aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Lando <ml636r@att.com>2017-02-19 12:35:04 +0200
committerMichael Lando <ml636r@att.com>2017-02-19 12:35:04 +0200
commitf5f13c4f6b6fe3b4d98e349dfd7db59339803436 (patch)
tree72caffc93fab394ffa3b761505775331f1c559b9
parent451a3400b76511393c62a444f588a4ed15f4a549 (diff)
push addional code
Change-Id: Ia427bb3460cda3a896f8faced2de69eaf3807b74 Signed-off-by: Michael Lando <ml636r@att.com>
-rw-r--r--openecomp-be/.gitignore13
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/pom.xml130
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/main/java/org/openecomp/sdcrests/action/rest/Actions.java206
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/main/java/org/openecomp/sdcrests/action/rest/mapping/MapActionToActionResponseDto.java42
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/main/java/org/openecomp/sdcrests/action/rest/services/ActionsImpl.java1212
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-types/pom.xml37
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-types/src/main/java/org/openecomp/sdcrests/action/types/ActionResponseDto.java149
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-types/src/main/java/org/openecomp/sdcrests/action/types/ActionVersionDto.java38
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-types/src/main/java/org/openecomp/sdcrests/action/types/ListResponseWrapper.java70
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/pom.xml22
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/pom.xml62
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/ApplicationConfiguration.java69
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/mapping/MapApplicationConfigEntityToApplicationConfigDto.java34
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/mapping/MapConfigurationDataToConfigurationDataDto.java34
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/services/ApplicationConfigurationImpl.java87
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-types/pom.xml17
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-types/src/main/java/org/openecomp/sdcrests/applicationconfiguration/types/ApplicationConfigDto.java43
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-types/src/main/java/org/openecomp/sdcrests/applicationconfiguration/types/ConfigurationDataDto.java50
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/pom.xml23
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/pom.xml183
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthenticationFilter.java115
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthorizationFilter.java71
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionLibraryPrivilege.java59
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/interceptors/DefaultOutput.java182
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/interceptors/EmptyOutputOutInterceptor.java63
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/interceptors/InternalEmptyObject.java34
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/listeners/OnboardingAppStartupListener.java43
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/resources/keyfile.txt27
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/beans-services.xml70
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/jetty-web.xml8
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/web.xml95
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/templates/markdown.hbs105
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/templates/operation.hbs73
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/templates/security.hbs88
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/templates/strapdown.html.hbs11
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/pom.xml47
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/RestConstants.java29
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/mapping/MapErrorCodeToDto.java34
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/mapping/MapErrorMessageToDto.java33
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/types/ErrorCodeDto.java53
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/types/ErrorMessageDto.java44
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/errors/DefaultExceptionMapper.java163
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/mapping/MappingBase.java104
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/versioning/types/VersioningAction.java28
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/wrappers/GenericCollectionWrapper.java107
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/wrappers/StringWrapperResponse.java42
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/resources/errorCodesToResponseStatusMapping.json9
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/pom.xml29
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/sequence-rest/pom.xml15
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/sequence-rest/src/main/java/org/openecomp/sdcrests/service/rest/Service.java24
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/sequence-rest/src/main/java/org/openecomp/sdcrests/service/rest/services/ServiceImpl.java26
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/pom.xml23
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/pom.xml144
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/Validation.java52
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/mapping/MapValidationFileResponseToValidationFileResponseDto.java34
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/services/ValidationImpl.java63
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-types/pom.xml32
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-types/src/main/java/org/openecomp/sdcrests/validation/types/ValidationFileResponseDto.java36
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/pom.xml24
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/pom.xml133
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/EntitlementPools.java105
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/FeatureGroups.java108
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/LicenseAgreements.java109
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/LicenseKeyGroups.java104
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/VendorLicenseModels.java111
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapChoiceOrOtherDtoToChoiceOrOther.java36
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapChoiceOrOtherToChoiceOrOtherDto.java35
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolEntityToEntitlementPoolEntityDto.java53
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolRequestDtoToEntitlementPoolEntity.java51
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapFeatureGroupDescriptorDtoToFeatureGroupEntity.java36
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapFeatureGroupEntityToFeatureGroupDescriptorDto.java35
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseAgreementDescriptorDtoToLicenseAgreementEntity.java38
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseAgreementEntityToLicenseAgreementDescriptorDto.java38
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto.java40
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseKeyGroupRequestDtoToLicenseKeyGroupEntity.java38
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapMultiChoiceOrOtherDtoToMultiChoiceOrOther.java36
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapMultiChoiceOrOtherToMultiChoiceOrOtherDto.java35
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapVendorLicenseModelRequestDtoToVendorLicenseModelEntity.java36
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapVersionedVendorLicenseModelToVendorLicenseModelEntityDto.java60
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/EntitlementPoolsImpl.java157
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/FeatureGroupsImpl.java169
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/LicenseAgreementsImpl.java186
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/LicenseKeyGroupsImpl.java159
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/VendorLicenseModelsImpl.java135
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/pom.xml30
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/ChoiceOrOtherDto.java75
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/EntitlementPoolEntityDto.java48
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/EntitlementPoolRequestDto.java144
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupDescriptorDto.java59
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupEntityDto.java69
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupModelDto.java66
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupRequestDto.java48
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupUpdateRequestDto.java48
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementDescriptorDto.java74
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementEntityDto.java51
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementModelDto.java47
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementRequestDto.java39
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementUpdateRequestDto.java38
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseKeyGroupEntityDto.java45
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseKeyGroupRequestDto.java74
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/MultiChoiceOrOtherDto.java79
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelActionRequestDto.java36
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelEntityDto.java85
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelRequestDto.java62
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/validation/ChoiceOrOtherSequenceProvider.java45
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/validation/MultiChoiceOrOtherSequenceProvider.java47
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/validation/OtherChoiceValidation.java24
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/pom.xml23
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/pom.xml144
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentProcesses.java168
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentUploads.java104
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Components.java142
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Networks.java107
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Nics.java144
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Processes.java151
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VendorSoftwareProducts.java193
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDataToComponentDto.java35
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentEntityToComponentDto.java37
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentRequestDtoToComponentEntity.java38
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapCompositionEntityResponseToDto.java47
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapCompositionEntityValidationDataToDto.java44
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapMibUploadStatusToDto.java33
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNetworkEntityToNetworkDto.java37
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNetworkRequestDtoToNetworkEntity.java37
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNetworkToNetworkDto.java33
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicEntityToNicDto.java37
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicRequestDtoToNicEntity.java37
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicToNicDto.java35
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapPackageInfoToPackageInfoDto.java42
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapProcessEntityToProcessEntityDto.java36
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapProcessRequestDtoToProcessEntity.java34
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapQuestionnaireResponseToQuestionnaireResponseDto.java35
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapUploadFileResponseToUploadFileResponseDto.java36
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapValidationResponseToDto.java90
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVersionedVendorSoftwareProductInfoToVspDetailsDto.java74
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDescriptionDtoToVspDetails.java56
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MspVspDetailsToVspCreationDto.java32
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentProcessesImpl.java144
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentUploadsImpl.java87
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentsImpl.java145
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/NetworksImpl.java115
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/NicsImpl.java140
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ProcessesImpl.java89
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VendorSoftwareProductsImpl.java228
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/pom.xml32
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDto.java35
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentRequestDto.java53
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/CompositionDataEntityDto.java24
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/CompositionEntityResponseDto.java51
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/CompositionEntityValidationDataDto.java65
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/MibUploadStatusDto.java46
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NetworkDto.java34
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NetworkRequestDto.java47
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NicDto.java43
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NicRequestDto.java52
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/PackageInfoDto.java124
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ProcessEntityDto.java42
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ProcessRequestDto.java47
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/QuestionnaireResponseDto.java42
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/QuestionnaireValidationResultDto.java42
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/TranslatedFileDataDto.java97
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/UploadFileResponseDto.java63
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ValidationResponseDto.java77
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VendorSoftwareProductAction.java29
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VersionSoftwareProductActionRequestDto.java33
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspCreationDto.java33
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspDescriptionDto.java115
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspDetailsDto.java97
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/CustomJsonValidator.java40
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/IsValidJson.java77
-rw-r--r--openecomp-be/api/pom.xml22
-rw-r--r--openecomp-be/backend/openecomp-sdc-action-manager/pom.xml87
-rw-r--r--openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/ActionManager.java66
-rw-r--r--openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/impl/ActionManagerImpl.java1217
-rw-r--r--openecomp-be/backend/openecomp-sdc-action-manager/src/test/java/org/openecomp/sdc/action/ActionTest.java1207
-rw-r--r--openecomp-be/backend/openecomp-sdc-action-manager/src/test/resources/test_artifact_file.txt2
-rw-r--r--openecomp-be/backend/openecomp-sdc-action-manager/src/test/resources/test_artifact_update_file.txt2
-rw-r--r--openecomp-be/backend/openecomp-sdc-action-manager/test-output/Default suite/Default test.html324
-rw-r--r--openecomp-be/backend/openecomp-sdc-action-manager/test-output/Default suite/Default test.xml53
-rw-r--r--openecomp-be/backend/openecomp-sdc-action-manager/test-output/Default suite/testng-failed.xml16
-rw-r--r--openecomp-be/backend/openecomp-sdc-action-manager/test-output/bullet_point.pngbin0 -> 356 bytes
-rw-r--r--openecomp-be/backend/openecomp-sdc-action-manager/test-output/collapseall.gifbin0 -> 157 bytes
-rw-r--r--openecomp-be/backend/openecomp-sdc-action-manager/test-output/emailable-report.html2
-rw-r--r--openecomp-be/backend/openecomp-sdc-action-manager/test-output/failed.pngbin0 -> 977 bytes
-rw-r--r--openecomp-be/backend/openecomp-sdc-action-manager/test-output/index.html1231
-rw-r--r--openecomp-be/backend/openecomp-sdc-action-manager/test-output/jquery-1.7.1.min.js4
-rw-r--r--openecomp-be/backend/openecomp-sdc-action-manager/test-output/junitreports/TEST-com.amdocs.asdc.action.ActionTest.xml53
-rw-r--r--openecomp-be/backend/openecomp-sdc-action-manager/test-output/navigator-bullet.pngbin0 -> 352 bytes
-rw-r--r--openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/Default test.properties1
-rw-r--r--openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/classes.html228
-rw-r--r--openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/groups.html3
-rw-r--r--openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/index.html6
-rw-r--r--openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/main.html2
-rw-r--r--openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/methods-alphabetical.html104
-rw-r--r--openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/methods-not-run.html2
-rw-r--r--openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/methods.html104
-rw-r--r--openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/reporter-output.html1
-rw-r--r--openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/testng.xml.html1
-rw-r--r--openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/toc.html30
-rw-r--r--openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/index.html9
-rw-r--r--openecomp-be/backend/openecomp-sdc-action-manager/test-output/passed.pngbin0 -> 1019 bytes
-rw-r--r--openecomp-be/backend/openecomp-sdc-action-manager/test-output/skipped.pngbin0 -> 967 bytes
-rw-r--r--openecomp-be/backend/openecomp-sdc-action-manager/test-output/testng-failed.xml16
-rw-r--r--openecomp-be/backend/openecomp-sdc-action-manager/test-output/testng-reports.css309
-rw-r--r--openecomp-be/backend/openecomp-sdc-action-manager/test-output/testng-reports.js122
-rw-r--r--openecomp-be/backend/openecomp-sdc-action-manager/test-output/testng-results.xml223
-rw-r--r--openecomp-be/backend/openecomp-sdc-action-manager/test-output/testng.css9
-rw-r--r--openecomp-be/backend/openecomp-sdc-application-config-manager/pom.xml55
-rw-r--r--openecomp-be/backend/openecomp-sdc-application-config-manager/src/main/java/org/openecomp/sdc/applicationconfig/ApplicationConfigManager.java35
-rw-r--r--openecomp-be/backend/openecomp-sdc-application-config-manager/src/main/java/org/openecomp/sdc/applicationconfig/impl/ApplicationConfigManagerImpl.java63
-rw-r--r--openecomp-be/backend/openecomp-sdc-application-config-manager/src/test/java/org/openecomp/sdc/applicationconfig/ApplicationConfigManagerTest.java64
-rw-r--r--openecomp-be/backend/openecomp-sdc-validation-manager/pom.xml78
-rw-r--r--openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/UploadValidationManager.java34
-rw-r--r--openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/errors/ValidationErrorCodes.java26
-rw-r--r--openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/errors/ValidationInvalidErrorBuilder.java75
-rw-r--r--openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/impl/UploadValidationManagerImpl.java161
-rw-r--r--openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/types/ValidationFileResponse.java36
-rw-r--r--openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/types/ValidationFileStatus.java26
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-license-manager/pom.xml103
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/VendorLicenseManager.java115
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerImpl.java558
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/ArtifactTestUtils.java252
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/EntitlementPoolTest.java275
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/FeatureGroupTest.java202
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/LicenseAgreementTest.java218
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/LicenseKeyGroupTest.java162
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/VendorLicenseModelTest.java402
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/VendorLicenseArtifactsServiceTest.java141
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/pom.xml147
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductManager.java173
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/CreatePackageForNonFinalVendorSoftwareProductErrorBuilder.java59
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/FileCreationErrorBuilder.java56
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/MibUploadErrorBuilder.java59
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/PackageInvalidErrorBuilder.java60
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/PackageNotFoundErrorBuilder.java71
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/TranslationFileCreationErrorBuilder.java60
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/UploadInvalidErrorBuilder.java82
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductErrorCodes.java48
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductInvalidErrorBuilder.java60
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductNotFoundErrorBuilder.java54
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java1567
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/CompositionDataExtractor.java386
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/CompositionEntityDataManager.java257
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/SchemaGenerator.java70
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/SchemaGeneratorConfig.java184
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/CompositionEntityResponse.java53
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/CompositionEntityValidationData.java122
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/ExtractCompositionDataContext.java204
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/LicensingData.java45
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/QuestionnaireResponse.java42
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/QuestionnaireValidationResult.java39
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/UploadFileResponse.java143
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/UploadFileStatus.java26
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/UploadFileStructure.java40
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/ValidationResponse.java157
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/VersionedVendorSoftwareProductInfo.java53
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/ComponentCompositionSchemaInput.java43
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/ComponentQuestionnaireSchemaInput.java42
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/MibUploadStatus.java51
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/NetworkCompositionSchemaInput.java43
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/NicCompositionSchemaInput.java55
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/SchemaTemplateContext.java26
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/SchemaTemplateInput.java25
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/util/CompilationUtil.java126
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/util/VendorSoftwareProductUtils.java254
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/ComponentProcessesTest.java46
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/ComponentsTest.java329
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/ComponentsUploadTest.java159
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/NetworksTest.java292
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/NicsTest.java346
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/ProcessesTest.java473
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/VSPCommon.java78
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/VSPFullTest.java194
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductManagerTest.java672
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/CompositionDataExtractorTest.java280
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/CompositionEntityDataManagerTest.java141
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/QuestionnaireSchemaTest.java64
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/QuestionnaireValidatorTest.java74
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/SchemaGeneratorTest.java244
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/tree/HeatTreeManagerTest.java102
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/tree/TreeBaseTest.java33
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/tree/UploadFileTest.java90
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/upload/HeatCleanup/HeatCleanupOnNewUploadTest.java167
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/upload/validation/UploadFileValidationTest.java199
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/emptyComposition/MANIFEST.json11
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/emptyComposition/ep-jsa_net.yaml21
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/componentsWithPort/ComponentsWithPortST.yaml428
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/fullComposition/MainServiceTemplate.yaml473
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/networks/MainServiceTemplate.yaml829
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/onlyComponents/OnlyComponentsST.yaml350
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/substitution/GlobalSubstitutionTypesServiceTemplate.yaml235
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/substitution/MainServiceTemplate.yaml139
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/substitution/nested1ServiceTemplate.yaml241
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/substitution/nested2ServiceTemplate.yaml135
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/AbstractSubstituteGlobalTypesServiceTemplate.yaml47
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/CinderVolumeGlobalTypesServiceTemplate.yaml176
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/CommonGlobalTypesServiceTemplate.yaml213
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/ContrailNetworkRuleGlobalTypeServiceTemplate.yaml117
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml71
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/GlobalSubstitutionTypesServiceTemplate.yaml93
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NativeTypesServiceTemplateServiceTemplate.yaml194
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronNetGlobalTypesServiceTemplate.yaml97
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronPortGlobalTypesServiceTemplate.yaml151
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronSecurityRulesGlobalTypesServiceTemplate.yaml116
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NovaServerGlobalTypesServiceTemplate.yaml249
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/fullComposition/MANIFEST.json17
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/fullComposition/hot-mog-0108-bs1271.env60
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/fullComposition/hot-mog-0108-bs1271.yml733
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/MANIFEST.json42
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/MMSC_Capacity_Line.yml3223
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/MMSC_Capacity_Line_1.env111
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/SG_ECA_MGMT.yaml76
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/cmaui.env17
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/cmaui.yml202
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/eca_oam.env20
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/eca_oam.yaml383
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/eca_oam_2.yaml383
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/sg_eca_mgmt.env7
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload/MANIFEST.json20
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload/create_stack.sh1
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload/vmme_small_create_fsb.env8
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload/vmme_small_create_fsb.yml54
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/MANIFEST.json29
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/create_stack.sh1
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/vmme_small.env97
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/vmme_small.yml661
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/vmme_small_create_fsb.env8
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/vmme_small_create_fsb.yml54
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/missingYml/MANIFEST.json20
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/missingYml/create_stack.sh1
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/missingYml/vmme_small_create_fsb.env8
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/HEAT.meta215
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/MANIFEST.json113
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/cloud-nimbus.sh12
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-oam-volumes_v1.0.env6
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-oam-volumes_v1.0.yaml45
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-oam_v1.0.env18
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-oam_v1.0.yaml109
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pcm-volumes_v1.0.env4
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pcm-volumes_v1.0.yaml28
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pcm_v1.0.env16
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pcm_v1.0.yaml80
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-ppd_v1.0.yaml286
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-ppd_v1.1.env35
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pps_v1.0.env11
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pps_v1.0.yaml121
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-psm_v1.0.env10
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-psm_v1.0.yaml199
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-swift-container_v1.0.env3
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-swift-container_v1.0.yaml30
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/mount_iso_script.sh34
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nested-oam_v1.0.yaml156
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nested-pcm_v1.0.yaml150
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nested-ppd_v1.0.yaml333
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nested-pps_v1.0.yaml99
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nested-psm_v1.0.yaml99
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nimbus-ethernet5
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nimbus-ethernet-gw6
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/notZipFile1
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/quesionnaire/invalidComponent.json34
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/quesionnaire/invalidNic.json36
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/quesionnaire/validComponent.json34
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/quesionnaire/validNic.json30
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/missing_manifest/input/heat_missing_from_manifast.yaml250
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/missing_manifest/input/mainValid.yaml250
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/missing_manifest/input/validHeat.yaml250
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_resource_group/MANIFEST.json17
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_resource_group/addOn.yml31
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_resource_group/nested.yml56
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_volume/MANIFEST.json16
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_volume/base_mobt.yaml26
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_volume/hot_mobt_volume_attach_nested.yaml28
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/valid_tree/input/MANIFEST.json39
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/valid_tree/input/heat_missing_from_manifast.yaml250
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/valid_tree/input/mainValid.yaml250
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/valid_tree/input/validHeat.yaml250
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/emptyZip.zipbin0 -> 22 bytes
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/missingManifestInZip.zipbin0 -> 397 bytes
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/710-ResourceGroup.zipbin0 -> 2811 bytes
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/MMSC.zipbin0 -> 21273 bytes
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/MNS OAM FW.zipbin0 -> 9111 bytes
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/VOTA.zipbin0 -> 41421 bytes
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/base_module_mns_oam.zipbin0 -> 11092 bytes
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/cmd-frwl-v302.zipbin0 -> 8239 bytes
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/GWv12.zipbin0 -> 9312 bytes
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/MNS OAM FW fix.zipbin0 -> 9199 bytes
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/base_module_mns_oam_fixed.zipbin0 -> 11073 bytes
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/cmd-frwl-v302.zipbin0 -> 8264 bytes
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/vDBE_fix_with_warr.zipbin0 -> 2752 bytes
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/vDNS.zipbin0 -> 3499 bytes
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/segw_heat_c3-base.zipbin0 -> 4026 bytes
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vDBE.zipbin0 -> 2750 bytes
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vDNS.zipbin0 -> 3480 bytes
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vDNS_21_8.zipbin0 -> 3480 bytes
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vProb.zipbin0 -> 33429 bytes
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vProbe_FE_081816.zipbin0 -> 33443 bytes
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vid_test_pcrf_base_template.zipbin0 -> 4223 bytes
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/zipFileWithFolder.zipbin0 -> 290 bytes
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/emptyComposition.zipbin0 -> 722 bytes
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/emptyZip.zipbin0 -> 22 bytes
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/fullComposition.zipbin0 -> 3905 bytes
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/invalidTypes.zipbin0 -> 16465 bytes
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/legalUpload.zipbin0 -> 1315 bytes
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/legalUpload2.zipbin0 -> 4622 bytes
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/missingYml.zipbin0 -> 838 bytes
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/nimbus.zipbin0 -> 17485 bytes
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/vDNS.zipbin0 -> 3480 bytes
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/withoutManifest.zipbin0 -> 970 bytes
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/zipFileWithFolder.zipbin0 -> 290 bytes
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withNetwork/MANIFEST.json21
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withNetwork/hot-mog-0108-bs1271.env60
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withNetwork/hot-mog-0108-bs1271.yml733
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withNetwork/network.yml733
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withNetwork/zip/withNetwork.zipbin0 -> 6442 bytes
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withoutManifest/create_stack.sh1
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withoutManifest/vmme_small_create_fsb.env8
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withoutManifest/vmme_small_create_fsb.yml54
-rw-r--r--openecomp-be/backend/pom.xml26
-rw-r--r--openecomp-be/configuration/pom.xml15
-rw-r--r--openecomp-be/lib/openecomp-common-lib/pom.xml46
-rw-r--r--openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/BaseErrorBuilder.java33
-rw-r--r--openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/CoreException.java39
-rw-r--r--openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/ErrorCategory.java64
-rw-r--r--openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/ErrorCode.java105
-rw-r--r--openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/ErrorCodeAndMessage.java88
-rw-r--r--openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/GeneralErrorBuilder.java53
-rw-r--r--openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/JsonMappingErrorBuilder.java53
-rw-r--r--openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/ValidationErrorBuilder.java68
-rw-r--r--openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/utils/AsdcCommon.java31
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/pom.xml48
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/ApplicationConfig.java35
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/ApplicationConfigFactory.java31
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/ApplicationConfigDao.java33
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/ApplicationConfigDaoFactory.java32
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/impl/ApplicationConfigDaoCassandraImpl.java115
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/impl/ApplicationConfigDaoFactoryImpl.java33
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/type/ApplicationConfigEntity.java79
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/impl/ApplicationConfigFactoryImpl.java34
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/impl/ApplicationConfigImpl.java74
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/type/ConfigurationData.java48
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/resources/factoryConfiguration.json4
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/resources/logback.xml90
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/test/java/org/openecomp/sdc/applicationconfig/dao/ApplicationConfigImplDaoTest.java88
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/test/resources/questionnaire/testTemplate.txt12
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-api/pom.xml31
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-api/src/main/java/org/openecomp/core/factory/api/AbstractFactory.java81
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-api/src/main/java/org/openecomp/core/factory/impl/AbstractFactoryBase.java212
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/pom.xml36
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/AbstractContextFactory.java27
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/FactoriesConfigImpl.java61
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/FactoryConfig.java46
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/api/AbstractComponentFactory.java105
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/api/FactoriesConfiguration.java29
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/pom.xml34
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/pom.xml40
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/dao/BaseDao.java36
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/dao/UniqueValueDao.java28
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/dao/UniqueValueDaoFactory.java30
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/dao/types/UniqueValueEntity.java58
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/nosqldb/api/NoSqlDb.java37
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/nosqldb/factory/NoSqlDbFactory.java34
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/util/UniqueValueUtil.java127
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/resources/cassandraStatements.json6
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/resources/factoryConfiguration.json4
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/pom.xml60
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/dao/impl/CassandraBaseDao.java50
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/dao/impl/UniqueValueCassandraDaoImpl.java65
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/dao/impl/UniqueValueDaoFactoryImpl.java33
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraNoSqlDbFactoryImpl.java43
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraNoSqlDbImpl.java104
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraSessionFactory.java124
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/util/CassandraUtils.java92
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/util/ConfigurationManager.java234
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/resources/configuration.yaml253
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/org/openecomp/core/nosqldb/NoSqlDbTest.java48
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/org/openecomp/core/utilities/Yaml/YamlUtilTest.java47
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/org/openecomp/core/utilities/json/JsonUtilTest.java13
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/testobjects/yaml/InnerP.java25
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/testobjects/yaml/Parameter.java68
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/testobjects/yaml/YamlFile.java37
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/pom.xml36
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/pom.xml82
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/CommonMethods.java555
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/file/FileContentHandler.java88
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/file/FileUtils.java286
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/json/JsonSchemaDataGenerator.java185
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/json/JsonUtil.java187
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/yaml/YamlUtil.java289
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/java/org/openecomp/core/utilities/json/JsonSchemaDataGeneratorTest.java50
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/java/org/openecomp/core/utilities/json/JsonUtilTest.java40
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json/a.json12
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json/a_invalid.json13
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json_schema/aSchema.json60
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json_schema/nicSchema.json118
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json_schema/schemaWithInvalidDefault.json67
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json_schema/schemaWithRefsAndDefaults.json71
-rw-r--r--openecomp-be/lib/openecomp-core-lib/pom.xml23
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/pom.xml59
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/DefinedHeatParameterTypes.java110
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/HeatBoolean.java96
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/FileData.java107
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/ManifestContent.java63
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/ManifestFile.java43
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Constraint.java78
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Environment.java35
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/GroupTypeValues.java49
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/HeatOrchestrationTemplate.java90
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/HeatPseudoParameters.java61
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/HeatResourcesTypes.java206
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Output.java42
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Parameter.java90
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/ParameterGroup.java53
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/ParameterType.java42
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/PolicyTypes.java61
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/PropertiesMapKeyTypes.java42
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Resource.java92
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/ResourceReferenceFunctions.java44
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/ResourceTypeToMessageString.java55
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/structure/Artifact.java105
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/structure/HeatStructureTree.java467
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/structure/ValidationStructureList.java40
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/ErrorCodes.java25
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/HeatConstants.java34
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/HeatStructureUtil.java261
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/manifest/ManifestUtil.java176
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/tree/HeatTreeManager.java298
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/tree/HeatTreeManagerUtil.java43
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/test/java/org/openecomp/sdc/heat/datatypes/model/EnvironmentTest.java38
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/test/java/org/openecomp/sdc/heat/datatypes/model/HeatOrchestrationTemplateTest.java122
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/test/resources/mock/model/envSettings.env36
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/test/resources/mock/model/testHeat.yml524
-rw-r--r--openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/pom.xml45
-rw-r--r--openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/ActionConstants.java104
-rw-r--r--openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/ActionArtifactDao.java34
-rw-r--r--openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/ActionArtifactDaoFactory.java31
-rw-r--r--openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/ActionDao.java51
-rw-r--r--openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/ActionDaoFactory.java31
-rw-r--r--openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/types/ActionArtifactEntity.java89
-rw-r--r--openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/types/ActionEntity.java224
-rw-r--r--openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/types/EcompComponentEntity.java73
-rw-r--r--openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/errors/ActionErrorConstants.java136
-rw-r--r--openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/errors/ActionException.java52
-rw-r--r--openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/errors/ActionExceptionMapper.java114
-rw-r--r--openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/errors/ActionExceptionResponse.java66
-rw-r--r--openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/logging/CategoryLogLevel.java29
-rw-r--r--openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/logging/StatusCode.java26
-rw-r--r--openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/Action.java255
-rw-r--r--openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionArtifact.java139
-rw-r--r--openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionArtifactProtection.java26
-rw-r--r--openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionLogResponseCode.java90
-rw-r--r--openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionRequest.java40
-rw-r--r--openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionStatus.java28
-rw-r--r--openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionSubOperation.java59
-rw-r--r--openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/EcompComponent.java104
-rw-r--r--openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/util/ActionUtil.java372
-rw-r--r--openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/resources/factoryConfiguration.json4
-rw-r--r--openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/pom.xml37
-rw-r--r--openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionArtifactDaoFactoryImpl.java33
-rw-r--r--openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionArtifactDaoImpl.java150
-rw-r--r--openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionDaoFactoryImpl.java33
-rw-r--r--openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionDaoImpl.java583
-rw-r--r--openecomp-be/lib/openecomp-sdc-action-lib/pom.xml25
-rw-r--r--openecomp-be/lib/openecomp-sdc-datatypes-lib/pom.xml38
-rw-r--r--openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/error/ErrorLevel.java25
-rw-r--r--openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/error/ErrorMessage.java91
-rw-r--r--openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/model/AsdcModel.java24
-rw-r--r--openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/model/heat/ForbiddenHeatResourceTypes.java56
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/pom.xml46
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/EnrichmentArtifactsServiceFactory.java33
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/EnrichmentConstants.java29
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/api/EnrichmentManager.java43
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/enrichmentartifacts/EnrichmentArtifactsService.java29
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/factory/EnrichmentManagerFactory.java32
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/CeilometerInfo.java71
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/ComponentArtifactType.java34
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/ComponentCeilometerInfo.java36
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/ComponentMibInfo.java45
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/EntityInfo.java27
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/MibInfo.java45
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/resources/factoryConfiguration.json4
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/pom.xml90
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/main/java/org/openecomp/sdc/enrichment/EnrichmentArtifactsServiceFactoryImpl.java34
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/main/java/org/openecomp/sdc/enrichment/enrichmentartifacts/EnrichmentArtifactsServiceImpl.java61
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/main/java/org/openecomp/sdc/enrichment/impl/EnrichmentManagerFactoryImpl.java34
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/main/java/org/openecomp/sdc/enrichment/impl/EnrichmentManagerImpl.java84
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/java/org/openecomp/sdc/enrichment/impl/EnrichmentManagerImplTest.java245
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/OnlyComponentsST.yaml350
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/OnlyComponentsST_01.yaml350
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/VariouseST.yaml363
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/expectedOutput/OnlyComponentsST.yaml550
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/expectedOutput/OnlyComponentsST_01.yaml550
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/expectedOutput/VariouseST.yaml363
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/onlyComponents/OnlyComponentsST.yaml350
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/onlyComponents/OnlyComponentsST_01.yaml350
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/onlyComponents/expectedOutput/OnlyComponentsST.yaml550
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/onlyComponents/expectedOutput/OnlyComponentsST_01.yaml550
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/AbstractSubstituteGlobalTypesServiceTemplate.yaml47
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/CinderVolumeGlobalTypesServiceTemplate.yaml176
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/CommonGlobalTypesServiceTemplate.yaml213
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/ContrailNetworkRuleGlobalTypeServiceTemplate.yaml117
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml71
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/GlobalSubstitutionTypesServiceTemplate.yaml93
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NativeTypesServiceTemplateServiceTemplate.yaml194
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronNetGlobalTypesServiceTemplate.yaml97
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronPortGlobalTypesServiceTemplate.yaml151
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronSecurityRulesGlobalTypesServiceTemplate.yaml116
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NovaServerGlobalTypesServiceTemplate.yaml249
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/pom.xml102
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/EnrichmentInfo.java63
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/factory/EnricherHandlerFactory.java32
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/EnricherHandlerFactoryImpl.java33
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/EnricherHandlerImpl.java89
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/external/artifact/ExternalArtifactEnricher.java106
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/CeilometerEnricher.java112
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/ComponentInfo.java47
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/SnmpEnricher.java38
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/ToscaEnricher.java73
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/inter/Enricher.java45
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/inter/EnricherHandler.java41
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/resources/factoryConfiguration.json3
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/pom.xml41
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/pom.xml49
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceArtifactDao.java28
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceArtifactDaoFactory.java32
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceModelDao.java42
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceModelDaoFactory.java32
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceTemplateDao.java26
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceTemplateDaoFactory.java32
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceArtifactDao.java44
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceArtifactDaoFactory.java32
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceArtifactDaoInter.java44
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceModelDao.java40
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceModelDaoFactory.java31
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceTemplateDao.java44
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceTemplateDaoFactory.java32
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceTemplateDaoInter.java46
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/EnrichedServiceArtifactEntity.java136
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/EnrichedServiceTemplateEntity.java154
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceArtifact.java29
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceArtifactEntity.java136
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceElement.java77
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceElementEntity.java31
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceTemplate.java38
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceTemplateEntity.java154
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/resources/factoryConfiguration.json8
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-core/pom.xml65
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-core/src/main/java/org/openecomp/sdc/model/impl/AbstractServiceModelDao.java191
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/pom.xml61
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceArtifactDaoCassandraFactoryImpl.java36
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceArtifactDaoCassandraImpl.java137
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceModelDaoFactoryImpl.java34
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceModelDaoImpl.java44
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceTemplateDaoCassandraFactoryImpl.java36
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceTemplateDaoCassandraImpl.java147
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceArtifactDaoCassandraFactoryImpl.java34
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceArtifactDaoCassandraImpl.java139
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceModelDaoFactoryImpl.java34
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceModelDaoImpl.java38
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceTemplateDaoCassandraFactoryImpl.java34
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceTemplateDaoCassandraImpl.java145
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/pom.xml43
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/pom.xml43
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/src/main/java/org/openecomp/core/translator/api/HeatToToscaTranslator.java48
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/src/main/java/org/openecomp/core/translator/datatypes/TranslatorOutput.java48
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/src/main/java/org/openecomp/core/translator/factory/HeatToToscaTranslatorFactory.java33
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/src/main/resources/factoryConfiguration.json3
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/pom.xml89
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/AttachedResourceId.java65
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/ResourceReferenceType.java25
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/to/FileDataCollection.java123
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/to/ResourceFileDataAndIDs.java70
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/to/TranslateTo.java132
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/to/TranslatedHeatResource.java49
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/impl/heattotosca/HeatToToscaTranslatorFactoryImpl.java34
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/impl/heattotosca/HeatToToscaTranslatorImpl.java134
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/Constants.java60
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/HeatToToscaUtil.java503
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/ResourceTranslation.java37
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/ResourceTranslationFactory.java107
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/TranslationContext.java172
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/TranslationService.java344
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/IncorrectResourceReferenceErrorBuilder.java51
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/InvalidPropertyValueErrorBuilder.java47
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/MissingMandatoryPropertyErrorBuilder.java43
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/NotInSyncNumberOfInterfacesErrorBuilder.java44
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/ReferenceToUnsupportedResourceErrorBuilder.java52
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/ResourceNotFoundInHeatFileErrorBuilder.java52
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/TranslatorErrorCodes.java31
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/AbstractSubstituteGlobalType.java167
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/CinderVolumeGlobalType.java242
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/CommonGlobalTypes.java500
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailAbstractSubstituteGlobalType.java196
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailComputeGlobalType.java128
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailNetworkRuleGlobalType.java227
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailPortGlobalType.java107
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailV2NetworkRuleGlobalType.java274
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailV2VirtualMachineInterfaceGlobalType.java136
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailV2VirtualNetworkGlobalType.java239
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailVirtualNetworkGlobalType.java134
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/GlobalTypesGenerator.java128
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/GlobalTypesUtil.java69
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/NeutronNetGlobalType.java143
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/NeutronPortGlobalType.java203
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/NeutronSecurityRulesGlobalType.java175
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/NovaServerGlobalType.java307
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/ContrailTranslationHelper.java65
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/NameExtractorService.java33
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/PropertyRegexMatcher.java69
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/VolumeTranslationHelper.java172
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/impl/NameExtractorServiceImpl.java95
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/BaseResourceConnection.java174
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ContrailV2VmInterfaceToNetResourceConnection.java139
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/NovaAndPortResourceConnectionHelper.java106
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/NovaToVolResourceConnection.java228
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/PortToNetResourceConnection.java200
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationBase.java456
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationCinderVolumeAttachmentImpl.java202
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationCinderVolumeImpl.java77
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailAttachPolicyImpl.java141
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailNetworkPolicyImpl.java53
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailServiceInstanceImpl.java663
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailServiceTemplateImpl.java100
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailV2NetworkPolicyImpl.java49
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailV2VirtualNetworkImpl.java209
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailV2VmInterfaceImpl.java126
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailVirtualNetworkImpl.java51
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationDefaultImpl.java41
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNestedImpl.java781
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronNetImpl.java52
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronPortImpl.java233
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronSecurityGroupImpl.java47
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronSubnetImpl.java170
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNovaServerGroupsImpl.java119
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNovaServerImpl.java419
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationResourceGroupImpl.java202
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/SecurityRulesToPortResourceConnection.java203
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaFunctionConverter.java410
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaParameterConverter.java271
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaPropertyConverter.java146
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/resources/heatToToscaMapping.json298
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/TestUtils.java43
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/multi/Translate_Heat_Nested_Multi.java17
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/nestedvolumelocal/NestedVolumelocal.java17
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/nestedvolumeseperatefile/NestedVolumeSeperateFile.java17
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/recursive/TranslateHeatNestedRecursiveTest.java43
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/reusenestedfrommultibase/Translate_Heat_Nested_From_Multi_Base.java18
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/separatevol/NestedAndSeparateVolTranslationTest.java22
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/single/TranslateHeatNestedSingle.java17
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/outputs/HeatOutputConversionTest.java50
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/parameters/HeatParameterConversionTest.java54
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/resources/ContrailNetworkRuleTest.java18
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/resources/OSContrailVirtualNetworkTest.java18
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/resources/OSNeutronNetTest.java17
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/resources/OSNovaServerTest.java17
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/sharedresource/HeatSharedResourceTest.java19
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/GlobalTypesGeneratorTest.java18
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/fullvfexample/hotmog/HotMogTranslationTest.java17
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/fullvfexample/vmmesmall/VmmeSmallTranslationTest.java17
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/helper/impl/NameExtractorServiceImplTest.java118
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/BaseResourceTranslationTest.java130
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ContrailV2VMInterfaceToNetResourceConnectionTest.java46
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/DependsOnResourceBaseTranslationlTest.java15
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/MultipleHeatTranslationTest.java31
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/NovaToVolResourceConnectionTest.java91
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/PortToContrailV2VirtualNetworkResourceConnectionTest.java45
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/PortToNetResourceConnectionTest.java38
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationCinderVolumeAttachmentImplTest.java52
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationCinderVolumeImplTest.java15
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailServiceInstanceImplTest.java72
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailServiceTemplateImplTest.java55
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailV2Test.java56
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailV2VMInterfaceImplTest.java36
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronPortImplTest.java17
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronSecurityGroupImplTest.java19
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNovaServerGroupsImplTest.java16
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationResourceGroupImplTest.java110
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/SecurityGroupToNovaResourceConnectionTest.java24
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/SecurityRulesToPortResourceConnectionTest.java55
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaFunctionConverterTest.java68
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/ep-jsa-si.env14
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/ep-jsa-si.yaml76
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/ep-jsa_net.env4
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/ep-jsa_net.yaml26
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/master-jsa.env6
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/master-jsa.yaml57
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml236
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/expectedoutputfiles/MainServiceTemplate.yaml240
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml207
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/expectedoutputfiles/nested-pcm_v0.1_2ServiceTemplate.yaml193
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/MANIFEST.json30
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/hot-nimbus-pcm_v0.4.env14
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/hot-nimbus-pcm_v0.4.yaml82
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/hot-nimbus-pcm_v0.4_2.yaml79
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/nested-pcm_v0.1.yaml114
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/nested-pcm_v0.1_2.yaml120
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/nimbus-ethernet0
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml166
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/expectedoutputfiles/MainServiceTemplate.yaml240
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/expectedoutputfiles/mvs.nested.heatServiceTemplate.yaml320
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/inputs/MANIFEST.json19
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/inputs/mvs.nested.heat.yaml165
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/inputs/mvs.vfmodule.heat.yaml158
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml267
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/expectedoutputfiles/MainServiceTemplate.yaml241
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/expectedoutputfiles/nested2levelServiceTemplate.yaml175
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/expectedoutputfiles/nestedServiceTemplate.yaml217
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/inputs/MANIFEST.json27
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/inputs/addOn.yml26
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/inputs/base.yml58
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/inputs/nested.yml65
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/inputs/nested2level.yml59
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml472
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/expectedoutputfiles/MainServiceTemplate.yaml241
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/expectedoutputfiles/nested2levelServiceTemplate.yaml217
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/expectedoutputfiles/nested3levelServiceTemplate.yaml175
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/expectedoutputfiles/nestedServiceTemplate.yaml247
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/MANIFEST.json32
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/addOn.yml26
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/base.yml58
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/nested.yml65
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/nested2level.yml65
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/nested3level.yml59
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml79
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/expectedoutputfiles/MainServiceTemplate.yaml65
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml91
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/inputs/MANIFEST.json14
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/inputs/hot-nimbus-pcm_v0.4.yaml22
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/inputs/nested-pcm_v0.1.yaml29
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml79
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/expectedoutputfiles/MainServiceTemplate.yaml72
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml91
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/inputs/MANIFEST.json17
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/inputs/hot-nimbus-pcm_v0.4.yaml23
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/inputs/nested-pcm_v0.1.yaml31
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/inputs/volume.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml330
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/expectedoutputfiles/MainServiceTemplate.yaml240
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml291
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/expectedoutputfiles/nested-pcm_v0.1_2ServiceTemplate.yaml205
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/MANIFEST.json26
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/hot-nimbus-pcm_v0.4.env14
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/hot-nimbus-pcm_v0.4.yaml82
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/hot-nimbus-pcm_v0.4_2.yaml79
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/nested-pcm_v0.1.yaml138
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/nested-pcm_v0.1_2.yaml110
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml161
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/expectedoutputfiles/MainServiceTemplate.yaml569
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/expectedoutputfiles/mvs.nested.heatServiceTemplate.yaml254
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/inputs/MANIFEST.json19
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/inputs/mvs.nested.heat.yaml129
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/inputs/mvs.vfmodule.heat.yaml228
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupInvalid/inputs/MANIFEST.json19
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupInvalid/inputs/mvs.nested.heat.yaml129
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupInvalid/inputs/mvs.vfmodule.heat.yaml166
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml153
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/expectedoutputfiles/MainServiceTemplate.yaml246
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/expectedoutputfiles/dns_nested_01ServiceTemplate.yaml249
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/MANIFEST.json37
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/base_dns.env8
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/base_dns.yaml43
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/dns_az_01.env21
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/dns_az_01.yaml94
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/dns_nested_01.yaml127
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/nimbus-willows-2.pem27
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml161
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/expectedoutputfiles/MainServiceTemplate.yaml223
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/expectedoutputfiles/mvs.nested.heatServiceTemplate.yaml254
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/inputs/MANIFEST.json19
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/inputs/mvs.nested.heat.yaml129
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/inputs/mvs.vfmodule.heat.yaml163
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml166
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/expectedoutputfiles/MainServiceTemplate.yaml195
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/expectedoutputfiles/mvs.nested.heatServiceTemplate.yaml320
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/inputs/MANIFEST.json19
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/inputs/mvs.nested.heat.yaml165
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/inputs/mvs.vfmodule.heat.yaml105
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml137
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/expectedoutputfiles/MainServiceTemplate.yaml216
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml207
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/inputs/MANIFEST.json23
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/inputs/hot-nimbus-pcm_v0.4.env14
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/inputs/hot-nimbus-pcm_v0.4.yaml82
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/inputs/hot-nimbus-pcm_v0.4_2.yaml71
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/inputs/nested-pcm_v0.1.yaml114
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml137
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/expectedoutputfiles/MainServiceTemplate.yaml236
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml207
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/inputs/MANIFEST.json20
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/inputs/hot-nimbus-pcm_v0.4.env14
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/inputs/hot-nimbus-pcm_v0.4.yaml94
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/inputs/nested-pcm_v0.1.yaml114
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/outputs/expectedoutputfiles/MainServiceTemplate.yaml86
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/outputs/inputs/MANIFEST.json11
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/outputs/inputs/outputs.yaml48
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/parameters/expectedoutputfiles/MainServiceTemplate.yaml181
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/parameters/inputs/MANIFEST.json17
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/parameters/inputs/parameters.env6
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/parameters/inputs/parameters.yaml101
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_Network_Rule/expectedoutputfiles/MainServiceTemplate.yaml197
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_Network_Rule/inputs/MANIFEST.json12
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_Network_Rule/inputs/network_policy_chain.yaml117
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/expectedoutputfiles/MainServiceTemplate.yaml1308
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/inputs/MANIFEST.json21
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/inputs/nimbus-ethernet.sh0
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/inputs/vmme_small.env97
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/inputs/vmme_small.yml722
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Neutron_Net/expectedoutputfiles/MainServiceTemplate.yaml219
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Neutron_Net/inputs/MANIFEST.json17
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Neutron_Net/inputs/ep-jsa_net.env4
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Neutron_Net/inputs/ep-jsa_net.yaml135
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/expectedoutputfiles/MainServiceTemplate.yaml602
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/inputs/MANIFEST.json25
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/inputs/ep-jsa_net.env4
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/inputs/ep-jsa_net.yaml411
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/inputs/nimbus-ethernet0
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/inputs/nimbus-ethernet-gw0
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/sharedresources/expectedoutputfiles/MainServiceTemplate.yaml95
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/sharedresources/inputs/MANIFEST.json12
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/sharedresources/inputs/sharedDefinitionOutParam.yaml45
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/expectedOutput/validationOutput.json1
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/MANIFEST.json83
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/MMSC_Capacity_Line.yml3234
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/MMSC_Capacity_Line_1.env111
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/NETWORK_OUT.yaml76
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/SG_ECA_MGMT.yaml81
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/VOLUME.yaml76
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/VOLUME_OUT.yaml76
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/art.sh1
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/cmaui.env15
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/cmaui.yml179
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/cmaui_net.yaml76
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/eca_oam.env20
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/eca_oam.yaml453
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/eca_oam_nested.yaml406
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/nested1.yaml430
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/nested2.yaml431
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/network_out.env7
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/sg_eca_mgmt.env7
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/volume.env7
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/volume_out.env7
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/expectedOutput/MainServiceTemplate.yaml4518
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/MANIFEST.json37
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/MMSC_Capacity_Line.yml3219
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/MMSC_Capacity_Line_1.env111
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/SG_ECA_MGMT.yaml76
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/cmaui.env15
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/cmaui.yml171
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/eca_oam.env20
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/eca_oam.yaml379
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/sg_eca_mgmt.env7
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/expectedOutput/GlobalSubstitutionTypesServiceTemplate.yaml347
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/expectedOutput/MainServiceTemplate.yaml4193
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/expectedOutput/eca_oamServiceTemplate.yaml569
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/MANIFEST.json37
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/MMSC_Capacity_Line.yml3219
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/MMSC_Capacity_Line_1.env111
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/SG_ECA_MGMT.yaml76
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/cmaui.env15
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/cmaui.yml171
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/eca_oam.env20
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/eca_oam.yaml407
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/sg_eca_mgmt.env7
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_MultiPolicy_single_net_translation/expectedoutputfiles/MainServiceTemplate.yaml305
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_MultiPolicy_single_net_translation/inputfiles/MANIFEST.json12
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_MultiPolicy_single_net_translation/inputfiles/main.yml223
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_Multi_net_single_policy_translation/expectedoutputfiles/MainServiceTemplate.yaml291
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_Multi_net_single_policy_translation/inputfiles/MANIFEST.json12
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_Multi_net_single_policy_translation/inputfiles/main.yml203
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/invalid_policy_resource_type/expectedoutputfiles/MainServiceTemplate.yaml193
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/invalid_policy_resource_type/inputfiles/MANIFEST.json12
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/invalid_policy_resource_type/inputfiles/main.yml153
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/simple/expectedoutputfiles/MainServiceTemplate.yaml225
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/simple/inputfiles/MANIFEST.json12
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/simple/inputfiles/main.yml153
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/multi/expectedoutputfiles/MainServiceTemplate.yaml190
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/multi/inputfiles/MANIFEST.json17
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/multi/inputfiles/addOn.yml72
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/multi/inputfiles/main.yml28
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml117
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/expectedoutputfiles/MainServiceTemplate.yaml81
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/expectedoutputfiles/nestedServiceTemplate.yaml181
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/inputfiles/MANIFEST.json17
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/inputfiles/main.yml27
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/inputfiles/nested.yml68
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml254
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/expectedoutputfiles/MainServiceTemplate.yaml152
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/expectedoutputfiles/nested1ServiceTemplate.yaml279
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/expectedoutputfiles/nested2ServiceTemplate.yaml146
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles/MANIFEST.json27
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles/addOn.yml32
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles/main.yml29
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles/nested1.yml110
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles/nested2.yml48
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/baseResourceTranslation/expectedoutputfiles/MainServiceTemplate.yaml215
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/baseResourceTranslation/inputfiles/MANIFEST.json11
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/baseResourceTranslation/inputfiles/hot_template.yml131
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/cinder_volume_translation/expectedoutputfiles/MainServiceTemplate.yaml131
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/cinder_volume_translation/inputfiles/MANIFEST.json11
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/cinder_volume_translation/inputfiles/hot_template.yml79
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml83
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/expectedoutputfiles/MainServiceTemplate.yaml401
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/expectedoutputfiles/service_instance_1ServiceTemplate.yaml407
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/expectedoutputfiles/service_instance_2ServiceTemplate.yaml319
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/inputfiles/MANIFEST.json12
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/inputfiles/OCS-fw.yml213
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml64
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/expectedoutputfiles/MainServiceTemplate.yaml300
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/expectedoutputfiles/service_instanceServiceTemplate.yaml411
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/inputfiles/MANIFEST.json17
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/inputfiles/lcp1_mss.oam-fw_si.yaml153
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/inputfiles/lcp1_mss.oam-fw_si_with_comments.env26
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml64
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/expectedoutputfiles/MainServiceTemplate.yaml441
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/expectedoutputfiles/service_instance_1ServiceTemplate.yaml407
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/expectedoutputfiles/service_instance_2ServiceTemplate.yaml407
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/inputfiles/MANIFEST.json12
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/inputfiles/OCS-fw.yml213
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml71
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/expectedoutputfiles/MainServiceTemplate.yaml407
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/expectedoutputfiles/service_instanceServiceTemplate.yaml451
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/inputfiles/MANIFEST.json17
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/inputfiles/OCS-fw.yml173
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/inputfiles/network_base.yml47
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml154
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/expectedoutputfiles/MainServiceTemplate.yaml90
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/expectedoutputfiles/OCS-fwServiceTemplate.yaml294
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/expectedoutputfiles/service_instanceServiceTemplate.yaml275
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/inputfiles/MANIFEST.json16
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/inputfiles/OCS-fw.yml163
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/inputfiles/main.yml30
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/listNet/expectedoutputfiles/MainServiceTemplate.yaml265
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/listNet/inputfiles/MANIFEST.json11
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/listNet/inputfiles/hot_template.yml177
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/oneNet/expectedoutputfiles/MainServiceTemplate.yaml203
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/oneNet/inputfiles/MANIFEST.json11
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/oneNet/inputfiles/hot_template.yml128
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/AbstractSubstituteGlobalTypesServiceTemplate.yaml88
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/CinderVolumeGlobalTypesServiceTemplate.yaml178
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/CommonGlobalTypesServiceTemplate.yaml354
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml166
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailComputeGlobalTypesServiceTemplate.yaml89
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailNetworkRuleGlobalTypeServiceTemplate.yaml131
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailPortGlobalTypesServiceTemplate.yaml64
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailV2NetworkRuleGlobalTypeServiceTemplate.yaml156
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml69
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailV2VirtualNetworkGlobalTypeServiceTemplate.yaml139
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml84
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/MainServiceTemplate.yaml196
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/NativeTypesServiceTemplateServiceTemplate.yaml205
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/NeutronNetGlobalTypesServiceTemplate.yaml97
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/NeutronPortGlobalTypesServiceTemplate.yaml151
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/NeutronSecurityRulesGlobalTypesServiceTemplate.yaml116
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/NovaServerGlobalTypesServiceTemplate.yaml249
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/inputfiles/MANIFEST.json11
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/inputfiles/hot_template.yml122
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-mog-0108-bs1271/expectedoutputfiles/MainServiceTemplate.yaml1459
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-mog-0108-bs1271/inputfiles/MANIFEST.json17
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-mog-0108-bs1271/inputfiles/hot-mog-0108-bs1271.env60
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-mog-0108-bs1271/inputfiles/hot-mog-0108-bs1271.yml733
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/MANIFEST.json99
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/cloud-nimbus.sh12
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-oam-volumes_v1.0.env6
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-oam-volumes_v1.0.yaml45
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-oam_v1.0.env18
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-oam_v1.0.yaml109
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pcm-volumes_v1.0.env4
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pcm-volumes_v1.0.yaml28
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pcm_v1.0.env16
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pcm_v1.0.yaml80
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-ppd_v1.0.yaml286
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-ppd_v1.1.env35
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pps_v1.0.env11
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pps_v1.0.yaml121
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-psm_v1.0.env10
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-psm_v1.0.yaml199
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nested-oam_v1.0.yaml156
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nested-pcm_v1.0.yaml150
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nested-ppd_v1.0.yaml333
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nested-pps_v1.0.yaml99
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nested-psm_v1.0.yaml99
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nimbus-ethernet5
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nimbus-ethernet-gw6
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/GlobalSubstitutionTypesServiceTemplate.yaml642
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/MainServiceTemplate.yaml1646
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/nested-oam_v1.0ServiceTemplate.yaml225
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/nested-pcm_v1.0ServiceTemplate.yaml216
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/nested-ppd_v1.0ServiceTemplate.yaml464
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/nested-pps_v1.0ServiceTemplate.yaml160
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/nested-psm_v1.0ServiceTemplate.yaml160
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_port_translation/expectedoutputfiles/MainServiceTemplate.yaml115
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_port_translation/inputfiles/MANIFEST.json11
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_port_translation/inputfiles/hot_template.yml49
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_security_group_translation/expectedoutputfiles/MainServiceTemplate.yaml169
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_security_group_translation/inputfiles/MANIFEST.json11
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_security_group_translation/inputfiles/hot_template.yml57
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novaservergroups/expectedoutputfiles/MainServiceTemplate.yaml603
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novaservergroups/inputfiles/MANIFEST.json11
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novaservergroups/inputfiles/hot_template.yml383
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml187
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/expectedoutputfiles/MainServiceTemplate.yaml194
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/expectedoutputfiles/nestedServiceTemplate.yaml279
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/inputfiles/MANIFEST.json24
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/inputfiles/a_vol.yml32
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/inputfiles/main.yml77
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/inputfiles/nested.yml170
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multiconnection/expectedoutputfiles/MainServiceTemplate.yaml276
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multiconnection/inputfiles/MANIFEST.json17
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multiconnection/inputfiles/addOn.yml168
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multiconnection/inputfiles/main.yml31
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multinotconnected/expectedoutputfiles/MainServiceTemplate.yaml314
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multinotconnected/inputfiles/MANIFEST.json17
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multinotconnected/inputfiles/addOn.yml171
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multinotconnected/inputfiles/main.yml128
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml109
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/expectedoutputfiles/MainServiceTemplate.yaml76
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/expectedoutputfiles/nestedServiceTemplate.yaml150
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/inputfiles/MANIFEST.json17
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/inputfiles/main.yml26
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/inputfiles/nested.yml55
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml109
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/expectedoutputfiles/MainServiceTemplate.yaml146
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/expectedoutputfiles/nestedServiceTemplate.yaml150
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/inputfiles/MANIFEST.json17
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/inputfiles/main.yml64
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/inputfiles/nested.yml55
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml158
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/expectedoutputfiles/MainServiceTemplate.yaml114
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/expectedoutputfiles/nestedServiceTemplate.yaml212
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/inputfiles/MANIFEST.json22
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/inputfiles/addOn.yml30
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/inputfiles/main.yml32
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/inputfiles/nested.yml87
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml158
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/expectedoutputfiles/MainServiceTemplate.yaml181
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/expectedoutputfiles/nestedServiceTemplate.yaml212
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/inputfiles/MANIFEST.json22
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/inputfiles/addOn.yml30
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/inputfiles/main.yml70
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/inputfiles/nested.yml87
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumemulticonnection/expectedoutputfiles/MainServiceTemplate.yaml326
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumesharednestedconnection/expectedoutputfiles/MainServiceTemplate.yaml104
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumesharednestedconnection/inputfiles/addOn.yml30
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/multi/expectedoutputfiles/MainServiceTemplate.yaml143
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/multi/inputfiles/MANIFEST.json17
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/multi/inputfiles/addOn.yml48
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/multi/inputfiles/main.yml20
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml106
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/expectedoutputfiles/MainServiceTemplate.yaml225
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/expectedoutputfiles/nestedServiceTemplate.yaml145
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/inputfiles/MANIFEST.json17
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/inputfiles/main.yml140
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/inputfiles/nested.yml45
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml251
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/expectedoutputfiles/MainServiceTemplate.yaml334
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/expectedoutputfiles/nested1ServiceTemplate.yaml252
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/expectedoutputfiles/nested2ServiceTemplate.yaml146
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles/MANIFEST.json27
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles/addOn.yml32
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles/main.yml174
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles/nested1.yml86
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles/nested2.yml48
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/multi/expectedoutputfiles/MainServiceTemplate.yaml143
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/multi/inputfiles/MANIFEST.json17
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/multi/inputfiles/addOn.yml48
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/multi/inputfiles/main.yml20
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml134
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/expectedoutputfiles/MainServiceTemplate.yaml110
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/expectedoutputfiles/nestedServiceTemplate.yaml203
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/inputfiles/MANIFEST.json17
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/inputfiles/main.yml42
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/inputfiles/nested.yml67
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml251
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/expectedoutputfiles/MainServiceTemplate.yaml172
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/expectedoutputfiles/nested1ServiceTemplate.yaml252
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/expectedoutputfiles/nested2ServiceTemplate.yaml146
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/inputfiles/MANIFEST.json27
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/inputfiles/addOn.yml38
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/inputfiles/main.yml39
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/inputfiles/nested1.yml86
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/inputfiles/nested2.yml48
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml106
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/expectedoutputfiles/MainServiceTemplate.yaml85
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/expectedoutputfiles/nestedServiceTemplate.yaml145
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/inputfiles/MANIFEST.json17
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/inputfiles/main.yml31
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/inputfiles/nested.yml45
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml177
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/expectedoutputfiles/MainServiceTemplate.yaml131
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/expectedoutputfiles/nested1ServiceTemplate.yaml252
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/inputfiles/MANIFEST.json22
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/inputfiles/addOn.yml32
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/inputfiles/main.yml29
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/inputfiles/nested1.yml86
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/expectedoutputfiles/MainServiceTemplate.yaml634
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles/MANIFEST.json27
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles/addOn1.yml57
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles/addOn2.yml57
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles/addOn3.yml67
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles/main.yml311
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/expectedoutputfiles/MainServiceTemplate.yaml1077
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_QRouterCloudConfig39
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_QRouterTemplate.yaml216
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vLBAgentCloudConfig53
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vLBAgentTemplate.yaml303
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vLBCloudConfig41
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vLBTemplate.yaml287
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vProbeCloudConfig50
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vProbeTemplate.yaml308
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEBase_Module.env91
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEBase_Module.yaml670
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/MANIFEST.json89
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/call_home.py97
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/check_availability.py34
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/qrouterdependencies.json35
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/register_status.py126
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/vlbagentdependencies_with_vLB.json46
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/vlbagentdependencies_without_vLB.json39
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/vlbdependencies.json43
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/vprobedependencies.json49
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/wait_for_resources.py84
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectionmulti/expectedoutputfiles/MainServiceTemplate.yaml340
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectionmulti/inputfiles/MANIFEST.json17
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectionmulti/inputfiles/addOn.yml72
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectionmulti/inputfiles/main.yml58
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/expectedoutputfiles/MainServiceTemplate.yaml222
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/expectedoutputfiles/nestedServiceTemplate.yaml175
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/inputfiles/MANIFEST.json17
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/inputfiles/main.yml58
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/inputfiles/nested.yml58
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/expectedoutputfiles/MainServiceTemplate.yaml241
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/expectedoutputfiles/nestedServiceTemplate.yaml175
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/inputfiles/MANIFEST.json22
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/inputfiles/addOn.yml26
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/inputfiles/main.yml58
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/inputfiles/nested.yml59
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnectionmulti/expectedoutputfiles/MainServiceTemplate.yaml332
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportlinking/expectedoutputfiles/MainServiceTemplate.yaml231
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportlinking/inputfiles/MANIFEST.json22
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml119
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/expectedoutputfiles/MainServiceTemplate.yaml243
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/expectedoutputfiles/nestedServiceTemplate.yaml174
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/inputfiles/MANIFEST.json22
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/inputfiles/addOn.yml31
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/inputfiles/main.yml58
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/inputfiles/nested.yml58
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/expectedoutputfiles/MainServiceTemplate.yaml1267
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/inputfiles/MANIFEST.json27
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/inputfiles/vmme_small.env97
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/inputfiles/vmme_small.yml644
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/inputfiles/vmme_small_create_fsb.env8
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/inputfiles/vmme_small_create_fsb.yml54
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/inputfiles/MANIFEST.json24
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/inputfiles/a_vol.yml24
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/inputfiles/main.yml71
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/inputfiles/nested.yml116
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/out/GlobalSubstitutionTypesServiceTemplate.yaml146
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/out/MainServiceTemplate.yaml150
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/out/nestedServiceTemplate.yaml242
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_and_attach_one_file/expectedoutputfiles/MainServiceTemplate.yaml194
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_and_attach_one_file/inputfiles/MANIFEST.json11
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_and_attach_one_file/inputfiles/hot_template.yml131
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_nested_in_main_file_in_manifest/expectedoutputfiles/MainServiceTemplate.yaml203
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_nested_in_main_file_in_manifest/inputfiles/MANIFEST.json19
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_nested_in_main_file_in_manifest/inputfiles/a_vol.yml24
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_nested_in_main_file_in_manifest/inputfiles/hot_template.yml112
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_parallel_to_main_file/expectedoutputfiles/MainServiceTemplate.yaml189
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_parallel_to_main_file/inputfiles/MANIFEST.json16
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_parallel_to_main_file/inputfiles/a_vol.yml20
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_parallel_to_main_file/inputfiles/hot_template.yml112
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/testManifestFormat.json59
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/MANIFEST.json29
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/create_stack.sh1
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/vmme_small.env97
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/vmme_small.yml676
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/vmme_small_create_fsb.env8
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/vmme_small_create_fsb.yml54
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/pom.xml37
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/pom.xml38
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/api/ValidationManager.java35
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/errors/ErrorMessagesFormatBuilder.java30
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/errors/Messages.java117
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/factory/ValidationManagerFactory.java32
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/interfaces/Validator.java36
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/types/FileValidationContext.java53
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/types/GlobalValidationContext.java142
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/types/MessageContainer.java82
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/types/MessageContainerUtil.java64
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/resources/factoryConfiguration.json3
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/resources/validationConfiguration.json24
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/pom.xml93
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/impl/ValidationManagerFactoryImpl.java34
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/impl/ValidationManagerImpl.java69
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/utils/ValidationConfiguration.java37
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/utils/ValidationConfigurationManager.java74
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/utils/ValidationManagerUtil.java65
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/utils/ValidatorConfiguration.java51
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/java/org/openecomp/sdc/heat/services/tree/HeatTreeManagerTest.java51
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/MANIFEST.json35
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/hot-nimbus-pps_v1.0.env12
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/hot-nimbus-pps_v1.0.yaml94
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/hot-nimbus-psm_v1.0.env12
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/hot-nimbus-psm_v1.0.yaml109
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/hot-nimbus-psm_volume.yaml21
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/nested-pps_v1.0.yaml98
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/pom.xml100
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/util/HeatValidationService.java323
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/util/ResourceValidationHeatValidator.java617
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/EcompGuideLineValidator.java784
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/HeatValidator.java469
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ManifestValidator.java153
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/YamlValidator.java97
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/ErrorMessagesTest.java25
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/ValidatorBaseTest.java84
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/validators/EcompGuideLineValidatorTest.java281
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/validators/EcompNamingConventionTest.java104
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/validators/HeatValidatorTest.java356
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/validators/ManifestValidatorTest.java125
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/validators/YamlValidatorTest.java89
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/MANIFEST.json27
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/first.env0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/first.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/firstVol.yaml1
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/second.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/MANIFEST.json27
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/first.env0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/first.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/firstVol.yaml1
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/second.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/MANIFEST.json27
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/first.env0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/first.yaml18
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/firstVol.yaml1
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/second.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/MANIFEST.json27
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/first.env0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/first.yaml21
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/firstVol.yaml1
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/second.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/MANIFEST.json27
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/first.env0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/first.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/firstVol.yaml1
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/second.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/MANIFEST.json27
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/first.env0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/first.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/firstVol.yaml1
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/second.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/MANIFEST.json27
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/first.env0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/first.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/firstVol.yaml1
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/second.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/MANIFEST.json27
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/first.env0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/first.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/firstVol.yaml1
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/second.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/MANIFEST.json27
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/first.env0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/first.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/firstVol.yaml1
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/second.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/MANIFEST.json27
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/first.env0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/first.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/firstVol.yaml1
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/second.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative/MANIFEST.json27
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative/first.env0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative/first.yaml25
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative/firstVol.yaml19
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative/second.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive/MANIFEST.json27
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive/first.env0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive/first.yaml37
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive/firstVol.yaml19
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive/second.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/MANIFEST.json27
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/first.env0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/first.yaml37
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/firstVol.yaml19
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/second.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/MANIFEST.json27
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/first.env0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/first.yaml52
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/firstVol.yaml19
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/second.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative/MANIFEST.json27
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative/first.env0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative/first.yaml58
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative/firstVol.yaml19
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative/second.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive/MANIFEST.json27
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive/first.env0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive/first.yaml43
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive/firstVol.yaml19
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive/second.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative/MANIFEST.json27
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative/first.env0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative/first.yaml41
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative/firstVol.yaml19
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative/second.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive/MANIFEST.json27
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive/first.env0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive/first.yaml37
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive/firstVol.yaml19
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive/second.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/MANIFEST.json27
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/first.env0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/first.yaml27
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/firstVol.yaml19
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/second.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/MANIFEST.json27
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/first.env0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/first.yaml26
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/firstVol.yaml19
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/second.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/MANIFEST.json27
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/first.env0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/first.yaml43
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/firstVol.yaml19
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/second.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive/MANIFEST.json27
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive/first.env0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive/first.yaml57
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive/firstVol.yaml19
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive/second.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/MANIFEST.json27
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/first.env0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/first.yaml40
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/firstVol.yaml19
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/second.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive/MANIFEST.json27
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive/first.env0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive/first.yaml39
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive/firstVol.yaml19
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive/second.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/MANIFEST.json27
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/first.env0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/first.yaml28
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/firstVol.yaml19
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/second.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/MANIFEST.json27
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/first.env0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/first.yaml33
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/firstVol.yaml19
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/second.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/MANIFEST.json27
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/first.env0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/first.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/firstVol.yaml19
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/second.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/MANIFEST.json27
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/first.env0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/first.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/firstVol.yaml19
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/second.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/MANIFEST.json27
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/first.env0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/first.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/firstVol.yaml1
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/second.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/multiBaseHeat/MANIFEST.json27
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/multiBaseHeat/first.env0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/multiBaseHeat/first.yaml0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/multiBaseHeat/firstVol.yaml0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/multiBaseHeat/second.yaml0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/availability_zone_name/expected_output/expected_output.json38
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/availability_zone_name/input/MANIFEST.json17
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/availability_zone_name/input/hot-nimbus-pps_v1.0.env12
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/availability_zone_name/input/hot-nimbus-pps_v1.0.yaml92
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/floating_ip_resource_type/expected_output/expected_output.json34
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/floating_ip_resource_type/input/MANIFEST.json17
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/floating_ip_resource_type/input/hot-nimbus-pps_v1.0.env12
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/floating_ip_resource_type/input/hot-nimbus-pps_v1.0.yaml71
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/neutron_port_fixed_ip_name/expected_output/expected_output.json42
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/neutron_port_fixed_ip_name/input/MANIFEST.json17
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/neutron_port_fixed_ip_name/input/hot-nimbus-pps_v1.0.env12
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/neutron_port_fixed_ip_name/input/hot-nimbus-pps_v1.0.yaml128
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/nova_server_name/expected_output/expected_output.json50
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/nova_server_name/input/MANIFEST.json17
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/nova_server_name/input/hot-nimbus-pps_v1.0.env12
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/nova_server_name/input/hot-nimbus-pps_v1.0.yaml138
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/default_value_align_with_type/negative_test/input/MANIFEST.json17
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/default_value_align_with_type/negative_test/input/hot-nimbus-pps_v1.0.env11
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/default_value_align_with_type/negative_test/input/hot-nimbus-pps_v1.0.yaml60
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/depends_on_points_to_existing_resource/input/MANIFEST.json11
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/depends_on_points_to_existing_resource/input/hot-nimbus-pps_v1.0.yaml43
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/negative_test/input/MANIFEST.json17
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/negative_test/input/hot-nimbus-pps_v1.0.env12
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/negative_test/input/hot-nimbus-pps_v1.0.yaml54
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/expected_output/expected_output.json1
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/MANIFEST.json51
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/hot-nimbus-pps_v1.0.env11
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/hot-nimbus-pps_v1.0.yaml121
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/hot-nimbus-psm_v1.0.env10
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/hot-nimbus-psm_v1.0.yaml199
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/nested-pps_v1.0.yaml97
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/nested-psm_v1.0.yaml97
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_empty_value/input/MANIFEST.json17
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_empty_value/input/env_empty_value.env3
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_empty_value/input/env_empty_value.yaml122
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/negative_test/input/MANIFEST.json35
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/negative_test/input/hot-nimbus-pps_v1.0.env11
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/negative_test/input/hot-nimbus-pps_v1.0.yaml50
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/expected_output/expected_output.json1
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/MANIFEST.json51
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/hot-nimbus-pps_v1.0.env11
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/hot-nimbus-pps_v1.0.yaml121
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/hot-nimbus-psm_v1.0.env10
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/hot-nimbus-psm_v1.0.yaml199
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/nested-pps_v1.0.yaml97
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/nested-psm_v1.0.yaml97
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/negative_test/input/MANIFEST.json21
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/negative_test/input/hot-nimbus-psm_v1.0.env10
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/negative_test/input/hot-nimbus-psm_v1.0.yaml72
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/negative_test/input/nested-psm_v1.0.yaml103
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/expected_output/expected_output.json1
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/MANIFEST.json51
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/hot-nimbus-pps_v1.0.env11
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/hot-nimbus-pps_v1.0.yaml121
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/hot-nimbus-psm_v1.0.env10
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/hot-nimbus-psm_v1.0.yaml204
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/nested-pps_v1.0.yaml97
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/nested-psm_v1.0.yaml103
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/negative_test/input/MANIFEST.json21
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/negative_test/input/hot-nimbus-psm_v1.0.env10
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/negative_test/input/hot-nimbus-psm_v1.0.yaml55
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/expected_output/expected_output.json1
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/MANIFEST.json51
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/hot-nimbus-pps_v1.0.env11
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/hot-nimbus-pps_v1.0.yaml121
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/hot-nimbus-psm_v1.0.env10
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/hot-nimbus-psm_v1.0.yaml199
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/nested-pps_v1.0.yaml97
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/nested-psm_v1.0.yaml97
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_resource_value_valid/negative_test/input/MANIFEST.json11
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_resource_value_valid/negative_test/input/hot-nimbus-pps_v1.0.yaml31
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/invalid_heat_format/negative_test/input/MANIFEST.json11
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/invalid_heat_format/negative_test/input/hot-nimbus-psm_v1.0.yaml52
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/network_policy_associated_with_attach_policy/input/MANIFEST.json17
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/network_policy_associated_with_attach_policy/input/hot-nimbus-pps_v1.0.env11
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/network_policy_associated_with_attach_policy/input/hot-nimbus-pps_v1.0.yaml69
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/MANIFEST.json45
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/hot-nimbus-psm_v1.0.env10
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/hot-nimbus-psm_v1.0.yaml56
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/nested-points-to-hot-nimbus-psm.yaml60
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/nested-psm_v1.0.yaml47
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/yaml-point-to-itself.yaml21
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/expected_output/expected_output.json1
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/MANIFEST.json51
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/hot-nimbus-pps_v1.0.env11
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/hot-nimbus-pps_v1.0.yaml121
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/hot-nimbus-psm_v1.0.env10
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/hot-nimbus-psm_v1.0.yaml199
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/nested-pps_v1.0.yaml97
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/nested-psm_v1.0.yaml97
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/negative_test/input/MANIFEST.json17
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/negative_test/input/hot-nimbus-psm_v1.0.env10
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/negative_test/input/hot-nimbus-psm_v1.0.yaml92
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/expected_output/expected_output.json1
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/MANIFEST.json51
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/hot-nimbus-pps_v1.0.env11
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/hot-nimbus-pps_v1.0.yaml121
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/hot-nimbus-psm_v1.0.env10
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/hot-nimbus-psm_v1.0.yaml236
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/nested-pps_v1.0.yaml97
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/nested-psm_v1.0.yaml97
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/negative_test/input/MANIFEST.json17
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/negative_test/input/hot-nimbus-psm_v1.0.env10
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/negative_test/input/hot-nimbus-psm_v1.0.yaml95
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/expected_output/expected_output.json1
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/MANIFEST.json51
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/hot-nimbus-pps_v1.0.env11
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/hot-nimbus-pps_v1.0.yaml121
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/hot-nimbus-psm_v1.0.env10
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/hot-nimbus-psm_v1.0.yaml233
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/nested-pps_v1.0.yaml97
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/nested-psm_v1.0.yaml97
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/MANIFEST.json51
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/hot-nimbus-pps_v1.0.env11
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/hot-nimbus-pps_v1.0.yaml121
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/hot-nimbus-psm_v1.0.env10
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/hot-nimbus-psm_v1.0.yaml199
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/nested-pps_v1.0.yaml97
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/nested-psm_v1.0.yaml97
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/expected_output/expected_output.json42
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/MANIFEST.json51
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/hot-nimbus-pps_v1.0.env11
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/hot-nimbus-pps_v1.0.yaml121
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/hot-nimbus-psm_v1.0.env10
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/hot-nimbus-psm_v1.0.yaml199
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/nested-pps_v1.0.yaml99
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/nested-psm_v1.0.yaml99
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/negative_test/input/MANIFEST.json17
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/negative_test/input/hot-nimbus-psm_v1.0.env8
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/negative_test/input/hot-nimbus-psm_v1.0.yaml116
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/expected_output/expected_output.json1
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/MANIFEST.json51
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/hot-nimbus-pps_v1.0.env11
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/hot-nimbus-pps_v1.0.yaml121
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/hot-nimbus-psm_v1.0.env10
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/hot-nimbus-psm_v1.0.yaml199
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/nested-pps_v1.0.yaml114
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/nested-psm_v1.0.yaml112
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/MANIFEST.json51
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/hot-nimbus-pps_v1.0.env11
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/hot-nimbus-pps_v1.0.yaml121
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/hot-nimbus-psm_v1.0.env10
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/hot-nimbus-psm_v1.0.yaml199
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/nested-pps_v1.0.yaml99
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/nested-psm_v1.0.yaml99
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/expected_output/expected_output.json1
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/MANIFEST.json51
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/hot-nimbus-pps_v1.0.env11
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/hot-nimbus-pps_v1.0.yaml121
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/hot-nimbus-psm_v1.0.env10
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/hot-nimbus-psm_v1.0.yaml199
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/nested-pps_v1.0.yaml99
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/nested-psm_v1.0.yaml99
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/negative_test/input/MANIFEST.json21
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/negative_test/input/hot-nimbus-pps_v1.0.env11
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/negative_test/input/hot-nimbus-pps_v1.0.yaml49
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/negative_test/input/nested-pps_v1.0.yaml74
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/expected_output/expected_output.json1
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/MANIFEST.json51
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/hot-nimbus-pps_v1.0.env11
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/hot-nimbus-pps_v1.0.yaml121
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/hot-nimbus-psm_v1.0.env10
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/hot-nimbus-psm_v1.0.yaml199
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/nested-pps_v1.0.yaml97
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/nested-psm_v1.0.yaml97
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/pseudo_parameters/input/MANIFEST.json11
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/pseudo_parameters/input/pseudo_parameters.yml61
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/negative_test/input/MANIFEST.json11
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/negative_test/input/hot-nimbus-pps_v1.0.yaml99
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/expected_output/expected_output.json1
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/MANIFEST.json51
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/artifact.sh99
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/cloud-nimbus.sh99
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/hot-nimbus-pps_v1.0.env11
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/hot-nimbus-pps_v1.0.yaml121
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/hot-nimbus-psm_v1.0.env10
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/hot-nimbus-psm_v1.0.yaml212
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/nested-pps_v1.0.yaml99
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/nested-psm_v1.0.yaml99
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/nimbus-ethernet99
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_group_invalid_type/negative_test/input/MANIFEST.json11
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_group_invalid_type/negative_test/input/hot-nimbus-psm_v1.0.yaml102
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_group_invalid_type/negative_test/input/yamlFile.yaml47
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/negative_test/input/MANIFEST.json15
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/negative_test/input/hot-nimbus-pps_v1.0.yaml16
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/expected_output/expected_output.json1
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/MANIFEST.json51
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/hot-nimbus-pps_v1.0.env11
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/hot-nimbus-pps_v1.0.yaml121
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/hot-nimbus-psm_v1.0.env10
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/hot-nimbus-psm_v1.0.yaml199
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/nested-pps_v1.0.yaml97
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/nested-psm_v1.0.yaml97
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input/MANIFEST.json19
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input/hot-nimbus-pps_v1.0.yaml59
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input/hot-nimbus-psm_v1.0.yaml98
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input/nested-from-resources-group.yaml105
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input/nested-pps_v1.0.yaml52
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/expected_output/expected_output.json1
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/MANIFEST.json51
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/hot-nimbus-pps_v1.0.env11
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/hot-nimbus-pps_v1.0.yaml144
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/hot-nimbus-psm_v1.0.env10
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/hot-nimbus-psm_v1.0.yaml288
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/nested-from-resources-group.yaml97
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/nested-pps_v1.0.yaml97
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/nested-psm_v1.0.yaml97
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_base_file_no_ports/input/MANIFEST.json17
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_base_file_no_ports/input/baseFile.yaml43
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_base_file_no_ports/input/notBaseFile.yaml26
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_called_by_port/input/MANIFEST.json17
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_called_by_port/input/hot-nimbus-pps_v1.0.env11
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_called_by_port/input/hot-nimbus-pps_v1.0.yaml68
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_group_called_by_nova_server/input/MANIFEST.json17
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_group_called_by_nova_server/input/hot-nimbus-pps_v1.0.env11
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_group_called_by_nova_server/input/hot-nimbus-pps_v1.0.yaml67
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/negative_test/input/MANIFEST.json17
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/negative_test/input/hot-nimbus-pps_v1.0.env11
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/negative_test/input/hot-nimbus-pps_v1.0.yaml70
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/expected_output/expected_output.json1
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/MANIFEST.json51
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/hot-nimbus-pps_v1.0.env11
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/hot-nimbus-pps_v1.0.yaml144
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/hot-nimbus-psm_v1.0.env10
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/hot-nimbus-psm_v1.0.yaml199
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/nested-pps_v1.0.yaml97
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/nested-psm_v1.0.yaml97
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/shared_resources/input/MANIFEST.json17
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/shared_resources/input/hot-nimbus-pps_v1.0.env11
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/shared_resources/input/hot-nimbus-pps_v1.0.yaml90
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/MANIFEST.json35
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/hot-nimbus-pps_v1.0.env11
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/hot-nimbus-pps_v1.0.yaml125
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/hot-nimbus-psm_v1.0.env10
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/hot-nimbus-psm_v1.0.yaml207
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/nested-pps_v1.0.yaml103
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/nested-psm_v1.0.yaml103
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/positive_test/expected_output/expected_output.json1
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/positive_test/input/MANIFEST.json17
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/positive_test/input/hot-nimbus-psm_v1.0.env10
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/positive_test/input/hot-nimbus-psm_v1.0.yaml50
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/envInRoot/MANIFEST.json22
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/envInRoot/first.env0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/envInRoot/first.yaml14
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/envInRoot/second.env0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidFileTypeInManifest/MANIFEST.json24
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidFileTypeInManifest/illegalTypeFile.yaml0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidFileTypeInManifest/single.env.illegalSuffix0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidFileTypeInManifest/single.yaml.illegalSuffix0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidFileTypeInManifest/singleVol.yaml.illegalSuffix0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidManifest/MANIFEST.json21
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidManifest/single.env0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidManifest/single.yaml0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidManifest/singleVol.yaml0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifest/MANIFEST.json22
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifest/extraFile.env0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifest/single.env0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifest/single.yaml0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifest/singleVol.yaml0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifestAndInZip/MANIFEST.json21
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifestAndInZip/extraFile.env0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifestAndInZip/single.env0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifestAndInZip/single.yaml0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInZip/MANIFEST.json21
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInZip/single.env0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInZip/single.yaml0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/validFiles/MANIFEST.json21
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/validFiles/single.env0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/validFiles/single.yaml0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/validFiles/singleVol.yaml0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/duplicateKey.yaml30
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/emptyYaml.yaml0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalidTabYamlStructure.yaml24
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalidYamlStructure.yaml30
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_duplicate_key/input/MANIFEST.json39
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_duplicate_key/input/heat_missing_from_manifast.yaml250
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_duplicate_key/input/mainValid.yaml250
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_duplicate_key/input/validHeat.yaml250
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/expected_output/expected_output.json46
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/MANIFEST.json39
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/heat_missing_from_manifast.yaml250
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalidYamlTab.yaml250
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalid_additionalSpaceBeforeProperty.yaml250
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalid_duplicateKey.yaml25
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalid_empty.yml0
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalid_yamlInXMLFormat.yaml4
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/validHeat.yaml250
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/valid_yaml/input/MANIFEST.json39
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/valid_yaml/input/heat_missing_from_manifast.yaml250
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/valid_yaml/input/mainValid.yaml250
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/valid_yaml/input/validHeat.yaml250
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/yaml_validator/input/MANIFEST.json39
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/yaml_validator/input/heat_missing_from_manifast.yaml250
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/yaml_validator/input/mainValid.yaml250
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/yaml_validator/input/validHeat.yaml250
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/pom.xml38
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/pom.xml57
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/HealingServiceFactory.java32
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/VendorLicenseArtifactServiceFactory.java33
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/VendorLicenseConstants.java43
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/EntitlementPoolDao.java38
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/EntitlementPoolDaoFactory.java31
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/FeatureGroupDao.java47
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/FeatureGroupDaoFactory.java31
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/LicenseAgreementDao.java40
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/LicenseAgreementDaoFactory.java31
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/LicenseKeyGroupDao.java34
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/LicenseKeyGroupDaoFactory.java32
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/VendorLicenseModelDao.java29
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/VendorLicenseModelDaoFactory.java32
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/AggregationFunction.java27
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/ChoiceOrOther.java154
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementMetric.java37
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolEntity.java370
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementTime.java30
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/FeatureGroupEntity.java203
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/FeatureGroupModel.java75
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseAgreementEntity.java182
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseAgreementModel.java45
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseKeyGroupEntity.java231
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseKeyType.java27
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseTerm.java28
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/MultiChoiceOrOther.java172
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/OperationalScope.java32
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/ThresholdUnit.java26
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/VendorLicenseModelEntity.java153
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/xml/AggregationFunctionForXml.java33
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/xml/EntitlementMetricForXml.java33
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/xml/EntitlementTimeForXml.java33
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/xml/LicenseKeyTypeForXml.java33
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/xml/ThresholdForXml.java42
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/JsonErrorBuilder.java51
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/LicensingDataInvalidErrorBuilder.java49
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/SubmitUncompletedLicenseModelErrorBuilder.java50
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/VendorLicenseErrorCodes.java28
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/VendorLicenseModelNotFoundErrorBuilder.java48
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/facade/VendorLicenseFacade.java89
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/facade/VendorLicenseFacadeFactory.java32
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/healing/HealingService.java31
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/VendorLicenseArtifactsService.java32
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/types/VersionedVendorLicenseModel.java54
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/resources/factoryConfiguration.json11
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/pom.xml48
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/SimpleHealingServiceServiceFactoryImpl.java34
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/VendorLicenseArtifactServiceFactoryImpl.java34
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/EntitlementPoolCassandraDaoImpl.java148
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/EntitlementPoolDaoFactoryImpl.java33
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/FeatureGroupCassandraDaoImpl.java206
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/FeatureGroupDaoFactoryImpl.java33
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/LicenseAgreementCassandraDaoImpl.java160
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/LicenseAgreementDaoFactoryImpl.java33
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/LicenseKeyGroupCassandraDaoImpl.java130
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/LicenseKeyGroupDaoFactoryImpl.java33
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/VendorLicenseModelCassandraDaoImpl.java91
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/VendorLicenseModelDaoFactoryImpl.java34
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/facade/impl/VendorLicenseFacadeFactoryImpl.java33
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/facade/impl/VendorLicenseFacadeImpl.java478
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/healing/impl/SimpleHealingServiceImpl.java63
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/VendorLicenseArtifactsServiceImpl.java200
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/FeatureGroupForArtifact.java60
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/VendorLicenseArtifact.java80
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/VnfLicenseArtifact.java97
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/XmlArtifact.java54
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinEntitlementPoolEntityForVendorLicenseArtifact.java100
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinEntitlementPoolEntityForVnfArtifact.java100
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinFeatureGroupEntity.java62
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinFeatureGroupModel.java61
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinLicenseKeyGroupEntityForVendorLicenseArtifact.java72
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinLicenseKeyGroupEntityForVnfArtifact.java74
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/pom.xml24
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/pom.xml63
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductConstants.java38
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ComponentArtifactDao.java40
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ComponentArtifactDaoFactory.java32
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ComponentDao.java38
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ComponentDaoFactory.java31
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/NetworkDao.java33
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/NetworkDaoFactory.java31
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/NicDao.java40
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/NicDaoFactory.java31
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/PackageInfoDao.java33
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/PackageInfoDaoFactory.java31
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ProcessArtifactDao.java32
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ProcessArtifactDaoFactory.java32
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ProcessDao.java30
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ProcessDaoFactory.java31
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDao.java34
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDaoFactory.java31
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductDao.java140
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductDaoFactory.java34
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductInfoDao.java30
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductInfoDaoFactory.java32
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VspQuestionnaireDao.java32
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VspQuestionnaireDaoFactory.java32
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/Action.java27
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ComponentArtifactEntity.java140
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ComponentEntity.java199
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/CompositionEntity.java40
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/NetworkEntity.java183
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/NicEntity.java203
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/PackageInfo.java176
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ProcessArtifactEntity.java128
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ProcessEntity.java179
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/TranslatedFileData.java97
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/UploadDataEntity.java135
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/VspDetails.java242
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/VspQuestionnaireEntity.java111
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/Component.java44
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/ComponentData.java80
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/CompositionData.java44
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/CompositionDataEntity.java24
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/CompositionEntityId.java64
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/CompositionEntityType.java28
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/Network.java67
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/NetworkType.java26
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/Nic.java102
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/resources/factoryConfiguration.json14
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/pom.xml67
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentArtifactDaoCassandraImpl.java159
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentArtifactDaoFactoryImpl.java33
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentDaoCassandraImpl.java139
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentDaoFactoryImpl.java33
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/NetworkDaoCassandraImpl.java127
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/NetworkDaoFactoryImpl.java33
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/NicDaoCassandraImpl.java148
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/NicDaoFactoryImpl.java33
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/PackageInfoDaoFactoryImpl.java33
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/PackageInfoDaoImpl.java103
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ProcessArtifactDaoCassandraImpl.java82
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ProcessArtifactDaoFactoryImpl.java33
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ProcessDaoCassandraImpl.java139
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ProcessDaoFactoryImpl.java33
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/UploadDataDaoFactoryImpl.java33
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/UploadDataDaoImpl.java92
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductDaoFactoryImpl.java33
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductDaoImpl.java349
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductInfoDaoFactoryImpl.java34
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductInfoDaoImpl.java83
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VspQuestionnaireDaoCassandraImpl.java72
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VspQuestionnaireDaoFactoryImpl.java33
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ServiceModelDaoFactoryTest.java97
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/pom.xml23
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/pom.xml71
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/VersioningManager.java57
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/VersioningManagerFactory.java31
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/VersioningUtil.java187
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionHistoryDao.java27
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionHistoryDaoFactory.java30
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionInfoDao.java28
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionInfoDaoFactory.java30
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionInfoDeletedDao.java29
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionInfoDeletedDaoFactory.java32
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionableDao.java25
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionableEntityDao.java34
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionableEntityDaoFactory.java31
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/UserCandidateVersion.java56
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/Version.java119
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionHistoryEntity.java90
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionInfoDeletedEntity.java126
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionInfoEntity.java126
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionStatus.java28
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionType.java26
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionableEntity.java43
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionableEntityId.java53
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/CheckinOnEntityLockedByOtherErrorBuilder.java52
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/CheckinOnUnlockedEntityErrorBuilder.java46
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/CheckoutOnLockedEntityErrorBuilder.java51
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/DeleteOnLockedEntityErrorBuilder.java49
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EditOnEntityLockedByOtherErrorBuilder.java50
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EditOnUnlockedEntityErrorBuilder.java48
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EntityAlreadyExistErrorBuilder.java46
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EntityAlreadyFinalizedErrorBuilder.java51
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EntityNotExistErrorBuilder.java46
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/RequestedVersionInvalidErrorBuilder.java40
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/SubmitLockedEntityNotAllowedErrorBuilder.java49
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/UndoCheckoutOnEntityLockedByOtherErrorBuilder.java53
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/UndoCheckoutOnUnlockedEntityErrorBuilder.java50
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/VersionableSubEntityNotFoundErrorBuilder.java77
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/VersioningErrorCodes.java43
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/UniqueValueMetadata.java49
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/VersionInfo.java97
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/VersionableEntityAction.java26
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/VersionableEntityMetadata.java78
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/resources/factoryConfiguration.json7
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/pom.xml61
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionHistoryCassandraDaoImpl.java69
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionHistoryDaoFactoryImpl.java33
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionInfoDaoFactoryImpl.java33
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionInfoDaoImpl.java66
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionInfoDeletedDaoFactoryImpl.java34
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionInfoDeletedDaoImpl.java65
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionableEntityDaoCassandraImpl.java159
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionableEntityDaoFactoryImpl.java33
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/VersioningManagerFactoryImpl.java33
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/VersioningManagerImpl.java468
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/test/java/org/openecomp/sdc/versioning/VersioningManagerTest.java364
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/pom.xml23
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/pom.xml66
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaArtifactType.java39
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaCapabilityType.java52
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaDataType.java84
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaElementTypes.java25
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaFunctions.java43
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaGroupType.java40
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaNodeType.java162
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaPolicyType.java43
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaRelationshipType.java44
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaServiceModel.java72
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/ArtifactDefinition.java69
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/ArtifactType.java83
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/AttributeDefinition.java85
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityAssignment.java45
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityDefinition.java113
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityFilterDefinition.java35
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityType.java82
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Constraint.java181
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/DataType.java73
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Directive.java40
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/EntrySchema.java65
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/GroupDefinition.java64
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/GroupType.java82
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Import.java61
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/InterfaceDefinition.java24
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/InterfaceType.java24
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Metadata.java55
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/NodeFilter.java47
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/NodeTemplate.java127
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/NodeType.java125
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/ParameterDefinition.java99
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/PolicyDefinition.java63
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/PolicyType.java73
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/PropertyDefinition.java112
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/PropertyType.java117
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/RelationshipTemplate.java99
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/RelationshipType.java93
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/RequirementAssignment.java70
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/RequirementDefinition.java82
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Scalar.java34
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/ServiceTemplate.java144
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Status.java42
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/SubstitutionMapping.java54
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Template.java24
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/TopologyTemplate.java114
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/heatextend/ParameterDefinitionExt.java55
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/heatextend/PropertyTypeExt.java85
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/InvalidAddActionNullEntityErrorBuilder.java58
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/InvalidRequirementAssignmentErrorBuilder.java57
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaErrorCodes.java36
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaInvalidEntryNotFoundErrorBuilder.java55
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaInvalidSubstituteNodeTemplateErrorBuilder.java55
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaInvalidSubstituteNodeTemplatePropertiesErrorBuilder.java59
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaInvalidSubstitutionServiceTemplateErrorBuilder.java57
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaMissingSubstitutionMappingForReqCapErrorBuilder.java88
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaNodeTypeNotFoundErrorBuilder.java46
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/exceptions/CsarCreationErrorBuilder.java43
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/exceptions/CsarMissingEntryPointErrorBuilder.java44
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java588
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaAnalyzerService.java66
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaConstants.java65
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaFileOutputService.java34
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaNativeTypesServiceTemplate.java309
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaUtil.java151
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImpl.java467
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaFileOutputServiceCsarImpl.java158
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/yamlutil/ToscaExtensionYamlUtil.java93
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/TestUtil.java71
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/PropertyTypeTest.java20
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/ToscaModelTest.java282
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityDefinitionTest.java101
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/model/RequirementDefinitionTest.java40
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/DataModelUtilTest.java104
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImplTest.java472
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/impl/ToscaFileOutputServiceCsarImplTest.java150
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/analyzerService/NestedServiceTemplateReqTest.yaml176
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/analyzerService/ServiceTemplateSubstituteTest.yaml89
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/analyzerService/toscasubstitution/MainServiceTemplate.yaml75
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/analyzerService/toscasubstitution/nestedServiceTemplate.yaml130
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/AbstractSubstituteGlobalTypesServiceTemplate.yaml47
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/CinderVolumeGlobalTypesServiceTemplate.yaml176
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/CommonGlobalTypesServiceTemplate.yaml210
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/ContrailNetworkRuleGlobalTypeServiceTemplate.yaml117
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml71
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/GlobalSubstitutionTypesServiceTemplate.yaml93
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/NativeTypesServiceTemplateServiceTemplate.yaml194
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/NeutronNetGlobalTypesServiceTemplate.yaml97
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/NeutronPortGlobalTypesServiceTemplate.yaml151
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/NeutronSecurityRulesGlobalTypesServiceTemplate.yaml116
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/NovaServerGlobalTypesServiceTemplate.yaml249
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/model/serviceTemplate.yaml116
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/model/serviceTemplateHeatExtend.yaml117
-rw-r--r--openecomp-be/lib/pom.xml30
-rw-r--r--openecomp-be/logs/ASDC/Debug.1.log.zipbin0 -> 146911 bytes
-rw-r--r--openecomp-be/logs/ASDC/Debug.2.log.zipbin0 -> 130246 bytes
-rw-r--r--openecomp-be/logs/ASDC/Debug.3.log.zipbin0 -> 158231 bytes
-rw-r--r--openecomp-be/logs/ASDC/Debug.4.log.zipbin0 -> 149071 bytes
-rw-r--r--openecomp-be/logs/ASDC/Debug.5.log.zipbin0 -> 150749 bytes
-rw-r--r--openecomp-be/logs/ASDC/Debug.6.log.zipbin0 -> 168721 bytes
-rw-r--r--openecomp-be/pom.xml158
-rw-r--r--openecomp-be/readMe.txt42
-rw-r--r--openecomp-be/tools/build/scripts/action_library_client/action_library_client.py704
-rw-r--r--openecomp-be/tools/build/scripts/action_library_client/doc/TESTPLAN.TXT10
-rw-r--r--openecomp-be/tools/build/scripts/action_library_client/test/scenarios/Backout.json45
-rw-r--r--openecomp-be/tools/build/scripts/action_library_client/test/scenarios/Copy_image.json45
-rw-r--r--openecomp-be/tools/build/scripts/action_library_client/test/scenarios/Healthcheck.json45
-rw-r--r--openecomp-be/tools/build/scripts/action_library_client/test/scenarios/Reboot.json45
-rw-r--r--openecomp-be/tools/build/scripts/action_library_client/test/seq.txt1
-rw-r--r--openecomp-be/tools/build/scripts/action_library_client/test/test_action_library_client.py154
-rw-r--r--openecomp-be/tools/build/scripts/action_library_client/test/test_action_library_client_integration.py329
-rw-r--r--openecomp-be/tools/build/scripts/cassandra-commands.json76
-rw-r--r--openecomp-be/tools/build/scripts/generate-application-config-insert-cql.sh64
-rw-r--r--openecomp-be/tools/build/scripts/generate-cassandra-alter-cql.sh40
-rw-r--r--openecomp-be/tools/build/scripts/generate-cassandra-drop-cql.sh40
-rw-r--r--openecomp-be/tools/build/scripts/generate-cassandra-init-cql.sh44
-rw-r--r--openecomp-be/tools/build/scripts/parse-json.py83
-rw-r--r--openecomp-be/tools/install/database/monitoring/component/ceilometer.ftl67
-rw-r--r--openecomp-be/tools/install/database/schemaTemplates/composition/component.ftl28
-rw-r--r--openecomp-be/tools/install/database/schemaTemplates/composition/network.ftl25
-rw-r--r--openecomp-be/tools/install/database/schemaTemplates/composition/nic.ftl36
-rw-r--r--openecomp-be/tools/install/database/schemaTemplates/questionnaire/component.ftl327
-rw-r--r--openecomp-be/tools/install/database/schemaTemplates/questionnaire/nic.ftl120
-rw-r--r--openecomp-be/tools/install/database/schemaTemplates/questionnaire/vsp.ftl89
-rw-r--r--openecomp-be/tools/migration/1607_to_1610.py281
-rw-r--r--openecomp-be/tools/migration/README88
-rw-r--r--openecomp-be/tools/scripts/generate-manifest.py435
-rw-r--r--openecomp-be/tools/swagger-ui/WEB-INF/jetty-web.xml8
-rw-r--r--openecomp-be/tools/swagger-ui/api-docs/api.html13140
-rw-r--r--openecomp-be/tools/swagger-ui/api-docs/api.json4676
-rw-r--r--openecomp-be/tools/swagger-ui/assembly/swagger.xml76
-rw-r--r--openecomp-be/tools/swagger-ui/css/ncso-style.css8659
-rw-r--r--openecomp-be/tools/swagger-ui/css/print.css1175
-rw-r--r--openecomp-be/tools/swagger-ui/css/reset.css125
-rw-r--r--openecomp-be/tools/swagger-ui/css/screen.css1282
-rw-r--r--openecomp-be/tools/swagger-ui/css/style.css250
-rw-r--r--openecomp-be/tools/swagger-ui/css/typography.css26
-rw-r--r--openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-700.eotbin0 -> 22922 bytes
-rw-r--r--openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-700.svg411
-rw-r--r--openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-700.ttfbin0 -> 40513 bytes
-rw-r--r--openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-700.woffbin0 -> 25992 bytes
-rw-r--r--openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-700.woff2bin0 -> 11480 bytes
-rw-r--r--openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-regular.eotbin0 -> 22008 bytes
-rw-r--r--openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-regular.svg403
-rw-r--r--openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-regular.ttfbin0 -> 39069 bytes
-rw-r--r--openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-regular.woffbin0 -> 24868 bytes
-rw-r--r--openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-regular.woff2bin0 -> 11304 bytes
-rw-r--r--openecomp-be/tools/swagger-ui/images/Thumbs.dbbin0 -> 6656 bytes
-rw-r--r--openecomp-be/tools/swagger-ui/images/explorer_icons.pngbin0 -> 5763 bytes
-rw-r--r--openecomp-be/tools/swagger-ui/images/favicon-16x16.pngbin0 -> 645 bytes
-rw-r--r--openecomp-be/tools/swagger-ui/images/favicon-32x32.pngbin0 -> 1654 bytes
-rw-r--r--openecomp-be/tools/swagger-ui/images/favicon.icobin0 -> 1150 bytes
-rw-r--r--openecomp-be/tools/swagger-ui/images/logo_small.pngbin0 -> 770 bytes
-rw-r--r--openecomp-be/tools/swagger-ui/images/pet_store_api.pngbin0 -> 824 bytes
-rw-r--r--openecomp-be/tools/swagger-ui/images/throbber.gifbin0 -> 9257 bytes
-rw-r--r--openecomp-be/tools/swagger-ui/images/wordnik_api.pngbin0 -> 980 bytes
-rw-r--r--openecomp-be/tools/swagger-ui/index.html328
-rw-r--r--openecomp-be/tools/swagger-ui/lang/en.js73
-rw-r--r--openecomp-be/tools/swagger-ui/lang/es.js72
-rw-r--r--openecomp-be/tools/swagger-ui/lang/ja.js73
-rw-r--r--openecomp-be/tools/swagger-ui/lang/pt.js73
-rw-r--r--openecomp-be/tools/swagger-ui/lang/ru.js72
-rw-r--r--openecomp-be/tools/swagger-ui/lang/tr.js73
-rw-r--r--openecomp-be/tools/swagger-ui/lang/translator.js59
-rw-r--r--openecomp-be/tools/swagger-ui/lang/zh-cn.js73
-rw-r--r--openecomp-be/tools/swagger-ui/lib/backbone-min.js35
-rw-r--r--openecomp-be/tools/swagger-ui/lib/handlebars-2.0.0.js48
-rw-r--r--openecomp-be/tools/swagger-ui/lib/highlight.7.3.pack.js21
-rw-r--r--openecomp-be/tools/swagger-ui/lib/jquery-1.8.0.min.js22
-rw-r--r--openecomp-be/tools/swagger-ui/lib/jquery.ba-bbq.min.js38
-rw-r--r--openecomp-be/tools/swagger-ui/lib/jquery.slideto.min.js21
-rw-r--r--openecomp-be/tools/swagger-ui/lib/jquery.wiggle.min.js28
-rw-r--r--openecomp-be/tools/swagger-ui/lib/marked.js1292
-rw-r--r--openecomp-be/tools/swagger-ui/lib/swagger-oauth.js310
-rw-r--r--openecomp-be/tools/swagger-ui/lib/underscore-min.js26
-rw-r--r--openecomp-be/tools/swagger-ui/lib/underscore-min.map1
-rw-r--r--openecomp-be/tools/swagger-ui/o2c.html20
-rw-r--r--openecomp-be/tools/swagger-ui/pom.xml77
-rw-r--r--openecomp-be/tools/swagger-ui/swagger-ui.js32311
-rw-r--r--openecomp-be/tools/swagger-ui/swagger-ui.min.js32
-rw-r--r--openecomp-be/tools/test.push1
-rw-r--r--pom.xml2
-rw-r--r--sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-normatives/files/default/normatives.tar.gzbin49376 -> 49377 bytes
2148 files changed, 290537 insertions, 1 deletions
diff --git a/openecomp-be/.gitignore b/openecomp-be/.gitignore
new file mode 100644
index 0000000000..2c9567e1a0
--- /dev/null
+++ b/openecomp-be/.gitignore
@@ -0,0 +1,13 @@
+target
+package
+.settings
+.project
+.classpath
+.idea
+
+*.log
+
+### idea files
+*.iml
+*.ipr
+*.iws
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/pom.xml
new file mode 100644
index 0000000000..23ba4e8c64
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/pom.xml
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.sdc.onboarding</groupId>
+ <artifactId>action-library-rest</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>action-library-rest-services</artifactId>
+
+
+
+ <properties>
+ <errorcode.dir>${project.build.directory}/generated-sources/error-codes</errorcode.dir>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>action-library-rest-types</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <!-- Spring -->
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ <version>${spring.framework.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <version>${spring.framework.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context-support</artifactId>
+ <version>${spring.framework.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ <version>${spring.framework.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ <version>${spring.framework.version}</version>
+ </dependency>
+
+ <!-- CXF -->
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-frontend-jaxrs</artifactId>
+ <version>${cxf.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ <version>${http.client.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpcore</artifactId>
+ <version>${http.client.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>javax.ws.rs-api</artifactId>
+ <version>${ws.rs.version}</version>
+ </dependency>
+
+ <!-- Other Stuff-->
+ <dependency>
+ <groupId>cglib</groupId>
+ <artifactId>cglib-nodep</artifactId>
+ <version>${cglib.nodep.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <!-- Java Stuff -->
+ <dependency>
+ <groupId>javax.inject</groupId>
+ <artifactId>javax.inject</artifactId>
+ <version>${javax.inject.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-action-manager</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-action-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc.sdc_common</groupId>
+ <artifactId>openecomp-logging-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <includes>
+ <include>test/core/unittest/offline/**</include>
+ </includes>
+ <skipTests>true</skipTests>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+
+
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/main/java/org/openecomp/sdcrests/action/rest/Actions.java b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/main/java/org/openecomp/sdcrests/action/rest/Actions.java
new file mode 100644
index 0000000000..c7e3bbddec
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/main/java/org/openecomp/sdcrests/action/rest/Actions.java
@@ -0,0 +1,206 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.action.rest;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.apache.cxf.jaxrs.ext.multipart.Attachment;
+import org.apache.cxf.jaxrs.ext.multipart.Multipart;
+import org.openecomp.sdcrests.action.types.ActionResponseDto;
+import org.springframework.validation.annotation.Validated;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+/**
+ * Defines various CRUD API that can be performed on Action.
+ */
+@Path("/workflow/v1.0/actions")
+@Produces(MediaType.APPLICATION_JSON)
+@Consumes(MediaType.APPLICATION_JSON)
+@Api(value = "Actions")
+@Validated
+public interface Actions {
+
+ /**
+ * List All Major, Last Minor and Candidate version if any for Given Action Invariant UUID
+ *
+ * @return List of All Major, Last Minor and Candidate version if any Of Action with given
+ actionInvariantUuId. If actionUUID is provided then only action with given actionInvariantUuId
+ and actionUUID
+ */
+ @GET
+ @Path("/{actionInvariantUUID}")
+ @ApiOperation(value = "List Actions For Given Action Invariant UUID", responseContainer = "List")
+ Response getActionsByActionInvariantUuId(
+ @PathParam("actionInvariantUUID") String actionInvariantUuId,
+ @QueryParam("version") String actionUuId, @Context HttpServletRequest servletRequest);
+
+ /**
+ * Get list of actions based on a filter criteria. If no filter is sent all actions will
+ be returned
+ *
+ * @return List Of Last Major and Last Minor of All Actions based on filter criteria
+ */
+ @GET
+ @ApiOperation(value = "List Filtered Actions ",
+ notes = "Get list of actions based on a filter criteria | If no filter is sent all actions "
+ + "will be returned",
+ responseContainer = "List")
+ Response getFilteredActions(@QueryParam("vendor") String vendor,
+ @QueryParam("category") String category,
+ @QueryParam("name") String name,
+ @QueryParam("modelId") String modelId,
+ @QueryParam("componentId") String componentId,
+ @Context HttpServletRequest servletRequest);
+
+ /**
+ * List ECOMP Components supported by Action Library.
+ *
+ * @return List of ECOMP Components supported by Action Library.
+ */
+ @GET
+ @Path("/components")
+ @ApiOperation(value = "List ECOMP Components supported by Action Library",
+ responseContainer = "List")
+ Response getEcompComponents(@Context HttpServletRequest servletRequest);
+
+ /**
+ * Create a new Action based on request JSON.
+ *
+ * @return Metadata object {@link ActionResponseDto ActionResponseDto} object for created Action.
+ */
+ @POST
+ @ApiOperation(value = "Create a new Action")
+ Response createAction(String requestJson, @Context HttpServletRequest servletRequest);
+
+ /**
+ * Update an existing action with parameters provided in requestJson.
+ *
+ * @return Metadata object {@link ActionResponseDto ActionResponseDto} object for created Action.
+ */
+ @PUT
+ @Path("/{actionInvariantUUID}")
+ @ApiOperation(value = "Update an existing action")
+ Response updateAction(@PathParam("actionInvariantUUID") String actionInvariantUuId,
+ String requestJson, @Context HttpServletRequest servletRequest);
+
+ /**
+ * Delete an action.
+ *
+ * @param actionInvariantUuId Invariant UUID of the action to be deleted.
+ * @param servletRequest Servlet request object.
+ * @return Empty response object.
+ */
+ @DELETE
+ @Path("/{actionInvariantUUID}")
+ @ApiOperation(value = "Delete Action")
+ Response deleteAction(@PathParam("actionInvariantUUID") String actionInvariantUuId,
+ @Context HttpServletRequest servletRequest);
+
+ /**
+ * Performs Checkout/Undo_Checkout/Checkin/Submit Operation on Action.
+ *
+ * @return Metadata object {@link ActionResponseDto ActionResponseDto} object for created Action.
+ */
+ @POST
+ @Path("/{actionInvariantUUID}")
+ @ApiOperation(value = "Actions on a action",
+ notes = "Performs one of the following actions on a action: |"
+ + "Checkout: Locks it for edits by other users. Only the locking user sees the edited "
+ + "version.|"
+ + "Undo_Checkout: Unlocks it and deletes the edits that were done.|"
+ + "Checkin: Unlocks it and activates the edited version to all users.| "
+ + "Submit: Finalize its active version.|")
+ Response actOnAction(@PathParam("actionInvariantUUID") String actionInvariantUuId,
+ String requestJson, @Context HttpServletRequest servletRequest);
+
+ /**
+ * Upload an artifact to an action.
+ *
+ * @param actionInvariantUuId Invariant UUID of the action to which the artifact is uploaded.
+ * @param artifactName Name of the artifact.
+ * @param artifactLabel Label of the artifact.
+ * @param artifactCategory Category of the artifact.
+ * @param artifactDescription Description of the artifact.
+ * @param artifactProtection Artifact protection mode.
+ * @param checksum Checksum of the artifact.
+ * @param artifactToUpload Artifact content object.
+ * @param servletRequest Servlet request object.
+ * @return Generated UUID of the uploaded artifact.
+ */
+ @POST
+ @Path("/{actionInvariantUUID}/artifacts")
+ @ApiOperation(value = "Upload new Artifact")
+ @Consumes(MediaType.MULTIPART_FORM_DATA)
+ Response uploadArtifact(@PathParam("actionInvariantUUID") String actionInvariantUuId,
+ @Multipart(value = "artifactName", required = false) String artifactName,
+ @Multipart(value = "artifactLabel", required = false) String artifactLabel,
+ @Multipart(value = "artifactCategory", required = false) String artifactCategory,
+ @Multipart(value = "artifactDescription", required = false) String artifactDescription,
+ @Multipart(value = "artifactProtection", required = false) String artifactProtection,
+ @HeaderParam("Content-MD5") String checksum,
+ @Multipart(value = "uploadArtifact", required = false) Attachment artifactToUpload,
+ @Context HttpServletRequest servletRequest);
+
+ @GET
+ @Path("/{actionUUID}/artifacts/{artifactUUID}")
+ @Produces(MediaType.APPLICATION_OCTET_STREAM)
+ @ApiOperation(value = "Downloads artifact for action")
+ Response downloadArtifact(@PathParam("actionUUID") String actionUuId,
+ @PathParam("artifactUUID") String artifactUuId,
+ @Context HttpServletRequest servletRequest);
+
+ @DELETE
+ @Path("/{actionInvariantUUID}/artifacts/{artifactUUID}")
+ @ApiOperation(value = "Delete Artifact")
+ Response deleteArtifact(@PathParam("actionInvariantUUID") String actionInvariantUuId,
+ @PathParam("artifactUUID") String artifactUuId,
+ @Context HttpServletRequest servletRequest);
+
+ @PUT
+ @Path("/{actionInvariantUUID}/artifacts/{artifactUUID}")
+ @ApiOperation(value = "Update an existing artifact")
+ @Consumes(MediaType.MULTIPART_FORM_DATA)
+ Response updateArtifact(@PathParam("actionInvariantUUID") String actionInvariantUuId,
+ @PathParam("artifactUUID") String artifactUuId,
+ @Multipart(value = "artifactName", required = false) String artifactName,
+ @Multipart(value = "artifactLabel", required = false) String artifactLabel,
+ @Multipart(value = "artifactCategory", required = false) String artifactCategory,
+ @Multipart(value = "artifactDescription", required = false) String artifactDescription,
+ @Multipart(value = "artifactProtection", required = false) String artifactProtection,
+ @HeaderParam("Content-MD5") String checksum,
+ @Multipart(value = "updateArtifact", required = false) Attachment artifactToUpdate,
+ @Context HttpServletRequest servletRequest);
+
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/main/java/org/openecomp/sdcrests/action/rest/mapping/MapActionToActionResponseDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/main/java/org/openecomp/sdcrests/action/rest/mapping/MapActionToActionResponseDto.java
new file mode 100644
index 0000000000..27d3f482c7
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/main/java/org/openecomp/sdcrests/action/rest/mapping/MapActionToActionResponseDto.java
@@ -0,0 +1,42 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.action.rest.mapping;
+
+import org.openecomp.sdc.action.types.Action;
+import org.openecomp.sdcrests.action.types.ActionResponseDto;
+import org.openecomp.sdcrests.mapping.MappingBase;
+
+
+/**
+ * Maps Source Action Object To Action Response DTO.
+ */
+public class MapActionToActionResponseDto extends MappingBase<Action, ActionResponseDto> {
+
+ @Override
+ public void doMapping(Action source, ActionResponseDto target) {
+ target.setActionUuId(source.getActionUuId());
+ target.setActionInvariantUuId(source.getActionInvariantUuId());
+ target.setVersion(source.getVersion());
+ if (source.getStatus() != null) {
+ target.setStatus(source.getStatus().name());
+ }
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/main/java/org/openecomp/sdcrests/action/rest/services/ActionsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/main/java/org/openecomp/sdcrests/action/rest/services/ActionsImpl.java
new file mode 100644
index 0000000000..7e9cca0e0b
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/main/java/org/openecomp/sdcrests/action/rest/services/ActionsImpl.java
@@ -0,0 +1,1212 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.action.rest.services;
+
+import static org.openecomp.sdc.action.ActionConstants.ACTION_REQUEST_PARAM_END_POINT_URI;
+import static org.openecomp.sdc.action.ActionConstants.ACTION_REQUEST_PARAM_NAME;
+import static org.openecomp.sdc.action.ActionConstants.ACTION_REQUEST_PARAM_SUPPORTED_COMPONENTS;
+import static org.openecomp.sdc.action.ActionConstants.ACTION_REQUEST_PARAM_SUPPORTED_MODELS;
+import static org.openecomp.sdc.action.ActionConstants.ARTIFACT_FILE;
+import static org.openecomp.sdc.action.ActionConstants.ARTIFACT_NAME;
+import static org.openecomp.sdc.action.ActionConstants.BE_FQDN;
+import static org.openecomp.sdc.action.ActionConstants.CATEGORY_LOG_LEVEL;
+import static org.openecomp.sdc.action.ActionConstants.CLIENT_IP;
+import static org.openecomp.sdc.action.ActionConstants.ERROR_DESCRIPTION;
+import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_CATEGORY;
+import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_ECOMP_COMPONENT;
+import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_MODEL;
+import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_NAME;
+import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_NONE;
+import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_VENDOR;
+import static org.openecomp.sdc.action.ActionConstants.INSTANCE_UUID;
+import static org.openecomp.sdc.action.ActionConstants.LOCAL_ADDR;
+import static org.openecomp.sdc.action.ActionConstants.MAX_ACTION_ARTIFACT_SIZE;
+import static org.openecomp.sdc.action.ActionConstants.MDC_ASDC_INSTANCE_UUID;
+import static org.openecomp.sdc.action.ActionConstants.PARTNER_NAME;
+import static org.openecomp.sdc.action.ActionConstants.REMOTE_HOST;
+import static org.openecomp.sdc.action.ActionConstants.REQUEST_EMPTY_BODY;
+import static org.openecomp.sdc.action.ActionConstants.REQUEST_ID;
+import static org.openecomp.sdc.action.ActionConstants.REQUEST_TYPE_CREATE_ACTION;
+import static org.openecomp.sdc.action.ActionConstants.REQUEST_TYPE_UPDATE_ACTION;
+import static org.openecomp.sdc.action.ActionConstants.REQUEST_TYPE_VERSION_ACTION;
+import static org.openecomp.sdc.action.ActionConstants.SERVICE_INSTANCE_ID;
+import static org.openecomp.sdc.action.ActionConstants.SERVICE_METRIC_BEGIN_TIMESTAMP;
+import static org.openecomp.sdc.action.ActionConstants.SERVICE_NAME;
+import static org.openecomp.sdc.action.ActionConstants.STATUS;
+import static org.openecomp.sdc.action.ActionConstants.STATUS_CODE;
+import static org.openecomp.sdc.action.ActionConstants.SUPPORTED_COMPONENTS_ID;
+import static org.openecomp.sdc.action.ActionConstants.SUPPORTED_MODELS_VERSION_ID;
+import static org.openecomp.sdc.action.ActionConstants.TARGET_ENTITY;
+import static org.openecomp.sdc.action.ActionConstants.TARGET_ENTITY_API;
+import static org.openecomp.sdc.action.ActionConstants.TARGET_SERVICE_NAME;
+import static org.openecomp.sdc.action.ActionConstants.TIMESTAMP;
+import static org.openecomp.sdc.action.ActionConstants.UPDATED_BY;
+import static org.openecomp.sdc.action.ActionConstants.X_ECOMP_INSTANCE_ID_HEADER_PARAM;
+import static org.openecomp.sdc.action.ActionConstants.X_ECOMP_REQUEST_ID_HEADER_PARAM;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_CHECKSUM_ERROR_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_INVALID_NAME;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_INVALID_NAME_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_INVALID_PROTECTION_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_READ_FILE_ERROR;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_TOO_BIG_ERROR;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_TOO_BIG_ERROR_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_NOT_EXIST;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_NOT_EXIST_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_FILTER_MULTIPLE_QUERY_PARAM_NOT_SUPPORTED;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INTERNAL_SERVER_ERR_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INVALID_INSTANCE_ID_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INVALID_PARAM_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INVALID_REQUEST_BODY_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INVALID_REQUEST_ID_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INVALID_SEARCH_CRITERIA;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_MULT_SEARCH_CRITERIA;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_ARTIFACT_CHECKSUM_ERROR;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_ARTIFACT_INVALID_PROTECTION_VALUE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_ARTIFACT_OPERATION_ALLOWED;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_BODY_EMPTY;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_CONTENT_TYPE_INVALID;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_ECOMP_INSTANCE_ID_INVALID;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_ECOMP_REQUEST_ID_INVALID;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_FILTER_PARAM_INVALID;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_INVALID_GENERIC_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_INVALID_NAME;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_MISSING_MANDATORY_PARAM;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_UNSUPPORTED_OPERATION;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_UPDATE_NOT_ALLOWED_CODE;
+import static org.openecomp.sdc.action.util.ActionUtil.actionErrorLogProcessor;
+import static org.openecomp.sdc.action.util.ActionUtil.actionLogPostProcessor;
+
+import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.cxf.jaxrs.ext.multipart.Attachment;
+import org.openecomp.core.logging.api.Logger;
+import org.openecomp.core.logging.api.LoggerFactory;
+import org.openecomp.core.utilities.file.FileUtils;
+import org.openecomp.core.utilities.json.JsonUtil;
+import org.openecomp.sdc.action.ActionConstants;
+import org.openecomp.sdc.action.ActionManager;
+import org.openecomp.sdc.action.errors.ActionErrorConstants;
+import org.openecomp.sdc.action.errors.ActionException;
+import org.openecomp.sdc.action.logging.CategoryLogLevel;
+import org.openecomp.sdc.action.logging.StatusCode;
+import org.openecomp.sdc.action.types.Action;
+import org.openecomp.sdc.action.types.ActionArtifact;
+import org.openecomp.sdc.action.types.ActionArtifactProtection;
+import org.openecomp.sdc.action.types.ActionRequest;
+import org.openecomp.sdc.action.types.EcompComponent;
+import org.openecomp.sdcrests.action.rest.Actions;
+import org.openecomp.sdcrests.action.rest.mapping.MapActionToActionResponseDto;
+import org.openecomp.sdcrests.action.types.ActionResponseDto;
+import org.openecomp.sdcrests.action.types.ActionVersionDto;
+import org.openecomp.sdcrests.action.types.ListResponseWrapper;
+import org.openecomp.sdcrests.wrappers.StringWrapperResponse;
+import org.slf4j.MDC;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Service;
+import org.springframework.validation.annotation.Validated;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.TimeZone;
+import javax.inject.Named;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.core.Response;
+
+
+
+/**
+ * Implements various CRUD API that can be performed on Action.
+ */
+@SuppressWarnings("ALL")
+@Named
+@Service("actions")
+@Scope(value = "prototype")
+@Validated
+public class ActionsImpl implements Actions {
+
+ @Autowired
+ private ActionManager actionManager;
+ private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName());
+
+ private String whitespaceCharacters = "\\s" /* dummy empty string for homogeneity */
+ + "\\u0009" // CHARACTER TABULATION
+ + "\\u000A" // LINE FEED (LF)
+ + "\\u000B" // LINE TABULATION
+ + "\\u000C" // FORM FEED (FF)
+ + "\\u000D" // CARRIAGE RETURN (CR)
+ + "\\u0020" // SPACE
+ + "\\u0085" // NEXT LINE (NEL)
+ + "\\u00A0" // NO-BREAK SPACE
+ + "\\u1680" // OGHAM SPACE MARK
+ + "\\u180E" // MONGOLIAN VOWEL SEPARATOR
+ + "\\u2000" // EN QUAD
+ + "\\u2001" // EM QUAD
+ + "\\u2002" // EN SPACE
+ + "\\u2003" // EM SPACE
+ + "\\u2004" // THREE-PER-EM SPACE
+ + "\\u2005" // FOUR-PER-EM SPACE
+ + "\\u2006" // SIX-PER-EM SPACE
+ + "\\u2007" // FIGURE SPACE
+ + "\\u2008" // PUNCTUATION SPACE
+ + "\\u2009" // THIN SPACE
+ + "\\u200A" // HAIR SPACE
+ + "\\u2028" // LINE SEPARATOR
+ + "\\u2029" // PARAGRAPH SEPARATOR
+ + "\\u202F" // NARROW NO-BREAK SPACE
+ + "\\u205F" // MEDIUM MATHEMATICAL SPACE
+ + "\\u3000" // IDEOGRAPHIC SPACE
+ ;
+ private String invalidFilenameChars = "#<>$+%!`&*'|{}?\"=/:@\\\\";
+ private String whitespaceRegex = ".*[" + whitespaceCharacters + "].*";
+ private String invalidFilenameRegex = ".*[" + whitespaceCharacters + invalidFilenameChars + "].*";
+
+ /**
+ * Calculate the checksum for a given input.
+ *
+ * @param input Byte array for which the checksum has to be calculated.
+ * @return Calculated checksum of the input byte array.
+ */
+ private static String calculateCheckSum(byte[] input) {
+ String checksum = null;
+ if (input != null) {
+ checksum = DigestUtils.md5Hex(input);
+ }
+ return checksum;
+ }
+
+ /**
+ * Convert timestamp to UTC format date string.
+ *
+ * @param timeStamp UTC timestamp to be converted to the UTC Date format.
+ * @return UTC formatted Date string from timestamp.
+ */
+ public static String getUTCDateStringFromTimestamp(Date timeStamp) {
+ DateFormat df = new SimpleDateFormat("dd MMM yyyy kk:mm:ss z");
+ df.setTimeZone(TimeZone.getTimeZone("GMT"));
+ return df.format(timeStamp);
+ }
+ /**
+ * Initialize MDC for logging the current request
+ * @param actionInvariantId Action Invariant Id if available (null otherwise)
+ * @param servletRequest Request Contecxt object
+ * @param requestType Current action request (CRUD of Action, Artifact, Version operations)
+ */
+ private void initializeRequestMDC(HttpServletRequest servletRequest, String actionInvariantId, ActionRequest requestType){
+ MDC.put(REQUEST_ID, servletRequest.getHeader(X_ECOMP_REQUEST_ID_HEADER_PARAM));
+ MDC.put(PARTNER_NAME, servletRequest.getRemoteUser());
+ MDC.put(INSTANCE_UUID, MDC_ASDC_INSTANCE_UUID);
+ MDC.put(SERVICE_METRIC_BEGIN_TIMESTAMP, String.valueOf(System.currentTimeMillis()));
+ MDC.put(STATUS_CODE, StatusCode.COMPLETE.name());
+ MDC.put(SERVICE_NAME, requestType.name());
+ MDC.put(CLIENT_IP, MDC.get(REMOTE_HOST));
+ MDC.put(SERVICE_INSTANCE_ID, actionInvariantId);
+ MDC.put(LOCAL_ADDR, MDC.get("ServerIPAddress"));
+ MDC.put(BE_FQDN, MDC.get("ServerFQDN"));
+
+ if(log.isDebugEnabled())
+ MDC.put(CATEGORY_LOG_LEVEL, CategoryLogLevel.DEBUG.name());
+ else if(log.isInfoEnabled())
+ MDC.put(CATEGORY_LOG_LEVEL, CategoryLogLevel.INFO.name());
+ else if(log.isWarnEnabled())
+ MDC.put(CATEGORY_LOG_LEVEL, CategoryLogLevel.WARN.name());
+ else if(log.isErrorEnabled())
+ MDC.put(CATEGORY_LOG_LEVEL, CategoryLogLevel.ERROR.name());
+ }
+
+ @Override
+ public Response getActionsByActionInvariantUuId(String invariantId, String actionUuId,
+ HttpServletRequest servletRequest) {
+ ListResponseWrapper responseList = new ListResponseWrapper();
+
+ try{
+ log.debug(" entering getActionsByActionInvariantUUID ");
+ initializeRequestMDC(servletRequest, invariantId, ActionRequest.GET_ACTIONS_INVARIANT_ID);
+ MDC.put(SERVICE_INSTANCE_ID, invariantId);
+
+ if(StringUtils.isEmpty(servletRequest.getQueryString())){
+ responseList = getActionsByInvId(servletRequest,invariantId);
+ } else{
+ Response response = getActionByUUID(servletRequest, invariantId, actionUuId);
+ actionLogPostProcessor(StatusCode.COMPLETE, true);
+ return response;
+ }
+ } catch (ActionException e){
+ actionLogPostProcessor(StatusCode.ERROR, e.getErrorCode(), e.getDescription(), true);
+ actionErrorLogProcessor(CategoryLogLevel.ERROR, e.getErrorCode(), e.getDescription());
+ log.error("");
+ throw e;
+ } catch (Exception e){
+ actionLogPostProcessor(StatusCode.ERROR, true);
+ actionErrorLogProcessor(CategoryLogLevel.ERROR, ACTION_INTERNAL_SERVER_ERR_CODE, ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG);
+ log.error("");
+ throw e;
+ } finally {
+ finalAuditMetricsLogProcessor(ActionRequest.GET_ACTIONS_INVARIANT_ID.name());
+ }
+
+ log.debug(" exit getActionsByActionInvariantUUID " );
+ actionLogPostProcessor(StatusCode.COMPLETE, true);
+ return Response.ok(responseList).build();
+ }
+
+ private ListResponseWrapper getActionsByInvId(HttpServletRequest servletRequest, String invariantId){
+ log.debug(" entering getActionsByInvId with invariantId= " + invariantId );
+ ListResponseWrapper responseList = new ListResponseWrapper();
+ if(StringUtils.isEmpty(servletRequest.getQueryString())){
+ Map<String, String> errorMap = validateRequestHeaders(servletRequest);
+ Map<String, String> queryParamErrors = validateQueryParam(invariantId);
+ errorMap.putAll(queryParamErrors);
+ if(errorMap.isEmpty()) {
+ List<Action> actions = actionManager.getActionsByActionInvariantUuId(invariantId);
+ List<ActionResponseDto> versionList = new ArrayList<ActionResponseDto>();
+ for (Action action : actions) {
+ ActionResponseDto responseDTO = createResponseDTO(action);
+ versionList.add(responseDTO);
+ }
+ responseList .setVersions(versionList);
+ responseList.setActionList(null);
+
+ } else{
+ checkAndThrowError(errorMap);
+ }
+ }
+ log.debug(" exit getActionsByInvId with invariantId= " + invariantId );
+ return responseList;
+ }
+
+ private Response getActionByUUID(HttpServletRequest servletRequest, String invariantID, String actionUUID) throws ActionException{
+ int noOfFilterParams = 0;
+ Response response = null;
+ log.debug(" entering getActionByUUID with invariantID= " + invariantID + " and actionUUID= " + actionUUID);
+ if(!StringUtils.isEmpty(actionUUID)) {
+ noOfFilterParams ++;
+ response = getActionsByUniqueID(actionUUID, servletRequest, invariantID);
+ }
+ if(noOfFilterParams == 0)
+ throw new ActionException(ACTION_INVALID_SEARCH_CRITERIA, ACTION_REQUEST_FILTER_PARAM_INVALID);
+
+ log.debug(" exit getActionByUUID with invariantID= " + invariantID + " and actionUUID= " + actionUUID);
+ return response;
+ }
+
+ private void finalAuditMetricsLogProcessor(String targetServiceName) {
+ MDC.put(TARGET_SERVICE_NAME, targetServiceName);
+ MDC.put(TARGET_ENTITY, TARGET_ENTITY_API);
+ log.metrics("");
+ log.audit("");
+ }
+
+ @Override
+ public Response getEcompComponents(HttpServletRequest servletRequest) {
+ try {
+ log.debug(" entering getECOMPComponents ");
+ initializeRequestMDC(servletRequest, "", ActionRequest.GET_ECOMP_COMPONENTS);
+ //Validate request syntax before passing to the manager
+ Map<String, String> errorMap = validateRequestHeaders(servletRequest);
+ checkAndThrowError(errorMap);
+ ListResponseWrapper response = new ListResponseWrapper();
+ List<EcompComponent> ecompComponents = actionManager.getEcompComponents();
+ response.setActionList(null);
+ response.setComponentList(ecompComponents);
+ log.debug(" exit getECOMPComponents ");
+ actionLogPostProcessor(StatusCode.COMPLETE, true);
+ return Response.ok(response).build();
+ }catch (ActionException e){
+ actionLogPostProcessor(StatusCode.ERROR, e.getErrorCode(), e.getDescription(), true);
+ actionErrorLogProcessor(CategoryLogLevel.ERROR, e.getErrorCode(), e.getDescription());
+ log.error("");
+ throw e;
+ }
+ catch (Exception e){
+ actionLogPostProcessor(StatusCode.ERROR, true);
+ actionErrorLogProcessor(CategoryLogLevel.ERROR, ACTION_INTERNAL_SERVER_ERR_CODE, ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG);
+ log.error("");
+ throw e;
+ }
+ finally {
+ finalAuditMetricsLogProcessor(ActionRequest.GET_ECOMP_COMPONENTS.name());
+ }
+ }
+
+ @Override
+ public Response getFilteredActions(String vendor, String category, String name, String modelId,
+ String componentId, HttpServletRequest servletRequest) {
+ try {
+ log.debug(" entering getFilteredActions ");
+ int noOfFilterParams = 0;
+ Response response = null;
+ initializeRequestMDC(servletRequest, "", ActionRequest.GET_FILTERED_ACTIONS);
+ if (!StringUtils.isEmpty(vendor)) {
+ noOfFilterParams++;
+ }
+ if (!StringUtils.isEmpty(category)) {
+ noOfFilterParams++;
+ }
+ if (!StringUtils.isEmpty(name)) {
+ noOfFilterParams++;
+ }
+ if (!StringUtils.isEmpty(modelId)) {
+ noOfFilterParams++;
+ }
+ if (!StringUtils.isEmpty(componentId)) {
+ noOfFilterParams++;
+ }
+ if (StringUtils.isEmpty(servletRequest.getQueryString())) {
+ response = getAllActions(servletRequest);
+ log.debug(" exit getFilteredActions ");
+ actionLogPostProcessor(StatusCode.COMPLETE, true);
+ return response;
+ }
+ if (noOfFilterParams > 1) {
+ throw new ActionException(ACTION_MULT_SEARCH_CRITERIA,
+ ACTION_FILTER_MULTIPLE_QUERY_PARAM_NOT_SUPPORTED);
+ }
+ if (noOfFilterParams == 0) {
+ throw new ActionException(ACTION_INVALID_SEARCH_CRITERIA,
+ ACTION_REQUEST_FILTER_PARAM_INVALID);
+ }
+ ListResponseWrapper responseList = null;
+ if (!StringUtils.isEmpty(vendor)) {
+ response = getActionsByVendor(vendor, servletRequest);
+ } else if (!StringUtils.isEmpty(category)) {
+ response = getActionsByCategory(category, servletRequest);
+ } else if (!StringUtils.isEmpty(name)) {
+ response = getActionsByName(name, servletRequest);
+ } else if (!StringUtils.isEmpty(modelId)) {
+ response = getActionsByModel(modelId, servletRequest);
+ } else if (!StringUtils.isEmpty(componentId)) {
+ response = getActionsByECOMPComponent(componentId, servletRequest);
+ } else {
+ throw new ActionException(ACTION_INVALID_PARAM_CODE, ACTION_REQUEST_FILTER_PARAM_INVALID);
+ }
+ log.debug(" exit getFilteredActions ");
+ actionLogPostProcessor(StatusCode.COMPLETE, true);
+ return response;
+ }
+ catch (ActionException e){
+ actionLogPostProcessor(StatusCode.ERROR, e.getErrorCode(), e.getDescription(), true);
+ actionErrorLogProcessor(CategoryLogLevel.ERROR, e.getErrorCode(), e.getDescription());
+ log.error("");
+ throw e;
+ }
+ catch (Exception e){
+ actionLogPostProcessor(StatusCode.ERROR, true);
+ actionErrorLogProcessor(CategoryLogLevel.ERROR, ACTION_INTERNAL_SERVER_ERR_CODE, ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG);
+ log.error("");
+ throw e;
+ }
+ finally {
+ finalAuditMetricsLogProcessor(ActionRequest.GET_FILTERED_ACTIONS.name());
+ }
+ }
+
+ @Override
+ public Response createAction(String requestJson, HttpServletRequest servletRequest) {
+ try {
+ initializeRequestMDC(servletRequest, null, ActionRequest.CREATE_ACTION);
+ log.debug(" entering API createAction ");
+ Map<String, String> errorMap = validateRequestHeaders(servletRequest);
+ Map<String, String> requestBodyErrors =
+ validateRequestBody(REQUEST_TYPE_CREATE_ACTION, requestJson);
+ errorMap.putAll(requestBodyErrors);
+ ActionResponseDto actionResponseDto = new ActionResponseDto();
+ if (errorMap.isEmpty()) {
+ String user = servletRequest.getRemoteUser();
+ Action action = JsonUtil.json2Object(requestJson, Action.class);
+ action.setData(requestJson);
+ Action responseAction = actionManager.createAction(action, user);
+ MDC.put(SERVICE_INSTANCE_ID, responseAction.getActionInvariantUuId());
+ new MapActionToActionResponseDto().doMapping(responseAction, actionResponseDto);
+ } else {
+ checkAndThrowError(errorMap);
+ }
+ actionLogPostProcessor(StatusCode.COMPLETE, true);
+ log.debug(" exit API createAction with ActionInvariantUUID= " + MDC.get(SERVICE_INSTANCE_ID));
+ return Response.ok(actionResponseDto).build();
+ }catch (ActionException e){
+ actionLogPostProcessor(StatusCode.ERROR, e.getErrorCode(), e.getDescription(), true);
+ actionErrorLogProcessor(CategoryLogLevel.ERROR, e.getErrorCode(), e.getDescription());
+ log.error("");
+ throw e;
+ }catch (Exception e){
+ actionLogPostProcessor(StatusCode.ERROR, true);
+ actionErrorLogProcessor(CategoryLogLevel.ERROR, ACTION_INTERNAL_SERVER_ERR_CODE, ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG);
+ log.error(e.getMessage());
+ throw e;
+ }finally {
+ finalAuditMetricsLogProcessor(ActionRequest.CREATE_ACTION.name());
+ }
+
+ }
+
+ @Override
+ public Response updateAction(String actionInvariantUuId, String requestJson,
+ HttpServletRequest servletRequest) {
+ try {
+ initializeRequestMDC(servletRequest, actionInvariantUuId, ActionRequest.UPDATE_ACTION);
+ log.debug(" entering API updateAction ");
+ Map<String, String> errorMap = validateRequestHeaders(servletRequest);
+ Map<String, String> requestBodyErrors =
+ validateRequestBody(REQUEST_TYPE_UPDATE_ACTION, requestJson);
+ errorMap.putAll(requestBodyErrors);
+ ActionResponseDto actionResponseDto = new ActionResponseDto();
+ if (errorMap.isEmpty()) {
+ String user = servletRequest.getRemoteUser();
+ Action action = JsonUtil.json2Object(requestJson, Action.class);
+ action.setActionInvariantUuId(actionInvariantUuId);
+ action.setData(requestJson);
+ Action updatedAction = actionManager.updateAction(action, user);
+ new MapActionToActionResponseDto().doMapping(updatedAction, actionResponseDto);
+ } else {
+ checkAndThrowError(errorMap);
+ }
+ actionLogPostProcessor(StatusCode.COMPLETE, true);
+ log.debug(" exit API updateAction ");
+ return Response.ok(actionResponseDto).build();
+ }catch (ActionException e){
+ actionLogPostProcessor(StatusCode.ERROR, e.getErrorCode(), e.getDescription(), true);
+ actionErrorLogProcessor(CategoryLogLevel.ERROR, e.getErrorCode(), e.getDescription());
+ log.error("");
+ throw e;
+ }catch (Exception e){
+ actionLogPostProcessor(StatusCode.ERROR, true);
+ actionErrorLogProcessor(CategoryLogLevel.ERROR, ACTION_INTERNAL_SERVER_ERR_CODE, ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG);
+ log.error(e.getMessage());
+ throw e;
+ }finally {
+ finalAuditMetricsLogProcessor(ActionRequest.UPDATE_ACTION.name());
+ }
+ }
+
+ @Override
+ public Response deleteAction(String actionInvariantUuId, HttpServletRequest servletRequest) {
+ try {
+ log.debug(" entering API deleteAction ");
+ initializeRequestMDC(servletRequest, actionInvariantUuId, ActionRequest.DELETE_ACTION);
+ Map<String, String> errorMap = validateRequestHeaders(servletRequest);
+ if (errorMap.isEmpty()) {
+ String user = servletRequest.getRemoteUser();
+ actionManager.deleteAction(actionInvariantUuId, user);
+ } else {
+ checkAndThrowError(errorMap);
+ }
+ actionLogPostProcessor(StatusCode.COMPLETE, true);
+ log.debug(" exit API deleteAction ");
+ return Response.ok(new ActionResponseDto()).build();
+ }catch (ActionException e){
+ actionLogPostProcessor(StatusCode.ERROR, e.getErrorCode(), e.getDescription(), true);
+ actionErrorLogProcessor(CategoryLogLevel.ERROR, e.getErrorCode(), e.getDescription());
+ log.error(MDC.get(ERROR_DESCRIPTION));
+ throw e;
+ }catch (Exception e){
+ actionLogPostProcessor(StatusCode.ERROR,true);
+ actionErrorLogProcessor(CategoryLogLevel.ERROR, ACTION_INTERNAL_SERVER_ERR_CODE, ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG);
+ log.error(e.getMessage());
+ throw e;
+ }finally {
+ finalAuditMetricsLogProcessor(ActionRequest.DELETE_ACTION.name());
+ }
+ }
+
+ @Override
+ public Response actOnAction(String actionInvariantUuId, String requestJson,
+ HttpServletRequest servletRequest) {
+ Response response = null;
+ try {
+ initializeRequestMDC(servletRequest,actionInvariantUuId,ActionRequest.ACTION_VERSIONING);
+ log.debug("entering actOnAction with invariantUUID= "+ actionInvariantUuId + " and requestJSON= "+ requestJson );
+ Map<String, String> errorMap = validateRequestHeaders(servletRequest);
+ Map<String, String> requestBodyErrors =
+ validateRequestBody(REQUEST_TYPE_VERSION_ACTION, requestJson);
+ errorMap.putAll(requestBodyErrors);
+ ActionVersionDto versionDTO = JsonUtil.json2Object(requestJson, ActionVersionDto.class);
+ checkAndThrowError(errorMap);
+
+ String status = versionDTO.getStatus();
+ Action action = new Action();
+ String user = servletRequest.getRemoteUser();
+ switch (status) {
+ case "Checkout":
+ action = actionManager.checkout(actionInvariantUuId, user);
+ break;
+ case "Undo_Checkout":
+ actionManager.undoCheckout(actionInvariantUuId, user);
+ StringWrapperResponse responseText = new StringWrapperResponse();
+ responseText.setValue(ActionConstants.UNDO_CHECKOUT_RESPONSE_TEXT);
+ response = Response
+ .status(Response.Status.OK)
+ .entity(responseText)
+ .build();
+ return response;
+ case "Checkin":
+ action = actionManager.checkin(actionInvariantUuId, user);
+ break;
+ case "Submit":
+ action = actionManager.submit(actionInvariantUuId, user);
+ break;
+ default:
+ throw new ActionException(ACTION_INVALID_PARAM_CODE,
+ String.format(ACTION_UNSUPPORTED_OPERATION, status));
+ }
+
+ ActionResponseDto actionResponseDto = new ActionResponseDto();
+ new MapActionToActionResponseDto().doMapping(action, actionResponseDto);
+ response = Response.ok(actionResponseDto).build();
+ actionLogPostProcessor(StatusCode.COMPLETE,true);
+ }catch (ActionException e){
+ actionLogPostProcessor(StatusCode.ERROR, e.getErrorCode(), e.getDescription(), true);
+ actionErrorLogProcessor(CategoryLogLevel.ERROR, e.getErrorCode(), e.getDescription());
+ log.error(MDC.get(ERROR_DESCRIPTION));
+ throw e;
+ }catch (Exception e){
+ actionLogPostProcessor(StatusCode.ERROR,true);
+ actionErrorLogProcessor(CategoryLogLevel.ERROR, ACTION_INTERNAL_SERVER_ERR_CODE, ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG);
+ log.error(e.getMessage());
+ throw e;
+ }finally {
+ finalAuditMetricsLogProcessor(ActionRequest.ACTION_VERSIONING.name());
+ log.debug("exit actOnAction with invariantUUID= "+ actionInvariantUuId + " and requestJSON= "+ requestJson );
+ }
+ return response;
+ }
+
+ @Override
+ public Response uploadArtifact(String actionInvariantUuId,
+ String artifactName,
+ String artifactLabel,
+ String artifactCategory,
+ String artifactDescription,
+ String artifactProtection,
+ String checksum,
+ Attachment artifactToUpload,
+ HttpServletRequest servletRequest) {
+ Response response = null;
+ try {
+ initializeRequestMDC(servletRequest,actionInvariantUuId, ActionRequest.UPLOAD_ARTIFACT);
+ log.debug("entering uploadArtifact with actionInvariantUUID= "+ actionInvariantUuId + "artifactName= "+ artifactName );
+ response = uploadArtifactInternal(actionInvariantUuId, artifactName, artifactLabel, artifactCategory, artifactDescription, artifactProtection, checksum, artifactToUpload, servletRequest);
+ actionLogPostProcessor(StatusCode.COMPLETE,true);
+ log.debug("exiting uploadArtifact with actionInvariantUUID= "+ actionInvariantUuId + "artifactName= "+ artifactName );
+ }catch (ActionException e){
+ actionLogPostProcessor(StatusCode.ERROR, e.getErrorCode(), e.getDescription(), true);
+ actionErrorLogProcessor(CategoryLogLevel.ERROR, e.getErrorCode(), e.getDescription());
+ log.error(MDC.get(ERROR_DESCRIPTION));
+ throw e;
+ }catch (Exception e){
+ actionLogPostProcessor(StatusCode.ERROR,true);
+ actionErrorLogProcessor(CategoryLogLevel.ERROR, ACTION_INTERNAL_SERVER_ERR_CODE, ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG);
+ log.error(e.getMessage());
+ throw e;
+ }finally {
+ finalAuditMetricsLogProcessor(ActionRequest.UPLOAD_ARTIFACT.name());
+ }
+ log.debug("exiting uploadArtifact with actionInvariantUUID= "+ actionInvariantUuId + "artifactName= "+ artifactName );
+ return response;
+ }
+
+ private Response uploadArtifactInternal(String actionInvariantUuId,
+ String artifactName,
+ String artifactLabel,
+ String artifactCategory,
+ String artifactDescription,
+ String artifactProtection,
+ String checksum,
+ Attachment artifactToUpload,
+ HttpServletRequest servletRequest) {
+ ListResponseWrapper responseList = null;
+ byte[] payload = null;
+ Map<String, String> errorMap = validateRequestHeaders(servletRequest);
+ //Artifact name empty validation
+ if(StringUtils.isEmpty(artifactName)){
+ errorMap.put(ACTION_REQUEST_INVALID_GENERIC_CODE, ACTION_REQUEST_MISSING_MANDATORY_PARAM + ARTIFACT_NAME);
+ }else{
+ //Artifact name syntax check for whitespaces and invalid characters
+ if(artifactName.matches(invalidFilenameRegex)){
+ errorMap.put(ACTION_ARTIFACT_INVALID_NAME_CODE, ACTION_ARTIFACT_INVALID_NAME);
+ }
+ }
+
+ //Content-Type Header Validation
+ String contentType = servletRequest.getContentType();
+ if(StringUtils.isEmpty(contentType)){
+ errorMap.put(ACTION_REQUEST_INVALID_GENERIC_CODE, ACTION_REQUEST_CONTENT_TYPE_INVALID);
+ }
+
+ if(artifactToUpload == null){
+ throw new ActionException(ACTION_REQUEST_INVALID_GENERIC_CODE, ACTION_REQUEST_MISSING_MANDATORY_PARAM + ARTIFACT_FILE);
+ }
+
+ InputStream artifactInputStream = null;
+ try {
+ artifactInputStream = artifactToUpload.getDataHandler().getInputStream();
+ } catch (IOException e) {
+ throw new ActionException(ACTION_INTERNAL_SERVER_ERR_CODE, ACTION_ARTIFACT_READ_FILE_ERROR);
+ }
+
+ payload = FileUtils.toByteArray(artifactInputStream);
+ //Validate Artifact size
+ if(payload != null && payload.length > MAX_ACTION_ARTIFACT_SIZE){
+ throw new ActionException(ACTION_ARTIFACT_TOO_BIG_ERROR_CODE, ACTION_ARTIFACT_TOO_BIG_ERROR);
+ }
+
+ //Validate Checksum
+ if(StringUtils.isEmpty(checksum) || !checksum.equalsIgnoreCase(calculateCheckSum(payload))){
+ errorMap.put(ACTION_ARTIFACT_CHECKSUM_ERROR_CODE, ACTION_REQUEST_ARTIFACT_CHECKSUM_ERROR);
+ }
+
+ //Validate artifact protection values
+ if(StringUtils.isEmpty(artifactProtection))
+ artifactProtection = ActionArtifactProtection.readWrite.name();
+
+ if(!artifactProtection.equals(ActionArtifactProtection.readOnly.name()) && !artifactProtection.equals(ActionArtifactProtection.readWrite.name())){
+ errorMap.put(ACTION_ARTIFACT_INVALID_PROTECTION_CODE, ACTION_REQUEST_ARTIFACT_INVALID_PROTECTION_VALUE);
+ }
+
+ ActionArtifact uploadedArtifact = new ActionArtifact();
+ if(errorMap.isEmpty()){
+ String user = servletRequest.getRemoteUser();
+ ActionArtifact upload = new ActionArtifact();
+ upload.setArtifactName(artifactName);
+ upload.setArtifactLabel(artifactLabel);
+ upload.setArtifactDescription(artifactDescription);
+ upload.setArtifact(payload);
+ upload.setArtifactCategory(artifactCategory);
+ upload.setArtifactProtection(artifactProtection);
+ uploadedArtifact = actionManager.uploadArtifact(upload, actionInvariantUuId, user);
+ }
+ else{
+ checkAndThrowError(errorMap);
+ }
+ return Response.ok(uploadedArtifact).build();
+ }
+
+ @Override
+ public Response downloadArtifact(String actionUuId, String artifactUuId,
+ HttpServletRequest servletRequest) {
+ Response response = null;
+ try {
+ initializeRequestMDC(servletRequest, "", ActionRequest.DOWNLOAD_ARTIFACT);
+ log.debug(" entering downloadArtifact with actionUUID= " + actionUuId + " and artifactUUID= " + artifactUuId);
+ response = downloadArtifactInternal(actionUuId, artifactUuId, servletRequest);
+ actionLogPostProcessor(StatusCode.COMPLETE, true);
+ }catch (ActionException e){
+ actionLogPostProcessor(StatusCode.ERROR, e.getErrorCode(), e.getDescription(), true);
+ actionErrorLogProcessor(CategoryLogLevel.ERROR, e.getErrorCode(), e.getDescription());
+ log.error(MDC.get(ERROR_DESCRIPTION));
+ throw e;
+ }catch (Exception e){
+ actionLogPostProcessor(StatusCode.ERROR,true);
+ actionErrorLogProcessor(CategoryLogLevel.ERROR, ACTION_INTERNAL_SERVER_ERR_CODE, ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG);
+ log.error(e.getMessage());
+ throw e;
+ }finally {
+ finalAuditMetricsLogProcessor(ActionRequest.DOWNLOAD_ARTIFACT.name());
+ }
+ log.debug(" exit downloadArtifact with actionUUID= " + actionUuId + " and artifactUUID= " + artifactUuId);
+ return response;
+ }
+
+ public Response downloadArtifactInternal(String actionUuId, String artifactUuId,
+ HttpServletRequest servletRequest) {
+ ActionArtifact actionartifact = null;
+ Map<String, String> errorMap = validateRequestHeaders(servletRequest);
+ Map<String, String> queryParamErrors = validateQueryParam(actionUuId);
+ errorMap.putAll(queryParamErrors);
+ queryParamErrors = validateQueryParam(artifactUuId);
+ errorMap.putAll(queryParamErrors);
+ if (errorMap.isEmpty()) {
+ actionartifact = actionManager.downloadArtifact(actionUuId, artifactUuId);
+ } else {
+ checkAndThrowError(errorMap);
+ }
+
+ return createArtifactDownloadResponse(actionartifact);
+ }
+
+ @Override
+ public Response deleteArtifact(String actionInvariantUuId, String artifactUuId,
+ HttpServletRequest servletRequest) {
+ Response response=null;
+ try {
+ initializeRequestMDC(servletRequest, actionInvariantUuId, ActionRequest.DELETE_ARTIFACT);
+ log.debug(" entering deleteArtifact with actionInvariantUUID= " + actionInvariantUuId + " and artifactUUID= " + artifactUuId);
+ response = deleteArtifactInternal(actionInvariantUuId, artifactUuId, servletRequest);
+ log.debug(" exit deleteArtifact with actionInvariantUUID= " + actionInvariantUuId + " and artifactUUID= " + artifactUuId);
+ actionLogPostProcessor(StatusCode.COMPLETE, true);
+ }catch (ActionException e){
+ actionLogPostProcessor(StatusCode.ERROR, e.getErrorCode(), e.getDescription(), true);
+ actionErrorLogProcessor(CategoryLogLevel.ERROR, e.getErrorCode(), e.getDescription());
+ log.error(MDC.get(ERROR_DESCRIPTION));
+ throw e;
+ }catch (Exception e){
+ actionLogPostProcessor(StatusCode.ERROR,true);
+ actionErrorLogProcessor(CategoryLogLevel.ERROR, ACTION_INTERNAL_SERVER_ERR_CODE, ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG);
+ log.error(e.getMessage());
+ throw e;
+ }finally {
+ finalAuditMetricsLogProcessor(ActionRequest.DELETE_ARTIFACT.name());
+ }
+ return response;
+ }
+
+ public Response deleteArtifactInternal(String actionInvariantUuId, String artifactUuId,
+ HttpServletRequest servletRequest) {
+ Map<String, String> errorMap = validateRequestHeaders(servletRequest);
+ Map<String, String> queryParamErrors = validateQueryParam(actionInvariantUuId);
+ errorMap.putAll(queryParamErrors);
+ queryParamErrors = validateQueryParam(artifactUuId);
+ errorMap.putAll(queryParamErrors);
+ if (errorMap.isEmpty()) {
+ actionManager
+ .deleteArtifact(actionInvariantUuId, artifactUuId, servletRequest.getRemoteUser());
+ } else {
+ checkAndThrowError(errorMap);
+ }
+ return Response.ok().build();
+ }
+
+ @Override
+ public Response updateArtifact(String actionInvariantUuId, String artifactUuId,
+ String artifactName, String artifactLabel, String artifactCategory,
+ String artifactDescription, String artifactProtection,
+ String checksum, Attachment artifactToUpdate,
+ HttpServletRequest servletRequest) {
+ Response response=null;
+ log.debug(" entering updateArtifact with actionInvariantUUID= " + actionInvariantUuId + " and artifactUUID= " + artifactUuId + " and artifactName= "+artifactName+" and artifactLabel= "+ artifactLabel+" and artifactCategory= "+artifactCategory+" and artifactDescription= "+artifactDescription+" and artifactProtection= "+artifactProtection+" and checksum= "+checksum);
+ try {
+ initializeRequestMDC(servletRequest, actionInvariantUuId, ActionRequest.UPDATE_ARTIFACT);
+ response = updateArtifactInternal(actionInvariantUuId, artifactUuId, artifactName, artifactLabel, artifactCategory, artifactDescription, artifactProtection, checksum, artifactToUpdate, servletRequest);
+ actionLogPostProcessor(StatusCode.COMPLETE, true);
+ }catch (ActionException e){
+ actionLogPostProcessor(StatusCode.ERROR, e.getErrorCode(), e.getDescription(), true);
+ actionErrorLogProcessor(CategoryLogLevel.ERROR, e.getErrorCode(), e.getDescription());
+ log.error(MDC.get(ERROR_DESCRIPTION));
+ throw e;
+ }catch (Exception e){
+ actionLogPostProcessor(StatusCode.ERROR,true);
+ actionErrorLogProcessor(CategoryLogLevel.ERROR, ACTION_INTERNAL_SERVER_ERR_CODE, ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG);
+ log.error(e.getMessage());
+ throw e;
+ }finally {
+ finalAuditMetricsLogProcessor(ActionRequest.UPDATE_ARTIFACT.name());
+ }
+ log.debug(" exit updateArtifact with actionInvariantUUID= " + actionInvariantUuId + " and artifactUUID= " + artifactUuId + " and artifactName= "+artifactName+" and artifactLabel= "+ artifactLabel+" and artifactCategory= "+artifactCategory+" and artifactDescription= "+artifactDescription+" and artifactProtection= "+artifactProtection+" and checksum= "+checksum);
+ return response;
+ }
+
+ public Response updateArtifactInternal(String actionInvariantUuId, String artifactUuId,
+ String artifactName, String artifactLabel, String artifactCategory,
+ String artifactDescription, String artifactProtection,
+ String checksum, Attachment artifactToUpdate,
+ HttpServletRequest servletRequest) {
+ byte[] payload = null;
+ Map<String, String> errorMap = validateRequestHeaders(servletRequest);
+ //Content-Type Header Validation
+ String contentType = servletRequest.getContentType();
+ if (StringUtils.isEmpty(contentType)) {
+ errorMap.put(ACTION_REQUEST_INVALID_GENERIC_CODE, ACTION_REQUEST_CONTENT_TYPE_INVALID);
+ }
+
+ if (artifactToUpdate != null) {
+ InputStream artifactInputStream = null;
+ try {
+ artifactInputStream = artifactToUpdate.getDataHandler().getInputStream();
+ } catch (IOException e) {
+ throw new ActionException(ACTION_INTERNAL_SERVER_ERR_CODE, ACTION_ARTIFACT_READ_FILE_ERROR);
+ }
+
+ payload = FileUtils.toByteArray(artifactInputStream);
+ //Validate Artifact size
+ if (payload != null && payload.length > MAX_ACTION_ARTIFACT_SIZE) {
+ throw new ActionException(ACTION_ARTIFACT_TOO_BIG_ERROR_CODE,
+ ACTION_ARTIFACT_TOO_BIG_ERROR);
+ }
+
+ //Validate Checksum
+ if (StringUtils.isEmpty(checksum) || !checksum.equalsIgnoreCase(calculateCheckSum(payload))) {
+ errorMap.put(ACTION_ARTIFACT_CHECKSUM_ERROR_CODE, ACTION_REQUEST_ARTIFACT_CHECKSUM_ERROR);
+ }
+ }
+
+ if (artifactProtection != null && (artifactProtection.isEmpty() ||
+ (!artifactProtection.equals(ActionArtifactProtection.readOnly.name()) &&
+ !artifactProtection.equals(ActionArtifactProtection.readWrite.name())))) {
+ errorMap.put(ACTION_ARTIFACT_INVALID_PROTECTION_CODE,
+ ACTION_REQUEST_ARTIFACT_INVALID_PROTECTION_VALUE);
+ }
+
+ ActionArtifact updateArtifact = new ActionArtifact();
+ if (errorMap.isEmpty()) {
+ String user = servletRequest.getRemoteUser();
+ ActionArtifact update = new ActionArtifact();
+ update.setArtifactUuId(artifactUuId);
+ update.setArtifactName(artifactName);
+ update.setArtifactLabel(artifactLabel);
+ update.setArtifactDescription(artifactDescription);
+ update.setArtifact(payload);
+ update.setArtifactCategory(artifactCategory);
+ update.setArtifactProtection(artifactProtection);
+ actionManager.updateArtifact(update, actionInvariantUuId, user);
+ } else {
+ checkAndThrowError(errorMap);
+ }
+ return Response.ok().build();
+ //return Response.status(Response.Status.OK).entity("Artifact successfully updated").build();
+ }
+
+ /**
+ * Get List of all actions
+ */
+ private Response getAllActions(HttpServletRequest servletRequest) {
+ ListResponseWrapper responseList = null;
+ Map<String, String> errorMap = validateRequestHeaders(servletRequest);
+ if (errorMap.isEmpty()) {
+ List<Action> actions = actionManager.getFilteredActions(FILTER_TYPE_NONE, null);
+ responseList = createResponse(actions);
+ } else {
+ checkAndThrowError(errorMap);
+ }
+
+ return Response.ok(responseList).build();
+ }
+
+ /**
+ * Get Actions by ECOMP component ID
+ */
+ private Response getActionsByECOMPComponent(String componentID,
+ HttpServletRequest servletRequest) {
+ ListResponseWrapper responseList = null;
+ Map<String, String> errorMap = validateRequestHeaders(servletRequest);
+ ;
+ Map<String, String> queryParamErrors = validateQueryParam(componentID);
+ errorMap.putAll(queryParamErrors);
+ if (errorMap.isEmpty()) {
+ List<Action> actions =
+ actionManager.getFilteredActions(FILTER_TYPE_ECOMP_COMPONENT, componentID);
+ responseList = createResponse(actions);
+ } else {
+ checkAndThrowError(errorMap);
+ }
+ return Response.ok(responseList).build();
+ }
+
+ /**
+ * Get Actions by Model ID
+ */
+ private Response getActionsByModel(String modelId, HttpServletRequest servletRequest) {
+ ListResponseWrapper responseList = null;
+ Map<String, String> errorMap = validateRequestHeaders(servletRequest);
+ Map<String, String> queryParamErrors = validateQueryParam(modelId);
+ errorMap.putAll(queryParamErrors);
+ if (errorMap.isEmpty()) {
+ List<Action> actions = actionManager.getFilteredActions(FILTER_TYPE_MODEL, modelId);
+ responseList = createResponse(actions);
+ } else {
+ checkAndThrowError(errorMap);
+ }
+ return Response.ok(responseList).build();
+ }
+
+ /**
+ * Get all actions with given action name
+ */
+ private Response getActionsByName(String name, HttpServletRequest servletRequest) {
+ ListResponseWrapper responseList = null;
+ Map<String, String> errorMap = validateRequestHeaders(servletRequest);
+ Map<String, String> queryParamErrors = validateQueryParam(name);
+ errorMap.putAll(queryParamErrors);
+ if (errorMap.isEmpty()) {
+ List<Action> actions = actionManager.getFilteredActions(FILTER_TYPE_NAME, name);
+ responseList = createResponse(actions);
+ } else {
+ checkAndThrowError(errorMap);
+ }
+ return Response.ok(responseList).build();
+ }
+
+ /**
+ * Get an action with given ActionUUID
+ */
+ private Response getActionsByUniqueID(String actionUUID, HttpServletRequest servletRequest,
+ String actionInvariantUUID) {
+ Map<String, String> errorMap = validateRequestHeaders(servletRequest);
+ Map<String, Object> responseDTO = new LinkedHashMap<>();
+ Map<String, String> queryParamErrors = validateQueryParam(actionUUID);
+ errorMap.putAll(queryParamErrors);
+ if (errorMap.isEmpty()) {
+ Action action = actionManager.getActionsByActionUuId(actionUUID);
+ if (action.getActionInvariantUuId() != null &&
+ action.getActionInvariantUuId().equalsIgnoreCase(actionInvariantUUID)) {
+ responseDTO = JsonUtil.json2Object(action.getData(), LinkedHashMap.class);
+ responseDTO.put(STATUS, action.getStatus().name());
+ responseDTO.put(TIMESTAMP, getUTCDateStringFromTimestamp(action.getTimestamp()));
+ responseDTO.put(UPDATED_BY, action.getUser());
+ } else {
+ throw new ActionException(ACTION_ENTITY_NOT_EXIST_CODE, ACTION_ENTITY_NOT_EXIST);
+ }
+ } else {
+ checkAndThrowError(errorMap);
+ }
+ return Response.ok(responseDTO).build();
+ }
+
+ /**
+ * Get all actions with given Vendor Name
+ */
+ private Response getActionsByVendor(String vendor, HttpServletRequest servletRequest) {
+ //Validate request syntax before passing to the manager
+ ListResponseWrapper responseList = null;
+ Map<String, String> errorMap = validateRequestHeaders(servletRequest);
+ Map<String, String> queryParamErrors = validateQueryParam(vendor);
+ errorMap.putAll(queryParamErrors);
+ if (errorMap.isEmpty()) {
+ List<Action> actions = actionManager.getFilteredActions(FILTER_TYPE_VENDOR, vendor);
+ responseList = createResponse(actions);
+ } else {
+ checkAndThrowError(errorMap);
+ }
+ return Response.ok(responseList).build();
+ }
+
+ /**
+ * Get all actions with given Category Name
+ */
+ private Response getActionsByCategory(String category, HttpServletRequest servletRequest) {
+ //Validate request syntax before passing to the manager
+ ListResponseWrapper responseList = null;
+ Map<String, String> errorMap = validateRequestHeaders(servletRequest);
+ Map<String, String> queryParamErrors = validateQueryParam(category);
+ errorMap.putAll(queryParamErrors);
+ if (errorMap.isEmpty()) {
+ List<Action> actions = actionManager.getFilteredActions(FILTER_TYPE_CATEGORY, category);
+ responseList = createResponse(actions);
+ } else {
+ checkAndThrowError(errorMap);
+ }
+ return Response.ok(responseList).build();
+ }
+
+ /**
+ * Validates mandatory headers in the request
+ *
+ * @param servletRequest Servlet Request object
+ * @return Map of error codes and description found in the request headers
+ */
+ private Map<String, String> validateRequestHeaders(HttpServletRequest servletRequest) {
+ Map<String, String> errorMap = new LinkedHashMap<>();
+ //Syntactic generic request parameter validations
+ String ecompRequestId = servletRequest.getHeader(X_ECOMP_REQUEST_ID_HEADER_PARAM);
+ if (StringUtils.isEmpty(ecompRequestId)) {
+ errorMap.put(ACTION_INVALID_REQUEST_ID_CODE, ACTION_REQUEST_ECOMP_REQUEST_ID_INVALID);
+ }
+
+ String ecompInstanceId = servletRequest.getHeader(X_ECOMP_INSTANCE_ID_HEADER_PARAM);
+ if (StringUtils.isEmpty(ecompInstanceId)) {
+ errorMap.put(ACTION_INVALID_INSTANCE_ID_CODE, ACTION_REQUEST_ECOMP_INSTANCE_ID_INVALID);
+ }
+ return errorMap;
+ }
+
+ /**
+ * Validates query parameter in the request
+ *
+ * @param queryParam Query Parameter to be validated
+ * @return Map of error codes and description found in the query parameter
+ */
+ private Map<String, String> validateQueryParam(String queryParam) {
+ Map<String, String> queryParamErrors = new LinkedHashMap<>();
+ if (StringUtils.isEmpty(queryParam)) {
+ queryParamErrors
+ .put(ACTION_INVALID_PARAM_CODE, ACTION_REQUEST_MISSING_MANDATORY_PARAM + queryParam);
+ }
+ return queryParamErrors;
+ }
+
+ /**
+ * Validate request body based on request type
+ *
+ * @param requestJSON Raw request json body as string
+ * @return Map of error codes and description found in the request body
+ */
+ private Map<String, String> validateRequestBody(String requestType, String requestJSON) {
+ Map<String, String> requestBodyErrorMap = new LinkedHashMap<>();
+ if (StringUtils.isEmpty(requestJSON) || requestJSON.equals(REQUEST_EMPTY_BODY)) {
+ requestBodyErrorMap.put(ACTION_INVALID_REQUEST_BODY_CODE, ACTION_REQUEST_BODY_EMPTY);
+ } else {
+ switch (requestType) {
+ case REQUEST_TYPE_CREATE_ACTION:
+ case REQUEST_TYPE_UPDATE_ACTION:
+ //Semantic request specific validations
+ Action action = JsonUtil.json2Object(requestJSON, Action.class);
+ if (StringUtils.isEmpty(action.getName())) {
+ setErrorValue(ACTION_REQUEST_INVALID_GENERIC_CODE, ACTION_REQUEST_PARAM_NAME,
+ requestBodyErrorMap);
+ } else {
+ //Added check for action name not allowing whitespaces
+ if (action.getName().matches(whitespaceRegex)) {
+ requestBodyErrorMap
+ .put(ACTION_ARTIFACT_INVALID_NAME_CODE, ACTION_REQUEST_INVALID_NAME);
+ }
+ }
+
+ if (StringUtils.isEmpty(action.getEndpointUri())) {
+ setErrorValue(ACTION_REQUEST_INVALID_GENERIC_CODE, ACTION_REQUEST_PARAM_END_POINT_URI,
+ requestBodyErrorMap);
+ }
+ if (action.getSupportedModels() != null &&
+ !isIDPresentInMap(action.getSupportedModels(), SUPPORTED_MODELS_VERSION_ID)) {
+ setErrorValue(ACTION_REQUEST_INVALID_GENERIC_CODE,
+ ACTION_REQUEST_PARAM_SUPPORTED_MODELS, requestBodyErrorMap);
+ }
+ if (action.getSupportedComponents() != null &&
+ !isIDPresentInMap(action.getSupportedComponents(), SUPPORTED_COMPONENTS_ID)) {
+ setErrorValue(ACTION_REQUEST_INVALID_GENERIC_CODE,
+ ACTION_REQUEST_PARAM_SUPPORTED_COMPONENTS, requestBodyErrorMap);
+ }
+ if (action.getArtifacts() != null) {
+ setErrorValue(ACTION_UPDATE_NOT_ALLOWED_CODE, ACTION_REQUEST_ARTIFACT_OPERATION_ALLOWED,
+ requestBodyErrorMap);
+ }
+ break;
+ }
+
+ }
+ return requestBodyErrorMap;
+ }
+
+ /**
+ * Populates Given Error Map with Given Error Code and Error MEssage
+ */
+ private void setErrorValue(String key, String message, Map<String, String> errorMap) {
+ String errorMessage = errorMap.get(key);
+ if (errorMessage != null) {
+ message = errorMessage + ", " + message;
+ } else {
+ switch (key) {
+ case ACTION_REQUEST_INVALID_GENERIC_CODE:
+ message = ACTION_REQUEST_MISSING_MANDATORY_PARAM + message;
+ break;
+ }
+ }
+ errorMap.put(key, message);
+ }
+
+ /**
+ * Returns true if given key exists in List of HashMap
+ */
+ private boolean isIDPresentInMap(List<HashMap<String, String>> map, String idName) {
+ if (map != null && !map.isEmpty()) {
+ for (HashMap<String, String> entry : map) {
+ if (StringUtils.isEmpty(entry.get(idName))) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ /**
+ * @throws ActionException if given ErrorMap is not empty.
+ * All error messages at given time are thrown in one single exception
+ */
+ private void checkAndThrowError(Map<String, String> errorMap) {
+ if (errorMap.size() > 1) {
+ //Multiple errors detected .. Send the response with a common error code for multiple errors
+ throw new ActionException(ACTION_REQUEST_INVALID_GENERIC_CODE,
+ StringUtils.join(errorMap.values(), ", "));
+ } else if (errorMap.size() == 1) {
+ String svcPolicyExceptionCode = errorMap.entrySet().iterator().next().getKey();
+ throw new ActionException(svcPolicyExceptionCode,
+ errorMap.get(svcPolicyExceptionCode));
+ }
+ }
+
+ /**
+ * Populates ActionResponseDto based on given Action
+ */
+ private ActionResponseDto createResponseDTO(Action action) {
+ String data = action.getData();
+ ActionResponseDto responseDTO = JsonUtil.json2Object(data, ActionResponseDto.class);
+ responseDTO.setStatus(action.getStatus().name());
+ responseDTO.setTimestamp(getUTCDateStringFromTimestamp(action.getTimestamp()));
+ //if(!action.getUser().equals(DELETE_ACTION_USER))
+ responseDTO.setUpdatedBy(action.getUser());
+ return responseDTO;
+ }
+
+ /**
+ * Creates response based on given list of actions
+ */
+ private ListResponseWrapper createResponse(List<Action> actions) {
+ ListResponseWrapper responseList = new ListResponseWrapper();
+ for (Action action : actions) {
+ ActionResponseDto responseDTO = createResponseDTO(action);
+ responseList.add(responseDTO);
+ }
+ return responseList;
+ }
+
+
+ private Response createArtifactDownloadResponse(ActionArtifact actionartifact) {
+ if (actionartifact != null && actionartifact.getArtifact() != null) {
+ byte[] artifactsBytes = actionartifact.getArtifact();
+ File artifactFile = new File(actionartifact.getArtifactName());
+ try {
+ FileOutputStream fos = new FileOutputStream(artifactFile);
+ fos.write(artifactsBytes);
+ fos.close();
+ } catch (IOException e) {
+ throw new ActionException(ACTION_INTERNAL_SERVER_ERR_CODE,
+ ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG);
+ }
+ Response.ResponseBuilder responseBuilder = Response.ok(artifactFile);
+ responseBuilder.header("Content-Disposition",
+ "attachment; filename=" + actionartifact.getArtifactName());
+ responseBuilder.header("Content-MD5", CalcMD5CheckSum(artifactsBytes));
+ responseBuilder.header("Content-Length", artifactFile.length());
+ return responseBuilder.build();
+ } else {
+ throw new ActionException(ActionErrorConstants.ACTION_ARTIFACT_ENTITY_NOT_EXIST_CODE,
+ ActionErrorConstants.ACTION_ARTIFACT_ENTITY_NOT_EXIST);
+ }
+ }
+
+ private String CalcMD5CheckSum(byte[] input) {
+ String checksum = null;
+ if (input != null) {
+ checksum = DigestUtils.md5Hex(input).toUpperCase();
+ System.out.println("checksum : " + checksum);
+ }
+ return checksum;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-types/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-types/pom.xml
new file mode 100644
index 0000000000..18a52bd940
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-types/pom.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.openecomp.sdc.onboarding</groupId>
+ <artifactId>action-library-rest</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../</relativePath>
+ </parent>
+
+ <artifactId>action-library-rest-types</artifactId>
+ <name>action-library-rest-types</name>
+
+
+
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-common-rest</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-action-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <!--<dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-vendor-license-manager</artifactId>
+ <version>${project.version}</version>
+ </dependency>-->
+ </dependencies>
+
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-types/src/main/java/org/openecomp/sdcrests/action/types/ActionResponseDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-types/src/main/java/org/openecomp/sdcrests/action/types/ActionResponseDto.java
new file mode 100644
index 0000000000..ff2a934f83
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-types/src/main/java/org/openecomp/sdcrests/action/types/ActionResponseDto.java
@@ -0,0 +1,149 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.action.types;
+
+
+import java.util.HashMap;
+import java.util.List;
+
+/**
+ * Defines DTO used for Action Response.
+ */
+public class ActionResponseDto {
+
+ String actionUuId;
+ String actionInvariantUuId;
+ String name;
+ String displayName;
+ String version;
+ String description;
+ String status;
+ String timestamp;
+ String updatedBy;
+ List<String> vendorList;
+ List<String> categoryList;
+ List<HashMap<String, String>> supportedModels;
+ List<HashMap<String, String>> supportedComponents;
+
+ public String getActionUuId() {
+ return actionUuId;
+ }
+
+ public void setActionUuId(String actionUuId) {
+ this.actionUuId = actionUuId;
+ }
+
+ public String getActionInvariantUuId() {
+ return actionInvariantUuId;
+ }
+
+ public void setActionInvariantUuId(String actionInvariantUuId) {
+ this.actionInvariantUuId = actionInvariantUuId;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+ public void setDisplayName(String displayName) {
+ this.displayName = displayName;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public List<String> getCategoryList() {
+ return categoryList;
+ }
+
+ public void setCategoryList(List<String> categoryList) {
+ this.categoryList = categoryList;
+ }
+
+ public List<String> getVendorList() {
+ return vendorList;
+ }
+
+ public void setVendorList(List<String> vendorList) {
+ this.vendorList = vendorList;
+ }
+
+ public List<HashMap<String, String>> getSupportedComponents() {
+ return supportedComponents;
+ }
+
+ public void setSupportedComponents(List<HashMap<String, String>> supportedComponents) {
+ this.supportedComponents = supportedComponents;
+ }
+
+ public List<HashMap<String, String>> getSupportedModels() {
+ return supportedModels;
+ }
+
+ public void setSupportedModels(List<HashMap<String, String>> supportedModels) {
+ this.supportedModels = supportedModels;
+ }
+
+ public String getTimestamp() {
+ return timestamp;
+ }
+
+ public void setTimestamp(String timeStamp) {
+ this.timestamp = timeStamp;
+ }
+
+ public String getUpdatedBy() {
+ return updatedBy;
+ }
+
+ public void setUpdatedBy(String updatedBy) {
+ this.updatedBy = updatedBy;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-types/src/main/java/org/openecomp/sdcrests/action/types/ActionVersionDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-types/src/main/java/org/openecomp/sdcrests/action/types/ActionVersionDto.java
new file mode 100644
index 0000000000..1b3a5cb445
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-types/src/main/java/org/openecomp/sdcrests/action/types/ActionVersionDto.java
@@ -0,0 +1,38 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.action.types;
+
+/**
+ * Defines DTO for capturing input for versioning operations.
+ */
+public class ActionVersionDto {
+
+ String status;
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String workflowActionStatus) {
+ this.status = workflowActionStatus.trim();
+ }
+
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-types/src/main/java/org/openecomp/sdcrests/action/types/ListResponseWrapper.java b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-types/src/main/java/org/openecomp/sdcrests/action/types/ListResponseWrapper.java
new file mode 100644
index 0000000000..0ae8504db5
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-types/src/main/java/org/openecomp/sdcrests/action/types/ListResponseWrapper.java
@@ -0,0 +1,70 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.action.types;
+
+import org.openecomp.sdc.action.types.EcompComponent;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Defines DTO used for creating Response with list of {@link ActionResponseDto }
+ * or list of {@link EcompComponent }.
+ */
+public class ListResponseWrapper {
+
+ List<ActionResponseDto> actionList;
+ List<EcompComponent> componentList;
+ List<ActionResponseDto> versions;
+
+
+ public ListResponseWrapper() {
+ this.actionList = new ArrayList<>();
+ }
+
+ public List<ActionResponseDto> getVersions() {
+ return versions;
+ }
+
+ public void setVersions(List<ActionResponseDto> versions) {
+ this.versions = versions;
+ }
+
+ public List<ActionResponseDto> getActionList() {
+ return actionList;
+ }
+
+ public void setActionList(List<ActionResponseDto> actionList) {
+ this.actionList = actionList;
+ }
+
+ public List<EcompComponent> getComponentList() {
+ return componentList;
+ }
+
+ public void setComponentList(List<EcompComponent> componentList) {
+ this.componentList = componentList;
+ }
+
+ public void add(ActionResponseDto e0) {
+ this.getActionList().add(e0);
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/pom.xml
new file mode 100644
index 0000000000..482675fb53
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/pom.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-rest-webapp</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../</relativePath>
+ </parent>
+ <groupId>org.openecomp.sdc.onboarding</groupId>
+ <artifactId>action-library-rest</artifactId>
+ <name>action-library-rest</name>
+ <packaging>pom</packaging>
+
+
+ <modules>
+ <module>/action-library-rest-services</module>
+ <module>/action-library-rest-types</module>
+ </modules>
+</project> \ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/pom.xml
new file mode 100644
index 0000000000..a5979798d2
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/pom.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>application-config-rest</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>application-config-rest-services</artifactId>
+ <!--packaging>pom</packaging-->
+
+ <dependencies>
+
+ <dependency>
+ <groupId>io.swagger</groupId>
+ <artifactId>swagger-annotations</artifactId>
+ <version>1.5.3</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>javax.ws.rs-api</artifactId>
+ <version>${ws.rs.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <version>${spring.framework.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.inject</groupId>
+ <artifactId>javax.inject</artifactId>
+ <version>1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-application-config-manager</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>application-config-rest-types</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-common-rest</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <!-- CXF -->
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-frontend-jaxrs</artifactId>
+ <version>${cxf.version}</version>
+ </dependency>
+ </dependencies>
+
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/ApplicationConfiguration.java b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/ApplicationConfiguration.java
new file mode 100644
index 0000000000..df743a6a93
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/ApplicationConfiguration.java
@@ -0,0 +1,69 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.applicationconfig.rest;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.apache.cxf.jaxrs.ext.multipart.Multipart;
+import org.openecomp.sdcrests.applicationconfiguration.types.ConfigurationDataDto;
+import org.springframework.validation.annotation.Validated;
+
+import java.io.InputStream;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+
+@Path("/v1.0/application-configuration")
+@Produces(MediaType.APPLICATION_JSON)
+@Consumes(MediaType.APPLICATION_JSON)
+@Api(value = "Application Configuration")
+@Validated
+public interface ApplicationConfiguration {
+
+ @POST
+ @Path("/")
+ @Consumes(MediaType.MULTIPART_FORM_DATA)
+ @ApiOperation(value = "Insert JSON schema into application config table")
+ Response insertToTable(@QueryParam("namespace") String namespace, @QueryParam("key") String key,
+ @Multipart("value") InputStream fileContainingSchema);
+
+
+ @GET
+ @Path("/{namespace}/{key}")
+ @ApiOperation(value = "Get JSON schema by namespace and key",
+ response = ConfigurationDataDto.class)
+ Response getFromTable(@PathParam("namespace") String namespace, @PathParam("key") String key);
+
+
+ @GET
+ @Path("/{namespace}")
+ @ApiOperation(value = "Get List of keys and values by namespace",
+ responseContainer = "List")
+ Response getListOfConfigurationByNamespaceFromTable(@PathParam("namespace") String namespace);
+
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/mapping/MapApplicationConfigEntityToApplicationConfigDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/mapping/MapApplicationConfigEntityToApplicationConfigDto.java
new file mode 100644
index 0000000000..4d43e37769
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/mapping/MapApplicationConfigEntityToApplicationConfigDto.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.applicationconfig.rest.mapping;
+
+import org.openecomp.core.utilities.applicationconfig.dao.type.ApplicationConfigEntity;
+import org.openecomp.sdcrests.applicationconfiguration.types.ApplicationConfigDto;
+import org.openecomp.sdcrests.mapping.MappingBase;
+
+public class MapApplicationConfigEntityToApplicationConfigDto
+ extends MappingBase<ApplicationConfigEntity, ApplicationConfigDto> {
+ @Override
+ public void doMapping(ApplicationConfigEntity source, ApplicationConfigDto target) {
+ target.setKey(source.getKey());
+ target.setValue(source.getValue());
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/mapping/MapConfigurationDataToConfigurationDataDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/mapping/MapConfigurationDataToConfigurationDataDto.java
new file mode 100644
index 0000000000..6865c676ec
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/mapping/MapConfigurationDataToConfigurationDataDto.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.applicationconfig.rest.mapping;
+
+import org.openecomp.core.utilities.applicationconfig.type.ConfigurationData;
+import org.openecomp.sdcrests.applicationconfiguration.types.ConfigurationDataDto;
+import org.openecomp.sdcrests.mapping.MappingBase;
+
+public class MapConfigurationDataToConfigurationDataDto
+ extends MappingBase<ConfigurationData, ConfigurationDataDto> {
+ @Override
+ public void doMapping(ConfigurationData source, ConfigurationDataDto target) {
+ target.setValue(source.getValue());
+ target.setTimeStamp(source.getTimeStamp());
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/services/ApplicationConfigurationImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/services/ApplicationConfigurationImpl.java
new file mode 100644
index 0000000000..81f7251fdc
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/services/ApplicationConfigurationImpl.java
@@ -0,0 +1,87 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.applicationconfig.rest.services;
+
+import org.openecomp.core.utilities.applicationconfig.dao.type.ApplicationConfigEntity;
+import org.openecomp.core.utilities.applicationconfig.type.ConfigurationData;
+import org.openecomp.core.utilities.file.FileUtils;
+import org.openecomp.sdc.applicationconfig.ApplicationConfigManager;
+import org.openecomp.sdcrests.applicationconfig.rest.ApplicationConfiguration;
+import org.openecomp.sdcrests.applicationconfig.rest.mapping.MapApplicationConfigEntityToApplicationConfigDto;
+import org.openecomp.sdcrests.applicationconfig.rest.mapping.MapConfigurationDataToConfigurationDataDto;
+import org.openecomp.sdcrests.applicationconfiguration.types.ApplicationConfigDto;
+import org.openecomp.sdcrests.applicationconfiguration.types.ConfigurationDataDto;
+import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Service;
+
+import java.io.InputStream;
+import java.util.Collection;
+import javax.inject.Named;
+
+import javax.ws.rs.core.Response;
+
+@Named
+@Service("applicationConfiguration")
+@Scope(value = "prototype")
+public class ApplicationConfigurationImpl implements ApplicationConfiguration {
+
+ @Autowired
+ private ApplicationConfigManager applicationConfigManager;
+
+
+ @Override
+ public Response insertToTable(String namespace, String key, InputStream fileContainingSchema) {
+ String value = new String(FileUtils.toByteArray(fileContainingSchema));
+
+ applicationConfigManager.insertIntoTable(namespace, key, value);
+
+ return Response.ok().build();
+ }
+
+ @Override
+ public Response getFromTable(String namespace, String key) {
+ ConfigurationData value = applicationConfigManager.getFromTable(namespace, key);
+ ConfigurationDataDto valueDto = new MapConfigurationDataToConfigurationDataDto()
+ .applyMapping(value, ConfigurationDataDto.class);
+
+ return Response.ok(valueDto).build();
+ }
+
+ @Override
+ public Response getListOfConfigurationByNamespaceFromTable(String namespace) {
+ Collection<ApplicationConfigEntity> applicationConfigEntities =
+ applicationConfigManager.getListOfConfigurationByNamespace(namespace);
+ GenericCollectionWrapper<ApplicationConfigDto> applicationConfigWrapper =
+ new GenericCollectionWrapper<>();
+ MapApplicationConfigEntityToApplicationConfigDto mapper =
+ new MapApplicationConfigEntityToApplicationConfigDto();
+
+ for (ApplicationConfigEntity applicationConfigEntity : applicationConfigEntities) {
+ applicationConfigWrapper
+ .add(mapper.applyMapping(applicationConfigEntity, ApplicationConfigDto.class));
+ }
+
+ return Response.ok(applicationConfigWrapper).build();
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-types/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-types/pom.xml
new file mode 100644
index 0000000000..52d592d4bf
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-types/pom.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>application-config-rest</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>application-config-rest-types</artifactId>
+
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-types/src/main/java/org/openecomp/sdcrests/applicationconfiguration/types/ApplicationConfigDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-types/src/main/java/org/openecomp/sdcrests/applicationconfiguration/types/ApplicationConfigDto.java
new file mode 100644
index 0000000000..4d2f160d51
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-types/src/main/java/org/openecomp/sdcrests/applicationconfiguration/types/ApplicationConfigDto.java
@@ -0,0 +1,43 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.applicationconfiguration.types;
+
+public class ApplicationConfigDto {
+
+ private String key;
+ private String value;
+
+ public String getKey() {
+ return key;
+ }
+
+ public void setKey(String key) {
+ this.key = key;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-types/src/main/java/org/openecomp/sdcrests/applicationconfiguration/types/ConfigurationDataDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-types/src/main/java/org/openecomp/sdcrests/applicationconfiguration/types/ConfigurationDataDto.java
new file mode 100644
index 0000000000..fcabcf5e89
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-types/src/main/java/org/openecomp/sdcrests/applicationconfiguration/types/ConfigurationDataDto.java
@@ -0,0 +1,50 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.applicationconfiguration.types;
+
+public class ConfigurationDataDto {
+ private String value;
+ private long timeStamp;
+
+ public ConfigurationDataDto(String value, long timeStamp) {
+ this.value = value;
+ this.timeStamp = timeStamp;
+ }
+
+ public ConfigurationDataDto() {
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public long getTimeStamp() {
+ return timeStamp;
+ }
+
+ public void setTimeStamp(long timeStamp) {
+ this.timeStamp = timeStamp;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/pom.xml
new file mode 100644
index 0000000000..cc1fbbbe6b
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/pom.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-rest-webapp</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>application-config-rest</artifactId>
+ <packaging>pom</packaging>
+
+
+ <modules>
+ <module>application-config-rest-services</module>
+ <module>application-config-rest-types</module>
+ </modules>
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/pom.xml
new file mode 100644
index 0000000000..0dea1b3ff9
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/pom.xml
@@ -0,0 +1,183 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-rest-webapp</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+ <groupId>org.openecomp.sdc.onboarding</groupId>
+ <artifactId>onboarding-be</artifactId>
+ <name>onboarding-rest-war</name>
+ <packaging>war</packaging>
+
+
+
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.sdc.onboarding</groupId>
+ <artifactId>vendor-license-rest-services</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc.onboarding</groupId>
+ <artifactId>vendor-software-products-rest-services</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc.onboarding</groupId>
+ <artifactId>validation-rest-services</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <!--dependency>
+ <groupId>org.openecomp.sdc.onboarding</groupId>
+ <artifactId>application-config-rest-services</artifactId>
+ <version>${project.version}</version>
+ </dependency-->
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>application-config-rest-services</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc.onboarding</groupId>
+ <artifactId>action-library-rest-services</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>${javax.servlet.version}</version>
+ </dependency>
+ <!-- JSON -->
+ <dependency>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-jaxrs</artifactId>
+ <version>${org.codehaus.jackson.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-core-asl</artifactId>
+ <version>${org.codehaus.jackson.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.inject</groupId>
+ <artifactId>javax.inject</artifactId>
+ <version>1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-vendor-software-product-manager</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-servlets</artifactId>
+ <version>9.0.6.v20130930</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-application-config-manager</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.groovy</groupId>
+ <artifactId>groovy-all</artifactId>
+ <version>2.4.7</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.janino</groupId>
+ <artifactId>janino</artifactId>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.janino</groupId>
+ <artifactId>commons-compiler</artifactId>
+ <version>3.0.6</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ </dependency>
+
+ </dependencies>
+
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <includes>
+ <include>test/core/unittest/offline/**</include>
+ </includes>
+ <skipTests>true</skipTests>
+ <systemProperties>
+ <property>
+ <name>buildNumber</name>
+ <value>${buildNumber}</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>2.1.1</version>
+ <configuration>
+ <attachClasses>true</attachClasses>
+ <webResources>
+ <resource>
+ <!-- this is relative to the pom.xml directory -->
+ <directory>${basedir}/target/generated/swagger-ui</directory>
+ </resource>
+ </webResources>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>com.github.kongchen</groupId>
+ <artifactId>swagger-maven-plugin</artifactId>
+ <version>3.1.0</version>
+ <configuration>
+ <apiSources>
+ <apiSource>
+ <springmvc>false</springmvc>
+ <locations>org.openecomp.sdcrests</locations>
+ <schemes>http</schemes>
+ <basePath>/onboarding-api</basePath>
+ <info>
+ <title>Rest API</title>
+ <version>v1.0, build #${buildNumber}</version>
+ <description>Rest API Documentation</description>
+ <termsOfService>
+ http://www.github.com/kongchen/swagger-maven-plugin
+ </termsOfService>
+ </info>
+ <templatePath>${basedir}/templates/strapdown.html.hbs</templatePath>
+ <outputPath>${basedir}/target/generated/api.html</outputPath>
+ <swaggerDirectory>${basedir}/target/generated/swagger-ui</swaggerDirectory>
+ </apiSource>
+ </apiSources>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>compile</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+
+ <!--finalName>onboarding-api</finalName-->
+ </build>
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthenticationFilter.java b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthenticationFilter.java
new file mode 100644
index 0000000000..6e9b4dbe25
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthenticationFilter.java
@@ -0,0 +1,115 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.server.filters;
+
+import java.io.IOException;
+import java.security.Principal;
+import java.util.Base64;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletRequestWrapper;
+import javax.servlet.http.HttpServletResponse;
+
+public class ActionAuthenticationFilter implements Filter {
+
+ private boolean runningOnLocal = true;
+
+ @Override
+ public void destroy() {
+
+ }
+
+ @Override
+ public void doFilter(ServletRequest arg0, ServletResponse arg1, FilterChain arg2)
+ throws IOException, ServletException {
+ if (runningOnLocal) {
+
+ HttpServletRequest httpRequest = (HttpServletRequest) arg0;
+ String authorizationHeader = httpRequest.getHeader("Authorization");
+ if (authorizationHeader != null && !authorizationHeader.isEmpty()) {
+ String username;
+ try {
+ String base64Credentials =
+ httpRequest.getHeader("Authorization").replace("Basic", "").trim();
+ String decodedCredentials = new String(Base64.getDecoder().decode(base64Credentials));
+ username = decodedCredentials.substring(0, decodedCredentials.indexOf(":"));
+ } catch (Exception e0) {
+ setResponseStatus((HttpServletResponse) arg1, HttpServletResponse.SC_FORBIDDEN);
+ return;
+ }
+ if (username.startsWith("AUTH")) {
+ HttpServletRequestWrapper servletRequest = new HttpServletRequestWrapper(httpRequest) {
+ @Override
+ public java.lang.String getRemoteUser() {
+ return getUserPrincipal().getName();
+ }
+
+ @Override
+ public Principal getUserPrincipal() {
+ return () -> username.substring(0, username.indexOf("-"));
+ }
+
+ @Override
+ public boolean isUserInRole(String role) {
+ try {
+ ActionLibraryPrivilege requiredPrivilege =
+ ActionLibraryPrivilege.getPrivilege(httpRequest.getMethod());
+ ActionLibraryPrivilege userPrivilege = ActionLibraryPrivilege
+ .valueOf(username.substring(username.indexOf("-") + 1).toUpperCase());
+ return userPrivilege.ordinal() >= requiredPrivilege.ordinal();
+ } catch (Exception e0) {
+ return false;
+ }
+ }
+ };
+ arg2.doFilter(servletRequest, arg1);
+ } else {
+ setResponseStatus((HttpServletResponse) arg1, HttpServletResponse.SC_FORBIDDEN);
+ }
+ } else {
+ setResponseStatus((HttpServletResponse) arg1, HttpServletResponse.SC_UNAUTHORIZED);
+ }
+ } else {
+ //call super doFilter of cadi authentication filter
+ }
+
+
+ }
+
+ private void setResponseStatus(HttpServletResponse response, int status) {
+ response.setStatus(status);
+ }
+
+ @Override
+ public void init(FilterConfig arg0) throws ServletException {
+ /*runningOnLocal = System.getProperty("file.separator").equals("\\");
+ if (!runningOnLocal){
+ // call to super init of cadi filter as we are not running on windows
+ }*/
+ }
+
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthorizationFilter.java b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthorizationFilter.java
new file mode 100644
index 0000000000..ba9c7537f4
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthorizationFilter.java
@@ -0,0 +1,71 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.server.filters;
+
+import java.io.IOException;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+public class ActionAuthorizationFilter implements Filter {
+
+ private boolean runningOnLocal = true;
+
+ @Override
+ public void destroy() {
+ }
+
+ @Override
+ public void doFilter(ServletRequest arg0, ServletResponse arg1, FilterChain arg2)
+ throws IOException, ServletException {
+
+ if (runningOnLocal) {
+ HttpServletRequest httpRequest = (HttpServletRequest) arg0;
+ if (httpRequest.isUserInRole(httpRequest.getMethod().toUpperCase())) {
+ arg2.doFilter(arg0, arg1);
+ } else {
+ setResponseStatus((HttpServletResponse) arg1, HttpServletResponse.SC_FORBIDDEN);
+ }
+ } else {
+ //call super doFilter of cadi authorization filter with relavant info as and when available
+ }
+
+ }
+
+ private void setResponseStatus(HttpServletResponse response, int status) {
+ response.setStatus(status);
+ }
+
+ @Override
+ public void init(FilterConfig arg0) throws ServletException {
+ /*runningOnLocal = System.getProperty("file.separator").equals("\\");
+ if (!runningOnLocal){
+ // call to super init of cadi filter as we are not running on windows
+ }*/
+ }
+
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionLibraryPrivilege.java b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionLibraryPrivilege.java
new file mode 100644
index 0000000000..c34af00830
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionLibraryPrivilege.java
@@ -0,0 +1,59 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.server.filters;
+
+public enum ActionLibraryPrivilege {
+
+ RETRIEVE, CREATE, UPDATE, DELETE;
+
+ /**
+ *
+ * @param operation .
+ * @return actionLibraryPrivilege
+ */
+ public static ActionLibraryPrivilege getPrivilege(String operation) {
+
+ ActionLibraryPrivilege toReturn;
+
+ switch (operation) {
+
+ case "GET":
+ toReturn = RETRIEVE;
+ break;
+ case "POST":
+ toReturn = CREATE;
+ break;
+ case "PUT":
+ toReturn = UPDATE;
+ break;
+ case "DELETE":
+ toReturn = DELETE;
+ break;
+ default:
+ toReturn = null;
+ break;
+
+ }
+
+ return toReturn;
+
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/interceptors/DefaultOutput.java b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/interceptors/DefaultOutput.java
new file mode 100644
index 0000000000..b2e1119a78
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/interceptors/DefaultOutput.java
@@ -0,0 +1,182 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.server.interceptors;
+
+import java.io.Serializable;
+import java.lang.annotation.Annotation;
+import java.net.URI;
+import java.util.Date;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
+
+import javax.ws.rs.core.EntityTag;
+import javax.ws.rs.core.GenericType;
+import javax.ws.rs.core.Link;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.NewCookie;
+import javax.ws.rs.core.Response;
+
+public class DefaultOutput extends Response implements Serializable {
+
+ private static final long serialVersionUID = 8061802931931401706L;
+
+ private final int status;
+ private final Object entity;
+ private MultivaluedMap<String, Object> metadata;
+
+ public DefaultOutput(int s0, Object e0) {
+ this.status = s0;
+ this.entity = e0;
+ }
+ public Object getEntity() {
+ return entity;
+ }
+
+ @Override
+ public <T> T readEntity(Class<T> asClass) {
+ return null;
+ }
+
+ @Override
+ public <T> T readEntity(GenericType<T> genericType) {
+ return null;
+ }
+
+ @Override
+ public <T> T readEntity(Class<T> asClass, Annotation[] annotations) {
+ return null;
+ }
+
+ @Override
+ public <T> T readEntity(GenericType<T> var1, Annotation[] var2) {
+ return null;
+ }
+
+ @Override
+ public boolean hasEntity() throws IllegalStateException {
+ return false;
+ }
+
+ @Override
+ public boolean bufferEntity() {
+ return false;
+ }
+
+ @Override
+ public void close() {
+ }
+
+ @Override
+ public MediaType getMediaType() {
+ return null;
+ }
+
+ @Override
+ public Locale getLanguage() {
+ return null;
+ }
+
+ @Override
+ public int getLength() {
+ return 0;
+ }
+
+ @Override
+ public Set<String> getAllowedMethods() {
+ return null;
+ }
+
+ @Override
+ public Map<String, NewCookie> getCookies() {
+ return null;
+ }
+
+ @Override
+ public EntityTag getEntityTag() {
+ return null;
+ }
+
+ @Override
+ public Date getDate() {
+ return null;
+ }
+
+ @Override
+ public Date getLastModified() {
+ return null;
+ }
+
+ @Override
+ public URI getLocation() {
+ return null;
+ }
+
+ @Override
+ public Set<Link> getLinks() {
+ return null;
+ }
+
+ @Override
+ public boolean hasLink(String s0) {
+ return false;
+ }
+
+ @Override
+ public Link getLink(String s0) {
+ return null;
+ }
+
+ @Override
+ public Link.Builder getLinkBuilder(String s0) {
+ return null;
+ }
+
+ public int getStatus() {
+ return status;
+ }
+
+ @Override
+ public StatusType getStatusInfo() {
+ return null;
+ }
+
+ void addMetadata(MultivaluedMap<String, Object> meta) {
+ this.metadata = meta;
+ }
+
+ public MultivaluedMap<String, Object> getMetadata() {
+ // don't worry about cloning for now
+ return metadata;
+ }
+
+ @Override
+ public MultivaluedMap<String, String> getStringHeaders() {
+ return null;
+ }
+
+ @Override
+ public String getHeaderString(String s0) {
+ return null;
+ }
+
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/interceptors/EmptyOutputOutInterceptor.java b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/interceptors/EmptyOutputOutInterceptor.java
new file mode 100644
index 0000000000..4e2f56834f
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/interceptors/EmptyOutputOutInterceptor.java
@@ -0,0 +1,63 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.server.interceptors;
+
+import org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor;
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageContentsList;
+import org.apache.cxf.phase.Phase;
+
+import javax.inject.Named;
+import javax.ws.rs.core.Response;
+
+@Named
+public class EmptyOutputOutInterceptor extends AbstractOutDatabindingInterceptor {
+
+ public EmptyOutputOutInterceptor() {
+ // To be executed in post logical phase before marshal phase
+ super(Phase.POST_LOGICAL);
+ }
+
+ /**
+ * Intercepts a message.
+ * Interceptors should NOT invoke handleMessage or handleFault
+ * on the next interceptor - the interceptor chain will
+ * take care of this.
+ *
+ * @param message input message.
+ */
+ public void handleMessage(Message message) throws Fault {
+ //get the message
+ MessageContentsList objs = MessageContentsList.getContentsList(message);
+ if (objs.get(0) instanceof Response) {
+ //check if response is present but entity inside it is null the set a default entity
+ int status = ((Response) objs.get(0)).getStatus();
+ Object entity = ((Response) objs.get(0)).getEntity();
+ // in case of staus 200 and entity is null send InternalEmptyObject in output.
+ if (entity == null && status == 200) {
+ DefaultOutput defaultOutput = new DefaultOutput(status, new InternalEmptyObject());
+ defaultOutput.addMetadata(((Response) objs.get(0)).getMetadata());
+ objs.set(0, defaultOutput);
+ }
+ }
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/interceptors/InternalEmptyObject.java b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/interceptors/InternalEmptyObject.java
new file mode 100644
index 0000000000..d2b24bde77
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/interceptors/InternalEmptyObject.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.server.interceptors;
+
+import org.codehaus.jackson.annotate.JsonAutoDetect;
+
+import java.io.Serializable;
+
+/**
+ * This class is for Internal use only.
+ * Please don't use this class.
+ */
+@JsonAutoDetect
+public class InternalEmptyObject implements Serializable {
+
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/listeners/OnboardingAppStartupListener.java b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/listeners/OnboardingAppStartupListener.java
new file mode 100644
index 0000000000..2ea0ee2f66
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/listeners/OnboardingAppStartupListener.java
@@ -0,0 +1,43 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.server.listeners;
+
+
+import org.springframework.web.context.ContextLoaderListener;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+public class OnboardingAppStartupListener implements ServletContextListener {
+
+ ContextLoaderListener springListener;
+
+ @Override
+ public void contextInitialized(ServletContextEvent servletContextEvent) {
+ springListener = new ContextLoaderListener();
+ springListener.initWebApplicationContext(servletContextEvent.getServletContext());
+ }
+
+ @Override
+ public void contextDestroyed(ServletContextEvent servletContextEvent) {
+ springListener.closeWebApplicationContext(servletContextEvent.getServletContext());
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/resources/keyfile.txt b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/resources/keyfile.txt
new file mode 100644
index 0000000000..d6c2c253f8
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/resources/keyfile.txt
@@ -0,0 +1,27 @@
+hfLSGGYWU2SyTlltV0HVwU6o3GtrtccAU8aFwq65OHsl6JeEAirXa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VMCm038l_eMGL35jD6OcgOCC2GL9U9
+wfyjwumJMNIND8I3viuyouMy_B5q00v27M2im6Q814Mg5Cw-RCiKy4kjhutkqTw8hXh7RLkm-QeJ
+KlsrH98snwWLaw9LBeGoMbqzHzWl93inEsTyLutMPA8xSIj5kySLIcJCXq9-RMp8cnOYy8TY9Jix
+oaB2u4ofHDDrrMzKY88ZPdMiGQX2BNdsOG6o4ifSVyyYwIWBtQvtO7SDvGhRUGEV1JHloBdIos0M
+87SMERYd_UPKK_yl2RaqloQZRlDSgUR7i0hoqrhtPe5Ef4cJFX_CSt_oQnEu0JatwAuwybkLLPbO
+mArd3rtrOh-uR_0Y77zb7Uw4H5_oX_ANIecH0sgRcvQESaq-ioYrvS94VqvxU8ByuxqxJLMo90Rc
+oOAk3pq0b-16x_WRxWTfbnnNLDSQ_DwS-Xeav1nPwm-ELy1AVEQdpgbjONThjkZp3AuljaH_1Fs4
+u0A8HeCgIa4g7jsvIRxw6zLKspYENdvoHvQLWGRpaA-vfT3i3lR0MEu53v8M9hI8U8MqJo_J0xe6
+z2mtQWPiCLtW99vTqhKOm621_GNYmp10TEXVMkXumEk2rTgLBDaFEFwpgS5LqkEOObVChd9jx9oa
+DW4LjhzO1EE5twGvbTiRAJsO6j5UNTonGFLLttYKq9CMvDiBZ8-whFGOM8D2qAWYiwDCI-dLqwat
+jxQP1cYKGHMS2-VJ5QJa6EINEx2zo3VmnHYCE9gM71fC26018Y2T-sQfE1MRE9SU_Xma7Qbl5OBp
+IflyJCTyhZfgFlqU9f2cq12bjoNuMrgOlKwap6325LGZK1XsmsHuHmASRE4-E-qmQY7GI9oJLmbl
+425swlxRA-mr1eGZU0hK3ZFjz_4clBMLJBYMFYhdGzi4VYGPzaO0z0wNJzOQf3V5NbReFjxl \ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/beans-services.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/beans-services.xml
new file mode 100644
index 0000000000..5eb2b98cd5
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/beans-services.xml
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:jaxrs="http://cxf.apache.org/jaxrs"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd
+ http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
+
+ <import resource="classpath:META-INF/cxf/cxf.xml"/>
+ <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>
+
+ <!-- CXF -->
+ <context:component-scan base-package="org.openecomp.sdcrests"/>
+ <!-- Needed for JSR-303 validations. May be removed when moving to JAX-RS 2.0 -->
+ <bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean"/>
+
+ <!-- Needed for JSR-303 validations. May be removed when moving to JAX-RS 2.0 -->
+ <bean class="org.springframework.validation.beanvalidation.MethodValidationPostProcessor"/>
+
+ <bean id="jacksonObjectMapper" class="org.codehaus.jackson.map.ObjectMapper">
+ <property name="serializationInclusion" value="NON_NULL"/>
+ </bean>
+
+ <bean id="jsonProvider" class="org.codehaus.jackson.jaxrs.JacksonJsonProvider">
+ <property name="mapper" ref="jacksonObjectMapper"/>
+ </bean>
+
+ <bean id="outEmptyResponseInterceptor" class="org.openecomp.server.interceptors.EmptyOutputOutInterceptor"/>
+
+ <!-- ASDC -->
+ <bean id="vendorLicenseManager" class="org.openecomp.sdc.vendorlicense.impl.VendorLicenseManagerImpl"/>
+ <bean id="vendorSoftwareProductManager" class="org.openecomp.sdc.vendorsoftwareproduct.impl.VendorSoftwareProductManagerImpl"/>
+ <bean id="UploadValidationManager" class="org.openecomp.sdc.validation.impl.UploadValidationManagerImpl"/>
+ <bean id="actionManager" class="org.openecomp.sdc.action.impl.ActionManagerImpl"/>
+ <bean id="applicationConfigManager" class="org.openecomp.sdc.applicationconfig.impl.ApplicationConfigManagerImpl"/>
+
+ <!-- RESTful Services -->
+ <jaxrs:server id="restContainer" address="/">
+
+ <jaxrs:serviceBeans>
+ <ref bean="vendorLicenseModels"/>
+ <ref bean="licenseAgreements"/>
+ <ref bean="featureGroups"/>
+ <ref bean="entitlementPools"/>
+ <ref bean="licenseKeyGroups"/>
+ <ref bean="vendorSoftwareProducts"/>
+ <ref bean="networks"/>
+ <ref bean="components"/>
+ <ref bean="nics"/>
+ <ref bean="processes"/>
+ <ref bean="componentProcesses"/>
+ <ref bean="validation"/>
+ <ref bean="actions"/>
+ <ref bean="applicationConfiguration"/>
+ <ref bean="componentUploads"/>
+ </jaxrs:serviceBeans>
+
+ <jaxrs:providers>
+ <ref bean="jsonProvider"/>
+ <bean class="org.openecomp.sdc.action.errors.ActionExceptionMapper"/>
+ <bean class="org.openecomp.sdcrests.errors.DefaultExceptionMapper"/>
+ </jaxrs:providers>
+
+ <jaxrs:outInterceptors>
+ <ref bean="outEmptyResponseInterceptor"/>
+ </jaxrs:outInterceptors>
+ </jaxrs:server>
+
+</beans> \ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/jetty-web.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/jetty-web.xml
new file mode 100644
index 0000000000..80d8dd70cb
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/jetty-web.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE Configure PUBLIC
+ "-//Mort Bay Consulting//DTD Configure//EN"
+ "http://www.eclipse.org/jetty/configure_9_0.dtd">
+
+<Configure class="org.eclipse.jetty.webapp.WebAppContext">
+ <Set name="contextPath">/onboarding-api</Set>
+</Configure>
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/web.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000000..68b7758609
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,95 @@
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd" >
+
+<web-app>
+
+
+ <!-- Spring -->
+ <context-param>
+ <param-name>contextConfigLocation</param-name>
+ <param-value>WEB-INF/beans-services.xml</param-value>
+ </context-param>
+
+
+ <listener>
+ <listener-class>org.openecomp.server.listeners.OnboardingAppStartupListener</listener-class>
+ </listener>
+
+ <filter>
+ <filter-name>cross-origin</filter-name>
+ <filter-class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-class>
+ <init-param>
+ <param-name>allowedOrigins</param-name>
+ <param-value>*</param-value>
+ </init-param>
+ <init-param>
+ <param-name>allowedMethods</param-name>
+ <param-value>*</param-value>
+ </init-param>
+ <init-param>
+ <param-name>allowedHeaders</param-name>
+ <param-value>*</param-value>
+ </init-param>
+ </filter>
+
+ <filter>
+ <filter-name>AuthN</filter-name>
+ <filter-class>org.openecomp.server.filters.ActionAuthenticationFilter</filter-class>
+ </filter>
+ <filter>
+ <filter-name>AuthZ</filter-name>
+ <filter-class>org.openecomp.server.filters.ActionAuthorizationFilter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>cross-origin</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>AuthN</filter-name>
+ <url-pattern>/workflow/v1.0/actions/*</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>AuthZ</filter-name>
+ <url-pattern>/workflow/v1.0/actions/*</url-pattern>
+ </filter-mapping>
+ <filter>
+ <filter-name>LoggingServletFilter</filter-name>
+ <filter-class>org.openecomp.core.logging.servlet.LoggingFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>LoggingServletFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+ <!-- CXF -->
+ <servlet>
+ <servlet-name>CXFServlet</servlet-name>
+ <display-name>CXF Servlet</display-name>
+ <servlet-class>
+ org.apache.cxf.transport.servlet.CXFServlet
+ </servlet-class>
+ <init-param>
+ <param-name>redirects-list</param-name>
+ <param-value>
+ /docs/(\S)+\.json
+ </param-value>
+ </init-param>
+ <init-param>
+ <param-name>redirect-attributes</param-name>
+ <param-value>
+ javax.servlet.include.request_uri
+ </param-value>
+ </init-param>
+ <init-param>
+ <param-name>redirect-servlet-name</param-name>
+ <param-value>default</param-value>
+ </init-param>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>CXFServlet</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/templates/markdown.hbs b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/templates/markdown.hbs
new file mode 100644
index 0000000000..cc87c38244
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/templates/markdown.hbs
@@ -0,0 +1,105 @@
+#{{#info}}{{title}}
+
+
+## {{join schemes " | "}}://{{host}}{{basePath}}
+
+
+{{description}}
+
+{{#contact}}
+[**Contact the developer**](mailto:{{email}})
+{{/contact}}
+
+**Version** {{version}}
+
+{{#license}}[**{{name}}**]({{url}}){{/license}}
+
+{{/info}}
+
+{{#if consumes}}**Consumes:** {{join consumes ", "}}{{/if}}
+
+{{#if produces}}**Produces:** {{join produces ", "}}{{/if}}
+
+{{#if securityDefinitions}}
+# Security Definitions
+{{/if}}
+{{> security}}
+
+# APIs
+
+{{#each paths}}
+## {{@key}}
+{{#this}}
+{{#get}}
+### GET
+{{> operation}}
+{{/get}}
+
+{{#put}}
+### PUT
+{{> operation}}
+{{/put}}
+
+{{#post}}
+### POST
+
+{{> operation}}
+
+{{/post}}
+
+{{#delete}}
+### DELETE
+{{> operation}}
+{{/delete}}
+
+{{#option}}
+### OPTION
+{{> operation}}
+{{/option}}
+
+{{#patch}}
+### PATCH
+{{> operation}}
+{{/patch}}
+
+{{#head}}
+### HEAD
+{{> operation}}
+{{/head}}
+
+{{/this}}
+{{/each}}
+
+# Definitions
+{{#each definitions}}
+## <a name="/definitions/{{key}}">{{@key}}</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+ {{#each this.properties}}
+ <tr>
+ <td>{{@key}}</td>
+ <td>
+ {{#ifeq type "array"}}
+ {{#items.$ref}}
+ {{type}}[<a href="{{items.$ref}}">{{basename items.$ref}}</a>]
+ {{/items.$ref}}
+ {{^items.$ref}}{{type}}[{{items.type}}]{{/items.$ref}}
+ {{else}}
+ {{#$ref}}<a href="{{$ref}}">{{basename $ref}}</a>{{/$ref}}
+ {{^$ref}}{{type}}{{#format}} ({{format}}){{/format}}{{/$ref}}
+ {{/ifeq}}
+ </td>
+ <td>{{#required}}required{{/required}}{{^required}}optional{{/required}}</td>
+ <td>{{#description}}{{{description}}}{{/description}}{{^description}}-{{/description}}</td>
+ <td>{{example}}</td>
+ </tr>
+ {{/each}}
+</table>
+{{/each}} \ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/templates/operation.hbs b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/templates/operation.hbs
new file mode 100644
index 0000000000..375d4f7701
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/templates/operation.hbs
@@ -0,0 +1,73 @@
+{{#deprecated}}-deprecated-{{/deprecated}}
+<a id="{{operationId}}">{{summary}}</a>
+
+{{description}}
+
+{{#if externalDocs.url}}{{externalDocs.description}}. [See external documents for more details]({{externalDocs.url}})
+{{/if}}
+
+{{#if security}}
+#### Security
+{{/if}}
+
+{{#security}}
+{{#each this}}
+* {{@key}}
+{{#this}} * {{this}}
+{{/this}}
+{{/each}}
+{{/security}}
+
+#### Request
+
+{{#if consumes}}
+**Content-Type: ** {{join consumes ", "}}{{/if}}
+
+##### Parameters
+{{#if parameters}}
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+{{/if}}
+
+{{#parameters}}
+<tr>
+ <th>{{name}}</th>
+ <td>{{in}}</td>
+ <td>{{#if required}}yes{{else}}no{{/if}}</td>
+ <td>{{description}}{{#if pattern}} (**Pattern**: `{{pattern}}`){{/if}}</td>
+ <td>{{#if defaultValue}}{{defaultValue}}{{else}} - {{/if}}</td>
+{{#ifeq in "body"}}
+ <td>
+ {{#ifeq schema.type "array"}}Array[<a href="{{schema.items.$ref}}">{{basename schema.items.$ref}}</a>]{{/ifeq}}
+ {{#schema.$ref}}<a href="{{schema.$ref}}">{{basename schema.$ref}}</a> {{/schema.$ref}}
+ </td>
+{{else}}
+ {{#ifeq type "array"}}
+ <td>Array[{{items.type}}] ({{collectionFormat}})</td>
+ {{else}}
+ <td>{{type}} {{#format}}({{format}}){{/format}}</td>
+ {{/ifeq}}
+{{/ifeq}}
+</tr>
+{{/parameters}}
+{{#if parameters}}
+</table>
+{{/if}}
+
+
+#### Response
+
+{{#if produces}}**Content-Type: ** {{join produces ", "}}{{/if}}
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+{{#each responses}}| {{@key}} | {{description}} | {{#schema.$ref}}<a href="{{schema.$ref}}">{{basename schema.$ref}}</a>{{/schema.$ref}}{{#ifeq schema.type "array"}}Array[<a href="{{schema.items.$ref}}">{{basename schema.items.$ref}}</a>]{{/ifeq}}{{^schema}} - {{/schema}}|
+{{/each}} \ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/templates/security.hbs b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/templates/security.hbs
new file mode 100644
index 0000000000..04f86e8380
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/templates/security.hbs
@@ -0,0 +1,88 @@
+{{#each securityDefinitions}}
+### {{@key}}
+{{#this}}
+{{#ifeq type "oauth2"}}
+<table>
+ <tr>
+ <th>type</th>
+ <th colspan="2">{{type}}</th>
+ </tr>
+{{#if description}}
+ <tr>
+ <th>description</th>
+ <th colspan="2">{{description}}</th>
+ </tr>
+{{/if}}
+{{#if authorizationUrl}}
+ <tr>
+ <th>authorizationUrl</th>
+ <th colspan="2">{{authorizationUrl}}</th>
+ </tr>
+{{/if}}
+{{#if flow}}
+ <tr>
+ <th>flow</th>
+ <th colspan="2">{{flow}}</th>
+ </tr>
+{{/if}}
+{{#if tokenUrl}}
+ <tr>
+ <th>tokenUrl</th>
+ <th colspan="2">{{tokenUrl}}</th>
+ </tr>
+{{/if}}
+{{#if scopes}}
+ <tr>
+ <td rowspan="3">scopes</td>
+{{#each scopes}}
+ <td>{{@key}}</td>
+ <td>{{this}}</td>
+ </tr>
+ <tr>
+{{/each}}
+ </tr>
+{{/if}}
+</table>
+{{/ifeq}}
+{{#ifeq type "apiKey"}}
+<table>
+ <tr>
+ <th>type</th>
+ <th colspan="2">{{type}}</th>
+ </tr>
+{{#if description}}
+ <tr>
+ <th>description</th>
+ <th colspan="2">{{description}}</th>
+ </tr>
+{{/if}}
+{{#if name}}
+ <tr>
+ <th>name</th>
+ <th colspan="2">{{name}}</th>
+ </tr>
+{{/if}}
+{{#if in}}
+ <tr>
+ <th>in</th>
+ <th colspan="2">{{in}}</th>
+ </tr>
+{{/if}}
+</table>
+{{/ifeq}}
+{{#ifeq type "basic"}}
+<table>
+ <tr>
+ <th>type</th>
+ <th colspan="2">{{type}}</th>
+ </tr>
+{{#if description}}
+ <tr>
+ <th>description</th>
+ <th colspan="2">{{description}}</th>
+ </tr>
+{{/if}}
+</table>
+{{/ifeq}}
+{{/this}}
+{{/each}} \ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/templates/strapdown.html.hbs b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/templates/strapdown.html.hbs
new file mode 100644
index 0000000000..fe722ab6f1
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/templates/strapdown.html.hbs
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<title>API Document</title>
+
+<!--xmp theme="united" style="display:none;"-->
+<xmp theme="united" style="display:none;">
+{{>markdown}}
+</xmp>
+
+<script src="http://strapdownjs.com/v/0.2/strapdown.js"></script>
+</html> \ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/pom.xml
new file mode 100644
index 0000000000..764fb84db4
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/pom.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-rest-webapp</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>openecomp-sdc-common-rest</artifactId>
+ <name>openecomp-sdc-common-rest</name>
+
+
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-utilities-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-common-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</artifactId>
+ <version>${hibernate.validator.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>javax.ws.rs-api</artifactId>
+ <version>${ws.rs.version}</version>
+ </dependency>
+ <!-- Swagger -->
+ <dependency>
+ <groupId>io.swagger</groupId>
+ <artifactId>swagger-core</artifactId>
+ <version>${swagger.version}</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/RestConstants.java b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/RestConstants.java
new file mode 100644
index 0000000000..499bd6e785
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/RestConstants.java
@@ -0,0 +1,29 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.common;
+
+public class RestConstants {
+ public static final String USER_HEADER_PARAM = "USER_ID";
+ public static final String USER_MISSING_ERROR_MSG =
+ "Field does not conform to predefined criteria : user : may not be null";
+ public static final String INVALID_JSON_ERROR_MESSAGE =
+ "Field does not conform to predefined criteria : body :must be in JSON format";
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/mapping/MapErrorCodeToDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/mapping/MapErrorCodeToDto.java
new file mode 100644
index 0000000000..cad5c69899
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/mapping/MapErrorCodeToDto.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.common.mapping;
+
+import org.openecomp.sdc.common.errors.ErrorCode;
+import org.openecomp.sdcrests.common.types.ErrorCodeDto;
+import org.openecomp.sdcrests.mapping.MappingBase;
+
+public class MapErrorCodeToDto extends MappingBase<ErrorCode, ErrorCodeDto> {
+ @Override
+ public void doMapping(ErrorCode source, ErrorCodeDto target) {
+ target.setId(source.id());
+ target.setCategory(source.category());
+ target.setMessage(source.message());
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/mapping/MapErrorMessageToDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/mapping/MapErrorMessageToDto.java
new file mode 100644
index 0000000000..83c7b15980
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/mapping/MapErrorMessageToDto.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.common.mapping;
+
+import org.openecomp.sdc.datatypes.error.ErrorMessage;
+import org.openecomp.sdcrests.common.types.ErrorMessageDto;
+import org.openecomp.sdcrests.mapping.MappingBase;
+
+public class MapErrorMessageToDto extends MappingBase<ErrorMessage, ErrorMessageDto> {
+ @Override
+ public void doMapping(ErrorMessage source, ErrorMessageDto target) {
+ target.setMessage(source.getMessage());
+ target.setLevel(source.getLevel());
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/types/ErrorCodeDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/types/ErrorCodeDto.java
new file mode 100644
index 0000000000..3615f89afc
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/types/ErrorCodeDto.java
@@ -0,0 +1,53 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.common.types;
+
+import org.openecomp.sdc.common.errors.ErrorCategory;
+
+public class ErrorCodeDto {
+ private String id;
+ private String message;
+ private ErrorCategory category;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public ErrorCategory getCategory() {
+ return category;
+ }
+
+ public void setCategory(ErrorCategory category) {
+ this.category = category;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/types/ErrorMessageDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/types/ErrorMessageDto.java
new file mode 100644
index 0000000000..f63a9b0ced
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/types/ErrorMessageDto.java
@@ -0,0 +1,44 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.common.types;
+
+import org.openecomp.sdc.datatypes.error.ErrorLevel;
+
+public class ErrorMessageDto {
+ private ErrorLevel level;
+ private String message;
+
+ public ErrorLevel getLevel() {
+ return level;
+ }
+
+ public void setLevel(ErrorLevel level) {
+ this.level = level;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/errors/DefaultExceptionMapper.java b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/errors/DefaultExceptionMapper.java
new file mode 100644
index 0000000000..67da814f48
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/errors/DefaultExceptionMapper.java
@@ -0,0 +1,163 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.errors;
+
+import org.codehaus.jackson.map.JsonMappingException;
+import org.hibernate.validator.internal.engine.path.PathImpl;
+import org.openecomp.core.utilities.CommonMethods;
+import org.openecomp.core.utilities.file.FileUtils;
+import org.openecomp.core.utilities.json.JsonUtil;
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+import org.openecomp.sdc.common.errors.ErrorCodeAndMessage;
+import org.openecomp.sdc.common.errors.GeneralErrorBuilder;
+import org.openecomp.sdc.common.errors.JsonMappingErrorBuilder;
+import org.openecomp.sdc.common.errors.ValidationErrorBuilder;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import javax.validation.ConstraintViolation;
+import javax.validation.ConstraintViolationException;
+import javax.validation.Path;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.ext.ExceptionMapper;
+
+public class DefaultExceptionMapper implements ExceptionMapper<Exception> {
+ private static final String ERROR_CODES_TO_RESPONSE_STATUS_MAPPING_FILE =
+ "errorCodesToResponseStatusMapping.json";
+ private static Map<String, String> errorCodeToResponseStatus = JsonUtil
+ .json2Object(FileUtils.getFileInputStream(ERROR_CODES_TO_RESPONSE_STATUS_MAPPING_FILE),
+ Map.class);
+ private static org.slf4j.Logger logger = LoggerFactory.getLogger(DefaultExceptionMapper.class);
+
+ @Override
+ public Response toResponse(Exception e0) {
+ Response response;
+ if (e0 instanceof CoreException) {
+ response = transform(CoreException.class.cast(e0));
+ } else if (e0 instanceof ConstraintViolationException) {
+ response = transform(ConstraintViolationException.class.cast(e0));
+
+ } else if (e0 instanceof JsonMappingException) {
+ response = transform(JsonMappingException.class.cast(e0));
+
+ } else {
+ response = transform(e0);
+ }
+
+ List<Object> contentTypes = new ArrayList<>();
+ contentTypes.add(MediaType.APPLICATION_JSON);
+ response.getMetadata().put("Content-Type", contentTypes);
+ return response;
+ }
+
+ private Response transform(CoreException coreException) {
+ Response response;
+ ErrorCode code = coreException.code();
+ logger.error(code.message(), coreException);
+
+ if (coreException.code().category().equals(ErrorCategory.APPLICATION)) {
+ if (Response.Status.NOT_FOUND.name().equals(errorCodeToResponseStatus.get(code.id()))) {
+ response = Response
+ .status(Response.Status.NOT_FOUND)
+ .entity(toEntity(Response.Status.NOT_FOUND, code))
+ .build();
+ } else if (Response.Status.BAD_REQUEST.name()
+ .equals(errorCodeToResponseStatus.get(code.id()))) {
+ response = Response
+ .status(Response.Status.BAD_REQUEST)
+ .entity(toEntity(Response.Status.BAD_REQUEST, code))
+ .build();
+ } else {
+ response = Response
+ .status(Response.Status.EXPECTATION_FAILED)
+ .entity(toEntity(Response.Status.EXPECTATION_FAILED, code))
+ .build();
+ }
+ } else {
+ response = Response
+ .status(Response.Status.INTERNAL_SERVER_ERROR)
+ .entity(toEntity(Response.Status.INTERNAL_SERVER_ERROR, code))
+ .build();
+ }
+
+
+ return response;
+ }
+
+ private Response transform(ConstraintViolationException validationException) {
+ Set<ConstraintViolation<?>> constraintViolationSet =
+ validationException.getConstraintViolations();
+ String message;
+
+ String fieldName = null;
+ if (!CommonMethods.isEmpty(constraintViolationSet)) {
+ // getting the first violation message for the output response.
+ ConstraintViolation<?> constraintViolation = constraintViolationSet.iterator().next();
+ message = constraintViolation.getMessage();
+ fieldName = getFieldName(constraintViolation.getPropertyPath());
+
+ } else {
+ message = validationException.getMessage();
+ }
+
+ ErrorCode validationErrorCode = new ValidationErrorBuilder(message, fieldName).build();
+
+ logger.error(validationErrorCode.message(), validationException);
+ return Response
+ .status(Response.Status.EXPECTATION_FAILED) //error 417
+ .entity(toEntity(Response.Status.EXPECTATION_FAILED, validationErrorCode))
+ .build();
+ }
+
+
+ private Response transform(JsonMappingException jsonMappingException) {
+ ErrorCode jsonMappingErrorCode = new JsonMappingErrorBuilder().build();
+ logger.error(jsonMappingErrorCode.message(), jsonMappingException);
+ return Response
+ .status(Response.Status.EXPECTATION_FAILED) //error 417
+ .entity(toEntity(Response.Status.EXPECTATION_FAILED, jsonMappingErrorCode))
+ .build();
+ }
+
+ private Response transform(Exception e0) {
+ ErrorCode generalErrorCode = new GeneralErrorBuilder(e0.getMessage()).build();
+ logger.error(generalErrorCode.message(), e0);
+ return Response
+ .status(Response.Status.INTERNAL_SERVER_ERROR)
+ .entity(toEntity(Response.Status.INTERNAL_SERVER_ERROR, generalErrorCode))
+ .build();
+ }
+
+ private String getFieldName(Path propertyPath) {
+ return ((PathImpl) propertyPath).getLeafNode().toString();
+ }
+
+ private Object toEntity(Response.Status status, ErrorCode code) {
+ return new ErrorCodeAndMessage(status, code);
+ }
+
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/mapping/MappingBase.java b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/mapping/MappingBase.java
new file mode 100644
index 0000000000..7382ef72eb
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/mapping/MappingBase.java
@@ -0,0 +1,104 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.mapping;
+
+/**
+ * Base class for all mapping classes. Mapping classes will perform data mapping from source object
+ * to target object Base class provides following<br>
+ * <ol>
+ * <li>provides life cycle of mapping class , first mapSimpleProperties is called and then
+ * mapComplexProperties is called.</li>
+ * <li>methods mapSimpleProperties and mapComplexProperties with default implementation,
+ * these should be overridden by concrete mapping classes for writing mapping logic.</li>
+ * </ol>
+ */
+
+public abstract class MappingBase<S, T> {
+
+ /**
+ * Method is called for starting mapping from source object to target object method sets context
+ * in the thread locale and than calls mapSimpleProperties and mapComplexProperties respectively.
+ *
+ * @param source : source object for mapping
+ * @param clazz : target <code>Class</code> for mapping
+ * @return <code>T</code> - instance of type <code>T</code>
+ */
+
+ public final T applyMapping(final S source, Class<T> clazz) {
+ T target = (T) instantiateTarget(clazz);
+ if (source == null || target == null) {
+ //TODO: what what?
+ } else {
+ preMapping(source, target);
+ doMapping(source, target);
+ postMapping(source, target);
+
+ }
+ return target;
+
+ }
+
+ /**
+ * This method is called before the <code>doMapping</code> method.
+ */
+
+ public void preMapping(final S source, T target) {
+ }
+
+ /**
+ * The actual method that does the mapping between the <code>source</code>
+ * to <code>target</code> objects.
+ * This method is being called automatically as part of the mapper class.
+ * This method must be override (it is abstract) by the mapper class.
+ *
+ * @param source - the source object.
+ * @param target - the target object.
+ */
+
+ public abstract void doMapping(final S source, T target);
+
+ /**
+ * This method is called after the <code>doMapping</code> method.
+ */
+
+ public void postMapping(final S source, T target) {
+ }
+
+ /**
+ * Creates the instance of the input class.
+ *
+ * @return <code>Object</code>
+ */
+
+ private Object instantiateTarget(final Class<?> clazz) {
+ Object object = null;
+ try {
+ object = clazz.newInstance();
+
+ } catch (InstantiationException | IllegalAccessException e0) {
+ //Do nothing
+ }
+ return object;
+
+ }
+
+}
+
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/versioning/types/VersioningAction.java b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/versioning/types/VersioningAction.java
new file mode 100644
index 0000000000..8cb5a061b9
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/versioning/types/VersioningAction.java
@@ -0,0 +1,28 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.versioning.types;
+
+public enum VersioningAction {
+ Checkout,
+ Undo_Checkout,
+ Checkin,
+ Submit;
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/wrappers/GenericCollectionWrapper.java b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/wrappers/GenericCollectionWrapper.java
new file mode 100644
index 0000000000..b8d47e4ef3
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/wrappers/GenericCollectionWrapper.java
@@ -0,0 +1,107 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.wrappers;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * This class represents a generic collection wrapper to be used by paginated results.
+ *
+ * @param <T> the type parameter
+ */
+public class GenericCollectionWrapper<T> implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ private List<T> results;
+ private int listCount;
+
+ /**
+ * Instantiates a new Generic collection wrapper.
+ */
+ public GenericCollectionWrapper() {
+ this.results = new ArrayList<>();
+ }
+
+ /**
+ * Instantiates a new Generic collection wrapper.
+ *
+ * @param list the list
+ * @param listCount the list count
+ */
+ public GenericCollectionWrapper(List<T> list, int listCount) {
+ if (!list.isEmpty()) {
+ this.results = list;
+ this.listCount = listCount;
+ }
+ }
+
+ /**
+ * Gets results.
+ *
+ * @return the results
+ */
+ public List<T> getResults() {
+ return results;
+ }
+
+ /**
+ * Sets results.
+ *
+ * @param results the results
+ */
+ public void setResults(List<T> results) {
+ this.results = results;
+ }
+
+ /**
+ * Gets list count.
+ *
+ * @return the list count
+ */
+ public int getListCount() {
+ return listCount;
+ }
+
+ /**
+ * Sets list count.
+ *
+ * @param listCount the list count
+ */
+ public void setListCount(int listCount) {
+ this.listCount = listCount;
+ }
+
+ /**
+ * Add boolean.
+ *
+ * @param e0 the e 0
+ * @return the boolean
+ */
+ public boolean add(T e0) {
+ if (this.getResults().add(e0)) {
+ this.setListCount(this.getResults().size());
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/wrappers/StringWrapperResponse.java b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/wrappers/StringWrapperResponse.java
new file mode 100644
index 0000000000..d472eb9d14
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/wrappers/StringWrapperResponse.java
@@ -0,0 +1,42 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.wrappers;
+
+public class StringWrapperResponse {
+ private String value;
+
+ public StringWrapperResponse() {
+ }
+
+ public StringWrapperResponse(String value) {
+ super();
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/resources/errorCodesToResponseStatusMapping.json b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/resources/errorCodesToResponseStatusMapping.json
new file mode 100644
index 0000000000..e4c6962847
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/resources/errorCodesToResponseStatusMapping.json
@@ -0,0 +1,9 @@
+{
+ "VSP_NOT_FOUND": "NOT_FOUND",
+ "VSP_INVALID": "BAD_REQUEST",
+ "UPLOAD_INVALID" : "PRECONDITION_FAILED",
+ "PACKAGE_NOT_FOUND": "NOT_FOUND",
+ "PACKAGE_INVALID": "BAD_REQUEST",
+ "VENDOR_LICENSE_MODEL_NOT_FOUND": "NOT_FOUND",
+ "VENDOR_LICENSE_ENTITY_NOT_FOUND": "NOT_FOUND"
+} \ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/pom.xml
new file mode 100644
index 0000000000..7d20b19016
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/pom.xml
@@ -0,0 +1,29 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-api</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../</relativePath>
+ </parent>
+
+ <artifactId>openecomp-sdc-rest-webapp</artifactId>
+ <name>openecomp-sdc-rest-webapp</name>
+ <packaging>pom</packaging>
+
+
+
+ <modules>
+ <module>/openecomp-sdc-common-rest</module>
+ <module>/vendor-license-rest</module>
+ <module>/onboarding-rest-war</module>
+ <module>/vendor-software-products-rest</module>
+ <module>/sequence-rest</module>
+ <module>/validation-rest</module>
+ <module>/action-library-rest</module>
+ <module>/application-config-rest</module>
+ </modules>
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/sequence-rest/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/sequence-rest/pom.xml
new file mode 100644
index 0000000000..68f021c16b
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/sequence-rest/pom.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>openecomp-sdc-rest-webapp</artifactId>
+ <groupId>org.openecomp.sdc</groupId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>sequence-rest</artifactId>
+
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/sequence-rest/src/main/java/org/openecomp/sdcrests/service/rest/Service.java b/openecomp-be/api/openecomp-sdc-rest-webapp/sequence-rest/src/main/java/org/openecomp/sdcrests/service/rest/Service.java
new file mode 100644
index 0000000000..3e1a107b81
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/sequence-rest/src/main/java/org/openecomp/sdcrests/service/rest/Service.java
@@ -0,0 +1,24 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.service.rest;
+
+public interface Service {
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/sequence-rest/src/main/java/org/openecomp/sdcrests/service/rest/services/ServiceImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/sequence-rest/src/main/java/org/openecomp/sdcrests/service/rest/services/ServiceImpl.java
new file mode 100644
index 0000000000..030d4a9c1d
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/sequence-rest/src/main/java/org/openecomp/sdcrests/service/rest/services/ServiceImpl.java
@@ -0,0 +1,26 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.service.rest.services;
+
+import org.openecomp.sdcrests.service.rest.Service;
+
+public class ServiceImpl implements Service {
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/pom.xml
new file mode 100644
index 0000000000..1db9db948c
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/pom.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-rest-webapp</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.openecomp.sdc.onboarding</groupId>
+ <artifactId>validation-rest</artifactId>
+ <name>validation-rest</name>
+ <packaging>pom</packaging>
+
+
+ <modules>
+ <module>/validation-rest-services</module>
+ <module>/validation-rest-types</module>
+ </modules>
+</project> \ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/pom.xml
new file mode 100644
index 0000000000..793cdc0d42
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/pom.xml
@@ -0,0 +1,144 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.sdc.onboarding</groupId>
+ <artifactId>validation-rest</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>validation-rest-services</artifactId>
+
+
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ <version>${spring.framework.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <version>${spring.framework.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context-support</artifactId>
+ <version>${spring.framework.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ <version>${spring.framework.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ <version>${spring.framework.version}</version>
+ </dependency>
+
+ <!-- CXF -->
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-frontend-jaxrs</artifactId>
+ <version>${cxf.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ <version>${http.client.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>javax.ws.rs-api</artifactId>
+ <version>${ws.rs.version}</version>
+ </dependency>
+
+ <!-- Other Stuff-->
+ <dependency>
+ <groupId>cglib</groupId>
+ <artifactId>cglib-nodep</artifactId>
+ <version>${cglib.nodep.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <!-- Java Stuff -->
+ <dependency>
+ <groupId>javax.inject</groupId>
+ <artifactId>javax.inject</artifactId>
+ <version>${javax.inject.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>javax.ws.rs-api</artifactId>
+ <version>${ws.rs.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-core</artifactId>
+ <version>1.19.1</version>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>jsr311-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>io.swagger</groupId>
+ <artifactId>swagger-annotations</artifactId>
+ <version>1.5.3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc.onboarding</groupId>
+ <artifactId>validation-rest-types</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-annotations</artifactId>
+ <version>2.7.4</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.dataformat</groupId>
+ <artifactId>jackson-dataformat-xml</artifactId>
+ <version>2.7.4</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.woodstox</groupId>
+ <artifactId>woodstox-core-asl</artifactId>
+ <version>4.4.1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-vendor-software-product-manager</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+
+ </dependencies>
+
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <includes>
+ <include>test/core/unittest/offline/**</include>
+ </includes>
+ <skipTests>true</skipTests>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/Validation.java b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/Validation.java
new file mode 100644
index 0000000000..5a1955c0dd
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/Validation.java
@@ -0,0 +1,52 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.validation.rest;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.apache.cxf.jaxrs.ext.multipart.Multipart;
+import org.springframework.validation.annotation.Validated;
+
+import java.io.InputStream;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+
+@Path("/v1.0/validation")
+@Produces(MediaType.APPLICATION_JSON)
+@Consumes(MediaType.APPLICATION_JSON)
+@Api(value = "Validation")
+@Validated
+public interface Validation {
+
+
+ @POST
+ @Path("{type}/validate")
+ @Consumes(MediaType.MULTIPART_FORM_DATA)
+ @ApiOperation(value = "Validate a package")
+ Response validateFile(@PathParam("type") String type,
+ @Multipart("validate") InputStream fileToValidate);
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/mapping/MapValidationFileResponseToValidationFileResponseDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/mapping/MapValidationFileResponseToValidationFileResponseDto.java
new file mode 100644
index 0000000000..bd8639b682
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/mapping/MapValidationFileResponseToValidationFileResponseDto.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.validation.rest.mapping;
+
+
+import org.openecomp.sdc.validation.types.ValidationFileResponse;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.validation.types.ValidationFileResponseDto;
+
+public class MapValidationFileResponseToValidationFileResponseDto
+ extends MappingBase<ValidationFileResponse, ValidationFileResponseDto> {
+ @Override
+ public void doMapping(ValidationFileResponse source, ValidationFileResponseDto target) {
+ target.setValidationData(source.getValidationData());
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/services/ValidationImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/services/ValidationImpl.java
new file mode 100644
index 0000000000..88a173de84
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/services/ValidationImpl.java
@@ -0,0 +1,63 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.validation.rest.services;
+
+import org.openecomp.sdc.validation.UploadValidationManager;
+import org.openecomp.sdc.validation.types.ValidationFileResponse;
+import org.openecomp.sdcrests.validation.rest.Validation;
+import org.openecomp.sdcrests.validation.rest.mapping.MapValidationFileResponseToValidationFileResponseDto;
+import org.openecomp.sdcrests.validation.types.ValidationFileResponseDto;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Service;
+
+import java.io.IOException;
+import java.io.InputStream;
+import javax.inject.Named;
+import javax.ws.rs.core.Response;
+
+
+@Named
+@Service("validation")
+@Scope(value = "prototype")
+public class ValidationImpl implements Validation {
+
+ @Autowired
+ private UploadValidationManager uploadValidationManager;
+
+ @Override
+ public Response validateFile(String type, InputStream fileToValidate) {
+ ValidationFileResponse validationFileResponse = null;
+ try {
+ validationFileResponse = uploadValidationManager.validateFile(type, fileToValidate);
+ } catch (IOException e0) {
+ throw new RuntimeException(e0);
+ }
+
+ ValidationFileResponseDto validationFileResponseDto =
+ new MapValidationFileResponseToValidationFileResponseDto()
+ .applyMapping(validationFileResponse, ValidationFileResponseDto.class);
+
+ return Response.ok(validationFileResponseDto).build();
+ }
+
+
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-types/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-types/pom.xml
new file mode 100644
index 0000000000..fa844f891c
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-types/pom.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.sdc.onboarding</groupId>
+ <artifactId>validation-rest</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../</relativePath>
+ </parent>
+
+ <artifactId>validation-rest-types</artifactId>
+ <name>validation-rest-types</name>
+
+
+
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-common-rest</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-validation-manager</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-types/src/main/java/org/openecomp/sdcrests/validation/types/ValidationFileResponseDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-types/src/main/java/org/openecomp/sdcrests/validation/types/ValidationFileResponseDto.java
new file mode 100644
index 0000000000..75e59973e3
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-types/src/main/java/org/openecomp/sdcrests/validation/types/ValidationFileResponseDto.java
@@ -0,0 +1,36 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.validation.types;
+
+import org.openecomp.sdc.heat.datatypes.structure.ValidationStructureList;
+
+public class ValidationFileResponseDto {
+
+ private ValidationStructureList validationData;
+
+ public ValidationStructureList getValidationData() {
+ return validationData;
+ }
+
+ public void setValidationData(ValidationStructureList validationData) {
+ this.validationData = validationData;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/pom.xml
new file mode 100644
index 0000000000..6c8a7376a2
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/pom.xml
@@ -0,0 +1,24 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-rest-webapp</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../</relativePath>
+ </parent>
+
+ <groupId>org.openecomp.sdc.onboarding</groupId>
+ <artifactId>vendor-license-rest</artifactId>
+ <name>vendor-license-rest</name>
+ <packaging>pom</packaging>
+
+
+
+ <modules>
+ <module>/vendor-license-rest-services</module>
+ <module>/vendor-license-rest-types</module>
+ </modules>
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/pom.xml
new file mode 100644
index 0000000000..86f7ebde14
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/pom.xml
@@ -0,0 +1,133 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.sdc.onboarding</groupId>
+ <artifactId>vendor-license-rest</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../</relativePath>
+ </parent>
+
+ <artifactId>vendor-license-rest-services</artifactId>
+ <name>vendor-license-rest-services</name>
+
+
+
+
+ <properties>
+ <errorcode.dir>${project.build.directory}/generated-sources/error-codes</errorcode.dir>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>vendor-license-rest-types</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-vendor-license-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-vendor-license-manager</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+
+ <!-- Spring -->
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ <version>${spring.framework.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <version>${spring.framework.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context-support</artifactId>
+ <version>${spring.framework.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ <version>${spring.framework.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ <version>${spring.framework.version}</version>
+ </dependency>
+
+ <!-- CXF -->
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-frontend-jaxrs</artifactId>
+ <version>${cxf.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ <version>${http.client.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpcore</artifactId>
+ <version>${http.client.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>javax.ws.rs-api</artifactId>
+ <version>${ws.rs.version}</version>
+ </dependency>
+
+ <!-- Other Stuff-->
+ <dependency>
+ <groupId>cglib</groupId>
+ <artifactId>cglib-nodep</artifactId>
+ <version>${cglib.nodep.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <!-- Java Stuff -->
+ <dependency>
+ <groupId>javax.inject</groupId>
+ <artifactId>javax.inject</artifactId>
+ <version>${javax.inject.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-vendor-software-product-manager</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ </dependencies>
+
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <includes>
+ <include>test/core/unittest/offline/**</include>
+ </includes>
+ <skipTests>true</skipTests>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+
+
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/EntitlementPools.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/EntitlementPools.java
new file mode 100644
index 0000000000..9dea767f7d
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/EntitlementPools.java
@@ -0,0 +1,105 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.rest;
+
+import static org.openecomp.sdcrests.common.RestConstants.USER_HEADER_PARAM;
+import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdcrests.vendorlicense.types.EntitlementPoolEntityDto;
+import org.openecomp.sdcrests.vendorlicense.types.EntitlementPoolRequestDto;
+import org.springframework.validation.annotation.Validated;
+
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Pattern;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+@Path("/v1.0/vendor-license-models/{vlmId}/entitlement-pools")
+@Produces(MediaType.APPLICATION_JSON)
+@Consumes(MediaType.APPLICATION_JSON)
+@Api(value = "Vendor License Model - Entitlement Pools")
+@Validated
+public interface EntitlementPools {
+ @GET
+ @Path("/")
+ @ApiOperation(value = "List vendor entitlement pools",
+ response = EntitlementPoolEntityDto.class,
+ responseContainer = "List")
+ Response listEntitlementPools(
+ @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
+ @Pattern(regexp = Version.VERSION_REGEX, message = Version.VERSION_STRING_VIOLATION_MSG)
+ @QueryParam("version") String version,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user);
+
+ @POST
+ @Path("/")
+ @ApiOperation(value = "Create vendor entitlement pool")
+ Response createEntitlementPool(@Valid EntitlementPoolRequestDto request,
+ @ApiParam(value = "Vendor license model Id") @PathParam("vlmId")
+ String vlmId,
+ @NotNull(message = USER_MISSING_ERROR_MSG)
+ @HeaderParam(USER_HEADER_PARAM) String user);
+
+ @PUT
+ @Path("/{entitlementPoolId}")
+ @ApiOperation(value = "Update vendor entitlement pool")
+ Response updateEntitlementPool(@Valid EntitlementPoolRequestDto request,
+ @ApiParam(value = "Vendor license model Id") @PathParam("vlmId")
+ String vlmId,
+ @NotNull(message = USER_MISSING_ERROR_MSG)
+ @PathParam("entitlementPoolId") String entitlementPoolId,
+ @HeaderParam(USER_HEADER_PARAM) String user);
+
+ @GET
+ @Path("/{entitlementPoolId}")
+ @ApiOperation(value = "Get vendor entitlement pool",
+ response = EntitlementPoolEntityDto.class)
+ Response getEntitlementPool(
+ @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
+ @Pattern(regexp = Version.VERSION_REGEX, message = Version.VERSION_STRING_VIOLATION_MSG)
+ @QueryParam("version") String version,
+ @PathParam("entitlementPoolId") String entitlementPoolId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user);
+
+ @DELETE
+ @Path("/{entitlementPoolId}")
+ @ApiOperation(value = "Delete vendor entitlement pool")
+ Response deleteEntitlementPool(
+ @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
+ @PathParam("entitlementPoolId") String entitlementPoolId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user);
+
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/FeatureGroups.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/FeatureGroups.java
new file mode 100644
index 0000000000..f5ad973cb0
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/FeatureGroups.java
@@ -0,0 +1,108 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.rest;
+
+import static org.openecomp.sdcrests.common.RestConstants.USER_HEADER_PARAM;
+import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupEntityDto;
+import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupModelDto;
+import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupRequestDto;
+import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupUpdateRequestDto;
+import org.springframework.validation.annotation.Validated;
+
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Pattern;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+@Path("/v1.0/vendor-license-models/{vlmId}/feature-groups")
+@Produces(MediaType.APPLICATION_JSON)
+@Consumes(MediaType.APPLICATION_JSON)
+@Api(value = "Vendor License Model - Feature Groups")
+@Validated
+public interface FeatureGroups {
+
+ @GET
+ @Path("/")
+ @ApiOperation(value = "List vendor feature groups",
+ response = FeatureGroupEntityDto.class,
+ responseContainer = "List")
+ Response listFeatureGroups(
+ @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
+ @Pattern(regexp = Version.VERSION_REGEX, message = Version.VERSION_STRING_VIOLATION_MSG)
+ @QueryParam("version") String version,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user);
+
+ @POST
+ @Path("/")
+ @ApiOperation(value = "Create vendor feature group")
+ Response createFeatureGroup(@Valid FeatureGroupRequestDto request,
+ @ApiParam(value = "Vendor license model Id") @PathParam("vlmId")
+ String vlmId,
+ @NotNull(message = USER_MISSING_ERROR_MSG)
+ @HeaderParam(USER_HEADER_PARAM) String user);
+
+ @PUT
+ @Path("/{featureGroupId}")
+ @ApiOperation(value = "Update vendor feature group")
+ Response updateFeatureGroup(@Valid FeatureGroupUpdateRequestDto request,
+ @ApiParam(value = "Vendor license model Id") @PathParam("vlmId")
+ String vlmId,
+ @PathParam("featureGroupId") String featureGroupId,
+ @NotNull(message = USER_MISSING_ERROR_MSG)
+ @HeaderParam(USER_HEADER_PARAM) String user);
+
+ @GET
+ @Path("/{featureGroupId}")
+ @ApiOperation(value = "Get vendor feature group",
+ response = FeatureGroupModelDto.class)
+ Response getFeatureGroup(
+ @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
+ @Pattern(regexp = Version.VERSION_REGEX, message = Version.VERSION_STRING_VIOLATION_MSG)
+ @QueryParam("version") String version,
+ @PathParam("featureGroupId") String featureGroupId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user);
+
+ @DELETE
+ @Path("/{featureGroupId}")
+ @ApiOperation(value = "Delete vendor feature group")
+ Response deleteFeatureGroup(
+ @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
+ @PathParam("featureGroupId") String featureGroupId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user);
+
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/LicenseAgreements.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/LicenseAgreements.java
new file mode 100644
index 0000000000..28d9f5a32f
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/LicenseAgreements.java
@@ -0,0 +1,109 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.rest;
+
+import static org.openecomp.sdcrests.common.RestConstants.USER_HEADER_PARAM;
+import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdcrests.vendorlicense.types.LicenseAgreementEntityDto;
+import org.openecomp.sdcrests.vendorlicense.types.LicenseAgreementModelDto;
+import org.openecomp.sdcrests.vendorlicense.types.LicenseAgreementRequestDto;
+import org.openecomp.sdcrests.vendorlicense.types.LicenseAgreementUpdateRequestDto;
+import org.springframework.validation.annotation.Validated;
+
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Pattern;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+@Path("/v1.0/vendor-license-models/{vlmId}/license-agreements")
+@Produces(MediaType.APPLICATION_JSON)
+@Consumes(MediaType.APPLICATION_JSON)
+@Api(value = "Vendor License Model - License Agreements")
+@Validated
+
+public interface LicenseAgreements {
+
+ @GET
+ @Path("/")
+ @ApiOperation(value = "List vendor license agreements",
+ response = LicenseAgreementEntityDto.class,
+ responseContainer = "List")
+ Response listLicenseAgreements(
+ @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
+ @Pattern(regexp = Version.VERSION_REGEX, message = Version.VERSION_STRING_VIOLATION_MSG)
+ @QueryParam("version") String version,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user);
+
+ @POST
+ @Path("/")
+ @ApiOperation(value = "Create vendor license agreement")
+ Response createLicenseAgreement(@Valid LicenseAgreementRequestDto request,
+ @ApiParam(value = "Vendor license model Id") @PathParam("vlmId")
+ String vlmId,
+ @NotNull(message = USER_MISSING_ERROR_MSG)
+ @HeaderParam(USER_HEADER_PARAM) String user);
+
+ @PUT
+ @Path("/{licenseAgreementId}")
+ @ApiOperation(value = "Update vendor license agreement")
+ Response updateLicenseAgreement(@Valid LicenseAgreementUpdateRequestDto request,
+ @ApiParam(value = "Vendor license model Id") @PathParam("vlmId")
+ String vlmId,
+ @PathParam("licenseAgreementId") String licenseAgreementId,
+ @NotNull(message = USER_MISSING_ERROR_MSG)
+ @HeaderParam(USER_HEADER_PARAM) String user);
+
+ @GET
+ @Path("/{licenseAgreementId}")
+ @ApiOperation(value = "Get vendor license agreement",
+ response = LicenseAgreementModelDto.class)
+ Response getLicenseAgreement(
+ @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
+ @Pattern(regexp = Version.VERSION_REGEX, message = Version.VERSION_STRING_VIOLATION_MSG)
+ @QueryParam("version") String version,
+ @PathParam("licenseAgreementId") String licenseAgreementId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user);
+
+ @DELETE
+ @Path("/{licenseAgreementId}")
+ @ApiOperation(value = "Delete vendor license agreement")
+ Response deleteLicenseAgreement(
+ @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
+ @PathParam("licenseAgreementId") String licenseAgreementId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user);
+
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/LicenseKeyGroups.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/LicenseKeyGroups.java
new file mode 100644
index 0000000000..d66945d63c
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/LicenseKeyGroups.java
@@ -0,0 +1,104 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.rest;
+
+import static org.openecomp.sdcrests.common.RestConstants.USER_HEADER_PARAM;
+import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdcrests.vendorlicense.types.LicenseKeyGroupEntityDto;
+import org.openecomp.sdcrests.vendorlicense.types.LicenseKeyGroupRequestDto;
+import org.springframework.validation.annotation.Validated;
+
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Pattern;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+@Path("/v1.0/vendor-license-models/{vlmId}/license-key-groups")
+@Produces(MediaType.APPLICATION_JSON)
+@Consumes(MediaType.APPLICATION_JSON)
+@Api(value = "Vendor License Model - License Key Groups")
+@Validated
+public interface LicenseKeyGroups {
+ @GET
+ @Path("/")
+ @ApiOperation(value = "List vendor license key groups",
+ response = LicenseKeyGroupEntityDto.class,
+ responseContainer = "List")
+ Response listLicenseKeyGroups(
+ @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
+ @Pattern(regexp = Version.VERSION_REGEX, message = Version.VERSION_STRING_VIOLATION_MSG)
+ @QueryParam("version") String version,
+ @HeaderParam(USER_HEADER_PARAM) String user);
+
+ @POST
+ @Path("/")
+ @ApiOperation(value = "Create vendor license key group")
+ Response createLicenseKeyGroup(@Valid LicenseKeyGroupRequestDto request,
+ @ApiParam(value = "Vendor license model Id") @PathParam("vlmId")
+ String vlmId,
+ @NotNull(message = USER_MISSING_ERROR_MSG)
+ @HeaderParam(USER_HEADER_PARAM) String user);
+
+ @PUT
+ @Path("/{licenseKeyGroupId}")
+ @ApiOperation(value = "Update vendor license key group")
+ Response updateLicenseKeyGroup(@Valid LicenseKeyGroupRequestDto request,
+ @ApiParam(value = "Vendor license model Id") @PathParam("vlmId")
+ String vlmId,
+ @PathParam("licenseKeyGroupId") String licenseKeyGroupId,
+ @NotNull(message = USER_MISSING_ERROR_MSG)
+ @HeaderParam(USER_HEADER_PARAM) String user);
+
+ @GET
+ @Path("/{licenseKeyGroupId}")
+ @ApiOperation(value = "Get vendor license key group",
+ response = LicenseKeyGroupEntityDto.class)
+ Response getLicenseKeyGroup(
+ @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
+ @Pattern(regexp = Version.VERSION_REGEX, message = Version.VERSION_STRING_VIOLATION_MSG)
+ @QueryParam("version") String version,
+ @PathParam("licenseKeyGroupId") String licenseKeyGroupId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user);
+
+ @DELETE
+ @Path("/{licenseKeyGroupId}")
+ @ApiOperation(value = "Delete vendor license key group")
+ Response deleteLicenseKeyGroup(
+ @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
+ @PathParam("licenseKeyGroupId") String licenseKeyGroupId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user);
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/VendorLicenseModels.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/VendorLicenseModels.java
new file mode 100644
index 0000000000..15fc9bf0d9
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/VendorLicenseModels.java
@@ -0,0 +1,111 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.rest;
+
+import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdcrests.common.RestConstants;
+import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelActionRequestDto;
+import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelEntityDto;
+import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelRequestDto;
+import org.springframework.validation.annotation.Validated;
+
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Pattern;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+@Path("/v1.0/vendor-license-models")
+@Produces(MediaType.APPLICATION_JSON)
+@Consumes(MediaType.APPLICATION_JSON)
+@Api(value = "Vendor License Models")
+@Validated
+public interface VendorLicenseModels {
+
+ @GET
+ @Path("/")
+ @ApiOperation(value = "List vendor license models",
+ response = VendorLicenseModelEntityDto.class,
+ responseContainer = "List")
+ Response listLicenseModels(@ApiParam(
+ value = "Currently supported value: 'Final' - only vendor License models with final versions "
+ + "will be return - with their latest final version")
+ @QueryParam("versionFilter") String versionFilter,
+ @NotNull(message = USER_MISSING_ERROR_MSG)
+ @HeaderParam(RestConstants.USER_HEADER_PARAM) String user);
+
+ @POST
+ @Path("/")
+ @ApiOperation(value = "Create vendor license model")
+ Response createLicenseModel(@Valid VendorLicenseModelRequestDto request,
+ @NotNull(message = USER_MISSING_ERROR_MSG)
+ @HeaderParam(RestConstants.USER_HEADER_PARAM) String user);
+
+ @PUT
+ @Path("/{vlmId}")
+ @ApiOperation(value = "Update vendor license model")
+ Response updateLicenseModel(@Valid VendorLicenseModelRequestDto request,
+ @ApiParam(value = "Vendor license model Id") @PathParam("vlmId")
+ String vlmId, @NotNull(message = USER_MISSING_ERROR_MSG)
+ @HeaderParam(RestConstants.USER_HEADER_PARAM) String user);
+
+ @GET
+ @Path("/{vlmId}")
+ @ApiOperation(value = "Get vendor license model",
+ response = VendorLicenseModelEntityDto.class)
+ Response getLicenseModel(
+ @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
+ @Pattern(regexp = Version.VERSION_REGEX, message = Version.VERSION_STRING_VIOLATION_MSG)
+ @QueryParam("version") String version,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(RestConstants.USER_HEADER_PARAM)
+ String user);
+
+ @DELETE
+ @Path("/{vlmId}")
+ @ApiOperation(value = "Delete vendor license model")
+ Response deleteLicenseModel(
+ @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(RestConstants.USER_HEADER_PARAM)
+ String user);
+
+ @PUT
+ @Path("/{vlmId}/actions")
+ @ApiOperation(value = "Update vendor license model")
+ Response actOnLicenseModel(@Valid VendorLicenseModelActionRequestDto request,
+ @ApiParam(value = "Vendor license model Id") @PathParam("vlmId")
+ String vlmId, @NotNull(message = USER_MISSING_ERROR_MSG)
+ @HeaderParam(RestConstants.USER_HEADER_PARAM) String user);
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapChoiceOrOtherDtoToChoiceOrOther.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapChoiceOrOtherDtoToChoiceOrOther.java
new file mode 100644
index 0000000000..28eeb29018
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapChoiceOrOtherDtoToChoiceOrOther.java
@@ -0,0 +1,36 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.rest.mapping;
+
+import org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorlicense.types.ChoiceOrOtherDto;
+
+public class MapChoiceOrOtherDtoToChoiceOrOther
+ extends MappingBase<ChoiceOrOtherDto, ChoiceOrOther> {
+
+ @Override
+ public void doMapping(ChoiceOrOtherDto source, ChoiceOrOther target) {
+ target.setChoice(source.getChoice());
+ target.setOther(source.getOther());
+ target.setResult(null);
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapChoiceOrOtherToChoiceOrOtherDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapChoiceOrOtherToChoiceOrOtherDto.java
new file mode 100644
index 0000000000..2d686110d5
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapChoiceOrOtherToChoiceOrOtherDto.java
@@ -0,0 +1,35 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.rest.mapping;
+
+import org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorlicense.types.ChoiceOrOtherDto;
+
+public class MapChoiceOrOtherToChoiceOrOtherDto
+ extends MappingBase<ChoiceOrOther, ChoiceOrOtherDto> {
+
+ @Override
+ public void doMapping(ChoiceOrOther source, ChoiceOrOtherDto target) {
+ target.setChoice(source.getChoice());
+ target.setOther(source.getOther());
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolEntityToEntitlementPoolEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolEntityToEntitlementPoolEntityDto.java
new file mode 100644
index 0000000000..c9f4ab894b
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolEntityToEntitlementPoolEntityDto.java
@@ -0,0 +1,53 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.rest.mapping;
+
+import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorlicense.types.ChoiceOrOtherDto;
+import org.openecomp.sdcrests.vendorlicense.types.EntitlementPoolEntityDto;
+import org.openecomp.sdcrests.vendorlicense.types.MultiChoiceOrOtherDto;
+
+public class MapEntitlementPoolEntityToEntitlementPoolEntityDto
+ extends MappingBase<EntitlementPoolEntity, EntitlementPoolEntityDto> {
+ @Override
+ public void doMapping(EntitlementPoolEntity source, EntitlementPoolEntityDto target) {
+ target.setId(source.getId());
+ target.setName(source.getName());
+ target.setDescription(source.getDescription());
+ target.setThresholdValue(source.getThresholdValue());
+ target.setThresholdUnits(source.getThresholdUnit());
+ target.setIncrements(source.getIncrements());
+
+ MapChoiceOrOtherToChoiceOrOtherDto choiceOrOtherMapper =
+ new MapChoiceOrOtherToChoiceOrOtherDto();
+ target.setEntitlementMetric(
+ choiceOrOtherMapper.applyMapping(source.getEntitlementMetric(), ChoiceOrOtherDto.class));
+ target.setAggregationFunction(
+ choiceOrOtherMapper.applyMapping(source.getAggregationFunction(), ChoiceOrOtherDto.class));
+ target.setOperationalScope(new MapMultiChoiceOrOtherToMultiChoiceOrOtherDto()
+ .applyMapping(source.getOperationalScope(), MultiChoiceOrOtherDto.class));
+ target.setTime(choiceOrOtherMapper.applyMapping(source.getTime(), ChoiceOrOtherDto.class));
+ target.setManufacturerReferenceNumber(source.getManufacturerReferenceNumber());
+
+ target.setReferencingFeatureGroups(source.getReferencingFeatureGroups());
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolRequestDtoToEntitlementPoolEntity.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolRequestDtoToEntitlementPoolEntity.java
new file mode 100644
index 0000000000..fe626e374c
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolRequestDtoToEntitlementPoolEntity.java
@@ -0,0 +1,51 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.rest.mapping;
+
+import org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther;
+import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorlicense.types.EntitlementPoolRequestDto;
+
+public class MapEntitlementPoolRequestDtoToEntitlementPoolEntity
+ extends MappingBase<EntitlementPoolRequestDto, EntitlementPoolEntity> {
+ @Override
+ public void doMapping(EntitlementPoolRequestDto source, EntitlementPoolEntity target) {
+ target.setName(source.getName());
+ target.setDescription(source.getDescription());
+ target.setThresholdValue(source.getThresholdValue());
+ target.setThresholdUnit(source.getThresholdUnits());
+ target.setIncrements(source.getIncrements());
+
+ MapChoiceOrOtherDtoToChoiceOrOther choiceOrOtherMapper =
+ new MapChoiceOrOtherDtoToChoiceOrOther();
+ target.setEntitlementMetric(
+ choiceOrOtherMapper.applyMapping(source.getEntitlementMetric(), ChoiceOrOther.class));
+ target.setAggregationFunction(
+ choiceOrOtherMapper.applyMapping(source.getAggregationFunction(), ChoiceOrOther.class));
+ target.setOperationalScope(new MapMultiChoiceOrOtherDtoToMultiChoiceOrOther()
+ .applyMapping(source.getOperationalScope(), MultiChoiceOrOther.class));
+ target.setTime(choiceOrOtherMapper.applyMapping(source.getTime(), ChoiceOrOther.class));
+
+ target.setManufacturerReferenceNumber(source.getManufacturerReferenceNumber());
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapFeatureGroupDescriptorDtoToFeatureGroupEntity.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapFeatureGroupDescriptorDtoToFeatureGroupEntity.java
new file mode 100644
index 0000000000..91239e2655
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapFeatureGroupDescriptorDtoToFeatureGroupEntity.java
@@ -0,0 +1,36 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.rest.mapping;
+
+import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupDescriptorDto;
+
+
+public class MapFeatureGroupDescriptorDtoToFeatureGroupEntity
+ extends MappingBase<FeatureGroupDescriptorDto, FeatureGroupEntity> {
+ @Override
+ public void doMapping(FeatureGroupDescriptorDto source, FeatureGroupEntity target) {
+ target.setName(source.getName());
+ target.setDescription(source.getDescription());
+ target.setPartNumber(source.getPartNumber());
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapFeatureGroupEntityToFeatureGroupDescriptorDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapFeatureGroupEntityToFeatureGroupDescriptorDto.java
new file mode 100644
index 0000000000..70f5666bcb
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapFeatureGroupEntityToFeatureGroupDescriptorDto.java
@@ -0,0 +1,35 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.rest.mapping;
+
+import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupDescriptorDto;
+
+public class MapFeatureGroupEntityToFeatureGroupDescriptorDto
+ extends MappingBase<FeatureGroupEntity, FeatureGroupDescriptorDto> {
+ @Override
+ public void doMapping(FeatureGroupEntity source, FeatureGroupDescriptorDto target) {
+ target.setName(source.getName());
+ target.setDescription(source.getDescription());
+ target.setPartNumber(source.getPartNumber());
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseAgreementDescriptorDtoToLicenseAgreementEntity.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseAgreementDescriptorDtoToLicenseAgreementEntity.java
new file mode 100644
index 0000000000..f5ea8414d5
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseAgreementDescriptorDtoToLicenseAgreementEntity.java
@@ -0,0 +1,38 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.rest.mapping;
+
+import org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther;
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorlicense.types.LicenseAgreementDescriptorDto;
+
+public class MapLicenseAgreementDescriptorDtoToLicenseAgreementEntity
+ extends MappingBase<LicenseAgreementDescriptorDto, LicenseAgreementEntity> {
+ @Override
+ public void doMapping(LicenseAgreementDescriptorDto source, LicenseAgreementEntity target) {
+ target.setName(source.getName());
+ target.setDescription(source.getDescription());
+ target.setLicenseTerm(new MapChoiceOrOtherDtoToChoiceOrOther()
+ .applyMapping(source.getLicenseTerm(), ChoiceOrOther.class));
+ target.setRequirementsAndConstrains(source.getRequirementsAndConstrains());
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseAgreementEntityToLicenseAgreementDescriptorDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseAgreementEntityToLicenseAgreementDescriptorDto.java
new file mode 100644
index 0000000000..2fd4f669cf
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseAgreementEntityToLicenseAgreementDescriptorDto.java
@@ -0,0 +1,38 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.rest.mapping;
+
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorlicense.types.ChoiceOrOtherDto;
+import org.openecomp.sdcrests.vendorlicense.types.LicenseAgreementDescriptorDto;
+
+public class MapLicenseAgreementEntityToLicenseAgreementDescriptorDto
+ extends MappingBase<LicenseAgreementEntity, LicenseAgreementDescriptorDto> {
+ @Override
+ public void doMapping(LicenseAgreementEntity source, LicenseAgreementDescriptorDto target) {
+ target.setName(source.getName());
+ target.setDescription(source.getDescription());
+ target.setLicenseTerm(new MapChoiceOrOtherToChoiceOrOtherDto()
+ .applyMapping(source.getLicenseTerm(), ChoiceOrOtherDto.class));
+ target.setRequirementsAndConstrains(source.getRequirementsAndConstrains());
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto.java
new file mode 100644
index 0000000000..38384711b1
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto.java
@@ -0,0 +1,40 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.rest.mapping;
+
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorlicense.types.LicenseKeyGroupEntityDto;
+import org.openecomp.sdcrests.vendorlicense.types.MultiChoiceOrOtherDto;
+
+public class MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto
+ extends MappingBase<LicenseKeyGroupEntity, LicenseKeyGroupEntityDto> {
+ @Override
+ public void doMapping(LicenseKeyGroupEntity source, LicenseKeyGroupEntityDto target) {
+ target.setId(source.getId());
+ target.setName(source.getName());
+ target.setDescription(source.getDescription());
+ target.setType(source.getType());
+ target.setOperationalScope(new MapMultiChoiceOrOtherToMultiChoiceOrOtherDto()
+ .applyMapping(source.getOperationalScope(), MultiChoiceOrOtherDto.class));
+ target.setReferencingFeatureGroups(source.getReferencingFeatureGroups());
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseKeyGroupRequestDtoToLicenseKeyGroupEntity.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseKeyGroupRequestDtoToLicenseKeyGroupEntity.java
new file mode 100644
index 0000000000..aee27c8521
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseKeyGroupRequestDtoToLicenseKeyGroupEntity.java
@@ -0,0 +1,38 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.rest.mapping;
+
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorlicense.types.LicenseKeyGroupRequestDto;
+
+public class MapLicenseKeyGroupRequestDtoToLicenseKeyGroupEntity
+ extends MappingBase<LicenseKeyGroupRequestDto, LicenseKeyGroupEntity> {
+ @Override
+ public void doMapping(LicenseKeyGroupRequestDto source, LicenseKeyGroupEntity target) {
+ target.setName(source.getName());
+ target.setDescription(source.getDescription());
+ target.setType(source.getType());
+ target.setOperationalScope(new MapMultiChoiceOrOtherDtoToMultiChoiceOrOther()
+ .applyMapping(source.getOperationalScope(), MultiChoiceOrOther.class));
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapMultiChoiceOrOtherDtoToMultiChoiceOrOther.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapMultiChoiceOrOtherDtoToMultiChoiceOrOther.java
new file mode 100644
index 0000000000..320bf67bdf
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapMultiChoiceOrOtherDtoToMultiChoiceOrOther.java
@@ -0,0 +1,36 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.rest.mapping;
+
+import org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorlicense.types.MultiChoiceOrOtherDto;
+
+public class MapMultiChoiceOrOtherDtoToMultiChoiceOrOther
+ extends MappingBase<MultiChoiceOrOtherDto, MultiChoiceOrOther> {
+
+ @Override
+ public void doMapping(MultiChoiceOrOtherDto source, MultiChoiceOrOther target) {
+ target.setChoices(source.getChoices());
+ target.setOther(source.getOther());
+ target.setResults(null);
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapMultiChoiceOrOtherToMultiChoiceOrOtherDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapMultiChoiceOrOtherToMultiChoiceOrOtherDto.java
new file mode 100644
index 0000000000..9649053fb4
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapMultiChoiceOrOtherToMultiChoiceOrOtherDto.java
@@ -0,0 +1,35 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.rest.mapping;
+
+import org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorlicense.types.MultiChoiceOrOtherDto;
+
+public class MapMultiChoiceOrOtherToMultiChoiceOrOtherDto
+ extends MappingBase<MultiChoiceOrOther, MultiChoiceOrOtherDto> {
+
+ @Override
+ public void doMapping(MultiChoiceOrOther source, MultiChoiceOrOtherDto target) {
+ target.setChoices(source.getChoices());
+ target.setOther(source.getOther());
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapVendorLicenseModelRequestDtoToVendorLicenseModelEntity.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapVendorLicenseModelRequestDtoToVendorLicenseModelEntity.java
new file mode 100644
index 0000000000..1117a2db9f
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapVendorLicenseModelRequestDtoToVendorLicenseModelEntity.java
@@ -0,0 +1,36 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.rest.mapping;
+
+import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelRequestDto;
+
+
+public class MapVendorLicenseModelRequestDtoToVendorLicenseModelEntity
+ extends MappingBase<VendorLicenseModelRequestDto, VendorLicenseModelEntity> {
+ @Override
+ public void doMapping(VendorLicenseModelRequestDto source, VendorLicenseModelEntity target) {
+ target.setVendorName(source.getVendorName());
+ target.setDescription(source.getDescription());
+ target.setIconRef(source.getIconRef());
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapVersionedVendorLicenseModelToVendorLicenseModelEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapVersionedVendorLicenseModelToVendorLicenseModelEntityDto.java
new file mode 100644
index 0000000000..a53d5c9e36
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapVersionedVendorLicenseModelToVendorLicenseModelEntityDto.java
@@ -0,0 +1,60 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.rest.mapping;
+
+import org.openecomp.core.utilities.CommonMethods;
+import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity;
+import org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.types.VersionInfo;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelEntityDto;
+
+import java.util.stream.Collectors;
+
+public class MapVersionedVendorLicenseModelToVendorLicenseModelEntityDto
+ extends MappingBase<VersionedVendorLicenseModel, VendorLicenseModelEntityDto> {
+ @Override
+ public void doMapping(VersionedVendorLicenseModel source, VendorLicenseModelEntityDto target) {
+ VendorLicenseModelEntity sourceVlm = source.getVendorLicenseModel();
+ target.setId(sourceVlm.getId());
+ target.setVendorName(sourceVlm.getVendorName());
+ target.setDescription(sourceVlm.getDescription());
+ target.setIconRef(sourceVlm.getIconRef());
+
+ VersionInfo versionInfo = source.getVersionInfo();
+ if (versionInfo != null) {
+ target.setVersion(versionInfo.getActiveVersion().toString());
+ target.setStatus(versionInfo.getStatus());
+ target.setLockingUser(versionInfo.getLockingUser());
+
+ if (!CommonMethods.isEmpty(versionInfo.getViewableVersions())) {
+ target.setViewableVersions(versionInfo.getViewableVersions().stream().map(Version::toString)
+ .collect(Collectors.toList()));
+ }
+
+ if (!CommonMethods.isEmpty(versionInfo.getFinalVersions())) {
+ target.setFinalVersions(versionInfo.getFinalVersions().stream().map(Version::toString)
+ .collect(Collectors.toList()));
+ }
+ }
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/EntitlementPoolsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/EntitlementPoolsImpl.java
new file mode 100644
index 0000000000..ab9800e612
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/EntitlementPoolsImpl.java
@@ -0,0 +1,157 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.rest.services;
+
+import org.openecomp.sdc.vendorlicense.VendorLicenseManager;
+import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import org.openecomp.sdcrests.vendorlicense.rest.EntitlementPools;
+import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapEntitlementPoolEntityToEntitlementPoolEntityDto;
+import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapEntitlementPoolRequestDtoToEntitlementPoolEntity;
+import org.openecomp.sdcrests.vendorlicense.types.EntitlementPoolEntityDto;
+import org.openecomp.sdcrests.vendorlicense.types.EntitlementPoolRequestDto;
+import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper;
+import org.openecomp.sdcrests.wrappers.StringWrapperResponse;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Service;
+
+import java.util.Collection;
+import javax.inject.Named;
+import javax.ws.rs.core.Response;
+
+@Named
+@Service("entitlementPools")
+@Scope(value = "prototype")
+public class EntitlementPoolsImpl implements EntitlementPools {
+
+ @Autowired
+ private VendorLicenseManager vendorLicenseManager;
+
+ /**
+ * List entitlement pools response.
+ *
+ * @param vlmId the vlm id
+ * @param version the version
+ * @param user the user
+ * @return the response
+ */
+ public Response listEntitlementPools(String vlmId, String version, String user) {
+ Collection<EntitlementPoolEntity> entitlementPools =
+ vendorLicenseManager.listEntitlementPools(vlmId, Version.valueOf(version), user);
+
+ GenericCollectionWrapper<EntitlementPoolEntityDto> result = new GenericCollectionWrapper<>();
+ MapEntitlementPoolEntityToEntitlementPoolEntityDto outputMapper =
+ new MapEntitlementPoolEntityToEntitlementPoolEntityDto();
+ for (EntitlementPoolEntity ep : entitlementPools) {
+ result.add(outputMapper.applyMapping(ep, EntitlementPoolEntityDto.class));
+ }
+
+ return Response.ok(result).build();
+ }
+
+ /**
+ * Create entitlement pool response.
+ *
+ * @param request the request
+ * @param vlmId the vlm id
+ * @param user the user
+ * @return the response
+ */
+ public Response createEntitlementPool(EntitlementPoolRequestDto request, String vlmId,
+ String user) {
+ EntitlementPoolEntity entitlementPoolEntity =
+ new MapEntitlementPoolRequestDtoToEntitlementPoolEntity()
+ .applyMapping(request, EntitlementPoolEntity.class);
+ entitlementPoolEntity.setVendorLicenseModelId(vlmId);
+
+ EntitlementPoolEntity createdEntitlementPool =
+ vendorLicenseManager.createEntitlementPool(entitlementPoolEntity, user);
+ StringWrapperResponse result =
+ createdEntitlementPool != null ? new StringWrapperResponse(createdEntitlementPool.getId())
+ : null;
+
+ return Response.ok(result).build();
+ }
+
+ /**
+ * Update entitlement pool response.
+ *
+ * @param request the request
+ * @param vlmId the vlm id
+ * @param entitlementPoolId the entitlement pool id
+ * @param user the user
+ * @return the response
+ */
+ public Response updateEntitlementPool(EntitlementPoolRequestDto request, String vlmId,
+ String entitlementPoolId, String user) {
+ EntitlementPoolEntity entitlementPoolEntity =
+ new MapEntitlementPoolRequestDtoToEntitlementPoolEntity()
+ .applyMapping(request, EntitlementPoolEntity.class);
+
+ entitlementPoolEntity.setVendorLicenseModelId(vlmId);
+ entitlementPoolEntity.setId(entitlementPoolId);
+
+ vendorLicenseManager.updateEntitlementPool(entitlementPoolEntity, user);
+ return Response.ok().build();
+ }
+
+ /**
+ * Gets entitlement pool.
+ *
+ * @param vlmId the vlm id
+ * @param version the version
+ * @param entitlementPoolId the entitlement pool id
+ * @param user the user
+ * @return the entitlement pool
+ */
+ public Response getEntitlementPool(String vlmId, String version, String entitlementPoolId,
+ String user) {
+ EntitlementPoolEntity epInput = new EntitlementPoolEntity();
+ epInput.setVendorLicenseModelId(vlmId);
+ epInput.setVersion(Version.valueOf(version));
+ epInput.setId(entitlementPoolId);
+ EntitlementPoolEntity entitlementPool = vendorLicenseManager.getEntitlementPool(epInput, user);
+
+ EntitlementPoolEntityDto entitlementPoolEntityDto = entitlementPool == null ? null :
+ new MapEntitlementPoolEntityToEntitlementPoolEntityDto()
+ .applyMapping(entitlementPool, EntitlementPoolEntityDto.class);
+ return Response.ok(entitlementPoolEntityDto).build();
+ }
+
+ /**
+ * Delete entitlement pool response.
+ *
+ * @param vlmId the vlm id
+ * @param entitlementPoolId the entitlement pool id
+ * @param user the user
+ * @return the response
+ */
+ public Response deleteEntitlementPool(String vlmId, String entitlementPoolId, String user) {
+ EntitlementPoolEntity epInput = new EntitlementPoolEntity();
+ epInput.setVendorLicenseModelId(vlmId);
+ epInput.setId(entitlementPoolId);
+ vendorLicenseManager.deleteEntitlementPool(epInput, user);
+ return Response.ok().build();
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/FeatureGroupsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/FeatureGroupsImpl.java
new file mode 100644
index 0000000000..daf35f9ee6
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/FeatureGroupsImpl.java
@@ -0,0 +1,169 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.rest.services;
+
+import org.openecomp.core.utilities.CommonMethods;
+import org.openecomp.sdc.vendorlicense.VendorLicenseManager;
+import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupModel;
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdcrests.vendorlicense.rest.FeatureGroups;
+import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapEntitlementPoolEntityToEntitlementPoolEntityDto;
+import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapFeatureGroupDescriptorDtoToFeatureGroupEntity;
+import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapFeatureGroupEntityToFeatureGroupDescriptorDto;
+import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto;
+import org.openecomp.sdcrests.vendorlicense.types.EntitlementPoolEntityDto;
+import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupEntityDto;
+import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupModelDto;
+import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupRequestDto;
+import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupUpdateRequestDto;
+import org.openecomp.sdcrests.vendorlicense.types.LicenseKeyGroupEntityDto;
+import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper;
+import org.openecomp.sdcrests.wrappers.StringWrapperResponse;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Service;
+
+import java.util.Collection;
+import java.util.HashSet;
+import javax.inject.Named;
+import javax.ws.rs.core.Response;
+
+
+@Named
+@Service("featureGroups")
+@Scope(value = "prototype")
+public class FeatureGroupsImpl implements FeatureGroups {
+
+ @Autowired
+ private VendorLicenseManager vendorLicenseManager;
+
+ @Override
+ public Response listFeatureGroups(String vlmId, String version, String user) {
+ Collection<FeatureGroupEntity> featureGroupEntities =
+ vendorLicenseManager.listFeatureGroups(vlmId, Version.valueOf(version), user);
+
+ MapFeatureGroupEntityToFeatureGroupDescriptorDto outputMapper =
+ new MapFeatureGroupEntityToFeatureGroupDescriptorDto();
+ GenericCollectionWrapper<FeatureGroupEntityDto> results = new GenericCollectionWrapper<>();
+
+ for (FeatureGroupEntity fg : featureGroupEntities) {
+ FeatureGroupEntityDto fgDto = new FeatureGroupEntityDto();
+ fgDto.setId(fg.getId());
+ fgDto.setLicenseKeyGroupsIds(fg.getLicenseKeyGroupIds());
+ fgDto.setEntitlementPoolsIds(fg.getEntitlementPoolIds());
+ fgDto.setReferencingLicenseAgreements(fg.getReferencingLicenseAgreements());
+ outputMapper.doMapping(fg, fgDto);
+ results.add(fgDto);
+ }
+
+ return Response.ok(results).build();
+ }
+
+ @Override
+ public Response createFeatureGroup(FeatureGroupRequestDto request, String vlmId, String user) {
+ FeatureGroupEntity featureGroupEntity = new MapFeatureGroupDescriptorDtoToFeatureGroupEntity()
+ .applyMapping(request, FeatureGroupEntity.class);
+ featureGroupEntity.setVendorLicenseModelId(vlmId);
+ featureGroupEntity.setLicenseKeyGroupIds(request.getAddedLicenseKeyGroupsIds());
+ featureGroupEntity.setEntitlementPoolIds(request.getAddedEntitlementPoolsIds());
+
+ FeatureGroupEntity createdFeatureGroup =
+ vendorLicenseManager.createFeatureGroup(featureGroupEntity, user);
+
+ StringWrapperResponse result =
+ createdFeatureGroup != null ? new StringWrapperResponse(createdFeatureGroup.getId()) : null;
+ return Response.ok(result).build();
+ }
+
+ @Override
+ public Response updateFeatureGroup(FeatureGroupUpdateRequestDto request, String vlmId,
+ String featureGroupId, String user) {
+ FeatureGroupEntity featureGroupEntity = new MapFeatureGroupDescriptorDtoToFeatureGroupEntity()
+ .applyMapping(request, FeatureGroupEntity.class);
+ featureGroupEntity.setVendorLicenseModelId(vlmId);
+ featureGroupEntity.setId(featureGroupId);
+
+ vendorLicenseManager
+ .updateFeatureGroup(featureGroupEntity, request.getAddedLicenseKeyGroupsIds(),
+ request.getRemovedLicenseKeyGroupsIds(), request.getAddedEntitlementPoolsIds(),
+ request.getRemovedEntitlementPoolsIds(), user);
+ return Response.ok().build();
+ }
+
+ @Override
+ public Response getFeatureGroup(String vlmId, String version, String featureGroupId,
+ String user) {
+ FeatureGroupEntity fgInput = new FeatureGroupEntity();
+ fgInput.setVendorLicenseModelId(vlmId);
+ fgInput.setVersion(Version.valueOf(version));
+ fgInput.setId(featureGroupId);
+ FeatureGroupModel featureGroupModel = vendorLicenseManager.getFeatureGroupModel(fgInput, user);
+
+ if (featureGroupModel == null) {
+ return Response.ok().build();
+ }
+
+ FeatureGroupModelDto fgmDto = new FeatureGroupModelDto();
+ fgmDto.setId(featureGroupModel.getFeatureGroup().getId());
+ fgmDto.setReferencingLicenseAgreements(
+ featureGroupModel.getFeatureGroup().getReferencingLicenseAgreements());
+ new MapFeatureGroupEntityToFeatureGroupDescriptorDto()
+ .doMapping(featureGroupModel.getFeatureGroup(), fgmDto);
+
+ if (!CommonMethods.isEmpty(featureGroupModel.getLicenseKeyGroups())) {
+ fgmDto.setLicenseKeyGroups(new HashSet<>());
+
+ MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto lkgMapper =
+ new MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto();
+ for (LicenseKeyGroupEntity lkg : featureGroupModel.getLicenseKeyGroups()) {
+ fgmDto.getLicenseKeyGroups()
+ .add(lkgMapper.applyMapping(lkg, LicenseKeyGroupEntityDto.class));
+ }
+ }
+
+ if (!CommonMethods.isEmpty(featureGroupModel.getEntitlementPools())) {
+ fgmDto.setEntitlementPools(new HashSet<>());
+
+ MapEntitlementPoolEntityToEntitlementPoolEntityDto epMapper =
+ new MapEntitlementPoolEntityToEntitlementPoolEntityDto();
+ for (EntitlementPoolEntity ep : featureGroupModel.getEntitlementPools()) {
+ fgmDto.getEntitlementPools().add(epMapper.applyMapping(ep, EntitlementPoolEntityDto.class));
+
+ }
+ }
+
+ return Response.ok(fgmDto).build();
+ }
+
+ @Override
+ public Response deleteFeatureGroup(String vlmId, String featureGroupId, String user) {
+ FeatureGroupEntity fgInput = new FeatureGroupEntity();
+ fgInput.setVendorLicenseModelId(vlmId);
+ fgInput.setId(featureGroupId);
+ vendorLicenseManager.deleteFeatureGroup(fgInput, user);
+ return Response.ok().build();
+ }
+
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/LicenseAgreementsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/LicenseAgreementsImpl.java
new file mode 100644
index 0000000000..d87be05998
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/LicenseAgreementsImpl.java
@@ -0,0 +1,186 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.rest.services;
+
+import org.openecomp.core.utilities.CommonMethods;
+import org.openecomp.sdc.vendorlicense.VendorLicenseManager;
+import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementModel;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdcrests.vendorlicense.rest.LicenseAgreements;
+import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapFeatureGroupEntityToFeatureGroupDescriptorDto;
+import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapLicenseAgreementDescriptorDtoToLicenseAgreementEntity;
+import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapLicenseAgreementEntityToLicenseAgreementDescriptorDto;
+import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupEntityDto;
+import org.openecomp.sdcrests.vendorlicense.types.LicenseAgreementEntityDto;
+import org.openecomp.sdcrests.vendorlicense.types.LicenseAgreementModelDto;
+import org.openecomp.sdcrests.vendorlicense.types.LicenseAgreementRequestDto;
+import org.openecomp.sdcrests.vendorlicense.types.LicenseAgreementUpdateRequestDto;
+import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper;
+import org.openecomp.sdcrests.wrappers.StringWrapperResponse;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Service;
+
+import java.util.Collection;
+import java.util.HashSet;
+import javax.inject.Named;
+import javax.ws.rs.core.Response;
+
+@Named
+@Service("licenseAgreements")
+@Scope(value = "prototype")
+public class LicenseAgreementsImpl implements LicenseAgreements {
+
+ @Autowired
+ private VendorLicenseManager vendorLicenseManager;
+
+ /**
+ * List license agreements response.
+ *
+ * @param vlmId the vlm id
+ * @param version the version
+ * @param user the user
+ * @return the response
+ */
+ public Response listLicenseAgreements(String vlmId, String version, String user) {
+ Collection<LicenseAgreementEntity> licenseAgreements =
+ vendorLicenseManager.listLicenseAgreements(vlmId, Version.valueOf(version), user);
+
+ GenericCollectionWrapper<LicenseAgreementEntityDto> results = new GenericCollectionWrapper<>();
+ MapLicenseAgreementEntityToLicenseAgreementDescriptorDto outputMapper =
+ new MapLicenseAgreementEntityToLicenseAgreementDescriptorDto();
+ for (LicenseAgreementEntity lae : licenseAgreements) {
+ LicenseAgreementEntityDto laeDto = new LicenseAgreementEntityDto();
+ laeDto.setId(lae.getId());
+ laeDto.setFeatureGroupsIds(lae.getFeatureGroupIds());
+ outputMapper.doMapping(lae, laeDto);
+ results.add(laeDto);
+ }
+
+ return Response.ok(results).build();
+ }
+
+ /**
+ * Create license agreement response.
+ *
+ * @param request the request
+ * @param vlmId the vlm id
+ * @param user the user
+ * @return the response
+ */
+ public Response createLicenseAgreement(LicenseAgreementRequestDto request, String vlmId,
+ String user) {
+ LicenseAgreementEntity licenseAgreementEntity =
+ new MapLicenseAgreementDescriptorDtoToLicenseAgreementEntity()
+ .applyMapping(request, LicenseAgreementEntity.class);
+ licenseAgreementEntity.setVendorLicenseModelId(vlmId);
+ licenseAgreementEntity.setFeatureGroupIds(request.getAddedFeatureGroupsIds());
+
+ LicenseAgreementEntity createdLicenseAgreement =
+ vendorLicenseManager.createLicenseAgreement(licenseAgreementEntity, user);
+ StringWrapperResponse result =
+ createdLicenseAgreement != null ? new StringWrapperResponse(createdLicenseAgreement.getId())
+ : null;
+
+ return Response.ok(result).build();
+ }
+
+ /**
+ * Update license agreement response.
+ *
+ * @param request the request
+ * @param vlmId the vlm id
+ * @param licenseAgreementId the license agreement id
+ * @param user the user
+ * @return the response
+ */
+ public Response updateLicenseAgreement(LicenseAgreementUpdateRequestDto request, String vlmId,
+ String licenseAgreementId, String user) {
+ LicenseAgreementEntity licenseAgreementEntity =
+ new MapLicenseAgreementDescriptorDtoToLicenseAgreementEntity()
+ .applyMapping(request, LicenseAgreementEntity.class);
+ licenseAgreementEntity.setVendorLicenseModelId(vlmId);
+ licenseAgreementEntity.setId(licenseAgreementId);
+
+ vendorLicenseManager
+ .updateLicenseAgreement(licenseAgreementEntity, request.getAddedFeatureGroupsIds(),
+ request.getRemovedFeatureGroupsIds(), user);
+ return Response.ok().build();
+ }
+
+ /**
+ * Gets license agreement.
+ *
+ * @param vlmId the vlm id
+ * @param version the version
+ * @param licenseAgreementId the license agreement id
+ * @param user the user
+ * @return the license agreement
+ */
+ public Response getLicenseAgreement(String vlmId, String version, String licenseAgreementId,
+ String user) {
+ LicenseAgreementModel licenseAgreementModel = vendorLicenseManager
+ .getLicenseAgreementModel(vlmId, Version.valueOf(version), licenseAgreementId, user);
+
+ if (licenseAgreementModel == null) {
+ return Response.ok().build();
+ }
+
+ LicenseAgreementModelDto lamDto = new LicenseAgreementModelDto();
+ lamDto.setId(licenseAgreementModel.getLicenseAgreement().getId());
+ new MapLicenseAgreementEntityToLicenseAgreementDescriptorDto()
+ .doMapping(licenseAgreementModel.getLicenseAgreement(), lamDto);
+
+ if (!CommonMethods.isEmpty(licenseAgreementModel.getFeatureGroups())) {
+ lamDto.setFeatureGroups(new HashSet<>());
+
+ MapFeatureGroupEntityToFeatureGroupDescriptorDto fgMapper =
+ new MapFeatureGroupEntityToFeatureGroupDescriptorDto();
+ for (FeatureGroupEntity fg : licenseAgreementModel.getFeatureGroups()) {
+ FeatureGroupEntityDto fgeDto = new FeatureGroupEntityDto();
+ fgeDto.setId(fg.getId());
+ fgeDto.setEntitlementPoolsIds(fg.getEntitlementPoolIds());
+ fgeDto.setLicenseKeyGroupsIds(fg.getLicenseKeyGroupIds());
+ fgMapper.doMapping(fg, fgeDto);
+
+ lamDto.getFeatureGroups().add(fgeDto);
+ }
+ }
+
+ return Response.ok(lamDto).build();
+ }
+
+ /**
+ * Delete license agreement response.
+ *
+ * @param vlmId the vlm id
+ * @param licenseAgreementId the license agreement id
+ * @param user the user
+ * @return the response
+ */
+ public Response deleteLicenseAgreement(String vlmId, String licenseAgreementId, String user) {
+ vendorLicenseManager.deleteLicenseAgreement(vlmId, licenseAgreementId, user);
+ return Response.ok().build();
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/LicenseKeyGroupsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/LicenseKeyGroupsImpl.java
new file mode 100644
index 0000000000..6ef7e194b8
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/LicenseKeyGroupsImpl.java
@@ -0,0 +1,159 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.rest.services;
+
+import org.openecomp.sdc.vendorlicense.VendorLicenseManager;
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import org.openecomp.sdcrests.vendorlicense.rest.LicenseKeyGroups;
+import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto;
+import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapLicenseKeyGroupRequestDtoToLicenseKeyGroupEntity;
+import org.openecomp.sdcrests.vendorlicense.types.LicenseKeyGroupEntityDto;
+import org.openecomp.sdcrests.vendorlicense.types.LicenseKeyGroupRequestDto;
+import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper;
+import org.openecomp.sdcrests.wrappers.StringWrapperResponse;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Service;
+import org.springframework.validation.annotation.Validated;
+
+import java.util.Collection;
+import javax.inject.Named;
+import javax.ws.rs.core.Response;
+
+@Named
+@Service("licenseKeyGroups")
+@Scope(value = "prototype")
+@Validated
+public class LicenseKeyGroupsImpl implements LicenseKeyGroups {
+
+ @Autowired
+ private VendorLicenseManager vendorLicenseManager;
+
+ /**
+ * List license key groups response.
+ *
+ * @param vlmId the vlm id
+ * @param version the version
+ * @param user the user
+ * @return the response
+ */
+ public Response listLicenseKeyGroups(String vlmId, String version, String user) {
+ Collection<LicenseKeyGroupEntity> licenseKeyGroups =
+ vendorLicenseManager.listLicenseKeyGroups(vlmId, Version.valueOf(version), user);
+
+ GenericCollectionWrapper<LicenseKeyGroupEntityDto> result = new GenericCollectionWrapper<>();
+ MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto outputMapper =
+ new MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto();
+ for (LicenseKeyGroupEntity ep : licenseKeyGroups) {
+ result.add(outputMapper.applyMapping(ep, LicenseKeyGroupEntityDto.class));
+ }
+
+ return Response.ok(result).build();
+ }
+
+ /**
+ * Create license key group response.
+ *
+ * @param request the request
+ * @param vlmId the vlm id
+ * @param user the user
+ * @return the response
+ */
+ public Response createLicenseKeyGroup(LicenseKeyGroupRequestDto request, String vlmId,
+ String user) {
+ LicenseKeyGroupEntity licenseKeyGroupEntity =
+ new MapLicenseKeyGroupRequestDtoToLicenseKeyGroupEntity()
+ .applyMapping(request, LicenseKeyGroupEntity.class);
+ licenseKeyGroupEntity.setVendorLicenseModelId(vlmId);
+
+ LicenseKeyGroupEntity createdLicenseKeyGroup =
+ vendorLicenseManager.createLicenseKeyGroup(licenseKeyGroupEntity, user);
+ StringWrapperResponse result =
+ createdLicenseKeyGroup != null ? new StringWrapperResponse(createdLicenseKeyGroup.getId())
+ : null;
+
+ return Response.ok(result).build();
+ }
+
+ /**
+ * Update license key group response.
+ *
+ * @param request the request
+ * @param vlmId the vlm id
+ * @param licenseKeyGroupId the license key group id
+ * @param user the user
+ * @return the response
+ */
+ public Response updateLicenseKeyGroup(LicenseKeyGroupRequestDto request, String vlmId,
+ String licenseKeyGroupId, String user) {
+ LicenseKeyGroupEntity licenseKeyGroupEntity =
+ new MapLicenseKeyGroupRequestDtoToLicenseKeyGroupEntity()
+ .applyMapping(request, LicenseKeyGroupEntity.class);
+
+ licenseKeyGroupEntity.setVendorLicenseModelId(vlmId);
+ licenseKeyGroupEntity.setId(licenseKeyGroupId);
+
+ vendorLicenseManager.updateLicenseKeyGroup(licenseKeyGroupEntity, user);
+ return Response.ok().build();
+ }
+
+ /**
+ * Gets license key group.
+ *
+ * @param vlmId the vlm id
+ * @param version the version
+ * @param licenseKeyGroupId the license key group id
+ * @param user the user
+ * @return the license key group
+ */
+ public Response getLicenseKeyGroup(String vlmId, String version, String licenseKeyGroupId,
+ String user) {
+ LicenseKeyGroupEntity lkgInput = new LicenseKeyGroupEntity();
+ lkgInput.setVendorLicenseModelId(vlmId);
+ lkgInput.setVersion(Version.valueOf(version));
+ lkgInput.setId(licenseKeyGroupId);
+ LicenseKeyGroupEntity licenseKeyGroup = vendorLicenseManager.getLicenseKeyGroup(lkgInput, user);
+
+ LicenseKeyGroupEntityDto licenseKeyGroupEntityDto = licenseKeyGroup == null ? null :
+ new MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto()
+ .applyMapping(licenseKeyGroup, LicenseKeyGroupEntityDto.class);
+ return Response.ok(licenseKeyGroupEntityDto).build();
+ }
+
+ /**
+ * Delete license key group response.
+ *
+ * @param vlmId the vlm id
+ * @param licenseKeyGroupId the license key group id
+ * @param user the user
+ * @return the response
+ */
+ public Response deleteLicenseKeyGroup(String vlmId, String licenseKeyGroupId, String user) {
+ LicenseKeyGroupEntity lkgInput = new LicenseKeyGroupEntity();
+ lkgInput.setVendorLicenseModelId(vlmId);
+ lkgInput.setId(licenseKeyGroupId);
+ vendorLicenseManager.deleteLicenseKeyGroup(lkgInput, user);
+ return Response.ok().build();
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/VendorLicenseModelsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/VendorLicenseModelsImpl.java
new file mode 100644
index 0000000000..c63da86e7a
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/VendorLicenseModelsImpl.java
@@ -0,0 +1,135 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.rest.services;
+
+import org.openecomp.sdc.vendorlicense.VendorLicenseManager;
+import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity;
+import org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdcrests.vendorlicense.rest.VendorLicenseModels;
+import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapVendorLicenseModelRequestDtoToVendorLicenseModelEntity;
+import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapVersionedVendorLicenseModelToVendorLicenseModelEntityDto;
+import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelActionRequestDto;
+import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelEntityDto;
+import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelRequestDto;
+import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper;
+import org.openecomp.sdcrests.wrappers.StringWrapperResponse;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Service;
+import org.springframework.validation.annotation.Validated;
+
+import java.util.Collection;
+import javax.inject.Named;
+import javax.ws.rs.core.Response;
+
+
+
+@Named
+@Service("vendorLicenseModels")
+@Scope(value = "prototype")
+@Validated
+public class VendorLicenseModelsImpl implements VendorLicenseModels {
+
+ @Autowired
+ private VendorLicenseManager vendorLicenseManager;
+
+ @Override
+ public Response listLicenseModels(String versionFilter, String user) {
+ Collection<VersionedVendorLicenseModel> versionedVendorLicenseModels =
+ vendorLicenseManager.listVendorLicenseModels(versionFilter, user);
+
+ GenericCollectionWrapper<VendorLicenseModelEntityDto> results =
+ new GenericCollectionWrapper<>();
+ MapVersionedVendorLicenseModelToVendorLicenseModelEntityDto outputMapper =
+ new MapVersionedVendorLicenseModelToVendorLicenseModelEntityDto();
+ for (VersionedVendorLicenseModel versionedVlm : versionedVendorLicenseModels) {
+ results.add(outputMapper.applyMapping(versionedVlm, VendorLicenseModelEntityDto.class));
+ }
+
+ return Response.ok(results).build();
+ }
+
+ @Override
+ public Response createLicenseModel(VendorLicenseModelRequestDto request, String user) {
+ VendorLicenseModelEntity vendorLicenseModelEntity =
+ new MapVendorLicenseModelRequestDtoToVendorLicenseModelEntity()
+ .applyMapping(request, VendorLicenseModelEntity.class);
+ VendorLicenseModelEntity createdVendorLicenseModel =
+ vendorLicenseManager.createVendorLicenseModel(vendorLicenseModelEntity, user);
+ StringWrapperResponse result = createdVendorLicenseModel != null ? new StringWrapperResponse(
+ createdVendorLicenseModel.getId()) : null;
+
+ return Response.ok(result).build();
+ }
+
+ @Override
+ public Response updateLicenseModel(VendorLicenseModelRequestDto request, String vlmId,
+ String user) {
+ VendorLicenseModelEntity vendorLicenseModelEntity =
+ new MapVendorLicenseModelRequestDtoToVendorLicenseModelEntity()
+ .applyMapping(request, VendorLicenseModelEntity.class);
+ vendorLicenseModelEntity.setId(vlmId);
+
+ vendorLicenseManager.updateVendorLicenseModel(vendorLicenseModelEntity, user);
+ return Response.ok().build();
+ }
+
+ @Override
+ public Response getLicenseModel(String vlmId, String version, String user) {
+ VersionedVendorLicenseModel versionedVlm =
+ vendorLicenseManager.getVendorLicenseModel(vlmId, Version.valueOf(version), user);
+
+ VendorLicenseModelEntityDto vlmDto = versionedVlm == null ? null :
+ new MapVersionedVendorLicenseModelToVendorLicenseModelEntityDto()
+ .applyMapping(versionedVlm, VendorLicenseModelEntityDto.class);
+ return Response.ok(vlmDto).build();
+ }
+
+ @Override
+ public Response deleteLicenseModel(String vlmId, String user) {
+ vendorLicenseManager.deleteVendorLicenseModel(vlmId, user);
+ return Response.ok().build();
+ }
+
+ @Override
+ public Response actOnLicenseModel(VendorLicenseModelActionRequestDto request, String vlmId,
+ String user) {
+
+ switch (request.getAction()) {
+ case Checkout:
+ vendorLicenseManager.checkout(vlmId, user);
+ break;
+ case Undo_Checkout:
+ vendorLicenseManager.undoCheckout(vlmId, user);
+ break;
+ case Checkin:
+ vendorLicenseManager.checkin(vlmId, user);
+ break;
+ case Submit:
+ vendorLicenseManager.submit(vlmId, user);
+ break;
+ default:
+ }
+
+ return Response.ok().build();
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/pom.xml
new file mode 100644
index 0000000000..1b0319dcf3
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/pom.xml
@@ -0,0 +1,30 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.sdc.onboarding</groupId>
+ <artifactId>vendor-license-rest</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../</relativePath>
+ </parent>
+
+ <artifactId>vendor-license-rest-types</artifactId>
+ <name>vendor-license-rest-types</name>
+
+
+
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-common-rest</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-vendor-license-manager</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/ChoiceOrOtherDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/ChoiceOrOtherDto.java
new file mode 100644
index 0000000000..ba8f57f79f
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/ChoiceOrOtherDto.java
@@ -0,0 +1,75 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.types;
+
+import org.hibernate.validator.group.GroupSequenceProvider;
+import org.openecomp.sdcrests.vendorlicense.types.validation.ChoiceOrOtherSequenceProvider;
+import org.openecomp.sdcrests.vendorlicense.types.validation.OtherChoiceValidation;
+
+import javax.validation.constraints.NotNull;
+
+@GroupSequenceProvider(value = ChoiceOrOtherSequenceProvider.class)
+public class ChoiceOrOtherDto<E extends Enum<E>> {
+ @NotNull
+ private E choice;
+ @NotNull(message = "may not be null when choice is set to 'Other'.",
+ groups = OtherChoiceValidation.class)
+ private String other;
+
+ public E getChoice() {
+ return choice;
+ }
+
+ public void setChoice(E choice) {
+ this.choice = choice;
+ }
+
+ public String getOther() {
+ return other;
+ }
+
+ public void setOther(String other) {
+ this.other = other;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null || getClass() != obj.getClass()) {
+ return false;
+ }
+
+ ChoiceOrOtherDto<?> that = (ChoiceOrOtherDto<?>) obj;
+
+ return choice != null ? choice.equals(that.choice)
+ : that.choice == null && (other != null ? other.equals(that.other) : that.other == null);
+
+ }
+
+ @Override
+ public int hashCode() {
+ int result = choice != null ? choice.hashCode() : 0;
+ result = 31 * result + (other != null ? other.hashCode() : 0);
+ return result;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/EntitlementPoolEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/EntitlementPoolEntityDto.java
new file mode 100644
index 0000000000..5ed40b00b7
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/EntitlementPoolEntityDto.java
@@ -0,0 +1,48 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.types;
+
+
+import io.swagger.annotations.ApiModel;
+
+import java.util.Set;
+
+@ApiModel(value = "EntitlementPoolEntity")
+public class EntitlementPoolEntityDto extends EntitlementPoolRequestDto {
+ private String id;
+ private Set<String> referencingFeatureGroups;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public Set<String> getReferencingFeatureGroups() {
+ return referencingFeatureGroups;
+ }
+
+ public void setReferencingFeatureGroups(Set<String> referencingFeatureGroups) {
+ this.referencingFeatureGroups = referencingFeatureGroups;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/EntitlementPoolRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/EntitlementPoolRequestDto.java
new file mode 100644
index 0000000000..b70504e20e
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/EntitlementPoolRequestDto.java
@@ -0,0 +1,144 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.types;
+
+import io.swagger.annotations.ApiModel;
+import org.openecomp.sdc.vendorlicense.dao.types.AggregationFunction;
+import org.openecomp.sdc.vendorlicense.dao.types.EntitlementMetric;
+import org.openecomp.sdc.vendorlicense.dao.types.EntitlementTime;
+import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope;
+import org.openecomp.sdc.vendorlicense.dao.types.ThresholdUnit;
+
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+
+@ApiModel(value = "EntitlementPoolRequest")
+public class EntitlementPoolRequestDto {
+
+ @NotNull
+ @Size(max = 120)
+ private String name;
+ @NotNull
+ @Size(max = 1000)
+ private String description;
+ @NotNull
+ private int thresholdValue;
+ @NotNull
+ private ThresholdUnit thresholdUnits;
+ @NotNull
+ @Valid
+ private ChoiceOrOtherDto<EntitlementMetric> entitlementMetric;
+ @Size(max = 120)
+ private String increments;
+ @NotNull
+ @Valid
+ private ChoiceOrOtherDto<AggregationFunction> aggregationFunction;
+ @NotNull
+ @Valid
+ private MultiChoiceOrOtherDto<OperationalScope> operationalScope;
+ @NotNull
+ @Valid
+ private ChoiceOrOtherDto<EntitlementTime> time;
+ @NotNull
+ @Size(max = 100)
+ private String manufacturerReferenceNumber;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public int getThresholdValue() {
+ return thresholdValue;
+ }
+
+ public void setThresholdValue(int thresholdValue) {
+ this.thresholdValue = thresholdValue;
+ }
+
+ public ThresholdUnit getThresholdUnits() {
+ return thresholdUnits;
+ }
+
+ public void setThresholdUnits(ThresholdUnit thresholdUnits) {
+ this.thresholdUnits = thresholdUnits;
+ }
+
+ public ChoiceOrOtherDto<EntitlementMetric> getEntitlementMetric() {
+ return entitlementMetric;
+ }
+
+ public void setEntitlementMetric(ChoiceOrOtherDto<EntitlementMetric> entitlementMetric) {
+ this.entitlementMetric = entitlementMetric;
+ }
+
+ public String getIncrements() {
+ return increments;
+ }
+
+ public void setIncrements(String increments) {
+ this.increments = increments;
+ }
+
+ public ChoiceOrOtherDto<AggregationFunction> getAggregationFunction() {
+ return aggregationFunction;
+ }
+
+ public void setAggregationFunction(ChoiceOrOtherDto<AggregationFunction> aggregationFunction) {
+ this.aggregationFunction = aggregationFunction;
+ }
+
+ public MultiChoiceOrOtherDto<OperationalScope> getOperationalScope() {
+ return operationalScope;
+ }
+
+ public void setOperationalScope(MultiChoiceOrOtherDto<OperationalScope> operationalScope) {
+ this.operationalScope = operationalScope;
+ }
+
+ public ChoiceOrOtherDto<EntitlementTime> getTime() {
+ return time;
+ }
+
+ public void setTime(ChoiceOrOtherDto<EntitlementTime> time) {
+ this.time = time;
+ }
+
+ public String getManufacturerReferenceNumber() {
+ return manufacturerReferenceNumber;
+ }
+
+ public void setManufacturerReferenceNumber(String manufacturerReferenceNumber) {
+ this.manufacturerReferenceNumber = manufacturerReferenceNumber;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupDescriptorDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupDescriptorDto.java
new file mode 100644
index 0000000000..5c1f8f2cfc
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupDescriptorDto.java
@@ -0,0 +1,59 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.types;
+
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+
+public class FeatureGroupDescriptorDto {
+ @NotNull
+ @Size(max = 120)
+ private String name;
+ @NotNull
+ @Size(max = 1000)
+ private String description;
+ @NotNull
+ private String partNumber;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getPartNumber() {
+ return partNumber;
+ }
+
+ public void setPartNumber(String partNumber) {
+ this.partNumber = partNumber;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupEntityDto.java
new file mode 100644
index 0000000000..a1d1edddcf
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupEntityDto.java
@@ -0,0 +1,69 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.types;
+
+import io.swagger.annotations.ApiModel;
+
+import java.util.Set;
+
+import javax.validation.constraints.Size;
+
+
+@ApiModel(value = "FeatureGroupEntity")
+public class FeatureGroupEntityDto extends FeatureGroupDescriptorDto {
+ private String id;
+ private Set<String> licenseKeyGroupsIds;
+ @Size(min = 1)
+ private Set<String> entitlementPoolsIds;
+ private Set<String> referencingLicenseAgreements;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public Set<String> getLicenseKeyGroupsIds() {
+ return licenseKeyGroupsIds;
+ }
+
+ public void setLicenseKeyGroupsIds(Set<String> licenseKeyGroupsIds) {
+ this.licenseKeyGroupsIds = licenseKeyGroupsIds;
+ }
+
+ public Set<String> getEntitlementPoolsIds() {
+ return entitlementPoolsIds;
+ }
+
+ public void setEntitlementPoolsIds(Set<String> entitlementPoolsIds) {
+ this.entitlementPoolsIds = entitlementPoolsIds;
+ }
+
+ public Set<String> getReferencingLicenseAgreements() {
+ return referencingLicenseAgreements;
+ }
+
+ public void setReferencingLicenseAgreements(Set<String> referencingLicenseAgreements) {
+ this.referencingLicenseAgreements = referencingLicenseAgreements;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupModelDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupModelDto.java
new file mode 100644
index 0000000000..1572320bb1
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupModelDto.java
@@ -0,0 +1,66 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.types;
+
+import io.swagger.annotations.ApiModel;
+
+import java.util.Collection;
+import java.util.Set;
+
+@ApiModel(value = "FeatureGroupModel")
+public class FeatureGroupModelDto extends FeatureGroupDescriptorDto {
+ private String id;
+ private Set<String> referencingLicenseAgreements;
+ private Collection<LicenseKeyGroupEntityDto> licenseKeyGroups;
+ private Collection<EntitlementPoolEntityDto> entitlementPools;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public Set<String> getReferencingLicenseAgreements() {
+ return referencingLicenseAgreements;
+ }
+
+ public void setReferencingLicenseAgreements(Set<String> referencingLicenseAgreements) {
+ this.referencingLicenseAgreements = referencingLicenseAgreements;
+ }
+
+ public Collection<LicenseKeyGroupEntityDto> getLicenseKeyGroups() {
+ return licenseKeyGroups;
+ }
+
+ public void setLicenseKeyGroups(Collection<LicenseKeyGroupEntityDto> licenseKeyGroups) {
+ this.licenseKeyGroups = licenseKeyGroups;
+ }
+
+ public Collection<EntitlementPoolEntityDto> getEntitlementPools() {
+ return entitlementPools;
+ }
+
+ public void setEntitlementPools(Collection<EntitlementPoolEntityDto> entitlementPools) {
+ this.entitlementPools = entitlementPools;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupRequestDto.java
new file mode 100644
index 0000000000..282e797f1b
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupRequestDto.java
@@ -0,0 +1,48 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.types;
+
+import io.swagger.annotations.ApiModel;
+
+import java.util.Set;
+
+@ApiModel(value = "FeatureGroupRequest")
+public class FeatureGroupRequestDto extends FeatureGroupDescriptorDto {
+
+ private Set<String> addedLicenseKeyGroupsIds;
+ private Set<String> addedEntitlementPoolsIds;
+
+ public Set<String> getAddedLicenseKeyGroupsIds() {
+ return addedLicenseKeyGroupsIds;
+ }
+
+ public void setAddedLicenseKeyGroupsIds(Set<String> addedLicenseKeyGroupsIds) {
+ this.addedLicenseKeyGroupsIds = addedLicenseKeyGroupsIds;
+ }
+
+ public Set<String> getAddedEntitlementPoolsIds() {
+ return addedEntitlementPoolsIds;
+ }
+
+ public void setAddedEntitlementPoolsIds(Set<String> addedEntitlementPoolsIds) {
+ this.addedEntitlementPoolsIds = addedEntitlementPoolsIds;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupUpdateRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupUpdateRequestDto.java
new file mode 100644
index 0000000000..002e48bb2c
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupUpdateRequestDto.java
@@ -0,0 +1,48 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.types;
+
+import io.swagger.annotations.ApiModel;
+
+import java.util.Set;
+
+@ApiModel(value = "FeatureGroupUpdateRequest")
+public class FeatureGroupUpdateRequestDto extends FeatureGroupRequestDto {
+
+ private Set<String> removedLicenseKeyGroupsIds;
+ private Set<String> removedEntitlementPoolsIds;
+
+ public Set<String> getRemovedLicenseKeyGroupsIds() {
+ return removedLicenseKeyGroupsIds;
+ }
+
+ public void setRemovedLicenseKeyGroupsIds(Set<String> removedLicenseKeyGroupsIds) {
+ this.removedLicenseKeyGroupsIds = removedLicenseKeyGroupsIds;
+ }
+
+ public Set<String> getRemovedEntitlementPoolsIds() {
+ return removedEntitlementPoolsIds;
+ }
+
+ public void setRemovedEntitlementPoolsIds(Set<String> removedEntitlementPoolsIds) {
+ this.removedEntitlementPoolsIds = removedEntitlementPoolsIds;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementDescriptorDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementDescriptorDto.java
new file mode 100644
index 0000000000..acfc130ed1
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementDescriptorDto.java
@@ -0,0 +1,74 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.types;
+
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseTerm;
+
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+
+public class LicenseAgreementDescriptorDto {
+
+ @NotNull
+ @Size(max = 120)
+ private String name;
+ @NotNull
+ @Size(max = 1000)
+ private String description;
+ @NotNull
+ @Valid
+ private ChoiceOrOtherDto<LicenseTerm> licenseTerm;
+ @Size(max = 1000)
+ private String requirementsAndConstrains;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public ChoiceOrOtherDto<LicenseTerm> getLicenseTerm() {
+ return licenseTerm;
+ }
+
+ public void setLicenseTerm(ChoiceOrOtherDto<LicenseTerm> licenseTerm) {
+ this.licenseTerm = licenseTerm;
+ }
+
+ public String getRequirementsAndConstrains() {
+ return requirementsAndConstrains;
+ }
+
+ public void setRequirementsAndConstrains(String requirementsAndConstrains) {
+ this.requirementsAndConstrains = requirementsAndConstrains;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementEntityDto.java
new file mode 100644
index 0000000000..b0a8f65995
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementEntityDto.java
@@ -0,0 +1,51 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.types;
+
+
+import io.swagger.annotations.ApiModel;
+
+import java.util.Set;
+import javax.validation.constraints.Size;
+
+
+@ApiModel(value = "LicenseAgreementEntity")
+public class LicenseAgreementEntityDto extends LicenseAgreementDescriptorDto {
+ private String id;
+ @Size(min = 1)
+ private Set<String> featureGroupsIds;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public Set<String> getFeatureGroupsIds() {
+ return featureGroupsIds;
+ }
+
+ public void setFeatureGroupsIds(Set<String> featureGroupsIds) {
+ this.featureGroupsIds = featureGroupsIds;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementModelDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementModelDto.java
new file mode 100644
index 0000000000..a3460c321f
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementModelDto.java
@@ -0,0 +1,47 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.types;
+
+import io.swagger.annotations.ApiModel;
+
+import java.util.Set;
+
+@ApiModel(value = "LicenseAgreementModel")
+public class LicenseAgreementModelDto extends LicenseAgreementDescriptorDto {
+ private String id;
+ private Set<FeatureGroupEntityDto> featureGroups;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public Set<FeatureGroupEntityDto> getFeatureGroups() {
+ return featureGroups;
+ }
+
+ public void setFeatureGroups(Set<FeatureGroupEntityDto> featureGroups) {
+ this.featureGroups = featureGroups;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementRequestDto.java
new file mode 100644
index 0000000000..3830bdb713
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementRequestDto.java
@@ -0,0 +1,39 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.types;
+
+import io.swagger.annotations.ApiModel;
+
+import java.util.Set;
+
+@ApiModel(value = "LicenseAgreementRequest")
+public class LicenseAgreementRequestDto extends LicenseAgreementDescriptorDto {
+
+ private Set<String> addedFeatureGroupsIds;
+
+ public Set<String> getAddedFeatureGroupsIds() {
+ return addedFeatureGroupsIds;
+ }
+
+ public void setAddedFeatureGroupsIds(Set<String> addedFeatureGroupsIds) {
+ this.addedFeatureGroupsIds = addedFeatureGroupsIds;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementUpdateRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementUpdateRequestDto.java
new file mode 100644
index 0000000000..2590bcf519
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementUpdateRequestDto.java
@@ -0,0 +1,38 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.types;
+
+import io.swagger.annotations.ApiModel;
+
+import java.util.Set;
+
+@ApiModel(value = "LicenseAgreementUpdateRequest")
+public class LicenseAgreementUpdateRequestDto extends LicenseAgreementRequestDto {
+ private Set<String> removedFeatureGroupsIds;
+
+ public Set<String> getRemovedFeatureGroupsIds() {
+ return removedFeatureGroupsIds;
+ }
+
+ public void setRemovedFeatureGroupsIds(Set<String> removedFeatureGroupsIds) {
+ this.removedFeatureGroupsIds = removedFeatureGroupsIds;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseKeyGroupEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseKeyGroupEntityDto.java
new file mode 100644
index 0000000000..9fab60fe27
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseKeyGroupEntityDto.java
@@ -0,0 +1,45 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.types;
+
+
+import java.util.Set;
+
+public class LicenseKeyGroupEntityDto extends LicenseKeyGroupRequestDto {
+ private String id;
+ private Set<String> referencingFeatureGroups;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public Set<String> getReferencingFeatureGroups() {
+ return referencingFeatureGroups;
+ }
+
+ public void setReferencingFeatureGroups(Set<String> referencingFeatureGroups) {
+ this.referencingFeatureGroups = referencingFeatureGroups;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseKeyGroupRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseKeyGroupRequestDto.java
new file mode 100644
index 0000000000..0df2e3251f
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseKeyGroupRequestDto.java
@@ -0,0 +1,74 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.types;
+
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyType;
+import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope;
+
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+
+public class LicenseKeyGroupRequestDto {
+ @NotNull
+ @Size(max = 120)
+ private String name;
+ @NotNull
+ @Size(max = 1000)
+ private String description;
+ @NotNull
+ private LicenseKeyType type;
+ @NotNull
+ @Valid
+ private MultiChoiceOrOtherDto<OperationalScope> operationalScope;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public LicenseKeyType getType() {
+ return type;
+ }
+
+ public void setType(LicenseKeyType type) {
+ this.type = type;
+ }
+
+ public MultiChoiceOrOtherDto<OperationalScope> getOperationalScope() {
+ return operationalScope;
+ }
+
+ public void setOperationalScope(MultiChoiceOrOtherDto<OperationalScope> operationalScope) {
+ this.operationalScope = operationalScope;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/MultiChoiceOrOtherDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/MultiChoiceOrOtherDto.java
new file mode 100644
index 0000000000..5a88e4c72f
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/MultiChoiceOrOtherDto.java
@@ -0,0 +1,79 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.types;
+
+import org.hibernate.validator.group.GroupSequenceProvider;
+import org.openecomp.sdcrests.vendorlicense.types.validation.MultiChoiceOrOtherSequenceProvider;
+import org.openecomp.sdcrests.vendorlicense.types.validation.OtherChoiceValidation;
+
+import java.util.Set;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+
+
+@GroupSequenceProvider(value = MultiChoiceOrOtherSequenceProvider.class)
+public class MultiChoiceOrOtherDto<E extends Enum<E>> {
+ @NotNull
+ @Size(min = 1, message = "must contain at least 1 choice.")
+ private Set<E> choices;
+ @NotNull(message = "may not be null when choices is set to 'Other'.",
+ groups = OtherChoiceValidation.class)
+ private String other;
+
+ public Set<E> getChoices() {
+ return choices;
+ }
+
+ public void setChoices(Set<E> choices) {
+ this.choices = choices;
+ }
+
+ public String getOther() {
+ return other;
+ }
+
+ public void setOther(String other) {
+ this.other = other;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null || getClass() != obj.getClass()) {
+ return false;
+ }
+
+ MultiChoiceOrOtherDto<?> that = (MultiChoiceOrOtherDto<?>) obj;
+
+ return choices != null ? choices.equals(that.choices)
+ : that.choices == null && (other != null ? other.equals(that.other) : that.other == null);
+
+ }
+
+ @Override
+ public int hashCode() {
+ int result = choices != null ? choices.hashCode() : 0;
+ result = 31 * result + (other != null ? other.hashCode() : 0);
+ return result;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelActionRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelActionRequestDto.java
new file mode 100644
index 0000000000..cfae94ce35
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelActionRequestDto.java
@@ -0,0 +1,36 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.types;
+
+import org.openecomp.sdcrests.versioning.types.VersioningAction;
+
+public class VendorLicenseModelActionRequestDto {
+
+ private VersioningAction action;
+
+ public VersioningAction getAction() {
+ return action;
+ }
+
+ public void setAction(VersioningAction action) {
+ this.action = action;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelEntityDto.java
new file mode 100644
index 0000000000..6c10f8fbe2
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelEntityDto.java
@@ -0,0 +1,85 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.types;
+
+import io.swagger.annotations.ApiModel;
+import org.openecomp.sdc.versioning.dao.types.VersionStatus;
+
+
+import java.util.List;
+
+@ApiModel(value = "VendorLicenseModelEntity")
+public class VendorLicenseModelEntityDto extends VendorLicenseModelRequestDto {
+ private String id;
+ private String version;
+ private VersionStatus status;
+ private String lockingUser;
+ private List<String> viewableVersions;
+ private List<String> finalVersions;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ public VersionStatus getStatus() {
+ return status;
+ }
+
+ public void setStatus(VersionStatus status) {
+ this.status = status;
+ }
+
+ public String getLockingUser() {
+ return lockingUser;
+ }
+
+ public void setLockingUser(String lockingUser) {
+ this.lockingUser = lockingUser;
+ }
+
+ public List<String> getViewableVersions() {
+ return viewableVersions;
+ }
+
+ public void setViewableVersions(List<String> viewableVersions) {
+ this.viewableVersions = viewableVersions;
+ }
+
+ public List<String> getFinalVersions() {
+ return finalVersions;
+ }
+
+ public void setFinalVersions(List<String> finalVersions) {
+ this.finalVersions = finalVersions;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelRequestDto.java
new file mode 100644
index 0000000000..57b936a57f
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelRequestDto.java
@@ -0,0 +1,62 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.types;
+
+import io.swagger.annotations.ApiModel;
+
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+
+@ApiModel(value = "VendorLicenseModelRequest")
+public class VendorLicenseModelRequestDto {
+ @NotNull
+ @Size(max = 25)
+ private String vendorName;
+ @NotNull
+ @Size(max = 1000)
+ private String description;
+ @NotNull
+ private String iconRef;
+
+ public String getVendorName() {
+ return vendorName;
+ }
+
+ public void setVendorName(String vendorName) {
+ this.vendorName = vendorName;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getIconRef() {
+ return iconRef;
+ }
+
+ public void setIconRef(String iconRef) {
+ this.iconRef = iconRef;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/validation/ChoiceOrOtherSequenceProvider.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/validation/ChoiceOrOtherSequenceProvider.java
new file mode 100644
index 0000000000..8be0ba3231
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/validation/ChoiceOrOtherSequenceProvider.java
@@ -0,0 +1,45 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.types.validation;
+
+import org.hibernate.validator.spi.group.DefaultGroupSequenceProvider;
+import org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther;
+import org.openecomp.sdcrests.vendorlicense.types.ChoiceOrOtherDto;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class ChoiceOrOtherSequenceProvider
+ implements DefaultGroupSequenceProvider<ChoiceOrOtherDto> {
+
+ @Override
+ public List<Class<?>> getValidationGroups(ChoiceOrOtherDto choiceOrOther) {
+ List<Class<?>> sequence = new ArrayList<>();
+ sequence.add(ChoiceOrOtherDto.class);
+
+ if (choiceOrOther != null && choiceOrOther.getChoice() != null
+ && ChoiceOrOther.OTHER_ENUM_VALUE.equals(choiceOrOther.getChoice().name())) {
+ sequence.add(OtherChoiceValidation.class);
+ }
+
+ return sequence;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/validation/MultiChoiceOrOtherSequenceProvider.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/validation/MultiChoiceOrOtherSequenceProvider.java
new file mode 100644
index 0000000000..7cc9bbd2a2
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/validation/MultiChoiceOrOtherSequenceProvider.java
@@ -0,0 +1,47 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.types.validation;
+
+import org.hibernate.validator.spi.group.DefaultGroupSequenceProvider;
+import org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther;
+import org.openecomp.sdcrests.vendorlicense.types.MultiChoiceOrOtherDto;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class MultiChoiceOrOtherSequenceProvider
+ implements DefaultGroupSequenceProvider<MultiChoiceOrOtherDto> {
+
+ @Override
+ public List<Class<?>> getValidationGroups(MultiChoiceOrOtherDto multiChoiceOrOther) {
+ List<Class<?>> sequence = new ArrayList<>();
+ sequence.add(MultiChoiceOrOtherDto.class);
+
+ if (multiChoiceOrOther != null && multiChoiceOrOther.getChoices() != null
+ && multiChoiceOrOther.getChoices().size() == 1
+ && MultiChoiceOrOther.OTHER_ENUM_VALUE
+ .equals((((Enum) (multiChoiceOrOther.getChoices().iterator().next())).name()))) {
+ sequence.add(OtherChoiceValidation.class);
+ }
+
+ return sequence;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/validation/OtherChoiceValidation.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/validation/OtherChoiceValidation.java
new file mode 100644
index 0000000000..ff682dd8b5
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/validation/OtherChoiceValidation.java
@@ -0,0 +1,24 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorlicense.types.validation;
+
+public interface OtherChoiceValidation {
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/pom.xml
new file mode 100644
index 0000000000..8bd67d6a07
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/pom.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-rest-webapp</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.openecomp.sdc.onboarding</groupId>
+ <artifactId>vendor-software-products-rest</artifactId>
+ <name>vendor-software-products-rest</name>
+ <packaging>pom</packaging>
+
+
+ <modules>
+ <module>/vendor-software-products-rest-services</module>
+ <module>/vendor-software-products-rest-types</module>
+ </modules>
+</project> \ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/pom.xml
new file mode 100644
index 0000000000..7869edfa01
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/pom.xml
@@ -0,0 +1,144 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.sdc.onboarding</groupId>
+ <artifactId>vendor-software-products-rest</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>vendor-software-products-rest-services</artifactId>
+
+
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ <version>${spring.framework.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <version>${spring.framework.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context-support</artifactId>
+ <version>${spring.framework.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ <version>${spring.framework.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ <version>${spring.framework.version}</version>
+ </dependency>
+
+ <!-- CXF -->
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-frontend-jaxrs</artifactId>
+ <version>${cxf.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ <version>${http.client.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>javax.ws.rs-api</artifactId>
+ <version>${ws.rs.version}</version>
+ </dependency>
+
+ <!-- Other Stuff-->
+ <dependency>
+ <groupId>cglib</groupId>
+ <artifactId>cglib-nodep</artifactId>
+ <version>${cglib.nodep.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <!-- Java Stuff -->
+ <dependency>
+ <groupId>javax.inject</groupId>
+ <artifactId>javax.inject</artifactId>
+ <version>${javax.inject.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>javax.ws.rs-api</artifactId>
+ <version>${ws.rs.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-core</artifactId>
+ <version>1.19.1</version>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>jsr311-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>io.swagger</groupId>
+ <artifactId>swagger-annotations</artifactId>
+ <version>1.5.3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc.onboarding</groupId>
+ <artifactId>vendor-software-products-rest-types</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-annotations</artifactId>
+ <version>2.7.4</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.dataformat</groupId>
+ <artifactId>jackson-dataformat-xml</artifactId>
+ <version>2.7.4</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.woodstox</groupId>
+ <artifactId>woodstox-core-asl</artifactId>
+ <version>4.4.1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-vendor-software-product-manager</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+
+ </dependencies>
+
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <includes>
+ <include>test/core/unittest/offline/**</include>
+ </includes>
+ <skipTests>true</skipTests>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentProcesses.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentProcesses.java
new file mode 100644
index 0000000000..3fae16cf7f
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentProcesses.java
@@ -0,0 +1,168 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vsp.rest;
+
+import static org.openecomp.sdcrests.common.RestConstants.USER_HEADER_PARAM;
+import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.apache.cxf.jaxrs.ext.multipart.Attachment;
+import org.apache.cxf.jaxrs.ext.multipart.Multipart;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ProcessEntityDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ProcessRequestDto;
+import org.springframework.validation.annotation.Validated;
+
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Pattern;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+@Path("/v1.0/vendor-software-products/{vspId}/components/{componentId}/processes")
+@Produces(MediaType.APPLICATION_JSON)
+@Consumes(MediaType.APPLICATION_JSON)
+@Api(value = "Vendor Software Product Component Processes")
+@Validated
+public interface ComponentProcesses {
+ @GET
+ @Path("/")
+ @ApiOperation(value = "List vendor software product component processes",
+ response = ProcessEntityDto.class,
+ responseContainer = "List")
+ Response list(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @ApiParam(value = "Vendor software product component Id") @PathParam("componentId")
+ String componentId,
+ @Pattern(regexp = Version.VERSION_REGEX,
+ message = Version.VERSION_STRING_VIOLATION_MSG) @QueryParam("version")
+ String version,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM)
+ String user);
+
+ @DELETE
+ @Path("/")
+ @ApiOperation(value = "Delete vendor software product processes",
+ responseContainer = "List")
+ Response deleteList(
+ @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @ApiParam(value = "Vendor software product component Id") @PathParam("componentId")
+ String componentId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user);
+
+ @POST
+ @Path("/")
+ @ApiOperation(value = "Create a vendor software product process")
+ Response create(@Valid ProcessRequestDto request,
+ @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @ApiParam(value = "Vendor software product component Id")
+ @PathParam("componentId") String componentId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM)
+ String user);
+
+ @GET
+ @Path("/{processId}")
+ @ApiOperation(value = "Get vendor software product process",
+ response = ProcessEntityDto.class)
+ Response get(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @ApiParam(value = "Vendor software product component Id") @PathParam("componentId")
+ String componentId,
+ @ApiParam(value = "Vendor software product process Id") @PathParam("processId")
+ String processId,
+ @Pattern(regexp = Version.VERSION_REGEX,
+ message = Version.VERSION_STRING_VIOLATION_MSG) @QueryParam("version")
+ String version,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM)
+ String user);
+
+ @DELETE
+ @Path("/{processId}")
+ @ApiOperation(value = "Delete vendor software product process")
+ Response delete(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @ApiParam(value = "Vendor software product component Id")
+ @PathParam("componentId") String componentId,
+ @ApiParam(value = "Vendor software product process Id") @PathParam("processId")
+ String processId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM)
+ String user);
+
+ @PUT
+ @Path("/{processId}")
+ @ApiOperation(value = "Update vendor software product process")
+ Response update(@Valid ProcessRequestDto request,
+ @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @ApiParam(value = "Vendor software product component Id")
+ @PathParam("componentId") String componentId,
+ @ApiParam(value = "Vendor software product process Id") @PathParam("processId")
+ String processId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM)
+ String user);
+
+ @GET
+ @Path("/{processId}/upload")
+ @Produces(MediaType.APPLICATION_OCTET_STREAM)
+ @ApiOperation(value = "Get vendor software product process uploaded file")
+ Response getUploadedFile(
+ @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @ApiParam(value = "Vendor software product component Id") @PathParam("componentId")
+ String componentId,
+ @ApiParam(value = "Vendor software product process Id") @PathParam("processId")
+ String processId,
+ @Pattern(regexp = Version.VERSION_REGEX, message = Version.VERSION_STRING_VIOLATION_MSG)
+ @QueryParam("version") String version,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user);
+
+ @DELETE
+ @Path("/{processId}/upload")
+ @ApiOperation(value = "Delete vendor software product process uploaded file")
+ Response deleteUploadedFile(
+ @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @ApiParam(value = "Vendor software product component Id") @PathParam("componentId")
+ String componentId,
+ @ApiParam(value = "Vendor software product process Id") @PathParam("processId")
+ String processId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user);
+
+ @POST
+ @Path("/{processId}/upload")
+ @Consumes(MediaType.MULTIPART_FORM_DATA)
+ @ApiOperation(value = "Update vendor software product process upload")
+ Response uploadFile(@Multipart("upload") Attachment attachment,
+ @ApiParam(value = "Vendor software product Id") @PathParam("vspId")
+ String vspId,
+ @ApiParam(value = "Vendor software product component Id")
+ @PathParam("componentId") String componentId,
+ @ApiParam(value = "Vendor software product process Id")
+ @PathParam("processId") String processId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM)
+ String user);
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentUploads.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentUploads.java
new file mode 100644
index 0000000000..c7ad2f7fe5
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentUploads.java
@@ -0,0 +1,104 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vsp.rest;
+
+import static org.openecomp.sdcrests.common.RestConstants.USER_HEADER_PARAM;
+import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.apache.cxf.jaxrs.ext.multipart.Attachment;
+import org.apache.cxf.jaxrs.ext.multipart.Multipart;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.MibUploadStatusDto;
+import org.springframework.validation.annotation.Validated;
+
+import javax.validation.constraints.NotNull;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+
+@Path("/v1.0/vendor-software-products/{vspId}/components/{componentId}/monitors")
+@Produces(MediaType.APPLICATION_JSON)
+@Consumes(MediaType.APPLICATION_JSON)
+@Api(value = "Vendor Software Product Component MIB Uploads")
+@Validated
+public interface ComponentUploads {
+ @POST
+ @Path("/snmp-trap/upload")
+ @Consumes(MediaType.MULTIPART_FORM_DATA)
+ @ApiOperation(value = "Upload vendor software product MIB Trap Definitions file")
+ Response uploadTrapMibFile(@Multipart("upload") Attachment attachment,
+ @ApiParam(value = "Vendor software product Id") @PathParam("vspId")
+ String vspId,
+ @ApiParam(value = "Vendor software product component Id")
+ @PathParam("componentId") String componentId,
+ @NotNull(message = USER_MISSING_ERROR_MSG)
+ @HeaderParam(USER_HEADER_PARAM) String user);
+
+ @DELETE
+ @Path("/snmp-trap")
+ @ApiOperation(value = "Delete vendor software product MIB Trap Definitions file")
+ Response deleteTrapMibFile(
+ @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @ApiParam(value = "Vendor software product component Id") @PathParam("componentId")
+ String componentId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user);
+
+ @POST
+ @Path("/snmp/upload")
+ @Consumes(MediaType.MULTIPART_FORM_DATA)
+ @ApiOperation(value = "Upload vendor software product MIB Poll Definitions file")
+ Response uploadPollMibFile(@Multipart("upload") Attachment attachment,
+ @ApiParam(value = "Vendor software product Id") @PathParam("vspId")
+ String vspId,
+ @ApiParam(value = "Vendor software product component Id")
+ @PathParam("componentId") String componentId,
+ @NotNull(message = USER_MISSING_ERROR_MSG)
+ @HeaderParam(USER_HEADER_PARAM) String user);
+
+ @DELETE
+ @Path("/snmp")
+ @ApiOperation(value = "Delete vendor software product MIB Poll Definitions file")
+ Response deletePollMibFile(
+ @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @ApiParam(value = "Vendor software product component Id") @PathParam("componentId")
+ String componentId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user);
+
+ @GET
+ @Path("/snmp/")
+ @ApiOperation(value = "Get the filenames of uploaded MIB definitions",
+ response = MibUploadStatusDto.class)
+ Response list(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @ApiParam(value = "Vendor software product component Id") @PathParam("componentId")
+ String componentId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM)
+ String user);
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Components.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Components.java
new file mode 100644
index 0000000000..949a40cfbb
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Components.java
@@ -0,0 +1,142 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vsp.rest;
+
+import static org.openecomp.sdcrests.common.RestConstants.USER_HEADER_PARAM;
+import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentRequestDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireResponseDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.validation.IsValidJson;
+import org.springframework.validation.annotation.Validated;
+
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Pattern;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+@Path("/v1.0/vendor-software-products/{vspId}/components")
+@Produces(MediaType.APPLICATION_JSON)
+@Consumes(MediaType.APPLICATION_JSON)
+@Api(value = "Vendor Software Product Components")
+@Validated
+public interface Components {
+ @GET
+ @Path("/")
+ @ApiOperation(value = "List vendor software product components",
+ response = ComponentDto.class,
+ responseContainer = "List")
+ Response list(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Pattern(regexp = Version.VERSION_REGEX,
+ message = Version.VERSION_STRING_VIOLATION_MSG) @QueryParam("version")
+ String version,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM)
+ String user);
+
+ @DELETE
+ @Path("/")
+ @ApiOperation(value = "Delete vendor software product components",
+ responseContainer = "List")
+ Response deleteList(
+ @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user);
+
+ @POST
+ @Path("/")
+ @ApiOperation(value = "Create a vendor software product component")
+ Response create(@Valid ComponentRequestDto request,
+ @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM)
+ String user);
+
+ @GET
+ @Path("/{componentId}")
+ @ApiOperation(value = "Get vendor software product component",
+ response = ComponentData.class,
+ responseContainer = "CompositionEntityResponse")
+ Response get(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @ApiParam(value = "Vendor software product component Id") @PathParam("componentId")
+ String componentId,
+ @Pattern(regexp = Version.VERSION_REGEX,
+ message = Version.VERSION_STRING_VIOLATION_MSG) @QueryParam("version")
+ String version,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM)
+ String user);
+
+ @DELETE
+ @Path("/{componentId}")
+ @ApiOperation(value = "Delete vendor software product component")
+ Response delete(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @ApiParam(value = "Vendor software product component Id")
+ @PathParam("componentId") String componentId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM)
+ String user);
+
+ @PUT
+ @Path("/{componentId}")
+ @ApiOperation(value = "Update vendor software product component")
+ Response update(@Valid ComponentRequestDto request,
+ @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @ApiParam(value = "Vendor software product component Id")
+ @PathParam("componentId") String componentId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM)
+ String user);
+
+ @GET
+ @Path("/{componentId}/questionnaire")
+ @ApiOperation(value = "Get vendor software product component questionnaire",
+ response = QuestionnaireResponseDto.class)
+ Response getQuestionnaire(
+ @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @ApiParam(value = "Vendor software product component Id") @PathParam("componentId")
+ String componentId,
+ @Pattern(regexp = Version.VERSION_REGEX, message = Version.VERSION_STRING_VIOLATION_MSG)
+ @QueryParam("version") String version,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user);
+
+ @PUT
+ @Path("/{componentId}/questionnaire")
+ @ApiOperation(value = "Update vendor software product component questionnaire")
+ Response updateQuestionnaire(@NotNull @IsValidJson String questionnaireData,
+ @ApiParam(value = "Vendor software product Id") @PathParam("vspId")
+ String vspId,
+ @ApiParam(value = "Vendor software product component Id")
+ @PathParam("componentId") String componentId,
+ @NotNull(message = USER_MISSING_ERROR_MSG)
+ @HeaderParam(USER_HEADER_PARAM) String user);
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Networks.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Networks.java
new file mode 100644
index 0000000000..5c7c9d7bd8
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Networks.java
@@ -0,0 +1,107 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vsp.rest;
+
+import static org.openecomp.sdcrests.common.RestConstants.USER_HEADER_PARAM;
+import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.NetworkDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.NetworkRequestDto;
+import org.springframework.validation.annotation.Validated;
+
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Pattern;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+@Path("/v1.0/vendor-software-products/{vspId}/networks")
+@Produces(MediaType.APPLICATION_JSON)
+@Consumes(MediaType.APPLICATION_JSON)
+@Api(value = "Vendor Software Product Networks")
+@Validated
+public interface Networks {
+ @GET
+ @Path("/")
+ @ApiOperation(value = "List vendor software product networks",
+ response = NetworkDto.class,
+ responseContainer = "List")
+ Response list(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Pattern(regexp = Version.VERSION_REGEX,
+ message = Version.VERSION_STRING_VIOLATION_MSG) @QueryParam("version")
+ String version,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM)
+ String user);
+
+ @POST
+ @Path("/")
+ @ApiOperation(value = "Create a vendor software product network")
+ Response create(@Valid NetworkRequestDto request,
+ @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM)
+ String user);
+
+ @GET
+ @Path("/{networkId}")
+ @ApiOperation(value = "Get vendor software product network",
+ response = NetworkDto.class)
+ Response get(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @ApiParam(value = "Vendor software product network Id") @PathParam("networkId")
+ String networkId,
+ @Pattern(regexp = Version.VERSION_REGEX,
+ message = Version.VERSION_STRING_VIOLATION_MSG) @QueryParam("version")
+ String version,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM)
+ String user);
+
+ @DELETE
+ @Path("/{networkId}")
+ @ApiOperation(value = "Delete vendor software product network")
+ Response delete(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @ApiParam(value = "Vendor software product network Id") @PathParam("networkId")
+ String networkId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM)
+ String user);
+
+ @PUT
+ @Path("/{networkId}")
+ @ApiOperation(value = "Update vendor software product network")
+ Response update(@Valid NetworkRequestDto request,
+ @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @ApiParam(value = "Vendor software product network Id") @PathParam("networkId")
+ String networkId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM)
+ String user);
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Nics.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Nics.java
new file mode 100644
index 0000000000..8cf26a405b
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Nics.java
@@ -0,0 +1,144 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vsp.rest;
+
+import static org.openecomp.sdcrests.common.RestConstants.USER_HEADER_PARAM;
+import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.NicDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.NicRequestDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireResponseDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.validation.IsValidJson;
+import org.springframework.validation.annotation.Validated;
+
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Pattern;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+@Path("/v1.0/vendor-software-products/{vspId}/components/{componentId}/nics")
+@Produces(MediaType.APPLICATION_JSON)
+@Consumes(MediaType.APPLICATION_JSON)
+@Api(value = "Vendor Software Product Component NICs")
+@Validated
+public interface Nics {
+ @GET
+ @Path("/")
+ @ApiOperation(value = "List vendor software product component NICs",
+ response = NicDto.class,
+ responseContainer = "List")
+ Response list(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @ApiParam(value = "Vendor software product component Id") @PathParam("componentId")
+ String componentId,
+ @Pattern(regexp = Version.VERSION_REGEX,
+ message = Version.VERSION_STRING_VIOLATION_MSG) @QueryParam("version")
+ String version,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM)
+ String user);
+
+ @POST
+ @Path("/")
+ @ApiOperation(value = "Create a vendor software product NIC")
+ Response create(@Valid NicRequestDto request,
+ @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @ApiParam(value = "Vendor software product component Id")
+ @PathParam("componentId") String componentId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM)
+ String user);
+
+ @GET
+ @Path("/{nicId}")
+ @ApiOperation(value = "Get vendor software product NIC",
+ response = NicDto.class)
+ Response get(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @ApiParam(value = "Vendor software product component Id") @PathParam("componentId")
+ String componentId,
+ @ApiParam(value = "Vendor software product NIC Id") @PathParam("nicId") String nicId,
+ @Pattern(regexp = Version.VERSION_REGEX,
+ message = Version.VERSION_STRING_VIOLATION_MSG) @QueryParam("version")
+ String version,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM)
+ String user);
+
+ @DELETE
+ @Path("/{nicId}")
+ @ApiOperation(value = "Delete vendor software product NIC")
+ Response delete(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @ApiParam(value = "Vendor software product component Id")
+ @PathParam("componentId") String componentId,
+ @ApiParam(value = "Vendor software product NIC Id") @PathParam("nicId")
+ String nicId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM)
+ String user);
+
+ @PUT
+ @Path("/{nicId}")
+ @ApiOperation(value = "Update vendor software product NIC")
+ Response update(@Valid NicRequestDto request,
+ @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @ApiParam(value = "Vendor software product component Id")
+ @PathParam("componentId") String componentId,
+ @ApiParam(value = "Vendor software product NIC Id") @PathParam("nicId")
+ String nicId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM)
+ String user);
+
+ @GET
+ @Path("/{nicId}/questionnaire")
+ @ApiOperation(value = "Get vendor software product component NIC questionnaire",
+ response = QuestionnaireResponseDto.class)
+ Response getQuestionnaire(
+ @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @ApiParam(value = "Vendor software product component Id") @PathParam("componentId")
+ String componentId,
+ @ApiParam(value = "Vendor software product NIC Id") @PathParam("nicId") String nicId,
+ @Pattern(regexp = Version.VERSION_REGEX, message = Version.VERSION_STRING_VIOLATION_MSG)
+ @QueryParam("version") String version,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user);
+
+ @PUT
+ @Path("/{nicId}/questionnaire")
+ @ApiOperation(value = "Update vendor software product component NIC questionnaire")
+ Response updateQuestionnaire(@NotNull @IsValidJson String questionnaireData,
+ @ApiParam(value = "Vendor software product Id") @PathParam("vspId")
+ String vspId,
+ @ApiParam(value = "Vendor software product component Id")
+ @PathParam("componentId") String componentId,
+ @ApiParam(value = "Vendor software product NIC Id")
+ @PathParam("nicId") String nicId,
+ @NotNull(message = USER_MISSING_ERROR_MSG)
+ @HeaderParam(USER_HEADER_PARAM) String user);
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Processes.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Processes.java
new file mode 100644
index 0000000000..b5c74587e4
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Processes.java
@@ -0,0 +1,151 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vsp.rest;
+
+import static org.openecomp.sdcrests.common.RestConstants.USER_HEADER_PARAM;
+import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.apache.cxf.jaxrs.ext.multipart.Attachment;
+import org.apache.cxf.jaxrs.ext.multipart.Multipart;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ProcessEntityDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ProcessRequestDto;
+
+import org.springframework.validation.annotation.Validated;
+
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Pattern;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+@Path("/v1.0/vendor-software-products/{vspId}/processes")
+@Produces(MediaType.APPLICATION_JSON)
+@Consumes(MediaType.APPLICATION_JSON)
+@Api(value = "Vendor Software Product Processes")
+@Validated
+public interface Processes {
+ @GET
+ @Path("/")
+ @ApiOperation(value = "List vendor software product processes",
+ response = ProcessEntityDto.class,
+ responseContainer = "List")
+ Response list(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @Pattern(regexp = Version.VERSION_REGEX,
+ message = Version.VERSION_STRING_VIOLATION_MSG) @QueryParam("version")
+ String version,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM)
+ String user);
+
+ @DELETE
+ @Path("/")
+ @ApiOperation(value = "Delete vendor software product processes",
+ responseContainer = "List")
+ Response deleteList(
+ @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user);
+
+ @POST
+ @Path("/")
+ @ApiOperation(value = "Create a vendor software product process")
+ Response create(@Valid ProcessRequestDto request,
+ @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM)
+ String user);
+
+ @GET
+ @Path("/{processId}")
+ @ApiOperation(value = "Get vendor software product process",
+ response = ProcessEntityDto.class)
+ Response get(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @ApiParam(value = "Vendor software product process Id") @PathParam("processId")
+ String processId,
+ @Pattern(regexp = Version.VERSION_REGEX,
+ message = Version.VERSION_STRING_VIOLATION_MSG) @QueryParam("version")
+ String version,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM)
+ String user);
+
+ @DELETE
+ @Path("/{processId}")
+ @ApiOperation(value = "Delete vendor software product process")
+ Response delete(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @ApiParam(value = "Vendor software product process Id") @PathParam("processId")
+ String processId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM)
+ String user);
+
+ @PUT
+ @Path("/{processId}")
+ @ApiOperation(value = "Update vendor software product process")
+ Response update(@Valid ProcessRequestDto request,
+ @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @ApiParam(value = "Vendor software product process Id") @PathParam("processId")
+ String processId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM)
+ String user);
+
+ @GET
+ @Path("/{processId}/upload")
+ @Produces(MediaType.APPLICATION_OCTET_STREAM)
+ @ApiOperation(value = "Get vendor software product process uploaded file")
+ Response getUploadedFile(
+ @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @ApiParam(value = "Vendor software product process Id") @PathParam("processId")
+ String processId,
+ @Pattern(regexp = Version.VERSION_REGEX, message = Version.VERSION_STRING_VIOLATION_MSG)
+ @QueryParam("version") String version,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user);
+
+ @DELETE
+ @Path("/{processId}/upload")
+ @ApiOperation(value = "Delete vendor software product process uploaded file")
+ Response deleteUploadedFile(
+ @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+ @ApiParam(value = "Vendor software product process Id") @PathParam("processId")
+ String processId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user);
+
+ @POST
+ @Path("/{processId}/upload")
+ @Consumes(MediaType.MULTIPART_FORM_DATA)
+ @ApiOperation(value = "Update vendor software product process upload")
+ Response uploadFile(@Multipart("upload") Attachment attachment,
+ @ApiParam(value = "Vendor software product Id") @PathParam("vspId")
+ String vspId,
+ @ApiParam(value = "Vendor software product process Id")
+ @PathParam("processId") String processId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM)
+ String user);
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VendorSoftwareProducts.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VendorSoftwareProducts.java
new file mode 100644
index 0000000000..259ef723c6
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VendorSoftwareProducts.java
@@ -0,0 +1,193 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vsp.rest;
+
+import static org.openecomp.sdcrests.common.RestConstants.USER_HEADER_PARAM;
+import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+
+import org.apache.cxf.jaxrs.ext.multipart.Multipart;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.PackageInfoDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireResponseDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.UploadFileResponseDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.VersionSoftwareProductActionRequestDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspCreationDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspDescriptionDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.validation.IsValidJson;
+import org.springframework.validation.annotation.Validated;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Pattern;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+
+@Path("/v1.0/vendor-software-products")
+@Produces(MediaType.APPLICATION_JSON)
+@Consumes(MediaType.APPLICATION_JSON)
+@Api(value = "Vendor Software Products")
+@Validated
+public interface VendorSoftwareProducts {
+
+ @POST
+ @Path("/")
+ @ApiOperation(value = "Create a new vendor software product",
+ response = VspCreationDto.class)
+ Response createNewVsp(@Valid VspDescriptionDto vspDescriptionDto,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM)
+ String user);
+
+ @GET
+ @Path("/")
+ @ApiOperation(value = "Get list of vendor software products and their description",
+ responseContainer = "List")
+ Response getVspList(@ApiParam(
+ value = "Currently supported values: 'Final' - only vendor software products with final "
+ + "version will be return - with their latest final version")
+ @QueryParam("versionFilter") String versionFilter,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM)
+ String user);
+
+ @GET
+ @Path("/packages")
+ @ApiOperation(value = "Get list of translated CSAR files details",
+ response = PackageInfoDto.class,
+ responseContainer = "List")
+ Response listPackages(@ApiParam("Category") @QueryParam("category") String category,
+ @ApiParam("Sub-category") @QueryParam("subCategory") String subCategory,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM)
+ String user);
+
+ @GET
+ @Path("/{vspId}")
+ @ApiOperation(value = "Get details of a vendor software product")
+ Response getVspDetails(@PathParam("vspId") String vspId,
+ @Pattern(regexp = Version.VERSION_REGEX,
+ message = Version.VERSION_STRING_VIOLATION_MSG) @QueryParam("version")
+ String version,
+ @NotNull(message = USER_MISSING_ERROR_MSG)
+ @HeaderParam(USER_HEADER_PARAM) String user);
+
+ @PUT
+ @Path("/{vspId}")
+ @ApiOperation(value = "Update an existing vendor software product")
+ Response updateVsp(@PathParam("vspId") String vspId, @Valid VspDescriptionDto vspDescriptionDto,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM)
+ String user);
+
+ @DELETE
+ @Path("/{vspId}")
+ @ApiOperation(value = "Deletes vendor software product by given id")
+ Response deleteVsp(@PathParam("vspId") String vspId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM)
+ String user);
+
+ @POST
+ @Path("{vspId}/upload")
+ @Consumes(MediaType.MULTIPART_FORM_DATA)
+ @ApiOperation(value = "Uploads a HEAT package to translate",
+ response = UploadFileResponseDto.class)
+ Response uploadFile(@PathParam("vspId") String vspId,
+ @Multipart("upload") InputStream heatFileToUpload,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM)
+ String user);
+
+ @GET
+ @Path("/{vspId}/downloadHeat")
+ @Produces(MediaType.APPLICATION_OCTET_STREAM)
+ @ApiOperation(value = "Get uploaded HEAT file",
+ notes = "Downloads the latest HEAT package",
+ response = File.class)
+ Response getLatestHeatPackage(@PathParam("vspId") String vspId,
+ /*@NotNull(message = USER_MISSING_ERROR_MSG)*/
+ @HeaderParam(USER_HEADER_PARAM) String user);
+
+
+ @PUT
+ @Path("/{vspId}/actions")
+ @ApiOperation(value = "Actions on a vendor software product",
+ notes = "Performs one of the following actions on a vendor software product: |"
+ + "Checkout: Locks it for edits by other users. Only the locking user sees the edited "
+ + "version.|"
+ + "Undo_Checkout: Unlocks it and deletes the edits that were done.|"
+ + "Checkin: Unlocks it and activates the edited version to all users.| "
+ + "Submit: Finalize its active version.|"
+ + "Create_Package: Creates a CSAR zip file.|")
+ /*@ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Action succeeded"),
+ @ApiResponse(code = 417, message = "Validation before submit has failed",
+ response = ValidationResponseDto.class)})*/
+ Response actOnVendorSoftwareProduct(@PathParam("vspId") String vspId,
+ VersionSoftwareProductActionRequestDto request,
+ @NotNull(message = USER_MISSING_ERROR_MSG)
+ @HeaderParam(USER_HEADER_PARAM) String user)
+ throws IOException;
+
+ @GET
+ @Path("/packages/{vspId}")
+ @Produces(MediaType.APPLICATION_OCTET_STREAM)
+ @ApiOperation(value = "Get translated CSAR file",
+ notes = "Exports translated file to a zip file",
+ response = File.class)
+ Response getTranslatedFile(@PathParam("vspId") String vspId,
+ @Pattern(regexp = Version.VERSION_REGEX,
+ message = Version.VERSION_STRING_VIOLATION_MSG)
+ @QueryParam("version") String version,
+ /*@NotNull(message = USER_MISSING_ERROR_MSG)*/
+ @HeaderParam(USER_HEADER_PARAM) String user);
+
+ @GET
+ @Path("/{vspId}/questionnaire")
+ @ApiOperation(value = "Get vendor software product questionnaire",
+ response = QuestionnaireResponseDto.class)
+ Response getQuestionnaire(@PathParam("vspId") String vspId,
+ @Pattern(regexp = Version.VERSION_REGEX,
+ message = Version.VERSION_STRING_VIOLATION_MSG)
+ @QueryParam("version") String version,
+ @NotNull(message = USER_MISSING_ERROR_MSG)
+ @HeaderParam(USER_HEADER_PARAM) String user);
+
+ @PUT
+ @Path("/{vspId}/questionnaire")
+ @ApiOperation(value = "Update vendor software product questionnaire")
+ Response updateQuestionnaire(@NotNull @IsValidJson String questionnaireData,
+ @PathParam("vspId") String vspId,
+ @NotNull(message = USER_MISSING_ERROR_MSG)
+ @HeaderParam(USER_HEADER_PARAM) String user);
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDataToComponentDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDataToComponentDto.java
new file mode 100644
index 0000000000..e448ed6ca7
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDataToComponentDto.java
@@ -0,0 +1,35 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vsp.rest.mapping;
+
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDto;
+
+public class MapComponentDataToComponentDto extends MappingBase<ComponentData, ComponentDto> {
+ @Override
+ public void doMapping(ComponentData source, ComponentDto target) {
+ target.setName(source.getName());
+ target.setDisplayName(
+ source.getDisplayName() == null ? source.getName() : source.getDisplayName());
+ target.setDescription(source.getDescription());
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentEntityToComponentDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentEntityToComponentDto.java
new file mode 100644
index 0000000000..8878581d1c
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentEntityToComponentDto.java
@@ -0,0 +1,37 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vsp.rest.mapping;
+
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDto;
+
+public class MapComponentEntityToComponentDto extends MappingBase<ComponentEntity, ComponentDto> {
+ @Override
+ public void doMapping(ComponentEntity source, ComponentDto target) {
+ target.setId(source.getId());
+ ComponentData component = source.getComponentCompositionData();
+ if (component != null) {
+ new MapComponentDataToComponentDto().doMapping(component, target);
+ }
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentRequestDtoToComponentEntity.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentRequestDtoToComponentEntity.java
new file mode 100644
index 0000000000..ce9e32770c
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentRequestDtoToComponentEntity.java
@@ -0,0 +1,38 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vsp.rest.mapping;
+
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentRequestDto;
+
+public class MapComponentRequestDtoToComponentEntity
+ extends MappingBase<ComponentRequestDto, ComponentEntity> {
+ @Override
+ public void doMapping(ComponentRequestDto source, ComponentEntity target) {
+ ComponentData component = new ComponentData();
+ component.setName(source.getName());
+ component.setDisplayName(source.getDisplayName());
+ component.setDescription(source.getDescription());
+ target.setComponentCompositionData(component);
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapCompositionEntityResponseToDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapCompositionEntityResponseToDto.java
new file mode 100644
index 0000000000..b5b7ccdfee
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapCompositionEntityResponseToDto.java
@@ -0,0 +1,47 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vsp.rest.mapping;
+
+import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityResponse;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionDataEntity;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionDataEntityDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityResponseDto;
+
+public class MapCompositionEntityResponseToDto<S extends CompositionDataEntity,
+ T extends CompositionDataEntityDto, M extends MappingBase<S, T>>
+ extends MappingBase<CompositionEntityResponse<S>, CompositionEntityResponseDto<T>> {
+ private M dataMapper;
+ private Class<T> targetDataClass;
+
+ public MapCompositionEntityResponseToDto(M dataMapper, Class<T> targetDataClass) {
+ this.dataMapper = dataMapper;
+ this.targetDataClass = targetDataClass;
+ }
+
+ @Override
+ public void doMapping(CompositionEntityResponse<S> source,
+ CompositionEntityResponseDto<T> target) {
+ target.setId(source.getId());
+ target.setSchema(source.getSchema());
+ target.setData(dataMapper.applyMapping(source.getData(), targetDataClass));
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapCompositionEntityValidationDataToDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapCompositionEntityValidationDataToDto.java
new file mode 100644
index 0000000000..cb726dfc79
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapCompositionEntityValidationDataToDto.java
@@ -0,0 +1,44 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vsp.rest.mapping;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityValidationData;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityValidationDataDto;
+
+import java.util.stream.Collectors;
+
+public class MapCompositionEntityValidationDataToDto
+ extends MappingBase<CompositionEntityValidationData, CompositionEntityValidationDataDto> {
+ @Override
+ public void doMapping(CompositionEntityValidationData source,
+ CompositionEntityValidationDataDto target) {
+ target.setEntityType(source.getEntityType());
+ target.setEntityId(source.getEntityId());
+ target.setErrors(source.getErrors());
+ if (CollectionUtils.isNotEmpty(source.getSubEntitiesValidationData())) {
+ target.setSubEntitiesValidationData(source.getSubEntitiesValidationData().stream()
+ .map(sub -> applyMapping(sub, CompositionEntityValidationDataDto.class))
+ .collect(Collectors.toList()));
+ }
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapMibUploadStatusToDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapMibUploadStatusToDto.java
new file mode 100644
index 0000000000..d69e078ac1
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapMibUploadStatusToDto.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vsp.rest.mapping;
+
+import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.MibUploadStatus;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.MibUploadStatusDto;
+
+public class MapMibUploadStatusToDto extends MappingBase<MibUploadStatus, MibUploadStatusDto> {
+ @Override
+ public void doMapping(MibUploadStatus source, MibUploadStatusDto target) {
+ target.setSnmpPoll(source.getSnmpPoll());
+ target.setSnmpTrap(source.getSnmpTrap());
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNetworkEntityToNetworkDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNetworkEntityToNetworkDto.java
new file mode 100644
index 0000000000..1d79f35769
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNetworkEntityToNetworkDto.java
@@ -0,0 +1,37 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vsp.rest.mapping;
+
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.NetworkDto;
+
+public class MapNetworkEntityToNetworkDto extends MappingBase<NetworkEntity, NetworkDto> {
+ @Override
+ public void doMapping(NetworkEntity source, NetworkDto target) {
+ target.setId(source.getId());
+ Network network = source.getNetworkCompositionData();
+ if (network != null) {
+ new MapNetworkToNetworkDto().doMapping(network, target);
+ }
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNetworkRequestDtoToNetworkEntity.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNetworkRequestDtoToNetworkEntity.java
new file mode 100644
index 0000000000..00395c4b99
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNetworkRequestDtoToNetworkEntity.java
@@ -0,0 +1,37 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vsp.rest.mapping;
+
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.NetworkRequestDto;
+
+public class MapNetworkRequestDtoToNetworkEntity
+ extends MappingBase<NetworkRequestDto, NetworkEntity> {
+ @Override
+ public void doMapping(NetworkRequestDto source, NetworkEntity target) {
+ Network network = new Network();
+ network.setName(source.getName());
+ network.setDhcp(source.isDhcp());
+ target.setNetworkCompositionData(network);
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNetworkToNetworkDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNetworkToNetworkDto.java
new file mode 100644
index 0000000000..dd819de1a6
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNetworkToNetworkDto.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vsp.rest.mapping;
+
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.NetworkDto;
+
+public class MapNetworkToNetworkDto extends MappingBase<Network, NetworkDto> {
+ @Override
+ public void doMapping(Network source, NetworkDto target) {
+ target.setName(source.getName());
+ target.setDhcp(source.isDhcp());
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicEntityToNicDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicEntityToNicDto.java
new file mode 100644
index 0000000000..2af7e2ff6b
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicEntityToNicDto.java
@@ -0,0 +1,37 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vsp.rest.mapping;
+
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.NicDto;
+
+public class MapNicEntityToNicDto extends MappingBase<NicEntity, NicDto> {
+ @Override
+ public void doMapping(NicEntity source, NicDto target) {
+ target.setId(source.getId());
+ Nic nic = source.getNicCompositionData();
+ if (nic != null) {
+ new MapNicToNicDto().doMapping(nic, target);
+ }
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicRequestDtoToNicEntity.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicRequestDtoToNicEntity.java
new file mode 100644
index 0000000000..4744364ea6
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicRequestDtoToNicEntity.java
@@ -0,0 +1,37 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vsp.rest.mapping;
+
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.NicRequestDto;
+
+public class MapNicRequestDtoToNicEntity extends MappingBase<NicRequestDto, NicEntity> {
+ @Override
+ public void doMapping(NicRequestDto source, NicEntity target) {
+ Nic nic = new Nic();
+ nic.setName(source.getName());
+ nic.setDescription(source.getDescription());
+ nic.setNetworkId(source.getNetworkId());
+ target.setNicCompositionData(nic);
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicToNicDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicToNicDto.java
new file mode 100644
index 0000000000..2fcfd36b3f
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicToNicDto.java
@@ -0,0 +1,35 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vsp.rest.mapping;
+
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.NicDto;
+
+public class MapNicToNicDto extends MappingBase<Nic, NicDto> {
+ @Override
+ public void doMapping(Nic source, NicDto target) {
+ target.setName(source.getName());
+ target.setDescription(source.getDescription());
+ target.setNetworkId(source.getNetworkId());
+ target.setNetworkName(source.getNetworkName());
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapPackageInfoToPackageInfoDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapPackageInfoToPackageInfoDto.java
new file mode 100644
index 0000000000..9cd365480e
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapPackageInfoToPackageInfoDto.java
@@ -0,0 +1,42 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vsp.rest.mapping;
+
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.PackageInfo;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.PackageInfoDto;
+
+public class MapPackageInfoToPackageInfoDto extends MappingBase<PackageInfo, PackageInfoDto> {
+ @Override
+ public void doMapping(PackageInfo source, PackageInfoDto target) {
+ target.setDisplayName(source.getDisplayName());
+ target.setVspName(source.getVspName());
+ target.setPackageId(source.getVspId());
+ target.setDescription(source.getVspDescription());
+ target.setVersion(source.getVersion() == null ? null : source.getVersion().toString());
+ target.setPackageType(source.getPackageType());
+ target.setCategory(source.getCategory());
+ target.setSubCategory(source.getSubCategory());
+ target.setPackageChecksum(source.getPackageChecksum());
+ target.setVendorRelease(source.getVendorRelease());
+ target.setVendorName(source.getVendorName());
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapProcessEntityToProcessEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapProcessEntityToProcessEntityDto.java
new file mode 100644
index 0000000000..5842a30b70
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapProcessEntityToProcessEntityDto.java
@@ -0,0 +1,36 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vsp.rest.mapping;
+
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ProcessEntityDto;
+
+public class MapProcessEntityToProcessEntityDto
+ extends MappingBase<ProcessEntity, ProcessEntityDto> {
+ @Override
+ public void doMapping(ProcessEntity source, ProcessEntityDto target) {
+ target.setId(source.getId());
+ target.setName(source.getName());
+ target.setDescription(source.getDescription());
+ target.setArtifactName(source.getArtifactName());
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapProcessRequestDtoToProcessEntity.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapProcessRequestDtoToProcessEntity.java
new file mode 100644
index 0000000000..1fd35d1960
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapProcessRequestDtoToProcessEntity.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vsp.rest.mapping;
+
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ProcessRequestDto;
+
+public class MapProcessRequestDtoToProcessEntity
+ extends MappingBase<ProcessRequestDto, ProcessEntity> {
+ @Override
+ public void doMapping(ProcessRequestDto source, ProcessEntity target) {
+ target.setName(source.getName());
+ target.setDescription(source.getDescription());
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapQuestionnaireResponseToQuestionnaireResponseDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapQuestionnaireResponseToQuestionnaireResponseDto.java
new file mode 100644
index 0000000000..23fdf385e4
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapQuestionnaireResponseToQuestionnaireResponseDto.java
@@ -0,0 +1,35 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vsp.rest.mapping;
+
+import org.openecomp.sdc.vendorsoftwareproduct.types.QuestionnaireResponse;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireResponseDto;
+
+public class MapQuestionnaireResponseToQuestionnaireResponseDto
+ extends MappingBase<QuestionnaireResponse, QuestionnaireResponseDto> {
+
+ @Override
+ public void doMapping(QuestionnaireResponse source, QuestionnaireResponseDto target) {
+ target.setData(source.getData());
+ target.setSchema(source.getSchema());
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapUploadFileResponseToUploadFileResponseDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapUploadFileResponseToUploadFileResponseDto.java
new file mode 100644
index 0000000000..29b6701413
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapUploadFileResponseToUploadFileResponseDto.java
@@ -0,0 +1,36 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vsp.rest.mapping;
+
+
+import org.openecomp.sdc.vendorsoftwareproduct.types.UploadFileResponse;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.UploadFileResponseDto;
+
+public class MapUploadFileResponseToUploadFileResponseDto
+ extends MappingBase<UploadFileResponse, UploadFileResponseDto> {
+ @Override
+ public void doMapping(UploadFileResponse source, UploadFileResponseDto target) {
+ target.setStatus(source.getStatus());
+ target.setErrors(source.getErrors());
+ target.setFileNames(source.getFileNames());
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapValidationResponseToDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapValidationResponseToDto.java
new file mode 100644
index 0000000000..68bc97d1a6
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapValidationResponseToDto.java
@@ -0,0 +1,90 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vsp.rest.mapping;
+
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.MapUtils;
+import org.openecomp.sdc.common.errors.ErrorCode;
+import org.openecomp.sdc.datatypes.error.ErrorMessage;
+import org.openecomp.sdc.vendorsoftwareproduct.types.QuestionnaireValidationResult;
+import org.openecomp.sdc.vendorsoftwareproduct.types.ValidationResponse;
+import org.openecomp.sdcrests.common.mapping.MapErrorCodeToDto;
+import org.openecomp.sdcrests.common.mapping.MapErrorMessageToDto;
+import org.openecomp.sdcrests.common.types.ErrorCodeDto;
+import org.openecomp.sdcrests.common.types.ErrorMessageDto;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityValidationDataDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireValidationResultDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ValidationResponseDto;
+
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+public class MapValidationResponseToDto
+ extends MappingBase<ValidationResponse, ValidationResponseDto> {
+ private static Map<String, List<ErrorMessageDto>> mapUploadDataErrors(
+ Map<String, List<ErrorMessage>> uploadDataErrors) {
+ if (MapUtils.isEmpty(uploadDataErrors)) {
+ return null;
+ }
+ return uploadDataErrors.entrySet().stream().collect(
+ Collectors.toMap(entry -> entry.getKey(), entry -> mapErrorMessages(entry.getValue())));
+ }
+
+ private static QuestionnaireValidationResultDto mapQuestionnaireValidationResult(
+ QuestionnaireValidationResult questionnaireValidationResult) {
+ if (questionnaireValidationResult == null) {
+ return null;
+ }
+ QuestionnaireValidationResultDto questionnaireValidationResultDto =
+ new QuestionnaireValidationResultDto();
+ questionnaireValidationResultDto.setValid(questionnaireValidationResult.isValid());
+ questionnaireValidationResultDto.setValidationData(new MapCompositionEntityValidationDataToDto()
+ .applyMapping(questionnaireValidationResult.getValidationData(),
+ CompositionEntityValidationDataDto.class));
+ return questionnaireValidationResultDto;
+ }
+
+ private static List<ErrorMessageDto> mapErrorMessages(List<ErrorMessage> errorMessages) {
+ return errorMessages == null ? null : errorMessages.stream().map(
+ errorMessage -> new MapErrorMessageToDto()
+ .applyMapping(errorMessage, ErrorMessageDto.class)).collect(Collectors.toList());
+ }
+
+ private static Collection<ErrorCodeDto> mapErrorCodes(Collection<ErrorCode> errorCodes) {
+ return CollectionUtils.isEmpty(errorCodes) ? null : errorCodes.stream()
+ .map(errorCode -> new MapErrorCodeToDto().applyMapping(errorCode, ErrorCodeDto.class))
+ .collect(Collectors.toList());
+ }
+
+ @Override
+ public void doMapping(ValidationResponse source, ValidationResponseDto target) {
+ target.setValid(source.isValid());
+ target.setVspErrors(mapErrorCodes(source.getVspErrors()));
+ target.setLicensingDataErrors(mapErrorCodes(source.getLicensingDataErrors()));
+ target.setUploadDataErrors(mapUploadDataErrors(source.getUploadDataErrors()));
+ target.setQuestionnaireValidationResult(
+ mapQuestionnaireValidationResult(source.getQuestionnaireValidationResult()));
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVersionedVendorSoftwareProductInfoToVspDetailsDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVersionedVendorSoftwareProductInfoToVspDetailsDto.java
new file mode 100644
index 0000000000..9f03f7ff0d
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVersionedVendorSoftwareProductInfoToVspDetailsDto.java
@@ -0,0 +1,74 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vsp.rest.mapping;
+
+import org.openecomp.core.utilities.CommonMethods;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
+import org.openecomp.sdc.vendorsoftwareproduct.types.LicensingData;
+import org.openecomp.sdc.vendorsoftwareproduct.types.VersionedVendorSoftwareProductInfo;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspDetailsDto;
+
+import java.util.stream.Collectors;
+
+public class MapVersionedVendorSoftwareProductInfoToVspDetailsDto
+ extends MappingBase<VersionedVendorSoftwareProductInfo, VspDetailsDto> {
+
+ @Override
+ public void doMapping(VersionedVendorSoftwareProductInfo source, VspDetailsDto target) {
+ VspDetails vsp = source.getVspDetails();
+
+ target.setId(vsp.getId());
+ target.setVersion(vsp.getVersion().toString());
+ target.setName(vsp.getName());
+ target.setDescription(vsp.getDescription());
+ target.setCategory(vsp.getCategory());
+ target.setSubCategory(vsp.getSubCategory());
+ target.setVendorId(vsp.getVendorId());
+ target.setVendorName(vsp.getVendorName());
+ target.setLicensingVersion(vsp.getVlmVersion() == null ? null : vsp.getVlmVersion().toString());
+
+ if (vsp.getLicenseAgreement() != null || vsp.getFeatureGroups() != null) {
+ LicensingData licensingData = new LicensingData();
+ licensingData.setLicenseAgreement(vsp.getLicenseAgreement());
+ licensingData.setFeatureGroups(vsp.getFeatureGroups());
+ target.setLicensingData(licensingData);
+ }
+
+ target.setValidationData(vsp.getValidationDataStructure());
+
+ target.setStatus(source.getVersionInfo().getStatus());
+ target.setLockingUser(source.getVersionInfo().getLockingUser());
+
+ if (!CommonMethods.isEmpty(source.getVersionInfo().getViewableVersions())) {
+ target.setViewableVersions(
+ source.getVersionInfo().getViewableVersions().stream().map(Version::toString)
+ .collect(Collectors.toList()));
+ }
+
+ if (!CommonMethods.isEmpty(source.getVersionInfo().getFinalVersions())) {
+ target.setFinalVersions(
+ source.getVersionInfo().getFinalVersions().stream().map(Version::toString)
+ .collect(Collectors.toList()));
+ }
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDescriptionDtoToVspDetails.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDescriptionDtoToVspDetails.java
new file mode 100644
index 0000000000..77093fe682
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDescriptionDtoToVspDetails.java
@@ -0,0 +1,56 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vsp.rest.mapping;
+
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
+import org.openecomp.sdc.vendorsoftwareproduct.types.LicensingData;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspDescriptionDto;
+
+import java.util.regex.Pattern;
+
+public class MapVspDescriptionDtoToVspDetails extends MappingBase<VspDescriptionDto, VspDetails> {
+
+ @Override
+ public void doMapping(VspDescriptionDto source, VspDetails target) {
+ target.setName(source.getName());
+ target.setDescription(source.getDescription());
+ target.setCategory(source.getCategory());
+ target.setSubCategory(source.getSubCategory());
+ target.setIcon(source.getIcon());
+ target.setVendorName(source.getVendorName());
+ target.setVendorId(source.getVendorId());
+
+ String vlmVersion = source.getLicensingVersion();
+ if (vlmVersion != null) {
+ target.setVlmVersion(
+ Pattern.compile(Version.VERSION_REGEX).matcher(vlmVersion).find() ? Version
+ .valueOf(vlmVersion) : null);
+ }
+
+ LicensingData licensingData = source.getLicensingData();
+ if (licensingData != null) {
+ target.setLicenseAgreement(licensingData.getLicenseAgreement());
+ target.setFeatureGroups(licensingData.getFeatureGroups());
+ }
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MspVspDetailsToVspCreationDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MspVspDetailsToVspCreationDto.java
new file mode 100644
index 0000000000..a2de1741a3
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MspVspDetailsToVspCreationDto.java
@@ -0,0 +1,32 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vsp.rest.mapping;
+
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspCreationDto;
+
+public class MspVspDetailsToVspCreationDto extends MappingBase<VspDetails, VspCreationDto> {
+ @Override
+ public void doMapping(VspDetails source, VspCreationDto target) {
+ target.setVspId(source.getId());
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentProcessesImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentProcessesImpl.java
new file mode 100644
index 0000000000..2b16fea6c0
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentProcessesImpl.java
@@ -0,0 +1,144 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vsp.rest.services;
+
+import org.apache.cxf.jaxrs.ext.multipart.Attachment;
+import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductManager;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ProcessEntityDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ProcessRequestDto;
+import org.openecomp.sdcrests.vsp.rest.ComponentProcesses;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapProcessEntityToProcessEntityDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapProcessRequestDtoToProcessEntity;
+import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper;
+import org.openecomp.sdcrests.wrappers.StringWrapperResponse;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Service;
+
+import java.io.File;
+import java.io.InputStream;
+import java.util.Collection;
+import javax.inject.Named;
+import javax.ws.rs.core.Response;
+
+
+@Named
+@Service("componentProcesses")
+@Scope(value = "prototype")
+public class ComponentProcessesImpl implements ComponentProcesses {
+ @Autowired
+ private VendorSoftwareProductManager vendorSoftwareProductManager;
+
+ @Override
+ public Response list(String vspId, String componentId, String version, String user) {
+ Collection<ProcessEntity> processes = vendorSoftwareProductManager
+ .listProcesses(vspId, Version.valueOf(version), componentId, user);
+
+ MapProcessEntityToProcessEntityDto mapper = new MapProcessEntityToProcessEntityDto();
+ GenericCollectionWrapper<ProcessEntityDto> results = new GenericCollectionWrapper<>();
+ for (ProcessEntity process : processes) {
+ results.add(mapper.applyMapping(process, ProcessEntityDto.class));
+ }
+
+ return Response.ok(results).build();
+ }
+
+ @Override
+ public Response deleteList(String vspId, String componentId, String user) {
+ vendorSoftwareProductManager.deleteProcesses(vspId, componentId, user);
+ return Response.ok().build();
+ }
+
+ @Override
+ public Response create(ProcessRequestDto request, String vspId, String componentId, String user) {
+ ProcessEntity process =
+ new MapProcessRequestDtoToProcessEntity().applyMapping(request, ProcessEntity.class);
+ process.setVspId(vspId);
+ process.setComponentId(componentId);
+
+ ProcessEntity createdProcess = vendorSoftwareProductManager.createProcess(process, user);
+ return Response
+ .ok(createdProcess != null ? new StringWrapperResponse(createdProcess.getId()) : null)
+ .build();
+ }
+
+ @Override
+ public Response get(String vspId, String componentId, String processId, String version,
+ String user) {
+ ProcessEntity process = vendorSoftwareProductManager
+ .getProcess(vspId, Version.valueOf(version), componentId, processId, user);
+ ProcessEntityDto result =
+ new MapProcessEntityToProcessEntityDto().applyMapping(process, ProcessEntityDto.class);
+ return Response.ok(result).build();
+ }
+
+ @Override
+ public Response delete(String vspId, String componentId, String processId, String user) {
+ vendorSoftwareProductManager.deleteProcess(vspId, componentId, processId, user);
+ return Response.ok().build();
+ }
+
+ @Override
+ public Response update(ProcessRequestDto request, String vspId, String componentId,
+ String processId, String user) {
+ ProcessEntity processEntity =
+ new MapProcessRequestDtoToProcessEntity().applyMapping(request, ProcessEntity.class);
+ processEntity.setVspId(vspId);
+ processEntity.setComponentId(componentId);
+ processEntity.setId(processId);
+
+ vendorSoftwareProductManager.updateProcess(processEntity, user);
+ return Response.ok().build();
+ }
+
+ @Override
+ public Response getUploadedFile(String vspId, String componentId, String processId,
+ String version, String user) {
+ File file = vendorSoftwareProductManager
+ .getProcessArtifact(vspId, Version.valueOf(version), componentId, processId, user);
+
+ Response.ResponseBuilder response = Response.ok(file);
+ if (file == null) {
+ return Response.status(Response.Status.NOT_FOUND).build();
+ }
+ response.header("Content-Disposition", "attachment; filename=" + file.getName());
+ return response.build();
+ }
+
+ @Override
+ public Response deleteUploadedFile(String vspId, String componentId, String processId,
+ String user) {
+ vendorSoftwareProductManager.deleteProcessArtifact(vspId, componentId, processId, user);
+ return Response.ok().build();
+ }
+
+ @Override
+ public Response uploadFile(Attachment attachment, String vspId, String componentId,
+ String processId, String user) {
+ vendorSoftwareProductManager.uploadProcessArtifact(attachment.getObject(InputStream.class),
+ attachment.getContentDisposition().getParameter("filename"), vspId, componentId, processId,
+ user);
+ return Response.ok().build();
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentUploadsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentUploadsImpl.java
new file mode 100644
index 0000000000..3cd384d7e7
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentUploadsImpl.java
@@ -0,0 +1,87 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vsp.rest.services;
+
+import org.apache.cxf.jaxrs.ext.multipart.Attachment;
+import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductManager;
+import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.MibUploadStatus;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.MibUploadStatusDto;
+import org.openecomp.sdcrests.vsp.rest.ComponentUploads;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapMibUploadStatusToDto;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Service;
+import org.springframework.validation.annotation.Validated;
+
+import java.io.InputStream;
+import javax.inject.Named;
+import javax.ws.rs.core.Response;
+
+@Named
+@Service("componentUploads")
+@Scope(value = "prototype")
+@Validated
+public class ComponentUploadsImpl implements ComponentUploads {
+ @Autowired
+ private VendorSoftwareProductManager vendorSoftwareProductManager;
+
+ @Override
+ public Response uploadTrapMibFile(Attachment attachment, String vspId, String componentId,
+ String user) {
+ vendorSoftwareProductManager.uploadComponentMib(attachment.getObject(InputStream.class),
+ attachment.getContentDisposition().getParameter("filename"), vspId, componentId, true,
+ user);
+ return Response.ok().build();
+ }
+
+ @Override
+ public Response deleteTrapMibFile(String vspId, String componentId, String user) {
+ vendorSoftwareProductManager.deleteComponentMib(vspId, componentId, true, user);
+ return Response.ok().build();
+ }
+
+ @Override
+ public Response uploadPollMibFile(Attachment attachment, String vspId, String componentId,
+ String user) {
+ vendorSoftwareProductManager.uploadComponentMib(attachment.getObject(InputStream.class),
+ attachment.getContentDisposition().getParameter("filename"), vspId, componentId, false,
+ user);
+ return Response.ok().build();
+ }
+
+ @Override
+ public Response deletePollMibFile(String vspId, String componentId, String user) {
+ vendorSoftwareProductManager.deleteComponentMib(vspId, componentId, false, user);
+ return Response.ok().build();
+ }
+
+ @Override
+ public Response list(String vspId, String componentId, String user) {
+ MibUploadStatus response =
+ vendorSoftwareProductManager.listMibFilenames(vspId, componentId, user);
+
+ MibUploadStatusDto returnEntity =
+ new MapMibUploadStatusToDto().applyMapping(response, MibUploadStatusDto.class);
+ return Response.status(Response.Status.OK).entity(returnEntity).build();
+
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentsImpl.java
new file mode 100644
index 0000000000..cba9abbdbc
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentsImpl.java
@@ -0,0 +1,145 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vsp.rest.services;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductManager;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityResponse;
+import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityValidationData;
+import org.openecomp.sdc.vendorsoftwareproduct.types.QuestionnaireResponse;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentRequestDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityResponseDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityValidationDataDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireResponseDto;
+import org.openecomp.sdcrests.vsp.rest.Components;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapComponentDataToComponentDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapComponentEntityToComponentDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapComponentRequestDtoToComponentEntity;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapCompositionEntityResponseToDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapCompositionEntityValidationDataToDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapQuestionnaireResponseToQuestionnaireResponseDto;
+import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper;
+import org.openecomp.sdcrests.wrappers.StringWrapperResponse;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Service;
+
+import java.util.Collection;
+import javax.inject.Named;
+import javax.ws.rs.core.Response;
+
+
+@Named
+@Service("components")
+@Scope(value = "prototype")
+public class ComponentsImpl implements Components {
+ @Autowired
+ private VendorSoftwareProductManager vendorSoftwareProductManager;
+
+ @Override
+ public Response list(String vspId, String version, String user) {
+ Collection<ComponentEntity> components =
+ vendorSoftwareProductManager.listComponents(vspId, Version.valueOf(version), user);
+
+ MapComponentEntityToComponentDto mapper = new MapComponentEntityToComponentDto();
+ GenericCollectionWrapper<ComponentDto> results = new GenericCollectionWrapper<>();
+ for (ComponentEntity component : components) {
+ results.add(mapper.applyMapping(component, ComponentDto.class));
+ }
+
+ return Response.ok(results).build();
+ }
+
+ @Override
+ public Response deleteList(String vspId, String user) {
+ vendorSoftwareProductManager.deleteComponents(vspId, user);
+ return Response.ok().build();
+ }
+
+ @Override
+ public Response create(ComponentRequestDto request, String vspId, String user) {
+ ComponentEntity component =
+ new MapComponentRequestDtoToComponentEntity().applyMapping(request, ComponentEntity.class);
+ component.setVspId(vspId);
+ ComponentEntity createdComponent =
+ vendorSoftwareProductManager.createComponent(component, user);
+ return Response
+ .ok(createdComponent != null ? new StringWrapperResponse(createdComponent.getId()) : null)
+ .build();
+ }
+
+ @Override
+ public Response get(String vspId, String componentId, String version, String user) {
+ CompositionEntityResponse<ComponentData> response = vendorSoftwareProductManager
+ .getComponent(vspId, Version.valueOf(version), componentId, user);
+
+ CompositionEntityResponseDto<ComponentDto> responseDto = new CompositionEntityResponseDto<>();
+ new MapCompositionEntityResponseToDto<>(new MapComponentDataToComponentDto(),
+ ComponentDto.class).doMapping(response, responseDto);
+ return Response.ok(responseDto).build();
+ }
+
+ @Override
+ public Response delete(String vspId, String componentId, String user) {
+ vendorSoftwareProductManager.deleteComponent(vspId, componentId, user);
+ return Response.ok().build();
+ }
+
+ @Override
+ public Response update(ComponentRequestDto request, String vspId, String componentId,
+ String user) {
+ ComponentEntity componentEntity =
+ new MapComponentRequestDtoToComponentEntity().applyMapping(request, ComponentEntity.class);
+ componentEntity.setVspId(vspId);
+ componentEntity.setId(componentId);
+
+ CompositionEntityValidationData validationData =
+ vendorSoftwareProductManager.updateComponent(componentEntity, user);
+ return validationData != null && CollectionUtils.isNotEmpty(validationData.getErrors())
+ ? Response.status(Response.Status.EXPECTATION_FAILED).entity(
+ new MapCompositionEntityValidationDataToDto()
+ .applyMapping(validationData, CompositionEntityValidationDataDto.class)).build() :
+ Response.ok().build();
+ }
+
+ @Override
+ public Response getQuestionnaire(String vspId, String componentId, String version, String user) {
+ QuestionnaireResponse questionnaireResponse = vendorSoftwareProductManager
+ .getComponentQuestionnaire(vspId, Version.valueOf(version), componentId, user);
+
+ QuestionnaireResponseDto result = new MapQuestionnaireResponseToQuestionnaireResponseDto()
+ .applyMapping(questionnaireResponse, QuestionnaireResponseDto.class);
+ return Response.ok(result).build();
+ }
+
+ @Override
+ public Response updateQuestionnaire(String questionnaireData, String vspId, String componentId,
+ String user) {
+ vendorSoftwareProductManager
+ .updateComponentQuestionnaire(vspId, componentId, questionnaireData, user);
+ return Response.ok().build();
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/NetworksImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/NetworksImpl.java
new file mode 100644
index 0000000000..afc25ab4b0
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/NetworksImpl.java
@@ -0,0 +1,115 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vsp.rest.services;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductManager;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityResponse;
+import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityValidationData;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityResponseDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityValidationDataDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.NetworkDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.NetworkRequestDto;
+import org.openecomp.sdcrests.vsp.rest.Networks;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapCompositionEntityResponseToDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapCompositionEntityValidationDataToDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapNetworkEntityToNetworkDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapNetworkRequestDtoToNetworkEntity;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapNetworkToNetworkDto;
+import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper;
+import org.openecomp.sdcrests.wrappers.StringWrapperResponse;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Service;
+
+import java.util.Collection;
+import javax.inject.Named;
+import javax.ws.rs.core.Response;
+
+
+@Named
+@Service("networks")
+@Scope(value = "prototype")
+public class NetworksImpl implements Networks {
+ @Autowired
+ private VendorSoftwareProductManager vendorSoftwareProductManager;
+
+ @Override
+ public Response list(String vspId, String version, String user) {
+ Collection<NetworkEntity> networks =
+ vendorSoftwareProductManager.listNetworks(vspId, Version.valueOf(version), user);
+
+ MapNetworkEntityToNetworkDto mapper = new MapNetworkEntityToNetworkDto();
+ GenericCollectionWrapper<NetworkDto> results = new GenericCollectionWrapper<>();
+ for (NetworkEntity network : networks) {
+ results.add(mapper.applyMapping(network, NetworkDto.class));
+ }
+
+ return Response.ok(results).build();
+ }
+
+ @Override
+ public Response create(NetworkRequestDto request, String vspId, String user) {
+ NetworkEntity network =
+ new MapNetworkRequestDtoToNetworkEntity().applyMapping(request, NetworkEntity.class);
+ network.setVspId(vspId);
+ NetworkEntity createdNetwork = vendorSoftwareProductManager.createNetwork(network, user);
+ return Response
+ .ok(createdNetwork != null ? new StringWrapperResponse(createdNetwork.getId()) : null)
+ .build();
+ }
+
+ @Override
+ public Response get(String vspId, String networkId, String version, String user) {
+ CompositionEntityResponse<Network> response =
+ vendorSoftwareProductManager.getNetwork(vspId, Version.valueOf(version), networkId, user);
+
+ CompositionEntityResponseDto<NetworkDto> responseDto = new CompositionEntityResponseDto<>();
+ new MapCompositionEntityResponseToDto<>(new MapNetworkToNetworkDto(), NetworkDto.class)
+ .doMapping(response, responseDto);
+ return Response.ok(responseDto).build();
+ }
+
+ @Override
+ public Response delete(String vspId, String networkId, String user) {
+ vendorSoftwareProductManager.deleteNetwork(vspId, networkId, user);
+ return Response.ok().build();
+ }
+
+ @Override
+ public Response update(NetworkRequestDto request, String vspId, String networkId, String user) {
+ NetworkEntity networkEntity =
+ new MapNetworkRequestDtoToNetworkEntity().applyMapping(request, NetworkEntity.class);
+ networkEntity.setVspId(vspId);
+ networkEntity.setId(networkId);
+
+ CompositionEntityValidationData validationData =
+ vendorSoftwareProductManager.updateNetwork(networkEntity, user);
+ return validationData != null && CollectionUtils.isNotEmpty(validationData.getErrors())
+ ? Response.status(Response.Status.EXPECTATION_FAILED).entity(
+ new MapCompositionEntityValidationDataToDto()
+ .applyMapping(validationData, CompositionEntityValidationDataDto.class)).build() :
+ Response.ok().build();
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/NicsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/NicsImpl.java
new file mode 100644
index 0000000000..ce601ec999
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/NicsImpl.java
@@ -0,0 +1,140 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vsp.rest.services;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductManager;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityResponse;
+import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityValidationData;
+import org.openecomp.sdc.vendorsoftwareproduct.types.QuestionnaireResponse;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityResponseDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityValidationDataDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.NicDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.NicRequestDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireResponseDto;
+import org.openecomp.sdcrests.vsp.rest.Nics;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapCompositionEntityResponseToDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapCompositionEntityValidationDataToDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapNicEntityToNicDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapNicRequestDtoToNicEntity;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapNicToNicDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapQuestionnaireResponseToQuestionnaireResponseDto;
+import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper;
+import org.openecomp.sdcrests.wrappers.StringWrapperResponse;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Service;
+
+import java.util.Collection;
+import javax.inject.Named;
+import javax.ws.rs.core.Response;
+
+
+@Named
+@Service("nics")
+@Scope(value = "prototype")
+public class NicsImpl implements Nics {
+ @Autowired
+ private VendorSoftwareProductManager vendorSoftwareProductManager;
+
+ @Override
+ public Response list(String vspId, String componentId, String version, String user) {
+ Collection<NicEntity> nics =
+ vendorSoftwareProductManager.listNics(vspId, Version.valueOf(version), componentId, user);
+
+ MapNicEntityToNicDto mapper = new MapNicEntityToNicDto();
+ GenericCollectionWrapper<NicDto> results = new GenericCollectionWrapper<>();
+ for (NicEntity nic : nics) {
+ results.add(mapper.applyMapping(nic, NicDto.class));
+ }
+
+ return Response.ok(results).build();
+ }
+
+ @Override
+ public Response create(NicRequestDto request, String vspId, String componentId, String user) {
+ NicEntity nic = new MapNicRequestDtoToNicEntity().applyMapping(request, NicEntity.class);
+ nic.setVspId(vspId);
+ nic.setComponentId(componentId);
+
+ NicEntity createdNic = vendorSoftwareProductManager.createNic(nic, user);
+ return Response.ok(createdNic != null ? new StringWrapperResponse(createdNic.getId()) : null)
+ .build();
+ }
+
+ @Override
+ public Response get(String vspId, String componentId, String nicId, String version, String user) {
+ CompositionEntityResponse<Nic> response = vendorSoftwareProductManager
+ .getNic(vspId, Version.valueOf(version), componentId, nicId, user);
+
+ CompositionEntityResponseDto<NicDto> responseDto = new CompositionEntityResponseDto<>();
+ new MapCompositionEntityResponseToDto<>(new MapNicToNicDto(), NicDto.class)
+ .doMapping(response, responseDto);
+ return Response.ok(responseDto).build();
+ }
+
+ @Override
+ public Response delete(String vspId, String componentId, String nicId, String user) {
+ vendorSoftwareProductManager.deleteNic(vspId, componentId, nicId, user);
+ return Response.ok().build();
+ }
+
+ @Override
+ public Response update(NicRequestDto request, String vspId, String componentId, String nicId,
+ String user) {
+ NicEntity nicEntity = new MapNicRequestDtoToNicEntity().applyMapping(request, NicEntity.class);
+ nicEntity.setVspId(vspId);
+ nicEntity.setComponentId(componentId);
+ nicEntity.setId(nicId);
+
+ CompositionEntityValidationData validationData =
+ vendorSoftwareProductManager.updateNic(nicEntity, user);
+ return validationData != null && CollectionUtils.isNotEmpty(validationData.getErrors())
+ ? Response.status(Response.Status.EXPECTATION_FAILED).entity(
+ new MapCompositionEntityValidationDataToDto()
+ .applyMapping(validationData, CompositionEntityValidationDataDto.class)).build() :
+ Response.ok().build();
+ }
+
+ @Override
+ public Response getQuestionnaire(String vspId, String componentId, String nicId, String version,
+ String user) {
+ QuestionnaireResponse questionnaireResponse = vendorSoftwareProductManager
+ .getNicQuestionnaire(vspId, Version.valueOf(version), componentId, nicId, user);
+
+ QuestionnaireResponseDto result = new MapQuestionnaireResponseToQuestionnaireResponseDto()
+ .applyMapping(questionnaireResponse, QuestionnaireResponseDto.class);
+ return Response.ok(result).build();
+ }
+
+ @Override
+ public Response updateQuestionnaire(String questionnaireData, String vspId, String componentId,
+ String nicId, String user) {
+ vendorSoftwareProductManager
+ .updateNicQuestionnaire(vspId, componentId, nicId, questionnaireData, user);
+ return Response.ok().build();
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ProcessesImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ProcessesImpl.java
new file mode 100644
index 0000000000..004d84591a
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ProcessesImpl.java
@@ -0,0 +1,89 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vsp.rest.services;
+
+import static org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants.GENERAL_COMPONENT_ID;
+
+import org.apache.cxf.jaxrs.ext.multipart.Attachment;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ProcessRequestDto;
+import org.openecomp.sdcrests.vsp.rest.ComponentProcesses;
+import org.openecomp.sdcrests.vsp.rest.Processes;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Service;
+
+import javax.inject.Named;
+import javax.ws.rs.core.Response;
+
+@Named
+@Service("processes")
+@Scope(value = "prototype")
+public class ProcessesImpl implements Processes {
+
+ @Autowired
+ private ComponentProcesses componentProcesses;
+
+ @Override
+ public Response list(String vspId, String version, String user) {
+ return componentProcesses.list(vspId, GENERAL_COMPONENT_ID, version, user);
+ }
+
+ @Override
+ public Response deleteList(String vspId, String user) {
+ return componentProcesses.deleteList(vspId, GENERAL_COMPONENT_ID, user);
+ }
+
+ @Override
+ public Response create(ProcessRequestDto request, String vspId, String user) {
+ return componentProcesses.create(request, vspId, GENERAL_COMPONENT_ID, user);
+ }
+
+ @Override
+ public Response get(String vspId, String processId, String version, String user) {
+ return componentProcesses.get(vspId, GENERAL_COMPONENT_ID, processId, version, user);
+ }
+
+ @Override
+ public Response delete(String vspId, String processId, String user) {
+ return componentProcesses.delete(vspId, GENERAL_COMPONENT_ID, processId, user);
+ }
+
+ @Override
+ public Response update(ProcessRequestDto request, String vspId, String processId, String user) {
+ return componentProcesses.update(request, vspId, GENERAL_COMPONENT_ID, processId, user);
+ }
+
+ @Override
+ public Response getUploadedFile(String vspId, String processId, String version, String user) {
+ return componentProcesses
+ .getUploadedFile(vspId, GENERAL_COMPONENT_ID, processId, version, user);
+ }
+
+ @Override
+ public Response deleteUploadedFile(String vspId, String processId, String user) {
+ return componentProcesses.deleteUploadedFile(vspId, GENERAL_COMPONENT_ID, processId, user);
+ }
+
+ @Override
+ public Response uploadFile(Attachment attachment, String vspId, String processId, String user) {
+ return componentProcesses.uploadFile(attachment, vspId, GENERAL_COMPONENT_ID, processId, user);
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VendorSoftwareProductsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VendorSoftwareProductsImpl.java
new file mode 100644
index 0000000000..1c13f172f1
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VendorSoftwareProductsImpl.java
@@ -0,0 +1,228 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vsp.rest.services;
+
+import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductManager;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.PackageInfo;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
+import org.openecomp.sdc.vendorsoftwareproduct.types.QuestionnaireResponse;
+import org.openecomp.sdc.vendorsoftwareproduct.types.UploadFileResponse;
+import org.openecomp.sdc.vendorsoftwareproduct.types.ValidationResponse;
+import org.openecomp.sdc.vendorsoftwareproduct.types.VersionedVendorSoftwareProductInfo;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.PackageInfoDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireResponseDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.UploadFileResponseDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ValidationResponseDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.VersionSoftwareProductActionRequestDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspCreationDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspDescriptionDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspDetailsDto;
+import org.openecomp.sdcrests.vsp.rest.VendorSoftwareProducts;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapPackageInfoToPackageInfoDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapQuestionnaireResponseToQuestionnaireResponseDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapUploadFileResponseToUploadFileResponseDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapValidationResponseToDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapVersionedVendorSoftwareProductInfoToVspDetailsDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapVspDescriptionDtoToVspDetails;
+import org.openecomp.sdcrests.vsp.rest.mapping.MspVspDetailsToVspCreationDto;
+import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Service;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+import javax.inject.Named;
+import javax.ws.rs.core.Response;
+
+@Named
+@Service("vendorSoftwareProducts")
+@Scope(value = "prototype")
+public class VendorSoftwareProductsImpl implements VendorSoftwareProducts {
+
+ @Autowired
+ private VendorSoftwareProductManager vendorSoftwareProductManager;
+
+ @Override
+ public Response createNewVsp(VspDescriptionDto vspDescriptionDto, String user) {
+ VspDetails vspDetails =
+ new MapVspDescriptionDtoToVspDetails().applyMapping(vspDescriptionDto, VspDetails.class);
+
+ vspDetails = vendorSoftwareProductManager.createNewVsp(vspDetails, user);
+
+ MspVspDetailsToVspCreationDto mapping = new MspVspDetailsToVspCreationDto();
+ VspCreationDto vspCreationDto = mapping.applyMapping(vspDetails, VspCreationDto.class);
+
+ return Response.ok(vspCreationDto).build();
+ }
+
+ @Override
+ public Response getVspList(String versionFilter, String user) {
+ List<VersionedVendorSoftwareProductInfo> vspList =
+ vendorSoftwareProductManager.getVspList(versionFilter, user);
+
+ GenericCollectionWrapper<VspDetailsDto> results = new GenericCollectionWrapper<>();
+ if (!vspList.isEmpty()) {
+ MapVersionedVendorSoftwareProductInfoToVspDetailsDto mapper =
+ new MapVersionedVendorSoftwareProductInfoToVspDetailsDto();
+ for (VersionedVendorSoftwareProductInfo versionedVsp : vspList) {
+ results.add(mapper.applyMapping(versionedVsp, VspDetailsDto.class));
+ }
+ }
+
+ return Response.ok(results).build();
+ }
+
+ @Override
+ public Response getVspDetails(String vspId, String version, String user) {
+ VersionedVendorSoftwareProductInfo vspDetails =
+ vendorSoftwareProductManager.getVspDetails(vspId, Version.valueOf(version), user);
+
+ VspDetailsDto vspDetailsDto = vspDetails == null ? null
+ : new MapVersionedVendorSoftwareProductInfoToVspDetailsDto()
+ .applyMapping(vspDetails, VspDetailsDto.class);
+
+ return Response.ok(vspDetailsDto).build();
+ }
+
+ @Override
+ public Response updateVsp(String vspId, VspDescriptionDto vspDescriptionDto, String user) {
+ VspDetails vspDetails =
+ new MapVspDescriptionDtoToVspDetails().applyMapping(vspDescriptionDto, VspDetails.class);
+ vspDetails.setId(vspId);
+
+ vendorSoftwareProductManager.updateVsp(vspDetails, user);
+
+ return Response.ok().build();
+ }
+
+ @Override
+ public Response deleteVsp(String vspId, String user) {
+ vendorSoftwareProductManager.deleteVsp(vspId, user);
+
+ return Response.ok().build();
+ }
+
+ @Override
+ public Response actOnVendorSoftwareProduct(String vspId,
+ VersionSoftwareProductActionRequestDto request,
+ String user) throws IOException {
+ switch (request.getAction()) {
+ case Checkout:
+ vendorSoftwareProductManager.checkout(vspId, user);
+ break;
+ case Undo_Checkout:
+ vendorSoftwareProductManager.undoCheckout(vspId, user);
+ break;
+ case Checkin:
+ vendorSoftwareProductManager.checkin(vspId, user);
+ break;
+ case Submit:
+ ValidationResponse validationResponse = vendorSoftwareProductManager.submit(vspId, user);
+ if (!validationResponse.isValid()) {
+ return Response.status(Response.Status.EXPECTATION_FAILED).entity(
+ new MapValidationResponseToDto()
+ .applyMapping(validationResponse, ValidationResponseDto.class)).build();
+ }
+ break;
+ case Create_Package:
+ PackageInfo packageInfo = vendorSoftwareProductManager.createPackage(vspId, user);
+ return Response.ok(packageInfo == null ? null
+ : new MapPackageInfoToPackageInfoDto().applyMapping(packageInfo, PackageInfoDto.class))
+ .build();
+ default:
+ }
+
+ return Response.ok().build();
+ }
+
+ @Override
+ public Response uploadFile(String uploadVspId, InputStream heatFileToUpload, String user) {
+ UploadFileResponse uploadFileResponse =
+ vendorSoftwareProductManager.uploadFile(uploadVspId, heatFileToUpload, user);
+
+ UploadFileResponseDto uploadFileResponseDto = new MapUploadFileResponseToUploadFileResponseDto()
+ .applyMapping(uploadFileResponse, UploadFileResponseDto.class);
+
+ return Response.ok(uploadFileResponseDto).build();
+ }
+
+ @Override
+ public Response getLatestHeatPackage(String vspId, String user) {
+ File zipFile = vendorSoftwareProductManager.getLatestHeatPackage(vspId, user);
+
+ if (zipFile == null) {
+ return Response.status(Response.Status.NOT_FOUND).build();
+ }
+ Response.ResponseBuilder response = Response.ok(zipFile);
+ response.header("Content-Disposition", "attachment; filename=" + zipFile.getName());
+ return response.build();
+ }
+
+ @Override
+ public Response listPackages(String category, String subCategory, String user) {
+ List<PackageInfo> packageInfoList =
+ vendorSoftwareProductManager.listPackages(category, subCategory);
+
+ GenericCollectionWrapper<PackageInfoDto> results = new GenericCollectionWrapper<>();
+ MapPackageInfoToPackageInfoDto mapper = new MapPackageInfoToPackageInfoDto();
+
+ if (packageInfoList != null) {
+ for (PackageInfo packageInfo : packageInfoList) {
+ results.add(mapper.applyMapping(packageInfo, PackageInfoDto.class));
+ }
+ }
+ return Response.ok(results).build();
+ }
+
+ @Override
+ public Response getTranslatedFile(String vspId, String version, String user) {
+ File zipFile =
+ vendorSoftwareProductManager.getTranslatedFile(vspId, Version.valueOf(version), user);
+
+ Response.ResponseBuilder response = Response.ok(zipFile);
+ if (zipFile == null) {
+ return Response.status(Response.Status.NOT_FOUND).build();
+ }
+ response.header("Content-Disposition", "attachment; filename=" + zipFile.getName());
+ return response.build();
+ }
+
+ @Override
+ public Response getQuestionnaire(String vspId, String version, String user) {
+ QuestionnaireResponse questionnaireResponse =
+ vendorSoftwareProductManager.getVspQuestionnaire(vspId, Version.valueOf(version), user);
+
+ QuestionnaireResponseDto result = new MapQuestionnaireResponseToQuestionnaireResponseDto()
+ .applyMapping(questionnaireResponse, QuestionnaireResponseDto.class);
+ return Response.ok(result).build();
+ }
+
+ @Override
+ public Response updateQuestionnaire(String questionnaireData, String vspId, String user) {
+ vendorSoftwareProductManager.updateVspQuestionnaire(vspId, questionnaireData, user);
+ return Response.ok().build();
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/pom.xml
new file mode 100644
index 0000000000..d68c2b9034
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/pom.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.sdc.onboarding</groupId>
+ <artifactId>vendor-software-products-rest</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../</relativePath>
+ </parent>
+
+ <artifactId>vendor-software-products-rest-types</artifactId>
+ <name>vendor-software-products-rest-types</name>
+
+
+
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-common-rest</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-vendor-software-product-manager</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDto.java
new file mode 100644
index 0000000000..63b7e6ea7d
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDto.java
@@ -0,0 +1,35 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorsoftwareproducts.types;
+
+public class ComponentDto extends ComponentRequestDto implements CompositionDataEntityDto {
+
+ private String id;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentRequestDto.java
new file mode 100644
index 0000000000..f626dab072
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentRequestDto.java
@@ -0,0 +1,53 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorsoftwareproducts.types;
+
+public class ComponentRequestDto {
+
+ private String name;
+ private String displayName;
+ private String description;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+ public void setDisplayName(String displayName) {
+ this.displayName = displayName;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/CompositionDataEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/CompositionDataEntityDto.java
new file mode 100644
index 0000000000..8eb1c6557f
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/CompositionDataEntityDto.java
@@ -0,0 +1,24 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorsoftwareproducts.types;
+
+public interface CompositionDataEntityDto {
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/CompositionEntityResponseDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/CompositionEntityResponseDto.java
new file mode 100644
index 0000000000..6e25e35d9b
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/CompositionEntityResponseDto.java
@@ -0,0 +1,51 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorsoftwareproducts.types;
+
+public class CompositionEntityResponseDto<T extends CompositionDataEntityDto> {
+ private String id;
+ private String schema;
+ private T data;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getSchema() {
+ return schema;
+ }
+
+ public void setSchema(String schema) {
+ this.schema = schema;
+ }
+
+ public T getData() {
+ return data;
+ }
+
+ public void setData(T data) {
+ this.data = data;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/CompositionEntityValidationDataDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/CompositionEntityValidationDataDto.java
new file mode 100644
index 0000000000..20e07880c4
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/CompositionEntityValidationDataDto.java
@@ -0,0 +1,65 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorsoftwareproducts.types;
+
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType;
+
+import java.util.Collection;
+
+public class CompositionEntityValidationDataDto {
+ private CompositionEntityType entityType;
+ private String entityId;
+ private Collection<String> errors;
+ private Collection<CompositionEntityValidationDataDto> subEntitiesValidationData;
+
+ public CompositionEntityType getEntityType() {
+ return entityType;
+ }
+
+ public void setEntityType(CompositionEntityType entityType) {
+ this.entityType = entityType;
+ }
+
+ public String getEntityId() {
+ return entityId;
+ }
+
+ public void setEntityId(String entityId) {
+ this.entityId = entityId;
+ }
+
+ public Collection<String> getErrors() {
+ return errors;
+ }
+
+ public void setErrors(Collection<String> errors) {
+ this.errors = errors;
+ }
+
+ public Collection<CompositionEntityValidationDataDto> getSubEntitiesValidationData() {
+ return subEntitiesValidationData;
+ }
+
+ public void setSubEntitiesValidationData(
+ Collection<CompositionEntityValidationDataDto> subEntitiesValidationData) {
+ this.subEntitiesValidationData = subEntitiesValidationData;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/MibUploadStatusDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/MibUploadStatusDto.java
new file mode 100644
index 0000000000..7331115c3f
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/MibUploadStatusDto.java
@@ -0,0 +1,46 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorsoftwareproducts.types;
+
+public class MibUploadStatusDto {
+ private String snmpTrap;
+ private String snmpPoll;
+
+
+ public MibUploadStatusDto() {
+ }
+
+ public String getSnmpTrap() {
+ return snmpTrap;
+ }
+
+ public void setSnmpTrap(String snmpTrap) {
+ this.snmpTrap = snmpTrap;
+ }
+
+ public String getSnmpPoll() {
+ return snmpPoll;
+ }
+
+ public void setSnmpPoll(String snmpPoll) {
+ this.snmpPoll = snmpPoll;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NetworkDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NetworkDto.java
new file mode 100644
index 0000000000..09ff449a52
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NetworkDto.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorsoftwareproducts.types;
+
+public class NetworkDto extends NetworkRequestDto implements CompositionDataEntityDto {
+
+ private String id;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NetworkRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NetworkRequestDto.java
new file mode 100644
index 0000000000..896ea22207
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NetworkRequestDto.java
@@ -0,0 +1,47 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorsoftwareproducts.types;
+
+import javax.validation.constraints.NotNull;
+
+public class NetworkRequestDto {
+
+ @NotNull
+ private String name;
+ @NotNull
+ private boolean dhcp;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public boolean isDhcp() {
+ return dhcp;
+ }
+
+ public void setDhcp(boolean dhcp) {
+ this.dhcp = dhcp;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NicDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NicDto.java
new file mode 100644
index 0000000000..05cd9a3a2b
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NicDto.java
@@ -0,0 +1,43 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorsoftwareproducts.types;
+
+public class NicDto extends NicRequestDto implements CompositionDataEntityDto {
+
+ private String id;
+ private String networkName;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getNetworkName() {
+ return networkName;
+ }
+
+ public void setNetworkName(String networkName) {
+ this.networkName = networkName;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NicRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NicRequestDto.java
new file mode 100644
index 0000000000..bd14012eee
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NicRequestDto.java
@@ -0,0 +1,52 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorsoftwareproducts.types;
+
+public class NicRequestDto {
+
+ private String name;
+ private String description;
+ private String networkId;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getNetworkId() {
+ return networkId;
+ }
+
+ public void setNetworkId(String networkId) {
+ this.networkId = networkId;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/PackageInfoDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/PackageInfoDto.java
new file mode 100644
index 0000000000..5e689f3a0c
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/PackageInfoDto.java
@@ -0,0 +1,124 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorsoftwareproducts.types;
+
+public class PackageInfoDto {
+
+ private String displayName;
+ private String description;
+ private String vspName;
+ private String version;
+ private String packageId;
+ private String category;
+ private String subCategory;
+ private String vendorName;
+ private String vendorRelease;
+ private String packageChecksum;
+ private String packageType;
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+ public void setDisplayName(String displayName) {
+ this.displayName = displayName;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ public String getPackageId() {
+ return packageId;
+ }
+
+ public void setPackageId(String packageId) {
+ this.packageId = packageId;
+ }
+
+ public String getCategory() {
+ return category;
+ }
+
+ public void setCategory(String category) {
+ this.category = category;
+ }
+
+ public String getSubCategory() {
+ return subCategory;
+ }
+
+ public void setSubCategory(String subCategory) {
+ this.subCategory = subCategory;
+ }
+
+ public String getVendorName() {
+ return vendorName;
+ }
+
+ public void setVendorName(String vendorName) {
+ this.vendorName = vendorName;
+ }
+
+ public String getVendorRelease() {
+ return vendorRelease;
+ }
+
+ public void setVendorRelease(String vendorRelease) {
+ this.vendorRelease = vendorRelease;
+ }
+
+ public String getPackageChecksum() {
+ return packageChecksum;
+ }
+
+ public void setPackageChecksum(String packageChecksum) {
+ this.packageChecksum = packageChecksum;
+ }
+
+ public String getPackageType() {
+ return packageType;
+ }
+
+ public void setPackageType(String packageType) {
+ this.packageType = packageType;
+ }
+
+ public String getVspName() {
+ return vspName;
+ }
+
+ public void setVspName(String vendorName) {
+ this.vspName = vendorName;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ProcessEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ProcessEntityDto.java
new file mode 100644
index 0000000000..50923ff2e8
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ProcessEntityDto.java
@@ -0,0 +1,42 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorsoftwareproducts.types;
+
+public class ProcessEntityDto extends ProcessRequestDto {
+ private String id;
+ private String artifactName;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getArtifactName() {
+ return artifactName;
+ }
+
+ public void setArtifactName(String artifactName) {
+ this.artifactName = artifactName;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ProcessRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ProcessRequestDto.java
new file mode 100644
index 0000000000..e9c99b9d65
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ProcessRequestDto.java
@@ -0,0 +1,47 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorsoftwareproducts.types;
+
+import javax.validation.constraints.NotNull;
+
+public class ProcessRequestDto {
+
+ @NotNull
+ private String name;
+
+ private String description;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/QuestionnaireResponseDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/QuestionnaireResponseDto.java
new file mode 100644
index 0000000000..81377764c2
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/QuestionnaireResponseDto.java
@@ -0,0 +1,42 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorsoftwareproducts.types;
+
+public class QuestionnaireResponseDto {
+ private String schema;
+ private String data;
+
+ public String getSchema() {
+ return schema;
+ }
+
+ public void setSchema(String schema) {
+ this.schema = schema;
+ }
+
+ public String getData() {
+ return data;
+ }
+
+ public void setData(String data) {
+ this.data = data;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/QuestionnaireValidationResultDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/QuestionnaireValidationResultDto.java
new file mode 100644
index 0000000000..bf4805a9e1
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/QuestionnaireValidationResultDto.java
@@ -0,0 +1,42 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorsoftwareproducts.types;
+
+public class QuestionnaireValidationResultDto {
+ private boolean valid;
+ private CompositionEntityValidationDataDto validationData;
+
+ public boolean isValid() {
+ return valid;
+ }
+
+ public void setValid(boolean valid) {
+ this.valid = valid;
+ }
+
+ public CompositionEntityValidationDataDto getValidationData() {
+ return validationData;
+ }
+
+ public void setValidationData(CompositionEntityValidationDataDto validationData) {
+ this.validationData = validationData;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/TranslatedFileDataDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/TranslatedFileDataDto.java
new file mode 100644
index 0000000000..975f78d473
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/TranslatedFileDataDto.java
@@ -0,0 +1,97 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorsoftwareproducts.types;
+
+public class TranslatedFileDataDto {
+
+ private String displayName;
+ private String version;
+ private String category;
+ private String subcategory;
+ private String vendorName;
+ private String vendorRelease;
+ private String packageChecksum;
+ private String packageType;
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+ public void setDisplayName(String displayName) {
+ this.displayName = displayName;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ public String getCategory() {
+ return category;
+ }
+
+ public void setCategory(String category) {
+ this.category = category;
+ }
+
+ public String getSubcategory() {
+ return subcategory;
+ }
+
+ public void setSubcategory(String subcategory) {
+ this.subcategory = subcategory;
+ }
+
+ public String getVandorName() {
+ return vendorName;
+ }
+
+ public void setVandorName(String vandorName) {
+ this.vendorName = vandorName;
+ }
+
+ public String getVendorRelease() {
+ return vendorRelease;
+ }
+
+ public void setVendorRelease(String vendorRelease) {
+ this.vendorRelease = vendorRelease;
+ }
+
+ public String getPackageChecksum() {
+ return packageChecksum;
+ }
+
+ public void setPackageChecksum(String packageChecksum) {
+ this.packageChecksum = packageChecksum;
+ }
+
+ public String getPackageType() {
+ return packageType;
+ }
+
+ public void setPackageType(String packageType) {
+ this.packageType = packageType;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/UploadFileResponseDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/UploadFileResponseDto.java
new file mode 100644
index 0000000000..4f57b8031f
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/UploadFileResponseDto.java
@@ -0,0 +1,63 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorsoftwareproducts.types;
+
+import org.openecomp.sdc.datatypes.error.ErrorMessage;
+import org.openecomp.sdc.vendorsoftwareproduct.types.UploadFileStatus;
+
+
+import java.util.List;
+import java.util.Map;
+
+public class UploadFileResponseDto {
+ private List<String> fileNames;
+ private Map<String, List<ErrorMessage>> errors;
+ private UploadFileStatus status;
+
+ public Map<String, List<ErrorMessage>> getErrors() {
+ return errors;
+ }
+
+ public void setErrors(Map<String, List<ErrorMessage>> errors) {
+ this.errors = errors;
+ }
+
+ public UploadFileStatus getStatus() {
+ return status;
+ }
+
+ public void setStatus(UploadFileStatus status) {
+ this.status = status;
+ }
+
+ public List<String> getFileNames() {
+ return fileNames;
+ }
+
+ public void setFileNames(List<String> fileNames) {
+ this.fileNames = fileNames;
+ }
+
+ public void addNewFileToList(String filename) {
+ this.fileNames.add(filename);
+ }
+
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ValidationResponseDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ValidationResponseDto.java
new file mode 100644
index 0000000000..d76ae665ae
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ValidationResponseDto.java
@@ -0,0 +1,77 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorsoftwareproducts.types;
+
+import org.openecomp.sdcrests.common.types.ErrorCodeDto;
+import org.openecomp.sdcrests.common.types.ErrorMessageDto;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+public class ValidationResponseDto {
+ private boolean valid;
+ private Collection<ErrorCodeDto> vspErrors;
+ private Collection<ErrorCodeDto> licensingDataErrors;
+ private Map<String, List<ErrorMessageDto>> uploadDataErrors;
+ private QuestionnaireValidationResultDto questionnaireValidationResult;
+
+ public boolean isValid() {
+ return valid;
+ }
+
+ public void setValid(boolean valid) {
+ this.valid = valid;
+ }
+
+ public Collection<ErrorCodeDto> getVspErrors() {
+ return vspErrors;
+ }
+
+ public void setVspErrors(Collection<ErrorCodeDto> vspErrors) {
+ this.vspErrors = vspErrors;
+ }
+
+ public Collection<ErrorCodeDto> getLicensingDataErrors() {
+ return licensingDataErrors;
+ }
+
+ public void setLicensingDataErrors(Collection<ErrorCodeDto> licensingDataErrors) {
+ this.licensingDataErrors = licensingDataErrors;
+ }
+
+ public Map<String, List<ErrorMessageDto>> getUploadDataErrors() {
+ return uploadDataErrors;
+ }
+
+ public void setUploadDataErrors(Map<String, List<ErrorMessageDto>> uploadDataErrors) {
+ this.uploadDataErrors = uploadDataErrors;
+ }
+
+ public QuestionnaireValidationResultDto getQuestionnaireValidationResult() {
+ return questionnaireValidationResult;
+ }
+
+ public void setQuestionnaireValidationResult(
+ QuestionnaireValidationResultDto questionnaireValidationResult) {
+ this.questionnaireValidationResult = questionnaireValidationResult;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VendorSoftwareProductAction.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VendorSoftwareProductAction.java
new file mode 100644
index 0000000000..c652c1cc4e
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VendorSoftwareProductAction.java
@@ -0,0 +1,29 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorsoftwareproducts.types;
+
+public enum VendorSoftwareProductAction {
+ Checkout,
+ Undo_Checkout,
+ Checkin,
+ Submit,
+ Create_Package;
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VersionSoftwareProductActionRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VersionSoftwareProductActionRequestDto.java
new file mode 100644
index 0000000000..4ce2bf92f4
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VersionSoftwareProductActionRequestDto.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorsoftwareproducts.types;
+
+public class VersionSoftwareProductActionRequestDto {
+ private VendorSoftwareProductAction action;
+
+ public VendorSoftwareProductAction getAction() {
+ return action;
+ }
+
+ public void setAction(VendorSoftwareProductAction action) {
+ this.action = action;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspCreationDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspCreationDto.java
new file mode 100644
index 0000000000..d786017be1
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspCreationDto.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorsoftwareproducts.types;
+
+public class VspCreationDto {
+ private String vspId;
+
+ public String getVspId() {
+ return vspId;
+ }
+
+ public void setVspId(String vspId) {
+ this.vspId = vspId;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspDescriptionDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspDescriptionDto.java
new file mode 100644
index 0000000000..a2358a0b48
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspDescriptionDto.java
@@ -0,0 +1,115 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorsoftwareproducts.types;
+
+import org.openecomp.sdc.vendorsoftwareproduct.types.LicensingData;
+
+import javax.validation.constraints.NotNull;
+
+public class VspDescriptionDto {
+ @NotNull
+ private String name;
+ @NotNull
+ private String description;
+ private String icon;
+ @NotNull
+ private String category;
+ @NotNull
+ private String subCategory;
+ @NotNull
+ private String vendorName;
+ @NotNull
+ private String vendorId; // this will be populated with vlm id
+ private String licensingVersion; // this will be populated with vlm version
+ private LicensingData licensingData;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getIcon() {
+ return this.icon;
+ }
+
+ public void setIcon(String icon) {
+ this.icon = icon;
+ }
+
+ public String getCategory() {
+ return category;
+ }
+
+ public void setCategory(String category) {
+ this.category = category;
+ }
+
+ public String getSubCategory() {
+ return subCategory;
+ }
+
+ public void setSubCategory(String subCategory) {
+ this.subCategory = subCategory;
+ }
+
+ public String getVendorName() {
+ return vendorName;
+ }
+
+ public void setVendorName(String vendorName) {
+ this.vendorName = vendorName;
+ }
+
+ public String getVendorId() {
+ return vendorId;
+ }
+
+ public void setVendorId(String vendorId) {
+ this.vendorId = vendorId;
+ }
+
+ public String getLicensingVersion() {
+ return licensingVersion;
+ }
+
+ public void setLicensingVersion(String licensingVersion) {
+ this.licensingVersion = licensingVersion;
+ }
+
+ public LicensingData getLicensingData() {
+ return licensingData;
+ }
+
+ public void setLicensingData(LicensingData licensingData) {
+ this.licensingData = licensingData;
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspDetailsDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspDetailsDto.java
new file mode 100644
index 0000000000..85b3203099
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspDetailsDto.java
@@ -0,0 +1,97 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorsoftwareproducts.types;
+
+import io.swagger.annotations.ApiModel;
+
+import org.openecomp.sdc.heat.datatypes.structure.ValidationStructureList;
+import org.openecomp.sdc.versioning.dao.types.VersionStatus;
+
+import java.util.List;
+
+@ApiModel(value = "VspDetails")
+public class VspDetailsDto extends VspDescriptionDto {
+
+ private String id;
+ private String version;
+ private List<String> viewableVersions;
+ private List<String> finalVersions;
+ private VersionStatus status;
+ private String lockingUser;
+ private ValidationStructureList validationData;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ public List<String> getViewableVersions() {
+ return viewableVersions;
+ }
+
+ public void setViewableVersions(List<String> viewableVersions) {
+ this.viewableVersions = viewableVersions;
+ }
+
+ public List<String> getFinalVersions() {
+ return finalVersions;
+ }
+
+ public void setFinalVersions(List<String> finalVersions) {
+ this.finalVersions = finalVersions;
+ }
+
+ public VersionStatus getStatus() {
+ return status;
+ }
+
+ public void setStatus(VersionStatus status) {
+ this.status = status;
+ }
+
+ public String getLockingUser() {
+ return lockingUser;
+ }
+
+ public void setLockingUser(String lockingUser) {
+ this.lockingUser = lockingUser;
+ }
+
+ public ValidationStructureList getValidationData() {
+ return validationData;
+ }
+
+ public void setValidationData(ValidationStructureList validationData) {
+ this.validationData = validationData;
+ }
+
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/CustomJsonValidator.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/CustomJsonValidator.java
new file mode 100644
index 0000000000..23d90c02a2
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/CustomJsonValidator.java
@@ -0,0 +1,40 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorsoftwareproducts.types.validation;
+
+import org.openecomp.core.utilities.json.JsonUtil;
+
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+
+public class CustomJsonValidator implements ConstraintValidator<IsValidJson, String> {
+
+ @Override
+ public void initialize(IsValidJson stringEnumeration) {
+ }
+
+
+ @Override
+ public boolean isValid(String json, ConstraintValidatorContext context) {
+ return JsonUtil.isValidJson(json);
+ }
+
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/IsValidJson.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/IsValidJson.java
new file mode 100644
index 0000000000..7a9ec50721
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/IsValidJson.java
@@ -0,0 +1,77 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdcrests.vendorsoftwareproducts.types.validation;
+
+
+import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
+import static java.lang.annotation.ElementType.CONSTRUCTOR;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import org.openecomp.sdcrests.common.RestConstants;
+
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.validation.Constraint;
+import javax.validation.Payload;
+
+
+/**
+ * The interface Is valid json.
+ */
+@Documented
+@Constraint(validatedBy = CustomJsonValidator.class)
+@Target({METHOD, FIELD, ANNOTATION_TYPE, PARAMETER, CONSTRUCTOR})
+@Retention(RUNTIME)
+public @interface IsValidJson {
+ /**
+ * The constant message.
+ */
+ String message = RestConstants.INVALID_JSON_ERROR_MESSAGE;
+
+ /**
+ * Message string.
+ *
+ * @return the string
+ */
+ String message() default RestConstants.INVALID_JSON_ERROR_MESSAGE;
+
+ /**
+ * Groups class [ ].
+ *
+ * @return the class [ ]
+ */
+ Class<?>[] groups() default {};
+
+ /**
+ * Payload class [ ].
+ *
+ * @return the class [ ]
+ */
+ Class<? extends Payload>[] payload() default {};
+}
+
+
diff --git a/openecomp-be/api/pom.xml b/openecomp-be/api/pom.xml
new file mode 100644
index 0000000000..f6654290c7
--- /dev/null
+++ b/openecomp-be/api/pom.xml
@@ -0,0 +1,22 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>openecomp-sdc-api</artifactId>
+ <name>openecomp-sdc-api</name>
+ <packaging>pom</packaging>
+ <url>http://maven.apache.org</url>
+
+
+
+ <modules>
+ <module>/openecomp-sdc-rest-webapp</module>
+ </modules>
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/pom.xml b/openecomp-be/backend/openecomp-sdc-action-manager/pom.xml
new file mode 100644
index 0000000000..af1652ad50
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-action-manager/pom.xml
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>backend</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>openecomp-sdc-action-manager</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-utilities-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-validation-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-nosqldb-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>6.9.10</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>RELEASE</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.dataformat</groupId>
+ <artifactId>jackson-dataformat-xml</artifactId>
+ <version>2.7.4</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.woodstox</groupId>
+ <artifactId>woodstox-core-asl</artifactId>
+ <version>4.4.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-action-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-versioning-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc.sdc_common</groupId>
+ <artifactId>openecomp-logging-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc.sdc_common</groupId>
+ <artifactId>openecomp-logging-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.19.1</version>
+ <configuration>
+ <skipTests>true</skipTests>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/ActionManager.java b/openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/ActionManager.java
new file mode 100644
index 0000000000..52b0b2a851
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/ActionManager.java
@@ -0,0 +1,66 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.action;
+
+
+import org.openecomp.sdc.action.errors.ActionException;
+import org.openecomp.sdc.action.types.Action;
+import org.openecomp.sdc.action.types.ActionArtifact;
+import org.openecomp.sdc.action.types.EcompComponent;
+
+import java.util.List;
+
+public interface ActionManager {
+ public Action createAction(Action action, String user) throws ActionException;
+
+ public Action updateAction(Action action, String user) throws ActionException;
+
+ public void deleteAction(String actionInvariantUuId, String user) throws ActionException;
+
+ public List<Action> getFilteredActions(String filterType, String filterValue)
+ throws ActionException;
+
+ public List<EcompComponent> getEcompComponents() throws ActionException;
+
+ public List<Action> getActionsByActionInvariantUuId(String invariantId) throws ActionException;
+
+ public Action getActionsByActionUuId(String actionUuId) throws ActionException;
+
+ public Action checkout(String invariantUuId, String user) throws ActionException;
+
+ public void undoCheckout(String invariantUuId, String user) throws ActionException;
+
+ public Action checkin(String invariantUuId, String user) throws ActionException;
+
+ public Action submit(String invariantUuId, String user) throws ActionException;
+
+ public ActionArtifact uploadArtifact(ActionArtifact data, String actionInvariantUuId,
+ String user);
+
+ public ActionArtifact downloadArtifact(String actionUuId, String artifactUuId)
+ throws ActionException;
+
+ public void deleteArtifact(String actionInvariantUuId, String artifactUuId, String user)
+ throws ActionException;
+
+ public void updateArtifact(ActionArtifact data, String actionInvariantUuId, String user);
+}
+
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/impl/ActionManagerImpl.java b/openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/impl/ActionManagerImpl.java
new file mode 100644
index 0000000000..53ab943765
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/impl/ActionManagerImpl.java
@@ -0,0 +1,1217 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.action.impl;
+
+import static org.openecomp.sdc.action.ActionConstants.SERVICE_INSTANCE_ID;
+import static org.openecomp.sdc.action.ActionConstants.TARGET_ENTITY_API;
+import static org.openecomp.sdc.action.ActionConstants.TARGET_ENTITY_DB;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_ALREADY_EXISTS;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_ALREADY_EXISTS_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_DELETE_READ_ONLY;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_DELETE_READ_ONLY_MSG;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_UPDATE_NAME_INVALID;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_UPDATE_READ_ONLY;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_UPDATE_READ_ONLY_MSG;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_CHECKIN_ON_ENTITY_LOCKED_BY_OTHER_USER;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_CHECKIN_ON_UNLOCKED_ENTITY;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_CHECKOUT_ON_LOCKED_ENTITY;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_CHECKOUT_ON_LOCKED_ENTITY_OTHER_USER;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_DELETE_ON_LOCKED_ENTITY_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_NOT_EXIST;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_NOT_EXIST_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_UNIQUE_VALUE_ERROR;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_UNIQUE_VALUE_MSG;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INTERNAL_SERVER_ERR_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUESTED_VERSION_INVALID;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_SUBMIT_FINALIZED_ENTITY_NOT_ALLOWED;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_SUBMIT_LOCKED_ENTITY_NOT_ALLOWED;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_UNDO_CHECKOUT_ON_ENTITY_LOCKED_BY_OTHER_USER;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_UNDO_CHECKOUT_ON_UNLOCKED_ENTITY;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_UPDATE_INVALID_VERSION;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_UPDATE_NOT_ALLOWED_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_UPDATE_NOT_ALLOWED_CODE_NAME;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_UPDATE_NOT_ALLOWED_FOR_NAME;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_UPDATE_ON_UNLOCKED_ENTITY;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_UPDATE_PARAM_INVALID;
+import static org.openecomp.sdc.action.util.ActionUtil.actionLogPostProcessor;
+import static org.openecomp.sdc.action.util.ActionUtil.actionLogPreProcessor;
+import static org.openecomp.sdc.versioning.dao.types.Version.VERSION_STRING_VIOLATION_MSG;
+
+import org.apache.commons.lang.StringUtils;
+import org.openecomp.core.logging.api.Logger;
+import org.openecomp.core.logging.api.LoggerFactory;
+import org.openecomp.core.util.UniqueValueUtil;
+import org.openecomp.core.utilities.CommonMethods;
+import org.openecomp.core.utilities.json.JsonUtil;
+import org.openecomp.sdc.action.ActionConstants;
+import org.openecomp.sdc.action.ActionManager;
+import org.openecomp.sdc.action.dao.ActionArtifactDao;
+import org.openecomp.sdc.action.dao.ActionArtifactDaoFactory;
+import org.openecomp.sdc.action.dao.ActionDao;
+import org.openecomp.sdc.action.dao.ActionDaoFactory;
+import org.openecomp.sdc.action.dao.types.ActionArtifactEntity;
+import org.openecomp.sdc.action.dao.types.ActionEntity;
+import org.openecomp.sdc.action.errors.ActionErrorConstants;
+import org.openecomp.sdc.action.errors.ActionException;
+import org.openecomp.sdc.action.logging.StatusCode;
+import org.openecomp.sdc.action.types.Action;
+import org.openecomp.sdc.action.types.ActionArtifact;
+import org.openecomp.sdc.action.types.ActionArtifactProtection;
+import org.openecomp.sdc.action.types.ActionStatus;
+import org.openecomp.sdc.action.types.ActionSubOperation;
+import org.openecomp.sdc.action.types.EcompComponent;
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.versioning.VersioningManager;
+import org.openecomp.sdc.versioning.VersioningManagerFactory;
+import org.openecomp.sdc.versioning.dao.VersionInfoDao;
+import org.openecomp.sdc.versioning.dao.VersionInfoDaoFactory;
+import org.openecomp.sdc.versioning.dao.types.UserCandidateVersion;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.dao.types.VersionInfoEntity;
+import org.openecomp.sdc.versioning.errors.EntityNotExistErrorBuilder;
+import org.openecomp.sdc.versioning.errors.VersioningErrorCodes;
+import org.openecomp.sdc.versioning.types.VersionInfo;
+import org.openecomp.sdc.versioning.types.VersionableEntityAction;
+import org.slf4j.MDC;
+
+import java.time.ZoneOffset;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+
+/**
+ * Manager Implementation for {@link ActionManager Action Library Operations}. <br> Handles Business
+ * layer validations and acts as an interface between the REST and DAO layers.
+ */
+public class ActionManagerImpl implements ActionManager {
+
+ private static final ActionDao actionDao = ActionDaoFactory.getInstance().createInterface();
+ private static final VersioningManager versioningManager =
+ VersioningManagerFactory.getInstance().createInterface();
+ private static final ActionArtifactDao actionArtifactDao =
+ ActionArtifactDaoFactory.getInstance().createInterface();
+ private static VersionInfoDao versionInfoDao =
+ VersionInfoDaoFactory.getInstance().createInterface();
+
+ private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName());
+
+ public ActionManagerImpl() {
+ actionDao.registerVersioning(ActionConstants.ACTION_VERSIONABLE_TYPE);
+ }
+
+ /**
+ * Get Current Timestamp in UTC format.
+ *
+ * @return Current Timestamp in UTC format.
+ */
+ public static Date getCurrentTimeStampUtc() {
+ return Date.from(java.time.ZonedDateTime.now(ZoneOffset.UTC).toInstant());
+ }
+
+ /**
+ * List All Major, Last Minor and Candidate version (if any) for Given Action Invariant UUID.
+ *
+ * @param invariantId Invariant UUID of the action for which the information is required.
+ * @return List of All Major, Last Minor and Candidate version if any Of {@link Action} with given
+ actionInvariantUuId.
+ * @throws ActionException Exception with an action library specific code, short description and
+ * detailed message for the error occurred during the operation.
+ */
+ @Override
+ public List<Action> getActionsByActionInvariantUuId(String invariantId) throws ActionException {
+ log.debug(" entering getActionsByActionInvariantUUID with invariantID = " + invariantId);
+ List<Action> actions = actionDao
+ .getActionsByActionInvariantUuId(invariantId != null ? invariantId.toUpperCase() : null);
+ if (actions != null && actions.isEmpty()) {
+ throw new ActionException(ACTION_ENTITY_NOT_EXIST_CODE, ACTION_ENTITY_NOT_EXIST);
+ }
+ log.debug(" exit getActionsByActionInvariantUUID with invariantID = " + invariantId);
+ return actions;
+ }
+
+ /**
+ * Get list of actions based on a filter criteria. If no filter is sent all actions will be
+ * returned.
+ *
+ * @param filterType Filter by Vendor/Category/Model/Component/None.
+ * @param filterValue Filter Parameter Value (Vendor ID/Category ID/Model ID/Component ID).
+ * @return List of {@link Action} objects based on a filter criteria <br> Empty List if no records
+ match the provided filter criteria.
+ * @throws ActionException Exception with an action library specific code, short description and
+ * detailed message for the error occurred for the error occurred during
+ * the operation.
+ */
+ @Override
+ public List<Action> getFilteredActions(String filterType, String filterValue)
+ throws ActionException {
+ log.debug(" entering getFilteredActions By filterType = " + filterType + " With value = "
+ + filterValue);
+ List<Action> actions;
+ switch (filterType) {
+ case ActionConstants.FILTER_TYPE_NONE:
+ //Business validation for ECOMP Component type fetch (if any)
+ break;
+ case ActionConstants.FILTER_TYPE_VENDOR:
+ //Business validation for vendor type fetch (if any)
+ break;
+ case ActionConstants.FILTER_TYPE_CATEGORY:
+ //Business validation for Category type fetch (if any)
+ break;
+ case ActionConstants.FILTER_TYPE_MODEL:
+ //Business validation for model type fetch (if any)
+ break;
+ case ActionConstants.FILTER_TYPE_ECOMP_COMPONENT:
+ //Business validation for ECOMP Component type fetch (if any)
+ break;
+ case ActionConstants.FILTER_TYPE_NAME:
+ actions = actionDao
+ .getFilteredActions(filterType, filterValue != null ? filterValue.toLowerCase() : null);
+ if (actions != null && actions.isEmpty()) {
+ throw new ActionException(ACTION_ENTITY_NOT_EXIST_CODE, ACTION_ENTITY_NOT_EXIST);
+ }
+ log.debug(" exit getFilteredActions By filterType = " + filterType + " With value = "
+ + filterValue);
+ return actions;
+ default:
+ break;
+ }
+ actions = actionDao
+ .getFilteredActions(filterType, filterValue != null ? filterValue.toLowerCase() : null);
+ List<Action> majorMinorVersionList = getMajorMinorVersionActions(actions);
+ Collections.sort(majorMinorVersionList);
+ log.debug(
+ " exit getFilteredActions By filterType = " + filterType + " With value = " + filterValue);
+ return majorMinorVersionList;
+ }
+
+ /**
+ * Get the properties of an action version by its UUID.
+ *
+ * @param actionUuId UUID of the specific action version.
+ * @return {@link Action} object corresponding the version represented by the UUID.
+ * @throws ActionException Exception with an action library specific code, short description and
+ * detailed message for the error occurred for the error occurred during
+ * the operation.
+ */
+ @Override
+ public Action getActionsByActionUuId(String actionUuId) throws ActionException {
+ log.debug(" entering getActionsByActionUUID with actionUUID = " + actionUuId);
+ Action action =
+ actionDao.getActionsByActionUuId(actionUuId != null ? actionUuId.toUpperCase() : null);
+
+ if (action == null) {
+ throw new ActionException(ACTION_ENTITY_NOT_EXIST_CODE, ACTION_ENTITY_NOT_EXIST);
+ }
+ log.debug(" exit getActionsByActionUUID with actionUUID = " + actionUuId);
+ return action;
+ }
+
+ /**
+ * List ECOMP Components supported by Action Library
+ *
+ * @return List of {@link EcompComponent} objects supported by Action Library <br> Empty List if
+ no components are found.
+ * @throws ActionException Exception with an action library specific code, short description and
+ * detailed message for the error occurred for the error occurred during
+ * the operation.
+ */
+ @Override
+ public List<EcompComponent> getEcompComponents() throws ActionException {
+ return actionDao.getEcompComponents();
+ }
+
+
+ /**
+ * Delete an action.
+ *
+ * @param actionInvariantUuId Invariant UUID of the action to be deleted.
+ * @param user User id of the user performing the operation.
+ */
+ @Override
+ public void deleteAction(String actionInvariantUuId, String user) throws ActionException {
+ try {
+ log.debug("entering deleteAction with actionInvariantUUID = " + actionInvariantUuId
+ + " and user = " + user);
+ actionLogPreProcessor(ActionSubOperation.DELETE_ACTION, TARGET_ENTITY_API);
+ versioningManager.delete(ActionConstants.ACTION_VERSIONABLE_TYPE, actionInvariantUuId, user);
+ actionLogPostProcessor(StatusCode.COMPLETE);
+ log.metrics("");
+ actionDao.deleteAction(actionInvariantUuId);
+ } catch (CoreException ce) {
+ formAndThrowException(ce);
+ }
+ }
+
+ /**
+ * Create a new Action.
+ *
+ * @param action Action object model of the user request for creating an action.
+ * @param user AT&T id of the user sending the create request.
+ * @return {@link Action} model object for the created action.
+ * @throws ActionException Exception with an action library specific code, short description and
+ * detailed message for the error occurred for the error occurred during
+ * the operation.
+ */
+ @Override
+ public Action createAction(Action action, String user) throws ActionException {
+ try {
+ actionLogPreProcessor(ActionSubOperation.VALIDATE_ACTION_UNIQUE_NAME, TARGET_ENTITY_API);
+ UniqueValueUtil
+ .validateUniqueValue(ActionConstants.UniqueValues.ACTION_NAME, action.getName());
+ actionLogPostProcessor(StatusCode.COMPLETE);
+ } catch (CoreException ce) {
+ String errorDesc = String
+ .format(ACTION_ENTITY_UNIQUE_VALUE_MSG, ActionConstants.UniqueValues.ACTION_NAME,
+ action.getName());
+ actionLogPostProcessor(StatusCode.ERROR, ACTION_ENTITY_UNIQUE_VALUE_ERROR, errorDesc, false);
+ throw new ActionException(ACTION_ENTITY_UNIQUE_VALUE_ERROR, errorDesc);
+ } finally {
+ log.metrics("");
+ }
+
+ action.setUser(user);
+ action.setTimestamp(getCurrentTimeStampUtc());
+ action.setActionInvariantUuId(CommonMethods.nextUuId());
+ action.setActionUuId(CommonMethods.nextUuId());
+
+ actionLogPreProcessor(ActionSubOperation.CREATE_ACTION_VERSION, TARGET_ENTITY_API);
+ Version version = versioningManager
+ .create(ActionConstants.ACTION_VERSIONABLE_TYPE, action.getActionInvariantUuId(), user);
+ actionLogPostProcessor(StatusCode.COMPLETE);
+ log.metrics("");
+ action.setVersion(version.toString());
+ action.setStatus(ActionStatus.Locked);
+ action = updateData(action);
+ action = actionDao.createAction(action);
+ actionLogPreProcessor(ActionSubOperation.CREATE_ACTION_UNIQUE_VALUE, TARGET_ENTITY_API);
+ UniqueValueUtil.createUniqueValue(ActionConstants.UniqueValues.ACTION_NAME, action.getName());
+ actionLogPostProcessor(StatusCode.COMPLETE);
+ log.metrics("");
+ return action;
+ }
+
+ /**
+ * Update an existing action.
+ *
+ * @param action Action object model of the user request for creating an action.
+ * @param user AT&T id of the user sending the update request.
+ * @return {@link Action} model object for the update action.
+ * @throws ActionException Exception with an action library specific code, short description and
+ * detailed message for the error occurred for the error occurred during
+ * the operation.
+ */
+ @Override
+ public Action updateAction(Action action, String user) throws ActionException {
+ try {
+ log.debug("entering updateAction to update action with invariantUUID = "
+ + action.getActionInvariantUuId() + " by user = " + user);
+ String invariantUuId = action.getActionInvariantUuId();
+ actionLogPreProcessor(ActionSubOperation.GET_ACTION_VERSION, TARGET_ENTITY_API);
+ VersionInfo versionInfo = versioningManager
+ .getEntityVersionInfo(ActionConstants.ACTION_VERSIONABLE_TYPE, invariantUuId, user,
+ VersionableEntityAction.Write);
+ actionLogPostProcessor(StatusCode.COMPLETE);
+ log.metrics("");
+ Version activeVersion = versionInfo.getActiveVersion();
+ validateActions(action, activeVersion);
+ action.setStatus(ActionStatus.Locked); //Status will be Checkout for update
+ updateData(action);
+ action.setUser(user);
+ action.setTimestamp(getCurrentTimeStampUtc());
+ actionDao.updateAction(action);
+ } catch (CoreException ce) {
+ formAndThrowException(ce);
+ }
+ log.debug("exit updateAction");
+ return action;
+ }
+
+ /**
+ * Checkout an existing action.
+ *
+ * @param invariantUuId actionInvariantUuId of the action to be checked out.
+ * @param user AT&T id of the user sending the checkout request.
+ * @return {@link Action} model object for the checkout action.
+ * @throws ActionException Exception with an action library specific code, short description and
+ * detailed message for the error occurred for the error occurred during
+ * the operation.
+ */
+ @Override
+ public Action checkout(String invariantUuId, String user) throws ActionException {
+ Version version = null;
+ ActionEntity actionEntity = null;
+ try {
+ log.debug(
+ "entering checkout for Action with invariantUUID= " + invariantUuId + " by user = "
+ + user);
+ actionLogPreProcessor(ActionSubOperation.CHECKOUT_ACTION, TARGET_ENTITY_API);
+ version =
+ versioningManager.checkout(ActionConstants.ACTION_VERSIONABLE_TYPE, invariantUuId, user);
+ actionLogPostProcessor(StatusCode.COMPLETE);
+ log.metrics("");
+ actionEntity =
+ updateUniqueIdForVersion(invariantUuId, version, ActionStatus.Locked.name(), user);
+ } catch (CoreException e0) {
+ if (e0.code() != null
+ && e0.code().id().equals(VersioningErrorCodes.CHECKOT_ON_LOCKED_ENTITY)) {
+ actionLogPreProcessor(ActionSubOperation.GET_ACTION_VERSION, TARGET_ENTITY_DB);
+ VersionInfoEntity versionInfoEntity = versionInfoDao
+ .get(new VersionInfoEntity(ActionConstants.ACTION_VERSIONABLE_TYPE, invariantUuId));
+ actionLogPostProcessor(StatusCode.COMPLETE);
+ log.metrics("");
+ String checkoutUser = versionInfoEntity.getCandidate().getUser();
+ log.debug(
+ "Actual checkout user for Action with invariantUUID= " + invariantUuId + " is = "
+ + checkoutUser);
+ if (!checkoutUser.equals(user)) {
+ throw new ActionException(ACTION_CHECKOUT_ON_LOCKED_ENTITY_OTHER_USER, e0.getMessage());
+ }
+ }
+ formAndThrowException(e0);
+ }
+ log.debug(
+ "exit checkout for Action with invariantUUID= " + invariantUuId + " by user = " + user);
+ return actionEntity != null ? actionEntity.toDto() : new Action();
+ }
+
+ /**
+ * Undo an already checked out action.
+ *
+ * @param invariantUuId actionInvariantUuId of the checked out action.
+ * @param user AT&T id of the user sending the request.
+ * @throws ActionException Exception with an action library specific code, short description and
+ * detailed message for the error occurred for the error occurred during
+ * the operation.
+ */
+ @Override
+ public void undoCheckout(String invariantUuId, String user) throws ActionException {
+ Version version;
+ try {
+ log.debug(
+ "entering undoCheckout for Action with invariantUUID= " + invariantUuId + " by user = "
+ + user);
+ actionLogPreProcessor(ActionSubOperation.GET_ACTION_VERSION, TARGET_ENTITY_DB);
+ //Get list of uploaded artifacts in this checked out version
+ VersionInfoEntity versionInfoEntity = versionInfoDao
+ .get(new VersionInfoEntity(ActionConstants.ACTION_VERSIONABLE_TYPE, invariantUuId));
+ actionLogPostProcessor(StatusCode.COMPLETE);
+ log.metrics("");
+ if (versionInfoEntity == null) {
+ throw new CoreException(
+ new EntityNotExistErrorBuilder(ActionConstants.ACTION_VERSIONABLE_TYPE, invariantUuId)
+ .build());
+ }
+ UserCandidateVersion candidate = versionInfoEntity.getCandidate();
+ Version activeVersion;
+ if (candidate != null) {
+ activeVersion = candidate.getVersion();
+ } else {
+ activeVersion = versionInfoEntity.getActiveVersion();
+ }
+ actionLogPreProcessor(ActionSubOperation.GET_ACTIONENTITY_BY_VERSION, TARGET_ENTITY_DB);
+ Action action = actionDao.get(new ActionEntity(invariantUuId, activeVersion)).toDto();
+ actionLogPostProcessor(StatusCode.COMPLETE);
+ log.metrics("");
+ //Perform undo checkout on the action
+ actionLogPreProcessor(ActionSubOperation.UNDO_CHECKOUT_ACTION, TARGET_ENTITY_API);
+ version = versioningManager
+ .undoCheckout(ActionConstants.ACTION_VERSIONABLE_TYPE, invariantUuId, user);
+ actionLogPostProcessor(StatusCode.COMPLETE);
+ log.metrics("");
+ if (version.equals(new Version(0, 0))) {
+ actionLogPreProcessor(ActionSubOperation.DELETE_UNIQUEVALUE, TARGET_ENTITY_API);
+ UniqueValueUtil
+ .deleteUniqueValue(ActionConstants.UniqueValues.ACTION_NAME, action.getName());
+ actionLogPostProcessor(StatusCode.COMPLETE);
+ log.metrics("");
+ actionLogPreProcessor(ActionSubOperation.DELETE_ACTIONVERSION, TARGET_ENTITY_DB );
+ //Added for the case where Create->Undo_Checkout->Checkout should not get the action
+ versionInfoDao
+ .delete(new VersionInfoEntity(ActionConstants.ACTION_VERSIONABLE_TYPE, invariantUuId));
+ actionLogPostProcessor(StatusCode.COMPLETE);
+ log.metrics("");
+ }
+ List<ActionArtifact> currentVersionArtifacts = action.getArtifacts();
+
+ //Delete the artifacts from action_artifact table (if any)
+ if (currentVersionArtifacts != null && currentVersionArtifacts.size() > 0) {
+ for (ActionArtifact artifact : currentVersionArtifacts) {
+ ActionArtifactEntity artifactDeleteEntity =
+ new ActionArtifactEntity(artifact.getArtifactUuId(),
+ getEffectiveVersion(activeVersion.toString()));
+ actionLogPreProcessor(ActionSubOperation.DELETE_ARTIFACT, TARGET_ENTITY_DB);
+ actionArtifactDao.delete(artifactDeleteEntity);
+ actionLogPostProcessor(StatusCode.COMPLETE);
+ log.metrics("");
+ }
+ }
+ } catch (CoreException e0) {
+ formAndThrowException(e0);
+ }
+ log.debug(
+ "exit undoCheckout for Action with invariantUUID= " + invariantUuId + " by user = " + user);
+ }
+
+ /**
+ * Checkin a checked out action.
+ *
+ * @param invariantUuId actionInvariantUuId of the checked out action.
+ * @param user AT&T id of the user sending the request.
+ * @return {@link Action} model object for the updated action.
+ * @throws ActionException Exception with an action library specific code, short description and
+ * detailed message for the error occurred for the error occurred during
+ * the operation.
+ */
+ @Override
+ public Action checkin(String invariantUuId, String user) throws ActionException {
+ Version version = null;
+ ActionEntity actionEntity = null;
+ try {
+ log.debug("entering checkin for Action with invariantUUID= " + invariantUuId + " by user = "
+ + user);
+ actionLogPreProcessor(ActionSubOperation.CHECKIN_ACTION, TARGET_ENTITY_API);
+ version = versioningManager
+ .checkin(ActionConstants.ACTION_VERSIONABLE_TYPE, invariantUuId, user, null);
+ actionLogPostProcessor(StatusCode.COMPLETE);
+ log.metrics("");
+ actionEntity =
+ updateStatusForVersion(invariantUuId, version, ActionStatus.Available.name(), user);
+ } catch (CoreException e0) {
+ formAndThrowException(e0);
+ }
+ log.debug(
+ "exit checkin for Action with invariantUUID= " + invariantUuId + " by user = " + user);
+ return actionEntity != null ? actionEntity.toDto() : new Action();
+ }
+
+ /**
+ * Submit a checked in action.
+ *
+ * @param invariantUuId actionInvariantUuId of the checked in action.
+ * @param user AT&T id of the user sending the request.
+ * @return {@link Action} model object for the updated action.
+ * @throws ActionException Exception with an action library specific code, short description and
+ * detailed message for the error occurred for the error occurred during
+ * the operation.
+ */
+ @Override
+ public Action submit(String invariantUuId, String user) throws ActionException {
+ Version version = null;
+ ActionEntity actionEntity = null;
+ try {
+ log.debug("entering checkin for Action with invariantUUID= " + invariantUuId + " by user = "
+ + user);
+ actionLogPreProcessor(ActionSubOperation.CHECKIN_ACTION, TARGET_ENTITY_API);
+ version = versioningManager
+ .submit(ActionConstants.ACTION_VERSIONABLE_TYPE, invariantUuId, user, null);
+ actionLogPostProcessor(StatusCode.COMPLETE);
+ log.metrics("");
+ actionEntity =
+ updateUniqueIdForVersion(invariantUuId, version, ActionStatus.Final.name(), user);
+ } catch (CoreException e0) {
+ formAndThrowException(e0);
+ }
+ log.debug(
+ "exit checkin for Action with invariantUUID= " + invariantUuId + " by user = " + user);
+ return actionEntity != null ? actionEntity.toDto() : new Action();
+ }
+
+ /**
+ * Download an artifact of an action.
+ *
+ * @param artifactUuId {@link ActionArtifact} object representing the artifact and its metadata.
+ * @param actionUuId UUID of the action for which the artifact has to be downloaded.
+ * @return downloaded action artifact object.
+ */
+ @Override
+ public ActionArtifact downloadArtifact(String actionUuId, String artifactUuId)
+ throws ActionException {
+ log.debug(" entering downloadArtifact with actionUUID= " + actionUuId + " and artifactUUID= "
+ + artifactUuId);
+ Action action = actionDao.getActionsByActionUuId(actionUuId);
+ ActionArtifact actionArtifact;
+ if (action != null) {
+ MDC.put(SERVICE_INSTANCE_ID, action.getActionInvariantUuId());
+ List<ActionArtifact> artifacts = action.getArtifacts();
+ String actionVersion = action.getVersion();
+ int effectiveVersion = getEffectiveVersion(actionVersion);
+ ActionArtifact artifactMetadata =
+ getArtifactMetadataFromAction(artifacts, ActionConstants.ARTIFACT_METADATA_ATTR_UUID,
+ artifactUuId);
+ if (artifactMetadata != null) {
+ String artifactName = artifactMetadata.getArtifactName();
+ actionArtifact = actionArtifactDao.downloadArtifact(effectiveVersion, artifactUuId);
+ actionArtifact.setArtifactName(artifactName);
+
+ } else {
+ throw new ActionException(ActionErrorConstants.ACTION_ARTIFACT_ENTITY_NOT_EXIST_CODE,
+ ActionErrorConstants.ACTION_ARTIFACT_ENTITY_NOT_EXIST);
+ }
+ } else {
+ throw new ActionException(ACTION_ENTITY_NOT_EXIST_CODE,
+ ACTION_ENTITY_NOT_EXIST);
+ }
+ log.debug(" exit downloadArtifact with actionUUID= " + actionUuId + " and artifactUUID= "
+ + artifactUuId);
+ return actionArtifact;
+ }
+
+ /**
+ * Upload an artifact to an action.
+ *
+ * @param artifact {@link ActionArtifact} object representing the artifact and its
+ * metadata.
+ * @param actionInvariantUuId Invariant UUID of the action to which the artifact has to be
+ * uploaded.
+ * @param user User ID of the user sending the request.
+ * @return Uploaded action artifact object.
+ */
+ @Override
+ public ActionArtifact uploadArtifact(ActionArtifact artifact, String actionInvariantUuId,
+ String user) {
+ ActionArtifact uploadArtifactResponse = new ActionArtifact();
+ try {
+ log.debug("entering uploadArtifact with actionInvariantUUID= " + actionInvariantUuId
+ + "artifactName= " + artifact.getArtifactName());
+ actionLogPreProcessor(ActionSubOperation.GET_ACTION_VERSION, TARGET_ENTITY_DB);
+ VersionInfo versionInfo = versioningManager
+ .getEntityVersionInfo(ActionConstants.ACTION_VERSIONABLE_TYPE, actionInvariantUuId, user,
+ VersionableEntityAction.Write);
+ actionLogPostProcessor(StatusCode.COMPLETE);
+ log.metrics("");
+ Version activeVersion = versionInfo.getActiveVersion();
+ actionLogPreProcessor(ActionSubOperation.GET_ACTIONENTITY_BY_ACTIONINVID, TARGET_ENTITY_DB);
+ Action action = actionDao.get(new ActionEntity(actionInvariantUuId, activeVersion)).toDto();
+ actionLogPostProcessor(StatusCode.COMPLETE);
+ log.metrics("");
+ String artifactUuId = generateActionArtifactUuId(action, artifact.getArtifactName());
+ //Check for Unique document name
+ List<ActionArtifact> actionArtifacts = action.getArtifacts();
+ ActionArtifact artifactMetadata = getArtifactMetadataFromAction(actionArtifacts,
+ ActionConstants.ARTIFACT_METADATA_ATTR_NAME, artifact.getArtifactName());
+ if (artifactMetadata != null) {
+ throw new ActionException(ACTION_ARTIFACT_ALREADY_EXISTS_CODE,
+ String.format(ACTION_ARTIFACT_ALREADY_EXISTS, actionInvariantUuId));
+ }
+
+ //Create the artifact
+ artifact.setArtifactUuId(artifactUuId);
+ artifact.setTimestamp(getCurrentTimeStampUtc());
+ artifact.setEffectiveVersion(getEffectiveVersion(activeVersion.toString()));
+ actionArtifactDao.uploadArtifact(artifact);
+
+ //Update the action data field and timestamp
+ addArtifactMetadataInActionData(action, artifact);
+
+ //Set the response object
+ uploadArtifactResponse.setArtifactUuId(artifact.getArtifactUuId());
+ } catch (CoreException ce) {
+ formAndThrowException(ce);
+ }
+ log.debug(
+ "exit uploadArtifact with actionInvariantUUID= " + actionInvariantUuId + "artifactName= "
+ + artifact.getArtifactName());
+ return uploadArtifactResponse;
+ }
+
+ @Override
+ public void deleteArtifact(String actionInvariantUuId, String artifactUuId, String user)
+ throws ActionException {
+ log.debug(
+ "enter deleteArtifact with actionInvariantUUID= " + actionInvariantUuId + "artifactUUID= "
+ + artifactUuId + " and user = " + user);
+ Action action = actionDao.getLockedAction(actionInvariantUuId, user);
+ List<ActionArtifact> actionArtifacts = action.getArtifacts();
+ ActionArtifact artifactMetadata =
+ getArtifactMetadataFromAction(actionArtifacts, ActionConstants.ARTIFACT_METADATA_ATTR_UUID,
+ artifactUuId);
+ if (artifactMetadata == null) {
+ throw new ActionException(ActionErrorConstants.ACTION_ARTIFACT_ENTITY_NOT_EXIST_CODE,
+ ActionErrorConstants.ACTION_ARTIFACT_ENTITY_NOT_EXIST);
+ }
+ if (artifactMetadata.getArtifactProtection().equals(ActionArtifactProtection.readOnly.name())) {
+ throw new ActionException(ACTION_ARTIFACT_DELETE_READ_ONLY,
+ ACTION_ARTIFACT_DELETE_READ_ONLY_MSG);
+ } else {
+
+ //Update action by removing artifact metadata
+ String jsonData = action.getData();
+ List<ActionArtifact> artifacts = action.getArtifacts();//action.getArtifacts();
+ ActionArtifact artifact = null;
+ Iterator<ActionArtifact> it = artifacts.iterator();
+ while (it.hasNext()) {
+ artifact = it.next();
+ String artifactId = artifact.getArtifactUuId();
+ if (artifactId.equals(artifactUuId)) {
+ it.remove();
+ }
+ }
+
+ Map dataMap = JsonUtil.json2Object(jsonData, LinkedHashMap.class);
+ dataMap.put("artifacts", artifacts);
+ String data = JsonUtil.object2Json(dataMap);
+ ActionEntity actionEntity = action.toEntity();
+ actionEntity.setData(data);
+ actionLogPreProcessor(ActionSubOperation.UPDATE_ACTION, TARGET_ENTITY_DB);
+ actionDao.update(actionEntity);
+ actionLogPostProcessor(StatusCode.COMPLETE, null, "", false);
+ log.metrics("");
+ // delete Artifact if it's upload and delete action on same checkout version
+ String artifactName = artifactMetadata.getArtifactName();
+ String generatedArtifactUuId = generateActionArtifactUuId(action, artifactName);
+ if (generatedArtifactUuId.equals(artifactUuId)) {
+ ActionArtifactEntity artifactDeleteEntity =
+ new ActionArtifactEntity(artifact.getArtifactUuId(),
+ getEffectiveVersion(action.getVersion()));
+ actionLogPreProcessor(ActionSubOperation.DELETE_ACTION_ARTIFACT, TARGET_ENTITY_DB);
+ actionArtifactDao.delete(artifactDeleteEntity);
+ actionLogPostProcessor(StatusCode.COMPLETE, null, "", false);
+ log.metrics("");
+ }
+
+ }
+ log.debug(
+ "exit deleteArtifact with actionInvariantUUID= " + actionInvariantUuId + "artifactUUID= "
+ + artifactUuId + " and user = " + user);
+ }
+
+ /**
+ * Update an existing artifact.
+ *
+ * @param artifact {@link ActionArtifact} object representing the artifact and its
+ * metadata.
+ * @param actionInvariantUuId Invariant UUID of the action to which the artifact has to be
+ * uploaded.
+ * @param user User ID of the user sending the request.
+ */
+ public void updateArtifact(ActionArtifact artifact, String actionInvariantUuId, String user) {
+ try {
+ log.debug("Enter updateArtifact with actionInvariantUUID= " + actionInvariantUuId
+ + "artifactUUID= " + artifact.getArtifactUuId() + " and user = " + user);
+ actionLogPreProcessor(ActionSubOperation.GET_ACTION_VERSION, TARGET_ENTITY_API);
+ VersionInfo versionInfo = versioningManager
+ .getEntityVersionInfo(ActionConstants.ACTION_VERSIONABLE_TYPE, actionInvariantUuId, user,
+ VersionableEntityAction.Write);
+ actionLogPostProcessor(StatusCode.COMPLETE, null, "", false);
+ log.metrics("");
+ Version activeVersion = versionInfo.getActiveVersion();
+ actionLogPreProcessor(ActionSubOperation.GET_ACTIONENTITY_BY_ACTIONINVID, TARGET_ENTITY_DB);
+ Action action = actionDao.get(new ActionEntity(actionInvariantUuId, activeVersion)).toDto();
+ actionLogPostProcessor(StatusCode.COMPLETE, null, "", false);
+ log.metrics("");
+ List<ActionArtifact> actionArtifacts = action.getArtifacts();
+ ActionArtifact artifactMetadataByUuId = getArtifactMetadataFromAction(actionArtifacts,
+ ActionConstants.ARTIFACT_METADATA_ATTR_UUID, artifact.getArtifactUuId());
+ //Check if artifact is already in action or not
+ if (artifactMetadataByUuId == null) {
+ throw new ActionException(ActionErrorConstants.ACTION_ARTIFACT_ENTITY_NOT_EXIST_CODE,
+ ActionErrorConstants.ACTION_ARTIFACT_ENTITY_NOT_EXIST);
+ }
+ //If user tries to change artifact name
+ if (artifact.getArtifactName() != null
+ && !artifactMetadataByUuId.getArtifactName()
+ .equalsIgnoreCase(artifact.getArtifactName())) {
+ throw new ActionException(ACTION_UPDATE_NOT_ALLOWED_CODE,
+ ACTION_ARTIFACT_UPDATE_NAME_INVALID);
+ }
+
+ byte[] payload = artifact.getArtifact();
+ String artifactLabel = artifact.getArtifactLabel();
+ String artifactCategory = artifact.getArtifactCategory();
+ String artifactDescription = artifact.getArtifactDescription();
+ String artifactProtection = artifact.getArtifactProtection();
+ String artifactName = artifact.getArtifactName();
+ //If artifact read only
+ if (artifactMetadataByUuId.getArtifactProtection()
+ .equals(ActionArtifactProtection.readOnly.name())) {
+ if (artifactName != null || artifactLabel != null || artifactCategory != null
+ || artifactDescription != null || payload != null) {
+ throw new ActionException(ACTION_ARTIFACT_UPDATE_READ_ONLY,
+ ACTION_ARTIFACT_UPDATE_READ_ONLY_MSG);
+ }
+ //Changing value from readOnly to readWrite
+ if (artifactProtection != null
+ && artifactProtection.equals(ActionArtifactProtection.readWrite.name())) {
+ artifactMetadataByUuId.setArtifactProtection(ActionArtifactProtection.readWrite.name());
+ artifactMetadataByUuId.setTimestamp(getCurrentTimeStampUtc());
+ updateArtifactMetadataInActionData(action, artifactMetadataByUuId);
+ }
+ } else {
+ int effectiveVersion = getEffectiveVersion(activeVersion.toString());
+ if (artifactLabel != null) {
+ artifactMetadataByUuId.setArtifactLabel(artifactLabel);
+ }
+ if (artifactCategory != null) {
+ artifactMetadataByUuId.setArtifactCategory(artifactCategory);
+ }
+ if (artifactDescription != null) {
+ artifactMetadataByUuId.setArtifactDescription(artifactDescription);
+ }
+ if (artifactProtection != null) {
+ artifactMetadataByUuId.setArtifactProtection(artifactProtection);
+ }
+ if (payload != null) {
+ //get artifact data from action_artifact table for updating the content
+ ActionArtifact artifactContent = new ActionArtifact();
+ artifactContent.setArtifactUuId(artifact.getArtifactUuId());
+ artifactContent.setArtifact(payload);
+ artifactContent.setEffectiveVersion(effectiveVersion);
+ actionArtifactDao.updateArtifact(artifactContent);
+ }
+ //Update the action data field and timestamp
+ artifactMetadataByUuId.setTimestamp(getCurrentTimeStampUtc());
+ updateArtifactMetadataInActionData(action, artifactMetadataByUuId);
+ }
+ log.debug("exit updateArtifact with actionInvariantUUID= " + actionInvariantUuId
+ + "artifactUUID= " + artifact.getArtifactUuId() + " and user = " + user);
+ } catch (CoreException coreException) {
+ formAndThrowException(coreException);
+ }
+ }
+
+ /**
+ * Generate artifact UUID at runtime using action name and effective version.
+ *
+ * @param action {@link Action} for which the artifact is being uploaded/updated/downloaded.
+ * @param artifactName Artifact name.
+ * @return Generated UUID string.
+ */
+ private String generateActionArtifactUuId(Action action, String artifactName) {
+ int effectiveVersion = getEffectiveVersion(action.getVersion());
+ //Upper case for maintaining case-insensitive behavior for the artifact names
+ String artifactUuIdString
+ = action.getName().toUpperCase() + effectiveVersion + artifactName.toUpperCase();
+ String generateArtifactUuId
+ = UUID.nameUUIDFromBytes((artifactUuIdString).getBytes()).toString();
+ String artifactUuId = generateArtifactUuId.replace("-", "");
+ return artifactUuId.toUpperCase();
+ }
+
+ /**
+ * Generate the effective action version for artifact operations.
+ *
+ * @param actionVersion Version of the action as a string.
+ * @return Effective version to be used for artifact operations.
+ */
+ private int getEffectiveVersion(String actionVersion) {
+ Version version = Version.valueOf(actionVersion);
+ return version.getMajor() * 10000 + version.getMinor();
+ }
+
+ /**
+ * Update the data field of the Action object with the modified/generated fields after an
+ * operation.
+ *
+ * @param action Action object whose data field has to be updated.
+ * @return Updated {@link Action} object.
+ */
+ private Action updateData(Action action) {
+ log.debug("entering updateData to update data json for action with actionuuid= "
+ + action.getActionUuId());
+ Map<String, String> dataMap = new LinkedHashMap<>();
+ dataMap.put(ActionConstants.UNIQUE_ID, action.getActionUuId());
+ dataMap.put(ActionConstants.VERSION, action.getVersion());
+ dataMap.put(ActionConstants.INVARIANTUUID, action.getActionInvariantUuId());
+ dataMap.put(ActionConstants.STATUS, action.getStatus().name());
+
+ String data = action.getData();
+ Map<String, String> currentDataMap = JsonUtil.json2Object(data, LinkedHashMap.class);
+ dataMap.putAll(currentDataMap);
+ data = JsonUtil.object2Json(dataMap);
+ action.setData(data);
+ log.debug("exit updateData");
+ return action;
+ }
+
+ /**
+ * Method to add the artifact metadata in the data attribute of action table.
+ *
+ * @param action Action to which artifact is uploaded.
+ * @param artifact Uploaded artifact object.
+ */
+ private void addArtifactMetadataInActionData(Action action, ActionArtifact artifact) {
+
+ ActionArtifact artifactMetadata = new ActionArtifact();
+ artifactMetadata.setArtifactUuId(artifact.getArtifactUuId());
+ artifactMetadata.setArtifactName(artifact.getArtifactName());
+ artifactMetadata.setArtifactProtection(artifact.getArtifactProtection());
+ artifactMetadata.setArtifactLabel(artifact.getArtifactLabel());
+ artifactMetadata.setArtifactDescription(artifact.getArtifactDescription());
+ artifactMetadata.setArtifactCategory(artifact.getArtifactCategory());
+ artifactMetadata.setTimestamp(artifact.getTimestamp());
+ List<ActionArtifact> actionArtifacts = action.getArtifacts();
+ if (actionArtifacts == null) {
+ actionArtifacts = new ArrayList<>();
+ }
+ actionArtifacts.add(artifactMetadata);
+ action.setArtifacts(actionArtifacts);
+ String currentData = action.getData();
+ Map<String, Object> currentDataMap = JsonUtil.json2Object(currentData, LinkedHashMap.class);
+ currentDataMap.put(ActionConstants.ARTIFACTS, actionArtifacts);
+ String updatedActionData = JsonUtil.object2Json(currentDataMap);
+ action.setData(updatedActionData);
+ action.setTimestamp(artifact.getTimestamp());
+ actionDao.updateAction(action);
+ }
+
+ /**
+ * Get a list of last major and last minor version (no candidate) of action from a list of
+ * actions.
+ *
+ * @param actions Exhaustive list of the action versions.
+ * @return List {@link Action} of last major and last minor version (no candidate) of action from
+ a list of actions.
+ */
+ private List<Action> getMajorMinorVersionActions(List<Action> actions) {
+ log.debug(" entering getMajorMinorVersionActions for actions ");
+ List<Action> list = new LinkedList<>();
+ actionLogPreProcessor(ActionSubOperation.GET_VERSIONINFO_FOR_ALL_ACTIONS, TARGET_ENTITY_API);
+ Map<String, VersionInfo> actionVersionMap = versioningManager
+ .listEntitiesVersionInfo(ActionConstants.ACTION_VERSIONABLE_TYPE, "",
+ VersionableEntityAction.Read);
+ actionLogPostProcessor(StatusCode.COMPLETE);
+ log.metrics("");
+ for (Action action : actions) {
+ if (action.getStatus() == ActionStatus.Deleted) {
+ continue;
+ }
+ VersionInfo actionVersionInfo = actionVersionMap.get(action.getActionInvariantUuId());
+ if (actionVersionInfo.getActiveVersion() != null
+ && actionVersionInfo.getActiveVersion().equals(Version.valueOf(action.getVersion()))) {
+ list.add(action);
+ } else if (actionVersionInfo.getLatestFinalVersion() != null
+ && actionVersionInfo.getLatestFinalVersion().equals(Version.valueOf(action.getVersion()))
+ &&
+ !actionVersionInfo.getLatestFinalVersion().equals(actionVersionInfo.getActiveVersion())) {
+ list.add(action);
+ }
+ }
+ log.debug(" exit getMajorMinorVersionActions for actions ");
+ return list;
+ }
+
+ /**
+ * CoreException object wrapper from Version library to Action Library Exception.
+ *
+ * @param exception CoreException object from version library.
+ */
+ private void formAndThrowException(CoreException exception) {
+ log.debug(
+ "entering formAndThrowException with input CoreException =" + exception.code().id() + " "
+ + exception.getMessage());
+ String errorDescription = exception.getMessage();
+ String errorCode = exception.code().id();
+ ActionException actionException = new ActionException();
+ switch (errorCode) {
+ case VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST:
+ actionException.setErrorCode(ACTION_ENTITY_NOT_EXIST_CODE);
+ actionException.setDescription(ACTION_ENTITY_NOT_EXIST);
+ break;
+ case VersioningErrorCodes.CHECKOT_ON_LOCKED_ENTITY:
+ actionException.setErrorCode(ACTION_CHECKOUT_ON_LOCKED_ENTITY);
+ actionException.setDescription(errorDescription);
+ break;
+ case VersioningErrorCodes.CHECKIN_ON_UNLOCKED_ENTITY:
+ actionException.setErrorCode(ACTION_CHECKIN_ON_UNLOCKED_ENTITY);
+ actionException.setDescription(errorDescription);
+ break;
+ case VersioningErrorCodes.SUBMIT_FINALIZED_ENTITY_NOT_ALLOWED:
+ actionException.setErrorCode(ACTION_SUBMIT_FINALIZED_ENTITY_NOT_ALLOWED);
+ actionException.setDescription(errorDescription);
+ break;
+ case VersioningErrorCodes.SUBMIT_LOCKED_ENTITY_NOT_ALLOWED:
+ actionException.setErrorCode(ACTION_SUBMIT_LOCKED_ENTITY_NOT_ALLOWED);
+ actionException.setDescription(errorDescription);
+ break;
+ case VersioningErrorCodes.UNDO_CHECKOUT_ON_UNLOCKED_ENTITY:
+ actionException.setErrorCode(ACTION_UNDO_CHECKOUT_ON_UNLOCKED_ENTITY);
+ actionException.setDescription(errorDescription);
+ break;
+ case VersioningErrorCodes.EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER:
+ actionException.setErrorCode(ACTION_EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER);
+ actionException.setDescription(errorDescription.replace("edit", "updat"));
+ break;
+ case VersioningErrorCodes.CHECKIN_ON_ENTITY_LOCKED_BY_OTHER_USER:
+ actionException.setErrorCode(ACTION_CHECKIN_ON_ENTITY_LOCKED_BY_OTHER_USER);
+ actionException.setDescription(errorDescription);
+ break;
+ case VersioningErrorCodes.UNDO_CHECKOUT_ON_ENTITY_LOCKED_BY_OTHER_USER:
+ actionException.setErrorCode(ACTION_UNDO_CHECKOUT_ON_ENTITY_LOCKED_BY_OTHER_USER);
+ actionException.setDescription(errorDescription);
+ break;
+ case VersioningErrorCodes.EDIT_ON_UNLOCKED_ENTITY:
+ actionException.setErrorCode(ACTION_UPDATE_ON_UNLOCKED_ENTITY);
+ actionException.setDescription(errorDescription.replace("edit", "update"));
+ break;
+ case VersioningErrorCodes.DELETE_ON_LOCKED_ENTITY:
+ actionException.setErrorCode(ACTION_DELETE_ON_LOCKED_ENTITY_CODE);
+ actionException.setDescription(errorDescription);
+ break;
+ default:
+ actionException.setErrorCode(ACTION_INTERNAL_SERVER_ERR_CODE);
+ actionException.setDescription(exception.getMessage());
+
+ }
+ log.debug(
+ "exit formAndThrowException with ActionException =" + actionException.getErrorCode() + " "
+ + actionException.getDescription());
+ throw actionException;
+ }
+
+ /**
+ * Validates an action object for business layer validations before an update operation.
+ *
+ * @param action Action object to be validated.
+ * @param activeVersion Active version of the actoin object.
+ */
+ private void validateActions(Action action, Version activeVersion) {
+ try {
+ //Set version if not already available in input request
+ //If version set in input compare it with version from DB
+ if (StringUtils.isEmpty(action.getVersion())) {
+ action.setVersion(activeVersion.toString());
+ } else {
+ if (!activeVersion.equals(Version.valueOf(action.getVersion()))) {
+ throw new ActionException(ACTION_UPDATE_INVALID_VERSION,
+ String.format(ACTION_REQUESTED_VERSION_INVALID, action.getVersion()));
+ }
+ }
+ String invariantUuId = action.getActionInvariantUuId();
+ Version version = Version.valueOf(action.getVersion());
+ Action existingAction = getActions(invariantUuId, version);
+ if (existingAction == null || existingAction.getActionInvariantUuId() == null) {
+ throw new ActionException(ACTION_ENTITY_NOT_EXIST_CODE, ACTION_ENTITY_NOT_EXIST);
+ }
+ List<String> invalidParameters = new LinkedList<>();
+ //Prevent update of name, version and id fields
+ if (!existingAction.getName().equals(action.getName())) {
+ throw new ActionException(ACTION_UPDATE_NOT_ALLOWED_CODE_NAME,
+ ACTION_UPDATE_NOT_ALLOWED_FOR_NAME);
+ }
+ if (!StringUtils.isEmpty(action.getActionUuId())
+ && !existingAction.getActionUuId().equals(action.getActionUuId())) {
+ invalidParameters.add(ActionConstants.UNIQUE_ID);
+ }
+ if (action.getStatus() != null && (existingAction.getStatus() != action.getStatus())) {
+ invalidParameters.add(ActionConstants.STATUS);
+ }
+
+ if (!invalidParameters.isEmpty()) {
+ throw new ActionException(ACTION_UPDATE_NOT_ALLOWED_CODE,
+ String.format(ACTION_UPDATE_PARAM_INVALID, StringUtils.join(invalidParameters, ", ")));
+ }
+ action.setActionUuId(existingAction.getActionUuId());
+ } catch (IllegalArgumentException iae) {
+ String message = iae.getMessage();
+ switch (message) {
+ case VERSION_STRING_VIOLATION_MSG:
+ throw new ActionException(ACTION_UPDATE_NOT_ALLOWED_CODE, message);
+ default:
+ throw iae;
+ }
+ }
+ }
+
+ /**
+ * Get an action version entity object.
+ *
+ * @param invariantUuId Invariant UUID of the action.
+ * @param version Version of the action.
+ * @return {@link ActionEntity} object of the action version.
+ */
+ private ActionEntity getActionsEntityByVersion(String invariantUuId, Version version) {
+ log.debug(
+ "entering getActionsEntityByVersion with invariantUUID= " + invariantUuId + " and version"
+ + version);
+ ActionEntity entity = null;
+ if (version != null) {
+ actionLogPreProcessor(ActionSubOperation.GET_ACTIONENTITY_BY_VERSION, TARGET_ENTITY_DB);
+ entity = actionDao.get(
+ new ActionEntity(invariantUuId != null ? invariantUuId.toUpperCase() : null, version));
+ actionLogPostProcessor(StatusCode.COMPLETE);
+ log.metrics("");
+ }
+ log.debug(
+ "exit getActionsEntityByVersion with invariantUUID= " + invariantUuId + " and version"
+ + version);
+ return entity;
+ }
+
+ /**
+ * Get an action version object.
+ *
+ * @param invariantUuId Invariant UUID of the action.
+ * @param version Version of the action.
+ * @return {@link Action} object of the action version.
+ */
+ private Action getActions(String invariantUuId, Version version) {
+ ActionEntity actionEntity =
+ getActionsEntityByVersion(invariantUuId != null ? invariantUuId.toUpperCase() : null,
+ version);
+ return actionEntity != null ? actionEntity.toDto() : new Action();
+ }
+
+ /**
+ * Create and set the Unique ID in for an action version row.
+ *
+ * @param invariantUuId Invariant UUID of the action.
+ * @param version Version of the action.
+ * @param status Status of the action.
+ * @param user AT&T id of the user sending the request.
+ * @return {@link ActionEntity} object of the action version.
+ */
+ private ActionEntity updateUniqueIdForVersion(String invariantUuId, Version version,
+ String status, String user) {
+ log.debug(
+ "entering updateUniqueIdForVersion to update action with invariantUUID= " + invariantUuId
+ + " with version,status and user as ::" + version + " " + status + " " + user);
+ //generate UUID AND update for newly created entity row
+ ActionEntity actionEntity = getActionsEntityByVersion(invariantUuId, version);
+ if (actionEntity != null) {
+ log.debug("Found action to be updated");
+ String data = actionEntity.getData();
+ String uniqueId = CommonMethods.nextUuId();
+ Map<String, String> dataMap = JsonUtil.json2Object(data, LinkedHashMap.class);
+ dataMap.put(ActionConstants.UNIQUE_ID, uniqueId);
+ dataMap.put(ActionConstants.VERSION, version.toString());
+ dataMap.put(ActionConstants.STATUS, status);
+ data = JsonUtil.object2Json(dataMap);
+
+ actionEntity.setData(data);
+ actionEntity.setActionUuId(uniqueId);
+ actionEntity.setStatus(status);
+ actionEntity.setUser(user);
+ actionEntity.setTimestamp(getCurrentTimeStampUtc());
+ actionLogPreProcessor(ActionSubOperation.UPDATE_ACTION, TARGET_ENTITY_DB);
+ actionDao.update(actionEntity);
+ actionLogPostProcessor(StatusCode.COMPLETE);
+ log.metrics("");
+ }
+ log.debug(
+ "exit updateUniqueIdForVersion to update action with invariantUUID= " + invariantUuId);
+ return actionEntity;
+ }
+
+ /**
+ * Set the status for an action version row.
+ *
+ * @param invariantUuId Invariant UUID of the action.
+ * @param version Version of the action.
+ * @param status Status of the action.
+ * @param user AT&T id of the user sending the request.
+ * @return {@link ActionEntity} object of the action version.
+ */
+ private ActionEntity updateStatusForVersion(String invariantUuId, Version version, String status,
+ String user) {
+ log.debug(
+ "entering updateStatusForVersion with invariantUUID= " + invariantUuId + " and version"
+ + version + " for updating status " + status + " by user " + user);
+ ActionEntity actionEntity = getActionsEntityByVersion(invariantUuId, version);
+ if (actionEntity != null) {
+ String data = actionEntity.getData();
+ Map<String, String> dataMap = JsonUtil.json2Object(data, LinkedHashMap.class);
+ dataMap.put(ActionConstants.STATUS, status);
+ data = JsonUtil.object2Json(dataMap);
+ actionEntity.setData(data);
+ actionEntity.setStatus(status);
+ actionEntity.setUser(user);
+ actionEntity.setTimestamp(getCurrentTimeStampUtc());
+ actionLogPreProcessor(ActionSubOperation.UPDATE_ACTION, TARGET_ENTITY_DB);
+ actionDao.update(actionEntity);
+ actionLogPostProcessor(StatusCode.COMPLETE);
+ log.metrics("");
+ }
+ log.debug("exit updateStatusForVersion with invariantUUID= " + invariantUuId + " and version"
+ + version + " for updating status " + status + " by user " + user);
+ return actionEntity;
+
+ }
+
+ /**
+ * Gets an artifact from the action artifact metadata by artifact name.
+ *
+ * @param actionArtifactList Action's existing artifact list.
+ * @param artifactFilterType Search criteria for artifact in action artifact metadata.
+ * @param artifactFilterValue Value of Search parameter.
+ * @return Artifact metadata object if artifact is present in action and null otherwise.
+ */
+ private ActionArtifact getArtifactMetadataFromAction(List<ActionArtifact> actionArtifactList,
+ String artifactFilterType,
+ String artifactFilterValue) {
+ ActionArtifact artifact = null;
+ if (actionArtifactList != null && !actionArtifactList.isEmpty()) {
+ for (ActionArtifact entry : actionArtifactList) {
+ switch (artifactFilterType) {
+ case ActionConstants.ARTIFACT_METADATA_ATTR_UUID:
+ String artifactUuId = entry.getArtifactUuId();
+ if (artifactUuId != null && artifactUuId.equals(artifactFilterValue)) {
+ artifact = entry;
+ break;
+ }
+ break;
+ case ActionConstants.ARTIFACT_METADATA_ATTR_NAME:
+ String existingArtifactName = entry.getArtifactName().toLowerCase();
+ if (existingArtifactName.equals(artifactFilterValue.toLowerCase())) {
+ artifact = entry;
+ break;
+ }
+ break;
+ default:
+ }
+ }
+ }
+ return artifact;
+ }
+
+ /**
+ * Method to update the artifact metadata in the data attribute of action table.
+ *
+ * @param action Action to which artifact is uploaded.
+ * @param updatedArtifact updated artifact object.
+ */
+ private void updateArtifactMetadataInActionData(Action action, ActionArtifact updatedArtifact) {
+ for (ActionArtifact entry : action.getArtifacts()) {
+ if (entry.getArtifactUuId().equals(updatedArtifact.getArtifactUuId())) {
+ entry.setArtifactLabel(updatedArtifact.getArtifactLabel());
+ entry.setArtifactCategory(updatedArtifact.getArtifactCategory());
+ entry.setArtifactDescription(updatedArtifact.getArtifactDescription());
+ entry.setArtifactProtection(updatedArtifact.getArtifactProtection());
+ entry.setTimestamp(updatedArtifact.getTimestamp());
+ break;
+ }
+ }
+ String data = action.getData();
+ Map<String, Object> map = JsonUtil.json2Object(data, LinkedHashMap.class);
+ map.put(ActionConstants.ARTIFACTS, action.getArtifacts());
+ String updatedActionData = JsonUtil.object2Json(map);
+ action.setData(updatedActionData);
+ action.setTimestamp(updatedArtifact.getTimestamp());
+ actionDao.updateAction(action);
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/src/test/java/org/openecomp/sdc/action/ActionTest.java b/openecomp-be/backend/openecomp-sdc-action-manager/src/test/java/org/openecomp/sdc/action/ActionTest.java
new file mode 100644
index 0000000000..6d4b422154
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-action-manager/src/test/java/org/openecomp/sdc/action/ActionTest.java
@@ -0,0 +1,1207 @@
+package org.openecomp.sdc.action;
+
+import org.openecomp.sdc.action.dao.ActionDao;
+import org.openecomp.sdc.action.dao.ActionDaoFactory;
+import org.openecomp.sdc.action.dao.types.ActionEntity;
+import org.openecomp.sdc.action.errors.ActionErrorConstants;
+import org.openecomp.sdc.action.errors.ActionException;
+import org.openecomp.sdc.action.impl.ActionManagerImpl;
+
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
+import org.openecomp.core.utilities.json.JsonUtil;
+
+import org.openecomp.sdc.action.types.Action;
+import org.openecomp.sdc.action.types.ActionArtifact;
+import org.openecomp.sdc.action.types.ActionArtifactProtection;
+import org.openecomp.sdc.action.types.ActionStatus;
+import org.openecomp.sdc.action.types.EcompComponent;
+import org.testng.Assert;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Test;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.*;
+
+
+@SuppressWarnings("Duplicates")
+public class ActionTest {
+ private static final Version VERSION01 = new Version(0, 1);
+ private static final String USER1 = "actionTestUser1";
+ private static final String USER2 = "actionTestUser2";
+ private static final String ACTION_1 =
+ "{\"name\":\"Test_Action1_name\", \"endpointUri\":\"/test/action/uri\"}";
+ private static final String ACTION_2 =
+ "{\"name\":\"Test_Action2_list\", \"endpointUri\":\"/test/action/uri\", \"categoryList\":[\"Cat-test\", \"Cat-2\"], \"supportedModels\":[{\"versionId\" : \"Model-test\"}], \"supportedComponents\":[{\"Id\":\"APP-C\"}]}";
+ private static final String ACTION_3 =
+ "{\"name\":\"Test_Action3_list\", \"endpointUri\":\"/test/action/uri\", \"vendorList\":[\"Vendor-test\", \"Vendor-2\"], \"supportedModels\":[{\"versionId\" : \"Model-2\"}], \"supportedComponents\":[{\"Id\":\"MSO\"}]}";
+ private static final String ACTION_4 =
+ "{\"name\":\"Test_Action4_list\", \"endpointUri\":\"/test/action/uri\", \"categoryList\":[\"Cat-test\", \"Cat-2\"], \"supportedModels\":[{\"versionId\" : \"Model-test\"}], \"supportedComponents\":[{\"Id\":\"APP-C\"}]}";
+ private static final String ACTION_5 =
+ "{\"name\":\"Test_Action5_list\", \"endpointUri\":\"/test/action/uri\", \"vendorList\":[\"Vendor-test\", \"Vendor-2\"], \"supportedModels\":[{\"versionId\" : \"Model-2\"}], \"supportedComponents\":[{\"Id\":\"MSO\"}]}";
+ private static final String ACTION_6 =
+ "{\"name\":\"Test_Action6_name\", \"endpointUri\":\"/test/action/uri\"}";
+ private static final String ARTIFACT_TEST_ACTION =
+ "{\"name\":\"Test_Artifact_Action\", \"endpointUri\":\"/test/artifact/action/uri\", \"vendorList\":[\"Vendor-test\", \"Vendor-2\"], \"supportedModels\":[{\"versionId\" : \"Model-2\"}], \"supportedComponents\":[{\"Id\":\"MSO\"}]}";
+ private static final String ACTION_TEST_DELETE =
+ "{\"name\":\"Test_Delete_Action\", \"endpointUri\":\"/test/delete/action/uri\", \"categoryList\":[\"Cat-Delete-test\"], \"vendorList\":[\"Vendor-Delete\"], \"supportedModels\":[{\"versionId\" : \"Model-Delete\"}], \"supportedComponents\":[{\"Id\":\"MSO-Delete\"}]}";
+ private static final String ACTION_TEST_ARTIFACT_FILE_NAME = "test_artifact_file.txt";
+ private static final String ACTION_TEST_UPDATE_ARTIFACT_FILE_NAME =
+ "test_artifact_update_file.txt";
+ private static ActionManager actionManager = new ActionManagerImpl();
+ private static ActionDao actionDao = ActionDaoFactory.getInstance().createInterface();
+
+ private static NoSqlDb noSqlDb;
+
+ private static String action1Id;
+ private static String action2Id;
+
+ private static String actionUUId;
+ private static Action testArtifactAction;
+ private static String expectedArtifactUUID;
+ private static ActionArtifact actionArtifact;
+ private Action deleteAction;
+
+ private static String testCreate() {
+ Action action1 = createAction(ACTION_1);
+ Action actionCreated = actionManager.createAction(action1, USER1);
+ action1Id = actionCreated.getActionInvariantUuId();
+ actionUUId = actionCreated.getActionUuId();
+ action1.setVersion(VERSION01.toString());
+ ActionEntity loadedAction = actionDao.get(action1.toEntity());
+ assertActionEquals(actionCreated, loadedAction.toDto());
+ return action1Id;
+ }
+
+ private static Action createAction(String requestJSON) {
+ Action action = JsonUtil.json2Object(requestJSON, Action.class);
+ action.setData(requestJSON);
+ return action;
+ }
+
+ private static void assertActionEquals(Action actual, Action expected) {
+ Assert.assertEquals(actual.getActionUuId(), expected.getActionUuId());
+ Assert.assertEquals(actual.getVersion(), expected.getVersion());
+ Assert.assertEquals(actual.getName(), expected.getName());
+ //Assert.assertEquals(actual.getDescription(), expected.getDescription());
+ Assert.assertEquals(actual.getData(), expected.getData());
+ Assert.assertEquals(actual.getActionInvariantUuId(), expected.getActionInvariantUuId());
+ //Assert.assertEquals(actual.getEndpointUri(), expected.getEndpointUri());
+ Assert.assertEquals(actual.getStatus(), expected.getStatus());
+ Assert.assertEquals(actual.getSupportedComponents(), expected.getSupportedComponents());
+ Assert.assertEquals(actual.getSupportedModels(), expected.getSupportedModels());
+ }
+
+ @BeforeTest
+ private void init() {
+ this.noSqlDb = NoSqlDbFactory.getInstance().createInterface();
+ this.noSqlDb.execute("TRUNCATE dox.action;");
+ this.noSqlDb.execute("TRUNCATE dox.ecompcomponent;");
+ this.noSqlDb.execute("TRUNCATE dox.unique_value;");
+ this.noSqlDb.execute("TRUNCATE dox.action_artifact;");
+ this.noSqlDb.execute("insert into dox.ecompcomponent(id, name) values ('COMP-1','MSO');");
+ this.noSqlDb.execute("insert into dox.ecompcomponent(id, name) values ('COMP-2','APP-C');");
+ }
+
+ @Test
+ public void createTest() {
+ action1Id = testCreate();
+ }
+
+ @Test
+ public void testGetByInvIdOnCreate() {
+ String input =
+ "{\"name\":\"Action_2.0\",\"endpointUri\":\"new/action/uri\",\"categoryList\":[\"Cat-1\", \"Cat-2\"],\"displayName\":\"Updated Action\",\"vendorList\":[\"Vendor-1\", \"Vendor-2\"]," +
+ "\"supportedModels\":[{\"versionId\":\"AA56B177-9383-4934-8543-0F91A7A04971\"," +
+ "\"invariantID\":\"CC87B177-9383-4934-8543-0F91A7A07193\", \"name\":\"vABC\"," +
+ "\"version\":\"2.1\",\"vendor\":\"cisco\"}]," +
+ "\"supportedComponents\":[{\"Id\":\"BB47B177-9383-4934-8543-0F91A7A06448\", \"name\":\"appc\"}]}";
+ Action action1 = createAction(input);
+ Action action = actionManager.createAction(action1, USER1);
+ action2Id = action.getActionInvariantUuId();
+ List<Action> actions =
+ actionManager.getActionsByActionInvariantUuId(action.getActionInvariantUuId());
+ Assert.assertEquals(1, actions.size());
+ Assert.assertEquals("0.1", actions.get(0).getVersion());
+ }
+
+ @Test(dependsOnMethods = {"testGetByInvIdOnCreate"})
+ public void testGetByIgnoreCaseName() {
+ List<Action> actions =
+ actionManager.getFilteredActions(ActionConstants.FILTER_TYPE_NAME, "acTion_2.0");
+ List<String> actualVersionList = new ArrayList<String>();
+ List<String> expectedVersionList = new ArrayList<String>();
+ expectedVersionList.add("0.1");
+ for (Action action : actions) {
+ System.out.println("action by testGetByIgnoreCaseName is::::");
+ System.out.println(action.getActionInvariantUuId() + " " + action.getVersion());
+ actualVersionList.add(action.getVersion());
+ }
+ Assert.assertEquals(1, actions.size());
+ Assert.assertEquals(expectedVersionList, actualVersionList);
+ }
+
+ @Test(dependsOnMethods = {"testGetByInvIdOnCreate"})
+ public void testGetByInvIdManyVersionWithoutSubmit() {
+ for (int i = 0; i < 11; i++) {
+ actionManager.checkin(action2Id, USER1);
+ actionManager.checkout(action2Id, USER1);
+ }
+
+ List<Action> actions = actionManager.getActionsByActionInvariantUuId(action2Id);
+ List<String> actualVersionList = new ArrayList<String>();
+ List<String> expectedVersionList = new ArrayList<String>();
+ expectedVersionList.add("0.11");
+ expectedVersionList.add("0.12");
+ System.out.println(actions.size());
+ for (Action action : actions) {
+ System.out.println("testGetByInvIdManyVersionWithoutSubmit is::::");
+ System.out.println(action.getActionInvariantUuId() + " " + action.getVersion());
+ actualVersionList.add(action.getVersion());
+ }
+ Assert.assertEquals(2, actions.size());
+ Assert.assertEquals(expectedVersionList, actualVersionList);
+ }
+
+ @Test(dependsOnMethods = {"testGetByInvIdManyVersionWithoutSubmit"})
+ public void testGetByInvIdManyVersionWithFirstSubmit() {
+ actionManager.checkin(action2Id, USER1);//Checkin 0.12
+ actionManager.submit(action2Id, USER1); //1.0
+ for (int i = 0; i < 11; i++) {
+ actionManager.checkout(action2Id, USER1);
+ actionManager.checkin(action2Id, USER1);
+ }
+
+ List<Action> actions = actionManager.getActionsByActionInvariantUuId(action2Id);
+ List<String> actualVersionList = new ArrayList<String>();
+ List<String> expectedVersionList = new ArrayList<String>();
+ expectedVersionList.add("1.0");
+ expectedVersionList.add("1.11");
+ System.out.println(actions.size());
+ for (Action action : actions) {
+ System.out.println("testGetByInvIdManyVersionWithFirstSubmit is::::");
+ System.out.println(action.getActionInvariantUuId() + " " + action.getVersion());
+ actualVersionList.add(action.getVersion());
+ }
+ Assert.assertEquals(2, actions.size());
+ Assert.assertEquals(expectedVersionList, actualVersionList);
+ }
+
+ @Test(dependsOnMethods = {"testGetByInvIdManyVersionWithFirstSubmit"})
+ public void testGetByInvIdManyVersionWithMultSubmit() {
+ actionManager.submit(action2Id, USER1); //2.0
+ for (int i = 0; i < 11; i++) {
+ actionManager.checkout(action2Id, USER1);
+ actionManager.checkin(action2Id, USER1);
+ }
+ actionManager.checkout(action2Id, USER1); //2.12
+
+ List<Action> actions = actionManager.getActionsByActionInvariantUuId(action2Id);
+ List<String> actualVersionList = new ArrayList<String>();
+ List<String> expectedVersionList = new ArrayList<String>();
+ expectedVersionList.add("1.0");
+ expectedVersionList.add("2.0");
+ expectedVersionList.add("2.11");
+ expectedVersionList.add("2.12");
+ System.out.println(actions.size());
+ for (Action action : actions) {
+ System.out.println("testGetByInvIdManyVersionWithMultSubmit is::::");
+ System.out.println(action.getActionInvariantUuId() + " " + action.getVersion());
+ actualVersionList.add(action.getVersion());
+ }
+ Assert.assertEquals(4, actions.size());
+ Assert.assertEquals(expectedVersionList, actualVersionList);
+ }
+
+ @Test(dependsOnMethods = {"testGetByInvIdManyVersionWithMultSubmit"})
+ public void testGetByInvIdOnName() {
+ for (int i = 0; i < 9; i++) {
+ actionManager.checkin(action2Id, USER1);
+ actionManager.checkout(action2Id, USER1); //2.21
+ }
+
+ List<Action> actions =
+ actionManager.getFilteredActions(ActionConstants.FILTER_TYPE_NAME, "Action_2.0");
+ List<String> actualVersionList = new ArrayList<String>();
+ List<String> expectedVersionList = new ArrayList<String>();
+ expectedVersionList.add("1.0");
+ expectedVersionList.add("2.0");
+ expectedVersionList.add("2.20");
+ expectedVersionList.add("2.21");
+ for (Action action : actions) {
+ System.out.println("action by testGetByInvIdOnName is::::");
+ System.out.println(action.getActionInvariantUuId() + " " + action.getVersion());
+ actualVersionList.add(action.getVersion());
+ }
+ Assert.assertEquals(4, actions.size());
+ Assert.assertEquals(expectedVersionList, actualVersionList);
+ }
+
+ @Test(dependsOnMethods = {"createTest"})
+ public void testCreateWithExistingActionName_negative() {
+ try {
+ actionManager.createAction(createAction(ACTION_1), USER1);
+ Assert.fail();
+ } catch (ActionException e) {
+ Assert.assertEquals(e.getErrorCode(), ActionErrorConstants.ACTION_ENTITY_UNIQUE_VALUE_ERROR);
+ }
+ }
+
+ @Test(groups = "updateTestGroup",
+ dependsOnMethods = {"testCreateWithExistingActionName_negative", "createTest"})
+ public void updateTest() {
+ List<String> newSupportedComponents = new LinkedList<>();
+ newSupportedComponents.add("Updated MSO");
+ newSupportedComponents.add("Updated APPC");
+
+ List<String> newSupportedModels = new LinkedList<>();
+ newSupportedModels.add("Updated Model-1");
+ newSupportedModels.add("Updated Model-2");
+
+ Action action = new Action();
+ action.setActionInvariantUuId(action1Id);
+ action.setVersion(VERSION01.toString());
+ ActionEntity existingActionEntity = actionDao.get(action.toEntity());
+ existingActionEntity
+ .setSupportedComponents(newSupportedComponents); //Updating Supported components
+ existingActionEntity.setSupportedModels(newSupportedModels); //Updating supported models
+ //Persisting the updated entity
+ Action updatedAction = actionManager.updateAction(existingActionEntity.toDto(), USER1);
+
+ //Create expected response template
+ ActionEntity expectedActionEntity = new ActionEntity(action1Id, VERSION01);
+ expectedActionEntity.setName(existingActionEntity.getName());
+ expectedActionEntity.setActionUuId(existingActionEntity.getActionUuId());
+ expectedActionEntity.setActionInvariantUuId(existingActionEntity.getActionInvariantUuId());
+ expectedActionEntity.setData(existingActionEntity.getData());
+ expectedActionEntity.setStatus(ActionStatus.Locked.name());
+ expectedActionEntity.setSupportedComponents(newSupportedComponents);
+ expectedActionEntity.setSupportedModels(newSupportedModels);
+ Action expectedAction = updateData(expectedActionEntity.toDto());
+
+ assertActionEquals(updatedAction, expectedAction);
+ }
+
+ @Test(groups = "updateTestGroup", dependsOnMethods = {"updateTest"})
+ public void testUpdateName_negative() {
+ try {
+ Action action = new Action();
+ action.setActionInvariantUuId(action1Id);
+ action.setVersion(VERSION01.toString());
+ ActionEntity existingActionEntity = actionDao.get(action.toEntity());
+ action = existingActionEntity.toDto();
+ action.setName("Update - New Action Name");
+ //Persisting the updated entity
+ actionManager.updateAction(action, USER1);
+ Assert.fail();
+ } catch (ActionException e) {
+ Assert
+ .assertEquals(e.getErrorCode(), ActionErrorConstants.ACTION_UPDATE_NOT_ALLOWED_CODE_NAME);
+ }
+ }
+
+ @Test(groups = "updateTestGroup", dependsOnMethods = {"updateTest"})
+ public void testUpdateVersion_negative() {
+ try {
+ Action action = new Action();
+ action.setActionInvariantUuId(action1Id);
+ action.setVersion(VERSION01.toString());
+ ActionEntity existingActionEntity = actionDao.get(action.toEntity());
+ action = existingActionEntity.toDto();
+ action.setVersion("0.3");
+ //Persisting the updated entity
+ actionManager.updateAction(action, USER1);
+ Assert.fail();
+ } catch (ActionException e) {
+ Assert.assertEquals(e.getErrorCode(), ActionErrorConstants.ACTION_UPDATE_INVALID_VERSION);
+ }
+ }
+
+ @Test(groups = "updateTestGroup", dependsOnMethods = {"updateTest"})
+ public void testUpdateInvalidVersion_negative() {
+ try {
+ Action action = new Action();
+ action.setActionInvariantUuId(action1Id);
+ action.setVersion(VERSION01.toString());
+ ActionEntity existingActionEntity = actionDao.get(action.toEntity());
+ //existingActionEntity.setDisplayName("Display Name Updated");
+ Action updatedAction = existingActionEntity.toDto();
+ updatedAction.setVersion("invalid_version_format");
+ //Persisting the updated entity
+ actionManager.updateAction(updatedAction, USER1);
+ Assert.fail();
+ } catch (ActionException e) {
+ Assert.assertEquals(e.getErrorCode(), ActionErrorConstants.ACTION_UPDATE_NOT_ALLOWED_CODE);
+ }
+ }
+
+ /*@Test(groups = "updateTestGroup", dependsOnMethods = {"updateTest"})
+ public void testUpdateStatusInvalidEnum_negative() {
+ try {
+ Action action = new Action();
+ action.setActionInvariantUuId(action1Id);
+ action.setVersion(VERSION01.toString());
+ ActionEntity existingActionEntity = actionDao.get(action.toEntity());
+ existingActionEntity.setStatus("invalid_status_string");
+ //Persisting the updated entity
+ actionManager.updateAction(existingActionEntity.toDto(),USER1);
+ Assert.fail();
+ } catch (ActionException e) {
+ Assert.assertEquals(e.getErrorCode(), ActionErrorConstants.ACTION_UPDATE_NOT_ALLOWED_CODE);
+ } catch (IllegalArgumentException ie){
+ String message = ie.getMessage();
+ boolean result = message.contains("No enum constant");
+ Assert.assertEquals(true, result);
+ }
+ }*/
+
+ @Test(groups = "updateTestGroup", dependsOnMethods = {"updateTest"})
+ public void testUpdateInvariantId_negative() {
+ try {
+ Action action = new Action();
+ action.setActionInvariantUuId(action1Id);
+ action.setVersion(VERSION01.toString());
+ ActionEntity existingActionEntity = actionDao.get(action.toEntity());
+ action = existingActionEntity.toDto();
+ action.setActionInvariantUuId(UUID.randomUUID().toString());
+ //Persisting the updated entity
+ actionManager.updateAction(action, USER1);
+ Assert.fail();
+ } catch (ActionException e) {
+ Assert.assertEquals(e.getErrorCode(), ActionErrorConstants.ACTION_ENTITY_NOT_EXIST_CODE);
+ }
+ }
+
+ @Test(groups = "updateTestGroup", dependsOnMethods = {"updateTest"})
+ public void testUpdateUniqueId_negative() {
+ try {
+ Action action = new Action();
+ action.setActionInvariantUuId(action1Id);
+ action.setVersion(VERSION01.toString());
+ ActionEntity existingActionEntity = actionDao.get(action.toEntity());
+ //existingActionEntity.setActionUuId(UUID.randomUUID().toString());
+
+ action = existingActionEntity.toDto();
+ action.setActionUuId(UUID.randomUUID().toString());
+ //Persisting the updated entity
+ //actionManager.updateAction(existingActionEntity.toDto(),USER1);
+ actionManager.updateAction(action, USER1);
+ Assert.fail();
+ } catch (ActionException e) {
+ Assert.assertEquals(e.getErrorCode(), ActionErrorConstants.ACTION_UPDATE_NOT_ALLOWED_CODE);
+ }
+ }
+
+ @Test(groups = "updateTestGroup", dependsOnMethods = {"updateTest"})
+ public void testUpdateStatus_negative() {
+ try {
+ Action action = new Action();
+ action.setActionInvariantUuId(action1Id);
+ action.setVersion(VERSION01.toString());
+ ActionEntity existingActionEntity = actionDao.get(action.toEntity());
+ action = existingActionEntity.toDto();
+ action.setStatus(ActionStatus.Final);
+ //Persisting the updated entity
+ actionManager.updateAction(action, USER1);
+ Assert.fail();
+ } catch (ActionException e) {
+ Assert.assertEquals(e.getErrorCode(), ActionErrorConstants.ACTION_UPDATE_NOT_ALLOWED_CODE);
+ } catch (IllegalArgumentException ie) {
+ String message = ie.getMessage();
+ boolean result = message.contains("No enum constant");
+ Assert.assertEquals(true, result);
+ }
+ }
+
+ @Test(groups = "updateTestGroup", dependsOnMethods = {"updateTest"})
+ public void testUpdateOtherUser_negative() {
+ try {
+ Action action = new Action();
+ action.setActionInvariantUuId(action1Id);
+ action.setVersion(VERSION01.toString());
+ ActionEntity existingActionEntity = actionDao.get(action.toEntity());
+ action = existingActionEntity.toDto();
+ //existingActionEntity.setDescription("Testing Update using other user");
+ //Persisting the updated entity
+ actionManager.updateAction(action, USER2);
+ Assert.fail();
+ } catch (ActionException e) {
+ Assert.assertEquals(e.getErrorCode(),
+ ActionErrorConstants.ACTION_EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER);
+ }
+ }
+
+ @Test(dependsOnMethods = {"createTest"})
+ public void testCheckOutOnCheckOut() {
+ try {
+ actionManager.checkout(action1Id, USER1);
+ } catch (ActionException wae) {
+ Assert
+ .assertEquals(wae.getErrorCode(), ActionErrorConstants.ACTION_CHECKOUT_ON_LOCKED_ENTITY);
+ Assert.assertEquals(wae.getDescription(),
+ "Can not check out versionable entity Action with id " + action1Id +
+ " since it is checked out by other user: " + USER1 + ".");
+ }
+ }
+
+ @Test(dependsOnMethods = {"createTest"})
+ public void testCheckOutOnCheckOutWithOtherUser() {
+ try {
+ actionManager.checkout(action1Id, "invlaiduser");
+ } catch (ActionException wae) {
+ Assert.assertEquals(wae.getErrorCode(),
+ ActionErrorConstants.ACTION_CHECKOUT_ON_LOCKED_ENTITY_OTHER_USER);
+ Assert.assertEquals(wae.getDescription(),
+ "Can not check out versionable entity Action with id " + action1Id +
+ " since it is checked out by other user: " + USER1 + ".");
+ }
+ }
+
+ @Test(dependsOnGroups = {"updateTestGroup"})
+ public void testCheckIn() {
+ Action action = actionManager.checkin(action1Id, USER1);
+ Assert.assertEquals(action.getActionInvariantUuId(), action1Id);
+ Assert.assertEquals(action.getStatus(), ActionStatus.Available);
+ Assert.assertEquals(action.getVersion(), VERSION01.toString());
+ Assert.assertNotNull(action.getActionUuId());
+ }
+
+ @Test(dependsOnMethods = {"testCheckIn"})
+ public void testUpdateOnCheckedInAction_negative() {
+ try {
+ Action action = new Action();
+ action.setActionInvariantUuId(action1Id);
+ action.setVersion(VERSION01.toString());
+ ActionEntity existingActionEntity = actionDao.get(action.toEntity());
+ //existingActionEntity.setDescription("Testing Update On Checked In Action");
+ //Persisting the updated entity
+ actionManager.updateAction(existingActionEntity.toDto(), USER1);
+ Assert.fail();
+ } catch (ActionException e) {
+ Assert.assertEquals(e.getErrorCode(), ActionErrorConstants.ACTION_UPDATE_ON_UNLOCKED_ENTITY);
+ }
+ }
+
+ @Test(dependsOnMethods = {"testUpdateOnCheckedInAction_negative"})
+ public void testSubmit() {
+ Action action = actionManager.submit(action1Id, USER1);
+ ActionEntity loadedAction = actionDao.get(action.toEntity());
+ assertActionEquals(action, loadedAction.toDto());
+ }
+
+ @Test(dependsOnMethods = {"testSubmit"})
+ public void testCheckInWithoutCheckout() {
+ try {
+ actionManager.checkin(action1Id, "invaliduser");
+ } catch (ActionException wae) {
+ Assert
+ .assertEquals(wae.getErrorCode(), ActionErrorConstants.ACTION_CHECKIN_ON_UNLOCKED_ENTITY);
+ Assert.assertEquals(wae.getDescription(),
+ "Can not check in versionable entity Action with id " + action1Id +
+ " since it is not checked out.");
+ }
+ }
+
+ @Test(dependsOnMethods = {"testSubmit"})
+ public void testCheckOut() {
+ final Version VERSION02 = new Version(1, 1);
+ Action action = null;
+ action = actionManager.checkout(action1Id, USER1);
+ ActionEntity loadedAction = actionDao.get(action.toEntity());
+ assertActionEquals(action, loadedAction.toDto());
+ }
+
+ @Test(dependsOnMethods = {"testCheckOut"})
+ public void testCheckInWithOtherUser() {
+ try {
+ actionManager.checkin(action1Id, "invaliduser");
+ } catch (ActionException wae) {
+ Assert.assertEquals(wae.getErrorCode(),
+ ActionErrorConstants.ACTION_CHECKIN_ON_ENTITY_LOCKED_BY_OTHER_USER);
+ Assert.assertEquals(wae.getDescription(),
+ "Can not check in versionable entity Action with id " + action1Id +
+ " since it is checked out by other user: " + USER1 + ".");
+ }
+ }
+
+ @Test(dependsOnMethods = {"testCheckOut"})
+ public void testSubmitOnCheckout() {
+ try {
+ actionManager.submit(action1Id, USER1);
+ } catch (ActionException wae) {
+ Assert.assertEquals(wae.getErrorCode(),
+ ActionErrorConstants.ACTION_SUBMIT_LOCKED_ENTITY_NOT_ALLOWED);
+ Assert.assertEquals(wae.getDescription(), "Versionable entity Action with id " + action1Id +
+ " can not be submitted since it is currently locked by user " + USER1 + ".");
+ }
+ }
+
+ @Test(dependsOnMethods = {"testCheckOut"})
+ public void testUndoCheckout() {
+ final Version VERSION11 = new Version(1, 1);
+ actionManager.undoCheckout(action1Id, USER1);
+ Action action = new Action();
+ action.setActionInvariantUuId(action1Id);
+ action.setVersion(VERSION11.toString());
+ ActionEntity existingActionEntity = actionDao.get(action.toEntity());
+ Assert.assertNull(existingActionEntity);
+ }
+
+ @Test
+ public void testUndoCheckoutOnCreate() {
+ Action action = actionManager.createAction(createAction(ACTION_6), USER1);
+ actionManager.undoCheckout(action.getActionInvariantUuId(), USER1);
+ ActionEntity existingActionEntity = actionDao.get(action.toEntity());
+ Assert.assertNull(existingActionEntity);
+ }
+
+ @Test
+ public void testGetECOMPComponents() {
+ List<EcompComponent> componentList = actionManager.getEcompComponents();
+ List<EcompComponent> expectedComponentList = new ArrayList<>();
+ expectedComponentList.add(new EcompComponent("MSO", "COMP-1"));
+ expectedComponentList.add(new EcompComponent("APP-C", "COMP-2"));
+ for (EcompComponent e : componentList) {
+ boolean res = expectedComponentList.contains(e);
+ Assert.assertEquals(res, true);
+ }
+ }
+
+ @Test
+ public void testgetActionsByActionUUID_Negative() {
+ try {
+ Action action = actionManager.getActionsByActionUuId("");
+ Assert.fail();
+ } catch (ActionException e) {
+ Assert.assertEquals(e.getErrorCode(), ActionErrorConstants.ACTION_ENTITY_NOT_EXIST_CODE);
+ }
+ }
+
+ @Test(dependsOnMethods = {"createTest"})
+ public void testgetActionsByActionUUID() {
+ Action action = actionManager.getActionsByActionUuId(actionUUId);
+ Assert.assertNotNull(action.getData());
+ }
+
+ @Test
+ public void testGetByCategory() {
+ createActionVersions(ACTION_2);
+ createActionVersions(ACTION_3);
+ createActionVersions(ACTION_4);
+ createActionVersions(ACTION_5);
+ List<Action> actions =
+ actionManager.getFilteredActions(ActionConstants.FILTER_TYPE_CATEGORY, "CAT-teSt");
+
+ List<String> actualNameVersionList = new ArrayList<String>();
+ List<String> expectedNameVersionList = new ArrayList<String>();
+ expectedNameVersionList.add("Test_Action4_list:2.2");
+ expectedNameVersionList.add("Test_Action4_list:2.0");
+ expectedNameVersionList.add("Test_Action2_list:2.2");
+ expectedNameVersionList.add("Test_Action2_list:2.0");
+ for (Action action : actions) {
+ System.out.println("action by category is::::");
+ System.out.println(action.getName() + " " + action.getVersion());
+ actualNameVersionList.add(action.getName() + ":" + action.getVersion());
+ }
+ Assert.assertEquals(4, actions.size());
+ Assert.assertEquals(expectedNameVersionList, actualNameVersionList);
+ }
+
+ @Test(dependsOnMethods = {"testGetByCategory"})
+ public void testGetByVendor() {
+ List<Action> actions =
+ actionManager.getFilteredActions(ActionConstants.FILTER_TYPE_VENDOR, "VendOr-tESt");
+
+ List<String> actualNameVersionList = new ArrayList<String>();
+ List<String> expectedNameVersionList = new ArrayList<String>();
+ expectedNameVersionList.add("Test_Action5_list:2.2");
+ expectedNameVersionList.add("Test_Action5_list:2.0");
+ expectedNameVersionList.add("Test_Action3_list:2.2");
+ expectedNameVersionList.add("Test_Action3_list:2.0");
+ for (Action action : actions) {
+ System.out.println("action by category is::::");
+ System.out.println(action.getName() + " " + action.getVersion());
+ actualNameVersionList.add(action.getName() + ":" + action.getVersion());
+ }
+ Assert.assertEquals(4, actions.size());
+ Assert.assertEquals(expectedNameVersionList, actualNameVersionList);
+ }
+
+ @Test(dependsOnMethods = {"testGetByCategory"})
+ public void testGetBySupportedModel() {
+ List<Action> actions =
+ actionManager.getFilteredActions(ActionConstants.FILTER_TYPE_MODEL, "MODEL-tEst");
+
+ List<String> actualNameVersionList = new ArrayList<>();
+ List<String> expectedNameVersionList = new ArrayList<>();
+ expectedNameVersionList.add("Test_Action4_list:2.2");
+ expectedNameVersionList.add("Test_Action4_list:2.0");
+ expectedNameVersionList.add("Test_Action2_list:2.2");
+ expectedNameVersionList.add("Test_Action2_list:2.0");
+ for (Action action : actions) {
+ actualNameVersionList.add(action.getName() + ":" + action.getVersion());
+ }
+ Assert.assertEquals(4, actions.size());
+ Assert.assertEquals(expectedNameVersionList, actualNameVersionList);
+ }
+
+ @Test(dependsOnMethods = {"testGetByCategory"})
+ public void testGetBySupportedComponent() {
+ List<Action> actions =
+ actionManager.getFilteredActions(ActionConstants.FILTER_TYPE_ECOMP_COMPONENT, "mso");
+
+ List<String> actualNameVersionList = new ArrayList<>();
+ List<String> expectedNameVersionList = new ArrayList<>();
+ expectedNameVersionList.add("Test_Action5_list:2.2");
+ expectedNameVersionList.add("Test_Action5_list:2.0");
+ expectedNameVersionList.add("Test_Action3_list:2.2");
+ expectedNameVersionList.add("Test_Action3_list:2.0");
+ for (Action action : actions) {
+ actualNameVersionList.add(action.getName() + ":" + action.getVersion());
+ }
+ Assert.assertEquals(4, actions.size());
+ Assert.assertEquals(expectedNameVersionList, actualNameVersionList);
+ }
+
+ @Test(dependsOnMethods = {"testGetByCategory"})
+ public void testGetAllActions() {
+ List<Action> actions =
+ actionManager.getFilteredActions(ActionConstants.FILTER_TYPE_NONE, "MSO");
+
+ List<String> actualNameVersionList = new ArrayList<>();
+ List<String> expectedNameVersionList = new ArrayList<>();
+
+ expectedNameVersionList.add("Test_Action5_list:2.2");
+ expectedNameVersionList.add("Test_Action5_list:2.0");
+ expectedNameVersionList.add("Test_Action3_list:2.2");
+ expectedNameVersionList.add("Test_Action3_list:2.0");
+ expectedNameVersionList.add("Test_Action4_list:2.2");
+ expectedNameVersionList.add("Test_Action4_list:2.0");
+ expectedNameVersionList.add("Test_Action2_list:2.2");
+ expectedNameVersionList.add("Test_Action2_list:2.0");
+ for (Action action : actions) {
+ actualNameVersionList.add(action.getName() + ":" + action.getVersion());
+ }
+ Assert.assertEquals(8, actions.size());
+
+ for (String s : actualNameVersionList) {
+ boolean res = expectedNameVersionList.contains(s);
+ Assert.assertEquals(res, true);
+ }
+ }
+
+ @Test(dependsOnMethods = {"testGetAllActions"})
+ public void testDeleteCheckedOutAction_Negative() {
+ try {
+ initDeleteActionTest();
+ String deleteActionInvariantId = deleteAction.getActionInvariantUuId();
+ actionManager.deleteAction(deleteActionInvariantId, USER1);
+ Assert.fail();
+ } catch (ActionException e) {
+ Assert.assertEquals(e.getErrorCode(), ActionErrorConstants.ACTION_DELETE_ON_LOCKED_ENTITY_CODE);
+ Assert.assertEquals(e.getDescription(), String.format(
+ "Can not delete versionable entity Action with id %s since it is checked out by other user: %s",
+ deleteAction.getActionInvariantUuId(), USER1 + "."));
+ }
+ }
+
+ @Test(dependsOnMethods = {"testDeleteCheckedOutAction_Negative"})
+ public void testDeleteAction() {
+ try {
+ String deleteActionInvariantId = deleteAction.getActionInvariantUuId();
+ actionManager.checkin(deleteActionInvariantId, USER1);
+ actionManager.deleteAction(deleteActionInvariantId, USER1);
+ } catch (ActionException e) {
+ Assert.fail("Delete action test failed with exception : " + e.getDescription());
+ }
+ }
+
+ @Test(dependsOnMethods = {"testDeleteAction"})
+ public void testDeletedActionVersioningOperations_Negative() {
+ String deleteActionInvariantId = deleteAction.getActionInvariantUuId();
+ try {
+ actionManager.checkout(deleteActionInvariantId, USER1);
+ Assert.fail();
+ } catch (ActionException e) {
+ Assert.assertEquals(e.getErrorCode(), ActionErrorConstants.ACTION_ENTITY_NOT_EXIST_CODE);
+ Assert.assertEquals(e.getDescription(), ActionErrorConstants.ACTION_ENTITY_NOT_EXIST);
+ }
+ try {
+ actionManager.checkin(deleteActionInvariantId, USER1);
+ Assert.fail();
+ } catch (ActionException e) {
+ Assert.assertEquals(e.getErrorCode(), ActionErrorConstants.ACTION_ENTITY_NOT_EXIST_CODE);
+ Assert.assertEquals(e.getDescription(), ActionErrorConstants.ACTION_ENTITY_NOT_EXIST);
+ }
+ try {
+ actionManager.submit(deleteActionInvariantId, USER1);
+ Assert.fail();
+ } catch (ActionException e) {
+ Assert.assertEquals(e.getErrorCode(), ActionErrorConstants.ACTION_ENTITY_NOT_EXIST_CODE);
+ Assert.assertEquals(e.getDescription(), ActionErrorConstants.ACTION_ENTITY_NOT_EXIST);
+ }
+ try {
+ actionManager.undoCheckout(deleteActionInvariantId, USER1);
+ Assert.fail();
+ } catch (ActionException e) {
+ Assert.assertEquals(e.getErrorCode(), ActionErrorConstants.ACTION_ENTITY_NOT_EXIST_CODE);
+ Assert.assertEquals(e.getDescription(), ActionErrorConstants.ACTION_ENTITY_NOT_EXIST);
+ }
+ try {
+ actionManager.deleteAction(deleteActionInvariantId, USER1);
+ Assert.fail();
+ } catch (ActionException e) {
+ Assert.assertEquals(e.getErrorCode(), ActionErrorConstants.ACTION_ENTITY_NOT_EXIST_CODE);
+ Assert.assertEquals(e.getDescription(), ActionErrorConstants.ACTION_ENTITY_NOT_EXIST);
+ }
+ }
+
+ @Test(dependsOnMethods = {"testDeleteAction"})
+ public void testCreateActionWithDeletedActionName_Negative() {
+ try {
+ actionManager.createAction(createAction(ACTION_TEST_DELETE), USER1);
+ Assert.fail();
+ } catch (ActionException e) {
+ Assert.assertEquals(e.getErrorCode(), ActionErrorConstants.ACTION_ENTITY_UNIQUE_VALUE_ERROR);
+ Assert.assertEquals(e.getDescription(), String
+ .format(ActionErrorConstants.ACTION_ENTITY_UNIQUE_VALUE_MSG, ActionConstants.UniqueValues.ACTION_NAME,
+ deleteAction.getName()));
+ }
+ }
+
+ @Test(dependsOnMethods = {"testDeleteAction"})
+ public void testDeletedActionGetQueries() {
+ String deleteActionInvariantId = deleteAction.getActionInvariantUuId();
+ List<Action> invariantFetchResults =
+ actionManager.getActionsByActionInvariantUuId(deleteActionInvariantId);
+ Assert.assertEquals(invariantFetchResults.size(), 3);
+ for (Action a : invariantFetchResults) {
+ Assert.assertEquals(a.getStatus(), ActionStatus.Deleted);
+ }
+
+ Action actionUUIDFetchResult =
+ actionManager.getActionsByActionUuId(deleteAction.getActionUuId());
+ Assert.assertEquals(actionUUIDFetchResult.getStatus(), ActionStatus.Deleted);
+
+ List<Action> nameFetchResults =
+ actionManager.getFilteredActions(ActionConstants.FILTER_TYPE_NAME, "Test_Delete_Action");
+ Assert.assertEquals(nameFetchResults.size(), 3);
+ for (Action a : nameFetchResults) {
+ Assert.assertEquals(a.getStatus(), ActionStatus.Deleted);
+ }
+
+ List<Action> filteredActions =
+ actionManager.getFilteredActions(ActionConstants.FILTER_TYPE_VENDOR, "Vendor-Delete");
+ Assert.assertEquals(filteredActions.size(), 0);
+ filteredActions =
+ actionManager.getFilteredActions(ActionConstants.FILTER_TYPE_CATEGORY, "Cat-Delete-test");
+ Assert.assertEquals(filteredActions.size(), 0);
+ filteredActions =
+ actionManager.getFilteredActions(ActionConstants.FILTER_TYPE_ECOMP_COMPONENT, "MSO-delete");
+ Assert.assertEquals(filteredActions.size(), 0);
+ filteredActions =
+ actionManager.getFilteredActions(ActionConstants.FILTER_TYPE_MODEL, "Model-Delete");
+ Assert.assertEquals(filteredActions.size(), 0);
+ }
+
+ /***
+ * ACTION ARTIFACT OPERATION TEST CASES
+ ***/
+
+ @Test
+ public void testUploadArtifact() {
+ actionArtifact = new ActionArtifact();
+ File resourceFile = new File(
+ this.getClass().getClassLoader().getResource(ACTION_TEST_ARTIFACT_FILE_NAME).getPath());
+ FileInputStream fileInputStream;
+ //Create payload from the test resource file
+ byte[] payload = new byte[(int) resourceFile.length()];
+ try {
+ fileInputStream = new FileInputStream(resourceFile);
+ fileInputStream.read(payload);
+ fileInputStream.close();
+ actionArtifact.setArtifact(payload);
+ actionArtifact.setArtifactName(ACTION_TEST_ARTIFACT_FILE_NAME);
+ actionArtifact.setArtifactLabel("Test Artifact Label");
+ actionArtifact.setArtifactDescription("Test Artifact Description");
+ actionArtifact.setArtifactProtection(ActionArtifactProtection.readWrite.name());
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ //Create action for artifact upload test
+ testArtifactAction = actionManager.createAction(createAction(ARTIFACT_TEST_ACTION), USER1);
+ //Generate Expected artifact UUID
+ expectedArtifactUUID =
+ generateActionArtifactUUID(testArtifactAction, ACTION_TEST_ARTIFACT_FILE_NAME);
+ //Upload the artifact
+ ActionArtifact response = actionManager
+ .uploadArtifact(actionArtifact, testArtifactAction.getActionInvariantUuId(), USER1);
+ //Validate if generated and the expected artifact UUID is same
+ Assert.assertEquals(expectedArtifactUUID, response.getArtifactUuId());
+ //Fetch the data field of the updated action version
+ Action updatedAction = actionManager.getActionsByActionUuId(testArtifactAction.getActionUuId());
+ List<ActionArtifact> updatedArtifactList = updatedAction.getArtifacts();
+ for (ActionArtifact artifact : updatedArtifactList) {
+ //Validate the artifact metadata
+ Assert.assertEquals(artifact.getArtifactName(), actionArtifact.getArtifactName());
+ Assert.assertEquals(artifact.getArtifactLabel(), actionArtifact.getArtifactLabel());
+ Assert
+ .assertEquals(artifact.getArtifactDescription(), actionArtifact.getArtifactDescription());
+ Assert.assertEquals(artifact.getArtifactProtection(), actionArtifact.getArtifactProtection());
+ }
+ }
+
+ @Test(dependsOnMethods = {"testUploadArtifact"})
+ public void testUploadArtifactInvalidActionInvId_negative() {
+ ActionArtifact testArtifact = new ActionArtifact();
+ testArtifact.setArtifact("testData".getBytes());
+ testArtifact.setArtifactName(ACTION_TEST_ARTIFACT_FILE_NAME);
+ try {
+ actionManager.uploadArtifact(testArtifact, "INVALID_UUID", USER1);
+ } catch (ActionException ae) {
+ Assert.assertEquals(ae.getErrorCode(), ActionErrorConstants.ACTION_ENTITY_NOT_EXIST_CODE);
+ Assert.assertEquals(ae.getDescription(), ActionErrorConstants.ACTION_ENTITY_NOT_EXIST);
+ }
+ }
+
+ @Test(dependsOnMethods = {"testUploadArtifact"})
+ public void testUploadArtifactSameName_negative() {
+ try {
+ actionManager
+ .uploadArtifact(actionArtifact, testArtifactAction.getActionInvariantUuId(), USER1);
+ } catch (ActionException ae) {
+ Assert.assertEquals(ae.getErrorCode(), ActionErrorConstants.ACTION_ARTIFACT_ALREADY_EXISTS_CODE);
+ Assert.assertEquals(ae.getDescription(), String
+ .format(ActionErrorConstants.ACTION_ARTIFACT_ALREADY_EXISTS, testArtifactAction.getActionInvariantUuId()));
+ }
+ }
+
+ @Test(dependsOnMethods = {"testUploadArtifact"})
+ public void testUploadArtifactCheckedOutOtherUser_negative() {
+ try {
+ actionManager
+ .uploadArtifact(actionArtifact, testArtifactAction.getActionInvariantUuId(), USER2);
+ } catch (ActionException ae) {
+ Assert.assertEquals(ae.getErrorCode(), ActionErrorConstants.ACTION_EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER);
+ Assert.assertEquals(ae.getDescription(),
+ "Versionable entity Action with id " + testArtifactAction.getActionInvariantUuId() +
+ " can not be updated since it is locked by other user " + USER1 + ".");
+ }
+ }
+
+ @Test(dependsOnMethods = {"testUploadArtifact"})
+ public void testUploadArtifactUnlockedAction_negative() {
+ try {
+ testArtifactAction =
+ actionManager.checkin(testArtifactAction.getActionInvariantUuId(), USER1);
+ actionManager
+ .uploadArtifact(actionArtifact, testArtifactAction.getActionInvariantUuId(), USER1);
+ } catch (ActionException ae) {
+ Assert.assertEquals(ae.getErrorCode(), ActionErrorConstants.ACTION_UPDATE_ON_UNLOCKED_ENTITY);
+ Assert.assertEquals(ae.getDescription(), "Can not update versionable entity Action with id " +
+ testArtifactAction.getActionInvariantUuId() + " since it is not checked out.");
+ }
+ }
+
+ @Test(dependsOnMethods = {"testUploadArtifact"})
+ public void testDownloadArtifact() {
+ String actionUUID = testArtifactAction.getActionUuId();
+ ActionArtifact response = actionManager.downloadArtifact(actionUUID, expectedArtifactUUID);
+ Assert.assertEquals(actionArtifact.getArtifactName(), response.getArtifactName());
+ Assert.assertEquals(actionArtifact.getArtifact(), response.getArtifact());
+ }
+
+ @Test(dependsOnMethods = {"testUploadArtifact"})
+ public void testDownloadArtifactNegativeInvalidArtifact() {
+ String actionUUID = testArtifactAction.getActionUuId();
+ String artifactUUID = "negativeArtifact";
+ try {
+ ActionArtifact response = actionManager.downloadArtifact(actionUUID, artifactUUID);
+ } catch (ActionException ae) {
+ Assert.assertEquals(ae.getErrorCode(), ActionErrorConstants.ACTION_ARTIFACT_ENTITY_NOT_EXIST_CODE);
+ }
+
+ }
+
+ @Test
+ public void testDownloadArtifactNegativeInvalidAction() {
+ String actionUUID = "NegativeAction";
+ try {
+ ActionArtifact response = actionManager.downloadArtifact(actionUUID, expectedArtifactUUID);
+ } catch (ActionException ae) {
+ Assert.assertEquals(ae.getErrorCode(), ActionErrorConstants.ACTION_ENTITY_NOT_EXIST_CODE);
+ }
+
+ }
+
+ @Test
+ public void testDeleteArtifactInvalidActInvId() {
+ try {
+ actionManager.deleteArtifact("action2Id", "1234", USER1);
+ } catch (ActionException e) {
+ Assert.assertEquals(e.getErrorCode(), ActionErrorConstants.ACTION_ENTITY_NOT_EXIST_CODE);
+ Assert.assertEquals(e.getDescription(), ActionErrorConstants.ACTION_ENTITY_NOT_EXIST);
+ }
+ }
+
+ @Test(dependsOnMethods = {"testGetByInvIdOnCreate"})
+ public void testDeleteArtifactInvalidArtifactUUID() {
+ try {
+ actionManager.deleteArtifact(action2Id, "1234", USER1);
+ } catch (ActionException e) {
+ Assert.assertEquals(e.getErrorCode(),
+ ActionErrorConstants.ACTION_ARTIFACT_ENTITY_NOT_EXIST_CODE);
+ Assert
+ .assertEquals(e.getDescription(), ActionErrorConstants.ACTION_ARTIFACT_ENTITY_NOT_EXIST);
+ }
+ }
+
+ @Test(dependsOnMethods = {"testUploadArtifact"})
+ public void testDeleteReadOnlyArtifact() {
+ ActionArtifact testArtifact = null;
+ String artifactUUID = null;
+ try {
+ testArtifact = new ActionArtifact();
+ testArtifact.setArtifact("testData".getBytes());
+ testArtifact.setArtifactProtection(ActionArtifactProtection.readOnly.name());
+ testArtifact.setArtifactName("TestRO.txt");
+ actionManager
+ .uploadArtifact(testArtifact, testArtifactAction.getActionInvariantUuId(), USER1);
+ artifactUUID = testArtifact.getArtifactUuId();
+ actionManager.deleteArtifact(testArtifactAction.getActionInvariantUuId(),
+ testArtifact.getArtifactUuId(), USER1);
+
+ } catch (ActionException e) {
+ Assert.assertEquals(e.getErrorCode(), ActionErrorConstants.ACTION_ARTIFACT_DELETE_READ_ONLY);
+ Assert.assertEquals(e.getDescription(),
+ ActionErrorConstants.ACTION_ARTIFACT_DELETE_READ_ONLY_MSG);
+ }
+
+ //cleanup uploaded document after test
+ testArtifact = new ActionArtifact();
+ testArtifact.setArtifactUuId(artifactUUID);
+ testArtifact.setArtifactProtection(ActionArtifactProtection.readWrite.name());
+ actionManager.updateArtifact(testArtifact, testArtifactAction.getActionInvariantUuId(), USER1);
+ actionManager
+ .deleteArtifact(testArtifactAction.getActionInvariantUuId(), testArtifact.getArtifactUuId(),
+ USER1);
+ }
+
+ @Test(dependsOnMethods = {"testUploadArtifact"})
+ public void testDeleteArtifactLockedByOtherUser() {
+ try {
+ actionManager.deleteArtifact(testArtifactAction.getActionInvariantUuId(),
+ actionArtifact.getArtifactUuId(), USER2);
+ } catch (ActionException ae) {
+ Assert.assertEquals(ae.getErrorCode(), ActionErrorConstants.ACTION_ARTIFACT_DEL_LOCKED_OTHER_USER_CODE);
+ Assert.assertEquals(ae.getDescription(),
+ String.format(ActionErrorConstants.ACTION_ARTIFACT_DEL_LOCKED_OTHER_USER, USER1));
+ }
+ }
+
+ @Test(dependsOnMethods = {"testUploadArtifactUnlockedAction_negative"})
+ public void testDeleteArtifactOnUnlockedAction() {
+ try {
+ actionManager.deleteArtifact(testArtifactAction.getActionInvariantUuId(),
+ actionArtifact.getArtifactUuId(), USER1);
+ } catch (ActionException ae) {
+ Assert.assertEquals(ae.getErrorCode(), ActionErrorConstants.ACTION_NOT_LOCKED_CODE);
+ Assert.assertEquals(ae.getDescription(), ActionErrorConstants.ACTION_NOT_LOCKED_MSG);
+ }
+ }
+
+ @Test(dependsOnMethods = {"testUploadArtifact"})
+ public void testDeleteArtifact() {
+ try {
+ ActionArtifact testArtifact = new ActionArtifact();
+ testArtifact.setArtifact("testData".getBytes());
+ testArtifact.setArtifactName("Test_ToBeDel.txt");
+ testArtifact.setArtifactProtection(ActionArtifactProtection.readWrite.name());
+ actionManager
+ .uploadArtifact(testArtifact, testArtifactAction.getActionInvariantUuId(), USER1);
+ actionManager.deleteArtifact(testArtifactAction.getActionInvariantUuId(),
+ testArtifact.getArtifactUuId(), USER1);
+ ActionArtifact response = actionManager
+ .downloadArtifact(testArtifactAction.getActionUuId(), testArtifact.getArtifactUuId());
+ } catch (ActionException e) {
+ Assert.assertEquals(e.getErrorCode(),
+ ActionErrorConstants.ACTION_ARTIFACT_ENTITY_NOT_EXIST_CODE);
+ Assert
+ .assertEquals(e.getDescription(), ActionErrorConstants.ACTION_ARTIFACT_ENTITY_NOT_EXIST);
+ }
+ }
+
+ @Test(dependsOnMethods = {"testUploadArtifact"})
+ public void testUpdateArtifact() {
+ ActionArtifact updatedArtifact = new ActionArtifact();
+ File resourceFile = new File(
+ this.getClass().getClassLoader().getResource(ACTION_TEST_UPDATE_ARTIFACT_FILE_NAME)
+ .getPath());
+ FileInputStream fileInputStream;
+ //Create payload from the test resource file
+ byte[] payload = new byte[(int) resourceFile.length()];
+ try {
+ fileInputStream = new FileInputStream(resourceFile);
+ fileInputStream.read(payload);
+ fileInputStream.close();
+ updatedArtifact.setArtifactUuId(
+ generateActionArtifactUUID(testArtifactAction, ACTION_TEST_ARTIFACT_FILE_NAME));
+ updatedArtifact.setArtifact(payload);
+ updatedArtifact.setArtifactName(ACTION_TEST_ARTIFACT_FILE_NAME);
+ updatedArtifact.setArtifactLabel("Test Artifact Update Label");
+ updatedArtifact.setArtifactDescription("Test Artifact Update Description");
+ updatedArtifact.setArtifactProtection(ActionArtifactProtection.readWrite.name());
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ String actionInvarientUUID = testArtifactAction.getActionInvariantUuId();
+ actionManager.updateArtifact(updatedArtifact, actionInvarientUUID, USER1);
+
+ String actionUUID = testArtifactAction.getActionUuId();
+ Action action = actionManager.getActionsByActionUuId(actionUUID);
+ List<ActionArtifact> artifacts = action.getArtifacts();
+ for (ActionArtifact actionArtifact : artifacts) {
+ Assert.assertEquals(actionArtifact.getArtifactName(), updatedArtifact.getArtifactName());
+ Assert.assertEquals(actionArtifact.getArtifactLabel(), updatedArtifact.getArtifactLabel());
+ Assert.assertEquals(actionArtifact.getArtifactDescription(),
+ updatedArtifact.getArtifactDescription());
+ Assert.assertEquals(actionArtifact.getArtifactProtection(),
+ updatedArtifact.getArtifactProtection());
+ }
+ }
+
+ @Test(dependsOnMethods = {"testUploadArtifact"})
+ public void testUpdateArtifact_ArtifactNotPresent_Negative() {
+ ActionArtifact invalidActionArtifact = new ActionArtifact();
+ String artifactUUID = generateActionArtifactUUID(testArtifactAction, "ArtifactNotPresent");
+ invalidActionArtifact.setArtifactUuId(artifactUUID);
+ try {
+ actionManager
+ .updateArtifact(invalidActionArtifact, testArtifactAction.getActionInvariantUuId(),
+ USER1);
+ } catch (ActionException actionException) {
+ Assert.assertEquals(actionException.getDescription(), ActionErrorConstants.ACTION_ARTIFACT_ENTITY_NOT_EXIST);
+ }
+ }
+
+ @Test(dependsOnMethods = {"testUploadArtifact"})
+ public void testUpdateArtifact_ArtifactNameUpdate_Negative() {
+ String invariantUUID = testArtifactAction.getActionInvariantUuId();
+ ActionArtifact artifactToUpdate = new ActionArtifact();
+ artifactToUpdate.setArtifactUuId(actionArtifact.getArtifactUuId());
+ artifactToUpdate.setArtifactName("UpdatingName");
+
+ try {
+ actionManager.updateArtifact(artifactToUpdate, invariantUUID, USER1);
+ } catch (ActionException actionException) {
+ Assert.assertEquals(actionException.getDescription(), ActionErrorConstants.ACTION_ARTIFACT_UPDATE_NAME_INVALID);
+ }
+ }
+
+ @Test(dependsOnMethods = {"testUploadArtifact"})
+ void testUpdateArtifact_CheckoutByOtherUser_Negative() {
+ String invariantUUID = testArtifactAction.getActionInvariantUuId();
+ ActionArtifact artifactToUpdate = new ActionArtifact();
+ artifactToUpdate.setArtifactUuId(actionArtifact.getArtifactUuId());
+ artifactToUpdate.setArtifactLabel("CheckoutbyOtherUser label");
+
+ try {
+ actionManager.updateArtifact(artifactToUpdate, invariantUUID, USER2);
+ } catch (ActionException actionException) {
+ Assert
+ .assertEquals(actionException.getErrorCode(), ActionErrorConstants.ACTION_EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER);
+ Assert.assertEquals(actionException.getDescription(),
+ "Versionable entity Action with id " + invariantUUID +
+ " can not be updated since it is locked by other user " + USER1 + ".");
+ }
+ System.out.println("asdf");
+ }
+
+ @Test(dependsOnMethods = {"testUploadArtifact"})
+ void testUpdateArtifact_ArtifactProtectionReadOnly_CanNotUpdate_Negative() {
+ String invariantUUID = testArtifactAction.getActionInvariantUuId();
+ ActionArtifact artifactToUpdate = new ActionArtifact();
+ artifactToUpdate.setArtifactUuId(actionArtifact.getArtifactUuId());
+ artifactToUpdate.setArtifactProtection(ActionArtifactProtection.readOnly.name());
+ actionManager.updateArtifact(artifactToUpdate, invariantUUID, USER1);
+
+ artifactToUpdate.setArtifactLabel("test label");
+ artifactToUpdate.setArtifactDescription("test description");
+ artifactToUpdate.setArtifactProtection(ActionArtifactProtection.readWrite.name());
+ try {
+ actionManager.updateArtifact(artifactToUpdate, invariantUUID, USER1);
+ } catch (ActionException actionExecption) {
+ Assert.assertEquals(actionExecption.getDescription(), ActionErrorConstants.ACTION_ARTIFACT_UPDATE_READ_ONLY_MSG);
+ }
+ }
+
+ // Function which will take action as input string and create action
+ // After create multiple versions of same action
+ // Final versions :1.0, 2.0
+ // Last minor version :2.2
+ // Candidate version :2.3
+ private void createActionVersions(String input) {
+ Action action1 = createAction(input);
+ Action action = actionManager.createAction(action1, USER1);
+ String Id = action.getActionInvariantUuId();
+
+ actionManager.checkin(Id, USER1);
+ actionManager.submit(Id, USER1); // 1.0
+ actionManager.checkout(Id, USER1);
+ actionManager.checkin(Id, USER1);
+ actionManager.submit(Id, USER1);//2.0
+ actionManager.checkout(Id, USER1);
+ actionManager.checkin(Id, USER1);
+ actionManager.checkout(Id, USER1);
+ actionManager.checkin(Id, USER1); //2.2
+ actionManager.checkout(Id, USER1); //2.3 candidate
+ }
+
+ private Action updateData(Action action) {
+ Map<String, String> dataMap = new LinkedHashMap<>();
+ dataMap.put(ActionConstants.UNIQUE_ID, action.getActionUuId());
+ dataMap.put(ActionConstants.VERSION, action.getVersion());
+ dataMap.put(ActionConstants.INVARIANTUUID, action.getActionInvariantUuId());
+ dataMap.put(ActionConstants.STATUS, ActionStatus.Locked.name());
+
+ String data = action.getData();
+ Map<String, String> currentDataMap = JsonUtil.json2Object(data, LinkedHashMap.class);
+ dataMap.putAll(currentDataMap);
+ data = JsonUtil.object2Json(dataMap);
+ action.setData(data);
+ return action;
+ }
+
+ private void initDeleteActionTest() {
+ deleteAction = actionManager.createAction(createAction(ACTION_TEST_DELETE), USER1);
+ String deleteActionInvariantId = deleteAction.getActionInvariantUuId();
+ actionManager.checkin(deleteActionInvariantId, USER1);
+ actionManager.submit(deleteActionInvariantId, USER1); // 1.0
+ actionManager.checkout(deleteActionInvariantId, USER1);
+ actionManager.checkin(deleteActionInvariantId, USER1);
+ actionManager.submit(deleteActionInvariantId, USER1);//2.0
+ actionManager.checkout(deleteActionInvariantId, USER1);
+ }
+
+ private int getEffectiveVersion(String actionVersion) {
+ Version version = Version.valueOf(actionVersion);
+ return version.getMajor() * 10000 + version.getMinor();
+ }
+
+ private String generateActionArtifactUUID(Action action, String artifactName) {
+ int effectiveVersion = getEffectiveVersion(action.getVersion());
+ //Upper case for maintaining case-insensitive behavior for the artifact names
+ String artifactUUIDString =
+ action.getName().toUpperCase() + effectiveVersion + artifactName.toUpperCase();
+ String generateArtifactUUID =
+ UUID.nameUUIDFromBytes((artifactUUIDString).getBytes()).toString();
+ String artifactUUID = generateArtifactUUID.replace("-", "");
+ return artifactUUID.toUpperCase();
+ }
+
+}
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/src/test/resources/test_artifact_file.txt b/openecomp-be/backend/openecomp-sdc-action-manager/src/test/resources/test_artifact_file.txt
new file mode 100644
index 0000000000..15752ea310
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-action-manager/src/test/resources/test_artifact_file.txt
@@ -0,0 +1,2 @@
+Upload_Artifacts.
+The test verifies uploading an artifact when action status is locked. \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/src/test/resources/test_artifact_update_file.txt b/openecomp-be/backend/openecomp-sdc-action-manager/src/test/resources/test_artifact_update_file.txt
new file mode 100644
index 0000000000..940aedfc85
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-action-manager/src/test/resources/test_artifact_update_file.txt
@@ -0,0 +1,2 @@
+Update_Artifacts.
+The test verifies updating an artifact when action status is locked. \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/Default suite/Default test.html b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/Default suite/Default test.html
new file mode 100644
index 0000000000..d0d707db79
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/Default suite/Default test.html
@@ -0,0 +1,324 @@
+<html>
+<head>
+<title>TestNG: Default test</title>
+<link href="../testng.css" rel="stylesheet" type="text/css" />
+<link href="../my-testng.css" rel="stylesheet" type="text/css" />
+
+<style type="text/css">
+.log { display: none;}
+.stack-trace { display: none;}
+</style>
+<script type="text/javascript">
+<!--
+function flip(e) {
+ current = e.style.display;
+ if (current == 'block') {
+ e.style.display = 'none';
+ return 0;
+ }
+ else {
+ e.style.display = 'block';
+ return 1;
+ }
+}
+
+function toggleBox(szDivId, elem, msg1, msg2)
+{
+ var res = -1; if (document.getElementById) {
+ res = flip(document.getElementById(szDivId));
+ }
+ else if (document.all) {
+ // this is the way old msie versions work
+ res = flip(document.all[szDivId]);
+ }
+ if(elem) {
+ if(res == 0) elem.innerHTML = msg1; else elem.innerHTML = msg2;
+ }
+
+}
+
+function toggleAllBoxes() {
+ if (document.getElementsByTagName) {
+ d = document.getElementsByTagName('div');
+ for (i = 0; i < d.length; i++) {
+ if (d[i].className == 'log') {
+ flip(d[i]);
+ }
+ }
+ }
+}
+
+// -->
+</script>
+
+</head>
+<body>
+<h2 align='center'>Default test</h2><table border='1' align="center">
+<tr>
+<td>Tests passed/Failed/Skipped:</td><td>49/0/0</td>
+</tr><tr>
+<td>Started on:</td><td>Thu Sep 08 12:49:36 IST 2016</td>
+</tr>
+<tr><td>Total time:</td><td>6 seconds (6008 ms)</td>
+</tr><tr>
+<td>Included groups:</td><td></td>
+</tr><tr>
+<td>Excluded groups:</td><td></td>
+</tr>
+</table><p/>
+<small><i>(Hover the method name to see the test class name)</i></small><p/>
+<table width='100%' border='1' class='invocation-passed'>
+<tr><td colspan='4' align='center'><b>PASSED TESTS</b></td></tr>
+<tr><td><b>Test method</b></td>
+<td width="30%"><b>Exception</b></td>
+<td width="10%"><b>Time (seconds)</b></td>
+<td><b>Instance</b></td>
+</tr>
+<tr>
+<td title='ActionTest.createTest()'><b>createTest</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testCheckIn()'><b>testCheckIn</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testCheckInWithOtherUser()'><b>testCheckInWithOtherUser</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testCheckInWithoutCheckout()'><b>testCheckInWithoutCheckout</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testCheckOut()'><b>testCheckOut</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testCheckOutOnCheckOut()'><b>testCheckOutOnCheckOut</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testCheckOutOnCheckOutWithOtherUser()'><b>testCheckOutOnCheckOutWithOtherUser</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testCreateWithExistingActionName_negative()'><b>testCreateWithExistingActionName_negative</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testDeleteArtifact()'><b>testDeleteArtifact</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testDeleteArtifactInvalidActInvId()'><b>testDeleteArtifactInvalidActInvId</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testDeleteArtifactInvalidArtifactUUID()'><b>testDeleteArtifactInvalidArtifactUUID</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testDeleteArtifactLockedByOtherUser()'><b>testDeleteArtifactLockedByOtherUser</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testDeleteArtifactOnUnlockedAction()'><b>testDeleteArtifactOnUnlockedAction</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testDeleteReadOnlyArtifact()'><b>testDeleteReadOnlyArtifact</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testDownloadArtifact()'><b>testDownloadArtifact</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testDownloadArtifactNegativeInvalidAction()'><b>testDownloadArtifactNegativeInvalidAction</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testDownloadArtifactNegativeInvalidArtifact()'><b>testDownloadArtifactNegativeInvalidArtifact</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testGetAllActions()'><b>testGetAllActions</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testGetByCategory()'><b>testGetByCategory</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testGetByIgnoreCaseName()'><b>testGetByIgnoreCaseName</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testGetByInvIdManyVersionWithFirstSubmit()'><b>testGetByInvIdManyVersionWithFirstSubmit</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testGetByInvIdManyVersionWithMultSubmit()'><b>testGetByInvIdManyVersionWithMultSubmit</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testGetByInvIdManyVersionWithoutSubmit()'><b>testGetByInvIdManyVersionWithoutSubmit</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testGetByInvIdOnCreate()'><b>testGetByInvIdOnCreate</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testGetByInvIdOnName()'><b>testGetByInvIdOnName</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testGetBySupportedComponent()'><b>testGetBySupportedComponent</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testGetBySupportedModel()'><b>testGetBySupportedModel</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testGetByVendor()'><b>testGetByVendor</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testGetECOMPComponents()'><b>testGetECOMPComponents</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testSubmit()'><b>testSubmit</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testSubmitOnCheckout()'><b>testSubmitOnCheckout</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testUndoCheckout()'><b>testUndoCheckout</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testUpdateArtifact()'><b>testUpdateArtifact</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testUpdateInvalidVersion_negative()'><b>testUpdateInvalidVersion_negative</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testUpdateInvariantId_negative()'><b>testUpdateInvariantId_negative</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testUpdateName_negative()'><b>testUpdateName_negative</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testUpdateOnCheckedInAction_negative()'><b>testUpdateOnCheckedInAction_negative</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testUpdateOtherUser_negative()'><b>testUpdateOtherUser_negative</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testUpdateStatus_negative()'><b>testUpdateStatus_negative</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testUpdateUniqueId_negative()'><b>testUpdateUniqueId_negative</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testUpdateVersion_negative()'><b>testUpdateVersion_negative</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testUploadArtifact()'><b>testUploadArtifact</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testUploadArtifactCheckedOutOtherUser_negative()'><b>testUploadArtifactCheckedOutOtherUser_negative</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testUploadArtifactInvalidActionInvId_negative()'><b>testUploadArtifactInvalidActionInvId_negative</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testUploadArtifactSameName_negative()'><b>testUploadArtifactSameName_negative</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testUploadArtifactUnlockedAction_negative()'><b>testUploadArtifactUnlockedAction_negative</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testgetActionsByActionUUID()'><b>testgetActionsByActionUUID</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.testgetActionsByActionUUID_Negative()'><b>testgetActionsByActionUUID_Negative</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+<tr>
+<td title='ActionTest.updateTest()'><b>updateTest</b><br>Test class: ActionTest</td>
+<td></td>
+<td>0</td>
+<td>ActionTest@5b367418</td></tr>
+</table><p>
+</body>
+</html> \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/Default suite/Default test.xml b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/Default suite/Default test.xml
new file mode 100644
index 0000000000..9eb74cff2d
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/Default suite/Default test.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated by org.testng.reporters.JUnitXMLReporter -->
+<testsuite hostname="SHEETALM02" name="Default test" tests="49" failures="0" timestamp="8 Sep 2016 07:19:42 GMT" time="6.008" errors="0">
+ <testcase name="createTest" time="0.079" classname="ActionTest"/>
+ <testcase name="testDeleteArtifactInvalidActInvId" time="0.003" classname="ActionTest"/>
+ <testcase name="testDownloadArtifactNegativeInvalidAction" time="0.004" classname="ActionTest"/>
+ <testcase name="testGetByCategory" time="0.961" classname="ActionTest"/>
+ <testcase name="testGetByInvIdOnCreate" time="0.03" classname="ActionTest"/>
+ <testcase name="testGetECOMPComponents" time="0.005" classname="ActionTest"/>
+ <testcase name="testUploadArtifact" time="0.078" classname="ActionTest"/>
+ <testcase name="testgetActionsByActionUUID_Negative" time="0.004" classname="ActionTest"/>
+ <testcase name="testCheckOutOnCheckOut" time="0.013" classname="ActionTest"/>
+ <testcase name="testCheckOutOnCheckOutWithOtherUser" time="0.009" classname="ActionTest"/>
+ <testcase name="testCreateWithExistingActionName_negative" time="0.005" classname="ActionTest"/>
+ <testcase name="testGetAllActions" time="0.056" classname="ActionTest"/>
+ <testcase name="testDeleteArtifactInvalidArtifactUUID" time="0.009" classname="ActionTest"/>
+ <testcase name="testGetByIgnoreCaseName" time="0.011" classname="ActionTest"/>
+ <testcase name="testGetByInvIdManyVersionWithoutSubmit" time="0.451" classname="ActionTest"/>
+ <testcase name="testGetBySupportedComponent" time="0.044" classname="ActionTest"/>
+ <testcase name="testGetBySupportedModel" time="0.044" classname="ActionTest"/>
+ <testcase name="testGetByVendor" time="0.041" classname="ActionTest"/>
+ <testcase name="testDeleteArtifact" time="0.039" classname="ActionTest"/>
+ <testcase name="testDeleteArtifactLockedByOtherUser" time="0.005" classname="ActionTest"/>
+ <testcase name="testDeleteReadOnlyArtifact" time="0.059" classname="ActionTest"/>
+ <testcase name="testDownloadArtifact" time="0.008" classname="ActionTest"/>
+ <testcase name="testDownloadArtifactNegativeInvalidArtifact" time="0.005" classname="ActionTest"/>
+ <testcase name="testUpdateArtifact" time="0.022" classname="ActionTest"/>
+ <testcase name="testUploadArtifactCheckedOutOtherUser_negative" time="0.006" classname="ActionTest"/>
+ <testcase name="testUploadArtifactInvalidActionInvId_negative" time="0.006" classname="ActionTest"/>
+ <testcase name="testUploadArtifactSameName_negative" time="0.009" classname="ActionTest"/>
+ <testcase name="testUploadArtifactUnlockedAction_negative" time="0.021" classname="ActionTest"/>
+ <testcase name="testgetActionsByActionUUID" time="0.005" classname="ActionTest"/>
+ <testcase name="testGetByInvIdManyVersionWithFirstSubmit" time="0.515" classname="ActionTest"/>
+ <testcase name="testDeleteArtifactOnUnlockedAction" time="0.005" classname="ActionTest"/>
+ <testcase name="updateTest" time="0.017" classname="ActionTest"/>
+ <testcase name="testGetByInvIdManyVersionWithMultSubmit" time="0.366" classname="ActionTest"/>
+ <testcase name="testUpdateInvalidVersion_negative" time="0.007" classname="ActionTest"/>
+ <testcase name="testUpdateInvariantId_negative" time="0.006" classname="ActionTest"/>
+ <testcase name="testUpdateName_negative" time="0.008" classname="ActionTest"/>
+ <testcase name="testUpdateOtherUser_negative" time="0.007" classname="ActionTest"/>
+ <testcase name="testUpdateStatus_negative" time="0.01" classname="ActionTest"/>
+ <testcase name="testUpdateUniqueId_negative" time="0.009" classname="ActionTest"/>
+ <testcase name="testUpdateVersion_negative" time="0.007" classname="ActionTest"/>
+ <testcase name="testGetByInvIdOnName" time="0.271" classname="ActionTest"/>
+ <testcase name="testCheckIn" time="0.01" classname="ActionTest"/>
+ <testcase name="testUpdateOnCheckedInAction_negative" time="0.007" classname="ActionTest"/>
+ <testcase name="testSubmit" time="0.02" classname="ActionTest"/>
+ <testcase name="testCheckInWithoutCheckout" time="0.004" classname="ActionTest"/>
+ <testcase name="testCheckOut" time="0.021" classname="ActionTest"/>
+ <testcase name="testCheckInWithOtherUser" time="0.005" classname="ActionTest"/>
+ <testcase name="testSubmitOnCheckout" time="0.004" classname="ActionTest"/>
+ <testcase name="testUndoCheckout" time="0.018" classname="ActionTest"/>
+</testsuite> <!-- Default test -->
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/Default suite/testng-failed.xml b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/Default suite/testng-failed.xml
new file mode 100644
index 0000000000..5f2650e66e
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/Default suite/testng-failed.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="Failed suite [Default suite]">
+ <test name="Default test(failed)">
+ <classes>
+ <class name="ActionTest">
+ <methods>
+ <include name="testDeleteReadOnlyArtifact"/>
+ <include name="testUploadArtifact"/>
+ <include name="testUpdateArtifact"/>
+ <include name="init"/>
+ </methods>
+ </class> <!-- ActionTest -->
+ </classes>
+ </test> <!-- Default test(failed) -->
+</suite> <!-- Failed suite [Default suite] -->
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/bullet_point.png b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/bullet_point.png
new file mode 100644
index 0000000000..176e6d5b3d
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/bullet_point.png
Binary files differ
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/collapseall.gif b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/collapseall.gif
new file mode 100644
index 0000000000..a2d80a9044
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/collapseall.gif
Binary files differ
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/emailable-report.html b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/emailable-report.html
new file mode 100644
index 0000000000..299de973b7
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/emailable-report.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>TestNG Report</title><style type="text/css">table {margin-bottom:10px;border-collapse:collapse;empty-cells:show}th,td {border:1px solid #009;padding:.25em .5em}th {vertical-align:bottom}td {vertical-align:top}table a {font-weight:bold}.stripe td {background-color: #E6EBF9}.num {text-align:right}.passedodd td {background-color: #3F3}.passedeven td {background-color: #0A0}.skippedodd td {background-color: #DDD}.skippedeven td {background-color: #CCC}.failedodd td,.attn {background-color: #F33}.failedeven td,.stripe .attn {background-color: #D00}.stacktrace {white-space:pre;font-family:monospace}.totop {font-size:85%;text-align:center;border-bottom:2px solid #000}</style></head><body><table><tr><th>Test</th><th># Passed</th><th># Skipped</th><th># Failed</th><th>Time (ms)</th><th>Included Groups</th><th>Excluded Groups</th></tr><tr><th colspan="7">Default suite</th></tr><tr><td><a href="#t0">Default test</a></td><td class="num">49</td><td class="num">0</td><td class="num">0</td><td class="num">6,008</td><td></td><td></td></tr></table><table><thead><tr><th>Class</th><th>Method</th><th>Start</th><th>Time (ms)</th></tr></thead><tbody><tr><th colspan="4">Default suite</th></tr></tbody><tbody id="t0"><tr><th colspan="4">Default test &#8212; passed</th></tr><tr class="passedeven"><td rowspan="49">ActionTest</td><td><a href="#m0">createTest</a></td><td rowspan="1">1473319179408</td><td rowspan="1">79</td></tr><tr class="passedeven"><td><a href="#m1">testCheckIn</a></td><td rowspan="1">1473319182701</td><td rowspan="1">10</td></tr><tr class="passedeven"><td><a href="#m2">testCheckInWithOtherUser</a></td><td rowspan="1">1473319182766</td><td rowspan="1">5</td></tr><tr class="passedeven"><td><a href="#m3">testCheckInWithoutCheckout</a></td><td rowspan="1">1473319182740</td><td rowspan="1">4</td></tr><tr class="passedeven"><td><a href="#m4">testCheckOut</a></td><td rowspan="1">1473319182745</td><td rowspan="1">21</td></tr><tr class="passedeven"><td><a href="#m5">testCheckOutOnCheckOut</a></td><td rowspan="1">1473319180580</td><td rowspan="1">13</td></tr><tr class="passedeven"><td><a href="#m6">testCheckOutOnCheckOutWithOtherUser</a></td><td rowspan="1">1473319180594</td><td rowspan="1">9</td></tr><tr class="passedeven"><td><a href="#m7">testCreateWithExistingActionName_negative</a></td><td rowspan="1">1473319180603</td><td rowspan="1">5</td></tr><tr class="passedeven"><td><a href="#m8">testDeleteArtifact</a></td><td rowspan="1">1473319181272</td><td rowspan="1">39</td></tr><tr class="passedeven"><td><a href="#m9">testDeleteArtifactInvalidActInvId</a></td><td rowspan="1">1473319179488</td><td rowspan="1">3</td></tr><tr class="passedeven"><td><a href="#m10">testDeleteArtifactInvalidArtifactUUID</a></td><td rowspan="1">1473319180666</td><td rowspan="1">9</td></tr><tr class="passedeven"><td><a href="#m11">testDeleteArtifactLockedByOtherUser</a></td><td rowspan="1">1473319181312</td><td rowspan="1">5</td></tr><tr class="passedeven"><td><a href="#m12">testDeleteArtifactOnUnlockedAction</a></td><td rowspan="1">1473319181982</td><td rowspan="1">5</td></tr><tr class="passedeven"><td><a href="#m13">testDeleteReadOnlyArtifact</a></td><td rowspan="1">1473319181317</td><td rowspan="1">59</td></tr><tr class="passedeven"><td><a href="#m14">testDownloadArtifact</a></td><td rowspan="1">1473319181377</td><td rowspan="1">8</td></tr><tr class="passedeven"><td><a href="#m15">testDownloadArtifactNegativeInvalidAction</a></td><td rowspan="1">1473319179492</td><td rowspan="1">4</td></tr><tr class="passedeven"><td><a href="#m16">testDownloadArtifactNegativeInvalidArtifact</a></td><td rowspan="1">1473319181386</td><td rowspan="1">5</td></tr><tr class="passedeven"><td><a href="#m17">testGetAllActions</a></td><td rowspan="1">1473319180609</td><td rowspan="1">56</td></tr><tr class="passedeven"><td><a href="#m18">testGetByCategory</a></td><td rowspan="1">1473319179497</td><td rowspan="1">961</td></tr><tr class="passedeven"><td><a href="#m19">testGetByIgnoreCaseName</a></td><td rowspan="1">1473319180676</td><td rowspan="1">11</td></tr><tr class="passedeven"><td><a href="#m20">testGetByInvIdManyVersionWithFirstSubmit</a></td><td rowspan="1">1473319181466</td><td rowspan="1">515</td></tr><tr class="passedeven"><td><a href="#m21">testGetByInvIdManyVersionWithMultSubmit</a></td><td rowspan="1">1473319182005</td><td rowspan="1">366</td></tr><tr class="passedeven"><td><a href="#m22">testGetByInvIdManyVersionWithoutSubmit</a></td><td rowspan="1">1473319180688</td><td rowspan="1">451</td></tr><tr class="passedeven"><td><a href="#m23">testGetByInvIdOnCreate</a></td><td rowspan="1">1473319180459</td><td rowspan="1">30</td></tr><tr class="passedeven"><td><a href="#m24">testGetByInvIdOnName</a></td><td rowspan="1">1473319182430</td><td rowspan="1">271</td></tr><tr class="passedeven"><td><a href="#m25">testGetBySupportedComponent</a></td><td rowspan="1">1473319181140</td><td rowspan="1">44</td></tr><tr class="passedeven"><td><a href="#m26">testGetBySupportedModel</a></td><td rowspan="1">1473319181185</td><td rowspan="1">44</td></tr><tr class="passedeven"><td><a href="#m27">testGetByVendor</a></td><td rowspan="1">1473319181230</td><td rowspan="1">41</td></tr><tr class="passedeven"><td><a href="#m28">testGetECOMPComponents</a></td><td rowspan="1">1473319180490</td><td rowspan="1">5</td></tr><tr class="passedeven"><td><a href="#m29">testSubmit</a></td><td rowspan="1">1473319182719</td><td rowspan="1">20</td></tr><tr class="passedeven"><td><a href="#m30">testSubmitOnCheckout</a></td><td rowspan="1">1473319182772</td><td rowspan="1">4</td></tr><tr class="passedeven"><td><a href="#m31">testUndoCheckout</a></td><td rowspan="1">1473319182777</td><td rowspan="1">18</td></tr><tr class="passedeven"><td><a href="#m32">testUpdateArtifact</a></td><td rowspan="1">1473319181392</td><td rowspan="1">22</td></tr><tr class="passedeven"><td><a href="#m33">testUpdateInvalidVersion_negative</a></td><td rowspan="1">1473319182371</td><td rowspan="1">7</td></tr><tr class="passedeven"><td><a href="#m34">testUpdateInvariantId_negative</a></td><td rowspan="1">1473319182378</td><td rowspan="1">6</td></tr><tr class="passedeven"><td><a href="#m35">testUpdateName_negative</a></td><td rowspan="1">1473319182385</td><td rowspan="1">8</td></tr><tr class="passedeven"><td><a href="#m36">testUpdateOnCheckedInAction_negative</a></td><td rowspan="1">1473319182712</td><td rowspan="1">7</td></tr><tr class="passedeven"><td><a href="#m37">testUpdateOtherUser_negative</a></td><td rowspan="1">1473319182394</td><td rowspan="1">7</td></tr><tr class="passedeven"><td><a href="#m38">testUpdateStatus_negative</a></td><td rowspan="1">1473319182402</td><td rowspan="1">10</td></tr><tr class="passedeven"><td><a href="#m39">testUpdateUniqueId_negative</a></td><td rowspan="1">1473319182413</td><td rowspan="1">9</td></tr><tr class="passedeven"><td><a href="#m40">testUpdateVersion_negative</a></td><td rowspan="1">1473319182422</td><td rowspan="1">7</td></tr><tr class="passedeven"><td><a href="#m41">testUploadArtifact</a></td><td rowspan="1">1473319180496</td><td rowspan="1">78</td></tr><tr class="passedeven"><td><a href="#m42">testUploadArtifactCheckedOutOtherUser_negative</a></td><td rowspan="1">1473319181415</td><td rowspan="1">6</td></tr><tr class="passedeven"><td><a href="#m43">testUploadArtifactInvalidActionInvId_negative</a></td><td rowspan="1">1473319181422</td><td rowspan="1">6</td></tr><tr class="passedeven"><td><a href="#m44">testUploadArtifactSameName_negative</a></td><td rowspan="1">1473319181428</td><td rowspan="1">9</td></tr><tr class="passedeven"><td><a href="#m45">testUploadArtifactUnlockedAction_negative</a></td><td rowspan="1">1473319181438</td><td rowspan="1">21</td></tr><tr class="passedeven"><td><a href="#m46">testgetActionsByActionUUID</a></td><td rowspan="1">1473319181460</td><td rowspan="1">5</td></tr><tr class="passedeven"><td><a href="#m47">testgetActionsByActionUUID_Negative</a></td><td rowspan="1">1473319180574</td><td rowspan="1">4</td></tr><tr class="passedeven"><td><a href="#m48">updateTest</a></td><td rowspan="1">1473319181987</td><td rowspan="1">17</td></tr></tbody></table><h2>Default test</h2><h3 id="m0">ActionTest#createTest</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m1">ActionTest#testCheckIn</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m2">ActionTest#testCheckInWithOtherUser</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m3">ActionTest#testCheckInWithoutCheckout</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m4">ActionTest#testCheckOut</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m5">ActionTest#testCheckOutOnCheckOut</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m6">ActionTest#testCheckOutOnCheckOutWithOtherUser</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m7">ActionTest#testCreateWithExistingActionName_negative</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m8">ActionTest#testDeleteArtifact</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m9">ActionTest#testDeleteArtifactInvalidActInvId</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m10">ActionTest#testDeleteArtifactInvalidArtifactUUID</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m11">ActionTest#testDeleteArtifactLockedByOtherUser</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m12">ActionTest#testDeleteArtifactOnUnlockedAction</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m13">ActionTest#testDeleteReadOnlyArtifact</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m14">ActionTest#testDownloadArtifact</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m15">ActionTest#testDownloadArtifactNegativeInvalidAction</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m16">ActionTest#testDownloadArtifactNegativeInvalidArtifact</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m17">ActionTest#testGetAllActions</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m18">ActionTest#testGetByCategory</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m19">ActionTest#testGetByIgnoreCaseName</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m20">ActionTest#testGetByInvIdManyVersionWithFirstSubmit</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m21">ActionTest#testGetByInvIdManyVersionWithMultSubmit</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m22">ActionTest#testGetByInvIdManyVersionWithoutSubmit</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m23">ActionTest#testGetByInvIdOnCreate</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m24">ActionTest#testGetByInvIdOnName</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m25">ActionTest#testGetBySupportedComponent</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m26">ActionTest#testGetBySupportedModel</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m27">ActionTest#testGetByVendor</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m28">ActionTest#testGetECOMPComponents</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m29">ActionTest#testSubmit</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m30">ActionTest#testSubmitOnCheckout</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m31">ActionTest#testUndoCheckout</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m32">ActionTest#testUpdateArtifact</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m33">ActionTest#testUpdateInvalidVersion_negative</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m34">ActionTest#testUpdateInvariantId_negative</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m35">ActionTest#testUpdateName_negative</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m36">ActionTest#testUpdateOnCheckedInAction_negative</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m37">ActionTest#testUpdateOtherUser_negative</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m38">ActionTest#testUpdateStatus_negative</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m39">ActionTest#testUpdateUniqueId_negative</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m40">ActionTest#testUpdateVersion_negative</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m41">ActionTest#testUploadArtifact</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m42">ActionTest#testUploadArtifactCheckedOutOtherUser_negative</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m43">ActionTest#testUploadArtifactInvalidActionInvId_negative</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m44">ActionTest#testUploadArtifactSameName_negative</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m45">ActionTest#testUploadArtifactUnlockedAction_negative</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m46">ActionTest#testgetActionsByActionUUID</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m47">ActionTest#testgetActionsByActionUUID_Negative</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p><h3 id="m48">ActionTest#updateTest</h3><table class="result"></table><p class="totop"><a href="#summary">back to summary</a></p></body></html> \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/failed.png b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/failed.png
new file mode 100644
index 0000000000..c117be59a9
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/failed.png
Binary files differ
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/index.html b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/index.html
new file mode 100644
index 0000000000..a9227f662e
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/index.html
@@ -0,0 +1,1231 @@
+<!DOCTYPE html>
+
+<html>
+ <head>
+ <title>TestNG reports</title>
+
+ <link type="text/css" href="testng-reports.css" rel="stylesheet" />
+ <script type="text/javascript" src="jquery-1.7.1.min.js"></script>
+ <script type="text/javascript" src="testng-reports.js"></script>
+ <script type="text/javascript" src="https://www.google.com/jsapi"></script>
+ <script type='text/javascript'>
+ google.load('visualization', '1', {packages:['table']});
+ google.setOnLoadCallback(drawTable);
+ var suiteTableInitFunctions = new Array();
+ var suiteTableData = new Array();
+ </script>
+ <!--
+ <script type="text/javascript" src="jquery-ui/js/jquery-ui-1.8.16.custom.min.js"></script>
+ -->
+ </head>
+
+ <body>
+ <div class="top-banner-root">
+ <span class="top-banner-title-font">Test results</span>
+ <br/>
+ <span class="top-banner-font-1">1 suite</span>
+ </div> <!-- top-banner-root -->
+ <div class="navigator-root">
+ <div class="navigator-suite-header">
+ <span>All suites</span>
+ <a href="#" class="collapse-all-link" title="Collapse/expand all the suites">
+ <img class="collapse-all-icon" src="collapseall.gif">
+ </img> <!-- collapse-all-icon -->
+ </a> <!-- collapse-all-link -->
+ </div> <!-- navigator-suite-header -->
+ <div class="suite">
+ <div class="rounded-window">
+ <div class="suite-header light-rounded-window-top">
+ <a href="#" class="navigator-link" panel-name="suite-Default_suite">
+ <span class="suite-name border-passed">Default suite</span>
+ </a> <!-- navigator-link -->
+ </div> <!-- suite-header light-rounded-window-top -->
+ <div class="navigator-suite-content">
+ <div class="suite-section-title">
+ <span>Info</span>
+ </div> <!-- suite-section-title -->
+ <div class="suite-section-content">
+ <ul>
+ <li>
+ <a href="#" class="navigator-link " panel-name="test-xml-Default_suite">
+ <span>C:\Users\sheetalm\AppData\Local\Temp\testng-eclipse--1963739526\testng-customsuite.xml</span>
+ </a> <!-- navigator-link -->
+ </li>
+ <li>
+ <a href="#" class="navigator-link " panel-name="testlist-Default_suite">
+ <span class="test-stats">1 test</span>
+ </a> <!-- navigator-link -->
+ </li>
+ <li>
+ <a href="#" class="navigator-link " panel-name="group-Default_suite">
+ <span>1 group</span>
+ </a> <!-- navigator-link -->
+ </li>
+ <li>
+ <a href="#" class="navigator-link " panel-name="times-Default_suite">
+ <span>Times</span>
+ </a> <!-- navigator-link -->
+ </li>
+ <li>
+ <a href="#" class="navigator-link " panel-name="reporter-Default_suite">
+ <span>Reporter output</span>
+ </a> <!-- navigator-link -->
+ </li>
+ <li>
+ <a href="#" class="navigator-link " panel-name="ignored-methods-Default_suite">
+ <span>Ignored methods</span>
+ </a> <!-- navigator-link -->
+ </li>
+ <li>
+ <a href="#" class="navigator-link " panel-name="chronological-Default_suite">
+ <span>Chronological view</span>
+ </a> <!-- navigator-link -->
+ </li>
+ </ul>
+ </div> <!-- suite-section-content -->
+ <div class="result-section">
+ <div class="suite-section-title">
+ <span>Results</span>
+ </div> <!-- suite-section-title -->
+ <div class="suite-section-content">
+ <ul>
+ <li>
+ <span class="method-stats">49 methods, 49 passed</span>
+ </li>
+ <li>
+ <span class="method-list-title passed">Passed methods</span>
+ <span class="show-or-hide-methods passed">
+ <a href="#" panel-name="suite-Default_suite" class="hide-methods passed suite-Default_suite"> (hide)</a> <!-- hide-methods passed suite-Default_suite -->
+ <a href="#" panel-name="suite-Default_suite" class="show-methods passed suite-Default_suite"> (show)</a> <!-- show-methods passed suite-Default_suite -->
+ </span>
+ <div class="method-list-content passed suite-Default_suite">
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="createTest">createTest</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testCheckIn">testCheckIn</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testCheckInWithOtherUser">testCheckInWithOtherUser</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testCheckInWithoutCheckout">testCheckInWithoutCheckout</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testCheckOut">testCheckOut</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testCheckOutOnCheckOut">testCheckOutOnCheckOut</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testCheckOutOnCheckOutWithOtherUser">testCheckOutOnCheckOutWithOtherUser</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testCreateWithExistingActionName_negative">testCreateWithExistingActionName_negative</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testDeleteArtifact">testDeleteArtifact</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testDeleteArtifactInvalidActInvId">testDeleteArtifactInvalidActInvId</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testDeleteArtifactInvalidArtifactUUID">testDeleteArtifactInvalidArtifactUUID</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testDeleteArtifactLockedByOtherUser">testDeleteArtifactLockedByOtherUser</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testDeleteArtifactOnUnlockedAction">testDeleteArtifactOnUnlockedAction</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testDeleteReadOnlyArtifact">testDeleteReadOnlyArtifact</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testDownloadArtifact">testDownloadArtifact</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testDownloadArtifactNegativeInvalidAction">testDownloadArtifactNegativeInvalidAction</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testDownloadArtifactNegativeInvalidArtifact">testDownloadArtifactNegativeInvalidArtifact</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testGetAllActions">testGetAllActions</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testGetByCategory">testGetByCategory</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testGetByIgnoreCaseName">testGetByIgnoreCaseName</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testGetByInvIdManyVersionWithFirstSubmit">testGetByInvIdManyVersionWithFirstSubmit</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testGetByInvIdManyVersionWithMultSubmit">testGetByInvIdManyVersionWithMultSubmit</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testGetByInvIdManyVersionWithoutSubmit">testGetByInvIdManyVersionWithoutSubmit</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testGetByInvIdOnCreate">testGetByInvIdOnCreate</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testGetByInvIdOnName">testGetByInvIdOnName</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testGetBySupportedComponent">testGetBySupportedComponent</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testGetBySupportedModel">testGetBySupportedModel</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testGetByVendor">testGetByVendor</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testGetECOMPComponents">testGetECOMPComponents</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testSubmit">testSubmit</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testSubmitOnCheckout">testSubmitOnCheckout</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testUndoCheckout">testUndoCheckout</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testUpdateArtifact">testUpdateArtifact</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testUpdateInvalidVersion_negative">testUpdateInvalidVersion_negative</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testUpdateInvariantId_negative">testUpdateInvariantId_negative</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testUpdateName_negative">testUpdateName_negative</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testUpdateOnCheckedInAction_negative">testUpdateOnCheckedInAction_negative</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testUpdateOtherUser_negative">testUpdateOtherUser_negative</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testUpdateStatus_negative">testUpdateStatus_negative</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testUpdateUniqueId_negative">testUpdateUniqueId_negative</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testUpdateVersion_negative">testUpdateVersion_negative</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testUploadArtifact">testUploadArtifact</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testUploadArtifactCheckedOutOtherUser_negative">testUploadArtifactCheckedOutOtherUser_negative</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testUploadArtifactInvalidActionInvId_negative">testUploadArtifactInvalidActionInvId_negative</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testUploadArtifactSameName_negative">testUploadArtifactSameName_negative</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testUploadArtifactUnlockedAction_negative">testUploadArtifactUnlockedAction_negative</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testgetActionsByActionUUID">testgetActionsByActionUUID</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="testgetActionsByActionUUID_Negative">testgetActionsByActionUUID_Negative</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ <span>
+ <img width="3%" src="passed.png"/>
+ <a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="ActionTest" hash-for-method="updateTest">updateTest</a> <!-- method navigator-link -->
+ </span>
+ <br/>
+ </div> <!-- method-list-content passed suite-Default_suite -->
+ </li>
+ </ul>
+ </div> <!-- suite-section-content -->
+ </div> <!-- result-section -->
+ </div> <!-- navigator-suite-content -->
+ </div> <!-- rounded-window -->
+ </div> <!-- suite -->
+ </div> <!-- navigator-root -->
+ <div class="wrapper">
+ <div class="main-panel-root">
+ <div panel-name="suite-Default_suite" class="panel Default_suite">
+ <div class="suite-Default_suite-class-passed">
+ <div class="main-panel-header rounded-window-top">
+ <img src="passed.png"/>
+ <span class="class-name">ActionTest</span>
+ </div> <!-- main-panel-header rounded-window-top -->
+ <div class="main-panel-content rounded-window-bottom">
+ <div class="method">
+ <div class="method-content">
+ <a name="createTest">
+ </a> <!-- createTest -->
+ <span class="method-name">createTest</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testCheckIn">
+ </a> <!-- testCheckIn -->
+ <span class="method-name">testCheckIn</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testCheckInWithOtherUser">
+ </a> <!-- testCheckInWithOtherUser -->
+ <span class="method-name">testCheckInWithOtherUser</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testCheckInWithoutCheckout">
+ </a> <!-- testCheckInWithoutCheckout -->
+ <span class="method-name">testCheckInWithoutCheckout</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testCheckOut">
+ </a> <!-- testCheckOut -->
+ <span class="method-name">testCheckOut</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testCheckOutOnCheckOut">
+ </a> <!-- testCheckOutOnCheckOut -->
+ <span class="method-name">testCheckOutOnCheckOut</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testCheckOutOnCheckOutWithOtherUser">
+ </a> <!-- testCheckOutOnCheckOutWithOtherUser -->
+ <span class="method-name">testCheckOutOnCheckOutWithOtherUser</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testCreateWithExistingActionName_negative">
+ </a> <!-- testCreateWithExistingActionName_negative -->
+ <span class="method-name">testCreateWithExistingActionName_negative</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testDeleteArtifact">
+ </a> <!-- testDeleteArtifact -->
+ <span class="method-name">testDeleteArtifact</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testDeleteArtifactInvalidActInvId">
+ </a> <!-- testDeleteArtifactInvalidActInvId -->
+ <span class="method-name">testDeleteArtifactInvalidActInvId</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testDeleteArtifactInvalidArtifactUUID">
+ </a> <!-- testDeleteArtifactInvalidArtifactUUID -->
+ <span class="method-name">testDeleteArtifactInvalidArtifactUUID</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testDeleteArtifactLockedByOtherUser">
+ </a> <!-- testDeleteArtifactLockedByOtherUser -->
+ <span class="method-name">testDeleteArtifactLockedByOtherUser</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testDeleteArtifactOnUnlockedAction">
+ </a> <!-- testDeleteArtifactOnUnlockedAction -->
+ <span class="method-name">testDeleteArtifactOnUnlockedAction</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testDeleteReadOnlyArtifact">
+ </a> <!-- testDeleteReadOnlyArtifact -->
+ <span class="method-name">testDeleteReadOnlyArtifact</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testDownloadArtifact">
+ </a> <!-- testDownloadArtifact -->
+ <span class="method-name">testDownloadArtifact</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testDownloadArtifactNegativeInvalidAction">
+ </a> <!-- testDownloadArtifactNegativeInvalidAction -->
+ <span class="method-name">testDownloadArtifactNegativeInvalidAction</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testDownloadArtifactNegativeInvalidArtifact">
+ </a> <!-- testDownloadArtifactNegativeInvalidArtifact -->
+ <span class="method-name">testDownloadArtifactNegativeInvalidArtifact</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testGetAllActions">
+ </a> <!-- testGetAllActions -->
+ <span class="method-name">testGetAllActions</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testGetByCategory">
+ </a> <!-- testGetByCategory -->
+ <span class="method-name">testGetByCategory</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testGetByIgnoreCaseName">
+ </a> <!-- testGetByIgnoreCaseName -->
+ <span class="method-name">testGetByIgnoreCaseName</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testGetByInvIdManyVersionWithFirstSubmit">
+ </a> <!-- testGetByInvIdManyVersionWithFirstSubmit -->
+ <span class="method-name">testGetByInvIdManyVersionWithFirstSubmit</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testGetByInvIdManyVersionWithMultSubmit">
+ </a> <!-- testGetByInvIdManyVersionWithMultSubmit -->
+ <span class="method-name">testGetByInvIdManyVersionWithMultSubmit</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testGetByInvIdManyVersionWithoutSubmit">
+ </a> <!-- testGetByInvIdManyVersionWithoutSubmit -->
+ <span class="method-name">testGetByInvIdManyVersionWithoutSubmit</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testGetByInvIdOnCreate">
+ </a> <!-- testGetByInvIdOnCreate -->
+ <span class="method-name">testGetByInvIdOnCreate</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testGetByInvIdOnName">
+ </a> <!-- testGetByInvIdOnName -->
+ <span class="method-name">testGetByInvIdOnName</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testGetBySupportedComponent">
+ </a> <!-- testGetBySupportedComponent -->
+ <span class="method-name">testGetBySupportedComponent</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testGetBySupportedModel">
+ </a> <!-- testGetBySupportedModel -->
+ <span class="method-name">testGetBySupportedModel</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testGetByVendor">
+ </a> <!-- testGetByVendor -->
+ <span class="method-name">testGetByVendor</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testGetECOMPComponents">
+ </a> <!-- testGetECOMPComponents -->
+ <span class="method-name">testGetECOMPComponents</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testSubmit">
+ </a> <!-- testSubmit -->
+ <span class="method-name">testSubmit</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testSubmitOnCheckout">
+ </a> <!-- testSubmitOnCheckout -->
+ <span class="method-name">testSubmitOnCheckout</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testUndoCheckout">
+ </a> <!-- testUndoCheckout -->
+ <span class="method-name">testUndoCheckout</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testUpdateArtifact">
+ </a> <!-- testUpdateArtifact -->
+ <span class="method-name">testUpdateArtifact</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testUpdateInvalidVersion_negative">
+ </a> <!-- testUpdateInvalidVersion_negative -->
+ <span class="method-name">testUpdateInvalidVersion_negative</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testUpdateInvariantId_negative">
+ </a> <!-- testUpdateInvariantId_negative -->
+ <span class="method-name">testUpdateInvariantId_negative</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testUpdateName_negative">
+ </a> <!-- testUpdateName_negative -->
+ <span class="method-name">testUpdateName_negative</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testUpdateOnCheckedInAction_negative">
+ </a> <!-- testUpdateOnCheckedInAction_negative -->
+ <span class="method-name">testUpdateOnCheckedInAction_negative</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testUpdateOtherUser_negative">
+ </a> <!-- testUpdateOtherUser_negative -->
+ <span class="method-name">testUpdateOtherUser_negative</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testUpdateStatus_negative">
+ </a> <!-- testUpdateStatus_negative -->
+ <span class="method-name">testUpdateStatus_negative</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testUpdateUniqueId_negative">
+ </a> <!-- testUpdateUniqueId_negative -->
+ <span class="method-name">testUpdateUniqueId_negative</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testUpdateVersion_negative">
+ </a> <!-- testUpdateVersion_negative -->
+ <span class="method-name">testUpdateVersion_negative</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testUploadArtifact">
+ </a> <!-- testUploadArtifact -->
+ <span class="method-name">testUploadArtifact</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testUploadArtifactCheckedOutOtherUser_negative">
+ </a> <!-- testUploadArtifactCheckedOutOtherUser_negative -->
+ <span class="method-name">testUploadArtifactCheckedOutOtherUser_negative</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testUploadArtifactInvalidActionInvId_negative">
+ </a> <!-- testUploadArtifactInvalidActionInvId_negative -->
+ <span class="method-name">testUploadArtifactInvalidActionInvId_negative</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testUploadArtifactSameName_negative">
+ </a> <!-- testUploadArtifactSameName_negative -->
+ <span class="method-name">testUploadArtifactSameName_negative</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testUploadArtifactUnlockedAction_negative">
+ </a> <!-- testUploadArtifactUnlockedAction_negative -->
+ <span class="method-name">testUploadArtifactUnlockedAction_negative</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testgetActionsByActionUUID">
+ </a> <!-- testgetActionsByActionUUID -->
+ <span class="method-name">testgetActionsByActionUUID</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="testgetActionsByActionUUID_Negative">
+ </a> <!-- testgetActionsByActionUUID_Negative -->
+ <span class="method-name">testgetActionsByActionUUID_Negative</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ <div class="method">
+ <div class="method-content">
+ <a name="updateTest">
+ </a> <!-- updateTest -->
+ <span class="method-name">updateTest</span>
+ </div> <!-- method-content -->
+ </div> <!-- method -->
+ </div> <!-- main-panel-content rounded-window-bottom -->
+ </div> <!-- suite-Default_suite-class-passed -->
+ </div> <!-- panel Default_suite -->
+ <div panel-name="test-xml-Default_suite" class="panel">
+ <div class="main-panel-header rounded-window-top">
+ <span class="header-content">C:\Users\sheetalm\AppData\Local\Temp\testng-eclipse--1963739526\testng-customsuite.xml</span>
+ </div> <!-- main-panel-header rounded-window-top -->
+ <div class="main-panel-content rounded-window-bottom">
+ <pre>
+&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
+&lt;!DOCTYPE suite SYSTEM &quot;http://testng.org/testng-1.0.dtd&quot;&gt;
+&lt;suite name=&quot;Default suite&quot;&gt;
+ &lt;test verbose=&quot;2&quot; name=&quot;Default test&quot;&gt;
+ &lt;classes&gt;
+ &lt;class name=&quot;ActionTest&quot;/&gt;
+ &lt;/classes&gt;
+ &lt;/test&gt; &lt;!-- Default test --&gt;
+&lt;/suite&gt; &lt;!-- Default suite --&gt;
+ </pre>
+ </div> <!-- main-panel-content rounded-window-bottom -->
+ </div> <!-- panel -->
+ <div panel-name="testlist-Default_suite" class="panel">
+ <div class="main-panel-header rounded-window-top">
+ <span class="header-content">Tests for Default suite</span>
+ </div> <!-- main-panel-header rounded-window-top -->
+ <div class="main-panel-content rounded-window-bottom">
+ <ul>
+ <li>
+ <span class="test-name">Default test (1 class)</span>
+ </li>
+ </ul>
+ </div> <!-- main-panel-content rounded-window-bottom -->
+ </div> <!-- panel -->
+ <div panel-name="group-Default_suite" class="panel">
+ <div class="main-panel-header rounded-window-top">
+ <span class="header-content">Groups for Default suite</span>
+ </div> <!-- main-panel-header rounded-window-top -->
+ <div class="main-panel-content rounded-window-bottom">
+ <div class="test-group">
+ <span class="test-group-name">updateTestGroup</span>
+ <br/>
+ <div class="method-in-group">
+ <span class="method-in-group-name">testUpdateInvalidVersion_negative</span>
+ <br/>
+ </div> <!-- method-in-group -->
+ <div class="method-in-group">
+ <span class="method-in-group-name">testUpdateInvariantId_negative</span>
+ <br/>
+ </div> <!-- method-in-group -->
+ <div class="method-in-group">
+ <span class="method-in-group-name">testUpdateName_negative</span>
+ <br/>
+ </div> <!-- method-in-group -->
+ <div class="method-in-group">
+ <span class="method-in-group-name">testUpdateOtherUser_negative</span>
+ <br/>
+ </div> <!-- method-in-group -->
+ <div class="method-in-group">
+ <span class="method-in-group-name">testUpdateStatus_negative</span>
+ <br/>
+ </div> <!-- method-in-group -->
+ <div class="method-in-group">
+ <span class="method-in-group-name">testUpdateUniqueId_negative</span>
+ <br/>
+ </div> <!-- method-in-group -->
+ <div class="method-in-group">
+ <span class="method-in-group-name">testUpdateVersion_negative</span>
+ <br/>
+ </div> <!-- method-in-group -->
+ <div class="method-in-group">
+ <span class="method-in-group-name">updateTest</span>
+ <br/>
+ </div> <!-- method-in-group -->
+ </div> <!-- test-group -->
+ </div> <!-- main-panel-content rounded-window-bottom -->
+ </div> <!-- panel -->
+ <div panel-name="times-Default_suite" class="panel">
+ <div class="main-panel-header rounded-window-top">
+ <span class="header-content">Times for Default suite</span>
+ </div> <!-- main-panel-header rounded-window-top -->
+ <div class="main-panel-content rounded-window-bottom">
+ <div class="times-div">
+ <script type="text/javascript">
+suiteTableInitFunctions.push('tableData_Default_suite');
+function tableData_Default_suite() {
+var data = new google.visualization.DataTable();
+data.addColumn('number', 'Number');
+data.addColumn('string', 'Method');
+data.addColumn('string', 'Class');
+data.addColumn('number', 'Time (ms)');
+data.addRows(49);
+data.setCell(0, 0, 0)
+data.setCell(0, 1, 'testGetByCategory')
+data.setCell(0, 2, 'ActionTest')
+data.setCell(0, 3, 961);
+data.setCell(1, 0, 1)
+data.setCell(1, 1, 'testGetByInvIdManyVersionWithFirstSubmit')
+data.setCell(1, 2, 'ActionTest')
+data.setCell(1, 3, 515);
+data.setCell(2, 0, 2)
+data.setCell(2, 1, 'testGetByInvIdManyVersionWithoutSubmit')
+data.setCell(2, 2, 'ActionTest')
+data.setCell(2, 3, 451);
+data.setCell(3, 0, 3)
+data.setCell(3, 1, 'testGetByInvIdManyVersionWithMultSubmit')
+data.setCell(3, 2, 'ActionTest')
+data.setCell(3, 3, 366);
+data.setCell(4, 0, 4)
+data.setCell(4, 1, 'testGetByInvIdOnName')
+data.setCell(4, 2, 'ActionTest')
+data.setCell(4, 3, 271);
+data.setCell(5, 0, 5)
+data.setCell(5, 1, 'createTest')
+data.setCell(5, 2, 'ActionTest')
+data.setCell(5, 3, 79);
+data.setCell(6, 0, 6)
+data.setCell(6, 1, 'testUploadArtifact')
+data.setCell(6, 2, 'ActionTest')
+data.setCell(6, 3, 78);
+data.setCell(7, 0, 7)
+data.setCell(7, 1, 'testDeleteReadOnlyArtifact')
+data.setCell(7, 2, 'ActionTest')
+data.setCell(7, 3, 59);
+data.setCell(8, 0, 8)
+data.setCell(8, 1, 'testGetAllActions')
+data.setCell(8, 2, 'ActionTest')
+data.setCell(8, 3, 56);
+data.setCell(9, 0, 9)
+data.setCell(9, 1, 'testGetBySupportedModel')
+data.setCell(9, 2, 'ActionTest')
+data.setCell(9, 3, 44);
+data.setCell(10, 0, 10)
+data.setCell(10, 1, 'testGetBySupportedComponent')
+data.setCell(10, 2, 'ActionTest')
+data.setCell(10, 3, 44);
+data.setCell(11, 0, 11)
+data.setCell(11, 1, 'testGetByVendor')
+data.setCell(11, 2, 'ActionTest')
+data.setCell(11, 3, 41);
+data.setCell(12, 0, 12)
+data.setCell(12, 1, 'testDeleteArtifact')
+data.setCell(12, 2, 'ActionTest')
+data.setCell(12, 3, 39);
+data.setCell(13, 0, 13)
+data.setCell(13, 1, 'testGetByInvIdOnCreate')
+data.setCell(13, 2, 'ActionTest')
+data.setCell(13, 3, 30);
+data.setCell(14, 0, 14)
+data.setCell(14, 1, 'testUpdateArtifact')
+data.setCell(14, 2, 'ActionTest')
+data.setCell(14, 3, 22);
+data.setCell(15, 0, 15)
+data.setCell(15, 1, 'testCheckOut')
+data.setCell(15, 2, 'ActionTest')
+data.setCell(15, 3, 21);
+data.setCell(16, 0, 16)
+data.setCell(16, 1, 'testUploadArtifactUnlockedAction_negative')
+data.setCell(16, 2, 'ActionTest')
+data.setCell(16, 3, 21);
+data.setCell(17, 0, 17)
+data.setCell(17, 1, 'testSubmit')
+data.setCell(17, 2, 'ActionTest')
+data.setCell(17, 3, 20);
+data.setCell(18, 0, 18)
+data.setCell(18, 1, 'testUndoCheckout')
+data.setCell(18, 2, 'ActionTest')
+data.setCell(18, 3, 18);
+data.setCell(19, 0, 19)
+data.setCell(19, 1, 'updateTest')
+data.setCell(19, 2, 'ActionTest')
+data.setCell(19, 3, 17);
+data.setCell(20, 0, 20)
+data.setCell(20, 1, 'testCheckOutOnCheckOut')
+data.setCell(20, 2, 'ActionTest')
+data.setCell(20, 3, 13);
+data.setCell(21, 0, 21)
+data.setCell(21, 1, 'testGetByIgnoreCaseName')
+data.setCell(21, 2, 'ActionTest')
+data.setCell(21, 3, 11);
+data.setCell(22, 0, 22)
+data.setCell(22, 1, 'testUpdateStatus_negative')
+data.setCell(22, 2, 'ActionTest')
+data.setCell(22, 3, 10);
+data.setCell(23, 0, 23)
+data.setCell(23, 1, 'testCheckIn')
+data.setCell(23, 2, 'ActionTest')
+data.setCell(23, 3, 10);
+data.setCell(24, 0, 24)
+data.setCell(24, 1, 'testDeleteArtifactInvalidArtifactUUID')
+data.setCell(24, 2, 'ActionTest')
+data.setCell(24, 3, 9);
+data.setCell(25, 0, 25)
+data.setCell(25, 1, 'testCheckOutOnCheckOutWithOtherUser')
+data.setCell(25, 2, 'ActionTest')
+data.setCell(25, 3, 9);
+data.setCell(26, 0, 26)
+data.setCell(26, 1, 'testUploadArtifactSameName_negative')
+data.setCell(26, 2, 'ActionTest')
+data.setCell(26, 3, 9);
+data.setCell(27, 0, 27)
+data.setCell(27, 1, 'testUpdateUniqueId_negative')
+data.setCell(27, 2, 'ActionTest')
+data.setCell(27, 3, 9);
+data.setCell(28, 0, 28)
+data.setCell(28, 1, 'testDownloadArtifact')
+data.setCell(28, 2, 'ActionTest')
+data.setCell(28, 3, 8);
+data.setCell(29, 0, 29)
+data.setCell(29, 1, 'testUpdateName_negative')
+data.setCell(29, 2, 'ActionTest')
+data.setCell(29, 3, 8);
+data.setCell(30, 0, 30)
+data.setCell(30, 1, 'testUpdateInvalidVersion_negative')
+data.setCell(30, 2, 'ActionTest')
+data.setCell(30, 3, 7);
+data.setCell(31, 0, 31)
+data.setCell(31, 1, 'testUpdateVersion_negative')
+data.setCell(31, 2, 'ActionTest')
+data.setCell(31, 3, 7);
+data.setCell(32, 0, 32)
+data.setCell(32, 1, 'testUpdateOnCheckedInAction_negative')
+data.setCell(32, 2, 'ActionTest')
+data.setCell(32, 3, 7);
+data.setCell(33, 0, 33)
+data.setCell(33, 1, 'testUpdateOtherUser_negative')
+data.setCell(33, 2, 'ActionTest')
+data.setCell(33, 3, 7);
+data.setCell(34, 0, 34)
+data.setCell(34, 1, 'testUpdateInvariantId_negative')
+data.setCell(34, 2, 'ActionTest')
+data.setCell(34, 3, 6);
+data.setCell(35, 0, 35)
+data.setCell(35, 1, 'testUploadArtifactInvalidActionInvId_negative')
+data.setCell(35, 2, 'ActionTest')
+data.setCell(35, 3, 6);
+data.setCell(36, 0, 36)
+data.setCell(36, 1, 'testUploadArtifactCheckedOutOtherUser_negative')
+data.setCell(36, 2, 'ActionTest')
+data.setCell(36, 3, 6);
+data.setCell(37, 0, 37)
+data.setCell(37, 1, 'testDeleteArtifactOnUnlockedAction')
+data.setCell(37, 2, 'ActionTest')
+data.setCell(37, 3, 5);
+data.setCell(38, 0, 38)
+data.setCell(38, 1, 'testCheckInWithOtherUser')
+data.setCell(38, 2, 'ActionTest')
+data.setCell(38, 3, 5);
+data.setCell(39, 0, 39)
+data.setCell(39, 1, 'testCreateWithExistingActionName_negative')
+data.setCell(39, 2, 'ActionTest')
+data.setCell(39, 3, 5);
+data.setCell(40, 0, 40)
+data.setCell(40, 1, 'testgetActionsByActionUUID')
+data.setCell(40, 2, 'ActionTest')
+data.setCell(40, 3, 5);
+data.setCell(41, 0, 41)
+data.setCell(41, 1, 'testDownloadArtifactNegativeInvalidArtifact')
+data.setCell(41, 2, 'ActionTest')
+data.setCell(41, 3, 5);
+data.setCell(42, 0, 42)
+data.setCell(42, 1, 'testDeleteArtifactLockedByOtherUser')
+data.setCell(42, 2, 'ActionTest')
+data.setCell(42, 3, 5);
+data.setCell(43, 0, 43)
+data.setCell(43, 1, 'testGetECOMPComponents')
+data.setCell(43, 2, 'ActionTest')
+data.setCell(43, 3, 5);
+data.setCell(44, 0, 44)
+data.setCell(44, 1, 'testSubmitOnCheckout')
+data.setCell(44, 2, 'ActionTest')
+data.setCell(44, 3, 4);
+data.setCell(45, 0, 45)
+data.setCell(45, 1, 'testCheckInWithoutCheckout')
+data.setCell(45, 2, 'ActionTest')
+data.setCell(45, 3, 4);
+data.setCell(46, 0, 46)
+data.setCell(46, 1, 'testDownloadArtifactNegativeInvalidAction')
+data.setCell(46, 2, 'ActionTest')
+data.setCell(46, 3, 4);
+data.setCell(47, 0, 47)
+data.setCell(47, 1, 'testgetActionsByActionUUID_Negative')
+data.setCell(47, 2, 'ActionTest')
+data.setCell(47, 3, 4);
+data.setCell(48, 0, 48)
+data.setCell(48, 1, 'testDeleteArtifactInvalidActInvId')
+data.setCell(48, 2, 'ActionTest')
+data.setCell(48, 3, 3);
+window.suiteTableData['Default_suite']= { tableData: data, tableDiv: 'times-div-Default_suite'}
+return data;
+}
+ </script>
+ <span class="suite-total-time">Total running time: 3 seconds</span>
+ <div id="times-div-Default_suite">
+ </div> <!-- times-div-Default_suite -->
+ </div> <!-- times-div -->
+ </div> <!-- main-panel-content rounded-window-bottom -->
+ </div> <!-- panel -->
+ <div panel-name="reporter-Default_suite" class="panel">
+ <div class="main-panel-header rounded-window-top">
+ <span class="header-content">Reporter output for Default suite</span>
+ </div> <!-- main-panel-header rounded-window-top -->
+ <div class="main-panel-content rounded-window-bottom">
+ </div> <!-- main-panel-content rounded-window-bottom -->
+ </div> <!-- panel -->
+ <div panel-name="ignored-methods-Default_suite" class="panel">
+ <div class="main-panel-header rounded-window-top">
+ <span class="header-content">0 ignored methods</span>
+ </div> <!-- main-panel-header rounded-window-top -->
+ <div class="main-panel-content rounded-window-bottom">
+ </div> <!-- main-panel-content rounded-window-bottom -->
+ </div> <!-- panel -->
+ <div panel-name="chronological-Default_suite" class="panel">
+ <div class="main-panel-header rounded-window-top">
+ <span class="header-content">Methods in chronological order</span>
+ </div> <!-- main-panel-header rounded-window-top -->
+ <div class="main-panel-content rounded-window-bottom">
+ <div class="chronological-class">
+ <div class="chronological-class-name">ActionTest</div> <!-- chronological-class-name -->
+ <div class="configuration-test before">
+ <span class="method-name">init</span>
+ <span class="method-start">0 ms</span>
+ </div> <!-- configuration-test before -->
+ <div class="test-method">
+ <span class="method-name">createTest</span>
+ <span class="method-start">2619 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testDeleteArtifactInvalidActInvId</span>
+ <span class="method-start">2699 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testDownloadArtifactNegativeInvalidAction</span>
+ <span class="method-start">2703 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testGetByCategory</span>
+ <span class="method-start">2708 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testGetByInvIdOnCreate</span>
+ <span class="method-start">3670 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testGetECOMPComponents</span>
+ <span class="method-start">3701 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testUploadArtifact</span>
+ <span class="method-start">3707 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testgetActionsByActionUUID_Negative</span>
+ <span class="method-start">3785 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testCheckOutOnCheckOut</span>
+ <span class="method-start">3791 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testCheckOutOnCheckOutWithOtherUser</span>
+ <span class="method-start">3805 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testCreateWithExistingActionName_negative</span>
+ <span class="method-start">3814 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testGetAllActions</span>
+ <span class="method-start">3820 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testDeleteArtifactInvalidArtifactUUID</span>
+ <span class="method-start">3877 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testGetByIgnoreCaseName</span>
+ <span class="method-start">3887 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testGetByInvIdManyVersionWithoutSubmit</span>
+ <span class="method-start">3899 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testGetBySupportedComponent</span>
+ <span class="method-start">4351 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testGetBySupportedModel</span>
+ <span class="method-start">4396 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testGetByVendor</span>
+ <span class="method-start">4441 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testDeleteArtifact</span>
+ <span class="method-start">4483 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testDeleteArtifactLockedByOtherUser</span>
+ <span class="method-start">4523 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testDeleteReadOnlyArtifact</span>
+ <span class="method-start">4528 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testDownloadArtifact</span>
+ <span class="method-start">4588 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testDownloadArtifactNegativeInvalidArtifact</span>
+ <span class="method-start">4597 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testUpdateArtifact</span>
+ <span class="method-start">4603 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testUploadArtifactCheckedOutOtherUser_negative</span>
+ <span class="method-start">4626 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testUploadArtifactInvalidActionInvId_negative</span>
+ <span class="method-start">4633 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testUploadArtifactSameName_negative</span>
+ <span class="method-start">4639 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testUploadArtifactUnlockedAction_negative</span>
+ <span class="method-start">4649 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testgetActionsByActionUUID</span>
+ <span class="method-start">4671 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testGetByInvIdManyVersionWithFirstSubmit</span>
+ <span class="method-start">4677 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testDeleteArtifactOnUnlockedAction</span>
+ <span class="method-start">5193 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">updateTest</span>
+ <span class="method-start">5198 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testGetByInvIdManyVersionWithMultSubmit</span>
+ <span class="method-start">5216 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testUpdateInvalidVersion_negative</span>
+ <span class="method-start">5582 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testUpdateInvariantId_negative</span>
+ <span class="method-start">5589 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testUpdateName_negative</span>
+ <span class="method-start">5596 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testUpdateOtherUser_negative</span>
+ <span class="method-start">5605 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testUpdateStatus_negative</span>
+ <span class="method-start">5613 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testUpdateUniqueId_negative</span>
+ <span class="method-start">5624 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testUpdateVersion_negative</span>
+ <span class="method-start">5633 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testGetByInvIdOnName</span>
+ <span class="method-start">5641 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testCheckIn</span>
+ <span class="method-start">5912 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testUpdateOnCheckedInAction_negative</span>
+ <span class="method-start">5923 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testSubmit</span>
+ <span class="method-start">5930 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testCheckInWithoutCheckout</span>
+ <span class="method-start">5951 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testCheckOut</span>
+ <span class="method-start">5956 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testCheckInWithOtherUser</span>
+ <span class="method-start">5977 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testSubmitOnCheckout</span>
+ <span class="method-start">5983 ms</span>
+ </div> <!-- test-method -->
+ <div class="test-method">
+ <span class="method-name">testUndoCheckout</span>
+ <span class="method-start">5988 ms</span>
+ </div> <!-- test-method -->
+ </div> <!-- main-panel-content rounded-window-bottom -->
+ </div> <!-- panel -->
+ </div> <!-- main-panel-root -->
+ </div> <!-- wrapper -->
+ </body>
+</html>
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/jquery-1.7.1.min.js b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/jquery-1.7.1.min.js
new file mode 100644
index 0000000000..198b3ff07d
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/jquery-1.7.1.min.js
@@ -0,0 +1,4 @@
+/*! jQuery v1.7.1 jquery.com | jquery.org/license */
+(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function cb(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function ca(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bE.test(a)?d(a,e):ca(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)ca(a+"["+e+"]",b[e],c,d);else d(a,b)}function b_(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function b$(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bT,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=b$(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=b$(a,c,d,e,"*",g));return l}function bZ(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bP),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bC(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bx:by,g=0,h=e.length;if(d>0){if(c!=="border")for(;g<h;g++)c||(d-=parseFloat(f.css(a,"padding"+e[g]))||0),c==="margin"?d+=parseFloat(f.css(a,c+e[g]))||0:d-=parseFloat(f.css(a,"border"+e[g]+"Width"))||0;return d+"px"}d=bz(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0;if(c)for(;g<h;g++)d+=parseFloat(f.css(a,"padding"+e[g]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+e[g]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+e[g]))||0);return d+"px"}function bp(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c+(i[c][d].namespace?".":"")+i[c][d].namespace,i[c][d],i[c][d].data)}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(O.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H)return H.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c)e.access(a,j,c[j],f,g,d);return a}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;k<i;k++)g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?m(g):h==="function"&&(!a.unique||!o.has(g))&&c.push(g)},n=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,l=j||0,j=0,k=c.length;for(;c&&l<k;l++)if(c[l].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}i=!1,c&&(a.once?e===!0?o.disable():c=[]:d&&d.length&&(e=d.shift(),o.fireWith(e[0],e[1])))},o={add:function(){if(c){var a=c.length;m(arguments),i?k=c.length:e&&e!==!0&&(j=a,n(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){i&&f<=k&&(k--,f<=l&&l--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&o.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(i?a.once||d.push([b,c]):(!a.once||!e)&&n(b,c));return this},fire:function(){o.fireWith(this,arguments);return this},fired:function(){return!!e}};return o};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p,q=c.createElement("div"),r=c.documentElement;q.setAttribute("className","t"),q.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="<div "+n+"><div></div></div>"+"<table "+n+" cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="<div style='width:4px;'></div>",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d,e,g,h=null;if(typeof a=="undefined"){if(this.length){h=f.data(this[0]);if(this[0].nodeType===1&&!f._data(this[0],"parsedAttrs")){e=this[0].attributes;for(var i=0,j=e.length;i<j;i++)g=e[i].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),l(this[0],g,h[g]));f._data(this[0],"parsedAttrs",!0)}}return h}if(typeof a=="object")return this.each(function(){f.data(this,a)});d=a.split("."),d[1]=d[1]?"."+d[1]:"";if(c===b){h=this.triggerHandler("getData"+d[1]+"!",[d[0]]),h===b&&this.length&&(h=f.data(this[0],a),h=l(this[0],a,h));return h===b&&d[1]?this.data(d[0]):h}return this.each(function(){var b=f(this),e=[d[0],c];b.triggerHandler("setData"+d[1]+"!",e),f.data(this,a,c),b.triggerHandler("changeData"+d[1]+"!",e)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b)return f.queue(this[0],a);return this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0))h++,l.add(m);m();return d.promise()}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,a,b,!0,f.prop)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h<g;h++)e=d[h],e&&(c=f.propFix[e]||e,f.attr(a,e,""),a.removeAttribute(v?e:c),u.test(e)&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return w.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&(e=g.get(a,c))!==null?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};
+f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=[],j,k,l,m,n,o,p,q,r,s,t;g[0]=c,c.delegateTarget=this;if(e&&!c.target.disabled&&(!c.button||c.type!=="click")){m=f(this),m.context=this.ownerDocument||this;for(l=c.target;l!=this;l=l.parentNode||this){o={},q=[],m[0]=l;for(j=0;j<e;j++)r=d[j],s=r.selector,o[s]===b&&(o[s]=r.quick?H(l,r.quick):m.is(s)),o[s]&&q.push(r);q.length&&i.push({elem:l,matches:q})}}d.length>e&&i.push({elem:this,matches:d.slice(e)});for(j=0;j<i.length&&!c.isPropagationStopped();j++){p=i[j],c.currentTarget=p.elem;for(k=0;k<p.matches.length&&!c.isImmediatePropagationStopped();k++){r=p.matches[k];if(h||!c.namespace&&!r.namespace||c.namespace_re&&c.namespace_re.test(r.namespace))c.data=r.data,c.handleObj=r,n=((f.event.special[r.origType]||{}).handle||r.handler).apply(p.elem,g),n!==b&&(c.result=n,n===!1&&(c.preventDefault(),c.stopPropagation()))}}return c.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando])return a;var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event))return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;if(!d||d!==c&&!f.contains(c,d))a.type=e.origType,h=e.handler.apply(this,arguments),a.type=b;return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){this.parentNode&&!a.isTrigger&&f.event.simulate("submit",this.parentNode,a,!0)}),d._submit_attached=!0)})},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate("change",this,a,!0))});return!1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,"._change");return z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=c,c=b);for(i in a)this.on(i,c,d,a[i],g);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=J;else if(!e)return this;g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on.call(this,a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.type+"."+e.namespace:e.type,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a)this.off(g,c,a[g]);return this}if(c===!1||typeof c=="function")d=c,c=b;d===!1&&(d=J);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f._data(this,"lastToggle"+a.guid)||0)%d;f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1||d===9){if(typeof a.textContent=="string")return a.textContent;if(typeof a.innerText=="string")return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(j,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nodeType===1)return!1;return!0;case"nth":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.POS,R={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(T(this,a,!1),"not",a)},filter:function(a){return this.pushStack(T(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?Q.test(a)?f(a,this.context).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return c}var i=Q.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new RegExp("<(?:"+V+")","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function()
+{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++)this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,bp)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1></$2>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i<r;i++)bn(k[i]);else bn(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||be.test(a.type)};for(j=0;h[j];j++)if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript"))e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bq=/alpha\([^)]*\)/i,br=/opacity=([^)]*)/,bs=/([A-Z]|^ms)/g,bt=/^-?\d+(?:px)?$/i,bu=/^-?\d/,bv=/^([\-+])=([\-+.\de]+)/,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Left","Right"],by=["Top","Bottom"],bz,bA,bB;f.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bz(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bv.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(bz)return bz(a,c)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){if(a.offsetWidth!==0)return bC(a,b,d);f.swap(a,bw,function(){e=bC(a,b,d)});return e}},set:function(a,b){if(!bt.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cv(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(cu("hide",3),a,b,c);var d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));for(g=0;g<h;g++)this[g].style&&(this[g].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(cu("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function g(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cv(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)j=new f.fx(this,b,i),h=a[i],cn.test(h)?(o=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),o?(f._data(this,"toggle"+i,o==="show"?"hide":"show"),j[o]()):j[h]()):(k=co.exec(h),l=j.cur(),k?(m=parseFloat(k[2]),n=k[3]||(f.cssNumber[i]?"":"px"),n!=="px"&&(f.style(this,i,(m||1)+n),l=(m||1)/j.cur()*l,f.style(this,i,l+n)),k[1]&&(m=(k[1]==="-="?-1:1)*m+l),j.custom(l,m,n)):j.custom(l,h,""));return!0}var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in g)g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);else g[b=a+".run"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:cu("show",1),slideUp:cu("hide",1),slideToggle:cu("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,c,d){function h(a){return e.step(a)}var e=this,g=f.fx;this.startTime=cr||cs(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){e.options.hide&&f._data(e.elem,"fxshow"+e.prop)===b&&f._data(e.elem,"fxshow"+e.prop,e.start)},h()&&f.timers.push(h)&&!cp&&(cp=setInterval(g.tick,g.interval))},show:function(){var a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=cr||cs(),g=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(cp),cp=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}}),f.each(["width","height"],function(a,b){f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now)+a.unit)}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=e.body,i=cy(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:f.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.support.fixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cw.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.support.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;f.support.fixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/junitreports/TEST-com.amdocs.asdc.action.ActionTest.xml b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/junitreports/TEST-com.amdocs.asdc.action.ActionTest.xml
new file mode 100644
index 0000000000..538301cde7
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/junitreports/TEST-com.amdocs.asdc.action.ActionTest.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated by org.testng.reporters.JUnitReportReporter -->
+<testsuite hostname="SHEETALM02" name="ActionTest" tests="49" failures="0" timestamp="8 Sep 2016 07:19:43 GMT" time="3.349" errors="0">
+ <testcase name="testGetBySupportedModel" time="0.044" classname="ActionTest"/>
+ <testcase name="testDeleteArtifactInvalidArtifactUUID" time="0.009" classname="ActionTest"/>
+ <testcase name="testCheckOut" time="0.021" classname="ActionTest"/>
+ <testcase name="testDeleteArtifactInvalidActInvId" time="0.003" classname="ActionTest"/>
+ <testcase name="testSubmit" time="0.020" classname="ActionTest"/>
+ <testcase name="testUndoCheckout" time="0.018" classname="ActionTest"/>
+ <testcase name="testGetByInvIdManyVersionWithMultSubmit" time="0.366" classname="ActionTest"/>
+ <testcase name="testSubmitOnCheckout" time="0.004" classname="ActionTest"/>
+ <testcase name="testDownloadArtifact" time="0.008" classname="ActionTest"/>
+ <testcase name="testUpdateInvariantId_negative" time="0.006" classname="ActionTest"/>
+ <testcase name="testCheckOutOnCheckOut" time="0.013" classname="ActionTest"/>
+ <testcase name="updateTest" time="0.017" classname="ActionTest"/>
+ <testcase name="testUpdateName_negative" time="0.008" classname="ActionTest"/>
+ <testcase name="testCheckInWithoutCheckout" time="0.004" classname="ActionTest"/>
+ <testcase name="testCheckOutOnCheckOutWithOtherUser" time="0.009" classname="ActionTest"/>
+ <testcase name="testGetByInvIdOnCreate" time="0.030" classname="ActionTest"/>
+ <testcase name="testDeleteArtifactOnUnlockedAction" time="0.005" classname="ActionTest"/>
+ <testcase name="testCheckInWithOtherUser" time="0.005" classname="ActionTest"/>
+ <testcase name="testDownloadArtifactNegativeInvalidAction" time="0.004" classname="ActionTest"/>
+ <testcase name="testGetByInvIdManyVersionWithoutSubmit" time="0.451" classname="ActionTest"/>
+ <testcase name="testCreateWithExistingActionName_negative" time="0.005" classname="ActionTest"/>
+ <testcase name="createTest" time="0.079" classname="ActionTest"/>
+ <testcase name="testGetAllActions" time="0.056" classname="ActionTest"/>
+ <testcase name="testgetActionsByActionUUID" time="0.005" classname="ActionTest"/>
+ <testcase name="testDownloadArtifactNegativeInvalidArtifact" time="0.005" classname="ActionTest"/>
+ <testcase name="testUpdateArtifact" time="0.022" classname="ActionTest"/>
+ <testcase name="testUploadArtifactInvalidActionInvId_negative" time="0.006" classname="ActionTest"/>
+ <testcase name="testGetByInvIdManyVersionWithFirstSubmit" time="0.515" classname="ActionTest"/>
+ <testcase name="testgetActionsByActionUUID_Negative" time="0.004" classname="ActionTest"/>
+ <testcase name="testDeleteReadOnlyArtifact" time="0.059" classname="ActionTest"/>
+ <testcase name="testUploadArtifact" time="0.078" classname="ActionTest"/>
+ <testcase name="testUpdateInvalidVersion_negative" time="0.007" classname="ActionTest"/>
+ <testcase name="testUploadArtifactUnlockedAction_negative" time="0.021" classname="ActionTest"/>
+ <testcase name="testDeleteArtifact" time="0.039" classname="ActionTest"/>
+ <testcase name="testGetByInvIdOnName" time="0.271" classname="ActionTest"/>
+ <testcase name="testUpdateVersion_negative" time="0.007" classname="ActionTest"/>
+ <testcase name="testDeleteArtifactLockedByOtherUser" time="0.005" classname="ActionTest"/>
+ <testcase name="testUpdateStatus_negative" time="0.010" classname="ActionTest"/>
+ <testcase name="testUploadArtifactSameName_negative" time="0.009" classname="ActionTest"/>
+ <testcase name="testUpdateUniqueId_negative" time="0.009" classname="ActionTest"/>
+ <testcase name="testCheckIn" time="0.010" classname="ActionTest"/>
+ <testcase name="testGetByIgnoreCaseName" time="0.011" classname="ActionTest"/>
+ <testcase name="testGetECOMPComponents" time="0.005" classname="ActionTest"/>
+ <testcase name="testGetByCategory" time="0.961" classname="ActionTest"/>
+ <testcase name="testGetBySupportedComponent" time="0.044" classname="ActionTest"/>
+ <testcase name="testUpdateOnCheckedInAction_negative" time="0.007" classname="ActionTest"/>
+ <testcase name="testUploadArtifactCheckedOutOtherUser_negative" time="0.006" classname="ActionTest"/>
+ <testcase name="testGetByVendor" time="0.041" classname="ActionTest"/>
+ <testcase name="testUpdateOtherUser_negative" time="0.007" classname="ActionTest"/>
+</testsuite> <!-- ActionTest -->
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/navigator-bullet.png b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/navigator-bullet.png
new file mode 100644
index 0000000000..36d90d395c
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/navigator-bullet.png
Binary files differ
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/Default test.properties b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/Default test.properties
new file mode 100644
index 0000000000..37da032f9d
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/Default test.properties
@@ -0,0 +1 @@
+[SuiteResult context=Default test] \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/classes.html b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/classes.html
new file mode 100644
index 0000000000..1ef25b20ff
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/classes.html
@@ -0,0 +1,228 @@
+<table border='1'>
+<tr>
+<th>Class name</th>
+<th>Method name</th>
+<th>Groups</th>
+</tr><tr>
+<td>ActionTest</td>
+<td>&nbsp;</td><td>&nbsp;</td></tr>
+<tr>
+<td align='center' colspan='3'>@Test</td>
+</tr>
+<tr>
+<td>&nbsp;</td>
+<td>testUploadArtifactSameName_negative</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td>&nbsp;</td>
+<td>testCheckIn</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td>&nbsp;</td>
+<td>testGetBySupportedComponent</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td>&nbsp;</td>
+<td>testDeleteArtifactOnUnlockedAction</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td>&nbsp;</td>
+<td>testDeleteArtifactInvalidActInvId</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td>&nbsp;</td>
+<td>testUpdateStatus_negative</td>
+<td>updateTestGroup </td>
+</tr>
+<tr>
+<td>&nbsp;</td>
+<td>testUpdateArtifact</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td>&nbsp;</td>
+<td>testGetByVendor</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td>&nbsp;</td>
+<td>testCheckInWithOtherUser</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td>&nbsp;</td>
+<td>testGetByInvIdManyVersionWithMultSubmit</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td>&nbsp;</td>
+<td>testUpdateOtherUser_negative</td>
+<td>updateTestGroup </td>
+</tr>
+<tr>
+<td>&nbsp;</td>
+<td>testUploadArtifactCheckedOutOtherUser_negative</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td>&nbsp;</td>
+<td>testCheckInWithoutCheckout</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td>&nbsp;</td>
+<td>updateTest</td>
+<td>updateTestGroup </td>
+</tr>
+<tr>
+<td>&nbsp;</td>
+<td>testUpdateVersion_negative</td>
+<td>updateTestGroup </td>
+</tr>
+<tr>
+<td>&nbsp;</td>
+<td>testGetByIgnoreCaseName</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td>&nbsp;</td>
+<td>testgetActionsByActionUUID</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td>&nbsp;</td>
+<td>testGetECOMPComponents</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td>&nbsp;</td>
+<td>testGetByCategory</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td>&nbsp;</td>
+<td>testDownloadArtifact</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td>&nbsp;</td>
+<td>createTest</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td>&nbsp;</td>
+<td>testUpdateName_negative</td>
+<td>updateTestGroup </td>
+</tr>
+<tr>
+<td>&nbsp;</td>
+<td>testGetAllActions</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td>&nbsp;</td>
+<td>testUndoCheckout</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td>&nbsp;</td>
+<td>testCheckOutOnCheckOutWithOtherUser</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td>&nbsp;</td>
+<td>testUploadArtifactInvalidActionInvId_negative</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td>&nbsp;</td>
+<td>testSubmit</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td>&nbsp;</td>
+<td>testgetActionsByActionUUID_Negative</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td>&nbsp;</td>
+<td>testUpdateOnCheckedInAction_negative</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td>&nbsp;</td>
+<td>testGetByInvIdManyVersionWithoutSubmit</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td>&nbsp;</td>
+<td>testGetByInvIdManyVersionWithFirstSubmit</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td>&nbsp;</td>
+<td>testUpdateUniqueId_negative</td>
+<td>updateTestGroup </td>
+</tr>
+<tr>
+<td>&nbsp;</td>
+<td>testGetByInvIdOnCreate</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td>&nbsp;</td>
+<td>testGetBySupportedModel</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td>&nbsp;</td>
+<td>testUploadArtifact</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td>&nbsp;</td>
+<td>testDownloadArtifactNegativeInvalidArtifact</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td>&nbsp;</td>
+<td>testDeleteReadOnlyArtifact</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td>&nbsp;</td>
+<td>testUpdateInvariantId_negative</td>
+<td>updateTestGroup </td>
+</tr>
+<tr>
+<td>&nbsp;</td>
+<td>testDownloadArtifactNegativeInvalidAction</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td>&nbsp;</td>
+<td>testGetByInvIdOnName</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td>&nbsp;</td>
+<td>testUpdateInvalidVersion_negative</td>
+<td>updateTestGroup </td>
+</tr>
+<tr>
+<td>&nbsp;</td>
+<td>testDeleteArtifact</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td>&nbsp;</td>
+<td>testDeleteArtifactLockedByOtherUser</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td>&nbsp;</td>
+<td>testCheckOut</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td>&nbsp;</td>
+<td>testCheckOutOnCheckOut</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td>&nbsp;</td>
+<td>testUploadArtifactUnlockedAction_negative</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td>&nbsp;</td>
+<td>testSubmitOnCheckout</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td>&nbsp;</td>
+<td>testDeleteArtifactInvalidArtifactUUID</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td>&nbsp;</td>
+<td>testCreateWithExistingActionName_negative</td>
+<td>&nbsp;</td></tr>
+<tr>
+<td align='center' colspan='3'>@BeforeClass</td>
+</tr>
+<tr>
+<td align='center' colspan='3'>@BeforeMethod</td>
+</tr>
+<tr>
+<td align='center' colspan='3'>@AfterMethod</td>
+</tr>
+<tr>
+<td align='center' colspan='3'>@AfterClass</td>
+</tr>
+</table>
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/groups.html b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/groups.html
new file mode 100644
index 0000000000..211c8ec14d
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/groups.html
@@ -0,0 +1,3 @@
+<h2>Groups used for this test run</h2><table border="1">
+<tr> <td align="center"><b>Group name</b></td><td align="center"><b>Methods</b></td></tr><tr><td>updateTestGroup</td><td>ActionTest.testUpdateOtherUser_negative()[pri:0, instance:ActionTest@5b367418]<br/>ActionTest.testUpdateInvariantId_negative()[pri:0, instance:ActionTest@5b367418]<br/>ActionTest.testUpdateStatus_negative()[pri:0, instance:ActionTest@5b367418]<br/>ActionTest.testUpdateUniqueId_negative()[pri:0, instance:ActionTest@5b367418]<br/>ActionTest.testUpdateVersion_negative()[pri:0, instance:ActionTest@5b367418]<br/>ActionTest.updateTest()[pri:0, instance:ActionTest@5b367418]<br/>ActionTest.testUpdateInvalidVersion_negative()[pri:0, instance:ActionTest@5b367418]<br/>ActionTest.testUpdateName_negative()[pri:0, instance:ActionTest@5b367418]<br/></td></tr>
+</table>
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/index.html b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/index.html
new file mode 100644
index 0000000000..8ed202c3be
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/index.html
@@ -0,0 +1,6 @@
+<html><head><title>Results for Default suite</title></head>
+<frameset cols="26%,74%">
+<frame src="toc.html" name="navFrame">
+<frame src="main.html" name="mainFrame">
+</frameset>
+</html>
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/main.html b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/main.html
new file mode 100644
index 0000000000..5888ae0744
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/main.html
@@ -0,0 +1,2 @@
+<html><head><title>Results for Default suite</title></head>
+<body>Select a result on the left-hand pane.</body></html>
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/methods-alphabetical.html b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/methods-alphabetical.html
new file mode 100644
index 0000000000..c7600fc861
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/methods-alphabetical.html
@@ -0,0 +1,104 @@
+<h2>Methods run, sorted chronologically</h2><h3>&gt;&gt; means before, &lt;&lt; means after</h3><p/><br/><em>Default suite</em><p/><small><i>(Hover the method name to see the test class name)</i></small><p/>
+<table border="1">
+<tr><th>Time</th><th>Delta (ms)</th><th>Suite<br>configuration</th><th>Test<br>configuration</th><th>Class<br>configuration</th><th>Groups<br>configuration</th><th>Method<br>configuration</th><th>Test<br>method</th><th>Thread</th><th>Instances</th></tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:39</td> <td>0</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.createTest()[pri:0, instance:ActionTest@5b367418]">createTest</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:36</td> <td>-2616</td> <td>&nbsp;</td><td title="&gt;&gt;ActionTest.init()[pri:0, instance:ActionTest@5b367418]">&gt;&gt;init</td>
+<td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td> <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:42</td> <td>3293</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testCheckIn()[pri:0, instance:ActionTest@5b367418]">testCheckIn</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:42</td> <td>3358</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testCheckInWithOtherUser()[pri:0, instance:ActionTest@5b367418]">testCheckInWithOtherUser</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:42</td> <td>3332</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testCheckInWithoutCheckout()[pri:0, instance:ActionTest@5b367418]">testCheckInWithoutCheckout</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:42</td> <td>3337</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testCheckOut()[pri:0, instance:ActionTest@5b367418]">testCheckOut</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:40</td> <td>1172</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testCheckOutOnCheckOut()[pri:0, instance:ActionTest@5b367418]">testCheckOutOnCheckOut</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:40</td> <td>1186</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testCheckOutOnCheckOutWithOtherUser()[pri:0, instance:ActionTest@5b367418]">testCheckOutOnCheckOutWithOtherUser</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:40</td> <td>1195</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testCreateWithExistingActionName_negative()[pri:0, instance:ActionTest@5b367418]">testCreateWithExistingActionName_negative</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:41</td> <td>1864</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testDeleteArtifact()[pri:0, instance:ActionTest@5b367418]">testDeleteArtifact</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:39</td> <td>80</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testDeleteArtifactInvalidActInvId()[pri:0, instance:ActionTest@5b367418]">testDeleteArtifactInvalidActInvId</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:40</td> <td>1258</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testDeleteArtifactInvalidArtifactUUID()[pri:0, instance:ActionTest@5b367418]">testDeleteArtifactInvalidArtifactUUID</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:41</td> <td>1904</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testDeleteArtifactLockedByOtherUser()[pri:0, instance:ActionTest@5b367418]">testDeleteArtifactLockedByOtherUser</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:41</td> <td>2574</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testDeleteArtifactOnUnlockedAction()[pri:0, instance:ActionTest@5b367418]">testDeleteArtifactOnUnlockedAction</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:41</td> <td>1909</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testDeleteReadOnlyArtifact()[pri:0, instance:ActionTest@5b367418]">testDeleteReadOnlyArtifact</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:41</td> <td>1969</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testDownloadArtifact()[pri:0, instance:ActionTest@5b367418]">testDownloadArtifact</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:39</td> <td>84</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testDownloadArtifactNegativeInvalidAction()[pri:0, instance:ActionTest@5b367418]">testDownloadArtifactNegativeInvalidAction</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:41</td> <td>1978</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testDownloadArtifactNegativeInvalidArtifact()[pri:0, instance:ActionTest@5b367418]">testDownloadArtifactNegativeInvalidArtifact</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:40</td> <td>1201</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testGetAllActions()[pri:0, instance:ActionTest@5b367418]">testGetAllActions</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:39</td> <td>89</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testGetByCategory()[pri:0, instance:ActionTest@5b367418]">testGetByCategory</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:40</td> <td>1268</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testGetByIgnoreCaseName()[pri:0, instance:ActionTest@5b367418]">testGetByIgnoreCaseName</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:41</td> <td>2058</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testGetByInvIdManyVersionWithFirstSubmit()[pri:0, instance:ActionTest@5b367418]">testGetByInvIdManyVersionWithFirstSubmit</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:42</td> <td>2597</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testGetByInvIdManyVersionWithMultSubmit()[pri:0, instance:ActionTest@5b367418]">testGetByInvIdManyVersionWithMultSubmit</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:40</td> <td>1280</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testGetByInvIdManyVersionWithoutSubmit()[pri:0, instance:ActionTest@5b367418]">testGetByInvIdManyVersionWithoutSubmit</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:40</td> <td>1051</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testGetByInvIdOnCreate()[pri:0, instance:ActionTest@5b367418]">testGetByInvIdOnCreate</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:42</td> <td>3022</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testGetByInvIdOnName()[pri:0, instance:ActionTest@5b367418]">testGetByInvIdOnName</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:41</td> <td>1732</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testGetBySupportedComponent()[pri:0, instance:ActionTest@5b367418]">testGetBySupportedComponent</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:41</td> <td>1777</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testGetBySupportedModel()[pri:0, instance:ActionTest@5b367418]">testGetBySupportedModel</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:41</td> <td>1822</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testGetByVendor()[pri:0, instance:ActionTest@5b367418]">testGetByVendor</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:40</td> <td>1082</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testGetECOMPComponents()[pri:0, instance:ActionTest@5b367418]">testGetECOMPComponents</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:42</td> <td>3311</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testSubmit()[pri:0, instance:ActionTest@5b367418]">testSubmit</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:42</td> <td>3364</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testSubmitOnCheckout()[pri:0, instance:ActionTest@5b367418]">testSubmitOnCheckout</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:42</td> <td>3369</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testUndoCheckout()[pri:0, instance:ActionTest@5b367418]">testUndoCheckout</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:41</td> <td>1984</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testUpdateArtifact()[pri:0, instance:ActionTest@5b367418]">testUpdateArtifact</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:42</td> <td>2963</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testUpdateInvalidVersion_negative()[pri:0, instance:ActionTest@5b367418]">testUpdateInvalidVersion_negative</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:42</td> <td>2970</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testUpdateInvariantId_negative()[pri:0, instance:ActionTest@5b367418]">testUpdateInvariantId_negative</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:42</td> <td>2977</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testUpdateName_negative()[pri:0, instance:ActionTest@5b367418]">testUpdateName_negative</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:42</td> <td>3304</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testUpdateOnCheckedInAction_negative()[pri:0, instance:ActionTest@5b367418]">testUpdateOnCheckedInAction_negative</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:42</td> <td>2986</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testUpdateOtherUser_negative()[pri:0, instance:ActionTest@5b367418]">testUpdateOtherUser_negative</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:42</td> <td>2994</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testUpdateStatus_negative()[pri:0, instance:ActionTest@5b367418]">testUpdateStatus_negative</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:42</td> <td>3005</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testUpdateUniqueId_negative()[pri:0, instance:ActionTest@5b367418]">testUpdateUniqueId_negative</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:42</td> <td>3014</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testUpdateVersion_negative()[pri:0, instance:ActionTest@5b367418]">testUpdateVersion_negative</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:40</td> <td>1088</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testUploadArtifact()[pri:0, instance:ActionTest@5b367418]">testUploadArtifact</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:41</td> <td>2007</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testUploadArtifactCheckedOutOtherUser_negative()[pri:0, instance:ActionTest@5b367418]">testUploadArtifactCheckedOutOtherUser_negative</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:41</td> <td>2014</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testUploadArtifactInvalidActionInvId_negative()[pri:0, instance:ActionTest@5b367418]">testUploadArtifactInvalidActionInvId_negative</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:41</td> <td>2020</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testUploadArtifactSameName_negative()[pri:0, instance:ActionTest@5b367418]">testUploadArtifactSameName_negative</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:41</td> <td>2030</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testUploadArtifactUnlockedAction_negative()[pri:0, instance:ActionTest@5b367418]">testUploadArtifactUnlockedAction_negative</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:41</td> <td>2052</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testgetActionsByActionUUID()[pri:0, instance:ActionTest@5b367418]">testgetActionsByActionUUID</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:40</td> <td>1166</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testgetActionsByActionUUID_Negative()[pri:0, instance:ActionTest@5b367418]">testgetActionsByActionUUID_Negative</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:41</td> <td>2579</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.updateTest()[pri:0, instance:ActionTest@5b367418]">updateTest</td>
+ <td>main@222427158</td> <td></td> </tr>
+</table>
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/methods-not-run.html b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/methods-not-run.html
new file mode 100644
index 0000000000..54b14cb854
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/methods-not-run.html
@@ -0,0 +1,2 @@
+<h2>Methods that were not run</h2><table>
+</table> \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/methods.html b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/methods.html
new file mode 100644
index 0000000000..ebf981d265
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/methods.html
@@ -0,0 +1,104 @@
+<h2>Methods run, sorted chronologically</h2><h3>&gt;&gt; means before, &lt;&lt; means after</h3><p/><br/><em>Default suite</em><p/><small><i>(Hover the method name to see the test class name)</i></small><p/>
+<table border="1">
+<tr><th>Time</th><th>Delta (ms)</th><th>Suite<br>configuration</th><th>Test<br>configuration</th><th>Class<br>configuration</th><th>Groups<br>configuration</th><th>Method<br>configuration</th><th>Test<br>method</th><th>Thread</th><th>Instances</th></tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:36</td> <td>0</td> <td>&nbsp;</td><td title="&gt;&gt;ActionTest.init()[pri:0, instance:ActionTest@5b367418]">&gt;&gt;init</td>
+<td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td> <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:39</td> <td>2616</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.createTest()[pri:0, instance:ActionTest@5b367418]">createTest</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:39</td> <td>2696</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testDeleteArtifactInvalidActInvId()[pri:0, instance:ActionTest@5b367418]">testDeleteArtifactInvalidActInvId</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:39</td> <td>2700</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testDownloadArtifactNegativeInvalidAction()[pri:0, instance:ActionTest@5b367418]">testDownloadArtifactNegativeInvalidAction</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:39</td> <td>2705</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testGetByCategory()[pri:0, instance:ActionTest@5b367418]">testGetByCategory</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:40</td> <td>3667</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testGetByInvIdOnCreate()[pri:0, instance:ActionTest@5b367418]">testGetByInvIdOnCreate</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:40</td> <td>3698</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testGetECOMPComponents()[pri:0, instance:ActionTest@5b367418]">testGetECOMPComponents</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:40</td> <td>3704</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testUploadArtifact()[pri:0, instance:ActionTest@5b367418]">testUploadArtifact</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:40</td> <td>3782</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testgetActionsByActionUUID_Negative()[pri:0, instance:ActionTest@5b367418]">testgetActionsByActionUUID_Negative</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:40</td> <td>3788</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testCheckOutOnCheckOut()[pri:0, instance:ActionTest@5b367418]">testCheckOutOnCheckOut</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:40</td> <td>3802</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testCheckOutOnCheckOutWithOtherUser()[pri:0, instance:ActionTest@5b367418]">testCheckOutOnCheckOutWithOtherUser</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:40</td> <td>3811</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testCreateWithExistingActionName_negative()[pri:0, instance:ActionTest@5b367418]">testCreateWithExistingActionName_negative</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:40</td> <td>3817</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testGetAllActions()[pri:0, instance:ActionTest@5b367418]">testGetAllActions</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:40</td> <td>3874</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testDeleteArtifactInvalidArtifactUUID()[pri:0, instance:ActionTest@5b367418]">testDeleteArtifactInvalidArtifactUUID</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:40</td> <td>3884</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testGetByIgnoreCaseName()[pri:0, instance:ActionTest@5b367418]">testGetByIgnoreCaseName</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:40</td> <td>3896</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testGetByInvIdManyVersionWithoutSubmit()[pri:0, instance:ActionTest@5b367418]">testGetByInvIdManyVersionWithoutSubmit</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:41</td> <td>4348</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testGetBySupportedComponent()[pri:0, instance:ActionTest@5b367418]">testGetBySupportedComponent</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:41</td> <td>4393</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testGetBySupportedModel()[pri:0, instance:ActionTest@5b367418]">testGetBySupportedModel</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:41</td> <td>4438</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testGetByVendor()[pri:0, instance:ActionTest@5b367418]">testGetByVendor</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:41</td> <td>4480</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testDeleteArtifact()[pri:0, instance:ActionTest@5b367418]">testDeleteArtifact</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:41</td> <td>4520</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testDeleteArtifactLockedByOtherUser()[pri:0, instance:ActionTest@5b367418]">testDeleteArtifactLockedByOtherUser</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:41</td> <td>4525</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testDeleteReadOnlyArtifact()[pri:0, instance:ActionTest@5b367418]">testDeleteReadOnlyArtifact</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:41</td> <td>4585</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testDownloadArtifact()[pri:0, instance:ActionTest@5b367418]">testDownloadArtifact</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:41</td> <td>4594</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testDownloadArtifactNegativeInvalidArtifact()[pri:0, instance:ActionTest@5b367418]">testDownloadArtifactNegativeInvalidArtifact</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:41</td> <td>4600</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testUpdateArtifact()[pri:0, instance:ActionTest@5b367418]">testUpdateArtifact</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:41</td> <td>4623</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testUploadArtifactCheckedOutOtherUser_negative()[pri:0, instance:ActionTest@5b367418]">testUploadArtifactCheckedOutOtherUser_negative</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:41</td> <td>4630</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testUploadArtifactInvalidActionInvId_negative()[pri:0, instance:ActionTest@5b367418]">testUploadArtifactInvalidActionInvId_negative</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:41</td> <td>4636</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testUploadArtifactSameName_negative()[pri:0, instance:ActionTest@5b367418]">testUploadArtifactSameName_negative</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:41</td> <td>4646</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testUploadArtifactUnlockedAction_negative()[pri:0, instance:ActionTest@5b367418]">testUploadArtifactUnlockedAction_negative</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:41</td> <td>4668</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testgetActionsByActionUUID()[pri:0, instance:ActionTest@5b367418]">testgetActionsByActionUUID</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:41</td> <td>4674</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testGetByInvIdManyVersionWithFirstSubmit()[pri:0, instance:ActionTest@5b367418]">testGetByInvIdManyVersionWithFirstSubmit</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:41</td> <td>5190</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testDeleteArtifactOnUnlockedAction()[pri:0, instance:ActionTest@5b367418]">testDeleteArtifactOnUnlockedAction</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:41</td> <td>5195</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.updateTest()[pri:0, instance:ActionTest@5b367418]">updateTest</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:42</td> <td>5213</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testGetByInvIdManyVersionWithMultSubmit()[pri:0, instance:ActionTest@5b367418]">testGetByInvIdManyVersionWithMultSubmit</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:42</td> <td>5579</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testUpdateInvalidVersion_negative()[pri:0, instance:ActionTest@5b367418]">testUpdateInvalidVersion_negative</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:42</td> <td>5586</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testUpdateInvariantId_negative()[pri:0, instance:ActionTest@5b367418]">testUpdateInvariantId_negative</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:42</td> <td>5593</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testUpdateName_negative()[pri:0, instance:ActionTest@5b367418]">testUpdateName_negative</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:42</td> <td>5602</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testUpdateOtherUser_negative()[pri:0, instance:ActionTest@5b367418]">testUpdateOtherUser_negative</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:42</td> <td>5610</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testUpdateStatus_negative()[pri:0, instance:ActionTest@5b367418]">testUpdateStatus_negative</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:42</td> <td>5621</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testUpdateUniqueId_negative()[pri:0, instance:ActionTest@5b367418]">testUpdateUniqueId_negative</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:42</td> <td>5630</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testUpdateVersion_negative()[pri:0, instance:ActionTest@5b367418]">testUpdateVersion_negative</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:42</td> <td>5638</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testGetByInvIdOnName()[pri:0, instance:ActionTest@5b367418]">testGetByInvIdOnName</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:42</td> <td>5909</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testCheckIn()[pri:0, instance:ActionTest@5b367418]">testCheckIn</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:42</td> <td>5920</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testUpdateOnCheckedInAction_negative()[pri:0, instance:ActionTest@5b367418]">testUpdateOnCheckedInAction_negative</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:42</td> <td>5927</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testSubmit()[pri:0, instance:ActionTest@5b367418]">testSubmit</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:42</td> <td>5948</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testCheckInWithoutCheckout()[pri:0, instance:ActionTest@5b367418]">testCheckInWithoutCheckout</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:42</td> <td>5953</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testCheckOut()[pri:0, instance:ActionTest@5b367418]">testCheckOut</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:42</td> <td>5974</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testCheckInWithOtherUser()[pri:0, instance:ActionTest@5b367418]">testCheckInWithOtherUser</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:42</td> <td>5980</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testSubmitOnCheckout()[pri:0, instance:ActionTest@5b367418]">testSubmitOnCheckout</td>
+ <td>main@222427158</td> <td></td> </tr>
+<tr bgcolor="baeedf"> <td>16/09/08 12:49:42</td> <td>5985</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="ActionTest.testUndoCheckout()[pri:0, instance:ActionTest@5b367418]">testUndoCheckout</td>
+ <td>main@222427158</td> <td></td> </tr>
+</table>
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/reporter-output.html b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/reporter-output.html
new file mode 100644
index 0000000000..063bc2e96f
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/reporter-output.html
@@ -0,0 +1 @@
+<h2>Reporter output</h2><table></table> \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/testng.xml.html b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/testng.xml.html
new file mode 100644
index 0000000000..ce68151560
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/testng.xml.html
@@ -0,0 +1 @@
+<html><head><title>testng.xml for Default suite</title></head><body><tt>&lt;?xml&nbsp;version="1.0"&nbsp;encoding="UTF-8"?&gt; <br/>&lt;!DOCTYPE&nbsp;suite&nbsp;SYSTEM&nbsp;"http://testng.org/testng-1.0.dtd"&gt; <br/>&lt;suite&nbsp;name="Default&nbsp;suite"&gt; <br/>&nbsp;&nbsp;&lt;test&nbsp;verbose="2"&nbsp;name="Default&nbsp;test"&gt; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;classes&gt; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;class&nbsp;name="ActionTest"/&gt; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/classes&gt; <br/>&nbsp;&nbsp;&lt;/test&gt;&nbsp;&lt;!--&nbsp;Default&nbsp;test&nbsp;--&gt; <br/>&lt;/suite&gt;&nbsp;&lt;!--&nbsp;Default&nbsp;suite&nbsp;--&gt; <br/></tt></body></html> \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/toc.html b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/toc.html
new file mode 100644
index 0000000000..a27f5af7c9
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/toc.html
@@ -0,0 +1,30 @@
+<html>
+<head>
+<title>Results for Default suite</title>
+<link href="../testng.css" rel="stylesheet" type="text/css" />
+<link href="../my-testng.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<h3><p align="center">Results for<br/><em>Default suite</em></p></h3>
+<table border='1' width='100%'>
+<tr valign='top'>
+<td>1 test</td>
+<td><a target='mainFrame' href='classes.html'>1 class</a></td>
+<td>49 methods:<br/>
+&nbsp;&nbsp;<a target='mainFrame' href='methods.html'>chronological</a><br/>
+&nbsp;&nbsp;<a target='mainFrame' href='methods-alphabetical.html'>alphabetical</a><br/>
+&nbsp;&nbsp;<a target='mainFrame' href='methods-not-run.html'>not run (0)</a></td>
+</tr>
+<tr>
+<td><a target='mainFrame' href='groups.html'>1 group</a></td>
+<td><a target='mainFrame' href='reporter-output.html'>reporter output</a></td>
+<td><a target='mainFrame' href='testng.xml.html'>testng.xml</a></td>
+</tr></table>
+<table width='100%' class='test-passed'>
+<tr><td>
+<table style='width: 100%'><tr><td valign='top'>Default test (49/0/0)</td><td valign='top' align='right'>
+ <a href='Default test.html' target='mainFrame'>Results</a>
+</td></tr></table>
+</td></tr><p/>
+</table>
+</body></html> \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/index.html b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/index.html
new file mode 100644
index 0000000000..0ac18dca36
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/index.html
@@ -0,0 +1,9 @@
+<html>
+<head><title>Test results</title><link href="./testng.css" rel="stylesheet" type="text/css" />
+<link href="./my-testng.css" rel="stylesheet" type="text/css" />
+</head><body>
+<h2><p align='center'>Test results</p></h2>
+<table border='1' width='100%' class='main-page'><tr><th>Suite</th><th>Passed</th><th>Failed</th><th>Skipped</th><th>testng.xml</th></tr>
+<tr align='center' class='invocation-passed'><td><em>Total</em></td><td><em>49</em></td><td><em>0</em></td><td><em>0</em></td><td>&nbsp;</td></tr>
+<tr align='center' class='invocation-passed'><td><a href='Default suite/index.html'>Default suite</a></td>
+<td>49</td><td>0</td><td>0</td><td><a href='Default suite/testng.xml.html'>Link</a></td></tr></table></body></html>
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/passed.png b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/passed.png
new file mode 100644
index 0000000000..45e85bbfd0
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/passed.png
Binary files differ
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/skipped.png b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/skipped.png
new file mode 100644
index 0000000000..c36a324398
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/skipped.png
Binary files differ
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/testng-failed.xml b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/testng-failed.xml
new file mode 100644
index 0000000000..5f2650e66e
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/testng-failed.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="Failed suite [Default suite]">
+ <test name="Default test(failed)">
+ <classes>
+ <class name="ActionTest">
+ <methods>
+ <include name="testDeleteReadOnlyArtifact"/>
+ <include name="testUploadArtifact"/>
+ <include name="testUpdateArtifact"/>
+ <include name="init"/>
+ </methods>
+ </class> <!-- ActionTest -->
+ </classes>
+ </test> <!-- Default test(failed) -->
+</suite> <!-- Failed suite [Default suite] -->
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/testng-reports.css b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/testng-reports.css
new file mode 100644
index 0000000000..29588e5572
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/testng-reports.css
@@ -0,0 +1,309 @@
+body {
+ margin: 0px 0px 5px 5px;
+}
+
+ul {
+ margin: 0px;
+}
+
+li {
+ list-style-type: none;
+}
+
+a {
+ text-decoration: none;
+}
+
+a:hover {
+ text-decoration: underline;
+}
+
+.navigator-selected {
+ background: #ffa500;
+}
+
+.wrapper {
+ position: absolute;
+ top: 60px;
+ bottom: 0;
+ left: 400px;
+ right: 0;
+ overflow: auto;
+}
+
+.navigator-root {
+ position: absolute;
+ top: 60px;
+ bottom: 0;
+ left: 0;
+ width: 400px;
+ overflow-y: auto;
+}
+
+.suite {
+ margin: 0px 10px 10px 0px;
+ background-color: #fff8dc;
+}
+
+.suite-name {
+ padding-left: 10px;
+ font-size: 25px;
+ font-family: Times;
+}
+
+.main-panel-header {
+ padding: 5px;
+ background-color: #9FB4D9; //afeeee;
+ font-family: monospace;
+ font-size: 18px;
+}
+
+.main-panel-content {
+ padding: 5px;
+ margin-bottom: 10px;
+ background-color: #DEE8FC; //d0ffff;
+}
+
+.rounded-window {
+ border-radius: 10px;
+ border-style: solid;
+ border-width: 1px;
+}
+
+.rounded-window-top {
+ border-top-right-radius: 10px 10px;
+ border-top-left-radius: 10px 10px;
+ border-style: solid;
+ border-width: 1px;
+ overflow: auto;
+}
+
+.light-rounded-window-top {
+ border-top-right-radius: 10px 10px;
+ border-top-left-radius: 10px 10px;
+}
+
+.rounded-window-bottom {
+ border-style: solid;
+ border-width: 0px 1px 1px 1px;
+ border-bottom-right-radius: 10px 10px;
+ border-bottom-left-radius: 10px 10px;
+ overflow: auto;
+}
+
+.method-name {
+ font-size: 12px;
+ font-family: monospace;
+}
+
+.method-content {
+ border-style: solid;
+ border-width: 0px 0px 1px 0px;
+ margin-bottom: 10;
+ padding-bottom: 5px;
+ width: 80%;
+}
+
+.parameters {
+ font-size: 14px;
+ font-family: monospace;
+}
+
+.stack-trace {
+ white-space: pre;
+ font-family: monospace;
+ font-size: 12px;
+ font-weight: bold;
+ margin-top: 0px;
+ margin-left: 20px;
+}
+
+.testng-xml {
+ font-family: monospace;
+}
+
+.method-list-content {
+ margin-left: 10px;
+}
+
+.navigator-suite-content {
+ margin-left: 10px;
+ font: 12px 'Lucida Grande';
+}
+
+.suite-section-title {
+ margin-top: 10px;
+ width: 80%;
+ border-style: solid;
+ border-width: 1px 0px 0px 0px;
+ font-family: Times;
+ font-size: 18px;
+ font-weight: bold;
+}
+
+.suite-section-content {
+ list-style-image: url(bullet_point.png);
+}
+
+.top-banner-root {
+ position: absolute;
+ top: 0;
+ height: 45px;
+ left: 0;
+ right: 0;
+ padding: 5px;
+ margin: 0px 0px 5px 0px;
+ background-color: #0066ff;
+ font-family: Times;
+ color: #fff;
+ text-align: center;
+}
+
+.top-banner-title-font {
+ font-size: 25px;
+}
+
+.test-name {
+ font-family: 'Lucida Grande';
+ font-size: 16px;
+}
+
+.suite-icon {
+ padding: 5px;
+ float: right;
+ height: 20;
+}
+
+.test-group {
+ font: 20px 'Lucida Grande';
+ margin: 5px 5px 10px 5px;
+ border-width: 0px 0px 1px 0px;
+ border-style: solid;
+ padding: 5px;
+}
+
+.test-group-name {
+ font-weight: bold;
+}
+
+.method-in-group {
+ font-size: 16px;
+ margin-left: 80px;
+}
+
+table.google-visualization-table-table {
+ width: 100%;
+}
+
+.reporter-method-name {
+ font-size: 14px;
+ font-family: monospace;
+}
+
+.reporter-method-output-div {
+ padding: 5px;
+ margin: 0px 0px 5px 20px;
+ font-size: 12px;
+ font-family: monospace;
+ border-width: 0px 0px 0px 1px;
+ border-style: solid;
+}
+
+.ignored-class-div {
+ font-size: 14px;
+ font-family: monospace;
+}
+
+.ignored-methods-div {
+ padding: 5px;
+ margin: 0px 0px 5px 20px;
+ font-size: 12px;
+ font-family: monospace;
+ border-width: 0px 0px 0px 1px;
+ border-style: solid;
+}
+
+.border-failed {
+ border-top-left-radius: 10px 10px;
+ border-bottom-left-radius: 10px 10px;
+ border-style: solid;
+ border-width: 0px 0px 0px 10px;
+ border-color: #f00;
+}
+
+.border-skipped {
+ border-top-left-radius: 10px 10px;
+ border-bottom-left-radius: 10px 10px;
+ border-style: solid;
+ border-width: 0px 0px 0px 10px;
+ border-color: #edc600;
+}
+
+.border-passed {
+ border-top-left-radius: 10px 10px;
+ border-bottom-left-radius: 10px 10px;
+ border-style: solid;
+ border-width: 0px 0px 0px 10px;
+ border-color: #19f52d;
+}
+
+.times-div {
+ text-align: center;
+ padding: 5px;
+}
+
+.suite-total-time {
+ font: 16px 'Lucida Grande';
+}
+
+.configuration-suite {
+ margin-left: 20px;
+}
+
+.configuration-test {
+ margin-left: 40px;
+}
+
+.configuration-class {
+ margin-left: 60px;
+}
+
+.configuration-method {
+ margin-left: 80px;
+}
+
+.test-method {
+ margin-left: 100px;
+}
+
+.chronological-class {
+ background-color: #0ccff;
+ border-style: solid;
+ border-width: 0px 0px 1px 1px;
+}
+
+.method-start {
+ float: right;
+}
+
+.chronological-class-name {
+ padding: 0px 0px 0px 5px;
+ color: #008;
+}
+
+.after, .before, .test-method {
+ font-family: monospace;
+ font-size: 14px;
+}
+
+.navigator-suite-header {
+ font-size: 22px;
+ margin: 0px 10px 5px 0px;
+ background-color: #deb887;
+ text-align: center;
+}
+
+.collapse-all-icon {
+ padding: 5px;
+ float: right;
+}
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/testng-reports.js b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/testng-reports.js
new file mode 100644
index 0000000000..5159f81927
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/testng-reports.js
@@ -0,0 +1,122 @@
+$(document).ready(function() {
+ $('a.navigator-link').click(function() {
+ // Extract the panel for this link
+ var panel = getPanelName($(this));
+
+ // Mark this link as currently selected
+ $('.navigator-link').parent().removeClass('navigator-selected');
+ $(this).parent().addClass('navigator-selected');
+
+ showPanel(panel);
+ });
+
+ installMethodHandlers('failed');
+ installMethodHandlers('skipped');
+ installMethodHandlers('passed', true); // hide passed methods by default
+
+ $('a.method').click(function() {
+ showMethod($(this));
+ return false;
+ });
+
+ // Hide all the panels and display the first one (do this last
+ // to make sure the click() will invoke the listeners)
+ $('.panel').hide();
+ $('.navigator-link').first().click();
+
+ // Collapse/expand the suites
+ $('a.collapse-all-link').click(function() {
+ var contents = $('.navigator-suite-content');
+ if (contents.css('display') == 'none') {
+ contents.show();
+ } else {
+ contents.hide();
+ }
+ });
+});
+
+// The handlers that take care of showing/hiding the methods
+function installMethodHandlers(name, hide) {
+ function getContent(t) {
+ return $('.method-list-content.' + name + "." + t.attr('panel-name'));
+ }
+
+ function getHideLink(t, name) {
+ var s = 'a.hide-methods.' + name + "." + t.attr('panel-name');
+ return $(s);
+ }
+
+ function getShowLink(t, name) {
+ return $('a.show-methods.' + name + "." + t.attr('panel-name'));
+ }
+
+ function getMethodPanelClassSel(element, name) {
+ var panelName = getPanelName(element);
+ var sel = '.' + panelName + "-class-" + name;
+ return $(sel);
+ }
+
+ $('a.hide-methods.' + name).click(function() {
+ var w = getContent($(this));
+ w.hide();
+ getHideLink($(this), name).hide();
+ getShowLink($(this), name).show();
+ getMethodPanelClassSel($(this), name).hide();
+ });
+
+ $('a.show-methods.' + name).click(function() {
+ var w = getContent($(this));
+ w.show();
+ getHideLink($(this), name).show();
+ getShowLink($(this), name).hide();
+ showPanel(getPanelName($(this)));
+ getMethodPanelClassSel($(this), name).show();
+ });
+
+ if (hide) {
+ $('a.hide-methods.' + name).click();
+ } else {
+ $('a.show-methods.' + name).click();
+ }
+}
+
+function getHashForMethod(element) {
+ return element.attr('hash-for-method');
+}
+
+function getPanelName(element) {
+ return element.attr('panel-name');
+}
+
+function showPanel(panelName) {
+ $('.panel').hide();
+ var panel = $('.panel[panel-name="' + panelName + '"]');
+ panel.show();
+}
+
+function showMethod(element) {
+ var hashTag = getHashForMethod(element);
+ var panelName = getPanelName(element);
+ showPanel(panelName);
+ var current = document.location.href;
+ var base = current.substring(0, current.indexOf('#'))
+ document.location.href = base + '#' + hashTag;
+ var newPosition = $(document).scrollTop() - 65;
+ $(document).scrollTop(newPosition);
+}
+
+function drawTable() {
+ for (var i = 0; i < suiteTableInitFunctions.length; i++) {
+ window[suiteTableInitFunctions[i]]();
+ }
+
+ for (var k in window.suiteTableData) {
+ var v = window.suiteTableData[k];
+ var div = v.tableDiv;
+ var data = v.tableData
+ var table = new google.visualization.Table(document.getElementById(div));
+ table.draw(data, {
+ showRowNumber : false
+ });
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/testng-results.xml b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/testng-results.xml
new file mode 100644
index 0000000000..02c71b6bac
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/testng-results.xml
@@ -0,0 +1,223 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<testng-results skipped="0" failed="0" total="49" passed="49">
+ <reporter-output>
+ </reporter-output>
+ <suite name="Default suite" duration-ms="6008" started-at="2016-09-08T07:19:36Z" finished-at="2016-09-08T07:19:42Z">
+ <groups>
+ <group name="updateTestGroup">
+ <method signature="ActionTest.updateTest()[pri:0, instance:ActionTest@5b367418]" name="updateTest" class="ActionTest"/>
+ <method signature="ActionTest.testUpdateInvalidVersion_negative()[pri:0, instance:ActionTest@5b367418]" name="testUpdateInvalidVersion_negative" class="ActionTest"/>
+ <method signature="ActionTest.testUpdateInvariantId_negative()[pri:0, instance:ActionTest@5b367418]" name="testUpdateInvariantId_negative" class="ActionTest"/>
+ <method signature="ActionTest.testUpdateName_negative()[pri:0, instance:ActionTest@5b367418]" name="testUpdateName_negative" class="ActionTest"/>
+ <method signature="ActionTest.testUpdateOtherUser_negative()[pri:0, instance:ActionTest@5b367418]" name="testUpdateOtherUser_negative" class="ActionTest"/>
+ <method signature="ActionTest.testUpdateStatus_negative()[pri:0, instance:ActionTest@5b367418]" name="testUpdateStatus_negative" class="ActionTest"/>
+ <method signature="ActionTest.testUpdateUniqueId_negative()[pri:0, instance:ActionTest@5b367418]" name="testUpdateUniqueId_negative" class="ActionTest"/>
+ <method signature="ActionTest.testUpdateVersion_negative()[pri:0, instance:ActionTest@5b367418]" name="testUpdateVersion_negative" class="ActionTest"/>
+ </group> <!-- updateTestGroup -->
+ </groups>
+ <test name="Default test" duration-ms="6008" started-at="2016-09-08T07:19:36Z" finished-at="2016-09-08T07:19:42Z">
+ <class name="ActionTest">
+ <test-method status="PASS" signature="init()[pri:0, instance:ActionTest@5b367418]" name="init" is-config="true" duration-ms="2613" started-at="2016-09-08T12:49:36Z" finished-at="2016-09-08T12:49:39Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- init -->
+ <test-method status="PASS" signature="createTest()[pri:0, instance:ActionTest@5b367418]" name="createTest" duration-ms="79" started-at="2016-09-08T12:49:39Z" finished-at="2016-09-08T12:49:39Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- createTest -->
+ <test-method status="PASS" signature="testDeleteArtifactInvalidActInvId()[pri:0, instance:ActionTest@5b367418]" name="testDeleteArtifactInvalidActInvId" duration-ms="3" started-at="2016-09-08T12:49:39Z" finished-at="2016-09-08T12:49:39Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testDeleteArtifactInvalidActInvId -->
+ <test-method status="PASS" signature="testDownloadArtifactNegativeInvalidAction()[pri:0, instance:ActionTest@5b367418]" name="testDownloadArtifactNegativeInvalidAction" duration-ms="4" started-at="2016-09-08T12:49:39Z" finished-at="2016-09-08T12:49:39Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testDownloadArtifactNegativeInvalidAction -->
+ <test-method status="PASS" signature="testGetByCategory()[pri:0, instance:ActionTest@5b367418]" name="testGetByCategory" duration-ms="961" started-at="2016-09-08T12:49:39Z" finished-at="2016-09-08T12:49:40Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testGetByCategory -->
+ <test-method status="PASS" signature="testGetByInvIdOnCreate()[pri:0, instance:ActionTest@5b367418]" name="testGetByInvIdOnCreate" duration-ms="30" started-at="2016-09-08T12:49:40Z" finished-at="2016-09-08T12:49:40Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testGetByInvIdOnCreate -->
+ <test-method status="PASS" signature="testGetECOMPComponents()[pri:0, instance:ActionTest@5b367418]" name="testGetECOMPComponents" duration-ms="5" started-at="2016-09-08T12:49:40Z" finished-at="2016-09-08T12:49:40Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testGetECOMPComponents -->
+ <test-method status="PASS" signature="testUploadArtifact()[pri:0, instance:ActionTest@5b367418]" name="testUploadArtifact" duration-ms="78" started-at="2016-09-08T12:49:40Z" finished-at="2016-09-08T12:49:40Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testUploadArtifact -->
+ <test-method status="PASS" signature="testgetActionsByActionUUID_Negative()[pri:0, instance:ActionTest@5b367418]" name="testgetActionsByActionUUID_Negative" duration-ms="4" started-at="2016-09-08T12:49:40Z" finished-at="2016-09-08T12:49:40Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testgetActionsByActionUUID_Negative -->
+ <test-method status="PASS" signature="testCheckOutOnCheckOut()[pri:0, instance:ActionTest@5b367418]" name="testCheckOutOnCheckOut" duration-ms="13" started-at="2016-09-08T12:49:40Z" depends-on-methods="ActionTest.createTest" finished-at="2016-09-08T12:49:40Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testCheckOutOnCheckOut -->
+ <test-method status="PASS" signature="testCheckOutOnCheckOutWithOtherUser()[pri:0, instance:ActionTest@5b367418]" name="testCheckOutOnCheckOutWithOtherUser" duration-ms="9" started-at="2016-09-08T12:49:40Z" depends-on-methods="ActionTest.createTest" finished-at="2016-09-08T12:49:40Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testCheckOutOnCheckOutWithOtherUser -->
+ <test-method status="PASS" signature="testCreateWithExistingActionName_negative()[pri:0, instance:ActionTest@5b367418]" name="testCreateWithExistingActionName_negative" duration-ms="5" started-at="2016-09-08T12:49:40Z" depends-on-methods="ActionTest.createTest" finished-at="2016-09-08T12:49:40Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testCreateWithExistingActionName_negative -->
+ <test-method status="PASS" signature="testGetAllActions()[pri:0, instance:ActionTest@5b367418]" name="testGetAllActions" duration-ms="56" started-at="2016-09-08T12:49:40Z" depends-on-methods="ActionTest.testGetByCategory" finished-at="2016-09-08T12:49:40Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testGetAllActions -->
+ <test-method status="PASS" signature="testDeleteArtifactInvalidArtifactUUID()[pri:0, instance:ActionTest@5b367418]" name="testDeleteArtifactInvalidArtifactUUID" duration-ms="9" started-at="2016-09-08T12:49:40Z" depends-on-methods="ActionTest.testGetByInvIdOnCreate" finished-at="2016-09-08T12:49:40Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testDeleteArtifactInvalidArtifactUUID -->
+ <test-method status="PASS" signature="testGetByIgnoreCaseName()[pri:0, instance:ActionTest@5b367418]" name="testGetByIgnoreCaseName" duration-ms="11" started-at="2016-09-08T12:49:40Z" depends-on-methods="ActionTest.testGetByInvIdOnCreate" finished-at="2016-09-08T12:49:40Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testGetByIgnoreCaseName -->
+ <test-method status="PASS" signature="testGetByInvIdManyVersionWithoutSubmit()[pri:0, instance:ActionTest@5b367418]" name="testGetByInvIdManyVersionWithoutSubmit" duration-ms="451" started-at="2016-09-08T12:49:40Z" depends-on-methods="ActionTest.testGetByInvIdOnCreate" finished-at="2016-09-08T12:49:41Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testGetByInvIdManyVersionWithoutSubmit -->
+ <test-method status="PASS" signature="testGetBySupportedComponent()[pri:0, instance:ActionTest@5b367418]" name="testGetBySupportedComponent" duration-ms="44" started-at="2016-09-08T12:49:41Z" depends-on-methods="ActionTest.testGetByCategory" finished-at="2016-09-08T12:49:41Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testGetBySupportedComponent -->
+ <test-method status="PASS" signature="testGetBySupportedModel()[pri:0, instance:ActionTest@5b367418]" name="testGetBySupportedModel" duration-ms="44" started-at="2016-09-08T12:49:41Z" depends-on-methods="ActionTest.testGetByCategory" finished-at="2016-09-08T12:49:41Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testGetBySupportedModel -->
+ <test-method status="PASS" signature="testGetByVendor()[pri:0, instance:ActionTest@5b367418]" name="testGetByVendor" duration-ms="41" started-at="2016-09-08T12:49:41Z" depends-on-methods="ActionTest.testGetByCategory" finished-at="2016-09-08T12:49:41Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testGetByVendor -->
+ <test-method status="PASS" signature="testDeleteArtifact()[pri:0, instance:ActionTest@5b367418]" name="testDeleteArtifact" duration-ms="39" started-at="2016-09-08T12:49:41Z" depends-on-methods="ActionTest.testUploadArtifact" finished-at="2016-09-08T12:49:41Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testDeleteArtifact -->
+ <test-method status="PASS" signature="testDeleteArtifactLockedByOtherUser()[pri:0, instance:ActionTest@5b367418]" name="testDeleteArtifactLockedByOtherUser" duration-ms="5" started-at="2016-09-08T12:49:41Z" depends-on-methods="ActionTest.testUploadArtifact" finished-at="2016-09-08T12:49:41Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testDeleteArtifactLockedByOtherUser -->
+ <test-method status="PASS" signature="testDeleteReadOnlyArtifact()[pri:0, instance:ActionTest@5b367418]" name="testDeleteReadOnlyArtifact" duration-ms="59" started-at="2016-09-08T12:49:41Z" depends-on-methods="ActionTest.testUploadArtifact" finished-at="2016-09-08T12:49:41Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testDeleteReadOnlyArtifact -->
+ <test-method status="PASS" signature="testDownloadArtifact()[pri:0, instance:ActionTest@5b367418]" name="testDownloadArtifact" duration-ms="8" started-at="2016-09-08T12:49:41Z" depends-on-methods="ActionTest.testUploadArtifact" finished-at="2016-09-08T12:49:41Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testDownloadArtifact -->
+ <test-method status="PASS" signature="testDownloadArtifactNegativeInvalidArtifact()[pri:0, instance:ActionTest@5b367418]" name="testDownloadArtifactNegativeInvalidArtifact" duration-ms="5" started-at="2016-09-08T12:49:41Z" depends-on-methods="ActionTest.testUploadArtifact" finished-at="2016-09-08T12:49:41Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testDownloadArtifactNegativeInvalidArtifact -->
+ <test-method status="PASS" signature="testUpdateArtifact()[pri:0, instance:ActionTest@5b367418]" name="testUpdateArtifact" duration-ms="22" started-at="2016-09-08T12:49:41Z" depends-on-methods="ActionTest.testUploadArtifact" finished-at="2016-09-08T12:49:41Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testUpdateArtifact -->
+ <test-method status="PASS" signature="testUploadArtifactCheckedOutOtherUser_negative()[pri:0, instance:ActionTest@5b367418]" name="testUploadArtifactCheckedOutOtherUser_negative" duration-ms="6" started-at="2016-09-08T12:49:41Z" depends-on-methods="ActionTest.testUploadArtifact" finished-at="2016-09-08T12:49:41Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testUploadArtifactCheckedOutOtherUser_negative -->
+ <test-method status="PASS" signature="testUploadArtifactInvalidActionInvId_negative()[pri:0, instance:ActionTest@5b367418]" name="testUploadArtifactInvalidActionInvId_negative" duration-ms="6" started-at="2016-09-08T12:49:41Z" depends-on-methods="ActionTest.testUploadArtifact" finished-at="2016-09-08T12:49:41Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testUploadArtifactInvalidActionInvId_negative -->
+ <test-method status="PASS" signature="testUploadArtifactSameName_negative()[pri:0, instance:ActionTest@5b367418]" name="testUploadArtifactSameName_negative" duration-ms="9" started-at="2016-09-08T12:49:41Z" depends-on-methods="ActionTest.testUploadArtifact" finished-at="2016-09-08T12:49:41Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testUploadArtifactSameName_negative -->
+ <test-method status="PASS" signature="testUploadArtifactUnlockedAction_negative()[pri:0, instance:ActionTest@5b367418]" name="testUploadArtifactUnlockedAction_negative" duration-ms="21" started-at="2016-09-08T12:49:41Z" depends-on-methods="ActionTest.testUploadArtifact" finished-at="2016-09-08T12:49:41Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testUploadArtifactUnlockedAction_negative -->
+ <test-method status="PASS" signature="testgetActionsByActionUUID()[pri:0, instance:ActionTest@5b367418]" name="testgetActionsByActionUUID" duration-ms="5" started-at="2016-09-08T12:49:41Z" depends-on-methods="ActionTest.createTest" finished-at="2016-09-08T12:49:41Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testgetActionsByActionUUID -->
+ <test-method status="PASS" signature="testGetByInvIdManyVersionWithFirstSubmit()[pri:0, instance:ActionTest@5b367418]" name="testGetByInvIdManyVersionWithFirstSubmit" duration-ms="515" started-at="2016-09-08T12:49:41Z" depends-on-methods="ActionTest.testGetByInvIdManyVersionWithoutSubmit" finished-at="2016-09-08T12:49:41Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testGetByInvIdManyVersionWithFirstSubmit -->
+ <test-method status="PASS" signature="testDeleteArtifactOnUnlockedAction()[pri:0, instance:ActionTest@5b367418]" name="testDeleteArtifactOnUnlockedAction" duration-ms="5" started-at="2016-09-08T12:49:41Z" depends-on-methods="ActionTest.testUploadArtifactUnlockedAction_negative" finished-at="2016-09-08T12:49:41Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testDeleteArtifactOnUnlockedAction -->
+ <test-method status="PASS" signature="updateTest()[pri:0, instance:ActionTest@5b367418]" name="updateTest" duration-ms="17" started-at="2016-09-08T12:49:41Z" depends-on-methods="ActionTest.createTest, ActionTest.testCreateWithExistingActionName_negative" finished-at="2016-09-08T12:49:42Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- updateTest -->
+ <test-method status="PASS" signature="testGetByInvIdManyVersionWithMultSubmit()[pri:0, instance:ActionTest@5b367418]" name="testGetByInvIdManyVersionWithMultSubmit" duration-ms="366" started-at="2016-09-08T12:49:42Z" depends-on-methods="ActionTest.testGetByInvIdManyVersionWithFirstSubmit" finished-at="2016-09-08T12:49:42Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testGetByInvIdManyVersionWithMultSubmit -->
+ <test-method status="PASS" signature="testUpdateInvalidVersion_negative()[pri:0, instance:ActionTest@5b367418]" name="testUpdateInvalidVersion_negative" duration-ms="7" started-at="2016-09-08T12:49:42Z" depends-on-methods="ActionTest.updateTest" finished-at="2016-09-08T12:49:42Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testUpdateInvalidVersion_negative -->
+ <test-method status="PASS" signature="testUpdateInvariantId_negative()[pri:0, instance:ActionTest@5b367418]" name="testUpdateInvariantId_negative" duration-ms="6" started-at="2016-09-08T12:49:42Z" depends-on-methods="ActionTest.updateTest" finished-at="2016-09-08T12:49:42Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testUpdateInvariantId_negative -->
+ <test-method status="PASS" signature="testUpdateName_negative()[pri:0, instance:ActionTest@5b367418]" name="testUpdateName_negative" duration-ms="8" started-at="2016-09-08T12:49:42Z" depends-on-methods="ActionTest.updateTest" finished-at="2016-09-08T12:49:42Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testUpdateName_negative -->
+ <test-method status="PASS" signature="testUpdateOtherUser_negative()[pri:0, instance:ActionTest@5b367418]" name="testUpdateOtherUser_negative" duration-ms="7" started-at="2016-09-08T12:49:42Z" depends-on-methods="ActionTest.updateTest" finished-at="2016-09-08T12:49:42Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testUpdateOtherUser_negative -->
+ <test-method status="PASS" signature="testUpdateStatus_negative()[pri:0, instance:ActionTest@5b367418]" name="testUpdateStatus_negative" duration-ms="10" started-at="2016-09-08T12:49:42Z" depends-on-methods="ActionTest.updateTest" finished-at="2016-09-08T12:49:42Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testUpdateStatus_negative -->
+ <test-method status="PASS" signature="testUpdateUniqueId_negative()[pri:0, instance:ActionTest@5b367418]" name="testUpdateUniqueId_negative" duration-ms="9" started-at="2016-09-08T12:49:42Z" depends-on-methods="ActionTest.updateTest" finished-at="2016-09-08T12:49:42Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testUpdateUniqueId_negative -->
+ <test-method status="PASS" signature="testUpdateVersion_negative()[pri:0, instance:ActionTest@5b367418]" name="testUpdateVersion_negative" duration-ms="7" started-at="2016-09-08T12:49:42Z" depends-on-methods="ActionTest.updateTest" finished-at="2016-09-08T12:49:42Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testUpdateVersion_negative -->
+ <test-method status="PASS" signature="testGetByInvIdOnName()[pri:0, instance:ActionTest@5b367418]" name="testGetByInvIdOnName" duration-ms="271" started-at="2016-09-08T12:49:42Z" depends-on-methods="ActionTest.testGetByInvIdManyVersionWithMultSubmit" finished-at="2016-09-08T12:49:42Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testGetByInvIdOnName -->
+ <test-method status="PASS" signature="testCheckIn()[pri:0, instance:ActionTest@5b367418]" name="testCheckIn" duration-ms="10" depends-on-groups="updateTestGroup" started-at="2016-09-08T12:49:42Z" finished-at="2016-09-08T12:49:42Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testCheckIn -->
+ <test-method status="PASS" signature="testUpdateOnCheckedInAction_negative()[pri:0, instance:ActionTest@5b367418]" name="testUpdateOnCheckedInAction_negative" duration-ms="7" started-at="2016-09-08T12:49:42Z" depends-on-methods="ActionTest.testCheckIn" finished-at="2016-09-08T12:49:42Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testUpdateOnCheckedInAction_negative -->
+ <test-method status="PASS" signature="testSubmit()[pri:0, instance:ActionTest@5b367418]" name="testSubmit" duration-ms="20" started-at="2016-09-08T12:49:42Z" depends-on-methods="ActionTest.testUpdateOnCheckedInAction_negative" finished-at="2016-09-08T12:49:42Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testSubmit -->
+ <test-method status="PASS" signature="testCheckInWithoutCheckout()[pri:0, instance:ActionTest@5b367418]" name="testCheckInWithoutCheckout" duration-ms="4" started-at="2016-09-08T12:49:42Z" depends-on-methods="ActionTest.testSubmit" finished-at="2016-09-08T12:49:42Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testCheckInWithoutCheckout -->
+ <test-method status="PASS" signature="testCheckOut()[pri:0, instance:ActionTest@5b367418]" name="testCheckOut" duration-ms="21" started-at="2016-09-08T12:49:42Z" depends-on-methods="ActionTest.testSubmit" finished-at="2016-09-08T12:49:42Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testCheckOut -->
+ <test-method status="PASS" signature="testCheckInWithOtherUser()[pri:0, instance:ActionTest@5b367418]" name="testCheckInWithOtherUser" duration-ms="5" started-at="2016-09-08T12:49:42Z" depends-on-methods="ActionTest.testCheckOut" finished-at="2016-09-08T12:49:42Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testCheckInWithOtherUser -->
+ <test-method status="PASS" signature="testSubmitOnCheckout()[pri:0, instance:ActionTest@5b367418]" name="testSubmitOnCheckout" duration-ms="4" started-at="2016-09-08T12:49:42Z" depends-on-methods="ActionTest.testCheckOut" finished-at="2016-09-08T12:49:42Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testSubmitOnCheckout -->
+ <test-method status="PASS" signature="testUndoCheckout()[pri:0, instance:ActionTest@5b367418]" name="testUndoCheckout" duration-ms="18" started-at="2016-09-08T12:49:42Z" depends-on-methods="ActionTest.testCheckOut" finished-at="2016-09-08T12:49:42Z">
+ <reporter-output>
+ </reporter-output>
+ </test-method> <!-- testUndoCheckout -->
+ </class> <!-- ActionTest -->
+ </test> <!-- Default test -->
+ </suite> <!-- Default suite -->
+</testng-results>
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/testng.css b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/testng.css
new file mode 100644
index 0000000000..5124ba863b
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/testng.css
@@ -0,0 +1,9 @@
+.invocation-failed, .test-failed { background-color: #DD0000; }
+.invocation-percent, .test-percent { background-color: #006600; }
+.invocation-passed, .test-passed { background-color: #00AA00; }
+.invocation-skipped, .test-skipped { background-color: #CCCC00; }
+
+.main-page {
+ font-size: x-large;
+}
+
diff --git a/openecomp-be/backend/openecomp-sdc-application-config-manager/pom.xml b/openecomp-be/backend/openecomp-sdc-application-config-manager/pom.xml
new file mode 100644
index 0000000000..437114404f
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-application-config-manager/pom.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>backend</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-application-config-manager</artifactId>
+
+
+ <dependencies>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <version>2.3.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.yaml</groupId>
+ <artifactId>snakeyaml</artifactId>
+ <version>1.14</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-config-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>6.9.10</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.19.1</version>
+ <configuration>
+ <skipTests>true</skipTests>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-application-config-manager/src/main/java/org/openecomp/sdc/applicationconfig/ApplicationConfigManager.java b/openecomp-be/backend/openecomp-sdc-application-config-manager/src/main/java/org/openecomp/sdc/applicationconfig/ApplicationConfigManager.java
new file mode 100644
index 0000000000..924401b9c1
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-application-config-manager/src/main/java/org/openecomp/sdc/applicationconfig/ApplicationConfigManager.java
@@ -0,0 +1,35 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.applicationconfig;
+
+import org.openecomp.core.utilities.applicationconfig.dao.type.ApplicationConfigEntity;
+import org.openecomp.core.utilities.applicationconfig.type.ConfigurationData;
+
+import java.util.Collection;
+
+public interface ApplicationConfigManager {
+
+ void insertIntoTable(String namespace, String key, String value);
+
+ ConfigurationData getFromTable(String namespace, String key);
+
+ Collection<ApplicationConfigEntity> getListOfConfigurationByNamespace(String namespace);
+}
diff --git a/openecomp-be/backend/openecomp-sdc-application-config-manager/src/main/java/org/openecomp/sdc/applicationconfig/impl/ApplicationConfigManagerImpl.java b/openecomp-be/backend/openecomp-sdc-application-config-manager/src/main/java/org/openecomp/sdc/applicationconfig/impl/ApplicationConfigManagerImpl.java
new file mode 100644
index 0000000000..b44c541261
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-application-config-manager/src/main/java/org/openecomp/sdc/applicationconfig/impl/ApplicationConfigManagerImpl.java
@@ -0,0 +1,63 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.applicationconfig.impl;
+
+import org.openecomp.core.utilities.applicationconfig.ApplicationConfig;
+import org.openecomp.core.utilities.applicationconfig.dao.type.ApplicationConfigEntity;
+import org.openecomp.core.utilities.applicationconfig.impl.ApplicationConfigImpl;
+import org.openecomp.core.utilities.applicationconfig.type.ConfigurationData;
+import org.openecomp.sdc.applicationconfig.ApplicationConfigManager;
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+
+import java.util.Collection;
+
+public class ApplicationConfigManagerImpl implements ApplicationConfigManager {
+ private static final String SCHEMA_GENERATOR_INITIALIZATION_ERROR =
+ "SCHEMA_GENERATOR_INITIALIZATION_ERROR";
+ private static final String SCHEMA_GENERATOR_INITIALIZATION_ERROR_MSG =
+ "Error occurred while loading questionnaire schema templates";
+ private ApplicationConfig applicationConfig = new ApplicationConfigImpl();
+
+ @Override
+ public void insertIntoTable(String namespace, String key, String value) {
+ try {
+ applicationConfig.insertValue(namespace, key, value);
+ } catch (Exception exception) {
+ throw new CoreException(new ErrorCode.ErrorCodeBuilder()
+ .withCategory(ErrorCategory.APPLICATION)
+ .withId(SCHEMA_GENERATOR_INITIALIZATION_ERROR)
+ .withMessage(SCHEMA_GENERATOR_INITIALIZATION_ERROR_MSG)
+ .build());
+ }
+ }
+
+ @Override
+ public ConfigurationData getFromTable(String namespace, String key) {
+ return applicationConfig.getConfigurationData(namespace, key);
+ }
+
+ @Override
+ public Collection<ApplicationConfigEntity> getListOfConfigurationByNamespace(String namespace) {
+ return applicationConfig.getListOfConfigurationByNamespace(namespace);
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-application-config-manager/src/test/java/org/openecomp/sdc/applicationconfig/ApplicationConfigManagerTest.java b/openecomp-be/backend/openecomp-sdc-application-config-manager/src/test/java/org/openecomp/sdc/applicationconfig/ApplicationConfigManagerTest.java
new file mode 100644
index 0000000000..291ef18e19
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-application-config-manager/src/test/java/org/openecomp/sdc/applicationconfig/ApplicationConfigManagerTest.java
@@ -0,0 +1,64 @@
+package org.openecomp.sdc.applicationconfig;
+
+import org.openecomp.sdc.applicationconfig.impl.ApplicationConfigManagerImpl;
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.core.utilities.applicationconfig.dao.type.ApplicationConfigEntity;
+import org.openecomp.core.utilities.applicationconfig.type.ConfigurationData;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+import java.util.Collection;
+
+public class ApplicationConfigManagerTest {
+
+ public static final String TEST_NAMESPACE_1 = "test-app-namespace";
+ public static final String TEST_NAMESPACE_2 = "test-namespace";
+ public static final String TEST_KEY = "test-app-key";
+ public static final String TEST_VALUE = "test-app-value";
+ ApplicationConfigManager applicationConfigManager = new ApplicationConfigManagerImpl();
+
+ @Test
+ public void testInsertIntoTable() {
+ try {
+ applicationConfigManager.insertIntoTable(TEST_NAMESPACE_1, TEST_KEY, TEST_VALUE);
+ } catch (CoreException e) {
+ Assert.assertEquals(e.getMessage(),
+ "Error occurred while loading questionnaire schema templates");
+ }
+ }
+
+
+ @Test(dependsOnMethods = "testInsertIntoTable")
+ public void testGetValueFromTable() {
+ ConfigurationData value = applicationConfigManager.getFromTable(TEST_NAMESPACE_1, TEST_KEY);
+
+ Assert.assertEquals(value.getValue(), TEST_VALUE);
+ }
+
+
+ @Test(dependsOnMethods = "testInsertIntoTable")
+ public void testGetValueFromTableNegative() {
+ try {
+ ConfigurationData value =
+ applicationConfigManager.getFromTable("not-existing-namespace", "not-existing-key");
+ } catch (CoreException ce) {
+ Assert.assertEquals(ce.getMessage(),
+ "Configuration for namespace not-existing-namespace and key not-existing-key was not found");
+ }
+
+ }
+
+ @Test
+ public void testGetList() {
+ applicationConfigManager.insertIntoTable(TEST_NAMESPACE_2, "key1", "val1");
+ applicationConfigManager.insertIntoTable(TEST_NAMESPACE_2, "key2", "val2");
+ applicationConfigManager.insertIntoTable(TEST_NAMESPACE_2, "key3", "val3");
+
+ Collection<ApplicationConfigEntity> ACElist =
+ applicationConfigManager.getListOfConfigurationByNamespace(TEST_NAMESPACE_2);
+
+ Assert.assertNotNull(ACElist);
+ Assert.assertEquals(ACElist.size(), 3);
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-validation-manager/pom.xml b/openecomp-be/backend/openecomp-sdc-validation-manager/pom.xml
new file mode 100644
index 0000000000..4a7b39aae1
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-validation-manager/pom.xml
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>backend</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>openecomp-sdc-validation-manager</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-utilities-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-validation-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-heat-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>6.9.10</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>RELEASE</version>
+ <scope>test</scope>
+ </dependency>
+
+
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-translator-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.dataformat</groupId>
+ <artifactId>jackson-dataformat-xml</artifactId>
+ <version>2.7.4</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.woodstox</groupId>
+ <artifactId>woodstox-core-asl</artifactId>
+ <version>4.4.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-vendor-license-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-validation-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+
+
+
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/UploadValidationManager.java b/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/UploadValidationManager.java
new file mode 100644
index 0000000000..734771f909
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/UploadValidationManager.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.validation;
+
+import org.openecomp.sdc.validation.types.ValidationFileResponse;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+public interface UploadValidationManager {
+
+
+ ValidationFileResponse validateFile(String type, InputStream heatFileToUpload) throws IOException;
+
+
+}
diff --git a/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/errors/ValidationErrorCodes.java b/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/errors/ValidationErrorCodes.java
new file mode 100644
index 0000000000..815517cdb8
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/errors/ValidationErrorCodes.java
@@ -0,0 +1,26 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.validation.errors;
+
+public class ValidationErrorCodes {
+ public static final String VALIDATION_INVALID = "VALIDATION_INVALID";
+
+}
diff --git a/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/errors/ValidationInvalidErrorBuilder.java b/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/errors/ValidationInvalidErrorBuilder.java
new file mode 100644
index 0000000000..5e4cb59ef3
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/errors/ValidationInvalidErrorBuilder.java
@@ -0,0 +1,75 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.validation.errors;
+
+import static org.openecomp.sdc.validation.errors.ValidationErrorCodes.VALIDATION_INVALID;
+
+import org.openecomp.sdc.common.errors.BaseErrorBuilder;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.datatypes.error.ErrorMessage;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * The type Validation invalid error builder.
+ */
+public class ValidationInvalidErrorBuilder extends BaseErrorBuilder {
+ private static final String VALIDATION_INVALID_DETAILED_MSG = "File is invalid: %s";
+ private static final String VALIDATION_INVALID_MSG = "Validated file is invalid";
+
+ /**
+ * Instantiates a new Validation invalid error builder.
+ *
+ * @param errors the errors
+ */
+ public ValidationInvalidErrorBuilder(Map<String, List<ErrorMessage>> errors) {
+ getErrorCodeBuilder().withId(VALIDATION_INVALID);
+ getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION);
+ getErrorCodeBuilder()
+ .withMessage(String.format(VALIDATION_INVALID_DETAILED_MSG, toString(errors)));
+ }
+
+ /**
+ * Instantiates a new Validation invalid error builder.
+ */
+ public ValidationInvalidErrorBuilder() {
+ getErrorCodeBuilder().withId(VALIDATION_INVALID);
+ getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION);
+ getErrorCodeBuilder().withMessage(VALIDATION_INVALID_MSG);
+ }
+
+ private String toString(Map<String, List<ErrorMessage>> errors) {
+ StringBuffer sb = new StringBuffer();
+ errors.entrySet().stream()
+ .forEach(entry -> singleErrorToString(sb, entry.getKey(), entry.getValue()));
+ return sb.toString();
+ }
+
+ private void singleErrorToString(StringBuffer sb, String fileName, List<ErrorMessage> errors) {
+ sb.append(System.lineSeparator());
+ sb.append(fileName);
+ sb.append(sb.append(": "));
+ errors.stream().forEach(
+ error -> sb.append(error.getMessage()).append("[").append(error.getLevel()).append("], "));
+ }
+
+}
diff --git a/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/impl/UploadValidationManagerImpl.java b/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/impl/UploadValidationManagerImpl.java
new file mode 100644
index 0000000000..ce0d911082
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/impl/UploadValidationManagerImpl.java
@@ -0,0 +1,161 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.validation.impl;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.MapUtils;
+import org.openecomp.core.utilities.file.FileContentHandler;
+import org.openecomp.core.utilities.file.FileUtils;
+import org.openecomp.core.validation.api.ValidationManager;
+import org.openecomp.core.validation.errors.Messages;
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+import org.openecomp.sdc.common.utils.AsdcCommon;
+import org.openecomp.sdc.heat.datatypes.structure.ValidationStructureList;
+import org.openecomp.sdc.heat.services.tree.HeatTreeManager;
+import org.openecomp.sdc.heat.services.tree.HeatTreeManagerUtil;
+import org.openecomp.sdc.validation.UploadValidationManager;
+import org.openecomp.sdc.validation.types.ValidationFileResponse;
+import org.openecomp.sdc.validation.utils.ValidationManagerUtil;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+
+public class UploadValidationManagerImpl implements UploadValidationManager {
+
+ private static FileContentHandler getFileContentMapFromZip(byte[] uploadFileData)
+ throws IOException, CoreException {
+ ZipEntry zipEntry;
+ List<String> folderList = new ArrayList<>();
+ FileContentHandler mapFileContent = new FileContentHandler();
+ try {
+ ZipInputStream inputZipStream;
+
+ byte[] fileByteContent;
+ String currentEntryName;
+ inputZipStream = new ZipInputStream(new ByteArrayInputStream(uploadFileData));
+
+ while ((zipEntry = inputZipStream.getNextEntry()) != null) {
+ currentEntryName = zipEntry.getName();
+ // else, get the file content (as byte array) and save it in a map.
+ fileByteContent = FileUtils.toByteArray(inputZipStream);
+
+ int index = lastIndexFileSeparatorIndex(currentEntryName);
+ String currSubstringWithoutSeparator =
+ currentEntryName.substring(index + 1, currentEntryName.length());
+ if (index != -1) {
+ if (currSubstringWithoutSeparator.length() > 0) {
+ mapFileContent.addFile(currentEntryName.substring(index + 1, currentEntryName.length()),
+ fileByteContent);
+ } else {
+ folderList.add(currentEntryName);
+ }
+ } else {
+ mapFileContent.addFile(currentEntryName, fileByteContent);
+ }
+ }
+ } catch (RuntimeException exception) {
+ throw new IOException(exception);
+ }
+
+ if (CollectionUtils.isNotEmpty(folderList)) {
+ throw new CoreException((new ErrorCode.ErrorCodeBuilder())
+ .withMessage(Messages.ZIP_SHOULD_NOT_CONTAIN_FOLDERS.getErrorMessage())
+ .withId(Messages.ZIP_SHOULD_NOT_CONTAIN_FOLDERS.getErrorMessage())
+ .withCategory(ErrorCategory.APPLICATION).build());
+
+ }
+
+ return mapFileContent;
+ }
+
+ private static int lastIndexFileSeparatorIndex(String filePath) {
+ int length = filePath.length() - 1;
+
+ for (int i = length; i >= 0; i--) {
+ char currChar = filePath.charAt(i);
+ if (currChar == '/' || currChar == File.separatorChar || currChar == File.pathSeparatorChar) {
+ return i;
+ }
+ }
+ // if we've reached to the start of the string and didn't find file separator - return -1
+ return -1;
+ }
+
+ @Override
+ public ValidationFileResponse validateFile(String type, InputStream fileToValidate)
+ throws IOException {
+
+ ValidationFileResponse validationFileResponse = new ValidationFileResponse();
+
+ HeatTreeManager tree;
+ ValidationStructureList validationStructureList = new ValidationStructureList();
+ if (type.toLowerCase().equals("heat")) {
+ FileContentHandler content = getFileContent(fileToValidate);
+ if (!content.containsFile(AsdcCommon.MANIFEST_NAME)) {
+ throw new CoreException((new ErrorCode.ErrorCodeBuilder())
+ .withMessage(Messages.MANIFEST_NOT_EXIST.getErrorMessage())
+ .withId(Messages.ZIP_SHOULD_NOT_CONTAIN_FOLDERS.getErrorMessage())
+ .withCategory(ErrorCategory.APPLICATION).build());
+ }
+ Map<String, List<org.openecomp.sdc.datatypes.error.ErrorMessage>> errors =
+ validateHeatUploadData(content);
+ tree = HeatTreeManagerUtil.initHeatTreeManager(content);
+ tree.createTree();
+ if (MapUtils.isNotEmpty(errors)) {
+
+
+ tree.addErrors(errors);
+ validationStructureList.setImportStructure(tree.getTree());
+ //validationFileResponse.setStatus(ValidationFileStatus.Failure);
+ } else {
+ //validationFileResponse.setStatus(ValidationFileStatus.Success);
+ }
+ } else {
+ throw new RuntimeException("invalid type:" + type);
+ }
+ validationFileResponse.setValidationData(validationStructureList);
+ return validationFileResponse;
+ }
+
+ private Map<String, List<org.openecomp.sdc.datatypes.error.ErrorMessage>> validateHeatUploadData(
+ FileContentHandler fileContentMap)
+ throws IOException {
+ ValidationManager validationManager =
+ ValidationManagerUtil.initValidationManager(fileContentMap);
+ return validationManager.validate();
+ }
+
+ private FileContentHandler getFileContent(InputStream is) throws IOException {
+ return getFileContentMapFromZip(FileUtils.toByteArray(is));
+
+
+ }
+
+}
diff --git a/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/types/ValidationFileResponse.java b/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/types/ValidationFileResponse.java
new file mode 100644
index 0000000000..ff7f845252
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/types/ValidationFileResponse.java
@@ -0,0 +1,36 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.validation.types;
+
+
+import org.openecomp.sdc.heat.datatypes.structure.ValidationStructureList;
+
+public class ValidationFileResponse {
+ private ValidationStructureList validationData;
+
+ public ValidationStructureList getValidationData() {
+ return validationData;
+ }
+
+ public void setValidationData(ValidationStructureList validationData) {
+ this.validationData = validationData;
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/types/ValidationFileStatus.java b/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/types/ValidationFileStatus.java
new file mode 100644
index 0000000000..117eb3b3b7
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/types/ValidationFileStatus.java
@@ -0,0 +1,26 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.validation.types;
+
+public enum ValidationFileStatus {
+ Success,
+ Failure;
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/pom.xml b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/pom.xml
new file mode 100644
index 0000000000..a8c8e9a9f1
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/pom.xml
@@ -0,0 +1,103 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+
+ <parent>
+ <artifactId>backend</artifactId>
+ <groupId>org.openecomp.sdc</groupId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>openecomp-sdc-vendor-license-manager</artifactId>
+ <name>openecomp-sdc-vendor-license-manager</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <version>2.3.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.yaml</groupId>
+ <artifactId>snakeyaml</artifactId>
+ <version>1.14</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-vendor-license-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <scope>test</scope>
+ <version>1.10.19</version>
+ </dependency>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <scope>test</scope>
+ <version>6.8.5</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>snakeyaml</artifactId>
+ <groupId>org.yaml</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ <version>RELEASE</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>javax.el-api</artifactId>
+ <version>${javax.el-api.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.web</groupId>
+ <artifactId>javax.el</artifactId>
+ <version>2.2.4</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.woodstox</groupId>
+ <artifactId>woodstox-core-asl</artifactId>
+ <version>4.4.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-vendor-software-product-manager</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.dataformat</groupId>
+ <artifactId>jackson-dataformat-xml</artifactId>
+ <version>2.7.4</version>
+ </dependency>
+ <!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>${commons.io.version}</version>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.19.1</version>
+ <configuration>
+ <skipTests>true</skipTests>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project> \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/VendorLicenseManager.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/VendorLicenseManager.java
new file mode 100644
index 0000000000..dbe786a44b
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/VendorLicenseManager.java
@@ -0,0 +1,115 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense;
+
+import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupModel;
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementModel;
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity;
+import org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.util.Collection;
+import java.util.Set;
+
+public interface VendorLicenseManager {
+
+ void checkout(String vendorLicenseModelId, String user);
+
+ void undoCheckout(String vendorLicenseModelId, String user);
+
+ void checkin(String vendorLicenseModelId, String user);
+
+ void submit(String vendorLicenseModelId, String user);
+
+ Collection<VersionedVendorLicenseModel> listVendorLicenseModels(String versionFilter,
+ String user);
+
+ VendorLicenseModelEntity createVendorLicenseModel(VendorLicenseModelEntity licenseModel,
+ String user);
+
+ void updateVendorLicenseModel(VendorLicenseModelEntity licenseModel, String user);
+
+ VersionedVendorLicenseModel getVendorLicenseModel(String vlmId, Version version, String user);
+
+ void deleteVendorLicenseModel(String vlmId, String user);
+
+
+ Collection<LicenseAgreementEntity> listLicenseAgreements(String vlmId, Version version,
+ String user);
+
+ LicenseAgreementEntity createLicenseAgreement(LicenseAgreementEntity licenseAgreement,
+ String user);
+
+ void updateLicenseAgreement(LicenseAgreementEntity licenseAgreement,
+ Set<String> addedFeatureGroupIds, Set<String> removedFeatureGroupIds,
+ String user);
+
+ LicenseAgreementModel getLicenseAgreementModel(String vlmId, Version version,
+ String licenseAgreementId, String user);
+
+ void deleteLicenseAgreement(String vlmId, String licenseAgreementId, String user);
+
+
+ Collection<org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity> listFeatureGroups(
+ String vlmId, Version version, String user);
+
+ org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity createFeatureGroup(
+ org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity fg, String user);
+
+ void updateFeatureGroup(org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity featureGroup,
+ Set<String> addedLicenseKeyGroups, Set<String> removedLicenseKeyGroups,
+ Set<String> addedEntitlementPools, Set<String> removedEntitlementPools,
+ String user);
+
+ FeatureGroupModel getFeatureGroupModel(
+ org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity featureGroup, String user);
+
+ void deleteFeatureGroup(org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity featureGroup,
+ String user);
+
+
+ Collection<EntitlementPoolEntity> listEntitlementPools(String vlmId, Version version,
+ String user);
+
+ EntitlementPoolEntity createEntitlementPool(EntitlementPoolEntity entitlementPool, String user);
+
+ void updateEntitlementPool(EntitlementPoolEntity entitlementPool, String user);
+
+ EntitlementPoolEntity getEntitlementPool(EntitlementPoolEntity entitlementPool, String user);
+
+ void deleteEntitlementPool(EntitlementPoolEntity entitlementPool, String user);
+
+
+ Collection<LicenseKeyGroupEntity> listLicenseKeyGroups(String vlmId, Version version,
+ String user);
+
+ LicenseKeyGroupEntity createLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup, String user);
+
+ void updateLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup, String user);
+
+ LicenseKeyGroupEntity getLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup, String user);
+
+ void deleteLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup, String user);
+
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerImpl.java
new file mode 100644
index 0000000000..b0b088c774
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerImpl.java
@@ -0,0 +1,558 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.impl;
+
+import static org.openecomp.sdc.vendorlicense.VendorLicenseConstants
+ .VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE;
+
+import org.openecomp.core.util.UniqueValueUtil;
+import org.openecomp.sdc.vendorlicense.VendorLicenseConstants;
+import org.openecomp.sdc.vendorlicense.VendorLicenseManager;
+import org.openecomp.sdc.vendorlicense.dao.EntitlementPoolDao;
+import org.openecomp.sdc.vendorlicense.dao.EntitlementPoolDaoFactory;
+import org.openecomp.sdc.vendorlicense.dao.FeatureGroupDao;
+import org.openecomp.sdc.vendorlicense.dao.FeatureGroupDaoFactory;
+import org.openecomp.sdc.vendorlicense.dao.LicenseAgreementDaoFactory;
+import org.openecomp.sdc.vendorlicense.dao.LicenseKeyGroupDao;
+import org.openecomp.sdc.vendorlicense.dao.LicenseKeyGroupDaoFactory;
+import org.openecomp.sdc.vendorlicense.dao.VendorLicenseModelDao;
+import org.openecomp.sdc.vendorlicense.dao.VendorLicenseModelDaoFactory;
+import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupModel;
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementModel;
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity;
+import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacade;
+import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacadeFactory;
+import org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel;
+import org.openecomp.sdc.versioning.VersioningManager;
+import org.openecomp.sdc.versioning.VersioningUtil;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.dao.types.VersionStatus;
+import org.openecomp.sdc.versioning.types.VersionInfo;
+import org.openecomp.sdc.versioning.types.VersionableEntityAction;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+public class VendorLicenseManagerImpl implements VendorLicenseManager {
+
+ private static final VersioningManager versioningManager =
+ org.openecomp.sdc.versioning.VersioningManagerFactory.getInstance().createInterface();
+ private static final VendorLicenseFacade vendorLicenseFacade =
+ VendorLicenseFacadeFactory.getInstance().createInterface();
+
+ private static final VendorLicenseModelDao
+ vendorLicenseModelDao = VendorLicenseModelDaoFactory.getInstance().createInterface();
+ private static final org.openecomp.sdc.vendorlicense.dao.LicenseAgreementDao
+ licenseAgreementDao = LicenseAgreementDaoFactory.getInstance().createInterface();
+ private static final FeatureGroupDao featureGroupDao =
+ FeatureGroupDaoFactory.getInstance().createInterface();
+ private static final EntitlementPoolDao
+ entitlementPoolDao = EntitlementPoolDaoFactory.getInstance().createInterface();
+ private static final LicenseKeyGroupDao
+ licenseKeyGroupDao = LicenseKeyGroupDaoFactory.getInstance().createInterface();
+
+ private static void sortVlmListByModificationTimeDescOrder(
+ List<VersionedVendorLicenseModel> vendorLicenseModels) {
+ Collections.sort(vendorLicenseModels, new Comparator<VersionedVendorLicenseModel>() {
+ @Override
+ public int compare(VersionedVendorLicenseModel o1, VersionedVendorLicenseModel o2) {
+ return o2.getVendorLicenseModel().getWritetimeMicroSeconds()
+ .compareTo(o1.getVendorLicenseModel().getWritetimeMicroSeconds());
+ }
+ });
+ }
+
+ @Override
+ public void checkout(String vendorLicenseModelId, String user) {
+ Version newVersion = versioningManager
+ .checkout(VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, vendorLicenseModelId, user);
+ vendorLicenseFacade.updateVlmLastModificationTime(vendorLicenseModelId, newVersion);
+ }
+
+ @Override
+ public void undoCheckout(String vendorLicenseModelId, String user) {
+ Version newVersion = versioningManager
+ .undoCheckout(VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, vendorLicenseModelId, user);
+ vendorLicenseFacade.updateVlmLastModificationTime(vendorLicenseModelId, newVersion);
+ }
+
+ @Override
+ public void checkin(String vendorLicenseModelId, String user) {
+ vendorLicenseFacade.checkin(vendorLicenseModelId, user);
+ }
+
+ @Override
+ public void submit(String vendorLicenseModelId, String user) {
+ vendorLicenseFacade.submit(vendorLicenseModelId, user);
+ }
+
+ @Override
+ public Collection<VersionedVendorLicenseModel> listVendorLicenseModels(String versionFilter,
+ String user) {
+ Map<String, VersionInfo> idToVersionsInfo = versioningManager
+ .listEntitiesVersionInfo(VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, user,
+ VersionableEntityAction.Read);
+
+ List<VersionedVendorLicenseModel> vendorLicenseModels = new ArrayList<>();
+ for (Map.Entry<String, VersionInfo> entry : idToVersionsInfo.entrySet()) {
+ VersionInfo versionInfo = entry.getValue();
+ if (versionFilter != null && versionFilter.equals(VersionStatus.Final.name())) {
+ if (versionInfo.getLatestFinalVersion() == null) {
+ continue;
+ }
+ versionInfo.setActiveVersion(versionInfo.getLatestFinalVersion());
+ versionInfo.setStatus(VersionStatus.Final);
+ versionInfo.setLockingUser(null);
+ }
+
+ VendorLicenseModelEntity
+ vlm = vendorLicenseModelDao
+ .get(new VendorLicenseModelEntity(entry.getKey(), versionInfo.getActiveVersion()));
+ if (vlm != null) {
+ VersionedVendorLicenseModel versionedVlm = new VersionedVendorLicenseModel();
+ versionedVlm.setVendorLicenseModel(vlm);
+ versionedVlm.setVersionInfo(versionInfo);
+ vendorLicenseModels.add(versionedVlm);
+ }
+ }
+
+ sortVlmListByModificationTimeDescOrder(vendorLicenseModels);
+
+ return vendorLicenseModels;
+ }
+
+ @Override
+ public VendorLicenseModelEntity createVendorLicenseModel(
+ VendorLicenseModelEntity vendorLicenseModelEntity, String user) {
+ return vendorLicenseFacade.createVendorLicenseModel(vendorLicenseModelEntity, user);
+ }
+
+ @Override
+ public void updateVendorLicenseModel(VendorLicenseModelEntity vendorLicenseModelEntity,
+ String user) {
+ Version activeVersion =
+ getVersionInfo(vendorLicenseModelEntity.getId(), VersionableEntityAction.Write, user)
+ .getActiveVersion();
+ vendorLicenseModelEntity.setVersion(activeVersion);
+
+ String existingVendorName = vendorLicenseModelDao.get(vendorLicenseModelEntity).getVendorName();
+ UniqueValueUtil
+ .updateUniqueValue(VendorLicenseConstants.UniqueValues.VENDOR_NAME, existingVendorName,
+ vendorLicenseModelEntity.getVendorName());
+ vendorLicenseModelDao.update(vendorLicenseModelEntity);
+
+ vendorLicenseFacade
+ .updateVlmLastModificationTime(vendorLicenseModelEntity.getId(), activeVersion);
+ }
+
+ @Override
+ public VersionedVendorLicenseModel getVendorLicenseModel(String vlmId, Version version,
+ String user) {
+ return vendorLicenseFacade.getVendorLicenseModel(vlmId, version, user);
+ }
+
+ @Override
+ public void deleteVendorLicenseModel(String vlmId, String user) {
+ throw new UnsupportedOperationException("Unsupported operation for 1607 release.");
+
+ /* Version activeVersion = getVersionInfo(vlmId, VersionableEntityAction.Write, user)
+ .getActiveVersion();
+
+ vendorLicenseModelDao.delete(new VendorLicenseModelEntity(vlmId, activeVersion));
+ licenseAgreementDao.deleteAll(new LicenseAgreementEntity(vlmId, activeVersion, null));
+ featureGroupDao.deleteAll(new FeatureGroupEntity(vlmId, activeVersion, null));
+ licenseKeyGroupDao.deleteAll(new LicenseKeyGroupEntity(vlmId, activeVersion, null));
+ entitlementPoolDao.deleteAll(new EntitlementPoolEntity(vlmId, activeVersion, null));*/
+ }
+
+ @Override
+ public Collection<LicenseAgreementEntity> listLicenseAgreements(String vlmId, Version version,
+ String user) {
+ return licenseAgreementDao.list(new LicenseAgreementEntity(vlmId, VersioningUtil
+ .resolveVersion(version, getVersionInfo(vlmId, VersionableEntityAction.Read, user)), null));
+ }
+
+ @Override
+ public LicenseAgreementEntity createLicenseAgreement(LicenseAgreementEntity licenseAgreement,
+ String user) {
+ return vendorLicenseFacade.createLicenseAgreement(licenseAgreement, user);
+ }
+
+ @Override
+ public void updateLicenseAgreement(LicenseAgreementEntity licenseAgreement,
+ Set<String> addedFeatureGroupIds,
+ Set<String> removedFeatureGroupIds, String user) {
+ Version activeVersion =
+ getVersionInfo(licenseAgreement.getVendorLicenseModelId(), VersionableEntityAction.Write,
+ user).getActiveVersion();
+ licenseAgreement.setVersion(activeVersion);
+ LicenseAgreementEntity retrieved = licenseAgreementDao.get(licenseAgreement);
+ VersioningUtil
+ .validateEntityExistence(retrieved, licenseAgreement, VendorLicenseModelEntity.ENTITY_TYPE);
+ VersioningUtil.validateContainedEntitiesExistence(
+ new org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity().getEntityType(),
+ removedFeatureGroupIds, retrieved, retrieved.getFeatureGroupIds());
+ VersioningUtil.validateEntitiesExistence(addedFeatureGroupIds,
+ new org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity(
+ licenseAgreement.getVendorLicenseModelId(), activeVersion, null),
+ featureGroupDao, VendorLicenseModelEntity.ENTITY_TYPE);
+
+ UniqueValueUtil.updateUniqueValue(VendorLicenseConstants.UniqueValues.LICENSE_AGREEMENT_NAME,
+ retrieved.getName(), licenseAgreement.getName(), licenseAgreement.getVendorLicenseModelId(),
+ licenseAgreement.getVersion().toString());
+ licenseAgreementDao.updateColumnsAndDeltaFeatureGroupIds(licenseAgreement, addedFeatureGroupIds,
+ removedFeatureGroupIds);
+
+ addFeatureGroupsToLicenseAgreementRef(addedFeatureGroupIds, licenseAgreement);
+ removeFeatureGroupsToLicenseAgreementRef(removedFeatureGroupIds, licenseAgreement);
+
+ vendorLicenseFacade
+ .updateVlmLastModificationTime(licenseAgreement.getVendorLicenseModelId(), activeVersion);
+ }
+
+ @Override
+ public LicenseAgreementModel getLicenseAgreementModel(String vlmId, Version version,
+ String licenseAgreementId, String user) {
+ return vendorLicenseFacade.getLicenseAgreementModel(vlmId, version, licenseAgreementId, user);
+ }
+
+ @Override
+ public void deleteLicenseAgreement(String vlmId, String licenseAgreementId, String user) {
+ Version activeVersion =
+ getVersionInfo(vlmId, VersionableEntityAction.Write, user).getActiveVersion();
+ LicenseAgreementEntity input =
+ new LicenseAgreementEntity(vlmId, activeVersion, licenseAgreementId);
+ LicenseAgreementEntity retrieved = licenseAgreementDao.get(input);
+ VersioningUtil.validateEntityExistence(retrieved, input, VendorLicenseModelEntity.ENTITY_TYPE);
+
+ removeFeatureGroupsToLicenseAgreementRef(retrieved.getFeatureGroupIds(), retrieved);
+
+ licenseAgreementDao.delete(input);
+ UniqueValueUtil.deleteUniqueValue(VendorLicenseConstants.UniqueValues.LICENSE_AGREEMENT_NAME,
+ retrieved.getVendorLicenseModelId(), retrieved.getVersion().toString(),
+ retrieved.getName());
+
+ vendorLicenseFacade
+ .updateVlmLastModificationTime(input.getVendorLicenseModelId(), input.getVersion());
+ }
+
+ @Override
+ public Collection<org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity> listFeatureGroups(
+ String vlmId, Version version,
+ String user) {
+ return featureGroupDao
+ .list(new org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity(vlmId, VersioningUtil
+ .resolveVersion(version, getVersionInfo(vlmId, VersionableEntityAction.Read, user)),
+ null));
+ }
+
+ @Override
+ public org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity createFeatureGroup(
+ org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity featureGroup, String user) {
+ return vendorLicenseFacade.createFeatureGroup(featureGroup, user);
+ }
+
+ @Override
+ public void updateFeatureGroup(
+ org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity featureGroup,
+ Set<String> addedLicenseKeyGroups,
+ Set<String> removedLicenseKeyGroups,
+ Set<String> addedEntitlementPools,
+ Set<String> removedEntitlementPools,
+ String user) {
+ Version activeVersion =
+ getVersionInfo(featureGroup.getVendorLicenseModelId(), VersionableEntityAction.Write, user)
+ .getActiveVersion();
+ featureGroup.setVersion(activeVersion);
+
+ org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity retrieved =
+ featureGroupDao.get(featureGroup);
+ VersioningUtil
+ .validateEntityExistence(retrieved, featureGroup, VendorLicenseModelEntity.ENTITY_TYPE);
+
+ VersioningUtil.validateContainedEntitiesExistence(new LicenseKeyGroupEntity().getEntityType(),
+ removedLicenseKeyGroups, retrieved, retrieved.getLicenseKeyGroupIds());
+ VersioningUtil.validateContainedEntitiesExistence(new EntitlementPoolEntity().getEntityType(),
+ removedEntitlementPools, retrieved, retrieved.getEntitlementPoolIds());
+
+ VersioningUtil.validateEntitiesExistence(addedLicenseKeyGroups,
+ new LicenseKeyGroupEntity(featureGroup.getVendorLicenseModelId(), activeVersion, null),
+ licenseKeyGroupDao, VendorLicenseModelEntity.ENTITY_TYPE);
+ VersioningUtil.validateEntitiesExistence(addedEntitlementPools,
+ new EntitlementPoolEntity(featureGroup.getVendorLicenseModelId(), activeVersion, null),
+ entitlementPoolDao, VendorLicenseModelEntity.ENTITY_TYPE);
+ UniqueValueUtil.updateUniqueValue(VendorLicenseConstants.UniqueValues.FEATURE_GROUP_NAME,
+ retrieved.getName(), featureGroup.getName(), featureGroup.getVendorLicenseModelId(),
+ featureGroup.getVersion().toString());
+
+ addLicenseKeyGroupsToFeatureGroupsRef(addedLicenseKeyGroups, featureGroup);
+ removeLicenseKeyGroupsToFeatureGroupsRef(removedLicenseKeyGroups, featureGroup);
+ addEntitlementPoolsToFeatureGroupsRef(addedEntitlementPools, featureGroup);
+ removeEntitlementPoolsToFeatureGroupsRef(removedEntitlementPools, featureGroup);
+
+ featureGroupDao.updateFeatureGroup(featureGroup, addedEntitlementPools, removedEntitlementPools,
+ addedLicenseKeyGroups, removedLicenseKeyGroups);
+
+ vendorLicenseFacade
+ .updateVlmLastModificationTime(featureGroup.getVendorLicenseModelId(), activeVersion);
+ }
+
+ @Override
+ public FeatureGroupModel getFeatureGroupModel(
+ org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity featureGroup, String user) {
+ return vendorLicenseFacade.getFeatureGroupModel(featureGroup, user);
+ }
+
+ @Override
+ public void deleteFeatureGroup(
+ org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity featureGroup, String user) {
+ Version activeVersion =
+ getVersionInfo(featureGroup.getVendorLicenseModelId(), VersionableEntityAction.Write, user)
+ .getActiveVersion();
+ featureGroup.setVersion(activeVersion);
+ org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity retrieved =
+ featureGroupDao.get(featureGroup);
+ VersioningUtil
+ .validateEntityExistence(retrieved, featureGroup, VendorLicenseModelEntity.ENTITY_TYPE);
+
+ removeLicenseKeyGroupsToFeatureGroupsRef(retrieved.getLicenseKeyGroupIds(), featureGroup);
+ removeEntitlementPoolsToFeatureGroupsRef(retrieved.getEntitlementPoolIds(), featureGroup);
+
+ for (String licenceAgreementId : retrieved.getReferencingLicenseAgreements()) {
+ licenseAgreementDao.removeFeatureGroup(
+ new LicenseAgreementEntity(featureGroup.getVendorLicenseModelId(), activeVersion,
+ licenceAgreementId), featureGroup.getId());
+ }
+
+ featureGroupDao.delete(featureGroup);
+ UniqueValueUtil.deleteUniqueValue(VendorLicenseConstants.UniqueValues.FEATURE_GROUP_NAME,
+ retrieved.getVendorLicenseModelId(), retrieved.getVersion().toString(),
+ retrieved.getName());
+
+ vendorLicenseFacade.updateVlmLastModificationTime(featureGroup.getVendorLicenseModelId(),
+ featureGroup.getVersion());
+ }
+
+ @Override
+ public Collection<EntitlementPoolEntity> listEntitlementPools(String vlmId, Version version,
+ String user) {
+ return vendorLicenseFacade.listEntitlementPools(vlmId, version, user);
+ }
+
+ @Override
+ public EntitlementPoolEntity createEntitlementPool(EntitlementPoolEntity entitlementPool,
+ String user) {
+ return vendorLicenseFacade.createEntitlementPool(entitlementPool, user);
+ }
+
+ @Override
+ public void updateEntitlementPool(EntitlementPoolEntity entitlementPool, String user) {
+ Version activeVersion =
+ getVersionInfo(entitlementPool.getVendorLicenseModelId(), VersionableEntityAction.Write,
+ user).getActiveVersion();
+ vendorLicenseFacade
+ .updateVlmLastModificationTime(entitlementPool.getVendorLicenseModelId(), activeVersion);
+ vendorLicenseFacade.updateEntitlementPool(entitlementPool, user);
+ }
+
+ @Override
+ public EntitlementPoolEntity getEntitlementPool(EntitlementPoolEntity entitlementPool,
+ String user) {
+ entitlementPool.setVersion(VersioningUtil.resolveVersion(entitlementPool.getVersion(),
+ getVersionInfo(entitlementPool.getVendorLicenseModelId(), VersionableEntityAction.Read,
+ user)));
+
+ EntitlementPoolEntity retrieved = entitlementPoolDao.get(entitlementPool);
+ VersioningUtil
+ .validateEntityExistence(retrieved, entitlementPool, VendorLicenseModelEntity.ENTITY_TYPE);
+ return retrieved;
+ }
+
+ @Override
+ public void deleteEntitlementPool(EntitlementPoolEntity entitlementPool, String user) {
+ Version activeVersion =
+ getVersionInfo(entitlementPool.getVendorLicenseModelId(), VersionableEntityAction.Write,
+ user).getActiveVersion();
+ entitlementPool.setVersion(activeVersion);
+
+ EntitlementPoolEntity retrieved = entitlementPoolDao.get(entitlementPool);
+ VersioningUtil
+ .validateEntityExistence(retrieved, entitlementPool, VendorLicenseModelEntity.ENTITY_TYPE);
+
+ for (String referencingFeatureGroupId : retrieved.getReferencingFeatureGroups()) {
+ featureGroupDao.removeEntitlementPool(
+ new org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity(
+ entitlementPool.getVendorLicenseModelId(), activeVersion,
+ referencingFeatureGroupId), entitlementPool.getId());
+ }
+
+ entitlementPoolDao.delete(entitlementPool);
+ UniqueValueUtil.deleteUniqueValue(VendorLicenseConstants.UniqueValues.ENTITLEMENT_POOL_NAME,
+ retrieved.getVendorLicenseModelId(), retrieved.getVersion().toString(),
+ retrieved.getName());
+
+ vendorLicenseFacade.updateVlmLastModificationTime(entitlementPool.getVendorLicenseModelId(),
+ entitlementPool.getVersion());
+ }
+
+ @Override
+ public Collection<LicenseKeyGroupEntity> listLicenseKeyGroups(String vlmId, Version version,
+ String user) {
+ return vendorLicenseFacade.listLicenseKeyGroups(vlmId, version, user);
+ }
+
+ @Override
+ public LicenseKeyGroupEntity createLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup,
+ String user) {
+ return vendorLicenseFacade.createLicenseKeyGroup(licenseKeyGroup, user);
+ }
+
+ @Override
+ public void updateLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup, String user) {
+ Version activeVersion =
+ getVersionInfo(licenseKeyGroup.getVendorLicenseModelId(), VersionableEntityAction.Write,
+ user).getActiveVersion();
+ vendorLicenseFacade
+ .updateVlmLastModificationTime(licenseKeyGroup.getVendorLicenseModelId(), activeVersion);
+
+ vendorLicenseFacade.updateLicenseKeyGroup(licenseKeyGroup, user);
+ }
+
+ @Override
+ public LicenseKeyGroupEntity getLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup,
+ String user) {
+ licenseKeyGroup.setVersion(VersioningUtil.resolveVersion(licenseKeyGroup.getVersion(),
+ getVersionInfo(licenseKeyGroup.getVendorLicenseModelId(), VersionableEntityAction.Read,
+ user)));
+
+ LicenseKeyGroupEntity retrieved = licenseKeyGroupDao.get(licenseKeyGroup);
+ VersioningUtil
+ .validateEntityExistence(retrieved, licenseKeyGroup, VendorLicenseModelEntity.ENTITY_TYPE);
+ return retrieved;
+ }
+
+ @Override
+ public void deleteLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup, String user) {
+ Version activeVersion =
+ getVersionInfo(licenseKeyGroup.getVendorLicenseModelId(), VersionableEntityAction.Write,
+ user).getActiveVersion();
+ licenseKeyGroup.setVersion(activeVersion);
+
+ LicenseKeyGroupEntity retrieved = licenseKeyGroupDao.get(licenseKeyGroup);
+ VersioningUtil
+ .validateEntityExistence(retrieved, licenseKeyGroup, VendorLicenseModelEntity.ENTITY_TYPE);
+
+ licenseKeyGroupDao.delete(licenseKeyGroup);
+ for (String referencingFeatureGroupId : retrieved.getReferencingFeatureGroups()) {
+ featureGroupDao.removeLicenseKeyGroup(
+ new org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity(
+ licenseKeyGroup.getVendorLicenseModelId(), activeVersion,
+ referencingFeatureGroupId), licenseKeyGroup.getId());
+ }
+ UniqueValueUtil.deleteUniqueValue(VendorLicenseConstants.UniqueValues.LICENSE_KEY_GROUP_NAME,
+ retrieved.getVendorLicenseModelId(), retrieved.getVersion().toString(),
+ retrieved.getName());
+
+ vendorLicenseFacade.updateVlmLastModificationTime(licenseKeyGroup.getVendorLicenseModelId(),
+ licenseKeyGroup.getVersion());
+ }
+
+ private void addFeatureGroupsToLicenseAgreementRef(Set<String> featureGroupIds,
+ LicenseAgreementEntity licenseAgreement) {
+ if (featureGroupIds != null) {
+ for (String featureGroupId : featureGroupIds) {
+ featureGroupDao.addReferencingLicenseAgreement(
+ new org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity(
+ licenseAgreement.getVendorLicenseModelId(),
+ licenseAgreement.getVersion(), featureGroupId), licenseAgreement.getId());
+ }
+ }
+ }
+
+ private void removeFeatureGroupsToLicenseAgreementRef(Set<String> featureGroupIds,
+ LicenseAgreementEntity licenseAgreement) {
+ if (featureGroupIds != null) {
+ for (String featureGroupId : featureGroupIds) {
+ featureGroupDao.removeReferencingLicenseAgreement(
+ new org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity(
+ licenseAgreement.getVendorLicenseModelId(),
+ licenseAgreement.getVersion(), featureGroupId), licenseAgreement.getId());
+ }
+ }
+ }
+
+ private void addLicenseKeyGroupsToFeatureGroupsRef(Set<String> licenseKeyGroupIds,
+ org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity featureGroup) {
+ if (licenseKeyGroupIds != null) {
+ for (String licenseKeyGroupId : licenseKeyGroupIds) {
+ licenseKeyGroupDao.addReferencingFeatureGroup(
+ new LicenseKeyGroupEntity(featureGroup.getVendorLicenseModelId(),
+ featureGroup.getVersion(), licenseKeyGroupId), featureGroup.getId());
+ }
+ }
+ }
+
+ private void removeLicenseKeyGroupsToFeatureGroupsRef(Set<String> licenseKeyGroupIds,
+ org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity featureGroup) {
+ if (licenseKeyGroupIds != null) {
+ for (String licenseKeyGroupId : licenseKeyGroupIds) {
+ licenseKeyGroupDao.removeReferencingFeatureGroup(
+ new LicenseKeyGroupEntity(featureGroup.getVendorLicenseModelId(),
+ featureGroup.getVersion(), licenseKeyGroupId), featureGroup.getId());
+ }
+ }
+ }
+
+ private void addEntitlementPoolsToFeatureGroupsRef(Set<String> entitlementPoolIds,
+ org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity featureGroup) {
+ if (entitlementPoolIds != null) {
+ for (String entitlementPoolId : entitlementPoolIds) {
+ entitlementPoolDao.addReferencingFeatureGroup(
+ new EntitlementPoolEntity(featureGroup.getVendorLicenseModelId(),
+ featureGroup.getVersion(), entitlementPoolId), featureGroup.getId());
+ }
+ }
+ }
+
+ private void removeEntitlementPoolsToFeatureGroupsRef(Set<String> entitlementPoolIds,
+ org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity featureGroup) {
+ if (entitlementPoolIds != null) {
+ for (String entitlementPoolId : entitlementPoolIds) {
+ entitlementPoolDao.removeReferencingFeatureGroup(
+ new EntitlementPoolEntity(featureGroup.getVendorLicenseModelId(),
+ featureGroup.getVersion(), entitlementPoolId), featureGroup.getId());
+ }
+ }
+ }
+
+ private VersionInfo getVersionInfo(String vendorLicenseModelId, VersionableEntityAction action,
+ String user) {
+ return vendorLicenseFacade.getVersionInfo(vendorLicenseModelId, action, user);
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/ArtifactTestUtils.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/ArtifactTestUtils.java
new file mode 100644
index 0000000000..60fe06a23e
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/ArtifactTestUtils.java
@@ -0,0 +1,252 @@
+package org.openecomp.sdc.vendorlicense;
+
+import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacade;
+import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacadeFactory;
+import org.openecomp.sdc.vendorlicense.impl.VendorLicenseManagerImpl;
+import org.openecomp.sdc.vendorlicense.licenseartifacts.VendorLicenseArtifactsService;
+import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductManager;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
+import org.openecomp.sdc.vendorsoftwareproduct.impl.VendorSoftwareProductManagerImpl;
+import org.openecomp.sdc.versioning.VersioningManager;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.types.VersionInfo;
+import org.openecomp.sdc.versioning.types.VersionableEntityAction;
+import org.openecomp.core.utilities.CommonMethods;
+import org.testng.annotations.BeforeMethod;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import static org.openecomp.sdc.vendorlicense.VendorLicenseConstants.VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE;
+
+public class ArtifactTestUtils {
+
+ protected static final Version VERSION01 = new Version(0, 1);
+ protected static final String USER1 = "baseTest_TestUser1";
+ protected static VendorLicenseManager vendorLicenseManager = new VendorLicenseManagerImpl();
+ protected static VendorSoftwareProductManager vendorSoftwareProductManager = new VendorSoftwareProductManagerImpl();
+ protected static VendorLicenseFacade vendorLicenseFacade = VendorLicenseFacadeFactory.getInstance().createInterface();
+ private static final VersioningManager versioningManager = org.openecomp.sdc.versioning.VersioningManagerFactory
+ .getInstance().createInterface();
+ protected static VendorLicenseArtifactsService vendorLicenseArtifactsService = VendorLicenseArtifactServiceFactory
+ .getInstance().createInterface();
+
+ protected static Version currVersion;
+
+ protected String vlm1Id;
+ protected String vlm2Id;
+
+ protected String ep11Id;
+ protected String ep12Id;
+ protected String lkg11Id;
+ protected String lkg12Id;
+ protected String lkg13Id;
+ protected String fg11Id;
+ protected String fg12Id;
+ protected String la11Id;
+
+ protected String ep21Id;
+ protected String ep22Id;
+ protected String lkg21Id;
+ protected String lkg22Id;
+ protected String fg21Id;
+ protected String fg22Id;
+ protected String la21Id;
+ protected String la22Id;
+
+ protected org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity fg11;
+ protected org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity fg12;
+ protected org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity ep11;
+ protected org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity ep12;
+ protected org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity lkg11;
+ protected org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity lkg12;
+ protected org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity lkg13;
+
+ protected org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity fg21;
+ protected org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity fg22;
+ protected org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity ep21;
+ protected org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity ep22;
+ protected org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity lkg21;
+ protected org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity lkg22;
+
+ protected VspDetails vspDetails;
+ protected VspDetails vsp2;
+
+
+ @BeforeMethod
+ public void setUp() {
+ vlm1Id = vendorLicenseFacade.createVendorLicenseModel(VendorLicenseModelTest.createVendorLicenseModel("vlm1 name" + CommonMethods.nextUuId(), "vlm1Id desc", "icon1"), USER1).getId();
+ vlm2Id = vendorLicenseFacade.createVendorLicenseModel(VendorLicenseModelTest.createVendorLicenseModel("vlm2 name" + CommonMethods.nextUuId(), "vlm2Id desc", "icon2"), USER1).getId();
+
+
+ Set<org.openecomp.sdc.vendorlicense.dao.types.OperationalScope> opScopeChoices = new HashSet<>();
+ opScopeChoices.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Other);
+ opScopeChoices.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Data_Center);
+ opScopeChoices.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Network_Wide);
+
+ ep11 = EntitlementPoolTest.createEntitlementPool(vlm1Id, VERSION01, "EP1_" + CommonMethods.nextUuId(), "EP1 dec", 80, org.openecomp.sdc.vendorlicense.dao.types.ThresholdUnit.Absolute, org.openecomp.sdc.vendorlicense.dao.types.EntitlementMetric.Core, null, "inc1", org.openecomp.sdc.vendorlicense.dao.types.AggregationFunction.Other, "agg func1", opScopeChoices, null, org.openecomp.sdc.vendorlicense.dao.types.EntitlementTime.Hour, null, "sku1");
+ ep11Id = vendorLicenseManager.createEntitlementPool(ep11, USER1).getId();
+ ep12 = EntitlementPoolTest.createEntitlementPool(vlm1Id, VERSION01, "EP2_" + CommonMethods.nextUuId(), "EP2 dec", 70, org.openecomp.sdc.vendorlicense.dao.types.ThresholdUnit.Absolute, org.openecomp.sdc.vendorlicense.dao.types.EntitlementMetric.Other, "e metric2", "inc2", org.openecomp.sdc.vendorlicense.dao.types.AggregationFunction.Average, null, opScopeChoices, "op scope2", org.openecomp.sdc.vendorlicense.dao.types.EntitlementTime.Other, "time2", "sku2");
+ ep12Id = vendorLicenseManager.createEntitlementPool(ep12, USER1).getId();
+
+ Set<org.openecomp.sdc.vendorlicense.dao.types.OperationalScope> opScopeChoicesLKG = new HashSet<>();
+ opScopeChoicesLKG.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.CPU);
+ opScopeChoicesLKG.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.VM);
+ opScopeChoicesLKG.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Availability_Zone);
+ opScopeChoicesLKG.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Data_Center);
+
+ lkg11 = LicenseKeyGroupTest.createLicenseKeyGroup(vlm1Id, VERSION01, "LKG1", "LKG1 dec", org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyType.One_Time, new org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther<>(opScopeChoicesLKG, null));
+ lkg11Id = vendorLicenseManager.createLicenseKeyGroup(lkg11, USER1).getId();
+ lkg11.setId(lkg11Id);
+
+ lkg12 = LicenseKeyGroupTest.createLicenseKeyGroup(vlm1Id, VERSION01, "LKG2", "LKG2 dec", org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyType.Unique, new org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther<>(opScopeChoicesLKG, null));
+ lkg12Id = vendorLicenseManager.createLicenseKeyGroup(lkg12, USER1).getId();
+ lkg12.setId(lkg11Id);
+
+ lkg13 = LicenseKeyGroupTest.createLicenseKeyGroup(vlm1Id, VERSION01, "LKG3", "LKG3 dec", org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyType.Universal, new org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther<>(opScopeChoicesLKG, null));
+ lkg13Id = vendorLicenseManager.createLicenseKeyGroup(lkg13, USER1).getId();
+ lkg13.setId(lkg13Id);
+
+ fg11 = LicenseAgreementTest.createFeatureGroup(vlm1Id, VERSION01, "fg11", "FG1", "FG1 desc", CommonMethods.toSingleElementSet(ep11Id), CommonMethods.toSingleElementSet(lkg11Id));
+ fg11Id = vendorLicenseManager.createFeatureGroup(fg11, USER1).getId();
+
+ fg12 = LicenseAgreementTest.createFeatureGroup(vlm1Id, VERSION01, "fg2", "FG2", "FG2 desc", CommonMethods.toSingleElementSet(ep12Id), CommonMethods.toSingleElementSet(lkg12Id));
+ fg12Id = vendorLicenseManager.createFeatureGroup(fg12, USER1).getId();
+
+
+ String requirementsAndConstrains1 = "Requirements And Constraints1";
+ org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity
+ la1 = LicenseAgreementTest.createLicenseAgreement(vlm1Id, VERSION01, null, "LA1", "LA1 desc", requirementsAndConstrains1, new org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther<>(
+ org.openecomp.sdc.vendorlicense.dao.types.LicenseTerm.Unlimited, null), fg11Id);
+ la11Id = vendorLicenseManager.createLicenseAgreement(la1, USER1).getId();
+
+ List<String> fgs = new ArrayList<>();
+ fgs.add(fg11Id);
+ createTwoFinalVersionsForVLM(vlm1Id);
+ VersionInfo versionInfo = vendorLicenseFacade.getVersionInfo(vlm1Id, VersionableEntityAction.Read, "");
+ vspDetails = createVspDetails(null, null, "VSP1_" + CommonMethods.nextUuId(), "Test-vsp", "vendorName", vlm1Id, "icon", "category", "subCategory", la11Id, fgs);
+
+ List<Version> finalVersions = versionInfo.getFinalVersions();
+ Version finalVersion = finalVersions.get(1);
+
+ vspDetails.setVlmVersion(finalVersion);
+
+ vspDetails = vendorSoftwareProductManager.createNewVsp(vspDetails, USER1);
+
+ }
+
+ private void createTwoFinalVersionsForVLM(String vlm1Id) {
+ versioningManager.checkin(VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, vlm1Id, USER1, "desc1");
+ versioningManager.checkout(VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, vlm1Id, USER1);
+ versioningManager.checkin(VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, vlm1Id, USER1, "desc1");
+ vendorLicenseFacade.submit(vlm1Id, USER1);
+ versioningManager.checkout(VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, vlm1Id, USER1);
+ versioningManager.checkin(VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, vlm1Id, USER1, "desc2");
+ vendorLicenseFacade.submit(vlm1Id, USER1);
+
+ }
+
+ protected void createThirdFinalVersionForVLMChangeEpLKGInSome(String vlm1Id, org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity ep, org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity lkg) {
+ versioningManager.checkout(VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, vlm1Id, USER1);
+ vendorLicenseManager.updateEntitlementPool(ep, USER1);
+ vendorLicenseManager.updateLicenseKeyGroup(lkg, USER1);
+ versioningManager.checkin(VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, vlm1Id, USER1, "desc1");
+ vendorLicenseFacade.submit(vlm1Id, USER1);
+
+ }
+
+
+ protected void setVlm2FirstVersion() {
+ Set<org.openecomp.sdc.vendorlicense.dao.types.OperationalScope> opScopeChoices = new HashSet<>();
+ opScopeChoices.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Other);
+ opScopeChoices.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Data_Center);
+ opScopeChoices.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Network_Wide);
+
+ Set<org.openecomp.sdc.vendorlicense.dao.types.OperationalScope> opScopeChoicesLKG = new HashSet<>();
+ opScopeChoicesLKG.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.CPU);
+ opScopeChoicesLKG.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.VM);
+ opScopeChoicesLKG.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Availability_Zone);
+ opScopeChoicesLKG.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Data_Center);
+
+ ep21 = EntitlementPoolTest.createEntitlementPool(vlm2Id, VERSION01, "EP21", "EP21 dec", 80, org.openecomp.sdc.vendorlicense.dao.types.ThresholdUnit.Absolute, org.openecomp.sdc.vendorlicense.dao.types.EntitlementMetric.Core, null, "inc21", org.openecomp.sdc.vendorlicense.dao.types.AggregationFunction.Other, "agg func21", opScopeChoices, null, org.openecomp.sdc.vendorlicense.dao.types.EntitlementTime.Hour, null, "sku21");
+ ep21Id = vendorLicenseManager.createEntitlementPool(ep21, USER1).getId();
+
+ lkg21 = LicenseKeyGroupTest.createLicenseKeyGroup(vlm2Id, VERSION01, "LKG21", "LKG21 dec", org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyType.One_Time, new org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther<>(opScopeChoicesLKG, null));
+ lkg21Id = vendorLicenseManager.createLicenseKeyGroup(lkg21, USER1).getId();
+ lkg21.setId(lkg21Id);
+
+ fg21 = LicenseAgreementTest.createFeatureGroup(vlm2Id, VERSION01, "fg21", "FG21", "FG21 desc", CommonMethods.toSingleElementSet(ep21Id), CommonMethods.toSingleElementSet(lkg21Id));
+ fg21Id = vendorLicenseManager.createFeatureGroup(fg21, USER1).getId();
+
+ String requirementsAndConstrains1 = "Requirements And Constraints21";
+ org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity
+ la2 = LicenseAgreementTest.createLicenseAgreement(vlm2Id, VERSION01, null, "LA21", "LA21 desc", requirementsAndConstrains1, new org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther<>(
+ org.openecomp.sdc.vendorlicense.dao.types.LicenseTerm.Unlimited, null), fg21Id);
+ la21Id = vendorLicenseManager.createLicenseAgreement(la2, USER1).getId();
+
+// setValuesForVlm(VERSION01, ep21, ep21Id, lkg21, lkg21Id, fg21, fg21Id, la21Id, 1);
+
+ vendorLicenseManager.checkin(vlm2Id, USER1);
+ currVersion = versioningManager.submit(VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, vlm2Id, USER1, null);
+
+ List<String> fgs = new ArrayList<>();
+ fgs.add(fg21Id);
+ vsp2 = createVspDetails(null, null, "VSP2_" + CommonMethods.nextUuId(), "Test-vsp", "vendorName", vlm2Id, "icon", "category", "subCategory", la21Id, fgs);
+ vsp2 = vendorSoftwareProductManager.createNewVsp(vsp2, USER1);
+ }
+
+ protected void setVlm2SecondVersion() {
+ vendorLicenseManager.checkout(vlm2Id, USER1);
+
+ Set<org.openecomp.sdc.vendorlicense.dao.types.OperationalScope> opScopeChoices = new HashSet<>();
+ opScopeChoices.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Other);
+ opScopeChoices.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Data_Center);
+ opScopeChoices.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Network_Wide);
+
+ Set<org.openecomp.sdc.vendorlicense.dao.types.OperationalScope> opScopeChoicesLKG = new HashSet<>();
+ opScopeChoicesLKG.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.CPU);
+ opScopeChoicesLKG.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.VM);
+ opScopeChoicesLKG.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Availability_Zone);
+ opScopeChoicesLKG.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Data_Center);
+
+ ep22 = EntitlementPoolTest.createEntitlementPool(vlm2Id, currVersion, "EP22", "EP22 dec", 80, org.openecomp.sdc.vendorlicense.dao.types.ThresholdUnit.Absolute, org.openecomp.sdc.vendorlicense.dao.types.EntitlementMetric.Core, null, "inc22", org.openecomp.sdc.vendorlicense.dao.types.AggregationFunction.Other, "agg func22", opScopeChoices, null, org.openecomp.sdc.vendorlicense.dao.types.EntitlementTime.Hour, null, "sku22");
+ ep22Id = vendorLicenseManager.createEntitlementPool(ep22, USER1).getId();
+
+ lkg22 = LicenseKeyGroupTest.createLicenseKeyGroup(vlm2Id, currVersion, "LKG22", "LKG22 dec", org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyType.One_Time, new org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther<>(opScopeChoicesLKG, null));
+ lkg22Id = vendorLicenseManager.createLicenseKeyGroup(lkg22, USER1).getId();
+ lkg22.setId(lkg22Id);
+
+ fg22 = LicenseAgreementTest.createFeatureGroup(vlm2Id, currVersion, "fg22", "FG22", "FG22 desc", CommonMethods.toSingleElementSet(ep22Id), CommonMethods.toSingleElementSet(lkg22Id));
+ fg22Id = vendorLicenseManager.createFeatureGroup(fg22, USER1).getId();
+
+ String requirementsAndConstrains1 = "Requirements And Constraints22";
+ org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity
+ la2 = LicenseAgreementTest.createLicenseAgreement(vlm2Id, currVersion, null, "LA22", "LA22 desc", requirementsAndConstrains1, new org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther<>(
+ org.openecomp.sdc.vendorlicense.dao.types.LicenseTerm.Unlimited, null), fg22Id);
+ la22Id = vendorLicenseManager.createLicenseAgreement(la2, USER1).getId();
+
+// setValuesForVlm(currVersion, ep22, ep22Id, lkg22, lkg22Id, fg22, fg22Id, la22Id, 2);
+
+ vendorLicenseManager.checkin(vlm2Id, USER1);
+ currVersion = versioningManager.submit(VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, vlm2Id, USER1, null);
+ }
+
+ protected static VspDetails createVspDetails(String id, Version version, String name, String desc, String vendorName, String vlm, String icon, String category, String subCategory, String licenseAgreement, List<String> featureGroups) {
+ VspDetails vspDetails = new VspDetails(id, version);
+ vspDetails.setName(name);
+ vspDetails.setDescription(desc);
+ vspDetails.setIcon(icon);
+ vspDetails.setCategory(category);
+ vspDetails.setSubCategory(subCategory);
+ vspDetails.setVendorName(vendorName);
+ vspDetails.setVendorId(vlm);
+ vspDetails.setLicenseAgreement(licenseAgreement);
+ vspDetails.setFeatureGroups(featureGroups);
+ return vspDetails;
+ }
+
+
+}
+
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/EntitlementPoolTest.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/EntitlementPoolTest.java
new file mode 100644
index 0000000000..0c05fee10d
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/EntitlementPoolTest.java
@@ -0,0 +1,275 @@
+package org.openecomp.sdc.vendorlicense;
+
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.vendorlicense.dao.EntitlementPoolDao;
+import org.openecomp.sdc.vendorlicense.dao.EntitlementPoolDaoFactory;
+import org.openecomp.sdc.vendorlicense.impl.VendorLicenseManagerImpl;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.errors.VersioningErrorCodes;
+import org.openecomp.core.util.UniqueValueUtil;
+import org.openecomp.core.utilities.CommonMethods;
+
+import org.openecomp.sdc.vendorlicense.dao.types.AggregationFunction;
+import org.openecomp.sdc.vendorlicense.dao.types.EntitlementMetric;
+import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.EntitlementTime;
+import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope;
+import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+public class EntitlementPoolTest {
+
+ private static final String USER1 = "epTestUser1";
+ private static final String USER2 = "epTestUser2";
+ private static final String EP1_V01_DESC = "EP1 desc";
+ private static final Version VERSION01 = new Version(0, 1);
+ private static final Version VERSION03 = new Version(0, 3);
+ private static final String EP1_NAME = "EP1 name";
+ private static final String EP2_NAME = "EP2 name";
+
+ private static VendorLicenseManager vendorLicenseManager = new VendorLicenseManagerImpl();
+ private static EntitlementPoolDao entitlementPoolDao;
+
+ private static String vlm1Id;
+ private static String vlm2Id;
+ private static String ep1Id;
+ private static String ep2Id;
+
+ public static EntitlementPoolEntity createEntitlementPool(String vlmId, Version version,
+ String name, String desc, int threshold,
+ org.openecomp.sdc.vendorlicense.dao.types.ThresholdUnit thresholdUnit,
+ EntitlementMetric entitlementMetricChoice,
+ String entitlementMetricOther,
+ String increments,
+ AggregationFunction aggregationFunctionChoice,
+ String aggregationFunctionOther,
+ Set<OperationalScope> operationalScopeChoices,
+ String operationalScopeOther,
+ EntitlementTime timeChoice,
+ String timeOther, String sku) {
+ EntitlementPoolEntity entitlementPool = new EntitlementPoolEntity();
+ entitlementPool.setVendorLicenseModelId(vlmId);
+ entitlementPool.setVersion(version);
+ entitlementPool.setName(name);
+ entitlementPool.setDescription(desc);
+ entitlementPool.setThresholdValue(threshold);
+ entitlementPool.setThresholdUnit(thresholdUnit);
+ entitlementPool
+ .setEntitlementMetric(new org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther<>(entitlementMetricChoice, entitlementMetricOther));
+ entitlementPool.setIncrements(increments);
+ entitlementPool.setAggregationFunction(
+ new org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther<>(aggregationFunctionChoice, aggregationFunctionOther));
+ entitlementPool.setOperationalScope(
+ new org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther<>(operationalScopeChoices, operationalScopeOther));
+ entitlementPool.setTime(new org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther<>(timeChoice, timeOther));
+ entitlementPool.setManufacturerReferenceNumber(sku);
+ return entitlementPool;
+ }
+
+ private static void assertEntitlementPoolsEquals(EntitlementPoolEntity actual,
+ EntitlementPoolEntity expected) {
+ Assert.assertEquals(actual.getVendorLicenseModelId(), expected.getVendorLicenseModelId());
+ Assert.assertEquals(actual.getVersion(), expected.getVersion());
+ Assert.assertEquals(actual.getId(), expected.getId());
+ Assert.assertEquals(actual.getName(), expected.getName());
+ Assert.assertEquals(actual.getDescription(), expected.getDescription());
+ Assert.assertEquals(actual.getThresholdValue(), expected.getThresholdValue());
+ Assert.assertEquals(actual.getThresholdUnit(), expected.getThresholdUnit());
+ Assert.assertEquals(actual.getEntitlementMetric(), expected.getEntitlementMetric());
+ Assert.assertEquals(actual.getIncrements(), expected.getIncrements());
+ Assert.assertEquals(actual.getAggregationFunction(), expected.getAggregationFunction());
+ Assert.assertEquals(actual.getOperationalScope(), expected.getOperationalScope());
+ Assert.assertEquals(actual.getTime(), expected.getTime());
+ Assert.assertEquals(actual.getManufacturerReferenceNumber(),
+ expected.getManufacturerReferenceNumber());
+ }
+
+ @BeforeClass
+ private void init() {
+ entitlementPoolDao = EntitlementPoolDaoFactory.getInstance().createInterface();
+ vlm1Id = vendorLicenseManager.createVendorLicenseModel(VendorLicenseModelTest
+ .createVendorLicenseModel("vendor1 name " + CommonMethods.nextUuId(), "vlm1 dec", "icon1"),
+ USER1).getId();
+ vlm2Id = vendorLicenseManager.createVendorLicenseModel(VendorLicenseModelTest
+ .createVendorLicenseModel("vendor2 name " + CommonMethods.nextUuId(), "vlm2 dec", "icon2"),
+ USER1).getId();
+ }
+
+ @Test
+ public void emptyListTest() {
+ Collection<EntitlementPoolEntity> entitlementPools =
+ vendorLicenseManager.listEntitlementPools(vlm1Id, null, USER1);
+ Assert.assertEquals(entitlementPools.size(), 0);
+ }
+
+ @Test(dependsOnMethods = "emptyListTest")
+ public void createTest() {
+ ep1Id = testCreate(vlm1Id, EP1_NAME);
+
+ Set<OperationalScope> opScopeChoices;
+ opScopeChoices = new HashSet<>();
+ opScopeChoices.add(OperationalScope.Core);
+ opScopeChoices.add(OperationalScope.CPU);
+ opScopeChoices.add(OperationalScope.Network_Wide);
+ EntitlementPoolEntity ep2 =
+ createEntitlementPool(vlm1Id, null, EP2_NAME, "EP2 dec", 70, org.openecomp.sdc.vendorlicense.dao.types.ThresholdUnit.Absolute,
+ EntitlementMetric.Other, "e metric2", "inc2", AggregationFunction.Average, null,
+ opScopeChoices, null, EntitlementTime.Other, "time2", "sku2");
+ ep2Id = vendorLicenseManager.createEntitlementPool(ep2, USER1).getId();
+ ep2.setId(ep2Id);
+ }
+
+ private String testCreate(String vlmId, String name) {
+ Set<OperationalScope> opScopeChoices = new HashSet<>();
+ opScopeChoices.add(OperationalScope.Other);
+ EntitlementPoolEntity ep1 =
+ createEntitlementPool(vlmId, null, name, EP1_V01_DESC, 80, org.openecomp.sdc.vendorlicense.dao.types.ThresholdUnit.Percentage,
+ EntitlementMetric.Core, null, "inc1", AggregationFunction.Other, "agg func1",
+ opScopeChoices, "op scope1", EntitlementTime.Other, "time1", "sku1");
+ String ep1Id = vendorLicenseManager.createEntitlementPool(ep1, USER1).getId();
+ ep1.setId(ep1Id);
+
+ EntitlementPoolEntity loadedEp1 = entitlementPoolDao.get(ep1);
+ Assert.assertTrue(loadedEp1.equals(ep1));
+ return ep1Id;
+ }
+
+ @Test(dependsOnMethods = {"createTest"})
+ public void testCreateWithExistingName_negative() {
+ testCreateWithExistingName_negative(vlm1Id, EP1_NAME);
+ }
+
+ @Test(dependsOnMethods = {"createTest"})
+ public void testCreateWithExistingNameUnderOtherVlm() {
+ testCreate(vlm2Id, EP1_NAME);
+ }
+
+ @Test(dependsOnMethods = {"testCreateWithExistingName_negative"})
+ public void updateAndGetTest() {
+ EntitlementPoolEntity emptyEp1 = new EntitlementPoolEntity(vlm1Id, VERSION01, ep1Id);
+
+ EntitlementPoolEntity ep1 = entitlementPoolDao.get(emptyEp1);
+ ep1.setEntitlementMetric(new org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther<>(EntitlementMetric.Other, "e metric1 updated"));
+ ep1.setAggregationFunction(new org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther<>(AggregationFunction.Other, "agg func1 updated"));
+
+ vendorLicenseManager.updateEntitlementPool(ep1, USER1);
+
+ EntitlementPoolEntity loadedEp1 = vendorLicenseManager.getEntitlementPool(emptyEp1, USER1);
+ assertEntitlementPoolsEquals(loadedEp1, ep1);
+ }
+
+ @Test(dependsOnMethods = {"updateAndGetTest"})
+ public void testGetNonExistingVersion_negative() {
+ try {
+ vendorLicenseManager
+ .getEntitlementPool(new EntitlementPoolEntity(vlm1Id, new Version(48, 83), ep1Id), USER1);
+ Assert.assertTrue(false);
+ } catch (CoreException e) {
+ Assert.assertEquals(e.code().id(), VersioningErrorCodes.REQUESTED_VERSION_INVALID);
+ }
+ }
+
+ @Test(dependsOnMethods = {"updateAndGetTest"})
+ public void testGetOtherUserCandidateVersion_negative() {
+ vendorLicenseManager.checkin(vlm1Id, USER1);
+ vendorLicenseManager.checkout(vlm1Id, USER2);
+ try {
+ vendorLicenseManager
+ .getEntitlementPool(new EntitlementPoolEntity(vlm1Id, new Version(0, 2), ep1Id), USER1);
+ Assert.assertTrue(false);
+ } catch (CoreException e) {
+ Assert.assertEquals(e.code().id(), VersioningErrorCodes.REQUESTED_VERSION_INVALID);
+ }
+ }
+
+ @Test(dependsOnMethods = {"testGetOtherUserCandidateVersion_negative"})
+ public void testGetCandidateVersion() {
+ EntitlementPoolEntity ep = new EntitlementPoolEntity(vlm1Id, new Version(0, 2), ep1Id);
+ ep.setDescription("updated!");
+ vendorLicenseManager.updateEntitlementPool(ep, USER2);
+
+ EntitlementPoolEntity actualEp = vendorLicenseManager.getEntitlementPool(ep, USER2);
+ EntitlementPoolEntity expectedEp = entitlementPoolDao.get(ep);
+
+ Assert.assertEquals(actualEp.getDescription(), ep.getDescription());
+ assertEntitlementPoolsEquals(actualEp, expectedEp);
+ }
+
+ @Test(dependsOnMethods = {"testGetCandidateVersion"})
+ public void testGetOldVersion() {
+ vendorLicenseManager.checkin(vlm1Id, USER2);
+ EntitlementPoolEntity actualEp = vendorLicenseManager
+ .getEntitlementPool(new EntitlementPoolEntity(vlm1Id, new Version(0, 1), ep1Id), USER2);
+ Assert.assertEquals(actualEp.getDescription(), EP1_V01_DESC);
+ }
+
+ @Test(dependsOnMethods = {"testGetOldVersion"})
+ public void listTest() {
+ Collection<EntitlementPoolEntity> loadedEps =
+ vendorLicenseManager.listEntitlementPools(vlm1Id, null, USER1);
+ Assert.assertEquals(loadedEps.size(), 2);
+
+ int existingCounter = 0;
+ for (EntitlementPoolEntity loadedEp : loadedEps) {
+ if (ep2Id.equals(loadedEp.getId()) || ep1Id.equals(loadedEp.getId())) {
+ existingCounter++;
+ }
+ }
+
+ Assert.assertEquals(existingCounter, 2);
+ }
+
+ @Test(dependsOnMethods = {"listTest"})
+ public void deleteTest() {
+ vendorLicenseManager.checkout(vlm1Id, USER1);
+ EntitlementPoolEntity emptyEp1 = new EntitlementPoolEntity(vlm1Id, null, ep1Id);
+ vendorLicenseManager.deleteEntitlementPool(emptyEp1, USER1);
+
+ emptyEp1.setVersion(VERSION03);
+ EntitlementPoolEntity loadedEp1 = entitlementPoolDao.get(emptyEp1);
+ Assert.assertEquals(loadedEp1, null);
+
+ Collection<EntitlementPoolEntity> loadedEps =
+ entitlementPoolDao.list(new EntitlementPoolEntity(vlm1Id, VERSION03, null));
+ Assert.assertEquals(loadedEps.size(), 1);
+ Assert.assertEquals(loadedEps.iterator().next().getId(), ep2Id);
+ }
+
+ @Test(dependsOnMethods = "deleteTest")
+ public void listOldVersionTest() {
+ Collection<EntitlementPoolEntity> loadedEps =
+ vendorLicenseManager.listEntitlementPools(vlm1Id, VERSION01, USER1);
+ Assert.assertEquals(loadedEps.size(), 2);
+ }
+
+ @Test(dependsOnMethods = "deleteTest")
+ public void testCreateWithRemovedName() {
+ testCreate(vlm1Id, EP1_NAME);
+ }
+
+ @Test(dependsOnMethods = "deleteTest")
+ public void testCreateWithExistingNameAfterCheckout_negative() {
+ testCreateWithExistingName_negative(vlm1Id, EP2_NAME);
+ }
+
+ private void testCreateWithExistingName_negative(String vlmId, String epName) {
+ try {
+ EntitlementPoolEntity ep1 =
+ createEntitlementPool(vlmId, null, epName, EP1_V01_DESC, 80, org.openecomp.sdc.vendorlicense.dao.types.ThresholdUnit.Percentage,
+ EntitlementMetric.Core, null, "inc1", AggregationFunction.Other, "agg func1",
+ Collections.singleton(OperationalScope.Other), "op scope1", EntitlementTime.Other,
+ "time1", "sku1");
+ vendorLicenseManager.createEntitlementPool(ep1, USER1).getId();
+ Assert.fail();
+ } catch (CoreException e) {
+ Assert.assertEquals(e.code().id(), UniqueValueUtil.UNIQUE_VALUE_VIOLATION);
+ }
+ }
+
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/FeatureGroupTest.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/FeatureGroupTest.java
new file mode 100644
index 0000000000..c2381dd2f3
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/FeatureGroupTest.java
@@ -0,0 +1,202 @@
+package org.openecomp.sdc.vendorlicense;
+
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacade;
+import org.openecomp.sdc.vendorlicense.impl.VendorLicenseManagerImpl;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.core.util.UniqueValueUtil;
+import org.openecomp.core.utilities.CommonMethods;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+import java.util.*;
+
+public class FeatureGroupTest {
+ protected static final Version VERSION01 = new Version(0, 1);
+ protected static final String USER1 = "FeatureGroupTest_User1";
+ protected static VendorLicenseManager vendorLicenseManager = new VendorLicenseManagerImpl();
+ protected static VendorLicenseFacade vendorLicenseFacade = org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacadeFactory
+ .getInstance().createInterface();
+
+
+ @Test
+ public void testListFeatureGroups() throws Exception {
+ String vlmId = vendorLicenseFacade.createVendorLicenseModel(VendorLicenseModelTest.createVendorLicenseModel("vlmId_" + CommonMethods.nextUuId(), "vlm2Id desc", "icon2"), USER1).getId();
+ org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity
+ fg22 = LicenseAgreementTest.createFeatureGroup(vlmId, VERSION01, "fg2", "FG2", "FG2 desc", null, null);
+ String fg22Id = vendorLicenseManager.createFeatureGroup(fg22, USER1).getId();
+ org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity
+ fg33 = LicenseAgreementTest.createFeatureGroup(vlmId, VERSION01, "fg3", "FG3", "FG3 desc", null, null);
+ String fg33Id = vendorLicenseManager.createFeatureGroup(fg33, USER1).getId();
+
+ Collection<org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity> featureGroupEntities = vendorLicenseManager.listFeatureGroups(vlmId, null, USER1);
+
+ Assert.assertEquals(featureGroupEntities.size(), 2);
+ Set<String> actualIds = new HashSet<>();
+ for (org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity featureGroupEntity : featureGroupEntities) {
+ actualIds.add(featureGroupEntity.getId());
+ }
+
+ Set<String> expectedIds = new HashSet<>();
+ expectedIds.add(fg22Id);
+ expectedIds.add(fg33Id);
+ for (String id : actualIds) {
+ Assert.assertTrue(expectedIds.contains(id));
+ }
+
+ }
+
+ @Test
+ public void testCreateFeatureGroup() throws Exception {
+ String testName = "testCreateFeatureGroup";
+ String vlmId = vendorLicenseFacade.createVendorLicenseModel(VendorLicenseModelTest.createVendorLicenseModel(testName + CommonMethods.nextUuId(), testName, "icon1"), USER1).getId();
+ Set<org.openecomp.sdc.vendorlicense.dao.types.OperationalScope> opScopeChoices = new HashSet<>();
+ opScopeChoices.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Other);
+ opScopeChoices.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Data_Center);
+ opScopeChoices.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Network_Wide);
+ org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity
+ ep = EntitlementPoolTest.createEntitlementPool(vlmId, VERSION01, "EP1" + CommonMethods.nextUuId(), "EP1 dec", 80, org.openecomp.sdc.vendorlicense.dao.types.ThresholdUnit.Absolute, org.openecomp.sdc.vendorlicense.dao.types.EntitlementMetric.Core, null, "inc1", org.openecomp.sdc.vendorlicense.dao.types.AggregationFunction.Other, "agg func1", opScopeChoices, null, org.openecomp.sdc.vendorlicense.dao.types.EntitlementTime.Hour, null, "sku1");
+ String epId = vendorLicenseManager.createEntitlementPool(ep, USER1).getId();
+ Set<org.openecomp.sdc.vendorlicense.dao.types.OperationalScope> opScopeChoicesLKG = new HashSet<>();
+ opScopeChoicesLKG.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.CPU);
+ opScopeChoicesLKG.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.VM);
+ opScopeChoicesLKG.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Availability_Zone);
+ opScopeChoicesLKG.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Data_Center);
+
+ org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity
+ lkg = LicenseKeyGroupTest.createLicenseKeyGroup(vlmId, VERSION01, "LKG1", "LKG1 dec", org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyType.One_Time, new org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther<>(opScopeChoicesLKG, null));
+ String lkgId = vendorLicenseManager.createLicenseKeyGroup(lkg, USER1).getId();
+ lkg.setId(lkgId);
+ org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity
+ fg1 = createFGForTest(vlmId, "created" + CommonMethods.nextUuId(), Collections.singleton(epId), Collections.singleton(lkgId));
+ org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity
+ fg1FromDB = vendorLicenseManager.getFeatureGroupModel(fg1, USER1).getFeatureGroup();
+ Assert.assertTrue(fg1FromDB.equals(fg1));
+ }
+
+
+ @Test
+ public void testCreateWithExistingName_negative() {
+ String testName = "createExistingName";
+ String vlmId = vendorLicenseFacade.createVendorLicenseModel(VendorLicenseModelTest.createVendorLicenseModel(testName + CommonMethods.nextUuId(), testName, "icon1"), USER1).getId();
+ createFGForTest(vlmId, "created", Collections.emptySet(), Collections.emptySet());
+ try {
+ org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity
+ created = LicenseAgreementTest.createFeatureGroup(vlmId, null, "created", "created", "created desc", Collections.emptySet(), Collections.emptySet());
+ vendorLicenseManager.createFeatureGroup(created, USER1);
+ Assert.fail();
+ } catch (CoreException e) {
+ Assert.assertEquals(e.code().id(), UniqueValueUtil.UNIQUE_VALUE_VIOLATION);
+ }
+ }
+
+ private org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity createFGForTest(String vlmId, String fgName, Set<String> epIds, Set<String> lkgIds) {
+ org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity
+ created = LicenseAgreementTest.createFeatureGroup(vlmId, null, null, fgName, "created desc", epIds, lkgIds);
+ return vendorLicenseManager.createFeatureGroup(created, USER1);
+ }
+
+ @Test
+ public void testUpdateFeatureGroup_addEP_andGET() throws Exception {
+ String testName = "testUpdateFeatureGroup_addEP_andGET";
+ String vlmId = vendorLicenseFacade.createVendorLicenseModel(VendorLicenseModelTest.createVendorLicenseModel(testName + CommonMethods.nextUuId(), testName, "icon1"), USER1).getId();
+
+ org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity
+ fg5 = LicenseAgreementTest.createFeatureGroup(vlmId, VERSION01, "id" + CommonMethods.nextUuId(), "created" + CommonMethods.nextUuId(), "created desc", null, null);
+ vendorLicenseManager.createFeatureGroup(fg5, USER1).getId();
+
+
+ Set<org.openecomp.sdc.vendorlicense.dao.types.OperationalScope> opScopeChoices = new HashSet<>();
+ opScopeChoices.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Other);
+ opScopeChoices.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Data_Center);
+
+ org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity
+ epToAdd = EntitlementPoolTest.createEntitlementPool(vlmId, VERSION01, "epToAdd", "epToAdd dec", 80, org.openecomp.sdc.vendorlicense.dao.types.ThresholdUnit.Absolute, org.openecomp.sdc.vendorlicense.dao.types.EntitlementMetric.Core, null, "inc1", org.openecomp.sdc.vendorlicense.dao.types.AggregationFunction.Other, "agg func1", opScopeChoices, null, org.openecomp.sdc.vendorlicense.dao.types.EntitlementTime.Hour, null, "sku1");
+ String epToAddId = vendorLicenseManager.createEntitlementPool(epToAdd, USER1).getId();
+
+ vendorLicenseManager.updateFeatureGroup(fg5, null, null, CommonMethods.toSingleElementSet(epToAddId), null, USER1);
+ org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupModel
+ updatedFG = vendorLicenseManager.getFeatureGroupModel(fg5, USER1);
+ Set<org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity> updatedEPs = updatedFG.getEntitlementPools();
+
+ epToAdd.setReferencingFeatureGroups(CommonMethods.toSingleElementSet(fg5.getId()));
+
+ Assert.assertEquals(updatedEPs.size(), 1);
+ for (org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity updatedEP : updatedEPs) {
+ Assert.assertTrue(updatedEP.getReferencingFeatureGroups().contains(fg5.getId()));
+ Assert.assertEquals(updatedEP.getId(), epToAddId);
+ }
+ }
+
+ @Test
+ public void testUpdateFeatureGroup_removeLKG_andGET() throws Exception {
+ String testName = "testUpdateFeatureGroup_removeLKG_andGET";
+ String vlmId = vendorLicenseFacade.createVendorLicenseModel(VendorLicenseModelTest.createVendorLicenseModel(testName + CommonMethods.nextUuId(), testName, "icon1"), USER1).getId();
+
+ Set<org.openecomp.sdc.vendorlicense.dao.types.OperationalScope> opScopeChoicesLKG = new HashSet<>();
+ opScopeChoicesLKG.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.CPU);
+ opScopeChoicesLKG.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.VM);
+ opScopeChoicesLKG.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Availability_Zone);
+ opScopeChoicesLKG.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Data_Center);
+ org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity
+ lkg = LicenseKeyGroupTest.createLicenseKeyGroup(vlmId, VERSION01, "lkg" + CommonMethods.nextUuId(), "lkg desc", org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyType.Unique, new org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther<>(opScopeChoicesLKG, null));
+ String lkgId = vendorLicenseManager.createLicenseKeyGroup(lkg, USER1).getId();
+ lkg.setId(lkgId);
+
+ org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity
+ lkg_1 = LicenseKeyGroupTest.createLicenseKeyGroup(vlmId, VERSION01, "lkg" + CommonMethods.nextUuId(), "lkg_1 desc", org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyType.Unique, new org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther<>(opScopeChoicesLKG, null));
+ String lkgId_1 = vendorLicenseManager.createLicenseKeyGroup(lkg_1, USER1).getId();
+ lkg.setId(lkgId);
+
+ Set<org.openecomp.sdc.vendorlicense.dao.types.OperationalScope> opScopeChoices = new HashSet<>();
+ opScopeChoices.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Other);
+ opScopeChoices.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Data_Center);
+ opScopeChoices.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Network_Wide);
+ org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity
+ ep = EntitlementPoolTest.createEntitlementPool(vlmId, VERSION01, "EP1" + CommonMethods.nextUuId(), "EP1 dec", 80, org.openecomp.sdc.vendorlicense.dao.types.ThresholdUnit.Absolute, org.openecomp.sdc.vendorlicense.dao.types.EntitlementMetric.Core, null, "inc1", org.openecomp.sdc.vendorlicense.dao.types.AggregationFunction.Other, "agg func1", opScopeChoices, null, org.openecomp.sdc.vendorlicense.dao.types.EntitlementTime.Hour, null, "sku1");
+ String epId = vendorLicenseManager.createEntitlementPool(ep, USER1).getId();
+
+ Set<String> lkgs = new HashSet<>();
+ lkgs.add(lkgId);
+ lkgs.add(lkgId_1);
+
+ org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity
+ fg = LicenseAgreementTest.createFeatureGroup(vlmId, VERSION01, "fg11" + CommonMethods.nextUuId(), "FG1", "FG1 desc", CommonMethods.toSingleElementSet(epId), lkgs);
+ String fgId = vendorLicenseManager.createFeatureGroup(fg, USER1).getId();
+ vendorLicenseManager.updateFeatureGroup(fg, null, CommonMethods.toSingleElementSet(lkgId), null, null, USER1);
+
+ org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupModel
+ featureGroup = vendorLicenseManager.getFeatureGroupModel(fg, USER1);
+ Set<org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity> licenseKeyGroups = featureGroup.getLicenseKeyGroups();
+ Assert.assertEquals(licenseKeyGroups.size(), 1);
+ List<String> lkgIds = new ArrayList<>();
+ for (org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity licenseKeyGroup : licenseKeyGroups) {
+ lkgIds.add(licenseKeyGroup.getId());
+ }
+
+ Assert.assertTrue(lkgIds.contains(lkgId_1));
+ Assert.assertFalse(lkgIds.contains(lkgId));
+
+ }
+
+
+ @Test
+ public void testDeleteFeatureGroup() throws Exception {
+ String testName = "testDeleteFeatureGroup";
+ String vlmId = vendorLicenseFacade.createVendorLicenseModel(VendorLicenseModelTest.createVendorLicenseModel(testName + CommonMethods.nextUuId(), testName, "icon1"), USER1).getId();
+
+ org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity
+ fg1 = createFGForTest(vlmId, "new", Collections.emptySet(), Collections.emptySet());
+ org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity
+ fg2 = createFGForTest(vlmId, "newer", Collections.emptySet(), Collections.emptySet());
+ Collection<org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity> featureGroupEntities = vendorLicenseManager.listFeatureGroups(vlmId, null, USER1);
+ Assert.assertEquals(featureGroupEntities.size(), 2); //precondition
+
+ vendorLicenseManager.deleteFeatureGroup(fg1, USER1);
+ Assert.assertEquals(vendorLicenseManager.listFeatureGroups(vlmId, null, USER1).size(), 1);
+
+
+ }
+
+
+} \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/LicenseAgreementTest.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/LicenseAgreementTest.java
new file mode 100644
index 0000000000..f68f84ec0a
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/LicenseAgreementTest.java
@@ -0,0 +1,218 @@
+package org.openecomp.sdc.vendorlicense;
+
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.vendorlicense.dao.FeatureGroupDaoFactory;
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseTerm;
+import org.openecomp.sdc.vendorlicense.impl.VendorLicenseManagerImpl;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.core.util.UniqueValueUtil;
+import org.openecomp.core.utilities.CommonMethods;
+import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+
+public class LicenseAgreementTest {
+ private static final Version VERSION01 = new Version(0, 1);
+ private static final String USER1 = "user1";
+ private static final String LA1_NAME = "LA1 Name";
+
+ private static VendorLicenseManager vendorLicenseManager = new VendorLicenseManagerImpl();
+ private static org.openecomp.sdc.vendorlicense.dao.FeatureGroupDao featureGroupDao;
+ private static org.openecomp.sdc.vendorlicense.dao.LicenseAgreementDao licenseAgreementDao;
+
+ private static String vlm1Id;
+ private static String vlm2Id;
+ private static String la1Id;
+ private static String la2Id;
+
+ public static org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity createLicenseAgreement(String vlmId, Version version,
+ String id, String name, String desc,
+ String requirementsAndConstrains,
+ org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther<LicenseTerm> term,
+ String... fgIds) {
+ org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity
+ la = new org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity();
+ la.setVendorLicenseModelId(vlmId);
+ la.setVersion(version);
+ la.setId(id);
+ la.setName(name);
+ la.setDescription(desc);
+ la.setLicenseTerm(term);
+ la.setRequirementsAndConstrains(requirementsAndConstrains);
+ for (String fgId : fgIds) {
+ la.getFeatureGroupIds().add(fgId);
+ }
+ return la;
+ }
+
+ public static org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity createFeatureGroup(String vendorId, Version version, String id,
+ String name, String description,
+ Set<String> entitlementPoolIds,
+ Set<String> licenseKeyGroupIds) {
+ org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity
+ featureGroup = new org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity();
+ featureGroup.setVendorLicenseModelId(vendorId);
+ featureGroup.setVersion(version);
+ featureGroup.setId(id);
+ featureGroup.setName(name);
+ featureGroup.setDescription(description);
+ featureGroup.setEntitlementPoolIds(entitlementPoolIds);
+ featureGroup.setLicenseKeyGroupIds(licenseKeyGroupIds);
+ return featureGroup;
+ }
+
+ @BeforeClass
+ private void init() {
+ licenseAgreementDao = org.openecomp.sdc.vendorlicense.dao.LicenseAgreementDaoFactory.getInstance().createInterface();
+ featureGroupDao = FeatureGroupDaoFactory.getInstance().createInterface();
+ vlm1Id = vendorLicenseManager.createVendorLicenseModel(VendorLicenseModelTest
+ .createVendorLicenseModel("vendor1 name " + CommonMethods.nextUuId(), "vlm1 dec", "icon1"),
+ USER1).getId();
+ vlm2Id = vendorLicenseManager.createVendorLicenseModel(VendorLicenseModelTest
+ .createVendorLicenseModel("vendor2 name " + CommonMethods.nextUuId(), "vlm2 dec", "icon2"),
+ USER1).getId();
+ }
+
+ @Test
+ public void createLicenseAgreementTest() {
+ la1Id = testCreate(vlm1Id, LA1_NAME);
+ }
+
+ private String testCreate(String vlmId, String name) {
+ org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity fg1 =
+ createFeatureGroup(vlmId, VERSION01, "fg11", "FG1", "FG1 desc", null, null);
+ featureGroupDao.create(fg1);
+
+ org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity
+ la1 = createLicenseAgreement(vlmId, VERSION01, null, name, "LA1 desc",
+ "RequirementsAndConstrains1", new org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther<>(
+ org.openecomp.sdc.vendorlicense.dao.types.LicenseTerm.Unlimited, null), "fg11");
+ la1 = vendorLicenseManager.createLicenseAgreement(la1, USER1);
+ String la1Id = la1.getId();
+
+ org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity loadedLa1 = licenseAgreementDao.get(la1);
+ Assert.assertTrue(loadedLa1.equals(la1));
+ return la1Id;
+ }
+
+ @Test(dependsOnMethods = {"createLicenseAgreementTest"})
+ public void testCreateWithExistingName_negative() {
+ try {
+ org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity la1 =
+ createLicenseAgreement(vlm1Id, VERSION01, null, LA1_NAME, "LA1 desc",
+ "RequirementsAndConstrains1", new org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther<>(
+ org.openecomp.sdc.vendorlicense.dao.types.LicenseTerm.Unlimited, null),
+ "fg11");
+ vendorLicenseManager.createLicenseAgreement(la1, USER1);
+ Assert.fail();
+ } catch (CoreException e) {
+ Assert.assertEquals(e.code().id(), UniqueValueUtil.UNIQUE_VALUE_VIOLATION);
+ }
+ }
+
+ @Test(dependsOnMethods = {"createLicenseAgreementTest"})
+ public void testCreateWithExistingNameUnderOtherVlm() {
+ testCreate(vlm2Id, LA1_NAME);
+ }
+
+ @Test(dependsOnMethods = {"testCreateWithExistingName_negative"})
+ public void updateLicenseAgreementTest() {
+ org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity fg2 =
+ createFeatureGroup(vlm1Id, VERSION01, "fg2", "FG2", "FG2 desc", null, null);
+ featureGroupDao.create(fg2);
+
+ org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity fg3 =
+ createFeatureGroup(vlm1Id, VERSION01, "fg3", "FG3", "FG3 desc", null, null);
+ featureGroupDao.create(fg3);
+
+ org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity la1 =
+ licenseAgreementDao.get(new org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity(vlm1Id, VERSION01, la1Id));
+ la1.setDescription("LA1 desc updated");
+ la1.setLicenseTerm(new org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther<>(
+ org.openecomp.sdc.vendorlicense.dao.types.LicenseTerm.Other, "bla bla term"));
+ la1.getFeatureGroupIds().add("fg2");
+ la1.getFeatureGroupIds().add("fg3");
+ la1.getFeatureGroupIds().remove("fg11");
+
+ Set<String> addedFeatureGroupIds = new HashSet<>();
+ addedFeatureGroupIds.add("fg2");
+ addedFeatureGroupIds.add("fg3");
+
+ Set<String> removedFeatureGroupIds = new HashSet<>();
+ removedFeatureGroupIds.add("fg11");
+
+ vendorLicenseManager
+ .updateLicenseAgreement(la1, addedFeatureGroupIds, removedFeatureGroupIds, USER1);
+
+ org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity loadedLa1 =
+ licenseAgreementDao.get(new org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity(vlm1Id, VERSION01, la1Id));
+ Assert.assertTrue(loadedLa1.equals(la1));
+
+ }
+
+ @Test(dependsOnMethods = {"updateLicenseAgreementTest"})
+ public void listLicenseAgreementsTest() {
+ org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity
+ la2 = createLicenseAgreement(vlm1Id, VERSION01, null, "LA2", "LA2 desc",
+ "RequirementsAndConstrains2", new org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther<>(
+ org.openecomp.sdc.vendorlicense.dao.types.LicenseTerm.Unlimited, null), "fg2");
+ la2 = vendorLicenseManager.createLicenseAgreement(la2, USER1);
+ la2Id = la2.getId();
+
+ Collection<org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity> loadedLas =
+ vendorLicenseManager.listLicenseAgreements(vlm1Id, null, USER1);
+ Assert.assertEquals(loadedLas.size(), 2);
+ boolean la2Exists = false;
+ for (org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity loadedLa : loadedLas) {
+ if (la2Id.equals(loadedLa.getId())) {
+ Assert.assertTrue(loadedLa.equals(la2));
+ la2Exists = true;
+ }
+ }
+
+ Assert.assertTrue(la2Exists);
+ }
+
+ @Test(dependsOnMethods = {"listLicenseAgreementsTest"})
+ public void featureGroupDeletedLicenseAgreementUpdated() {
+ org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity licenseAgreement =
+ createLicenseAgreement(vlm1Id, VERSION01, "laId", "LA2", "LA2 desc",
+ "RequirementsAndConstrains2", new org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther<>(
+ org.openecomp.sdc.vendorlicense.dao.types.LicenseTerm.Unlimited, null), "fg2");
+ licenseAgreementDao.create(licenseAgreement);
+ String featureGroupId = "FeatureGroupId";
+ org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity created =
+ createFeatureGroup(vlm1Id, VERSION01, "fg11", "FG1", "FG1 desc", null, null);
+ featureGroupDao.create(created);
+ featureGroupDao.addReferencingLicenseAgreement(created, licenseAgreement.getId());
+
+ vendorLicenseManager.deleteFeatureGroup(created, USER1);
+ org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity afterDeletingFG = licenseAgreementDao.get(licenseAgreement);
+ Assert.assertEquals(afterDeletingFG.getFeatureGroupIds().size(), 1);
+ Assert.assertTrue(afterDeletingFG.getFeatureGroupIds().contains("fg2"));
+ }
+
+ @Test(dependsOnMethods = {"listLicenseAgreementsTest"})
+ public void deleteLicenseAgreementsTest() {
+ vendorLicenseManager.deleteLicenseAgreement(vlm1Id, la1Id, USER1);
+
+ org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity loadedLa1 =
+ licenseAgreementDao.get(new org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity(vlm1Id, VERSION01, la1Id));
+ Assert.assertEquals(loadedLa1, null);
+
+ Collection<org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity> loadedLas =
+ licenseAgreementDao.list(new org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity(vlm1Id, VERSION01, null));
+ Assert.assertEquals(loadedLas.size(), 1);
+ Assert.assertEquals(loadedLas.iterator().next().getId(), la2Id);
+ }
+
+ @Test(dependsOnMethods = "deleteLicenseAgreementsTest")
+ public void testCreateWithRemovedName() {
+ testCreate(vlm1Id, LA1_NAME);
+ }
+}
+
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/LicenseKeyGroupTest.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/LicenseKeyGroupTest.java
new file mode 100644
index 0000000000..15b179b9c6
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/LicenseKeyGroupTest.java
@@ -0,0 +1,162 @@
+package org.openecomp.sdc.vendorlicense;
+
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.vendorlicense.dao.LicenseKeyGroupDao;
+import org.openecomp.sdc.vendorlicense.dao.LicenseKeyGroupDaoFactory;
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyType;
+import org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther;
+import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope;
+import org.openecomp.sdc.vendorlicense.impl.VendorLicenseManagerImpl;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
+import org.openecomp.core.util.UniqueValueUtil;
+import org.openecomp.core.utilities.CommonMethods;
+import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+public class LicenseKeyGroupTest {
+
+ public static final String LKG1_NAME = "LKG1 name";
+ private static final Version VERSION01 = new Version(0, 1);
+ private static final String USER1 = "user1";
+ public static String vlm1Id;
+ public static String vlm2Id;
+ private static VendorLicenseManager vendorLicenseManager = new VendorLicenseManagerImpl();
+ private static LicenseKeyGroupDao licenseKeyGroupDao;
+ private static NoSqlDb noSqlDb;
+ private static String lkg1Id;
+ private static String lkg2Id;
+
+ public static LicenseKeyGroupEntity createLicenseKeyGroup(String vlmId, Version version,
+ String name, String desc,
+ LicenseKeyType type,
+ MultiChoiceOrOther<OperationalScope> operationalScope) {
+ LicenseKeyGroupEntity licenseKeyGroup = new LicenseKeyGroupEntity();
+ licenseKeyGroup.setVendorLicenseModelId(vlmId);
+ licenseKeyGroup.setVersion(version);
+ licenseKeyGroup.setName(name);
+ licenseKeyGroup.setDescription(desc);
+ licenseKeyGroup.setType(type);
+ licenseKeyGroup.setOperationalScope(operationalScope);
+ return licenseKeyGroup;
+ }
+
+ @BeforeClass
+ private void init() {
+ licenseKeyGroupDao = LicenseKeyGroupDaoFactory.getInstance().createInterface();
+ noSqlDb = NoSqlDbFactory.getInstance().createInterface();
+
+ vlm1Id = vendorLicenseManager.createVendorLicenseModel(VendorLicenseModelTest
+ .createVendorLicenseModel("vendor1 name " + CommonMethods.nextUuId(), "vlm1Id dec",
+ "icon1"), USER1).getId();
+ vlm2Id = vendorLicenseManager.createVendorLicenseModel(VendorLicenseModelTest
+ .createVendorLicenseModel("vendor2 name " + CommonMethods.nextUuId(), "vlm2 dec", "icon2"),
+ USER1).getId();
+ }
+
+ @Test
+ public void createTest() {
+ lkg1Id = testCreate(vlm1Id, LKG1_NAME);
+ }
+
+ private String testCreate(String vlmId, String name) {
+ Set<OperationalScope> opScopeChoices = new HashSet<>();
+ opScopeChoices.add(OperationalScope.CPU);
+ opScopeChoices.add(OperationalScope.VM);
+ opScopeChoices.add(OperationalScope.Tenant);
+ opScopeChoices.add(OperationalScope.Data_Center);
+ LicenseKeyGroupEntity lkg1 =
+ createLicenseKeyGroup(vlmId, VERSION01, name, "LKG1 dec", LicenseKeyType.One_Time,
+ new MultiChoiceOrOther<>(opScopeChoices, null));
+ String lkg1Id = vendorLicenseManager.createLicenseKeyGroup(lkg1, USER1).getId();
+ lkg1.setId(lkg1Id);
+
+ LicenseKeyGroupEntity loadedLkg1 = licenseKeyGroupDao.get(lkg1);
+ Assert.assertTrue(loadedLkg1.equals(lkg1));
+ return lkg1Id;
+ }
+
+ @Test(dependsOnMethods = {"createTest"})
+ public void testCreateWithExistingName_negative() {
+ try {
+ LicenseKeyGroupEntity lkg1 =
+ createLicenseKeyGroup(vlm1Id, VERSION01, LKG1_NAME, "LKG1 dec", LicenseKeyType.One_Time,
+ new MultiChoiceOrOther<>(Collections.singleton(OperationalScope.Other),
+ "other op scope"));
+ vendorLicenseManager.createLicenseKeyGroup(lkg1, USER1).getId();
+ Assert.fail();
+ } catch (CoreException e) {
+ Assert.assertEquals(e.code().id(), UniqueValueUtil.UNIQUE_VALUE_VIOLATION);
+ }
+ }
+
+ @Test(dependsOnMethods = {"createTest"})
+ public void testCreateWithExistingNameUnderOtherVlm() {
+ testCreate(vlm2Id, LKG1_NAME);
+ }
+
+ @Test(dependsOnMethods = {"testCreateWithExistingName_negative"})
+ public void updateAndGetTest() {
+ LicenseKeyGroupEntity lkg1 =
+ licenseKeyGroupDao.get(new LicenseKeyGroupEntity(vlm1Id, VERSION01, lkg1Id));
+ Set<OperationalScope> opScopeChoices = new HashSet<>();
+ opScopeChoices.add(OperationalScope.Other);
+ lkg1.setOperationalScope(new MultiChoiceOrOther<>(opScopeChoices, "op scope1 updated"));
+ lkg1.setDescription("LKG1 dec updated");
+
+ vendorLicenseManager.updateLicenseKeyGroup(lkg1, USER1);
+
+ LicenseKeyGroupEntity loadedLkg1 = vendorLicenseManager.getLicenseKeyGroup(lkg1, USER1);
+ Assert.assertTrue(loadedLkg1.equals(lkg1));
+
+ }
+
+ @Test(dependsOnMethods = {"updateAndGetTest"})
+ public void listTest() {
+ Set<OperationalScope> opScopeChoices = new HashSet<>();
+ opScopeChoices.add(OperationalScope.Network_Wide);
+ LicenseKeyGroupEntity lkg2 =
+ createLicenseKeyGroup(vlm1Id, VERSION01, "LKG2", "LKG2 dec", LicenseKeyType.Universal,
+ new MultiChoiceOrOther<>(opScopeChoices, null));
+ lkg2Id = vendorLicenseManager.createLicenseKeyGroup(lkg2, USER1).getId();
+ lkg2.setId(lkg2Id);
+
+ Collection<LicenseKeyGroupEntity> loadedLkgs =
+ vendorLicenseManager.listLicenseKeyGroups(vlm1Id, null, USER1);
+ Assert.assertEquals(loadedLkgs.size(), 2);
+ for (LicenseKeyGroupEntity loadedLkg : loadedLkgs) {
+ if (lkg2Id.equals(loadedLkg.getId())) {
+ Assert.assertTrue(loadedLkg.equals(lkg2));
+ }
+ }
+ }
+
+ @Test(dependsOnMethods = {"listTest"})
+ public void deleteTest() {
+ vendorLicenseManager
+ .deleteLicenseKeyGroup(new LicenseKeyGroupEntity(vlm1Id, VERSION01, lkg1Id), USER1);
+
+ LicenseKeyGroupEntity loadedLkg1 =
+ licenseKeyGroupDao.get(new LicenseKeyGroupEntity(vlm1Id, VERSION01, lkg1Id));
+ Assert.assertEquals(loadedLkg1, null);
+
+ Collection<LicenseKeyGroupEntity> loadedLkgs =
+ licenseKeyGroupDao.list(new LicenseKeyGroupEntity(vlm1Id, VERSION01, null));
+ Assert.assertEquals(loadedLkgs.size(), 1);
+ Assert.assertEquals(loadedLkgs.iterator().next().getId(), lkg2Id);
+ }
+
+ @Test(dependsOnMethods = "deleteTest")
+ public void testCreateWithRemovedName() {
+ testCreate(vlm1Id, LKG1_NAME);
+ }
+}
+
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/VendorLicenseModelTest.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/VendorLicenseModelTest.java
new file mode 100644
index 0000000000..c2a8d14c01
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/VendorLicenseModelTest.java
@@ -0,0 +1,402 @@
+package org.openecomp.sdc.vendorlicense;
+
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.vendorlicense.impl.VendorLicenseManagerImpl;
+import org.openecomp.core.util.UniqueValueUtil;
+
+import org.testng.Assert;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Test;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+public class VendorLicenseModelTest {
+ private static final org.openecomp.sdc.versioning.dao.types.Version
+ VERSION01 = new org.openecomp.sdc.versioning.dao.types.Version(0, 1);
+ private static final org.openecomp.sdc.versioning.dao.types.Version
+ VERSION02 = new org.openecomp.sdc.versioning.dao.types.Version(0, 2);
+ private static final String USER1 = "vlmTestUser1";
+ private static final String USER2 = "vlmTestUser2";
+ private static final String USER3 = "vlmTestUser3";
+ private static final String VLM1_NAME = "Vlm1 name";
+ private static VendorLicenseManager vendorLicenseManager = new VendorLicenseManagerImpl();
+ private static org.openecomp.sdc.vendorlicense.dao.VendorLicenseModelDao vendorLicenseModelDao =
+ org.openecomp.sdc.vendorlicense.dao.VendorLicenseModelDaoFactory.getInstance().createInterface();
+
+ private static String vlm1Id;
+ private static String vlm2Id;
+ private static String vlm3Id;
+ private static String vlm4Id;
+ private static String laId;
+ private static String fg1Id;
+ private static String fg2Id;
+
+ private static String testCreate() {
+ org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity vlm1 = createVendorLicenseModel(VLM1_NAME, "VLM1 dec", "icon1");
+ String vlmId = vendorLicenseManager.createVendorLicenseModel(vlm1, USER1).getId();
+
+ vlm1.setVersion(VERSION01);
+ org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity loadedVlm1 = vendorLicenseModelDao.get(vlm1);
+ Assert.assertTrue(loadedVlm1.equals(vlm1));
+ return vlmId;
+ }
+
+ public static org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity createVendorLicenseModel(String name, String desc,
+ String icon) {
+ org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity
+ vendorLicenseModel = new org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity();
+ vendorLicenseModel.setVendorName(name);
+ vendorLicenseModel.setDescription(desc);
+ vendorLicenseModel.setIconRef(icon);
+ return vendorLicenseModel;
+ }
+
+ @BeforeTest
+ private void init() {
+ UniqueValueUtil.deleteUniqueValue(VendorLicenseConstants.UniqueValues.VENDOR_NAME, VLM1_NAME);
+ UniqueValueUtil
+ .deleteUniqueValue(VendorLicenseConstants.UniqueValues.VENDOR_NAME, "VLM1 updated");
+ UniqueValueUtil.deleteUniqueValue(VendorLicenseConstants.UniqueValues.VENDOR_NAME, "VLM2");
+ UniqueValueUtil.deleteUniqueValue(VendorLicenseConstants.UniqueValues.VENDOR_NAME, "test_vlm1");
+ UniqueValueUtil.deleteUniqueValue(VendorLicenseConstants.UniqueValues.VENDOR_NAME, "test_vlm2");
+ UniqueValueUtil.deleteUniqueValue(VendorLicenseConstants.UniqueValues.VENDOR_NAME, "test_vlm3");
+ }
+
+ @Test
+ public void createTest() {
+ vlm1Id = testCreate();
+ }
+
+ @Test(dependsOnMethods = {"createTest"})
+ public void testCreateWithExistingVendorName_negative() {
+ try {
+ vendorLicenseManager
+ .createVendorLicenseModel(createVendorLicenseModel(VLM1_NAME, "VLM1 dec", "icon1"),
+ USER1);
+ Assert.fail();
+ } catch (CoreException e) {
+ Assert.assertEquals(e.code().id(), UniqueValueUtil.UNIQUE_VALUE_VIOLATION);
+ }
+ }
+
+ @Test(dependsOnMethods = {"testCreateWithExistingVendorName_negative"})
+ public void updateTest() {
+ org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity
+ expectedVlm1 = new org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity(vlm1Id, VERSION01);
+ expectedVlm1.setVendorName("VLM1 updated");
+ expectedVlm1.setDescription("VLM1 dec updated");
+ expectedVlm1.setIconRef("icon1 updated");
+ vendorLicenseManager.updateVendorLicenseModel(expectedVlm1, USER1);
+
+ org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity actualVlm1 =
+ vendorLicenseModelDao.get(new org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity(vlm1Id, VERSION01));
+ Assert.assertTrue(actualVlm1.equals(expectedVlm1));
+ }
+
+ @Test(dependsOnMethods = {"updateTest"})
+ public void testUpdateWithSimilarVendorName() {
+ org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity
+ expectedVlm1 = new org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity(vlm1Id, VERSION01);
+ expectedVlm1.setVendorName("vlm1 UPDATED");
+ vendorLicenseManager.updateVendorLicenseModel(expectedVlm1, USER1);
+
+ org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity actualVlm1 =
+ vendorLicenseModelDao.get(new org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity(vlm1Id, VERSION01));
+ Assert.assertTrue(actualVlm1.equals(expectedVlm1));
+ }
+
+ @Test(dependsOnMethods = {"updateTest"})
+ public void testCreateWithRemovedVendorName() {
+ testCreate();
+ }
+
+ @Test(dependsOnMethods = {"updateTest"})
+ public void getTest() {
+ org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity expectedVlm1 =
+ vendorLicenseModelDao.get(new org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity(vlm1Id, VERSION01));
+ org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel actualVlm1 =
+ vendorLicenseManager.getVendorLicenseModel(vlm1Id, null, USER1);
+
+ Assert.assertTrue(actualVlm1.getVendorLicenseModel().equals(expectedVlm1));
+ Assert.assertEquals(actualVlm1.getVersionInfo().getActiveVersion(), VERSION01);
+ Assert.assertEquals(actualVlm1.getVersionInfo().getStatus(), org.openecomp.sdc.versioning.dao.types.VersionStatus.Locked);
+ Assert.assertEquals(actualVlm1.getVersionInfo().getLockingUser(), USER1);
+ }
+
+ @Test(dependsOnMethods = {"getTest"})
+ public void listTest() {
+ org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity vlm2 = createVendorLicenseModel("VLM2", "VLM2 dec", "icon2");
+ vlm2Id = vendorLicenseManager.createVendorLicenseModel(vlm2, USER1).getId();
+ vlm2.setId(vlm2Id);
+
+ Collection<org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel> loadedVlms =
+ vendorLicenseManager.listVendorLicenseModels(null, USER1);
+ boolean vlm1Exists = false;
+ boolean vlm2Exists = false;
+ for (org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel loadedVlm : loadedVlms) {
+ if (vlm1Id.equals(loadedVlm.getVendorLicenseModel().getId())) {
+ vlm1Exists = true;
+ continue;
+ }
+ if (vlm2Id.equals(loadedVlm.getVendorLicenseModel().getId())) {
+ Assert.assertTrue(loadedVlm.getVendorLicenseModel().equals(vlm2));
+
+ vlm2Exists = true;
+ }
+ }
+
+ Assert.assertTrue(vlm1Exists);
+ Assert.assertTrue(vlm2Exists);
+ }
+
+ @Test(dependsOnMethods = {"listTest"})
+ public void listFinalVersionWhenNoneTest() {
+ Collection<org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel> loadedVlms =
+ vendorLicenseManager.listVendorLicenseModels(
+ org.openecomp.sdc.versioning.dao.types.VersionStatus.Final.name(), USER1);
+ boolean vlm1Exists = false;
+ boolean vlm2Exists = false;
+ for (org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel loadedVlm : loadedVlms) {
+ if (vlm1Id.equals(loadedVlm.getVendorLicenseModel().getId())) {
+ vlm1Exists = true;
+ continue;
+ }
+ if (vlm2Id.equals(loadedVlm.getVendorLicenseModel().getId())) {
+ vlm2Exists = true;
+ }
+ }
+
+ Assert.assertFalse(vlm1Exists);
+ Assert.assertFalse(vlm2Exists);
+ }
+
+ @Test(dependsOnMethods = {"listFinalVersionWhenNoneTest"})
+
+ // Unsupported operation for 1607 release.
+/* public void deleteTest() {
+ vendorLicenseManager.deleteVendorLicenseModel(vlm1Id, USER1);
+
+ VendorLicenseModelEntity loadedVlm1 = vendorLicenseModelDao.get(new VendorLicenseModelEntity(vlm1Id, VERSION01));
+ Assert.assertEquals(loadedVlm1, null);
+
+ Collection<VendorLicenseModelEntity> loadedVlms = vendorLicenseModelDao.list(null);
+ Assert.assertTrue(loadedVlms.size() > 1);
+ boolean vlm1Exists = false;
+ boolean vlm2Exists = false;
+ for (VendorLicenseModelEntity loadedVlm : loadedVlms) {
+ if (vlm1Id.equals(loadedVlm.getId())) {
+ vlm1Exists = true;
+ }
+ if (vlm2Id.equals(loadedVlm.getId())) {
+ vlm2Exists = true;
+ }
+ }
+ Assert.assertFalse(vlm1Exists);
+ Assert.assertTrue(vlm2Exists);
+ }
+
+ @Test(dependsOnMethods = {"deleteTest"})*/
+ public void checkinTest() {
+ vendorLicenseManager.checkin(vlm2Id, USER1);
+
+ org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel versionedVlm2 =
+ vendorLicenseManager.getVendorLicenseModel(vlm2Id, null, USER1);
+ Assert.assertEquals(versionedVlm2.getVersionInfo().getActiveVersion(), VERSION01);
+ Assert.assertEquals(versionedVlm2.getVersionInfo().getStatus(), org.openecomp.sdc.versioning.dao.types.VersionStatus.Available);
+ Assert.assertNull(versionedVlm2.getVersionInfo().getLockingUser());
+ }
+
+ @Test(dependsOnMethods = {"checkinTest"})
+ public void checkoutTest() {
+ vendorLicenseManager.checkout(vlm2Id, USER2);
+
+ org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel versionedVlm2 =
+ vendorLicenseManager.getVendorLicenseModel(vlm2Id, null, USER2);
+ Assert.assertEquals(versionedVlm2.getVersionInfo().getActiveVersion(), VERSION02);
+ Assert.assertEquals(versionedVlm2.getVersionInfo().getStatus(), org.openecomp.sdc.versioning.dao.types.VersionStatus.Locked);
+ Assert.assertEquals(versionedVlm2.getVersionInfo().getLockingUser(), USER2);
+
+ versionedVlm2 = vendorLicenseManager.getVendorLicenseModel(vlm2Id, null, USER1);
+ Assert.assertEquals(versionedVlm2.getVersionInfo().getActiveVersion(), VERSION01);
+ Assert.assertEquals(versionedVlm2.getVersionInfo().getStatus(), org.openecomp.sdc.versioning.dao.types.VersionStatus.Locked);
+ Assert.assertEquals(versionedVlm2.getVersionInfo().getLockingUser(), USER2);
+ }
+
+ @Test(dependsOnMethods = {"checkoutTest"})
+ public void undoCheckoutTest() {
+ vendorLicenseManager.undoCheckout(vlm2Id, USER2);
+
+ org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel versionedVlm2 =
+ vendorLicenseManager.getVendorLicenseModel(vlm2Id, null, USER2);
+ Assert.assertEquals(versionedVlm2.getVersionInfo().getActiveVersion(), VERSION01);
+ Assert.assertEquals(versionedVlm2.getVersionInfo().getStatus(), org.openecomp.sdc.versioning.dao.types.VersionStatus.Available);
+ Assert.assertNull(versionedVlm2.getVersionInfo().getLockingUser());
+ }
+
+ @Test(dependsOnMethods = {"undoCheckoutTest"}, expectedExceptions = CoreException.class)
+ public void submitUncompletedVlmNegativeTest() {
+ vendorLicenseManager.submit(vlm2Id, USER2);
+ }
+
+ @Test(dependsOnMethods = {"submitUncompletedVlmNegativeTest"},
+ expectedExceptions = CoreException.class)
+ public void submitUncompletedVlmMissingFGNegativeTest() {
+ vendorLicenseManager.checkout(vlm2Id, USER2);
+ org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity
+ licenseAgreement = new org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity(vlm2Id, null, null);
+ org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity licenseAgreementEntity =
+ vendorLicenseManager.createLicenseAgreement(licenseAgreement, USER2);
+ laId = licenseAgreementEntity.getId();
+ vendorLicenseManager.checkin(vlm2Id, USER2);
+ vendorLicenseManager.submit(vlm2Id, USER2);
+ }
+
+ @Test(dependsOnMethods = {"submitUncompletedVlmMissingFGNegativeTest"},
+ expectedExceptions = CoreException.class)
+ public void submitUncompletedVlmMissingEPNegativeTest() {
+ vendorLicenseManager.checkout(vlm2Id, USER2);
+ org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity
+ featureGroup = new org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity(vlm2Id, null, null);
+ featureGroup = vendorLicenseManager.createFeatureGroup(featureGroup, USER2);
+ fg1Id = featureGroup.getId();
+
+ org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementModel licenseAgreementModel =
+ vendorLicenseManager.getLicenseAgreementModel(vlm2Id, null, laId, USER2);
+ Set<String> fgIdSet = new HashSet<>();
+ fgIdSet.add(fg1Id);
+ vendorLicenseManager
+ .updateLicenseAgreement(licenseAgreementModel.getLicenseAgreement(), fgIdSet, null, USER2);
+ vendorLicenseManager.checkin(vlm2Id, USER2);
+ vendorLicenseManager.submit(vlm2Id, USER2);
+ }
+
+ @Test(dependsOnMethods = {"submitUncompletedVlmMissingEPNegativeTest"},
+ expectedExceptions = CoreException.class)
+ public void submitUncompletedVlmMissingEPInOneFGNegativeTest() {
+ vendorLicenseManager.checkout(vlm2Id, USER2);
+ org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity
+ featureGroup = new org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity(vlm2Id, null, null);
+ org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity entitlementPool = vendorLicenseManager
+ .createEntitlementPool(new org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity(vlm2Id, null, null), USER2);
+ featureGroup.getEntitlementPoolIds().add(entitlementPool.getId());
+ featureGroup = vendorLicenseManager.createFeatureGroup(featureGroup, USER2);
+ fg2Id = featureGroup.getId();
+ org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementModel licenseAgreementModel =
+ vendorLicenseManager.getLicenseAgreementModel(vlm2Id, null, laId, USER2);
+ Set<String> fgIdSet = new HashSet<>();
+ fgIdSet.add(fg2Id);
+ vendorLicenseManager
+ .updateLicenseAgreement(licenseAgreementModel.getLicenseAgreement(), fgIdSet, null, USER2);
+
+ vendorLicenseManager.checkin(vlm2Id, USER2);
+ vendorLicenseManager.submit(vlm2Id, USER2);
+ }
+
+ @Test(dependsOnMethods = {"submitUncompletedVlmMissingEPInOneFGNegativeTest"})
+ public void submitTest() {
+ vendorLicenseManager.checkout(vlm2Id, USER2);
+
+ org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity entitlementPool = vendorLicenseManager
+ .createEntitlementPool(new org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity(vlm2Id, null, null), USER2);
+ Set<String> epSetId = new HashSet<>();
+ epSetId.add(entitlementPool.getId());
+
+ org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity
+ featureGroup = new org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity(vlm2Id, null, fg1Id);
+ featureGroup.getEntitlementPoolIds().add(entitlementPool.getId());
+ org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupModel featureGroupModel =
+ vendorLicenseManager.getFeatureGroupModel(featureGroup, USER2);
+
+ vendorLicenseManager
+ .updateFeatureGroup(featureGroupModel.getFeatureGroup(), null, null, epSetId, null, USER2);
+ vendorLicenseManager.checkin(vlm2Id, USER2);
+ vendorLicenseManager.submit(vlm2Id, USER2);
+
+ org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel versionedVlm2 =
+ vendorLicenseManager.getVendorLicenseModel(vlm2Id, null, USER1);
+ Assert.assertEquals(versionedVlm2.getVersionInfo().getActiveVersion(), new org.openecomp.sdc.versioning.dao.types.Version(1, 0));
+ Assert.assertEquals(versionedVlm2.getVersionInfo().getStatus(), org.openecomp.sdc.versioning.dao.types.VersionStatus.Final);
+ Assert.assertNull(versionedVlm2.getVersionInfo().getLockingUser());
+ }
+
+ @Test(dependsOnMethods = {"submitTest"})
+ public void listFinalVersionWhenOneTest() {
+ Collection<org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel> loadedVlms =
+ vendorLicenseManager.listVendorLicenseModels(
+ org.openecomp.sdc.versioning.dao.types.VersionStatus.Final.name(), USER1);
+ boolean vlm2Exists = false;
+ for (org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel loadedVlm : loadedVlms) {
+ if (vlm2Id.equals(loadedVlm.getVendorLicenseModel().getId())) {
+ vlm2Exists = true;
+ Assert.assertEquals(loadedVlm.getVersionInfo().getActiveVersion(), new org.openecomp.sdc.versioning.dao.types.Version(1, 0));
+ Assert.assertEquals(loadedVlm.getVersionInfo().getStatus(), org.openecomp.sdc.versioning.dao.types.VersionStatus.Final);
+ Assert.assertNull(loadedVlm.getVersionInfo().getLockingUser());
+ break;
+ }
+ }
+
+ Assert.assertTrue(vlm2Exists);
+ }
+
+ @Test(dependsOnMethods = {"listFinalVersionWhenOneTest"})
+ public void testVLMListWithModificationTimeDescOrder() {
+ org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity vlm1 = createVendorLicenseModel("test_vlm1", "desc", "icon");
+ vlm3Id = vendorLicenseManager.createVendorLicenseModel(vlm1, USER3).getId();
+
+ org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity vlm2 = createVendorLicenseModel("test_vlm2", "desc", "icon");
+ vlm4Id = vendorLicenseManager.createVendorLicenseModel(vlm2, USER3).getId();
+
+ assertVLMInWantedLocationInVSPList(vlm4Id, 0, USER3);
+ assertVLMInWantedLocationInVSPList(vlm3Id, 1, USER3);
+ }
+
+ @Test(dependsOnMethods = {"testVLMListWithModificationTimeDescOrder"})
+ public void testOldVLMAfterChangeShouldBeInBeginningOfList() {
+ org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity ep = vendorLicenseManager
+ .createEntitlementPool(new org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity(vlm3Id, null, null), USER3);
+
+ assertVLMInWantedLocationInVSPList(vlm3Id, 0, USER3);
+ }
+
+ @Test(dependsOnMethods = {"testOldVLMAfterChangeShouldBeInBeginningOfList"})
+ public void testAddNewVLMShouldBeInBeginningOfList() {
+ org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity vlm = createVendorLicenseModel("test_vlm3", "desc", "icon");
+ String vlm5Id = vendorLicenseManager.createVendorLicenseModel(vlm, USER3).getId();
+
+ assertVLMInWantedLocationInVSPList(vlm5Id, 0, USER3);
+ }
+
+ @Test(dependsOnMethods = {"testAddNewVLMShouldBeInBeginningOfList"})
+ public void testVLMInBeginningOfListAfterCheckin() {
+ vendorLicenseManager.checkin(vlm4Id, USER3);
+ assertVLMInWantedLocationInVSPList(vlm4Id, 0, USER3);
+ }
+
+ @Test(dependsOnMethods = {"testVLMInBeginningOfListAfterCheckin"})
+ public void testVLMInBeginningOfListAfterCheckout() {
+ vendorLicenseManager.checkin(vlm3Id, USER3);
+ assertVLMInWantedLocationInVSPList(vlm3Id, 0, USER3);
+
+ vendorLicenseManager.checkout(vlm4Id, USER3);
+ assertVLMInWantedLocationInVSPList(vlm4Id, 0, USER3);
+ }
+
+ @Test(dependsOnMethods = {"testVLMInBeginningOfListAfterCheckout"})
+ public void testVLMInBeginningOfListAfterUndoCheckout() {
+ vendorLicenseManager.checkout(vlm3Id, USER3);
+ vendorLicenseManager.undoCheckout(vlm3Id, USER3);
+ assertVLMInWantedLocationInVSPList(vlm3Id, 0, USER3);
+ }
+
+ private void assertVLMInWantedLocationInVSPList(String vlmId, int location, String user) {
+ List<org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel> vlmList =
+ (List<org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel>) vendorLicenseManager
+ .listVendorLicenseModels(null, user);
+ Assert.assertEquals(vlmList.get(location).getVendorLicenseModel().getId(), vlmId);
+ }
+
+
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/VendorLicenseArtifactsServiceTest.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/VendorLicenseArtifactsServiceTest.java
new file mode 100644
index 0000000000..778caf3756
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/VendorLicenseArtifactsServiceTest.java
@@ -0,0 +1,141 @@
+package org.openecomp.sdc.vendorlicense.licenseartifacts.impl;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.openecomp.sdc.vendorlicense.ArtifactTestUtils;
+import org.openecomp.sdc.vendorlicense.dao.types.EntitlementMetric;
+import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.core.utilities.file.FileContentHandler;
+import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+
+public class VendorLicenseArtifactsServiceTest extends ArtifactTestUtils {
+ private FileContentHandler licenseArtifacts;
+
+
+ @Test
+ public void createVNFArtifact() throws Exception {
+ Version vlmVersion = vspDetails.getVlmVersion();
+ licenseArtifacts = vendorLicenseArtifactsService.createLicenseArtifacts(vspDetails.getId(), vspDetails.getVendorId(), vlmVersion, vspDetails.getFeatureGroups(), USER1);
+ String actual = IOUtils.toString(licenseArtifacts.getFileContent(
+ org.openecomp.sdc.vendorlicense.VendorLicenseConstants.VNF_ARTIFACT_NAME_WITH_PATH), StandardCharsets.UTF_8);
+// System.out.println("createVnfArtifact = " + actual);
+
+ Assert.assertTrue(actual.contains("type"));
+ Assert.assertFalse(actual.contains(lkg13Id));
+ Assert.assertTrue(actual.contains(OperationalScope.Availability_Zone.toString()));
+ Assert.assertTrue(actual.contains("vf-id"));
+ Assert.assertFalse(actual.contains(org.openecomp.sdc.vendorlicense.VendorLicenseConstants.VENDOR_LICENSE_MODEL_ARTIFACT_REGEX_REMOVE));
+ Assert.assertFalse(actual.contains("80.0"));
+ Assert.assertTrue(actual.contains("80"));
+
+ }
+
+ @Test
+ public void createVendorLicenseArtifact() throws Exception {
+ Version vlmVersion = vspDetails.getVlmVersion();
+
+ licenseArtifacts = vendorLicenseArtifactsService.createLicenseArtifacts(vspDetails.getId(), vspDetails.getVendorId(), vlmVersion, vspDetails.getFeatureGroups(), USER1);
+ String actual = IOUtils.toString(licenseArtifacts.getFileContent(
+ org.openecomp.sdc.vendorlicense.VendorLicenseConstants.VENDOR_LICENSE_MODEL_ARTIFACT_NAME_WITH_PATH), StandardCharsets.UTF_8);
+
+// System.out.println("createVendorLicenseArtifact = " + actual);
+ Assert.assertFalse(actual.contains(lkg11Id));
+ Assert.assertFalse(actual.contains(ep11Id));
+ Assert.assertTrue(actual.contains("type"));
+ Assert.assertTrue(actual.contains(EntitlementMetric.Core.toString()));
+ Assert.assertTrue(actual.contains("entitlement-pool-list"));
+ Assert.assertFalse(actual.contains(org.openecomp.sdc.vendorlicense.VendorLicenseConstants.VENDOR_LICENSE_MODEL_ARTIFACT_REGEX_REMOVE));
+
+ Assert.assertTrue(actual.contains("vendor-license-model"));
+ Assert.assertFalse(actual.contains("80.0"));
+ Assert.assertTrue(actual.contains("80"));
+ }
+
+ @Test
+ public void vNFArtifactContainsCurrentVLMVersion() throws IOException {
+ super.setVlm2FirstVersion();
+ licenseArtifacts = vendorLicenseArtifactsService.createLicenseArtifacts(vsp2.getId(), vsp2.getVendorId(), vsp2.getVlmVersion(), vsp2.getFeatureGroups(), USER1);
+ String actual = IOUtils.toString(licenseArtifacts.getFileContent(
+ org.openecomp.sdc.vendorlicense.VendorLicenseConstants.VNF_ARTIFACT_NAME_WITH_PATH), StandardCharsets.UTF_8);
+
+ Assert.assertTrue(actual.contains(ep21.getVersionUuId()));
+ }
+
+ @Test
+ public void vnfArtifactContainsSameIdAsVLMArtifact() throws IOException {
+ Version vlmVersion = vspDetails.getVlmVersion();
+ licenseArtifacts = vendorLicenseArtifactsService.createLicenseArtifacts(vspDetails.getId(), vspDetails.getVendorId(), vlmVersion, vspDetails.getFeatureGroups(), USER1);
+ String actualVnfArtifact = IOUtils.toString(licenseArtifacts.getFileContent(
+ org.openecomp.sdc.vendorlicense.VendorLicenseConstants.VNF_ARTIFACT_NAME_WITH_PATH), StandardCharsets.UTF_8);
+ String actualVendorLicenseArtifact = IOUtils.toString(licenseArtifacts.getFileContent(
+ org.openecomp.sdc.vendorlicense.VendorLicenseConstants.VENDOR_LICENSE_MODEL_ARTIFACT_NAME_WITH_PATH), StandardCharsets.UTF_8);
+
+ String firstLKGUUID = actualVnfArtifact.substring(actualVnfArtifact.indexOf("<license-key-group-uuid>") + 24, actualVnfArtifact.indexOf("<license-key-group-uuid>") + 60);
+ Assert.assertTrue(actualVendorLicenseArtifact.contains(firstLKGUUID));
+
+ String firstEPUUID = actualVnfArtifact.substring(actualVnfArtifact.indexOf("<<entitlement-pool-uuid>>") + 23, actualVnfArtifact.indexOf("<<entitlement-pool-uuid>>") + 60);
+ Assert.assertTrue(actualVendorLicenseArtifact.contains(firstEPUUID));
+ }
+
+
+ @Test
+ public void vNFArtifactContainsPreviousVLMVersionAndNotLatest() throws IOException {
+ super.setVlm2SecondVersion();
+ licenseArtifacts = vendorLicenseArtifactsService.createLicenseArtifacts(vsp2.getId(), vsp2.getVendorId(), vsp2.getVlmVersion(), vsp2.getFeatureGroups(), USER1);
+ String actual = IOUtils.toString(licenseArtifacts.getFileContent(
+ org.openecomp.sdc.vendorlicense.VendorLicenseConstants.VNF_ARTIFACT_NAME_WITH_PATH), StandardCharsets.UTF_8);
+
+ Assert.assertTrue(actual.contains(lkg21.getVersionUuId()));
+ Assert.assertTrue(actual.contains(ep21.getVersionUuId()));
+ Assert.assertFalse(actual.contains(lkg22Id));
+ Assert.assertFalse(actual.contains(ep22Id));
+
+
+ Assert.assertTrue(actual.contains("80"));
+ }
+
+
+ @Test
+ public void onlyAddChangedEntitiesToVendorArtifact() throws IOException {
+ Version vlmVersion = vspDetails.getVlmVersion();
+
+ EntitlementPoolEntity updatedEP = ep11;
+ String updatedNameEP = "updatedNameEP";
+ updatedEP.setName(updatedNameEP);
+ LicenseKeyGroupEntity updatedLKG = new LicenseKeyGroupEntity();
+ updatedLKG.setId(lkg11Id);
+ updatedLKG.setVendorLicenseModelId(lkg11.getVendorLicenseModelId());
+ String updateDescLKG = "UpdateDescLKG";
+ updatedLKG.setName(lkg11.getName());
+ updatedLKG.setDescription(updateDescLKG);
+
+ createThirdFinalVersionForVLMChangeEpLKGInSome(ep11.getVendorLicenseModelId(), updatedEP, updatedLKG);
+ licenseArtifacts = vendorLicenseArtifactsService.createLicenseArtifacts(vspDetails.getId(), vspDetails.getVendorId(), vlmVersion, vspDetails.getFeatureGroups(), USER1);
+ String actual = IOUtils.toString(licenseArtifacts.getFileContent(
+ org.openecomp.sdc.vendorlicense.VendorLicenseConstants.VENDOR_LICENSE_MODEL_ARTIFACT_NAME_WITH_PATH), StandardCharsets.UTF_8);
+// System.out.println("onlyAddChangedEntitiesToVendorArtifact = " + actual);
+
+ int countUpdatedLKG = StringUtils.countMatches(actual, updateDescLKG);
+ Assert.assertEquals(countUpdatedLKG, 1);
+
+ int countUpdatedEp = StringUtils.countMatches(actual, updatedNameEP);
+ Assert.assertEquals(countUpdatedEp, 1);
+
+ int epOccurrences = StringUtils.countMatches(actual, "<entitlement-pool>");
+ Assert.assertEquals(epOccurrences, 3);
+ }
+
+ @BeforeClass
+ public void setUp() {
+ super.setUp();
+ }
+}
+
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/pom.xml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/pom.xml
new file mode 100644
index 0000000000..6b98e15c75
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/pom.xml
@@ -0,0 +1,147 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>backend</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>openecomp-sdc-vendor-software-product-manager</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <version>2.3.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.yaml</groupId>
+ <artifactId>snakeyaml</artifactId>
+ <version>1.14</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-utilities-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-validation-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-nosqldb-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-vendor-software-product-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-heat-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-tosca-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>6.9.10</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>RELEASE</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <version>1.10.19</version>
+ <scope>test</scope>
+ </dependency>
+
+
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-translator-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.dataformat</groupId>
+ <artifactId>jackson-dataformat-xml</artifactId>
+ <version>2.7.4</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.woodstox</groupId>
+ <artifactId>woodstox-core-asl</artifactId>
+ <version>4.4.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-vendor-license-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-enrichment-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-validation-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-enrichment-impl</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>${commons.io.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-model-impl</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-validation-manager</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.19.1</version>
+ <configuration>
+ <skipTests>true</skipTests>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductManager.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductManager.java
new file mode 100644
index 0000000000..0d38d165c2
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductManager.java
@@ -0,0 +1,173 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct;
+
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.PackageInfo;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
+import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityResponse;
+import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityValidationData;
+import org.openecomp.sdc.vendorsoftwareproduct.types.QuestionnaireResponse;
+import org.openecomp.sdc.vendorsoftwareproduct.types.UploadFileResponse;
+import org.openecomp.sdc.vendorsoftwareproduct.types.ValidationResponse;
+import org.openecomp.sdc.vendorsoftwareproduct.types.VersionedVendorSoftwareProductInfo;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic;
+import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.MibUploadStatus;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Collection;
+import java.util.List;
+
+public interface VendorSoftwareProductManager {
+
+ Version checkout(String vendorSoftwareProductId, String user);
+
+ Version undoCheckout(String vendorSoftwareProductId, String user);
+
+ Version checkin(String vendorSoftwareProductId, String user);
+
+ ValidationResponse submit(String vendorSoftwareProductId, String user) throws IOException;
+
+
+ VspDetails createNewVsp(VspDetails vspDetails, String user);
+
+ List<VersionedVendorSoftwareProductInfo> getVspList(String versionFilter, String user);
+
+ void updateVsp(VspDetails vspDetails, String user);
+
+ VersionedVendorSoftwareProductInfo getVspDetails(String vspId, Version version, String user);
+
+ void deleteVsp(String vspIdToDelete, String user);
+
+
+ UploadFileResponse uploadFile(String vspId, InputStream heatFileToUpload, String user);
+
+ PackageInfo createPackage(String vspId, String user) throws IOException;
+
+ List<PackageInfo> listPackages(String category, String subCategory);
+
+ File getTranslatedFile(String vspId, Version version, String user);
+
+ File getLatestHeatPackage(String vspId, String user);
+
+ QuestionnaireResponse getVspQuestionnaire(String vspId, Version version, String user);
+
+ void updateVspQuestionnaire(String vspId, String questionnaireData, String user);
+
+
+ Collection<NetworkEntity> listNetworks(String vspId, Version version, String user);
+
+ NetworkEntity createNetwork(NetworkEntity network, String user);
+
+ CompositionEntityValidationData updateNetwork(NetworkEntity networkEntity, String user);
+
+ CompositionEntityResponse<Network> getNetwork(String vspId, Version version, String networkId,
+ String user);
+
+ void deleteNetwork(String vspId, String networkId, String user);
+
+
+ QuestionnaireResponse getComponentQuestionnaire(String vspId, Version version, String componentId,
+ String user);
+
+ void updateComponentQuestionnaire(String vspId, String componentId, String questionnaireData,
+ String user);
+
+
+ Collection<ComponentEntity> listComponents(String vspId, Version version, String user);
+
+ void deleteComponents(String vspId, String user);
+
+ ComponentEntity createComponent(ComponentEntity componentEntity, String user);
+
+ CompositionEntityValidationData updateComponent(ComponentEntity componentEntity, String user);
+
+ CompositionEntityResponse<ComponentData> getComponent(String vspId, Version version,
+ String componentId, String user);
+
+ void deleteComponent(String vspId, String componentId, String user);
+
+
+ Collection<org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity> listProcesses(
+ String vspId, Version version, String componentId,
+ String user);
+
+ void deleteProcesses(String vspId, String componentId, String user);
+
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity createProcess(
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity processEntity, String user);
+
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity getProcess(String vspId,
+ Version version,
+ String componentId,
+ String processId,
+ String user);
+
+ void updateProcess(org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity processEntity,
+ String user);
+
+ void deleteProcess(String vspId, String componentId, String processId, String user);
+
+
+ File getProcessArtifact(String vspId, Version version, String componentId, String processId,
+ String user);
+
+ void deleteProcessArtifact(String vspId, String componentId, String processId, String user);
+
+ void uploadProcessArtifact(InputStream uploadFile, String fileName, String vspId,
+ String componentId, String processId, String user);
+
+
+ Collection<org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity> listNics(String vspId,
+ Version version,
+ String componentId,
+ String user);
+
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity createNic(
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity nic, String user);
+
+ CompositionEntityValidationData updateNic(
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity nicEntity, String user);
+
+ CompositionEntityResponse<Nic> getNic(String vspId, Version version, String componentId,
+ String nicId, String user);
+
+ void deleteNic(String vspId, String componentId, String nicId, String user);
+
+ QuestionnaireResponse getNicQuestionnaire(String vspId, Version version, String componentId,
+ String nicId, String user);
+
+ void updateNicQuestionnaire(String vspId, String componentId, String nicId,
+ String questionnaireData, String user);
+
+ void deleteComponentMib(String vspId, String componentId, boolean isTrap, String user);
+
+ void uploadComponentMib(InputStream object, String filename, String vspId, String componentId,
+ boolean isTrap, String user);
+
+ MibUploadStatus listMibFilenames(String vspId, String componentId, String user);
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/CreatePackageForNonFinalVendorSoftwareProductErrorBuilder.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/CreatePackageForNonFinalVendorSoftwareProductErrorBuilder.java
new file mode 100644
index 0000000000..527530d4de
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/CreatePackageForNonFinalVendorSoftwareProductErrorBuilder.java
@@ -0,0 +1,59 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.errors;
+
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+/**
+ * The type Create package for non final vendor software product error builder.
+ */
+public class CreatePackageForNonFinalVendorSoftwareProductErrorBuilder {
+
+ private static final String CREATE_PACKAGE_FOR_NON_FINAL_VSP_MSG =
+ "Package creation for vendor software product with id %s and version %s is not allowed "
+ + "since it is not final (submitted).";
+ private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
+
+ /**
+ * Instantiates a new Create package for non final vendor software product error builder.
+ *
+ * @param vendorSoftwareProductId the vendor software product id
+ * @param version the version
+ */
+ public CreatePackageForNonFinalVendorSoftwareProductErrorBuilder(String vendorSoftwareProductId,
+ Version version) {
+ builder.withId(VendorSoftwareProductErrorCodes.CREATE_PACKAGE_FOR_NON_FINAL_VSP);
+ builder.withCategory(ErrorCategory.APPLICATION);
+ builder.withMessage(String
+ .format(CREATE_PACKAGE_FOR_NON_FINAL_VSP_MSG, vendorSoftwareProductId, version.toString()));
+ }
+
+ /**
+ * Build error code.
+ *
+ * @return the error code
+ */
+ public ErrorCode build() {
+ return builder.build();
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/FileCreationErrorBuilder.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/FileCreationErrorBuilder.java
new file mode 100644
index 0000000000..5a40609270
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/FileCreationErrorBuilder.java
@@ -0,0 +1,56 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.errors;
+
+import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.HEAT_PACKAGE_FILE_CREATION;
+
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+
+/**
+ * The type File creation error builder.
+ */
+public class FileCreationErrorBuilder {
+ private static final String HEAT_PKG_FILE_CREATION_ERROR_MSG =
+ "Error while trying to create heat file from the package of vendor software product "
+ + "with Id %s.";
+ private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
+
+ /**
+ * Instantiates a new File creation error builder.
+ *
+ * @param vendorSoftwareProductId the vendor software product id
+ */
+ public FileCreationErrorBuilder(String vendorSoftwareProductId) {
+ builder.withId(HEAT_PACKAGE_FILE_CREATION);
+ builder.withCategory(ErrorCategory.SYSTEM);
+ builder.withMessage(String.format(HEAT_PKG_FILE_CREATION_ERROR_MSG, vendorSoftwareProductId));
+ }
+
+ /**
+ * Build error code.
+ *
+ * @return the error code
+ */
+ public ErrorCode build() {
+ return builder.build();
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/MibUploadErrorBuilder.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/MibUploadErrorBuilder.java
new file mode 100644
index 0000000000..75a4aa3ff7
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/MibUploadErrorBuilder.java
@@ -0,0 +1,59 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.errors;
+
+import org.openecomp.sdc.common.errors.BaseErrorBuilder;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+
+/**
+ * The type Mib upload error builder.
+ */
+public class MibUploadErrorBuilder extends BaseErrorBuilder {
+ private static final String UPLOAD_INVALID_DETAILED_MSG =
+ "MIB uploaded for vendor software product with Id %s and version %s is invalid: %s";
+
+
+ /**
+ * Instantiates a new Mib upload error builder.
+ *
+ * @param vendorSoftwareProductId the vendor software product id
+ * @param version the version
+ * @param error the error
+ */
+ public MibUploadErrorBuilder(String vendorSoftwareProductId, org.openecomp.sdc.versioning.dao
+ .types.Version version, String error) {
+ getErrorCodeBuilder().withId(VendorSoftwareProductErrorCodes.MIB_UPLOAD_INVALID);
+ getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION);
+ getErrorCodeBuilder().withMessage(String
+ .format(UPLOAD_INVALID_DETAILED_MSG, vendorSoftwareProductId, version.toString(), error));
+ }
+
+ /**
+ * Instantiates a new Mib upload error builder.
+ *
+ * @param errorMessage the error message
+ */
+ public MibUploadErrorBuilder(String errorMessage) {
+ getErrorCodeBuilder().withId(VendorSoftwareProductErrorCodes.MIB_UPLOAD_INVALID);
+ getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION);
+ getErrorCodeBuilder().withMessage(errorMessage);
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/PackageInvalidErrorBuilder.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/PackageInvalidErrorBuilder.java
new file mode 100644
index 0000000000..279dbfe4ea
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/PackageInvalidErrorBuilder.java
@@ -0,0 +1,60 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.errors;
+
+import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes
+ .PACKAGE_INVALID;
+
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+/**
+ * The type Package invalid error builder.
+ */
+public class PackageInvalidErrorBuilder {
+ private static final String PACKAGE_INVALID_MSG =
+ "Package for vendor software product with Id %s and version %s is invalid "
+ + "(does not contain translated data).";
+ private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
+
+ /**
+ * Instantiates a new Package invalid error builder.
+ *
+ * @param vendorSoftwareProductId the vendor software product id
+ * @param version the version
+ */
+ public PackageInvalidErrorBuilder(String vendorSoftwareProductId, Version version) {
+ builder.withId(PACKAGE_INVALID);
+ builder.withCategory(ErrorCategory.APPLICATION);
+ builder.withMessage(
+ String.format(PACKAGE_INVALID_MSG, vendorSoftwareProductId, version.toString()));
+ }
+
+ /**
+ * Build error code.
+ *
+ * @return the error code
+ */
+ public ErrorCode build() {
+ return builder.build();
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/PackageNotFoundErrorBuilder.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/PackageNotFoundErrorBuilder.java
new file mode 100644
index 0000000000..3a32fa30b1
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/PackageNotFoundErrorBuilder.java
@@ -0,0 +1,71 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.errors;
+
+import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.PACKAGE_NOT_FOUND;
+
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+/**
+ * The type Package not found error builder.
+ */
+public class PackageNotFoundErrorBuilder {
+ private static final String PACKAGE_VERSION_NOT_FOUND_MSG =
+ "Package for vendor software product with Id %s and version %s does not exist.";
+ private static final String PACKAGE_NOT_FOUND_MSG =
+ "Package for vendor software product with Id %s does not exist.";
+ private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
+
+ /**
+ * Instantiates a new Package not found error builder.
+ *
+ * @param vendorSoftwareProductId the vendor software product id
+ * @param version the version
+ */
+ public PackageNotFoundErrorBuilder(String vendorSoftwareProductId, Version version) {
+ builder.withId(PACKAGE_NOT_FOUND);
+ builder.withCategory(ErrorCategory.APPLICATION);
+ builder.withMessage(
+ String.format(PACKAGE_VERSION_NOT_FOUND_MSG, vendorSoftwareProductId, version.toString()));
+ }
+
+ /**
+ * Instantiates a new Package not found error builder.
+ *
+ * @param vendorSoftwareProductId the vendor software product id
+ */
+ public PackageNotFoundErrorBuilder(String vendorSoftwareProductId) {
+ builder.withId(PACKAGE_NOT_FOUND);
+ builder.withCategory(ErrorCategory.APPLICATION);
+ builder.withMessage(String.format(PACKAGE_NOT_FOUND_MSG, vendorSoftwareProductId));
+ }
+
+ /**
+ * Build error code.
+ *
+ * @return the error code
+ */
+ public ErrorCode build() {
+ return builder.build();
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/TranslationFileCreationErrorBuilder.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/TranslationFileCreationErrorBuilder.java
new file mode 100644
index 0000000000..2267e1d80a
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/TranslationFileCreationErrorBuilder.java
@@ -0,0 +1,60 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.errors;
+
+import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes
+ .TRANSLATION_FILE_CREATION;
+
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+/**
+ * The type Translation file creation error builder.
+ */
+public class TranslationFileCreationErrorBuilder {
+ private static final String TRANSLATION_FILE_CREATION_ERROR_MSG =
+ "Error while trying to create translation file from the package of vendor software "
+ + "product with Id %s and version %s.";
+ private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
+
+ /**
+ * Instantiates a new Translation file creation error builder.
+ *
+ * @param vendorSoftwareProductId the vendor software product id
+ * @param version the version
+ */
+ public TranslationFileCreationErrorBuilder(String vendorSoftwareProductId, Version version) {
+ builder.withId(TRANSLATION_FILE_CREATION);
+ builder.withCategory(ErrorCategory.SYSTEM);
+ builder.withMessage(String
+ .format(TRANSLATION_FILE_CREATION_ERROR_MSG, vendorSoftwareProductId, version.toString()));
+ }
+
+ /**
+ * Build error code.
+ *
+ * @return the error code
+ */
+ public ErrorCode build() {
+ return builder.build();
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/UploadInvalidErrorBuilder.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/UploadInvalidErrorBuilder.java
new file mode 100644
index 0000000000..0974af1c6a
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/UploadInvalidErrorBuilder.java
@@ -0,0 +1,82 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.errors;
+
+import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes
+ .UPLOAD_INVALID;
+
+import org.openecomp.sdc.common.errors.BaseErrorBuilder;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.datatypes.error.ErrorMessage;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * The type Upload invalid error builder.
+ */
+public class UploadInvalidErrorBuilder extends BaseErrorBuilder {
+ private static final String UPLOAD_INVALID_DETAILED_MSG =
+ "File uploaded for vendor software product with Id %s and version %s is invalid: %s";
+ private static final String UPLOAD_INVALID_MSG = "Uploaded file is invalid";
+
+ /**
+ * Instantiates a new Upload invalid error builder.
+ *
+ * @param vendorSoftwareProductId the vendor software product id
+ * @param version the version
+ * @param errors the errors
+ */
+ public UploadInvalidErrorBuilder(String vendorSoftwareProductId, Version version,
+ Map<String, List<ErrorMessage>> errors) {
+ getErrorCodeBuilder().withId(UPLOAD_INVALID);
+ getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION);
+ getErrorCodeBuilder().withMessage(String
+ .format(UPLOAD_INVALID_DETAILED_MSG, vendorSoftwareProductId, version.toString(),
+ toString(errors)));
+ }
+
+ /**
+ * Instantiates a new Upload invalid error builder.
+ */
+ public UploadInvalidErrorBuilder() {
+ getErrorCodeBuilder().withId(UPLOAD_INVALID);
+ getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION);
+ getErrorCodeBuilder().withMessage(UPLOAD_INVALID_MSG);
+ }
+
+ private String toString(Map<String, List<ErrorMessage>> errors) {
+ StringBuffer sb = new StringBuffer();
+ errors.entrySet().stream()
+ .forEach(entry -> singleErrorToString(sb, entry.getKey(), entry.getValue()));
+ return sb.toString();
+ }
+
+ private void singleErrorToString(StringBuffer sb, String fileName, List<ErrorMessage> errors) {
+ sb.append(System.lineSeparator());
+ sb.append(fileName);
+ sb.append(sb.append(": "));
+ errors.stream().forEach(
+ error -> sb.append(error.getMessage()).append("[").append(error.getLevel()).append("], "));
+ }
+
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductErrorCodes.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductErrorCodes.java
new file mode 100644
index 0000000000..369e99d75f
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductErrorCodes.java
@@ -0,0 +1,48 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.errors;
+
+public class VendorSoftwareProductErrorCodes {
+
+ public static final String VSP_NOT_FOUND = "VSP_NOT_FOUND";
+ public static final String VSP_INVALID = "VSP_INVALID";
+
+ public static final String UPLOAD_INVALID = "UPLOAD_INVALID";
+
+ public static final String PACKAGE_NOT_FOUND = "PACKAGE_NOT_FOUND";
+
+ public static final String PACKAGE_INVALID = "PACKAGE_INVALID";
+ public static final String VSP_COMPOSITION_EDIT_NOT_ALLOWED = "VSP_COMPOSITION_EDIT_NOT_ALLOWED";
+
+ public static final String CREATE_PACKAGE_FOR_NON_FINAL_VSP = "CREATE_PACKAGE_FOR_NON_FINAL_VSP";
+
+ public static final String TRANSLATION_FILE_CREATION = "TRANSLATION_FILE_CREATION";
+
+ public static final String HEAT_PACKAGE_FILE_CREATION = "HEAT_PACKAGE_FILE_CREATION";
+
+ public static final String TOSCA_ENTRY_NOT_FOUND = "TOSCA_ENTRY_NOT_FOUND";
+ public static final String TOSCA_INVALID_SUBSTITUTE_NODE_TEMPLATE =
+ "TOSCA_INVALID_SUBSTITUTE_NODE_TEMPLATE";
+
+ public static final String MIB_UPLOAD_INVALID = "MIB_UPLOAD_INVALID";
+
+
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductInvalidErrorBuilder.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductInvalidErrorBuilder.java
new file mode 100644
index 0000000000..1439563b17
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductInvalidErrorBuilder.java
@@ -0,0 +1,60 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.errors;
+
+import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.VSP_INVALID;
+
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+
+/**
+ * The type Vendor software product invalid error builder.
+ */
+public class VendorSoftwareProductInvalidErrorBuilder {
+ private static final String VSP_INVALID_MSG =
+ "Vendor software product with Id %s and version %s is invalid - does not contain "
+ + "service model.";
+ private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
+
+ /**
+ * Instantiates a new Vendor software product invalid error builder.
+ *
+ * @param vendorSoftwareProductId the vendor software product id
+ * @param version the version
+ */
+ public VendorSoftwareProductInvalidErrorBuilder(String vendorSoftwareProductId, Version version) {
+ builder.withId(VSP_INVALID);
+ builder.withCategory(ErrorCategory.APPLICATION);
+ builder
+ .withMessage(String.format(VSP_INVALID_MSG, vendorSoftwareProductId, version.toString()));
+ }
+
+ /**
+ * Build error code.
+ *
+ * @return the error code
+ */
+ public ErrorCode build() {
+ return builder.build();
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductNotFoundErrorBuilder.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductNotFoundErrorBuilder.java
new file mode 100644
index 0000000000..89fc08cdb0
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductNotFoundErrorBuilder.java
@@ -0,0 +1,54 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.errors;
+
+import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.VSP_NOT_FOUND;
+
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+
+/**
+ * The type Vendor software product not found error builder.
+ */
+public class VendorSoftwareProductNotFoundErrorBuilder {
+ private static final String VSP_FOUND_MSG = "Vendor software product with Id %s not found.";
+ private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
+
+ /**
+ * Instantiates a new Vendor software product not found error builder.
+ *
+ * @param vendorSoftwareProductId the vendor software product id
+ */
+ public VendorSoftwareProductNotFoundErrorBuilder(String vendorSoftwareProductId) {
+ builder.withId(VSP_NOT_FOUND);
+ builder.withCategory(ErrorCategory.APPLICATION);
+ builder.withMessage(String.format(VSP_FOUND_MSG, vendorSoftwareProductId));
+ }
+
+ /**
+ * Build error code.
+ *
+ * @return the error code
+ */
+ public ErrorCode build() {
+ return builder.build();
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java
new file mode 100644
index 0000000000..191c8d728c
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java
@@ -0,0 +1,1567 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.impl;
+
+import static org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants.CSAR;
+import static org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants.GENERAL_COMPONENT_ID;
+import static org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants.UPLOAD_RAW_DATA;
+import static org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE;
+import static org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants.VSP_PACKAGE_ZIP;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.MapUtils;
+import org.openecomp.core.enrichment.EnrichmentArtifactsServiceFactory;
+import org.openecomp.core.enrichment.api.EnrichmentManager;
+import org.openecomp.core.enrichment.enrichmentartifacts.EnrichmentArtifactsService;
+import org.openecomp.core.enrichment.factory.EnrichmentManagerFactory;
+import org.openecomp.core.enrichment.types.ComponentArtifactType;
+import org.openecomp.core.model.dao.EnrichedServiceModelDao;
+import org.openecomp.core.model.dao.EnrichedServiceModelDaoFactory;
+import org.openecomp.core.model.dao.ServiceModelDao;
+import org.openecomp.core.model.dao.ServiceModelDaoFactory;
+import org.openecomp.core.model.types.ServiceElement;
+import org.openecomp.core.util.UniqueValueUtil;
+import org.openecomp.core.utilities.CommonMethods;
+import org.openecomp.core.utilities.file.FileContentHandler;
+import org.openecomp.core.utilities.file.FileUtils;
+import org.openecomp.core.utilities.json.JsonSchemaDataGenerator;
+import org.openecomp.core.utilities.json.JsonUtil;
+import org.openecomp.core.validation.api.ValidationManager;
+import org.openecomp.core.validation.errors.Messages;
+import org.openecomp.core.validation.types.MessageContainerUtil;
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+import org.openecomp.sdc.common.errors.ValidationErrorBuilder;
+import org.openecomp.sdc.common.utils.AsdcCommon;
+import org.openecomp.sdc.datatypes.error.ErrorLevel;
+import org.openecomp.sdc.datatypes.error.ErrorMessage;
+import org.openecomp.sdc.enrichment.impl.tosca.ComponentInfo;
+import org.openecomp.sdc.heat.datatypes.structure.HeatStructureTree;
+import org.openecomp.sdc.heat.datatypes.structure.ValidationStructureList;
+import org.openecomp.sdc.heat.services.tree.HeatTreeManager;
+import org.openecomp.sdc.heat.services.tree.HeatTreeManagerUtil;
+import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
+import org.openecomp.sdc.tosca.services.impl.ToscaFileOutputServiceCsarImpl;
+import org.openecomp.sdc.validation.utils.ValidationManagerUtil;
+import org.openecomp.sdc.vendorlicense.VendorLicenseArtifactServiceFactory;
+import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacade;
+import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacadeFactory;
+import org.openecomp.sdc.vendorlicense.licenseartifacts.VendorLicenseArtifactsService;
+import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants;
+import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductManager;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentArtifactDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentArtifactDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentArtifactEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.PackageInfo;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessArtifactEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.UploadDataEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspQuestionnaireEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.errors.CreatePackageForNonFinalVendorSoftwareProductErrorBuilder;
+import org.openecomp.sdc.vendorsoftwareproduct.errors.FileCreationErrorBuilder;
+import org.openecomp.sdc.vendorsoftwareproduct.errors.MibUploadErrorBuilder;
+import org.openecomp.sdc.vendorsoftwareproduct.errors.PackageInvalidErrorBuilder;
+import org.openecomp.sdc.vendorsoftwareproduct.errors.PackageNotFoundErrorBuilder;
+import org.openecomp.sdc.vendorsoftwareproduct.errors.TranslationFileCreationErrorBuilder;
+import org.openecomp.sdc.vendorsoftwareproduct.errors.UploadInvalidErrorBuilder;
+import org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes;
+import org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductInvalidErrorBuilder;
+import org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductNotFoundErrorBuilder;
+import org.openecomp.sdc.vendorsoftwareproduct.services.CompositionDataExtractor;
+import org.openecomp.sdc.vendorsoftwareproduct.services.CompositionEntityDataManager;
+import org.openecomp.sdc.vendorsoftwareproduct.services.SchemaGenerator;
+import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityResponse;
+import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityValidationData;
+import org.openecomp.sdc.vendorsoftwareproduct.types.QuestionnaireResponse;
+import org.openecomp.sdc.vendorsoftwareproduct.types.QuestionnaireValidationResult;
+import org.openecomp.sdc.vendorsoftwareproduct.types.UploadFileResponse;
+import org.openecomp.sdc.vendorsoftwareproduct.types.ValidationResponse;
+import org.openecomp.sdc.vendorsoftwareproduct.types.VersionedVendorSoftwareProductInfo;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Component;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionData;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic;
+import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.ComponentCompositionSchemaInput;
+import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.ComponentQuestionnaireSchemaInput;
+import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.MibUploadStatus;
+import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.NetworkCompositionSchemaInput;
+import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.NicCompositionSchemaInput;
+import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.SchemaTemplateContext;
+import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.SchemaTemplateInput;
+import org.openecomp.sdc.vendorsoftwareproduct.util.CompilationUtil;
+import org.openecomp.sdc.vendorsoftwareproduct.util.VendorSoftwareProductUtils;
+import org.openecomp.sdc.versioning.VersioningManager;
+import org.openecomp.sdc.versioning.VersioningManagerFactory;
+import org.openecomp.sdc.versioning.VersioningUtil;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.dao.types.VersionStatus;
+import org.openecomp.sdc.versioning.errors.RequestedVersionInvalidErrorBuilder;
+import org.openecomp.sdc.versioning.types.VersionInfo;
+import org.openecomp.sdc.versioning.types.VersionableEntityAction;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+/**
+ * The type Vendor software product manager.
+ */
+public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductManager {
+
+ private static final String VSP_COMPOSITION_EDIT_NOT_ALLOWED_MSG =
+ "Composition entities may not be created / deleted for Vendor Software Product whose "
+ + "entities were uploaded";
+
+ private static final VersioningManager versioningManager =
+ VersioningManagerFactory.getInstance().createInterface();
+ private static final VendorSoftwareProductDao vendorSoftwareProductDao =
+ VendorSoftwareProductDaoFactory.getInstance().createInterface();
+ private static final VendorLicenseFacade vendorLicenseFacade =
+ VendorLicenseFacadeFactory.getInstance().createInterface();
+ private static final ComponentArtifactDao componentArtifactDao =
+ ComponentArtifactDaoFactory.getInstance().createInterface();
+ private static final ServiceModelDao<ToscaServiceModel, ServiceElement> serviceModelDao =
+ ServiceModelDaoFactory.getInstance().createInterface();
+ private static final EnrichedServiceModelDao<ToscaServiceModel, ServiceElement>
+ enrichedServiceModelDao = EnrichedServiceModelDaoFactory.getInstance().createInterface();
+ private static VendorLicenseArtifactsService licenseArtifactsService =
+ VendorLicenseArtifactServiceFactory.getInstance().createInterface();
+ private static EnrichmentArtifactsService enrichmentArtifactsService =
+ EnrichmentArtifactsServiceFactory.getInstance().createInterface();
+
+
+ /**
+ * Instantiates a new Vendor software product manager.
+ */
+ public VendorSoftwareProductManagerImpl() {
+ vendorSoftwareProductDao.registerVersioning(VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE);
+ serviceModelDao.registerVersioning(VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE);
+ enrichedServiceModelDao.registerVersioning(VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE);
+ componentArtifactDao.registerVersioning(VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE);
+ }
+
+ private static List<ErrorCode> validateCompletedVendorSoftwareProduct(VspDetails vspDetails,
+ UploadDataEntity uploadData,
+ Object serviceModel) {
+ List<ErrorCode> errros = new ArrayList<>();
+
+ if (vspDetails.getName() == null) {
+ errros.add(createMissingMandatoryFieldError("name"));
+ }
+ if (vspDetails.getDescription() == null) {
+ errros.add(createMissingMandatoryFieldError("description"));
+ }
+ if (vspDetails.getVendorId() == null) {
+ errros.add(createMissingMandatoryFieldError("vendor Id"));
+ }
+ if (vspDetails.getVlmVersion() == null) {
+ errros.add(createMissingMandatoryFieldError(
+ "licensing version (in the format of: {integer}.{integer})"));
+ }
+ if (vspDetails.getCategory() == null) {
+ errros.add(createMissingMandatoryFieldError("category"));
+ }
+ if (vspDetails.getSubCategory() == null) {
+ errros.add(createMissingMandatoryFieldError("sub category"));
+ }
+ if (vspDetails.getLicenseAgreement() == null) {
+ errros.add(createMissingMandatoryFieldError("license agreement"));
+ }
+ if (CollectionUtils.isEmpty(vspDetails.getFeatureGroups())) {
+ errros.add(createMissingMandatoryFieldError("feature groups"));
+ }
+ if (uploadData == null || uploadData.getContentData() == null || serviceModel == null) {
+ errros.add(
+ new VendorSoftwareProductInvalidErrorBuilder(vspDetails.getId(), vspDetails.getVersion())
+ .build());
+ }
+
+ return errros.isEmpty() ? null : errros;
+ }
+
+ private static ErrorCode createMissingMandatoryFieldError(String fieldName) {
+ return new ValidationErrorBuilder("must be supplied", fieldName).build();
+ }
+
+ private static String getVspQuestionnaireSchema(SchemaTemplateInput schemaInput) {
+ return SchemaGenerator
+ .generate(SchemaTemplateContext.questionnaire, CompositionEntityType.vsp, schemaInput);
+ }
+
+ private static String getComponentQuestionnaireSchema(SchemaTemplateInput schemaInput) {
+ return SchemaGenerator
+ .generate(SchemaTemplateContext.questionnaire, CompositionEntityType.component,
+ schemaInput);
+ }
+
+ private static String getNicQuestionnaireSchema(SchemaTemplateInput schemaInput) {
+ return SchemaGenerator
+ .generate(SchemaTemplateContext.questionnaire, CompositionEntityType.nic, schemaInput);
+ }
+
+ private static void sortVspListByModificationTimeDescOrder(
+ List<VersionedVendorSoftwareProductInfo> vendorLicenseModels) {
+ Collections.sort(vendorLicenseModels, new Comparator<VersionedVendorSoftwareProductInfo>() {
+ @Override
+ public int compare(VersionedVendorSoftwareProductInfo o1,
+ VersionedVendorSoftwareProductInfo o2) {
+ return o2.getVspDetails().getWritetimeMicroSeconds()
+ .compareTo(o1.getVspDetails().getWritetimeMicroSeconds());
+ }
+ });
+ }
+
+ private boolean isManual(String vspId, Version version) {
+ return false;
+ }
+
+ @Override
+ public Version checkout(String vendorSoftwareProductId, String user) {
+ Version newVersion = versioningManager
+ .checkout(VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, vendorSoftwareProductId, user);
+ vendorSoftwareProductDao.updateVspLatestModificationTime(vendorSoftwareProductId, newVersion);
+ return newVersion;
+ }
+
+ @Override
+ public Version undoCheckout(String vendorSoftwareProductId, String user) {
+ Version newVersion = versioningManager
+ .undoCheckout(VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, vendorSoftwareProductId, user);
+ vendorSoftwareProductDao.updateVspLatestModificationTime(vendorSoftwareProductId, newVersion);
+ return newVersion;
+ }
+
+ @Override
+ public Version checkin(String vendorSoftwareProductId, String user) {
+ Version newVersion = versioningManager
+ .checkin(VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, vendorSoftwareProductId, user, null);
+ vendorSoftwareProductDao.updateVspLatestModificationTime(vendorSoftwareProductId, newVersion);
+ return newVersion;
+ }
+
+ @Override
+ public ValidationResponse submit(String vendorSoftwareProductId, String user) throws IOException {
+ VspDetails vspDetails = getVspDetails(vendorSoftwareProductId, null, user).getVspDetails();
+ UploadDataEntity uploadData = vendorSoftwareProductDao
+ .getUploadData(new UploadDataEntity(vendorSoftwareProductId, vspDetails.getVersion()));
+ ToscaServiceModel serviceModel =
+ serviceModelDao.getServiceModel(vendorSoftwareProductId, vspDetails.getVersion());
+ Version newVersion = null;
+
+ ValidationResponse validationResponse = new ValidationResponse();
+ validationResponse
+ .setVspErrors(validateCompletedVendorSoftwareProduct(vspDetails, uploadData, serviceModel));
+ validationResponse.setLicensingDataErrors(validateLicensingData(vspDetails));
+ validationResponse.setUploadDataErrors(validateUploadData(uploadData));
+ validationResponse.setQuestionnaireValidationResult(
+ validateQuestionnaire(vspDetails.getId(), vspDetails.getVersion()));
+ validationResponse.setCompilationErrors(
+ compile(vendorSoftwareProductId, vspDetails.getVersion(), serviceModel));
+
+ if (validationResponse.isValid()) {
+ newVersion = versioningManager
+ .submit(VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, vendorSoftwareProductId, user, null);
+ }
+ //vendorSoftwareProductDao.updateVspLatestModificationTime(vendorSoftwareProductId, newVersion);
+ return validationResponse;
+ }
+
+ private Map<String, List<ErrorMessage>> compile(String vendorSoftwareProductId, Version version,
+ ToscaServiceModel serviceModel) {
+ Collection<ComponentEntity> components = listComponents(vendorSoftwareProductId, version);
+ if (serviceModel == null) {
+ return null;
+ }
+ if (CollectionUtils.isEmpty(components)) {
+ enrichedServiceModelDao.storeServiceModel(vendorSoftwareProductId, version, serviceModel);
+ return null;
+ }
+ EnrichmentManager<ToscaServiceModel> enrichmentManager =
+ EnrichmentManagerFactory.getInstance().createInterface();
+ enrichmentManager.initInput(vendorSoftwareProductId, version);
+ enrichmentManager.addModel(serviceModel);
+
+ ComponentInfo componentInfo = new ComponentInfo();
+ Map<String, List<ErrorMessage>> compileErrors = new HashMap<>();
+ CompilationUtil.addMonitoringInfo(componentInfo, compileErrors);
+ for (ComponentEntity componentEntity : components) {
+ ComponentInfo currentEntityComponentInfo = new ComponentInfo();
+ currentEntityComponentInfo.setCeilometerInfo(componentInfo.getCeilometerInfo());
+ CompilationUtil
+ .addMibInfo(vendorSoftwareProductId, version, componentEntity, currentEntityComponentInfo,
+ compileErrors);
+ enrichmentManager.addEntityInput(componentEntity.getComponentCompositionData().getName(),
+ currentEntityComponentInfo);
+
+ }
+ Map<String, List<ErrorMessage>> enrichErrors;
+ enrichErrors = enrichmentManager.enrich();
+ enrichedServiceModelDao
+ .storeServiceModel(vendorSoftwareProductId, version, enrichmentManager.getModel());
+ if (enrichErrors != null) {
+ compileErrors.putAll(enrichErrors);
+ }
+
+ vendorSoftwareProductDao.updateVspLatestModificationTime(vendorSoftwareProductId, version);
+
+ return compileErrors;
+ }
+
+ private Collection<ErrorCode> validateLicensingData(VspDetails vspDetails) {
+ if (vspDetails.getVendorId() == null || vspDetails.getVlmVersion() == null
+ || vspDetails.getLicenseAgreement() == null
+ || CollectionUtils.isEmpty(vspDetails.getFeatureGroups())) {
+ return null;
+ }
+ return vendorLicenseFacade
+ .validateLicensingData(vspDetails.getVendorId(), vspDetails.getVlmVersion(),
+ vspDetails.getLicenseAgreement(), vspDetails.getFeatureGroups());
+ }
+
+ @Override
+ public VspDetails createNewVsp(VspDetails vspDetails, String user) {
+ UniqueValueUtil.validateUniqueValue(
+ VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME,
+ vspDetails.getName());
+ vspDetails.setId(CommonMethods.nextUuId());
+
+ // vspDetails.setLastModificationTime(new Date());
+
+ Version version = versioningManager
+ .create(VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, vspDetails.getId(), user);
+ vspDetails.setVersion(version);
+
+ // vspDetails.setLastModificationTime(new Date());
+
+ vendorSoftwareProductDao.createVendorSoftwareProductInfo(vspDetails);
+ vendorSoftwareProductDao.updateQuestionnaire(vspDetails.getId(), version,
+ new JsonSchemaDataGenerator(getVspQuestionnaireSchema(null)).generateData());
+ UniqueValueUtil
+ .createUniqueValue(VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME,
+ vspDetails.getName());
+
+ return vspDetails;
+ }
+
+ @Override
+ public List<VersionedVendorSoftwareProductInfo> getVspList(String versionFilter, String user) {
+ Map<String, VersionInfo> idToVersionsInfo = versioningManager
+ .listEntitiesVersionInfo(VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, user,
+ VersionableEntityAction.Read);
+
+ List<VersionedVendorSoftwareProductInfo> vsps = new ArrayList<>();
+ for (Map.Entry<String, VersionInfo> entry : idToVersionsInfo.entrySet()) {
+ VersionInfo versionInfo = entry.getValue();
+ if (versionFilter != null && versionFilter.equals(VersionStatus.Final.name())) {
+ if (versionInfo.getLatestFinalVersion() == null) {
+ continue;
+ }
+ versionInfo.setActiveVersion(versionInfo.getLatestFinalVersion());
+ versionInfo.setStatus(VersionStatus.Final);
+ versionInfo.setLockingUser(null);
+ }
+
+ VspDetails vsp = vendorSoftwareProductDao.getVendorSoftwareProductInfo(
+ new VspDetails(entry.getKey(), entry.getValue().getActiveVersion()));
+ if (vsp != null) {
+ vsp.setValidationDataStructure(null);
+ vsps.add(new VersionedVendorSoftwareProductInfo(vsp, entry.getValue()));
+ }
+ }
+
+ sortVspListByModificationTimeDescOrder(vsps);
+ return vsps;
+ }
+
+ @Override
+ public void updateVsp(VspDetails vspDetails, String user) {
+ Version activeVersion =
+ getVersionInfo(vspDetails.getId(), VersionableEntityAction.Write, user).getActiveVersion();
+ vspDetails.setVersion(activeVersion);
+ // vspDetails.setLastModificationTime(new Date());
+
+ VspDetails retrieved = vendorSoftwareProductDao.getVendorSoftwareProductInfo(vspDetails);
+ vspDetails.setValidationData(retrieved.getValidationData());
+ UniqueValueUtil
+ .updateUniqueValue(VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME,
+ retrieved.getName(), vspDetails.getName());
+ vendorSoftwareProductDao.updateVendorSoftwareProductInfo(vspDetails);
+
+ vendorSoftwareProductDao.updateVspLatestModificationTime(vspDetails.getId(), activeVersion);
+ }
+
+ @Override
+ public VersionedVendorSoftwareProductInfo getVspDetails(String vspId, Version version,
+ String user) {
+ VersionInfo versionInfo = getVersionInfo(vspId, VersionableEntityAction.Read, user);
+ if (version == null) {
+ version = versionInfo.getActiveVersion();
+ } else {
+ if (!versionInfo.getViewableVersions().contains(version)) {
+ throw new CoreException(new RequestedVersionInvalidErrorBuilder().build());
+ }
+ }
+
+ VspDetails vendorSoftwareProductInfo =
+ vendorSoftwareProductDao.getVendorSoftwareProductInfo(new VspDetails(vspId, version));
+ if (vendorSoftwareProductInfo == null) {
+ throw new CoreException(new VendorSoftwareProductNotFoundErrorBuilder(vspId).build());
+ }
+ return new VersionedVendorSoftwareProductInfo(vendorSoftwareProductInfo, versionInfo);
+ }
+
+ @Override
+ public void deleteVsp(String vspId, String user) {
+ throw new UnsupportedOperationException("Unsupported operation for 1607 release.");
+ }
+
+ @Override
+ public UploadFileResponse uploadFile(String vspId, InputStream heatFileToUpload, String user) {
+ Version activeVersion =
+ getVersionInfo(vspId, VersionableEntityAction.Write, user).getActiveVersion();
+ UploadFileResponse uploadFileResponse = new UploadFileResponse();
+
+ if (heatFileToUpload == null) {
+ uploadFileResponse.addStructureError(AsdcCommon.UPLOAD_FILE,
+ new ErrorMessage(ErrorLevel.ERROR,
+ Messages.NO_ZIP_FILE_WAS_UPLOADED_OR_ZIP_NOT_EXIST.getErrorMessage()));
+ return uploadFileResponse;
+ }
+
+ InputStream uploadedFileData;
+ FileContentHandler fileContentMap;
+ Map<String, List<ErrorMessage>> errors = new HashMap<>();
+ try {
+ fileContentMap = getContent(heatFileToUpload, errors);
+ if (!errors.isEmpty()) {
+ return addStructureErrorsToResponse(uploadFileResponse, errors);
+ }
+
+ uploadedFileData = fileContentMap.getFileContent(UPLOAD_RAW_DATA);
+ fileContentMap.remove(UPLOAD_RAW_DATA);
+
+ ValidationManagerUtil.handleMissingManifest(fileContentMap, errors);
+ if (!errors.isEmpty()) {
+ return addStructureErrorsToResponse(uploadFileResponse, errors);
+ }
+
+ } catch (CoreException ce) {
+ ErrorMessage.ErrorMessageUtil.addMessage(AsdcCommon.UPLOAD_FILE, errors)
+ .add(new ErrorMessage(ErrorLevel.ERROR, ce.getMessage()));
+ return addStructureErrorsToResponse(uploadFileResponse, errors);
+ }
+
+ HeatStructureTree tree = createAndValidateHeatTree(uploadFileResponse, fileContentMap);
+
+ deleteUploadDataAndContent(vspId, activeVersion);
+ saveHotData(vspId, activeVersion, uploadedFileData, fileContentMap, tree);
+
+ vendorSoftwareProductDao.updateVspLatestModificationTime(vspId, activeVersion);
+
+ ToscaServiceModel toscaServiceModel =
+ VendorSoftwareProductUtils.loadAndTranslateTemplateData(fileContentMap)
+ .getToscaServiceModel();
+ if (toscaServiceModel != null) {
+ serviceModelDao.storeServiceModel(vspId, activeVersion, toscaServiceModel);
+ saveCompositionData(vspId, activeVersion,
+ CompositionDataExtractor.extractServiceCompositionData(toscaServiceModel));
+ }
+
+ return uploadFileResponse;
+ }
+
+ private UploadFileResponse addStructureErrorsToResponse(UploadFileResponse uploadFileResponse,
+ Map<String, List<ErrorMessage>> errors) {
+ uploadFileResponse.addStructureErrors(errors);
+ return uploadFileResponse;
+ }
+
+ private HeatStructureTree createAndValidateHeatTree(UploadFileResponse uploadFileResponse,
+ FileContentHandler fileContentMap) {
+ VendorSoftwareProductUtils.addFileNamesToUploadFileResponse(fileContentMap, uploadFileResponse);
+ Map<String, List<ErrorMessage>> validationErrors =
+ ValidationManagerUtil.initValidationManager(fileContentMap).validate();
+ uploadFileResponse.getErrors().putAll(validationErrors);
+
+ HeatTreeManager heatTreeManager = HeatTreeManagerUtil.initHeatTreeManager(fileContentMap);
+ heatTreeManager.createTree();
+ heatTreeManager.addErrors(validationErrors);
+ return heatTreeManager.getTree();
+ }
+
+ private void saveHotData(String vspId, Version activeVersion, InputStream uploadedFileData,
+ FileContentHandler fileContentMap, HeatStructureTree tree) {
+ Map<String, Object> manifestAsMap = (Map<String, Object>) JsonUtil
+ .json2Object(fileContentMap.getFileContent(AsdcCommon.MANIFEST_NAME), Map.class);
+
+ UploadDataEntity uploadData = new UploadDataEntity(vspId, activeVersion);
+ uploadData.setPackageName((String) manifestAsMap.get("name"));
+ uploadData.setPackageVersion((String) manifestAsMap.get("version"));
+ uploadData.setContentData(ByteBuffer.wrap(FileUtils.toByteArray(uploadedFileData)));
+ uploadData.setValidationDataStructure(new ValidationStructureList(tree));
+ vendorSoftwareProductDao.updateUploadData(uploadData);
+ }
+
+ private FileContentHandler getContent(InputStream heatFileToUpload,
+ Map<String, List<ErrorMessage>> errors) {
+ FileContentHandler contentMap = null;
+ byte[] uploadedFileData;
+ try {
+ uploadedFileData = FileUtils.toByteArray(heatFileToUpload);
+ VendorSoftwareProductUtils.validateRawZipData(uploadedFileData, errors);
+ contentMap = VendorSoftwareProductUtils.loadUploadFileContent(uploadedFileData);
+ VendorSoftwareProductUtils.validateContentZipData(contentMap, errors);
+ contentMap.addFile(UPLOAD_RAW_DATA, uploadedFileData);
+ } catch (IOException e0) {
+ ErrorMessage.ErrorMessageUtil.addMessage(AsdcCommon.UPLOAD_FILE, errors)
+ .add(new ErrorMessage(ErrorLevel.ERROR, Messages.INVALID_ZIP_FILE.getErrorMessage()));
+ }
+ return contentMap;
+ }
+
+ private void validateMibZipContent(String vspId, Version version, byte[] uploadedFileData,
+ Map<String, List<ErrorMessage>> errors) {
+ FileContentHandler contentMap;
+ try {
+ contentMap = VendorSoftwareProductUtils.loadUploadFileContent(uploadedFileData);
+ VendorSoftwareProductUtils.validateContentZipData(contentMap, errors);
+ } catch (IOException e0) {
+ throw new CoreException(
+ new MibUploadErrorBuilder(vspId, version, Messages.INVALID_ZIP_FILE.getErrorMessage())
+ .build());
+ }
+ }
+
+ @Override
+ public List<PackageInfo> listPackages(String category, String subCategory) {
+ return vendorSoftwareProductDao.listPackages(category, subCategory);
+ }
+
+ @Override
+ public File getTranslatedFile(String vspId, Version version, String user) {
+ VersionInfo versionInfo = getVersionInfo(vspId, VersionableEntityAction.Read, user);
+ if (version == null) {
+ if (versionInfo.getLatestFinalVersion() == null) {
+ throw new CoreException(new PackageNotFoundErrorBuilder(vspId).build());
+ }
+ version = versionInfo.getLatestFinalVersion();
+ } else {
+ if (!version.isFinal() || !versionInfo.getViewableVersions().contains(version)) {
+ throw new CoreException(new RequestedVersionInvalidErrorBuilder().build());
+ }
+ }
+
+ PackageInfo packageInfo =
+ vendorSoftwareProductDao.getPackageInfo(new PackageInfo(vspId, version));
+ if (packageInfo == null) {
+ throw new CoreException(new PackageNotFoundErrorBuilder(vspId, version).build());
+ }
+
+ ByteBuffer translatedFileBuffer = packageInfo.getTranslatedFile();
+ if (translatedFileBuffer == null) {
+ throw new CoreException(new PackageInvalidErrorBuilder(vspId, version).build());
+ }
+
+ File translatedFile = new File(VSP_PACKAGE_ZIP);
+
+ try {
+ FileOutputStream fos = new FileOutputStream(translatedFile);
+ fos.write(translatedFileBuffer.array());
+ fos.close();
+ } catch (IOException e0) {
+ throw new CoreException(new TranslationFileCreationErrorBuilder(vspId, version).build(), e0);
+ }
+
+ return translatedFile;
+ }
+
+ @Override
+ public File getLatestHeatPackage(String vspId,
+ String user) { //todo remove the writing to file system..
+ VersionInfo versionInfo = getVersionInfo(vspId, VersionableEntityAction.Read, user);
+ Version version = versionInfo.getActiveVersion();
+
+ UploadDataEntity uploadData =
+ vendorSoftwareProductDao.getUploadData(new UploadDataEntity(vspId, version));
+
+ ByteBuffer contentData = uploadData.getContentData();
+ if (contentData == null) {
+ return null;
+ }
+
+ File heatPkgFile = new File(String.format("heats-for-%s.zip", vspId));
+
+ try {
+ FileOutputStream fos = new FileOutputStream(heatPkgFile);
+ fos.write(contentData.array());
+ fos.close();
+ } catch (IOException e0) {
+ throw new CoreException(new FileCreationErrorBuilder(vspId).build(), e0);
+ }
+ return heatPkgFile;
+ }
+
+ @Override
+ public PackageInfo createPackage(String vspId, String user) throws IOException {
+ VersionInfo versionInfo = getVersionInfo(vspId, VersionableEntityAction.Read, user);
+ Version activeVersion = versionInfo.getActiveVersion();
+ if (!activeVersion.isFinal()) {
+ throw new CoreException(
+ new CreatePackageForNonFinalVendorSoftwareProductErrorBuilder(vspId, activeVersion)
+ .build());
+ }
+
+ ToscaServiceModel toscaServiceModel =
+ enrichedServiceModelDao.getServiceModel(vspId, activeVersion);
+ VspDetails vspDetails =
+ vendorSoftwareProductDao.getVendorSoftwareProductInfo(new VspDetails(vspId, activeVersion));
+ Version vlmVersion = vspDetails.getVlmVersion();
+
+ PackageInfo packageInfo = createPackageInfo(vspId, vspDetails);
+
+ ToscaFileOutputServiceCsarImpl toscaServiceTemplateServiceCsar =
+ new ToscaFileOutputServiceCsarImpl();
+ FileContentHandler licenseArtifacts = licenseArtifactsService
+ .createLicenseArtifacts(vspDetails.getId(), vspDetails.getVendorId(), vlmVersion,
+ vspDetails.getFeatureGroups(), user);
+ //todo add tosca validation here
+ packageInfo.setTranslatedFile(ByteBuffer.wrap(
+ toscaServiceTemplateServiceCsar.createOutputFile(toscaServiceModel, licenseArtifacts)));
+
+ vendorSoftwareProductDao.insertPackageDetails(packageInfo);
+
+ vendorSoftwareProductDao.updateVspLatestModificationTime(vspId, vspDetails.getVersion());
+
+ return packageInfo;
+ }
+
+ private PackageInfo createPackageInfo(String vspId, VspDetails vspDetails) {
+ PackageInfo packageInfo = new PackageInfo();
+ packageInfo.setVspId(vspId);
+ packageInfo.setVersion(vspDetails.getVersion());
+ packageInfo.setDisplayName(vspDetails.getPackageName());
+ packageInfo.setVspName(vspDetails.getName());
+ packageInfo.setVspDescription(vspDetails.getDescription());
+ packageInfo.setCategory(vspDetails.getCategory());
+ packageInfo.setSubCategory(vspDetails.getSubCategory());
+ packageInfo.setVendorName(vspDetails.getVendorName());
+ packageInfo.setPackageType(CSAR);
+ packageInfo.setVendorRelease("1.0"); //todo TBD
+ return packageInfo;
+ }
+
+ @Override
+ public QuestionnaireResponse getVspQuestionnaire(String vspId, Version version, String user) {
+ version = VersioningUtil
+ .resolveVersion(version, getVersionInfo(vspId, VersionableEntityAction.Read, user));
+
+ QuestionnaireResponse questionnaireResponse = new QuestionnaireResponse();
+ questionnaireResponse.setData(getVspQuestionnaire(vspId, version).getQuestionnaireData());
+ questionnaireResponse.setSchema(getVspQuestionnaireSchema(null));
+
+ return questionnaireResponse;
+ }
+
+ private VspQuestionnaireEntity getVspQuestionnaire(String vspId, Version version) {
+ VspQuestionnaireEntity retrieved = vendorSoftwareProductDao.getQuestionnaire(vspId, version);
+ VersioningUtil.validateEntityExistence(retrieved, new VspQuestionnaireEntity(vspId, version),
+ VspDetails.ENTITY_TYPE);
+ return retrieved;
+ }
+
+ @Override
+ public void updateVspQuestionnaire(String vspId, String questionnaireData, String user) {
+ Version activeVersion =
+ getVersionInfo(vspId, VersionableEntityAction.Write, user).getActiveVersion();
+
+ vendorSoftwareProductDao.updateVspLatestModificationTime(vspId, activeVersion);
+
+ vendorSoftwareProductDao.updateQuestionnaire(vspId, activeVersion, questionnaireData);
+ }
+
+ @Override
+ public Collection<NetworkEntity> listNetworks(String vspId, Version version, String user) {
+ version = VersioningUtil
+ .resolveVersion(version, getVersionInfo(vspId, VersionableEntityAction.Read, user));
+ return listNetworks(vspId, version);
+ }
+
+ private Collection<NetworkEntity> listNetworks(String vspId, Version version) {
+ return vendorSoftwareProductDao.listNetworks(vspId, version);
+ }
+
+ @Override
+ public NetworkEntity createNetwork(NetworkEntity network, String user) {
+ Version activeVersion =
+ getVersionInfo(network.getVspId(), VersionableEntityAction.Write, user).getActiveVersion();
+ network.setVersion(activeVersion);
+ if (!isManual(network.getVspId(), activeVersion)) {
+ throw new CoreException(
+ new ErrorCode.ErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION)
+ .withId(VendorSoftwareProductErrorCodes.VSP_COMPOSITION_EDIT_NOT_ALLOWED)
+ .withMessage(VSP_COMPOSITION_EDIT_NOT_ALLOWED_MSG).build());
+ }
+
+ vendorSoftwareProductDao.updateVspLatestModificationTime(network.getVspId(), activeVersion);
+ return null;
+ }
+
+ private NetworkEntity createNetwork(NetworkEntity network) {
+ network.setId(CommonMethods.nextUuId());
+ vendorSoftwareProductDao.createNetwork(network);
+
+ return network;
+ }
+
+ @Override
+ public CompositionEntityValidationData updateNetwork(NetworkEntity network, String user) {
+ Version activeVersion =
+ getVersionInfo(network.getVspId(), VersionableEntityAction.Write, user).getActiveVersion();
+ network.setVersion(activeVersion);
+ NetworkEntity retrieved = getNetwork(network.getVspId(), activeVersion, network.getId());
+
+ NetworkCompositionSchemaInput schemaInput = new NetworkCompositionSchemaInput();
+ schemaInput.setManual(isManual(network.getVspId(), activeVersion));
+ schemaInput.setNetwork(retrieved.getNetworkCompositionData());
+
+ CompositionEntityValidationData validationData = CompositionEntityDataManager
+ .validateEntity(network, SchemaTemplateContext.composition, schemaInput);
+ if (CollectionUtils.isEmpty(validationData.getErrors())) {
+ vendorSoftwareProductDao.updateNetwork(network);
+ }
+
+ vendorSoftwareProductDao.updateVspLatestModificationTime(network.getVspId(), activeVersion);
+
+ return validationData;
+ }
+
+ @Override
+ public CompositionEntityResponse<Network> getNetwork(String vspId, Version version,
+ String networkId, String user) {
+ version = VersioningUtil
+ .resolveVersion(version, getVersionInfo(vspId, VersionableEntityAction.Read, user));
+ NetworkEntity networkEntity = getNetwork(vspId, version, networkId);
+ Network network = networkEntity.getNetworkCompositionData();
+
+ NetworkCompositionSchemaInput schemaInput = new NetworkCompositionSchemaInput();
+ schemaInput.setManual(isManual(vspId, version));
+ schemaInput.setNetwork(network);
+
+ CompositionEntityResponse<Network> response = new CompositionEntityResponse<>();
+ response.setId(networkId);
+ response.setData(network);
+ response.setSchema(SchemaGenerator
+ .generate(SchemaTemplateContext.composition, CompositionEntityType.network, schemaInput));
+
+ return response;
+ }
+
+ private NetworkEntity getNetwork(String vspId, Version version, String networkId) {
+ NetworkEntity retrieved = vendorSoftwareProductDao.getNetwork(vspId, version, networkId);
+ VersioningUtil.validateEntityExistence(retrieved, new NetworkEntity(vspId, version, networkId),
+ VspDetails.ENTITY_TYPE);
+ return retrieved;
+ }
+
+ @Override
+ public void deleteNetwork(String vspId, String networkId, String user) {
+ Version activeVersion =
+ getVersionInfo(vspId, VersionableEntityAction.Write, user).getActiveVersion();
+ if (!isManual(vspId, activeVersion)) {
+ throw new CoreException(
+ new ErrorCode.ErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION)
+ .withId(VendorSoftwareProductErrorCodes.VSP_COMPOSITION_EDIT_NOT_ALLOWED)
+ .withMessage(VSP_COMPOSITION_EDIT_NOT_ALLOWED_MSG).build());
+ }
+
+ vendorSoftwareProductDao.updateVspLatestModificationTime(vspId, activeVersion);
+ }
+
+ @Override
+ public QuestionnaireResponse getComponentQuestionnaire(String vspId, Version version,
+ String componentId, String user) {
+ version = VersioningUtil
+ .resolveVersion(version, getVersionInfo(vspId, VersionableEntityAction.Read, user));
+
+ QuestionnaireResponse questionnaireResponse = new QuestionnaireResponse();
+ questionnaireResponse.setData(getComponent(vspId, version, componentId).getQuestionnaireData());
+ List<String> nicNames = listNics(vspId, version, componentId).stream()
+ .map(nic -> nic.getNicCompositionData().getName()).collect(Collectors.toList());
+ questionnaireResponse.setSchema(getComponentQuestionnaireSchema(
+ new ComponentQuestionnaireSchemaInput(nicNames,
+ JsonUtil.json2Object(questionnaireResponse.getData(), Map.class))));
+
+ return questionnaireResponse;
+ }
+
+ @Override
+ public void updateComponentQuestionnaire(String vspId, String componentId,
+ String questionnaireData, String user) {
+ Version activeVersion =
+ getVersionInfo(vspId, VersionableEntityAction.Write, user).getActiveVersion();
+ getComponent(vspId, activeVersion, componentId);
+
+ vendorSoftwareProductDao
+ .updateComponentQuestionnaire(vspId, activeVersion, componentId, questionnaireData);
+
+ vendorSoftwareProductDao.updateVspLatestModificationTime(vspId, activeVersion);
+ }
+
+ @Override
+ public Collection<ComponentEntity> listComponents(String vspId, Version version, String user) {
+ version = VersioningUtil
+ .resolveVersion(version, getVersionInfo(vspId, VersionableEntityAction.Read, user));
+ return listComponents(vspId, version);
+ }
+
+ private Collection<ComponentEntity> listComponents(String vspId, Version version) {
+ return vendorSoftwareProductDao.listComponents(vspId, version);
+ }
+
+ @Override
+ public void deleteComponents(String vspId, String user) {
+ Version activeVersion =
+ getVersionInfo(vspId, VersionableEntityAction.Write, user).getActiveVersion();
+ if (!isManual(vspId, activeVersion)) {
+ throw new CoreException(
+ new ErrorCode.ErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION)
+ .withId(VendorSoftwareProductErrorCodes.VSP_COMPOSITION_EDIT_NOT_ALLOWED)
+ .withMessage(VSP_COMPOSITION_EDIT_NOT_ALLOWED_MSG).build());
+ }
+
+ vendorSoftwareProductDao.updateVspLatestModificationTime(vspId, activeVersion);
+ }
+
+ @Override
+ public ComponentEntity createComponent(ComponentEntity component, String user) {
+ Version activeVersion =
+ getVersionInfo(component.getVspId(), VersionableEntityAction.Write, user)
+ .getActiveVersion();
+ component.setVersion(activeVersion);
+
+ if (!isManual(component.getVspId(), activeVersion)) {
+ throw new CoreException(
+ new ErrorCode.ErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION)
+ .withId(VendorSoftwareProductErrorCodes.VSP_COMPOSITION_EDIT_NOT_ALLOWED)
+ .withMessage(VSP_COMPOSITION_EDIT_NOT_ALLOWED_MSG).build());
+
+ }
+
+ /* ComponentCompositionSchemaInput schemaInput = new ComponentCompositionSchemaInput();
+ schemaInput.setManual(true);
+ CompositionEntityValidationData validationData = CompositionEntityDataManager
+ .validateEntity(component, SchemaTemplateContext.composition, schemaInput);
+ if (CollectionUtils.isEmpty(validationData.getErrors())) {
+ return createComponent(component);
+ }
+ return validationData;*/
+
+ vendorSoftwareProductDao.updateVspLatestModificationTime(component.getVspId(), activeVersion);
+
+ return null;
+ }
+
+ private ComponentEntity createComponent(ComponentEntity component) {
+ component.setId(CommonMethods.nextUuId());
+ component.setQuestionnaireData(
+ new JsonSchemaDataGenerator(getComponentQuestionnaireSchema(null)).generateData());
+
+ vendorSoftwareProductDao.createComponent(component);
+
+ return component;
+ }
+
+ @Override
+ public CompositionEntityResponse<ComponentData> getComponent(String vspId, Version version,
+ String componentId, String user) {
+ version = VersioningUtil
+ .resolveVersion(version, getVersionInfo(vspId, VersionableEntityAction.Read, user));
+ ComponentEntity componentEntity = getComponent(vspId, version, componentId);
+ ComponentData component = componentEntity.getComponentCompositionData();
+
+ ComponentCompositionSchemaInput schemaInput = new ComponentCompositionSchemaInput();
+ schemaInput.setManual(isManual(vspId, version));
+ schemaInput.setComponent(component);
+
+ CompositionEntityResponse<ComponentData> response = new CompositionEntityResponse<>();
+ response.setId(componentId);
+ response.setData(component);
+ response.setSchema(SchemaGenerator
+ .generate(SchemaTemplateContext.composition, CompositionEntityType.component, schemaInput));
+
+ return response;
+ }
+
+ private ComponentEntity getComponent(String vspId, Version version, String componentId) {
+ ComponentEntity retrieved = vendorSoftwareProductDao.getComponent(vspId, version, componentId);
+ VersioningUtil
+ .validateEntityExistence(retrieved, new ComponentEntity(vspId, version, componentId),
+ VspDetails.ENTITY_TYPE);
+ return retrieved;
+ }
+
+ @Override
+ public CompositionEntityValidationData updateComponent(ComponentEntity component, String user) {
+ Version activeVersion =
+ getVersionInfo(component.getVspId(), VersionableEntityAction.Write, user)
+ .getActiveVersion();
+ component.setVersion(activeVersion);
+ ComponentEntity retrieved =
+ getComponent(component.getVspId(), activeVersion, component.getId());
+
+ ComponentCompositionSchemaInput schemaInput = new ComponentCompositionSchemaInput();
+ schemaInput.setManual(isManual(component.getVspId(), activeVersion));
+ schemaInput.setComponent(retrieved.getComponentCompositionData());
+
+ CompositionEntityValidationData validationData = CompositionEntityDataManager
+ .validateEntity(component, SchemaTemplateContext.composition, schemaInput);
+ if (CollectionUtils.isEmpty(validationData.getErrors())) {
+ vendorSoftwareProductDao.updateComponent(component);
+ }
+
+ vendorSoftwareProductDao.updateVspLatestModificationTime(component.getVspId(), activeVersion);
+
+ return validationData;
+ }
+
+ @Override
+ public void deleteComponent(String vspId, String componentId, String user) {
+ Version activeVersion =
+ getVersionInfo(vspId, VersionableEntityAction.Write, user).getActiveVersion();
+ if (!isManual(vspId, activeVersion)) {
+ throw new CoreException(
+ new ErrorCode.ErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION)
+ .withId(VendorSoftwareProductErrorCodes.VSP_COMPOSITION_EDIT_NOT_ALLOWED)
+ .withMessage(VSP_COMPOSITION_EDIT_NOT_ALLOWED_MSG).build());
+ }
+
+ vendorSoftwareProductDao.updateVspLatestModificationTime(vspId, activeVersion);
+ }
+
+ @Override
+ public Collection<org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity> listProcesses(
+ String vspId, Version version, String componentId,
+ String user) {
+ version = VersioningUtil
+ .resolveVersion(version, getVersionInfo(vspId, VersionableEntityAction.Read, user));
+ if (!GENERAL_COMPONENT_ID.equals(componentId)) {
+ getComponent(vspId, version, componentId);
+ }
+ return vendorSoftwareProductDao.listProcesses(vspId, version, componentId);
+ }
+
+ @Override
+ public void deleteProcesses(String vspId, String componentId, String user) {
+ Version activeVersion =
+ getVersionInfo(vspId, VersionableEntityAction.Write, user).getActiveVersion();
+ if (!GENERAL_COMPONENT_ID.equals(componentId)) {
+ getComponent(vspId, activeVersion, componentId);
+ }
+
+ Collection<org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity> processes =
+ vendorSoftwareProductDao.listProcesses(vspId, activeVersion, componentId);
+ for (org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity process : processes) {
+ UniqueValueUtil.deleteUniqueValue(VendorSoftwareProductConstants.UniqueValues.PROCESS_NAME,
+ process.getVspId(), process.getVersion().toString(), process.getComponentId(),
+ process.getName());
+ }
+
+ vendorSoftwareProductDao.deleteProcesses(vspId, activeVersion, componentId);
+
+ vendorSoftwareProductDao.updateVspLatestModificationTime(vspId, activeVersion);
+ }
+
+ @Override
+ public org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity createProcess(
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity process, String user) {
+ Version activeVersion =
+ getVersionInfo(process.getVspId(), VersionableEntityAction.Write, user).getActiveVersion();
+ process.setVersion(activeVersion);
+ UniqueValueUtil.validateUniqueValue(VendorSoftwareProductConstants.UniqueValues.PROCESS_NAME,
+ process.getVspId(), process.getVersion().toString(), process.getComponentId(),
+ process.getName());
+ process.setId(CommonMethods.nextUuId());
+ if (!GENERAL_COMPONENT_ID.equals(process.getComponentId())) {
+ getComponent(process.getVspId(), activeVersion, process.getComponentId());
+ }
+
+ vendorSoftwareProductDao.createProcess(process);
+ UniqueValueUtil.createUniqueValue(VendorSoftwareProductConstants.UniqueValues.PROCESS_NAME,
+ process.getVspId(), process.getVersion().toString(), process.getComponentId(),
+ process.getName());
+
+ vendorSoftwareProductDao.updateVspLatestModificationTime(process.getVspId(), activeVersion);
+ return process;
+ }
+
+ @Override
+ public org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity getProcess(String vspId,
+ Version version,
+ String componentId,
+ String processId,
+ String user) {
+ version = VersioningUtil
+ .resolveVersion(version, getVersionInfo(vspId, VersionableEntityAction.Read, user));
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity retrieved =
+ vendorSoftwareProductDao.getProcess(vspId, version, componentId, processId);
+ validateProcessExistence(vspId, version, componentId, processId, retrieved);
+ return retrieved;
+ }
+
+ @Override
+ public void updateProcess(org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity process,
+ String user) {
+ Version activeVersion =
+ getVersionInfo(process.getVspId(), VersionableEntityAction.Write, user).getActiveVersion();
+ process.setVersion(activeVersion);
+
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity retrieved =
+ vendorSoftwareProductDao
+ .getProcess(process.getVspId(), activeVersion, process.getComponentId(),
+ process.getId());
+ validateProcessExistence(process.getVspId(), activeVersion, process.getComponentId(),
+ process.getId(), retrieved);
+
+ UniqueValueUtil.updateUniqueValue(VendorSoftwareProductConstants.UniqueValues.PROCESS_NAME,
+ retrieved.getName(), process.getName(), process.getVspId(), process.getVersion().toString(),
+ process.getComponentId());
+ vendorSoftwareProductDao.updateProcess(process);
+
+ vendorSoftwareProductDao.updateVspLatestModificationTime(process.getVspId(), activeVersion);
+ }
+
+ @Override
+ public void deleteProcess(String vspId, String componentId, String processId, String user) {
+ Version activeVersion =
+ getVersionInfo(vspId, VersionableEntityAction.Write, user).getActiveVersion();
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity retrieved =
+ vendorSoftwareProductDao.getProcess(vspId, activeVersion, componentId, processId);
+ validateProcessExistence(vspId, activeVersion, componentId, processId, retrieved);
+
+ vendorSoftwareProductDao.deleteProcess(vspId, activeVersion, componentId, processId);
+ UniqueValueUtil.deleteUniqueValue(VendorSoftwareProductConstants.UniqueValues.PROCESS_NAME,
+ retrieved.getVspId(), retrieved.getVersion().toString(), retrieved.getComponentId(),
+ retrieved.getName());
+
+ vendorSoftwareProductDao.updateVspLatestModificationTime(vspId, activeVersion);
+ }
+
+ @Override
+ public File getProcessArtifact(String vspId, Version version, String componentId,
+ String processId, String user) {
+ version = VersioningUtil
+ .resolveVersion(version, getVersionInfo(vspId, VersionableEntityAction.Read, user));
+ ProcessArtifactEntity retrieved =
+ vendorSoftwareProductDao.getProcessArtifact(vspId, version, componentId, processId);
+ validateProcessArtifactExistence(vspId, version, componentId, processId, retrieved);
+
+ File file = new File(String
+ .format("%s_%s_%s_%s", vspId, version.toString().replace('.', '_'), componentId,
+ processId));
+ try {
+ FileOutputStream fos = new FileOutputStream(file);
+ fos.write(retrieved.getArtifact().array());
+ fos.close();
+ } catch (IOException e0) {
+ throw new CoreException(new UploadInvalidErrorBuilder().build());
+ }
+
+ return file;
+ }
+
+ @Override
+ public void deleteProcessArtifact(String vspId, String componentId, String processId,
+ String user) {
+ Version activeVersion =
+ getVersionInfo(vspId, VersionableEntityAction.Write, user).getActiveVersion();
+ ProcessArtifactEntity retrieved =
+ vendorSoftwareProductDao.getProcessArtifact(vspId, activeVersion, componentId, processId);
+ validateProcessArtifactExistence(vspId, activeVersion, componentId, processId, retrieved);
+
+ vendorSoftwareProductDao.deleteProcessArtifact(vspId, activeVersion, componentId, processId);
+
+ vendorSoftwareProductDao.updateVspLatestModificationTime(vspId, activeVersion);
+ }
+
+ @Override
+ public void uploadProcessArtifact(InputStream artifactFile, String artifactFileName, String vspId,
+ String componentId, String processId, String user) {
+ Version activeVersion =
+ getVersionInfo(vspId, VersionableEntityAction.Write, user).getActiveVersion();
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity retrieved =
+ vendorSoftwareProductDao.getProcess(vspId, activeVersion, componentId, processId);
+ validateProcessExistence(vspId, activeVersion, componentId, processId, retrieved);
+
+ if (artifactFile == null) {
+ throw new CoreException(new UploadInvalidErrorBuilder().build());
+ }
+
+ byte[] artifact;
+ try {
+ artifact = FileUtils.toByteArray(artifactFile);
+ } catch (RuntimeException e0) {
+ throw new CoreException(new UploadInvalidErrorBuilder().build());
+ }
+
+ vendorSoftwareProductDao
+ .uploadProcessArtifact(vspId, activeVersion, componentId, processId, artifact,
+ artifactFileName);
+
+ vendorSoftwareProductDao.updateVspLatestModificationTime(vspId, activeVersion);
+ }
+
+ @Override
+ public Collection<org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity> listNics(
+ String vspId, Version version, String componentId,
+ String user) {
+ version = VersioningUtil
+ .resolveVersion(version, getVersionInfo(vspId, VersionableEntityAction.Read, user));
+ Collection<org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity> nics =
+ listNics(vspId, version, componentId);
+
+ Map<String, String> networksNameById = listNetworksNameById(vspId, version);
+ nics.stream().forEach(nicEntity -> {
+ Nic nic = nicEntity.getNicCompositionData();
+ nic.setNetworkName(networksNameById.get(nic.getNetworkId()));
+ nicEntity.setNicCompositionData(nic);
+ });
+ return nics;
+ }
+
+ private Collection<org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity> listNics(
+ String vspId, Version version, String componentId) {
+ getComponent(vspId, version, componentId);
+
+ return vendorSoftwareProductDao.listNics(vspId, version, componentId);
+ }
+
+ private Map<String, String> listNetworksNameById(String vspId, Version version) {
+ Collection<NetworkEntity> networks = listNetworks(vspId, version);
+ return networks.stream().collect(Collectors.toMap(NetworkEntity::getId,
+ networkEntity -> networkEntity.getNetworkCompositionData().getName()));
+ }
+
+ @Override
+ public org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity createNic(
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity nic, String user) {
+ Version activeVersion =
+ getVersionInfo(nic.getVspId(), VersionableEntityAction.Write, user).getActiveVersion();
+ nic.setVersion(activeVersion);
+ if (!isManual(nic.getVspId(), activeVersion)) {
+ throw new CoreException(
+ new ErrorCode.ErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION)
+ .withId(VendorSoftwareProductErrorCodes.VSP_COMPOSITION_EDIT_NOT_ALLOWED)
+ .withMessage(VSP_COMPOSITION_EDIT_NOT_ALLOWED_MSG).build());
+ }
+
+ vendorSoftwareProductDao.updateVspLatestModificationTime(nic.getVspId(), activeVersion);
+
+ return null;
+ }
+
+ private org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity createNic(
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity nic) {
+ nic.setId(CommonMethods.nextUuId());
+ nic.setQuestionnaireData(
+ new JsonSchemaDataGenerator(getNicQuestionnaireSchema(null)).generateData());
+
+ vendorSoftwareProductDao.createNic(nic);
+
+ return nic;
+ }
+
+ @Override
+ public CompositionEntityResponse<Nic> getNic(String vspId, Version version, String componentId,
+ String nicId, String user) {
+ version = VersioningUtil
+ .resolveVersion(version, getVersionInfo(vspId, VersionableEntityAction.Read, user));
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity
+ nicEntity = getNic(vspId, version, componentId, nicId);
+ Nic nic = nicEntity.getNicCompositionData();
+
+ NicCompositionSchemaInput schemaInput = new NicCompositionSchemaInput();
+ schemaInput.setManual(isManual(vspId, version));
+ schemaInput.setNic(nic);
+ Map<String, String> networksNameById = listNetworksNameById(vspId, version);
+ nic.setNetworkName(networksNameById.get(nic.getNetworkId()));
+ schemaInput.setNetworkIds(networksNameById.keySet());
+
+ CompositionEntityResponse<Nic> response = new CompositionEntityResponse<>();
+ response.setId(nicId);
+ response.setData(nic);
+ response.setSchema(SchemaGenerator
+ .generate(SchemaTemplateContext.composition, CompositionEntityType.nic, schemaInput));
+
+ return response;
+ }
+
+ private org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity getNic(String vspId,
+ Version version,
+ String componentId,
+ String nicId) {
+ getComponent(vspId, version, componentId);
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity
+ retrieved = vendorSoftwareProductDao.getNic(vspId, version, componentId, nicId);
+ VersioningUtil
+ .validateEntityExistence(retrieved,
+ new org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity(vspId, version,
+ componentId, nicId),
+ VspDetails.ENTITY_TYPE);
+ return retrieved;
+ }
+
+ @Override
+ public void deleteNic(String vspId, String componentId, String nicId, String user) {
+ Version activeVersion =
+ getVersionInfo(vspId, VersionableEntityAction.Write, user).getActiveVersion();
+ if (!isManual(vspId, activeVersion)) {
+ throw new CoreException(
+ new ErrorCode.ErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION)
+ .withId(VendorSoftwareProductErrorCodes.VSP_COMPOSITION_EDIT_NOT_ALLOWED)
+ .withMessage(VSP_COMPOSITION_EDIT_NOT_ALLOWED_MSG).build());
+ }
+
+ vendorSoftwareProductDao.updateVspLatestModificationTime(vspId, activeVersion);
+ }
+
+ @Override
+ public CompositionEntityValidationData updateNic(
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity nic, String user) {
+ Version activeVersion =
+ getVersionInfo(nic.getVspId(), VersionableEntityAction.Write, user).getActiveVersion();
+ nic.setVersion(activeVersion);
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity
+ retrieved = getNic(nic.getVspId(), activeVersion, nic.getComponentId(), nic.getId());
+
+ NicCompositionSchemaInput schemaInput = new NicCompositionSchemaInput();
+ schemaInput.setManual(isManual(nic.getVspId(), activeVersion));
+ schemaInput.setNic(retrieved.getNicCompositionData());
+
+ CompositionEntityValidationData validationData = CompositionEntityDataManager
+ .validateEntity(nic, SchemaTemplateContext.composition, schemaInput);
+ if (CollectionUtils.isEmpty(validationData.getErrors())) {
+ vendorSoftwareProductDao.updateNic(nic);
+ }
+
+ vendorSoftwareProductDao.updateVspLatestModificationTime(nic.getVspId(), activeVersion);
+ return validationData;
+ }
+
+ @Override
+ public QuestionnaireResponse getNicQuestionnaire(String vspId, Version version,
+ String componentId, String nicId, String user) {
+ version = VersioningUtil
+ .resolveVersion(version, getVersionInfo(vspId, VersionableEntityAction.Read, user));
+
+ QuestionnaireResponse questionnaireResponse = new QuestionnaireResponse();
+ questionnaireResponse
+ .setData(getNic(vspId, version, componentId, nicId).getQuestionnaireData());
+ questionnaireResponse.setSchema(getNicQuestionnaireSchema(null));
+
+ return questionnaireResponse;
+ }
+
+ @Override
+ public void updateNicQuestionnaire(String vspId, String componentId, String nicId,
+ String questionnaireData, String user) {
+ Version activeVersion =
+ getVersionInfo(vspId, VersionableEntityAction.Write, user).getActiveVersion();
+ getNic(vspId, activeVersion, componentId, nicId);
+
+ vendorSoftwareProductDao
+ .updateNicQuestionnaire(vspId, activeVersion, componentId, nicId, questionnaireData);
+
+ vendorSoftwareProductDao.updateVspLatestModificationTime(vspId, activeVersion);
+ }
+
+ @Override
+ public void deleteComponentMib(String vspId, String componentId, boolean isTrap, String user) {
+ Version activeVersion =
+ getVersionInfo(vspId, VersionableEntityAction.Write, user).getActiveVersion();
+ ComponentArtifactEntity componentArtifactEntity =
+ setValuesForComponentArtifactEntityUpload(vspId, activeVersion, null, componentId, null,
+ isTrap, null);
+ ComponentArtifactEntity retrieved =
+ componentArtifactDao.getArtifactByType(componentArtifactEntity);
+
+ componentArtifactDao.delete(retrieved);
+
+ vendorSoftwareProductDao.updateVspLatestModificationTime(vspId, activeVersion);
+ }
+
+ @Override
+ public void uploadComponentMib(InputStream object, String filename, String vspId,
+ String componentId, boolean isTrap, String user) {
+ Version activeVersion =
+ getVersionInfo(vspId, VersionableEntityAction.Write, user).getActiveVersion();
+ ComponentArtifactEntity componentArtifactEntity;
+
+
+ if (object == null) {
+ throw new CoreException(new MibUploadErrorBuilder(
+ Messages.NO_ZIP_FILE_WAS_UPLOADED_OR_ZIP_NOT_EXIST.getErrorMessage()).build());
+ } else {
+ byte[] uploadedFileData;
+ Map<String, List<ErrorMessage>> errors = new HashMap<>();
+ try {
+ uploadedFileData = FileUtils.toByteArray(object);
+ validateMibZipContent(vspId, activeVersion, uploadedFileData, errors);
+ if (MapUtils.isNotEmpty(errors)) {
+ throw new CoreException(
+ new MibUploadErrorBuilder(errors.values().iterator().next().get(0).getMessage())
+ .build());
+ }
+
+ createArtifactInDatabase(vspId, activeVersion, filename, componentId, isTrap,
+ uploadedFileData);
+
+ } catch (Exception e0) {
+ throw new CoreException(new MibUploadErrorBuilder(e0.getMessage()).build());
+ }
+ }
+
+ vendorSoftwareProductDao.updateVspLatestModificationTime(vspId, activeVersion);
+ }
+
+ private void createArtifactInDatabase(String vspId, Version activeVersion, String filename,
+ String componentId, boolean isTrap,
+ byte[] uploadedFileData) {
+ ComponentArtifactEntity componentArtifactEntity;
+
+ String artifactId = CommonMethods.nextUuId();
+ componentArtifactEntity =
+ setValuesForComponentArtifactEntityUpload(vspId, activeVersion, filename, componentId,
+ artifactId, isTrap, uploadedFileData);
+ componentArtifactDao.update(componentArtifactEntity);
+ }
+
+ @Override
+ public MibUploadStatus listMibFilenames(String vspId, String componentId, String user) {
+ Version activeVersion =
+ getVersionInfo(vspId, VersionableEntityAction.Read, user).getActiveVersion();
+ ComponentArtifactEntity current =
+ new ComponentArtifactEntity(vspId, activeVersion, componentId, null);
+
+ return setMibUploadStatusValues(current);
+
+ }
+
+ private MibUploadStatus setMibUploadStatusValues(
+ ComponentArtifactEntity componentArtifactEntity) {
+ MibUploadStatus mibUploadStatus = new MibUploadStatus();
+
+ Collection<ComponentArtifactEntity> artifactNames =
+ componentArtifactDao.getArtifactNamesAndTypesForComponent(componentArtifactEntity);
+ Map<ComponentArtifactType, String> artifactTypeToFilename =
+ VendorSoftwareProductUtils.filterNonTrapOrPollArtifacts(artifactNames);
+
+ if (MapUtils.isNotEmpty(artifactTypeToFilename)) {
+ if (artifactTypeToFilename.containsKey(ComponentArtifactType.SNMP_TRAP)) {
+ mibUploadStatus.setSnmpTrap(artifactTypeToFilename.get(ComponentArtifactType.SNMP_TRAP));
+ }
+ if (artifactTypeToFilename.containsKey(ComponentArtifactType.SNMP_POLL)) {
+ mibUploadStatus.setSnmpPoll(artifactTypeToFilename.get(ComponentArtifactType.SNMP_POLL));
+ }
+ }
+
+ return mibUploadStatus;
+ }
+
+ private ComponentArtifactEntity setValuesForComponentArtifactEntityUpload(String vspId,
+ Version version,
+ String filename,
+ String componentId,
+ String artifactId,
+ boolean isTrap,
+ byte[]
+ uploadedFileData) {
+ ComponentArtifactEntity componentArtifactEntity = new ComponentArtifactEntity();
+
+ componentArtifactEntity.setVspId(vspId);
+ componentArtifactEntity.setVersion(version);
+ componentArtifactEntity.setComponentId(componentId);
+ componentArtifactEntity.setId(artifactId);
+ componentArtifactEntity.setType(ComponentArtifactType.getComponentArtifactType(isTrap));
+ componentArtifactEntity.setArtifactName(filename);
+
+ if (Objects.nonNull(uploadedFileData)) {
+ componentArtifactEntity.setArtifact(ByteBuffer.wrap(uploadedFileData));
+ }
+
+ return componentArtifactEntity;
+ }
+
+ private void validateProcessExistence(String vspId, Version version, String componentId,
+ String processId,
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity retrieved) {
+ if (retrieved != null) {
+ return;
+ }
+ if (!GENERAL_COMPONENT_ID.equals(componentId)) {
+ getComponent(vspId, version, componentId);
+ }
+ VersioningUtil.validateEntityExistence(retrieved,
+ new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity(vspId, version,
+ componentId, processId),
+ VspDetails.ENTITY_TYPE);//todo retrieved is always null ??
+ }
+
+ private void validateProcessArtifactExistence(String vspId, Version version, String componentId,
+ String processId, ProcessArtifactEntity retrieved) {
+ if (retrieved != null) {
+ VersioningUtil.validateEntityExistence(retrieved.getArtifact(),
+ new ProcessArtifactEntity(vspId, version, componentId, processId),
+ VspDetails.ENTITY_TYPE);
+ } else {
+ if (!GENERAL_COMPONENT_ID.equals(componentId)) {
+ getComponent(vspId, version, componentId);
+ }
+ VersioningUtil.validateEntityExistence(retrieved,
+ new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity(vspId, version,
+ componentId, processId),
+ VspDetails.ENTITY_TYPE); //todo retrieved is always null ??
+ }
+ }
+
+ private Map<String, List<ErrorMessage>> validateUploadData(UploadDataEntity uploadData)
+ throws IOException {
+ if (uploadData == null || uploadData.getContentData() == null) {
+ return null;
+ }
+
+ FileContentHandler fileContentMap =
+ VendorSoftwareProductUtils.loadUploadFileContent(uploadData.getContentData().array());
+ ValidationManager validationManager =
+ ValidationManagerUtil.initValidationManager(fileContentMap);
+ Map<String, List<ErrorMessage>> validationErrors = validationManager.validate();
+
+ return
+ MapUtils.isEmpty(MessageContainerUtil.getMessageByLevel(ErrorLevel.ERROR, validationErrors))
+ ? null : validationErrors;
+ }
+
+ private VersionInfo getVersionInfo(String vendorSoftwareProductId, VersionableEntityAction action,
+ String user) {
+ return versioningManager
+ .getEntityVersionInfo(VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, vendorSoftwareProductId,
+ user, action);
+ }
+
+ private void saveCompositionData(String vspId, Version version, CompositionData compositionData) {
+ Map<String, String> networkIdByName = new HashMap<>();
+ for (Network network : compositionData.getNetworks()) {
+
+ NetworkEntity networkEntity = new NetworkEntity(vspId, version, null);
+ networkEntity.setNetworkCompositionData(network);
+
+ if (network.getName() != null) {
+ networkIdByName.put(network.getName(), createNetwork(networkEntity).getId());
+ }
+ }
+
+ for (Component component : compositionData.getComponents()) {
+ ComponentEntity componentEntity = new ComponentEntity(vspId, version, null);
+ componentEntity.setComponentCompositionData(component.getData());
+
+ String componentId = createComponent(componentEntity).getId();
+
+ if (CollectionUtils.isNotEmpty(component.getNics())) {
+ for (Nic nic : component.getNics()) {
+ if (nic.getNetworkName() != null) {
+ nic.setNetworkId(networkIdByName.get(nic.getNetworkName()));
+ nic.setNetworkName(null);
+ }
+
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity
+ nicEntity =
+ new org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity(vspId, version,
+ componentId, null);
+ nicEntity.setNicCompositionData(nic);
+ createNic(nicEntity);
+ }
+ }
+ }
+ }
+
+ private void deleteUploadDataAndContent(String vspId, Version version) {
+ vendorSoftwareProductDao.deleteUploadData(vspId, version);
+ }
+
+ private QuestionnaireValidationResult validateQuestionnaire(String vspId, Version version) {
+ CompositionEntityDataManager compositionEntityDataManager = new CompositionEntityDataManager();
+ compositionEntityDataManager
+ .addEntity(vendorSoftwareProductDao.getQuestionnaire(vspId, version), null);
+
+ Collection<org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity> nics =
+ vendorSoftwareProductDao.listNicsByVsp(vspId, version);
+
+ Map<String, List<String>> nicNamesByComponent = new HashMap<>();
+ for (org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity nicEntity : nics) {
+ compositionEntityDataManager.addEntity(nicEntity, null);
+
+ Nic nic = nicEntity.getNicCompositionData();
+ if (nic != null && nic.getName() != null) {
+ List<String> nicNames = nicNamesByComponent.get(nicEntity.getComponentId());
+ if (nicNames == null) {
+ nicNames = new ArrayList<>();
+ nicNamesByComponent.put(nicEntity.getComponentId(), nicNames);
+ }
+ nicNames.add(nic.getName());
+ }
+ }
+
+ Collection<ComponentEntity> components =
+ vendorSoftwareProductDao.listComponentsQuestionnaire(vspId, version);
+ components.stream().forEach(component -> compositionEntityDataManager.addEntity(component,
+ new ComponentQuestionnaireSchemaInput(nicNamesByComponent.get(component.getId()),
+ JsonUtil.json2Object(component.getQuestionnaireData(), Map.class))));
+
+ Map<CompositionEntityId, Collection<String>> errorsByEntityId =
+ compositionEntityDataManager.validateEntitiesQuestionnaire();
+ if (MapUtils.isNotEmpty(errorsByEntityId)) {
+ compositionEntityDataManager.buildTrees();
+ compositionEntityDataManager.addErrorsToTrees(errorsByEntityId);
+ Collection<CompositionEntityValidationData> roots = compositionEntityDataManager.getTrees();
+ return new QuestionnaireValidationResult(roots.iterator().next());
+ }
+
+ return null;
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/CompositionDataExtractor.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/CompositionDataExtractor.java
new file mode 100644
index 0000000000..f92b83532e
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/CompositionDataExtractor.java
@@ -0,0 +1,386 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.services;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.MapUtils;
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType;
+import org.openecomp.sdc.tosca.datatypes.ToscaFunctions;
+import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
+import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType;
+import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
+import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.ParameterDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.RequirementAssignment;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.tosca.errors.ToscaInvalidEntryNotFoundErrorBuilder;
+import org.openecomp.sdc.tosca.errors.ToscaInvalidSubstituteNodeTemplateErrorBuilder;
+import org.openecomp.sdc.tosca.errors.ToscaMissingSubstitutionMappingForReqCapErrorBuilder;
+import org.openecomp.sdc.tosca.services.ToscaAnalyzerService;
+import org.openecomp.sdc.tosca.services.ToscaConstants;
+import org.openecomp.sdc.tosca.services.impl.ToscaAnalyzerServiceImpl;
+import org.openecomp.sdc.tosca.services.yamlutil.ToscaExtensionYamlUtil;
+import org.openecomp.sdc.vendorsoftwareproduct.types.ExtractCompositionDataContext;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Component;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionData;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+
+/**
+ * The type Composition data extractor.
+ */
+public class CompositionDataExtractor {
+
+ /**
+ * The constant logger.
+ */
+ protected static Logger logger;
+ private static ToscaAnalyzerService toscaAnalyzerService;
+
+ static {
+ logger = LoggerFactory.getLogger(CompositionDataExtractor.class);
+ toscaAnalyzerService = new ToscaAnalyzerServiceImpl();
+ }
+
+ /**
+ * Extract service composition data composition data.
+ *
+ * @param toscaServiceModel the tosca service model
+ * @return the composition data
+ */
+ public static CompositionData extractServiceCompositionData(ToscaServiceModel toscaServiceModel) {
+ ExtractCompositionDataContext context = new ExtractCompositionDataContext();
+ String entryDefinitionServiceTemplateFileName =
+ toscaServiceModel.getEntryDefinitionServiceTemplate();
+ ServiceTemplate entryDefinitionServiceTemplate =
+ toscaServiceModel.getServiceTemplates().get(entryDefinitionServiceTemplateFileName);
+ extractServiceCompositionData(entryDefinitionServiceTemplateFileName,
+ entryDefinitionServiceTemplate, toscaServiceModel, context);
+
+ CompositionData compositionData = new CompositionData();
+ compositionData.setNetworks(context.getNetworks());
+ compositionData.setComponents(context.getComponents());
+ return compositionData;
+ }
+
+ private static void extractServiceCompositionData(String serviceTemplateFileName,
+ ServiceTemplate serviceTemplate,
+ ToscaServiceModel toscaServiceModel,
+ ExtractCompositionDataContext context) {
+ if (context.getHandledServiceTemplates().contains(serviceTemplateFileName)) {
+ return;
+ }
+ context.addNetworks(extractNetworks(serviceTemplate, toscaServiceModel));
+ extractComponents(serviceTemplate, toscaServiceModel, context);
+ handleSubstitution(serviceTemplate, toscaServiceModel, context);
+ context.addHandledServiceTemplates(serviceTemplateFileName);
+ }
+
+ private static void handleSubstitution(ServiceTemplate serviceTemplate,
+ ToscaServiceModel toscaServiceModel,
+ ExtractCompositionDataContext context) {
+ Map<String, NodeTemplate> substitutableNodeTemplates =
+ toscaAnalyzerService.getSubstitutableNodeTemplates(serviceTemplate);
+
+ if (substitutableNodeTemplates != null) {
+ for (String substitutableNodeTemplateId : substitutableNodeTemplates.keySet()) {
+ handleSubstitutableNodeTemplate(serviceTemplate, toscaServiceModel,
+ substitutableNodeTemplateId,
+ substitutableNodeTemplates.get(substitutableNodeTemplateId), context);
+ }
+ }
+ }
+
+ private static void handleSubstitutableNodeTemplate(ServiceTemplate serviceTemplate,
+ ToscaServiceModel toscaServiceModel,
+ String substitutableNodeTemplateId,
+ NodeTemplate substitutableNodeTemplate,
+ ExtractCompositionDataContext context) {
+ ToscaExtensionYamlUtil toscaExtensionYamlUtil = new ToscaExtensionYamlUtil();
+ Optional<String> substituteServiceTemplateFileName = toscaAnalyzerService
+ .getSubstituteServiceTemplateName(substitutableNodeTemplateId, substitutableNodeTemplate);
+ if (!substituteServiceTemplateFileName.isPresent()) {
+ throw new CoreException(
+ new ToscaInvalidSubstituteNodeTemplateErrorBuilder(substitutableNodeTemplateId).build());
+ }
+ if (context.getHandledServiceTemplates().contains(substituteServiceTemplateFileName.get())) {
+ return;
+ }
+
+ ServiceTemplate substituteServiceTemplate =
+ toscaServiceModel.getServiceTemplates().get(substituteServiceTemplateFileName.get());
+ extractServiceCompositionData(substituteServiceTemplateFileName.get(),
+ substituteServiceTemplate, toscaServiceModel, context);
+
+ List<Map<String, RequirementAssignment>> substitutableRequirements =
+ substitutableNodeTemplate.getRequirements();
+
+ if (CollectionUtils.isEmpty(substitutableRequirements)) {
+ return;
+ }
+
+ for (Map<String, RequirementAssignment> substitutableReq : substitutableRequirements) {
+ substitutableReq.keySet().stream().filter(reqId -> {
+ RequirementAssignment reqAssignment = toscaExtensionYamlUtil
+ .yamlToObject(toscaExtensionYamlUtil.objectToYaml(substitutableReq.get(reqId)),
+ RequirementAssignment.class);
+ return isLinkToNetworkRequirementAssignment(reqAssignment);
+ }).forEach(reqId -> {
+ RequirementAssignment linkToNetworkRequirement = toscaExtensionYamlUtil
+ .yamlToObject(toscaExtensionYamlUtil.objectToYaml(substitutableReq.get(reqId)),
+ RequirementAssignment.class);
+ String connectedNodeId = linkToNetworkRequirement.getNode();
+ Optional<NodeTemplate> connectedNodeTemplate =
+ toscaAnalyzerService.getNodeTemplateById(serviceTemplate, connectedNodeId);
+
+ if (connectedNodeTemplate.isPresent() && toscaAnalyzerService
+ .isTypeOf(connectedNodeTemplate.get(), ToscaNodeType.NETWORK.getDisplayName(),
+ serviceTemplate, toscaServiceModel)) {
+ Optional<Map.Entry<String, NodeTemplate>> mappedNodeTemplate = toscaAnalyzerService
+ .getSubstitutionMappedNodeTemplateByExposedReq(
+ substituteServiceTemplateFileName.get(), substituteServiceTemplate, reqId);
+ if (!mappedNodeTemplate.isPresent()) {
+ throw new CoreException(new ToscaMissingSubstitutionMappingForReqCapErrorBuilder(
+ ToscaMissingSubstitutionMappingForReqCapErrorBuilder.MappingExposedEntry
+ .REQUIREMENT, connectedNodeId).build());
+ }
+
+ if (toscaAnalyzerService.isTypeOf(mappedNodeTemplate.get().getValue(),
+ ToscaNodeType.NETWORK_PORT.getDisplayName(), serviceTemplate, toscaServiceModel)) {
+ Nic port = context.getNics().get(mappedNodeTemplate.get().getKey());
+ if (port != null) {
+ port.setNetworkName(connectedNodeId);
+ } else {
+ logger.warn(
+ "Different ports define for the same component which is used in different "
+ + "substitution service templates.");
+ }
+ }
+ } else if (!connectedNodeTemplate.isPresent()) {
+ throw new CoreException(
+ new ToscaInvalidEntryNotFoundErrorBuilder("Node Template", connectedNodeId).build());
+ }
+ });
+ }
+ }
+
+ private static boolean isLinkToNetworkRequirementAssignment(RequirementAssignment requirement) {
+ return toscaAnalyzerService.isDesiredRequirementAssignment(requirement,
+ ToscaCapabilityType.NETWORK_LINKABLE.getDisplayName(), null,
+ ToscaRelationshipType.NETWORK_LINK_TO.getDisplayName());
+ }
+
+
+ private static void connectPortToNetwork(Nic port, NodeTemplate portNodeTemplate) {
+ List<RequirementAssignment> linkRequirementsToNetwork =
+ toscaAnalyzerService.getRequirements(portNodeTemplate, ToscaConstants.LINK_REQUIREMENT_ID);
+
+ //port is connected to one network
+ for (RequirementAssignment linkRequirementToNetwork : linkRequirementsToNetwork) {
+ port.setNetworkName(linkRequirementToNetwork.getNode());
+ }
+
+ }
+
+ /*
+ return Map with key - compute node template id, value - list of connected port node template id
+ */
+ private static Map<String, List<String>> getComputeToPortsConnection(
+ Map<String, NodeTemplate> portNodeTemplates) {
+ Map<String, List<String>> computeToPortConnection = new HashMap<>();
+ if (MapUtils.isEmpty(portNodeTemplates)) {
+ return computeToPortConnection;
+ }
+ for (String portId : portNodeTemplates.keySet()) {
+ List<RequirementAssignment> bindingRequirementsToCompute = toscaAnalyzerService
+ .getRequirements(portNodeTemplates.get(portId), ToscaConstants.BINDING_REQUIREMENT_ID);
+ for (RequirementAssignment bindingRequirementToCompute : bindingRequirementsToCompute) {
+ computeToPortConnection
+ .putIfAbsent(bindingRequirementToCompute.getNode(), new ArrayList<>());
+ computeToPortConnection.get(bindingRequirementToCompute.getNode()).add(portId);
+ }
+
+ }
+
+ return computeToPortConnection;
+ }
+
+ private static void extractComponents(ServiceTemplate serviceTemplate,
+ ToscaServiceModel toscaServiceModel,
+ ExtractCompositionDataContext context) {
+ Map<String, NodeTemplate> computeNodeTemplates = toscaAnalyzerService
+ .getNodeTemplatesByType(serviceTemplate, ToscaNodeType.COMPUTE.getDisplayName(),
+ toscaServiceModel);
+ if (MapUtils.isEmpty(computeNodeTemplates)) {
+ return;
+ }
+ Map<String, NodeTemplate> portNodeTemplates = toscaAnalyzerService
+ .getNodeTemplatesByType(serviceTemplate, ToscaNodeType.NETWORK_PORT.getDisplayName(),
+ toscaServiceModel);
+ Map<String, List<String>> computeToPortsConnection =
+ getComputeToPortsConnection(portNodeTemplates);
+ Map<String, List<String>> computesGroupedByType =
+ getNodeTemplatesGroupedByType(computeNodeTemplates);
+
+ computesGroupedByType.keySet()
+ .stream()
+ .filter(nodeType ->
+ !context.getCreatedComponents().contains(nodeType))
+ .forEach(nodeType -> extractComponent(serviceTemplate, computeToPortsConnection,
+ computesGroupedByType, nodeType, context));
+ }
+
+ private static void extractComponent(ServiceTemplate serviceTemplate,
+ Map<String, List<String>> computeToPortsConnection,
+ Map<String, List<String>> computesGroupedByType,
+ String computeNodeType,
+ ExtractCompositionDataContext context) {
+ ComponentData component = new ComponentData();
+ component.setName(computeNodeType);
+ component.setDisplayName(getComponentDisplayName(component.getName()));
+ Component componentModel = new Component();
+ componentModel.setData(component);
+
+ String computeId = computesGroupedByType.get(computeNodeType).get(0);
+ List<String> connectedPortIds = computeToPortsConnection.get(computeId);
+
+ if (connectedPortIds != null) {
+ componentModel.setNics(new ArrayList<>());
+ for (String portId : connectedPortIds) {
+ Nic port = extractPort(serviceTemplate, portId);
+ componentModel.getNics().add(port);
+ context.addNic(portId, port);
+ }
+ }
+ context.addComponent(componentModel);
+ context.getCreatedComponents().add(computeNodeType);
+ }
+
+ private static Nic extractPort(ServiceTemplate serviceTemplate, String portNodeTemplateId) {
+ Optional<NodeTemplate> portNodeTemplate =
+ toscaAnalyzerService.getNodeTemplateById(serviceTemplate, portNodeTemplateId);
+ if (portNodeTemplate.isPresent()) {
+ Nic port = new Nic();
+ port.setName(portNodeTemplateId);
+ connectPortToNetwork(port, portNodeTemplate.get());
+ return port;
+ } else {
+ throw new CoreException(
+ new ToscaInvalidEntryNotFoundErrorBuilder("Node Template", portNodeTemplateId).build());
+ }
+ }
+
+
+ private static Map<String, List<String>> getNodeTemplatesGroupedByType(
+ Map<String, NodeTemplate> nodeTemplates) {
+ Map<String, List<String>> nodeTemplatesGrouped =
+ new HashMap<>(); //key - node type, value - list of node ids with this type
+ for (String nodeId : nodeTemplates.keySet()) {
+ String nodeType = nodeTemplates.get(nodeId).getType();
+ nodeTemplatesGrouped.putIfAbsent(nodeType, new ArrayList<>());
+ nodeTemplatesGrouped.get(nodeType).add(nodeId);
+ }
+ return nodeTemplatesGrouped;
+ }
+
+ private static List<Network> extractNetworks(ServiceTemplate serviceTemplate,
+ ToscaServiceModel toscaServiceModel) {
+ List<Network> networks = new ArrayList<>();
+ Map<String, NodeTemplate> networkNodeTemplates = toscaAnalyzerService
+ .getNodeTemplatesByType(serviceTemplate, ToscaNodeType.NETWORK.getDisplayName(),
+ toscaServiceModel);
+ if (MapUtils.isEmpty(networkNodeTemplates)) {
+ return networks;
+ }
+ for (String networkId : networkNodeTemplates.keySet()) {
+ Network network = new Network();
+ network.setName(networkId);
+ Optional<Boolean> networkDhcpValue =
+ getNetworkDhcpValue(serviceTemplate, networkNodeTemplates.get(networkId));
+ network.setDhcp(networkDhcpValue.isPresent() ? networkDhcpValue.get() : true);
+ networks.add(network);
+ }
+
+ return networks;
+ }
+
+ //dhcp default value is true
+ private static Optional<Boolean> getNetworkDhcpValue(ServiceTemplate serviceTemplate,
+ NodeTemplate networkNodeTemplate) {
+ if (networkNodeTemplate == null) {
+ return Optional.empty();
+ }
+ if (networkNodeTemplate.getProperties() == null
+ || networkNodeTemplate.getProperties().get(ToscaConstants.DHCP_ENABLED_PROPERTY_NAME)
+ == null) {
+ return Optional.of(true);
+ }
+
+ Object dhcp =
+ networkNodeTemplate.getProperties().get(ToscaConstants.DHCP_ENABLED_PROPERTY_NAME);
+ if (dhcp instanceof String) {
+ return Optional.of(Boolean.valueOf((String) dhcp));
+ } else if (dhcp instanceof Boolean) {
+ return Optional.of((Boolean) dhcp);
+ } else if (dhcp instanceof Map) {
+ String inputParameterName =
+ (String) ((Map) dhcp).get(ToscaFunctions.GET_INPUT.getDisplayName());
+ if (inputParameterName != null) {
+ ParameterDefinition inputParameterDefinition =
+ serviceTemplate.getTopology_template().getInputs().get(inputParameterName);
+ if (inputParameterDefinition != null) {
+ if (inputParameterDefinition.get_default() != null) {
+ return Optional.of(Boolean.valueOf(inputParameterDefinition.get_default().toString()));
+ }
+ } else {
+ throw new CoreException(
+ new ToscaInvalidEntryNotFoundErrorBuilder("Input Parameter", inputParameterName)
+ .build());
+ }
+ }
+ }
+
+ return Optional.of(true);
+ }
+
+ private static String getComponentDisplayName(String componentName) {
+ if (componentName == null) {
+ return null;
+ }
+ String delimiterChar = ".";
+ if (componentName.contains(delimiterChar)) {
+ return componentName.substring(componentName.lastIndexOf(delimiterChar) + 1);
+ }
+ return componentName;
+
+ }
+
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/CompositionEntityDataManager.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/CompositionEntityDataManager.java
new file mode 100644
index 0000000000..e3f56a6578
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/CompositionEntityDataManager.java
@@ -0,0 +1,257 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.services;
+
+import org.openecomp.core.utilities.json.JsonUtil;
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityValidationData;
+import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.SchemaTemplateContext;
+import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.SchemaTemplateInput;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * The type Composition entity data manager.
+ */
+public class CompositionEntityDataManager {
+
+ private static final String COMPOSITION_ENTITY_DATA_MANAGER_ERR =
+ "COMPOSITION_ENTITY_DATA_MANAGER_ERR";
+ private static final String COMPOSITION_ENTITY_DATA_MANAGER_ERR_MSG =
+ "Invalid input: %s may not be null";
+
+ private Map<org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId,
+ CompositionEntityData> entities = new HashMap<>();
+ private Map<org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType,
+ String> nonDynamicSchemas = new HashMap<>();
+ private List<CompositionEntityValidationData> roots = new ArrayList<>();
+
+ /**
+ * Validate entity composition entity validation data.
+ *
+ * @param entity the entity
+ * @param schemaTemplateContext the schema template context
+ * @param schemaTemplateInput the schema template input
+ * @return the composition entity validation data
+ */
+ public static CompositionEntityValidationData validateEntity(
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.CompositionEntity entity,
+ SchemaTemplateContext schemaTemplateContext,
+ SchemaTemplateInput schemaTemplateInput) {
+ if (entity == null) {
+ throw new CoreException(
+ new ErrorCode.ErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION)
+ .withId(COMPOSITION_ENTITY_DATA_MANAGER_ERR).withMessage(
+ String.format(COMPOSITION_ENTITY_DATA_MANAGER_ERR_MSG, "composition entity"))
+ .build());
+ }
+ if (schemaTemplateContext == null) {
+ throw new CoreException(
+ new ErrorCode.ErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION)
+ .withId(COMPOSITION_ENTITY_DATA_MANAGER_ERR).withMessage(
+ String.format(COMPOSITION_ENTITY_DATA_MANAGER_ERR_MSG, "schema template context"))
+ .build());
+ }
+
+ CompositionEntityValidationData validationData =
+ new CompositionEntityValidationData(entity.getType(), entity.getId());
+ String json =
+ schemaTemplateContext == SchemaTemplateContext.composition ? entity.getCompositionData()
+ : entity.getQuestionnaireData();
+ validationData.setErrors(JsonUtil.validate(
+ json == null ? JsonUtil.object2Json(new Object()) : json,
+ SchemaGenerator.generate(schemaTemplateContext, entity.getType(), schemaTemplateInput)));
+
+ return validationData;
+ }
+
+ /**
+ * Add entity.
+ *
+ * @param entity the entity
+ * @param schemaTemplateInput the schema template input
+ */
+ public void addEntity(org.openecomp.sdc.vendorsoftwareproduct.dao.type.CompositionEntity entity,
+ SchemaTemplateInput schemaTemplateInput) {
+ if (entity == null) {
+ throw new CoreException(
+ new ErrorCode.ErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION)
+ .withId(COMPOSITION_ENTITY_DATA_MANAGER_ERR).withMessage(
+ String.format(COMPOSITION_ENTITY_DATA_MANAGER_ERR_MSG, "composition entity"))
+ .build());
+ }
+ entities.put(entity.getCompositionEntityId(),
+ new CompositionEntityData(entity, schemaTemplateInput));
+ }
+
+ /**
+ * Validate entities questionnaire map.
+ *
+ * @return the map
+ */
+ public Map<org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId,
+ Collection<String>> validateEntitiesQuestionnaire() {
+ Map<org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId,
+ Collection<String>>
+ errorsByEntityId = new HashMap<>();
+
+ entities.entrySet().stream().forEach(entry -> {
+ Collection<String> errors = validateQuestionnaire(entry.getValue());
+ if (errors != null) {
+ errorsByEntityId.put(entry.getKey(), errors);
+ }
+ });
+
+ return errorsByEntityId;
+ }
+
+ /**
+ * Build trees.
+ */
+ public void buildTrees() {
+ Map<org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId,
+ CompositionEntityValidationData>
+ entitiesValidationData =
+ new HashMap<>();
+ entities.entrySet().stream().forEach(
+ entry -> addValidationDataEntity(entitiesValidationData, entry.getKey(),
+ entry.getValue().entity));
+ }
+
+ /**
+ * Gets trees.
+ *
+ * @return the trees
+ */
+ public Collection<CompositionEntityValidationData> getTrees() {
+ return roots;
+ }
+
+ /**
+ * Add errors to trees.
+ *
+ * @param errors the errors
+ */
+ public void addErrorsToTrees(
+ Map<org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId,
+ Collection<String>> errors) {
+ roots.stream().forEach(root -> addErrorsToTree(root, null, errors));
+ }
+
+ private void addValidationDataEntity(
+ Map<org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId,
+ CompositionEntityValidationData> entitiesValidationData,
+ org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId entityId,
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.CompositionEntity entity) {
+ if (entitiesValidationData.containsKey(entityId)) {
+ return;
+ }
+
+ CompositionEntityValidationData validationData =
+ new CompositionEntityValidationData(entity.getType(), entity.getId());
+ entitiesValidationData.put(entityId, validationData);
+
+ org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId parentEntityId =
+ entityId.getParentId();
+ if (parentEntityId == null) {
+ roots.add(validationData);
+ } else {
+ CompositionEntityData parentEntity = entities.get(parentEntityId);
+ if (parentEntity == null) {
+ roots.add(validationData);
+ } else {
+ addValidationDataEntity(entitiesValidationData, parentEntityId, parentEntity.entity);
+ entitiesValidationData.get(parentEntityId).addSubEntityValidationData(validationData);
+ }
+ }
+ }
+
+ private void addErrorsToTree(CompositionEntityValidationData node,
+ org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId parentNodeId,
+ Map<org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId,
+ Collection<String>> errors) {
+ if (node == null) {
+ return;
+ }
+ org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId
+ nodeId = new org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId(
+ node.getEntityId(), parentNodeId);
+ node.setErrors(errors.get(nodeId));
+
+ if (node.getSubEntitiesValidationData() != null) {
+ node.getSubEntitiesValidationData().stream()
+ .forEach(subNode -> addErrorsToTree(subNode, nodeId, errors));
+ }
+ }
+
+ private Collection<String> validateQuestionnaire(CompositionEntityData compositionEntityData) {
+ return JsonUtil.validate(
+ compositionEntityData.entity.getQuestionnaireData() == null ? JsonUtil
+ .object2Json(new Object()) : compositionEntityData.entity.getQuestionnaireData(),
+ getSchema(compositionEntityData.entity.getType(), SchemaTemplateContext.questionnaire,
+ compositionEntityData.schemaTemplateInput));
+ }
+
+ private String getSchema(
+ org.openecomp.sdc.vendorsoftwareproduct.types
+ .composition.CompositionEntityType compositionEntityType,
+ SchemaTemplateContext schemaTemplateContext,
+ SchemaTemplateInput schemaTemplateInput) {
+ return schemaTemplateInput == null ? getNonDynamicSchema(schemaTemplateContext,
+ compositionEntityType) : SchemaGenerator
+ .generate(schemaTemplateContext, compositionEntityType, schemaTemplateInput);
+ }
+
+ private String getNonDynamicSchema(SchemaTemplateContext schemaTemplateContext,
+ org.openecomp.sdc.vendorsoftwareproduct.types.composition
+ .CompositionEntityType compositionEntityType) {
+ String schema = nonDynamicSchemas.get(compositionEntityType);
+ if (schema == null) {
+ schema = SchemaGenerator.generate(schemaTemplateContext, compositionEntityType, null);
+ nonDynamicSchemas.put(compositionEntityType, schema);
+ }
+ return schema;
+ }
+
+ private static class CompositionEntityData {
+ private org.openecomp.sdc.vendorsoftwareproduct.dao.type.CompositionEntity entity;
+ private SchemaTemplateInput schemaTemplateInput;
+
+ /**
+ * Instantiates a new Composition entity data.
+ *
+ * @param entity the entity
+ * @param schemaTemplateInput the schema template input
+ */
+ public CompositionEntityData(
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.CompositionEntity entity,
+ SchemaTemplateInput schemaTemplateInput) {
+ this.entity = entity;
+ this.schemaTemplateInput = schemaTemplateInput;
+ }
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/SchemaGenerator.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/SchemaGenerator.java
new file mode 100644
index 0000000000..53fe5455fb
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/SchemaGenerator.java
@@ -0,0 +1,70 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.services;
+
+import freemarker.template.Template;
+import freemarker.template.TemplateException;
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.SchemaTemplateContext;
+import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.SchemaTemplateInput;
+
+import java.io.IOException;
+import java.io.StringWriter;
+import java.io.Writer;
+
+/**
+ * The type Schema generator.
+ */
+public class SchemaGenerator {
+ /**
+ * The constant SCHEMA_GENERATION_ERROR.
+ */
+ public static final String SCHEMA_GENERATION_ERROR = "SCHEMA_GENERATION_ERROR";
+
+ /**
+ * Generate string.
+ *
+ * @param schemaTemplateContext the schema template context
+ * @param entityType the entity type
+ * @param input the input
+ * @return the string
+ */
+ public static String generate(SchemaTemplateContext schemaTemplateContext,
+ org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType entityType,
+ SchemaTemplateInput input) {
+ Template schemaTemplate =
+ SchemaGeneratorConfig.getSchemaTemplate(schemaTemplateContext, entityType);
+ return processTemplate(input, schemaTemplate);
+ }
+
+ private static String processTemplate(SchemaTemplateInput input, Template schemaTemplate) {
+ try (Writer writer = new StringWriter(1024)) {
+ schemaTemplate.process(input, writer);
+ return writer.toString();
+ } catch (IOException | TemplateException exception) {
+ throw new CoreException(
+ new ErrorCode.ErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION)
+ .withId(SCHEMA_GENERATION_ERROR).withMessage(exception.getMessage()).build());
+ }
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/SchemaGeneratorConfig.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/SchemaGeneratorConfig.java
new file mode 100644
index 0000000000..034d8520fb
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/SchemaGeneratorConfig.java
@@ -0,0 +1,184 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.services;
+
+import freemarker.cache.StringTemplateLoader;
+import freemarker.template.Configuration;
+import freemarker.template.Template;
+import freemarker.template.TemplateExceptionHandler;
+import org.openecomp.core.utilities.applicationconfig.ApplicationConfig;
+import org.openecomp.core.utilities.applicationconfig.ApplicationConfigFactory;
+import org.openecomp.core.utilities.applicationconfig.type.ConfigurationData;
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.SchemaTemplateContext;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * The type Schema generator config.
+ */
+public class SchemaGeneratorConfig {
+ /**
+ * The constant SCHEMA_GENERATOR_INITIALIZATION_ERROR.
+ */
+ public static final String SCHEMA_GENERATOR_INITIALIZATION_ERROR =
+ "SCHEMA_GENERATOR_INITIALIZATION_ERROR";
+ /**
+ * The constant SCHEMA_GENERATOR_INITIALIZATION_ERROR_MSG.
+ */
+ public static final String SCHEMA_GENERATOR_INITIALIZATION_ERROR_MSG =
+ "Error occurred while loading questionnaire schema schemaTemplates";
+ private static final String CONFIGURATION_NAMESPACE = "vsp.schemaTemplates";
+ private static Map<SchemaTemplateId, SchemaTemplate> schemaTemplates = new HashMap<>();
+ private static ApplicationConfig applicationConfig =
+ ApplicationConfigFactory.getInstance().createInterface();
+
+ private static Configuration configuration = new Configuration(Configuration.VERSION_2_3_23);
+ private static StringTemplateLoader stringLoader = new StringTemplateLoader();
+
+ static {
+ configuration.setClassLoaderForTemplateLoading(SchemaGenerator.class.getClassLoader(),
+ File.pathSeparator);
+ configuration.setDefaultEncoding("UTF-8");
+ configuration.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
+ configuration.setLogTemplateExceptions(true);
+ configuration.setTemplateLoader(stringLoader);
+ }
+
+ /**
+ * Insert schema template.
+ *
+ * @param schemaTemplateContext the schema template context
+ * @param entityType the entity type
+ * @param schemaTemplateString the schema template string
+ */
+ public static void insertSchemaTemplate(SchemaTemplateContext schemaTemplateContext,
+ org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType entityType,
+ String schemaTemplateString) {
+ applicationConfig.insertValue(CONFIGURATION_NAMESPACE,
+ new SchemaTemplateId(schemaTemplateContext, entityType).toString(), schemaTemplateString);
+ }
+
+ /**
+ * Gets schema template.
+ *
+ * @param schemaTemplateContext the schema template context
+ * @param entityType the entity type
+ * @return the schema template
+ */
+ public static Template getSchemaTemplate(SchemaTemplateContext schemaTemplateContext,
+ org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType entityType) {
+ SchemaTemplateId id = new SchemaTemplateId(schemaTemplateContext, entityType);
+ ConfigurationData configurationData =
+ applicationConfig.getConfigurationData(CONFIGURATION_NAMESPACE, id.toString());
+
+ SchemaTemplate schemaTemplate = schemaTemplates.get(id);
+ if (schemaTemplate == null || schemaTemplate.timestamp != configurationData.getTimeStamp()) {
+ stringLoader.putTemplate(id.toString(), configurationData.getValue());
+ Template template;
+ try {
+ template = configuration.getTemplate(id.toString());
+ } catch (IOException exception) {
+ throw new CoreException(
+ new ErrorCode.ErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION)
+ .withId(SCHEMA_GENERATOR_INITIALIZATION_ERROR)
+ .withMessage(SCHEMA_GENERATOR_INITIALIZATION_ERROR_MSG).build(), exception);
+ }
+ schemaTemplate = new SchemaTemplate(template, configurationData.getTimeStamp());
+ schemaTemplates.put(id, schemaTemplate);
+ }
+ return schemaTemplate.template;
+ }
+
+ private static class SchemaTemplateId {
+ private SchemaTemplateContext context;
+ private org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType
+ entityType;
+
+ /**
+ * Instantiates a new Schema template id.
+ *
+ * @param context the context
+ * @param entityType the entity type
+ */
+ public SchemaTemplateId(SchemaTemplateContext context,
+ org.openecomp.sdc.vendorsoftwareproduct.types.composition
+ .CompositionEntityType entityType) {
+ this.context = context;
+ this.entityType = entityType;
+ }
+
+ @Override
+ public String toString() {
+ return context + "." + entityType;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null || getClass() != obj.getClass()) {
+ return false;
+ }
+
+ SchemaTemplateId that = (SchemaTemplateId) obj;
+
+ if (entityType != that.entityType) {
+ return false;
+ }
+ if (context != that.context) {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = entityType != null ? entityType.hashCode() : 0;
+ result = 31 * result + (context != null ? context.hashCode() : 0);
+ return result;
+ }
+ }
+
+ private static class SchemaTemplate {
+ private Template template;
+ private long timestamp;
+
+ /**
+ * Instantiates a new Schema template.
+ *
+ * @param template the template
+ * @param timestamp the timestamp
+ */
+ public SchemaTemplate(Template template, long timestamp) {
+ this.template = template;
+ this.timestamp = timestamp;
+ }
+ }
+
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/CompositionEntityResponse.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/CompositionEntityResponse.java
new file mode 100644
index 0000000000..6a71db041b
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/CompositionEntityResponse.java
@@ -0,0 +1,53 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.types;
+
+public class CompositionEntityResponse<T extends org.openecomp.sdc
+ .vendorsoftwareproduct.types.composition.CompositionDataEntity> {
+
+ private String id;
+ private String schema;
+ private T data;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getSchema() {
+ return schema;
+ }
+
+ public void setSchema(String schema) {
+ this.schema = schema;
+ }
+
+ public T getData() {
+ return data;
+ }
+
+ public void setData(T data) {
+ this.data = data;
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/CompositionEntityValidationData.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/CompositionEntityValidationData.java
new file mode 100644
index 0000000000..d334e18637
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/CompositionEntityValidationData.java
@@ -0,0 +1,122 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.types;
+
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+/**
+ * The type Composition entity validation data.
+ */
+public class CompositionEntityValidationData {
+ private CompositionEntityType entityType;
+ private String entityId;
+ private Collection<String> errors;
+ private Collection<CompositionEntityValidationData> subEntitiesValidationData;
+
+ /**
+ * Instantiates a new Composition entity validation data.
+ *
+ * @param entityType the entity type
+ * @param entityId the entity id
+ */
+ public CompositionEntityValidationData(CompositionEntityType entityType, String entityId) {
+ this.entityType = entityType;
+ this.entityId = entityId;
+ }
+
+ /**
+ * Gets entity type.
+ *
+ * @return the entity type
+ */
+ public CompositionEntityType getEntityType() {
+ return entityType;
+ }
+
+ /**
+ * Sets entity type.
+ *
+ * @param entityType the entity type
+ */
+ public void setEntityType(CompositionEntityType entityType) {
+ this.entityType = entityType;
+ }
+
+ /**
+ * Gets entity id.
+ *
+ * @return the entity id
+ */
+ public String getEntityId() {
+ return entityId;
+ }
+
+ /**
+ * Sets entity id.
+ *
+ * @param entityId the entity id
+ */
+ public void setEntityId(String entityId) {
+ this.entityId = entityId;
+ }
+
+ /**
+ * Gets errors.
+ *
+ * @return the errors
+ */
+ public Collection<String> getErrors() {
+ return errors;
+ }
+
+ /**
+ * Sets errors.
+ *
+ * @param errors the errors
+ */
+ public void setErrors(Collection<String> errors) {
+ this.errors = errors;
+ }
+
+ /**
+ * Gets sub entities validation data.
+ *
+ * @return the sub entities validation data
+ */
+ public Collection<CompositionEntityValidationData> getSubEntitiesValidationData() {
+ return subEntitiesValidationData;
+ }
+
+ /**
+ * Add sub entity validation data.
+ *
+ * @param subEntityValidationData the sub entity validation data
+ */
+ public void addSubEntityValidationData(CompositionEntityValidationData subEntityValidationData) {
+ if (subEntitiesValidationData == null) {
+ subEntitiesValidationData = new ArrayList<>();
+ }
+ subEntitiesValidationData.add(subEntityValidationData);
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/ExtractCompositionDataContext.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/ExtractCompositionDataContext.java
new file mode 100644
index 0000000000..0e34fc4e56
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/ExtractCompositionDataContext.java
@@ -0,0 +1,204 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.types;
+
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * The type Extract composition data context.
+ */
+public class ExtractCompositionDataContext {
+ private List<org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network> networks =
+ new ArrayList<>();
+ private List<org.openecomp.sdc.vendorsoftwareproduct.types.composition.Component> components =
+ new ArrayList<>();
+ private Map<String, Nic> nics = new HashMap<>();
+ private Set<String> handledServiceTemplates = new HashSet<>();
+ private Set<String> createdComponents = new HashSet<>();
+
+ /**
+ * Gets created components.
+ *
+ * @return the created components
+ */
+ public Set<String> getCreatedComponents() {
+ return createdComponents;
+ }
+
+ /**
+ * Sets created components.
+ *
+ * @param createdComponents the created components
+ */
+ public void setCreatedComponents(Set<String> createdComponents) {
+ this.createdComponents = createdComponents;
+ }
+
+ /**
+ * Gets handled service templates.
+ *
+ * @return the handled service templates
+ */
+ public Set<String> getHandledServiceTemplates() {
+ return handledServiceTemplates;
+ }
+
+ /**
+ * Sets handled service templates.
+ *
+ * @param handledServiceTemplates the handled service templates
+ */
+ public void setHandledServiceTemplates(Set<String> handledServiceTemplates) {
+ this.handledServiceTemplates = handledServiceTemplates;
+ }
+
+ /**
+ * Add handled service templates.
+ *
+ * @param handledServiceTemplate the handled service template
+ */
+ public void addHandledServiceTemplates(String handledServiceTemplate) {
+ this.handledServiceTemplates.add(handledServiceTemplate);
+ }
+
+ /**
+ * Gets networks.
+ *
+ * @return the networks
+ */
+ public List<org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network> getNetworks() {
+ return networks;
+ }
+
+ /**
+ * Sets networks.
+ *
+ * @param networks the networks
+ */
+ public void setNetworks(
+ List<org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network> networks) {
+ this.networks = networks;
+ }
+
+ /**
+ * Add network.
+ *
+ * @param network the network
+ */
+ public void addNetwork(
+ org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network network) {
+ if (network != null) {
+ networks.add(network);
+ }
+ }
+
+ /**
+ * Add networks.
+ *
+ * @param network the network
+ */
+ public void addNetworks(
+ List<org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network> network) {
+ if (networks != null) {
+ networks.addAll(network);
+ }
+ }
+
+ /**
+ * Gets components.
+ *
+ * @return the components
+ */
+ public List<org.openecomp.sdc.vendorsoftwareproduct.types.composition.Component> getComponents() {
+ return components;
+ }
+
+ /**
+ * Sets components.
+ *
+ * @param components the components
+ */
+ public void setComponents(
+ List<org.openecomp.sdc.vendorsoftwareproduct.types.composition.Component> components) {
+ this.components = components;
+ }
+
+ /**
+ * Add component.
+ *
+ * @param component the component
+ */
+ public void addComponent(
+ org.openecomp.sdc.vendorsoftwareproduct.types.composition.Component component) {
+ if (component != null) {
+ components.add(component);
+ }
+ }
+
+ /**
+ * Add components.
+ *
+ * @param components the components
+ */
+ public void addComponents(
+ List<org.openecomp.sdc.vendorsoftwareproduct.types.composition.Component> components) {
+ if (components != null) {
+ this.components.addAll(components);
+ }
+ }
+
+ /**
+ * Gets nics.
+ *
+ * @return the nics
+ */
+ public Map<String, Nic> getNics() {
+ return nics;
+ }
+
+ /**
+ * Sets nics.
+ *
+ * @param nics the nics
+ */
+ public void setNics(Map<String, Nic> nics) {
+ this.nics = nics;
+ }
+
+ /**
+ * Add nic.
+ *
+ * @param nicId the nic id
+ * @param nic the nic
+ */
+ public void addNic(String nicId, Nic nic) {
+ this.nics.put(nicId, nic);
+ }
+
+
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/LicensingData.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/LicensingData.java
new file mode 100644
index 0000000000..f0f6c095dd
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/LicensingData.java
@@ -0,0 +1,45 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.types;
+
+import java.util.List;
+
+public class LicensingData {
+
+ private String licenseAgreement;
+ private List<String> featureGroups;
+
+ public String getLicenseAgreement() {
+ return licenseAgreement;
+ }
+
+ public void setLicenseAgreement(String licenseAgreement) {
+ this.licenseAgreement = licenseAgreement;
+ }
+
+ public List<String> getFeatureGroups() {
+ return featureGroups;
+ }
+
+ public void setFeatureGroups(List<String> featureGroups) {
+ this.featureGroups = featureGroups;
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/QuestionnaireResponse.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/QuestionnaireResponse.java
new file mode 100644
index 0000000000..84a2ed58f8
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/QuestionnaireResponse.java
@@ -0,0 +1,42 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.types;
+
+public class QuestionnaireResponse {
+ private String schema;
+ private String data;
+
+ public String getSchema() {
+ return schema;
+ }
+
+ public void setSchema(String schema) {
+ this.schema = schema;
+ }
+
+ public String getData() {
+ return data;
+ }
+
+ public void setData(String data) {
+ this.data = data;
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/QuestionnaireValidationResult.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/QuestionnaireValidationResult.java
new file mode 100644
index 0000000000..d970e73a06
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/QuestionnaireValidationResult.java
@@ -0,0 +1,39 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.types;
+
+public class QuestionnaireValidationResult {
+ private boolean valid;
+ private CompositionEntityValidationData validationData;
+
+ public QuestionnaireValidationResult(CompositionEntityValidationData validationData) {
+ this.validationData = validationData;
+ valid = validationData == null;
+ }
+
+ public boolean isValid() {
+ return valid;
+ }
+
+ public CompositionEntityValidationData getValidationData() {
+ return validationData;
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/UploadFileResponse.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/UploadFileResponse.java
new file mode 100644
index 0000000000..68389b6ed9
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/UploadFileResponse.java
@@ -0,0 +1,143 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.types;
+
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class UploadFileResponse {
+ private List<String> fileNames;
+ private Map<String, List<org.openecomp.sdc.datatypes.error.ErrorMessage>> errors =
+ new HashMap<>();
+ private UploadFileStatus status = UploadFileStatus.Success;
+
+ /**
+ * Gets status.
+ *
+ * @return the status
+ */
+ public UploadFileStatus getStatus() {
+ return status;
+ }
+
+ /**
+ * Sets status.
+ *
+ * @param status the status
+ */
+ public void setStatus(UploadFileStatus status) {
+ this.status = status;
+ }
+
+ /**
+ * Gets file names.
+ *
+ * @return the file names
+ */
+ public List<String> getFileNames() {
+ return fileNames;
+ }
+
+ /**
+ * Sets file names.
+ *
+ * @param fileNames the file names
+ */
+ public void setFileNames(List<String> fileNames) {
+ this.fileNames = fileNames;
+ }
+
+ /**
+ * Add new file to list.
+ *
+ * @param filename the filename
+ */
+ public void addNewFileToList(String filename) {
+ this.fileNames.add(filename);
+ }
+
+ /**
+ * Remove file from list.
+ *
+ * @param toRemove the to remove
+ */
+ public void removeFileFromList(String toRemove) {
+ this.fileNames.remove(toRemove);
+ }
+
+ /**
+ * Add structure error.
+ *
+ * @param fileName the file name
+ * @param errorMessage the error message
+ */
+ public void addStructureError(String fileName,
+ org.openecomp.sdc.datatypes.error.ErrorMessage errorMessage) {
+ List<org.openecomp.sdc.datatypes.error.ErrorMessage> errorList = errors.get(fileName);
+ if (errorList == null) {
+ errorList = new ArrayList<>();
+ errors.put(fileName, errorList);
+ }
+ errorList.add(errorMessage);
+ if (org.openecomp.sdc.datatypes.error.ErrorLevel.ERROR.equals(errorMessage.getLevel())) {
+ status = UploadFileStatus.Failure;
+ }
+ }
+
+ /**
+ * Add structure errors.
+ *
+ * @param errorsByFileName the errors by file name
+ */
+ public void addStructureErrors(
+ Map<String, List<org.openecomp.sdc.datatypes.error.ErrorMessage>> errorsByFileName) {
+ if (errorsByFileName == null) {
+ return;
+ }
+
+ errors.putAll(errorsByFileName);
+
+ if (status == UploadFileStatus.Failure) {
+ return;
+ }
+ for (Map.Entry<String, List<org.openecomp.sdc.datatypes.error.ErrorMessage>> entry
+ : errorsByFileName.entrySet()) {
+ for (org.openecomp.sdc.datatypes.error.ErrorMessage errorMessage : entry.getValue()) {
+ if (errorMessage.getLevel() == org.openecomp.sdc.datatypes.error.ErrorLevel.ERROR) {
+ status = UploadFileStatus.Failure;
+ return;
+ }
+ }
+ }
+ }
+
+ /**
+ * Gets errors.
+ *
+ * @return the errors
+ */
+ public Map<String, List<org.openecomp.sdc.datatypes.error.ErrorMessage>> getErrors() {
+ return errors;
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/UploadFileStatus.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/UploadFileStatus.java
new file mode 100644
index 0000000000..2bd8d76a66
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/UploadFileStatus.java
@@ -0,0 +1,26 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.types;
+
+public enum UploadFileStatus {
+ Success,
+ Failure
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/UploadFileStructure.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/UploadFileStructure.java
new file mode 100644
index 0000000000..1e21c60577
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/UploadFileStructure.java
@@ -0,0 +1,40 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.types;
+
+import java.util.List;
+
+public class UploadFileStructure {
+
+ private List<String> fileNames;
+
+ public List<String> getFileNames() {
+ return fileNames;
+ }
+
+ public void setFileNames(List<String> fileNames) {
+ this.fileNames = fileNames;
+ }
+
+ public void addNewFileToList(String filename) {
+ this.fileNames.add(filename);
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/ValidationResponse.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/ValidationResponse.java
new file mode 100644
index 0000000000..29e5f73bce
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/ValidationResponse.java
@@ -0,0 +1,157 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.types;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.MapUtils;
+import org.openecomp.sdc.common.errors.ErrorCode;
+import org.openecomp.sdc.datatypes.error.ErrorMessage;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * The type Validation response.
+ */
+public class ValidationResponse {
+ private boolean valid = true;
+ private Collection<ErrorCode> vspErrors;
+ private Collection<ErrorCode> licensingDataErrors;
+ private Map<String, List<ErrorMessage>> uploadDataErrors;
+ private Map<String, List<ErrorMessage>> compilationErrors;
+ private QuestionnaireValidationResult questionnaireValidationResult;
+
+ /**
+ * Is valid boolean.
+ *
+ * @return the boolean
+ */
+ public boolean isValid() {
+ return valid;
+ }
+
+ /**
+ * Gets vsp errors.
+ *
+ * @return the vsp errors
+ */
+ public Collection<ErrorCode> getVspErrors() {
+ return vspErrors;
+ }
+
+ /**
+ * Sets vsp errors.
+ *
+ * @param vspErrors the vsp errors
+ */
+ public void setVspErrors(Collection<ErrorCode> vspErrors) {
+ this.vspErrors = vspErrors;
+ if (CollectionUtils.isNotEmpty(vspErrors)) {
+ valid = false;
+ }
+ }
+
+ /**
+ * Gets licensing data errors.
+ *
+ * @return the licensing data errors
+ */
+ public Collection<ErrorCode> getLicensingDataErrors() {
+ return licensingDataErrors;
+ }
+
+ /**
+ * Sets licensing data errors.
+ *
+ * @param licensingDataErrors the licensing data errors
+ */
+ public void setLicensingDataErrors(Collection<ErrorCode> licensingDataErrors) {
+ this.licensingDataErrors = licensingDataErrors;
+ if (CollectionUtils.isNotEmpty(licensingDataErrors)) {
+ valid = false;
+ }
+ }
+
+ /**
+ * Gets upload data errors.
+ *
+ * @return the upload data errors
+ */
+ public Map<String, List<ErrorMessage>> getUploadDataErrors() {
+ return uploadDataErrors;
+ }
+
+ /**
+ * Sets upload data errors.
+ *
+ * @param uploadDataErrors the upload data errors
+ */
+ public void setUploadDataErrors(Map<String, List<ErrorMessage>> uploadDataErrors) {
+ this.uploadDataErrors = uploadDataErrors;
+ if (MapUtils.isNotEmpty(uploadDataErrors)) {
+ valid = false;
+ }
+ }
+
+ /**
+ * Gets compilation errors.
+ *
+ * @return the compilation errors
+ */
+ public Map<String, List<ErrorMessage>> getCompilationErrors() {
+ return compilationErrors;
+ }
+
+ /**
+ * Sets compilation errors.
+ *
+ * @param compilationErrors the compilation errors
+ */
+ public void setCompilationErrors(Map<String, List<ErrorMessage>> compilationErrors) {
+ this.compilationErrors = compilationErrors;
+ if (MapUtils.isNotEmpty(compilationErrors)) {
+ valid = false;
+ }
+ }
+
+ /**
+ * Gets questionnaire validation result.
+ *
+ * @return the questionnaire validation result
+ */
+ public QuestionnaireValidationResult getQuestionnaireValidationResult() {
+ return questionnaireValidationResult;
+ }
+
+ /**
+ * Sets questionnaire validation result.
+ *
+ * @param questionnaireValidationResult the questionnaire validation result
+ */
+ public void setQuestionnaireValidationResult(
+ QuestionnaireValidationResult questionnaireValidationResult) {
+ this.questionnaireValidationResult = questionnaireValidationResult;
+ if (questionnaireValidationResult != null && !questionnaireValidationResult.isValid()) {
+ valid = false;
+ }
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/VersionedVendorSoftwareProductInfo.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/VersionedVendorSoftwareProductInfo.java
new file mode 100644
index 0000000000..cbc81da1ee
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/VersionedVendorSoftwareProductInfo.java
@@ -0,0 +1,53 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.types;
+
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
+
+public class VersionedVendorSoftwareProductInfo {
+ private VspDetails vspDetails;
+ private org.openecomp.sdc.versioning.types.VersionInfo versionInfo;
+
+ public VersionedVendorSoftwareProductInfo() {
+ }
+
+ public VersionedVendorSoftwareProductInfo(VspDetails vspDetails,
+ org.openecomp.sdc.versioning.types.VersionInfo versionInfo) {
+ this.vspDetails = vspDetails;
+ this.versionInfo = versionInfo;
+ }
+
+ public VspDetails getVspDetails() {
+ return vspDetails;
+ }
+
+ public void setVspDetails(VspDetails vspDetails) {
+ this.vspDetails = vspDetails;
+ }
+
+ public org.openecomp.sdc.versioning.types.VersionInfo getVersionInfo() {
+ return versionInfo;
+ }
+
+ public void setVersionInfo(org.openecomp.sdc.versioning.types.VersionInfo versionInfo) {
+ this.versionInfo = versionInfo;
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/ComponentCompositionSchemaInput.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/ComponentCompositionSchemaInput.java
new file mode 100644
index 0000000000..7fb5ec890b
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/ComponentCompositionSchemaInput.java
@@ -0,0 +1,43 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator;
+
+public class ComponentCompositionSchemaInput implements SchemaTemplateInput {
+ private boolean manual;
+ private org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData component;
+
+ public boolean isManual() {
+ return manual;
+ }
+
+ public void setManual(boolean manual) {
+ this.manual = manual;
+ }
+
+ public org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData getComponent() {
+ return component;
+ }
+
+ public void setComponent(
+ org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData component) {
+ this.component = component;
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/ComponentQuestionnaireSchemaInput.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/ComponentQuestionnaireSchemaInput.java
new file mode 100644
index 0000000000..1f92e6d957
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/ComponentQuestionnaireSchemaInput.java
@@ -0,0 +1,42 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator;
+
+import java.util.List;
+import java.util.Map;
+
+public class ComponentQuestionnaireSchemaInput implements SchemaTemplateInput {
+ private List<String> nicNames;
+ private Map componentQuestionnaireData;
+
+ public ComponentQuestionnaireSchemaInput(List<String> nicNames, Map componentQuestionnaireData) {
+ this.nicNames = nicNames;
+ this.componentQuestionnaireData = componentQuestionnaireData;
+ }
+
+ public List<String> getNicNames() {
+ return nicNames;
+ }
+
+ public Map getComponentQuestionnaireData() {
+ return componentQuestionnaireData;
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/MibUploadStatus.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/MibUploadStatus.java
new file mode 100644
index 0000000000..046d53054e
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/MibUploadStatus.java
@@ -0,0 +1,51 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator;
+
+public class MibUploadStatus {
+ private String snmpTrap;
+ private String snmpPoll;
+
+
+ public MibUploadStatus(String snmpTrap, String snmpPoll) {
+ this.snmpTrap = snmpTrap;
+ this.snmpPoll = snmpPoll;
+ }
+
+ public MibUploadStatus() {
+ }
+
+ public String getSnmpTrap() {
+ return snmpTrap;
+ }
+
+ public void setSnmpTrap(String snmpTrap) {
+ this.snmpTrap = snmpTrap;
+ }
+
+ public String getSnmpPoll() {
+ return snmpPoll;
+ }
+
+ public void setSnmpPoll(String snmpPoll) {
+ this.snmpPoll = snmpPoll;
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/NetworkCompositionSchemaInput.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/NetworkCompositionSchemaInput.java
new file mode 100644
index 0000000000..456b4409fd
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/NetworkCompositionSchemaInput.java
@@ -0,0 +1,43 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator;
+
+public class NetworkCompositionSchemaInput implements SchemaTemplateInput {
+ private boolean manual;
+ private org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network network;
+
+ public boolean isManual() {
+ return manual;
+ }
+
+ public void setManual(boolean manual) {
+ this.manual = manual;
+ }
+
+ public org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network getNetwork() {
+ return network;
+ }
+
+ public void setNetwork(org.openecomp.sdc.vendorsoftwareproduct.types.composition
+ .Network network) {
+ this.network = network;
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/NicCompositionSchemaInput.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/NicCompositionSchemaInput.java
new file mode 100644
index 0000000000..87693a492c
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/NicCompositionSchemaInput.java
@@ -0,0 +1,55 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator;
+
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic;
+
+import java.util.Collection;
+
+public class NicCompositionSchemaInput implements SchemaTemplateInput {
+ private boolean manual;
+ private Nic nic;
+ private Collection<String> networkIds;
+
+ public boolean isManual() {
+ return manual;
+ }
+
+ public void setManual(boolean manual) {
+ this.manual = manual;
+ }
+
+ public Nic getNic() {
+ return nic;
+ }
+
+ public void setNic(Nic nic) {
+ this.nic = nic;
+ }
+
+ public Collection<String> getNetworkIds() {
+ return networkIds;
+ }
+
+ public void setNetworkIds(Collection<String> networkIds) {
+ this.networkIds = networkIds;
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/SchemaTemplateContext.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/SchemaTemplateContext.java
new file mode 100644
index 0000000000..3ee3e4a5e6
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/SchemaTemplateContext.java
@@ -0,0 +1,26 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator;
+
+public enum SchemaTemplateContext {
+ composition,
+ questionnaire
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/SchemaTemplateInput.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/SchemaTemplateInput.java
new file mode 100644
index 0000000000..93e614f98b
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/SchemaTemplateInput.java
@@ -0,0 +1,25 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator;
+
+public interface SchemaTemplateInput {
+
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/util/CompilationUtil.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/util/CompilationUtil.java
new file mode 100644
index 0000000000..54038bcd73
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/util/CompilationUtil.java
@@ -0,0 +1,126 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.util;
+
+import org.openecomp.core.enrichment.types.ComponentArtifactType;
+import org.openecomp.core.enrichment.types.ComponentCeilometerInfo;
+import org.openecomp.core.enrichment.types.ComponentMibInfo;
+import org.openecomp.core.enrichment.types.MibInfo;
+import org.openecomp.core.utilities.applicationconfig.ApplicationConfig;
+import org.openecomp.core.utilities.applicationconfig.ApplicationConfigFactory;
+import org.openecomp.core.utilities.json.JsonUtil;
+import org.openecomp.sdc.datatypes.error.ErrorMessage;
+import org.openecomp.sdc.enrichment.impl.tosca.ComponentInfo;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentArtifactDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentArtifactDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentArtifactEntity;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.io.File;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * The type Compilation util.
+ */
+public class CompilationUtil {
+
+ private static final ApplicationConfig applicationConfig =
+ ApplicationConfigFactory.getInstance().createInterface();
+ private static final ComponentArtifactDao componentArtifactDao =
+ ComponentArtifactDaoFactory.getInstance().createInterface();
+
+ /**
+ * Add monitoring info.
+ *
+ * @param componentInfo the component info
+ * @param compileErrors the compile errors
+ */
+ public static void addMonitoringInfo(ComponentInfo componentInfo,
+ Map<String, List<ErrorMessage>> compileErrors) {
+
+ String ceilometerJson =
+ applicationConfig.getConfigurationData("vsp.monitoring", "component.ceilometer").getValue();
+ ComponentCeilometerInfo ceilometerInfo =
+ JsonUtil.json2Object(ceilometerJson, ComponentCeilometerInfo.class);
+ componentInfo.setCeilometerInfo(ceilometerInfo);
+ }
+
+ /**
+ * Add mib info.
+ *
+ * @param vspId the vsp id
+ * @param version the version
+ * @param componentEntity the component entity
+ * @param componentInfo the component info
+ * @param compileErrors the compile errors
+ */
+ public static void addMibInfo(String vspId, Version version, org.openecomp.sdc
+ .vendorsoftwareproduct.dao.type.ComponentEntity componentEntity,
+ ComponentInfo componentInfo,
+ Map<String, List<ErrorMessage>> compileErrors) {
+
+ String componentId = componentEntity.getId();
+
+ ComponentArtifactEntity entity = new ComponentArtifactEntity();
+ entity.setVspId(vspId);
+ entity.setVersion(version);
+ entity.setComponentId(componentId);
+
+ ComponentMibInfo componentMibInfo = new ComponentMibInfo();
+
+ extractAndInsertMibContentToComponentInfo(componentId, ComponentArtifactType.SNMP_POLL, entity,
+ componentMibInfo, compileErrors);
+ extractAndInsertMibContentToComponentInfo(componentId, ComponentArtifactType.SNMP_TRAP, entity,
+ componentMibInfo, compileErrors);
+ componentInfo.setMibInfo(componentMibInfo);
+ }
+
+ private static void extractAndInsertMibContentToComponentInfo(String componentId,
+ ComponentArtifactType type,
+ ComponentArtifactEntity componentArtifactEntity,
+ ComponentMibInfo componentMibInfo,
+ Map<String, List<ErrorMessage>> compileErrors) {
+ String path;
+ componentArtifactEntity.setType(type);
+ ComponentArtifactEntity artifact =
+ componentArtifactDao.getArtifactByType(componentArtifactEntity);
+
+ if (artifact == null) {
+ return;
+ }
+ path = componentId + File.separator + type.name();
+ MibInfo mibInfo = new MibInfo();
+ mibInfo.setName(path);
+ mibInfo.setContent(artifact.getArtifact().array());
+ switch (type) {
+ case SNMP_POLL:
+ componentMibInfo.setSnmpPoll(mibInfo);
+ break;
+ case SNMP_TRAP:
+ componentMibInfo.setSnmpTrap(mibInfo);
+ break;
+ default:
+ }
+
+
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/util/VendorSoftwareProductUtils.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/util/VendorSoftwareProductUtils.java
new file mode 100644
index 0000000000..62e8dd8b87
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/util/VendorSoftwareProductUtils.java
@@ -0,0 +1,254 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.util;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.MapUtils;
+import org.openecomp.core.enrichment.types.ComponentArtifactType;
+import org.openecomp.core.translator.api.HeatToToscaTranslator;
+import org.openecomp.core.translator.datatypes.TranslatorOutput;
+import org.openecomp.core.translator.factory.HeatToToscaTranslatorFactory;
+import org.openecomp.core.utilities.file.FileContentHandler;
+import org.openecomp.core.utilities.file.FileUtils;
+import org.openecomp.core.validation.errors.Messages;
+import org.openecomp.core.validation.types.MessageContainerUtil;
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+import org.openecomp.sdc.common.utils.AsdcCommon;
+import org.openecomp.sdc.datatypes.error.ErrorMessage;
+import org.openecomp.sdc.heat.datatypes.structure.HeatStructureTree;
+import org.openecomp.sdc.heat.datatypes.structure.ValidationStructureList;
+import org.openecomp.sdc.heat.services.tree.HeatTreeManager;
+import org.openecomp.sdc.heat.services.tree.HeatTreeManagerUtil;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentArtifactEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.types.UploadFileResponse;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+
+/**
+ * The type Vendor software product utils.
+ */
+public class VendorSoftwareProductUtils {
+
+ private static org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao
+ vendorSoftwareProductDao =
+ VendorSoftwareProductDaoFactory.getInstance().createInterface();
+
+ /**
+ * Load upload file content file content handler.
+ *
+ * @param uploadedFileData the uploaded file data
+ * @return the file content handler
+ * @throws IOException the io exception
+ */
+ public static FileContentHandler loadUploadFileContent(byte[] uploadedFileData)
+ throws IOException {
+ return getFileContentMapFromZip(uploadedFileData);
+ }
+
+ private static FileContentHandler getFileContentMapFromZip(byte[] uploadFileData)
+ throws IOException, CoreException {
+ ZipEntry zipEntry;
+ List<String> folderList = new ArrayList<>();
+ FileContentHandler mapFileContent = new FileContentHandler();
+ try {
+ ZipInputStream inputZipStream;
+
+ byte[] fileByteContent;
+ String currentEntryName;
+ inputZipStream = new ZipInputStream(new ByteArrayInputStream(uploadFileData));
+
+ while ((zipEntry = inputZipStream.getNextEntry()) != null) {
+ currentEntryName = zipEntry.getName();
+ // else, get the file content (as byte array) and save it in a map.
+ fileByteContent = FileUtils.toByteArray(inputZipStream);
+
+ int index = lastIndexFileSeparatorIndex(currentEntryName);
+ String currSubstringWithoutSeparator =
+ currentEntryName.substring(index + 1, currentEntryName.length());
+ if (index != -1) { //todo ?
+ folderList.add(currentEntryName);
+ } else {
+ mapFileContent.addFile(currentEntryName, fileByteContent);
+ }
+
+ }
+
+ } catch (RuntimeException e0) {
+ throw new IOException(e0);
+ }
+
+ if (CollectionUtils.isNotEmpty(folderList)) {
+ throw new CoreException((new ErrorCode.ErrorCodeBuilder())
+ .withMessage(Messages.ZIP_SHOULD_NOT_CONTAIN_FOLDERS.getErrorMessage())
+ .withId(Messages.ZIP_SHOULD_NOT_CONTAIN_FOLDERS.getErrorMessage())
+ .withCategory(ErrorCategory.APPLICATION).build());
+ }
+
+ return mapFileContent;
+ }
+
+ /**
+ * Load and translate template data translator output.
+ *
+ * @param fileNameContentMap the file name content map
+ * @return the translator output
+ */
+ public static TranslatorOutput loadAndTranslateTemplateData(
+ FileContentHandler fileNameContentMap) {
+ HeatToToscaTranslator heatToToscaTranslator =
+ HeatToToscaTranslatorFactory.getInstance().createInterface();
+ InputStream fileContent = fileNameContentMap.getFileContent(AsdcCommon.MANIFEST_NAME);
+
+ heatToToscaTranslator.addManifest(AsdcCommon.MANIFEST_NAME, FileUtils.toByteArray(fileContent));
+
+ fileNameContentMap.getFileList().stream()
+ .filter(fileName -> !(fileName.equals(AsdcCommon.MANIFEST_NAME))).forEach(
+ fileName -> heatToToscaTranslator
+ .addFile(fileName, FileUtils.toByteArray(fileNameContentMap.getFileContent(fileName))));
+
+ Map<String, List<ErrorMessage>> errors = heatToToscaTranslator.validate();
+ if (MapUtils.isNotEmpty(MessageContainerUtil.getMessageByLevel(
+ org.openecomp.sdc.datatypes.error.ErrorLevel.ERROR, errors))) {
+ TranslatorOutput translatorOutput = new TranslatorOutput();
+ translatorOutput.setErrorMessages(errors);
+ return translatorOutput;
+ }
+
+ InputStream structureFile = getHeatStructureTreeFile(fileNameContentMap);
+ heatToToscaTranslator.addExternalArtifacts(AsdcCommon.HEAT_META, structureFile);
+ return heatToToscaTranslator.translate();
+ }
+
+ private static InputStream getHeatStructureTreeFile(FileContentHandler fileNameContentMap) {
+ HeatTreeManager heatTreeManager = HeatTreeManagerUtil.initHeatTreeManager(fileNameContentMap);
+ heatTreeManager.createTree();
+ HeatStructureTree tree = heatTreeManager.getTree();
+ ValidationStructureList validationStructureList = new ValidationStructureList(tree);
+ return FileUtils.convertToInputStream(validationStructureList, FileUtils.FileExtension.JSON);
+ }
+
+
+ private static int lastIndexFileSeparatorIndex(String filePath) {
+ int length = filePath.length() - 1;
+
+ for (int i = length; i >= 0; i--) {
+ char currChar = filePath.charAt(i);
+ if (currChar == '/' || currChar == File.separatorChar || currChar == File.pathSeparatorChar) {
+ return i;
+ }
+ }
+ // if we've reached to the start of the string and didn't find file separator - return -1
+ return -1;
+ }
+
+ /**
+ * Add file names to upload file response.
+ *
+ * @param fileContentMap the file content map
+ * @param uploadFileResponse the upload file response
+ */
+ public static void addFileNamesToUploadFileResponse(FileContentHandler fileContentMap,
+ UploadFileResponse uploadFileResponse) {
+ uploadFileResponse.setFileNames(new ArrayList<>());
+ for (String filename : fileContentMap.getFileList()) {
+ if (!new File(filename).isDirectory()) {
+ uploadFileResponse.addNewFileToList(filename);
+ }
+ }
+ uploadFileResponse.removeFileFromList(AsdcCommon.MANIFEST_NAME);
+ }
+
+ /**
+ * Validate raw zip data.
+ *
+ * @param uploadedFileData the uploaded file data
+ * @param errors the errors
+ */
+ public static void validateRawZipData(byte[] uploadedFileData,
+ Map<String, List<ErrorMessage>> errors) {
+ if (uploadedFileData.length == 0) {
+ ErrorMessage.ErrorMessageUtil.addMessage(AsdcCommon.UPLOAD_FILE, errors).add(
+ new ErrorMessage(org.openecomp.sdc.datatypes.error.ErrorLevel.ERROR,
+ Messages.NO_ZIP_FILE_WAS_UPLOADED_OR_ZIP_NOT_EXIST.getErrorMessage()));
+ }
+ }
+
+ /**
+ * Validate content zip data.
+ *
+ * @param contentMap the content map
+ * @param errors the errors
+ */
+ public static void validateContentZipData(FileContentHandler contentMap,
+ Map<String, List<ErrorMessage>> errors) {
+ if (contentMap == null) {
+ ErrorMessage.ErrorMessageUtil.addMessage(AsdcCommon.UPLOAD_FILE, errors).add(
+ new ErrorMessage(org.openecomp.sdc.datatypes.error.ErrorLevel.ERROR,
+ Messages.ZIP_SHOULD_NOT_CONTAIN_FOLDERS.getErrorMessage()));
+
+ } else if (contentMap.getFileList().size() == 0) {
+ ErrorMessage.ErrorMessageUtil.addMessage(AsdcCommon.UPLOAD_FILE, errors)
+ .add(new ErrorMessage(org.openecomp.sdc.datatypes.error.ErrorLevel.ERROR,
+ Messages.INVALID_ZIP_FILE.getErrorMessage()));
+ }
+ }
+
+
+ /**
+ * Filter non trap or poll artifacts map.
+ *
+ * @param artifacts the artifacts
+ * @return the map
+ */
+ public static Map<ComponentArtifactType, String> filterNonTrapOrPollArtifacts(
+ Collection<ComponentArtifactEntity> artifacts) {
+ Map<ComponentArtifactType, String> artifactTypeToFilename = new HashMap<>();
+
+ for (ComponentArtifactEntity entity : artifacts) {
+ if (isTrapOrPoll(entity.getType())) {
+ artifactTypeToFilename.put(entity.getType(), entity.getArtifactName());
+ }
+ }
+
+ return artifactTypeToFilename;
+ }
+
+
+ private static boolean isTrapOrPoll(ComponentArtifactType type) {
+ return type.equals(ComponentArtifactType.SNMP_POLL)
+ || type.equals(ComponentArtifactType.SNMP_TRAP);
+ }
+
+
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/ComponentProcessesTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/ComponentProcessesTest.java
new file mode 100644
index 0000000000..cfc2e111ac
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/ComponentProcessesTest.java
@@ -0,0 +1,46 @@
+package org.openecomp.sdc.vendorsoftwareproduct;
+
+import org.testng.annotations.BeforeClass;
+
+public class ComponentProcessesTest extends ProcessesTest {
+
+ @BeforeClass
+ @Override
+ protected void init() {
+// super.init();
+//
+// org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity
+// comp11 = new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity(vsp1Id, null, null);
+// org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData
+// compData11 = new org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData();
+// compData11.setName("c11 name");
+// compData11.setDescription("c11 desc");
+// comp11.setComponentCompositionData(compData11);
+//
+//// component11Id = vendorSoftwareProductManager.createComponent(comp11, USER1).getId();
+//
+// org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity
+// comp21 = new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity(vsp2Id, null, null);
+// org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData
+// compData21 = new org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData();
+// compData21.setName("c21 name");
+// compData21.setDescription("c21 desc");
+// comp21.setComponentCompositionData(compData21);
+
+// component21Id = vendorSoftwareProductManager.createComponent(comp21, USER1).getId();
+ }
+
+ @Override
+ public void testCreateWithExistingNameUnderOtherComponent() {
+// org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity
+// comp12 = new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity(vsp1Id, null, null);
+// org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData
+// compData12 = new org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData();
+// compData12.setName("c12 name");
+// compData12.setDescription("c12 desc");
+// comp12.setComponentCompositionData(compData12);
+//
+// String component12Id = vendorSoftwareProductManager.createComponent(comp12, USER1).getId();
+// testCreate(vsp1Id, component12Id);
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/ComponentsTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/ComponentsTest.java
new file mode 100644
index 0000000000..ff33bcb9ee
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/ComponentsTest.java
@@ -0,0 +1,329 @@
+package org.openecomp.sdc.vendorsoftwareproduct;
+
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
+import org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes;
+import org.openecomp.sdc.vendorsoftwareproduct.impl.VendorSoftwareProductManagerImpl;
+import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityResponse;
+import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityValidationData;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.errors.VersioningErrorCodes;
+import org.openecomp.core.utilities.CommonMethods;
+
+import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import java.util.Collection;
+
+public class ComponentsTest {
+
+ private static final String USER1 = "componentsTestUser1";
+ private static final String USER2 = "componentsTestUser2";
+ private static final Version VERSION01 = new Version(0, 1);
+ private static final VendorSoftwareProductManager vendorSoftwareProductManager =
+ new VendorSoftwareProductManagerImpl();
+ private static final org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao
+ vendorSoftwareProductDao =
+ VendorSoftwareProductDaoFactory.getInstance().createInterface();
+
+ private static String vsp1Id;
+ private static String vsp2Id;
+ private static String comp1Id = "1";
+ private static String comp2Id = "2";
+
+ static org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity createComponent(String vspId, Version version, String compId) {
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity
+ componentEntity = new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity(vspId, version, compId);
+ ComponentData compData = new ComponentData();
+ compData.setName(compId + " name");
+ compData.setDisplayName(compId + " display name");
+ compData.setDescription(compId + " desc");
+ componentEntity.setComponentCompositionData(compData);
+ vendorSoftwareProductDao.createComponent(componentEntity);
+ return componentEntity;
+ }
+
+ @BeforeClass
+ private void init() {
+ VspDetails vsp1 = vendorSoftwareProductManager.createNewVsp(VSPCommon
+ .createVspDetails(null, null, "VSP_" + CommonMethods.nextUuId(), "Test-vsp1", "vendorName",
+ "vlm1Id", "icon", "category", "subCategory", "123", null), USER1);
+ vsp1Id = vsp1.getId();
+
+ VspDetails vsp2 = vendorSoftwareProductManager.createNewVsp(VSPCommon
+ .createVspDetails(null, null, "VSP_" + CommonMethods.nextUuId(), "Test-vsp2", "vendorName",
+ "vlm1Id", "icon", "category", "subCategory", "123", null), USER1);
+ vsp2Id = vsp2.getId();
+ }
+
+ @Test
+ public void testListWhenNone() {
+ Collection<org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity> components =
+ vendorSoftwareProductManager.listComponents(vsp1Id, null, USER1);
+ Assert.assertEquals(components.size(), 0);
+ }
+
+ @Test
+ public void testCreateNonExistingVspId_negative() {
+ testCreate_negative(new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity("non existing vsp id", null, null), USER1,
+ VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST);
+ }
+
+ @Test
+ public void testCreateOnLockedVsp_negative() {
+ testCreate_negative(new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity(vsp1Id, null, null), USER2,
+ VersioningErrorCodes.EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER);
+ }
+
+/* @Test(dependsOnMethods = "testListWhenNone")
+ public void testCreate() {
+ comp1Id = testCreate(vsp1Id);
+ }
+
+ private String testCreate(String vspId) {
+ ComponentEntity expected = new ComponentEntity(vspId, null, null);
+ ComponentData compData = new ComponentData();
+ compData.setName("comp1 name");
+ compData.setDescription("comp1 desc");
+ expected.setComponentCompositionData(compData);
+
+ ComponentEntity created = vendorSoftwareProductManager.createComponent(expected, USER1);
+ Assert.assertNotNull(created);
+ expected.setId(created.getId());
+ expected.setVersion(VERSION01);
+
+ ComponentEntity actual = vendorSoftwareProductDao.getComponent(vspId, VERSION01, created.getId());
+
+ Assert.assertEquals(actual, expected);
+ return created.getId();
+ }*/
+
+/* @Test(dependsOnMethods = {"testCreate"})
+ public void testCreateWithExistingName_negative() {
+ ComponentEntity component = new ComponentEntity(vsp1Id, null, null);
+ ComponentData compData = new ComponentData();
+ compData.setName("comp1 name");
+ compData.setDescription("comp1 desc");
+ component.setComponentCompositionData(compData);
+ testCreate_negative(component, USER1, UniqueValueUtil.UNIQUE_VALUE_VIOLATION);
+ }*/
+
+/* @Test(dependsOnMethods = {"testCreate"})
+ public void testCreateWithExistingNameUnderOtherVsp() {
+ testCreate(vsp2Id);
+ }*/
+
+ @Test
+ public void testCreateOnUploadVsp_negative() {
+ testCreate_negative(new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity(vsp1Id, null, null), USER1,
+ VendorSoftwareProductErrorCodes.VSP_COMPOSITION_EDIT_NOT_ALLOWED);
+ }
+
+ @Test
+ public void testGetNonExistingComponentId_negative() {
+ testGet_negative(vsp1Id, null, "non existing component id", USER1,
+ VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+ }
+
+ @Test
+ public void testGetNonExistingVspId_negative() {
+ testGet_negative("non existing vsp id", null, comp1Id, USER1,
+ VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST);
+ }
+
+ @Test(dependsOnMethods = "testListWhenNone")//"testCreate")
+ public void testGet() {
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity
+ expected = createComponent(vsp1Id, VERSION01, comp1Id);
+ testGet(vsp1Id, VERSION01, comp1Id, USER1, expected);
+ }
+
+ @Test
+ public void testUpdateNonExistingComponentId_negative() {
+ testUpdate_negative(vsp1Id, "non existing component id", USER1,
+ VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+ }
+
+ @Test
+ public void testUpdateNonExistingVspId_negative() {
+ testUpdate_negative("non existing vsp id", comp1Id, USER1,
+ VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST);
+ }
+
+ @Test(dependsOnMethods = {"testGet"})
+ public void testUpdateOnUploadVsp() {
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity
+ expected = new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity(vsp1Id, null, comp1Id);
+ ComponentData compData = new ComponentData();
+ compData.setName(comp1Id + " name"); // no change
+ compData.setDisplayName(comp1Id + " display name"); // no change
+ compData.setDescription(comp1Id + " desc updated"); // allowed change
+ expected.setComponentCompositionData(compData);
+
+ CompositionEntityValidationData validationData =
+ vendorSoftwareProductManager.updateComponent(expected, USER1);
+ Assert.assertTrue(validationData == null || validationData.getErrors() == null);
+ expected.setVersion(VERSION01);
+
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity actual = vendorSoftwareProductDao.getComponent(vsp1Id, VERSION01, comp1Id);
+ Assert.assertEquals(actual, expected);
+ }
+
+ @Test(dependsOnMethods = {"testUpdateOnUploadVsp"})
+ public void testIllegalUpdateOnUploadVsp() {
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity
+ expected = new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity(vsp1Id, null, comp1Id);
+ ComponentData compData = new ComponentData();
+ compData
+ .setName("comp1 name updated"); // not allowed: changed name + omitted display name
+ expected.setComponentCompositionData(compData);
+
+ CompositionEntityValidationData validationData =
+ vendorSoftwareProductManager.updateComponent(expected, USER1);
+ Assert.assertNotNull(validationData);
+ Assert.assertEquals(validationData.getErrors().size(), 2);
+ }
+
+ @Test
+ public void testListNonExistingVspId_negative() {
+ testList_negative("non existing vsp id", null, USER1,
+ VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST);
+ }
+/*
+ @Test(dependsOnMethods = {"testUpdateOnUploadVsp", "testList"})
+ public void testCreateWithERemovedName() {
+ testCreate(vsp1Id);
+ }
+
+ @Test(dependsOnMethods = "testList")
+ public void testDeleteNonExistingComponentId_negative() {
+ testDelete_negative(vsp1Id, "non existing component id", USER1, VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+ }*/
+
+ @Test(dependsOnMethods = {"testGet"})
+ public void testList() {
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity
+ createdP2 = createComponent(vsp1Id, VERSION01, comp2Id);
+
+ Collection<org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity> actual =
+ vendorSoftwareProductManager.listComponents(vsp1Id, null, USER1);
+ Assert.assertEquals(actual.size(), 2);
+ }
+
+ @Test
+ public void testDeleteNonExistingVspId_negative() {
+ testDelete_negative("non existing vsp id", comp1Id, USER1,
+ VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST);
+ }
+/*
+ @Test(dependsOnMethods = "testList")
+ public void testDelete() {
+ vendorSoftwareProductManager.deleteComponent(vsp1Id, comp1Id, USER1);
+ ComponentEntity actual = vendorSoftwareProductDao.getComponent(vsp1Id, VERSION01, comp1Id);
+ Assert.assertNull(actual);
+ }*/
+
+ @Test
+ public void testDeleteOnUploadVsp_negative() {
+ testDelete_negative(vsp1Id, comp1Id, USER1,
+ VendorSoftwareProductErrorCodes.VSP_COMPOSITION_EDIT_NOT_ALLOWED);
+ }
+
+ @Test
+ public void testDeleteListNonExistingVspId_negative() {
+ testDeleteList_negative("non existing vsp id", USER1,
+ VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST);
+ }
+/*
+ @Test(dependsOnMethods = "testDelete")
+ public void testDeleteList() {
+ ComponentEntity comp3 = new ComponentEntity(vsp1Id, null, null);
+ comp3.setName("comp3 name");
+ comp3.setDescription("comp3 desc");
+ vendorSoftwareProductManager.createComponent(comp3, USER1);
+
+ vendorSoftwareProductManager.deleteComponents(vsp1Id, USER1);
+
+ Collection<ComponentEntity> actual = vendorSoftwareProductManager.listComponents(vsp1Id, null, USER1);
+ Assert.assertEquals(actual.size(), 0);
+ }*/
+
+ @Test
+ public void testDeleteListOnUploadVsp_negative() {
+ testDeleteList_negative(vsp1Id, USER1,
+ VendorSoftwareProductErrorCodes.VSP_COMPOSITION_EDIT_NOT_ALLOWED);
+ }
+
+ private void testGet(String vspId, Version version, String componentId, String user,
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity expected) {
+ CompositionEntityResponse<ComponentData> response =
+ vendorSoftwareProductManager.getComponent(vspId, null, componentId, user);
+ Assert.assertEquals(response.getId(), expected.getId());
+ Assert.assertEquals(response.getData(), expected.getComponentCompositionData());
+ Assert.assertNotNull(response.getSchema());
+ }
+
+ private void testCreate_negative(
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity component, String user,
+ String expectedErrorCode) {
+ try {
+ vendorSoftwareProductManager.createComponent(component, user);
+ Assert.fail();
+ } catch (CoreException e) {
+ Assert.assertEquals(e.code().id(), expectedErrorCode);
+ }
+ }
+
+ private void testGet_negative(String vspId, Version version, String componentId, String user,
+ String expectedErrorCode) {
+ try {
+ vendorSoftwareProductManager.getComponent(vspId, version, componentId, user);
+ Assert.fail();
+ } catch (CoreException e) {
+ Assert.assertEquals(e.code().id(), expectedErrorCode);
+ }
+ }
+
+ private void testUpdate_negative(String vspId, String componentId, String user,
+ String expectedErrorCode) {
+ try {
+ vendorSoftwareProductManager
+ .updateComponent(new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity(vspId, null, componentId), user);
+ Assert.fail();
+ } catch (CoreException e) {
+ Assert.assertEquals(e.code().id(), expectedErrorCode);
+ }
+ }
+
+ private void testList_negative(String vspId, Version version, String user,
+ String expectedErrorCode) {
+ try {
+ vendorSoftwareProductManager.listComponents(vspId, version, user);
+ Assert.fail();
+ } catch (CoreException e) {
+ Assert.assertEquals(e.code().id(), expectedErrorCode);
+ }
+ }
+
+ private void testDeleteList_negative(String vspId, String user, String expectedErrorCode) {
+ try {
+ vendorSoftwareProductManager.deleteComponents(vspId, user);
+ Assert.fail();
+ } catch (CoreException e) {
+ Assert.assertEquals(e.code().id(), expectedErrorCode);
+ }
+ }
+
+ private void testDelete_negative(String vspId, String componentId, String user,
+ String expectedErrorCode) {
+ try {
+ vendorSoftwareProductManager.deleteComponent(vspId, componentId, user);
+ Assert.fail();
+ } catch (CoreException e) {
+ Assert.assertEquals(e.code().id(), expectedErrorCode);
+ }
+ }
+} \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/ComponentsUploadTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/ComponentsUploadTest.java
new file mode 100644
index 0000000000..0819d89851
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/ComponentsUploadTest.java
@@ -0,0 +1,159 @@
+package org.openecomp.sdc.vendorsoftwareproduct;
+
+import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacade;
+import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacadeFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
+import org.openecomp.sdc.vendorsoftwareproduct.impl.VendorSoftwareProductManagerImpl;
+import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.MibUploadStatus;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.core.util.UniqueValueUtil;
+import org.openecomp.core.utilities.CommonMethods;
+
+import org.testng.Assert;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Test;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+
+public class ComponentsUploadTest {
+
+ private static final String USER1 = "vspTestUser1";
+
+ private static VendorSoftwareProductManager vendorSoftwareProductManager =
+ new VendorSoftwareProductManagerImpl();
+ private static VendorSoftwareProductDao vendorSoftwareProductDao =
+ VendorSoftwareProductDaoFactory.getInstance().createInterface();
+ private static VendorLicenseFacade vendorLicenseFacade =
+ VendorLicenseFacadeFactory.getInstance().createInterface();
+
+ private static String vspId = null;
+ private static Version activeVersion = null;
+ private static String trapFileName = "MMSC.zip";
+ private static String pollFileName = "MNS OAM FW.zip";
+ private static String notZipFileName = "notZipFile";
+ private static String zipWithFoldersFileName = "zipFileWithFolder.zip";
+ private static String emptyZipFileName = "emptyZip.zip";
+ private String vlm1Id;
+ private String componentId;
+
+ @BeforeTest
+ private void init() {
+ UniqueValueUtil
+ .deleteUniqueValue(VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME,
+ "VSPTestMib");
+ vlm1Id = vendorLicenseFacade.createVendorLicenseModel(VSPCommon
+ .createVendorLicenseModel("vlmName " + CommonMethods.nextUuId(), "vlm1Id desc", "icon1"),
+ USER1).getId();
+ VspDetails vspDetails = vendorSoftwareProductManager.createNewVsp(VSPCommon
+ .createVspDetails(null, null, "VSPTestMib", "Test-vsp-mib", "vendorName", vlm1Id, "icon",
+ "category", "subCategory", "123", null), USER1);
+
+ vspId = vspDetails.getId();
+ activeVersion = vspDetails.getVersion();
+ componentId = createComponent(new ComponentEntity(vspId, activeVersion, null)).getId();
+ }
+
+
+ @Test
+ public void testUploadAndFilenamesList() {
+ InputStream zis1 = getFileInputStream("/validation/zips/various/MMSC.zip");
+ InputStream zis2 = getFileInputStream("/validation/zips/various/MNS OAM FW.zip");
+
+ vendorSoftwareProductManager
+ .uploadComponentMib(zis1, "MMSC.zip", vspId, componentId, true, USER1);
+ vendorSoftwareProductManager
+ .uploadComponentMib(zis2, "MNS OAM FW.zip", vspId, componentId, false, USER1);
+
+ MibUploadStatus mibUploadStatus =
+ vendorSoftwareProductManager.listMibFilenames(vspId, componentId, USER1);
+ Assert.assertEquals(mibUploadStatus.getSnmpTrap(), trapFileName);
+ Assert.assertEquals(mibUploadStatus.getSnmpPoll(), pollFileName);
+ }
+
+ @Test(dependsOnMethods = "testUploadAndFilenamesList")
+ public void testMibsExistentAfterCheckout() throws IOException {
+ activeVersion = vendorSoftwareProductManager.checkin(vspId, USER1);
+// UniqueValueUtil.deleteUniqueValue(VendorSoftwareProductConstants.UniqueValues.COMPONENT_ARTIFACT_NAME, "MMSC.zip");
+// UniqueValueUtil.deleteUniqueValue(VendorSoftwareProductConstants.UniqueValues.COMPONENT_ARTIFACT_NAME, "MNS OAM FW.zip");
+ activeVersion = vendorSoftwareProductManager.checkout(vspId, USER1);
+
+ MibUploadStatus mibUploadStatus =
+ vendorSoftwareProductManager.listMibFilenames(vspId, componentId, USER1);
+ Assert.assertNotNull(mibUploadStatus.getSnmpTrap());
+ Assert.assertNotNull(mibUploadStatus.getSnmpPoll());
+ }
+
+ @Test(dependsOnMethods = "testMibsExistentAfterCheckout")
+ public void testDeleteFile() {
+ vendorSoftwareProductManager.deleteComponentMib(vspId, componentId, true, USER1);
+ vendorSoftwareProductManager.deleteComponentMib(vspId, componentId, false, USER1);
+
+ MibUploadStatus mibUploadStatus =
+ vendorSoftwareProductManager.listMibFilenames(vspId, componentId, USER1);
+ Assert.assertNull(mibUploadStatus.getSnmpTrap());
+ Assert.assertNull(mibUploadStatus.getSnmpPoll());
+ }
+
+ @Test(dependsOnMethods = "testDeleteFile")
+ public void testUploadInvalidZip() {
+ URL url = this.getClass().getResource("/notZipFile");
+
+ try {
+ vendorSoftwareProductManager
+ .uploadComponentMib(url.openStream(), notZipFileName, vspId, componentId, true, USER1);
+ Assert.fail();
+ } catch (Exception e) {
+// Assert.assertEquals(e.getMessage(), "MIB uploaded for vendor software product with Id " + vspId + " and version " + activeVersion + " is invalid: Invalid zip file");
+ Assert.assertEquals(e.getMessage(), "Invalid zip file");
+ }
+ }
+
+ @Test(dependsOnMethods = "testUploadInvalidZip")
+ public void testUploadZipWithFolders() {
+ InputStream zis = getFileInputStream("/vspmanager/zips/zipFileWithFolder.zip");
+
+ try {
+ vendorSoftwareProductManager
+ .uploadComponentMib(zis, zipWithFoldersFileName, vspId, componentId, true, USER1);
+ Assert.fail();
+ } catch (Exception e) {
+ Assert.assertEquals(e.getMessage(), "Zip file should not contain folders");
+ }
+ }
+
+ @Test(dependsOnMethods = "testUploadZipWithFolders")
+ public void testUploadEmptyZip() {
+ InputStream zis = getFileInputStream("/vspmanager/zips/emptyZip.zip");
+
+ try {
+ vendorSoftwareProductManager
+ .uploadComponentMib(zis, emptyZipFileName, vspId, componentId, true, USER1);
+ Assert.fail();
+ } catch (Exception e) {
+ Assert.assertEquals(e.getMessage(), "Invalid zip file");
+ }
+ }
+
+
+ private InputStream getFileInputStream(String fileName) {
+ URL url = this.getClass().getResource(fileName);
+ try {
+ return url.openStream();
+ } catch (IOException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+
+ private ComponentEntity createComponent(ComponentEntity component) {
+ component.setId(CommonMethods.nextUuId());
+ vendorSoftwareProductDao.createComponent(component);
+ return component;
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/NetworksTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/NetworksTest.java
new file mode 100644
index 0000000000..2921f19c1b
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/NetworksTest.java
@@ -0,0 +1,292 @@
+package org.openecomp.sdc.vendorsoftwareproduct;
+
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
+import org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes;
+import org.openecomp.sdc.vendorsoftwareproduct.impl.VendorSoftwareProductManagerImpl;
+import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityResponse;
+import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityValidationData;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.errors.VersioningErrorCodes;
+import org.openecomp.core.utilities.CommonMethods;
+
+import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import java.util.Collection;
+
+public class NetworksTest {
+
+ private static final String USER1 = "networksTestUser1";
+ private static final String USER2 = "networksTestUser2";
+ private static final Version VERSION01 = new Version(0, 1);
+ private static final VendorSoftwareProductManager vendorSoftwareProductManager =
+ new VendorSoftwareProductManagerImpl();
+ private static final org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao
+ vendorSoftwareProductDao =
+ VendorSoftwareProductDaoFactory.getInstance().createInterface();
+
+ private static String vsp1Id;
+ private static String vsp2Id;
+ private static String networkId = "1";
+
+ static org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity createNetwork(String vspId, Version version, String networkId) {
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity
+ networkEntity = new org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity(vspId, version, networkId);
+ org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network
+ networkData = new org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network();
+ networkData.setName(networkId + " name");
+ networkData.setDhcp(true);
+ networkEntity.setNetworkCompositionData(networkData);
+ vendorSoftwareProductDao.createNetwork(networkEntity);
+ return networkEntity;
+ }
+
+ @BeforeClass
+ private void init() {
+ VspDetails vsp1 = vendorSoftwareProductManager.createNewVsp(VSPCommon
+ .createVspDetails(null, null, "VSP_" + CommonMethods.nextUuId(), "Test-vsp1", "vendorName",
+ "vlm1Id", "icon", "category", "subCategory", "123", null), USER1);
+ vsp1Id = vsp1.getId();
+
+ VspDetails vsp2 = vendorSoftwareProductManager.createNewVsp(VSPCommon
+ .createVspDetails(null, null, "VSP_" + CommonMethods.nextUuId(), "Test-vsp2", "vendorName",
+ "vlm1Id", "icon", "category", "subCategory", "123", null), USER1);
+ vsp2Id = vsp2.getId();
+ }
+
+ @Test
+ public void testListWhenNone() {
+ Collection<org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity> networks =
+ vendorSoftwareProductManager.listNetworks(vsp1Id, null, USER1);
+ Assert.assertEquals(networks.size(), 0);
+ }
+
+ @Test
+ public void testCreateNonExistingVspId_negative() {
+ testCreate_negative(new org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity("non existing vsp id", null, null), USER1,
+ VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST);
+ }
+
+ @Test
+ public void testCreateOnLockedVsp_negative() {
+ testCreate_negative(new org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity(vsp1Id, null, null), USER2,
+ VersioningErrorCodes.EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER);
+ }
+
+/* @Test(dependsOnMethods = "testListWhenNone")
+ public void testCreate() {
+ networkId = testCreate(vsp1Id);
+ }
+
+ private String testCreate(String vspId) {
+ NetworkEntity expected = new NetworkEntity(vspId, null, null);
+ Network networkData = new Network();
+ networkData.setName("network1 name");
+ networkData.setDhcp(true);
+ expected.setNetworkCompositionData(networkData);
+
+
+ NetworkEntity created = vendorSoftwareProductManager.createNetwork(expected, USER1);
+ Assert.assertNotNull(created);
+ expected.setId(created.getId());
+ expected.setVersion(VERSION01);
+
+ NetworkEntity actual = vendorSoftwareProductDao.getNetwork(vspId, VERSION01, created.getId());
+
+ Assert.assertEquals(actual, expected);
+ return created.getId();
+ }
+
+ @Test(dependsOnMethods = {"testCreate"})
+ public void testCreateWithExistingName_negative() {
+ NetworkEntity network = new NetworkEntity(vsp1Id, null, null);
+ Network networkData = new Network();
+ networkData.setName("network1 name");
+ networkData.setDhcp(true);
+ network.setNetworkCompositionData(networkData);
+ testCreate_negative(network, USER1, UniqueValueUtil.UNIQUE_VALUE_VIOLATION);
+ }*/
+
+ @Test
+ public void testCreateOnUploadVsp_negative() {
+ testCreate_negative(new org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity(vsp1Id, null, null), USER1,
+ VendorSoftwareProductErrorCodes.VSP_COMPOSITION_EDIT_NOT_ALLOWED);
+ }
+
+ /* @Test(dependsOnMethods = {"testCreate"})
+ public void testCreateWithExistingNameUnderOtherVsp() {
+ testCreate(vsp2Id);
+ }
+ */
+ @Test(dependsOnMethods = "testListWhenNone")//"testCreate")
+ public void testGetNonExistingNetworkId_negative() {
+ testGet_negative(vsp1Id, null, "non existing network id", USER1,
+ VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+ }
+
+ @Test(dependsOnMethods = "testListWhenNone")//"testCreate")
+ public void testGetNonExistingVspId_negative() {
+ testGet_negative("non existing vsp id", null, networkId, USER1,
+ VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST);
+ }
+
+ @Test(dependsOnMethods = "testListWhenNone")//"testCreate")
+ public void testGet() {
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity
+ expected = createNetwork(vsp1Id, VERSION01, networkId);
+ testGet(vsp1Id, VERSION01, networkId, USER1, expected);
+ }
+
+ @Test(dependsOnMethods = "testListWhenNone")//"testCreate")
+ public void testUpdateNonExistingNetworkId_negative() {
+ testUpdate_negative(vsp1Id, "non existing network id", USER1,
+ VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+ }
+
+ @Test(dependsOnMethods = "testListWhenNone")//"testCreate")
+ public void testUpdateNonExistingVspId_negative() {
+ testUpdate_negative("non existing vsp id", networkId, USER1,
+ VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST);
+ }
+
+ @Test(dependsOnMethods = {"testGet"})
+ public void testIllegalUpdateOnUploadVsp() {
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity
+ expected = new org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity(vsp1Id, null, networkId);
+ org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network
+ networkData = new org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network();
+ networkData.setName(networkId + " name updated");
+ networkData.setDhcp(false);
+ expected.setNetworkCompositionData(networkData);
+
+ CompositionEntityValidationData validationData =
+ vendorSoftwareProductManager.updateNetwork(expected, USER1);
+ Assert.assertNotNull(validationData);
+ Assert.assertTrue(validationData.getErrors().size() > 0);
+ }
+
+ @Test(dependsOnMethods = {"testGet"})
+ public void testListNonExistingVspId_negative() {
+ testList_negative("non existing vsp id", null, USER1,
+ VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST);
+ }
+
+ /*
+ @Test(dependsOnMethods = {"testUpdateOnUploadVsp", "testList"})
+ public void testCreateWithERemovedName() {
+ testCreate(vsp1Id);
+ }
+
+ @Test(dependsOnMethods = "testList")
+ public void testDeleteNonExistingNetworkId_negative() {
+ testDelete_negative(vsp1Id, "non existing network id", USER1, VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+ }*/
+
+ @Test(dependsOnMethods = {"testGet"})
+ public void testList() {
+ createNetwork(vsp1Id, VERSION01, "2");
+
+ Collection<org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity> actual =
+ vendorSoftwareProductManager.listNetworks(vsp1Id, null, USER1);
+ Assert.assertEquals(actual.size(), 2);
+ }
+
+ @Test(dependsOnMethods = "testList")
+ public void testDeleteNonExistingVspId_negative() {
+ testDelete_negative("non existing vsp id", networkId, USER1,
+ VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST);
+ }
+/*
+ @Test(dependsOnMethods = "testList")
+ public void testDelete() {
+ vendorSoftwareProductManager.deleteNetwork(vsp1Id, networkId, USER1);
+ NetworkEntity actual = vendorSoftwareProductDao.getNetwork(vsp1Id, VERSION01, networkId);
+ Assert.assertNull(actual);
+ }
+
+ @Test
+ public void testDeleteListNonExistingVspId_negative() {
+ testDeleteList_negative("non existing vsp id", USER1, VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST);
+ }
+
+ @Test(dependsOnMethods = "testDelete")
+ public void testDeleteList() {
+ NetworkEntity network3 = new NetworkEntity(vsp1Id, null, null);
+ network3.setName("network3 name");
+ network3.setDescription("network3 desc");
+ vendorSoftwareProductManager.createNetwork(network3, USER1);
+
+ vendorSoftwareProductManager.deleteNetworks(vsp1Id, USER1);
+
+ Collection<NetworkEntity> actual = vendorSoftwareProductManager.listNetworks(vsp1Id, null, USER1);
+ Assert.assertEquals(actual.size(), 0);
+ }*/
+
+ @Test(dependsOnMethods = "testList")
+ public void testDeleteOnUploadVsp_negative() {
+ testDelete_negative(vsp1Id, networkId, USER1,
+ VendorSoftwareProductErrorCodes.VSP_COMPOSITION_EDIT_NOT_ALLOWED);
+ }
+
+ private void testGet(String vspId, Version version, String networkId, String user,
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity expected) {
+ CompositionEntityResponse<org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network> response =
+ vendorSoftwareProductManager.getNetwork(vspId, null, networkId, user);
+ Assert.assertEquals(response.getId(), expected.getId());
+ Assert.assertEquals(response.getData(), expected.getNetworkCompositionData());
+ Assert.assertNotNull(response.getSchema());
+ }
+
+ private void testCreate_negative(
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity network, String user, String expectedErrorCode) {
+ try {
+ vendorSoftwareProductManager.createNetwork(network, user);
+ Assert.fail();
+ } catch (CoreException e) {
+ Assert.assertEquals(e.code().id(), expectedErrorCode);
+ }
+ }
+
+ private void testGet_negative(String vspId, Version version, String networkId, String user,
+ String expectedErrorCode) {
+ try {
+ vendorSoftwareProductManager.getNetwork(vspId, version, networkId, user);
+ Assert.fail();
+ } catch (CoreException e) {
+ Assert.assertEquals(e.code().id(), expectedErrorCode);
+ }
+ }
+
+ private void testUpdate_negative(String vspId, String networkId, String user,
+ String expectedErrorCode) {
+ try {
+ vendorSoftwareProductManager.updateNetwork(new org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity(vspId, null, networkId), user);
+ Assert.fail();
+ } catch (CoreException e) {
+ Assert.assertEquals(e.code().id(), expectedErrorCode);
+ }
+ }
+
+ private void testList_negative(String vspId, Version version, String user,
+ String expectedErrorCode) {
+ try {
+ vendorSoftwareProductManager.listNetworks(vspId, version, user);
+ Assert.fail();
+ } catch (CoreException e) {
+ Assert.assertEquals(e.code().id(), expectedErrorCode);
+ }
+ }
+
+ private void testDelete_negative(String vspId, String networkId, String user,
+ String expectedErrorCode) {
+ try {
+ vendorSoftwareProductManager.deleteNetwork(vspId, networkId, user);
+ Assert.fail();
+ } catch (CoreException e) {
+ Assert.assertEquals(e.code().id(), expectedErrorCode);
+ }
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/NicsTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/NicsTest.java
new file mode 100644
index 0000000000..10ea7f7eaf
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/NicsTest.java
@@ -0,0 +1,346 @@
+package org.openecomp.sdc.vendorsoftwareproduct;
+
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes;
+import org.openecomp.sdc.vendorsoftwareproduct.impl.VendorSoftwareProductManagerImpl;
+import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityResponse;
+import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityValidationData;
+import org.openecomp.core.utilities.CommonMethods;
+
+import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import java.util.Collection;
+
+public class NicsTest {
+
+ private static final String USER1 = "nicsTestUser1";
+ private static final String USER2 = "nicsTestUser2";
+ private static final org.openecomp.sdc.versioning.dao.types.Version
+ VERSION01 = new org.openecomp.sdc.versioning.dao.types.Version(0, 1);
+ private static final VendorSoftwareProductManager vendorSoftwareProductManager =
+ new VendorSoftwareProductManagerImpl();
+ private static final org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao
+ vendorSoftwareProductDao =
+ org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory.getInstance().createInterface();
+
+ private static String vsp1Id;
+ private static String vsp2Id;
+ private static org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity network1;
+ private static org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity network2;
+ private static String component11Id;
+ private static String component21Id;
+ private static String nic1Id = "nic1";
+
+ static org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity createNic(String vspId, org.openecomp.sdc.versioning.dao.types.Version version, String compId, String nicId,
+ String networkId) {
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity
+ nicEntity = new org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity(vspId, version, compId, nicId);
+ org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic
+ nicData = new org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic();
+ nicData.setName(nicId + " name");
+ nicData.setDescription(nicId + " desc");
+ nicData.setNetworkId(networkId);
+ nicEntity.setNicCompositionData(nicData);
+ vendorSoftwareProductDao.createNic(nicEntity);
+ return nicEntity;
+ }
+
+ @BeforeClass
+ private void init() {
+ vsp1Id = vendorSoftwareProductManager.createNewVsp(VSPCommon
+ .createVspDetails(null, null, "VSP_" + CommonMethods.nextUuId(), "Test-vsp1", "vendorName1",
+ "vlm1Id", "icon", "category", "subCategory", "123", null), USER1).getId();
+ network1 = NetworksTest.createNetwork(vsp1Id, VERSION01, "network1");
+ component11Id = ComponentsTest.createComponent(vsp1Id, VERSION01, "component11").getId();
+
+ vsp2Id = vendorSoftwareProductManager.createNewVsp(VSPCommon
+ .createVspDetails(null, null, "VSP_" + CommonMethods.nextUuId(), "Test-vsp2", "vendorName1",
+ "vlm1Id", "icon", "category", "subCategory", "123", null), USER1).getId();
+ network2 = NetworksTest.createNetwork(vsp2Id, VERSION01, "network2");
+ component21Id = ComponentsTest.createComponent(vsp2Id, VERSION01, "component21").getId();
+ }
+
+/* @Test
+ public void testCreateNonExistingComponentId_negative() {
+ testCreate_negative(new NicEntity(vsp1Id, null, "non existing component id", null), USER1, VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+ }*/
+
+ @Test
+ public void testListWhenNone() {
+ Collection<org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity> nics =
+ vendorSoftwareProductManager.listNics(vsp1Id, null, component11Id, USER1);
+ Assert.assertEquals(nics.size(), 0);
+ }
+
+ @Test
+ public void testCreateNonExistingVspId_negative() {
+ testCreate_negative(new org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity("non existing vsp id", null, component11Id, null), USER1,
+ org.openecomp.sdc.versioning.errors.VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST);
+ }
+
+ @Test
+ public void testCreateOnLockedVsp_negative() {
+ testCreate_negative(new org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity(vsp1Id, null, component11Id, null), USER2,
+ org.openecomp.sdc.versioning.errors.VersioningErrorCodes.EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER);
+ }
+
+// @Test(dependsOnMethods = "testListWhenNone")
+// public void testCreate() {
+// nic1Id = testCreate(vsp1Id, component11Id, network1.getId(), network1.getNetworkCompositionData().getName());
+// }
+
+/* @Test(dependsOnMethods = {"testCreate"})
+ public void testCreateWithExistingName_negative() {
+ NicEntity nic = new NicEntity(vsp1Id, null, component11Id, null);
+ Nic nicData = new Nic();
+ nicData.setName("nic1 name");
+ nic.setNicCompositionData(nicData);
+ testCreate_negative(nic, USER1, UniqueValueUtil.UNIQUE_VALUE_VIOLATION);
+ }*/
+
+// @Test(dependsOnMethods = {"testCreate"})
+// public void testCreateWithExistingNameUnderOtherComponent() {
+// ComponentEntity component12 = new ComponentEntity(vsp1Id, null, null);
+// ComponentData compData12 = new ComponentData();
+// compData12.setName("comp12 name");
+// compData12.setDescription("comp12 desc");
+// component12.setComponentCompositionData(compData12);
+//
+// String component12Id = vendorSoftwareProductManager.createComponent(component12, USER1).getId();
+// testCreate(vsp1Id, component12Id, network1.getId(), network1.getNetworkCompositionData().getName());
+// }
+
+// @Test(dependsOnMethods = {"testCreate"})
+// public void testCreateWithExistingNameUnderOtherVsp() {
+// testCreate(vsp2Id, component21Id, network2.getId(), network2.getNetworkCompositionData().getName());
+// }
+
+ @Test
+ public void testCreateOnUploadVsp_negative() {
+ testCreate_negative(new org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity(vsp1Id, null, component11Id, null), USER1,
+ VendorSoftwareProductErrorCodes.VSP_COMPOSITION_EDIT_NOT_ALLOWED);
+ }
+
+ @Test
+ public void testGetNonExistingNicId_negative() {
+ testGet_negative(vsp1Id, null, component11Id, "non existing nic id", USER1,
+ org.openecomp.sdc.versioning.errors.VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+ }
+
+ @Test(dependsOnMethods = "testListWhenNone")//"testCreate")
+ public void testGetNonExistingComponentId_negative() {
+ testGet_negative(vsp1Id, null, "non existing component id", nic1Id, USER1,
+ org.openecomp.sdc.versioning.errors.VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+ }
+
+ @Test(dependsOnMethods = "testListWhenNone")//"testCreate")
+ public void testGetNonExistingVspId_negative() {
+ testGet_negative("non existing vsp id", null, component11Id, nic1Id, USER1,
+ org.openecomp.sdc.versioning.errors.VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST);
+ }
+
+ @Test(dependsOnMethods = "testListWhenNone")//"testCreate")
+ public void testGet() {
+ createNic(vsp1Id, VERSION01, component11Id, nic1Id, network1.getId());
+ testGet(vsp1Id, VERSION01, component11Id, nic1Id, USER1);
+ }
+
+ @Test
+ public void testUpdateNonExistingNicId_negative() {
+ testUpdate_negative(vsp1Id, component11Id, "non existing nic id", USER1,
+ org.openecomp.sdc.versioning.errors.VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+ }
+
+ @Test(dependsOnMethods = "testListWhenNone")//"testCreate")
+ public void testUpdateNonExistingComponentId_negative() {
+ testUpdate_negative(vsp1Id, "non existing component id", nic1Id, USER1,
+ org.openecomp.sdc.versioning.errors.VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+ }
+
+ @Test(dependsOnMethods = "testListWhenNone")//"testCreate")
+ public void testUpdateNonExistingVspId_negative() {
+ testUpdate_negative("non existing vsp id", component11Id, nic1Id, USER1,
+ org.openecomp.sdc.versioning.errors.VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST);
+ }
+
+ @Test(dependsOnMethods = {"testGet"})
+ public void testUpdateOnUploadVsp() {
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity
+ expected = new org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity(vsp1Id, null, component11Id, nic1Id);
+ org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic
+ nicData = new org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic();
+ nicData.setName(nic1Id + " name");
+ nicData.setDescription(nic1Id + " desc updated");
+ nicData.setNetworkId(network1.getId());
+ expected.setNicCompositionData(nicData);
+
+ CompositionEntityValidationData validationData =
+ vendorSoftwareProductManager.updateNic(expected, USER1);
+ Assert.assertTrue(validationData == null || validationData.getErrors() == null);
+ expected.setVersion(VERSION01);
+
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity
+ actual = vendorSoftwareProductDao.getNic(vsp1Id, VERSION01, component11Id, nic1Id);
+ Assert.assertEquals(actual, expected);
+ }
+
+ @Test(dependsOnMethods = {"testGet"})
+ public void testIllegalUpdateOnUploadVsp() {
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity
+ expected = new org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity(vsp1Id, null, component11Id, nic1Id);
+ org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic
+ nicData = new org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic();
+ nicData.setName(nic1Id + " name updated");
+ nicData.setDescription(nic1Id + " desc updated");
+ nicData.setNetworkId(network1.getId());
+ expected.setNicCompositionData(nicData);
+
+ CompositionEntityValidationData validationData =
+ vendorSoftwareProductManager.updateNic(expected, USER1);
+ Assert.assertNotNull(validationData);
+ Assert.assertTrue(validationData.getErrors().size() > 0);
+ }
+
+ @Test
+ public void testListNonExistingComponentId_negative() {
+ testList_negative(vsp1Id, null, "non existing component id", USER1,
+ org.openecomp.sdc.versioning.errors.VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+ }
+
+ @Test
+ public void testListNonExistingVspId_negative() {
+ testList_negative("non existing vsp id", null, component11Id, USER1,
+ org.openecomp.sdc.versioning.errors.VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST);
+ }
+/*
+ @Test(dependsOnMethods = {"testUpdateOnUploadVsp", "testList"})
+ public void testCreateWithRemovedName() {
+ testCreate(vsp1Id, component11Id);
+ }
+
+ @Test
+ public void testDeleteNonExistingNicId_negative() {
+ testDelete_negative(vsp1Id, component11Id, "non existing nic id", USER1, VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+ }
+
+ @Test(dependsOnMethods = "testList")
+ public void testDeleteNonExistingComponentId_negative() {
+ testDelete_negative(vsp1Id, "non existing component id", nic1Id, USER1, VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+ }*/
+
+ @Test(dependsOnMethods = {"testGet"})
+ public void testList() {
+ createNic(vsp1Id, VERSION01, component11Id, "nic2", network1.getId());
+
+ Collection<org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity> actual =
+ vendorSoftwareProductManager.listNics(vsp1Id, null, component11Id, USER1);
+ Assert.assertEquals(actual.size(), 2);
+ }
+
+ @Test(dependsOnMethods = "testList")
+ public void testDeleteNonExistingVspId_negative() {
+ testDelete_negative("non existing vsp id", component11Id, nic1Id, USER1,
+ org.openecomp.sdc.versioning.errors.VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST);
+ }
+/*
+ @Test(dependsOnMethods = "testList")
+ public void testDelete() {
+ vendorSoftwareProductManager.deleteNic(vsp1Id, component11Id, nic1Id, USER1);
+ NicEntity actual = vendorSoftwareProductDao.getNic(vsp1Id, VERSION01, component11Id, nic1Id);
+ Assert.assertNull(actual);
+ }*/
+
+ @Test(dependsOnMethods = "testList")
+ public void testDeleteOnUploadVsp_negative() {
+ testDelete_negative(vsp1Id, component11Id, nic1Id, USER1,
+ VendorSoftwareProductErrorCodes.VSP_COMPOSITION_EDIT_NOT_ALLOWED);
+ }
+
+ private String testCreate(String vspId, String componentId, String networkId,
+ String networkName) {
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity
+ expected = new org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity(vspId, null, componentId, null);
+
+ org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic
+ nicData = new org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic();
+ nicData.setName("nic1 name");
+ nicData.setNetworkId(networkId);
+ //nicData.setNetworkName(networkName);
+ nicData.setNetworkType(org.openecomp.sdc.vendorsoftwareproduct.types.composition.NetworkType.External);
+ expected.setNicCompositionData(nicData);
+
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity created = vendorSoftwareProductManager.createNic(expected, USER1);
+ Assert.assertNotNull(created);
+ expected.setId(created.getId());
+ expected.setVersion(VERSION01);
+
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity actual =
+ vendorSoftwareProductDao.getNic(vspId, VERSION01, componentId, created.getId());
+
+ Assert.assertEquals(actual, expected);
+
+ return created.getId();
+ }
+
+ private void testGet(String vspId, org.openecomp.sdc.versioning.dao.types.Version version, String componentId, String nicId,
+ String user) {
+ CompositionEntityResponse<org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic> response =
+ vendorSoftwareProductManager.getNic(vspId, null, componentId, nicId, user);
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity
+ expected = vendorSoftwareProductDao.getNic(vspId, version, componentId, nicId);
+ Assert.assertEquals(response.getId(), expected.getId());
+ Assert.assertEquals(response.getData(), expected.getNicCompositionData());
+ Assert.assertNotNull(response.getSchema());
+ }
+
+ private void testCreate_negative(org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity nic, String user, String expectedErrorCode) {
+ try {
+ vendorSoftwareProductManager.createNic(nic, user);
+ Assert.fail();
+ } catch (CoreException e) {
+ Assert.assertEquals(e.code().id(), expectedErrorCode);
+ }
+ }
+
+ private void testGet_negative(String vspId, org.openecomp.sdc.versioning.dao.types.Version version, String componentId, String nicId,
+ String user, String expectedErrorCode) {
+ try {
+ vendorSoftwareProductManager.getNic(vspId, version, componentId, nicId, user);
+ Assert.fail();
+ } catch (CoreException e) {
+ Assert.assertEquals(e.code().id(), expectedErrorCode);
+ }
+ }
+
+ private void testUpdate_negative(String vspId, String componentId, String nicId, String user,
+ String expectedErrorCode) {
+ try {
+ vendorSoftwareProductManager.updateNic(new org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity(vspId, null, componentId, nicId), user);
+ Assert.fail();
+ } catch (CoreException e) {
+ Assert.assertEquals(e.code().id(), expectedErrorCode);
+ }
+ }
+
+ private void testList_negative(String vspId, org.openecomp.sdc.versioning.dao.types.Version version, String componentId, String user,
+ String expectedErrorCode) {
+ try {
+ vendorSoftwareProductManager.listNics(vspId, version, componentId, user);
+ Assert.fail();
+ } catch (CoreException e) {
+ Assert.assertEquals(e.code().id(), expectedErrorCode);
+ }
+ }
+
+ private void testDelete_negative(String vspId, String componentId, String nicId, String user,
+ String expectedErrorCode) {
+ try {
+ vendorSoftwareProductManager.deleteNic(vspId, componentId, nicId, user);
+ Assert.fail();
+ } catch (CoreException e) {
+ Assert.assertEquals(e.code().id(), expectedErrorCode);
+ }
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/ProcessesTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/ProcessesTest.java
new file mode 100644
index 0000000000..8571088be1
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/ProcessesTest.java
@@ -0,0 +1,473 @@
+package org.openecomp.sdc.vendorsoftwareproduct;
+
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessArtifactEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
+import org.openecomp.sdc.vendorsoftwareproduct.impl.VendorSoftwareProductManagerImpl;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.errors.VersioningErrorCodes;
+import org.openecomp.core.util.UniqueValueUtil;
+import org.openecomp.core.utilities.CommonMethods;
+
+import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.util.Collection;
+
+public class ProcessesTest {
+
+ protected static final String USER1 = "processesTestUser1";
+ protected static final VendorSoftwareProductManager vendorSoftwareProductManager =
+ new VendorSoftwareProductManagerImpl();
+ private static final String USER2 = "processesTestUser2";
+ private static final String ARTIFACT_NAME = "artifact.sh";
+ private static final Version VERSION01 = new Version(0, 1);
+ private static final VendorSoftwareProductDao vendorSoftwareProductDao =
+ VendorSoftwareProductDaoFactory.getInstance().createInterface();
+
+ protected String vsp1Id;
+ protected String vsp2Id;
+ protected String component11Id = VendorSoftwareProductConstants.GENERAL_COMPONENT_ID;
+ protected String component21Id = VendorSoftwareProductConstants.GENERAL_COMPONENT_ID;
+ private String p1Id;
+ private String p2Id;
+
+ @BeforeClass
+ protected void init() {
+ VspDetails vsp1 = vendorSoftwareProductManager.createNewVsp(VSPCommon
+ .createVspDetails(null, null, "VSP_" + CommonMethods.nextUuId(), "Test-vsp1", "vendorName1",
+ "vlm1Id", "icon", "category", "subCategory", "123", null), USER1);
+ vsp1Id = vsp1.getId();
+
+ VspDetails vsp2 = vendorSoftwareProductManager.createNewVsp(VSPCommon
+ .createVspDetails(null, null, "VSP_" + CommonMethods.nextUuId(), "Test-vsp2", "vendorName1",
+ "vlm1Id", "icon", "category", "subCategory", "123", null), USER1);
+ vsp2Id = vsp2.getId();
+ }
+
+ @Test
+ public void testListWhenNone() {
+ Collection<org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity> processes =
+ vendorSoftwareProductManager.listProcesses(vsp1Id, null, component11Id, USER1);
+ Assert.assertEquals(processes.size(), 0);
+ }
+
+ @Test
+ public void testCreateNonExistingComponentId_negative() {
+ testCreate_negative(new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity(vsp1Id, null, "non existing component id", null), USER1,
+ VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+ }
+
+ @Test
+ public void testCreateNonExistingVspId_negative() {
+ testCreate_negative(new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity("non existing vsp id", null, component11Id, null), USER1,
+ VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST);
+ }
+
+ @Test
+ public void testCreateOnLockedVsp_negative() {
+ testCreate_negative(new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity(vsp1Id, null, component11Id, null), USER2,
+ VersioningErrorCodes.EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER);
+ }
+
+ @Test(dependsOnMethods = "testListWhenNone")
+ public void testCreate() {
+ p1Id = testCreate(vsp1Id, component11Id);
+ }
+
+ @Test(dependsOnMethods = {"testCreate"})
+ public void testCreateWithExistingName_negative() {
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity
+ process = new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity(vsp1Id, null, component11Id, null);
+ process.setName("p1 name");
+ testCreate_negative(process, USER1, UniqueValueUtil.UNIQUE_VALUE_VIOLATION);
+ }
+
+ @Test(dependsOnMethods = {"testCreate"})
+ public void testCreateWithExistingNameUnderOtherComponent() {
+ // This method is implemented in the sub class ComponentProcessesTest, it is here in order to keep the tests sequence down there (using @Test).
+ }
+
+ @Test(dependsOnMethods = {"testCreate"})
+ public void testCreateWithExistingNameUnderOtherVsp() {
+ testCreate(vsp2Id, component21Id);
+ }
+
+ @Test
+ public void testGetNonExistingProcessId_negative() {
+ testGet_negative(vsp1Id, null, component11Id, "non existing process id", USER1,
+ VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+ }
+
+ @Test(dependsOnMethods = "testCreate")
+ public void testGetNonExistingComponentId_negative() {
+ testGet_negative(vsp1Id, null, "non existing component id", p1Id, USER1,
+ VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+ }
+
+ @Test(dependsOnMethods = "testCreate")
+ public void testGetNonExistingVspId_negative() {
+ testGet_negative("non existing vsp id", null, component11Id, p1Id, USER1,
+ VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST);
+ }
+
+ @Test(dependsOnMethods = "testCreate")
+ public void testGet() {
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity
+ actual = testGet(vsp1Id, VERSION01, component11Id, p1Id, USER1);
+ Assert.assertNull(actual.getArtifactName());
+ }
+
+ @Test
+ public void testUpdateNonExistingProcessId_negative() {
+ testUpdate_negative(vsp1Id, component11Id, "non existing process id", USER1,
+ VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+ }
+
+ @Test(dependsOnMethods = "testCreate")
+ public void testUpdateNonExistingComponentId_negative() {
+ testUpdate_negative(vsp1Id, "non existing component id", p1Id, USER1,
+ VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+ }
+
+ @Test(dependsOnMethods = "testCreate")
+ public void testUpdateNonExistingVspId_negative() {
+ testUpdate_negative("non existing vsp id", component11Id, p1Id, USER1,
+ VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST);
+ }
+
+ @Test(dependsOnMethods = {"testGet"})
+ public void testUpdate() {
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity
+ expected = new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity(vsp1Id, null, component11Id, p1Id);
+ expected.setName("p1 name updated");
+ expected.setDescription("p1 desc updated");
+
+ vendorSoftwareProductManager.updateProcess(expected, USER1);
+ expected.setVersion(VERSION01);
+
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity actual =
+ vendorSoftwareProductDao.getProcess(vsp1Id, VERSION01, component11Id, p1Id);
+ Assert.assertEquals(actual, expected);
+ }
+
+ @Test
+ public void testListNonExistingComponentId_negative() {
+ testList_negative(vsp1Id, null, "non existing component id", USER1,
+ VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+ }
+
+ @Test
+ public void testListNonExistingVspId_negative() {
+ testList_negative("non existing vsp id", null, component11Id, USER1,
+ VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST);
+ }
+
+ @Test(dependsOnMethods = {"testGet"})
+ public void testList() {
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity
+ p2 = new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity(vsp1Id, null, component11Id, null);
+ p2.setName("p2 name");
+ p2.setDescription("p2 desc");
+
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity createdP2 = vendorSoftwareProductManager.createProcess(p2, USER1);
+ p2Id = createdP2.getId();
+
+ Collection<org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity> actual =
+ vendorSoftwareProductManager.listProcesses(vsp1Id, null, component11Id, USER1);
+ Collection<org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity> expected =
+ vendorSoftwareProductDao.listProcesses(vsp1Id, VERSION01, component11Id);
+ Assert.assertEquals(actual.size(), 2);
+ Assert.assertEquals(actual, expected);
+ }
+
+ @Test(dependsOnMethods = {"testUpdate", "testList"})
+ public void testCreateWithRemovedName() {
+ testCreate(vsp1Id, component11Id);
+ }
+
+ @Test
+ public void testDeleteNonExistingProcessId_negative() {
+ testDelete_negative(vsp1Id, component11Id, "non existing process id", USER1,
+ VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+ }
+
+ @Test(dependsOnMethods = "testList")
+ public void testDeleteNonExistingComponentId_negative() {
+ testDelete_negative(vsp1Id, "non existing component id", p1Id, USER1,
+ VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+ }
+
+ @Test(dependsOnMethods = "testList")
+ public void testDeleteNonExistingVspId_negative() {
+ testDelete_negative("non existing vsp id", component11Id, p1Id, USER1,
+ VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST);
+ }
+
+ @Test(dependsOnMethods = "testList")
+ public void testDelete() {
+ vendorSoftwareProductManager.deleteProcess(vsp1Id, component11Id, p1Id, USER1);
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity actual =
+ vendorSoftwareProductDao.getProcess(vsp1Id, VERSION01, component11Id, p1Id);
+ Assert.assertNull(actual);
+ }
+
+ @Test
+ public void testUploadFileNonExistingProcessId_negative() {
+ testUploadFile_negative(vsp1Id, component11Id, "non existing process id", USER1,
+ VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+ }
+
+ @Test(dependsOnMethods = "testList")
+ public void testUploadFileNonExistingComponentId_negative() {
+ testUploadFile_negative(vsp1Id, "non existing component id", p2Id, USER1,
+ VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+ }
+
+ @Test(dependsOnMethods = "testList")
+ public void testUploadFileNonExistingVspId_negative() {
+ testUploadFile_negative("non existing vsp id", component11Id, p2Id, USER1,
+ VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST);
+ }
+
+ @Test(dependsOnMethods = "testList")
+ public void testGetFileWhenNone_negative() {
+ testGetFile_negative(vsp1Id, null, component11Id, p2Id, USER1,
+ VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+ }
+
+ @Test(dependsOnMethods = "testList")
+ public void testDeleteFileWhenNone_negative() {
+ testDeleteFile_negative(vsp1Id, component11Id, p2Id, USER1,
+ VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+ }
+
+ @Test(dependsOnMethods = {"testGetFileWhenNone_negative", "testDeleteFileWhenNone_negative"})
+ public void testUploadFile() {
+ vendorSoftwareProductManager
+ .uploadProcessArtifact(new ByteArrayInputStream("bla bla".getBytes()), ARTIFACT_NAME,
+ vsp1Id, component11Id, p2Id, USER1);
+ ProcessArtifactEntity actual =
+ vendorSoftwareProductDao.getProcessArtifact(vsp1Id, VERSION01, component11Id, p2Id);
+ Assert.assertNotNull(actual);
+ Assert.assertNotNull(actual.getArtifact());
+ Assert.assertEquals(actual.getArtifactName(), ARTIFACT_NAME);
+ }
+
+ @Test(dependsOnMethods = "testUploadFile")
+ public void testGetAfterUploadFile() {
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity
+ actual = testGet(vsp1Id, VERSION01, component11Id, p2Id, USER1);
+ Assert.assertEquals(actual.getArtifactName(), ARTIFACT_NAME);
+ }
+
+ @Test
+ public void testGetFileNonExistingProcessId_negative() {
+ testGetFile_negative(vsp1Id, null, component11Id, "non existing process id", USER1,
+ VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+ }
+
+ @Test(dependsOnMethods = "testList")
+ public void testGetFileNonExistingComponentId_negative() {
+ testGetFile_negative(vsp1Id, null, "non existing component id", p2Id, USER1,
+ VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+ }
+
+ @Test(dependsOnMethods = "testList")
+ public void testGetFileNonExistingVspId_negative() {
+ testGetFile_negative("non existing vsp id", null, component11Id, p2Id, USER1,
+ VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST);
+ }
+
+ @Test(dependsOnMethods = "testUploadFile")
+ public void testGetFile() {
+ File actual =
+ vendorSoftwareProductManager.getProcessArtifact(vsp1Id, null, component11Id, p2Id, USER1);
+ Assert.assertNotNull(actual);
+ ProcessArtifactEntity expected =
+ vendorSoftwareProductDao.getProcessArtifact(vsp1Id, VERSION01, component11Id, p2Id);
+ Assert.assertNotNull(expected);
+ Assert.assertNotNull(expected.getArtifact());
+ }
+
+ @Test
+ public void testDeleteFileNonExistingProcessId_negative() {
+ testDeleteFile_negative(vsp1Id, component11Id, "non existing process id", USER1,
+ VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+ }
+
+ @Test(dependsOnMethods = "testList")
+ public void testDeleteFileNonExistingComponentId_negative() {
+ testDeleteFile_negative(vsp1Id, "non existing component id", p2Id, USER1,
+ VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+ }
+
+ @Test(dependsOnMethods = "testList")
+ public void testDeleteFileNonExistingVspId_negative() {
+ testDeleteFile_negative("non existing vsp id", component11Id, p2Id, USER1,
+ VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST);
+ }
+
+ @Test(dependsOnMethods = "testGetFile")
+ public void testDeleteFile() {
+ vendorSoftwareProductManager.deleteProcessArtifact(vsp1Id, component11Id, p2Id, USER1);
+ ProcessArtifactEntity expected =
+ vendorSoftwareProductDao.getProcessArtifact(vsp1Id, VERSION01, component11Id, p2Id);
+ Assert.assertNull(expected.getArtifact());
+ }
+
+ @Test
+ public void testDeleteListNonExistingComponentId_negative() {
+ testDeleteList_negative(vsp1Id, "non existing component id", USER1,
+ VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+ }
+
+ @Test
+ public void testDeleteListNonExistingVspId_negative() {
+ testDeleteList_negative("non existing vsp id", component11Id, USER1,
+ VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST);
+ }
+
+ @Test(dependsOnMethods = {"testDeleteFile"})
+ public void testDeleteList() {
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity
+ p3 = new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity(vsp1Id, null, component11Id, null);
+ p3.setName("p3 name");
+ p3.setDescription("p3 desc");
+ vendorSoftwareProductManager.createProcess(p3, USER1);
+
+ vendorSoftwareProductManager.deleteProcesses(vsp1Id, component11Id, USER1);
+
+ Collection<org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity> actual =
+ vendorSoftwareProductManager.listProcesses(vsp1Id, null, component11Id, USER1);
+ Assert.assertEquals(actual.size(), 0);
+ }
+
+ protected String testCreate(String vspId, String componentId) {
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity
+ expected = new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity(vspId, null, componentId, null);
+ expected.setName("p1 name");
+ expected.setDescription("p1 desc");
+
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity created = vendorSoftwareProductManager.createProcess(expected, USER1);
+ Assert.assertNotNull(created);
+ expected.setId(created.getId());
+ expected.setVersion(VERSION01);
+
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity actual =
+ vendorSoftwareProductDao.getProcess(vspId, VERSION01, componentId, created.getId());
+
+ Assert.assertEquals(actual, expected);
+
+ return created.getId();
+ }
+
+ private org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity testGet(String vspId, Version version, String componentId, String processId,
+ String user) {
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity actual =
+ vendorSoftwareProductManager.getProcess(vspId, null, componentId, processId, user);
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity expected =
+ vendorSoftwareProductDao.getProcess(vspId, version, componentId, processId);
+ Assert.assertEquals(actual, expected);
+ return actual;
+ }
+
+ private void testCreate_negative(
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity process, String user, String expectedErrorCode) {
+ try {
+ vendorSoftwareProductManager.createProcess(process, user);
+ Assert.fail();
+ } catch (CoreException e) {
+ Assert.assertEquals(e.code().id(), expectedErrorCode);
+ }
+ }
+
+ private void testGet_negative(String vspId, Version version, String componentId, String processId,
+ String user, String expectedErrorCode) {
+ try {
+ vendorSoftwareProductManager.getProcess(vspId, version, componentId, processId, user);
+ Assert.fail();
+ } catch (CoreException e) {
+ Assert.assertEquals(e.code().id(), expectedErrorCode);
+ }
+ }
+
+ private void testUpdate_negative(String vspId, String componentId, String processId, String user,
+ String expectedErrorCode) {
+ try {
+ vendorSoftwareProductManager
+ .updateProcess(new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity(vspId, null, componentId, processId), user);
+ Assert.fail();
+ } catch (CoreException e) {
+ Assert.assertEquals(e.code().id(), expectedErrorCode);
+ }
+ }
+
+ private void testList_negative(String vspId, Version version, String componentId, String user,
+ String expectedErrorCode) {
+ try {
+ vendorSoftwareProductManager.listProcesses(vspId, version, componentId, user);
+ Assert.fail();
+ } catch (CoreException e) {
+ Assert.assertEquals(e.code().id(), expectedErrorCode);
+ }
+ }
+
+ private void testDeleteList_negative(String vspId, String componentId, String user,
+ String expectedErrorCode) {
+ try {
+ vendorSoftwareProductManager.deleteProcesses(vspId, componentId, user);
+ Assert.fail();
+ } catch (CoreException e) {
+ Assert.assertEquals(e.code().id(), expectedErrorCode);
+ }
+ }
+
+ private void testDelete_negative(String vspId, String componentId, String processId, String user,
+ String expectedErrorCode) {
+ try {
+ vendorSoftwareProductManager.deleteProcess(vspId, componentId, processId, user);
+ Assert.fail();
+ } catch (CoreException e) {
+ Assert.assertEquals(e.code().id(), expectedErrorCode);
+ }
+ }
+
+ private void testGetFile_negative(String vspId, Version version, String componentId,
+ String processId, String user, String expectedErrorCode) {
+ try {
+ vendorSoftwareProductManager.getProcessArtifact(vspId, version, componentId, processId, user);
+ Assert.fail();
+ } catch (CoreException e) {
+ Assert.assertEquals(e.code().id(), expectedErrorCode);
+ }
+ }
+
+ private void testUploadFile_negative(String vspId, String componentId, String processId,
+ String user, String expectedErrorCode) {
+ try {
+ vendorSoftwareProductManager
+ .uploadProcessArtifact(new ByteArrayInputStream("bla bla".getBytes()), "artifact.sh",
+ vspId, componentId, processId, user);
+ Assert.fail();
+ } catch (CoreException e) {
+ Assert.assertEquals(e.code().id(), expectedErrorCode);
+ }
+ }
+
+ private void testDeleteFile_negative(String vspId, String componentId, String processId,
+ String user, String expectedErrorCode) {
+ try {
+ vendorSoftwareProductManager.deleteProcessArtifact(vspId, componentId, processId, user);
+ Assert.fail();
+ } catch (CoreException e) {
+ Assert.assertEquals(e.code().id(), expectedErrorCode);
+ }
+ }
+
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/VSPCommon.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/VSPCommon.java
new file mode 100644
index 0000000000..4eaba77f2b
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/VSPCommon.java
@@ -0,0 +1,78 @@
+package org.openecomp.sdc.vendorsoftwareproduct;
+
+import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
+
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.core.utilities.file.FileUtils;
+
+import java.io.*;
+import java.util.List;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
+
+public class VSPCommon {
+
+ public static VspDetails createVspDetails(String id, Version version, String name, String desc,
+ String vendorName, String vlm, String icon,
+ String category, String subCategory,
+ String licenseAgreement, List<String> featureGroups) {
+ VspDetails vspDetails = new VspDetails(id, version);
+ vspDetails.setName(name);
+ vspDetails.setDescription(desc);
+ vspDetails.setIcon(icon);
+ vspDetails.setCategory(category);
+ vspDetails.setSubCategory(subCategory);
+ vspDetails.setVendorName(vendorName);
+ vspDetails.setVendorId(vlm);
+ vspDetails.setVlmVersion(new Version(1, 0));
+ vspDetails.setLicenseAgreement(licenseAgreement);
+ vspDetails.setFeatureGroups(featureGroups);
+ return vspDetails;
+ }
+
+
+ public static VendorLicenseModelEntity createVendorLicenseModel(String name, String desc,
+ String icon) {
+ VendorLicenseModelEntity vendorLicenseModel = new VendorLicenseModelEntity();
+ vendorLicenseModel.setVendorName(name);
+ vendorLicenseModel.setDescription(desc);
+ vendorLicenseModel.setIconRef(icon);
+ return vendorLicenseModel;
+ }
+
+ public static void zipDir(File file, String path, ZipOutputStream zos) {
+ zipDir(file, path, zos, false);
+ }
+
+ public static void zipDir(File file, String path, ZipOutputStream zos, boolean isRootDir) {
+ if (file.isDirectory()) {
+ path += File.separator + file.getName();
+ File[] files = file.listFiles();
+ if (files != null) {
+ for (File innerFile : files) {
+ if (isRootDir) {
+ zipDir(innerFile, "", zos, false);
+ } else {
+ zipDir(innerFile, path, zos, false);
+ }
+ }
+ }
+ } else {
+
+ try {
+ if (!path.isEmpty()) {
+ path += File.separator;
+ }
+ zos.putNextEntry(new ZipEntry(path + file.getName()));
+ InputStream is = new FileInputStream(file);
+ byte[] data = FileUtils.toByteArray(is);
+ zos.write(data);
+ zos.closeEntry();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/VSPFullTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/VSPFullTest.java
new file mode 100644
index 0000000000..ebc4c3af64
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/VSPFullTest.java
@@ -0,0 +1,194 @@
+package org.openecomp.sdc.vendorsoftwareproduct;
+
+import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
+import org.openecomp.sdc.tosca.datatypes.model.CapabilityDefinition;
+import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity;
+import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacade;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
+import org.openecomp.sdc.vendorsoftwareproduct.impl.VendorSoftwareProductManagerImpl;
+import org.openecomp.sdc.vendorsoftwareproduct.types.ValidationResponse;
+import org.openecomp.sdc.vendorsoftwareproduct.types.VersionedVendorSoftwareProductInfo;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.core.model.dao.EnrichedServiceModelDaoFactory;
+import org.openecomp.core.util.UniqueValueUtil;
+import org.openecomp.core.utilities.CommonMethods;
+import org.apache.commons.collections4.MapUtils;
+import org.apache.commons.io.IOUtils;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+import java.io.*;
+import java.net.URL;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+public class VSPFullTest {
+
+
+ public static final Version VERSION01 = new Version(0, 1);
+ private static final org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao
+ vendorSoftwareProductDao =
+ VendorSoftwareProductDaoFactory.getInstance().createInterface();
+ private static final String USER1 = "vspTestUser1";
+ private static VendorSoftwareProductManager vendorSoftwareProductManager =
+ new VendorSoftwareProductManagerImpl();
+ private static VendorLicenseFacade vendorLicenseFacade =
+ org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacadeFactory.getInstance().createInterface();
+
+ @Test
+ public void testEnrichModelInSubmit() {
+ UniqueValueUtil
+ .deleteUniqueValue(VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME,
+ "VSP_FullTest");
+
+ String vlm1Id = vendorLicenseFacade.createVendorLicenseModel(VSPCommon
+ .createVendorLicenseModel("vlmName " + CommonMethods.nextUuId(), "vlm1Id desc", "icon1"),
+ USER1).getId();
+ String entitlementPoolId = vendorLicenseFacade
+ .createEntitlementPool(new EntitlementPoolEntity(vlm1Id, null, null), USER1).getId();
+
+ org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity
+ featureGroup = new org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity(vlm1Id, null, null);
+ featureGroup.getEntitlementPoolIds().add(entitlementPoolId);
+ String featureGroupId = vendorLicenseFacade.createFeatureGroup(featureGroup, USER1).getId();
+
+ org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity
+ licenseAgreement = new org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity(vlm1Id, null, null);
+ licenseAgreement.getFeatureGroupIds().add(featureGroupId);
+ String licenseAgreementId =
+ vendorLicenseFacade.createLicenseAgreement(licenseAgreement, USER1).getId();
+
+ vendorLicenseFacade.checkin(vlm1Id, USER1);
+ vendorLicenseFacade.submit(vlm1Id, USER1);
+
+ String vspId = createVsp(vlm1Id, licenseAgreementId, licenseAgreement.getFeatureGroupIds());
+
+ Collection<org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity> components = uploadFullCompositionFile(vspId);
+
+
+ //check in
+ vendorSoftwareProductManager.checkin(vspId, USER1);
+ //submit
+ try {
+ ValidationResponse result = vendorSoftwareProductManager.submit(vspId, USER1);
+ //Assert.assertTrue(result.isValid());
+ //PackageInfo createPackageResult = vendorSoftwareProductManager.createPackage(vspId, USER1);
+
+ } catch (IOException e) {
+ Assert.fail();
+ }
+ VersionedVendorSoftwareProductInfo details =
+ vendorSoftwareProductManager.getVspDetails(vspId, null, USER1);
+
+
+ //File csar = vendorSoftwareProductManager.getTranslatedFile(vspId,details.getVersionInfo().getActiveVersion(),USER1);
+ // writeFile(csar);
+
+
+ ToscaServiceModel model =
+ (ToscaServiceModel) EnrichedServiceModelDaoFactory.getInstance().createInterface()
+ .getServiceModel(vspId, details.getVersionInfo().getActiveVersion());
+
+ Map<String, CapabilityDefinition> capabilities = new HashMap<>();
+ for (org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity component : components) {
+ model.getServiceTemplates().
+ entrySet().
+ stream().
+ filter(entryValue -> entryValue.getValue() != null &&
+ entryValue.getValue().getNode_types() != null &&
+ entryValue.getValue().
+ getNode_types().
+ containsKey(component.getComponentCompositionData().getName())).
+ forEach(entryValue -> entryValue.getValue().getNode_types().
+ values().
+ stream().
+ filter(type -> MapUtils.isNotEmpty(type.getCapabilities())).
+ forEach(type -> type.getCapabilities().
+ entrySet().
+ forEach(entry -> addCapability(entryValue.getKey(), capabilities, entry.getKey(),
+ entry.getValue()))));
+
+ }
+
+ Assert.assertNotNull(capabilities);
+ }
+
+ private Collection<org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity> uploadFullCompositionFile(String vspId) {
+ vendorSoftwareProductManager
+ .uploadFile(vspId, getFileInputStream("/vspmanager/zips/fullComposition.zip"), USER1);
+
+ Collection<org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity> components =
+ vendorSoftwareProductManager.listComponents(vspId, null, USER1);
+ Assert.assertFalse(components.isEmpty());
+
+ for (org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity component : components) {
+ Assert.assertNotNull(vendorSoftwareProductManager
+ .getComponentQuestionnaire(vspId, null, component.getId(), USER1).getData());
+
+ Collection<org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity> nics =
+ vendorSoftwareProductManager.listNics(vspId, null, component.getId(), USER1);
+ Assert.assertFalse(nics.isEmpty());
+ for (org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity nic : nics) {
+ Assert.assertNotNull(vendorSoftwareProductManager
+ .getNicQuestionnaire(vspId, null, component.getId(), nic.getId(), USER1).getData());
+ }
+ }
+
+ return components;
+ }
+
+ private String createVsp(String vlm1Id, String licenseAgreementId, Set<String> featureGroupIds) {
+ VspDetails expectedVsp = VSPCommon
+ .createVspDetails(null, null, "VSP_FullTest", "Test-vsp_fullTest", "vendorName", vlm1Id,
+ "icon", "category", "subCategory", licenseAgreementId,
+ featureGroupIds.stream().collect(Collectors.toList()));
+ String vspId = vendorSoftwareProductManager.createNewVsp(expectedVsp, USER1).getId();
+
+ VspDetails actualVsp =
+ vendorSoftwareProductDao.getVendorSoftwareProductInfo(new VspDetails(vspId, VERSION01));
+ expectedVsp.setId(vspId);
+ expectedVsp.setVersion(VERSION01);
+
+ VendorSoftwareProductManagerTest.assertVspsEquals(actualVsp, expectedVsp);
+ Assert.assertNotNull(
+ vendorSoftwareProductManager.getVspQuestionnaire(vspId, null, USER1).getData());
+ return vspId;
+ }
+
+ private void writeFile(File csar) {
+ try {
+ FileInputStream in = new FileInputStream(csar);
+ File output = new File("CSAR_vDNS.zip");
+
+ FileOutputStream out = new FileOutputStream(output);
+
+ IOUtils.copy(in, out);
+ in.close();
+ out.close();
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ private void addCapability(String entryValueKey, Map<String, CapabilityDefinition> capabilities,
+ String key, CapabilityDefinition value) {
+
+ capabilities.put(entryValueKey + "_" + key, value);
+ }
+
+ private InputStream getFileInputStream(String fileName) {
+ URL url = this.getClass().getResource(fileName);
+ try {
+ return url.openStream();
+ } catch (IOException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductManagerTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductManagerTest.java
new file mode 100644
index 0000000000..d94c868f25
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductManagerTest.java
@@ -0,0 +1,672 @@
+package org.openecomp.sdc.vendorsoftwareproduct;
+
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.common.errors.ErrorCode;
+import org.openecomp.sdc.common.errors.ValidationErrorBuilder;
+import org.openecomp.sdc.common.utils.AsdcCommon;
+import org.openecomp.sdc.heat.datatypes.structure.HeatStructureTree;
+import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
+import org.openecomp.sdc.tosca.datatypes.model.CapabilityDefinition;
+import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity;
+import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacade;
+
+import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.PackageInfo;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.UploadDataEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
+import org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes;
+import org.openecomp.sdc.vendorsoftwareproduct.impl.VendorSoftwareProductManagerImpl;
+import org.openecomp.sdc.vendorsoftwareproduct.tree.UploadFileTest;
+import org.openecomp.sdc.vendorsoftwareproduct.types.UploadFileResponse;
+import org.openecomp.sdc.vendorsoftwareproduct.types.ValidationResponse;
+import org.openecomp.sdc.vendorsoftwareproduct.types.VersionedVendorSoftwareProductInfo;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.errors.VersioningErrorCodes;
+import org.openecomp.core.model.dao.EnrichedServiceModelDaoFactory;
+import org.openecomp.core.util.UniqueValueUtil;
+import org.openecomp.core.utilities.CommonMethods;
+import org.openecomp.core.validation.errors.Messages;
+import org.apache.commons.collections4.MapUtils;
+import org.apache.commons.io.IOUtils;
+import org.testng.Assert;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Test;
+
+import java.io.*;
+import java.net.URL;
+import java.util.*;
+import java.util.stream.Collectors;
+
+public class VendorSoftwareProductManagerTest {
+ public static final Version VERSION01 = new Version(0, 1);
+ public static final Version VERSION10 = new Version(1, 0);
+ private static final String USER1 = "vspTestUser1";
+ private static final String USER2 = "vspTestUser2";
+ private static final String USER3 = "vspTestUser3";
+ public static String id001 = null;
+ public static String id002 = null;
+ public static String id003 = null;
+ public static String id004 = null;
+ public static String id005 = null;
+ public static String id006 = null;
+ public static String id007 = null;
+ public static Version activeVersion002 = null;
+ private static VendorSoftwareProductManager vendorSoftwareProductManager =
+ new VendorSoftwareProductManagerImpl();
+ private static org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao
+ vendorSoftwareProductDao =
+ VendorSoftwareProductDaoFactory.getInstance().createInterface();
+ private static VendorLicenseFacade vendorLicenseFacade =
+ org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacadeFactory.getInstance().createInterface();
+ private static String vlm1Id;
+ private static String licenseAgreementId;
+ private static String featureGroupId;
+ private static VspDetails vsp1;
+ private static VspDetails vsp2;
+ UploadFileTest ut = new UploadFileTest();
+
+ static void assertVspsEquals(VspDetails actual, VspDetails expected) {
+ Assert.assertEquals(actual.getId(), expected.getId());
+ Assert.assertEquals(actual.getVersion(), expected.getVersion());
+ Assert.assertEquals(actual.getName(), expected.getName());
+ Assert.assertEquals(actual.getDescription(), expected.getDescription());
+ Assert.assertEquals(actual.getIcon(), expected.getIcon());
+ Assert.assertEquals(actual.getCategory(), expected.getCategory());
+ Assert.assertEquals(actual.getSubCategory(), expected.getSubCategory());
+ Assert.assertEquals(actual.getVendorName(), expected.getVendorName());
+ Assert.assertEquals(actual.getVendorId(), expected.getVendorId());
+ Assert.assertEquals(actual.getLicenseAgreement(), expected.getLicenseAgreement());
+ Assert.assertEquals(actual.getFeatureGroups(), expected.getFeatureGroups());
+ }
+
+ @BeforeTest
+ private void init() {
+ UniqueValueUtil
+ .deleteUniqueValue(VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME,
+ "VSP1");
+ UniqueValueUtil
+ .deleteUniqueValue(VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME,
+ "VSP3");
+ UniqueValueUtil
+ .deleteUniqueValue(VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME,
+ "VSP4");
+ UniqueValueUtil
+ .deleteUniqueValue(VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME,
+ "VSP5");
+ UniqueValueUtil
+ .deleteUniqueValue(VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME,
+ "vsp1_test");
+ UniqueValueUtil
+ .deleteUniqueValue(VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME,
+ "vsp2_test");
+ createVlm();
+ }
+
+ private void createVlm() {
+ vlm1Id = vendorLicenseFacade.createVendorLicenseModel(VSPCommon
+ .createVendorLicenseModel("vlmName " + CommonMethods.nextUuId(), "vlm1Id desc", "icon1"),
+ USER1).getId();
+
+ String entitlementPoolId = vendorLicenseFacade
+ .createEntitlementPool(new EntitlementPoolEntity(vlm1Id, null, null), USER1).getId();
+
+ org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity
+ featureGroup = new org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity(vlm1Id, null, null);
+ featureGroup.getEntitlementPoolIds().add(entitlementPoolId);
+ featureGroupId = vendorLicenseFacade.createFeatureGroup(featureGroup, USER1).getId();
+
+ LicenseAgreementEntity licenseAgreement = new LicenseAgreementEntity(vlm1Id, null, null);
+ licenseAgreement.getFeatureGroupIds().add(featureGroupId);
+ licenseAgreementId =
+ vendorLicenseFacade.createLicenseAgreement(licenseAgreement, USER1).getId();
+
+ vendorLicenseFacade.checkin(vlm1Id, USER1);
+ vendorLicenseFacade.submit(vlm1Id, USER1);
+ }
+
+ @Test
+ public void testHeatSet() {
+ Set<HeatStructureTree> set = new HashSet<>();
+ HeatStructureTree heatStructureTree1 = new HeatStructureTree();
+ HeatStructureTree heatStructureTree2 = new HeatStructureTree();
+
+ heatStructureTree1.setFileName("file");
+
+ HeatStructureTree env = new HeatStructureTree();
+ env.setFileName("env");
+ heatStructureTree1.setEnv(env);
+
+ heatStructureTree2.setFileName("file");
+ heatStructureTree2.setEnv(env);
+
+ set.add(heatStructureTree1);
+ set.add(heatStructureTree2);
+
+ Assert.assertEquals(set.size(), 1);
+ }
+
+ @Test(dependsOnMethods = {"testHeatSet"})
+ public void testCreateVSP() {
+ VspDetails expectedVsp = VSPCommon
+ .createVspDetails(null, null, "VSP1", "Test-vsp", "vendorName", vlm1Id, "icon", "category",
+ "subCategory", "123", null);
+
+ VspDetails createdVsp = vendorSoftwareProductManager.createNewVsp(expectedVsp, USER1);
+ id001 = createdVsp.getId();
+ Assert.assertNotNull(id001);
+ Assert.assertNotNull(createdVsp.getVersion());
+
+ VspDetails actualVsp =
+ vendorSoftwareProductDao.getVendorSoftwareProductInfo(new VspDetails(id001, VERSION01));
+ expectedVsp.setId(id001);
+ expectedVsp.setVersion(VERSION01);
+
+ assertVspsEquals(actualVsp, expectedVsp);
+ Assert.assertNotNull(
+ vendorSoftwareProductManager.getVspQuestionnaire(id001, null, USER1).getData());
+ }
+
+ @Test(dependsOnMethods = {"testCreateVSP"})
+ public void testCreateWithExistingName_negative() {
+ try {
+ VspDetails expectedVsp = VSPCommon
+ .createVspDetails(null, null, "Vsp1", "Test-vsp", "vendorName", vlm1Id, "icon",
+ "category", "subCategory", "123", null);
+ vendorSoftwareProductManager.createNewVsp(expectedVsp, USER1);
+ Assert.fail();
+ } catch (CoreException e) {
+ Assert.assertEquals(e.code().id(), UniqueValueUtil.UNIQUE_VALUE_VIOLATION);
+ }
+ }
+
+ @Test(dependsOnMethods = {"testCreateWithExistingName_negative"})
+ public void testGetVSPDetails() {
+ VersionedVendorSoftwareProductInfo actualVsp =
+ vendorSoftwareProductManager.getVspDetails(id001, null, USER1);
+
+ VspDetails expectedVsp =
+ vendorSoftwareProductDao.getVendorSoftwareProductInfo(new VspDetails(id001, VERSION01));
+ assertVspsEquals(actualVsp.getVspDetails(), expectedVsp);
+ Assert.assertEquals(actualVsp.getVersionInfo().getActiveVersion(), VERSION01);
+ Assert.assertEquals(actualVsp.getVersionInfo().getStatus(), org.openecomp.sdc.versioning.dao.types.VersionStatus.Locked);
+ Assert.assertEquals(actualVsp.getVersionInfo().getLockingUser(), USER1);
+ }
+
+ @Test(dependsOnMethods = {"testGetVSPDetails"})
+ public void testUpdateVSP() {
+ VspDetails expectedVsp = VSPCommon
+ .createVspDetails(id001, VERSION01, "VSP1", null, "vendorName", vlm1Id, "icon", "category",
+ "subCategory", "456", null);
+ vendorSoftwareProductManager.updateVsp(expectedVsp, USER1);
+
+ VspDetails actualVsp =
+ vendorSoftwareProductDao.getVendorSoftwareProductInfo(new VspDetails(id001, VERSION01));
+
+ assertVspsEquals(actualVsp, expectedVsp);
+ }
+
+ @Test(dependsOnMethods = {"testUpdateVSP"})
+ public void testGetVSPDetailsAfterUpdate() {
+ VersionedVendorSoftwareProductInfo vspDetails =
+ vendorSoftwareProductManager.getVspDetails(id001, null, USER1);
+ Assert.assertEquals(vspDetails.getVspDetails().getName(), "VSP1");
+ Assert.assertEquals(vspDetails.getVspDetails().getCategory(), "category");
+ Assert.assertEquals(vspDetails.getVspDetails().getSubCategory(), "subCategory");
+ Assert.assertEquals(vspDetails.getVspDetails().getVendorId(), vlm1Id);
+ Assert.assertEquals(vspDetails.getVersionInfo().getActiveVersion(), VERSION01);
+ Assert.assertEquals(vspDetails.getVersionInfo().getStatus(), org.openecomp.sdc.versioning.dao.types.VersionStatus.Locked);
+ Assert.assertEquals(vspDetails.getVersionInfo().getLockingUser(), USER1);
+ }
+
+ @Test(dependsOnMethods = {"testGetVSPDetailsAfterUpdate"})
+ public void testGetVSPList() {
+ String licenseAgreementId = "bla bla";
+ VspDetails vspDetails = vendorSoftwareProductManager.createNewVsp(VSPCommon
+ .createVspDetails(null, null, "VSP3", "Test-vsp", "vendorName", vlm1Id, "icon", "category",
+ "subCategory", licenseAgreementId, null), USER1);
+ id002 = vspDetails.getId();
+ vspDetails = vendorSoftwareProductManager.createNewVsp(VSPCommon
+ .createVspDetails(null, null, "VSP4", "Test-vsp", "vendorName", vlm1Id, "icon", "category",
+ "subCategory", licenseAgreementId, null), USER1);
+ id003 = vspDetails.getId();
+
+ List<VersionedVendorSoftwareProductInfo> vspDetailsList =
+ vendorSoftwareProductManager.getVspList(null, USER1);
+ int foundCount = 0;
+ for (VersionedVendorSoftwareProductInfo vsp : vspDetailsList) {
+ if (vsp.getVspDetails().getId().equals(id001) || vsp.getVspDetails().getId().equals(id002) ||
+ vsp.getVspDetails().getId().equals(id003)) {
+ foundCount++;
+ }
+ }
+
+ Assert.assertEquals(foundCount, 3);
+ }
+
+ @Test(dependsOnMethods = {"testGetVSPList"})
+ // Unsupported operation for 1607 release.
+/* public void testDeleteVSP() {
+ vendorSoftwareProductManager.deleteVsp(id001, USER1);
+
+ VspDetails vspDetails = vendorSoftwareProductDao.getVendorSoftwareProductInfo(new VspDetails(id001, VERSION01));
+ Assert.assertNull(vspDetails);
+
+ List<VersionedVendorSoftwareProductInfo> vspDetailsList = vendorSoftwareProductManager.getVspList(null, USER1);
+ boolean found001 = false;
+ for (VersionedVendorSoftwareProductInfo vsp : vspDetailsList) {
+ if (vsp.getVspDetails().getId().equals(id001)) {
+ found001 = true;
+ }
+ }
+
+ Assert.assertFalse(found001);
+ }
+
+
+ @Test(dependsOnMethods = {"testDeleteVSP"})*/
+ public void testCheckin() {
+ vendorSoftwareProductManager.checkin(id002, USER1);
+
+ VersionedVendorSoftwareProductInfo vsp2 =
+ vendorSoftwareProductManager.getVspDetails(id002, null, USER1);
+ Assert.assertEquals(vsp2.getVersionInfo().getActiveVersion(), VERSION01);
+ Assert.assertEquals(vsp2.getVersionInfo().getStatus(), org.openecomp.sdc.versioning.dao.types.VersionStatus.Available);
+ Assert.assertNull(vsp2.getVersionInfo().getLockingUser());
+ }
+
+ @Test(dependsOnMethods = {"testCheckin"})
+ public void testCheckout() {
+ vendorSoftwareProductManager.checkout(id002, USER2);
+
+ VersionedVendorSoftwareProductInfo vsp2 =
+ vendorSoftwareProductManager.getVspDetails(id002, null, USER2);
+ Assert.assertEquals(vsp2.getVersionInfo().getActiveVersion(), new Version(0, 2));
+ Assert.assertEquals(vsp2.getVersionInfo().getStatus(), org.openecomp.sdc.versioning.dao.types.VersionStatus.Locked);
+ Assert.assertEquals(vsp2.getVersionInfo().getLockingUser(), USER2);
+
+ vsp2 = vendorSoftwareProductManager.getVspDetails(id002, null, USER1);
+ Assert.assertEquals(vsp2.getVersionInfo().getActiveVersion(), VERSION01);
+ Assert.assertEquals(vsp2.getVersionInfo().getStatus(), org.openecomp.sdc.versioning.dao.types.VersionStatus.Locked);
+ Assert.assertEquals(vsp2.getVersionInfo().getLockingUser(), USER2);
+ }
+
+ @Test(dependsOnMethods = {"testCheckout"})
+ public void testUndoCheckout() {
+ vendorSoftwareProductManager.undoCheckout(id002, USER2);
+
+ VersionedVendorSoftwareProductInfo vsp2 =
+ vendorSoftwareProductManager.getVspDetails(id002, null, USER2);
+ Assert.assertEquals(vsp2.getVersionInfo().getActiveVersion(), VERSION01);
+ Assert.assertEquals(vsp2.getVersionInfo().getStatus(), org.openecomp.sdc.versioning.dao.types.VersionStatus.Available);
+ Assert.assertNull(vsp2.getVersionInfo().getLockingUser());
+ }
+
+ @Test(dependsOnMethods = {"testUndoCheckout"})
+ public void testListFinalVspsWhenNone() {
+ List<VersionedVendorSoftwareProductInfo> vspDetailsList =
+ vendorSoftwareProductManager.getVspList(
+ org.openecomp.sdc.versioning.dao.types.VersionStatus.Final.name(), USER1);
+ int nonFinalFoundCount = 0;
+ for (VersionedVendorSoftwareProductInfo vsp : vspDetailsList) {
+ if (vsp.getVspDetails().getId().equals(id001) || vsp.getVspDetails().getId().equals(id002) ||
+ vsp.getVspDetails().getId().equals(id003)) {
+ nonFinalFoundCount++;
+ }
+ }
+
+ Assert.assertEquals(nonFinalFoundCount, 0);
+ }
+
+ @Test(dependsOnMethods = "testListFinalVspsWhenNone")
+ public void testSubmitWithoutLicencingData() throws IOException {
+ ValidationResponse validationResponse = vendorSoftwareProductManager.submit(id002, USER2);
+ Assert.assertNotNull(validationResponse);
+ Assert.assertFalse(validationResponse.isValid());
+ List<String> errorIds = validationResponse.getVspErrors().stream().map(ErrorCode::id).distinct()
+ .collect(Collectors.toList());
+ Assert.assertTrue(errorIds.contains(ValidationErrorBuilder.FIELD_VALIDATION_ERROR_ERR_ID));
+ Assert.assertTrue(errorIds.contains(VendorSoftwareProductErrorCodes.VSP_INVALID));
+ }
+
+ @Test(dependsOnMethods = {"testSubmitWithoutLicencingData"})
+ public void testSubmitWithoutUploadData() throws IOException {
+ vendorSoftwareProductManager.checkout(id002, USER2);
+
+ VspDetails updatedVsp2 =
+ vendorSoftwareProductManager.getVspDetails(id002, null, USER2).getVspDetails();
+ updatedVsp2.setFeatureGroups(new ArrayList<>());
+ updatedVsp2.getFeatureGroups().add(featureGroupId);
+ updatedVsp2.setLicenseAgreement(licenseAgreementId);
+
+ vendorSoftwareProductManager.updateVsp(updatedVsp2, USER2);
+ activeVersion002 = vendorSoftwareProductManager.checkin(id002, USER2);
+
+ ValidationResponse validationResponse = vendorSoftwareProductManager.submit(id002, USER2);
+ Assert.assertNotNull(validationResponse);
+ Assert.assertFalse(validationResponse.isValid());
+ Assert.assertTrue(validationResponse.getVspErrors().size() > 0);
+ }
+
+ @Test(dependsOnMethods = {"testSubmitWithoutUploadData"})
+ public void testUploadFile() throws IOException {
+ activeVersion002 = vendorSoftwareProductManager.checkout(id002, USER1);
+ testLegalUpload(id002, activeVersion002,
+ getFileInputStream("/vspmanager/zips/emptyComposition.zip"), USER1);
+ }
+
+/* @Test(dependsOnMethods = {"testUploadFile"})
+ public void testUploadFile2() throws IOException {
+ testLegalUpload(id002, activeVersion002, ut.getZipInputStream("/legalUpload2"), USER1);
+ }*/
+
+ @Test
+ public void testDownloadFile() throws IOException {
+ VspDetails expectedVsp = VSPCommon
+ .createVspDetails(null, null, String.format("VSP-test-%s", vlm1Id), "Test-vsp",
+ "vendorName", vlm1Id, "icon", "category", "subCategory", "123", null);
+ VspDetails createdVsp = vendorSoftwareProductManager.createNewVsp(expectedVsp, USER1);
+
+ id005 = createdVsp.getId();
+ Assert.assertNotNull(id005);
+ Assert.assertNotNull(createdVsp.getVersion());
+
+ //InputStream zipInputStream = getFileInputStream("/legalUpload/zip/legalUpload.zip")
+ try (InputStream zipInputStream = ut.getZipInputStream("/legalUpload")) {
+
+ UploadFileResponse resp =
+ vendorSoftwareProductManager.uploadFile(id005, zipInputStream, USER1);
+ File latestHeatPackage = vendorSoftwareProductManager.getLatestHeatPackage(id005, USER1);
+
+ zipInputStream.reset();
+ byte[] uploaded = IOUtils.toByteArray(zipInputStream);
+
+ byte[] downloaded;
+ try (BufferedInputStream fileStream = new BufferedInputStream(
+ new FileInputStream(latestHeatPackage))) {
+ downloaded = IOUtils.toByteArray(fileStream);
+ }
+
+ Assert.assertTrue(Arrays.equals(uploaded, downloaded));
+ }
+ }
+
+ @Test(dependsOnMethods = {"testUploadFile"})
+ public void testUploadNotExistingFile() throws IOException {
+ URL url = this.getClass().getResource("notExist.zip");
+ testLegalUpload(id002, activeVersion002, url == null ? null : url.openStream(), USER1);
+ }
+
+ @Test(dependsOnMethods = {"testUploadFile"}, expectedExceptions = CoreException.class)
+ public void negativeTestCreatePackageBeforeSubmit() throws IOException {
+ vendorSoftwareProductManager.createPackage(id002, USER1);
+ }
+
+ @Test(dependsOnMethods = {"negativeTestCreatePackageBeforeSubmit"})
+ public void negativeTestGetVSPDetailsNonExistingVersion() {
+ try {
+ vendorSoftwareProductManager.getVspDetails(id002, new Version(43, 8), USER1);
+ Assert.assertTrue(false);
+ } catch (CoreException e) {
+ Assert.assertEquals(e.code().id(), VersioningErrorCodes.REQUESTED_VERSION_INVALID);
+ }
+ }
+
+ @Test(dependsOnMethods = {"negativeTestCreatePackageBeforeSubmit"})
+ public void negativeTestGetVSPDetailsCheckoutByOtherVersion() {
+ try {
+ vendorSoftwareProductManager.getVspDetails(id002, activeVersion002, USER2);
+ Assert.assertTrue(false);
+ } catch (CoreException e) {
+ Assert.assertEquals(e.code().id(), VersioningErrorCodes.REQUESTED_VERSION_INVALID);
+ }
+ }
+
+ @Test(dependsOnMethods = {"negativeTestCreatePackageBeforeSubmit"})
+ public void testGetVSPDetailsCandidateVersion() {
+ VersionedVendorSoftwareProductInfo actualVsp =
+ vendorSoftwareProductManager.getVspDetails(id002, new Version(0, 3), USER1);
+
+ VspDetails expectedVsp = vendorSoftwareProductDao
+ .getVendorSoftwareProductInfo(new VspDetails(id002, new Version(0, 3)));
+ assertVspsEquals(actualVsp.getVspDetails(), expectedVsp);
+ Assert.assertEquals(actualVsp.getVersionInfo().getActiveVersion(), new Version(0, 3));
+ Assert.assertEquals(actualVsp.getVersionInfo().getStatus(), org.openecomp.sdc.versioning.dao.types.VersionStatus.Locked);
+ Assert.assertEquals(actualVsp.getVersionInfo().getLockingUser(), USER1);
+ }
+
+ @Test(dependsOnMethods = {"negativeTestCreatePackageBeforeSubmit"})
+ public void testGetVSPDetailsOldVersion() {
+ VersionedVendorSoftwareProductInfo actualVsp =
+ vendorSoftwareProductManager.getVspDetails(id002, new Version(0, 1), USER2);
+
+ VspDetails expectedVsp = vendorSoftwareProductDao
+ .getVendorSoftwareProductInfo(new VspDetails(id002, new Version(0, 1)));
+ assertVspsEquals(actualVsp.getVspDetails(), expectedVsp);
+ Assert.assertEquals(actualVsp.getVersionInfo().getActiveVersion(), new Version(0, 2));
+ Assert.assertEquals(actualVsp.getVersionInfo().getStatus(), org.openecomp.sdc.versioning.dao.types.VersionStatus.Locked);
+ Assert.assertEquals(actualVsp.getVersionInfo().getLockingUser(), USER1);
+ }
+
+ @Test(dependsOnMethods = {"negativeTestGetVSPDetailsNonExistingVersion",
+ "negativeTestGetVSPDetailsCheckoutByOtherVersion", "testGetVSPDetailsCandidateVersion",
+ "testGetVSPDetailsOldVersion"})
+ public void testSubmit() throws IOException {
+ activeVersion002 = vendorSoftwareProductManager.checkin(id002, USER1);
+ ValidationResponse validationResponse = vendorSoftwareProductManager.submit(id002, USER1);
+ Assert.assertTrue(validationResponse.isValid());
+
+ VersionedVendorSoftwareProductInfo vsp2 =
+ vendorSoftwareProductManager.getVspDetails(id002, null, USER1);
+ Assert.assertEquals(vsp2.getVersionInfo().getActiveVersion(), VERSION10);
+ Assert.assertEquals(vsp2.getVersionInfo().getStatus(), org.openecomp.sdc.versioning.dao.types.VersionStatus.Final);
+ Assert.assertNull(vsp2.getVersionInfo().getLockingUser());
+ }
+
+ @Test(dependsOnMethods = {"testSubmit"})
+ public void testListFinalVspsWhenExist() {
+ List<VersionedVendorSoftwareProductInfo> vspDetailsList =
+ vendorSoftwareProductManager.getVspList(
+ org.openecomp.sdc.versioning.dao.types.VersionStatus.Final.name(), USER1);
+ int nonFinalFoundCount = 0;
+ boolean found002 = false;
+ for (VersionedVendorSoftwareProductInfo vsp : vspDetailsList) {
+ if (vsp.getVspDetails().getId().equals(id002)) {
+ found002 = true;
+ }
+ if (vsp.getVspDetails().getId().equals(id001) || vsp.getVspDetails().getId().equals(id003)) {
+ nonFinalFoundCount++;
+ }
+ }
+
+ Assert.assertEquals(nonFinalFoundCount, 0);
+ Assert.assertTrue(found002);
+ }
+
+ @Test(dependsOnMethods = {"testSubmit"})
+ public void testCreatePackage() throws IOException {
+ PackageInfo packageInfo = vendorSoftwareProductManager.createPackage(id002, USER1);
+ Assert.assertNotNull(packageInfo.getVspId());
+ }
+
+ @Test
+ public void testUploadFileWithoutManifest() {
+ InputStream zis = getFileInputStream("/vspmanager/zips/withoutManifest.zip");
+ VspDetails vspDetails = vendorSoftwareProductManager.createNewVsp(VSPCommon
+ .createVspDetails(null, null, "VSP5", "Test-vsp", "vendorName", vlm1Id, "icon", "category",
+ "subCategory", "456", null), USER1);
+ id004 = vspDetails.getId();
+
+ UploadFileResponse uploadFileResponse =
+ vendorSoftwareProductManager.uploadFile(id004, zis, USER1);
+
+ Assert.assertNotNull(uploadFileResponse.getErrors());
+ Assert.assertEquals(uploadFileResponse.getErrors().size(), 1);
+ }
+
+ @Test(dependsOnMethods = {"testUploadFileWithoutManifest"})
+ public void testUploadFileMissingFile() {
+ InputStream zis = getFileInputStream("/vspmanager/zips/missingYml.zip");
+
+ UploadFileResponse uploadFileResponse =
+ vendorSoftwareProductManager.uploadFile(id004, zis, USER1);
+
+ Assert.assertEquals(uploadFileResponse.getErrors().size(), 3);
+ }
+
+ @Test(dependsOnMethods = {"testUploadFileMissingFile"})
+ public void testUploadNotZipFile() throws IOException {
+ URL url = this.getClass().getResource("/notZipFile");
+ UploadFileResponse uploadFileResponse =
+ vendorSoftwareProductManager.uploadFile(id004, url.openStream(), USER1);
+
+ Assert.assertNotNull(uploadFileResponse.getErrors());
+ Assert.assertEquals(
+ uploadFileResponse.getErrors().get(AsdcCommon.UPLOAD_FILE).get(0).getMessage(),
+ Messages.INVALID_ZIP_FILE.getErrorMessage());
+ }
+
+ @Test
+ public void testEnrichModelInSubmit() {
+ UniqueValueUtil
+ .deleteUniqueValue(VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME,
+ "VSP_syb");
+ VspDetails vspDetails = vendorSoftwareProductManager.createNewVsp(VSPCommon
+ .createVspDetails(null, null, "VSP_syb", "Test-vsp_syb", "vendorName", vlm1Id, "icon",
+ "category", "subCategory", "456", null), USER1);
+ String id = vspDetails.getId();
+
+ //upload file
+ InputStream zis = getFileInputStream("/vspmanager/zips/fullComposition.zip");
+ UploadFileResponse uploadFileResponse = vendorSoftwareProductManager.uploadFile(id, zis, USER1);
+
+ //check in
+ vendorSoftwareProductManager.checkin(id, USER1);
+ //submit
+ try {
+ ValidationResponse result = vendorSoftwareProductManager.submit(id, USER1);
+ } catch (IOException e) {
+ Assert.fail();
+ }
+ VersionedVendorSoftwareProductInfo details =
+ vendorSoftwareProductManager.getVspDetails(id, null, USER1);
+ Collection<org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity> components = vendorSoftwareProductManager
+ .listComponents(id, details.getVersionInfo().getActiveVersion(), USER1);
+
+ ToscaServiceModel model =
+ (ToscaServiceModel) EnrichedServiceModelDaoFactory.getInstance().createInterface()
+ .getServiceModel(id, details.getVersionInfo().getActiveVersion());
+
+ Map<String, CapabilityDefinition> capabilities = new HashMap<>();
+ for (org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity component : components) {
+ model.getServiceTemplates().
+ entrySet().
+ stream().
+ filter(entryValue -> entryValue.getValue() != null &&
+ entryValue.getValue().getNode_types() != null &&
+ entryValue.getValue().
+ getNode_types().
+ containsKey(component.getComponentCompositionData().getName())).
+ forEach(entryValue -> entryValue.getValue().getNode_types().
+ values().
+ stream().
+ filter(type -> MapUtils.isNotEmpty(type.getCapabilities())).
+ forEach(type -> type.getCapabilities().
+ entrySet().
+ forEach(entry -> addCapability(entryValue.getKey(), capabilities, entry.getKey(),
+ entry.getValue()))));
+
+ }
+
+ Assert.assertNotNull(capabilities);
+ }
+
+ @Test(dependsOnMethods = {"testEnrichModelInSubmit"})
+ public void testVSPListSortedByModificationTimeDescOreder() {
+ vsp1 = VSPCommon
+ .createVspDetails(null, null, "vsp1_test", "Test-vsp", "vendorName", vlm1Id, "icon",
+ "category", "subCategory", "123", null);
+ id006 = vendorSoftwareProductManager.createNewVsp(vsp1, USER3).getId();
+
+ vsp2 = VSPCommon
+ .createVspDetails(null, null, "vsp2_test", "Test-vsp", "vendorName", vlm1Id, "icon",
+ "category", "subCategory", "123", null);
+ id007 = vendorSoftwareProductManager.createNewVsp(vsp2, USER3).getId();
+
+ assertVSPInWantedLocationInVSPList(id007, 0, USER3);
+ assertVSPInWantedLocationInVSPList(id006, 1, USER3);
+ }
+
+ @Test(dependsOnMethods = {"testVSPListSortedByModificationTimeDescOreder"})
+ public void testUpdatedVSPShouldBeInBeginningOfList() {
+ vendorSoftwareProductManager.updateVsp(vsp1, USER3);
+ assertVSPInWantedLocationInVSPList(id006, 0, USER3);
+
+ vendorSoftwareProductManager
+ .uploadFile(id007, getFileInputStream("/vspmanager/zips/emptyComposition.zip"), USER3);
+ assertVSPInWantedLocationInVSPList(id007, 0, USER3);
+ }
+
+ @Test(dependsOnMethods = {"testUpdatedVSPShouldBeInBeginningOfList"})
+ public void testVSPInBeginningOfListAfterCheckin() {
+ vendorSoftwareProductManager.checkin(id006, USER3);
+ assertVSPInWantedLocationInVSPList(id006, 0, USER3);
+
+ vendorSoftwareProductManager.checkin(id007, USER3);
+ assertVSPInWantedLocationInVSPList(id007, 0, USER3);
+ }
+
+ @Test(dependsOnMethods = {"testVSPInBeginningOfListAfterCheckin"})
+ public void testVSPInBeginningOfListAfterCheckout() {
+ vendorSoftwareProductManager.checkout(id006, USER3);
+ assertVSPInWantedLocationInVSPList(id006, 0, USER3);
+ }
+
+ @Test(dependsOnMethods = {"testVSPInBeginningOfListAfterCheckout"})
+ public void testVSPInBeginningOfListAfterUndoCheckout() {
+ vendorSoftwareProductManager.checkout(id007, USER3);
+ assertVSPInWantedLocationInVSPList(id007, 0, USER3);
+
+ vendorSoftwareProductManager.undoCheckout(id006, USER3);
+ assertVSPInWantedLocationInVSPList(id006, 0, USER3);
+ }
+
+ @Test(dependsOnMethods = {"testVSPInBeginningOfListAfterUndoCheckout"})
+ public void testVSPInBeginningOfListAfterSubmit() throws IOException {
+ vendorSoftwareProductManager.checkin(id007, USER3);
+ vendorSoftwareProductManager.submit(id007, USER3);
+
+ assertVSPInWantedLocationInVSPList(id007, 0, USER3);
+ }
+
+ private void testLegalUpload(String vspId, Version version, InputStream upload, String user) {
+ vendorSoftwareProductManager.uploadFile(vspId, upload, user);
+
+ UploadDataEntity uploadData =
+ vendorSoftwareProductDao.getUploadData(new UploadDataEntity(vspId, version));
+ Assert.assertNotNull(uploadData);
+ Assert.assertNotNull(uploadData.getContentData());
+ }
+
+ private void addCapability(String entryValueKey, Map<String, CapabilityDefinition> capabilities,
+ String key, CapabilityDefinition value) {
+
+ capabilities.put(entryValueKey + "_" + key, value);
+ }
+
+ private InputStream getFileInputStream(String fileName) {
+ URL url = this.getClass().getResource(fileName);
+ try {
+ return url.openStream();
+ } catch (IOException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ private void assertVSPInWantedLocationInVSPList(String vspId, int location, String user) {
+ List<VersionedVendorSoftwareProductInfo> vspList =
+ vendorSoftwareProductManager.getVspList(null, user);
+ Assert.assertEquals(vspList.get(location).getVspDetails().getId(), vspId);
+ }
+} \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/CompositionDataExtractorTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/CompositionDataExtractorTest.java
new file mode 100644
index 0000000000..55f30db609
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/CompositionDataExtractorTest.java
@@ -0,0 +1,280 @@
+package org.openecomp.sdc.vendorsoftwareproduct.services;
+
+import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.tosca.services.yamlutil.ToscaExtensionYamlUtil;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+import java.io.*;
+import java.net.URL;
+import java.nio.file.NotDirectoryException;
+import java.util.HashMap;
+import java.util.Map;
+
+public class CompositionDataExtractorTest {
+
+
+ private static ToscaServiceModel loadToscaServiceModel(String serviceTemplatesPath,
+ String globalServiceTemplatesPath,
+ String entryDefinitionServiceTemplate)
+ throws IOException {
+ ToscaExtensionYamlUtil toscaExtensionYamlUtil = new ToscaExtensionYamlUtil();
+ Map<String, ServiceTemplate> serviceTemplates = new HashMap<>();
+ if (entryDefinitionServiceTemplate == null) {
+ entryDefinitionServiceTemplate = "MainServiceTemplate.yaml";
+ }
+
+ loadServiceTemplates(serviceTemplatesPath, toscaExtensionYamlUtil, serviceTemplates);
+ if (globalServiceTemplatesPath != null) {
+ loadServiceTemplates(globalServiceTemplatesPath, toscaExtensionYamlUtil, serviceTemplates);
+ }
+
+ return new ToscaServiceModel(null, serviceTemplates, entryDefinitionServiceTemplate);
+ }
+
+ private static void loadServiceTemplates(String serviceTemplatesPath,
+ ToscaExtensionYamlUtil toscaExtensionYamlUtil,
+ Map<String, ServiceTemplate> serviceTemplates)
+ throws IOException {
+ URL urlFile = CompositionDataExtractorTest.class.getResource(serviceTemplatesPath);
+ if (urlFile != null) {
+ File pathFile = new File(urlFile.getFile());
+ File[] files = pathFile.listFiles();
+ if (files != null) {
+ addServiceTemplateFiles(serviceTemplates, files, toscaExtensionYamlUtil);
+ } else {
+ throw new NotDirectoryException(serviceTemplatesPath);
+ }
+ } else {
+ throw new NotDirectoryException(serviceTemplatesPath);
+ }
+ }
+
+ private static void addServiceTemplateFiles(Map<String, ServiceTemplate> serviceTemplates,
+ File[] files,
+ ToscaExtensionYamlUtil toscaExtensionYamlUtil)
+ throws IOException {
+ for (File file : files) {
+ try (InputStream yamlFile = new FileInputStream(file)) {
+ ServiceTemplate serviceTemplateFromYaml =
+ toscaExtensionYamlUtil.yamlToObject(yamlFile, ServiceTemplate.class);
+ serviceTemplates.put(file.getName(), serviceTemplateFromYaml);
+ try {
+ yamlFile.close();
+ } catch (IOException ignore) {
+ }
+ } catch (FileNotFoundException e) {
+ throw e;
+ } catch (IOException e) {
+ throw e;
+ }
+ }
+ }
+
+ @Test
+ public void testExtractNetworks() throws Exception {
+ ToscaServiceModel toscaServiceModel =
+ loadToscaServiceModel("/extractServiceComposition/networks/",
+ "/extractServiceComposition/toscaGlobalServiceTemplates/", null);
+ org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionData compositionData =
+ CompositionDataExtractor.extractServiceCompositionData(toscaServiceModel);
+ Assert.assertEquals(compositionData.getComponents().size(), 0);
+ Assert.assertEquals(compositionData.getNetworks().size(), 7);
+
+ for (org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network network : compositionData.getNetworks()) {
+ boolean dhcp = network.isDhcp();
+ switch (network.getName()) {
+ case "contail-net-default-true-dhcp":
+ Assert.assertEquals(dhcp, true);
+ break;
+ case "contail-net-dhcp-false-param":
+ Assert.assertEquals(dhcp, false);
+ break;
+ case "contail-net-dhcp-false":
+ Assert.assertEquals(dhcp, false);
+ break;
+ case "contail-net-dhcp-true-param":
+ Assert.assertEquals(dhcp, true);
+ break;
+ case "contail-net-dhcp-true":
+ Assert.assertEquals(dhcp, true);
+ break;
+ case "contail-net-dhcp-default-true-param":
+ Assert.assertEquals(dhcp, true);
+ break;
+ case "neutron-net-default-dhcp":
+ Assert.assertEquals(dhcp, true);
+ break;
+ default:
+ throw new Exception("Unexpected Network Name " + network.getName());
+ }
+
+ }
+ }
+
+ @Test
+ public void testExtractOnlyComponents() throws Exception {
+ ToscaServiceModel toscaServiceModel =
+ loadToscaServiceModel("/extractServiceComposition/onlyComponents/",
+ "/extractServiceComposition/toscaGlobalServiceTemplates/", "OnlyComponentsST.yaml");
+ org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionData compositionData =
+ CompositionDataExtractor.extractServiceCompositionData(toscaServiceModel);
+ Assert.assertEquals(compositionData.getComponents().size(), 3);
+ Assert.assertEquals(compositionData.getNetworks().size(), 0);
+
+ for (org.openecomp.sdc.vendorsoftwareproduct.types.composition.Component component : compositionData.getComponents()) {
+ switch (component.getData().getName()) {
+ case "org.openecomp.resource.vfc.nodes.heat.pcrf_psm":
+ Assert.assertNull(component.getNics());
+ Assert.assertEquals(component.getData().getDisplayName(), "pcrf_psm");
+ break;
+ case "org.openecomp.resource.vfc.nodes.heat.nova.Server":
+ Assert.assertNull(component.getNics());
+ Assert.assertEquals(component.getData().getDisplayName(), "Server");
+ break;
+ case "org.openecomp.resource.vfc.nodes.heat.pcm":
+ Assert.assertNull(component.getNics());
+ Assert.assertEquals(component.getData().getDisplayName(), "pcm");
+ break;
+ default:
+ throw new Exception("Unexpected ComponentData Name " + component.getData().getName());
+ }
+ }
+ }
+
+ @Test
+ public void testExtractComponentsWithPorts() throws Exception {
+
+ ToscaServiceModel toscaServiceModel =
+ loadToscaServiceModel("/extractServiceComposition/componentsWithPort/",
+ "/extractServiceComposition/toscaGlobalServiceTemplates/", "ComponentsWithPortST.yaml");
+ org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionData compositionData =
+ CompositionDataExtractor.extractServiceCompositionData(toscaServiceModel);
+
+ Assert.assertEquals(compositionData.getComponents().size(), 3);
+ Assert.assertEquals(compositionData.getNetworks().size(), 0);
+
+ for (org.openecomp.sdc.vendorsoftwareproduct.types.composition.Component component : compositionData.getComponents()) {
+ switch (component.getData().getName()) {
+ case "org.openecomp.resource.vfc.nodes.heat.pcrf_psm":
+ Assert.assertEquals(component.getNics().size(), 1);
+ Assert.assertEquals(component.getNics().get(0).getName(), "psm01_port_0");
+ Assert.assertNull(component.getNics().get(0).getNetworkName());
+ Assert.assertEquals(component.getData().getDisplayName(), "pcrf_psm");
+ break;
+ case "org.openecomp.resource.vfc.nodes.heat.nova.Server":
+ Assert.assertEquals(component.getNics().size(), 1);
+ Assert.assertEquals(component.getNics().get(0).getName(), "FSB1_Internal2");
+ Assert.assertNull(component.getNics().get(0).getNetworkName());
+ Assert.assertEquals(component.getData().getDisplayName(), "Server");
+ break;
+ case "org.openecomp.resource.vfc.nodes.heat.pcm":
+ Assert.assertEquals(component.getNics().size(), 2);
+ Assert.assertEquals(component.getData().getDisplayName(), "pcm");
+ break;
+ default:
+ throw new Exception("Unexpected ComponentData Name " + component.getData().getName());
+ }
+ }
+ }
+
+ @Test
+ public void testExtractFullComposition() throws Exception {
+
+ ToscaServiceModel toscaServiceModel =
+ loadToscaServiceModel("/extractServiceComposition/fullComposition/",
+ "/extractServiceComposition/toscaGlobalServiceTemplates/", null);
+ org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionData compositionData =
+ CompositionDataExtractor.extractServiceCompositionData(toscaServiceModel);
+ Assert.assertEquals(compositionData.getComponents().size(), 3);
+ Assert.assertEquals(compositionData.getNetworks().size(), 3);
+
+ for (org.openecomp.sdc.vendorsoftwareproduct.types.composition.Component component : compositionData.getComponents()) {
+ switch (component.getData().getName()) {
+ case "org.openecomp.resource.vfc.nodes.heat.pcrf_psm":
+ Assert.assertEquals(component.getNics().size(), 1);
+ Assert.assertEquals(component.getNics().get(0).getName(), "psm01_port_0");
+ Assert.assertNull(component.getNics().get(0).getNetworkName());
+ Assert.assertEquals(component.getData().getDisplayName(), "pcrf_psm");
+ break;
+ case "org.openecomp.resource.vfc.nodes.heat.nova.Server":
+ Assert.assertEquals(component.getNics().size(), 3);
+ Assert.assertEquals(component.getData().getDisplayName(), "Server");
+ for (org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic port : component.getNics()) {
+ switch (port.getName()) {
+ case "FSB1_Internal2_port":
+ Assert.assertEquals(port.getNetworkName(), "Internal2-net");
+ break;
+ case "FSB1_OAM_Port":
+ Assert.assertNull(port.getNetworkName());
+ break;
+ case "FSB1_Internal1_port":
+ Assert.assertEquals(port.getNetworkName(), "Internal1-net");
+ break;
+ default:
+ throw new Exception("Unexpected Nic " + port.getName());
+ }
+ }
+ break;
+ case "org.openecomp.resource.vfc.nodes.heat.pcm":
+ Assert.assertEquals(component.getNics().size(), 2);
+ Assert.assertEquals(component.getData().getDisplayName(), "pcm");
+ break;
+ default:
+ throw new Exception("Unexpected ComponentData Name " + component.getData().getName());
+ }
+ }
+ }
+
+ @Test
+ public void testExtractSubstitutionComposition() throws Exception {
+
+ ToscaServiceModel toscaServiceModel =
+ loadToscaServiceModel("/extractServiceComposition/substitution/",
+ "/extractServiceComposition/toscaGlobalServiceTemplates/", null);
+ org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionData compositionData =
+ CompositionDataExtractor.extractServiceCompositionData(toscaServiceModel);
+ Assert.assertEquals(compositionData.getComponents().size(), 2);
+ Assert.assertEquals(compositionData.getNetworks().size(), 4);
+
+ for (org.openecomp.sdc.vendorsoftwareproduct.types.composition.Component component : compositionData.getComponents()) {
+ switch (component.getData().getName()) {
+ case "org.openecomp.resource.vfc.nodes.heat.cmaui_image":
+ Assert.assertEquals(component.getNics().size(), 1);
+ Assert.assertEquals(component.getNics().get(0).getName(), "cmaui_port_1");
+ Assert.assertEquals(component.getNics().get(0).getNetworkName(), "test_net1");
+ Assert.assertEquals(component.getData().getDisplayName(), "cmaui_image");
+ break;
+ case "org.openecomp.resource.vfc.nodes.heat.abc_image":
+ Assert.assertEquals(component.getNics().size(), 1);
+ Assert.assertEquals(component.getNics().get(0).getName(), "abc_port_1");
+ Assert.assertEquals(component.getNics().get(0).getNetworkName(), "test_net2");
+ Assert.assertEquals(component.getData().getDisplayName(), "abc_image");
+ break;
+ default:
+ throw new Exception("Unexpected ComponentData Name " + component.getData().getName());
+ }
+ }
+ for (org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network network : compositionData.getNetworks()) {
+ boolean dhcp = network.isDhcp();
+ switch (network.getName()) {
+ case "test_net2":
+ Assert.assertEquals(dhcp, true);
+ break;
+ case "test_net1":
+ Assert.assertEquals(dhcp, true);
+ break;
+ case "Internal1-net": // same network display twice since define in 2 nested files with the same key
+ Assert.assertEquals(dhcp, true);
+ break;
+ default:
+ throw new Exception("Unexpected Network Name " + network.getName());
+ }
+
+ }
+ }
+
+
+} \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/CompositionEntityDataManagerTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/CompositionEntityDataManagerTest.java
new file mode 100644
index 0000000000..e1ddcdc975
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/CompositionEntityDataManagerTest.java
@@ -0,0 +1,141 @@
+package org.openecomp.sdc.vendorsoftwareproduct.services;
+
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspQuestionnaireEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityValidationData;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network;
+import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.NetworkCompositionSchemaInput;
+import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.SchemaTemplateContext;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.apache.commons.collections.CollectionUtils;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+import java.util.Collection;
+import java.util.Map;
+
+public class CompositionEntityDataManagerTest {
+
+ public static final String VSP1 = "vsp1";
+ public static final String COMPONENT1 = "component1";
+ public static final String NIC1 = "nic1";
+ private static CompositionEntityDataManager compositionEntityDataManager =
+ new CompositionEntityDataManager();
+ private static Map<CompositionEntityId, Collection<String>> errorsById;
+
+ private static void assertValidationData(CompositionEntityValidationData validationData,
+ String id, CompositionEntityType type,
+ boolean hasErrors) {
+ Assert.assertNotNull(validationData);
+ Assert.assertEquals(validationData.getEntityId(), id);
+ Assert.assertEquals(validationData.getEntityType(), type);
+ Assert.assertTrue(CollectionUtils.isNotEmpty(validationData.getErrors()) == hasErrors);
+ }
+
+ @Test(expectedExceptions = CoreException.class)
+ public void testAddNullEntity_negative() {
+ compositionEntityDataManager.addEntity(null, null);
+ }
+
+ @Test
+ public void testAddEntity() {
+ compositionEntityDataManager
+ .addEntity(new VspQuestionnaireEntity(VSP1, new Version(0, 1)), null);
+
+ String invalidQuestionnaireData = "{\"a\": \"b\"}";
+
+ ComponentEntity component = new ComponentEntity(VSP1, new Version(0, 1), COMPONENT1);
+ component.setQuestionnaireData(invalidQuestionnaireData);
+ compositionEntityDataManager.addEntity(component, null);
+
+ org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity
+ nic = new org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity(VSP1, new Version(0, 1), COMPONENT1, NIC1);
+ nic.setQuestionnaireData(invalidQuestionnaireData);
+ compositionEntityDataManager.addEntity(nic, null);
+ }
+
+ @Test(dependsOnMethods = "testAddEntity")
+ public void testValidateEntitiesQuestionnaire() {
+ errorsById = compositionEntityDataManager.validateEntitiesQuestionnaire();
+ Assert.assertNotNull(errorsById);
+ Assert.assertEquals(errorsById.size(), 2); // both component and nic data don't mach schemas
+ CompositionEntityId nicId =
+ new org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity(VSP1, new Version(0, 1), COMPONENT1, NIC1).getCompositionEntityId();
+ Assert.assertTrue(errorsById.containsKey(nicId));
+ Assert.assertTrue(errorsById.containsKey(nicId.getParentId()));
+ }
+
+ @Test(dependsOnMethods = "testAddEntity")
+ public void testBuildTrees() {
+ compositionEntityDataManager.buildTrees();
+ }
+
+ @Test(dependsOnMethods = "testBuildTrees")
+ public void testAddErrorsToTrees() {
+ compositionEntityDataManager.addErrorsToTrees(errorsById);
+ }
+
+ @Test(dependsOnMethods = "testAddErrorsToTrees")
+ public void testGetTrees() {
+ Collection<CompositionEntityValidationData> trees = compositionEntityDataManager.getTrees();
+ Assert.assertNotNull(trees);
+ Assert.assertEquals(trees.size(), 1);
+
+ CompositionEntityValidationData vspValidationData = trees.iterator().next();
+ assertValidationData(vspValidationData, VSP1, CompositionEntityType.vsp, false);
+ Assert.assertEquals(vspValidationData.getSubEntitiesValidationData().size(), 1);
+
+ CompositionEntityValidationData componentValidationData =
+ vspValidationData.getSubEntitiesValidationData().iterator().next();
+ assertValidationData(componentValidationData, COMPONENT1, CompositionEntityType.component,
+ true);
+ Assert.assertEquals(componentValidationData.getSubEntitiesValidationData().size(), 1);
+
+ CompositionEntityValidationData nicValidationData =
+ componentValidationData.getSubEntitiesValidationData().iterator().next();
+ assertValidationData(nicValidationData, NIC1, CompositionEntityType.nic, true);
+ Assert.assertNull(nicValidationData.getSubEntitiesValidationData());
+ }
+
+ @Test
+ public void testValidateValidEntity() {
+ NetworkEntity networkEntity = new NetworkEntity(VSP1, new Version(0, 1), "network1");
+ Network network = new Network();
+ network.setName("network1 name");
+ network.setDhcp(true);
+ networkEntity.setNetworkCompositionData(network);
+
+ NetworkCompositionSchemaInput schemaTemplateInput = new NetworkCompositionSchemaInput();
+ schemaTemplateInput.setManual(false);
+ schemaTemplateInput.setNetwork(network);
+
+ CompositionEntityValidationData validationData = CompositionEntityDataManager
+ .validateEntity(networkEntity, SchemaTemplateContext.composition, schemaTemplateInput);
+ assertValidationData(validationData, "network1", CompositionEntityType.network, false);
+ }
+
+ @Test
+ public void testValidateInvalidEntity() {
+ NetworkEntity networkEntity = new NetworkEntity(VSP1, new Version(0, 1), "network1");
+ Network network = new Network();
+ network.setName("network1 name changed");
+ network.setDhcp(false);
+ networkEntity.setNetworkCompositionData(network);
+
+ NetworkCompositionSchemaInput schemaTemplateInput = new NetworkCompositionSchemaInput();
+ schemaTemplateInput.setManual(false);
+ Network origNetwork = new Network();
+ origNetwork.setName("network1 name");
+ origNetwork.setDhcp(true);
+ schemaTemplateInput.setNetwork(origNetwork);
+
+ CompositionEntityValidationData validationData = CompositionEntityDataManager
+ .validateEntity(networkEntity, SchemaTemplateContext.composition, schemaTemplateInput);
+ assertValidationData(validationData, "network1", CompositionEntityType.network, true);
+ Assert.assertEquals(validationData.getErrors().size(), 2);
+ }
+} \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/QuestionnaireSchemaTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/QuestionnaireSchemaTest.java
new file mode 100644
index 0000000000..4d03b5980f
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/QuestionnaireSchemaTest.java
@@ -0,0 +1,64 @@
+package org.openecomp.sdc.vendorsoftwareproduct.services;
+
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspQuestionnaireEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.core.utilities.file.FileUtils;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+public class QuestionnaireSchemaTest {
+
+ public static final String VSP1 = "vsp1";
+ public static final String COMPONENT1 = "component1";
+ public static final String NIC1 = "nic1";
+ private static CompositionEntityDataManager compositionEntityDataManager =
+ new CompositionEntityDataManager();
+ private static Map<CompositionEntityId, Collection<String>> errorsById;
+ private static org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity componentEntity;
+ private static org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity nicEntity;
+
+ private static String loadFileToString(String path) {
+ return new String(FileUtils.toByteArray(FileUtils.loadFileToInputStream(path)));
+ }
+
+ @Test
+ public void testAddEntity() {
+ compositionEntityDataManager
+ .addEntity(new VspQuestionnaireEntity(VSP1, new Version(0, 1)), null);
+
+ componentEntity = new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity(VSP1, new Version(0, 1), COMPONENT1);
+ nicEntity = new org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity(VSP1, new Version(0, 1), COMPONENT1, NIC1);
+ compositionEntityDataManager.addEntity(componentEntity, null);
+
+ componentEntity.setQuestionnaireData(loadFileToString("quesionnaire/validComponent.json"));
+ nicEntity.setQuestionnaireData(loadFileToString("quesionnaire/validNic.json"));
+ compositionEntityDataManager.addEntity(nicEntity, null);
+ }
+
+ @Test(dependsOnMethods = "testAddEntity")
+ public void testNicAndComponentValidQuestionnaire() {
+ errorsById = compositionEntityDataManager.validateEntitiesQuestionnaire();
+ Assert.assertEquals(errorsById.size(), 0);
+ }
+
+ @Test(dependsOnMethods = "testNicAndComponentValidQuestionnaire")
+ public void testComponentInvalidQuestionnaire() {
+ componentEntity.setQuestionnaireData(loadFileToString("quesionnaire/invalidComponent.json"));
+ compositionEntityDataManager.addEntity(componentEntity, null);
+
+ errorsById = compositionEntityDataManager.validateEntitiesQuestionnaire();
+ Assert.assertEquals(errorsById.size(), 1);
+
+ CompositionEntityId component = errorsById.keySet().iterator().next();
+ List<String> errors = (List<String>) errorsById.get(component);
+ Assert.assertEquals(errors.size(), 1);
+ Assert.assertEquals(errors.get(0),
+ "#/general/recovery/pointObjective: 20.0 is not lower or equal to 15");
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/QuestionnaireValidatorTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/QuestionnaireValidatorTest.java
new file mode 100644
index 0000000000..0dedacb34a
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/QuestionnaireValidatorTest.java
@@ -0,0 +1,74 @@
+package org.openecomp.sdc.vendorsoftwareproduct.services;
+
+public class QuestionnaireValidatorTest {
+/*
+ public static QuestionnaireValidator validator = new QuestionnaireValidator();
+
+ @Test(expectedExceptions = CoreException.class)
+ public void testAddSubEntityBeforeRoot_negative() {
+ validator.addSubEntity(createComponent("componentId2"), CompositionEntityType.vsp);
+ }
+
+ @Test(dependsOnMethods = "testAddSubEntityBeforeRoot_negative")
+ public void testAddRootEntity() {
+ validator.addRootEntity(createVspQuestionnaireEntity());
+ }
+
+ @Test(dependsOnMethods = "testAddRootEntity", expectedExceptions = CoreException.class)
+ public void testAddRootEntityWhenAlreadyExist_negative() {
+ validator.addRootEntity(createVspQuestionnaireEntity());
+ }
+
+ @Test(dependsOnMethods = "testAddRootEntity")
+ public void testAddSubEntity() {
+ validator.addSubEntity(createComponent("componentId1"), CompositionEntityType.vsp);
+ }
+
+ @Test(dependsOnMethods = "testAddRootEntity", expectedExceptions = CoreException.class)
+ public void testAddSubEntityWithNonExistingParentType() {
+ validator.addSubEntity(new ComponentEntity("vspId1", new Version(0, 1), "componentId2"), CompositionEntityType.nic);
+ }
+
+ @Test(dependsOnMethods = "testAddSubEntity")
+ public void testAddSubEntities() throws Exception {
+ Collection<CompositionEntity> nics = new ArrayList<>();
+ nics.add(createNic("nicId1", "componentId1"));
+ nics.add(createNic("nicId2", "componentId1"));
+ nics.add(createNic("nicId3", "componentId1"));
+
+ validator.addSubEntities(nics, CompositionEntityType.component);
+ }
+
+
+ @Test(dependsOnMethods = "testAddSubEntities")
+ public void testValidate() throws Exception {
+ QuestionnaireValidationResult validationResult = validator.validate();
+ Assert.assertTrue(validationResult.isValid());
+ }
+
+ private static VspQuestionnaireEntity createVspQuestionnaireEntity() {
+ VspQuestionnaireEntity vspQuestionnaireEntity = new VspQuestionnaireEntity();
+ vspQuestionnaireEntity.setId("vspId1");
+ vspQuestionnaireEntity.setVersion(new Version(0, 1));
+ vspQuestionnaireEntity.setQuestionnaireData("{\n" +
+ " \"name\": \"bla bla\"\n" +
+ "}");
+ return vspQuestionnaireEntity;
+ }
+
+ private static ComponentEntity createComponent(String componentId) {
+ ComponentEntity component = new ComponentEntity("vspId1", new Version(0, 1), componentId);
+ component.setQuestionnaireData("{\n" +
+ " \"name\": \"bla bla\"\n" +
+ "}");
+ return component;
+ }
+
+ private static CompositionEntity createNic(String nicId, String componentId) {
+ NicEntity nic = new NicEntity("vspId1", new Version(0, 1), componentId, nicId);
+ nic.setQuestionnaireData("{\n" +
+ " \"name\": \"bla bla\"\n" +
+ "}");
+ return nic;
+ }*/
+} \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/SchemaGeneratorTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/SchemaGeneratorTest.java
new file mode 100644
index 0000000000..fd293c66dd
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/SchemaGeneratorTest.java
@@ -0,0 +1,244 @@
+package org.openecomp.sdc.vendorsoftwareproduct.services;
+
+import org.openecomp.core.utilities.json.JsonUtil;
+import org.everit.json.schema.EmptySchema;
+import org.everit.json.schema.loader.SchemaLoader;
+import org.json.JSONObject;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.NetworkType;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic;
+import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.ComponentCompositionSchemaInput;
+import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.ComponentQuestionnaireSchemaInput;
+import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.NetworkCompositionSchemaInput;
+import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.NicCompositionSchemaInput;
+import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.SchemaTemplateContext;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+import java.util.Arrays;
+import java.util.Map;
+
+public class SchemaGeneratorTest {
+
+ private static int getMinOfVmMax(JSONObject schemaJson) {
+ return schemaJson.getJSONObject("properties").getJSONObject("compute")
+ .getJSONObject("properties").getJSONObject("numOfVMs").getJSONObject("properties")
+ .getJSONObject("maximum").getInt("minimum");
+ }
+
+ private static JSONObject validateSchema(String schema) {
+ System.out.println(schema);
+ Assert.assertNotNull(schema);
+ Assert.assertTrue(JsonUtil.isValidJson(schema));
+ JSONObject schemaJson = new JSONObject(schema);
+ Assert.assertFalse(SchemaLoader.load(schemaJson) instanceof EmptySchema);
+ return schemaJson;
+ }
+
+ @Test
+ public void testGenerateVspQuestionnaire() {
+ String schema = SchemaGenerator
+ .generate(SchemaTemplateContext.questionnaire, CompositionEntityType.vsp, null);
+ validateSchema(schema);
+ }
+
+ @Test
+ public void testGenerateNetworkCompositionUpload() {
+ Network network = new Network();
+ network.setName("upload network1 name");
+ network.setDhcp(true);
+
+ NetworkCompositionSchemaInput input = new NetworkCompositionSchemaInput();
+ input.setManual(false);
+ input.setNetwork(network);
+
+ String schema = SchemaGenerator
+ .generate(SchemaTemplateContext.composition, CompositionEntityType.network, input);
+ validateSchema(schema);
+ }
+
+ @Test
+ public void testGenerateNetworkCompositionManual() {
+ NetworkCompositionSchemaInput input = new NetworkCompositionSchemaInput();
+ input.setManual(true);
+
+ String schema = SchemaGenerator
+ .generate(SchemaTemplateContext.composition, CompositionEntityType.network, input);
+
+ validateSchema(schema);
+ }
+
+ @Test
+ public void testGenerateComponentQuestionnaireWithoutInput() {
+ String schema = SchemaGenerator
+ .generate(SchemaTemplateContext.questionnaire, CompositionEntityType.component, null);
+ validateSchema(schema);
+ }
+
+ @Test
+ public void testGenerateComponentQuestionnaireWithMissingInput() {
+ ComponentQuestionnaireSchemaInput input =
+ new ComponentQuestionnaireSchemaInput(Arrays.asList("nic1", "nic2"),
+ JsonUtil.json2Object("{\n" +
+ " \"compute\": {\n" +
+ " \"numOfVMs\": {\n" +
+ " \"blabla\": 70\n" + // no minimum
+ " }\n" +
+ " }\n" +
+ "}", Map.class));
+ String schema = SchemaGenerator
+ .generate(SchemaTemplateContext.questionnaire, CompositionEntityType.component, input);
+ JSONObject schemaJson = validateSchema(schema);
+ //Assert.assertEquals(getMinOfVmMax(schemaJson), 0);
+ }
+
+ @Test
+ public void testGenerateComponentQuestionnaireWithInvalidTypeInput() {
+ ComponentQuestionnaireSchemaInput input =
+ new ComponentQuestionnaireSchemaInput(Arrays.asList("nic1", "nic2"),
+ JsonUtil.json2Object("{\n" +
+ " \"compute\": {\n" +
+ " \"numOfVMs\": {\n" +
+ " \"minimum\": \"some string instead of integer\"\n" +
+ // invalid minimum - string
+ " }\n" +
+ " }\n" +
+ "}", Map.class));
+ String schema = SchemaGenerator
+ .generate(SchemaTemplateContext.questionnaire, CompositionEntityType.component, input);
+ JSONObject schemaJson = validateSchema(schema);
+ Assert.assertEquals(getMinOfVmMax(schemaJson), 0);
+ }
+
+ @Test
+ public void testGenerateComponentQuestionnaireWithInvalidRangeInput() {
+ ComponentQuestionnaireSchemaInput input =
+ new ComponentQuestionnaireSchemaInput(Arrays.asList("nic1", "nic2"),
+ JsonUtil.json2Object("{\n" +
+ " \"compute\": {\n" +
+ " \"numOfVMs\": {\n" +
+ " \"minimum\": 150\n" + // invalid minimum - integer out of range (0-100)
+ " }\n" +
+ " }\n" +
+ "}", Map.class));
+ String schema = SchemaGenerator
+ .generate(SchemaTemplateContext.questionnaire, CompositionEntityType.component, input);
+ JSONObject schemaJson = validateSchema(schema);
+ Assert.assertEquals(getMinOfVmMax(schemaJson), 0);
+ }
+
+ @Test
+ public void testGenerateComponentQuestionnaireWithValidInput() {
+ ComponentQuestionnaireSchemaInput input =
+ new ComponentQuestionnaireSchemaInput(Arrays.asList("nic1", "nic2"),
+ JsonUtil.json2Object("{\n" +
+ " \"compute\": {\n" +
+ " \"numOfVMs\": {\n" +
+ " \"minimum\": 30\n" + // valid minimum - integer at the correct range (0-100)
+ " }\n" +
+ " }\n" +
+ "}", Map.class));
+ String schema = SchemaGenerator
+ .generate(SchemaTemplateContext.questionnaire, CompositionEntityType.component, input);
+ JSONObject schemaJson = validateSchema(schema);
+ Assert.assertEquals(getMinOfVmMax(schemaJson), 30);
+ }
+
+ @Test
+ public void testGenerateNicQuestionnaire() {
+ String schema = SchemaGenerator
+ .generate(SchemaTemplateContext.questionnaire, CompositionEntityType.nic, null);
+ validateSchema(schema);
+ }
+
+ @Test
+ public void testGenerateComponentCompositionUpload() {
+ ComponentData component = new ComponentData();
+ component.setName("upload comp1 name");
+ component.setDescription("upload comp1 desc");
+
+ ComponentCompositionSchemaInput input = new ComponentCompositionSchemaInput();
+ input.setManual(false);
+ input.setComponent(component);
+
+ String schema = SchemaGenerator
+ .generate(SchemaTemplateContext.composition, CompositionEntityType.component, input);
+ validateSchema(schema);
+ }
+
+ @Test
+ public void testGenerateComponentCompositionManual() {
+ ComponentCompositionSchemaInput input = new ComponentCompositionSchemaInput();
+ input.setManual(true);
+
+ String schema = SchemaGenerator
+ .generate(SchemaTemplateContext.composition, CompositionEntityType.component, input);
+ validateSchema(schema);
+ }
+
+ @Test
+ public void testGenerateNicCompositionUpload() {
+ Nic nic = new Nic();
+ nic.setName("upload nic1 name");
+ nic.setDescription("upload nic1 desc");
+ nic.setNetworkId("upload nic1 networkId");
+ //nic.setNetworkName("upload nic1 networkName");
+ nic.setNetworkType(NetworkType.External);
+
+ NicCompositionSchemaInput input = new NicCompositionSchemaInput();
+ input.setManual(false);
+ input.setNic(nic);
+
+ String schema = SchemaGenerator
+ .generate(SchemaTemplateContext.composition, CompositionEntityType.nic, input);
+ validateSchema(schema);
+ }
+
+
+// @Test
+// public void testGenerateNicCompositionManualWithoutNetworkId() {
+// Nic nic = new Nic();
+// nic.setName("upload nic1 name");
+// nic.setDescription("upload nic1 desc");
+// //nic.setNetworkName("upload nic1 networkName");
+// nic.setNetworkType(NetworkType.External);
+//
+// NicCompositionSchemaInput input = new NicCompositionSchemaInput();
+// input.setManual(true);
+// input.setNic(nic);
+//
+// String schema = SchemaGenerator.generate(SchemaTemplateContext.composition, CompositionEntityType.nic, input);
+// validateSchema(schema);
+// }
+
+ @Test
+ public void testGenerateNicCompositionUploadWithoutNetworkId() {
+ Nic nic = new Nic();
+ nic.setName("upload nic1 name");
+ nic.setDescription("upload nic1 desc");
+ //nic.setNetworkName("upload nic1 networkName");
+ nic.setNetworkType(NetworkType.External);
+
+ NicCompositionSchemaInput input = new NicCompositionSchemaInput();
+ input.setManual(false);
+ input.setNic(nic);
+
+ String schema = SchemaGenerator
+ .generate(SchemaTemplateContext.composition, CompositionEntityType.nic, input);
+ validateSchema(schema);
+ }
+
+ @Test
+ public void testGenerateNicCompositionManual() {
+ NicCompositionSchemaInput input = new NicCompositionSchemaInput();
+ input.setManual(true);
+ input.setNetworkIds(
+ Arrays.asList("manual networkId1", "manual networkId2", "manual networkId3"));
+
+ String schema = SchemaGenerator
+ .generate(SchemaTemplateContext.composition, CompositionEntityType.nic, input);
+ validateSchema(schema);
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/tree/HeatTreeManagerTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/tree/HeatTreeManagerTest.java
new file mode 100644
index 0000000000..c926977c7b
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/tree/HeatTreeManagerTest.java
@@ -0,0 +1,102 @@
+package org.openecomp.sdc.vendorsoftwareproduct.tree;
+
+import org.openecomp.sdc.datatypes.error.ErrorMessage;
+import org.openecomp.sdc.heat.datatypes.structure.HeatStructureTree;
+import org.openecomp.sdc.heat.services.tree.HeatTreeManager;
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.io.IOException;
+import java.util.*;
+
+
+public class HeatTreeManagerTest extends TreeBaseTest {
+
+ @Test
+ public void testHeatTreeManager() {
+
+ INPUT_DIR = "/tree/valid_tree/input/";
+ HeatTreeManager heatTreeManager = initHeatTreeManager();
+ heatTreeManager.createTree();
+ Map<String, List<ErrorMessage>> errorMap = new HashMap<>();
+
+ List<ErrorMessage> errorList = new ArrayList<>();
+ errorList.add(new ErrorMessage(org.openecomp.sdc.datatypes.error.ErrorLevel.ERROR, "Missing Artifact"));
+ errorMap.put("missing-artifact", errorList);
+ errorList = new ArrayList<>();
+ errorList.add(new ErrorMessage(org.openecomp.sdc.datatypes.error.ErrorLevel.WARNING, "Missing Nested File"));
+ errorMap.put("missingNested.yaml", errorList);
+ heatTreeManager.addErrors(errorMap);
+ HeatStructureTree tree = heatTreeManager.getTree();
+ Assert.assertNotNull(tree);
+ }
+
+ @Test
+ public void testHeatTreeManagerMissingManifest() {
+
+ INPUT_DIR = "/tree/missing_manifest/input/";
+ HeatTreeManager heatTreeManager = initHeatTreeManager();
+ heatTreeManager.createTree();
+ Map<String, List<ErrorMessage>> errorMap = new HashMap<>();
+
+ List<ErrorMessage> errorList = new ArrayList<>();
+ errorList.add(new ErrorMessage(org.openecomp.sdc.datatypes.error.ErrorLevel.ERROR, "Missing Artifact"));
+ errorMap.put("missing-artifact", errorList);
+ errorList = new ArrayList<>();
+ errorList.add(new ErrorMessage(org.openecomp.sdc.datatypes.error.ErrorLevel.WARNING, "Missing Nested File"));
+ errorMap.put("missingNested.yaml", errorList);
+ heatTreeManager.addErrors(errorMap);
+ HeatStructureTree tree = heatTreeManager.getTree();
+ Assert.assertNotNull(tree);
+ Assert.assertEquals(tree.getHEAT(), null);
+
+ }
+
+
+ @Test
+ public void testResourceGroupShowsAsNestedFileInTree() throws IOException {
+ INPUT_DIR = "/tree/nested_resource_group";
+ HeatTreeManager heatTreeManager = initHeatTreeManager();
+ heatTreeManager.createTree();
+ HeatStructureTree tree = heatTreeManager.getTree();
+
+ Set<HeatStructureTree> heat = tree.getHEAT();
+ Assert.assertNotNull(heat);
+
+ HeatStructureTree addOnHeatSubTree =
+ HeatStructureTree.getHeatStructureTreeByName(heat, "addOn.yml");
+ Assert.assertNotNull(addOnHeatSubTree);
+
+ Set<HeatStructureTree> addOnNestedFiles = addOnHeatSubTree.getNested();
+ Assert.assertNotNull(addOnNestedFiles);
+
+ HeatStructureTree nestedFile =
+ HeatStructureTree.getHeatStructureTreeByName(addOnNestedFiles, "nested.yml");
+ Assert.assertNotNull(nestedFile);
+ }
+
+
+ @Test
+ public void testVolumeNestedFileIsNotUnderVolumeSubTree() {
+ INPUT_DIR = "/tree/nested_volume";
+ HeatTreeManager heatTreeManager = initHeatTreeManager();
+ heatTreeManager.createTree();
+ HeatStructureTree tree = heatTreeManager.getTree();
+
+ Set<HeatStructureTree> heat = tree.getHEAT();
+ Set<HeatStructureTree> volume = tree.getVolume();
+ Assert.assertNotNull(heat);
+ Assert.assertNull(volume);
+
+ HeatStructureTree baseMobtSubTree =
+ HeatStructureTree.getHeatStructureTreeByName(heat, "base_mobt.yaml");
+ Assert.assertNotNull(baseMobtSubTree);
+
+ Set<HeatStructureTree> baseMobtNestedFiles = baseMobtSubTree.getNested();
+ Assert.assertNotNull(baseMobtNestedFiles);
+
+ HeatStructureTree nestedVolumeFile = HeatStructureTree
+ .getHeatStructureTreeByName(baseMobtNestedFiles, "hot_mobt_volume_attach_nested.yaml");
+ Assert.assertNotNull(nestedVolumeFile);
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/tree/TreeBaseTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/tree/TreeBaseTest.java
new file mode 100644
index 0000000000..df6cf54058
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/tree/TreeBaseTest.java
@@ -0,0 +1,33 @@
+package org.openecomp.sdc.vendorsoftwareproduct.tree;
+
+import org.openecomp.sdc.heat.services.tree.HeatTreeManager;
+import org.openecomp.core.utilities.file.FileUtils;
+
+import java.io.File;
+import java.net.URISyntaxException;
+import java.net.URL;
+
+public class TreeBaseTest {
+
+ String INPUT_DIR;
+
+
+ HeatTreeManager initHeatTreeManager() {
+ HeatTreeManager heatTreeManager = new HeatTreeManager();
+
+ URL url = TreeBaseTest.class.getResource(INPUT_DIR);
+
+ File inputDir = null;
+ try {
+ inputDir = new File(url.toURI());
+ } catch (URISyntaxException e) {
+ e.printStackTrace();
+ }
+ File[] files = inputDir.listFiles();
+ for (File inputFile : files) {
+ heatTreeManager.addFile(inputFile.getName(), FileUtils.loadFileToInputStream(
+ INPUT_DIR.replace("/", File.separator) + File.separator + inputFile.getName()));
+ }
+ return heatTreeManager;
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/tree/UploadFileTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/tree/UploadFileTest.java
new file mode 100644
index 0000000000..ee31ba4d70
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/tree/UploadFileTest.java
@@ -0,0 +1,90 @@
+package org.openecomp.sdc.vendorsoftwareproduct.tree;
+
+import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacade;
+import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacadeFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.VSPCommon;
+import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductManager;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.UploadDataEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
+import org.openecomp.sdc.vendorsoftwareproduct.impl.VendorSoftwareProductManagerImpl;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import java.io.*;
+import java.net.URL;
+import java.util.zip.ZipOutputStream;
+
+public class UploadFileTest {
+
+
+ public static final Version VERSION01 = new Version(0, 1);
+ private static final String USER1 = "vspTestUser1";
+ public static String id001 = null;
+ public static String id002 = null;
+ public static Version activeVersion002 = null;
+ private static VendorSoftwareProductManager vendorSoftwareProductManager =
+ new VendorSoftwareProductManagerImpl();
+ private static VendorSoftwareProductDao vendorSoftwareProductDao =
+ VendorSoftwareProductDaoFactory.getInstance().createInterface();
+ private static VendorLicenseFacade vendorLicenseFacade =
+ VendorLicenseFacadeFactory.getInstance().createInterface();
+ private static String vlm1Id;
+
+ @BeforeClass
+ static public void init() {
+
+ //testCreateVSP
+ vlm1Id = vendorLicenseFacade.createVendorLicenseModel(
+ VSPCommon.createVendorLicenseModel("vlmName", "vlm1Id desc", "icon1"), USER1).getId();
+ VspDetails expectedVsp = VSPCommon
+ .createVspDetails(null, null, "VSP1", "Test-vsp", "vendorName", vlm1Id, "icon", "category",
+ "subCategory", "123", null);
+
+ VspDetails createdVsp = vendorSoftwareProductManager.createNewVsp(expectedVsp, USER1);
+ id001 = createdVsp.getId();
+
+ VspDetails actualVsp =
+ vendorSoftwareProductDao.getVendorSoftwareProductInfo(new VspDetails(id001, VERSION01));
+ expectedVsp.setId(id001);
+ expectedVsp.setVersion(VERSION01);
+
+
+ }
+
+ @Test
+ public void testUploadFile() {
+ //vspActiveVersion = vendorSoftwareProductManager.checkout(id001, USER1);
+ vendorSoftwareProductManager.uploadFile(id001, getZipInputStream("/legalUpload"), USER1);
+ //testLegalUpload(id001, vspActiveVersion, getZipInputStream("/legalUpload"), USER1);
+ }
+
+
+ private void testLegalUpload(String vspId, Version version, InputStream upload, String user) {
+ vendorSoftwareProductManager.uploadFile(vspId, upload, user);
+
+ UploadDataEntity uploadData =
+ vendorSoftwareProductDao.getUploadData(new UploadDataEntity(vspId, version));
+
+ }
+
+ public InputStream getZipInputStream(String name) {
+ URL url = this.getClass().getResource(name);
+ File templateDir = new File(url.getFile());
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ZipOutputStream zos = new ZipOutputStream(baos);
+
+ VSPCommon.zipDir(templateDir, "", zos, true);
+ try {
+ zos.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ return new ByteArrayInputStream(baos.toByteArray());
+ }
+
+
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/upload/HeatCleanup/HeatCleanupOnNewUploadTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/upload/HeatCleanup/HeatCleanupOnNewUploadTest.java
new file mode 100644
index 0000000000..f1bf5682e0
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/upload/HeatCleanup/HeatCleanupOnNewUploadTest.java
@@ -0,0 +1,167 @@
+package org.openecomp.sdc.vendorsoftwareproduct.upload.HeatCleanup;
+
+import org.openecomp.sdc.datatypes.error.ErrorLevel;
+import org.openecomp.sdc.vendorsoftwareproduct.VSPCommon;
+import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants;
+import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductManager;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.UploadDataEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
+import org.openecomp.sdc.vendorsoftwareproduct.impl.VendorSoftwareProductManagerImpl;
+import org.openecomp.sdc.vendorsoftwareproduct.types.UploadFileResponse;
+import org.openecomp.sdc.vendorsoftwareproduct.types.UploadFileStatus;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.core.model.dao.ServiceModelDao;
+import org.openecomp.core.model.dao.ServiceModelDaoFactory;
+import org.openecomp.core.util.UniqueValueUtil;
+import org.openecomp.core.validation.types.MessageContainerUtil;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.MapUtils;
+import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.List;
+
+public class HeatCleanupOnNewUploadTest {
+ private static final String USER1 = "vspTestUser1";
+
+ private static final VendorSoftwareProductManager vendorSoftwareProductManager =
+ new VendorSoftwareProductManagerImpl();
+ private static final VendorSoftwareProductDao vendorSoftwareProductDao =
+ VendorSoftwareProductDaoFactory.getInstance().createInterface();
+ private static final ServiceModelDao serviceModelDao =
+ ServiceModelDaoFactory.getInstance().createInterface();
+
+ private static String vspId = null;
+ private static Version vspActiveVersion = null;
+
+ private static void validateUploadContentExistence(boolean exist) {
+ UploadDataEntity uploadDataEntity =
+ vendorSoftwareProductDao.getUploadData(new UploadDataEntity(vspId, vspActiveVersion));
+ Assert.assertTrue((uploadDataEntity.getContentData() != null) == exist);
+ Assert.assertTrue((uploadDataEntity.getValidationData() != null) == exist);
+ Assert.assertTrue((uploadDataEntity.getPackageName() != null) == exist);
+ Assert.assertTrue((uploadDataEntity.getPackageVersion() != null) == exist);
+ Assert.assertTrue((serviceModelDao.getServiceModel(vspId, vspActiveVersion) != null) == exist);
+ }
+
+ private static void validateCompositionDataExistence(boolean exist) {
+ Assert.assertTrue(CollectionUtils
+ .isNotEmpty(vendorSoftwareProductDao.listNetworks(vspId, vspActiveVersion)) == exist);
+ Assert.assertTrue(CollectionUtils
+ .isNotEmpty(vendorSoftwareProductDao.listComponents(vspId, vspActiveVersion)) == exist);
+ Assert.assertTrue(CollectionUtils
+ .isNotEmpty(vendorSoftwareProductDao.listNicsByVsp(vspId, vspActiveVersion)) == exist);
+ }
+
+ private static InputStream getFileInputStream(String fileName) {
+ URL url = HeatCleanupOnNewUploadTest.class.getResource(fileName);
+ try {
+ return url.openStream();
+ } catch (IOException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ @BeforeClass
+ private void init() {
+ UniqueValueUtil
+ .deleteUniqueValue(VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME,
+ "VSPTestEmpty");
+
+ VspDetails vspDetails = vendorSoftwareProductManager.createNewVsp(VSPCommon
+ .createVspDetails(null, null, "VSPTestEmpty", "Test-vsp-empty", "vendorName", "vlm1Id",
+ "icon", "category", "subCategory", "123", null), USER1);
+ vspId = vspDetails.getId();
+ vspActiveVersion = vspDetails.getVersion();
+ }
+
+ @Test
+ public void testUploadWithComposition() {
+ InputStream zis = getFileInputStream("/vspmanager/zips/fullComposition.zip");
+
+ UploadFileResponse uploadFileResponse =
+ vendorSoftwareProductManager.uploadFile(vspId, zis, USER1);
+
+ Assert.assertEquals(uploadFileResponse.getStatus(), UploadFileStatus.Success);
+ Assert.assertTrue(MapUtils.isEmpty(
+ MessageContainerUtil.getMessageByLevel(ErrorLevel.ERROR, uploadFileResponse.getErrors())));
+
+ validateUploadContentExistence(true);
+ validateCompositionDataExistence(true);
+ }
+
+ @Test(dependsOnMethods = {"testUploadWithComposition"})
+ public void testProccesesMIBsDeletionAfterNewUpload() {
+ InputStream zis1 = getFileInputStream("/vspmanager/zips/fullComposition.zip");
+ InputStream zis2 = getFileInputStream("/vspmanager/zips/fullComposition.zip");
+ InputStream mib = getFileInputStream("/vspmanager/zips/vDNS.zip");
+
+ vendorSoftwareProductManager.uploadFile(vspId, zis1, USER1);
+ List<ComponentEntity> components =
+ (List<ComponentEntity>) vendorSoftwareProductDao.listComponents(vspId, vspActiveVersion);
+ String componentId = components.get(0).getId();
+
+ vendorSoftwareProductManager
+ .uploadComponentMib(mib, "vDNS.zip", vspId, componentId, true, USER1);
+ vendorSoftwareProductManager
+ .createProcess(new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity(vspId, vspActiveVersion, componentId, null), USER1);
+
+ vendorSoftwareProductManager.uploadFile(vspId, zis2, USER1);
+ Assert.assertTrue(
+ vendorSoftwareProductManager.listMibFilenames(vspId, componentId, USER1).getSnmpTrap() ==
+ null);
+ Assert.assertTrue(CollectionUtils
+ .isEmpty(vendorSoftwareProductDao.listProcesses(vspId, vspActiveVersion, componentId)));
+ }
+
+ @Test(dependsOnMethods = {"testProccesesMIBsDeletionAfterNewUpload"})
+ public void testInvalidStructureUploadAfterFullComposition() {
+ InputStream zis = getFileInputStream("/vspmanager/zips/withoutManifest.zip");
+
+ UploadFileResponse uploadFileResponse =
+ vendorSoftwareProductManager.uploadFile(vspId, zis, USER1);
+ Assert.assertEquals(uploadFileResponse.getStatus(), UploadFileStatus.Failure);
+ Assert.assertTrue(MapUtils.isNotEmpty(
+ MessageContainerUtil.getMessageByLevel(ErrorLevel.ERROR, uploadFileResponse.getErrors())));
+
+ validateUploadContentExistence(true);
+ validateCompositionDataExistence(true);
+ }
+
+ @Test(dependsOnMethods = {"testInvalidStructureUploadAfterFullComposition"})
+ public void testInvalidUploadAfterFullComposition() {
+ InputStream zis = getFileInputStream("/vspmanager/zips/missingYml.zip");
+
+ UploadFileResponse uploadFileResponse =
+ vendorSoftwareProductManager.uploadFile(vspId, zis, USER1);
+ Assert.assertEquals(uploadFileResponse.getStatus(), UploadFileStatus.Success);
+ Assert.assertTrue(MapUtils.isNotEmpty(
+ MessageContainerUtil.getMessageByLevel(ErrorLevel.ERROR, uploadFileResponse.getErrors())));
+
+ validateUploadContentExistence(true);
+ validateCompositionDataExistence(false);
+ }
+
+ @Test(dependsOnMethods = {"testInvalidUploadAfterFullComposition"})
+ public void testEmptyCompositionUploadAfterFullComposition() throws IOException {
+ testUploadWithComposition();
+
+ InputStream zis = getFileInputStream("/vspmanager/zips/emptyComposition.zip");
+ UploadFileResponse uploadFileResponse =
+ vendorSoftwareProductManager.uploadFile(vspId, zis, USER1);
+ Assert.assertEquals(uploadFileResponse.getStatus(), UploadFileStatus.Success);
+ Assert.assertTrue(MapUtils.isEmpty(
+ MessageContainerUtil.getMessageByLevel(ErrorLevel.ERROR, uploadFileResponse.getErrors())));
+
+ validateUploadContentExistence(true);
+ validateCompositionDataExistence(false);
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/upload/validation/UploadFileValidationTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/upload/validation/UploadFileValidationTest.java
new file mode 100644
index 0000000000..3ec8cb2e40
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/upload/validation/UploadFileValidationTest.java
@@ -0,0 +1,199 @@
+package org.openecomp.sdc.vendorsoftwareproduct.upload.validation;
+
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.common.utils.AsdcCommon;
+import org.openecomp.sdc.datatypes.error.ErrorMessage;
+
+import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductManager;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
+import org.openecomp.sdc.vendorsoftwareproduct.impl.VendorSoftwareProductManagerImpl;
+import org.openecomp.sdc.vendorsoftwareproduct.types.UploadFileResponse;
+import org.openecomp.core.util.UniqueValueUtil;
+import org.openecomp.core.utilities.CommonMethods;
+import org.openecomp.core.validation.errors.Messages;
+import org.openecomp.core.validation.types.MessageContainerUtil;
+import org.apache.commons.collections4.MapUtils;
+import org.testng.Assert;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Test;
+
+import java.io.*;
+import java.net.URL;
+import java.util.List;
+import java.util.Map;
+
+public class UploadFileValidationTest {
+
+ private static final String USER1 = "UploadFileValidationTest";
+ private static final String EMPTY_ZIP_FILE = "/validation/zips/emptyZip.zip";
+ private static final String MISSING_MANIFEST_IN_ZIP_FILE =
+ "/validation/zips/missingManifestInZip.zip";
+ private static final String ZIP_FILE_WITH_FOLDER = "/validation/zips/zipFileWithFolder.zip";
+ private static VendorSoftwareProductManager vendorSoftwareProductManager =
+ new VendorSoftwareProductManagerImpl();
+ private static String vspId;
+
+ public static org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity createVendorLicenseModel(String name, String desc,
+ String icon) {
+ org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity
+ vendorLicenseModel = new org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity();
+ vendorLicenseModel.setVendorName(name);
+ vendorLicenseModel.setDescription(desc);
+ vendorLicenseModel.setIconRef(icon);
+ return vendorLicenseModel;
+ }
+
+ @BeforeTest
+ private void init() {
+ VspDetails vspDetails = new VspDetails();
+ vspDetails.setVendorName("vspName_" + CommonMethods.nextUuId());
+ vspId = vendorSoftwareProductManager.createNewVsp(vspDetails, USER1).getId();
+
+ UniqueValueUtil
+ .deleteUniqueValue(org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME,
+ "VSP_syb_upload_various");
+ UniqueValueUtil
+ .deleteUniqueValue(org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME,
+ "vsp_syb_upload_no_error");
+ UniqueValueUtil
+ .deleteUniqueValue(org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME,
+ "vsp_syb");
+ }
+
+ @Test
+ public void testUploadZipNull() {
+ UploadFileResponse response = vendorSoftwareProductManager.uploadFile(vspId, null, USER1);
+ Assert.assertEquals(response.getErrors().size(), 1);
+ Assert.assertTrue(response.getErrors().containsKey(AsdcCommon.UPLOAD_FILE));
+ Assert.assertEquals(response.getErrors().get(AsdcCommon.UPLOAD_FILE).get(0).getMessage(),
+ Messages.NO_ZIP_FILE_WAS_UPLOADED_OR_ZIP_NOT_EXIST.getErrorMessage());
+ }
+
+ @Test(dependsOnMethods = "testUploadZipNull")
+ public void testUploadEmptyFile() {
+ UploadFileResponse response = vendorSoftwareProductManager
+ .uploadFile(vspId, new ByteArrayInputStream("".getBytes()), USER1);
+ Assert.assertEquals(response.getErrors().size(), 1);
+ Assert.assertTrue(response.getErrors().containsKey(AsdcCommon.UPLOAD_FILE));
+ Assert.assertEquals(response.getErrors().get(AsdcCommon.UPLOAD_FILE).get(0).getMessage(),
+ Messages.NO_ZIP_FILE_WAS_UPLOADED_OR_ZIP_NOT_EXIST.getErrorMessage());
+ }
+
+ @Test(dependsOnMethods = "testUploadEmptyFile")
+ public void testUploadEmptyZip() {
+ UploadFileResponse response =
+ vendorSoftwareProductManager.uploadFile(vspId, getFileInputStream(EMPTY_ZIP_FILE), USER1);
+ Assert.assertEquals(response.getErrors().size(), 1);
+ Assert.assertTrue(response.getErrors().containsKey(AsdcCommon.UPLOAD_FILE));
+ Assert.assertEquals(response.getErrors().get(AsdcCommon.UPLOAD_FILE).get(0).getMessage(),
+ Messages.INVALID_ZIP_FILE.getErrorMessage());
+ }
+
+ @Test(dependsOnMethods = "testUploadEmptyZip")
+ public void testUploadMissingManifestInZip() {
+ UploadFileResponse response = vendorSoftwareProductManager
+ .uploadFile(vspId, getFileInputStream(MISSING_MANIFEST_IN_ZIP_FILE), USER1);
+ Assert.assertEquals(response.getErrors().size(), 1);
+ Assert.assertTrue(response.getErrors().containsKey(AsdcCommon.MANIFEST_NAME));
+ Assert.assertEquals(response.getErrors().get(AsdcCommon.MANIFEST_NAME).get(0).getMessage(),
+ Messages.MANIFEST_NOT_EXIST.getErrorMessage());
+ }
+
+ @Test(dependsOnMethods = "testUploadMissingManifestInZip")
+ public void testUploadZipWithFolder() {
+ UploadFileResponse response = vendorSoftwareProductManager
+ .uploadFile(vspId, getFileInputStream(ZIP_FILE_WITH_FOLDER), USER1);
+ Assert.assertEquals(response.getErrors().size(), 1);
+ Assert.assertTrue(response.getErrors().containsKey(AsdcCommon.UPLOAD_FILE));
+ Assert.assertEquals(response.getErrors().get(AsdcCommon.UPLOAD_FILE).get(0).getMessage(),
+ Messages.ZIP_SHOULD_NOT_CONTAIN_FOLDERS.getErrorMessage());
+ }
+
+ @Test(dependsOnMethods = "testUploadZipWithFolder")
+ public void testUploadVariousZips() {
+
+ File[] files = getFileList("/validation/zips/various");
+ InputStream is;
+ for (File file : files) {
+ if (file.isFile()) {
+ UploadFileResponse response = null;
+ try {
+
+ is = new FileInputStream(file);
+ response = vendorSoftwareProductManager.uploadFile(vspId, is, USER1);
+
+ } catch (FileNotFoundException e) {
+ throw new RuntimeException(e);
+ } catch (CoreException ce) {
+ throw new RuntimeException("failed upload:" + file.getName(), ce);
+ } catch (RuntimeException re) {
+
+ throw new RuntimeException("failed upload:" + file.getName(), re);
+ }
+ System.out.println("zip:" + file.getName() + " Errors:" + calculateNumberOfMessages(
+ MessageContainerUtil.getMessageByLevel(org.openecomp.sdc.datatypes.error.ErrorLevel.ERROR, response.getErrors())) +
+ " Warnings:" + calculateNumberOfMessages(
+ MessageContainerUtil.getMessageByLevel(org.openecomp.sdc.datatypes.error.ErrorLevel.WARNING, response.getErrors())));
+ }
+ }
+ }
+
+ @Test(dependsOnMethods = "testUploadVariousZips")
+ public void testUploadNoErrorVariousZips() {
+
+
+ File[] files = getFileList("/validation/zips/various/noError");
+ InputStream is;
+ for (File file : files) {
+ if (file.isFile()) {
+ try {
+ is = new FileInputStream(file);
+ UploadFileResponse response = vendorSoftwareProductManager.uploadFile(vspId, is, USER1);
+ Map<String, List<ErrorMessage>> errors = response.getErrors();
+ Assert.assertTrue(
+ MapUtils.isEmpty(MessageContainerUtil.getMessageByLevel(
+ org.openecomp.sdc.datatypes.error.ErrorLevel.ERROR, errors)));
+
+
+ } catch (FileNotFoundException e) {
+ throw new RuntimeException(e);
+ } catch (CoreException ce) {
+ Assert.fail("failed upload:" + file.getName() + " exception:" + ce.getMessage());
+
+ } catch (RuntimeException re) {
+ Assert.fail("failed upload:" + file.getName() + " exception:" + re.getMessage());
+ }
+ }
+ }
+ }
+
+ private InputStream getFileInputStream(String fileName) {
+ URL url = this.getClass().getResource(fileName);
+ try {
+ return url.openStream();
+ } catch (IOException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ private File[] getFileList(String dir) {
+ URL url = UploadFileValidationTest.class.getResource(dir);
+
+ String path = url.getPath();
+ File pathFile = new File(path);
+ return pathFile.listFiles();
+
+
+ }
+
+ private int calculateNumberOfMessages(Map<String, List<ErrorMessage>> messages) {
+ int sum = 0;
+ for (List<ErrorMessage> errors : messages.values()) {
+ sum += errors.size();
+ }
+ return sum;
+ }
+
+
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/emptyComposition/MANIFEST.json b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/emptyComposition/MANIFEST.json
new file mode 100644
index 0000000000..af1e3fbbae
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/emptyComposition/MANIFEST.json
@@ -0,0 +1,11 @@
+{
+ "name": "vEP_JSA_Net",
+ "description": "Version 2.0 02-09-2016 (Authors: John Doe, user PROD)",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "ep-jsa_net.yaml",
+ "type": "HEAT"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/emptyComposition/ep-jsa_net.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/emptyComposition/ep-jsa_net.yaml
new file mode 100644
index 0000000000..f0773b7611
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/emptyComposition/ep-jsa_net.yaml
@@ -0,0 +1,21 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ snapshot02:
+ type: string
+ description: prop
+ network_name:
+ type: string
+ description: prop
+
+resources:
+
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_param: network_name}
+ - config: { get_param: snapshot02} \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/componentsWithPort/ComponentsWithPortST.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/componentsWithPort/ComponentsWithPortST.yaml
new file mode 100644
index 0000000000..1446e98d91
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/componentsWithPort/ComponentsWithPortST.yaml
@@ -0,0 +1,428 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.pcrf_psm:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.pcm:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ Internal2_name:
+ label: Internal2_name
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_name
+ Internal1_shared:
+ label: Internal1_shared
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_shared
+ FSB1_volume_name:
+ label: FSB1_volume
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_volume_1
+ jsa_cidr:
+ label: jsa_cidr
+ hidden: false
+ immutable: false
+ type: string
+ description: jsa_cidr
+ default: 107.243.7.128/26
+ availabilityzone_name:
+ label: availabilityzone_name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone_name
+ fsb1-name:
+ label: FSB1_name
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_name
+ pcm_image_name:
+ label: pcm_image_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_image_name
+ Internal2_external:
+ label: Internal2_external
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_external
+ Internal2_forwarding_mode:
+ label: Internal2_forwarding_mode
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_forwarding_mode
+ pcrf_psm_flavor_name:
+ label: pcrf_psm_flavor_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_flavor_name
+ pcrf_psm_image_name:
+ label: pcrf_psm_image_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_image_name
+ FSB_1_image:
+ label: MME_FSB1
+ hidden: false
+ immutable: false
+ type: string
+ description: MME_FSB1_15B-CP04-r5a01
+ volume_size:
+ label: volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: my volume size 320GB
+ fsb1-Internal1-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ Internal2_shared:
+ label: Internal2_shared
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_shared
+ pcm_server_name:
+ label: pcm_server_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_server_name
+ Internal1_net_name:
+ label: Internal1_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_net_name
+ oam_net_name:
+ label: oam_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: oam_net_name
+ fsb1-flavor:
+ label: FSB1_flavor
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_flavor
+ fsb1-Internal2-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ volume_type:
+ label: volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: volume type Gold
+ fsb1-zone:
+ label: FSB1_zone
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_zone
+ fsb_zone:
+ label: FSB1_zone
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_zone
+ security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: String
+ jsa_net_name:
+ label: jsa_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: jsa_net_name
+ default: jsa_log_net_0
+ pcrf_psm_server_name:
+ label: pcrf_psm_server_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_server_name
+ pcm_flavor_name:
+ label: pcm_flavor_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_flavor_name
+ oam_net_id:
+ label: oam_net_id
+ hidden: false
+ immutable: false
+ type: string
+ description: oam_net_id
+ fsb2-Internal1-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ Internal1_forwarding_mode:
+ label: Internal1_forwarding_mode
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_forwarding_mode
+ pcrf_cps_net_name:
+ label: pcrf_cps_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_cps_net_name
+ cps_net_name:
+ label: cps_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: cps_net_name
+ pcrf_security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: String
+ Internal1_external:
+ label: Internal1_external
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_external
+ node_templates:
+ pcm_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: oam_net_ip
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_pcm
+ relationship: tosca.relationships.network.BindsTo
+ FSB1_Internal2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ mac_address:
+ get_input: fsb1-Internal2-mac
+ network: Internal2-net
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: FSB2
+ relationship: tosca.relationships.network.BindsTo
+ FSB1_Internal1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ mac_address:
+ get_input: fsb1-Internal1-mac
+ network: Internal1-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal1-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: FSB1
+ relationship: tosca.relationships.network.BindsTo
+ FSB1_OAM:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ fixed_ips:
+ - ip_address:
+ get_input: fsb1-oam-ip
+ network:
+ get_input: oam_net_id
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: FSB1
+ relationship: tosca.relationships.network.BindsTo
+ psm01_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: pcrf_security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: pcrf_cps_net_ip
+ network:
+ get_input: pcrf_cps_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: pcrf_server_psm
+ relationship: tosca.relationships.network.BindsTo
+ pcm_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: cps_net_ip
+ network:
+ get_input: cps_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_pcm
+ relationship: tosca.relationships.network.BindsTo
+ server_pcm:
+ type: org.openecomp.resource.vfc.nodes.heat.pcm
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ user_data: UNSUPPORTED_RESOURCE_server_init
+ pcrf_server_psm:
+ type: org.openecomp.resource.vfc.nodes.heat.pcrf_psm
+ properties:
+ flavor:
+ get_input: pcrf_psm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcrf_psm_image_name
+ config_drive: 'True'
+ metadata:
+ vnf_id:
+ get_input: pcrf_vnf_id
+ user_data_format: RAW
+ name:
+ get_input: pcrf_psm_server_name
+ user_data: UNSUPPORTED_RESOURCE_pcrf_server_init
+ FSB2:
+ type: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ properties:
+ flavor:
+ get_input: fsb1-flavor
+ availability_zone:
+ get_input: fsb_zone
+ name:
+ get_input: fsb1-name
+ FSB1:
+ type: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ properties:
+ flavor:
+ get_input: fsb1-flavor
+ availability_zone:
+ get_input: fsb_zone
+ metadata:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: '0644'
+ content:
+ str_replace:
+ template:
+ get_artifact:
+ - SELF
+ - nimbus-ethernet
+ params:
+ $dev: eth0
+ $netmask:
+ get_input: cps_net_mask
+ $ip:
+ get_input: cps_net_ip
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth1
+ permissions: '0644'
+ content:
+ str_replace:
+ template:
+ get_artifact:
+ - SELF
+ - nimbus-ethernet-gw
+ params:
+ $dev: eth1
+ $netmask:
+ get_input: oam_net_mask
+ $gateway:
+ get_input: oam_net_gw
+ $ip:
+ get_input: oam_net_ip
+ name:
+ get_input: fsb1-name
+ artifacts:
+ nimbus-ethernet-gw:
+ type: tosca.artifacts.Deployment
+ file: ../Artifacts/nimbus-ethernet-gw
+ nimbus-ethernet:
+ type: tosca.artifacts.Deployment
+ file: ../Artifacts/nimbus-ethernet
+ groups:
+ ep-jsa_net:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/ep-jsa_net.yaml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - pcm_port_1
+ - FSB1_Internal2
+ - FSB1_Internal1
+ - FSB1_OAM
+ - psm01_port_0
+ - pcm_port_0
+ - server_pcm
+ - pcrf_server_psm
+ - FSB2
+ - FSB1 \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/fullComposition/MainServiceTemplate.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/fullComposition/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..62865b3e78
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/fullComposition/MainServiceTemplate.yaml
@@ -0,0 +1,473 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.pcrf_psm:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.pcm:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ Internal2_name:
+ label: Internal2_name
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_name
+ Internal1_shared:
+ label: Internal1_shared
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_shared
+ FSB1_volume_name:
+ label: FSB1_volume
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_volume_1
+ jsa_cidr:
+ label: jsa_cidr
+ hidden: false
+ immutable: false
+ type: string
+ description: jsa_cidr
+ default: 107.243.7.128/26
+ availabilityzone_name:
+ label: availabilityzone_name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone_name
+ fsb1-name:
+ label: FSB1_name
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_name
+ pcm_image_name:
+ label: pcm_image_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_image_name
+ Internal2_external:
+ label: Internal2_external
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_external
+ Internal2_forwarding_mode:
+ label: Internal2_forwarding_mode
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_forwarding_mode
+ pcrf_psm_flavor_name:
+ label: pcrf_psm_flavor_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_flavor_name
+ pcrf_psm_image_name:
+ label: pcrf_psm_image_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_image_name
+ FSB_1_image:
+ label: MME_FSB1
+ hidden: false
+ immutable: false
+ type: string
+ description: MME_FSB1_15B-CP04-r5a01
+ volume_size:
+ label: volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: my volume size 320GB
+ fsb1-Internal1-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ Internal2_shared:
+ label: Internal2_shared
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_shared
+ pcm_server_name:
+ label: pcm_server_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_server_name
+ Internal1_net_name:
+ label: Internal1_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_net_name
+ oam_net_name:
+ label: oam_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: oam_net_name
+ fsb1-flavor:
+ label: FSB1_flavor
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_flavor
+ fsb1-Internal2-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ volume_type:
+ label: volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: volume type Gold
+ fsb1-zone:
+ label: FSB1_zone
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_zone
+ fsb_zone:
+ label: FSB1_zone
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_zone
+ security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: String
+ jsa_net_name:
+ label: jsa_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: jsa_net_name
+ default: jsa_log_net_0
+ pcrf_psm_server_name:
+ label: pcrf_psm_server_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_server_name
+ pcm_flavor_name:
+ label: pcm_flavor_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_flavor_name
+ oam_net_id:
+ label: oam_net_id
+ hidden: false
+ immutable: false
+ type: string
+ description: oam_net_id
+ fsb2-Internal1-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ Internal1_forwarding_mode:
+ label: Internal1_forwarding_mode
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_forwarding_mode
+ pcrf_cps_net_name:
+ label: pcrf_cps_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_cps_net_name
+ cps_net_name:
+ label: cps_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: cps_net_name
+ pcrf_security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: String
+ Internal1_external:
+ label: Internal1_external
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_external
+ node_templates:
+ pcm_vol_02:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ image:
+ get_input: FSB_1_image
+ volume_type:
+ get_input: volume_type
+ size: '(get_input : volume_size) * 1024'
+ read_only: true
+ name:
+ get_input: FSB1_volume_name
+ Internal2-net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ shared:
+ get_input: Internal2_shared
+ forwarding_mode:
+ get_input: Internal2_forwarding_mode
+ external:
+ get_input: Internal2_external
+ network_name:
+ get_input: Internal2_name
+ pcm_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: oam_net_ip
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_pcm
+ relationship: tosca.relationships.network.BindsTo
+ server_VolumeTest_snapshot02:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ snapshot_id:
+ get_input: snapshot02
+ FSB1_Internal2_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ mac_address:
+ get_input: fsb1-Internal2-mac
+ network: Internal2-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal2-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: FSB1
+ relationship: tosca.relationships.network.BindsTo
+ server_VolumeTest_snapshot01:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ snapshot_id:
+ get_input: snapshot01
+ FSB1_Internal1_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ mac_address:
+ get_input: fsb1-Internal1-mac
+ network: Internal1-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal1-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: FSB1
+ relationship: tosca.relationships.network.BindsTo
+ FSB1_OAM_Port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ fixed_ips:
+ - ip_address:
+ get_input: fsb1-oam-ip
+ network:
+ get_input: oam_net_id
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: FSB1
+ relationship: tosca.relationships.network.BindsTo
+ psm01_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: pcrf_security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: pcrf_cps_net_ip
+ network:
+ get_input: pcrf_cps_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: pcrf_server_psm
+ relationship: tosca.relationships.network.BindsTo
+ pcm_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: cps_net_ip
+ network:
+ get_input: cps_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_pcm
+ relationship: tosca.relationships.network.BindsTo
+ network:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ network_name:
+ get_input: Internal1_net_name
+ server_pcm:
+ type: org.openecomp.resource.vfc.nodes.heat.pcm
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ user_data: UNSUPPORTED_RESOURCE_server_init
+ Internal1-net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ shared:
+ get_input: Internal1_shared
+ forwarding_mode:
+ get_input: Internal1_forwarding_mode
+ external:
+ get_input: Internal1_external
+ network_name:
+ get_input: Internal1_net_name
+ pcrf_server_psm:
+ type: org.openecomp.resource.vfc.nodes.heat.pcrf_psm
+ properties:
+ flavor:
+ get_input: pcrf_psm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcrf_psm_image_name
+ config_drive: 'True'
+ metadata:
+ vnf_id:
+ get_input: pcrf_vnf_id
+ user_data_format: RAW
+ name:
+ get_input: pcrf_psm_server_name
+ user_data: UNSUPPORTED_RESOURCE_pcrf_server_init
+ FSB1:
+ type: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ properties:
+ flavor:
+ get_input: fsb1-flavor
+ availability_zone:
+ get_input: fsb_zone
+ metadata:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: '0644'
+ content:
+ str_replace:
+ template:
+ get_artifact:
+ - SELF
+ - nimbus-ethernet
+ params:
+ $dev: eth0
+ $netmask:
+ get_input: cps_net_mask
+ $ip:
+ get_input: cps_net_ip
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth1
+ permissions: '0644'
+ content:
+ str_replace:
+ template:
+ get_artifact:
+ - SELF
+ - nimbus-ethernet-gw
+ params:
+ $dev: eth1
+ $netmask:
+ get_input: oam_net_mask
+ $gateway:
+ get_input: oam_net_gw
+ $ip:
+ get_input: oam_net_ip
+ name:
+ get_input: fsb1-name
+ artifacts:
+ nimbus-ethernet-gw:
+ type: tosca.artifacts.Deployment
+ file: ../Artifacts/nimbus-ethernet-gw
+ nimbus-ethernet:
+ type: tosca.artifacts.Deployment
+ file: ../Artifacts/nimbus-ethernet
+ groups:
+ ep-jsa_net:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/ep-jsa_net.yaml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - pcm_vol_02
+ - Internal2-net
+ - pcm_port_1
+ - FSB1_Internal2_port
+ - FSB1_Internal1_port
+ - FSB1_OAM_Port
+ - psm01_port_0
+ - pcm_port_0
+ - server_pcm
+ - Internal1-net
+ - pcrf_server_psm
+ - FSB1 \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/networks/MainServiceTemplate.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/networks/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..e5c68b61d0
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/networks/MainServiceTemplate.yaml
@@ -0,0 +1,829 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+topology_template:
+ inputs:
+ Internal2_name:
+ hidden: false
+ immutable: false
+ type: string
+ default: Internal2-subnet
+ vlc2-Internal2-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to vlc2-Internal2
+ default: 00:81:37:0E:02:12
+ epc-sctp-a-net-rt:
+ hidden: false
+ immutable: false
+ type: string
+ description: epc-sctp-a route target
+ default: 13979:105717
+ epc-sctp-b-net-rt:
+ hidden: false
+ immutable: false
+ type: string
+ description: epc-sctp-b route target
+ default: 13979:105719
+ gpb-flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor to use for servers gpb
+ default: m4.xlarge4
+ Internal1_cidr:
+ hidden: false
+ immutable: false
+ type: string
+ default: 169.253.0.0/17
+ epc-sctp-a-pool-start:
+ hidden: false
+ immutable: false
+ type: string
+ description: epc-sctp-a-net network ip pool start IP address
+ default: 107.243.37.3
+ Internal2_subnet_name:
+ hidden: false
+ immutable: false
+ type: string
+ default: vmme_int_int_sub_2
+ Internal1_subnet_name:
+ hidden: false
+ immutable: false
+ type: string
+ default: vmme_int_int_sub_1
+ gpb1-Internal1-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to gpb1-Internal1
+ default: 00:80:37:0E:01:22
+ gpb1-Internal1-ip:
+ hidden: false
+ immutable: false
+ type: string
+ default: 169.254.0.101
+ FSB_1_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: image name
+ fsb1-Internal2-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to fsb1-Internal2
+ default: 00:81:37:0E:0B:12
+ ncb_zone:
+ hidden: false
+ immutable: false
+ type: string
+ description: cluster for spawnning ncb instances
+ default: nova
+ Internal2_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ default: vmme_int_int_2
+ epc-sctp-a-pool-end:
+ hidden: false
+ immutable: false
+ type: string
+ description: epc-sctp-a-net network ip pool end IP address
+ default: 107.243.37.30
+ Internal1_name:
+ hidden: false
+ immutable: false
+ type: string
+ default: Internal1-subnet
+ gpb2-name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of gpb2
+ default: ZRDM1MMEX33GPB002
+ fsb2-Internal1-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to fsb2-Internal1
+ default: 00:80:37:0E:0D:12
+ fsb2-name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of fsb1
+ default: ZRDM1MMEX33FSB002
+ static_prefix_sctp_b_1:
+ hidden: false
+ immutable: false
+ type: string
+ description: Static Prefix
+ default: 107.239.40.64/30
+ fsb2-oam-ip:
+ hidden: false
+ immutable: false
+ type: string
+ default: 107.250.172.222
+ fsb2-flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor to use for servers fsb2
+ default: m4.xlarge4
+ fsb2-Internal2-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to fsb2-Internal2
+ default: 00:81:37:0E:0D:12
+ ncb2-Internal1-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to ncb2-Internal1
+ default: 00:80:37:0E:0F:12
+ ncb2-name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of ncb2
+ default: ZRDM1MMEX33NCB002
+ epc-sctp-b-pool-end:
+ hidden: false
+ immutable: false
+ type: string
+ description: epc-sctp-b-net network ip pool end IP address
+ default: 107.243.37.62
+ vlc1-gtp-ip:
+ hidden: false
+ immutable: false
+ type: string
+ default: 107.243.37.67
+ epc-sctp-b-pool-start:
+ hidden: false
+ immutable: false
+ type: string
+ description: epc-sctp-b-net network ip pool start IP address
+ default: 107.243.37.35
+ my_instance:
+ hidden: false
+ immutable: false
+ type: string
+ description: instance
+ Internal2_shared:
+ hidden: false
+ immutable: false
+ type: string
+ default: 'False'
+ Internal1_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ default: vmme_int_int_1
+ vlc2-name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of vlc2
+ default: ZRDM1MMEX33VLC002
+ Internal2_ipam_name:
+ hidden: false
+ immutable: false
+ type: string
+ default: vmme_ipam_int2
+ vlc1-sctp-b-ip:
+ hidden: false
+ immutable: false
+ type: string
+ default: 107.243.37.35
+ Internal1_net_pool_end:
+ hidden: false
+ immutable: false
+ type: string
+ default: 169.253.0.254
+ Internal1_default_gateway:
+ hidden: false
+ immutable: false
+ type: string
+ default: 169.253.0.3
+ ncb1-Internal1-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to ncb1-Internal1
+ default: 00:80:37:0E:09:12
+ epc-gtp-net-name:
+ hidden: false
+ immutable: false
+ type: string
+ description: gtp net name
+ default: EPC-GTP
+ vlc1-Internal1-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to vlc1-Internal1
+ default: 00:80:37:0E:01:12
+ gpb2-Internal1-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to gpb2-Internal1
+ default: 00:80:37:0E:02:22
+ epc-gtp-net-cidr:
+ hidden: false
+ immutable: false
+ type: string
+ description: gtp stubnet
+ default: 107.243.37.64/27
+ oam_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: uuid of oam network
+ default: 47bf4cca-0961-422f-bcd6-d5a4fbb1a351
+ vlc_zone:
+ hidden: false
+ immutable: false
+ type: string
+ description: cluster for spawnning vlc instances
+ default: nova
+ vlc2-Internal1-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to vlc2-Internal1
+ default: 00:80:37:0E:02:12
+ epc-sctp-a-net-cidr:
+ hidden: false
+ immutable: false
+ type: string
+ description: epc-sctp-a subnet
+ default: 107.243.37.0/27
+ Internal1_forwarding_mode:
+ hidden: false
+ immutable: false
+ type: string
+ default: l2
+ Internal2_dhcp:
+ hidden: false
+ immutable: false
+ type: string
+ default: 'False'
+ Internal4_dhcp:
+ hidden: false
+ immutable: false
+ type: string
+ fsb1-oam-ip:
+ hidden: false
+ immutable: false
+ type: string
+ default: 107.250.172.221
+ FSB_2_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: image name
+ vlc1-oam-ip:
+ hidden: false
+ immutable: false
+ type: string
+ default: 107.250.172.227
+ epc-sctp-a-net-name:
+ hidden: false
+ immutable: false
+ type: string
+ description: epc-sctp-a net name
+ default: EPC-SCTP-A
+ vlc2-oam-ip:
+ hidden: false
+ immutable: false
+ type: string
+ default: 107.250.172.228
+ Internal2_net_pool_start:
+ hidden: false
+ immutable: false
+ type: string
+ default: 169.255.0.100
+ FSB1_volume_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: volume name
+ vlc1-sctp-a-ip:
+ hidden: false
+ immutable: false
+ type: string
+ default: 107.243.37.3
+ Internal1_ipam_name:
+ hidden: false
+ immutable: false
+ type: string
+ default: vmme_ipam_int1
+ Internal1_dhcp:
+ hidden: false
+ immutable: false
+ type: string
+ default: 'False'
+ Internal3_dhcp:
+ hidden: false
+ immutable: false
+ type: string
+ default: 'True'
+ Internal2_external:
+ hidden: false
+ immutable: false
+ type: string
+ default: 'False'
+ Internal2_forwarding_mode:
+ hidden: false
+ immutable: false
+ type: string
+ default: l2
+ vlc1-name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of vlc1
+ default: ZRDM1MMEX33VLC002
+ vlc-flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor to use for servers vlc
+ default: m4.xlarge4
+ epc-gtp-net-rt:
+ hidden: false
+ immutable: false
+ type: string
+ description: gtp route target
+ default: 13979:105715
+ gpb_zone:
+ hidden: false
+ immutable: false
+ type: string
+ description: cluster for spawnning gpb instances
+ default: nova
+ Internal1-net:
+ hidden: false
+ immutable: false
+ type: string
+ description: net
+ gpb1-Internal2-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to gpb1-Internal2
+ default: 00:81:37:0E:01:22
+ fsb1-Internal1-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to fsb1-Internal1
+ default: 00:80:37:0E:0B:12
+ FSB2_volume_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: volume name
+ VMME_FSB2_boot_volume:
+ hidden: false
+ immutable: false
+ type: string
+ default: 089a0d11-4b15-4370-8343-3f90907b1221
+ fsb_zone:
+ hidden: false
+ immutable: false
+ type: string
+ description: cluster for spawnning fsb instances
+ default: nova
+ VMME_FSB1_boot_volume:
+ hidden: false
+ immutable: false
+ type: string
+ default: 8248e794-6173-4b49-b9c3-8219b0b56f4e
+ Internal2_default_gateway:
+ hidden: false
+ immutable: false
+ type: string
+ default: 169.255.0.3
+ Internal1_external:
+ hidden: false
+ immutable: false
+ type: string
+ default: 'False'
+ vlc2-sctp-a-ip:
+ hidden: false
+ immutable: false
+ type: string
+ default: 107.243.37.4
+ ncb-flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor to use for servers ncb
+ default: m4.xlarge4
+ Internal1_shared:
+ hidden: false
+ immutable: false
+ type: string
+ default: 'False'
+ fsb1-name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of fsb1
+ default: ZRDM1MMEX33FSB001
+ static_prefix_gtp_1:
+ hidden: false
+ immutable: false
+ type: string
+ description: Static Prefix
+ default: 107.239.40.96/30
+ epc-sctp-b-net-gateway:
+ hidden: false
+ immutable: false
+ type: string
+ description: epc-sctp-b-net network gateway
+ default: 107.243.37.33
+ epc-sctp-b-net-cidr:
+ hidden: false
+ immutable: false
+ type: string
+ description: epc-sctp-b subnet
+ default: 107.243.37.32/24
+ epc-gtp-pool-end:
+ hidden: false
+ immutable: false
+ type: string
+ description: gtp network ip pool end IP address
+ default: 107.243.37.94
+ epc-sctp-a-net-gateway:
+ hidden: false
+ immutable: false
+ type: string
+ description: epc-sctp-a-net network gateway
+ default: 107.243.37.1
+ vlc2-gtp-ip:
+ hidden: false
+ immutable: false
+ type: string
+ default: 107.243.37.68
+ vlc2-sctp-b-ip:
+ hidden: false
+ immutable: false
+ type: string
+ default: 107.243.37.36
+ Internal1_net_pool_start:
+ hidden: false
+ immutable: false
+ type: string
+ default: 169.253.0.100
+ volume_size:
+ hidden: false
+ immutable: false
+ type: string
+ description: volume
+ fsb2-image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of image to use for server fsb2
+ default: MME_FSB2_15B-CP04-r5a01
+ ncb2-Internal2-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to ncb2-Internal2
+ default: 00:81:37:0E:0F:12
+ ncb1-name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of ncb1
+ default: ZRDM1MMEX33NCB001
+ fsb1-image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of image to use for server fsb1
+ default: MME_FSB1_15B-CP04-r5a01
+ fsb1-flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor to use for servers fsb1
+ default: m4.xlarge4
+ volume_type:
+ hidden: false
+ immutable: false
+ type: string
+ description: volume
+ Internal2_net_pool_end:
+ hidden: false
+ immutable: false
+ type: string
+ default: 169.255.0.254
+ epc-sctp-b-net-name:
+ hidden: false
+ immutable: false
+ type: string
+ description: epc-sctp-b net name
+ default: EPC-SCTP-B
+ Internal2_cidr:
+ hidden: false
+ immutable: false
+ type: string
+ default: 169.255.0.0/17
+ epc-gtp-net-gateway:
+ hidden: false
+ immutable: false
+ type: string
+ description: gtp network gateway
+ default: 107.243.37.65
+ gpb2-Internal2-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to gpb2-Internal2
+ default: 00:81:37:0E:02:22
+ ncb1-Internal2-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to ncb1-Internal2
+ default: 00:81:37:0E:09:12
+ epc-gtp-pool-start:
+ hidden: false
+ immutable: false
+ type: string
+ description: gtp network ip pool start IP address
+ default: 107.243.37.67
+ static_prefix_sctp_a_1:
+ hidden: false
+ immutable: false
+ type: string
+ description: Static Prefix
+ default: 107.239.40.32/30
+ gpb1-name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of gpb1
+ default: ZRDM1MMEX33GPB001
+ pxe-image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of image to use for server ncb
+ default: MME_PXE-BOOT_cxp9025898_2r5a01.qcow2
+ vlc1-Internal2-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to vlc1-Internal2
+ default: 00:81:37:0E:01:12
+ node_templates:
+ contail-net-default-true-dhcp:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ route_targets:
+ - get_input: epc-gtp-net-rt
+ network_name:
+ get_input: epc-gtp-net-name
+ subnets:
+ epc-gtp-subnet:
+ cidr:
+ get_input: epc-gtp-net-cidr
+ gateway_ip:
+ get_input: epc-gtp-net-gateway
+ allocation_pools:
+ - start:
+ get_input: epc-gtp-pool-start
+ end:
+ get_input: epc-gtp-pool-end
+ contail-net-dhcp-false-param:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ shared:
+ get_input: Internal1_shared
+ forwarding_mode:
+ get_input: Internal1_forwarding_mode
+ external: true
+ route_targets:
+ get_artifact:
+ - SELF
+ - nimbus-ethernet
+ network_name:
+ get_input: Internal1_net_name
+ subnets:
+ Internal3-subnet:
+ enable_dhcp:
+ get_input: Internal2_dhcp
+ cidr:
+ get_input: Internal2_cidr
+ gateway_ip:
+ get_input: Internal2_default_gateway
+ Internal1-subnet:
+ enable_dhcp:
+ get_input: Internal1_dhcp
+ cidr:
+ get_input: Internal1_cidr
+ gateway_ip:
+ get_input: Internal1_default_gateway
+ dhcp_enabled:
+ get_input: Internal1_dhcp
+ artifacts:
+ nimbus-ethernet:
+ type: tosca.artifacts.Deployment
+ file: ../Artifacts/nimbus-ethernet.sh
+ contail-net-dhcp-false:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ shared:
+ get_input: Internal1_shared
+ forwarding_mode:
+ get_input: Internal1_forwarding_mode
+ external: true
+ route_targets:
+ get_artifact:
+ - SELF
+ - nimbus-ethernet
+ network_name:
+ get_input: Internal1_net_name
+ subnets:
+ Internal3-subnet:
+ enable_dhcp:
+ get_input: Internal2_dhcp
+ cidr:
+ get_input: Internal2_cidr
+ gateway_ip:
+ get_input: Internal2_default_gateway
+ Internal1-subnet:
+ enable_dhcp:
+ get_input: Internal1_dhcp
+ cidr:
+ get_input: Internal1_cidr
+ gateway_ip:
+ get_input: Internal1_default_gateway
+ dhcp_enabled: false
+ artifacts:
+ nimbus-ethernet:
+ type: tosca.artifacts.Deployment
+ file: ../Artifacts/nimbus-ethernet.sh
+ contail-net-dhcp-true-param:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ shared:
+ get_input: Internal1_shared
+ forwarding_mode:
+ get_input: Internal1_forwarding_mode
+ external: true
+ route_targets:
+ get_artifact:
+ - SELF
+ - nimbus-ethernet
+ network_name:
+ get_input: Internal1_net_name
+ subnets:
+ Internal3-subnet:
+ enable_dhcp:
+ get_input: Internal2_dhcp
+ cidr:
+ get_input: Internal2_cidr
+ gateway_ip:
+ get_input: Internal2_default_gateway
+ Internal1-subnet:
+ enable_dhcp:
+ get_input: Internal1_dhcp
+ cidr:
+ get_input: Internal1_cidr
+ gateway_ip:
+ get_input: Internal1_default_gateway
+ dhcp_enabled:
+ get_input: Internal3_dhcp
+ artifacts:
+ nimbus-ethernet:
+ type: tosca.artifacts.Deployment
+ file: ../Artifacts/nimbus-ethernet.sh
+ contail-net-dhcp-true:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ shared:
+ get_input: Internal1_shared
+ forwarding_mode:
+ get_input: Internal1_forwarding_mode
+ external: true
+ route_targets:
+ get_artifact:
+ - SELF
+ - nimbus-ethernet
+ network_name:
+ get_input: Internal1_net_name
+ subnets:
+ Internal3-subnet:
+ enable_dhcp:
+ get_input: Internal2_dhcp
+ cidr:
+ get_input: Internal2_cidr
+ gateway_ip:
+ get_input: Internal2_default_gateway
+ Internal1-subnet:
+ enable_dhcp:
+ get_input: Internal1_dhcp
+ cidr:
+ get_input: Internal1_cidr
+ gateway_ip:
+ get_input: Internal1_default_gateway
+ dhcp_enabled: true
+ artifacts:
+ nimbus-ethernet:
+ type: tosca.artifacts.Deployment
+ file: ../Artifacts/nimbus-ethernet.sh
+ contail-net-dhcp-default-true-param:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ shared:
+ get_input: Internal1_shared
+ forwarding_mode:
+ get_input: Internal1_forwarding_mode
+ external: true
+ route_targets:
+ get_artifact:
+ - SELF
+ - nimbus-ethernet
+ network_name:
+ get_input: Internal1_net_name
+ subnets:
+ Internal3-subnet:
+ enable_dhcp:
+ get_input: Internal2_dhcp
+ cidr:
+ get_input: Internal2_cidr
+ gateway_ip:
+ get_input: Internal2_default_gateway
+ Internal1-subnet:
+ enable_dhcp:
+ get_input: Internal1_dhcp
+ cidr:
+ get_input: Internal1_cidr
+ gateway_ip:
+ get_input: Internal1_default_gateway
+ dhcp_enabled:
+ get_input: Internal4_dhcp
+ artifacts:
+ nimbus-ethernet:
+ type: tosca.artifacts.Deployment
+ file: ../Artifacts/nimbus-ethernet.sh
+ neutron-net-default-dhcp:
+ type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
+ properties:
+ network_name:
+ get_input: private_net_2_name
+ subnets:
+ private_subnet_2:
+ cidr:
+ get_input: private_net_2_cidr
+ gateway_ip:
+ get_input: private_net_2_gateway
+ allocation_pools:
+ - start:
+ get_input: private_net_2_pool_start
+ end:
+ get_input: private_net_2_pool_end
+ groups:
+ vmme_small:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/vmme_small.yml
+ description: |
+ HOT template to create vmme 2 fsb 2 ncb 2 gbp 2 vlc
+ members:
+ - contail-net-default-true-dhcp
+ - contail-net-dhcp-false-param
+ - contail-net-dhcp-false
+ - contail-net-dhcp-true-param
+ - contail-net-dhcp-true
+ - contail-net-dhcp-default-true-param
+ - neutron-net-default-dhcp \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/onlyComponents/OnlyComponentsST.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/onlyComponents/OnlyComponentsST.yaml
new file mode 100644
index 0000000000..54f39e4219
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/onlyComponents/OnlyComponentsST.yaml
@@ -0,0 +1,350 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.pcrf_psm:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.pcm:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ Internal2_name:
+ label: Internal2_name
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_name
+ Internal1_shared:
+ label: Internal1_shared
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_shared
+ FSB1_volume_name:
+ label: FSB1_volume
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_volume_1
+ jsa_cidr:
+ label: jsa_cidr
+ hidden: false
+ immutable: false
+ type: string
+ description: jsa_cidr
+ default: 107.243.7.128/26
+ availabilityzone_name:
+ label: availabilityzone_name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone_name
+ fsb1-name:
+ label: FSB1_name
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_name
+ pcm_image_name:
+ label: pcm_image_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_image_name
+ Internal2_external:
+ label: Internal2_external
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_external
+ Internal2_forwarding_mode:
+ label: Internal2_forwarding_mode
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_forwarding_mode
+ pcrf_psm_flavor_name:
+ label: pcrf_psm_flavor_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_flavor_name
+ pcrf_psm_image_name:
+ label: pcrf_psm_image_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_image_name
+ FSB_1_image:
+ label: MME_FSB1
+ hidden: false
+ immutable: false
+ type: string
+ description: MME_FSB1_15B-CP04-r5a01
+ volume_size:
+ label: volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: my volume size 320GB
+ fsb1-Internal1-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ Internal2_shared:
+ label: Internal2_shared
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_shared
+ pcm_server_name:
+ label: pcm_server_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_server_name
+ Internal1_net_name:
+ label: Internal1_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_net_name
+ oam_net_name:
+ label: oam_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: oam_net_name
+ fsb1-flavor:
+ label: FSB1_flavor
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_flavor
+ fsb1-Internal2-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ volume_type:
+ label: volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: volume type Gold
+ fsb1-zone:
+ label: FSB1_zone
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_zone
+ fsb_zone:
+ label: FSB1_zone
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_zone
+ security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: String
+ jsa_net_name:
+ label: jsa_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: jsa_net_name
+ default: jsa_log_net_0
+ pcrf_psm_server_name:
+ label: pcrf_psm_server_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_server_name
+ pcm_flavor_name:
+ label: pcm_flavor_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_flavor_name
+ oam_net_id:
+ label: oam_net_id
+ hidden: false
+ immutable: false
+ type: string
+ description: oam_net_id
+ fsb2-Internal1-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ Internal1_forwarding_mode:
+ label: Internal1_forwarding_mode
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_forwarding_mode
+ pcrf_cps_net_name:
+ label: pcrf_cps_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_cps_net_name
+ cps_net_name:
+ label: cps_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: cps_net_name
+ pcrf_security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: String
+ Internal1_external:
+ label: Internal1_external
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_external
+ node_templates:
+ nova_local_type_pcm1:
+ type: org.openecomp.resource.vfc.nodes.heat.pcm
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ user_data: UNSUPPORTED_RESOURCE_server_init
+ nova_local_type_pcm2:
+ type: org.openecomp.resource.vfc.nodes.heat.pcm
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ user_data: UNSUPPORTED_RESOURCE_server_init
+ nova_local_type_pcrf_psm:
+ type: org.openecomp.resource.vfc.nodes.heat.pcrf_psm
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ user_data: UNSUPPORTED_RESOURCE_server_init
+ nova_global_type1:
+ type: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ properties:
+ flavor:
+ get_input: fsb1-flavor
+ availability_zone:
+ get_input: fsb_zone
+ name:
+ get_input: fsb1-name
+ nova_global_type2:
+ type: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ properties:
+ flavor:
+ get_input: fsb1-flavor
+ availability_zone:
+ get_input: fsb_zone
+ metadata:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: '0644'
+ content:
+ str_replace:
+ template:
+ get_artifact:
+ - SELF
+ - nimbus-ethernet
+ params:
+ $dev: eth0
+ $netmask:
+ get_input: cps_net_mask
+ $ip:
+ get_input: cps_net_ip
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth1
+ permissions: '0644'
+ content:
+ str_replace:
+ template:
+ get_artifact:
+ - SELF
+ - nimbus-ethernet-gw
+ params:
+ $dev: eth1
+ $netmask:
+ get_input: oam_net_mask
+ $gateway:
+ get_input: oam_net_gw
+ $ip:
+ get_input: oam_net_ip
+ name:
+ get_input: fsb1-name
+ artifacts:
+ nimbus-ethernet-gw:
+ type: tosca.artifacts.Deployment
+ file: ../Artifacts/nimbus-ethernet-gw
+ nimbus-ethernet:
+ type: tosca.artifacts.Deployment
+ file: ../Artifacts/nimbus-ethernet
+ groups:
+ ep-jsa_net:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/ep-jsa_net.yaml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - nova_local_type_pcm1
+ - nova_local_type_pcm2
+ - nova_local_type_pcrf_psm
+ - nova_global_type1
+ - nova_global_type2 \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/substitution/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/substitution/GlobalSubstitutionTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..06e6fb0b01
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/substitution/GlobalSubstitutionTypesServiceTemplate.yaml
@@ -0,0 +1,235 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: GlobalSubstitutionTypes
+imports:
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.abstract.nodes.heat.nested1:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ cmaui_names:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: String
+ p1:
+ type: string
+ description: UID of OAM network
+ p2:
+ type: string
+ description: UID of OAM network
+ abc_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ abc_names:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: String
+ security_group_name:
+ description: not impotrtant
+ availability_zone_0:
+ type: string
+ description: availabilityzone name
+ abc_image:
+ type: string
+ description: Image for CMAUI server
+ requirements:
+ - link_cmaui_port_2:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - local_storage_server_cmaui:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - local_storage_server_abc:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - link_abc_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_cmaui_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ capabilities:
+ scalable_server_abc:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_cmaui:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_abc_port_1:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_server_abc:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_server_cmaui:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_abc:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_server_cmaui:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_abc:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_cmaui:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_cmaui:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_abc:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_2:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_1:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ org.openecomp.resource.abstract.nodes.heat.nested2:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ cmaui_names:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: String
+ p1:
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ security_group_name:
+ description: not impotrtant
+ availability_zone_0:
+ type: string
+ description: availabilityzone name
+ requirements:
+ - local_storage_server_cmaui:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - link_cmaui_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ capabilities:
+ host_server_cmaui:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_cmaui:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_cmaui:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_cmaui:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_server_cmaui:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_1:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/substitution/MainServiceTemplate.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/substitution/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..6dd557798d
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/substitution/MainServiceTemplate.yaml
@@ -0,0 +1,139 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+topology_template:
+ inputs:
+ shared_network_id1:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ shared_network_id2:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ jsa_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ node_templates:
+ test_net2:
+ type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
+ properties:
+ shared: true
+ network_name:
+ get_input: jsa_net_name
+ test_nested2:
+ type: org.openecomp.resource.abstract.nodes.heat.nested2
+ directives:
+ - substitutable
+ properties:
+ p1:
+ get_input: shared_network_id1
+ service_template_filter:
+ substitute_service_template: nested2ServiceTemplate.yaml
+ requirements:
+ - link_cmaui_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net1
+ relationship: tosca.relationships.network.LinksTo
+ test_nested3:
+ type: org.openecomp.resource.abstract.nodes.heat.nested1
+ directives:
+ - substitutable
+ properties:
+ p1:
+ get_input: shared_network_id1
+ service_template_filter:
+ substitute_service_template: nested1ServiceTemplate.yaml
+ p2:
+ get_input: shared_network_id2
+ requirements:
+ - link_cmaui_port_2:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net2
+ relationship: tosca.relationships.network.LinksTo
+ - link_abc_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net2
+ relationship: tosca.relationships.network.LinksTo
+ - link_cmaui_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net1
+ relationship: tosca.relationships.network.LinksTo
+ test_net1:
+ type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
+ properties:
+ shared: true
+ network_name:
+ get_input: jsa_net_name
+ test_nested1:
+ type: org.openecomp.resource.abstract.nodes.heat.nested1
+ directives:
+ - substitutable
+ properties:
+ p1:
+ get_input: shared_network_id1
+ service_template_filter:
+ substitute_service_template: nested1ServiceTemplate.yaml
+ p2:
+ get_input: shared_network_id2
+ requirements:
+ - link_cmaui_port_2:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net2
+ relationship: tosca.relationships.network.LinksTo
+ - link_abc_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net2
+ relationship: tosca.relationships.network.LinksTo
+ - link_cmaui_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net1
+ relationship: tosca.relationships.network.LinksTo
+ groups:
+ addOn:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/addOn.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - test_nested2
+ - test_nested3
+ - test_nested1
+ main:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/main.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - test_net2
+ - test_net1
+ outputs:
+ shared_network_id1:
+ value: test_net1
+ shared_network_id2:
+ value: test_net2 \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/substitution/nested1ServiceTemplate.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/substitution/nested1ServiceTemplate.yaml
new file mode 100644
index 0000000000..1eb0796736
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/substitution/nested1ServiceTemplate.yaml
@@ -0,0 +1,241 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested1
+imports:
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ nested1:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cmaui_image:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.abc_image:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: String
+ p1:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ p2:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ abc_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ abc_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: String
+ security_group_name:
+ hidden: false
+ immutable: false
+ description: not impotrtant
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ abc_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ node_templates:
+ cmaui_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: p2
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ server_cmaui:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui_image
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ server_abc:
+ type: org.openecomp.resource.vfc.nodes.heat.abc_image
+ properties:
+ flavor:
+ get_input: abc_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: abc_image
+ name:
+ get_input:
+ - abc_names
+ - 0
+ abc_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - abc_oam_ips
+ - 0
+ network:
+ get_input: p2
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_abc
+ relationship: tosca.relationships.network.BindsTo
+ cmaui_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: p1
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ Internal1-net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ network_name:
+ get_input: Internal1_net_name
+ groups:
+ nested1:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested1.yml
+ description: cmaui server template for vMMSC
+ members:
+ - cmaui_port_2
+ - server_cmaui
+ - server_abc
+ - abc_port_1
+ - cmaui_port_1
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested1
+ capabilities:
+ scalable_server_abc:
+ - server_abc
+ - scalable
+ os_server_cmaui:
+ - server_cmaui
+ - os
+ attachment_abc_port_1:
+ - abc_port_1
+ - attachment
+ host_server_abc:
+ - server_abc
+ - host
+ scalable_server_cmaui:
+ - server_cmaui
+ - scalable
+ os_server_abc:
+ - server_abc
+ - os
+ host_server_cmaui:
+ - server_cmaui
+ - host
+ binding_server_abc:
+ - server_abc
+ - binding
+ endpoint_server_cmaui:
+ - server_cmaui
+ - endpoint
+ binding_server_cmaui:
+ - server_cmaui
+ - binding
+ endpoint_server_abc:
+ - server_abc
+ - endpoint
+ attachment_cmaui_port_2:
+ - cmaui_port_2
+ - attachment
+ attachment_cmaui_port_1:
+ - cmaui_port_1
+ - attachment
+ requirements:
+ local_storage_server_cmaui:
+ - server_cmaui
+ - local_storage
+ link_abc_port_1:
+ - abc_port_1
+ - link
+ link_cmaui_port_2:
+ - cmaui_port_2
+ - link
+ link_cmaui_port_1:
+ - cmaui_port_1
+ - link
+ local_storage_server_abc:
+ - server_abc
+ - local_storage \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/substitution/nested2ServiceTemplate.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/substitution/nested2ServiceTemplate.yaml
new file mode 100644
index 0000000000..3545683971
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/substitution/nested2ServiceTemplate.yaml
@@ -0,0 +1,135 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested2
+imports:
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ nested2:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cmaui_image:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: String
+ p1:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ security_group_name:
+ hidden: false
+ immutable: false
+ description: not impotrtant
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ node_templates:
+ server_cmaui:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui_image
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ cmaui_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: p1
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ Internal1-net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ network_name:
+ get_input: Internal1_net_name
+ groups:
+ nested2:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested2.yml
+ description: cmaui server template for vMMSC
+ members:
+ - server_cmaui
+ - cmaui_port_1
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested2
+ capabilities:
+ host_server_cmaui:
+ - server_cmaui
+ - host
+ os_server_cmaui:
+ - server_cmaui
+ - os
+ endpoint_server_cmaui:
+ - server_cmaui
+ - endpoint
+ binding_server_cmaui:
+ - server_cmaui
+ - binding
+ scalable_server_cmaui:
+ - server_cmaui
+ - scalable
+ attachment_cmaui_port_1:
+ - cmaui_port_1
+ - attachment
+ requirements:
+ local_storage_server_cmaui:
+ - server_cmaui
+ - local_storage
+ link_cmaui_port_1:
+ - cmaui_port_1
+ - link \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/AbstractSubstituteGlobalTypesServiceTemplate.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/AbstractSubstituteGlobalTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..8813b0abf6
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/AbstractSubstituteGlobalTypesServiceTemplate.yaml
@@ -0,0 +1,47 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: AbstractSubstituteGlobalTypes
+ template_version: 1.0.0
+description: Abstract Substitute Global Types
+imports:
+ common_definitions:
+ file: CommonGlobalTypesServiceTemplate.yaml
+data_types:
+ org.openecomp.datatypes.heat.substitution.SubstitutionFilter:
+ derived_from: tosca.datatypes.Root
+ description: Substitution Filter
+ properties:
+ substitute_service_template:
+ type: string
+ description: Substitute Service Template
+ required: true
+ status: SUPPORTED
+ index_variable:
+ type: string
+ description: Index variable
+ required: false
+ default: '%index%'
+ status: SUPPORTED
+ constraints:
+ - min_length: 3
+ count:
+ type: string
+ description: Count
+ required: false
+ default: 1
+ status: SUPPORTED
+ mandatory:
+ type: boolean
+ description: Mandatory
+ required: false
+ default: true
+ status: SUPPORTED
+node_types:
+ org.openecomp.resource.abstract.nodes.AbstractSubstitute:
+ derived_from: tosca.nodes.Root
+ properties:
+ service_template_filter:
+ type: org.openecomp.datatypes.heat.substitution.SubstitutionFilter
+ description: Substitution Filter
+ required: true
+ status: SUPPORTED \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/CinderVolumeGlobalTypesServiceTemplate.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/CinderVolumeGlobalTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..3ef94f22e7
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/CinderVolumeGlobalTypesServiceTemplate.yaml
@@ -0,0 +1,176 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: CinderVolumeGlobalTypes
+ template_version: 1.0.0
+description: Cinder Volume TOSCA Global Types
+relationship_types:
+ org.openecomp.relationships.heat.cinder.VolumeAttachesTo:
+ derived_from: tosca.relationships.AttachesTo
+ description: This type represents an attachment relationship for associating volume
+ properties:
+ volume_id:
+ type: string
+ description: The ID of the volume to be attached
+ required: true
+ status: SUPPORTED
+ location:
+ type: string
+ description: The location where the volume is exposed on the instance, mountpoint
+ required: false
+ status: SUPPORTED
+ instance_uuid:
+ type: string
+ description: The ID of the server to which the volume attaches
+ required: true
+ status: SUPPORTED
+ attributes:
+ show:
+ type: string
+ description: Detailed information about resource
+ status: SUPPORTED
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cinder.Volume:
+ derived_from: tosca.nodes.BlockStorage
+ properties:
+ availability_zone:
+ type: string
+ description: The availability zone in which the volume will be created
+ required: false
+ status: SUPPORTED
+ image:
+ type: string
+ description: If specified, the name or ID of the image to create the volume from
+ required: false
+ status: SUPPORTED
+ metadata:
+ type: map
+ description: Key/value pairs to associate with the volume
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ volume_type:
+ type: string
+ description: If specified, the type of volume to use, mapping to a specific backend
+ required: false
+ status: SUPPORTED
+ description:
+ type: string
+ description: A description of the volume
+ required: false
+ status: SUPPORTED
+ device_type:
+ type: string
+ description: Device type
+ required: false
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - cdrom
+ - disk
+ disk_bus:
+ type: string
+ description: 'Bus of the device: hypervisor driver chooses a suitable default
+ if omitted'
+ required: false
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - ide
+ - lame_bus
+ - scsi
+ - usb
+ - virtio
+ backup_id:
+ type: string
+ description: If specified, the backup to create the volume from
+ required: false
+ status: SUPPORTED
+ source_volid:
+ type: string
+ description: If specified, the volume to use as source
+ required: false
+ status: SUPPORTED
+ boot_index:
+ type: integer
+ description: Integer used for ordering the boot disks
+ required: false
+ status: SUPPORTED
+ size:
+ type: scalar-unit.size
+ description: The requested storage size (default unit is MB)
+ required: false
+ status: SUPPORTED
+ constraints:
+ - greater_or_equal: 1 GB
+ read_only:
+ type: boolean
+ description: Enables or disables read-only access mode of volume
+ required: false
+ status: SUPPORTED
+ name:
+ type: string
+ description: A name used to distinguish the volume
+ required: false
+ status: SUPPORTED
+ scheduler_hints:
+ type: map
+ description: Arbitrary key-value pairs specified by the client to help the Cinder scheduler creating a volume
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ swap_size:
+ type: scalar-unit.size
+ description: The size of the swap, in MB
+ required: false
+ status: SUPPORTED
+ delete_on_termination:
+ type: boolean
+ description: Indicate whether the volume should be deleted when the server is terminated
+ required: false
+ status: SUPPORTED
+ multiattach:
+ type: boolean
+ description: Whether allow the volume to be attached more than once
+ required: false
+ status: SUPPORTED
+ attributes:
+ display_description:
+ type: string
+ description: Description of the volume
+ status: SUPPORTED
+ attachments:
+ type: string
+ description: The list of attachments of the volume
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ encrypted:
+ type: boolean
+ description: Boolean indicating if the volume is encrypted or not
+ status: SUPPORTED
+ show:
+ type: string
+ description: Detailed information about resource
+ status: SUPPORTED
+ created_at:
+ type: timestamp
+ description: The timestamp indicating volume creation
+ status: SUPPORTED
+ display_name:
+ type: string
+ description: Name of the volume
+ status: SUPPORTED
+ metadata_values:
+ type: map
+ description: Key/value pairs associated with the volume in raw dict form
+ status: SUPPORTED
+ bootable:
+ type: boolean
+ description: Boolean indicating if the volume can be booted or not
+ status: SUPPORTED
+ status:
+ type: string
+ description: The current status of the volume
+ status: SUPPORTED
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/CommonGlobalTypesServiceTemplate.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/CommonGlobalTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..3388d5a89b
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/CommonGlobalTypesServiceTemplate.yaml
@@ -0,0 +1,213 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: CommonGlobalTypes
+ template_version: 1.0.0
+description: TOSCA Global Types
+imports:
+ NativeTypesServiceTemplate:
+ file: NativeTypesServiceTemplateServiceTemplate.yaml
+data_types:
+ org.openecomp.datatypes.heat.network.AddressPair:
+ derived_from: tosca.datatypes.Root
+ description: MAC/IP address pairs
+ properties:
+ mac_address:
+ type: string
+ description: MAC address
+ required: false
+ status: SUPPORTED
+ ip_address:
+ type: string
+ description: IP address
+ required: false
+ status: SUPPORTED
+ org.openecomp.datatypes.heat.network.subnet.HostRoute:
+ derived_from: tosca.datatypes.Root
+ description: Host route info for the subnet
+ properties:
+ destination:
+ type: string
+ description: The destination for static route
+ required: false
+ status: SUPPORTED
+ nexthop:
+ type: string
+ description: The next hop for the destination
+ required: false
+ status: SUPPORTED
+ org.openecomp.datatypes.heat.network.neutron.Subnet:
+ derived_from: tosca.datatypes.Root
+ description: A subnet represents an IP address block that can be used for assigning IP addresses to virtual instances
+ properties:
+ tenant_id:
+ type: string
+ description: The ID of the tenant who owns the network
+ required: false
+ status: SUPPORTED
+ enable_dhcp:
+ type: boolean
+ description: Set to true if DHCP is enabled and false if DHCP is disabled
+ required: false
+ default: true
+ status: SUPPORTED
+ ipv6_address_mode:
+ type: string
+ description: IPv6 address mode
+ required: false
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - dhcpv6-stateful
+ - dhcpv6-stateless
+ - slaac
+ ipv6_ra_mode:
+ type: string
+ description: IPv6 RA (Router Advertisement) mode
+ required: false
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - dhcpv6-stateful
+ - dhcpv6-stateless
+ - slaac
+ value_specs:
+ type: map
+ description: Extra parameters to include in the request
+ required: false
+ default: {
+ }
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ allocation_pools:
+ type: list
+ description: The start and end addresses for the allocation pools
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.AllocationPool
+ subnetpool:
+ type: string
+ description: The name or ID of the subnet pool
+ required: false
+ status: SUPPORTED
+ dns_nameservers:
+ type: list
+ description: A specified set of DNS name servers to be used
+ required: false
+ default: [
+ ]
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ host_routes:
+ type: list
+ description: The gateway IP address
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.subnet.HostRoute
+ ip_version:
+ type: integer
+ description: The gateway IP address
+ required: false
+ default: 4
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - '4'
+ - '6'
+ name:
+ type: string
+ description: The name of the subnet
+ required: false
+ status: SUPPORTED
+ prefixlen:
+ type: integer
+ description: Prefix length for subnet allocation from subnet pool
+ required: false
+ status: SUPPORTED
+ constraints:
+ - greater_or_equal: 0
+ cidr:
+ type: string
+ description: The CIDR
+ required: false
+ status: SUPPORTED
+ gateway_ip:
+ type: string
+ description: The gateway IP address
+ required: false
+ status: SUPPORTED
+ org.openecomp.datatypes.heat.network.AllocationPool:
+ derived_from: tosca.datatypes.Root
+ description: The start and end addresses for the allocation pool
+ properties:
+ start:
+ type: string
+ description: Start address for the allocation pool
+ required: false
+ status: SUPPORTED
+ end:
+ type: string
+ description: End address for the allocation pool
+ required: false
+ status: SUPPORTED
+relationship_types:
+ org.openecomp.relationships.AttachesTo:
+ derived_from: tosca.relationships.Root
+ description: This type represents an attachment relationship
+group_types:
+ org.openecomp.groups.heat.HeatStack:
+ derived_from: tosca.groups.Root
+ description: Grouped all heat resources which are in the same heat stack
+ properties:
+ heat_file:
+ type: string
+ description: Heat file which associate to this group/heat stack
+ required: true
+ status: SUPPORTED
+ description:
+ type: string
+ description: Heat file description
+ required: false
+ status: SUPPORTED
+policy_types:
+ org.openecomp.policies.placement.Colocate:
+ derived_from: tosca.policy.placement
+ description: Keep associated nodes (groups of nodes) based upon affinity value
+ properties:
+ name:
+ type: string
+ description: The name of the policy
+ required: false
+ status: SUPPORTED
+ affinity:
+ type: string
+ description: affinity
+ required: true
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - host
+ - region
+ - compute
+ org.openecomp.policies.placement.Antilocate:
+ derived_from: tosca.policy.placement
+ description: My placement policy for separation based upon container type value
+ properties:
+ name:
+ type: string
+ description: The name of the policy
+ required: false
+ status: SUPPORTED
+ container_type:
+ type: string
+ description: container type
+ required: false
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - host
+ - region
+ - compute
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/ContrailNetworkRuleGlobalTypeServiceTemplate.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
new file mode 100644
index 0000000000..98317310fa
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
@@ -0,0 +1,117 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: ContrailNetworkRuleGlobalType
+ template_version: 1.0.0
+description: Contrail Network Rule Global Types
+imports:
+ common_definitions:
+ file: CommonGlobalTypesServiceTemplate.yaml
+data_types:
+ org.openecomp.datatypes.heat.contrail.network.rule.PortPairs:
+ derived_from: tosca.datatypes.Root
+ description: source and destination port pairs
+ properties:
+ start_port:
+ type: string
+ description: Start port
+ required: false
+ status: SUPPORTED
+ end_port:
+ type: string
+ description: End port
+ required: false
+ status: SUPPORTED
+ org.openecomp.datatypes.heat.contrail.network.rule.Rule:
+ derived_from: tosca.datatypes.Root
+ description: policy rule
+ properties:
+ src_ports:
+ type: list
+ description: Source ports
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.contrail.network.rule.PortPairs
+ protocol:
+ type: string
+ description: Protocol
+ required: false
+ status: SUPPORTED
+ dst_addresses:
+ type: list
+ description: Destination addresses
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.contrail.network.rule.VirtualNetwork
+ apply_service:
+ type: string
+ description: Service to apply
+ required: false
+ status: SUPPORTED
+ dst_ports:
+ type: list
+ description: Destination ports
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.contrail.network.rule.PortPairs
+ src_addresses:
+ type: list
+ description: Source addresses
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.contrail.network.rule.VirtualNetwork
+ direction:
+ type: string
+ description: Direction
+ required: false
+ status: SUPPORTED
+ org.openecomp.datatypes.heat.contrail.network.rule.RuleList:
+ derived_from: tosca.datatypes.Root
+ description: list of policy rules
+ properties:
+ policy_rule:
+ type: list
+ description: Contrail network rule
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.contrail.network.rule.Rule
+ org.openecomp.datatypes.heat.contrail.network.rule.VirtualNetwork:
+ derived_from: tosca.datatypes.Root
+ description: source and destination addresses
+ properties:
+ virtual_network:
+ type: string
+ description: Virtual network
+ required: false
+ status: SUPPORTED
+node_types:
+ org.openecomp.resource.nodes.heat.network.contrail.NetworkRules:
+ derived_from: tosca.nodes.Root
+ properties:
+ entries:
+ type: org.openecomp.datatypes.heat.contrail.network.rule.RuleList
+ description: A symbolic name for this contrail network rule
+ required: false
+ status: SUPPORTED
+ name:
+ type: string
+ description: A symbolic name for this contrail network rule
+ required: false
+ status: SUPPORTED
+ attributes:
+ fq_name:
+ type: string
+ description: fq_name
+ status: SUPPORTED
+ requirements:
+ - network:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.network.Network
+ relationship: org.openecomp.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
new file mode 100644
index 0000000000..0927e3dd0e
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
@@ -0,0 +1,71 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: ContrailVirtualNetworkGlobalType
+ template_version: 1.0.0
+description: Contrail Virtual Network Global Types
+imports:
+ common_definitions:
+ file: CommonGlobalTypesServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork:
+ derived_from: tosca.nodes.network.Network
+ properties:
+ shared:
+ type: string
+ description: Is virtual network shared
+ required: false
+ status: SUPPORTED
+ forwarding_mode:
+ type: string
+ description: forwarding mode of the virtual network
+ required: false
+ status: SUPPORTED
+ external:
+ type: string
+ description: Is virtual network external
+ required: false
+ status: SUPPORTED
+ flood_unknown_unicast:
+ type: string
+ description: flood L2 packets on network
+ required: false
+ status: SUPPORTED
+ route_targets:
+ type: list
+ description: route targets associated with the virtual network
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ subnets:
+ type: map
+ description: Network related subnets
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.neutron.Subnet
+ attributes:
+ subnets_name:
+ type: list
+ description: Subnets name of this network
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ subnets_show:
+ type: map
+ description: Detailed information about each subnet
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ subnets:
+ type: map
+ description: Network related subnets
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.neutron.Subnet
+ capabilities:
+ attachment:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/GlobalSubstitutionTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..08c47bc646
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/GlobalSubstitutionTypesServiceTemplate.yaml
@@ -0,0 +1,93 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: GlobalSubstitutionTypes
+imports:
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.abstract.nodes.heat.nested:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ cmaui_names:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: String
+ p1:
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ security_group_name:
+ description: not impotrtant
+ availability_zone_0:
+ type: string
+ description: availabilityzone name
+ requirements:
+ - local_storage_server_cmaui:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - link_cmaui_port_0:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ capabilities:
+ host_server_cmaui:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_cmaui:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_cmaui:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_cmaui:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_server_cmaui:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_0:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NativeTypesServiceTemplateServiceTemplate.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NativeTypesServiceTemplateServiceTemplate.yaml
new file mode 100644
index 0000000000..e7dfd49ed9
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NativeTypesServiceTemplateServiceTemplate.yaml
@@ -0,0 +1,194 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: NativeTypesServiceTemplate
+ template_version: 1.0.0
+description: TOSCA Native Node Types
+node_types:
+ tosca.nodes.Compute:
+ derived_from: tosca.nodes.Root
+ attributes:
+ private_address:
+ type: string
+ description: private address
+ status: SUPPORTED
+ public_address:
+ type: string
+ description: public_address
+ status: SUPPORTED
+ networks:
+ type: map
+ description: networks
+ status: SUPPORTED
+ entry_schema:
+ type: tosca.datatypes.network.NetworkInfo
+ ports:
+ type: map
+ description: ports
+ status: SUPPORTED
+ entry_schema:
+ type: tosca.datatypes.network.PortInfo
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ capabilities:
+ scalable:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ tosca.nodes.network.Port:
+ derived_from: tosca.nodes.Root
+ properties:
+ ip_range_end:
+ type: string
+ required: false
+ status: SUPPORTED
+ ip_range_start:
+ type: string
+ required: false
+ status: SUPPORTED
+ ip_address:
+ type: string
+ required: false
+ status: SUPPORTED
+ is_default:
+ type: boolean
+ required: false
+ default: false
+ status: SUPPORTED
+ order:
+ type: integer
+ required: true
+ default: 0
+ status: SUPPORTED
+ constraints:
+ - greater_or_equal: 0
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.BindsTo
+ tosca.nodes.Root:
+ attributes:
+ tosca_name:
+ type: string
+ description: tosca name
+ status: SUPPORTED
+ state:
+ type: string
+ description: state
+ status: SUPPORTED
+ tosca_id:
+ type: string
+ description: tosca id
+ status: SUPPORTED
+ interfaces: {
+ }
+ tosca.nodes.network.Network:
+ derived_from: tosca.nodes.Root
+ properties:
+ physical_network:
+ type: string
+ required: false
+ status: SUPPORTED
+ segmentation_id:
+ type: string
+ required: false
+ status: SUPPORTED
+ network_id:
+ type: string
+ required: false
+ status: SUPPORTED
+ ip_version:
+ type: integer
+ required: false
+ default: 4
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - 4
+ - 6
+ start_ip:
+ type: string
+ required: false
+ status: SUPPORTED
+ network_name:
+ type: string
+ required: false
+ status: SUPPORTED
+ cidr:
+ type: string
+ required: false
+ status: SUPPORTED
+ gateway_ip:
+ type: string
+ required: false
+ status: SUPPORTED
+ network_type:
+ type: string
+ required: false
+ status: SUPPORTED
+ end_ip:
+ type: string
+ required: false
+ status: SUPPORTED
+ capabilities:
+ link:
+ type: tosca.capabilities.network.Linkable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ tosca.nodes.BlockStorage:
+ derived_from: tosca.nodes.Root
+ properties:
+ size:
+ type: scalar-unit.size
+ required: false
+ status: SUPPORTED
+ constraints:
+ - greater_or_equal: 1 MB
+ volume_id:
+ type: string
+ required: false
+ status: SUPPORTED
+ snapshot_id:
+ type: string
+ required: false
+ status: SUPPORTED
+ capabilities:
+ attachment:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronNetGlobalTypesServiceTemplate.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronNetGlobalTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..e80e2727c7
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronNetGlobalTypesServiceTemplate.yaml
@@ -0,0 +1,97 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: NeutronNetGlobalTypes
+ template_version: 1.0.0
+description: Neutron Network TOSCA Global Types
+imports:
+ common_definitions:
+ file: CommonGlobalTypesServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vl.nodes.heat.network.neutron.Net:
+ derived_from: tosca.nodes.network.Network
+ properties:
+ dhcp_agent_ids:
+ type: list
+ description: The IDs of the DHCP agent to schedule the network
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ tenant_id:
+ type: string
+ description: The ID of the tenant which will own the network
+ required: false
+ status: SUPPORTED
+ port_security_enabled:
+ type: boolean
+ description: Flag to enable/disable port security on the network
+ required: false
+ status: SUPPORTED
+ shared:
+ type: boolean
+ description: Whether this network should be shared across all tenants
+ required: false
+ default: false
+ status: SUPPORTED
+ admin_state_up:
+ type: boolean
+ description: A boolean value specifying the administrative status of the network
+ required: false
+ default: true
+ status: SUPPORTED
+ qos_policy:
+ type: string
+ description: The name or ID of QoS policy to attach to this network
+ required: false
+ status: SUPPORTED
+ subnets:
+ type: map
+ description: Network related subnets
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.neutron.Subnet
+ value_specs:
+ type: map
+ description: Extra parameters to include in the request
+ required: false
+ default: {
+ }
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ attributes:
+ qos_policy_id:
+ type: string
+ description: The QoS policy ID attached to this network
+ status: SUPPORTED
+ show:
+ type: string
+ description: Detailed information about resource
+ status: SUPPORTED
+ subnets_name:
+ type: list
+ description: Subnets name of this network
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ subnets:
+ type: map
+ description: Network related subnets
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.neutron.Subnet
+ mtu:
+ type: scalar-unit.size
+ description: The maximum transmission unit size(in bytes) for the network
+ status: SUPPORTED
+ status:
+ type: string
+ description: The status of the network
+ status: SUPPORTED
+ capabilities:
+ attachment:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronPortGlobalTypesServiceTemplate.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronPortGlobalTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..a337d6ed18
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronPortGlobalTypesServiceTemplate.yaml
@@ -0,0 +1,151 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: NeutronPortGlobalTypes
+ template_version: 1.0.0
+description: Neutron Port TOSCA Global Types
+imports:
+ common_definitions:
+ file: CommonGlobalTypesServiceTemplate.yaml
+data_types:
+ org.openecomp.datatypes.heat.neutron.port.FixedIps:
+ derived_from: tosca.datatypes.Root
+ description: subnet/ip_address
+ properties:
+ subnet:
+ type: string
+ description: Subnet in which to allocate the IP address for this port
+ required: false
+ status: SUPPORTED
+ ip_address:
+ type: string
+ description: IP address desired in the subnet for this port
+ required: false
+ status: SUPPORTED
+node_types:
+ org.openecomp.resource.cp.nodes.heat.network.neutron.Port:
+ derived_from: tosca.nodes.network.Port
+ properties:
+ port_security_enabled:
+ type: boolean
+ description: Flag to enable/disable port security on the network
+ required: false
+ status: SUPPORTED
+ device_id:
+ type: string
+ description: Device ID of this port
+ required: false
+ status: SUPPORTED
+ qos_policy:
+ type: string
+ description: The name or ID of QoS policy to attach to this network
+ required: false
+ status: SUPPORTED
+ allowed_address_pairs:
+ type: list
+ description: Additional MAC/IP address pairs allowed to pass through the port
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.AddressPair
+ binding:vnic_type:
+ type: string
+ description: The vnic type to be bound on the neutron port
+ required: false
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - macvtap
+ - direct
+ - normal
+ value_specs:
+ type: map
+ description: Extra parameters to include in the request
+ required: false
+ default: {
+ }
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ device_owner:
+ type: string
+ description: Name of the network owning the port
+ required: false
+ status: SUPPORTED
+ network:
+ type: string
+ description: Network this port belongs to
+ required: false
+ status: SUPPORTED
+ replacement_policy:
+ type: string
+ description: Policy on how to respond to a stack-update for this resource
+ required: false
+ default: AUTO
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - REPLACE_ALWAYS
+ - AUTO
+ security_groups:
+ type: list
+ description: List of security group names or IDs
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ fixed_ips:
+ type: list
+ description: Desired IPs for this port
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.neutron.port.FixedIps
+ mac_address:
+ type: string
+ description: MAC address to give to this port
+ required: false
+ status: SUPPORTED
+ admin_state_up:
+ type: boolean
+ description: A boolean value specifying the administrative status of the network
+ required: false
+ default: true
+ status: SUPPORTED
+ name:
+ type: string
+ description: A symbolic name for this port
+ required: false
+ status: SUPPORTED
+ attributes:
+ tenant_id:
+ type: string
+ description: Tenant owning the port
+ status: SUPPORTED
+ network_id:
+ type: string
+ description: Unique identifier for the network owning the port
+ status: SUPPORTED
+ qos_policy_id:
+ type: string
+ description: The QoS policy ID attached to this network
+ status: SUPPORTED
+ show:
+ type: string
+ description: Detailed information about resource
+ status: SUPPORTED
+ subnets:
+ type: list
+ description: Subnets of this network
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ status:
+ type: string
+ description: The status of the network
+ status: SUPPORTED
+ capabilities:
+ attachment:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronSecurityRulesGlobalTypesServiceTemplate.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..49c9a102c8
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
@@ -0,0 +1,116 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: NeutronSecurityRulesGlobalTypes
+ template_version: 1.0.0
+description: Neutron Security Rules TOSCA Global Types
+imports:
+ common_definitions:
+ file: CommonGlobalTypesServiceTemplate.yaml
+data_types:
+ org.openecomp.datatypes.heat.network.neutron.SecurityRules.Rule:
+ derived_from: tosca.datatypes.Root
+ description: Rules Pairs
+ properties:
+ remote_group_id:
+ type: string
+ description: The remote group ID to be associated with this security group rule
+ required: false
+ status: SUPPORTED
+ protocol:
+ type: string
+ description: The protocol that is matched by the security group rule
+ required: false
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - tcp
+ - udp
+ - icmp
+ ethertype:
+ type: string
+ description: Ethertype of the traffic
+ required: false
+ default: IPv4
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - IPv4
+ - IPv6
+ port_range_max:
+ type: integer
+ description: 'The maximum port number in the range that is matched by the
+ security group rule. '
+ required: false
+ status: SUPPORTED
+ constraints:
+ - in_range:
+ - 0
+ - 65535
+ remote_ip_prefix:
+ type: string
+ description: The remote IP prefix (CIDR) to be associated with this security group rule
+ required: false
+ status: SUPPORTED
+ remote_mode:
+ type: string
+ description: Whether to specify a remote group or a remote IP prefix
+ required: false
+ default: remote_ip_prefix
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - remote_ip_prefix
+ - remote_group_id
+ direction:
+ type: string
+ description: The direction in which the security group rule is applied
+ required: false
+ default: ingress
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - egress
+ - ingress
+ port_range_min:
+ type: integer
+ description: The minimum port number in the range that is matched by the security group rule.
+ required: false
+ status: SUPPORTED
+ constraints:
+ - in_range:
+ - 0
+ - 65535
+node_types:
+ org.openecomp.resource.nodes.heat.network.neutron.SecurityRules:
+ derived_from: tosca.nodes.Root
+ properties:
+ description:
+ type: string
+ description: Description of the security group
+ required: false
+ status: SUPPORTED
+ name:
+ type: string
+ description: A symbolic name for this security group, which is not required to be unique.
+ required: false
+ status: SUPPORTED
+ rules:
+ type: list
+ description: List of security group rules
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.neutron.SecurityRules.Rule
+ attributes:
+ show:
+ type: string
+ description: Detailed information about resource
+ status: SUPPORTED
+ requirements:
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ relationship: org.openecomp.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NovaServerGlobalTypesServiceTemplate.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NovaServerGlobalTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..2253a1e4af
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NovaServerGlobalTypesServiceTemplate.yaml
@@ -0,0 +1,249 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: NovaServerGlobalTypes
+ template_version: 1.0.0
+description: Nova Server TOSCA Global Types
+imports:
+ common_definitions:
+ file: CommonGlobalTypesServiceTemplate.yaml
+data_types:
+ org.openecomp.datatypes.heat.novaServer.network.PortExtraProperties:
+ derived_from: tosca.datatypes.Root
+ description: Nova server network expand properties for port
+ properties:
+ port_security_enabled:
+ type: boolean
+ description: Flag to enable/disable port security on the port
+ required: false
+ status: SUPPORTED
+ mac_address:
+ type: string
+ description: MAC address to give to this port
+ required: false
+ status: SUPPORTED
+ admin_state_up:
+ type: boolean
+ description: The administrative state of this port
+ required: false
+ default: true
+ status: SUPPORTED
+ qos_policy:
+ type: string
+ description: The name or ID of QoS policy to attach to this port
+ required: false
+ status: SUPPORTED
+ allowed_address_pairs:
+ type: list
+ description: Additional MAC/IP address pairs allowed to pass through the port
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.AddressPair
+ binding:vnic_type:
+ type: string
+ description: The vnic type to be bound on the neutron port
+ required: false
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - macvtap
+ - direct
+ - normal
+ value_specs:
+ type: map
+ description: Extra parameters to include in the request
+ required: false
+ default: {
+ }
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ org.openecomp.datatypes.heat.novaServer.network.AddressInfo:
+ derived_from: tosca.datatypes.network.NetworkInfo
+ description: Network addresses with corresponding port id
+ properties:
+ port_id:
+ type: string
+ description: Port id
+ required: false
+ status: SUPPORTED
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.nova.Server:
+ derived_from: tosca.nodes.Compute
+ properties:
+ admin_pass:
+ type: string
+ description: The administrator password for the server
+ required: false
+ status: SUPPORTED
+ availability_zone:
+ type: string
+ description: Availability zone to create servers in
+ required: false
+ status: SUPPORTED
+ image:
+ type: string
+ description: The ID or name of the image to boot with
+ required: false
+ status: SUPPORTED
+ image_update_policy:
+ type: string
+ description: Policy on how to apply an image-id update
+ required: false
+ default: REBUILD
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - REBUILD_PRESERVE_EPHEMERAL
+ - REPLACE
+ - REBUILD
+ metadata:
+ type: map
+ description: Arbitrary key/value metadata to store for this server
+ required: false
+ status: SUPPORTED
+ constraints:
+ - max_length: 255
+ entry_schema:
+ type: string
+ constraints:
+ - max_length: 255
+ user_data_update_policy:
+ type: string
+ description: Policy on how to apply a user_data update
+ required: false
+ default: REPLACE
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - REPLACE
+ - IGNORE
+ flavor_update_policy:
+ type: string
+ description: Policy on how to apply a flavor update
+ required: false
+ default: RESIZE
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - RESIZE
+ - REPLACE
+ user_data:
+ type: string
+ description: User data script to be executed by cloud-init
+ required: false
+ default: ''
+ status: SUPPORTED
+ flavor:
+ type: string
+ description: The ID or name of the flavor to boot onto
+ required: true
+ status: SUPPORTED
+ key_name:
+ type: string
+ description: Name of keypair to inject into the server
+ required: false
+ status: SUPPORTED
+ reservation_id:
+ type: string
+ description: A UUID for the set of servers being requested
+ required: false
+ status: SUPPORTED
+ security_groups:
+ type: list
+ description: List of security group names or IDs
+ required: false
+ default: [
+ ]
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ config_drive:
+ type: boolean
+ description: enable config drive on the server
+ required: false
+ status: SUPPORTED
+ personality:
+ type: map
+ description: A map of files to create/overwrite on the server upon boot
+ required: false
+ default: {
+ }
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ software_config_transport:
+ type: string
+ description: How the server should receive the metadata required for software configuration
+ required: false
+ default: POLL_SERVER_CFN
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - POLL_SERVER_CFN
+ - POLL_SERVER_HEAT
+ - POLL_TEMP_URL
+ - ZAQAR_MESSAGE
+ user_data_format:
+ type: string
+ description: How the user_data should be formatted for the server
+ required: false
+ default: HEAT_CFNTOOLS
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - SOFTWARE_CONFIG
+ - RAW
+ - HEAT_CFNTOOLS
+ diskConfig:
+ type: string
+ description: Control how the disk is partitioned when the server is created
+ required: false
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - AUTO
+ - MANUAL
+ name:
+ type: string
+ description: Server name
+ required: false
+ status: SUPPORTED
+ scheduler_hints:
+ type: map
+ description: Arbitrary key-value pairs specified by the client to help boot a server
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ attributes:
+ accessIPv4:
+ type: string
+ description: The manually assigned alternative public IPv4 address of the server
+ status: SUPPORTED
+ addresses:
+ type: map
+ description: A dict of all network addresses with corresponding port_id
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.novaServer.network.AddressInfo
+ accessIPv6:
+ type: string
+ description: The manually assigned alternative public IPv6 address of the server
+ status: SUPPORTED
+ instance_name:
+ type: string
+ description: AWS compatible instance name
+ status: SUPPORTED
+ name:
+ type: string
+ description: Name of the server
+ status: SUPPORTED
+ show:
+ type: string
+ description: Detailed information about resource
+ status: SUPPORTED
+ console_urls:
+ type: string
+ description: URLs of servers consoles
+ status: SUPPORTED \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/fullComposition/MANIFEST.json b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/fullComposition/MANIFEST.json
new file mode 100644
index 0000000000..40c2b4c296
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/fullComposition/MANIFEST.json
@@ -0,0 +1,17 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-mog-0108-bs1271.yml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-mog-0108-bs1271.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ }
+ ]
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/fullComposition/hot-mog-0108-bs1271.env b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/fullComposition/hot-mog-0108-bs1271.env
new file mode 100644
index 0000000000..407bc8db30
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/fullComposition/hot-mog-0108-bs1271.env
@@ -0,0 +1,60 @@
+parameters:
+ pd_server_names: ZRDM1MOGX01MPD001,ZRDM1MOGX01MPD002
+ pd_image_name: MOG_BASE_8.0
+ pd_flavor_name: m3.xlarge
+ oam_server_names: ZRDM1MOGX01OAM001,ZRDM1MOGX01OAM002
+ oam_image_name: MOG_BASE_8.0
+ oam_flavor_name: m3.xlarge
+ sm_server_names: ZRDM1MOGX01MSM001,ZRDM1MOGX01MSM002
+ sm_image_name: MOG_BASE_8.0
+ sm_flavor_name: m2.xlarge4
+ ps_server_names: ZRDM1MOGX01MPS001,ZRDM1MOGX01MPS002,ZRDM1MOGX01MPS003,ZRDM1MOGX01MPS004
+ ps_image_name: MOG_BASE_8.0
+ ps_flavor_name: m3.xlarge
+ cm_server_names: ZRDM1MOGX01MCM001
+ cm_image_name: MOG_BASE_8.0
+ cm_flavor_name: m3.xlarge
+ availabilityzone_name: nova
+ oam_net_name: oam_protected_net_0
+ oam_net_ips: 107.250.172.213,107.250.172.214,107.250.172.215,107.250.172.216,107.250.172.217
+ #internet_net_name: dmz_protected_net_0
+ #internet_net_ips: 107.239.53.4,107.239.53.5
+ # internet_net_floating_ip: 107.239.53.6
+ sl_net_name: exn_protected_net_0
+ sl_net_ips: 107.239.45.4,107.239.45.5
+ sl_net_floating_ip: 107.239.45.6
+ repl_net_name: cor_direct_net_0
+ repl_net_ips: 107.239.33.57,107.239.33.58
+ rx_net_name: cor_direct_net_1
+ rx_net_ips: 107.239.34.3,107.239.34.4
+ rx_net_floating_ip: 107.239.34.5
+ ran_net_name: gn_direct_net_0
+ ran_net_ips: 107.239.36.3,107.239.36.4
+ ran_net_floating_ip: 107.239.36.5
+ dummy_net_name_0: mog_dummy_0
+ dummy_net_start_0: 169.254.1.4
+ dummy_net_end_0: 169.254.1.254
+ dummy_net_cidr_0: 169.254.1.0/24
+ dummy_net_netmask_0: 255.255.255.0
+ dummy_net_name_1: mog_dummy_1
+ dummy_net_start_1: 169.254.2.4
+ dummy_net_end_1: 169.254.2.254
+ dummy_net_cidr_1: 169.254.2.0/24
+ dummy_net_netmask_1: 255.255.255.0
+ csb_net_name: int_mog_csb_net
+ csb_net_ips: 172.26.0.10,172.26.0.11,172.26.0.12,172.26.0.13,172.26.0.14,172.26.0.15,172.26.0.16,172.26.0.17,172.26.0.18,172.26.0.19,172.26.0.20
+ csb_net_start: 172.26.0.1
+ csb_net_end: 172.26.0.254
+ csb_net_cidr: 172.26.0.0/24
+ csb_net_netmask: 255.255.255.0
+ security_group_name: mog_security_group
+ mog_swift_container: http://10.147.38.210:8080/v1/AUTH_8e501b8121f34a6eaaf526d3305985cc/mogtestcontainer
+ mog_script_dir: /root
+ mog_script_name: http://10.147.38.210:8080/v1/AUTH_8e501b8121f34a6eaaf526d3305985cc/mogtestcontainer/mog-cloudinit.sh
+ mog_parameter_name: http://10.147.38.210:8080/v1/AUTH_8e501b8121f34a6eaaf526d3305985cc/mogtestcontainer
+ cluster-manager-vol-1: 43ccf5ba-2d50-427b-a38f-e8c7d8670eee
+ session-manager-vol-1: 49201898-333d-4c88-b58d-cf573b091633
+ session-manager-vol-2: 4c35b5f1-ce99-4220-a6e2-cda6e2d713a0
+ oam-vol-1: 0a7fcd9e-2624-401d-ac21-b0191f85ec77
+ oam-vol-2: 6d169cb6-6ddc-41dc-920c-2839898a2924
+ cluster-manager-vol-2: 6f92e211-2d61-487d-8f84-d2d00cea3698
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/fullComposition/hot-mog-0108-bs1271.yml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/fullComposition/hot-mog-0108-bs1271.yml
new file mode 100644
index 0000000000..85ca654ce1
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/fullComposition/hot-mog-0108-bs1271.yml
@@ -0,0 +1,733 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates MOG stack
+
+parameters:
+ pd_server_names:
+ type: comma_delimited_list
+ label: PD server names
+ description: name of the PD instance
+ pd_image_name:
+ type: string
+ label: image name
+ description: PD image name
+ pd_flavor_name:
+ type: string
+ label: PD flavor name
+ description: flavor name of PD instance
+ oam_server_names:
+ type: comma_delimited_list
+ label: OAM server names
+ description: name of the OAM instance
+ oam_image_name:
+ type: string
+ label: image name
+ description: OAM image name
+ oam_flavor_name:
+ type: string
+ label: OAM flavor name
+ description: flavor name of OAM instance
+ sm_server_names:
+ type: comma_delimited_list
+ label: SM server names
+ description: name of the SM instance
+ sm_image_name:
+ type: string
+ label: image name
+ description: SM image name
+ sm_flavor_name:
+ type: string
+ label: SM flavor name
+ description: flavor name of SM instance
+ ps_server_names:
+ type: comma_delimited_list
+ label: PS server names
+ description: name of the PS instance
+ ps_image_name:
+ type: string
+ label: PS image name
+ description: PS image name
+ ps_flavor_name:
+ type: string
+ label: PS flavor name
+ description: flavor name of PS instance
+ cm_server_names:
+ type: comma_delimited_list
+ label: CM server names
+ description: name of the CM instance
+ cm_image_name:
+ type: string
+ label: image name
+ description: CM image name
+ cm_flavor_name:
+ type: string
+ label: CM flavor name
+ description: flavor name of CM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ oam_net_name:
+ type: string
+ label: oam network name
+ description: name of the oam network
+ oam_net_ips:
+ type: comma_delimited_list
+ label: internet network ips
+ description: ip of the OAM network
+ # internet_net_name:
+ # type: string
+ # label: internet network name
+ # description: id of the internet network
+ # internet_net_ips:
+ # type: comma_delimited_list
+ # label: internet network ips
+ # description: ip of the internet network
+ # internet_net_floating_ip:
+ # type: string
+ # label: mog internet virtual ip
+ # description: mog internet virtual ip
+ sl_net_name:
+ type: string
+ label: silver lining network name
+ description: id of the sl network
+ sl_net_ips:
+ type: comma_delimited_list
+ label: silver lining network ips
+ description: ips of the sl network
+ sl_net_floating_ip:
+ type: string
+ label: mog sl net virtual ip
+ description: mog sl net virtual ip
+ repl_net_name:
+ type: string
+ label: Replication network name
+ description: name of the replication network
+ repl_net_ips:
+ type: comma_delimited_list
+ label: repl network ips
+ description: ips of repl network
+ rx_net_name:
+ type: string
+ label: Rx network name
+ description: Rx network name
+ rx_net_ips:
+ type: comma_delimited_list
+ label: Rx network ips
+ description: Rx network ips
+ rx_net_floating_ip:
+ type: string
+ label: mog rx net virtual ip
+ description: mog rx net virtual ip
+ ran_net_name:
+ type: string
+ label: RAN network name
+ description: RAN network name
+ ran_net_ips:
+ type: comma_delimited_list
+ label: RAN network ips
+ description: RAN network ip
+ ran_net_floating_ip:
+ type: string
+ label: mog ran net virtual ip
+ description: mog ran net virtual ip
+ csb_net_name:
+ type: string
+ label: csb internal network name
+ description: csb internal network name
+ csb_net_start:
+ type: string
+ label: csb internal start
+ description: csb internal start
+ csb_net_end:
+ type: string
+ label: csb internal end
+ description: csb internal end
+ csb_net_cidr:
+ type: string
+ label: csb ineternal cidr
+ description: csb internal cidr
+ csb_net_netmask:
+ type: string
+ description: CSB internal network subnet mask
+ csb_net_ips:
+ type: comma_delimited_list
+ description: mog_csb_net IP addresses
+ dummy_net_name_0:
+ type: string
+ label: csb internal network name
+ description: csb internal network name
+ dummy_net_start_0:
+ type: string
+ label: csb internal start
+ description: csb internal start
+ dummy_net_end_0:
+ type: string
+ label: csb internal end
+ description: csb internal end
+ dummy_net_cidr_0:
+ type: string
+ label: csb ineternal cidr
+ description: csb internal cidr
+ dummy_net_netmask_0:
+ type: string
+ description: CSB internal network subnet mask
+ dummy_net_name_1:
+ type: string
+ label: csb internal network name
+ description: csb internal network name
+ dummy_net_start_1:
+ type: string
+ label: csb internal start
+ description: csb internal start
+ dummy_net_end_1:
+ type: string
+ label: csb internal end
+ description: csb internal end
+ dummy_net_cidr_1:
+ type: string
+ label: csb ineternal cidr
+ description: csb internal cidr
+ dummy_net_netmask_1:
+ type: string
+ description: CSB internal network subnet mask
+
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ cluster-manager-vol-1:
+ type: string
+ label: mog-cm-vol-1
+ description: Cluster Manager volume 1
+ session-manager-vol-1:
+ type: string
+ label: mog-sm-vol-1
+ description: Session Manager volume 1
+ session-manager-vol-2:
+ type: string
+ label: mog-sm-vol-2
+ description: Session Manager volume 2
+ oam-vol-1:
+ type: string
+ label: mog-oam-vol-1
+ description: OAM volume 1
+ oam-vol-2:
+ type: string
+ label: mog-oam-vol-2
+ description: OAM volume 2
+ mog_swift_container:
+ type: string
+ label: mog Config URL
+ description: Config URL
+ mog_script_dir:
+ type: string
+ label: mog Config script directory
+ description: Config script directory
+ mog_script_name:
+ type: string
+ label: mog Config script name
+ description: Config script name
+ mog_parameter_name:
+ type: string
+ label: mog script parameter name
+ description: Config script parameter csv file name
+ cluster-manager-vol-2:
+ type: string
+ label: mog-cm-vol-2
+ description: Cluster Manager volume 2 with ISO image
+
+resources:
+ mog_security_group:
+ type: OS::Neutron::SecurityGroup
+ properties:
+ description: mog security group
+ name: {get_param: security_group_name}
+ rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}
+ ]
+
+ csb_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: csb_net_name}
+
+ csb_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: csb_net_name}
+ network_id: { get_resource: csb_net }
+ cidr: { get_param: csb_net_cidr }
+ allocation_pools: [{"start": {get_param: csb_net_start}, "end": {get_param: csb_net_end}}]
+ enable_dhcp: true
+
+ dummy_net_0:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: dummy_net_name_0}
+
+ dummy_ip_subnet_0:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: dummy_net_name_0}
+ network_id: { get_resource: dummy_net_0 }
+ cidr: { get_param: dummy_net_cidr_0 }
+ allocation_pools: [{"start": {get_param: dummy_net_start_0}, "end": {get_param: dummy_net_end_0}}]
+ enable_dhcp: true
+
+ dummy_net_1:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: dummy_net_name_1}
+
+ dummy_ip_subnet_1:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: dummy_net_name_1}
+ network_id: { get_resource: dummy_net_1 }
+ cidr: { get_param: dummy_net_cidr_1 }
+ allocation_pools: [{"start": {get_param: dummy_net_start_1}, "end": {get_param: dummy_net_end_1}}]
+ enable_dhcp: true
+
+
+ mogconfig:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ template: |
+ #!/bin/bash
+ wget -P script_dir swift_container/script_name
+ wget -P script_dir swift_container/parameter_name
+ chmod 755 script_dir/script_name
+ script_dir/script_name
+ params:
+ swift_container: {get_param: mog_swift_container}
+ script_dir: {get_param: mog_script_dir}
+ script_name: {get_param: mog_script_name}
+ #parameter_name: {get_param: mog_parameter_name}
+
+
+ servergroup_mog01:
+ type: OS::Nova::ServerGroup
+ properties:
+ policies:
+ - anti-affinity
+ server_pd_01:
+ type: OS::Nova::Server
+ properties:
+# config_drive: "True"
+ name: {get_param: [pd_server_names, 0]}
+ image: {get_param: pd_image_name}
+ flavor: {get_param: pd_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+ networks:
+ - port: {get_resource: pd01_port_0}
+ - port: {get_resource: pd01_port_1}
+ - port: {get_resource: pd01_port_2}
+ - port: {get_resource: pd01_port_3}
+ - port: {get_resource: pd01_port_4}
+ - port: {get_resource: pd01_port_5}
+ - port: {get_resource: pd01_port_6}
+ # - port: {get_resource: pd01_port_7}
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog01}}
+ user_data_format: RAW
+
+
+ pd01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ security_groups: [{get_resource: mog_security_group}]
+ pd01_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [oam_net_ips, 0]}}]
+ security_groups: [{get_resource: mog_security_group}]
+ pd01_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: dummy_net_0}
+ security_groups: [{get_resource: mog_security_group}]
+ pd01_port_3:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: rx_net_name}
+ fixed_ips: [{"ip_address": {get_param: [rx_net_ips, 0]}}]
+ allowed_address_pairs: [{"ip_address": {get_param: rx_net_floating_ip} }]
+ security_groups: [{get_resource: mog_security_group}]
+ pd01_port_4:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: dummy_net_1}
+ security_groups: [{get_resource: mog_security_group}]
+ pd01_port_5:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: ran_net_name}
+ fixed_ips: [{"ip_address": {get_param: [ran_net_ips, 0]}}]
+ allowed_address_pairs: [{"ip_address": {get_param: ran_net_floating_ip} }]
+ security_groups: [{get_resource: mog_security_group}]
+
+ pd01_port_6:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: sl_net_name}
+ fixed_ips: [{"ip_address": {get_param: [sl_net_ips, 0]}}]
+ allowed_address_pairs: [{"ip_address": {get_param: sl_net_floating_ip}}]
+ security_groups: [{get_resource: mog_security_group}]
+
+ # pd01_port_7:
+ #j type: OS::Neutron::Port
+ # properties:
+ # network: {get_param: internet_net_name}
+ # fixed_ips: [{"ip_address": {get_param: [internet_net_ips, 0]}}]
+ # allowed_address_pairs: [{"ip_address": {get_param: internet_net_floating_ip} }]
+ # security_groups: [{get_resource: mog_security_group}]
+
+ server_pd_02:
+ type: OS::Nova::Server
+ properties:
+# config_drive: "True"
+ name: {get_param: [pd_server_names, 1]}
+ image: {get_param: pd_image_name}
+ flavor: {get_param: pd_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+ networks:
+ - port: {get_resource: pd02_port_0}
+ - port: {get_resource: pd02_port_1}
+ - port: {get_resource: pd02_port_2}
+ - port: {get_resource: pd02_port_3}
+ - port: {get_resource: pd02_port_4}
+ - port: {get_resource: pd02_port_5}
+ - port: {get_resource: pd02_port_6}
+ # - port: {get_resource: pd02_port_7}
+
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog01}}
+ user_data_format: RAW
+
+ pd02_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ security_groups: [{get_resource: mog_security_group}]
+
+ pd02_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [oam_net_ips, 1]}}]
+ security_groups: [{get_resource: mog_security_group}]
+
+ pd02_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: dummy_net_0}
+ security_groups: [{get_resource: mog_security_group}]
+
+ pd02_port_3:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: rx_net_name}
+ fixed_ips: [{"ip_address": {get_param: [rx_net_ips, 1]}}]
+ allowed_address_pairs: [{"ip_address": {get_param: rx_net_floating_ip} }]
+ security_groups: [{get_resource: mog_security_group}]
+
+ pd02_port_4:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: dummy_net_1}
+ security_groups: [{get_resource: mog_security_group}]
+
+ pd02_port_5:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: ran_net_name}
+ fixed_ips: [{"ip_address": {get_param: [ran_net_ips, 1]}}]
+ allowed_address_pairs: [{"ip_address": {get_param: ran_net_floating_ip} }]
+ security_groups: [{get_resource: mog_security_group}]
+
+ pd02_port_6:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: sl_net_name}
+ fixed_ips: [{"ip_address": {get_param: [sl_net_ips, 1]}}]
+ allowed_address_pairs: [{"ip_address": {get_param: sl_net_floating_ip}}]
+ security_groups: [{get_resource: mog_security_group}]
+
+ # pd02_port_7:
+ # type: OS::Neutron::Port
+ # properties:
+ # network: {get_param: internet_net_name}
+ # fixed_ips: [{"ip_address": {get_param: [internet_net_ips, 1]}}]
+ # allowed_address_pairs: [{"ip_address": {get_param: internet_net_floating_ip} }]
+ # security_groups: [{get_resource: mog_security_group}]
+
+ servergroup_mog02:
+ type: OS::Nova::ServerGroup
+ properties:
+ policies:
+ - anti-affinity
+ server_oam01:
+ type: OS::Nova::Server
+ properties:
+# config_drive: "True"
+ name: {get_param: [oam_server_names, 0]}
+ image: {get_param: oam_image_name}
+ flavor: {get_param: oam_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+ networks:
+ - port: {get_resource: oam01_port_0}
+ - port: {get_resource: oam01_port_1}
+# block_device_mapping:
+# - device_name: vdd
+# volume_id: { get_param: oam-vol-1 }
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog02}}
+ user_data_format: RAW
+
+ oam01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ security_groups: [{get_resource: mog_security_group}]
+
+ oam01_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [oam_net_ips, 2]}}]
+ security_groups: [{get_resource: mog_security_group}]
+
+
+ server_oam02:
+ type: OS::Nova::Server
+ properties:
+# config_drive: "True"
+ name: {get_param: [oam_server_names, 1]}
+ image: {get_param: oam_image_name}
+ flavor: {get_param: oam_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+ networks:
+ - port: {get_resource: oam02_port_0}
+ - port: {get_resource: oam02_port_1}
+# block_device_mapping:
+# - device_name: vdd
+# volume_id: { get_param: oam-vol-2 }
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog02}}
+ user_data_format: RAW
+
+ oam02_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ security_groups: [{get_resource: mog_security_group}]
+
+ oam02_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [oam_net_ips, 3]}}]
+ security_groups: [{get_resource: mog_security_group}]
+
+
+ server_sm01:
+ type: OS::Nova::Server
+ properties:
+# config_drive: "True"
+ name: {get_param: [sm_server_names, 0]}
+ image: {get_param: sm_image_name}
+ flavor: {get_param: sm_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+ networks:
+ - port: {get_resource: sm01_port_0}
+ - port: {get_resource: sm01_port_1}
+# block_device_mapping:
+# - device_name: vdd
+# volume_id: { get_param: session-manager-vol-1 }
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog02}}
+ user_data_format: RAW
+
+ sm01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ security_groups: [{get_resource: mog_security_group}]
+
+ sm01_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: dummy_net_0}
+ security_groups: [{get_resource: mog_security_group}]
+
+ sm01_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: repl_net_name}
+ fixed_ips: [{"ip_address": {get_param: [repl_net_ips, 0]}}]
+ security_groups: [{get_resource: mog_security_group}]
+
+ server_sm02:
+ type: OS::Nova::Server
+ properties:
+# config_drive: "True"
+ name: {get_param: [sm_server_names, 1]}
+ image: {get_param: sm_image_name}
+ flavor: {get_param: sm_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+# block_device_mapping:
+# - device_name: vdd
+# volume_id: { get_param: session-manager-vol-2 }
+ networks:
+ - port: {get_resource: sm02_port_0}
+ - port: {get_resource: sm02_port_1}
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog02}}
+ user_data_format: RAW
+
+ sm02_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ security_groups: [{get_resource: mog_security_group}]
+
+ sm02_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: dummy_net_0}
+ security_groups: [{get_resource: mog_security_group}]
+
+ sm02_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: repl_net_name}
+ fixed_ips: [{"ip_address": {get_param: [repl_net_ips, 1]}}]
+ security_groups: [{get_resource: mog_security_group}]
+
+ servergroup_mog03:
+ type: OS::Nova::ServerGroup
+ properties:
+ policies:
+ - anti-affinity
+ server_ps01:
+ type: OS::Nova::Server
+ properties:
+# config_drive: "True"
+ name: {get_param: [ps_server_names, 0]}
+ image: {get_param: ps_image_name}
+ flavor: {get_param: ps_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+ networks:
+ - port: {get_resource: ps01_port_0}
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog03}}
+ user_data_format: RAW
+
+ ps01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ security_groups: [{get_resource: mog_security_group}]
+
+ server_ps02:
+ type: OS::Nova::Server
+ properties:
+# config_drive: "True"
+ name: {get_param: [ps_server_names, 1]}
+ image: {get_param: ps_image_name}
+ flavor: {get_param: ps_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+ networks:
+ - port: {get_resource: ps02_port_0}
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog03}}
+ user_data_format: RAW
+
+ ps02_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ security_groups: [{get_resource: mog_security_group}]
+
+ server_ps03:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: [ps_server_names, 2]}
+ image: {get_param: ps_image_name}
+ flavor: {get_param: ps_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+ networks:
+ - port: {get_resource: ps03_port_0}
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog03}}
+ user_data_format: RAW
+
+ ps03_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ security_groups: [{get_resource: mog_security_group}]
+
+ server_ps04:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: [ps_server_names, 3]}
+ image: {get_param: ps_image_name}
+ flavor: {get_param: ps_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+ networks:
+ - port: {get_resource: ps04_port_0}
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog03}}
+ user_data_format: RAW
+
+ ps04_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ security_groups: [{get_resource: mog_security_group}]
+
+ server_cm01:
+ type: OS::Nova::Server
+ properties:
+# config_drive: "True"
+ name: {get_param: [cm_server_names, 0]}
+ image: {get_param: cm_image_name}
+ flavor: {get_param: cm_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+ networks:
+ - port: {get_resource: cm01_port_0}
+ - port: {get_resource: cm01_port_1}
+# block_device_mapping:
+# - device_name: vdd
+# volume_id: { get_param: cluster-manager-vol-2 }
+# - device_name: vde
+# volume_id: { get_param: cluster-manager-vol-1 }
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog03}}
+ user_data_format: RAW
+
+ cm01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ fixed_ips: [{"ip_address": {get_param: [csb_net_ips, 10]}}]
+ security_groups: [{get_resource: mog_security_group}]
+
+ cm01_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [oam_net_ips, 4]}}]
+ security_groups: [{get_resource: mog_security_group}]
+
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/MANIFEST.json b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/MANIFEST.json
new file mode 100644
index 0000000000..6b48646d70
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/MANIFEST.json
@@ -0,0 +1,42 @@
+{
+ "name": "multiple_not_nested",
+ "description": "multiple heat files in zip, no nesting",
+ "version": "2013-05-23",
+ "data": [{
+ "file": "cmaui.yml",
+ "type": "HEAT",
+ "data": [{
+ "file": "cmaui.env",
+ "type": "HEAT_ENV"
+ }]
+ },
+ {
+ "file": "eca_oam.yaml",
+ "type": "AAA",
+ "data": [{
+ "file": "eca_oam.env",
+ "type": "AAA"
+ }]
+ },
+ {
+ "file": "eca_oam_2.yaml",
+ "type": "AAA"
+ },
+ {
+ "file": "MMSC_Capacity_Line.yml",
+ "type": "HEAT",
+ "data": [{
+ "file": "MMSC_Capacity_Line_1.env",
+ "type": "HEAT_ENV"
+ }]
+ },
+ {
+ "file": "SG_ECA_MGMT.yaml",
+ "type": "HEAT",
+ "data": [{
+ "file": "sg_eca_mgmt.env",
+ "type": "HEAT_ENV"
+ }]
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/MMSC_Capacity_Line.yml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/MMSC_Capacity_Line.yml
new file mode 100644
index 0000000000..3b0bc56e09
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/MMSC_Capacity_Line.yml
@@ -0,0 +1,3223 @@
+heat_template_version: 2013-05-23
+
+description: >
+ HOT template that creates internal networks, load balancers and servers for vMMSC capacity Line 1.
+ #11/23: updated the network definition to meet the juniper best practices way of defining the gateway, DHCP enable for internal networks (L457-L547)
+
+parameters:
+ vnf_id:
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_the_MMSC_id
+ oam_net_name:
+ type: string
+ label: UID of OAM network
+ description: UID of OAM network
+ oam_network_netmask:
+ type: string
+ label: oam network netmask
+ description: oam network gateway
+ oam_network_gateway:
+ type: string
+ label: oam network gateway
+ description: oam network gateway
+ oam_network_route_1:
+ type: string
+ label: oam network route 1
+ description: oam network route 1
+ oam_network_route_2:
+ type: string
+ label: oam network route 2
+ description: oam network route 2
+ external_dns:
+ type: string
+ label: dns server
+ description: dns server for MMSC
+ external_ntp:
+ type: string
+ label: ntp server
+ description: ntp server for MMSC
+ lb_oam_ips:
+ type: comma_delimited_list
+ label: management network ips for mmsc lb
+ description: the ips of the management network for mmsc lb
+ dmz_protected_net_name:
+ type: string
+ label: UID of dmz_protected network
+ description: UID of dmz_protected network
+ lb_dmz_protected_ips:
+ type: comma_delimited_list
+ label: dmz protected network local ips for lb VM
+ description: local ips of the dmz protected network for lb VM
+ cor_direct_net_name:
+ type: string
+ label: cor direct net UID
+ description: cor direct net
+ lb_cor_direct_ips:
+ type: comma_delimited_list
+ label: cor direct network local ips for lb VM
+ description: local ips of cor direct network for lb VM
+ mms_traffic_net_name:
+ type: string
+ label: Name of MMS traffic network
+ description: Name of MMS traffic network
+ mms_traffic_net_cidr:
+ type: string
+ label: MMS traffic network address (CIDR notation)
+ description: MMS traffic network address (CIDR notation)
+ mms_traffic_netmask:
+ type: string
+ label: MMS traffic network subnet mask
+ description: MMS traffic network subnet mask
+ mms_traffic_net_gateway:
+ type: string
+ label: MMS traffic network gateway address
+ description: MMS traffic network gateway address
+ mms_traffic_start:
+ type: string
+ label: mmsc traffic start IP
+ description: mmsc traffic start IP
+ mms_traffic_end:
+ type: string
+ label: mmsc traffic end IP
+ description: mmsc traffic end IP
+ mms_traffic_net_cidr:
+ type: string
+ label: mmsc traffic cidr
+ description: mmsc traffic cidr
+ mms_traffic_net_local_ip1:
+ type: string
+ label: mmsc traffic network local ip1
+ description: the local ip1 of the mmsc traffic network
+ mms_traffic_net_local_ip2:
+ type: string
+ label: mmsc traffic network local ip2
+ description: the local ip2 of the mmsc traffic network
+ mms_traffic_net_floating_ip:
+ type: string
+ label: mmsc traffic floating ip
+ description: mmsc traffic floating ip
+ nems_internal_name:
+ type: string
+ label: nems internal network name
+ description: nems internal network name
+ nems_internal_start:
+ type: string
+ label: nems internal start
+ description: nems internal start
+ nems_internal_end:
+ type: string
+ label: nems internal end
+ description: nems internal end
+ nems_internal_cidr:
+ type: string
+ label: nems ineternal cidr
+ description: nems internal cidr
+ nems_internal_netmask:
+ type: string
+ label: NEMS internal network subnet mask
+ description: NEMS internal network subnet mask
+ nems_internal_gateway:
+ type: string
+ label: nems internal gw
+ description: nems internal gw
+ nems_traffic_name:
+ type: string
+ label: nems traffic name
+ description: nems traffic name
+ nems_traffic_start:
+ type: string
+ label: nems traffic start
+ description: nems traffic start
+ nems_traffic_end:
+ type: string
+ label: nems traffic end
+ description: nems traffic end
+ nems_traffic_cidr:
+ type: string
+ label: nems traffic cidr
+ description: nems traffic cidr
+ nems_traffic_netmask:
+ type: string
+ label: NEMS traffic network subnet mask
+ description: NEMS traffic network subnet mask
+ nems_traffic_gateway:
+ type: string
+ label: NEMS traffic network gateway
+ description: NEMS traffic network gateway
+ nems_traffic_net_local_ip1:
+ type: string
+ label: nems traffic network local ip1
+ description: the local ip1 of the nems traffic network
+ nems_traffic_net_local_ip2:
+ type: string
+ label: nems traffic network local ip2
+ description: the local ip2 of the nems traffic network
+ nems_traffic_net_floating_ip:
+ type: string
+ label: nems traffic floating ip
+ description: nems traffic floating ip
+ nems_user_web_name:
+ type: string
+ label: nems user web name
+ description: nems user web name
+ nems_user_web_start:
+ type: string
+ label: nems user web start
+ description: nems user web end
+ nems_user_web_end:
+ type: string
+ label: nems user web end
+ description: nems user web end
+ nems_user_web_cidr:
+ type: string
+ label: nems user web cidr
+ description: nems user web cidr
+ nems_user_web_netmask:
+ type: string
+ label: NEMS user web network subnet mask
+ description: NEMS user web network subnet mask
+ nems_user_web_gateway:
+ type: string
+ label: NEMS user web network gateway
+ description: NEMS user web network gateway
+ nems_user_web_net_local_ip1:
+ type: string
+ label: nems user web network local ip1
+ description: the local ip1 of the nems user web network
+ nems_user_web_net_local_ip2:
+ type: string
+ label: nems user web network local ip2
+ description: the local ip2 of the nems user web network
+ nems_user_web_net_floating_ip:
+ type: string
+ label: nems user web floating ip
+ description: nems user web floating ip
+ nems_imap_name:
+ type: string
+ label: nems imap name
+ description: nems imap name
+ nems_imap_netmask:
+ type: string
+ label: nems imap subnet mask
+ description: nems imap subnet mask
+ nems_imap_start:
+ type: string
+ label: nems imap start
+ description: nems imap start
+ nems_imap_end:
+ type: string
+ label: nems imap end
+ description: nems imap end
+ nems_imap_cidr:
+ type: string
+ label: nems imap cidr
+ description: nems imap cidr
+ nems_imap_gateway:
+ type: string
+ label: nems imap gateway
+ description: nems imap gateway
+ eca_traffic_name:
+ type: string
+ label: eca traffic name
+ description: eca traffic name
+ eca_traffic_start:
+ type: string
+ label: eca traffic start
+ description: eca traffic start
+ eca_traffic_end:
+ type: string
+ label: eca traffic end
+ description: eca traffic end
+ eca_traffic_cidr:
+ type: string
+ label: eca traffic cidr
+ description: eca traffic cidr
+ eca_traffic_netmask:
+ type: string
+ label: ECA traffic network subnet mask
+ description: ECA traffic network subnet mask
+ eca_traffic_net_gateway:
+ type: string
+ label: eca_traffic network gateway
+ description: eca_traffic network gateway
+ eca_traffic_net_local_ip1:
+ type: string
+ label: eca traffic network local ip1
+ description: the local ip1 of the eca traffic network
+ eca_traffic_net_local_ip2:
+ type: string
+ label: eca traffic network local ip2
+ description: the local ip2 of the eca traffic network
+ eca_traffic_net_floating_ip:
+ type: string
+ label: eca traffic floating ip
+ description: eca traffic floating ip
+ ha_net_name:
+ type: string
+ label: ha_failover network name
+ description: ha_failover network name
+ ha_net_start:
+ type: string
+ label: ha net start
+ description: ha net start
+ ha_net_end:
+ type: string
+ label: ha net end
+ description: ha net end
+ ha_net_cidr:
+ type: string
+ label: ha net cidr
+ description: ha net cidr
+ ha_net_local_ip1:
+ type: string
+ label: ha net network local ip1
+ description: the local ip1 of the ha network
+ ha_net_local_ip2:
+ type: string
+ label: ha net network local ip2
+ description: the local ip2 of the ha network
+ lb_names:
+ type: comma_delimited_list
+ label: MMSC load balancer instance names
+ description: MMSC load balancer instance names
+ lb_image_name:
+ type: string
+ label: MMSC load balancer image name
+ description: MMSC load balancer image name
+ lb_flavor_name:
+ type: string
+ label: Load balancer flavor name
+ description: the flavor name of MMSC load balancer instance
+ availability_zone_0:
+ type: string
+ label: MMSC availabilityzone name
+ description: MMSC availabilityzone name
+ security_group_name:
+ type: string
+ label: MMSC security group name
+ description: MMSC security group name
+ mmsc_image:
+ type: string
+ label: Image for MMSC server
+ description: Image for MMSC server
+ mmsc_flavor:
+ type: string
+ label: Flavor for MMSC server
+ description: Flavor for MMSC server
+ mmsc_cinder_volume_size:
+ type: number
+ label: MMSC Cinder volume size
+ description: the size of the MMSC Cinder volume
+ nems_fe_image:
+ type: string
+ label: Image for NEMS FE server
+ description: Image for NEMS FE server
+ nems_fe_flavor:
+ type: string
+ label: Flavor for NEMS FE server
+ description: Flavor for NEMS FE server
+ nems_be_image:
+ type: string
+ label: Image for NEMS BE server
+ description: Image for NEMS BE server
+ nems_be_flavor:
+ type: string
+ label: Flavor for NEMS BE server
+ description: Flavor for NEMS BE server
+ eca_trx_image:
+ type: string
+ label: Image for ECA TRX server
+ description: Image for ECA TRX server
+ eca_trx_flavor:
+ type: string
+ label: Flavor for ECA TRX server
+ description: Flavor for ECA TRX server
+ mmsc_oam_ips:
+ type: comma_delimited_list
+ label: MMSC oam_net IP addresses
+ description: MMSC oam_net IP addresses
+ mmsc_mms_traffic_net_ips:
+ type: comma_delimited_list
+ label: MMSC mms_traffic_net IP addresses
+ description: MMSC mms_traffic_net IP addresses
+ nems_fe_names:
+ type: comma_delimited_list
+ label: NEMS_FE server names
+ description: NEMS_FE server names
+ nems_fe_node_roles:
+ type: comma_delimited_list
+ label: nems fe node roles
+ description: nems fe node roles
+ nems_fe_oam_ips:
+ type: comma_delimited_list
+ label: OAM_net IP for NEMS_FE
+ description: OAM_net IP for NEMS_FE
+ nems_fe_nems_traffic_net_ips:
+ type: comma_delimited_list
+ label: nems_traffic_net IPs for NEMS_FE
+ description: nems_traffic_net IPs for NEMS_FE
+ nems_fe_nems_user_web_net_ips:
+ type: comma_delimited_list
+ label: nems_web_user_net IPs for NEMS_FE
+ description: nems_web_user_net IPs for NEMS_FE
+ nems_fe_nems_internal_net_ips:
+ type: comma_delimited_list
+ label: nems_internal_net IPs for NEMS_FE
+ description: nems_internal_net IPs for NEMS_FE
+ nems_fe_nems_imap_net_ips:
+ type: comma_delimited_list
+ label: nems_imap_net IPs for NEMS_FE
+ description: nems_imap_net IPs for NEMS_FE
+ nems_be_names:
+ type: string
+ label: NEMS_BE server names
+ description: NEMS_BE server names
+ nems_be_node_roles:
+ type: string
+ label: nems node roles
+ description: nems node roles
+ nems_be_oam_ips:
+ type: string
+ label: OAM net IPs for NEMS_BE
+ description: OAM net IPs for NEMS_BE
+ nems_be_nems_internal_net_ips:
+ type: string
+ label: nems internal net IPs for NEMS_BE
+ description: nems internal net IPs for NEMS_BE
+ nems_be_nems_imap_net_ips:
+ type: string
+ label: nems imap_net IPs for NEMS_BE
+ description: nems imap net IPs for NEMS_BE
+ eca_trx_oam_ips:
+ type: comma_delimited_list
+ label: OAM net IP for ECA_TRX
+ description: OAM net IP for ECA_TRX
+ eca_trx_mgmt_ips:
+ type: comma_delimited_list
+ label: eca mgmt net IP for ECA_TRX
+ description: eca mgmt net IP for ECA_TRX
+ timezone:
+ type: string
+ label: timezone
+ description: timezone
+ eca_trx_names:
+ type: comma_delimited_list
+ label: ECA_TRX server names
+ description: ECA_TRX server names
+ eca_trx_eca_traffic_net_ips:
+ type: comma_delimited_list
+ label: eca traffic net IPs for ECA_TRX
+ description: eca traffic net IPs for ECA_TRX
+ mmsc_names:
+ type: comma_delimited_list
+ label: MMSC server names
+ description: MMSC server names
+ nems_volume_size:
+ type: number
+ label: nems fe volume size
+ description: nems fe volume size
+ nems_be_volume_size:
+ type: number
+ label: nems be volume size
+ description: nems be volume size
+ MMSC_volume_type:
+ type: string
+ label: MMSC vm volume type
+ description: the name of the target volume backend
+ NEMS_FE_volume_type:
+ type: string
+ label: nems fe vm volume type
+ description: the name of the target volume backend
+ NEMS_BE_volume_type:
+ type: string
+ label: nems be vm volume type
+ description: the name of the target volume backend
+ mmsc_core_virtual_server_ips:
+ type: comma_delimited_list
+ label: mmsc core virtual server ips
+ description: mmsc core virtual server ips
+ mmsc_core_snat_ips:
+ type: comma_delimited_list
+ label: mmsc core snat ips
+ description: mmsc core snat ips
+ mmsc_dmz_protected_virtual_server_ips:
+ type: comma_delimited_list
+ label: mmsc dmz_protected virtual server ips
+ description: mmsc dmz_protected virtual server ips
+ mmsc_dmz_protected_snat_ips:
+ type: comma_delimited_list
+ label: mmsc dmz_protected snat ips
+ description: mmsc dmz_protected snat ips
+ eca_mgmt_net_name:
+ type: string
+ label: eca management network ID
+ description: Network ID for eca management
+
+resources:
+ mms_traffic_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: mms_traffic_net_name }
+
+ mms_traffic_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: mms_traffic_net_name}
+ network_id: { get_resource: mms_traffic_net }
+ cidr: { get_param: mms_traffic_net_cidr }
+ allocation_pools: [{"start": {get_param: mms_traffic_start}, "end": {get_param: mms_traffic_end}}]
+
+ nems_internal_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: {get_param: nems_internal_name}
+
+ nems_internal_network_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: nems_internal_name}
+ allocation_pools: [{"start": {get_param: nems_internal_start}, "end": {get_param: nems_internal_end}}]
+ cidr: {get_param: nems_internal_cidr}
+ network_id: {get_resource: nems_internal_net}
+
+ nems_traffic_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: {get_param: nems_traffic_name}
+
+ nems_traffic_network_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: nems_traffic_name}
+ allocation_pools: [{"start": {get_param: nems_traffic_start}, "end": {get_param: nems_traffic_end}}]
+ cidr: {get_param: nems_traffic_cidr}
+ network_id: {get_resource: nems_traffic_net}
+
+ nems_user_web_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: {get_param: nems_user_web_name}
+
+ nems_user_web_network_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: nems_user_web_name}
+ allocation_pools: [{"start": {get_param: nems_user_web_start}, "end": {get_param: nems_user_web_end}}]
+ cidr: {get_param: nems_user_web_cidr}
+ network_id: {get_resource: nems_user_web_net}
+
+ nems_imap_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: {get_param: nems_imap_name}
+
+ nems_imap_network_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: nems_imap_name}
+ allocation_pools: [{"start": {get_param: nems_imap_start}, "end": {get_param: nems_imap_end}}]
+ cidr: {get_param: nems_imap_cidr}
+ network_id: {get_resource: nems_imap_net}
+
+ eca_traffic_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: {get_param: eca_traffic_name}
+
+ eca_traffic_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: eca_traffic_name}
+ allocation_pools: [{"start": {get_param: eca_traffic_start}, "end": {get_param: eca_traffic_end}}]
+ cidr: {get_param: eca_traffic_cidr}
+ network_id: {get_resource: eca_traffic_net}
+
+ ha_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: {get_param: ha_net_name}
+
+ ha_net_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: ha_net_name}
+ allocation_pools: [{"start": {get_param: ha_net_start}, "end": {get_param: ha_net_end}}]
+ cidr: {get_param: ha_net_cidr}
+ network_id: {get_resource: ha_net}
+
+ lb1_instance:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: [lb_names, 0]}
+ image: {get_param: lb_image_name}
+ flavor: {get_param: lb_flavor_name}
+ availability_zone: {get_param: availability_zone_0}
+ networks:
+ - port: {get_resource: lb1_mgmt_port}
+ - port: {get_resource: lb1_dmz_protected_port}
+ - port: {get_resource: lb1_cor_direct_port}
+ - port: {get_resource: lb1_mms_traffic_port}
+ - port: {get_resource: lb1_nems_traffic_port}
+ - port: {get_resource: lb1_nems_user_web_port}
+ - port: {get_resource: lb1_eca_traffic_port}
+ - port: {get_resource: lb1_ha_net_port}
+ metadata:
+ vnf_id: { get_param: vnf_id }
+
+ lb1_mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [lb_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb1_mms_traffic_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: mms_traffic_net}
+ fixed_ips: [{"ip_address": {get_param: mms_traffic_net_local_ip1}}]
+ allowed_address_pairs: [{"ip_address": {get_param: mms_traffic_net_floating_ip} }]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb1_dmz_protected_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: dmz_protected_net_name}
+ fixed_ips: [{"ip_address": {get_param: [lb_dmz_protected_ips, 0]}}]
+ allowed_address_pairs: [{"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 0]}}, {"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 1]}}, {"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 2]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 0]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 1]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 2]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 3]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb1_cor_direct_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: cor_direct_net_name}
+ fixed_ips: [{"ip_address": {get_param: [lb_cor_direct_ips, 0]}}]
+ allowed_address_pairs: [{"ip_address": {get_param: [mmsc_core_virtual_server_ips, 0]}}, {"ip_address": {get_param: [mmsc_core_virtual_server_ips, 1]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 0]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 1]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 2]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 3]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 4]}} ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb1_nems_traffic_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: nems_traffic_net}
+ fixed_ips: [{"ip_address": {get_param: nems_traffic_net_local_ip1}}]
+ allowed_address_pairs: [{"ip_address": {get_param: nems_traffic_net_floating_ip} }]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb1_nems_user_web_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: nems_user_web_net}
+ fixed_ips: [{"ip_address": {get_param: nems_user_web_net_local_ip1}}]
+ allowed_address_pairs: [{"ip_address": {get_param: nems_user_web_net_floating_ip} }]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb1_ha_net_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: ha_net}
+ fixed_ips: [{"ip_address": {get_param: ha_net_local_ip1}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb1_eca_traffic_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: eca_traffic_net}
+ fixed_ips: [{"ip_address": {get_param: eca_traffic_net_local_ip1}}]
+ allowed_address_pairs: [{"ip_address": {get_param: eca_traffic_net_floating_ip} }]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb2_instance:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: [lb_names, 1]}
+ image: {get_param: lb_image_name}
+ flavor: {get_param: lb_flavor_name}
+ availability_zone: {get_param: availability_zone_0}
+ networks:
+ - port: {get_resource: lb2_mgmt_port}
+ - port: {get_resource: lb2_dmz_protected_port}
+ - port: {get_resource: lb2_cor_direct_port}
+ - port: {get_resource: lb2_mms_traffic_port}
+ - port: {get_resource: lb2_nems_traffic_port}
+ - port: {get_resource: lb2_nems_user_web_port}
+ - port: {get_resource: lb2_eca_traffic_port}
+ - port: {get_resource: lb2_ha_net_port}
+ metadata:
+ vnf_id: { get_param: vnf_id }
+
+ lb2_mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [lb_oam_ips, 1]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb2_mms_traffic_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: mms_traffic_net}
+ fixed_ips: [{"ip_address": {get_param: mms_traffic_net_local_ip2}}]
+ allowed_address_pairs: [{"ip_address": {get_param: mms_traffic_net_floating_ip}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb2_dmz_protected_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: dmz_protected_net_name}
+ fixed_ips: [{"ip_address": {get_param: [lb_dmz_protected_ips, 1]}}]
+ allowed_address_pairs: [{"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 0]}}, {"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 1]}}, {"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 2]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 0]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 1]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 2]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 3]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb2_cor_direct_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: cor_direct_net_name}
+ fixed_ips: [{"ip_address": {get_param: [lb_cor_direct_ips, 1]}}]
+ allowed_address_pairs: [{"ip_address": {get_param: [mmsc_core_virtual_server_ips, 0]}}, {"ip_address": {get_param: [mmsc_core_virtual_server_ips, 1]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 0]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 1]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 2]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 3]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 4]}} ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb2_nems_traffic_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: nems_traffic_net}
+ fixed_ips: [{"ip_address": {get_param: nems_traffic_net_local_ip2}}]
+ allowed_address_pairs: [{"ip_address": {get_param: nems_traffic_net_floating_ip}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb2_nems_user_web_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: nems_user_web_net}
+ fixed_ips: [{"ip_address": {get_param: nems_user_web_net_local_ip2}}]
+ allowed_address_pairs: [{"ip_address": {get_param: nems_user_web_net_floating_ip}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb2_ha_net_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: ha_net}
+ fixed_ips: [{"ip_address": {get_param: ha_net_local_ip2}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb2_eca_traffic_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: eca_traffic_net}
+ fixed_ips: [{"ip_address": {get_param: eca_traffic_net_local_ip2}}]
+ allowed_address_pairs: [{"ip_address": {get_param: eca_traffic_net_floating_ip} }]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_mmsc1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [mmsc_names, 0]}
+ image: { get_param: mmsc_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: mmsc_flavor }
+ networks:
+ - port: { get_resource: mmsc1_port_0 }
+ - port: { get_resource: mmsc1_port_1 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ mmsc.mgmt.ip=${mmsc.mgmt.ip}
+ mmsc.mgmt.netmask=${mmsc.mgmt.netmask}
+ mmsc.mgmt.gateway=${mmsc.mgmt.gateway}
+ mmsc.traffic.ip=${mmsc.traffic.ip}
+ mmsc.traffic.netmask=${mmsc.traffic.netmask}
+ mmsc.traffic.gateway=${mmsc.traffic.gateway}
+ mmsc.mgmt.route.1=${mmsc.mgmt.route.1}
+ mmsc.mgmt.route.2=${mmsc.mgmt.route.2}
+ mmsc.external.dns=${mmsc.external.dns}
+ mmsc.external.ntp=${mmsc.external.ntp}
+ mmsc.hostname=${mmsc.hostname}
+ mmsc.timezone=${mmsc.timezone}
+ params:
+ ${mmsc.mgmt.ip}: {get_param: [mmsc_oam_ips, 0]}
+ ${mmsc.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${mmsc.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${mmsc.traffic.ip}: {get_param: [mmsc_mms_traffic_net_ips, 0]}
+ ${mmsc.traffic.netmask}: {get_param: mms_traffic_netmask}
+ ${mmsc.traffic.gateway}: {get_param: mms_traffic_net_gateway}
+ ${mmsc.mgmt.route.1}: {get_param: oam_network_route_1}
+ ${mmsc.mgmt.route.2}: {get_param: oam_network_route_2}
+ ${mmsc.external.dns}: {get_param: external_dns}
+ ${mmsc.external.ntp}: {get_param: external_ntp}
+ ${mmsc.hostname}: {get_param: [mmsc_names, 0]}
+ ${mmsc.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ mmsc1_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: mmsc_cinder_volume_size}
+ volume_type: {get_param: MMSC_volume_type}
+
+ mmsc1_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: mmsc1_volume}
+ instance_uuid: {get_resource: server_mmsc1}
+
+ mmsc1_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [
+ "ip_address": {get_param: [mmsc_oam_ips, 0]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ mmsc1_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: mms_traffic_net}
+ fixed_ips: [
+ "ip_address": {get_param: [mmsc_mms_traffic_net_ips, 0]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_mmsc2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [mmsc_names, 1]}
+ image: { get_param: mmsc_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: mmsc_flavor }
+ networks:
+ - port: { get_resource: mmsc2_port_0 }
+ - port: { get_resource: mmsc2_port_1 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ mmsc.mgmt.ip=${mmsc.mgmt.ip}
+ mmsc.mgmt.netmask=${mmsc.mgmt.netmask}
+ mmsc.mgmt.gateway=${mmsc.mgmt.gateway}
+ mmsc.traffic.ip=${mmsc.traffic.ip}
+ mmsc.traffic.netmask=${mmsc.traffic.netmask}
+ mmsc.traffic.gateway=${mmsc.traffic.gateway}
+ mmsc.mgmt.route.1=${mmsc.mgmt.route.1}
+ mmsc.mgmt.route.2=${mmsc.mgmt.route.2}
+ mmsc.external.dns=${mmsc.external.dns}
+ mmsc.external.ntp=${mmsc.external.ntp}
+ mmsc.hostname=${mmsc.hostname}
+ mmsc.timezone=${mmsc.timezone}
+ params:
+ ${mmsc.mgmt.ip}: {get_param: [mmsc_oam_ips, 1]}
+ ${mmsc.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${mmsc.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${mmsc.traffic.ip}: {get_param: [mmsc_mms_traffic_net_ips, 1]}
+ ${mmsc.traffic.netmask}: {get_param: mms_traffic_netmask}
+ ${mmsc.traffic.gateway}: {get_param: mms_traffic_net_gateway}
+ ${mmsc.mgmt.route.1}: {get_param: oam_network_route_1}
+ ${mmsc.mgmt.route.2}: {get_param: oam_network_route_2}
+ ${mmsc.external.dns}: {get_param: external_dns}
+ ${mmsc.external.ntp}: {get_param: external_ntp}
+ ${mmsc.hostname}: {get_param: [mmsc_names, 1]}
+ ${mmsc.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ mmsc2_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: mmsc_cinder_volume_size}
+ volume_type: {get_param: MMSC_volume_type}
+
+ mmsc2_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: mmsc2_volume}
+ instance_uuid: {get_resource: server_mmsc2}
+
+ mmsc2_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [
+ "ip_address": {get_param: [mmsc_oam_ips, 1]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ mmsc2_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: mms_traffic_net}
+ fixed_ips: [
+ "ip_address": {get_param: [mmsc_mms_traffic_net_ips, 1]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_mmsc3:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [mmsc_names, 2]}
+ image: { get_param: mmsc_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: mmsc_flavor }
+ networks:
+ - port: { get_resource: mmsc3_port_0 }
+ - port: { get_resource: mmsc3_port_1 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ mmsc.mgmt.ip=${mmsc.mgmt.ip}
+ mmsc.mgmt.netmask=${mmsc.mgmt.netmask}
+ mmsc.mgmt.gateway=${mmsc.mgmt.gateway}
+ mmsc.traffic.ip=${mmsc.traffic.ip}
+ mmsc.traffic.netmask=${mmsc.traffic.netmask}
+ mmsc.traffic.gateway=${mmsc.traffic.gateway}
+ mmsc.mgmt.route.1=${mmsc.mgmt.route.1}
+ mmsc.mgmt.route.2=${mmsc.mgmt.route.2}
+ mmsc.external.dns=${mmsc.external.dns}
+ mmsc.external.ntp=${mmsc.external.ntp}
+ mmsc.hostname=${mmsc.hostname}
+ mmsc.timezone=${mmsc.timezone}
+ params:
+ ${mmsc.mgmt.ip}: {get_param: [mmsc_oam_ips, 2]}
+ ${mmsc.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${mmsc.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${mmsc.traffic.ip}: {get_param: [mmsc_mms_traffic_net_ips, 2]}
+ ${mmsc.traffic.netmask}: {get_param: mms_traffic_netmask}
+ ${mmsc.traffic.gateway}: {get_param: mms_traffic_net_gateway}
+ ${mmsc.mgmt.route.1}: {get_param: oam_network_route_1}
+ ${mmsc.mgmt.route.2}: {get_param: oam_network_route_2}
+ ${mmsc.external.dns}: {get_param: external_dns}
+ ${mmsc.external.ntp}: {get_param: external_ntp}
+ ${mmsc.hostname}: {get_param: [mmsc_names, 2]}
+ ${mmsc.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ mmsc3_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: mmsc_cinder_volume_size}
+ volume_type: {get_param: MMSC_volume_type}
+
+ mmsc3_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: mmsc3_volume}
+ instance_uuid: {get_resource: server_mmsc3}
+
+ mmsc3_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [
+ "ip_address": {get_param: [mmsc_oam_ips, 2]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ mmsc3_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: mms_traffic_net}
+ fixed_ips: [
+ "ip_address": {get_param: [mmsc_mms_traffic_net_ips, 2]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_mmsc4:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [mmsc_names, 3]}
+ image: { get_param: mmsc_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: mmsc_flavor }
+ networks:
+ - port: { get_resource: mmsc4_port_0 }
+ - port: { get_resource: mmsc4_port_1 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ mmsc.mgmt.ip=${mmsc.mgmt.ip}
+ mmsc.mgmt.netmask=${mmsc.mgmt.netmask}
+ mmsc.mgmt.gateway=${mmsc.mgmt.gateway}
+ mmsc.traffic.ip=${mmsc.traffic.ip}
+ mmsc.traffic.netmask=${mmsc.traffic.netmask}
+ mmsc.traffic.gateway=${mmsc.traffic.gateway}
+ mmsc.mgmt.route.1=${mmsc.mgmt.route.1}
+ mmsc.mgmt.route.2=${mmsc.mgmt.route.2}
+ mmsc.external.dns=${mmsc.external.dns}
+ mmsc.external.ntp=${mmsc.external.ntp}
+ mmsc.hostname=${mmsc.hostname}
+ mmsc.timezone=${mmsc.timezone}
+ params:
+ ${mmsc.mgmt.ip}: {get_param: [mmsc_oam_ips, 3]}
+ ${mmsc.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${mmsc.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${mmsc.traffic.ip}: {get_param: [mmsc_mms_traffic_net_ips, 3]}
+ ${mmsc.traffic.netmask}: {get_param: mms_traffic_netmask}
+ ${mmsc.traffic.gateway}: {get_param: mms_traffic_net_gateway}
+ ${mmsc.mgmt.route.1}: {get_param: oam_network_route_1}
+ ${mmsc.mgmt.route.2}: {get_param: oam_network_route_2}
+ ${mmsc.external.dns}: {get_param: external_dns}
+ ${mmsc.external.ntp}: {get_param: external_ntp}
+ ${mmsc.hostname}: {get_param: [mmsc_names, 3]}
+ ${mmsc.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ mmsc4_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: mmsc_cinder_volume_size}
+ volume_type: {get_param: MMSC_volume_type}
+
+ mmsc4_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: mmsc4_volume}
+ instance_uuid: {get_resource: server_mmsc4}
+
+ mmsc4_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [
+ "ip_address": {get_param: [mmsc_oam_ips, 3]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ mmsc4_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: mms_traffic_net}
+ fixed_ips: [
+ "ip_address": {get_param: [mmsc_mms_traffic_net_ips, 3]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_mmsc5:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [mmsc_names, 4]}
+ image: { get_param: mmsc_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: mmsc_flavor }
+ networks:
+ - port: { get_resource: mmsc5_port_0 }
+ - port: { get_resource: mmsc5_port_1 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ mmsc.mgmt.ip=${mmsc.mgmt.ip}
+ mmsc.mgmt.netmask=${mmsc.mgmt.netmask}
+ mmsc.mgmt.gateway=${mmsc.mgmt.gateway}
+ mmsc.traffic.ip=${mmsc.traffic.ip}
+ mmsc.traffic.netmask=${mmsc.traffic.netmask}
+ mmsc.traffic.gateway=${mmsc.traffic.gateway}
+ mmsc.mgmt.route.1=${mmsc.mgmt.route.1}
+ mmsc.mgmt.route.2=${mmsc.mgmt.route.2}
+ mmsc.external.dns=${mmsc.external.dns}
+ mmsc.external.ntp=${mmsc.external.ntp}
+ mmsc.hostname=${mmsc.hostname}
+ mmsc.timezone=${mmsc.timezone}
+ params:
+ ${mmsc.mgmt.ip}: {get_param: [mmsc_oam_ips, 4]}
+ ${mmsc.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${mmsc.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${mmsc.traffic.ip}: {get_param: [mmsc_mms_traffic_net_ips, 4]}
+ ${mmsc.traffic.netmask}: {get_param: mms_traffic_netmask}
+ ${mmsc.traffic.gateway}: {get_param: mms_traffic_net_gateway}
+ ${mmsc.mgmt.route.1}: {get_param: oam_network_route_1}
+ ${mmsc.mgmt.route.2}: {get_param: oam_network_route_2}
+ ${mmsc.external.dns}: {get_param: external_dns}
+ ${mmsc.external.ntp}: {get_param: external_ntp}
+ ${mmsc.hostname}: {get_param: [mmsc_names, 4]}
+ ${mmsc.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ mmsc5_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: mmsc_cinder_volume_size}
+ volume_type: {get_param: MMSC_volume_type}
+
+ mmsc5_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: mmsc5_volume}
+ instance_uuid: {get_resource: server_mmsc5}
+
+ mmsc5_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [
+ "ip_address": {get_param: [mmsc_oam_ips, 4]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ mmsc5_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: mms_traffic_net}
+ fixed_ips: [
+ "ip_address": {get_param: [mmsc_mms_traffic_net_ips, 4]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_nems_fe1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [nems_fe_names, 0] }
+ image: { get_param: nems_fe_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: nems_fe_flavor }
+ networks:
+ - port: { get_resource: nems_fe1_port_0 }
+ - port: { get_resource: nems_fe1_port_1 }
+ - port: { get_resource: nems_fe1_port_2 }
+ - port: { get_resource: nems_fe1_port_3 }
+ - port: { get_resource: nems_fe1_port_4 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ nems.mgmt.ip=${nems.mgmt.ip}
+ nems.mgmt.netmask=${nems.mgmt.netmask}
+ nems.mgmt.gateway=${nems.mgmt.gateway}
+ nems.traffic.ip=${nems.traffic.ip}
+ nems.traffic.netmask=${nems.traffic.netmask}
+ nems.traffic.gateway=${nems.traffic.gateway}
+ nems.fe0.internal.ip=${nems.fe0.internal.ip}
+ nems.fe1.internal.ip=${nems.fe1.internal.ip}
+ nems.internal.netmask=${nems.internal.netmask}
+ nems.userweb.ip=${nems.userweb.ip}
+ nems.userweb.netmask=${nems.userweb.netmask}
+ nems.userweb.gateway=${nems.userweb.gateway}
+ nems.imap.ip=${nems.imap.ip}
+ nems.imap.netmask=${nems.imap.netmask}
+ nems.be.internal.ip=${nems.be.internal.ip}
+ nems.be.imap.ip=${nems.be.imap.ip}
+ nems.mgmt.route.1=${nems.mgmt.route.1}
+ nems.mgmt.route.2=${nems.mgmt.route.2}
+ nems.external.dns=${nems.external.dns}
+ nems.external.ntp=${nems.external.ntp}
+ nems.node=${nems.node}
+ nems.be0.host.name=${nems.be0.host.name}
+ nems.fe0.host.name=${nems.fe0.host.name}
+ nems.fe1.host.name=${nems.fe1.host.name}
+ nems.timezone=${nems.timezone}
+ params:
+ ${nems.mgmt.ip}: {get_param: [nems_fe_oam_ips, 0]}
+ ${nems.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${nems.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${nems.traffic.ip}: {get_param: [nems_fe_nems_traffic_net_ips, 0]}
+ ${nems.traffic.netmask}: {get_param: nems_traffic_netmask}
+ ${nems.traffic.gateway}: {get_param: nems_traffic_gateway}
+ ${nems.fe0.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 0]}
+ ${nems.fe1.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 1]}
+ ${nems.internal.netmask}: {get_param: nems_internal_netmask}
+ ${nems.userweb.ip}: {get_param: [nems_fe_nems_user_web_net_ips, 0]}
+ ${nems.userweb.netmask}: {get_param: nems_user_web_netmask}
+ ${nems.userweb.gateway}: {get_param: nems_user_web_gateway}
+ ${nems.imap.ip}: {get_param: [nems_fe_nems_imap_net_ips, 0]}
+ ${nems.imap.netmask}: {get_param: nems_imap_netmask}
+ ${nems.be.internal.ip}: {get_param: nems_be_nems_internal_net_ips}
+ ${nems.be.imap.ip}: {get_param: nems_be_nems_imap_net_ips}
+ ${nems.mgmt.route.1}: {get_param: oam_network_route_1}
+ ${nems.mgmt.route.2}: {get_param: oam_network_route_2}
+ ${nems.external.dns}: {get_param: external_dns}
+ ${nems.external.ntp}: {get_param: external_ntp}
+ ${nems.node}: {get_param: [nems_fe_node_roles, 0]}
+ ${nems.fe0.host.name}: {get_param: [nems_fe_names, 0]}
+ ${nems.fe1.host.name}: {get_param: [nems_fe_names, 1]}
+ ${nems.be0.host.name}: {get_param: nems_be_names}
+ ${nems.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ nems1_fe_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: nems_volume_size}
+ volume_type: {get_param: NEMS_FE_volume_type}
+
+ nems1_fe_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: nems1_fe_volume}
+ instance_uuid: {get_resource: server_nems_fe1}
+
+ nems_fe1_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [
+ "ip_address": { get_param: [nems_fe_oam_ips, 0] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ nems_fe1_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: nems_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [nems_fe_nems_traffic_net_ips, 0] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ nems_fe1_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: nems_user_web_net }
+ fixed_ips: [
+ "ip_address": { get_param: [nems_fe_nems_user_web_net_ips, 0] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ nems_fe1_port_3:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: nems_internal_net }
+ fixed_ips: [
+ "ip_address": { get_param: [nems_fe_nems_internal_net_ips, 0] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ nems_fe1_port_4:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: nems_imap_net }
+ fixed_ips: [
+ "ip_address": { get_param: [nems_fe_nems_imap_net_ips, 0] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_nems_fe2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [nems_fe_names, 1] }
+ image: { get_param: nems_fe_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: nems_fe_flavor }
+ networks:
+ - port: { get_resource: nems_fe2_port_0 }
+ - port: { get_resource: nems_fe2_port_1 }
+ - port: { get_resource: nems_fe2_port_2 }
+ - port: { get_resource: nems_fe2_port_3 }
+ - port: { get_resource: nems_fe2_port_4 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ nems.mgmt.ip=${nems.mgmt.ip}
+ nems.mgmt.netmask=${nems.mgmt.netmask}
+ nems.mgmt.gateway=${nems.mgmt.gateway}
+ nems.traffic.ip=${nems.traffic.ip}
+ nems.traffic.netmask=${nems.traffic.netmask}
+ nems.traffic.gateway=${nems.traffic.gateway}
+ nems.fe0.internal.ip=${nems.fe0.internal.ip}
+ nems.fe1.internal.ip=${nems.fe1.internal.ip}
+ nems.internal.netmask=${nems.internal.netmask}
+ nems.userweb.ip=${nems.userweb.ip}
+ nems.userweb.netmask=${nems.userweb.netmask}
+ nems.userweb.gateway=${nems.userweb.gateway}
+ nems.imap.ip=${nems.imap.ip}
+ nems.imap.netmask=${nems.imap.netmask}
+ nems.be.internal.ip=${nems.be.internal.ip}
+ nems.be.imap.ip=${nems.be.imap.ip}
+ nems.mgmt.route.1=${nems.mgmt.route.1}
+ nems.mgmt.route.2=${nems.mgmt.route.2}
+ nems.external.dns=${nems.external.dns}
+ nems.external.ntp=${nems.external.ntp}
+ nems.node=${nems.node}
+ nems.be0.host.name=${nems.be0.host.name}
+ nems.fe0.host.name=${nems.fe0.host.name}
+ nems.fe1.host.name=${nems.fe1.host.name}
+ nems.timezone=${nems.timezone}
+ params:
+ ${nems.mgmt.ip}: {get_param: [nems_fe_oam_ips, 1]}
+ ${nems.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${nems.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${nems.traffic.ip}: {get_param: [nems_fe_nems_traffic_net_ips, 1]}
+ ${nems.traffic.netmask}: {get_param: nems_traffic_netmask}
+ ${nems.traffic.gateway}: {get_param: nems_traffic_gateway}
+ ${nems.fe0.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 0]}
+ ${nems.fe1.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 1]}
+ ${nems.internal.netmask}: {get_param: nems_internal_netmask}
+ ${nems.userweb.ip}: {get_param: [nems_fe_nems_user_web_net_ips, 1]}
+ ${nems.userweb.netmask}: {get_param: nems_user_web_netmask}
+ ${nems.userweb.gateway}: {get_param: nems_user_web_gateway}
+ ${nems.imap.ip}: {get_param: [nems_fe_nems_imap_net_ips, 1]}
+ ${nems.imap.netmask}: {get_param: nems_imap_netmask}
+ ${nems.be.internal.ip}: {get_param: nems_be_nems_internal_net_ips}
+ ${nems.be.imap.ip}: {get_param: nems_be_nems_imap_net_ips}
+ ${nems.mgmt.route.1}: {get_param: oam_network_route_1}
+ ${nems.mgmt.route.2}: {get_param: oam_network_route_2}
+ ${nems.external.dns}: {get_param: external_dns}
+ ${nems.external.ntp}: {get_param: external_ntp}
+ ${nems.node}: {get_param: [nems_fe_node_roles, 1]}
+ ${nems.fe0.host.name}: {get_param: [nems_fe_names, 0]}
+ ${nems.fe1.host.name}: {get_param: [nems_fe_names, 1]}
+ ${nems.be0.host.name}: {get_param: nems_be_names}
+ ${nems.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ nems2_fe_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: nems_volume_size}
+ volume_type: {get_param: NEMS_FE_volume_type}
+
+ nems2_fe_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: nems2_fe_volume}
+ instance_uuid: {get_resource: server_nems_fe2}
+
+ nems_fe2_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [
+ "ip_address": {get_param: [nems_fe_oam_ips, 1]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ nems_fe2_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: nems_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [nems_fe_nems_traffic_net_ips, 1] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ nems_fe2_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: nems_user_web_net }
+ fixed_ips: [
+ "ip_address": { get_param: [nems_fe_nems_user_web_net_ips, 1] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ nems_fe2_port_3:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: nems_internal_net }
+ fixed_ips: [
+ "ip_address": { get_param: [nems_fe_nems_internal_net_ips, 1] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+
+ nems_fe2_port_4:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: nems_imap_net }
+ fixed_ips: [
+ "ip_address": { get_param: [nems_fe_nems_imap_net_ips, 1] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_nems_be1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: nems_be_names }
+ image: { get_param: nems_be_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: nems_be_flavor }
+ networks:
+ - port: { get_resource: nems_be1_port_0 }
+ - port: { get_resource: nems_be1_port_1 }
+ - port: { get_resource: nems_be1_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ nems.be.mgmt.ip=${nems.be.mgmt.ip}
+ nems.mgmt.netmask=${nems.mgmt.netmask}
+ nems.mgmt.gateway=${nems.mgmt.gateway}
+ nems.be.internal.ip=${nems.be.internal.ip}
+ nems.internal.netmask=${nems.internal.netmask}
+ nems.imap.netmask=${nems.imap.netmask}
+ nems.fe0.internal.ip=${nems.fe0.internal.ip}
+ nems.fe1.internal.ip=${nems.fe1.internal.ip}
+ nems.be.imap.ip=${nems.be.imap.ip}
+ nems.mgmt.route.1=${nems.mgmt.route.1}
+ nems.mgmt.route.2=${nems.mgmt.route.2}
+ nems.external.dns=${nems.external.dns}
+ nems.external.ntp=${nems.external.ntp}
+ nems.node=${nems.node}
+ nems.be0.host.name=${nems.be0.host.name}
+ nems.fe0.host.name=${nems.fe0.host.name}
+ nems.fe1.host.name=${nems.fe1.host.name}
+ nems.timezone=${nems.timezone}
+ params:
+ ${nems.be.mgmt.ip}: {get_param: nems_be_oam_ips}
+ ${nems.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${nems.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${nems.fe0.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 0]}
+ ${nems.fe1.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 1]}
+ ${nems.be.internal.ip}: {get_param: nems_be_nems_internal_net_ips}
+ ${nems.internal.netmask}: {get_param: nems_internal_netmask}
+ ${nems.imap.netmask}: {get_param: nems_imap_netmask}
+ ${nems.be.imap.ip}: {get_param: nems_be_nems_imap_net_ips}
+ ${nems.mgmt.route.1}: {get_param: oam_network_route_1}
+ ${nems.mgmt.route.2}: {get_param: oam_network_route_2}
+ ${nems.external.dns}: {get_param: external_dns}
+ ${nems.external.ntp}: {get_param: external_ntp}
+ ${nems.node}: {get_param: nems_be_node_roles}
+ ${nems.be0.host.name}: {get_param: nems_be_names}
+ ${nems.fe0.host.name}: {get_param: [nems_fe_names, 0]}
+ ${nems.fe1.host.name}: {get_param: [nems_fe_names, 1]}
+ ${nems.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ nems_be_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: nems_be_volume_size}
+ volume_type: {get_param: NEMS_BE_volume_type}
+
+ nems_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: nems_be_volume}
+ instance_uuid: {get_resource: server_nems_be1}
+
+
+ nems_be1_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [
+ "ip_address": { get_param: nems_be_oam_ips}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ nems_be1_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: nems_internal_net }
+ fixed_ips: [
+ "ip_address": { get_param: nems_be_nems_internal_net_ips}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ nems_be1_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: nems_imap_net }
+ fixed_ips: [
+ "ip_address": { get_param: nems_be_nems_imap_net_ips}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 0]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx1_port_0 }
+ - port: { get_resource: eca_trx1_port_1 }
+ - port: { get_resource: eca_trx1_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 0]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 0]}
+
+ eca_trx1_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 0] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx1_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 0] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx1_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 0] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+
+ server_eca_trx2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 1]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx2_port_0 }
+ - port: { get_resource: eca_trx2_port_1 }
+ - port: { get_resource: eca_trx2_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 1]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 1]}
+
+ eca_trx2_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 1] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx2_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 1] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx2_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 1] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx3:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 2]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx3_port_0 }
+ - port: { get_resource: eca_trx3_port_1 }
+ - port: { get_resource: eca_trx3_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 2]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 2]}
+
+ eca_trx3_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 2] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx3_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 2] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx3_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 2] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx4:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 3]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx4_port_0 }
+ - port: { get_resource: eca_trx4_port_1 }
+ - port: { get_resource: eca_trx4_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 3]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 3]}
+
+ eca_trx4_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 3] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx4_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 3] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx4_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 3] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx5:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 4]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx5_port_0 }
+ - port: { get_resource: eca_trx5_port_1 }
+ - port: { get_resource: eca_trx5_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 4]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 4]}
+
+ eca_trx5_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 4] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx5_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 4] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx5_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 4] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx6:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 5]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx6_port_0 }
+ - port: { get_resource: eca_trx6_port_1 }
+ - port: { get_resource: eca_trx6_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 5]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 5]}
+
+ eca_trx6_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 5] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx6_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 5] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx6_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 5] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx7:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 6]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx7_port_0 }
+ - port: { get_resource: eca_trx7_port_1 }
+ - port: { get_resource: eca_trx7_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 6]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 6]}
+
+ eca_trx7_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 6] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx7_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 6] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx7_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 6] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx8:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 7]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx8_port_0 }
+ - port: { get_resource: eca_trx8_port_1 }
+ - port: { get_resource: eca_trx8_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 7]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 7]}
+
+ eca_trx8_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 7] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx8_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 7] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx8_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 7] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx9:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 8]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx9_port_0 }
+ - port: { get_resource: eca_trx9_port_1 }
+ - port: { get_resource: eca_trx9_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 8]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 8]}
+
+ eca_trx9_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 8] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx9_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 8] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx9_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 8] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx10:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 9]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx10_port_0 }
+ - port: { get_resource: eca_trx10_port_1 }
+ - port: { get_resource: eca_trx10_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 9]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 9]}
+
+ eca_trx10_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 9] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx10_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 9] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx10_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 9] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx11:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 10]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx11_port_0 }
+ - port: { get_resource: eca_trx11_port_1 }
+ - port: { get_resource: eca_trx11_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 10]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 10]}
+
+ eca_trx11_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 10] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx11_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 10] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx11_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 10] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+
+ server_eca_trx12:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 11]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx12_port_0 }
+ - port: { get_resource: eca_trx12_port_1 }
+ - port: { get_resource: eca_trx12_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 11]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 11]}
+
+ eca_trx12_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 11] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx12_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 11] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx12_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 11] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx13:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 12]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx13_port_0 }
+ - port: { get_resource: eca_trx13_port_1 }
+ - port: { get_resource: eca_trx13_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 12]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 12]}
+
+ eca_trx13_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 12] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx13_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 12] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx13_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 12] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx14:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 13]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx14_port_0 }
+ - port: { get_resource: eca_trx14_port_1 }
+ - port: { get_resource: eca_trx14_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 13]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 13]}
+
+ eca_trx14_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 13] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx14_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 13] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx14_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 13] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx15:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 14]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx15_port_0 }
+ - port: { get_resource: eca_trx15_port_1 }
+ - port: { get_resource: eca_trx15_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 14]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 14]}
+
+ eca_trx15_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 14] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx15_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 14] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx15_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 14] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx16:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 15]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx16_port_0 }
+ - port: { get_resource: eca_trx16_port_1 }
+ - port: { get_resource: eca_trx16_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 15]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 15]}
+
+ eca_trx16_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 15] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx16_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 15] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx16_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 15] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+
+ server_eca_trx17:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 16]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx17_port_0 }
+ - port: { get_resource: eca_trx17_port_1 }
+ - port: { get_resource: eca_trx17_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 16]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 16]}
+
+ eca_trx17_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 16] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx17_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 16] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx17_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 16] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx18:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 17]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx18_port_0 }
+ - port: { get_resource: eca_trx18_port_1 }
+ - port: { get_resource: eca_trx18_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 17]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 17]}
+
+ eca_trx18_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 17] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx18_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 17] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx18_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 17] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx19:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 18]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx19_port_0 }
+ - port: { get_resource: eca_trx19_port_1 }
+ - port: { get_resource: eca_trx19_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 8]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 18]}
+
+ eca_trx19_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 18] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx19_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 18] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx19_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 18] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx20:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 19]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx20_port_0 }
+ - port: { get_resource: eca_trx20_port_1 }
+ - port: { get_resource: eca_trx20_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 19]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 19]}
+
+ eca_trx20_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 19] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx20_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 19] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx20_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 19] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/MMSC_Capacity_Line_1.env b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/MMSC_Capacity_Line_1.env
new file mode 100644
index 0000000000..b346d67d97
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/MMSC_Capacity_Line_1.env
@@ -0,0 +1,111 @@
+parameters:
+ oam_net_name: oam_protected_net_0
+ oam_network_netmask: 255.255.254.0
+ oam_network_gateway: 107.250.172.1
+ oam_network_route_1: 155.165.201.250/32,107.250.172.1
+ oam_network_route_2: 155.165.194.100/32,107.250.172.1
+ external_dns: 155.165.194.100
+ external_ntp: 155.165.201.250
+ lb_oam_ips: 107.250.172.50,107.250.172.51
+ dmz_protected_net_name: dmz_protected_net_0
+ lb_dmz_protected_ips: 107.239.14.19,107.239.14.20
+ cor_direct_net_name: cor_direct_net_0
+ lb_cor_direct_ips: 172.31.10.19,172.31.10.20
+ mms_traffic_net_name: int_mms_mms_traffic_net_2
+ mms_traffic_net_cidr: 172.26.2.0/24
+ mms_traffic_netmask: 255.255.255.0
+ mms_traffic_net_gateway: 172.26.2.1
+ mms_traffic_start: 172.26.2.3
+ mms_traffic_end: 172.26.2.254
+ mms_traffic_net_local_ip1: 172.26.2.3
+ mms_traffic_net_local_ip2: 172.26.2.4
+ mms_traffic_net_floating_ip: 172.26.2.5
+ nems_internal_name: int_mms_nems_internal_net_2
+ nems_internal_start: 172.26.6.3
+ nems_internal_end: 172.26.6.254
+ nems_internal_cidr: 172.26.6.0/24
+ nems_internal_netmask: 255.255.255.0
+ nems_internal_gateway: 172.26.6.1
+ nems_traffic_name: int_mms_nems_traffic_net_2
+ nems_traffic_start: 172.26.3.3
+ nems_traffic_end: 172.26.3.254
+ nems_traffic_cidr: 172.26.3.0/24
+ nems_traffic_netmask: 255.255.255.0
+ nems_traffic_gateway: 172.26.3.1
+ nems_traffic_net_local_ip1: 172.26.3.3
+ nems_traffic_net_local_ip2: 172.26.3.4
+ nems_traffic_net_floating_ip: 172.26.3.5
+ nems_user_web_name: int_mms_nems_web_net_2
+ nems_user_web_start: 172.26.4.3
+ nems_user_web_end: 172.26.4.254
+ nems_user_web_cidr: 172.26.4.0/24
+ nems_user_web_netmask: 255.255.255.0
+ nems_user_web_gateway: 172.26.4.1
+ nems_user_web_net_local_ip1: 172.26.4.3
+ nems_user_web_net_local_ip2: 172.26.4.4
+ nems_user_web_net_floating_ip: 172.26.4.5
+ nems_imap_name: int_mms_nems_imap_net_2
+ nems_imap_start: 172.26.7.3
+ nems_imap_end: 172.26.7.254
+ nems_imap_cidr: 172.26.7.0/24
+ nems_imap_netmask: 255.255.255.0
+ nems_imap_gateway: 172.26.7.1
+ eca_traffic_name: int_mms_eca_traffic_net_2
+ eca_traffic_cidr: 172.26.5.0/24
+ eca_traffic_netmask: 255.255.255.0
+ eca_traffic_net_gateway: 172.26.5.1
+ eca_traffic_start: 172.26.5.3
+ eca_traffic_end: 172.26.5.254
+ eca_traffic_net_local_ip1: 172.26.5.3
+ eca_traffic_net_local_ip2: 172.26.5.4
+ eca_traffic_net_floating_ip: 172.26.5.5
+ ha_net_name: int_mms_ha_net_2
+ ha_net_cidr: 172.26.1.0/24
+ ha_net_start: 172.26.1.3
+ ha_net_end: 172.26.1.254
+ ha_net_local_ip1: 172.26.1.3
+ ha_net_local_ip2: 172.26.1.4
+ lb_names: ZRDM1MMSC03ALB001,ZRDM1MMSC03ALB002
+ lb_image_name: BIGIP-11.5.3.0.0.163
+ lb_flavor_name: m1.xlarge
+ security_group_name: mmsc_security_group_1
+ availability_zone_0: nova
+ mmsc_mms_traffic_net_ips: 172.26.2.11,172.26.2.12,172.26.2.13,172.26.2.14,172.26.2.15
+ mmsc_oam_ips: 107.250.172.54,107.250.172.55,107.250.172.56,107.250.172.57,107.250.172.58
+ mmsc_flavor: lc.4xlarge4
+ mmsc_image: mmsc-6.0.2_v5
+ mmsc_cinder_volume_size: 480
+ nems_fe_flavor: m1.large2
+ nems_fe_image: nems-2.1.2_v29
+ nems_fe_names: ZRDM1MMSC03NFE001,ZRDM1MMSC03NFE002
+ nems_fe_node_roles: FE0,FE1
+ nems_fe_oam_ips: 107.250.172.64,107.250.172.65
+ nems_fe_nems_traffic_net_ips: 172.26.3.11,172.26.3.12
+ nems_fe_nems_user_web_net_ips: 172.26.4.11,172.26.4.12
+ nems_fe_nems_internal_net_ips: 172.26.6.11,172.26.6.12
+ nems_fe_nems_imap_net_ips: 172.26.7.11,172.26.7.12
+ nems_be_names: ZRDM1MMSC03NBE001
+ nems_be_node_roles: BE0
+ nems_be_oam_ips: 107.250.172.66
+ nems_be_nems_internal_net_ips: 172.26.6.13
+ nems_be_nems_imap_net_ips: 172.26.7.13
+ nems_be_flavor: m1.large2
+ nems_be_image: nems-2.1.2_v29
+ eca_trx_oam_ips: 107.250.172.70,107.250.172.71,107.250.172.72,107.250.172.73,107.250.172.74,107.250.172.75,107.250.172.76,107.250.172.77,107.250.172.78,107.250.172.79,107.250.172.80,107.250.172.81,107.250.172.82,107.250.172.83,107.250.172.84,107.250.172.85,107.250.172.86,107.250.172.87,107.250.172.88,107.250.172.89
+ eca_trx_mgmt_ips: 172.25.137.202,172.25.137.203,172.25.137.204,172.25.137.205,172.25.137.206,172.25.137.207,172.25.137.208,172.25.137.209,172.25.137.210,172.25.137.211,172.25.137.212,172.25.137.213,172.25.137.214,172.25.137.215,172.25.137.216,172.25.137.217,172.25.137.218,172.25.137.219,172.25.137.220,172.25.137.221
+ eca_trx_flavor: m1.xlarge
+ eca_trx_image: ECABASE
+ timezone: UTC
+ eca_trx_names: ZRDM1MMSC03TRX001,ZRDM1MMSC03TRX002,ZRDM1MMSC03TRX003,ZRDM1MMSC03TRX004,ZRDM1MMSC03TRX005,ZRDM1MMSC03TRX006,ZRDM1MMSC03TRX007,ZRDM1MMSC03TRX008,ZRDM1MMSC03TRX009,ZRDM1MMSC03TRX010,ZRDM1MMSC03TRX011,ZRDM1MMSC03TRX012,ZRDM1MMSC03TRX013,ZRDM1MMSC03TRX014,ZRDM1MMSC03TRX015,ZRDM1MMSC03TRX016,ZRDM1MMSC03TRX017,ZRDM1MMSC03TRX018,ZRDM1MMSC03TRX019,ZRDM1MMSC03TRX020
+ eca_trx_eca_traffic_net_ips: 172.26.5.11,172.26.5.12,172.26.5.13,172.26.5.14,172.26.5.15,172.26.5.16,172.26.5.17,172.26.5.18,172.26.5.19,172.26.5.20,172.26.5.21,172.26.5.22,172.26.5.23,172.26.5.24,172.26.5.25,172.26.5.26,172.26.5.27,172.26.5.28,172.26.5.29,172.26.5.30
+ mmsc_names: ZRDM1MMSC03MMS001,ZRDM1MMSC03MMS002,ZRDM1MMSC03MMS003,ZRDM1MMSC03MMS004,ZRDM1MMSC03MMS005
+ nems_volume_size: 50
+ nems_be_volume_size: 610
+ MMSC_volume_type: Platinum
+ NEMS_FE_volume_type: Platinum
+ NEMS_BE_volume_type: Platinum
+ mmsc_core_virtual_server_ips: 172.31.10.21,172.31.10.22
+ mmsc_core_snat_ips: 172.31.10.23,172.31.10.24,172.31.10.25,172.31.10.26,172.31.10.27
+ mmsc_dmz_protected_virtual_server_ips: 107.239.14.21,107.239.14.22,107.239.14.23
+ mmsc_dmz_protected_snat_ips: 107.239.14.24,107.239.14.25,107.239.14.26,107.239.14.27
+ eca_mgmt_net_name: int_eca_mgmt_net_1 \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/SG_ECA_MGMT.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/SG_ECA_MGMT.yaml
new file mode 100644
index 0000000000..53efc5e36e
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/SG_ECA_MGMT.yaml
@@ -0,0 +1,76 @@
+heat_template_version: 2013-05-23
+
+#################################
+#
+# Changes from MSO - 11/5/2015
+# - Parameter changes as below
+# - CDLs for vmNames, IPs
+# - aZone->availability_zone_0
+# - nwName->{nwRole}_net_name
+# - nwID->{nwRole}_net_id
+# - vmName->{vmType}_names
+# - ips ->{vmType}_{nwRole}_ips
+# - fips->{vmType}_{nwRole}_floating_ip
+# - added replacement_policy: AUTO to all ports
+# - added vnf_id for metadata to all servers
+# - externalized security group resource
+# - externalized eca_mgmt network
+#
+#################################
+
+description: >
+ HOT template that creates Security Group and ECA network
+
+parameters:
+ eca_mgmt_name:
+ type: string
+ label: eca management name
+ description: eca management name
+ eca_mgmt_start:
+ type: string
+ label: eca management start
+ description: eca management start
+ eca_mgmt_end:
+ type: string
+ label: eca management end
+ description: eca management end
+ eca_mgmt_cidr:
+ type: string
+ label: eca management cidr
+ description: eca management cidr
+ eca_mgmt_netmask:
+ type: string
+ label: ECA mgmt network subnet mask
+ description: ECA mgmt network subnet mask
+ security_group_name:
+ type: string
+ label: MMSC security group name
+ description: MMSC security group name
+
+resources:
+ mms_security_group:
+ type: OS::Neutron::SecurityGroup
+ properties:
+ description: mmsc security group
+ name: {get_param: security_group_name}
+ rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}
+ ]
+ eca_mgmt_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: {get_param: eca_mgmt_name}
+
+ eca_mgmt_network_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: eca_mgmt_name}
+ allocation_pools: [{"start": {get_param: eca_mgmt_start}, "end": {get_param: eca_mgmt_end}}]
+ cidr: {get_param: eca_mgmt_cidr}
+ #enable_dhcp: false
+ #gateway_ip: null
+ network_id: {get_resource: eca_mgmt_net}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/cmaui.env b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/cmaui.env
new file mode 100644
index 0000000000..d37e1eedc2
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/cmaui.env
@@ -0,0 +1,17 @@
+parameters:
+ cmaui_names: ZRDM1MMSC02CMI001,ZRDM1MMSC02CMI002
+ cmaui_flavor: m1.large
+ cmaui_image: cmaui-5.0.2.5_v25
+ cmaui_cinder_volume_size: 55
+ oam_net_name: oam_protected_net_0
+ oam_network_netmask: 255.255.254.0
+ oam_network_gateway: 107.250.172.1
+ oam_network_netmask: 255.255.255.192
+ oam_network_gateway: 10.20.30.1
+ external_dns: 155.165.201.250
+ external_ntp: 155.165.194.100
+ security_group_name: mmsc_security_group_1
+ availability_zone_0: nova
+ timezone: UTC
+ cmaui_oam_ips: 107.250.172.42,107.250.172.43
+ CMAUI_volume_type: Platinum \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/cmaui.yml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/cmaui.yml
new file mode 100644
index 0000000000..0b925e2d85
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/cmaui.yml
@@ -0,0 +1,202 @@
+heat_template_version: 2013-05-23
+
+#################################
+#
+# Changes from MSO 01/26/2016
+# Updated per ECOMP feedback
+#
+#################################
+
+description: cmaui server template for vMMSC
+
+parameters:
+ vnf_id:
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-CMAUI_id
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_cinder_volume_size:
+ type: number
+ label: CMAUI Cinder volume size
+ description: the size of the CMAUI Cinder volume
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ oam_net_name:
+ type: string
+ description: UID of OAM network
+ oam_network_netmask:
+ type: string
+ label: oam network netmask
+ description: oam network gateway
+ oam_network_gateway:
+ type: string
+ label: oam network gateway
+ description: oam network gateway
+ external_dns:
+ type: string
+ label: dns server
+ description: dns server
+ external_ntp:
+ type: string
+ label: ntp server
+ description: ntp server
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ timezone:
+ type: string
+ label: timezone
+ description: timezone
+ cmaui_oam_ips:
+ type: comma_delimited_list
+ label: CMAUI oam_net IP addresses
+ description: CMAUI oam_net IP addresses
+ CMAUI_volume_type:
+ type: string
+ label: CMAUI vm volume type
+ description: the name of the target volume backend
+
+resources:
+ server_cmaui:
+ type: eca_oam.yaml
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_0 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ cmaui.mgmt.ip=${cmaui.mgmt.ip}
+ cmaui.mgmt.netmask=${cmaui.mgmt.netmask}
+ cmaui.mgmt.gateway=${cmaui.mgmt.gateway}
+ cmaui.external.dns=${cmaui.external.dns}
+ cmaui.external.ntp=${cmaui.external.ntp}
+ cmaui.node=${cmaui.node}
+ cmaui.timezone=${cmaui.timezone}
+ params:
+ ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]}
+ ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${cmaui.external.dns}: {get_param: external_dns}
+ ${cmaui.external.ntp}: {get_param: external_ntp}
+ ${cmaui.node}: {get_param: [cmaui_names, 0]}
+ ${cmaui.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ server_cmaui_2:
+ type: eca_oam_2.yaml
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_0 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ cmaui.mgmt.ip=${cmaui.mgmt.ip}
+ cmaui.mgmt.netmask=${cmaui.mgmt.netmask}
+ cmaui.mgmt.gateway=${cmaui.mgmt.gateway}
+ cmaui.external.dns=${cmaui.external.dns}
+ cmaui.external.ntp=${cmaui.external.ntp}
+ cmaui.node=${cmaui.node}
+ cmaui.timezone=${cmaui.timezone}
+ params:
+ ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]}
+ ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${cmaui.external.dns}: {get_param: external_dns}
+ ${cmaui.external.ntp}: {get_param: external_ntp}
+ ${cmaui.node}: {get_param: [cmaui_names, 0]}
+ ${cmaui.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ cmaui_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: cmaui_cinder_volume_size}
+ volume_type: {get_param: CMAUI_volume_type}
+
+ cmaui_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: cmaui_volume}
+ instance_uuid: {get_resource: server_cmaui}
+
+ cmaui_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_cmaui1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 1]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui1_port_0 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ cmaui.mgmt.ip=${cmaui.mgmt.ip}
+ cmaui.mgmt.netmask=${cmaui.mgmt.netmask}
+ cmaui.mgmt.gateway=${cmaui.mgmt.gateway}
+ cmaui.external.dns=${cmaui.external.dns}
+ cmaui.external.ntp=${cmaui.external.ntp}
+ cmaui.node=${cmaui.node}
+ cmaui.timezone=${cmaui.timezone}
+ params:
+ ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 1]}
+ ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${cmaui.external.dns}: {get_param: external_dns}
+ ${cmaui.external.ntp}: {get_param: external_ntp}
+ ${cmaui.node}: {get_param: [cmaui_names, 1]}
+ ${cmaui.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ cmaui1_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: cmaui_cinder_volume_size}
+ volume_type: {get_param: CMAUI_volume_type}
+
+ cmaui1_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: cmaui1_volume}
+ instance_uuid: {get_resource: server_cmaui1}
+
+ cmaui1_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 1]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/eca_oam.env b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/eca_oam.env
new file mode 100644
index 0000000000..f9991722b3
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/eca_oam.env
@@ -0,0 +1,20 @@
+parameters:
+ eca_names: ZRDM1MMSC02OAM001,ZRDM1MMSC02OAM002
+ arb_names: ZRDM1MMSC02ARB001
+ oam_image_name: ECABASE
+ oam_flavor: lc.xlarge4
+ arbiter_flavor: m1.large2
+ availability_zone_0: nova
+ oam_net_name: oam_protected_net_0
+ eca_mgmt_net_name: int_mms_eca_mgmt_net_1
+ eca_oam_ips: 107.250.172.44,107.250.172.45
+ eca_eca_mgmt_ips: 172.25.137.242,172.25.137.243
+ eca_oam_gateway: 107.250.172.1
+ arb_oam_ips: 107.250.172.46
+ arb_eca_mgmt_ips: 172.25.137.244
+ security_group_name: mmsc_security_group_1
+ oam_volume_size: 1800
+ arb_volume_size: 40
+ swift_eca_url: http://object-store.rdm2.cci.com:8080/v1/AUTH_1bbab536a19b4756926e7d0ec1eb543c/eca
+ ECA_OAM_volume_type: Platinum
+ ARB_volume_type: Platinum
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/eca_oam.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/eca_oam.yaml
new file mode 100644
index 0000000000..b9fa48615c
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/eca_oam.yaml
@@ -0,0 +1,383 @@
+heat_template_version: 2013-05-23
+
+##########################################################
+#
+# Changes from MSO
+# - Updated per ECOMP Feedback
+#
+#
+##########################################################
+
+description: This stack creates two ECA OAM VM and one ARB VM
+
+parameters:
+ vnf_id:
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-ECA_id
+ eca_names:
+ type: comma_delimited_list
+ label: oam servers names
+ description: the names of the OAM1,OAM2 VM instances
+ arb_names:
+ type: comma_delimited_list
+ label: arbiter server names
+ description: the names of the arbiter VM instances
+ oam_image_name:
+ type: string
+ label: image name
+ description: the OAM image name
+ oam_flavor:
+ type: string
+ label: flavor name
+ description: OAM flavor name
+ arbiter_flavor:
+ type: string
+ label: flavor name
+ description: arbiter flavor name
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ oam_net_name:
+ type: string
+ label: oam network name
+ description: the name of the oam network
+ eca_mgmt_net_name:
+ type: string
+ label: internal network name
+ description: the name of the internal network
+ eca_oam_ips:
+ type: comma_delimited_list
+ label: oam network ips
+ description: the ips of oam networks for eca VM
+ eca_oam_gateway:
+ type: string
+ label: oam1 oam gateway
+ description: the ip of oam gateway
+ eca_eca_mgmt_ips:
+ type: comma_delimited_list
+ label: eca_mgmt network ips for eca VM
+ description: internal eca_mgmt network ips for eca VM
+ arb_oam_ips:
+ type: comma_delimited_list
+ label: oam network ips for arb VM
+ description: oam network ips for eca VM
+ arb_eca_mgmt_ips:
+ type: comma_delimited_list
+ label: eca_mgmt network ips
+ description: internal eca_mgmt network ips for arb VM
+ eca_oam_gateway:
+ type: string
+ label: oam network gateway
+ description: oam network gateway
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ oam_volume_size:
+ type: number
+ label: volume size
+ description: the size of the OAM volume
+ arb_volume_size:
+ type: number
+ label: volume size
+ description: the size of the ARB volume
+ swift_eca_url:
+ type: string
+ label: Swift URL
+ description: Base URL for eca swift object store
+ ECA_OAM_volume_type:
+ type: string
+ label: eca oam vm volume type
+ description: the name of the target volume backend
+ ARB_volume_type:
+ type: string
+ label: arb vm volume type
+ description: the name of the target volume backend
+
+resources:
+ oam1_instance:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: [eca_names, 0]}
+ image: {get_param: oam_image_name}
+ flavor: {get_param: oam_flavor}
+ availability_zone: {get_param: availability_zone_0}
+ networks:
+ - port: {get_resource: oam1_int_port}
+ - port: {get_resource: oam1_mgmt_port}
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ sed -i s/HOSTNAME.*/"HOSTNAME=oam1_hostname"/g /etc/sysconfig/network
+ eth1_ip_address='oam1_mgt_ip'
+ eth1_gateway='oam_gateway'
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ mkdir /etc/puppet/files/roles/transcoder
+ mkdir /etc/puppet/files/roles/oam_primary
+ curl swift_url/etc/puppet/manifests/roles/oam_primary.pp > /etc/puppet/manifests/roles/oam_primary.pp
+ curl swift_url/etc/puppet/manifests/roles/transcoder.pp > /etc/puppet/manifests/roles/transcoder.pp
+ curl swift_url/etc/puppet/files/roles/oam_primary/config.yaml > /etc/puppet/files/roles/oam_primary/config.yaml
+ curl swift_url/etc/puppet/files/roles/transcoder/config.yaml > /etc/puppet/files/roles/transcoder/config.yaml
+ curl swift_url/etc/puppet/files/roles/transcoder/hpm.conf > /etc/puppet/files/roles/transcoder/hpm.conf
+ curl swift_url/etc/puppet/files/roles/transcoder/trx.conf > /etc/puppet/files/roles/transcoder/trx.conf
+ curl swift_url/etc/puppet/files/roles/transcoder/plugins-mo.conf > /etc/puppet/files/roles/transcoder/plugins-mo.conf
+ curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
+ curl swift_url/etc/puppet/manifests/site.pp > /etc/puppet/manifests/site.pp
+ curl swift_url/scripts/van-init-replicaset > /usr/sbin/van-init-replicaset
+ van-role oam_primary > /root/startup-van-role.out
+ curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
+ fdisk /dev/vdb < /root/fdisk-keystrokes
+ curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
+ chmod 755 /root/os-conf-cinder-vol
+ /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
+ params:
+ oam1_mgt_ip: {get_param: [eca_oam_ips, 0] }
+ oam_gateway: {get_param: eca_oam_gateway }
+ oam1_hostname: {get_param: [eca_names, 0]}
+ swift_url: {get_param: swift_eca_url}
+
+ oam1_mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ oam1_int_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: eca_mgmt_net_name}
+ fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ oam1_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: oam_volume_size}
+ volume_type: {get_param: ECA_OAM_volume_type}
+
+ oam1_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: oam1_volume}
+ instance_uuid: {get_resource: oam1_instance}
+
+ oam2_instance:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: [eca_names, 1]}
+ image: {get_param: oam_image_name}
+ flavor: {get_param: oam_flavor}
+ availability_zone: {get_param: availability_zone_0}
+ networks:
+ - port: {get_resource: oam2_int_port}
+ - port: {get_resource: oam2_mgmt_port}
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ sed -i s/HOSTNAME.*/"HOSTNAME=oam2_hostname"/g /etc/sysconfig/network
+ eth1_ip_address='oam2_mgt_ip'
+ eth1_gateway='oam_gateway'
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ curl swift_url/etc/puppet/manifests/roles/oam_secondary.pp > /etc/puppet/manifests/roles/oam_secondary.pp
+ curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml
+ curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
+ van-role oam_secondary > /root/startup-van-role.out
+ curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
+ fdisk /dev/vdb < /root/fdisk-keystrokes
+ curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
+ chmod 755 /root/os-conf-cinder-vol
+ /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
+
+ params:
+ oam2_mgt_ip: {get_param: [eca_oam_ips, 1] }
+ oam2_hostname: {get_param: [eca_names, 1]}
+ swift_url: {get_param: swift_eca_url}
+ oam_gateway: {get_param: eca_oam_gateway }
+
+ oam2_mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 1]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ oam2_int_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: eca_mgmt_net_name}
+ fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 1]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ oam2_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: oam_volume_size}
+ volume_type: {get_param: ECA_OAM_volume_type}
+
+ oam2_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: oam2_volume}
+ instance_uuid: {get_resource: oam2_instance}
+
+ arb_instance:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: [arb_names, 0]}
+ image: {get_param: oam_image_name}
+ flavor: {get_param: arbiter_flavor}
+ availability_zone: {get_param: availability_zone_0}
+ networks:
+ - port: {get_resource: arb_int_port}
+ - port: {get_resource: arb_mgmt_port}
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ sed -i s/HOSTNAME.*/"HOSTNAME=arb_hostname"/g /etc/sysconfig/network
+ eth1_ip_address='arb_mgt_ip'
+ eth1_gateway='oam_gateway'
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ curl swift_url/etc/puppet/manifests/roles/oam_arbiter.pp > /etc/puppet/manifests/roles/oam_arbiter.pp
+ curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml
+ curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
+ van-role oam_arbiter > /root/startup-van-role.out
+ curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
+ fdisk /dev/vdb < /root/fdisk-keystrokes
+ curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
+ chmod 755 /root/os-conf-cinder-vol
+ /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
+ params:
+ arb_mgt_ip: {get_param: [arb_oam_ips, 0] }
+ arb_hostname: {get_param: [arb_names, 0]}
+ swift_url: {get_param: swift_eca_url}
+ oam_gateway: {get_param: eca_oam_gateway }
+
+ arb_mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [arb_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ arb_int_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: eca_mgmt_net_name}
+ fixed_ips: [{"ip_address": {get_param: [arb_eca_mgmt_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ arb_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: arb_volume_size}
+ volume_type: {get_param: ARB_volume_type}
+ arb_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: arb_volume}
+ instance_uuid: {get_resource: arb_instance}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/eca_oam_2.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/eca_oam_2.yaml
new file mode 100644
index 0000000000..b9fa48615c
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/eca_oam_2.yaml
@@ -0,0 +1,383 @@
+heat_template_version: 2013-05-23
+
+##########################################################
+#
+# Changes from MSO
+# - Updated per ECOMP Feedback
+#
+#
+##########################################################
+
+description: This stack creates two ECA OAM VM and one ARB VM
+
+parameters:
+ vnf_id:
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-ECA_id
+ eca_names:
+ type: comma_delimited_list
+ label: oam servers names
+ description: the names of the OAM1,OAM2 VM instances
+ arb_names:
+ type: comma_delimited_list
+ label: arbiter server names
+ description: the names of the arbiter VM instances
+ oam_image_name:
+ type: string
+ label: image name
+ description: the OAM image name
+ oam_flavor:
+ type: string
+ label: flavor name
+ description: OAM flavor name
+ arbiter_flavor:
+ type: string
+ label: flavor name
+ description: arbiter flavor name
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ oam_net_name:
+ type: string
+ label: oam network name
+ description: the name of the oam network
+ eca_mgmt_net_name:
+ type: string
+ label: internal network name
+ description: the name of the internal network
+ eca_oam_ips:
+ type: comma_delimited_list
+ label: oam network ips
+ description: the ips of oam networks for eca VM
+ eca_oam_gateway:
+ type: string
+ label: oam1 oam gateway
+ description: the ip of oam gateway
+ eca_eca_mgmt_ips:
+ type: comma_delimited_list
+ label: eca_mgmt network ips for eca VM
+ description: internal eca_mgmt network ips for eca VM
+ arb_oam_ips:
+ type: comma_delimited_list
+ label: oam network ips for arb VM
+ description: oam network ips for eca VM
+ arb_eca_mgmt_ips:
+ type: comma_delimited_list
+ label: eca_mgmt network ips
+ description: internal eca_mgmt network ips for arb VM
+ eca_oam_gateway:
+ type: string
+ label: oam network gateway
+ description: oam network gateway
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ oam_volume_size:
+ type: number
+ label: volume size
+ description: the size of the OAM volume
+ arb_volume_size:
+ type: number
+ label: volume size
+ description: the size of the ARB volume
+ swift_eca_url:
+ type: string
+ label: Swift URL
+ description: Base URL for eca swift object store
+ ECA_OAM_volume_type:
+ type: string
+ label: eca oam vm volume type
+ description: the name of the target volume backend
+ ARB_volume_type:
+ type: string
+ label: arb vm volume type
+ description: the name of the target volume backend
+
+resources:
+ oam1_instance:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: [eca_names, 0]}
+ image: {get_param: oam_image_name}
+ flavor: {get_param: oam_flavor}
+ availability_zone: {get_param: availability_zone_0}
+ networks:
+ - port: {get_resource: oam1_int_port}
+ - port: {get_resource: oam1_mgmt_port}
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ sed -i s/HOSTNAME.*/"HOSTNAME=oam1_hostname"/g /etc/sysconfig/network
+ eth1_ip_address='oam1_mgt_ip'
+ eth1_gateway='oam_gateway'
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ mkdir /etc/puppet/files/roles/transcoder
+ mkdir /etc/puppet/files/roles/oam_primary
+ curl swift_url/etc/puppet/manifests/roles/oam_primary.pp > /etc/puppet/manifests/roles/oam_primary.pp
+ curl swift_url/etc/puppet/manifests/roles/transcoder.pp > /etc/puppet/manifests/roles/transcoder.pp
+ curl swift_url/etc/puppet/files/roles/oam_primary/config.yaml > /etc/puppet/files/roles/oam_primary/config.yaml
+ curl swift_url/etc/puppet/files/roles/transcoder/config.yaml > /etc/puppet/files/roles/transcoder/config.yaml
+ curl swift_url/etc/puppet/files/roles/transcoder/hpm.conf > /etc/puppet/files/roles/transcoder/hpm.conf
+ curl swift_url/etc/puppet/files/roles/transcoder/trx.conf > /etc/puppet/files/roles/transcoder/trx.conf
+ curl swift_url/etc/puppet/files/roles/transcoder/plugins-mo.conf > /etc/puppet/files/roles/transcoder/plugins-mo.conf
+ curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
+ curl swift_url/etc/puppet/manifests/site.pp > /etc/puppet/manifests/site.pp
+ curl swift_url/scripts/van-init-replicaset > /usr/sbin/van-init-replicaset
+ van-role oam_primary > /root/startup-van-role.out
+ curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
+ fdisk /dev/vdb < /root/fdisk-keystrokes
+ curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
+ chmod 755 /root/os-conf-cinder-vol
+ /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
+ params:
+ oam1_mgt_ip: {get_param: [eca_oam_ips, 0] }
+ oam_gateway: {get_param: eca_oam_gateway }
+ oam1_hostname: {get_param: [eca_names, 0]}
+ swift_url: {get_param: swift_eca_url}
+
+ oam1_mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ oam1_int_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: eca_mgmt_net_name}
+ fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ oam1_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: oam_volume_size}
+ volume_type: {get_param: ECA_OAM_volume_type}
+
+ oam1_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: oam1_volume}
+ instance_uuid: {get_resource: oam1_instance}
+
+ oam2_instance:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: [eca_names, 1]}
+ image: {get_param: oam_image_name}
+ flavor: {get_param: oam_flavor}
+ availability_zone: {get_param: availability_zone_0}
+ networks:
+ - port: {get_resource: oam2_int_port}
+ - port: {get_resource: oam2_mgmt_port}
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ sed -i s/HOSTNAME.*/"HOSTNAME=oam2_hostname"/g /etc/sysconfig/network
+ eth1_ip_address='oam2_mgt_ip'
+ eth1_gateway='oam_gateway'
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ curl swift_url/etc/puppet/manifests/roles/oam_secondary.pp > /etc/puppet/manifests/roles/oam_secondary.pp
+ curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml
+ curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
+ van-role oam_secondary > /root/startup-van-role.out
+ curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
+ fdisk /dev/vdb < /root/fdisk-keystrokes
+ curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
+ chmod 755 /root/os-conf-cinder-vol
+ /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
+
+ params:
+ oam2_mgt_ip: {get_param: [eca_oam_ips, 1] }
+ oam2_hostname: {get_param: [eca_names, 1]}
+ swift_url: {get_param: swift_eca_url}
+ oam_gateway: {get_param: eca_oam_gateway }
+
+ oam2_mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 1]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ oam2_int_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: eca_mgmt_net_name}
+ fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 1]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ oam2_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: oam_volume_size}
+ volume_type: {get_param: ECA_OAM_volume_type}
+
+ oam2_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: oam2_volume}
+ instance_uuid: {get_resource: oam2_instance}
+
+ arb_instance:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: [arb_names, 0]}
+ image: {get_param: oam_image_name}
+ flavor: {get_param: arbiter_flavor}
+ availability_zone: {get_param: availability_zone_0}
+ networks:
+ - port: {get_resource: arb_int_port}
+ - port: {get_resource: arb_mgmt_port}
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ sed -i s/HOSTNAME.*/"HOSTNAME=arb_hostname"/g /etc/sysconfig/network
+ eth1_ip_address='arb_mgt_ip'
+ eth1_gateway='oam_gateway'
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ curl swift_url/etc/puppet/manifests/roles/oam_arbiter.pp > /etc/puppet/manifests/roles/oam_arbiter.pp
+ curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml
+ curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
+ van-role oam_arbiter > /root/startup-van-role.out
+ curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
+ fdisk /dev/vdb < /root/fdisk-keystrokes
+ curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
+ chmod 755 /root/os-conf-cinder-vol
+ /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
+ params:
+ arb_mgt_ip: {get_param: [arb_oam_ips, 0] }
+ arb_hostname: {get_param: [arb_names, 0]}
+ swift_url: {get_param: swift_eca_url}
+ oam_gateway: {get_param: eca_oam_gateway }
+
+ arb_mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [arb_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ arb_int_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: eca_mgmt_net_name}
+ fixed_ips: [{"ip_address": {get_param: [arb_eca_mgmt_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ arb_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: arb_volume_size}
+ volume_type: {get_param: ARB_volume_type}
+ arb_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: arb_volume}
+ instance_uuid: {get_resource: arb_instance}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/sg_eca_mgmt.env b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/sg_eca_mgmt.env
new file mode 100644
index 0000000000..8012063ac0
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/sg_eca_mgmt.env
@@ -0,0 +1,7 @@
+parameters:
+ eca_mgmt_name: int_eca_mgmt_net_1
+ eca_mgmt_cidr: 172.25.137.192/26
+ eca_mgmt_netmask: 255.255.255.192
+ eca_mgmt_start: 172.25.137.195
+ eca_mgmt_end: 172.25.137.254
+ security_group_name: mmsc_security_group_1
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload/MANIFEST.json b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload/MANIFEST.json
new file mode 100644
index 0000000000..2ff7eec20e
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload/MANIFEST.json
@@ -0,0 +1,20 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create vmme 2 fsb 2 ncb 2 gbp 2 vlc",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "vmme_small_create_fsb.yml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "vmme_small_create_fsb.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },{
+ "file": "create_stack.sh",
+ "type": "SHELL"
+ }
+ ]
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload/create_stack.sh b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload/create_stack.sh
new file mode 100644
index 0000000000..186d1c34fb
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload/create_stack.sh
@@ -0,0 +1 @@
+heat stack-create vMME -e vmme_small.env -f vmme_small.yml
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload/vmme_small_create_fsb.env b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload/vmme_small_create_fsb.env
new file mode 100644
index 0000000000..750bb2dd44
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload/vmme_small_create_fsb.env
@@ -0,0 +1,8 @@
+parameters:
+ volume_type: Gold
+ volume_size: 320
+ FSB_1_image: MME_FSB1_15B-CP04-r5a01
+ FSB_2_image: MME_FSB2_15B-CP04-r5a01
+ FSB1_volume_name: vFSB1_1_Vol_1
+ FSB2_volume_name: vFSB2_1_Vol_1
+
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload/vmme_small_create_fsb.yml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload/vmme_small_create_fsb.yml
new file mode 100644
index 0000000000..2d695a50c1
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload/vmme_small_create_fsb.yml
@@ -0,0 +1,54 @@
+heat_template_version: 2013-05-23
+
+description: server template for vMME
+
+parameters:
+
+ volume_type:
+ type: string
+ label: volume type
+ description: volume type Gold
+
+ volume_size:
+ type: number
+ label: volume size
+ description: my volume size 320GB
+
+ FSB_1_image:
+ type: string
+ label: MME_FSB1
+ description: MME_FSB1_15B-CP04-r5a01
+
+ FSB_2_image:
+ type: string
+ label: MME_FSB2
+ description: MME_FSB2_15B-CP04-r5a01
+
+ FSB1_volume_name:
+ type: string
+ label: FSB1_volume
+ description: FSB1_volume_1
+
+ FSB2_volume_name:
+ type: string
+ label: FSB2_volume
+ description: FSB2_volume_1
+
+resources:
+
+ FSB1_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: volume_size}
+ volume_type: {get_param: volume_type}
+ name: {get_param: FSB1_volume_name}
+ image: {get_param: FSB_1_image}
+
+ FSB2_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: volume_size}
+ volume_type: {get_param: volume_type}
+ name: {get_param: FSB2_volume_name}
+ image: {get_param: FSB_2_image}
+
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/MANIFEST.json b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/MANIFEST.json
new file mode 100644
index 0000000000..02733a6e3f
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/MANIFEST.json
@@ -0,0 +1,29 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create vmme 2 fsb 2 ncb 2 gbp 2 vlc",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "vmme_small.yml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "vmme_small.env",
+ "type": "HEAT_ENV"
+ },{
+ "file": "vmme_small_create_fsb.yml",
+ "type": "HEAT_NET",
+ "data":[
+ {
+ "file": "vmme_small_create_fsb.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ }
+ ]
+ },{
+ "file": "create_stack.sh",
+ "type": "SHELL"
+ }
+ ]
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/create_stack.sh b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/create_stack.sh
new file mode 100644
index 0000000000..186d1c34fb
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/create_stack.sh
@@ -0,0 +1 @@
+heat stack-create vMME -e vmme_small.env -f vmme_small.yml
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/vmme_small.env b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/vmme_small.env
new file mode 100644
index 0000000000..e46cfd2a2d
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/vmme_small.env
@@ -0,0 +1,97 @@
+parameters:
+ oam_net_id: 47bf4cca-0961-422f-bcd6-d5a4fbb1a351
+ fsb1-name: ZRDM1MMEX33FSB001
+ fsb2-name: ZRDM1MMEX33FSB002
+ ncb1-name: ZRDM1MMEX33NCB001
+ ncb2-name: ZRDM1MMEX33NCB002
+ vlc1-name: ZRDM1MMEX33VLC002
+ vlc2-name: ZRDM1MMEX33VLC002
+ gpb1-name: ZRDM1MMEX33GPB001
+ gpb2-name: ZRDM1MMEX33GPB002
+ epc-sctp-a-net-name: EPC-SCTP-A
+ epc-sctp-a-net-rt: 13979:105717
+ epc-sctp-a-net-cidr: 107.243.37.0/27
+ epc-sctp-a-net-gateway: 107.243.37.1
+ epc-sctp-a-pool-start: 107.243.37.3
+ epc-sctp-a-pool-end: 107.243.37.30
+ epc-sctp-b-net-name: EPC-SCTP-B
+ epc-sctp-b-net-rt: 13979:105719
+ epc-sctp-b-net-cidr: 107.243.37.32/24
+ epc-sctp-b-net-gateway: 107.243.37.33
+ epc-sctp-b-pool-start: 107.243.37.35
+ epc-sctp-b-pool-end: 107.243.37.62
+ epc-gtp-net-name: EPC-GTP
+ epc-gtp-net-rt: 13979:105715
+ epc-gtp-net-cidr: 107.243.37.64/27
+ epc-gtp-net-gateway: 107.243.37.65
+ epc-gtp-pool-start: 107.243.37.67
+ epc-gtp-pool-end: 107.243.37.94
+ fsb1-image: MME_FSB1_15B-CP04-r5a01
+ fsb2-image: MME_FSB2_15B-CP04-r5a01
+ fsb1-flavor: m4.xlarge4
+ fsb2-flavor: m4.xlarge4
+ fsb_zone: nova
+ fsb1-Internal1-mac: 00:80:37:0E:0B:12
+ fsb1-Internal2-mac: 00:81:37:0E:0B:12
+ fsb1-oam-ip: 107.250.172.221
+ fsb2-Internal1-mac: 00:80:37:0E:0D:12
+ fsb2-Internal2-mac: 00:81:37:0E:0D:12
+ fsb2-oam-ip: 107.250.172.222
+ pxe-image: MME_PXE-BOOT_cxp9025898_2r5a01.qcow2
+ ncb-flavor: m4.xlarge4
+ ncb_zone: nova
+ ncb1-Internal1-mac: 00:80:37:0E:09:12
+ ncb1-Internal2-mac: 00:81:37:0E:09:12
+ ncb2-Internal1-mac: 00:80:37:0E:0F:12
+ ncb2-Internal2-mac: 00:81:37:0E:0F:12
+ gpb-flavor: m4.xlarge4
+ gpb_zone: nova
+ gpb1-Internal1-mac: 00:80:37:0E:01:22
+ gpb1-Internal1-ip: 169.254.0.101
+ gpb1-Internal2-mac: 00:81:37:0E:01:22
+ gpb2-Internal1-mac: 00:80:37:0E:02:22
+ gpb2-Internal2-mac: 00:81:37:0E:02:22
+ vlc-flavor: m4.xlarge4
+ vlc_zone: nova
+ vlc1-sctp-a-ip: 107.243.37.3
+ vlc1-sctp-b-ip: 107.243.37.35
+ vlc1-gtp-ip: 107.243.37.67
+ vlc1-oam-ip: 107.250.172.227
+ vlc2-sctp-a-ip: 107.243.37.4
+ vlc2-sctp-b-ip: 107.243.37.36
+ vlc2-gtp-ip: 107.243.37.68
+ vlc2-oam-ip: 107.250.172.228
+ vlc1-Internal1-mac: 00:80:37:0E:01:12
+ vlc1-Internal2-mac: 00:81:37:0E:01:12
+ vlc2-Internal1-mac: 00:80:37:0E:02:12
+ vlc2-Internal2-mac: 00:81:37:0E:02:12
+ Internal1_net_name: vmme_int_int_1
+ Internal1_subnet_name: vmme_int_int_sub_1
+ Internal1_ipam_name: vmme_ipam_int1
+ Internal1_cidr: 169.253.0.0/17
+ Internal1_forwarding_mode: "l2"
+ Internal1_dhcp: "False"
+ Internal1_shared: "False"
+ Internal1_external: "False"
+ Internal1_name: "Internal1-subnet"
+ Internal1_default_gateway: 169.253.0.3
+ Internal1_net_pool_start: 169.253.0.100
+ Internal1_net_pool_end: 169.253.0.254
+ Internal2_net_name: vmme_int_int_2
+ Internal2_subnet_name: vmme_int_int_sub_2
+ Internal2_ipam_name: vmme_ipam_int2
+ Internal2_cidr: 169.255.0.0/17
+ Internal2_shared: "False"
+ Internal2_external: "False"
+ Internal2_forwarding_mode: "l2"
+ Internal2_dhcp: "False"
+ Internal2_name: "Internal2-subnet"
+ Internal2_default_gateway: 169.255.0.3
+ Internal2_net_pool_start: 169.255.0.100
+ Internal2_net_pool_end: 169.255.0.254
+ static_prefix_sctp_a_1: 107.239.40.32/30
+ static_prefix_gtp_1: 107.239.40.96/30
+ static_prefix_sctp_b_1: 107.239.40.64/30
+ VMME_FSB1_boot_volume: 8248e794-6173-4b49-b9c3-8219b0b56f4e
+ VMME_FSB2_boot_volume: 089a0d11-4b15-4370-8343-3f90907b1221
+
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/vmme_small.yml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/vmme_small.yml
new file mode 100644
index 0000000000..ab76c1ce0a
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/vmme_small.yml
@@ -0,0 +1,661 @@
+heat_template_version: 2013-05-23
+
+description: >
+ HOT template to create vmme 2 fsb 2 ncb 2 gbp 2 vlc
+
+parameters:
+ fsb1-oam-ip:
+ type: string
+ fsb2-oam-ip:
+ type: string
+ vlc1-oam-ip:
+ type: string
+ vlc2-oam-ip:
+ type: string
+ Internal1_net_pool_start:
+ type: string
+ Internal1_net_pool_end:
+ type: string
+ Internal2_net_pool_start:
+ type: string
+ Internal2_net_pool_end:
+ type: string
+ Internal1_default_gateway:
+ type: string
+ Internal2_default_gateway:
+ type: string
+ Internal1_shared:
+ type: string
+ Internal1_external:
+ type: string
+ Internal1_net_name:
+ type: string
+ Internal1_subnet_name:
+ type: string
+ Internal1_ipam_name:
+ type: string
+ Internal1_cidr:
+ type: string
+ Internal1_forwarding_mode:
+ type: string
+ Internal1_dhcp:
+ type: string
+ Internal1_name:
+ type: string
+ Internal2_net_name:
+ type: string
+ Internal2_subnet_name:
+ type: string
+ Internal2_ipam_name:
+ type: string
+ Internal2_cidr:
+ type: string
+ Internal2_forwarding_mode:
+ type: string
+ Internal2_dhcp:
+ type: string
+ Internal2_name:
+ type: string
+ Internal2_shared:
+ type: string
+ Internal2_external:
+ type: string
+ vlc1-sctp-a-ip:
+ type: string
+ vlc1-sctp-b-ip:
+ type: string
+ vlc1-gtp-ip:
+ type: string
+ vlc2-sctp-a-ip:
+ type: string
+ vlc2-sctp-b-ip:
+ type: string
+ vlc2-gtp-ip:
+ type: string
+ fsb1-name:
+ type: string
+ description: Name of fsb1
+ fsb2-name:
+ type: string
+ description: Name of fsb1
+ ncb1-name:
+ type: string
+ description: Name of ncb1
+ ncb2-name:
+ type: string
+ description: Name of ncb2
+ vlc1-name:
+ type: string
+ description: Name of vlc1
+ vlc2-name:
+ type: string
+ description: Name of vlc2
+ gpb1-name:
+ type: string
+ description: Name of gpb1
+ gpb2-name:
+ type: string
+ description: Name of gpb2
+ fsb_zone:
+ type: string
+ description: cluster for spawnning fsb instances
+ fsb1-image:
+ type: string
+ description: Name of image to use for server fsb1
+ fsb1-flavor:
+ type: string
+ description: Flavor to use for servers fsb1
+ oam_net_id:
+ type: string
+ description: uuid of oam network
+ fsb1-Internal1-mac:
+ type: string
+ description: static mac address assigned to fsb1-Internal1
+ fsb1-Internal2-mac:
+ type: string
+ description: static mac address assigned to fsb1-Internal2
+ fsb2-image:
+ type: string
+ description: Name of image to use for server fsb2
+ fsb2-flavor:
+ type: string
+ description: Flavor to use for servers fsb2
+ fsb2-Internal1-mac:
+ type: string
+ description: static mac address assigned to fsb2-Internal1
+ fsb2-Internal2-mac:
+ type: string
+ description: static mac address assigned to fsb2-Internal2
+ pxe-image:
+ type: string
+ description: Name of image to use for server ncb
+ ncb-flavor:
+ type: string
+ description: Flavor to use for servers ncb
+ ncb_zone:
+ type: string
+ description: cluster for spawnning ncb instances
+ ncb1-Internal1-mac:
+ type: string
+ description: static mac address assigned to ncb1-Internal1
+ ncb1-Internal2-mac:
+ type: string
+ description: static mac address assigned to ncb1-Internal2
+ ncb2-Internal1-mac:
+ type: string
+ description: static mac address assigned to ncb2-Internal1
+ ncb2-Internal2-mac:
+ type: string
+ description: static mac address assigned to ncb2-Internal2
+ gpb-flavor:
+ type: string
+ description: Flavor to use for servers gpb
+ gpb_zone:
+ type: string
+ description: cluster for spawnning gpb instances
+ gpb1-Internal1-ip:
+ type: string
+ gpb1-Internal1-mac:
+ type: string
+ description: static mac address assigned to gpb1-Internal1
+ gpb1-Internal2-mac:
+ type: string
+ description: static mac address assigned to gpb1-Internal2
+ gpb2-Internal1-mac:
+ type: string
+ description: static mac address assigned to gpb2-Internal1
+ gpb2-Internal2-mac:
+ type: string
+ description: static mac address assigned to gpb2-Internal2
+ vlc-flavor:
+ type: string
+ description: Flavor to use for servers vlc
+ vlc_zone:
+ type: string
+ description: cluster for spawnning vlc instances
+ vlc1-Internal1-mac:
+ type: string
+ description: static mac address assigned to vlc1-Internal1
+ vlc1-Internal2-mac:
+ type: string
+ description: static mac address assigned to vlc1-Internal2
+ vlc2-Internal1-mac:
+ type: string
+ description: static mac address assigned to vlc2-Internal1
+ vlc2-Internal2-mac:
+ type: string
+ description: static mac address assigned to vlc2-Internal2
+ epc-sctp-a-net-name:
+ type: string
+ description: epc-sctp-a net name
+ epc-sctp-a-net-rt:
+ type: string
+ description: epc-sctp-a route target
+ epc-sctp-a-net-cidr:
+ type: string
+ description: epc-sctp-a subnet
+ epc-sctp-a-net-gateway:
+ type: string
+ description: epc-sctp-a-net network gateway
+ epc-sctp-a-pool-start:
+ type: string
+ description: epc-sctp-a-net network ip pool start IP address
+ epc-sctp-a-pool-end:
+ type: string
+ description: epc-sctp-a-net network ip pool end IP address
+ epc-sctp-b-net-name:
+ type: string
+ description: epc-sctp-b net name
+ epc-sctp-b-net-rt:
+ type: string
+ description: epc-sctp-b route target
+ epc-sctp-b-net-cidr:
+ type: string
+ description: epc-sctp-b subnet
+ epc-sctp-b-net-gateway:
+ type: string
+ description: epc-sctp-b-net network gateway
+ epc-sctp-b-pool-start:
+ type: string
+ description: epc-sctp-b-net network ip pool start IP address
+ epc-sctp-b-pool-end:
+ type: string
+ description: epc-sctp-b-net network ip pool end IP address
+ epc-gtp-net-name:
+ type: string
+ description: gtp net name
+ epc-gtp-net-rt:
+ type: string
+ description: gtp route target
+ epc-gtp-net-cidr:
+ type: string
+ description: gtp stubnet
+ epc-gtp-net-gateway:
+ type: string
+ description: gtp network gateway
+ epc-gtp-pool-start:
+ type: string
+ description: gtp network ip pool start IP address
+ epc-gtp-pool-end:
+ type: string
+ description: gtp network ip pool end IP address
+ static_prefix_sctp_a_1:
+ type: string
+ description: Static Prefix
+ static_prefix_sctp_b_1:
+ type: string
+ description: Static Prefix
+ static_prefix_gtp_1:
+ type: string
+ description: Static Prefix
+ VMME_FSB1_boot_volume:
+ type: string
+ VMME_FSB2_boot_volume:
+ type: string
+
+resources:
+ Internal1_ipam:
+ type: OS::Contrail::NetworkIpam
+ properties:
+ name: { get_param: Internal1_ipam_name }
+
+ Internal2_ipam:
+ type: OS::Contrail::NetworkIpam
+ properties:
+ name: { get_param: Internal2_ipam_name }
+
+ Internal1-net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: Internal1_net_name }
+ template: { get_file: create_stack.sh }
+ forwarding_mode: { get_param: Internal1_forwarding_mode }
+ shared: { get_param: Internal1_shared }
+ external: true
+# route_targets: { "Fn::Split" : [ ",", Ref: route_targets ] }
+ testConvertGetParamFunctions:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: Internal1_net_name }
+ forwarding_mode: { get_param: Internal1_forwarding_mode }
+ shared: { get_param: Internal1_shared }
+
+# route_targets: { "Fn::Split" : [ ",", Ref: route_targets ] }
+ testConvertGetAttributeFunctions:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: Internal1_net_name }
+ forwarding_mode: { get_param: Internal1_forwarding_mode }
+ shared: { get_param: Internal1_shared }
+ external: { get_param: Internal1_external }
+# route_targets: { "Fn::Split" : [ ",", Ref: route_targets ] }
+
+ Internal1-subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: Internal1-net }
+ cidr: { get_param: Internal1_cidr }
+ gateway_ip: { get_param: Internal1_default_gateway }
+ enable_dhcp: { get_param: Internal1_dhcp }
+
+
+# Internal1-subnet:
+# type: OS::Contrail::VnSubnet
+# properties:
+# name: { get_param: Internal1_subnet_name }
+# network: { get_resource: Internal1-net }
+# ip_prefix: { get_param: Internal1_cidr }
+ # ipam: { get_resource: Internal1_ipam }
+ # enable_dhcp: { get_param: Internal1_dhcp }
+ # default_gateway: { get_param: Internal1_default_gateway }
+ # allocation_pools:
+ # - start: { get_param: Internal1_net_pool_start }
+ # end: { get_param: Internal1_net_pool_end }
+
+
+
+ Internal2-net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: Internal2_name }
+ forwarding_mode: { get_param: Internal2_forwarding_mode }
+ shared: { get_param: Internal2_shared }
+ external: { get_param: Internal2_external }
+# route_targets: { "Fn::Split" : [ ",", Ref: route_targets ] }
+
+# Internal2-subnet:
+# type: OS::Contrail::VnSubnet
+# properties:
+# name: { get_param: Internal2_subnet_name }
+# network: { get_resource: Internal2-net }
+# ip_prefix: { get_param: Internal2_cidr }
+# ipam: { get_resource: Internal2_ipam }
+# enable_dhcp: { get_param: Internal2_dhcp }
+# default_gateway: { get_param: Internal2_default_gateway }
+# allocation_pools:
+# - start: { get_param: Internal2_net_pool_start }
+# end: { get_param: Internal2_net_pool_end }
+
+ Internal2-subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: Internal2-net }
+ cidr: { get_param: Internal2_cidr }
+ gateway_ip: { get_param: Internal2_default_gateway }
+ enable_dhcp: { get_param: Internal2_dhcp }
+
+ epc-sctp-a-net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: epc-sctp-a-net-name }
+ route_targets: [ get_param: epc-sctp-a-net-rt ]
+
+
+ epc-sctp-a-subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: epc-sctp-a-net }
+ cidr: { get_param: epc-sctp-a-net-cidr }
+ gateway_ip: { get_param: epc-sctp-a-net-gateway }
+ allocation_pools:
+ - start: { get_param: epc-sctp-a-pool-start }
+ end: { get_param: epc-sctp-a-pool-end }
+
+ epc-sctp-b-net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: epc-sctp-b-net-name }
+ route_targets: [ get_param: epc-sctp-b-net-rt ]
+
+ epc-sctp-b-subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: epc-sctp-b-net }
+ cidr: { get_param: epc-sctp-b-net-cidr }
+ gateway_ip: { get_param: epc-sctp-b-net-gateway }
+ allocation_pools:
+ - start: { get_param: epc-sctp-b-pool-start }
+ end: { get_param: epc-sctp-b-pool-end }
+
+ epc-gtp-net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: epc-gtp-net-name }
+ route_targets: [ get_param: epc-gtp-net-rt ]
+
+ epc-gtp-subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: epc-gtp-net }
+ cidr: { get_param: epc-gtp-net-cidr }
+ gateway_ip: { get_param: epc-gtp-net-gateway }
+ allocation_pools:
+ - start: { get_param: epc-gtp-pool-start }
+ end: { get_param: epc-gtp-pool-end }
+
+ FSB1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: fsb1-name }
+ block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB1_boot_volume }, delete_on_termination: "false" }]
+ flavor: { get_param: fsb1-flavor }
+ availability_zone: { get_param: fsb_zone }
+ networks:
+ - port: { get_resource: FSB1_Internal1 }
+ - port: { get_resource: FSB1_Internal2 }
+ - port: { get_resource: FSB1_OAM }
+
+ FSB1_Internal1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: Internal1-net }
+ mac_address: { get_param: fsb1-Internal1-mac }
+
+ FSB1_Internal2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: Internal2-net }
+ mac_address: { get_param: fsb1-Internal2-mac }
+
+ FSB1_OAM:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_param: oam_net_id }
+ fixed_ips:
+ - ip_address: { get_param: fsb1-oam-ip }
+
+ FSB2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: fsb2-name }
+ block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }]
+ flavor: { get_param: fsb2-flavor }
+ availability_zone: { get_param: fsb_zone }
+ networks:
+ - port: { get_resource: FSB2_Internal1 }
+ - port: { get_resource: FSB2_Internal2 }
+ - port: { get_resource: FSB2_OAM }
+
+ FSB2_Internal1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: Internal1-net }
+ mac_address: { get_param: fsb2-Internal1-mac }
+
+
+ FSB2_Internal2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: Internal2-net }
+ mac_address: { get_param: fsb2-Internal2-mac }
+
+ FSB2_OAM:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_param: oam_net_id }
+ fixed_ips:
+ - ip_address: { get_param: fsb2-oam-ip }
+
+ NCB1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: ncb1-name }
+ image: { get_param: pxe-image }
+ flavor: { get_param: ncb-flavor }
+ availability_zone: { get_param: ncb_zone }
+ networks:
+ - port: { get_resource: NCB1_Internal1 }
+ - port: { get_resource: NCB1_Internal2 }
+
+ NCB1_Internal1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: Internal1-net }
+ mac_address: { get_param: ncb1-Internal1-mac }
+
+ NCB1_Internal2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: Internal2-net }
+ mac_address: { get_param: ncb1-Internal2-mac }
+
+ NCB2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: ncb2-name }
+ image: { get_param: pxe-image }
+ flavor: { get_param: ncb-flavor }
+ availability_zone: { get_param: ncb_zone }
+ networks:
+ - port: { get_resource: NCB2_Internal1 }
+ - port: { get_resource: NCB2_Internal2 }
+
+ NCB2_Internal1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: Internal1-net }
+ mac_address: { get_param: ncb2-Internal1-mac }
+
+ NCB2_Internal2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: Internal2-net }
+ mac_address: { get_param: ncb2-Internal2-mac }
+
+ GPB1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: gpb1-name }
+ image: { get_param: pxe-image }
+ flavor: { get_param: gpb-flavor }
+ availability_zone: { get_param: gpb_zone }
+ networks:
+ - port: { get_resource: GPB1_Internal1 }
+ - port: { get_resource: GPB1_Internal2 }
+
+ GPB1_Internal1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: Internal1-net }
+ mac_address: { get_param: gpb1-Internal1-mac }
+
+ GPB1_Internal2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: Internal2-net }
+ mac_address: { get_param: gpb1-Internal2-mac }
+
+ GPB2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: gpb2-name }
+ image: { get_param: pxe-image }
+ flavor: { get_param: gpb-flavor }
+ availability_zone: { get_param: gpb_zone }
+ networks:
+ - port: { get_resource: GPB2_Internal1 }
+ - port: { get_resource: GPB2_Internal2 }
+
+ GPB2_Internal1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: Internal1-net }
+ mac_address: { get_param: gpb2-Internal1-mac }
+
+ GPB2_Internal2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: Internal2-net }
+ mac_address: { get_param: gpb2-Internal2-mac }
+
+ VLC1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: vlc1-name }
+ image: { get_param: pxe-image }
+ flavor: { get_param: vlc-flavor }
+ availability_zone: { get_param: vlc_zone }
+ networks:
+ - port: { get_resource: VLC1_Internal1 }
+ - port: { get_resource: VLC1_Internal2 }
+ - port: { get_resource: VLC1_OAM }
+ - port: { get_resource: VLC1_SCTP_A }
+ - port: { get_resource: VLC1_SCTP_B }
+ - port: { get_resource: VLC1_GTP }
+
+ VLC1_Internal1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: Internal1-net }
+ mac_address: { get_param: vlc1-Internal1-mac }
+
+ VLC1_Internal2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: Internal2-net }
+ mac_address: { get_param: vlc1-Internal2-mac }
+
+ VLC1_OAM:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_param: oam_net_id }
+ fixed_ips:
+ - ip_address: { get_param: vlc1-oam-ip }
+
+ VLC1_SCTP_A:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: epc-sctp-a-net }
+ fixed_ips:
+ - ip_address: { get_param: vlc1-sctp-a-ip }
+
+ VLC1_SCTP_B:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: epc-sctp-b-net }
+ fixed_ips:
+ - ip_address: { get_param: vlc1-sctp-b-ip }
+
+ VLC1_GTP:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: epc-gtp-net }
+ fixed_ips:
+ - ip_address: { get_param: vlc1-gtp-ip }
+
+ VLC2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: vlc2-name }
+ image: { get_param: pxe-image }
+ flavor: { get_param: vlc-flavor }
+ availability_zone: { get_param: vlc_zone }
+ networks:
+ - port: { get_resource: VLC2_Internal1 }
+ - port: { get_resource: VLC2_Internal2 }
+ - port: { get_resource: VLC2_OAM }
+ - port: { get_resource: VLC2_SCTP_A }
+ - port: { get_resource: VLC2_SCTP_B }
+ - port: { get_resource: VLC2_GTP }
+
+
+ VLC2_Internal1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: Internal1-net }
+ mac_address: { get_param: vlc2-Internal1-mac }
+
+ VLC2_OAM:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_param: oam_net_id }
+ fixed_ips:
+ - ip_address: { get_param: vlc2-oam-ip }
+
+ VLC2_Internal2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: Internal2-net }
+ mac_address: { get_param: vlc2-Internal2-mac }
+
+ VLC2_SCTP_A:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: epc-sctp-a-net }
+ fixed_ips:
+ - ip_address: { get_param: vlc2-sctp-a-ip }
+
+ VLC2_SCTP_B:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: epc-sctp-b-net }
+ fixed_ips:
+ - ip_address: { get_param: vlc2-sctp-b-ip }
+
+ VLC2_GTP:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: epc-gtp-net }
+ fixed_ips:
+ - ip_address: { get_param: vlc2-gtp-ip }
+
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/vmme_small_create_fsb.env b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/vmme_small_create_fsb.env
new file mode 100644
index 0000000000..750bb2dd44
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/vmme_small_create_fsb.env
@@ -0,0 +1,8 @@
+parameters:
+ volume_type: Gold
+ volume_size: 320
+ FSB_1_image: MME_FSB1_15B-CP04-r5a01
+ FSB_2_image: MME_FSB2_15B-CP04-r5a01
+ FSB1_volume_name: vFSB1_1_Vol_1
+ FSB2_volume_name: vFSB2_1_Vol_1
+
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/vmme_small_create_fsb.yml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/vmme_small_create_fsb.yml
new file mode 100644
index 0000000000..2d695a50c1
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/vmme_small_create_fsb.yml
@@ -0,0 +1,54 @@
+heat_template_version: 2013-05-23
+
+description: server template for vMME
+
+parameters:
+
+ volume_type:
+ type: string
+ label: volume type
+ description: volume type Gold
+
+ volume_size:
+ type: number
+ label: volume size
+ description: my volume size 320GB
+
+ FSB_1_image:
+ type: string
+ label: MME_FSB1
+ description: MME_FSB1_15B-CP04-r5a01
+
+ FSB_2_image:
+ type: string
+ label: MME_FSB2
+ description: MME_FSB2_15B-CP04-r5a01
+
+ FSB1_volume_name:
+ type: string
+ label: FSB1_volume
+ description: FSB1_volume_1
+
+ FSB2_volume_name:
+ type: string
+ label: FSB2_volume
+ description: FSB2_volume_1
+
+resources:
+
+ FSB1_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: volume_size}
+ volume_type: {get_param: volume_type}
+ name: {get_param: FSB1_volume_name}
+ image: {get_param: FSB_1_image}
+
+ FSB2_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: volume_size}
+ volume_type: {get_param: volume_type}
+ name: {get_param: FSB2_volume_name}
+ image: {get_param: FSB_2_image}
+
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/missingYml/MANIFEST.json b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/missingYml/MANIFEST.json
new file mode 100644
index 0000000000..2ff7eec20e
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/missingYml/MANIFEST.json
@@ -0,0 +1,20 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create vmme 2 fsb 2 ncb 2 gbp 2 vlc",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "vmme_small_create_fsb.yml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "vmme_small_create_fsb.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },{
+ "file": "create_stack.sh",
+ "type": "SHELL"
+ }
+ ]
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/missingYml/create_stack.sh b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/missingYml/create_stack.sh
new file mode 100644
index 0000000000..186d1c34fb
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/missingYml/create_stack.sh
@@ -0,0 +1 @@
+heat stack-create vMME -e vmme_small.env -f vmme_small.yml
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/missingYml/vmme_small_create_fsb.env b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/missingYml/vmme_small_create_fsb.env
new file mode 100644
index 0000000000..750bb2dd44
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/missingYml/vmme_small_create_fsb.env
@@ -0,0 +1,8 @@
+parameters:
+ volume_type: Gold
+ volume_size: 320
+ FSB_1_image: MME_FSB1_15B-CP04-r5a01
+ FSB_2_image: MME_FSB2_15B-CP04-r5a01
+ FSB1_volume_name: vFSB1_1_Vol_1
+ FSB2_volume_name: vFSB2_1_Vol_1
+
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/HEAT.meta b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/HEAT.meta
new file mode 100644
index 0000000000..3981576218
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/HEAT.meta
@@ -0,0 +1,215 @@
+{
+ "importStructure": [
+ {
+ "HEAT": [
+ {
+ "fileName": "hot-nimbus-oam_v1.0.yaml",
+ "env": "hot-nimbus-oam_v1.0.env",
+ "volume": [
+ {
+ "fileName": "hot-nimbus-oam-volumes_v1.0.yaml",
+ "env": "hot-nimbus-oam-volumes_v1.0.env"
+ }
+ ],
+ "nested": [
+ {
+ "fileName": "nested-oam_v1.0.yaml"
+ },
+ {
+ "fileName": "nested-oam_v1.0.yaml"
+ }
+ ],
+ "artifacts": [
+ {
+ "name": "mount_iso_script.sh",
+ "status": "OK"
+ },
+ {
+ "name": "cloud-nimbus.sh",
+ "status": "OK"
+ },
+ {
+ "name": "nimbus-ethernet",
+ "status": "OK"
+ },
+ {
+ "name": "nimbus-ethernet-gw",
+ "status": "OK"
+ }
+ ]
+ },
+ {
+ "fileName": "hot-nimbus-pps_v1.0.yaml",
+ "env": "hot-nimbus-pps_v1.0.env",
+ "nested": [
+ {
+ "fileName": "nested-pps_v1.0.yaml"
+ },
+ {
+ "fileName": "nested-pps_v1.0.yaml"
+ },
+ {
+ "fileName": "nested-pps_v1.0.yaml"
+ },
+ {
+ "fileName": "nested-pps_v1.0.yaml"
+ },
+ {
+ "fileName": "nested-pps_v1.0.yaml"
+ },
+ {
+ "fileName": "nested-pps_v1.0.yaml"
+ }
+ ],
+ "artifacts": [
+ {
+ "name": "mount_iso_script.sh",
+ "status": "OK"
+ },
+ {
+ "name": "cloud-nimbus.sh",
+ "status": "OK"
+ },
+ {
+ "name": "nimbus-ethernet",
+ "status": "OK"
+ },
+ {
+ "name": "nimbus-ethernet-gw",
+ "status": "OK"
+ }
+ ]
+ },
+ {
+ "fileName": "hot-nimbus-psm_v1.0.yaml",
+ "env": "hot-nimbus-psm_v1.0.env",
+ "nested": [
+ {
+ "fileName": "nested-psm_v1.0.yaml"
+ },
+ {
+ "fileName": "nested-psm_v1.0.yaml"
+ },
+ {
+ "fileName": "nested-psm_v1.0.yaml"
+ },
+ {
+ "fileName": "nested-psm_v1.0.yaml"
+ },
+ {
+ "fileName": "nested-psm_v1.0.yaml"
+ },
+ {
+ "fileName": "nested-psm_v1.0.yaml"
+ },
+ {
+ "fileName": "nested-psm_v1.0.yaml"
+ },
+ {
+ "fileName": "nested-psm_v1.0.yaml"
+ },
+ {
+ "fileName": "nested-psm_v1.0.yaml"
+ },
+ {
+ "fileName": "nested-psm_v1.0.yaml"
+ },
+ {
+ "fileName": "nested-psm_v1.0.yaml"
+ },
+ {
+ "fileName": "nested-psm_v1.0.yaml"
+ }
+ ],
+ "artifacts": [
+ {
+ "name": "mount_iso_script.sh",
+ "status": "OK"
+ },
+ {
+ "name": "cloud-nimbus.sh",
+ "status": "OK"
+ },
+ {
+ "name": "nimbus-ethernet",
+ "status": "OK"
+ },
+ {
+ "name": "nimbus-ethernet-gw",
+ "status": "OK"
+ }
+ ]
+ },
+ {
+ "fileName": "hot-nimbus-ppd_v1.0.yaml",
+ "env": "hot-nimbus-ppd_v1.1.env",
+ "nested": [
+ {
+ "fileName": "nested-ppd_v1.0.yaml"
+ },
+ {
+ "fileName": "nested-ppd_v1.0.yaml"
+ },
+ {
+ "fileName": "nested-ppd_v1.0.yaml"
+ },
+ {
+ "fileName": "nested-ppd_v1.0.yaml"
+ }
+ ],
+ "artifacts": [
+ {
+ "name": "mount_iso_script.sh",
+ "status": "OK"
+ },
+ {
+ "name": "cloud-nimbus.sh",
+ "status": "OK"
+ },
+ {
+ "name": "nimbus-ethernet",
+ "status": "OK"
+ },
+ {
+ "name": "nimbus-ethernet-gw",
+ "status": "OK"
+ }
+ ]
+ },
+ {
+ "fileName": "hot-nimbus-pcm_v1.0.yaml",
+ "env": "hot-nimbus-pcm_v1.0.env",
+ "volume": [
+ {
+ "fileName": "hot-nimbus-pcm-volumes_v1.0.yaml",
+ "env": "hot-nimbus-pcm-volumes_v1.0.env"
+ }
+ ],
+ "nested": [
+ {
+ "fileName": "nested-pcm_v1.0.yaml"
+ }
+ ],
+ "artifacts": [
+ {
+ "name": "mount_iso_script.sh",
+ "status": "OK"
+ },
+ {
+ "name": "cloud-nimbus.sh",
+ "status": "OK"
+ },
+ {
+ "name": "nimbus-ethernet",
+ "status": "OK"
+ },
+ {
+ "name": "nimbus-ethernet-gw",
+ "status": "OK"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/MANIFEST.json b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/MANIFEST.json
new file mode 100644
index 0000000000..d85265d118
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/MANIFEST.json
@@ -0,0 +1,113 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-oam_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-oam_v1.0.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "hot-nimbus-oam-volumes_v1.0.yaml",
+ "type": "HEAT_VOL",
+ "data": [
+ {
+ "file": "hot-nimbus-oam-volumes_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "file": "hot-nimbus-pcm_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-pcm_v1.0.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "hot-nimbus-pcm-volumes_v1.0.yaml",
+ "type": "HEAT_VOL",
+ "data": [
+ {
+ "file": "hot-nimbus-pcm-volumes_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "file": "hot-nimbus-ppd_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-ppd_v1.1.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "hot-nimbus-pps_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "hot-nimbus-psm_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-psm_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "nested-oam_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "nested-pcm_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "nested-ppd_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "nested-pps_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "nested-psm_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "mount_iso_script.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "cloud-nimbus.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "nimbus-ethernet",
+ "type": "OTHER"
+ },
+ {
+ "file": "nimbus-ethernet-gw",
+ "type": "OTHER"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/cloud-nimbus.sh b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/cloud-nimbus.sh
new file mode 100644
index 0000000000..8e5a486289
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/cloud-nimbus.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+echo "Running first-boot script"
+FLAG="first-boot.sh"
+echo "First boot run" > ${FLAG}
+echo "$vm_name" >> ${FLAG}
+touch /var/lib/cloud/instance/payload/launch-params
+chmod 644 /var/lib/cloud/instance/payload/launch-params
+#for i in $(ls /sys/class/net); do
+# echo "Restart $i" >> ${FLAG}
+# ifdown ${i}
+# ifup ${i}
+#done
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-oam-volumes_v1.0.env b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-oam-volumes_v1.0.env
new file mode 100644
index 0000000000..b494d8c270
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-oam-volumes_v1.0.env
@@ -0,0 +1,6 @@
+parameters:
+ pcrf_oam_vol_size: 500
+ pcrf_oam_volume_silver-1: Silver
+ pcrf_oam_volume_silver-2: Silver
+ pcrf_oam_vol_name_1: sde1-pcrfx01-oam001-vol-1
+ pcrf_oam_vol_name_2: sde1-pcrfx01-oam001-vol-2 \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-oam-volumes_v1.0.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-oam-volumes_v1.0.yaml
new file mode 100644
index 0000000000..9e120547b4
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-oam-volumes_v1.0.yaml
@@ -0,0 +1,45 @@
+heat_template_version: 2013-05-23
+
+parameters:
+ pcrf_oam_vol_size:
+ type: number
+ label: Cinder volume size
+ description: the size of the Cinder volume
+ pcrf_oam_vol_name_1:
+ type: string
+ label: OAM volume name 1
+ description: Assigning name to volume
+ pcrf_oam_vol_name_2:
+ type: string
+ label: OAM volume name 2
+ description: Assigning name to volume
+ pcrf_oam_volume_silver-1:
+ type: string
+ label: vm volume type
+ description: the name of the target volume backend for OAM1
+ pcrf_oam_volume_silver-2:
+ type: string
+ label: vm volume type
+ description: the name of the target volume backend for OAM2
+
+resources:
+ pcrf_oam_volume_1:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: pcrf_oam_vol_size}
+ volume_type: {get_param: pcrf_oam_volume_silver-1}
+ name: {get_param: pcrf_oam_vol_name_1}
+
+ pcrf_oam_volume_2:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: pcrf_oam_vol_size}
+ volume_type: {get_param: pcrf_oam_volume_silver-2}
+ name: {get_param: pcrf_oam_vol_name_2}
+outputs:
+ pcrf_oam_volume_id_1:
+ description: the oam 001 volume id
+ value: { get_resource: pcrf_oam_volume_1 }
+ pcrf_oam_volume_id_2:
+ description: the oam 002 volume id
+ value: { get_resource: pcrf_oam_volume_2 } \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-oam_v1.0.env b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-oam_v1.0.env
new file mode 100644
index 0000000000..138feb5822
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-oam_v1.0.env
@@ -0,0 +1,18 @@
+parameters:
+ pcrf_oam_server_names: ZRDM1PCRF01OAM001,ZRDM1PCRF01OAM002
+ pcrf_oam_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_oam_flavor_name: lc.4xlarge4
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.111,172.26.16.112
+ pcrf_arbiter_vip: 172.26.16.115
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_oam_net_name: MNS-25180-L-01_oam_protected_net_0
+ pcrf_oam_net_ips: 107.239.64.117,107.239.64.118
+ pcrf_oam_net_gw: 107.239.64.1
+ pcrf_oam_net_mask: 255.255.248.0
+ pcrf_oam_volume_id_1: a4aa05fb-fcdc-457b-8077-6845fdfc3257
+ pcrf_oam_volume_id_2: 93d8fc1f-f1c3-4933-86b2-039881ee910f
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-oam_v1.0.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-oam_v1.0.yaml
new file mode 100644
index 0000000000..2aa1235de2
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-oam_v1.0.yaml
@@ -0,0 +1,109 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates multiple PCRF OAM nodes stack
+
+parameters:
+ pcrf_oam_server_names:
+ type: comma_delimited_list
+ label: PCRF OAM server names
+ description: name of the PCRF OAM instance
+ pcrf_oam_image_name:
+ type: string
+ label: PCRF OAM image name
+ description: PCRF OAM image name
+ pcrf_oam_flavor_name:
+ type: string
+ label: PCRF OAM flavor name
+ description: flavor name of PCRF OAM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_arbiter_vip:
+ type: string
+ label: OAM Arbiter LB VIP
+ description: OAM Arbiter LB VIP
+ pcrf_oam_net_name:
+ type: string
+ label: OAM network name
+ description: OAM network name
+ pcrf_oam_net_ips:
+ type: comma_delimited_list
+ label: OAM network ips
+ description: OAM network ips
+ pcrf_oam_net_gw:
+ type: string
+ label: CPS network gateway
+ description: CPS network gateway
+ pcrf_oam_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_oam_volume_id_1:
+ type: string
+ label: CPS OAM 001 Cinder Volume
+ description: CPS OAM 001 Cinder Volumes
+ pcrf_oam_volume_id_2:
+ type: string
+ label: CPS OAM 002 Cinder Volume
+ description: CPS OAM 002 Cinder Volumes
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_oam_001:
+ type: nested-oam_v1.0.yaml
+ properties:
+ pcrf_oam_server_name: { get_param: [pcrf_oam_server_names, 0] }
+ pcrf_oam_image_name: { get_param: pcrf_oam_image_name }
+ pcrf_oam_flavor_name: { get_param: pcrf_oam_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_oam_volume_id: { get_param: pcrf_oam_volume_id_1 }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_oam_net_name: { get_param: pcrf_oam_net_name }
+ pcrf_oam_net_ip: { get_param: [pcrf_oam_net_ips, 0] }
+ pcrf_oam_net_mask: { get_param: pcrf_oam_net_mask }
+ pcrf_oam_net_gw: { get_param: pcrf_oam_net_gw }
+ pcrf_arbiter_vip: { get_param: pcrf_arbiter_vip }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_oam_002:
+ type: nested-oam_v1.0.yaml
+ depends_on: [server_pcrf_oam_001]
+ properties:
+ pcrf_oam_server_name: { get_param: [pcrf_oam_server_names, 1] }
+ pcrf_oam_image_name: { get_param: pcrf_oam_image_name }
+ pcrf_oam_flavor_name: { get_param: pcrf_oam_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_oam_volume_id: { get_param: pcrf_oam_volume_id_2 }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_oam_net_name: { get_param: pcrf_oam_net_name }
+ pcrf_oam_net_ip: { get_param: [pcrf_oam_net_ips, 1] }
+ pcrf_oam_net_mask: { get_param: pcrf_oam_net_mask }
+ pcrf_oam_net_gw: { get_param: pcrf_oam_net_gw }
+ pcrf_arbiter_vip: { get_param: pcrf_arbiter_vip }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pcm-volumes_v1.0.env b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pcm-volumes_v1.0.env
new file mode 100644
index 0000000000..788365dcd3
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pcm-volumes_v1.0.env
@@ -0,0 +1,4 @@
+parameters:
+ pcrf_pcm_vol_size: 50
+ pcrf_pcm_volume_silver: Silver
+ pcrf_pcm_vol_name_1: sde1-pcrfx01-pcm001-vol-1
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pcm-volumes_v1.0.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pcm-volumes_v1.0.yaml
new file mode 100644
index 0000000000..bcc3e89f71
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pcm-volumes_v1.0.yaml
@@ -0,0 +1,28 @@
+heat_template_version: 2013-05-23
+
+parameters:
+ pcrf_pcm_vol_size:
+ type: number
+ label: Cinder volume size
+ description: the size of the Cinder volume
+ pcrf_pcm_vol_name_1:
+ type: string
+ label: PCM volume name
+ description: Assigning name to volume
+ pcrf_pcm_volume_silver:
+ type: string
+ label: vm volume type
+ description: the name of the target volume backend for PCM
+
+resources:
+ pcrf_pcm_volume_1:
+ type: OS::Cinder::Volume
+ properties:
+ size: { get_param: pcrf_pcm_vol_size }
+ volume_type: { get_param: pcrf_pcm_volume_silver }
+ name: { get_param: pcrf_pcm_vol_name_1 }
+
+outputs:
+ pcrf_pcm_volume_id_1:
+ description: the pcrf_pcm_volume_id
+ value: { get_resource: pcrf_pcm_volume_1 } \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pcm_v1.0.env b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pcm_v1.0.env
new file mode 100644
index 0000000000..82fb510291
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pcm_v1.0.env
@@ -0,0 +1,16 @@
+parameters:
+ pcrf_pcm_server_names: ZRDM1PCRF01PCM001
+ pcrf_pcm_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_pcm_flavor_name: lc.2xlarge4
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.113
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_oam_net_name: MNS-25180-L-01_oam_protected_net_0
+ pcrf_oam_net_ips: 107.239.64.121
+ pcrf_oam_net_gw: 107.239.64.1
+ pcrf_oam_net_mask: 255.255.248.0
+ pcrf_pcm_volume_id_1: 3438a3fe-1241-4390-80f2-d0b86238c40e
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pcm_v1.0.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pcm_v1.0.yaml
new file mode 100644
index 0000000000..2dd7480bfc
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pcm_v1.0.yaml
@@ -0,0 +1,80 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Cluman stack
+
+parameters:
+ pcrf_pcm_server_names:
+ type: comma_delimited_list
+ label: PCRF CM server names
+ description: name of the PCRF CM instance
+ pcrf_pcm_image_name:
+ type: string
+ label: PCRF CM image name
+ description: PCRF CM image name
+ pcrf_pcm_flavor_name:
+ type: string
+ label: PCRF CM flavor name
+ description: flavor name of PCRF CM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_oam_net_name:
+ type: string
+ label: OAM network name
+ description: OAM network name
+ pcrf_oam_net_ips:
+ type: comma_delimited_list
+ label: OAM network ips
+ description: OAM network ips
+ pcrf_oam_net_gw:
+ type: string
+ label: CPS network gateway
+ description: CPS network gateway
+ pcrf_oam_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_pcm_volume_id_1:
+ type: string
+ label: CPS Cluman Cinder Volume
+ description: CPS Cluman Cinder Volume
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_pcm_001:
+ type: nested-pcm_v1.0.yaml
+ properties:
+ pcrf_pcm_server_name: { get_param: [pcrf_pcm_server_names, 0] }
+ pcrf_pcm_image_name: { get_param: pcrf_pcm_image_name }
+ pcrf_pcm_flavor_name: { get_param: pcrf_pcm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_pcm_volume_id: { get_param: pcrf_pcm_volume_id_1 }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_oam_net_name: { get_param: pcrf_oam_net_name }
+ pcrf_oam_net_ip: { get_param: [pcrf_oam_net_ips, 0] }
+ pcrf_oam_net_mask: { get_param: pcrf_oam_net_mask }
+ pcrf_oam_net_gw: { get_param: pcrf_oam_net_gw }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-ppd_v1.0.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-ppd_v1.0.yaml
new file mode 100644
index 0000000000..2fffa0df8c
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-ppd_v1.0.yaml
@@ -0,0 +1,286 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Director stack
+
+parameters:
+ pcrf_ppd_server_names:
+ type: comma_delimited_list
+ label: PCRF PD server names
+ description: name of the PCRF PD instance
+ pcrf_ppd_image_name:
+ type: string
+ label: PCRF PD image name
+ description: PCRF PD image name
+ pcrf_ppd_flavor_name:
+ type: string
+ label: PCRF PD flavor name
+ description: flavor name of PCRF PD instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_lb_internal_vip:
+ type: string
+ label: CPS Internal LB VIP
+ description: CPS Internal LB VIP
+ pcrf_oam_net_name:
+ type: string
+ label: OAM network name
+ description: OAM network name
+ pcrf_oam_net_ips:
+ type: comma_delimited_list
+ label: OAM network ips
+ description: OAM network ips
+ pcrf_oam_net_gw:
+ type: string
+ label: CPS network gateway
+ description: CPS network gateway
+ pcrf_oam_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_lb_management_vip:
+ type: string
+ label: CPS OAM LB VIP
+ description: CPS OAM LB VIP
+ pcrf_gx_net_name:
+ type: string
+ label: Gx network name
+ description: Gx network name
+ pcrf_gx_net_ips:
+ type: comma_delimited_list
+ label: Gx network ips
+ description: Gx network ips
+ pcrf_gx_net_mask:
+ type: string
+ label: Gx network mask
+ description: Gx network mask
+ pcrf_sp_net_name:
+ type: string
+ label: Sp network name
+ description: Sp network name
+ pcrf_sp_net_ips:
+ type: comma_delimited_list
+ label: Sp network ips
+ description: Sp network ips
+ pcrf_sp_net_mask:
+ type: string
+ label: Sp network mask
+ description: Sp network mask
+ pcrf_sy_net_name:
+ type: string
+ label: Sy network name
+ description: Sy network name
+ pcrf_sy_net_ips:
+ type: comma_delimited_list
+ label: Sy network ips
+ description: Sy network ips
+ pcrf_sy_net_mask:
+ type: string
+ label: Sy network mask
+ description: Sy network mask
+ pcrf_rx_net_name:
+ type: string
+ label: Rx network name
+ description: Rx network name
+ pcrf_rx_net_ips:
+ type: comma_delimited_list
+ label: Rx network ips
+ description: Rx network ips
+ pcrf_rx_net_mask:
+ type: string
+ label: Rx network mask
+ description: Rx network mask
+ pcrf_sd_net_name:
+ type: string
+ label: Sd network name
+ description: Sd network name
+ pcrf_sd_net_ips:
+ type: comma_delimited_list
+ label: Sd network ips
+ description: Sd network ips
+ pcrf_sd_net_mask:
+ type: string
+ label: Sd network mask
+ description: Sd network mask
+ pcrf_sgi_sy_net_name:
+ type: string
+ label: Sgi Sy network name
+ description: Sgi Sy network name
+ pcrf_sgi_sy_net_ips:
+ type: comma_delimited_list
+ label: Sgi Sy network ips
+ description: Sgi Sy network ips
+ pcrf_sgi_sy_net_mask:
+ type: string
+ label: Sgi Sy network mask
+ description: Sgi Sy network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_ppd_001:
+ type: nested-ppd_v1.0.yaml
+ properties:
+ pcrf_ppd_server_name: { get_param: [pcrf_ppd_server_names, 0] }
+ pcrf_ppd_image_name: { get_param: pcrf_ppd_image_name }
+ pcrf_ppd_flavor_name: { get_param: pcrf_ppd_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_lb_internal_vip: { get_param: pcrf_lb_internal_vip }
+ pcrf_oam_net_name: { get_param: pcrf_oam_net_name }
+ pcrf_oam_net_ip: { get_param: [pcrf_oam_net_ips, 0] }
+ pcrf_oam_net_mask: { get_param: pcrf_oam_net_mask }
+ pcrf_oam_net_gw: { get_param: pcrf_oam_net_gw }
+ pcrf_lb_management_vip: { get_param: pcrf_lb_management_vip }
+ pcrf_gx_net_name: { get_param: pcrf_gx_net_name }
+ pcrf_gx_net_ip: { get_param: [pcrf_gx_net_ips, 0] }
+ pcrf_gx_net_mask: { get_param: pcrf_gx_net_mask }
+ pcrf_sp_net_name: { get_param: pcrf_sp_net_name }
+ pcrf_sp_net_ip: { get_param: [pcrf_sp_net_ips, 0] }
+ pcrf_sp_net_mask: { get_param: pcrf_sp_net_mask }
+ pcrf_sy_net_name: { get_param: pcrf_sy_net_name }
+ pcrf_sy_net_ip: { get_param: [pcrf_sy_net_ips, 0] }
+ pcrf_sy_net_mask: { get_param: pcrf_sy_net_mask }
+ pcrf_rx_net_name: { get_param: pcrf_rx_net_name }
+ pcrf_rx_net_ip: { get_param: [pcrf_rx_net_ips, 0] }
+ pcrf_rx_net_mask: { get_param: pcrf_rx_net_mask }
+ pcrf_sd_net_name: { get_param: pcrf_sd_net_name }
+ pcrf_sd_net_ip: { get_param: [pcrf_sd_net_ips, 0] }
+ pcrf_sd_net_mask: { get_param: pcrf_sd_net_mask }
+ pcrf_sgi_sy_net_name: { get_param: pcrf_sgi_sy_net_name }
+ pcrf_sgi_sy_net_ip: { get_param: [pcrf_sgi_sy_net_ips, 0] }
+ pcrf_sgi_sy_net_mask: { get_param: pcrf_sgi_sy_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_ppd_002:
+ type: nested-ppd_v1.0.yaml
+ properties:
+ pcrf_ppd_server_name: { get_param: [pcrf_ppd_server_names, 1] }
+ pcrf_ppd_image_name: { get_param: pcrf_ppd_image_name }
+ pcrf_ppd_flavor_name: { get_param: pcrf_ppd_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_lb_internal_vip: { get_param: pcrf_lb_internal_vip }
+ pcrf_oam_net_name: { get_param: pcrf_oam_net_name }
+ pcrf_oam_net_ip: { get_param: [pcrf_oam_net_ips, 1] }
+ pcrf_oam_net_mask: { get_param: pcrf_oam_net_mask }
+ pcrf_oam_net_gw: { get_param: pcrf_oam_net_gw }
+ pcrf_lb_management_vip: { get_param: pcrf_lb_management_vip }
+ pcrf_gx_net_name: { get_param: pcrf_gx_net_name }
+ pcrf_gx_net_ip: { get_param: [pcrf_gx_net_ips, 1] }
+ pcrf_gx_net_mask: { get_param: pcrf_gx_net_mask }
+ pcrf_sp_net_name: { get_param: pcrf_sp_net_name }
+ pcrf_sp_net_ip: { get_param: [pcrf_sp_net_ips, 1] }
+ pcrf_sp_net_mask: { get_param: pcrf_sp_net_mask }
+ pcrf_sy_net_name: { get_param: pcrf_sy_net_name }
+ pcrf_sy_net_ip: { get_param: [pcrf_sy_net_ips, 1] }
+ pcrf_sy_net_mask: { get_param: pcrf_sy_net_mask }
+ pcrf_rx_net_name: { get_param: pcrf_rx_net_name }
+ pcrf_rx_net_ip: { get_param: [pcrf_rx_net_ips, 1] }
+ pcrf_rx_net_mask: { get_param: pcrf_rx_net_mask }
+ pcrf_sd_net_name: { get_param: pcrf_sd_net_name }
+ pcrf_sd_net_ip: { get_param: [pcrf_sd_net_ips, 1] }
+ pcrf_sd_net_mask: { get_param: pcrf_sd_net_mask }
+ pcrf_sgi_sy_net_name: { get_param: pcrf_sgi_sy_net_name }
+ pcrf_sgi_sy_net_ip: { get_param: [pcrf_sgi_sy_net_ips, 1] }
+ pcrf_sgi_sy_net_mask: { get_param: pcrf_sgi_sy_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_ppd_003:
+ type: nested-ppd_v1.0.yaml
+ properties:
+ pcrf_ppd_server_name: { get_param: [pcrf_ppd_server_names, 2] }
+ pcrf_ppd_image_name: { get_param: pcrf_ppd_image_name }
+ pcrf_ppd_flavor_name: { get_param: pcrf_ppd_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_lb_internal_vip: { get_param: pcrf_lb_internal_vip }
+ pcrf_oam_net_name: { get_param: pcrf_oam_net_name }
+ pcrf_oam_net_ip: { get_param: [pcrf_oam_net_ips, 2] }
+ pcrf_oam_net_mask: { get_param: pcrf_oam_net_mask }
+ pcrf_oam_net_gw: { get_param: pcrf_oam_net_gw }
+ pcrf_lb_management_vip: { get_param: pcrf_lb_management_vip }
+ pcrf_gx_net_name: { get_param: pcrf_gx_net_name }
+ pcrf_gx_net_ip: { get_param: [pcrf_gx_net_ips, 2] }
+ pcrf_gx_net_mask: { get_param: pcrf_gx_net_mask }
+ pcrf_sp_net_name: { get_param: pcrf_sp_net_name }
+ pcrf_sp_net_ip: { get_param: [pcrf_sp_net_ips, 2] }
+ pcrf_sp_net_mask: { get_param: pcrf_sp_net_mask }
+ pcrf_sy_net_name: { get_param: pcrf_sy_net_name }
+ pcrf_sy_net_ip: { get_param: [pcrf_sy_net_ips, 2] }
+ pcrf_sy_net_mask: { get_param: pcrf_sy_net_mask }
+ pcrf_rx_net_name: { get_param: pcrf_rx_net_name }
+ pcrf_rx_net_ip: { get_param: [pcrf_rx_net_ips, 2] }
+ pcrf_rx_net_mask: { get_param: pcrf_rx_net_mask }
+ pcrf_sd_net_name: { get_param: pcrf_sd_net_name }
+ pcrf_sd_net_ip: { get_param: [pcrf_sd_net_ips, 2] }
+ pcrf_sd_net_mask: { get_param: pcrf_sd_net_mask }
+ pcrf_sgi_sy_net_name: { get_param: pcrf_sgi_sy_net_name }
+ pcrf_sgi_sy_net_ip: { get_param: [pcrf_sgi_sy_net_ips, 2] }
+ pcrf_sgi_sy_net_mask: { get_param: pcrf_sgi_sy_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_ppd_004:
+ type: nested-ppd_v1.0.yaml
+ properties:
+ pcrf_ppd_server_name: { get_param: [pcrf_ppd_server_names, 3] }
+ pcrf_ppd_image_name: { get_param: pcrf_ppd_image_name }
+ pcrf_ppd_flavor_name: { get_param: pcrf_ppd_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_lb_internal_vip: { get_param: pcrf_lb_internal_vip }
+ pcrf_oam_net_name: { get_param: pcrf_oam_net_name }
+ pcrf_oam_net_ip: { get_param: [pcrf_oam_net_ips, 3] }
+ pcrf_oam_net_mask: { get_param: pcrf_oam_net_mask }
+ pcrf_oam_net_gw: { get_param: pcrf_oam_net_gw }
+ pcrf_lb_management_vip: { get_param: pcrf_lb_management_vip }
+ pcrf_gx_net_name: { get_param: pcrf_gx_net_name }
+ pcrf_gx_net_ip: { get_param: [pcrf_gx_net_ips, 3] }
+ pcrf_gx_net_mask: { get_param: pcrf_gx_net_mask }
+ pcrf_sp_net_name: { get_param: pcrf_sp_net_name }
+ pcrf_sp_net_ip: { get_param: [pcrf_sp_net_ips, 3] }
+ pcrf_sp_net_mask: { get_param: pcrf_sp_net_mask }
+ pcrf_sy_net_name: { get_param: pcrf_sy_net_name }
+ pcrf_sy_net_ip: { get_param: [pcrf_sy_net_ips, 3] }
+ pcrf_sy_net_mask: { get_param: pcrf_sy_net_mask }
+ pcrf_rx_net_name: { get_param: pcrf_rx_net_name }
+ pcrf_rx_net_ip: { get_param: [pcrf_rx_net_ips, 3] }
+ pcrf_rx_net_mask: { get_param: pcrf_rx_net_mask }
+ pcrf_sd_net_name: { get_param: pcrf_sd_net_name }
+ pcrf_sd_net_ip: { get_param: [pcrf_sd_net_ips, 3] }
+ pcrf_sd_net_mask: { get_param: pcrf_sd_net_mask }
+ pcrf_sgi_sy_net_name: { get_param: pcrf_sgi_sy_net_name }
+ pcrf_sgi_sy_net_ip: { get_param: [pcrf_sgi_sy_net_ips, 3] }
+ pcrf_sgi_sy_net_mask: { get_param: pcrf_sgi_sy_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-ppd_v1.1.env b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-ppd_v1.1.env
new file mode 100644
index 0000000000..bb6dfe468c
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-ppd_v1.1.env
@@ -0,0 +1,35 @@
+parameters:
+ pcrf_ppd_server_names: ZRDM1PCRF01PPD001,ZRDM1PCRF01PPD002,ZRDM1PCRF01PPD003,ZRDM1PCRF01PPD004
+ pcrf_ppd_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_ppd_flavor_name: lc.4xlarge4
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.3,172.26.16.4,172.26.16.5,172.26.16.6
+ pcrf_lb_internal_vip: 172.26.16.114
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_oam_net_name: MNS-25180-L-01_oam_protected_net_0
+ pcrf_oam_net_ips: 107.239.64.113,107.239.64.114,107.239.64.115,107.239.64.116
+ pcrf_lb_management_vip: 107.239.64.123
+ pcrf_oam_net_gw: 107.239.64.1
+ pcrf_oam_net_mask: 255.255.248.0
+ pcrf_gx_net_name: Mobisupport-25193-I-INT1_cor_pcrf_gx_net_0
+ pcrf_gx_net_ips: 107.239.24.67,107.239.24.68,107.239.24.69,107.239.24.70
+ pcrf_gx_net_mask: 255.255.255.248
+ pcrf_sp_net_name: Mobisupport-25193-I-INT1_cor_pcrf_sp_net_0
+ pcrf_sp_net_ips: 107.239.24.75,107.239.24.76,107.239.24.77,107.239.24.78
+ pcrf_sp_net_mask: 255.255.255.248
+ pcrf_sy_net_name: Mobisupport-25193-I-INT1_cor_pcrf_sy_net_0
+ pcrf_sy_net_ips: 107.239.24.83,107.239.24.84,107.239.24.85,107.239.24.86
+ pcrf_sy_net_mask: 255.255.255.248
+ pcrf_rx_net_name: Mobisupport-25193-I-INT1_cor_pcrf_rx_net_0
+ pcrf_rx_net_ips: 107.239.24.91,107.239.24.92,107.239.24.93,107.239.24.94
+ pcrf_rx_net_mask: 255.255.255.248
+ pcrf_sd_net_name: Mobisupport-25193-I-INT1_cor_pcrf_sd_net_0
+ pcrf_sd_net_ips: 107.239.24.99,107.239.24.100,107.239.24.101,107.239.24.102
+ pcrf_sd_net_mask: 255.255.255.248
+ pcrf_sgi_sy_net_name: Mobisupport-25193-I-INT1_sgi_pcrf_sy_net_0
+ pcrf_sgi_sy_net_ips: 107.239.26.131,107.239.26.132,107.239.26.133,107.239.26.134
+ pcrf_sgi_sy_net_mask: 255.255.255.248
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pps_v1.0.env b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pps_v1.0.env
new file mode 100644
index 0000000000..340be2b815
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pps_v1.0.env
@@ -0,0 +1,11 @@
+parameters:
+ pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006
+ pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_pps_flavor_name: lc.3xlarge
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pps_v1.0.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pps_v1.0.yaml
new file mode 100644
index 0000000000..05bd6c9318
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pps_v1.0.yaml
@@ -0,0 +1,121 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_names:
+ type: comma_delimited_list
+ label: PCRF PS server names
+ description: PCRF PS server names
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_pps_001:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_002:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 1] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_003:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 2] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_004:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 3] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_005:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 4] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_006:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-psm_v1.0.env b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-psm_v1.0.env
new file mode 100644
index 0000000000..f24e4763c6
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-psm_v1.0.env
@@ -0,0 +1,10 @@
+parameters:
+ pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012
+ pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_psm_flavor_name: lc.4xlarge4
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-psm_v1.0.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-psm_v1.0.yaml
new file mode 100644
index 0000000000..c2d7b05ead
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-psm_v1.0.yaml
@@ -0,0 +1,199 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_names:
+ type: comma_delimited_list
+ label: PCRF SM server names
+ description: name of the PCRF SM instance
+ pcrf_psm_image_name:
+ type: string
+ label: PCRF SM image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_psm_001:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_002:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_003:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_004:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_005:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_006:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_007:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_008:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_009:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_010:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_011:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_012:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-swift-container_v1.0.env b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-swift-container_v1.0.env
new file mode 100644
index 0000000000..5424c1bbf3
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-swift-container_v1.0.env
@@ -0,0 +1,3 @@
+parameters:
+ pcrf_swift_container_name_1: PCRF_Config_Container_1
+ pcrf_swift_container_purge_on_delete_flag_1: false
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-swift-container_v1.0.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-swift-container_v1.0.yaml
new file mode 100644
index 0000000000..9597f234b0
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-swift-container_v1.0.yaml
@@ -0,0 +1,30 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_swift_container_name_1:
+ type: string
+ label: Swift Container name
+ description: Swift Container Name
+ pcrf_swift_container_purge_on_delete_flag_1:
+ type: boolean
+ label: Purge on Delete Flag
+ description: Purge on Delete Flag
+
+resources:
+ pcrf_swift_container_1:
+ type: OS::Swift::Container
+ properties:
+ name: { get_param: pcrf_swift_container_name_1 }
+ PurgeOnDelete: { get_param: pcrf_swift_container_purge_on_delete_flag_1 }
+ X-Container-Read: ".r:*"
+
+outputs:
+ pcrf_swift_container_id_1:
+ description: the pcrf_swift_container_1 id
+ value: { get_resource: pcrf_swift_container_1 }
+ pcrf_swift_container_url_1:
+ description: the pcrf_swift_container_1 url
+ value: { get_attr: [ pcrf_swift_container_1, WebsiteURL ] }
+ \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/mount_iso_script.sh b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/mount_iso_script.sh
new file mode 100644
index 0000000000..da5d9c4e9a
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/mount_iso_script.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+#. .config
+#following would be in the .config file
+ device_name="/dev/vde"
+ install_script="install_nimbus.sh"
+ enable_logic_flag_file=".flag"
+#end of config file
+
+#get the semaphore, 0 - disbaled, 1- enabled
+flag=$(cat ${enable_logic_flag_file})
+
+#check if device is mounted already
+test=$(mount | grep ${device_name})
+if [ "$flag" == "1" ]; then
+ if [ -e ${device_name} ] && [ ! "${test}" ]; then
+ #mount the iso image
+ mount -t iso9660 -v -o loop /dev/vde/ /mnt/iso
+ #if availabe run the install script (it contains the install.sh steps)
+ if [ -e "${install_script}" ] && [ -f "${install_script}" ]; then
+ ${install_script}
+ fi
+ #disable the script from attempting to
+ # mount and run install again until needed;
+ echo "0" > ${enable_logic_flag_file}
+ #if nedeed add step to comment out the crontab line here;
+ fi
+else
+ echo "Auto mounting ISO & run install logic disabled!"
+fi
+
+#cron job
+# * * * * * /mount_iso_script.sh
+
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nested-oam_v1.0.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nested-oam_v1.0.yaml
new file mode 100644
index 0000000000..d3baf41da5
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nested-oam_v1.0.yaml
@@ -0,0 +1,156 @@
+heat_template_version: 2013-05-23
+
+description: nested heat template that creates a PCRF OAM node stack
+
+parameters:
+ pcrf_oam_server_name:
+ type: string
+ label: PCRF OAM server name
+ description: PCRF OAM server name
+ pcrf_oam_image_name:
+ type: string
+ label: image name
+ description: PCRF OAM image name
+ pcrf_oam_flavor_name:
+ type: string
+ label: PCRF OAM flavor name
+ description: flavor name of PCRF OAM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_arbiter_vip:
+ type: string
+ label: OAM Arbiter LB VIP
+ description: OAM Arbiter LB VIP
+ pcrf_oam_net_name:
+ type: string
+ label: OAM network name
+ description: OAM network name
+ pcrf_oam_net_ip:
+ type: string
+ label: OAM network ip
+ description: OAM network ip
+ pcrf_oam_net_gw:
+ type: string
+ label: CPS network gateway
+ description: CPS network gateway
+ pcrf_oam_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_oam_volume_id:
+ type: string
+ label: CPS OAM Cinder Volume
+ description: CPS OAM Cinder Volume
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet }
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth1
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet-gw }
+ params:
+ $dev: eth1
+ $ip: { get_param: pcrf_oam_net_ip }
+ $netmask: { get_param: pcrf_oam_net_mask }
+ $gateway: { get_param: pcrf_oam_net_gw }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+ - ifdown eth1 && ifup eth1
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ template: { get_file: cloud-nimbus.sh }
+ params:
+ $vm_name: { get_param: pcrf_oam_server_name }
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_oam:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_oam_server_name }
+ image: { get_param: pcrf_oam_image_name }
+ flavor: { get_param: pcrf_oam_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: pcrf_oam_port_0}
+ - port: { get_resource: pcrf_oam_port_1}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+
+ pcrf_oam_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ allowed_address_pairs:
+ - ip_address: { get_param: pcrf_arbiter_vip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
+
+ pcrf_oam_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_oam_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_oam_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
+
+ pcrf_oam_vol_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: { get_param: pcrf_oam_volume_id }
+ mountpoint: /dev/vdd
+ instance_uuid: { get_resource: pcrf_server_oam }
+
+outputs:
+ pcrf_oam_vol_attachment_id:
+ description: the pcrf_oam_vol_attachment_id id
+ value: { get_resource: pcrf_oam_vol_attachment }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nested-pcm_v1.0.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nested-pcm_v1.0.yaml
new file mode 100644
index 0000000000..820d09b3dc
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nested-pcm_v1.0.yaml
@@ -0,0 +1,150 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Cluman stack
+
+parameters:
+ pcrf_pcm_server_name:
+ type: string
+ label: PCRF CM server name
+ description: PCRF CM server name
+ pcrf_pcm_image_name:
+ type: string
+ label: image name
+ description: PCRF CM image name
+ pcrf_pcm_flavor_name:
+ type: string
+ label: PCRF CM flavor name
+ description: flavor name of PCRF CM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_oam_net_name:
+ type: string
+ label: OAM network name
+ description: OAM network name
+ pcrf_oam_net_ip:
+ type: string
+ label: OAM network ip
+ description: OAM network ip
+ pcrf_oam_net_gw:
+ type: string
+ label: CPS network gateway
+ description: CPS network gateway
+ pcrf_oam_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_pcm_volume_id:
+ type: string
+ label: CPS Cluman Cinder Volume
+ description: CPS Cluman Cinder Volume
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet }
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth1
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet-gw }
+ params:
+ $dev: eth1
+ $ip: { get_param: pcrf_oam_net_ip }
+ $netmask: { get_param: pcrf_oam_net_mask }
+ $gateway: { get_param: pcrf_oam_net_gw }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+ - ifdown eth1 && ifup eth1
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ template: { get_file: cloud-nimbus.sh }
+ params:
+ $vm_name: { get_param: pcrf_pcm_server_name }
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_pcm:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_pcm_server_name }
+ image: { get_param: pcrf_pcm_image_name }
+ flavor: { get_param: pcrf_pcm_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: pcrf_pcm_port_0}
+ - port: { get_resource: pcrf_pcm_port_1}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+
+ pcrf_pcm_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
+
+ pcrf_pcm_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_oam_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_oam_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
+
+ volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: { get_param: pcrf_pcm_volume_id }
+ mountpoint: /dev/vdd
+ instance_uuid: { get_resource: pcrf_server_pcm }
+
+outputs:
+ pcrf_server_pcm_id:
+ description: the pcm server id
+ value: { get_resource: pcrf_server_pcm } \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nested-ppd_v1.0.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nested-ppd_v1.0.yaml
new file mode 100644
index 0000000000..397e85c252
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nested-ppd_v1.0.yaml
@@ -0,0 +1,333 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Director stack
+
+parameters:
+ pcrf_ppd_server_name:
+ type: string
+ label: PCRF PD server name
+ description: PCRF PD server name
+ pcrf_ppd_image_name:
+ type: string
+ label: image name
+ description: PCRF PD image name
+ pcrf_ppd_flavor_name:
+ type: string
+ label: PCRF PD flavor name
+ description: flavor name of PCRF PD instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_lb_internal_vip:
+ type: string
+ label: CPS Internal LB VIP
+ description: CPS Internal LB VIP
+ pcrf_oam_net_name:
+ type: string
+ label: OAM network name
+ description: OAM network name
+ pcrf_oam_net_ip:
+ type: string
+ label: OAM network ip
+ description: OAM network ip
+ pcrf_oam_net_gw:
+ type: string
+ label: CPS network gateway
+ description: CPS network gateway
+ pcrf_oam_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_lb_management_vip:
+ type: string
+ label: CPS OAM LB VIP
+ description: CPS OAM LB VIP
+ pcrf_gx_net_name:
+ type: string
+ label: Gx network name
+ description: Gx network name
+ pcrf_gx_net_ip:
+ type: string
+ label: Gx network ip
+ description: Gx network ip
+ pcrf_gx_net_mask:
+ type: string
+ label: Gx network mask
+ description: Gx network mask
+ pcrf_sp_net_name:
+ type: string
+ label: Sp network name
+ description: Sp network name
+ pcrf_sp_net_ip:
+ type: string
+ label: Sp network ip
+ description: Sp network ip
+ pcrf_sp_net_mask:
+ type: string
+ label: Sp network mask
+ description: Sp network mask
+ pcrf_sy_net_name:
+ type: string
+ label: Sy network name
+ description: Sy network name
+ pcrf_sy_net_ip:
+ type: string
+ label: Sy network ip
+ description: Sy network ip
+ pcrf_sy_net_mask:
+ type: string
+ label: Sy network mask
+ description: Sy network mask
+ pcrf_rx_net_name:
+ type: string
+ label: Rx network name
+ description: Rx network name
+ pcrf_rx_net_ip:
+ type: string
+ label: Rx network ip
+ description: Rx network ip
+ pcrf_rx_net_mask:
+ type: string
+ label: Rx network mask
+ description: Rx network mask
+ pcrf_sd_net_name:
+ type: string
+ label: Sd network name
+ description: Sd network name
+ pcrf_sd_net_ip:
+ type: string
+ label: Sd network ip
+ description: Sd network ip
+ pcrf_sd_net_mask:
+ type: string
+ label: Sd network mask
+ description: Sd network mask
+ pcrf_sgi_sy_net_name:
+ type: string
+ label: Sgi Sy network name
+ description: Sgi Sy network name
+ pcrf_sgi_sy_net_ip:
+ type: string
+ label: Sgi Sy network ip
+ description: Sgi Sy network ip
+ pcrf_sgi_sy_net_mask:
+ type: string
+ label: Sgi Sy network mask
+ description: Sgi Sy network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet }
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth1
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet-gw }
+ params:
+ $dev: eth1
+ $ip: { get_param: pcrf_oam_net_ip }
+ $netmask: { get_param: pcrf_oam_net_mask }
+ $gateway: { get_param: pcrf_oam_net_gw }
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth2
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet }
+ params:
+ $dev: eth2
+ $ip: { get_param: pcrf_gx_net_ip }
+ $netmask: { get_param: pcrf_gx_net_mask }
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth3
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet }
+ params:
+ $dev: eth3
+ $ip: { get_param: pcrf_sp_net_ip }
+ $netmask: { get_param: pcrf_sp_net_mask }
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth4
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet }
+ params:
+ $dev: eth4
+ $ip: { get_param: pcrf_sy_net_ip }
+ $netmask: { get_param: pcrf_sy_net_mask }
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth5
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet }
+ params:
+ $dev: eth5
+ $ip: { get_param: pcrf_rx_net_ip }
+ $netmask: { get_param: pcrf_rx_net_mask }
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth6
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet }
+ params:
+ $dev: eth6
+ $ip: { get_param: pcrf_sd_net_ip }
+ $netmask: { get_param: pcrf_sd_net_mask }
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth7
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet }
+ params:
+ $dev: eth7
+ $ip: { get_param: pcrf_sgi_sy_net_ip }
+ $netmask: { get_param: pcrf_sgi_sy_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+ - ifdown eth1 && ifup eth1
+ - ifdown eth2 && ifup eth2
+ - ifdown eth3 && ifup eth3
+ - ifdown eth4 && ifup eth4
+ - ifdown eth5 && ifup eth5
+ - ifdown eth6 && ifup eth6
+ - ifdown eth7 && ifup eth7
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ template: { get_file: cloud-nimbus.sh }
+ params:
+ $vm_name: { get_param: pcrf_ppd_server_name }
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_ppd:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_ppd_server_name }
+ image: { get_param: pcrf_ppd_image_name }
+ flavor: { get_param: pcrf_ppd_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: pcrf_ppd_port_0}
+ - port: { get_resource: pcrf_ppd_port_1}
+ - port: { get_resource: pcrf_ppd_port_2}
+ - port: { get_resource: pcrf_ppd_port_3}
+ - port: { get_resource: pcrf_ppd_port_4}
+ - port: { get_resource: pcrf_ppd_port_5}
+ - port: { get_resource: pcrf_ppd_port_6}
+ - port: { get_resource: pcrf_ppd_port_7}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+
+ pcrf_ppd_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
+ allowed_address_pairs:
+ - ip_address: { get_param: pcrf_lb_internal_vip }
+
+ pcrf_ppd_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_oam_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_oam_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
+ allowed_address_pairs:
+ - ip_address: { get_param: pcrf_lb_management_vip }
+
+ pcrf_ppd_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_gx_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_gx_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
+
+ pcrf_ppd_port_3:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_sp_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_sp_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
+
+ pcrf_ppd_port_4:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_sy_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_sy_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
+
+ pcrf_ppd_port_5:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_rx_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_rx_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
+
+ pcrf_ppd_port_6:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_sd_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_sd_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
+
+ pcrf_ppd_port_7:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_sgi_sy_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_sgi_sy_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
+
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nested-pps_v1.0.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nested-pps_v1.0.yaml
new file mode 100644
index 0000000000..fc5b6f74c3
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nested-pps_v1.0.yaml
@@ -0,0 +1,99 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_name:
+ type: string
+ label: PCRF PS server name
+ description: PCRF PS server name
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ template: { get_file: cloud-nimbus.sh }
+ params:
+ $vm_name: { get_param: pcrf_pps_server_name }
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet }
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_pps:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_pps_server_name }
+ image: { get_param: pcrf_pps_image_name }
+ flavor: { get_param: pcrf_pps_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: pcrf_pps_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+
+ pcrf_pps_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nested-psm_v1.0.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nested-psm_v1.0.yaml
new file mode 100644
index 0000000000..c86aa34713
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nested-psm_v1.0.yaml
@@ -0,0 +1,99 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_name:
+ type: string
+ label: PCRF SM server name
+ description: PCRF SM server name
+ pcrf_psm_image_name:
+ type: string
+ label: image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet }
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ template: { get_file: cloud-nimbus.sh }
+ params:
+ $vm_name: { get_param: pcrf_psm_server_name }
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_psm:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_psm_server_name }
+ image: { get_param: pcrf_psm_image_name }
+ flavor: { get_param: pcrf_psm_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: psm01_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+ #scheduler_hints: {group: { get_resource: servergroup_nimbus }}
+
+ psm01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nimbus-ethernet b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nimbus-ethernet
new file mode 100644
index 0000000000..51250a7b82
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nimbus-ethernet
@@ -0,0 +1,5 @@
+DEVICE=$dev
+BOOTPROTO=none
+NM_CONTROLLED=no
+IPADDR=$ip
+NETMASK=$netmask
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nimbus-ethernet-gw b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nimbus-ethernet-gw
new file mode 100644
index 0000000000..3e08d643bb
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nimbus-ethernet-gw
@@ -0,0 +1,6 @@
+DEVICE=$dev
+BOOTPROTO=none
+NM_CONTROLLED=no
+IPADDR=$ip
+NETMASK=$netmask
+GATEWAY=$gateway
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/notZipFile b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/notZipFile
new file mode 100644
index 0000000000..0f0f2a483c
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/notZipFile
@@ -0,0 +1 @@
+test text file \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/quesionnaire/invalidComponent.json b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/quesionnaire/invalidComponent.json
new file mode 100644
index 0000000000..9b10297572
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/quesionnaire/invalidComponent.json
@@ -0,0 +1,34 @@
+{
+ "general": {
+ "hypervisor": {
+ "hypervisor": "KVM",
+ "containerFeaturesDescription": "Nn8XhahKjo,FapqJ4Ale11LkO-f3,TlCJ2d0S Q B1w0JJwZgWo MeqEk85utsaM tdM33ZmAiAKp__c_PRBt_5-24gBU21unWme",
+ "drivers": ",Lz-m3R7iwRREmjBA3Ss6b0K8YBcH4SS66UJSG8OGTlaMs6Be"
+ },
+ "image": {
+ "ephemeralDiskSizePerVM": 8,
+ "format": "iso",
+ "bootDiskSizePerVM": 100,
+ "providedBy": "Vendor"
+ },
+ "dnsConfiguration": "dolore adipisicing proident aute amet",
+ "recovery": {
+ "vmProcessFailuresHandling": "in ad est ut",
+ "pointObjective": 20
+ }
+ },
+ "network": {},
+ "highAvailabilityAndLoadBalancing": {
+ "architectureChoice": "nostrud eu culpa velit Lorem",
+ "slaRequirements": "est esse Excepteur eu",
+ "failureLoadDistribution": "velit reprehenderit aute dolor in",
+ "loadDistributionMechanism": "quis fugiat veniam cillum"
+ },
+ "storage": {
+ "backup": {
+ "backupType": "On Site",
+ "backupStorageSize": 9,
+ "backupSolution": "fugiat tempor"
+ }
+ }
+} \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/quesionnaire/invalidNic.json b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/quesionnaire/invalidNic.json
new file mode 100644
index 0000000000..7297cdcc84
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/quesionnaire/invalidNic.json
@@ -0,0 +1,36 @@
+{
+ "ipConfiguration": {
+ "ipv6Required": false
+ },
+ "protocols": {
+ "protocolWithHighestTrafficProfile": "TCP"
+ },
+ "network": {
+ "networkDescription": "mLRqrnteBeIIUQsuvZEetXjllKPnYvbG"
+ },
+ "sizing": {
+ "describeQualityOfService": "adipisicing voluptate aute",
+ "acceptableJitter": {
+ "mean": "98690087997256150885582732516496929349161209784564642159997681825133065"
+ },
+ "flowLength": {
+ "packets": {},
+ "bytes": {}
+ },
+ "outflowTrafficPerSecond": {
+ "packets": {}
+ },
+ "acceptablePacketLoss": "15",
+ "inflowTrafficPerSecond": {
+ "bytes": {}
+ }
+ },
+ "describeQualityOfService": "minim dolore",
+ "acceptablePacketLoss": "4",
+ "flowLength": {},
+ "acceptableJitter": {
+ "mean": "61827261335222870878257995122569227177432366697624312367018960696207118652325834319325112734287",
+ "max": "498307229580528005673649352861421755",
+ "variable": "5085363947608755025538570280250262251802454469028997134802881591362"
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/quesionnaire/validComponent.json b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/quesionnaire/validComponent.json
new file mode 100644
index 0000000000..4e9e9aa6c0
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/quesionnaire/validComponent.json
@@ -0,0 +1,34 @@
+{
+ "general": {
+ "hypervisor": {
+ "hypervisor": "KVM",
+ "containerFeaturesDescription": "Nn8XhahKjo,FapqJ4Ale11LkO-f3,TlCJ2d0S Q B1w0JJwZgWo MeqEk85utsaM tdM33ZmAiAKp__c_PRBt_5-24gBU21unWme",
+ "drivers": ",Lz-m3R7iwRREmjBA3Ss6b0K8YBcH4SS66UJSG8OGTlaMs6Be"
+ },
+ "image": {
+ "ephemeralDiskSizePerVM": 8,
+ "format": "iso",
+ "bootDiskSizePerVM": 100,
+ "providedBy": "Vendor"
+ },
+ "dnsConfiguration": "dolore adipisicing proident aute amet",
+ "recovery": {
+ "vmProcessFailuresHandling": "in ad est ut",
+ "pointObjective": 6
+ }
+ },
+ "network": {},
+ "highAvailabilityAndLoadBalancing": {
+ "architectureChoice": "nostrud eu culpa velit Lorem",
+ "slaRequirements": "est esse Excepteur eu",
+ "failureLoadDistribution": "velit reprehenderit aute dolor in",
+ "loadDistributionMechanism": "quis fugiat veniam cillum"
+ },
+ "storage": {
+ "backup": {
+ "backupType": "On Site",
+ "backupStorageSize": 9,
+ "backupSolution": "fugiat tempor"
+ }
+ }
+} \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/quesionnaire/validNic.json b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/quesionnaire/validNic.json
new file mode 100644
index 0000000000..e30dcfd668
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/quesionnaire/validNic.json
@@ -0,0 +1,30 @@
+{
+ "ipConfiguration": {
+ "ipv6Required": false
+ },
+ "protocols": {
+ "protocolWithHighestTrafficProfile": "TCP"
+ },
+ "network": {
+ "networkDescription": "mLRqrnteBeIIUQsuvZEetXjllKPnYvbG"
+ },
+ "sizing": {
+ "describeQualityOfService": "adipisicing voluptate aute",
+ "flowLength": {
+ "packets": {},
+ "bytes": {}
+ },
+ "outflowTrafficPerSecond": {
+ "packets": {}
+ },
+ "acceptablePacketLoss": 15,
+ "inflowTrafficPerSecond": {
+ "bytes": {}
+ },
+ "acceptableJitter": {
+ "mean": 2000,
+ "max": 3000,
+ "variable": 4000
+ }
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/missing_manifest/input/heat_missing_from_manifast.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/missing_manifest/input/heat_missing_from_manifast.yaml
new file mode 100644
index 0000000000..d5608abfb4
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/missing_manifest/input/heat_missing_from_manifast.yaml
@@ -0,0 +1,250 @@
+### Heat Template ###
+description: Generated template
+heat_template_version: 2013-05-23
+parameters: {}
+resources:
+ network_0:
+ properties:
+ admin_state_up: true
+ name: NET_167
+ shared: true
+ type: OS::Neutron::Net
+ network_1:
+ properties:
+ admin_state_up: true
+ name: NET_169
+ shared: true
+ type: OS::Neutron::Net
+ network_2:
+ properties:
+ admin_state_up: true
+ name: NET_166
+ shared: true
+ type: OS::Neutron::Net
+ network_3:
+ properties:
+ admin_state_up: true
+ name: NET_168
+ shared: true
+ type: OS::Neutron::Net
+ network_4:
+ properties:
+ admin_state_up: true
+ name: NET_169
+ shared: true
+ type: OS::Neutron::Net
+ network_5:
+ properties:
+ admin_state_up: true
+ name: NET_170
+ shared: true
+ type: OS::Neutron::Net
+ network_6:
+ properties:
+ admin_state_up: true
+ name: NET_168
+ shared: true
+ type: OS::Neutron::Net
+ network_7:
+ properties:
+ admin_state_up: true
+ name: NET_170
+ shared: true
+ type: OS::Neutron::Net
+ network_8:
+ properties:
+ admin_state_up: true
+ name: NET_166
+ shared: true
+ type: OS::Neutron::Net
+ network_9:
+ properties:
+ admin_state_up: true
+ name: NET_167
+ shared: true
+ type: OS::Neutron::Net
+ security_group_0:
+ properties:
+ description: Default security group
+ name: _default
+ rules:
+ - direction: ingress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ - direction: egress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ type: OS::Neutron::SecurityGroup
+ security_group_1:
+ properties:
+ description: Default security group
+ name: _default
+ rules:
+ - direction: egress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ - direction: ingress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ type: OS::Neutron::SecurityGroup
+ subnet_0:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.254
+ start: 10.147.32.130
+ cidr: 10.147.32.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_167
+ network_id:
+ get_resource: network_9
+ type: OS::Neutron::Subnet
+ subnet_1:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.254
+ start: 10.147.32.130
+ cidr: 10.147.32.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_167
+ network_id:
+ get_resource: network_0
+ type: OS::Neutron::Subnet
+ subnet_2:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.126
+ start: 10.147.32.2
+ cidr: 10.147.32.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_166
+ network_id:
+ get_resource: network_8
+ type: OS::Neutron::Subnet
+ subnet_3:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.126
+ start: 10.147.32.2
+ cidr: 10.147.32.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_166
+ network_id:
+ get_resource: network_2
+ type: OS::Neutron::Subnet
+ subnet_4:
+ properties:
+ allocation_pools:
+ - end: 10.147.34.126
+ start: 10.147.34.2
+ cidr: 10.147.34.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_170
+ network_id:
+ get_resource: network_5
+ type: OS::Neutron::Subnet
+ subnet_5:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.126
+ start: 10.147.33.2
+ cidr: 10.147.33.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_168
+ network_id:
+ get_resource: network_6
+ type: OS::Neutron::Subnet
+ subnet_6:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.126
+ start: 10.147.33.2
+ cidr: 10.147.33.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_168
+ network_id:
+ get_resource: network_3
+ type: OS::Neutron::Subnet
+ subnet_7:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.254
+ start: 10.147.33.130
+ cidr: 10.147.33.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_169
+ network_id:
+ get_resource: network_1
+ type: OS::Neutron::Subnet
+ subnet_8:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.254
+ start: 10.147.33.130
+ cidr: 10.147.33.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_169
+ network_id:
+ get_resource: network_4
+ type: OS::Neutron::Subnet
+ subnet_9:
+ properties:
+ allocation_pools:
+ - end: 10.147.34.126
+ start: 10.147.34.2
+ cidr: 10.147.34.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_170
+ network_id:
+ get_resource: network_7
+ type: OS::Neutron::Subnet
+
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/missing_manifest/input/mainValid.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/missing_manifest/input/mainValid.yaml
new file mode 100644
index 0000000000..318c8f1283
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/missing_manifest/input/mainValid.yaml
@@ -0,0 +1,250 @@
+### Heat Template ###
+description: Generated template
+heat_template_version: 2013-05-23
+parameters: {}
+resources:
+ network_0:
+ properties:
+ admin_state_up: true
+ name: NET_167
+ shared: true
+ type: OS::Neutron::Net
+ network_1:
+ properties:
+ admin_state_up: true
+ name: NET_169
+ shared: true
+ type: OS::Neutron::Net
+ network_2:
+ properties:
+ admin_state_up: true
+ name: NET_166
+ shared: true
+ type: OS::Neutron::Net
+ network_3:
+ properties:
+ admin_state_up: true
+ name: NET_168
+ shared: true
+ type: missingNested.yaml
+ network_4:
+ properties:
+ admin_state_up: true
+ name: { get_file: missing-artifact }
+ shared: true
+ type: OS::Neutron::Net
+ network_5:
+ properties:
+ admin_state_up: true
+ name: NET_170
+ shared: true
+ type: OS::Neutron::Net
+ network_6:
+ properties:
+ admin_state_up: true
+ name: NET_168
+ shared: true
+ type: OS::Neutron::Net
+ network_7:
+ properties:
+ admin_state_up: true
+ name: NET_170
+ shared: true
+ type: OS::Neutron::Net
+ network_8:
+ properties:
+ admin_state_up: true
+ name: NET_166
+ shared: true
+ type: OS::Neutron::Net
+ network_9:
+ properties:
+ admin_state_up: true
+ name: NET_167
+ shared: true
+ type: OS::Neutron::Net
+ security_group_0:
+ properties:
+ description: Default security group
+ name: _default
+ rules:
+ - direction: ingress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ - direction: egress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ type: OS::Neutron::SecurityGroup
+ security_group_1:
+ properties:
+ description: Default security group
+ name: _default
+ rules:
+ - direction: egress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ - direction: ingress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ type: OS::Neutron::SecurityGroup
+ subnet_0:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.254
+ start: 10.147.32.130
+ cidr: 10.147.32.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_167
+ network_id:
+ get_resource: network_9
+ type: OS::Neutron::Subnet
+ subnet_1:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.254
+ start: 10.147.32.130
+ cidr: 10.147.32.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_167
+ network_id:
+ get_resource: network_0
+ type: OS::Neutron::Subnet
+ subnet_2:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.126
+ start: 10.147.32.2
+ cidr: 10.147.32.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_166
+ network_id:
+ get_resource: network_8
+ type: OS::Neutron::Subnet
+ subnet_3:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.126
+ start: 10.147.32.2
+ cidr: 10.147.32.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_166
+ network_id:
+ get_resource: network_2
+ type: OS::Neutron::Subnet
+ subnet_4:
+ properties:
+ allocation_pools:
+ - end: 10.147.34.126
+ start: 10.147.34.2
+ cidr: 10.147.34.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_170
+ network_id:
+ get_resource: network_5
+ type: OS::Neutron::Subnet
+ subnet_5:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.126
+ start: 10.147.33.2
+ cidr: 10.147.33.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_168
+ network_id:
+ get_resource: network_6
+ type: OS::Neutron::Subnet
+ subnet_6:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.126
+ start: 10.147.33.2
+ cidr: 10.147.33.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_168
+ network_id:
+ get_resource: network_3
+ type: OS::Neutron::Subnet
+ subnet_7:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.254
+ start: 10.147.33.130
+ cidr: 10.147.33.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_169
+ network_id:
+ get_resource: network_1
+ type: OS::Neutron::Subnet
+ subnet_8:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.254
+ start: 10.147.33.130
+ cidr: 10.147.33.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_169
+ network_id:
+ get_resource: network_4
+ type: OS::Neutron::Subnet
+ subnet_9:
+ properties:
+ allocation_pools:
+ - end: 10.147.34.126
+ start: 10.147.34.2
+ cidr: 10.147.34.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_170
+ network_id:
+ get_resource: network_7
+ type: OS::Neutron::Subnet
+
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/missing_manifest/input/validHeat.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/missing_manifest/input/validHeat.yaml
new file mode 100644
index 0000000000..d5608abfb4
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/missing_manifest/input/validHeat.yaml
@@ -0,0 +1,250 @@
+### Heat Template ###
+description: Generated template
+heat_template_version: 2013-05-23
+parameters: {}
+resources:
+ network_0:
+ properties:
+ admin_state_up: true
+ name: NET_167
+ shared: true
+ type: OS::Neutron::Net
+ network_1:
+ properties:
+ admin_state_up: true
+ name: NET_169
+ shared: true
+ type: OS::Neutron::Net
+ network_2:
+ properties:
+ admin_state_up: true
+ name: NET_166
+ shared: true
+ type: OS::Neutron::Net
+ network_3:
+ properties:
+ admin_state_up: true
+ name: NET_168
+ shared: true
+ type: OS::Neutron::Net
+ network_4:
+ properties:
+ admin_state_up: true
+ name: NET_169
+ shared: true
+ type: OS::Neutron::Net
+ network_5:
+ properties:
+ admin_state_up: true
+ name: NET_170
+ shared: true
+ type: OS::Neutron::Net
+ network_6:
+ properties:
+ admin_state_up: true
+ name: NET_168
+ shared: true
+ type: OS::Neutron::Net
+ network_7:
+ properties:
+ admin_state_up: true
+ name: NET_170
+ shared: true
+ type: OS::Neutron::Net
+ network_8:
+ properties:
+ admin_state_up: true
+ name: NET_166
+ shared: true
+ type: OS::Neutron::Net
+ network_9:
+ properties:
+ admin_state_up: true
+ name: NET_167
+ shared: true
+ type: OS::Neutron::Net
+ security_group_0:
+ properties:
+ description: Default security group
+ name: _default
+ rules:
+ - direction: ingress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ - direction: egress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ type: OS::Neutron::SecurityGroup
+ security_group_1:
+ properties:
+ description: Default security group
+ name: _default
+ rules:
+ - direction: egress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ - direction: ingress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ type: OS::Neutron::SecurityGroup
+ subnet_0:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.254
+ start: 10.147.32.130
+ cidr: 10.147.32.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_167
+ network_id:
+ get_resource: network_9
+ type: OS::Neutron::Subnet
+ subnet_1:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.254
+ start: 10.147.32.130
+ cidr: 10.147.32.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_167
+ network_id:
+ get_resource: network_0
+ type: OS::Neutron::Subnet
+ subnet_2:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.126
+ start: 10.147.32.2
+ cidr: 10.147.32.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_166
+ network_id:
+ get_resource: network_8
+ type: OS::Neutron::Subnet
+ subnet_3:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.126
+ start: 10.147.32.2
+ cidr: 10.147.32.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_166
+ network_id:
+ get_resource: network_2
+ type: OS::Neutron::Subnet
+ subnet_4:
+ properties:
+ allocation_pools:
+ - end: 10.147.34.126
+ start: 10.147.34.2
+ cidr: 10.147.34.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_170
+ network_id:
+ get_resource: network_5
+ type: OS::Neutron::Subnet
+ subnet_5:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.126
+ start: 10.147.33.2
+ cidr: 10.147.33.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_168
+ network_id:
+ get_resource: network_6
+ type: OS::Neutron::Subnet
+ subnet_6:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.126
+ start: 10.147.33.2
+ cidr: 10.147.33.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_168
+ network_id:
+ get_resource: network_3
+ type: OS::Neutron::Subnet
+ subnet_7:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.254
+ start: 10.147.33.130
+ cidr: 10.147.33.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_169
+ network_id:
+ get_resource: network_1
+ type: OS::Neutron::Subnet
+ subnet_8:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.254
+ start: 10.147.33.130
+ cidr: 10.147.33.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_169
+ network_id:
+ get_resource: network_4
+ type: OS::Neutron::Subnet
+ subnet_9:
+ properties:
+ allocation_pools:
+ - end: 10.147.34.126
+ start: 10.147.34.2
+ cidr: 10.147.34.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_170
+ network_id:
+ get_resource: network_7
+ type: OS::Neutron::Subnet
+
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_resource_group/MANIFEST.json b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_resource_group/MANIFEST.json
new file mode 100644
index 0000000000..522029634e
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_resource_group/MANIFEST.json
@@ -0,0 +1,17 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "nested.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ },
+ {
+ "file": "addOn.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ }
+ ]
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_resource_group/addOn.yml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_resource_group/addOn.yml
new file mode 100644
index 0000000000..39c34742a4
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_resource_group/addOn.yml
@@ -0,0 +1,31 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ shared_security_group_id1:
+ type: string
+ description: network name of jsa log network
+ shared_security_group_id2:
+ type: string
+ description: network name of jsa log network
+ jsa_net_name:
+ type: string
+ description: network name of jsa log network
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+
+resources:
+ mvs_modules:
+ type: OS::Heat::ResourceGroup
+ properties:
+ count: 3
+ index_var: "%index%"
+ resource_def:
+ type: nested.yml
+ properties:
+ p1: { get_param: shared_security_group_id1}
+ p2: { get_param: shared_security_group_id2}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_resource_group/nested.yml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_resource_group/nested.yml
new file mode 100644
index 0000000000..4614bdce93
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_resource_group/nested.yml
@@ -0,0 +1,56 @@
+heat_template_version: 2013-05-23
+
+description: cmaui server template for vMMSC
+
+parameters:
+ p1:
+ type: string
+ description: UID of OAM network
+ p2:
+ type: string
+ description: UID of OAM network
+ net:
+ type: string
+ description: UID of OAM network
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+
+resources:
+
+ cmaui_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: net }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: p1}, {get_param: p2}]
+ replacement_policy: AUTO
+
+ cmaui_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: net }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: p1}]
+ replacement_policy: AUTO
+
+ server_cmaui:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_1 }
+ - port: { get_resource: cmaui_port_2 } \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_volume/MANIFEST.json b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_volume/MANIFEST.json
new file mode 100644
index 0000000000..1e2b0c7997
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_volume/MANIFEST.json
@@ -0,0 +1,16 @@
+{
+ "name": "",
+ "description": "",
+ "data": [
+ {
+ "file": "hot_mobt_volume_attach_nested.yaml",
+ "type": "HEAT_VOL",
+ "isBase": "false"
+ },
+ {
+ "file": "base_mobt.yaml",
+ "type": "HEAT",
+ "isBase": "true"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_volume/base_mobt.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_volume/base_mobt.yaml
new file mode 100644
index 0000000000..c3be156e38
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_volume/base_mobt.yaml
@@ -0,0 +1,26 @@
+heat_template_version: 2014-10-16
+
+description: heat template that creates additional MOBT nodes in stack
+
+parameters:
+ mobt_vol_count:
+ type: number
+ label: MOBT OAM server count
+ description: MOBT OAM server instance count
+ default: 2
+ constraints:
+ - range: { min: 2, max: 2 }
+
+resources:
+ server_volume_attach_group:
+ type: OS::Heat::ResourceGroup
+ properties:
+ count: { get_param: mobt_vol_count }
+ resource_def:
+ type: hot_mobt_volume_attach_nested.yaml
+ properties:
+ mobt_vol_index: "%index%"
+ server_mobt_group_ids: { get_attr: [ server_mobt_group_data, mobt_server_adm_x_id ] }
+ update_policy:
+ batch_create:
+ max_batch_size: 1
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_volume/hot_mobt_volume_attach_nested.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_volume/hot_mobt_volume_attach_nested.yaml
new file mode 100644
index 0000000000..8e6d07f899
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_volume/hot_mobt_volume_attach_nested.yaml
@@ -0,0 +1,28 @@
+heat_template_version: 2014-10-16
+
+description: nested heat template that associtate the cinder volumes to OAM nodes stack
+
+parameters:
+ mobt_volume_ids:
+ type: comma_delimited_list
+ label: MOBT OAM Cinder Volumes
+ description: MOBT OAM Cinder Volumes
+
+ server_mobt_group_ids:
+ type: comma_delimited_list
+ label: MOBT OAM Resource Group
+ description: MOBT OAM Resource Group
+
+ mobt_vol_index:
+ type: number
+ label: ADM volume index
+ description: ADM volume UUID in list
+
+resources:
+ mobt_adm_vol_attachment_x:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: { get_param: [ mobt_volume_ids, get_param: mobt_vol_index ]}
+ mountpoint: /dev/vdb
+ instance_uuid: { get_param: [ server_mobt_group_ids, get_param: mobt_vol_index ]}
+
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/valid_tree/input/MANIFEST.json b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/valid_tree/input/MANIFEST.json
new file mode 100644
index 0000000000..a4065d0b68
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/valid_tree/input/MANIFEST.json
@@ -0,0 +1,39 @@
+{
+ "data": [
+ {
+ "file": "validHeat.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-oam_v1.0.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "hot-nimbus-oam-volumes_v1.0",
+ "type": "HEAT_VOL",
+ "data": [{
+ "file": "hot-nimbus-oam-volumes_v1.0.env",
+ "type": "HEAT_ENV"
+ }]
+ }
+ ]
+ },
+ {
+ "file": "mainValid.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-oam-networks_v1.0",
+ "type": "HEAT_NET"
+ }
+ ]
+ },
+ {
+ "file": "missingHeatFromZip.yaml.yaml",
+ "type": "HEAT"
+ }
+ ],
+ "description": "RXAEmleoRDWLeWVvmXUJxDKCItgjkMEXuKJcUWyVUZrCUiMzZSyHPzhqLcJSIUNBzohsIGXLBIwstuVDEuFtxuLIwWgCCdjprtvzruHIUKdVnCyifJQUJjqSCoKKKyVaWFTFKzHNhTZNlZTYaMKGEpIMXOpIxSyTZZCgVsGkItQelBbFVrmCltTgkuppYMrEfvwqNBLVRSGCucNwliWFZUuXloXBiZaqtodZjyFpqBNqhlpcrARmMpvLiz",
+ "name": "FCTRQGcMevNngRDvECQYfiEXCYbGeAWRHdaGggLUgyOnssHAiU",
+ "version": "2013-05-23"
+} \ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/valid_tree/input/heat_missing_from_manifast.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/valid_tree/input/heat_missing_from_manifast.yaml
new file mode 100644
index 0000000000..d5608abfb4
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/valid_tree/input/heat_missing_from_manifast.yaml
@@ -0,0 +1,250 @@
+### Heat Template ###
+description: Generated template
+heat_template_version: 2013-05-23
+parameters: {}
+resources:
+ network_0:
+ properties:
+ admin_state_up: true
+ name: NET_167
+ shared: true
+ type: OS::Neutron::Net
+ network_1:
+ properties:
+ admin_state_up: true
+ name: NET_169
+ shared: true
+ type: OS::Neutron::Net
+ network_2:
+ properties:
+ admin_state_up: true
+ name: NET_166
+ shared: true
+ type: OS::Neutron::Net
+ network_3:
+ properties:
+ admin_state_up: true
+ name: NET_168
+ shared: true
+ type: OS::Neutron::Net
+ network_4:
+ properties:
+ admin_state_up: true
+ name: NET_169
+ shared: true
+ type: OS::Neutron::Net
+ network_5:
+ properties:
+ admin_state_up: true
+ name: NET_170
+ shared: true
+ type: OS::Neutron::Net
+ network_6:
+ properties:
+ admin_state_up: true
+ name: NET_168
+ shared: true
+ type: OS::Neutron::Net
+ network_7:
+ properties:
+ admin_state_up: true
+ name: NET_170
+ shared: true
+ type: OS::Neutron::Net
+ network_8:
+ properties:
+ admin_state_up: true
+ name: NET_166
+ shared: true
+ type: OS::Neutron::Net
+ network_9:
+ properties:
+ admin_state_up: true
+ name: NET_167
+ shared: true
+ type: OS::Neutron::Net
+ security_group_0:
+ properties:
+ description: Default security group
+ name: _default
+ rules:
+ - direction: ingress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ - direction: egress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ type: OS::Neutron::SecurityGroup
+ security_group_1:
+ properties:
+ description: Default security group
+ name: _default
+ rules:
+ - direction: egress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ - direction: ingress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ type: OS::Neutron::SecurityGroup
+ subnet_0:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.254
+ start: 10.147.32.130
+ cidr: 10.147.32.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_167
+ network_id:
+ get_resource: network_9
+ type: OS::Neutron::Subnet
+ subnet_1:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.254
+ start: 10.147.32.130
+ cidr: 10.147.32.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_167
+ network_id:
+ get_resource: network_0
+ type: OS::Neutron::Subnet
+ subnet_2:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.126
+ start: 10.147.32.2
+ cidr: 10.147.32.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_166
+ network_id:
+ get_resource: network_8
+ type: OS::Neutron::Subnet
+ subnet_3:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.126
+ start: 10.147.32.2
+ cidr: 10.147.32.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_166
+ network_id:
+ get_resource: network_2
+ type: OS::Neutron::Subnet
+ subnet_4:
+ properties:
+ allocation_pools:
+ - end: 10.147.34.126
+ start: 10.147.34.2
+ cidr: 10.147.34.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_170
+ network_id:
+ get_resource: network_5
+ type: OS::Neutron::Subnet
+ subnet_5:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.126
+ start: 10.147.33.2
+ cidr: 10.147.33.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_168
+ network_id:
+ get_resource: network_6
+ type: OS::Neutron::Subnet
+ subnet_6:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.126
+ start: 10.147.33.2
+ cidr: 10.147.33.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_168
+ network_id:
+ get_resource: network_3
+ type: OS::Neutron::Subnet
+ subnet_7:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.254
+ start: 10.147.33.130
+ cidr: 10.147.33.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_169
+ network_id:
+ get_resource: network_1
+ type: OS::Neutron::Subnet
+ subnet_8:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.254
+ start: 10.147.33.130
+ cidr: 10.147.33.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_169
+ network_id:
+ get_resource: network_4
+ type: OS::Neutron::Subnet
+ subnet_9:
+ properties:
+ allocation_pools:
+ - end: 10.147.34.126
+ start: 10.147.34.2
+ cidr: 10.147.34.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_170
+ network_id:
+ get_resource: network_7
+ type: OS::Neutron::Subnet
+
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/valid_tree/input/mainValid.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/valid_tree/input/mainValid.yaml
new file mode 100644
index 0000000000..318c8f1283
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/valid_tree/input/mainValid.yaml
@@ -0,0 +1,250 @@
+### Heat Template ###
+description: Generated template
+heat_template_version: 2013-05-23
+parameters: {}
+resources:
+ network_0:
+ properties:
+ admin_state_up: true
+ name: NET_167
+ shared: true
+ type: OS::Neutron::Net
+ network_1:
+ properties:
+ admin_state_up: true
+ name: NET_169
+ shared: true
+ type: OS::Neutron::Net
+ network_2:
+ properties:
+ admin_state_up: true
+ name: NET_166
+ shared: true
+ type: OS::Neutron::Net
+ network_3:
+ properties:
+ admin_state_up: true
+ name: NET_168
+ shared: true
+ type: missingNested.yaml
+ network_4:
+ properties:
+ admin_state_up: true
+ name: { get_file: missing-artifact }
+ shared: true
+ type: OS::Neutron::Net
+ network_5:
+ properties:
+ admin_state_up: true
+ name: NET_170
+ shared: true
+ type: OS::Neutron::Net
+ network_6:
+ properties:
+ admin_state_up: true
+ name: NET_168
+ shared: true
+ type: OS::Neutron::Net
+ network_7:
+ properties:
+ admin_state_up: true
+ name: NET_170
+ shared: true
+ type: OS::Neutron::Net
+ network_8:
+ properties:
+ admin_state_up: true
+ name: NET_166
+ shared: true
+ type: OS::Neutron::Net
+ network_9:
+ properties:
+ admin_state_up: true
+ name: NET_167
+ shared: true
+ type: OS::Neutron::Net
+ security_group_0:
+ properties:
+ description: Default security group
+ name: _default
+ rules:
+ - direction: ingress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ - direction: egress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ type: OS::Neutron::SecurityGroup
+ security_group_1:
+ properties:
+ description: Default security group
+ name: _default
+ rules:
+ - direction: egress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ - direction: ingress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ type: OS::Neutron::SecurityGroup
+ subnet_0:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.254
+ start: 10.147.32.130
+ cidr: 10.147.32.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_167
+ network_id:
+ get_resource: network_9
+ type: OS::Neutron::Subnet
+ subnet_1:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.254
+ start: 10.147.32.130
+ cidr: 10.147.32.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_167
+ network_id:
+ get_resource: network_0
+ type: OS::Neutron::Subnet
+ subnet_2:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.126
+ start: 10.147.32.2
+ cidr: 10.147.32.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_166
+ network_id:
+ get_resource: network_8
+ type: OS::Neutron::Subnet
+ subnet_3:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.126
+ start: 10.147.32.2
+ cidr: 10.147.32.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_166
+ network_id:
+ get_resource: network_2
+ type: OS::Neutron::Subnet
+ subnet_4:
+ properties:
+ allocation_pools:
+ - end: 10.147.34.126
+ start: 10.147.34.2
+ cidr: 10.147.34.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_170
+ network_id:
+ get_resource: network_5
+ type: OS::Neutron::Subnet
+ subnet_5:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.126
+ start: 10.147.33.2
+ cidr: 10.147.33.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_168
+ network_id:
+ get_resource: network_6
+ type: OS::Neutron::Subnet
+ subnet_6:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.126
+ start: 10.147.33.2
+ cidr: 10.147.33.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_168
+ network_id:
+ get_resource: network_3
+ type: OS::Neutron::Subnet
+ subnet_7:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.254
+ start: 10.147.33.130
+ cidr: 10.147.33.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_169
+ network_id:
+ get_resource: network_1
+ type: OS::Neutron::Subnet
+ subnet_8:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.254
+ start: 10.147.33.130
+ cidr: 10.147.33.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_169
+ network_id:
+ get_resource: network_4
+ type: OS::Neutron::Subnet
+ subnet_9:
+ properties:
+ allocation_pools:
+ - end: 10.147.34.126
+ start: 10.147.34.2
+ cidr: 10.147.34.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_170
+ network_id:
+ get_resource: network_7
+ type: OS::Neutron::Subnet
+
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/valid_tree/input/validHeat.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/valid_tree/input/validHeat.yaml
new file mode 100644
index 0000000000..d5608abfb4
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/valid_tree/input/validHeat.yaml
@@ -0,0 +1,250 @@
+### Heat Template ###
+description: Generated template
+heat_template_version: 2013-05-23
+parameters: {}
+resources:
+ network_0:
+ properties:
+ admin_state_up: true
+ name: NET_167
+ shared: true
+ type: OS::Neutron::Net
+ network_1:
+ properties:
+ admin_state_up: true
+ name: NET_169
+ shared: true
+ type: OS::Neutron::Net
+ network_2:
+ properties:
+ admin_state_up: true
+ name: NET_166
+ shared: true
+ type: OS::Neutron::Net
+ network_3:
+ properties:
+ admin_state_up: true
+ name: NET_168
+ shared: true
+ type: OS::Neutron::Net
+ network_4:
+ properties:
+ admin_state_up: true
+ name: NET_169
+ shared: true
+ type: OS::Neutron::Net
+ network_5:
+ properties:
+ admin_state_up: true
+ name: NET_170
+ shared: true
+ type: OS::Neutron::Net
+ network_6:
+ properties:
+ admin_state_up: true
+ name: NET_168
+ shared: true
+ type: OS::Neutron::Net
+ network_7:
+ properties:
+ admin_state_up: true
+ name: NET_170
+ shared: true
+ type: OS::Neutron::Net
+ network_8:
+ properties:
+ admin_state_up: true
+ name: NET_166
+ shared: true
+ type: OS::Neutron::Net
+ network_9:
+ properties:
+ admin_state_up: true
+ name: NET_167
+ shared: true
+ type: OS::Neutron::Net
+ security_group_0:
+ properties:
+ description: Default security group
+ name: _default
+ rules:
+ - direction: ingress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ - direction: egress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ type: OS::Neutron::SecurityGroup
+ security_group_1:
+ properties:
+ description: Default security group
+ name: _default
+ rules:
+ - direction: egress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ - direction: ingress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ type: OS::Neutron::SecurityGroup
+ subnet_0:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.254
+ start: 10.147.32.130
+ cidr: 10.147.32.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_167
+ network_id:
+ get_resource: network_9
+ type: OS::Neutron::Subnet
+ subnet_1:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.254
+ start: 10.147.32.130
+ cidr: 10.147.32.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_167
+ network_id:
+ get_resource: network_0
+ type: OS::Neutron::Subnet
+ subnet_2:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.126
+ start: 10.147.32.2
+ cidr: 10.147.32.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_166
+ network_id:
+ get_resource: network_8
+ type: OS::Neutron::Subnet
+ subnet_3:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.126
+ start: 10.147.32.2
+ cidr: 10.147.32.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_166
+ network_id:
+ get_resource: network_2
+ type: OS::Neutron::Subnet
+ subnet_4:
+ properties:
+ allocation_pools:
+ - end: 10.147.34.126
+ start: 10.147.34.2
+ cidr: 10.147.34.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_170
+ network_id:
+ get_resource: network_5
+ type: OS::Neutron::Subnet
+ subnet_5:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.126
+ start: 10.147.33.2
+ cidr: 10.147.33.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_168
+ network_id:
+ get_resource: network_6
+ type: OS::Neutron::Subnet
+ subnet_6:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.126
+ start: 10.147.33.2
+ cidr: 10.147.33.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_168
+ network_id:
+ get_resource: network_3
+ type: OS::Neutron::Subnet
+ subnet_7:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.254
+ start: 10.147.33.130
+ cidr: 10.147.33.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_169
+ network_id:
+ get_resource: network_1
+ type: OS::Neutron::Subnet
+ subnet_8:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.254
+ start: 10.147.33.130
+ cidr: 10.147.33.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_169
+ network_id:
+ get_resource: network_4
+ type: OS::Neutron::Subnet
+ subnet_9:
+ properties:
+ allocation_pools:
+ - end: 10.147.34.126
+ start: 10.147.34.2
+ cidr: 10.147.34.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_170
+ network_id:
+ get_resource: network_7
+ type: OS::Neutron::Subnet
+
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/emptyZip.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/emptyZip.zip
new file mode 100644
index 0000000000..15cb0ecb3e
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/emptyZip.zip
Binary files differ
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/missingManifestInZip.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/missingManifestInZip.zip
new file mode 100644
index 0000000000..1d1e626efe
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/missingManifestInZip.zip
Binary files differ
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/710-ResourceGroup.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/710-ResourceGroup.zip
new file mode 100644
index 0000000000..3bc82994c7
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/710-ResourceGroup.zip
Binary files differ
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/MMSC.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/MMSC.zip
new file mode 100644
index 0000000000..8d8e669a87
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/MMSC.zip
Binary files differ
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/MNS OAM FW.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/MNS OAM FW.zip
new file mode 100644
index 0000000000..d96a5b6e16
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/MNS OAM FW.zip
Binary files differ
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/VOTA.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/VOTA.zip
new file mode 100644
index 0000000000..b224e3c6a4
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/VOTA.zip
Binary files differ
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/base_module_mns_oam.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/base_module_mns_oam.zip
new file mode 100644
index 0000000000..6fa54ce544
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/base_module_mns_oam.zip
Binary files differ
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/cmd-frwl-v302.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/cmd-frwl-v302.zip
new file mode 100644
index 0000000000..e169a8c0c3
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/cmd-frwl-v302.zip
Binary files differ
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/GWv12.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/GWv12.zip
new file mode 100644
index 0000000000..cbf0adff5b
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/GWv12.zip
Binary files differ
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/MNS OAM FW fix.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/MNS OAM FW fix.zip
new file mode 100644
index 0000000000..6dfb222ba2
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/MNS OAM FW fix.zip
Binary files differ
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/base_module_mns_oam_fixed.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/base_module_mns_oam_fixed.zip
new file mode 100644
index 0000000000..5c25590a9b
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/base_module_mns_oam_fixed.zip
Binary files differ
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/cmd-frwl-v302.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/cmd-frwl-v302.zip
new file mode 100644
index 0000000000..02ce760ce2
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/cmd-frwl-v302.zip
Binary files differ
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/vDBE_fix_with_warr.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/vDBE_fix_with_warr.zip
new file mode 100644
index 0000000000..3ecde1ba3c
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/vDBE_fix_with_warr.zip
Binary files differ
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/vDNS.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/vDNS.zip
new file mode 100644
index 0000000000..0bd8efbec8
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/vDNS.zip
Binary files differ
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/segw_heat_c3-base.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/segw_heat_c3-base.zip
new file mode 100644
index 0000000000..cfc49b003f
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/segw_heat_c3-base.zip
Binary files differ
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vDBE.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vDBE.zip
new file mode 100644
index 0000000000..10ee113631
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vDBE.zip
Binary files differ
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vDNS.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vDNS.zip
new file mode 100644
index 0000000000..c5fcf72d64
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vDNS.zip
Binary files differ
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vDNS_21_8.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vDNS_21_8.zip
new file mode 100644
index 0000000000..c5fcf72d64
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vDNS_21_8.zip
Binary files differ
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vProb.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vProb.zip
new file mode 100644
index 0000000000..86472e23fd
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vProb.zip
Binary files differ
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vProbe_FE_081816.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vProbe_FE_081816.zip
new file mode 100644
index 0000000000..578c561e4c
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vProbe_FE_081816.zip
Binary files differ
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vid_test_pcrf_base_template.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vid_test_pcrf_base_template.zip
new file mode 100644
index 0000000000..49c16f6774
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vid_test_pcrf_base_template.zip
Binary files differ
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/zipFileWithFolder.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/zipFileWithFolder.zip
new file mode 100644
index 0000000000..9d2fb1e8ab
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/zipFileWithFolder.zip
Binary files differ
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/emptyComposition.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/emptyComposition.zip
new file mode 100644
index 0000000000..76b3bfd873
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/emptyComposition.zip
Binary files differ
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/emptyZip.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/emptyZip.zip
new file mode 100644
index 0000000000..15cb0ecb3e
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/emptyZip.zip
Binary files differ
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/fullComposition.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/fullComposition.zip
new file mode 100644
index 0000000000..027f2c039a
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/fullComposition.zip
Binary files differ
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/invalidTypes.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/invalidTypes.zip
new file mode 100644
index 0000000000..5addd97cd3
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/invalidTypes.zip
Binary files differ
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/legalUpload.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/legalUpload.zip
new file mode 100644
index 0000000000..b4396f834d
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/legalUpload.zip
Binary files differ
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/legalUpload2.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/legalUpload2.zip
new file mode 100644
index 0000000000..1f264c3bd7
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/legalUpload2.zip
Binary files differ
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/missingYml.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/missingYml.zip
new file mode 100644
index 0000000000..5bc0bea15d
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/missingYml.zip
Binary files differ
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/nimbus.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/nimbus.zip
new file mode 100644
index 0000000000..000b154ceb
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/nimbus.zip
Binary files differ
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/vDNS.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/vDNS.zip
new file mode 100644
index 0000000000..c5fcf72d64
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/vDNS.zip
Binary files differ
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/withoutManifest.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/withoutManifest.zip
new file mode 100644
index 0000000000..6b52cf6065
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/withoutManifest.zip
Binary files differ
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/zipFileWithFolder.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/zipFileWithFolder.zip
new file mode 100644
index 0000000000..9d2fb1e8ab
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/zipFileWithFolder.zip
Binary files differ
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withNetwork/MANIFEST.json b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withNetwork/MANIFEST.json
new file mode 100644
index 0000000000..3d7004f8c0
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withNetwork/MANIFEST.json
@@ -0,0 +1,21 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-mog-0108-bs1271.yml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-mog-0108-bs1271.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "network.yml",
+ "type": "HEAT_NET"
+ }
+ ]
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withNetwork/hot-mog-0108-bs1271.env b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withNetwork/hot-mog-0108-bs1271.env
new file mode 100644
index 0000000000..407bc8db30
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withNetwork/hot-mog-0108-bs1271.env
@@ -0,0 +1,60 @@
+parameters:
+ pd_server_names: ZRDM1MOGX01MPD001,ZRDM1MOGX01MPD002
+ pd_image_name: MOG_BASE_8.0
+ pd_flavor_name: m3.xlarge
+ oam_server_names: ZRDM1MOGX01OAM001,ZRDM1MOGX01OAM002
+ oam_image_name: MOG_BASE_8.0
+ oam_flavor_name: m3.xlarge
+ sm_server_names: ZRDM1MOGX01MSM001,ZRDM1MOGX01MSM002
+ sm_image_name: MOG_BASE_8.0
+ sm_flavor_name: m2.xlarge4
+ ps_server_names: ZRDM1MOGX01MPS001,ZRDM1MOGX01MPS002,ZRDM1MOGX01MPS003,ZRDM1MOGX01MPS004
+ ps_image_name: MOG_BASE_8.0
+ ps_flavor_name: m3.xlarge
+ cm_server_names: ZRDM1MOGX01MCM001
+ cm_image_name: MOG_BASE_8.0
+ cm_flavor_name: m3.xlarge
+ availabilityzone_name: nova
+ oam_net_name: oam_protected_net_0
+ oam_net_ips: 107.250.172.213,107.250.172.214,107.250.172.215,107.250.172.216,107.250.172.217
+ #internet_net_name: dmz_protected_net_0
+ #internet_net_ips: 107.239.53.4,107.239.53.5
+ # internet_net_floating_ip: 107.239.53.6
+ sl_net_name: exn_protected_net_0
+ sl_net_ips: 107.239.45.4,107.239.45.5
+ sl_net_floating_ip: 107.239.45.6
+ repl_net_name: cor_direct_net_0
+ repl_net_ips: 107.239.33.57,107.239.33.58
+ rx_net_name: cor_direct_net_1
+ rx_net_ips: 107.239.34.3,107.239.34.4
+ rx_net_floating_ip: 107.239.34.5
+ ran_net_name: gn_direct_net_0
+ ran_net_ips: 107.239.36.3,107.239.36.4
+ ran_net_floating_ip: 107.239.36.5
+ dummy_net_name_0: mog_dummy_0
+ dummy_net_start_0: 169.254.1.4
+ dummy_net_end_0: 169.254.1.254
+ dummy_net_cidr_0: 169.254.1.0/24
+ dummy_net_netmask_0: 255.255.255.0
+ dummy_net_name_1: mog_dummy_1
+ dummy_net_start_1: 169.254.2.4
+ dummy_net_end_1: 169.254.2.254
+ dummy_net_cidr_1: 169.254.2.0/24
+ dummy_net_netmask_1: 255.255.255.0
+ csb_net_name: int_mog_csb_net
+ csb_net_ips: 172.26.0.10,172.26.0.11,172.26.0.12,172.26.0.13,172.26.0.14,172.26.0.15,172.26.0.16,172.26.0.17,172.26.0.18,172.26.0.19,172.26.0.20
+ csb_net_start: 172.26.0.1
+ csb_net_end: 172.26.0.254
+ csb_net_cidr: 172.26.0.0/24
+ csb_net_netmask: 255.255.255.0
+ security_group_name: mog_security_group
+ mog_swift_container: http://10.147.38.210:8080/v1/AUTH_8e501b8121f34a6eaaf526d3305985cc/mogtestcontainer
+ mog_script_dir: /root
+ mog_script_name: http://10.147.38.210:8080/v1/AUTH_8e501b8121f34a6eaaf526d3305985cc/mogtestcontainer/mog-cloudinit.sh
+ mog_parameter_name: http://10.147.38.210:8080/v1/AUTH_8e501b8121f34a6eaaf526d3305985cc/mogtestcontainer
+ cluster-manager-vol-1: 43ccf5ba-2d50-427b-a38f-e8c7d8670eee
+ session-manager-vol-1: 49201898-333d-4c88-b58d-cf573b091633
+ session-manager-vol-2: 4c35b5f1-ce99-4220-a6e2-cda6e2d713a0
+ oam-vol-1: 0a7fcd9e-2624-401d-ac21-b0191f85ec77
+ oam-vol-2: 6d169cb6-6ddc-41dc-920c-2839898a2924
+ cluster-manager-vol-2: 6f92e211-2d61-487d-8f84-d2d00cea3698
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withNetwork/hot-mog-0108-bs1271.yml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withNetwork/hot-mog-0108-bs1271.yml
new file mode 100644
index 0000000000..f069d4dd23
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withNetwork/hot-mog-0108-bs1271.yml
@@ -0,0 +1,733 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates MOG stack
+
+parameters:
+ pd_server_names:
+ type: comma_delimited_list
+ label: PD server names
+ description: name of the PD instance
+ pd_image_name:
+ type: string
+ label: image name
+ description: PD image name
+ pd_flavor_name:
+ type: string
+ label: PD flavor name
+ description: flavor name of PD instance
+ oam_server_names:
+ type: comma_delimited_list
+ label: OAM server names
+ description: name of the OAM instance
+ oam_image_name:
+ type: string
+ label: image name
+ description: OAM image name
+ oam_flavor_name:
+ type: string
+ label: OAM flavor name
+ description: flavor name of OAM instance
+ sm_server_names:
+ type: comma_delimited_list
+ label: SM server names
+ description: name of the SM instance
+ sm_image_name:
+ type: string
+ label: image name
+ description: SM image name
+ sm_flavor_name:
+ type: string
+ label: SM flavor name
+ description: flavor name of SM instance
+ ps_server_names:
+ type: comma_delimited_list
+ label: PS server names
+ description: name of the PS instance
+ ps_image_name:
+ type: string
+ label: PS image name
+ description: PS image name
+ ps_flavor_name:
+ type: string
+ label: PS flavor name
+ description: flavor name of PS instance
+ cm_server_names:
+ type: comma_delimited_list
+ label: CM server names
+ description: name of the CM instance
+ cm_image_name:
+ type: string
+ label: image name
+ description: CM image name
+ cm_flavor_name:
+ type: string
+ label: CM flavor name
+ description: flavor name of CM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ oam_net_name:
+ type: string
+ label: oam network name
+ description: name of the oam network
+ oam_net_ips:
+ type: comma_delimited_list
+ label: internet network ips
+ description: ip of the OAM network
+ # internet_net_name:
+ # type: string
+ # label: internet network name
+ # description: id of the internet network
+ # internet_net_ips:
+ # type: comma_delimited_list
+ # label: internet network ips
+ # description: ip of the internet network
+ # internet_net_floating_ip:
+ # type: string
+ # label: mog internet virtual ip
+ # description: mog internet virtual ip
+ sl_net_name:
+ type: string
+ label: silver lining network name
+ description: id of the sl network
+ sl_net_ips:
+ type: comma_delimited_list
+ label: silver lining network ips
+ description: ips of the sl network
+ sl_net_floating_ip:
+ type: string
+ label: mog sl net virtual ip
+ description: mog sl net virtual ip
+ repl_net_name:
+ type: string
+ label: Replication network name
+ description: name of the replication network
+ repl_net_ips:
+ type: comma_delimited_list
+ label: repl network ips
+ description: ips of repl network
+ rx_net_name:
+ type: string
+ label: Rx network name
+ description: Rx network name
+ rx_net_ips:
+ type: comma_delimited_list
+ label: Rx network ips
+ description: Rx network ips
+ rx_net_floating_ip:
+ type: string
+ label: mog rx net virtual ip
+ description: mog rx net virtual ip
+ ran_net_name:
+ type: string
+ label: RAN network name
+ description: RAN network name
+ ran_net_ips:
+ type: comma_delimited_list
+ label: RAN network ips
+ description: RAN network ip
+ ran_net_floating_ip:
+ type: string
+ label: mog ran net virtual ip
+ description: mog ran net virtual ip
+ csb_net_name:
+ type: string
+ label: csb internal network name
+ description: csb internal network name
+ csb_net_start:
+ type: string
+ label: csb internal start
+ description: csb internal start
+ csb_net_end:
+ type: string
+ label: csb internal end
+ description: csb internal end
+ csb_net_cidr:
+ type: string
+ label: csb ineternal cidr
+ description: csb internal cidr
+ csb_net_netmask:
+ type: string
+ description: CSB internal network subnet mask
+ csb_net_ips:
+ type: comma_delimited_list
+ description: mog_csb_net IP addresses
+ dummy_net_name_0:
+ type: string
+ label: csb internal network name
+ description: csb internal network name
+ dummy_net_start_0:
+ type: string
+ label: csb internal start
+ description: csb internal start
+ dummy_net_end_0:
+ type: string
+ label: csb internal end
+ description: csb internal end
+ dummy_net_cidr_0:
+ type: string
+ label: csb ineternal cidr
+ description: csb internal cidr
+ dummy_net_netmask_0:
+ type: string
+ description: CSB internal network subnet mask
+ dummy_net_name_1:
+ type: string
+ label: csb internal network name
+ description: csb internal network name
+ dummy_net_start_1:
+ type: string
+ label: csb internal start
+ description: csb internal start
+ dummy_net_end_1:
+ type: string
+ label: csb internal end
+ description: csb internal end
+ dummy_net_cidr_1:
+ type: string
+ label: csb ineternal cidr
+ description: csb internal cidr
+ dummy_net_netmask_1:
+ type: string
+ description: CSB internal network subnet mask
+
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ cluster-manager-vol-1:
+ type: string
+ label: mog-cm-vol-1
+ description: Cluster Manager volume 1
+ session-manager-vol-1:
+ type: string
+ label: mog-sm-vol-1
+ description: Session Manager volume 1
+ session-manager-vol-2:
+ type: string
+ label: mog-sm-vol-2
+ description: Session Manager volume 2
+ oam-vol-1:
+ type: string
+ label: mog-oam-vol-1
+ description: OAM volume 1
+ oam-vol-2:
+ type: string
+ label: mog-oam-vol-2
+ description: OAM volume 2
+ mog_swift_container:
+ type: string
+ label: mog Config URL
+ description: Config URL
+ mog_script_dir:
+ type: string
+ label: mog Config script directory
+ description: Config script directory
+ mog_script_name:
+ type: string
+ label: mog Config script name
+ description: Config script name
+ mog_parameter_name:
+ type: string
+ label: mog script parameter name
+ description: Config script parameter csv file name
+ cluster-manager-vol-2:
+ type: string
+ label: mog-cm-vol-2
+ description: Cluster Manager volume 2 with ISO image
+
+resources:
+ mog_security_group:
+ type: OS::Neutron::SecurityGroup
+ properties:
+ description: mog security group
+ name: {get_param: security_group_name}
+ rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}
+ ]
+
+ csb_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: csb_net_name}
+
+ csb_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: csb_net_name}
+ network_id: { get_resource: csb_net }
+ cidr: { get_param: csb_net_cidr }
+ allocation_pools: [{"start": {get_param: csb_net_start}, "end": {get_param: csb_net_end}}]
+ enable_dhcp: true
+
+ dummy_net_0:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: dummy_net_name_0}
+
+ dummy_ip_subnet_0:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: dummy_net_name_0}
+ network_id: { get_resource: dummy_net_0 }
+ cidr: { get_param: dummy_net_cidr_0 }
+ allocation_pools: [{"start": {get_param: dummy_net_start_0}, "end": {get_param: dummy_net_end_0}}]
+ enable_dhcp: true
+
+ dummy_net_1:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: dummy_net_name_1}
+
+ dummy_ip_subnet_1:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: dummy_net_name_1}
+ network_id: { get_resource: dummy_net_1 }
+ cidr: { get_param: dummy_net_cidr_1 }
+ allocation_pools: [{"start": {get_param: dummy_net_start_1}, "end": {get_param: dummy_net_end_1}}]
+ enable_dhcp: true
+
+
+ mogconfig:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ template: |
+ #!/bin/bash
+ wget -P script_dir swift_container/script_name
+ wget -P script_dir swift_container/parameter_name
+ chmod 755 script_dir/script_name
+ script_dir/script_name
+ params:
+ swift_container: {get_param: mog_swift_container}
+ script_dir: {get_param: mog_script_dir}
+ script_name: {get_param: mog_script_name}
+ #parameter_name: {get_param: mog_parameter_name}
+
+
+ servergroup_mog01:
+ type: OS::Nova::ServerGroup
+ properties:
+ policies:
+ - anti-affinity
+ server_pd_01:
+ type: OS::Nova::Server
+ properties:
+# config_drive: "True"
+ name: {get_param: [pd_server_names, 0]}
+ image: {get_param: pd_image_name}
+ flavor: {get_param: pd_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+ networks:
+ - port: {get_resource: pd01_port_0}
+ - port: {get_resource: pd01_port_1}
+ - port: {get_resource: pd01_port_2}
+ - port: {get_resource: pd01_port_3}
+ - port: {get_resource: pd01_port_4}
+ - port: {get_resource: pd01_port_5}
+ - port: {get_resource: pd01_port_6}
+ # - port: {get_resource: pd01_port_7}
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog01}}
+ user_data_format: RAW
+
+
+ pd01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ security_groups: [{get_resource: mog_security_group}]
+ pd01_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [oam_net_ips, 0]}}]
+ security_groups: [{get_resource: mog_security_group}]
+ pd01_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: dummy_net_0}
+ security_groups: [{get_resource: mog_security_group}]
+ pd01_port_3:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: rx_net_name}
+ fixed_ips: [{"ip_address": {get_param: [rx_net_ips, 0]}}]
+ allowed_address_pairs: [{"ip_address": {get_param: rx_net_floating_ip} }]
+ security_groups: [{get_resource: mog_security_group}]
+ pd01_port_4:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: dummy_net_1}
+ security_groups: [{get_resource: mog_security_group}]
+ pd01_port_5:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: ran_net_name}
+ fixed_ips: [{"ip_address": {get_param: [ran_net_ips, 0]}}]
+ allowed_address_pairs: [{"ip_address": {get_param: ran_net_floating_ip} }]
+ security_groups: [{get_resource: mog_security_group}]
+
+ pd01_port_6:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: sl_net_name}
+ fixed_ips: [{"ip_address": {get_param: [sl_net_ips, 0]}}]
+ allowed_address_pairs: [{"ip_address": {get_param: sl_net_floating_ip}}]
+ security_groups: [{get_resource: mog_security_group}]
+
+ # pd01_port_7:
+ #j type: OS::Neutron::Port
+ # properties:
+ # network: {get_param: internet_net_name}
+ # fixed_ips: [{"ip_address": {get_param: [internet_net_ips, 0]}}]
+ # allowed_address_pairs: [{"ip_address": {get_param: internet_net_floating_ip} }]
+ # security_groups: [{get_resource: mog_security_group}]
+
+ server_pd_02:
+ type: OS::Nova::Server
+ properties:
+# config_drive: "True"
+ name: {get_param: [pd_server_names, 1]}
+ image: {get_param: pd_image_name}
+ flavor: {get_param: pd_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+ networks:
+ - port: {get_resource: pd02_port_0}
+ - port: {get_resource: pd02_port_1}
+ - port: {get_resource: pd01_port_2}
+ - port: {get_resource: pd01_port_3}
+ - port: {get_resource: pd02_port_4}
+ - port: {get_resource: pd02_port_5}
+ - port: {get_resource: pd02_port_6}
+ # - port: {get_resource: pd02_port_7}
+
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog01}}
+ user_data_format: RAW
+
+ pd02_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ security_groups: [{get_resource: mog_security_group}]
+
+ pd02_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [oam_net_ips, 1]}}]
+ security_groups: [{get_resource: mog_security_group}]
+
+ pd02_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: dummy_net_0}
+ security_groups: [{get_resource: mog_security_group}]
+
+ pd02_port_3:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: rx_net_name}
+ fixed_ips: [{"ip_address": {get_param: [rx_net_ips, 1]}}]
+ allowed_address_pairs: [{"ip_address": {get_param: rx_net_floating_ip} }]
+ security_groups: [{get_resource: mog_security_group}]
+
+ pd02_port_4:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: dummy_net_1}
+ security_groups: [{get_resource: mog_security_group}]
+
+ pd02_port_5:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: ran_net_name}
+ fixed_ips: [{"ip_address": {get_param: [ran_net_ips, 1]}}]
+ allowed_address_pairs: [{"ip_address": {get_param: ran_net_floating_ip} }]
+ security_groups: [{get_resource: mog_security_group}]
+
+ pd02_port_6:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: sl_net_name}
+ fixed_ips: [{"ip_address": {get_param: [sl_net_ips, 1]}}]
+ allowed_address_pairs: [{"ip_address": {get_param: sl_net_floating_ip}}]
+ security_groups: [{get_resource: mog_security_group}]
+
+ # pd02_port_7:
+ # type: OS::Neutron::Port
+ # properties:
+ # network: {get_param: internet_net_name}
+ # fixed_ips: [{"ip_address": {get_param: [internet_net_ips, 1]}}]
+ # allowed_address_pairs: [{"ip_address": {get_param: internet_net_floating_ip} }]
+ # security_groups: [{get_resource: mog_security_group}]
+
+ servergroup_mog02:
+ type: OS::Nova::ServerGroup
+ properties:
+ policies:
+ - anti-affinity
+ server_oam01:
+ type: OS::Nova::Server
+ properties:
+# config_drive: "True"
+ name: {get_param: [oam_server_names, 0]}
+ image: {get_param: oam_image_name}
+ flavor: {get_param: oam_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+ networks:
+ - port: {get_resource: oam01_port_0}
+ - port: {get_resource: oam01_port_1}
+# block_device_mapping:
+# - device_name: vdd
+# volume_id: { get_param: oam-vol-1 }
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog02}}
+ user_data_format: RAW
+
+ oam01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ security_groups: [{get_resource: mog_security_group}]
+
+ oam01_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [oam_net_ips, 2]}}]
+ security_groups: [{get_resource: mog_security_group}]
+
+
+ server_oam02:
+ type: OS::Nova::Server
+ properties:
+# config_drive: "True"
+ name: {get_param: [oam_server_names, 1]}
+ image: {get_param: oam_image_name}
+ flavor: {get_param: oam_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+ networks:
+ - port: {get_resource: oam02_port_0}
+ - port: {get_resource: oam02_port_1}
+# block_device_mapping:
+# - device_name: vdd
+# volume_id: { get_param: oam-vol-2 }
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog02}}
+ user_data_format: RAW
+
+ oam02_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ security_groups: [{get_resource: mog_security_group}]
+
+ oam02_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [oam_net_ips, 3]}}]
+ security_groups: [{get_resource: mog_security_group}]
+
+
+ server_sm01:
+ type: OS::Nova::Server
+ properties:
+# config_drive: "True"
+ name: {get_param: [sm_server_names, 0]}
+ image: {get_param: sm_image_name}
+ flavor: {get_param: sm_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+ networks:
+ - port: {get_resource: sm01_port_0}
+ - port: {get_resource: sm01_port_1}
+# block_device_mapping:
+# - device_name: vdd
+# volume_id: { get_param: session-manager-vol-1 }
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog02}}
+ user_data_format: RAW
+
+ sm01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ security_groups: [{get_resource: mog_security_group}]
+
+ sm01_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: dummy_net_0}
+ security_groups: [{get_resource: mog_security_group}]
+
+ sm01_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: repl_net_name}
+ fixed_ips: [{"ip_address": {get_param: [repl_net_ips, 0]}}]
+ security_groups: [{get_resource: mog_security_group}]
+
+ server_sm02:
+ type: OS::Nova::Server
+ properties:
+# config_drive: "True"
+ name: {get_param: [sm_server_names, 1]}
+ image: {get_param: sm_image_name}
+ flavor: {get_param: sm_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+# block_device_mapping:
+# - device_name: vdd
+# volume_id: { get_param: session-manager-vol-2 }
+ networks:
+ - port: {get_resource: sm02_port_0}
+ - port: {get_resource: sm02_port_1}
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog02}}
+ user_data_format: RAW
+
+ sm02_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ security_groups: [{get_resource: mog_security_group}]
+
+ sm02_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: dummy_net_0}
+ security_groups: [{get_resource: mog_security_group}]
+
+ sm02_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: repl_net_name}
+ fixed_ips: [{"ip_address": {get_param: [repl_net_ips, 1]}}]
+ security_groups: [{get_resource: mog_security_group}]
+
+ servergroup_mog03:
+ type: OS::Nova::ServerGroup
+ properties:
+ policies:
+ - anti-affinity
+ server_ps01:
+ type: OS::Nova::Server
+ properties:
+# config_drive: "True"
+ name: {get_param: [ps_server_names, 0]}
+ image: {get_param: ps_image_name}
+ flavor: {get_param: ps_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+ networks:
+ - port: {get_resource: ps01_port_0}
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog03}}
+ user_data_format: RAW
+
+ ps01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ security_groups: [{get_resource: mog_security_group}]
+
+ server_ps02:
+ type: OS::Nova::Server
+ properties:
+# config_drive: "True"
+ name: {get_param: [ps_server_names, 1]}
+ image: {get_param: ps_image_name}
+ flavor: {get_param: ps_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+ networks:
+ - port: {get_resource: ps02_port_0}
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog03}}
+ user_data_format: RAW
+
+ ps02_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ security_groups: [{get_resource: mog_security_group}]
+
+ server_ps03:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: [ps_server_names, 2]}
+ image: {get_param: ps_image_name}
+ flavor: {get_param: ps_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+ networks:
+ - port: {get_resource: ps03_port_0}
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog03}}
+ user_data_format: RAW
+
+ ps03_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ security_groups: [{get_resource: mog_security_group}]
+
+ server_ps04:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: [ps_server_names, 3]}
+ image: {get_param: ps_image_name}
+ flavor: {get_param: ps_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+ networks:
+ - port: {get_resource: ps04_port_0}
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog03}}
+ user_data_format: RAW
+
+ ps04_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ security_groups: [{get_resource: mog_security_group}]
+
+ server_cm01:
+ type: OS::Nova::Server
+ properties:
+# config_drive: "True"
+ name: {get_param: [cm_server_names, 0]}
+ image: {get_param: cm_image_name}
+ flavor: {get_param: cm_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+ networks:
+ - port: {get_resource: cm01_port_0}
+ - port: {get_resource: cm01_port_1}
+# block_device_mapping:
+# - device_name: vdd
+# volume_id: { get_param: cluster-manager-vol-2 }
+# - device_name: vde
+# volume_id: { get_param: cluster-manager-vol-1 }
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog03}}
+ user_data_format: RAW
+
+ cm01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ fixed_ips: [{"ip_address": {get_param: [csb_net_ips, 10]}}]
+ security_groups: [{get_resource: mog_security_group}]
+
+ cm01_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [oam_net_ips, 4]}}]
+ security_groups: [{get_resource: mog_security_group}]
+
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withNetwork/network.yml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withNetwork/network.yml
new file mode 100644
index 0000000000..f069d4dd23
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withNetwork/network.yml
@@ -0,0 +1,733 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates MOG stack
+
+parameters:
+ pd_server_names:
+ type: comma_delimited_list
+ label: PD server names
+ description: name of the PD instance
+ pd_image_name:
+ type: string
+ label: image name
+ description: PD image name
+ pd_flavor_name:
+ type: string
+ label: PD flavor name
+ description: flavor name of PD instance
+ oam_server_names:
+ type: comma_delimited_list
+ label: OAM server names
+ description: name of the OAM instance
+ oam_image_name:
+ type: string
+ label: image name
+ description: OAM image name
+ oam_flavor_name:
+ type: string
+ label: OAM flavor name
+ description: flavor name of OAM instance
+ sm_server_names:
+ type: comma_delimited_list
+ label: SM server names
+ description: name of the SM instance
+ sm_image_name:
+ type: string
+ label: image name
+ description: SM image name
+ sm_flavor_name:
+ type: string
+ label: SM flavor name
+ description: flavor name of SM instance
+ ps_server_names:
+ type: comma_delimited_list
+ label: PS server names
+ description: name of the PS instance
+ ps_image_name:
+ type: string
+ label: PS image name
+ description: PS image name
+ ps_flavor_name:
+ type: string
+ label: PS flavor name
+ description: flavor name of PS instance
+ cm_server_names:
+ type: comma_delimited_list
+ label: CM server names
+ description: name of the CM instance
+ cm_image_name:
+ type: string
+ label: image name
+ description: CM image name
+ cm_flavor_name:
+ type: string
+ label: CM flavor name
+ description: flavor name of CM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ oam_net_name:
+ type: string
+ label: oam network name
+ description: name of the oam network
+ oam_net_ips:
+ type: comma_delimited_list
+ label: internet network ips
+ description: ip of the OAM network
+ # internet_net_name:
+ # type: string
+ # label: internet network name
+ # description: id of the internet network
+ # internet_net_ips:
+ # type: comma_delimited_list
+ # label: internet network ips
+ # description: ip of the internet network
+ # internet_net_floating_ip:
+ # type: string
+ # label: mog internet virtual ip
+ # description: mog internet virtual ip
+ sl_net_name:
+ type: string
+ label: silver lining network name
+ description: id of the sl network
+ sl_net_ips:
+ type: comma_delimited_list
+ label: silver lining network ips
+ description: ips of the sl network
+ sl_net_floating_ip:
+ type: string
+ label: mog sl net virtual ip
+ description: mog sl net virtual ip
+ repl_net_name:
+ type: string
+ label: Replication network name
+ description: name of the replication network
+ repl_net_ips:
+ type: comma_delimited_list
+ label: repl network ips
+ description: ips of repl network
+ rx_net_name:
+ type: string
+ label: Rx network name
+ description: Rx network name
+ rx_net_ips:
+ type: comma_delimited_list
+ label: Rx network ips
+ description: Rx network ips
+ rx_net_floating_ip:
+ type: string
+ label: mog rx net virtual ip
+ description: mog rx net virtual ip
+ ran_net_name:
+ type: string
+ label: RAN network name
+ description: RAN network name
+ ran_net_ips:
+ type: comma_delimited_list
+ label: RAN network ips
+ description: RAN network ip
+ ran_net_floating_ip:
+ type: string
+ label: mog ran net virtual ip
+ description: mog ran net virtual ip
+ csb_net_name:
+ type: string
+ label: csb internal network name
+ description: csb internal network name
+ csb_net_start:
+ type: string
+ label: csb internal start
+ description: csb internal start
+ csb_net_end:
+ type: string
+ label: csb internal end
+ description: csb internal end
+ csb_net_cidr:
+ type: string
+ label: csb ineternal cidr
+ description: csb internal cidr
+ csb_net_netmask:
+ type: string
+ description: CSB internal network subnet mask
+ csb_net_ips:
+ type: comma_delimited_list
+ description: mog_csb_net IP addresses
+ dummy_net_name_0:
+ type: string
+ label: csb internal network name
+ description: csb internal network name
+ dummy_net_start_0:
+ type: string
+ label: csb internal start
+ description: csb internal start
+ dummy_net_end_0:
+ type: string
+ label: csb internal end
+ description: csb internal end
+ dummy_net_cidr_0:
+ type: string
+ label: csb ineternal cidr
+ description: csb internal cidr
+ dummy_net_netmask_0:
+ type: string
+ description: CSB internal network subnet mask
+ dummy_net_name_1:
+ type: string
+ label: csb internal network name
+ description: csb internal network name
+ dummy_net_start_1:
+ type: string
+ label: csb internal start
+ description: csb internal start
+ dummy_net_end_1:
+ type: string
+ label: csb internal end
+ description: csb internal end
+ dummy_net_cidr_1:
+ type: string
+ label: csb ineternal cidr
+ description: csb internal cidr
+ dummy_net_netmask_1:
+ type: string
+ description: CSB internal network subnet mask
+
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ cluster-manager-vol-1:
+ type: string
+ label: mog-cm-vol-1
+ description: Cluster Manager volume 1
+ session-manager-vol-1:
+ type: string
+ label: mog-sm-vol-1
+ description: Session Manager volume 1
+ session-manager-vol-2:
+ type: string
+ label: mog-sm-vol-2
+ description: Session Manager volume 2
+ oam-vol-1:
+ type: string
+ label: mog-oam-vol-1
+ description: OAM volume 1
+ oam-vol-2:
+ type: string
+ label: mog-oam-vol-2
+ description: OAM volume 2
+ mog_swift_container:
+ type: string
+ label: mog Config URL
+ description: Config URL
+ mog_script_dir:
+ type: string
+ label: mog Config script directory
+ description: Config script directory
+ mog_script_name:
+ type: string
+ label: mog Config script name
+ description: Config script name
+ mog_parameter_name:
+ type: string
+ label: mog script parameter name
+ description: Config script parameter csv file name
+ cluster-manager-vol-2:
+ type: string
+ label: mog-cm-vol-2
+ description: Cluster Manager volume 2 with ISO image
+
+resources:
+ mog_security_group:
+ type: OS::Neutron::SecurityGroup
+ properties:
+ description: mog security group
+ name: {get_param: security_group_name}
+ rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}
+ ]
+
+ csb_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: csb_net_name}
+
+ csb_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: csb_net_name}
+ network_id: { get_resource: csb_net }
+ cidr: { get_param: csb_net_cidr }
+ allocation_pools: [{"start": {get_param: csb_net_start}, "end": {get_param: csb_net_end}}]
+ enable_dhcp: true
+
+ dummy_net_0:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: dummy_net_name_0}
+
+ dummy_ip_subnet_0:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: dummy_net_name_0}
+ network_id: { get_resource: dummy_net_0 }
+ cidr: { get_param: dummy_net_cidr_0 }
+ allocation_pools: [{"start": {get_param: dummy_net_start_0}, "end": {get_param: dummy_net_end_0}}]
+ enable_dhcp: true
+
+ dummy_net_1:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: dummy_net_name_1}
+
+ dummy_ip_subnet_1:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: dummy_net_name_1}
+ network_id: { get_resource: dummy_net_1 }
+ cidr: { get_param: dummy_net_cidr_1 }
+ allocation_pools: [{"start": {get_param: dummy_net_start_1}, "end": {get_param: dummy_net_end_1}}]
+ enable_dhcp: true
+
+
+ mogconfig:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ template: |
+ #!/bin/bash
+ wget -P script_dir swift_container/script_name
+ wget -P script_dir swift_container/parameter_name
+ chmod 755 script_dir/script_name
+ script_dir/script_name
+ params:
+ swift_container: {get_param: mog_swift_container}
+ script_dir: {get_param: mog_script_dir}
+ script_name: {get_param: mog_script_name}
+ #parameter_name: {get_param: mog_parameter_name}
+
+
+ servergroup_mog01:
+ type: OS::Nova::ServerGroup
+ properties:
+ policies:
+ - anti-affinity
+ server_pd_01:
+ type: OS::Nova::Server
+ properties:
+# config_drive: "True"
+ name: {get_param: [pd_server_names, 0]}
+ image: {get_param: pd_image_name}
+ flavor: {get_param: pd_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+ networks:
+ - port: {get_resource: pd01_port_0}
+ - port: {get_resource: pd01_port_1}
+ - port: {get_resource: pd01_port_2}
+ - port: {get_resource: pd01_port_3}
+ - port: {get_resource: pd01_port_4}
+ - port: {get_resource: pd01_port_5}
+ - port: {get_resource: pd01_port_6}
+ # - port: {get_resource: pd01_port_7}
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog01}}
+ user_data_format: RAW
+
+
+ pd01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ security_groups: [{get_resource: mog_security_group}]
+ pd01_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [oam_net_ips, 0]}}]
+ security_groups: [{get_resource: mog_security_group}]
+ pd01_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: dummy_net_0}
+ security_groups: [{get_resource: mog_security_group}]
+ pd01_port_3:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: rx_net_name}
+ fixed_ips: [{"ip_address": {get_param: [rx_net_ips, 0]}}]
+ allowed_address_pairs: [{"ip_address": {get_param: rx_net_floating_ip} }]
+ security_groups: [{get_resource: mog_security_group}]
+ pd01_port_4:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: dummy_net_1}
+ security_groups: [{get_resource: mog_security_group}]
+ pd01_port_5:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: ran_net_name}
+ fixed_ips: [{"ip_address": {get_param: [ran_net_ips, 0]}}]
+ allowed_address_pairs: [{"ip_address": {get_param: ran_net_floating_ip} }]
+ security_groups: [{get_resource: mog_security_group}]
+
+ pd01_port_6:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: sl_net_name}
+ fixed_ips: [{"ip_address": {get_param: [sl_net_ips, 0]}}]
+ allowed_address_pairs: [{"ip_address": {get_param: sl_net_floating_ip}}]
+ security_groups: [{get_resource: mog_security_group}]
+
+ # pd01_port_7:
+ #j type: OS::Neutron::Port
+ # properties:
+ # network: {get_param: internet_net_name}
+ # fixed_ips: [{"ip_address": {get_param: [internet_net_ips, 0]}}]
+ # allowed_address_pairs: [{"ip_address": {get_param: internet_net_floating_ip} }]
+ # security_groups: [{get_resource: mog_security_group}]
+
+ server_pd_02:
+ type: OS::Nova::Server
+ properties:
+# config_drive: "True"
+ name: {get_param: [pd_server_names, 1]}
+ image: {get_param: pd_image_name}
+ flavor: {get_param: pd_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+ networks:
+ - port: {get_resource: pd02_port_0}
+ - port: {get_resource: pd02_port_1}
+ - port: {get_resource: pd01_port_2}
+ - port: {get_resource: pd01_port_3}
+ - port: {get_resource: pd02_port_4}
+ - port: {get_resource: pd02_port_5}
+ - port: {get_resource: pd02_port_6}
+ # - port: {get_resource: pd02_port_7}
+
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog01}}
+ user_data_format: RAW
+
+ pd02_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ security_groups: [{get_resource: mog_security_group}]
+
+ pd02_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [oam_net_ips, 1]}}]
+ security_groups: [{get_resource: mog_security_group}]
+
+ pd02_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: dummy_net_0}
+ security_groups: [{get_resource: mog_security_group}]
+
+ pd02_port_3:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: rx_net_name}
+ fixed_ips: [{"ip_address": {get_param: [rx_net_ips, 1]}}]
+ allowed_address_pairs: [{"ip_address": {get_param: rx_net_floating_ip} }]
+ security_groups: [{get_resource: mog_security_group}]
+
+ pd02_port_4:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: dummy_net_1}
+ security_groups: [{get_resource: mog_security_group}]
+
+ pd02_port_5:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: ran_net_name}
+ fixed_ips: [{"ip_address": {get_param: [ran_net_ips, 1]}}]
+ allowed_address_pairs: [{"ip_address": {get_param: ran_net_floating_ip} }]
+ security_groups: [{get_resource: mog_security_group}]
+
+ pd02_port_6:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: sl_net_name}
+ fixed_ips: [{"ip_address": {get_param: [sl_net_ips, 1]}}]
+ allowed_address_pairs: [{"ip_address": {get_param: sl_net_floating_ip}}]
+ security_groups: [{get_resource: mog_security_group}]
+
+ # pd02_port_7:
+ # type: OS::Neutron::Port
+ # properties:
+ # network: {get_param: internet_net_name}
+ # fixed_ips: [{"ip_address": {get_param: [internet_net_ips, 1]}}]
+ # allowed_address_pairs: [{"ip_address": {get_param: internet_net_floating_ip} }]
+ # security_groups: [{get_resource: mog_security_group}]
+
+ servergroup_mog02:
+ type: OS::Nova::ServerGroup
+ properties:
+ policies:
+ - anti-affinity
+ server_oam01:
+ type: OS::Nova::Server
+ properties:
+# config_drive: "True"
+ name: {get_param: [oam_server_names, 0]}
+ image: {get_param: oam_image_name}
+ flavor: {get_param: oam_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+ networks:
+ - port: {get_resource: oam01_port_0}
+ - port: {get_resource: oam01_port_1}
+# block_device_mapping:
+# - device_name: vdd
+# volume_id: { get_param: oam-vol-1 }
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog02}}
+ user_data_format: RAW
+
+ oam01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ security_groups: [{get_resource: mog_security_group}]
+
+ oam01_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [oam_net_ips, 2]}}]
+ security_groups: [{get_resource: mog_security_group}]
+
+
+ server_oam02:
+ type: OS::Nova::Server
+ properties:
+# config_drive: "True"
+ name: {get_param: [oam_server_names, 1]}
+ image: {get_param: oam_image_name}
+ flavor: {get_param: oam_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+ networks:
+ - port: {get_resource: oam02_port_0}
+ - port: {get_resource: oam02_port_1}
+# block_device_mapping:
+# - device_name: vdd
+# volume_id: { get_param: oam-vol-2 }
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog02}}
+ user_data_format: RAW
+
+ oam02_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ security_groups: [{get_resource: mog_security_group}]
+
+ oam02_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [oam_net_ips, 3]}}]
+ security_groups: [{get_resource: mog_security_group}]
+
+
+ server_sm01:
+ type: OS::Nova::Server
+ properties:
+# config_drive: "True"
+ name: {get_param: [sm_server_names, 0]}
+ image: {get_param: sm_image_name}
+ flavor: {get_param: sm_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+ networks:
+ - port: {get_resource: sm01_port_0}
+ - port: {get_resource: sm01_port_1}
+# block_device_mapping:
+# - device_name: vdd
+# volume_id: { get_param: session-manager-vol-1 }
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog02}}
+ user_data_format: RAW
+
+ sm01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ security_groups: [{get_resource: mog_security_group}]
+
+ sm01_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: dummy_net_0}
+ security_groups: [{get_resource: mog_security_group}]
+
+ sm01_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: repl_net_name}
+ fixed_ips: [{"ip_address": {get_param: [repl_net_ips, 0]}}]
+ security_groups: [{get_resource: mog_security_group}]
+
+ server_sm02:
+ type: OS::Nova::Server
+ properties:
+# config_drive: "True"
+ name: {get_param: [sm_server_names, 1]}
+ image: {get_param: sm_image_name}
+ flavor: {get_param: sm_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+# block_device_mapping:
+# - device_name: vdd
+# volume_id: { get_param: session-manager-vol-2 }
+ networks:
+ - port: {get_resource: sm02_port_0}
+ - port: {get_resource: sm02_port_1}
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog02}}
+ user_data_format: RAW
+
+ sm02_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ security_groups: [{get_resource: mog_security_group}]
+
+ sm02_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: dummy_net_0}
+ security_groups: [{get_resource: mog_security_group}]
+
+ sm02_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: repl_net_name}
+ fixed_ips: [{"ip_address": {get_param: [repl_net_ips, 1]}}]
+ security_groups: [{get_resource: mog_security_group}]
+
+ servergroup_mog03:
+ type: OS::Nova::ServerGroup
+ properties:
+ policies:
+ - anti-affinity
+ server_ps01:
+ type: OS::Nova::Server
+ properties:
+# config_drive: "True"
+ name: {get_param: [ps_server_names, 0]}
+ image: {get_param: ps_image_name}
+ flavor: {get_param: ps_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+ networks:
+ - port: {get_resource: ps01_port_0}
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog03}}
+ user_data_format: RAW
+
+ ps01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ security_groups: [{get_resource: mog_security_group}]
+
+ server_ps02:
+ type: OS::Nova::Server
+ properties:
+# config_drive: "True"
+ name: {get_param: [ps_server_names, 1]}
+ image: {get_param: ps_image_name}
+ flavor: {get_param: ps_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+ networks:
+ - port: {get_resource: ps02_port_0}
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog03}}
+ user_data_format: RAW
+
+ ps02_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ security_groups: [{get_resource: mog_security_group}]
+
+ server_ps03:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: [ps_server_names, 2]}
+ image: {get_param: ps_image_name}
+ flavor: {get_param: ps_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+ networks:
+ - port: {get_resource: ps03_port_0}
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog03}}
+ user_data_format: RAW
+
+ ps03_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ security_groups: [{get_resource: mog_security_group}]
+
+ server_ps04:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: [ps_server_names, 3]}
+ image: {get_param: ps_image_name}
+ flavor: {get_param: ps_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+ networks:
+ - port: {get_resource: ps04_port_0}
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog03}}
+ user_data_format: RAW
+
+ ps04_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ security_groups: [{get_resource: mog_security_group}]
+
+ server_cm01:
+ type: OS::Nova::Server
+ properties:
+# config_drive: "True"
+ name: {get_param: [cm_server_names, 0]}
+ image: {get_param: cm_image_name}
+ flavor: {get_param: cm_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+ networks:
+ - port: {get_resource: cm01_port_0}
+ - port: {get_resource: cm01_port_1}
+# block_device_mapping:
+# - device_name: vdd
+# volume_id: { get_param: cluster-manager-vol-2 }
+# - device_name: vde
+# volume_id: { get_param: cluster-manager-vol-1 }
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog03}}
+ user_data_format: RAW
+
+ cm01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ fixed_ips: [{"ip_address": {get_param: [csb_net_ips, 10]}}]
+ security_groups: [{get_resource: mog_security_group}]
+
+ cm01_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [oam_net_ips, 4]}}]
+ security_groups: [{get_resource: mog_security_group}]
+
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withNetwork/zip/withNetwork.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withNetwork/zip/withNetwork.zip
new file mode 100644
index 0000000000..7cd81437d3
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withNetwork/zip/withNetwork.zip
Binary files differ
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withoutManifest/create_stack.sh b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withoutManifest/create_stack.sh
new file mode 100644
index 0000000000..186d1c34fb
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withoutManifest/create_stack.sh
@@ -0,0 +1 @@
+heat stack-create vMME -e vmme_small.env -f vmme_small.yml
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withoutManifest/vmme_small_create_fsb.env b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withoutManifest/vmme_small_create_fsb.env
new file mode 100644
index 0000000000..750bb2dd44
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withoutManifest/vmme_small_create_fsb.env
@@ -0,0 +1,8 @@
+parameters:
+ volume_type: Gold
+ volume_size: 320
+ FSB_1_image: MME_FSB1_15B-CP04-r5a01
+ FSB_2_image: MME_FSB2_15B-CP04-r5a01
+ FSB1_volume_name: vFSB1_1_Vol_1
+ FSB2_volume_name: vFSB2_1_Vol_1
+
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withoutManifest/vmme_small_create_fsb.yml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withoutManifest/vmme_small_create_fsb.yml
new file mode 100644
index 0000000000..2d695a50c1
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withoutManifest/vmme_small_create_fsb.yml
@@ -0,0 +1,54 @@
+heat_template_version: 2013-05-23
+
+description: server template for vMME
+
+parameters:
+
+ volume_type:
+ type: string
+ label: volume type
+ description: volume type Gold
+
+ volume_size:
+ type: number
+ label: volume size
+ description: my volume size 320GB
+
+ FSB_1_image:
+ type: string
+ label: MME_FSB1
+ description: MME_FSB1_15B-CP04-r5a01
+
+ FSB_2_image:
+ type: string
+ label: MME_FSB2
+ description: MME_FSB2_15B-CP04-r5a01
+
+ FSB1_volume_name:
+ type: string
+ label: FSB1_volume
+ description: FSB1_volume_1
+
+ FSB2_volume_name:
+ type: string
+ label: FSB2_volume
+ description: FSB2_volume_1
+
+resources:
+
+ FSB1_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: volume_size}
+ volume_type: {get_param: volume_type}
+ name: {get_param: FSB1_volume_name}
+ image: {get_param: FSB_1_image}
+
+ FSB2_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: volume_size}
+ volume_type: {get_param: volume_type}
+ name: {get_param: FSB2_volume_name}
+ image: {get_param: FSB_2_image}
+
diff --git a/openecomp-be/backend/pom.xml b/openecomp-be/backend/pom.xml
new file mode 100644
index 0000000000..f483205ab9
--- /dev/null
+++ b/openecomp-be/backend/pom.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <artifactId>openecomp-sdc</artifactId>
+ <groupId>org.openecomp.sdc</groupId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>backend</artifactId>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>openecomp-sdc-vendor-license-manager</module>
+ <module>openecomp-sdc-vendor-software-product-manager</module>
+ <module>openecomp-sdc-validation-manager</module>
+ <module>openecomp-sdc-action-manager</module>
+ <module>openecomp-sdc-application-config-manager</module>
+ </modules>
+
+
+</project>
diff --git a/openecomp-be/configuration/pom.xml b/openecomp-be/configuration/pom.xml
new file mode 100644
index 0000000000..59d5712d61
--- /dev/null
+++ b/openecomp-be/configuration/pom.xml
@@ -0,0 +1,15 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>openecomp-sdc-configuration</artifactId>
+ <name>openecomp-sdc-configuration</name>
+ <packaging>pom</packaging>
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-common-lib/pom.xml b/openecomp-be/lib/openecomp-common-lib/pom.xml
new file mode 100644
index 0000000000..78c5e86ec7
--- /dev/null
+++ b/openecomp-be/lib/openecomp-common-lib/pom.xml
@@ -0,0 +1,46 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <artifactId>openecomp-sdc-lib</artifactId>
+ <groupId>org.openecomp.sdc</groupId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>openecomp-common-lib</artifactId>
+ <groupId>org.openecomp.core</groupId>
+ <name>openecomp-common-lib</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-utilities-lib</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-datatypes-lib</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>javax.ws.rs-api</artifactId>
+ <version>${ws.rs.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <version>1.1.2</version>
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <version>1.1.2</version>
+ </dependency>
+ </dependencies>
+
+
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/BaseErrorBuilder.java b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/BaseErrorBuilder.java
new file mode 100644
index 0000000000..367cbf7df6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/BaseErrorBuilder.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.common.errors;
+
+public abstract class BaseErrorBuilder {
+ private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
+
+ public ErrorCode build() {
+ return builder.build();
+ }
+
+ protected ErrorCode.ErrorCodeBuilder getErrorCodeBuilder() {
+ return builder;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/CoreException.java b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/CoreException.java
new file mode 100644
index 0000000000..3b464ca107
--- /dev/null
+++ b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/CoreException.java
@@ -0,0 +1,39 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.common.errors;
+
+public class CoreException extends RuntimeException {
+
+ private ErrorCode errorCode;
+
+ public CoreException(ErrorCode errorCode) {
+ this(errorCode, null);
+ }
+
+ public CoreException(ErrorCode errorCode, Throwable cause) {
+ super(errorCode.toString(), cause);
+ this.errorCode = errorCode;
+ }
+
+ public ErrorCode code() {
+ return errorCode;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/ErrorCategory.java b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/ErrorCategory.java
new file mode 100644
index 0000000000..d24ee62124
--- /dev/null
+++ b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/ErrorCategory.java
@@ -0,0 +1,64 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.common.errors;
+
+public enum ErrorCategory {
+ /**
+ * System-level problems caused by external factors, resources shortage and similar. For instance:
+ * <ul>
+ * <li>I/O problems (network connectivity, filesystem access etc)</li>
+ * <li>Java issues (missing or incompatible class definitions etc)</li>
+ * <li>Environment problems</li>
+ * </ul>
+ */
+ SYSTEM,
+
+ /**
+ * Application-level issues related to implementation of certain functionality (such as detected
+ * illegal states of a program or data inconsistency).
+ */
+ APPLICATION,
+
+ /**
+ * Problems related to violations of different rules set either by product metadata (catalog
+ * definitions or similar) or other types of constraints.
+ */
+ VALIDATION,
+
+ /**
+ * Problems caused by attempt of a user to perform certain operations which contradict the
+ * system rules. Mostly applicable to UI-driven flows in presentation tier.
+ */
+ USER,
+
+ /**
+ * Improper values set in the system configuration (negative numbers, missing or inconsistent
+ * definitions, mismatch with valid values list etc).
+ * */
+ CONFIGURATION,
+
+ /**
+ * Security constraint violations (failed login attempts, lack of permissions to perform
+ * operation and so on). Any problems related to authentication/authorization should use the
+ * special category for system auditing purposes.
+ */
+ SECURITY
+}
diff --git a/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/ErrorCode.java b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/ErrorCode.java
new file mode 100644
index 0000000000..aa0b123d4a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/ErrorCode.java
@@ -0,0 +1,105 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.common.errors;
+
+import java.io.Serializable;
+
+public class ErrorCode implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private String id;
+ private String message;
+ private ErrorCategory category;
+
+ protected ErrorCode() {
+ }
+
+ public String id() {
+ return id;
+ }
+
+ @Deprecated
+ protected void id(String id) {
+ this.id = id;
+ }
+
+ public String message() {
+ return message;
+ }
+
+ @Deprecated
+ protected void message(String message) {
+ this.message = message;
+ }
+
+ public ErrorCategory category() {
+ return category;
+ }
+
+ @Deprecated
+ protected void category(ErrorCategory category) {
+ this.category = category;
+ }
+
+ @Override
+ public String toString() {
+ return message;
+ }
+
+ public static class ErrorCodeBuilder {
+
+ private String id;
+ private String message;
+ private ErrorCategory category = ErrorCategory.APPLICATION;
+
+ public ErrorCodeBuilder withId(String id) {
+ this.id = id;
+ return this;
+ }
+
+ //todo remove later
+
+ public ErrorCodeBuilder withMessage(String message) {
+ this.message = message;
+ return this;
+ }
+
+ //todo remove later
+ public ErrorCodeBuilder withCategory(ErrorCategory category) {
+ this.category = category;
+ return this;
+ }
+
+ /**
+ * Build error code.
+ *
+ * @return the error code
+ */
+ public ErrorCode build() {
+ ErrorCode inst = new ErrorCode();
+ inst.id = id;
+ inst.message = message;
+ inst.category = category;
+ return inst;
+ }
+ }
+}
diff --git a/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/ErrorCodeAndMessage.java b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/ErrorCodeAndMessage.java
new file mode 100644
index 0000000000..672397f53c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/ErrorCodeAndMessage.java
@@ -0,0 +1,88 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.common.errors;
+
+
+import javax.ws.rs.core.Response;
+
+/**
+ * This class represents an error object to be returned in failed REST instead of just returning one
+ * of HTTP fail statuses.
+ *
+ */
+public class ErrorCodeAndMessage {
+
+ /**
+ * the HTTP status code.
+ */
+ private Response.Status status;
+
+ /**
+ * Error code no. if available.
+ */
+ private String errorCode;
+
+ /**
+ * the error message to be displayed.
+ */
+ private String message;
+
+ public ErrorCodeAndMessage() {
+ }
+
+ /**
+ * Instantiates a new Error code and message.
+ *
+ * @param status the status
+ * @param errorCode the error code
+ */
+ public ErrorCodeAndMessage(Response.Status status, ErrorCode errorCode) {
+ this.status = status;
+ this.message = errorCode.message();
+ this.errorCode = errorCode.id();
+ }
+
+
+ public Response.Status getStatus() {
+ return status;
+ }
+
+ public void setStatus(Response.Status status) {
+ this.status = status;
+ }
+
+ public String getErrorCode() {
+ return errorCode;
+ }
+
+ public void setErrorCode(String errorCode) {
+ this.errorCode = errorCode;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+}
diff --git a/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/GeneralErrorBuilder.java b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/GeneralErrorBuilder.java
new file mode 100644
index 0000000000..155d020396
--- /dev/null
+++ b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/GeneralErrorBuilder.java
@@ -0,0 +1,53 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.common.errors;
+
+/**
+ * The type General error builder.
+ */
+public class GeneralErrorBuilder {
+
+ private static final String GENERAL_ERROR_REST_ID = "GENERAL_ERROR_REST_ID";
+ private static final String GENERAL_ERROR_REST_MSG = "An error has occurred: %s";
+
+ private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
+
+ /**
+ * Instantiates a new General error builder.
+ *
+ * @param detailedError the detailed error
+ */
+ public GeneralErrorBuilder(String detailedError) {
+ builder.withId(GENERAL_ERROR_REST_ID);
+ builder.withCategory(ErrorCategory.APPLICATION);
+ builder.withMessage(String.format(GENERAL_ERROR_REST_MSG, detailedError));
+ }
+
+ /**
+ * Build error code.
+ *
+ * @return the error code
+ */
+ public ErrorCode build() {
+ return builder.build();
+ }
+
+}
diff --git a/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/JsonMappingErrorBuilder.java b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/JsonMappingErrorBuilder.java
new file mode 100644
index 0000000000..2a916dbf90
--- /dev/null
+++ b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/JsonMappingErrorBuilder.java
@@ -0,0 +1,53 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.common.errors;
+
+/**
+ * The type Json mapping error builder.
+ */
+public class JsonMappingErrorBuilder {
+
+ private static final String JSON_MAPPING_ERROR_ERR_ID = "JSON_MAPPING_ERROR_ERR_ID";
+ private static final String JSON_MAPPING_ERROR_ERR_ERR_MSG =
+ "Error occurred while parsing the JSON input/body. Further info can be found in the log";
+
+
+ private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
+
+ /**
+ * Instantiates a new Json mapping error builder.
+ */
+ public JsonMappingErrorBuilder() {
+ builder.withId(JSON_MAPPING_ERROR_ERR_ID);
+ builder.withCategory(ErrorCategory.APPLICATION);
+ builder.withMessage(String.format(JSON_MAPPING_ERROR_ERR_ERR_MSG));
+ }
+
+ /**
+ * Build error code.
+ *
+ * @return the error code
+ */
+ public ErrorCode build() {
+ return builder.build();
+ }
+
+}
diff --git a/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/ValidationErrorBuilder.java b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/ValidationErrorBuilder.java
new file mode 100644
index 0000000000..eb60a63a4b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/ValidationErrorBuilder.java
@@ -0,0 +1,68 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.common.errors;
+
+/**
+ * The type Validation error builder.
+ */
+public class ValidationErrorBuilder {
+
+ /**
+ * The constant FIELD_VALIDATION_ERROR_ERR_ID.
+ */
+ public static final String FIELD_VALIDATION_ERROR_ERR_ID = "FIELD_VALIDATION_ERROR_ERR_ID";
+ private static final String FIELD_VALIDATION_ERROR_ERR_MSG =
+ "Field does not conform to predefined criteria : %s : %s";
+ private static final String FIELD_VALIDATION_ERROR_ERR_MSG_USE_PREDEFINED_FOR_FIELD = "%s";
+ private static final String FIELD_WITH_PREDEFINED_MESSAGE = "arg\\d";
+
+
+ private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
+
+ /**
+ * Instantiates a new Validation error builder.
+ *
+ * @param detailedMessage the detailed message
+ * @param fieldName the field name
+ */
+ public ValidationErrorBuilder(String detailedMessage, String fieldName) {
+ builder.withId(FIELD_VALIDATION_ERROR_ERR_ID);
+ builder.withCategory(ErrorCategory.APPLICATION);
+
+ if (fieldName.matches(FIELD_WITH_PREDEFINED_MESSAGE)) {
+ builder.withMessage(
+ String.format(FIELD_VALIDATION_ERROR_ERR_MSG_USE_PREDEFINED_FOR_FIELD, detailedMessage));
+ } else {
+ builder
+ .withMessage(String.format(FIELD_VALIDATION_ERROR_ERR_MSG, fieldName, detailedMessage));
+ }
+ }
+
+ /**
+ * Build error code.
+ *
+ * @return the error code
+ */
+ public ErrorCode build() {
+ return builder.build();
+ }
+
+}
diff --git a/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/utils/AsdcCommon.java b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/utils/AsdcCommon.java
new file mode 100644
index 0000000000..d3806ff34e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/utils/AsdcCommon.java
@@ -0,0 +1,31 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.common.utils;
+
+public class AsdcCommon {
+
+ public static final String MANIFEST_NAME = "MANIFEST.json";
+ public static final String UPLOAD_FILE = "uploadFile";
+
+ public static final String HEAT_TO_TOSCA_MAPPING_CONF = "heatToToscaMapping.json";
+ public static final String HEAT_META = "HEAT.meta";
+ public static final String PARENT = "parent";
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/pom.xml b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/pom.xml
new file mode 100644
index 0000000000..a10e9cbd04
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/pom.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-core-lib</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>openecomp-config-lib</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <version>2.3.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.yaml</groupId>
+ <artifactId>snakeyaml</artifactId>
+ <version>1.14</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-nosqldb-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>6.9.10</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-vendor-software-product-api</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/ApplicationConfig.java b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/ApplicationConfig.java
new file mode 100644
index 0000000000..a68c6b614a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/ApplicationConfig.java
@@ -0,0 +1,35 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.utilities.applicationconfig;
+
+import org.openecomp.core.utilities.applicationconfig.dao.type.ApplicationConfigEntity;
+import org.openecomp.core.utilities.applicationconfig.type.ConfigurationData;
+
+import java.util.Collection;
+
+public interface ApplicationConfig {
+
+ ConfigurationData getConfigurationData(String namespace, String key);
+
+ void insertValue(String namespace, String key, String value);
+
+ Collection<ApplicationConfigEntity> getListOfConfigurationByNamespace(String namespace);
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/ApplicationConfigFactory.java b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/ApplicationConfigFactory.java
new file mode 100644
index 0000000000..e022294dfd
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/ApplicationConfigFactory.java
@@ -0,0 +1,31 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.utilities.applicationconfig;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+public abstract class ApplicationConfigFactory extends AbstractComponentFactory<ApplicationConfig> {
+
+ public static ApplicationConfigFactory getInstance() {
+ return AbstractFactory.getInstance(ApplicationConfigFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/ApplicationConfigDao.java b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/ApplicationConfigDao.java
new file mode 100644
index 0000000000..a4c582744a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/ApplicationConfigDao.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.utilities.applicationconfig.dao;
+
+import org.openecomp.core.dao.BaseDao;
+import org.openecomp.core.utilities.applicationconfig.dao.type.ApplicationConfigEntity;
+import org.openecomp.core.utilities.applicationconfig.type.ConfigurationData;
+
+
+public interface ApplicationConfigDao extends BaseDao<ApplicationConfigEntity> {
+
+ long getValueTimestamp(String namespace, String key);
+
+ ConfigurationData getConfigurationData(String namespace, String key);
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/ApplicationConfigDaoFactory.java b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/ApplicationConfigDaoFactory.java
new file mode 100644
index 0000000000..f60e4a9010
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/ApplicationConfigDaoFactory.java
@@ -0,0 +1,32 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.utilities.applicationconfig.dao;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+public abstract class ApplicationConfigDaoFactory
+ extends AbstractComponentFactory<ApplicationConfigDao> {
+
+ public static ApplicationConfigDaoFactory getInstance() {
+ return AbstractFactory.getInstance(ApplicationConfigDaoFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/impl/ApplicationConfigDaoCassandraImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/impl/ApplicationConfigDaoCassandraImpl.java
new file mode 100644
index 0000000000..7fb0e2f5ae
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/impl/ApplicationConfigDaoCassandraImpl.java
@@ -0,0 +1,115 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.utilities.applicationconfig.dao.impl;
+
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.Row;
+import com.datastax.driver.mapping.Mapper;
+import com.datastax.driver.mapping.Result;
+import com.datastax.driver.mapping.annotations.Accessor;
+import com.datastax.driver.mapping.annotations.Query;
+import org.openecomp.core.dao.impl.CassandraBaseDao;
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
+import org.openecomp.core.utilities.applicationconfig.dao.ApplicationConfigDao;
+import org.openecomp.core.utilities.applicationconfig.dao.type.ApplicationConfigEntity;
+import org.openecomp.core.utilities.applicationconfig.type.ConfigurationData;
+
+import java.util.Collection;
+import java.util.Objects;
+
+public class ApplicationConfigDaoCassandraImpl extends CassandraBaseDao<ApplicationConfigEntity>
+ implements ApplicationConfigDao {
+
+ private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
+ private static final Mapper<ApplicationConfigEntity> mapper =
+ noSqlDb.getMappingManager().mapper(ApplicationConfigEntity.class);
+ private static final ApplicationConfigAccessor accessor =
+ noSqlDb.getMappingManager().createAccessor(ApplicationConfigAccessor.class);
+
+ @Override
+ protected Mapper<ApplicationConfigEntity> getMapper() {
+ return mapper;
+ }
+
+ @Override
+ protected Object[] getKeys(ApplicationConfigEntity entity) {
+ return new Object[]{entity.getNamespace(), entity.getKey(), entity.getValue()};
+ }
+
+ @Override
+ public Collection<ApplicationConfigEntity> list(ApplicationConfigEntity entity) {
+ return accessor.list(entity.getNamespace()).all();
+ }
+
+ @Override
+ public void create(ApplicationConfigEntity entity) {
+ accessor.updateApplicationConfigData(entity.getNamespace(), entity.getKey(), entity.getValue());
+ }
+
+ @Override
+ public void update(ApplicationConfigEntity entity) {
+ accessor.updateApplicationConfigData(entity.getNamespace(), entity.getKey(), entity.getValue());
+ }
+
+ @Override
+ public ApplicationConfigEntity get(ApplicationConfigEntity entity) {
+ return accessor.get(entity.getNamespace(), entity.getKey());
+ }
+
+ @Override
+ public long getValueTimestamp(String namespace, String key) {
+ ResultSet resultSet = accessor.getValueAndTimestampOfConfigurationValue(namespace, key);
+
+ return resultSet.one().getLong("writetime(value)");
+ }
+
+ @Override
+ public ConfigurationData getConfigurationData(String namespace, String key) {
+ //String value = accessor.getValue(namespace, key).one().getString("value");
+ ResultSet resultSet = accessor.getValueAndTimestampOfConfigurationValue(namespace, key);
+ Row one = resultSet.one();
+
+ if (Objects.nonNull(one)) {
+ return new ConfigurationData(one.getString("value"), one.getLong("writetime(value)"));
+ }
+
+ return null;
+ }
+
+
+ @Accessor
+ interface ApplicationConfigAccessor {
+
+ @Query("select namespace, key, value from application_config where namespace=?")
+ Result<ApplicationConfigEntity> list(String namespace);
+
+ @Query("insert into application_config (namespace, key, value) values (?,?,?)")
+ ResultSet updateApplicationConfigData(String namespace, String key, String value);
+
+ @Query("select namespace, key, value from application_config where namespace=? and key=?")
+ ApplicationConfigEntity get(String namespace, String key);
+
+ @Query("select value, writetime(value) from application_config where namespace=? and key=?")
+ ResultSet getValueAndTimestampOfConfigurationValue(String namespace, String key);
+
+ }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/impl/ApplicationConfigDaoFactoryImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/impl/ApplicationConfigDaoFactoryImpl.java
new file mode 100644
index 0000000000..cea49ea8d1
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/impl/ApplicationConfigDaoFactoryImpl.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.utilities.applicationconfig.dao.impl;
+
+import org.openecomp.core.utilities.applicationconfig.dao.ApplicationConfigDao;
+import org.openecomp.core.utilities.applicationconfig.dao.ApplicationConfigDaoFactory;
+
+public class ApplicationConfigDaoFactoryImpl extends ApplicationConfigDaoFactory {
+ private static final ApplicationConfigDao INSTANCE = new ApplicationConfigDaoCassandraImpl();
+
+ @Override
+ public ApplicationConfigDao createInterface() {
+ return INSTANCE;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/type/ApplicationConfigEntity.java b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/type/ApplicationConfigEntity.java
new file mode 100644
index 0000000000..c73ce36744
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/type/ApplicationConfigEntity.java
@@ -0,0 +1,79 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.utilities.applicationconfig.dao.type;
+
+
+import com.datastax.driver.mapping.annotations.ClusteringColumn;
+import com.datastax.driver.mapping.annotations.PartitionKey;
+import com.datastax.driver.mapping.annotations.Table;
+
+@Table(keyspace = "dox", name = "application_config")
+public class ApplicationConfigEntity {
+
+ @PartitionKey
+ private String namespace;
+ @ClusteringColumn
+ private String key;
+ private String value;
+
+ /**
+ * Instantiates a new Application config entity.
+ *
+ * @param namespace the namespace
+ * @param key the key
+ * @param value the value
+ */
+ public ApplicationConfigEntity(String namespace, String key, String value) {
+ this.namespace = namespace;
+ this.key = key;
+ this.value = value;
+ }
+
+
+ public ApplicationConfigEntity() {
+ }
+
+
+ public String getNamespace() {
+ return namespace;
+ }
+
+ public void setNamespace(String namespace) {
+ this.namespace = namespace;
+ }
+
+ public String getKey() {
+ return key;
+ }
+
+ public void setKey(String key) {
+ this.key = key;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/impl/ApplicationConfigFactoryImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/impl/ApplicationConfigFactoryImpl.java
new file mode 100644
index 0000000000..cca07fc227
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/impl/ApplicationConfigFactoryImpl.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.utilities.applicationconfig.impl;
+
+import org.openecomp.core.utilities.applicationconfig.ApplicationConfig;
+import org.openecomp.core.utilities.applicationconfig.ApplicationConfigFactory;
+
+public class ApplicationConfigFactoryImpl extends ApplicationConfigFactory {
+
+ private static final ApplicationConfig INSTANCE = new ApplicationConfigImpl();
+
+ @Override
+ public ApplicationConfig createInterface() {
+ return INSTANCE;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/impl/ApplicationConfigImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/impl/ApplicationConfigImpl.java
new file mode 100644
index 0000000000..ff9c9aea87
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/impl/ApplicationConfigImpl.java
@@ -0,0 +1,74 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.utilities.applicationconfig.impl;
+
+import org.openecomp.core.utilities.applicationconfig.ApplicationConfig;
+import org.openecomp.core.utilities.applicationconfig.dao.ApplicationConfigDao;
+import org.openecomp.core.utilities.applicationconfig.dao.ApplicationConfigDaoFactory;
+import org.openecomp.core.utilities.applicationconfig.dao.type.ApplicationConfigEntity;
+import org.openecomp.core.utilities.applicationconfig.type.ConfigurationData;
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+
+import java.util.Collection;
+import java.util.Objects;
+
+/**
+ * The type Application config.
+ */
+public class ApplicationConfigImpl implements ApplicationConfig {
+ private static final ApplicationConfigDao applicationConfigDao =
+ ApplicationConfigDaoFactory.getInstance().createInterface();
+
+ private static final String CONFIGURATION_SEARCH_ERROR = "CONFIGURATION_NOT_FOUND";
+ private static final String CONFIGURATION_SEARCH_ERROR_MSG =
+ "Configuration for namespace %s and key %s was not found";
+
+ @Override
+ public ConfigurationData getConfigurationData(String namespace, String key) {
+ ConfigurationData configurationData = applicationConfigDao.getConfigurationData(namespace, key);
+
+ if (Objects.isNull(configurationData)) {
+ throw new CoreException(new ErrorCode.ErrorCodeBuilder()
+ .withCategory(ErrorCategory.APPLICATION)
+ .withId(CONFIGURATION_SEARCH_ERROR)
+ .withMessage(String.format(CONFIGURATION_SEARCH_ERROR_MSG, namespace, key))
+ .build());
+ }
+
+ return configurationData;
+ }
+
+ @Override
+ public void insertValue(String namespace, String key, String value) {
+ ApplicationConfigEntity applicationConfigEntity =
+ new ApplicationConfigEntity(namespace, key, value);
+ applicationConfigDao.create(applicationConfigEntity);
+ }
+
+ @Override
+ public Collection<ApplicationConfigEntity> getListOfConfigurationByNamespace(String namespace) {
+ ApplicationConfigEntity applicationConfigEntity =
+ new ApplicationConfigEntity(namespace, null, null);
+ return applicationConfigDao.list(applicationConfigEntity);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/type/ConfigurationData.java b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/type/ConfigurationData.java
new file mode 100644
index 0000000000..53d3797e53
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/type/ConfigurationData.java
@@ -0,0 +1,48 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.utilities.applicationconfig.type;
+
+public class ConfigurationData {
+
+ private String value;
+ private long timeStamp;
+
+ public ConfigurationData(String value, long timeStamp) {
+ this.value = value;
+ this.timeStamp = timeStamp;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public long getTimeStamp() {
+ return timeStamp;
+ }
+
+ public void setTimeStamp(long timeStamp) {
+ this.timeStamp = timeStamp;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/resources/factoryConfiguration.json b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/resources/factoryConfiguration.json
new file mode 100644
index 0000000000..19d2cafe8f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/resources/factoryConfiguration.json
@@ -0,0 +1,4 @@
+{
+ "org.openecomp.core.utilities.applicationconfig.ApplicationConfigFactory":"org.openecomp.core.utilities.applicationconfig.impl.ApplicationConfigFactoryImpl",
+ "org.openecomp.core.utilities.applicationconfig.dao.ApplicationConfigDaoFactory":"org.openecomp.core.utilities.applicationconfig.dao.impl.ApplicationConfigDaoFactoryImpl"
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/resources/logback.xml b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/resources/logback.xml
new file mode 100644
index 0000000000..e256e0b10a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/resources/logback.xml
@@ -0,0 +1,90 @@
+<!--
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+
+
+ <appender name="DEBUG_ROLLING"
+ class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>DOX-BE.log
+ </file>
+
+ &lt;!&ndash; No need to deny audit messages - they are INFO only, will be denied
+ anyway &ndash;&gt;
+ &lt;!&ndash; Transaction messages filter - deny Transaction messages, there are
+ some DEBUG level messages among them &ndash;&gt;
+
+
+ &lt;!&ndash; accept DEBUG and TRACE level &ndash;&gt;
+
+ <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
+ <fileNamePattern>/DOX-BE.log.%i
+ </fileNamePattern>
+ <minIndex>1</minIndex>
+ <maxIndex>10</maxIndex>
+ </rollingPolicy>
+
+ <triggeringPolicy
+ class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
+ <maxFileSize>20MB</maxFileSize>
+ </triggeringPolicy>
+ <encoder>
+ <pattern>%level [%d{yyyy-MM-dd'T'HH:mm:ss}] - Method=%M, Desc=&lt;%msg&gt;%n</pattern>
+ </encoder>
+ </appender>
+
+
+ <root level="info">
+ <appender-ref ref="DEBUG_ROLLING" />
+ </root>
+</configuration>-->
+<configuration scan="true" scanPeriod="3 seconds">
+
+ <property name="logDir" value="logs"/>
+ <property name="componentName" value="ASDC"/>
+ <property name="ECOMP-subcomponent-name" value="ASDC-BE"/>
+
+ <property name="defaultPattern"
+ value="%msg%n"/>
+
+ <!--<property name="MetricsLogPattern" value="%X{BeginTimestamp}|%X{EndTimestamp}|%X{RequestId}|%X{ServiceInstanceId}|%thread|%X{ServerName}|%X{ServiceName}|%X{PartnerName}|%X{TargetEntity}|%X{TargetServiceName}|%X{StatusCode}|%X{ResponseCode}|%X{ResponseDescription}|%X{InstanceUUID}|%X{CategoryLogLevel}|%X{Severity}|%X{ServerIPAddress}|%X{ElapsedTime}|%X{ServerFQDN}|%X{ClientIP}|%logger%n" />
+ <property name="AuditLogPattern" value="%X{BeginTimestamp}|%X{EndTimestamp}|%X{RequestId}|%X{ServiceInstanceId}|%thread|%X{ServerName}|%X{ServiceName}|%X{PartnerName}|%X{StatusCode}|%X{ResponseCode}|%X{ResponseDescription}|%X{InstanceUUID}|%X{CategoryLogLevel}|%X{Severity}|%X{ServerIPAddress}|%X{ElapsedTime}|%X{ServerFQDN}|%X{ClientIP}%n" />
+ <property name="ErrorLogPattern" value="%d{yyyy-MM-dd'T'HH:mm:ss.SSS, GMT}|%X{RequestId}|%thread|%X{ServiceName}|%X{PartnerName}|%X{TargetEntity}|%X{TargetServiceName}|%X{ErrorCategory}|%X{ErrorCode}|%X{ErrorDescription}|%msg%n"/>
+ <property name="DebugLogPattern" value="%d{yyyy-MM-dd'T'HH:mm:ss.SSS, GMT}|%X{RequestId}||%logger|%msg%n"/>-->
+
+ <!-- new pattern -->
+ <property name="default-log-pattern"
+ value="%d{yyyy-MM-dd'T'HH:mm:ss.SSSXXX}|%X{BeginTimestamp}|%X{EndTimestamp}|%X{uuid}|%X{serviceInstanceID}|%thread|%X{ServerName}|%X{ServiceName}|${ECOMP-subcomponent-name}|%X{userId}|%X{TargetEntity}|%X{TargetServiceName}|%X{StatusCode}|%X{ResponseCode}|%X{ResponseDescription}|%X{InstanceUUID}|%X{ErrorCategory}|%X{ErrorCode}|%X{ErrorDescription}|%level|%X{alarmSeverity}|%X{localAddr}|%X{ElapsedTime}|%X{beFqdn}|%X{remoteAddr}|%logger{35}|%X{timer}|ActivityType=&lt;%M&gt;, Desc=&lt;%msg&gt;%n"/>
+
+ <property name="logDirectory" value="${logDir}/${componentName}"/>
+
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>${defaultPattern}</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="DISPATCHER" class="ch.qos.logback.classic.sift.SiftingAppender">
+ <discriminator class="org.openecomp.core.logging.logback.EventTypeDiscriminator"/>
+ <sift>
+ <appender name="${eventType}" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>${logDirectory}/${eventType}.log</file>
+ <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
+ <fileNamePattern>${logDirectory}/${eventType}.%i.log.zip</fileNamePattern>
+ <minIndex>1</minIndex>
+ <maxIndex>9</maxIndex>
+ </rollingPolicy>
+ <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
+ <maxFileSize>5MB</maxFileSize>
+ </triggeringPolicy>
+ <encoder>
+ <pattern>${default-log-pattern}</pattern>
+ </encoder>
+ </appender>
+ </sift>
+ </appender>
+
+ <root level="DEBUG">
+ <appender-ref ref="DISPATCHER"/>
+ </root>
+
+</configuration> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/test/java/org/openecomp/sdc/applicationconfig/dao/ApplicationConfigImplDaoTest.java b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/test/java/org/openecomp/sdc/applicationconfig/dao/ApplicationConfigImplDaoTest.java
new file mode 100644
index 0000000000..40cde1ecb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/test/java/org/openecomp/sdc/applicationconfig/dao/ApplicationConfigImplDaoTest.java
@@ -0,0 +1,88 @@
+package org.openecomp.sdc.applicationconfig.dao;
+
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType;
+import org.openecomp.core.utilities.applicationconfig.ApplicationConfig;
+import org.openecomp.core.utilities.applicationconfig.ApplicationConfigFactory;
+import org.openecomp.core.utilities.applicationconfig.dao.ApplicationConfigDao;
+import org.openecomp.core.utilities.applicationconfig.dao.ApplicationConfigDaoFactory;
+import org.openecomp.core.utilities.applicationconfig.dao.type.ApplicationConfigEntity;
+import org.openecomp.core.utilities.applicationconfig.type.ConfigurationData;
+import org.openecomp.core.utilities.file.FileUtils;
+import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+
+public class ApplicationConfigImplDaoTest {
+
+ private static final String SCHEMA_GENERATOR_INITIALIZATION_ERROR =
+ "SCHEMA_GENERATOR_INITIALIZATION_ERROR";
+ private static final String SCHEMA_GENERATOR_INITIALIZATION_ERROR_MSG =
+ "Error occurred while loading questionnaire schema templates";
+ private static ApplicationConfigDao applicationConfigDao =
+ ApplicationConfigDaoFactory.getInstance().createInterface();
+ private static ApplicationConfig applicationConfig =
+ ApplicationConfigFactory.getInstance().createInterface();
+
+// @BeforeClass
+ public static void init() {
+ try {
+
+ ApplicationConfigEntity applicationConfigEntity1 =
+ new ApplicationConfigEntity("test - namespace", "vsp", "vspTemplate");
+ ApplicationConfigEntity applicationConfigEntity2 =
+ new ApplicationConfigEntity("test - namespace", "nic", "nicTemplate");
+ ApplicationConfigEntity applicationConfigEntity3 =
+ new ApplicationConfigEntity("test - namespace", "component", "componentTemplate");
+
+ applicationConfigDao.create(applicationConfigEntity1);
+ applicationConfigDao.create(applicationConfigEntity2);
+ applicationConfigDao.create(applicationConfigEntity3);
+
+ } catch (Exception e) {
+ throw new CoreException(new ErrorCode.ErrorCodeBuilder().
+ withCategory(ErrorCategory.APPLICATION).
+ withId(SCHEMA_GENERATOR_INITIALIZATION_ERROR).
+ withMessage(SCHEMA_GENERATOR_INITIALIZATION_ERROR_MSG).
+ build());
+ }
+ }
+
+ private static String loadFileToString(String path) {
+ return new String(FileUtils.toByteArray(FileUtils.loadFileToInputStream(path)));
+ }
+
+// @Test
+ public void testApplicationConfigTimestampValue() {
+ ConfigurationData configurationData = applicationConfig
+ .getConfigurationData("test - namespace", CompositionEntityType.vsp.name());
+
+ Assert.assertNotNull(configurationData);
+ Assert.assertNotEquals(configurationData.getTimeStamp(), 0);
+
+ }
+
+// @Test(dependsOnMethods = "testApplicationConfigTimestampValue")
+ public void testNotExistingApplicationConfigTimestampValue() {
+ try {
+ applicationConfig.getConfigurationData("test - namespace", "aaa");
+ } catch (CoreException ce) {
+ Assert.assertEquals(ce.getMessage(),
+ "Configuration for namespace test - namespace and key aaa was not found");
+ }
+
+ }
+
+// @Test(dependsOnMethods = "testApplicationConfigTimestampValue")
+ public void testInsertApplicationConfiguration() {
+ String testTemplate = loadFileToString("questionnaire/testTemplate.txt");
+ applicationConfig.insertValue("test_namespace", "test_key", testTemplate);
+
+ Assert.assertEquals(testTemplate,
+ applicationConfig.getConfigurationData("test_namespace", "test_key").getValue());
+ }
+
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/test/resources/questionnaire/testTemplate.txt b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/test/resources/questionnaire/testTemplate.txt
new file mode 100644
index 0000000000..0bb19c5984
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/test/resources/questionnaire/testTemplate.txt
@@ -0,0 +1,12 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type": "object",
+ "properties": {
+ "general": {
+ "type": "object",
+ "properties": {
+ "testObject":{
+ "type": "string"
+ }
+ }
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-api/pom.xml b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-api/pom.xml
new file mode 100644
index 0000000000..ccb3db833e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-api/pom.xml
@@ -0,0 +1,31 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-lib</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../../..</relativePath>
+ </parent>
+
+ <name>openecomp-facade-api</name>
+ <artifactId>openecomp-facade-api</artifactId>
+ <groupId>org.openecomp.core</groupId>
+
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-utilities-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-common-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-api/src/main/java/org/openecomp/core/factory/api/AbstractFactory.java b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-api/src/main/java/org/openecomp/core/factory/api/AbstractFactory.java
new file mode 100644
index 0000000000..53b8f00fc0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-api/src/main/java/org/openecomp/core/factory/api/AbstractFactory.java
@@ -0,0 +1,81 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.factory.api;
+
+import org.openecomp.core.factory.impl.AbstractFactoryBase;
+
+/**
+ * This class provides generic implementation of an abstract factory. Components exposed as Java
+ * interfaces should have their own concrete factories derived from the given class. This assures
+ * code alignment and consistency across all Service Management components.
+ * The class actually
+ * uses singleton pattern to instantiate and reuse just one instance of a factory. Therefore, each
+ * factory implementation has to be <i>thread-safe</i>.
+ * In a general case, the hierarchy of
+ * factory objects for an Java interface <tt>IUknown</tt> may look as follows:
+ * <pre>
+ * AbstractFactory&lt;IUnknown&gt;
+ * ^
+ * |
+ * Application code ----> ConcreteFactory
+ * ^
+ * |
+ * +---------+---------+
+ * | |
+ * BaselineFactoryImpl CustomFactoryImpl
+ * </pre>
+ * Where the classes responsibility is: <ul> <li>Abstract factory - common logic to retrieve the
+ * implementation class name from a central repository.</li> <li>Concrete factory - abstract class
+ * that only exposes to application layer the type specific API such as: <ul> <li><tt>public static
+ * ConcreteFactory getInstance()</tt></li> </ul> <li>Baseline factory - out of the box
+ * implementation of concrete factory (that can be replaced by a custom one depending on customer
+ * needs) which actually implements method: <ul> <li><tt>public IUnknown createInterface()</tt></li>
+ * </ul> </ul> The normal concrete factory class may look like:
+ * <pre>
+ * public abstract class ConcreteFactory extends AbstractFactory&lt;IUnknown&gt; {
+ * static {
+ * registerFactory(ConcreteFactory.class, BaselineFactoryImpl.class);
+ * }
+ * public static ConcreteFactory getInstance() {
+ * return AbstractFactory.&lt;IUnknown, ConcreteFactory.class&gt;getInstance(ConcreteFactory.class);
+ * }
+ * }
+ * </pre>
+ *
+ * @param <I> Java interface type created by the factory.
+ */
+public abstract class AbstractFactory<I> extends AbstractFactoryBase {
+
+
+ /**
+ * Returns the interface implementor instance.
+ * <b>Note</b>: It's up to the concrete factory to decide on the actual
+ * implementation of the returned interface. Therefore, the call can get the
+ * same instance per each call in case of singleton implementation or new
+ * instance otherwise. However, the API consumer may not assume anything
+ * regarding the underlying logic and has always go through the factory to
+ * obtain the reference.
+ *
+ * @return Implementor of the exposed Java interface.
+ */
+ public abstract I createInterface();
+
+} // End of class
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-api/src/main/java/org/openecomp/core/factory/impl/AbstractFactoryBase.java b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-api/src/main/java/org/openecomp/core/factory/impl/AbstractFactoryBase.java
new file mode 100644
index 0000000000..e19d9e972f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-api/src/main/java/org/openecomp/core/factory/impl/AbstractFactoryBase.java
@@ -0,0 +1,212 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.factory.impl;
+
+import static org.openecomp.core.utilities.CommonMethods.isEmpty;
+import static org.openecomp.core.utilities.CommonMethods.newInstance;
+
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * The type Abstract factory base.
+ */
+public abstract class AbstractFactoryBase {
+
+ /**
+ * Temporary registry of default implementations. The map keeps class names rather then class
+ * types to allow unloading of those classes from memory by garbage collector if
+ * factory is not actually used.
+ */
+ private static Map<String, String> registry = new ConcurrentHashMap<String, String>();
+
+ /**
+ * Cached factory instances.
+ */
+ private static Map<String, AbstractFactoryBase> factoryMap =
+ new ConcurrentHashMap<String, AbstractFactoryBase>();
+
+ /**
+ * Registers implementor for an abstract factory. The method accepts Java classes rather
+ * then class names to ensure type safety at compilation time.
+ *
+ * @param <I> Java interface type instantiated by abstract factory
+ * @param <F> Type specific abstract factory for concrete Java interface
+ * @param factory Java class of a type specific abstract factory
+ * @param impl Java class of type specific factory implementor
+ */
+ public static <I, F extends AbstractFactoryBase> void registerFactory(Class<F> factory,
+ Class<? extends F> impl) {
+ if (factory == null) {
+ throw new CoreException(
+ new ErrorCode.ErrorCodeBuilder().withId("E0001").withMessage("Mandatory input factory.")
+ .withCategory(ErrorCategory.SYSTEM).build());
+ }
+
+ if (impl == null) {
+ throw new CoreException(
+ new ErrorCode.ErrorCodeBuilder().withId("E0001").withMessage("Mandatory input impl.")
+ .withCategory(ErrorCategory.SYSTEM).build());
+ }
+ if (factoryMap != null && factoryMap.containsKey(factory.getName())) {
+ factoryMap.remove(factory.getName());
+ }
+ registry.put(factory.getName(), impl.getName());
+ } // registerFactory
+
+ /**
+ * Register factory.
+ *
+ * @param factoryName the factory name
+ * @param implName the impl name
+ */
+ // TODO: Remove
+ protected static void registerFactory(String factoryName, String implName) {
+ registry.put(factoryName, implName);
+ } // registerFactory
+
+ /**
+ * Unregister factory.
+ *
+ * @param <F> the type parameter
+ * @param factory the factory
+ */
+ public static <F extends AbstractFactoryBase> void unregisterFactory(Class<F> factory) {
+ if (factory == null) {
+ throw new CoreException(
+ new ErrorCode.ErrorCodeBuilder().withId("E0001").withMessage("Mandatory input factory.")
+ .withCategory(ErrorCategory.SYSTEM).build());
+ }
+ if (factoryMap != null) {
+ factoryMap.remove(factory.getName());
+ }
+ }
+
+ /**
+ * Instantiates the configured implementation of an abstract factory.
+ *
+ * @param <I> Java interface type instantiated by abstract factory
+ * @param <F> Type specific abstract factory for concrete Java interface
+ * @param factoryType Java class of type specific abstract factory
+ * @return Instance of implementation class
+ */
+ @SuppressWarnings("unchecked")
+ public static <I, F extends AbstractFactoryBase> F getInstance(Class<F> factoryType) {
+ if (factoryType == null) {
+ throw new CoreException(
+ new ErrorCode.ErrorCodeBuilder().withId("E0001")
+ .withMessage("Mandatory input factory type.").withCategory(ErrorCategory.SYSTEM)
+ .build());
+
+ }
+ // Pick up factory instance from cache
+ F factory = (F) factoryMap.get(factoryType.getName());
+ // Check for the first time access
+ if (factory == null) {
+ // Synchronize factory instantiation
+ synchronized (factoryType) {
+ // Re-check the factory instance
+ factory = (F) factoryMap.get(factoryType.getName());
+ if (factory == null) {
+ // Get the implementation class name
+ String implName = registry.get(factoryType.getName());
+
+ if (isEmpty(implName)) {
+ throw new CoreException(
+ new ErrorCode.ErrorCodeBuilder().withId("E0001")
+ .withMessage("Mandatory input factory implementation.")
+ .withCategory(ErrorCategory.SYSTEM).build());
+ }
+
+ factory = newInstance(implName, factoryType);
+
+ factory.init();
+
+ // Cache the instantiated singleton
+ factoryMap.put(factoryType.getName(), factory);
+ }
+ }
+ }
+
+ return factory;
+
+ } // getInstance
+
+
+ /**
+ * Is factory registered boolean.
+ *
+ * @param <F> the type parameter
+ * @param factoryType the factory type
+ * @return the boolean
+ */
+ public static <F extends AbstractFactoryBase> boolean isFactoryRegistered(Class<F> factoryType) {
+ boolean isFactoryRegistered = false;
+ if (factoryType == null) {
+ throw new CoreException(
+ new ErrorCode.ErrorCodeBuilder().withId("E0001")
+ .withMessage("Mandatory input factory type.").withCategory(ErrorCategory.SYSTEM)
+ .build());
+ }
+ // Pick up factory instance from cache
+ F factory = (F) factoryMap.get(factoryType.getName());
+ // Check for the first time access
+ if (factory != null) {
+ isFactoryRegistered = true;
+ } else {
+ // Get the implementation class name
+ String implName = registry.get(factoryType.getName());
+ if (!isEmpty(implName)) {
+ isFactoryRegistered = true;
+ }
+ }
+ return isFactoryRegistered;
+ }
+
+ /**
+ * Stop all.
+ */
+ public static void stopAll() {
+ Collection<AbstractFactoryBase> factorylist = factoryMap.values();
+ for (AbstractFactoryBase factory : factorylist) {
+ factory.stop();
+ }
+ }
+
+ /**
+ * Init.
+ */
+ protected void init() {
+ }
+
+ /**
+ * Stop.
+ */
+ protected void stop() {
+ }
+
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/pom.xml b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/pom.xml
new file mode 100644
index 0000000000..0c5d36abcc
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/pom.xml
@@ -0,0 +1,36 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <artifactId>openecomp-sdc-lib</artifactId>
+ <groupId>org.openecomp.sdc</groupId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../../..</relativePath>
+ </parent>
+
+ <artifactId>openecomp-facade-core</artifactId>
+ <name>openecomp-facade-core</name>
+ <groupId>org.openecomp.core</groupId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-utilities-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-common-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-facade-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/AbstractContextFactory.java b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/AbstractContextFactory.java
new file mode 100644
index 0000000000..f4e1a85fee
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/AbstractContextFactory.java
@@ -0,0 +1,27 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.factory;
+
+import org.openecomp.core.factory.impl.AbstractFactoryBase;
+
+public abstract class AbstractContextFactory<I, C> extends AbstractFactoryBase {
+ public abstract I createInterface(C contextType);
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/FactoriesConfigImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/FactoriesConfigImpl.java
new file mode 100644
index 0000000000..173f9b15b1
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/FactoriesConfigImpl.java
@@ -0,0 +1,61 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.factory;
+
+
+import org.openecomp.core.factory.api.FactoriesConfiguration;
+import org.openecomp.core.utilities.file.FileUtils;
+import org.openecomp.core.utilities.json.JsonUtil;
+
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public final class FactoriesConfigImpl implements FactoriesConfiguration {
+
+
+ private static final String FACTORY_CONFIG_FILE_NAME = "factoryConfiguration.json";
+ private static Map factoryMap = new HashMap();
+ private static boolean initialized = false;
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public Map<String, String> getFactoriesMap() {
+ synchronized (this) {
+ if (!initialized) {
+ init();
+ initialized = true;
+ }
+ }
+ return factoryMap;
+ }
+
+ private void init() {
+ List<InputStream> factoryConfigIsList = FileUtils.getFileInputStreams(FACTORY_CONFIG_FILE_NAME);
+ for (InputStream factoryConfigIs : factoryConfigIsList) {
+ factoryMap.putAll(JsonUtil.json2Object(factoryConfigIs, Map.class));
+ }
+ }
+
+
+}
+
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/FactoryConfig.java b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/FactoryConfig.java
new file mode 100644
index 0000000000..d664cbee38
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/FactoryConfig.java
@@ -0,0 +1,46 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.factory;
+
+import org.openecomp.core.factory.api.FactoriesConfiguration;
+import org.openecomp.core.utilities.CommonMethods;
+
+import java.util.Map;
+
+public final class FactoryConfig {
+
+ private static final FactoriesConfiguration INSTANCE;
+
+ static {
+
+ try {
+ INSTANCE = CommonMethods.newInstance(
+ "org.openecomp.core.factory.FactoriesConfigImpl", FactoriesConfiguration.class);
+ } catch (Exception exception) {
+ exception.printStackTrace();
+ throw exception;
+ }
+ }
+
+ public static Map<String, String> getFactoriesMap() {
+ return INSTANCE.getFactoriesMap();
+ }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/api/AbstractComponentFactory.java b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/api/AbstractComponentFactory.java
new file mode 100644
index 0000000000..9cd7749f55
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/api/AbstractComponentFactory.java
@@ -0,0 +1,105 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.factory.api;
+
+import org.openecomp.core.factory.FactoryConfig;
+import org.openecomp.core.factory.impl.AbstractFactoryBase;
+import org.openecomp.core.utilities.CommonMethods;
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+
+import java.util.Map;
+
+public abstract class AbstractComponentFactory<I> extends AbstractFactory<I> {
+
+ static {
+ Registry registry = new RegistryImpl();
+ InitializationHelper.registerFactoryMapping(registry);
+ }
+
+ interface Registry {
+ void register(String factory, String impl);
+ }
+
+ private static class RegistryImpl implements Registry {
+ @Override
+ public void register(String factory, String impl) {
+ AbstractFactoryBase.registerFactory(factory, impl);
+ }
+ }
+
+ static class InitializationHelper {
+
+
+ private static boolean isRegistered = false;
+
+ private InitializationHelper() {
+ }
+
+ static synchronized boolean registerFactoryMapping(Registry registry) {
+
+ boolean done = !isRegistered;
+
+ if (!isRegistered) {
+ registerFactoryMappingImpl(registry);
+ isRegistered = true;
+ }
+
+ return done;
+ }
+
+ private static void registerFactoryMappingImpl(Registry registry) {
+ Map<String, String> factoryMap = FactoryConfig.getFactoriesMap();
+
+ try {
+ for (Map.Entry<String, String> entry : factoryMap.entrySet()) {
+ String abstractClassName = entry.getKey();
+ String concreteTypeName = entry.getValue();
+
+ if (CommonMethods.isEmpty(concreteTypeName)) {
+ throw new CoreException(
+ new ErrorCode.ErrorCodeBuilder().withId("E0003")
+ .withMessage("Missing configuration value:" + concreteTypeName + ".")
+ .withCategory(ErrorCategory.SYSTEM).build());
+
+ }
+
+ registry.register(abstractClassName, concreteTypeName);
+ }
+ } catch (RuntimeException exception) {
+ throw exception;
+ } catch (Exception exception) {
+ throw new RuntimeException(exception);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private static <T> Class<T> unsecureCast(Class<?> cls) {
+ return (Class<T>) cls;
+ }
+
+ private static String nameOf(Class<?> clazz) {
+ return (clazz != null) ? clazz.getName() : "null";
+ }
+ }
+
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/api/FactoriesConfiguration.java b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/api/FactoriesConfiguration.java
new file mode 100644
index 0000000000..8086181204
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/api/FactoriesConfiguration.java
@@ -0,0 +1,29 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.factory.api;
+
+import java.util.Map;
+
+
+public interface FactoriesConfiguration {
+
+ Map<String, String> getFactoriesMap();
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/pom.xml b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/pom.xml
new file mode 100644
index 0000000000..29e9cce688
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/pom.xml
@@ -0,0 +1,34 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <artifactId>openecomp-core-lib</artifactId>
+ <groupId>org.openecomp.core</groupId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <packaging>pom</packaging>
+ <artifactId>openecomp-facade-lib</artifactId>
+ <name>openecomp-facade-lib</name>
+
+ <modules>
+ <module>openecomp-facade-api</module>
+ <module>openecomp-facade-core</module>
+ </modules>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-facade-api</artifactId>
+ <version>${project.version}</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-facade-core</artifactId>
+ <version>${project.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/pom.xml b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/pom.xml
new file mode 100644
index 0000000000..174f2a36d9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/pom.xml
@@ -0,0 +1,40 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <artifactId>openecomp-sdc-lib</artifactId>
+ <groupId>org.openecomp.sdc</groupId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../../..</relativePath>
+ </parent>
+
+ <name>openecomp-nosqldb-api</name>
+ <artifactId>openecomp-nosqldb-api</artifactId>
+ <groupId>org.openecomp.core</groupId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-facade-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.datastax.cassandra</groupId>
+ <artifactId>cassandra-driver-core</artifactId>
+ <version>${datasatx.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.datastax.cassandra</groupId>
+ <artifactId>cassandra-driver-mapping</artifactId>
+ <version>${datasatx.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-facade-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/dao/BaseDao.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/dao/BaseDao.java
new file mode 100644
index 0000000000..c7623f8181
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/dao/BaseDao.java
@@ -0,0 +1,36 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.dao;
+
+import java.util.Collection;
+
+public interface BaseDao<T> {
+
+ Collection<T> list(T entity);
+
+ void create(T entity);
+
+ void update(T entity);
+
+ T get(T entity);
+
+ void delete(T entity);
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/dao/UniqueValueDao.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/dao/UniqueValueDao.java
new file mode 100644
index 0000000000..1fa4bb23fe
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/dao/UniqueValueDao.java
@@ -0,0 +1,28 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.dao;
+
+
+import org.openecomp.core.dao.types.UniqueValueEntity;
+
+public interface UniqueValueDao extends BaseDao<UniqueValueEntity> {
+
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/dao/UniqueValueDaoFactory.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/dao/UniqueValueDaoFactory.java
new file mode 100644
index 0000000000..9f57e4fadd
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/dao/UniqueValueDaoFactory.java
@@ -0,0 +1,30 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.dao;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+public abstract class UniqueValueDaoFactory extends AbstractComponentFactory<UniqueValueDao> {
+ public static UniqueValueDaoFactory getInstance() {
+ return AbstractFactory.getInstance(UniqueValueDaoFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/dao/types/UniqueValueEntity.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/dao/types/UniqueValueEntity.java
new file mode 100644
index 0000000000..1147644253
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/dao/types/UniqueValueEntity.java
@@ -0,0 +1,58 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.dao.types;
+
+import com.datastax.driver.mapping.annotations.PartitionKey;
+import com.datastax.driver.mapping.annotations.Table;
+
+@Table(keyspace = "dox", name = "unique_value")
+public class UniqueValueEntity {
+
+ @PartitionKey
+ private String type;
+
+ @PartitionKey(value = 1)
+ private String value;
+
+ public UniqueValueEntity() {
+ }
+
+ public UniqueValueEntity(String type, String value) {
+ this.type = type;
+ this.value = value;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/nosqldb/api/NoSqlDb.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/nosqldb/api/NoSqlDb.java
new file mode 100644
index 0000000000..6b13ee71e4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/nosqldb/api/NoSqlDb.java
@@ -0,0 +1,37 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.nosqldb.api;
+
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.mapping.MappingManager;
+
+public interface NoSqlDb {
+
+ //TODO: remove cassandra types from here!! (like done in SDC...).
+
+ void insert(String tableName, String[] colNames, Object[] values);
+
+ ResultSet execute(String statement);
+
+ ResultSet execute(String statementName, Object... values);
+
+ MappingManager getMappingManager();
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/nosqldb/factory/NoSqlDbFactory.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/nosqldb/factory/NoSqlDbFactory.java
new file mode 100644
index 0000000000..ede264f288
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/nosqldb/factory/NoSqlDbFactory.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.nosqldb.factory;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+
+
+public abstract class NoSqlDbFactory extends AbstractComponentFactory<NoSqlDb> {
+
+ public static NoSqlDbFactory getInstance() {
+
+ return AbstractFactory.getInstance(NoSqlDbFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/util/UniqueValueUtil.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/util/UniqueValueUtil.java
new file mode 100644
index 0000000000..a82c97c51c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/util/UniqueValueUtil.java
@@ -0,0 +1,127 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.util;
+
+import org.openecomp.core.dao.UniqueValueDao;
+import org.openecomp.core.dao.UniqueValueDaoFactory;
+import org.openecomp.core.dao.types.UniqueValueEntity;
+import org.openecomp.core.utilities.CommonMethods;
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+
+import java.util.Optional;
+
+/**
+ * The type Unique value util.
+ */
+public class UniqueValueUtil {
+ /**
+ * The constant UNIQUE_VALUE_VIOLATION.
+ */
+ public static final String UNIQUE_VALUE_VIOLATION = "UNIQUE_VALUE_VIOLATION";
+ private static final String UNIQUE_VALUE_VIOLATION_MSG = "%s with the value '%s' already exists.";
+
+ private static final UniqueValueDao uniqueValueDao =
+ UniqueValueDaoFactory.getInstance().createInterface();
+
+ /**
+ * Create unique value.
+ *
+ * @param type the type
+ * @param uniqueCombination the unique combination
+ */
+ public static void createUniqueValue(String type, String... uniqueCombination) {
+ Optional<String> value = formatValue(uniqueCombination);
+ if (!value.isPresent()) {
+ return;
+ }
+ validateUniqueValue(type, value.get(), uniqueCombination);
+ uniqueValueDao.create(new UniqueValueEntity(type, value.get()));
+ }
+
+ /**
+ * Delete unique value.
+ *
+ * @param type the type
+ * @param uniqueCombination the unique combination
+ */
+ public static void deleteUniqueValue(String type, String... uniqueCombination) {
+ Optional<String> value = formatValue(uniqueCombination);
+ if (!value.isPresent()) {
+ return;
+ }
+ uniqueValueDao.delete(new UniqueValueEntity(type, value.get()));
+ }
+
+ /**
+ * Update unique value.
+ *
+ * @param type the type
+ * @param oldValue the old value
+ * @param newValue the new value
+ * @param uniqueContext the unique context
+ */
+ public static void updateUniqueValue(String type, String oldValue, String newValue,
+ String... uniqueContext) {
+ if ((newValue != null && oldValue != null
+ && !newValue.toLowerCase().equals(oldValue.toLowerCase()))
+ || newValue == null || oldValue == null) {
+ createUniqueValue(type, CommonMethods.concat(uniqueContext, new String[]{newValue}));
+ deleteUniqueValue(type, CommonMethods.concat(uniqueContext, new String[]{oldValue}));
+ }
+ }
+
+ /**
+ * Validate unique value.
+ *
+ * @param type the type
+ * @param uniqueCombination the unique combination
+ */
+ public static void validateUniqueValue(String type, String... uniqueCombination) {
+ Optional<String> value = formatValue(uniqueCombination);
+ if (!value.isPresent()) {
+ return;
+ }
+ validateUniqueValue(type, value.get(), uniqueCombination);
+ }
+
+ private static void validateUniqueValue(String type, String value, String... uniqueCombination) {
+ if (uniqueValueDao.get(new UniqueValueEntity(type, value)) != null) {
+ throw new CoreException(new ErrorCode.ErrorCodeBuilder()
+ .withCategory(ErrorCategory.APPLICATION)
+ .withId(UNIQUE_VALUE_VIOLATION)
+ .withMessage(String.format(UNIQUE_VALUE_VIOLATION_MSG, type,
+ uniqueCombination[uniqueCombination.length - 1])).build());
+ }
+ }
+
+ private static Optional<String> formatValue(String[] uniqueCombination) {
+ if (uniqueCombination == null || uniqueCombination.length == 0
+ || uniqueCombination[uniqueCombination.length - 1] == null) {
+ return Optional.empty();
+ }
+
+ uniqueCombination[uniqueCombination.length - 1] =
+ uniqueCombination[uniqueCombination.length - 1].toLowerCase();
+ return Optional.of(CommonMethods.arrayToSeparatedString(uniqueCombination, '_'));
+ }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/resources/cassandraStatements.json b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/resources/cassandraStatements.json
new file mode 100644
index 0000000000..e83b9f0126
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/resources/cassandraStatements.json
@@ -0,0 +1,6 @@
+{
+ "test.select.all": "SELECT * FROM test",
+ "test.drop": "DROP TABLE IF EXISTS test",
+ "test.create": "CREATE TABLE test (name text PRIMARY KEY,value text)",
+ "test.insert": "INSERT INTO test (name,value) VALUES ( ?,?)"
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/resources/factoryConfiguration.json b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/resources/factoryConfiguration.json
new file mode 100644
index 0000000000..0d5440508f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/resources/factoryConfiguration.json
@@ -0,0 +1,4 @@
+{
+ "org.openecomp.core.dao.UniqueValueDaoFactory": "org.openecomp.core.dao.impl.UniqueValueDaoFactoryImpl",
+ "org.openecomp.core.nosqldb.factory.NoSqlDbFactory": "org.openecomp.core.nosqldb.impl.cassandra.CassandraNoSqlDbFactoryImpl"
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/pom.xml b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/pom.xml
new file mode 100644
index 0000000000..d799edb961
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/pom.xml
@@ -0,0 +1,60 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <artifactId>openecomp-sdc-lib</artifactId>
+ <groupId>org.openecomp.sdc</groupId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../../..</relativePath>
+ </parent>
+
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-nosqldb-core</artifactId>
+ <name>openecomp-nosqldb-core</name>
+
+
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-nosqldb-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.yaml</groupId>
+ <artifactId>snakeyaml</artifactId>
+ <version>1.14</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <version>2.3.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <scope>test</scope>
+ <version>1.10.19</version>
+ </dependency>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <scope>test</scope>
+ <version>6.8.5</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>snakeyaml</artifactId>
+ <groupId>org.yaml</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ <version>RELEASE</version>
+ </dependency>
+ </dependencies>
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/dao/impl/CassandraBaseDao.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/dao/impl/CassandraBaseDao.java
new file mode 100644
index 0000000000..1b3dbc4c6f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/dao/impl/CassandraBaseDao.java
@@ -0,0 +1,50 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.dao.impl;
+
+import com.datastax.driver.mapping.Mapper;
+import org.openecomp.core.dao.BaseDao;
+
+public abstract class CassandraBaseDao<T> implements BaseDao<T> {
+ protected abstract Mapper<T> getMapper();
+
+ protected abstract Object[] getKeys(T entity);
+
+ @Override
+ public void create(T entity) {
+ getMapper().save(entity);
+ }
+
+ @Override
+ public void update(T entity) {
+ getMapper().save(entity);
+ }
+
+ @Override
+ public T get(T entity) {
+ return getMapper().get(getKeys(entity));
+ }
+
+ @Override
+ public void delete(T entity) {
+ getMapper().delete(entity);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/dao/impl/UniqueValueCassandraDaoImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/dao/impl/UniqueValueCassandraDaoImpl.java
new file mode 100644
index 0000000000..31dd602400
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/dao/impl/UniqueValueCassandraDaoImpl.java
@@ -0,0 +1,65 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.dao.impl;
+
+import com.datastax.driver.mapping.Mapper;
+import com.datastax.driver.mapping.Result;
+import com.datastax.driver.mapping.annotations.Accessor;
+import com.datastax.driver.mapping.annotations.Query;
+import org.openecomp.core.dao.UniqueValueDao;
+import org.openecomp.core.dao.types.UniqueValueEntity;
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
+
+import java.util.Collection;
+
+public class UniqueValueCassandraDaoImpl extends CassandraBaseDao<UniqueValueEntity>
+ implements UniqueValueDao {
+
+ private static NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
+ private static Mapper<UniqueValueEntity> mapper =
+ noSqlDb.getMappingManager().mapper(UniqueValueEntity.class);
+ private static UniqueValueAccessor accessor =
+ noSqlDb.getMappingManager().createAccessor(UniqueValueAccessor.class);
+
+
+ @Override
+ protected Mapper<UniqueValueEntity> getMapper() {
+ return mapper;
+ }
+
+ @Override
+ protected Object[] getKeys(UniqueValueEntity entity) {
+ return new Object[]{entity.getType(), entity.getValue()};
+ }
+
+ @Override
+ public Collection<UniqueValueEntity> list(UniqueValueEntity entity) {
+ return accessor.listAll().all();
+ }
+
+ @Accessor
+ interface UniqueValueAccessor {
+
+ @Query("select * from unique_value")
+ Result<UniqueValueEntity> listAll();
+ }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/dao/impl/UniqueValueDaoFactoryImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/dao/impl/UniqueValueDaoFactoryImpl.java
new file mode 100644
index 0000000000..b717fcbee1
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/dao/impl/UniqueValueDaoFactoryImpl.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.dao.impl;
+
+import org.openecomp.core.dao.UniqueValueDao;
+import org.openecomp.core.dao.UniqueValueDaoFactory;
+
+public class UniqueValueDaoFactoryImpl extends UniqueValueDaoFactory {
+ private static UniqueValueDao INSTANCE = new UniqueValueCassandraDaoImpl();
+
+ @Override
+ public UniqueValueDao createInterface() {
+ return INSTANCE;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraNoSqlDbFactoryImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraNoSqlDbFactoryImpl.java
new file mode 100644
index 0000000000..2922925171
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraNoSqlDbFactoryImpl.java
@@ -0,0 +1,43 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.nosqldb.impl.cassandra;
+
+import com.datastax.driver.core.Session;
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
+
+public class CassandraNoSqlDbFactoryImpl extends NoSqlDbFactory {
+
+ @Override
+ public NoSqlDb createInterface() {
+
+
+ return new CassandraNoSqlDbImpl(ReferenceHolder.CASSANDRA);
+ }
+
+ protected void stop() {
+ ReferenceHolder.CASSANDRA.close();
+ }
+
+ private static class ReferenceHolder {
+ private static final Session CASSANDRA = CassandraSessionFactory.getSession();
+ }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraNoSqlDbImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraNoSqlDbImpl.java
new file mode 100644
index 0000000000..bcac5f8d79
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraNoSqlDbImpl.java
@@ -0,0 +1,104 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.nosqldb.impl.cassandra;
+
+import com.datastax.driver.core.BoundStatement;
+import com.datastax.driver.core.PreparedStatement;
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.Session;
+import com.datastax.driver.mapping.MappingManager;
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+import org.openecomp.core.nosqldb.util.CassandraUtils;
+import org.openecomp.core.utilities.CommonMethods;
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+
+class CassandraNoSqlDbImpl implements NoSqlDb {
+
+ private final Session session;
+ private final String keySpace;
+ private final MappingManager mappingManager;
+
+
+ public CassandraNoSqlDbImpl(Session session) {
+ this.session = session;
+ this.keySpace = this.session.getLoggedKeyspace();
+ this.mappingManager = new MappingManager(this.session);
+
+ }
+
+ @Override
+ public void insert(String tableName, String[] colNames, Object[] values) {
+ if (colNames.length != values.length) {
+ throw new CoreException((new ErrorCode.ErrorCodeBuilder()).withMessage(
+ "number of colmuns[" + colNames.length + "] is not equal to the number of values["
+ + values.length + "].").withId("E0005").withCategory(ErrorCategory.APPLICATION)
+ .build());
+ }
+
+ StringBuilder sb = new StringBuilder();
+ sb.append("insert into ")
+ .append(tableName)
+ .append(" (")
+ .append(CommonMethods.arrayToCommaSeparatedString(colNames))
+ .append(") values (")
+ .append(CommonMethods.duplicateStringWithDelimiter("?", ',', values.length))
+ .append(")");
+ System.out.println(sb.toString());
+ PreparedStatement prepared = session.prepare(sb.toString());
+
+ BoundStatement bound;
+ bound = prepared.bind(values);
+ session.execute(bound);
+
+ }
+
+ @Override
+ public ResultSet execute(String statement) {
+ return session.execute(statement);
+ }
+
+ @Override
+ public ResultSet execute(String statementName, Object... values) {
+
+ String statement = CassandraUtils.getStatement(statementName);
+ if (statement == null) {
+ statement = statementName;
+ }
+ if (values != null) {
+ PreparedStatement prepared = session.prepare(statement);
+
+ BoundStatement bound;
+ bound = prepared.bind(values);
+ return session.execute(bound);
+ } else {
+ return session.execute(statement);
+ }
+
+ }
+
+ @Override
+ public MappingManager getMappingManager() {
+ return mappingManager;
+ }
+
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraSessionFactory.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraSessionFactory.java
new file mode 100644
index 0000000000..1b98f095b5
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraSessionFactory.java
@@ -0,0 +1,124 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.nosqldb.impl.cassandra;
+
+import com.google.common.base.Optional;
+
+import com.datastax.driver.core.Cluster;
+import com.datastax.driver.core.SSLOptions;
+import com.datastax.driver.core.Session;
+
+import org.openecomp.core.nosqldb.util.CassandraUtils;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.security.KeyManagementException;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+import java.security.UnrecoverableKeyException;
+import java.security.cert.CertificateException;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.TrustManagerFactory;
+
+public class CassandraSessionFactory {
+ public static Session getSession() {
+ return ReferenceHolder.CASSANDRA;
+ }
+
+ /**
+ * New cassandra session session.
+ *
+ * @return the session
+ */
+ public static Session newCassandraSession() {
+ Cluster.Builder builder = Cluster.builder();
+ String[] addresses = CassandraUtils.getAddresses();
+ for (String address : addresses) {
+ builder.addContactPoint(address);
+ }
+ Boolean isSsl = CassandraUtils.isSsl();
+ if (isSsl) {
+ builder.withSSL(getSslOptions().get());
+ }
+ int port = CassandraUtils.getCassandraPort();
+ if (port > 0) {
+ builder.withPort(port);
+ }
+ //Check if user/pass
+ Boolean isAuthenticate = CassandraUtils.isAuthenticate();
+ if (isAuthenticate) {
+ builder.withCredentials(CassandraUtils.getUser(), CassandraUtils.getPassword());
+ }
+
+ Cluster cluster = builder.build();
+ String keyStore = CassandraUtils.getKeySpace();
+ return cluster.connect(keyStore);
+ }
+
+ private static Optional<SSLOptions> getSslOptions() {
+ Optional<String> truststorePath = Optional.of(CassandraUtils.getTruststore());
+ Optional<String> truststorePassword = Optional.of(CassandraUtils.getTruststorePassword());
+
+ if (truststorePath.isPresent() && truststorePassword.isPresent()) {
+ SSLContext context;
+ try {
+ context = getSslContext(truststorePath.get(), truststorePassword.get());
+ } catch (UnrecoverableKeyException | KeyManagementException
+ | NoSuchAlgorithmException | KeyStoreException | CertificateException | IOException e0) {
+ throw new RuntimeException(e0);
+ }
+ String[] css = new String[]{"TLS_RSA_WITH_AES_128_CBC_SHA"};
+ return Optional.of(new SSLOptions(context, css));
+ }
+ return Optional.absent();
+ }
+
+ private static SSLContext getSslContext(String truststorePath, String truststorePassword)
+ throws NoSuchAlgorithmException, KeyStoreException, CertificateException, IOException,
+ UnrecoverableKeyException, KeyManagementException {
+ FileInputStream tsf = null;
+ SSLContext ctx = null;
+ try {
+ tsf = new FileInputStream(truststorePath);
+ ctx = SSLContext.getInstance("SSL");
+
+ KeyStore ts = KeyStore.getInstance("JKS");
+ ts.load(tsf, truststorePassword.toCharArray());
+ TrustManagerFactory tmf =
+ TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
+ tmf.init(ts);
+
+ ctx.init(null, tmf.getTrustManagers(), new SecureRandom());
+ } catch (Exception e0) {
+ e0.printStackTrace();
+ } finally {
+ tsf.close();
+
+ }
+ return ctx;
+ }
+
+ private static class ReferenceHolder {
+ private static final Session CASSANDRA = newCassandraSession();
+ }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/util/CassandraUtils.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/util/CassandraUtils.java
new file mode 100644
index 0000000000..2a88d0e521
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/util/CassandraUtils.java
@@ -0,0 +1,92 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.nosqldb.util;
+
+import org.openecomp.core.utilities.file.FileUtils;
+import org.openecomp.core.utilities.json.JsonUtil;
+
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+
+public class CassandraUtils {
+
+
+ private static final String CASSANDRA_STATEMENT_DEFINITION_FILE = "cassandraStatements.json";
+ private static Map<String, String> statementMap = new HashMap<>();
+
+ public static String[] getAddresses() {
+ return ConfigurationManager.getInstance().getAddresses();
+
+ }
+
+ public static String getKeySpace() {
+ return ConfigurationManager.getInstance().getKeySpace();
+ }
+
+ /**
+ * Gets statement.
+ *
+ * @param statementName the statement name
+ * @return the statement
+ */
+ public static String getStatement(String statementName) {
+ if (statementMap.size() == 0) {
+ InputStream statementJson = FileUtils.getFileInputStream(CASSANDRA_STATEMENT_DEFINITION_FILE);
+ statementMap = JsonUtil.json2Object(statementJson, Map.class);
+ }
+ return statementMap.get(statementName);
+ }
+
+ public static String getUser() {
+
+ return ConfigurationManager.getInstance().getUsername();
+ }
+
+ public static String getPassword() {
+ return ConfigurationManager.getInstance().getPassword();
+
+ }
+
+ public static String getTruststore() {
+ return ConfigurationManager.getInstance().getTruststorePath();
+
+ }
+
+ public static String getTruststorePassword() {
+ return ConfigurationManager.getInstance().getTruststorePassword();
+
+ }
+
+ public static int getCassandraPort() {
+ return ConfigurationManager.getInstance().getSslPort();
+
+ }
+
+ public static boolean isSsl() {
+ return ConfigurationManager.getInstance().isSsl();
+
+ }
+
+ public static boolean isAuthenticate() {
+ return ConfigurationManager.getInstance().isAuthenticate();
+ }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/util/ConfigurationManager.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/util/ConfigurationManager.java
new file mode 100644
index 0000000000..a1c0b528fb
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/util/ConfigurationManager.java
@@ -0,0 +1,234 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.nosqldb.util;
+
+import org.openecomp.core.utilities.yaml.YamlUtil;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * The type Configuration manager.
+ */
+public class ConfigurationManager {
+
+ private static final String CONFIGURATION_YAML_FILE = "configuration.yaml";
+ private static final String cassandraKey = "cassandraConfig";
+ private static final String DEFAULT_KEYSPACE_NAME = "dox";
+ private static final String CASSANDRA_ADDRESSES = "cassandra.addresses";
+ private static final String CASSANDRA_DOX_KEY_STORE = "cassandra.dox.keystore";
+ private static final String CASSANDRA_AUTHENTICATE = "cassandra.authenticate";
+ private static final String CASSANDRA_USER = "cassandra.user";
+ private static final String CASSANDRA_PASSWORD = "cassandra.password";
+ private static final String CASSANDRA_PORT = "cassandra.port";
+ private static final String CASSANDRA_SSL = "cassandra.ssl";
+ private static final String CASSANDRA_TRUSTSTORE = "cassandra.Truststore";
+ private static final String CASSANDRA_TRUSTSTORE_PASSWORD = "cassandra.TruststorePassword";
+ private static final String cassandraHostsKey = "cassandraHosts";
+ private static final String cassandraPortKey = "port";
+ private static final String cassandraUsernameKey = "username";
+ private static final String cassandraPasswordKey = "password";
+ private static final String cassandraAuthenticateKey = "authenticate";
+ private static final String cassandraSSLKey = "ssl";
+ private static final String cassandraTruststorePathKey = "truststorePath";
+ private static final String cassandraTruststorePasswordKey = "truststorePassword";
+ private static ConfigurationManager instance = null;
+ private final LinkedHashMap<String, Object> cassandraConfiguration;
+
+
+ private ConfigurationManager() {
+ YamlUtil yamlUtil = new YamlUtil();
+ String configurationYamlFile = System.getProperty(CONFIGURATION_YAML_FILE);
+ InputStream yamlAsString;
+ if (configurationYamlFile != null) {
+ yamlAsString = getConfigFileIs(configurationYamlFile);
+ } else {
+ //Load from resources
+ yamlAsString = yamlUtil.loadYamlFileIs("/" + CONFIGURATION_YAML_FILE);
+ }
+ Map<String, LinkedHashMap<String, Object>> configurationMap = yamlUtil.yamlToMap(yamlAsString);
+ cassandraConfiguration = configurationMap.get(cassandraKey);
+
+ }
+
+ /**
+ * Gets instance.
+ *
+ * @return the instance
+ */
+ public static ConfigurationManager getInstance() {
+ if (instance == null) {
+ instance = new ConfigurationManager();
+ }
+ return instance;
+ }
+
+ /**
+ * Get addresses string [ ].
+ *
+ * @return the string [ ]
+ */
+ public String[] getAddresses() {
+
+ String addresses = System.getProperty(CASSANDRA_ADDRESSES);
+ if (addresses != null) {
+ return addresses.split(",");
+ }
+ List locAddresses = (ArrayList) cassandraConfiguration.get(cassandraHostsKey);
+ String[] addressesArray;
+ addressesArray = (String[]) locAddresses.toArray(new String[locAddresses.size()]);
+ return addressesArray;
+
+ }
+
+ /**
+ * Gets key space.
+ *
+ * @return the key space
+ */
+ public String getKeySpace() {
+ String keySpace = System.getProperty(CASSANDRA_DOX_KEY_STORE);
+ if (keySpace == null) {
+ //keySpace = cassandraConfiguration.get(cassandraKeySpaceKey);
+ //if (keySpace == null)
+ keySpace = DEFAULT_KEYSPACE_NAME;
+ }
+ return keySpace;
+ }
+
+ /**
+ * Gets username.
+ *
+ * @return the username
+ */
+ public String getUsername() {
+ String username = System.getProperty(CASSANDRA_USER);
+ if (username == null) {
+ username = (String) cassandraConfiguration.get(cassandraUsernameKey);
+ }
+ return username;
+ }
+
+ /**
+ * Gets password.
+ *
+ * @return the password
+ */
+ public String getPassword() {
+ String password = System.getProperty(CASSANDRA_PASSWORD);
+ if (password == null) {
+ password = (String) cassandraConfiguration.get(cassandraPasswordKey);
+ }
+ return password;
+ }
+
+ /**
+ * Gets truststore path.
+ *
+ * @return the truststore path
+ */
+ public String getTruststorePath() {
+ String truststorePath = System.getProperty(CASSANDRA_TRUSTSTORE);
+ if (truststorePath == null) {
+ truststorePath = (String) cassandraConfiguration.get(cassandraTruststorePathKey);
+ }
+ return truststorePath;
+ }
+
+ /**
+ * Gets truststore password.
+ *
+ * @return the truststore password
+ */
+ public String getTruststorePassword() {
+ String truststorePassword = System.getProperty(CASSANDRA_TRUSTSTORE_PASSWORD);
+ if (truststorePassword == null) {
+ truststorePassword = (String) cassandraConfiguration.get(cassandraTruststorePasswordKey);
+ }
+ return truststorePassword;
+ }
+
+ /**
+ * Gets ssl port.
+ *
+ * @return the ssl port
+ */
+ public int getSslPort() {
+ int port;
+ String sslPort = System.getProperty(CASSANDRA_PORT);
+ if (sslPort == null) {
+ sslPort = (String) cassandraConfiguration.get(cassandraPortKey);
+ if (sslPort == null) {
+ sslPort = "0";
+ }
+ }
+ port = Integer.valueOf(sslPort);
+ return port;
+ }
+
+
+ /**
+ * Is ssl boolean.
+ *
+ * @return the boolean
+ */
+ public boolean isSsl() {
+ return getBooleanResult(CASSANDRA_SSL, cassandraSSLKey);
+ }
+
+ /**
+ * Is authenticate boolean.
+ *
+ * @return the boolean
+ */
+ public boolean isAuthenticate() {
+ return getBooleanResult(CASSANDRA_AUTHENTICATE, cassandraAuthenticateKey);
+ }
+
+ private Boolean getBooleanResult(String property, String key) {
+ Boolean res;
+ String value;
+ if (System.getProperty(property) == null) {
+ value = String.valueOf(cassandraConfiguration.get(key));
+ } else {
+ value = System.getProperty(property);
+ }
+
+ res = Boolean.valueOf(value);
+
+ return res;
+ }
+
+ private InputStream getConfigFileIs(String file) {
+ InputStream is = null;
+ try {
+ is = new FileInputStream(file);
+ } catch (FileNotFoundException e0) {
+ e0.printStackTrace();
+ }
+ return is;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/resources/configuration.yaml b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/resources/configuration.yaml
new file mode 100644
index 0000000000..0988f50237
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/resources/configuration.yaml
@@ -0,0 +1,253 @@
+identificationHeaderFields:
+ - HTTP_IV_USER
+ - HTTP_CSP_FIRSTNAME
+ - HTTP_CSP_LASTNAME
+ - HTTP_IV_REMOTE_ADDRESS
+ - HTTP_CSP_WSTYPE
+
+
+
+# catalog backend hostname
+beFqdn: sdccatalog.att.com
+
+# catalog backend http port
+beHttpPort: 8080
+
+# catalog backend http context
+beContext: /sdc/rest/config/get
+
+# catalog backend protocol
+beProtocol: http
+
+# catalog backend ssl port
+beSslPort: 8443
+
+version: 1.0
+released: 2012-11-30
+
+titanCfgFile: /home/vagrant/catalog-be/config/catalog-be/titan.properties
+titanInMemoryGraph: false
+titanLockTimeout: 30
+titanReconnectIntervalInSeconds: 3
+titanHealthCheckReadTimeout: 1
+esReconnectIntervalInSeconds: 3
+uebHealthCheckReconnectIntervalInSeconds: 15
+uebHealthCheckReadTimeout: 4
+
+# Protocols
+protocols:
+ - http
+ - https
+
+# Users
+users:
+ tom: passwd
+ bob: passwd
+
+neo4j:
+ host: neo4jhost
+ port: 7474
+ user: neo4j
+ password: "12345"
+
+cassandraConfig:
+ cassandraHosts: ['127.0.0.1']
+ reconnectTimeout : 30000
+ authenticate: false
+ username: sdc_user
+ password: Aa1234%^!
+ ssl: false
+ truststorePath : /path/path
+ truststorePassword : Aa123456
+ keySpaces:
+ - { name: dox, replicationStrategy: SimpleStrategy, replicationInfo: ['1']}
+ - { name: sdcartifact, replicationStrategy: SimpleStrategy, replicationInfo: ['1']}
+
+#Application-specific settings of ES
+elasticSearch:
+ # Mapping of index prefix to time-based frame. For example, if below is configured:
+ #
+ # - indexPrefix: auditingevents
+ # creationPeriod: minute
+ #
+ # then ES object of type which is mapped to "auditingevents-*" template, and created on 2015-12-23 13:24:54, will enter "auditingevents-2015-12-23-13-24" index.
+ # Another object created on 2015-12-23 13:25:54, will enter "auditingevents-2015-12-23-13-25" index.
+ # If creationPeriod: month, both of the above will enter "auditingevents-2015-12" index.
+ #
+ # PLEASE NOTE: the timestamps are created in UTC/GMT timezone! This is needed so that timestamps will be correctly presented in Kibana.
+ #
+ # Legal values for creationPeriod - year, month, day, hour, minute, none (meaning no time-based behaviour).
+ #
+ # If no creationPeriod is configured for indexPrefix, default behavour is creationPeriod: month.
+
+ indicesTimeFrequency:
+ - indexPrefix: auditingevents
+ creationPeriod: month
+ - indexPrefix: monitoring_events
+ creationPeriod: month
+
+artifactTypes:
+ - CHEF
+ - PUPPET
+ - SHELL
+ - YANG
+ - YANG_XML
+ - HEAT
+ - BPEL
+ - DG_XML
+ - MURANO_PKG
+ - OTHER
+
+licenseTypes:
+ - User
+ - Installation
+ - CPU
+
+#Deployment artifacts placeHolder
+deploymentResourceArtifacts:
+ heat:
+ displayName: "HEAT Template"
+ type: HEAT
+
+deploymentResourceInstanceArtifacts:
+ heatEnv:
+ displayName: "HEAT ENV"
+ type: HEAT_ENV
+ description: "Auto-generated HEAT Environment deployment artifact"
+ fileExtension: "env"
+
+#Informational artifacts placeHolder
+excludeResourceCategory:
+ - Generic
+informationalResourceArtifacts:
+ features:
+ displayName: Features
+ type: OTHER
+ capacity:
+ displayName: Capacity
+ type: OTHER
+ vendorTestResult:
+ displayName: Vendor Test Result
+ type: OTHER
+ testScripts:
+ displayName: Test Scripts
+ type: OTHER
+ cloudQuestionnaire:
+ displayName: Cloud Questionnaire (completed)
+ type: OTHER
+ HEATTemplateFromVendor:
+ displayName: HEAT Template from Vendor
+ type: HEAT
+
+excludeServiceCategory:
+
+informationalServiceArtifacts:
+ messageFlows:
+ displayName: Message Flows
+ type: OTHER
+ instantiationFlows:
+ displayName: Management Flows
+ type: OTHER
+ serviceArtifactPlan:
+ displayName: Service Artifact Plan
+ type: OTHER
+ summaryOfImpactsToECOMPElements:
+ displayName: Summary of impacts to ECOMP elements,OSSs, BSSs
+ type: OTHER
+ controlLoopFunctions:
+ displayName: Control Loop Functions
+ type: OTHER
+ dimensioningInfo:
+ displayName: Dimensioning Info
+ type: OTHER
+ affinityRules:
+ displayName: Affinity Rules
+ type: OTHER
+ operationalPolicies:
+ displayName: Operational Policies
+ type: OTHER
+ serviceSpecificPolicies:
+ displayName: Service-specific Policies
+ type: OTHER
+ engineeringRules:
+ displayName: Engineering Rules (ERD)
+ type: OTHER
+ distributionInstructions:
+ displayName: Distribution Instructions
+ type: OTHER
+ certificationTestResults:
+ displayName: TD Certification Test Results
+ type: OTHER
+ deploymentVotingRecord:
+ displayName: Deployment Voting Record
+ type: OTHER
+ serviceQuestionnaire:
+ displayName: Service Questionnaire
+ type: OTHER
+
+serviceApiArtifacts:
+ configuration:
+ displayName: Configuration
+ type: OTHER
+ instantiation:
+ displayName: Instantiation
+ type: OTHER
+ monitoring:
+ displayName: Monitoring
+ type: OTHER
+ reporting:
+ displayName: Reporting
+ type: OTHER
+ logging:
+ displayName: Logging
+ type: OTHER
+ testing:
+ displayName: Testing
+ type: OTHER
+
+
+additionalInformationMaxNumberOfKeys: 50
+
+systemMonitoring:
+ enabled: false
+ isProxy: false
+ probeIntervalInSeconds: 15
+
+defaultHeatArtifactTimeoutMinutes: 60
+
+serviceDeploymentArtifacts:
+
+resourceDeploymentArtifacts:
+ HEAT:
+ acceptedTypes:
+ - yaml
+ - yml
+
+resourceInformationalDeployedArtifacts:
+ YANG_XML:
+ acceptedTypes:
+ - xml
+
+
+unLoggedUrls:
+ - /sdc2/rest/healthCheck
+
+cleanComponentsConfiguration:
+ cleanIntervalInMinutes: 1440
+ componentsToClean:
+ - Resource
+
+artifactsIndex: resources
+
+heatEnvArtifactHeader:
+ " # _______________________________________________________________________________________________________________________________________\n
+ #| AT&T Proprietary (Restricted) |\n
+ #| Only for use by authorized individuals or any above-designated team(s) |\n
+ #| within the AT&T companies and not for general distribution |\n
+ #|_______________________________________________________________________________________________________________________________________|\n"
+heatEnvArtifactFooter:
+ " # _______________________________________________________________________________________________________________________________________\n
+ #| AT&T Proprietary (Restricted) |\n
+ #| Only for use by authorized individuals or any above-designated team(s) |\n
+ #| within the AT&T companies and not for general distribution |\n
+ #|_______________________________________________________________________________________________________________________________________|\n"
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/org/openecomp/core/nosqldb/NoSqlDbTest.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/org/openecomp/core/nosqldb/NoSqlDbTest.java
new file mode 100644
index 0000000000..e53c482b86
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/org/openecomp/core/nosqldb/NoSqlDbTest.java
@@ -0,0 +1,48 @@
+package org.openecomp.core.nosqldb;
+
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+
+import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
+
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.Row;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+import java.util.List;
+
+public class NoSqlDbTest {
+
+ private static NoSqlDb noSqlDb;
+
+
+// @Test
+ public void testNoSqlDbFactoryFactoryInit(){
+ this.noSqlDb = NoSqlDbFactory.getInstance().createInterface();
+ Assert.assertNotNull(this.noSqlDb);
+ Assert.assertEquals(this.noSqlDb.getClass().getName(),"org.openecomp.core.nosqldb.impl.cassandra.CassandraNoSqlDbImpl");
+ }
+
+// @Test(dependsOnMethods = {"testNoSqlDbFactoryFactoryInit"})
+ public void testCreateTable(){
+ this.noSqlDb.execute("test.drop",null);
+ this.noSqlDb.execute("test.create",null);
+ }
+
+// @Test(dependsOnMethods = {"testCreateTable"})
+ public void testInsertTable(){
+ this.noSqlDb.insert("test",new String[]{"name","value"},new String[]{"TestName","testValue"});
+ this.noSqlDb.execute("test.insert",new String[]{"TestName2","testValue2"});
+ }
+
+// @Test(dependsOnMethod`s = {"testInsertTable"})
+ public void gettestSelectTable(){
+ ResultSet result = this.noSqlDb.execute("test.select.all",null);
+ List<Row> rows = result.all();
+ Assert.assertEquals(rows.size(),2);
+ for (Row row:rows){
+ System.out.format("%s %s\n", row.getString("name"), row.getString("value"));
+ }
+ }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/org/openecomp/core/utilities/Yaml/YamlUtilTest.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/org/openecomp/core/utilities/Yaml/YamlUtilTest.java
new file mode 100644
index 0000000000..baf9bfb350
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/org/openecomp/core/utilities/Yaml/YamlUtilTest.java
@@ -0,0 +1,47 @@
+package org.openecomp.core.utilities.Yaml;
+
+import org.openecomp.core.utilities.yaml.YamlUtil;
+import org.junit.Before;
+import org.junit.Test;
+import testobjects.yaml.YamlFile;
+
+
+public class YamlUtilTest {
+
+ String yamlContent;
+
+ @Before
+ public void setup() {
+ initYamlFileContent();
+ }
+
+ void initYamlFileContent() {
+ yamlContent = "heat_template_version: ss\n" +
+ "description: ab\n" +
+ "parameters:\n" +
+ " jsa_net_name: \n" +
+ " description: network name of jsa log network\n" +
+ " hidden: true\n" +
+ " inner:\n" +
+ " inner1:\n" +
+ " name: shiri\n" +
+ " inner2:\n" +
+ " name: avi";
+ }
+
+ @Test
+ public void shouldConvertSimpleYamlToObject() {
+ new YamlUtil().yamlToObject(yamlContent, YamlFile.class);
+ }
+
+
+ /*public void loadCassandraParameters(){
+ YamlUtil yamlutil = new YamlUtil();
+ String cassandraKey = "cassandraConfig";
+ String configurationFile = "/configuration.yaml";
+ InputStream yamlAsIS = yamlutil.loadYamlFileIs(configurationFile);
+ Map<String, LinkedHashMap<String, Object>> configurationMap = yamlutil.yamlToMap(yamlAsIS);
+ LinkedHashMap<String, Object> cassandraConfiguration = configurationMap.get(cassandraKey);
+ System.out.println(cassandraConfiguration.entrySet());
+ }*/
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/org/openecomp/core/utilities/json/JsonUtilTest.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/org/openecomp/core/utilities/json/JsonUtilTest.java
new file mode 100644
index 0000000000..5cf8988c06
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/org/openecomp/core/utilities/json/JsonUtilTest.java
@@ -0,0 +1,13 @@
+package org.openecomp.core.utilities.json;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+public class JsonUtilTest {
+ @Test
+ public void abc() {
+ System.out.println("as");
+ }
+
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/testobjects/yaml/InnerP.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/testobjects/yaml/InnerP.java
new file mode 100644
index 0000000000..eda4143e3e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/testobjects/yaml/InnerP.java
@@ -0,0 +1,25 @@
+package testobjects.yaml;
+
+public class InnerP {
+ String name;
+ String label;
+
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getLabel() {
+ return label;
+ }
+
+ public void setLabel(String label) {
+ this.label = label;
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/testobjects/yaml/Parameter.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/testobjects/yaml/Parameter.java
new file mode 100644
index 0000000000..febcef9c40
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/testobjects/yaml/Parameter.java
@@ -0,0 +1,68 @@
+package testobjects.yaml;
+
+import java.util.Map;
+
+public class Parameter {
+ String name;
+ String label;
+ String description;
+ String paramDefault;
+ boolean hidden;
+ Map<String, InnerP> inner;
+
+ public Map<String, InnerP> getInner() {
+ return inner;
+ }
+
+ public void setInner(Map<String, InnerP> inner) {
+ this.inner = inner;
+ }
+
+ public String getParamDefault() {
+ return paramDefault;
+ }
+
+ public void setParamDefault(String paramDefault) {
+ this.paramDefault = paramDefault;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getLabel() {
+ return label;
+ }
+
+ public void setLabel(String label) {
+ this.label = label;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getDefault() {
+ return paramDefault;
+ }
+
+ public void setDefault(String paramDefault) {
+ this.paramDefault = paramDefault;
+ }
+
+ public boolean isHidden() {
+ return hidden;
+ }
+
+ public void setHidden(boolean hidden) {
+ this.hidden = hidden;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/testobjects/yaml/YamlFile.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/testobjects/yaml/YamlFile.java
new file mode 100644
index 0000000000..1c4989da37
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/testobjects/yaml/YamlFile.java
@@ -0,0 +1,37 @@
+package testobjects.yaml;
+
+import java.util.Map;
+
+public class YamlFile {
+ String heat_template_version;
+ String description;
+ Map<String, Parameter> parameters;
+
+
+ public YamlFile() {
+ }
+
+ public String getHeat_template_version() {
+ return heat_template_version;
+ }
+
+ public void setHeat_template_version(String heat_template_version) {
+ this.heat_template_version = heat_template_version;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public Map<String, Parameter> getParameters() {
+ return parameters;
+ }
+
+ public void setParameters(Map<String, Parameter> parameters) {
+ this.parameters = parameters;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/pom.xml b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/pom.xml
new file mode 100644
index 0000000000..cb1d810547
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/pom.xml
@@ -0,0 +1,36 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <artifactId>openecomp-sdc-lib</artifactId>
+ <groupId>org.openecomp.sdc</groupId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../..</relativePath>
+ </parent>
+
+ <artifactId>openecomp-nosqldb-lib</artifactId>
+ <groupId>org.openecomp.core</groupId>
+ <name>openecomp-nosqldb-lib</name>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>openecomp-nosqldb-api</module>
+ <module>openecomp-nosqldb-core</module>
+ </modules>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-nosqldb-api</artifactId>
+ <version>${project.version}</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-nosqldb-core</artifactId>
+ <version>${project.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/pom.xml b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/pom.xml
new file mode 100644
index 0000000000..a7a53a32f0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/pom.xml
@@ -0,0 +1,82 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <artifactId>openecomp-core-lib</artifactId>
+ <groupId>org.openecomp.core</groupId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>openecomp-utilities-lib</artifactId>
+ <name>openecomp-utilities-lib</name>
+
+
+ <dependencies>
+ <dependency>
+ <groupId>org.yaml</groupId>
+ <artifactId>snakeyaml</artifactId>
+ <version>1.14</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ <version>3.4</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-collections4</artifactId>
+ <version>4.1</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <version>2.3.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.7.10</version>
+
+ </dependency>
+ <!--<dependency>
+ <groupId>org.yaml</groupId>
+ <artifactId>snakeyaml</artifactId>
+ <version>1.17</version>
+ </dependency>-->
+ <dependency>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ <version>${commons.codec.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ <version>RELEASE</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-mapper-asl</artifactId>
+ <version>${org.codehaus.jackson.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.everit.json</groupId>
+ <artifactId>org.everit.json.schema</artifactId>
+ <version>${org.everit.json.schema.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <scope>test</scope>
+ <version>6.8.5</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>snakeyaml</artifactId>
+ <groupId>org.yaml</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/CommonMethods.java b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/CommonMethods.java
new file mode 100644
index 0000000000..343636bd15
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/CommonMethods.java
@@ -0,0 +1,555 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.utilities;
+
+import org.apache.commons.codec.binary.Base64;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.PrintWriter;
+import java.io.Serializable;
+import java.io.StringWriter;
+import java.lang.reflect.Array;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+
+/**
+ * This class provides auxiliary static methods.
+ */
+public class CommonMethods {
+ //private static final Logger logger = LoggerFactory.getLogger(CommonMethods.class);
+
+ private static final char[] hexArray = "0123456789ABCDEF".toCharArray();
+
+ private static final char[] CHARS = new char[]{
+ '0', '1', '2', '3', '4', '5', '6', '7',
+ '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
+ };
+
+ /**
+ * Private default constructor to prevent instantiation of the class objects.
+ */
+ private CommonMethods() {
+ }
+
+ /**
+ * Serializes an object instance into byte array.
+ *
+ * @param object An instance to be serialized.
+ * @return Java array of bytes.
+ * @see #deserializeObject(byte[]) #deserializeObject(byte[])
+ */
+ public static byte[] serializeObject(Serializable object) {
+ ByteArrayOutputStream byteArray = new ByteArrayOutputStream(2048);
+ try {
+ ObjectOutputStream ds = new ObjectOutputStream(byteArray);
+ ds.writeObject(object);
+ ds.close();
+ } catch (IOException e0) {
+ throw new RuntimeException(e0);
+ }
+
+ return byteArray.toByteArray();
+ } // serializeObject
+
+ /**
+ * Deserializes an object instance.
+ *
+ * @param bytes Java array of bytes.
+ * @return Deserialized instance of an object.
+ * @see #serializeObject(Serializable) #serializeObject(Serializable)
+ */
+ public static Serializable deserializeObject(byte[] bytes) {
+ Serializable obj = null;
+ try {
+ ObjectInputStream stream = new ObjectInputStream(new ByteArrayInputStream(bytes));
+ obj = (Serializable) stream.readObject();
+ stream.close();
+ } catch (IOException | ClassNotFoundException e0) {
+ throw new RuntimeException(e0);
+ }
+
+ return obj;
+ } // deserializeObject
+
+ /**
+ * Encodes binary byte stream to ASCII format.
+ *
+ * @param binary An Java array of bytes in binary format.
+ * @return An Java array of bytes encoded in ASCII format.
+ * @see #decode(byte[]) #decode(byte[])
+ */
+ public static byte[] encode(byte[] binary) {
+ return Base64.encodeBase64(binary);
+ }
+
+ /**
+ * Decodes ASCII byte stream into binary format.
+ *
+ * @param ascii An Java array of bytes in ASCII format.
+ * @return An Java array of bytes encoded in binary format.
+ * @see #encode(byte[]) #encode(byte[])
+ */
+ public static byte[] decode(byte[] ascii) {
+ return Base64.decodeBase64(ascii);
+ }
+
+ /**
+ * Checks whether the given <tt>Object</tt> is empty.
+ *
+ * @param obj Object to be checked.
+ * @return <tt>true</tt> - if the Object is null, <tt>false</tt> otherwise.
+ */
+ public static boolean isEmpty(Object obj) {
+ return obj == null;
+ }
+
+ /**
+ * Checks whether the given <tt>Object</tt> is empty.
+ *
+ * @param byteArray Object to be checked.
+ * @return <tt>true</tt> - if the Object is null, <tt>false</tt> otherwise.
+ */
+ public static boolean isEmpty(byte[] byteArray) {
+ return (byteArray == null || byteArray.length == 0);
+ }
+
+ /**
+ * Checks whether the given <tt>String</tt> is empty.
+ *
+ * @param str String object to be checked.
+ * @return <tt>true</tt> - if the String is null or empty, <tt>false</tt> - otherwise.
+ */
+ public static boolean isEmpty(String str) {
+ return str == null || str.length() == 0;
+ }
+
+ /**
+ * Checks whether the given Java array is empty.
+ *
+ * @param array Java array to be checked.
+ * @return <tt>true</tt> - if the array is null or empty, <tt>false</tt> - otherwise.
+ */
+ public static boolean isEmpty(Object[] array) {
+ return array == null || array.length == 0;
+ }
+
+ /**
+ * Checks whether the given collection is empty.
+ *
+ * @param collection A collection to be checked.
+ * @return <tt>true</tt> - if the collection is null or empty, <tt>false</tt> - otherwise.
+ */
+ public static boolean isEmpty(Collection<?> collection) {
+ return collection == null || collection.isEmpty();
+ }
+
+ /**
+ * Checks whether the given map is empty.
+ *
+ * @param map A map to be checked.
+ * @return <tt>true</tt> - if the map is null or empty, <tt>false</tt> - otherwise.
+ */
+ public static boolean isEmpty(Map<?, ?> map) {
+ return map == null || map.isEmpty();
+ }
+
+ /**
+ * Converts the array with Long elements to the array with long (primitive type).
+ *
+ * @param array input array with Long elements.
+ * @return array with the same elements converted to the long type (primitive).
+ */
+ public static long[] toPrimitive(Long[] array) {
+ if (array == null) {
+ return null;
+ }
+
+ long[] result = new long[array.length];
+ for (int i = 0; i < array.length; i++) {
+ result[i] = array[i] != null ? array[i] : 0L;
+ }
+ return result;
+ }
+
+ /**
+ * Converts a collection to Java array.
+ *
+ * @param <T> Java type of the collection element.
+ * @param col Collection to be converted to array
+ * @param type Java type of collection/array element
+ * @return An Java array of collection elements, or empty array if collection is null or empty.
+ */
+ @SuppressWarnings("unchecked")
+ public static <T> T[] toArray(Collection<? extends T> col, Class<T> type) {
+ int length = isEmpty(col) ? 0 : col.size();
+ T[] array = (T[]) Array.newInstance(type, length);
+ return col != null ? col.toArray(array) : array;
+ }
+
+ /**
+ * Gets an universally unique identifier (UUID).
+ *
+ * @return String representation of generated UUID.
+ */
+ public static String nextUuId() {
+ UUID uuid = UUID.randomUUID();
+
+ StringBuilder buff = new StringBuilder(32);
+ long2string(uuid.getMostSignificantBits(), buff);
+ long2string(uuid.getLeastSignificantBits(), buff);
+
+ return buff.toString();
+ }
+
+ private static void long2string(long lng, StringBuilder buff) {
+ for (int i = 0; i < 16; i++) {
+ long nextByte = lng & 0xF000000000000000L;
+ lng <<= 4;
+ boolean isNegative = nextByte < 0;
+ nextByte = rightShift(nextByte, 60);
+
+ if (isNegative) {
+ nextByte |= 0x08;
+ }
+
+ buff.append(CHARS[(int) nextByte]);
+ }
+ }
+
+ private static long rightShift(long lng, int num) {
+ return lng >>> num;
+ }
+
+ /**
+ * Concatenates two Java arrays. The method allocates a new array and copies
+ * all elements to it or returns one of input arrays if another one is
+ * empty.
+ *
+ * @param <T> the type parameter
+ * @param left Elements of this array will be copied to positions from 0 to
+ * <tt>left.length - 1</tt> in the target array.
+ * @param right Elements of this array will be copied to positions from
+ * <tt>left.length</tt> to <tt>left.length + right.length</tt>
+ * @return A newly allocate Java array that accommodates elements of source (left/right)
+ arraysor one of source arrays if another is empty, <tt>null</tt> - otherwise.
+ */
+ @SuppressWarnings("unchecked")
+ public static <T> T[] concat(T[] left, T[] right) {
+ T[] res = null;
+
+ if (isEmpty(left)) {
+ res = right;
+ } else if (isEmpty(right)) {
+ res = left;
+ } else {
+ res = (T[]) Array.newInstance(left[0].getClass(), left.length + right.length);
+ System.arraycopy(left, 0, res, 0, left.length);
+ System.arraycopy(right, 0, res, left.length, right.length);
+ }
+
+ return res;
+ } // concat
+
+ /**
+ * Casts an object to the class or interface represented by the specified
+ * <tt>Class</tt> object. The method logic is similar to Java method
+ * <tt>Class.cast(Object)</tt> with the only difference that unlike Java's
+ * version the type name of the current object instance is specified in the
+ * error message if casting fails to simplify error tracking.
+ *
+ * @param <B> the type parameter
+ * @param <D> the type parameter
+ * @param b0 An object instance to be casted to the specified Java type.
+ * @param cls Target Java type.
+ * @return Object instance safely casted to the requested Java type.
+ * @throws ClassCastException In case which is the given object is not instance of the
+ * specified Java type.
+ */
+ @SuppressWarnings("unchecked")
+ public static <B, D> D cast(B b0, Class<D> cls) {
+ D d0 = null;
+ if (b0 != null) {
+ if (!cls.isInstance(b0)) {
+ throw new ClassCastException(String
+ .format("Failed to cast from '%s' to '%s'", b0.getClass().getName(), cls.getName()));
+ } else {
+ d0 = (D) b0;
+ }
+ }
+
+ return d0;
+ } // cast
+
+ /**
+ * New instance object.
+ *
+ * @param classname the classname
+ * @return the object
+ */
+ public static Object newInstance(String classname) {
+ return newInstance(classname, Object.class);
+ }
+
+ /**
+ * New instance t.
+ *
+ * @param <T> the type parameter
+ * @param classname the classname
+ * @param cls the cls
+ * @return the t
+ */
+ @SuppressWarnings("unchecked")
+ public static <T> T newInstance(String classname, Class<T> cls) {
+
+ if (isEmpty(classname)) {
+ throw new IllegalArgumentException();
+ }
+
+ if (cls == null) {
+ throw new IllegalArgumentException();
+ }
+
+ try {
+ Class<?> temp = Class.forName(classname);
+
+ if (!cls.isAssignableFrom(temp)) {
+ throw new ClassCastException(
+ String.format("Failed to cast from '%s' to '%s'", classname, cls.getName()));
+ }
+
+ Class<? extends T> impl = (Class<? extends T>) temp;
+
+ return newInstance(impl);
+ } catch (ClassNotFoundException e0) {
+ throw new IllegalArgumentException(e0);
+ }
+ }
+
+ /**
+ * New instance t.
+ *
+ * @param <T> the type parameter
+ * @param cls the cls
+ * @return the t
+ */
+ public static <T> T newInstance(Class<T> cls) {
+ try {
+ return cls.newInstance();
+ } catch (InstantiationException e0) {
+ throw new RuntimeException(e0);
+ } catch (IllegalAccessException e0) {
+ throw new RuntimeException(e0);
+ }
+ }
+
+ /**
+ * Gets resources path.
+ *
+ * @param resourceName the resource name
+ * @return the resources path
+ */
+ public static String getResourcesPath(String resourceName) {
+ URL resourceUrl = CommonMethods.class.getClassLoader().getResource(resourceName);
+ String resourcePath = resourceUrl.getPath();
+ String dirPath = resourcePath.substring(0, resourcePath.lastIndexOf("/") + 1);
+
+ return dirPath;
+ }
+
+ /**
+ * Gets stack trace.
+ *
+ * @param t0 the t 0
+ * @return the stack trace
+ */
+ public static String getStackTrace(Throwable t0) {
+ if (null == t0) {
+ return "";
+ }
+ StringWriter sw = new StringWriter();
+ t0.printStackTrace(new PrintWriter(sw));
+ return sw.toString();
+ }
+
+ /**
+ * Print stack trace string.
+ *
+ * @return the string
+ */
+ public static String printStackTrace() {
+
+ StringWriter sw = new StringWriter();
+ StackTraceElement[] trace = Thread.currentThread().getStackTrace();
+ for (StackTraceElement traceElement : trace) {
+ sw.write("\t " + traceElement);
+ sw.write(System.lineSeparator());
+ }
+ String str = sw.toString();
+ try {
+ sw.close();
+ } catch (IOException e0) {
+ System.err.println(e0);
+ }
+ return str;
+
+ }
+
+ /**
+ * Is equal object boolean.
+ *
+ * @param obj1 the obj 1
+ * @param obj2 the obj 2
+ * @return the boolean
+ */
+ public static boolean isEqualObject(Object obj1, Object obj2) {
+ boolean isEqualValue = false;
+ if (obj1 == null && obj2 == null) {
+ isEqualValue = true;
+ }
+
+ if (!isEqualValue && obj1 != null && obj2 != null && obj1.equals(obj2)) {
+ isEqualValue = true;
+ }
+ return isEqualValue;
+ }
+
+ /**
+ * Converts array of strings to comma-separated string.
+ *
+ * @param arr array of strings
+ * @return the string
+ */
+ public static String arrayToCommaSeparatedString(String[] arr) {
+ return arrayToSeparatedString(arr, ',');
+ }
+
+ /**
+ * Collection to comma separated string string.
+ *
+ * @param elementCollection the element collection
+ * @return the string
+ */
+ public static String collectionToCommaSeparatedString(Collection<String> elementCollection) {
+ List<String> list = new ArrayList<>();
+ elementCollection.stream().forEach(element -> list.add(element));
+ return listToSeparatedString(list, ',');
+ }
+
+ /**
+ * Converts array of strings to string separated with specified character.
+ *
+ * @param arr array of strings
+ * @param separator the separator
+ * @return the string
+ */
+ public static String arrayToSeparatedString(String[] arr, char separator) {
+ return listToSeparatedString(Arrays.asList(arr), separator);
+ }
+
+ /**
+ * Converts array of strings to string separated with specified character.
+ *
+ * @param list array of strings
+ * @param separator the separator
+ * @return the string
+ */
+ public static String listToSeparatedString(List<String> list, char separator) {
+ String res = null;
+ if (null != list) {
+ StringBuilder sb = new StringBuilder();
+ int sz = list.size();
+ for (int i = 0; i < sz; i++) {
+ if (i > 0) {
+ sb.append(separator);
+ }
+ sb.append(list.get(i));
+ }
+ res = sb.toString();
+ }
+ return res;
+ }
+
+ /**
+ * Duplicate string with delimiter string.
+ *
+ * @param arg the arg
+ * @param separator the separator
+ * @param numberOfDuplications the number of duplications
+ * @return the string
+ */
+ public static String duplicateStringWithDelimiter(String arg, char separator,
+ int numberOfDuplications) {
+ String res = null;
+ StringBuilder sb = new StringBuilder();
+
+ for (int i = 0; i < numberOfDuplications; i++) {
+ if (i > 0) {
+ sb.append(separator);
+ }
+ sb.append(arg);
+ }
+ res = sb.toString();
+ return res;
+ }
+
+ /**
+ * Bytes to hex string.
+ *
+ * @param bytes the bytes
+ * @return the string
+ */
+ public static String bytesToHex(byte[] bytes) {
+ char[] hexChars = new char[bytes.length * 2];
+ for (int j = 0; j < bytes.length; j++) {
+ int v0 = bytes[j] & 0xFF;
+ int x0 = j << 1;
+ hexChars[x0] = hexArray[v0 >>> 4];
+ hexChars[x0 + 1] = hexArray[v0 & 0x0F];
+ }
+ return new String(hexChars);
+ }
+
+ /**
+ * To single element set set.
+ *
+ * @param <T> the class of the objects in the set
+ * @param element the single element to be contained in the returned Set
+ * @return an immutable set containing only the specified object.The returned set is serializable.
+ */
+ public static <T> Set<T> toSingleElementSet(T element) {
+ return Collections.singleton(element);
+
+ }
+
+
+}
+
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/file/FileContentHandler.java b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/file/FileContentHandler.java
new file mode 100644
index 0000000000..67a79875d4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/file/FileContentHandler.java
@@ -0,0 +1,88 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.utilities.file;
+
+import org.apache.commons.collections4.MapUtils;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+public class FileContentHandler {
+ private Map<String, byte[]> files = new HashMap<>();
+
+ /**
+ * Gets file content.
+ *
+ * @param fileName the file name
+ * @return the file content
+ */
+ public InputStream getFileContent(String fileName) {
+
+ byte[] content = files.get(fileName);
+ if (content == null || content.length == 0) {
+ return null;
+ }
+
+ ByteArrayInputStream is = new ByteArrayInputStream(content);
+ return is;
+ }
+
+ public void addFile(String fileName, byte[] contect) {
+ files.put(fileName, contect);
+ }
+
+ public void addFile(String fileName, InputStream is) {
+
+ files.put(fileName, FileUtils.toByteArray(is));
+ }
+
+ public void setFiles(FileContentHandler extFiles) {
+ extFiles.getFileList().stream()
+ .forEach(fileName -> this.addFile(fileName, extFiles.getFileContent(fileName)));
+ }
+
+ public Set<String> getFileList() {
+ return files.keySet();
+ }
+
+ public void putAll(Map<String, byte[]> files) {
+ this.files = files;
+ }
+
+ public void addAll(FileContentHandler other) {
+ this.files.putAll(other.files);
+ }
+
+ public boolean isEmpty() {
+ return MapUtils.isEmpty(this.files);
+ }
+
+ public void remove(String fileName) {
+ files.remove(fileName);
+ }
+
+ public boolean containsFile(String fileName) {
+ return files.containsKey(fileName);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/file/FileUtils.java b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/file/FileUtils.java
new file mode 100644
index 0000000000..72fa9ac7b8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/file/FileUtils.java
@@ -0,0 +1,286 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.utilities.file;
+
+import org.openecomp.core.utilities.json.JsonUtil;
+import org.openecomp.core.utilities.yaml.YamlUtil;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+
+/**
+ * The type File utils.
+ */
+public class FileUtils {
+
+ /**
+ * Gets file input stream.
+ *
+ * @param fileName the file name
+ * @return the file input stream
+ */
+ public static InputStream getFileInputStream(String fileName) {
+ URL urlFile = FileUtils.class.getClassLoader().getResource(fileName);
+ InputStream is;
+ try {
+ assert urlFile != null;
+ is = urlFile.openStream();
+ } catch (IOException exception) {
+ throw new RuntimeException(exception);
+ }
+ return is;
+ }
+
+ /**
+ * Gets file input streams.
+ *
+ * @param fileName the file name
+ * @return the file input streams
+ */
+ public static List<InputStream> getFileInputStreams(String fileName) {
+ Enumeration<URL> urlFiles;
+ List<InputStream> streams = new ArrayList<>();
+ InputStream is;
+ URL url;
+ try {
+ urlFiles = FileUtils.class.getClassLoader().getResources(fileName);
+ while (urlFiles.hasMoreElements()) {
+ url = urlFiles.nextElement();
+ is = url.openStream();
+ streams.add(is);
+ }
+
+
+ } catch (IOException exception) {
+ throw new RuntimeException(exception);
+ }
+ return streams;
+ }
+
+ /**
+ * Convert to bytes byte [ ].
+ *
+ * @param object the object
+ * @param extension the extension
+ * @return the byte [ ]
+ */
+ public static byte[] convertToBytes(Object object, FileExtension extension) {
+ if (object != null) {
+ if (extension.equals(FileExtension.YAML) || extension.equals(FileExtension.YML)) {
+ return new YamlUtil().objectToYaml(object).getBytes();
+ } else {
+ return JsonUtil.object2Json(object).getBytes();
+ }
+ } else {
+ return new byte[]{};
+ }
+ }
+
+ /**
+ * Convert to input stream input stream.
+ *
+ * @param object the object
+ * @param extension the extension
+ * @return the input stream
+ */
+ public static InputStream convertToInputStream(Object object, FileExtension extension) {
+ if (object != null) {
+
+ byte[] content;
+
+ if (extension.equals(FileExtension.YAML) || extension.equals(FileExtension.YML)) {
+ content = new YamlUtil().objectToYaml(object).getBytes();
+ } else {
+ content = JsonUtil.object2Json(object).getBytes();
+
+ }
+ return new ByteArrayInputStream(content);
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Load file to input stream input stream.
+ *
+ * @param fileName the file name
+ * @return the input stream
+ */
+ public static InputStream loadFileToInputStream(String fileName) {
+ URL urlFile = FileUtils.class.getClassLoader().getResource(fileName);
+ try {
+ Enumeration<URL> en = FileUtils.class.getClassLoader().getResources(fileName);
+ while (en.hasMoreElements()) {
+ urlFile = en.nextElement();
+ }
+ } catch (IOException | NullPointerException exception) {
+ throw new RuntimeException(exception);
+ }
+ try {
+ if (urlFile != null) {
+ return urlFile.openStream();
+ } else {
+ throw new RuntimeException();
+ }
+ } catch (IOException | NullPointerException exception) {
+ throw new RuntimeException(exception);
+ }
+
+ }
+
+ /**
+ * To byte array byte [ ].
+ *
+ * @param input the input
+ * @return the byte [ ]
+ */
+ public static byte[] toByteArray(InputStream input) {
+ ByteArrayOutputStream output = new ByteArrayOutputStream();
+ try {
+ copy(input, output);
+ } catch (IOException exception) {
+ throw new RuntimeException(
+ "error will convertion input stream to byte array:" + exception.getMessage());
+ }
+ return output.toByteArray();
+ }
+
+ /**
+ * Copy int.
+ *
+ * @param input the input
+ * @param output the output
+ * @return the int
+ * @throws IOException the io exception
+ */
+ public static int copy(InputStream input, OutputStream output) throws IOException {
+ long count = copyLarge(input, output);
+ return count > 2147483647L ? -1 : (int) count;
+ }
+
+ private static long copyLarge(InputStream input, OutputStream output) throws IOException {
+ return copyLarge(input, output, new byte[4096]);
+ }
+
+ private static long copyLarge(InputStream input, OutputStream output, byte[] buffer)
+ throws IOException {
+ long count = 0L;
+
+ int n1;
+ if (input == null) {
+ return count;
+ }
+ for (; -1 != (n1 = input.read(buffer)); count += (long) n1) {
+ output.write(buffer, 0, n1);
+ }
+
+ return count;
+
+
+ }
+
+ /**
+ * Gets file without extention.
+ *
+ * @param fileName the file name
+ * @return the file without extention
+ */
+ public static String getFileWithoutExtention(String fileName) {
+ if (!fileName.contains(".")) {
+ return fileName;
+ }
+ return fileName.substring(0, fileName.lastIndexOf("."));
+ }
+
+ /**
+ * Gets file content map from zip.
+ *
+ * @param zipData the zip data
+ * @return the file content map from zip
+ * @throws IOException the io exception
+ */
+ public static FileContentHandler getFileContentMapFromZip(byte[] zipData) throws IOException {
+ ZipEntry zipEntry;
+ FileContentHandler mapFileContent = new FileContentHandler();
+ try {
+ ZipInputStream inputZipStream;
+
+ byte[] fileByteContent;
+ String currentEntryName;
+ inputZipStream = new ZipInputStream(new ByteArrayInputStream(zipData));
+
+ while ((zipEntry = inputZipStream.getNextEntry()) != null) {
+ currentEntryName = zipEntry.getName();
+ fileByteContent = FileUtils.toByteArray(inputZipStream);
+ mapFileContent.addFile(currentEntryName, fileByteContent);
+ }
+
+ } catch (RuntimeException exception) {
+ throw new IOException(exception);
+ }
+ return mapFileContent;
+ }
+
+ /**
+ * The enum File extension.
+ */
+ public enum FileExtension {
+
+ /**
+ * Json file extension.
+ */
+ JSON("json"),
+ /**
+ * Yaml file extension.
+ */
+ YAML("yaml"),
+ /**
+ * Yml file extension.
+ */
+ YML("yml");
+
+ private String displayName;
+
+ FileExtension(String displayName) {
+ this.displayName = displayName;
+ }
+
+ /**
+ * Gets display name.
+ *
+ * @return the display name
+ */
+ public String getDisplayName() {
+ return displayName;
+ }
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/json/JsonSchemaDataGenerator.java b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/json/JsonSchemaDataGenerator.java
new file mode 100644
index 0000000000..8968eeb323
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/json/JsonSchemaDataGenerator.java
@@ -0,0 +1,185 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.utilities.json;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * The type Json schema data generator.
+ */
+public class JsonSchemaDataGenerator {
+
+ private static final String ROOT = "root";
+ private static final Logger logger = LoggerFactory.getLogger(JsonSchemaDataGenerator.class);
+ /**
+ * The Include defaults.
+ */
+ boolean includeDefaults = true;
+ private JSONObject root;
+ private Map<String, Object> referencesData;
+
+ /**
+ * Instantiates a new Json schema data generator.
+ *
+ * @param jsonSchema the json schema
+ */
+ public JsonSchemaDataGenerator(String jsonSchema) {
+ if (jsonSchema == null) {
+ throw new IllegalArgumentException("Input string jsonSchema can not be null");
+ }
+ root = new JSONObject(jsonSchema);
+ }
+
+ /**
+ * Sets include defaults.
+ *
+ * @param includeDefaults the include defaults
+ */
+ public void setIncludeDefaults(boolean includeDefaults) {
+ this.includeDefaults = includeDefaults;
+ }
+
+ /**
+ * Generates json data that conform to the schema according to turned on flags.
+ *
+ * @return json that conform to the schema.
+ */
+ public String generateData() {
+ referencesData = new HashMap<>();
+ JSONObject data = new JSONObject();
+
+ generateData(ROOT, root,
+ data); // "root" is dummy name to represent the top level object (which, as apposed to
+ // inner objects, doesn't have a name in the schema)
+ return data.has(ROOT) ? data.get(ROOT).toString() : data.toString();
+ }
+
+ private void generateData(String propertyName, JSONObject property, JSONObject propertyData) {
+ if (property.has(JsonSchemaKeyword.TYPE)) {
+ String propertyType = property.getString(JsonSchemaKeyword.TYPE);
+ if (JsonSchemaKeyword.OBJECT.equals(propertyType)) {
+ generateObjectData(propertyName, property, propertyData);
+ } else {
+ generatePrimitiveData(propertyType, propertyName, property, propertyData);
+ }
+ } else if (property.has(JsonSchemaKeyword.REF)) {
+ generateReferenceData(propertyName, property.getString(JsonSchemaKeyword.REF), propertyData);
+ }
+ }
+
+ private void generateObjectData(String propertyName, JSONObject property,
+ JSONObject propertyData) {
+ JSONObject subProperties = property.getJSONObject(JsonSchemaKeyword.PROPERTIES);
+
+ JSONObject subPropertiesData = new JSONObject();
+ for (String subPropertyName : subProperties.keySet()) {
+ generateData(subPropertyName, subProperties.getJSONObject(subPropertyName),
+ subPropertiesData);
+ }
+
+ if (subPropertiesData.length() > 0) {
+ propertyData.put(propertyName, subPropertiesData);
+ }
+ }
+
+ private void generateReferenceData(String propertyName, String referencePath,
+ JSONObject propertyData) {
+ if (referencesData.containsKey(referencePath)) {
+ Object referenceData = referencesData.get(referencePath);
+ if (referenceData != null) {
+ propertyData.put(propertyName, referenceData);
+ }
+ } else {
+ generateData(propertyName, resolveReference(referencePath), propertyData);
+ referencesData.put(referencePath, propertyData.opt(propertyName));
+ }
+ }
+
+ private JSONObject resolveReference(String referencePath) {
+ String[] keys = referencePath.replaceFirst("#/", "").split("/");
+
+ JSONObject reference = root;
+ for (String key : keys) {
+ reference = reference.getJSONObject(key);
+ }
+ return reference;
+ }
+
+ private void generatePrimitiveData(String propertyType, String propertyName, JSONObject property,
+ JSONObject propertyData) {
+ if (includeDefaults) {
+ populateWithDefaultValue(propertyType, propertyName, property, propertyData);
+ }
+ }
+
+ private void populateWithDefaultValue(String propertyType, String propertyName,
+ JSONObject property, JSONObject propertyData) {
+ if (!property.has(JsonSchemaKeyword.DEFAULT)) {
+ return;
+ }
+ try {
+ switch (propertyType) {
+ case JsonSchemaKeyword.ARRAY:
+ propertyData.put(propertyName, property.getJSONArray(JsonSchemaKeyword.DEFAULT));
+ break;
+ case JsonSchemaKeyword.BOOLEAN:
+ propertyData.put(propertyName, property.getBoolean(JsonSchemaKeyword.DEFAULT));
+ break;
+ case JsonSchemaKeyword.INTEGER:
+ propertyData.put(propertyName, property.getInt(JsonSchemaKeyword.DEFAULT));
+ break;
+ case JsonSchemaKeyword.NUMBER:
+ propertyData.put(propertyName, property.getDouble(JsonSchemaKeyword.DEFAULT));
+ break;
+ case JsonSchemaKeyword.STRING:
+ propertyData.put(propertyName, property.getString(JsonSchemaKeyword.DEFAULT));
+ break;
+ default:
+ break;
+ }
+ } catch (JSONException e0) {
+ Object defaultValue = property.get(JsonSchemaKeyword.DEFAULT);
+ logger.error(String.format(
+ "Invalid schema: '%s' property type is '%s' but it has a default value which is not: %s.",
+ propertyName, propertyType, defaultValue), e0);
+ throw e0;
+ }
+ }
+
+ private static class JsonSchemaKeyword {
+ private static final String DEFAULT = "default";
+ private static final String TYPE = "type";
+ private static final String PROPERTIES = "properties";
+ private static final String ARRAY = "array";
+ private static final String BOOLEAN = "boolean";
+ private static final String INTEGER = "integer";
+ private static final String NUMBER = "number";
+ private static final String STRING = "string";
+ private static final String OBJECT = "object";
+ private static final String REF = "$ref";
+ }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/json/JsonUtil.java b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/json/JsonUtil.java
new file mode 100644
index 0000000000..6ae3677a8d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/json/JsonUtil.java
@@ -0,0 +1,187 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.utilities.json;
+
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.gson.JsonIOException;
+import com.google.gson.JsonParser;
+import com.google.gson.JsonSyntaxException;
+
+import org.apache.commons.collections.CollectionUtils;
+import org.everit.json.schema.EnumSchema;
+import org.everit.json.schema.Schema;
+import org.everit.json.schema.ValidationException;
+import org.everit.json.schema.loader.SchemaLoader;
+import org.json.JSONObject;
+import org.openecomp.core.utilities.CommonMethods;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.io.StringReader;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+/**
+ * The type Json util.
+ */
+public class JsonUtil {
+
+ /**
+ * Object 2 json string.
+ *
+ * @param obj the obj
+ * @return the string
+ */
+ //TODO: refactor all other ugly code to use this
+ public static String object2Json(Object obj) {
+ return sbObject2Json(obj).toString();
+
+ }
+
+ /**
+ * Sb object 2 json string buffer.
+ *
+ * @param obj the obj
+ * @return the string buffer
+ */
+ public static StringBuffer sbObject2Json(Object obj) {
+ return new StringBuffer((new GsonBuilder()).setPrettyPrinting().create().toJson(obj));
+ }
+
+ /**
+ * Json 2 object t.
+ *
+ * @param <T> the type parameter
+ * @param json the json
+ * @param classOfT the class of t
+ * @return the t
+ */
+ public static <T> T json2Object(String json, Class<T> classOfT) {
+ T type;
+ try {
+ try (Reader br = new StringReader(json)) {
+ type = new Gson().fromJson(br, classOfT);
+ } catch (IOException e0) {
+ throw e0;
+ }
+ } catch (JsonIOException | JsonSyntaxException | IOException e0) {
+ throw new RuntimeException(e0);
+ }
+ return type;
+ }
+
+ /**
+ * Json 2 object t.
+ *
+ * @param <T> the type parameter
+ * @param is the is
+ * @param classOfT the class of t
+ * @return the t
+ */
+ public static <T> T json2Object(InputStream is, Class<T> classOfT) {
+ T type;
+ try {
+ try (Reader br = new BufferedReader(new InputStreamReader(is))) {
+ type = new Gson().fromJson(br, classOfT);
+ }
+ } catch (JsonIOException | JsonSyntaxException | IOException e0) {
+ throw new RuntimeException(e0);
+ } finally {
+ if (is != null) {
+ try {
+ is.close();
+ } catch (IOException ignore) {
+ //do nothing
+ }
+ }
+ }
+ return type;
+ }
+
+
+ /**
+ * Is valid json boolean.
+ *
+ * @param json the json
+ * @return the boolean
+ */
+ //todo check https://github.com/stleary/JSON-java as replacement for this code
+ public static boolean isValidJson(String json) {
+ try {
+ return new JsonParser().parse(json).isJsonObject();
+ } catch (JsonSyntaxException jse) {
+ return false;
+ }
+ }
+
+ /**
+ * Validate list.
+ *
+ * @param json the json
+ * @param jsonSchema the json schema
+ * @return the list
+ */
+ public static List<String> validate(String json, String jsonSchema) {
+ List<ValidationException> validationErrors = validateUsingEverit(json, jsonSchema);
+ return validationErrors == null ? null
+ : validationErrors.stream().map(JsonUtil::mapValidationExceptionToMessage)
+ .collect(Collectors.toList());
+ }
+
+ private static String mapValidationExceptionToMessage(ValidationException e0) {
+ if (e0.getViolatedSchema() instanceof EnumSchema) {
+ return mapEnumViolationToMessage(e0);
+ }
+ return e0.getMessage();
+ }
+
+ private static String mapEnumViolationToMessage(ValidationException e1) {
+ Set<Object> possibleValues = ((EnumSchema) e1.getViolatedSchema()).getPossibleValues();
+ return e1.getMessage().replaceFirst("enum value", possibleValues.size() == 1
+ ? String.format("value. %s is the only possible value for this field",
+ possibleValues.iterator().next())
+ : String.format("value. Possible values: %s", CommonMethods
+ .collectionToCommaSeparatedString(
+ possibleValues.stream().map(Object::toString).collect(Collectors.toList()))));
+ }
+
+ private static List<ValidationException> validateUsingEverit(String json, String jsonSchema) {
+ if (json == null || jsonSchema == null) {
+ throw new IllegalArgumentException("Input strings json and jsonSchema can not be null");
+ }
+
+ Schema schemaObj = SchemaLoader.load(new JSONObject(jsonSchema));
+ try {
+ schemaObj.validate(new JSONObject(json));
+ } catch (ValidationException ve) {
+ return CollectionUtils.isEmpty(ve.getCausingExceptions()) ? Collections.singletonList(ve)
+ : ve.getCausingExceptions();
+ }
+ return null;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/yaml/YamlUtil.java b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/yaml/YamlUtil.java
new file mode 100644
index 0000000000..56261f08de
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/yaml/YamlUtil.java
@@ -0,0 +1,289 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.utilities.yaml;
+
+import org.openecomp.core.utilities.CommonMethods;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.yaml.snakeyaml.DumperOptions;
+import org.yaml.snakeyaml.TypeDescription;
+import org.yaml.snakeyaml.Yaml;
+import org.yaml.snakeyaml.constructor.Constructor;
+import org.yaml.snakeyaml.introspector.BeanAccess;
+import org.yaml.snakeyaml.introspector.Property;
+import org.yaml.snakeyaml.introspector.PropertyUtils;
+import org.yaml.snakeyaml.nodes.MappingNode;
+import org.yaml.snakeyaml.nodes.NodeTuple;
+import org.yaml.snakeyaml.nodes.Tag;
+import org.yaml.snakeyaml.parser.ParserException;
+import org.yaml.snakeyaml.representer.Representer;
+
+import java.beans.IntrospectionException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.AbstractMap;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * The type Yaml util.
+ */
+public class YamlUtil {
+
+ private static Logger logger = LoggerFactory.getLogger(YamlUtil.class);
+
+ /**
+ * Yaml to object t.
+ *
+ * @param <T> the type parameter
+ * @param yamlContent the yaml content
+ * @param typClass the typ class
+ * @return the t
+ */
+ public <T> T yamlToObject(String yamlContent, Class<T> typClass) {
+ Constructor constructor = getConstructor(typClass);
+ constructor.setPropertyUtils(getPropertyUtils());
+ TypeDescription yamlFileDescription = new TypeDescription(typClass);
+ constructor.addTypeDescription(yamlFileDescription);
+ Yaml yaml = new Yaml(constructor);
+ T yamlObj = (T) yaml.load(yamlContent);
+ yamlObj.toString();
+ return yamlObj;
+ }
+
+ /**
+ * Yaml to object t.
+ *
+ * @param <T> the type parameter
+ * @param yamlContent the yaml content
+ * @param typClass the typ class
+ * @return the t
+ */
+ public <T> T yamlToObject(InputStream yamlContent, Class<T> typClass) {
+ try {
+ Constructor constructor = getConstructor(typClass);
+ constructor.setPropertyUtils(getPropertyUtils());
+ TypeDescription yamlFileDescription = new TypeDescription(typClass);
+ constructor.addTypeDescription(yamlFileDescription);
+ Yaml yaml = new Yaml(constructor);
+ T yamlObj = (T) yaml.load(yamlContent);
+ if (yamlObj != null) {
+ yamlObj.toString();
+ return yamlObj;
+ } else {
+ throw new RuntimeException();
+ }
+ } catch (Exception exception) {
+ logger.error("Error will trying to convert yaml to object:" + exception.getMessage());
+ throw new RuntimeException(exception);
+ } finally {
+ try {
+ if (yamlContent != null) {
+ yamlContent.close();
+ }
+ } catch (IOException ignore) {
+ //nothing to dd
+ }
+ }
+ }
+
+
+ /**
+ * Gets constructor.
+ *
+ * @param <T> the type parameter
+ * @param typClass the typ class
+ * @return the constructor
+ */
+ public <T> Constructor getConstructor(Class<T> typClass) {
+ return new StrictMapAppenderConstructor(typClass);
+ }
+
+ /**
+ * Gets property utils.
+ *
+ * @return the property utils
+ */
+ protected PropertyUtils getPropertyUtils() {
+ return new MyPropertyUtils();
+ }
+
+ /**
+ * Yaml to map map.
+ *
+ * @param yamlContent the yaml content
+ * @return the map
+ */
+ public Map<String, LinkedHashMap<String, Object>> yamlToMap(InputStream yamlContent) {
+ Yaml yaml = new Yaml();
+ Map<String, LinkedHashMap<String, Object>> yamlData =
+ (Map<String, LinkedHashMap<String, Object>>) yaml.load(yamlContent);
+ return yamlData;
+ }
+
+ /**
+ * Object to yaml string.
+ *
+ * @param <T> the type parameter
+ * @param obj the obj
+ * @return the string
+ */
+ public <T> String objectToYaml(Object obj) {
+ DumperOptions options = new DumperOptions();
+ options.setPrettyFlow(true);
+ options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
+ Representer representer = new CustomRepresenter();
+ representer.addClassTag(obj.getClass(), Tag.MAP);
+ representer.setPropertyUtils(new MyPropertyUtils());
+
+ Yaml yaml = new Yaml(representer, options);
+ return yaml.dump(obj);
+ }
+
+ /**
+ * Load yaml file is input stream.
+ *
+ * @param yamlFullFileName the yaml full file name
+ * @return the input stream
+ */
+ public InputStream loadYamlFileIs(String yamlFullFileName) {
+ return CommonMethods.class.getResourceAsStream(yamlFullFileName);
+ }
+
+ /**
+ * Is yaml file content valid boolean.
+ *
+ * @param yamlFullFileName the yaml full file name
+ * @return the boolean
+ */
+ public boolean isYamlFileContentValid(String yamlFullFileName) {
+ Yaml yaml = new Yaml();
+ try {
+ Object loadResult = yaml.load(yamlFullFileName);
+ if (loadResult == null) {
+ return false;
+ }
+ return true;
+ } catch (Exception exception) {
+ return false;
+ }
+ }
+
+
+ private class CustomRepresenter extends Representer {
+ @Override
+ protected NodeTuple representJavaBeanProperty(Object javaBean, Property property,
+ Object propertyValue, Tag customTag) {
+ if (propertyValue == null) {
+ return null;
+ } else {
+ NodeTuple defaultNode =
+ super.representJavaBeanProperty(javaBean, property, propertyValue, customTag);
+
+ return property.getName().equals("_default")
+ ? new NodeTuple(representData("default"), defaultNode.getValueNode())
+ : defaultNode;
+ }
+ }
+
+ @Override
+ protected MappingNode representJavaBean(Set<Property> properties, Object javaBean) {
+ //remove the bean type from the output yaml (!! ...)
+ if (!classTags.containsKey(javaBean.getClass())) {
+ addClassTag(javaBean.getClass(), Tag.MAP);
+ }
+
+ return super.representJavaBean(properties, javaBean);
+ }
+ }
+
+
+ /**
+ * The type My property utils.
+ */
+ public class MyPropertyUtils extends PropertyUtils {
+ @Override
+ public Property getProperty(Class<?> type, String name) throws IntrospectionException {
+ if (name.equals("default")) {
+ name = "_default";
+ }
+ return super.getProperty(type, name);
+ }
+
+ //Unsorted properties
+ @Override
+ protected Set<Property> createPropertySet(Class<? extends Object> type, BeanAccess beanAccess)
+ throws IntrospectionException {
+ return new LinkedHashSet<Property>(getPropertiesMap(type,
+ BeanAccess.FIELD).values());
+ }
+
+ }
+
+ /**
+ * The type Strict map appender constructor.
+ */
+ protected class StrictMapAppenderConstructor extends Constructor {
+
+ /**
+ * Instantiates a new Strict map appender constructor.
+ *
+ * @param theRoot the the root
+ */
+ public StrictMapAppenderConstructor(Class<?> theRoot) {
+ super(theRoot);
+ }
+
+ @Override
+ protected Map<Object, Object> constructMapping(MappingNode node) {
+ try {
+ return super.constructMapping(node);
+ } catch (IllegalStateException exception) {
+ throw new ParserException("while parsing MappingNode", node.getStartMark(),
+ exception.getMessage(), node.getEndMark());
+ }
+ }
+
+ @Override
+ protected Map<Object, Object> createDefaultMap() {
+ final Map<Object, Object> delegate = super.createDefaultMap();
+ return new AbstractMap<Object, Object>() {
+ @Override
+ public Object put(Object key, Object value) {
+ if (delegate.containsKey(key)) {
+ throw new IllegalStateException("duplicate key: " + key);
+ }
+ return delegate.put(key, value);
+ }
+
+ @Override
+ public Set<Entry<Object, Object>> entrySet() {
+ return delegate.entrySet();
+ }
+ };
+ }
+ }
+}
+
+
+
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/java/org/openecomp/core/utilities/json/JsonSchemaDataGeneratorTest.java b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/java/org/openecomp/core/utilities/json/JsonSchemaDataGeneratorTest.java
new file mode 100644
index 0000000000..83c87737d2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/java/org/openecomp/core/utilities/json/JsonSchemaDataGeneratorTest.java
@@ -0,0 +1,50 @@
+package org.openecomp.core.utilities.json;
+
+import org.openecomp.core.utilities.file.FileUtils;
+import org.json.JSONException;
+import org.json.JSONObject;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+public class JsonSchemaDataGeneratorTest {
+
+ public static final String SCHEMA_WITHOUT_DEFAULTS = new String(
+ FileUtils.toByteArray(FileUtils.getFileInputStream("jsonUtil/json_schema/aSchema.json")));
+ public static final String SCHEMA_WITH_REFS_AND_DEFAULTS = new String(FileUtils.toByteArray(
+ FileUtils.getFileInputStream("jsonUtil/json_schema/schemaWithRefsAndDefaults.json")));
+ public static final String SCHEMA_WITH_INVALID_DEFAULT = new String(FileUtils.toByteArray(
+ FileUtils.getFileInputStream("jsonUtil/json_schema/schemaWithInvalidDefault.json")));
+ public static final String SCHEMA_NIC = new String(
+ FileUtils.toByteArray(FileUtils.getFileInputStream("jsonUtil/json_schema/nicSchema.json")));
+
+ @Test
+ public void testSchemaWithoutDefaults() {
+ testGenerate(SCHEMA_WITHOUT_DEFAULTS, new JSONObject());
+ }
+
+ @Test
+ public void testSchemaWithRefsAndDefaults() {
+ testGenerate(SCHEMA_WITH_REFS_AND_DEFAULTS,
+ new JSONObject(
+ "{\"cityOfBirth\":\"Tel Aviv\",\"address\":{\"city\":\"Tel Aviv\"},\"phoneNumber\":[{\"code\":1,\"location\":\"Home\"},{\"code\":2,\"location\":\"Office\"}]}"));
+ }
+
+ @Test(expectedExceptions = JSONException.class)
+ public void testSchemaWithInvalidDefault() {
+ testGenerate(SCHEMA_WITH_INVALID_DEFAULT, null);
+ }
+
+ @Test
+ public void testNicQuestionnaireSchema() {
+ testGenerate(SCHEMA_NIC,
+ new JSONObject("{\"ipConfiguration\":{\"ipv4Required\":true,\"ipv6Required\":false}}"));
+ }
+
+ private void testGenerate(String schema, JSONObject expectedData) {
+ JsonSchemaDataGenerator jsonSchemaDataGenerator = new JsonSchemaDataGenerator(schema);
+ String data = jsonSchemaDataGenerator.generateData();
+ System.out.println(data);
+ JSONObject dataJson = new JSONObject(data);
+ Assert.assertTrue(expectedData.similar(dataJson));
+ }
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/java/org/openecomp/core/utilities/json/JsonUtilTest.java b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/java/org/openecomp/core/utilities/json/JsonUtilTest.java
new file mode 100644
index 0000000000..e232f72f38
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/java/org/openecomp/core/utilities/json/JsonUtilTest.java
@@ -0,0 +1,40 @@
+package org.openecomp.core.utilities.json;
+
+
+import org.openecomp.core.utilities.file.FileUtils;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+import java.util.List;
+
+public class JsonUtilTest {
+
+ @Test
+ public void testValidJsonValidate() throws Exception {
+ String json =
+ new String(FileUtils.toByteArray(FileUtils.getFileInputStream("jsonUtil/json/a.json")));
+ String jsonSchema = new String(
+ FileUtils.toByteArray(FileUtils.getFileInputStream("jsonUtil/json_schema/aSchema.json")));
+
+ List<String> validationErrors = JsonUtil.validate(json, jsonSchema);
+ Assert.assertNull(validationErrors);
+ }
+
+ @Test
+ public void testInValidJsonValidate() throws Exception {
+ String json = new String(
+ FileUtils.toByteArray(FileUtils.getFileInputStream("jsonUtil/json/a_invalid.json")));
+ String jsonSchema = new String(
+ FileUtils.toByteArray(FileUtils.getFileInputStream("jsonUtil/json_schema/aSchema.json")));
+
+ List<String> validationErrors = JsonUtil.validate(json, jsonSchema);
+ Assert.assertNotNull(validationErrors);
+ Assert.assertEquals(validationErrors.size(), 3);
+ Assert.assertEquals(validationErrors.get(0),
+ "#/cityOfBirth: Paris is not a valid value. Possible values: New York,Tel Aviv,London");
+ Assert.assertEquals(validationErrors.get(1),
+ "#/address: {\"streetAddress\":\"21 2nd Street\",\"city\":\"Paris\"} is not a valid value. {\"streetAddress\":\"21 2nd Street\",\"city\":\"New York\"} is the only possible value for this field");
+ Assert.assertEquals(validationErrors.get(2),
+ "#/phoneNumber/0/code: expected type: Number, found: String");
+ }
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json/a.json b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json/a.json
new file mode 100644
index 0000000000..a3320d5fc7
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json/a.json
@@ -0,0 +1,12 @@
+{
+ "address": {
+ "streetAddress": "21 2nd Street",
+ "city": "New York"
+ },
+ "phoneNumber": [
+ {
+ "location": "home",
+ "code": 44
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json/a_invalid.json b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json/a_invalid.json
new file mode 100644
index 0000000000..8a02522ea9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json/a_invalid.json
@@ -0,0 +1,13 @@
+{
+ "address": {
+ "streetAddress": "21 2nd Street",
+ "city": "Paris"
+ },
+ "phoneNumber": [
+ {
+ "location": "home",
+ "code": "test"
+ }
+ ],
+ "cityOfBirth": "Paris"
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json_schema/aSchema.json b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json_schema/aSchema.json
new file mode 100644
index 0000000000..a77e38df87
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json_schema/aSchema.json
@@ -0,0 +1,60 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type": "object",
+ "definitions": {
+ "city": {
+ "type": "string",
+ "enum": [
+ "Tel Aviv",
+ "New York",
+ "London"
+ ]
+ }
+ },
+ "properties": {
+ "address": {
+ "type": "object",
+ "properties": {
+ "streetAddress": {
+ "type": "string"
+ },
+ "city": {
+ "$ref": "#/definitions/city"
+ }
+ },
+ "enum": [
+ {
+ "streetAddress": "21 2nd Street",
+ "city": "New York"
+ }
+ ],
+ "required": [
+ "streetAddress",
+ "city"
+ ]
+ },
+ "phoneNumber": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "location": {
+ "type": "string"
+ },
+ "code": {
+ "type": "integer"
+ }
+ },
+ "required": [
+ "location",
+ "code"
+ ]
+ }
+ },
+ "cityOfBirth" : { "$ref" : "#/definitions/city"}
+ },
+ "required": [
+ "address",
+ "phoneNumber"
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json_schema/nicSchema.json b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json_schema/nicSchema.json
new file mode 100644
index 0000000000..d96de6aa31
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json_schema/nicSchema.json
@@ -0,0 +1,118 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type": "object",
+ "properties": {
+ "protocols": {
+ "type": "object",
+ "properties": {
+ "protocols": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "TCP",
+ "UDP",
+ "SCTP",
+ "IPsec"
+ ]
+ },
+ "minItems": 1
+ },
+ "protocolWithHighestTrafficProfile": {
+ "$ref": "#/properties/protocols/properties/protocols/items"
+ }
+ },
+ "additionalProperties": false
+ },
+ "ipConfiguration": {
+ "type": "object",
+ "properties": {
+ "ipv4Required": {
+ "type": "boolean",
+ "default": true
+ },
+ "ipv6Required": {
+ "type": "boolean",
+ "default": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "network": {
+ "type": "object",
+ "properties": {
+ "networkDescription": {
+ "type": "string",
+ "pattern": "[A-Za-z]+",
+ "maxLength": 300
+ }
+ },
+ "additionalProperties": false
+ },
+ "sizing": {
+ "type": "object",
+ "definitions": {
+ "peakAndAvg": {
+ "type": "object",
+ "properties": {
+ "peak": {
+ "type": "number"
+ },
+ "avg": {
+ "type": "number"
+ }
+ },
+ "additionalProperties": false
+ },
+ "packetsAndBytes": {
+ "type": "object",
+ "properties": {
+ "packets": {
+ "$ref": "#/properties/sizing/definitions/peakAndAvg"
+ },
+ "bytes": {
+ "$ref": "#/properties/sizing/definitions/peakAndAvg"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "properties": {
+ "describeQualityOfService": {
+ "type": "string"
+ },
+ "inflowTrafficPerSecond": {
+ "$ref": "#/properties/sizing/definitions/packetsAndBytes"
+ },
+ "outflowTrafficPerSecond": {
+ "$ref": "#/properties/sizing/definitions/packetsAndBytes"
+ },
+ "flowLength": {
+ "$ref": "#/properties/sizing/definitions/packetsAndBytes"
+ },
+ "acceptableJitter": {
+ "type": "object",
+ "properties": {
+ "mean": {
+ "type": "number"
+ },
+ "max": {
+ "type": "number"
+ },
+ "variable": {
+ "type": "number"
+ }
+ },
+ "additionalProperties": false
+ },
+ "acceptablePacketLoss": {
+ "type": "number",
+ "minimum": 0,
+ "maximum": 100
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json_schema/schemaWithInvalidDefault.json b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json_schema/schemaWithInvalidDefault.json
new file mode 100644
index 0000000000..100d17f48e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json_schema/schemaWithInvalidDefault.json
@@ -0,0 +1,67 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "definitions": {
+ "city": {
+ "type": "string",
+ "enum": [
+ "Tel Aviv",
+ "New York",
+ "London"
+ ],
+ "default": "Tel Aviv"
+ }
+ },
+ "type": "object",
+ "properties": {
+ "address": {
+ "type": "object",
+ "properties": {
+ "streetAddress": {
+ "type": "string",
+ "default" : 7
+ },
+ "city": {
+ "$ref": "#/definitions/city"
+ }
+ },
+ "required": [
+ "streetAddress",
+ "city"
+ ]
+ },
+ "phoneNumber": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "location": {
+ "type": "string"
+ },
+ "code": {
+ "type": "integer",
+ "default": 777
+ }
+ },
+ "required": [
+ "location",
+ "code"
+ ]
+ },
+ "default": [
+ {
+ "location": "Home",
+ "code": 1
+ },
+ {
+ "location": "Office",
+ "code": 2
+ }
+ ]
+ },
+ "cityOfBirth" : { "$ref" : "#/definitions/city"}
+ },
+ "required": [
+ "address",
+ "phoneNumber"
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json_schema/schemaWithRefsAndDefaults.json b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json_schema/schemaWithRefsAndDefaults.json
new file mode 100644
index 0000000000..de027b9d56
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json_schema/schemaWithRefsAndDefaults.json
@@ -0,0 +1,71 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "definitions": {
+ "city": {
+ "type": "string",
+ "enum": [
+ "Tel Aviv",
+ "New York",
+ "London"
+ ],
+ "default": "Tel Aviv"
+ },
+ "zipCode" : {
+ "type" : "integer"
+ }
+ },
+ "type": "object",
+ "properties": {
+ "address": {
+ "type": "object",
+ "properties": {
+ "streetAddress": {
+ "type": "string"
+ },
+ "city": {
+ "$ref": "#/definitions/city"
+ },
+ "cityZipCode" : {"$ref" : "#/definitions/zipCode"}
+ },
+ "required": [
+ "streetAddress",
+ "city"
+ ]
+ },
+ "phoneNumber": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "location": {
+ "type": "string"
+ },
+ "locationZipCode" : {"$ref" : "#/definitions/zipCode"},
+ "code": {
+ "type": "integer",
+ "default": 777
+ }
+ },
+ "required": [
+ "location",
+ "code"
+ ]
+ },
+ "default": [
+ {
+ "location": "Home",
+ "code": 1
+ },
+ {
+ "location": "Office",
+ "code": 2
+ }
+ ]
+ },
+ "cityOfBirth" : { "$ref" : "#/definitions/city"}
+ },
+ "required": [
+ "address",
+ "phoneNumber"
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-core-lib/pom.xml b/openecomp-be/lib/openecomp-core-lib/pom.xml
new file mode 100644
index 0000000000..312b085424
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/pom.xml
@@ -0,0 +1,23 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <artifactId>openecomp-sdc-lib</artifactId>
+ <groupId>org.openecomp.sdc</groupId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-core-lib</artifactId>
+ <name>openecomp-core-lib</name>
+
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>/openecomp-facade-lib</module>
+ <module>/openecomp-nosqldb-lib</module>
+ <module>/openecomp-utilities-lib</module>
+ <module>/openecomp-config-lib</module>
+ </modules>
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-heat-lib/pom.xml b/openecomp-be/lib/openecomp-heat-lib/pom.xml
new file mode 100644
index 0000000000..47c7c728a0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-heat-lib/pom.xml
@@ -0,0 +1,59 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+
+ <parent>
+ <artifactId>openecomp-sdc-lib</artifactId>
+ <groupId>org.openecomp.sdc</groupId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>openecomp-heat-lib</artifactId>
+ <groupId>org.openecomp.core</groupId>
+ <name>openecomp-heat-lib</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.yaml</groupId>
+ <artifactId>snakeyaml</artifactId>
+ <version>1.17</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-utilities-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-datatypes-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-common-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <version>1.1.2</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>RELEASE</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-validation-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+
+
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/DefinedHeatParameterTypes.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/DefinedHeatParameterTypes.java
new file mode 100644
index 0000000000..62364e7a11
--- /dev/null
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/DefinedHeatParameterTypes.java
@@ -0,0 +1,110 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.heat.datatypes;
+
+import org.apache.commons.lang.math.NumberUtils;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+public enum DefinedHeatParameterTypes {
+ NUMBER("number"),
+ STRING("string"),
+ COMMA_DELIMITED_LIST("comma_delimited_list"),
+ JSON("json"),
+ BOOLEAN("boolean");
+ // TODO : ASK SEGEV ABOUT STRING
+
+ private static Map<String, DefinedHeatParameterTypes> stringToDefinedType = new HashMap<>();
+
+ static {
+ stringToDefinedType = new HashMap<>();
+ for (DefinedHeatParameterTypes definedHeatParameterType : DefinedHeatParameterTypes.values()) {
+ stringToDefinedType.put(definedHeatParameterType.type, definedHeatParameterType);
+ }
+ }
+
+ private String type;
+
+ DefinedHeatParameterTypes(String type) {
+ this.type = type;
+ }
+
+ public static DefinedHeatParameterTypes findByHeatResource(String type) {
+ return stringToDefinedType.get(type);
+ }
+
+ /**
+ * Is value is from given type boolean.
+ *
+ * @param value the value
+ * @param parameterType the parameter type
+ * @return the boolean
+ */
+ public static boolean isValueIsFromGivenType(Object value, String parameterType) {
+ DefinedHeatParameterTypes definedType = findByHeatResource(parameterType);
+
+ if (Objects.nonNull(definedType)) {
+ switch (definedType) {
+ case NUMBER:
+ return NumberUtils.isNumber(String.valueOf(value));
+
+ case BOOLEAN:
+ return HeatBoolean.isValueBoolean(value);
+
+ case COMMA_DELIMITED_LIST:
+ String valAsString = String.valueOf(value);
+ return valAsString.split(",") instanceof String[];
+
+ case JSON:
+ return (value instanceof Map) || (value instanceof List);
+
+ case STRING:
+ //return value instanceof String;
+ return true;
+
+ default:
+ // return false;
+ }
+ }
+
+ return false;
+ }
+
+ public static boolean isNovaServerEnvValueIsFromRightType(Object value) {
+ return isValueIsFromGivenType(value, COMMA_DELIMITED_LIST.getType())
+ || isValueIsFromGivenType(value, STRING.getType());
+ }
+
+ public static boolean isEmptyValueInEnv(Object value) {
+ return Objects.isNull(value);
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/HeatBoolean.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/HeatBoolean.java
new file mode 100644
index 0000000000..249dcaf4a5
--- /dev/null
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/HeatBoolean.java
@@ -0,0 +1,96 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.heat.datatypes;
+
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+import org.openecomp.sdc.heat.services.ErrorCodes;
+
+import java.util.HashSet;
+import java.util.Set;
+
+public class HeatBoolean {
+
+ private static Set<Object> heatFalse;
+ private static Set<Object> heatTrue;
+
+ static {
+
+
+ heatFalse = new HashSet<>();
+ heatFalse.add("f");
+ heatFalse.add(false);
+ heatFalse.add("false");
+ heatFalse.add("off");
+ heatFalse.add("n");
+ heatFalse.add("no");
+ heatFalse.add(0);
+
+ heatTrue = new HashSet<>();
+ heatTrue.add("t");
+ heatTrue.add(true);
+ heatTrue.add("true");
+ heatTrue.add("on");
+ heatTrue.add("y");
+ heatTrue.add("yes");
+ heatTrue.add(1);
+
+ }
+
+ /**
+ * Eval boolean.
+ *
+ * @param value the value
+ * @return the boolean
+ */
+ public static Boolean eval(Object value) {
+
+ if (value instanceof String) {
+ value = (String) ((String) value).toLowerCase();
+ }
+ if (heatFalse.contains(value)) {
+ return false;
+ } else if (heatTrue.contains(value)) {
+ return true;
+ } else {
+ throw new CoreException((new ErrorCode.ErrorCodeBuilder()).withId(ErrorCodes.INVALID_BOOLEAN)
+ .withCategory(ErrorCategory.APPLICATION)
+ .withMessage("Invalid boolean value [" + value + "].").build());
+ }
+
+ }
+
+ /**
+ * Is value boolean boolean.
+ *
+ * @param value the value
+ * @return the boolean
+ */
+ public static boolean isValueBoolean(Object value) {
+ try {
+ Boolean answer = eval(value);
+ return true;
+ } catch (CoreException ce) {
+ return false;
+ }
+ }
+}
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/FileData.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/FileData.java
new file mode 100644
index 0000000000..728b714868
--- /dev/null
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/FileData.java
@@ -0,0 +1,107 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.heat.datatypes.manifest;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.function.Predicate;
+
+public class FileData {
+
+ public static Set<Type> heatFileTypes =
+ new HashSet<>(Arrays.asList(Type.HEAT, Type.HEAT_NET, Type.HEAT_VOL));
+ private Boolean isBase;
+ private String file;
+ private Type type;
+ private List<FileData> data;
+
+ public static Predicate<FileData> buildFileDataPredicateByType(Type... types) {
+ return fileData -> Arrays.asList(types).contains(fileData.getType());
+ }
+
+ public static boolean isHeatFile(Type type) {
+ return heatFileTypes.contains(type);
+ }
+
+ public Boolean getBase() {
+ return isBase;
+ }
+
+ public void setBase(Boolean base) {
+ isBase = base;
+ }
+
+ public String getFile() {
+ return file;
+ }
+
+ public void setFile(String file) {
+ this.file = file;
+ }
+
+ public Type getType() {
+ return type;
+ }
+
+ public void setType(Type type) {
+ this.type = type;
+ }
+
+ public List<FileData> getData() {
+ return data;
+ }
+
+ public void setData(List<FileData> data) {
+ this.data = data;
+ }
+
+ public enum Type {
+
+ HEAT("HEAT"),
+ HEAT_ENV("HEAT_ENV"),
+ HEAT_NET("HEAT_NET"),
+ HEAT_VOL("HEAT_VOL"),
+ CHEF("CHEF"),
+ PUPPET("PUPPET"),
+ SHELL("SHELL"),
+ YANG("YANG"),
+ YANG_XML("YANG_XML"),
+ BPEL("BPEL"),
+ DG_XML("DG_XML"),
+ MURANO_PKG("MURANO_PKG"),
+ VENDOR_LICENSE("VENDOR_LICENSE"),
+ VF_LICENSE("VF_LICENSE"),
+ OTHER("OTHER");
+
+ private String displayName;
+
+ Type(String displayName) {
+ this.displayName = displayName;
+ }
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+ }
+}
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/ManifestContent.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/ManifestContent.java
new file mode 100644
index 0000000000..d89717125a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/ManifestContent.java
@@ -0,0 +1,63 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.heat.datatypes.manifest;
+
+import java.util.List;
+
+public class ManifestContent {
+
+ String name;
+ String description;
+ String version;
+ List<FileData> data;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ public List<FileData> getData() {
+ return data;
+ }
+
+ public void setData(List<FileData> data) {
+ this.data = data;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/ManifestFile.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/ManifestFile.java
new file mode 100644
index 0000000000..607f52a86d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/ManifestFile.java
@@ -0,0 +1,43 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.heat.datatypes.manifest;
+
+public class ManifestFile {
+
+ String name;
+ ManifestContent content;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public ManifestContent getContent() {
+ return content;
+ }
+
+ public void setContent(ManifestContent content) {
+ this.content = content;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Constraint.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Constraint.java
new file mode 100644
index 0000000000..8aad825055
--- /dev/null
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Constraint.java
@@ -0,0 +1,78 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.heat.datatypes.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class Constraint {
+ private Object[] length;
+ private Integer[] range;
+ private List<Object> valid_values;
+ private String pattern;
+
+ public Constraint() {
+ }
+
+ public Integer[] getRange() {
+ return range;
+ }
+
+ public void setRange(Integer[] inRange) {
+ this.range = new Integer[]{inRange[0], inRange[1]};
+ }
+
+ public List<Object> getValid_values() {
+ return valid_values;
+ }
+
+ public void setValid_values(List<Object> validValues) {
+ this.valid_values = validValues;
+ }
+
+ /**
+ * Add valid value.
+ *
+ * @param validValue the valid value
+ */
+ public void addValidValue(Object validValue) {
+ if (this.valid_values == null) {
+ this.valid_values = new ArrayList<>();
+ }
+ valid_values.add(validValue);
+ }
+
+ public Object[] getLength() {
+ return length;
+ }
+
+ public void setLength(Object[] length) {
+ this.length = length;
+ }
+
+ public String getPattern() {
+ return pattern;
+ }
+
+ public void setPattern(String pattern) {
+ this.pattern = pattern;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Environment.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Environment.java
new file mode 100644
index 0000000000..b2f45d06d9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Environment.java
@@ -0,0 +1,35 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.heat.datatypes.model;
+
+import java.util.Map;
+
+public class Environment {
+ Map<String, Object> parameters;
+
+ public Map<String, Object> getParameters() {
+ return parameters;
+ }
+
+ public void setParameters(Map<String, Object> parameters) {
+ this.parameters = parameters;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/GroupTypeValues.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/GroupTypeValues.java
new file mode 100644
index 0000000000..84259b1807
--- /dev/null
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/GroupTypeValues.java
@@ -0,0 +1,49 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.heat.datatypes.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public enum GroupTypeValues {
+ EXCLUSIVITY("exclusivity"),
+ AFFINITY("affinity"),
+ DIVERSITY("diversity");
+
+ private static List<String> groupTypeAsStrings;
+
+ static {
+ groupTypeAsStrings = new ArrayList<>();
+ for (GroupTypeValues attGroupTypeValue : GroupTypeValues.values()) {
+ groupTypeAsStrings.add(attGroupTypeValue.groupTypeValue);
+ }
+ }
+
+ private String groupTypeValue;
+
+ GroupTypeValues(String groupTypeValue) {
+ this.groupTypeValue = groupTypeValue;
+ }
+
+ public static boolean isGroupTypeValid(String groupType) {
+ return groupTypeAsStrings.contains(groupType);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/HeatOrchestrationTemplate.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/HeatOrchestrationTemplate.java
new file mode 100644
index 0000000000..4170d35d7a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/HeatOrchestrationTemplate.java
@@ -0,0 +1,90 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.heat.datatypes.model;
+
+import java.util.List;
+import java.util.Map;
+
+public class HeatOrchestrationTemplate {
+ String heat_template_version;
+ String description;
+ List<ParameterGroup> parameter_groups;
+ Map<String, Parameter> parameters;
+ Map<String, Resource> resources;
+ Map<String, Output> outputs;
+ Map<String, Object> conditions;
+
+ public String getHeat_template_version() {
+ return heat_template_version;
+ }
+
+ public void setHeat_template_version(String heatTemplateVersion) {
+ this.heat_template_version = heatTemplateVersion;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public List<ParameterGroup> getParameter_groups() {
+ return parameter_groups;
+ }
+
+ public void setParameter_groups(List<ParameterGroup> parameterGroups) {
+ this.parameter_groups = parameterGroups;
+ }
+
+ public Map<String, Parameter> getParameters() {
+ return parameters;
+ }
+
+ public void setParameters(Map<String, Parameter> parameters) {
+ this.parameters = parameters;
+ }
+
+ public Map<String, Resource> getResources() {
+ return resources;
+ }
+
+ public void setResources(Map<String, Resource> resources) {
+ this.resources = resources;
+ }
+
+ public Map<String, Output> getOutputs() {
+ return outputs;
+ }
+
+ public void setOutputs(Map<String, Output> outputs) {
+ this.outputs = outputs;
+ }
+
+ public Map<String, Object> getConditions() {
+ return conditions;
+ }
+
+ public void setConditions(Map<String, Object> conditions) {
+ this.conditions = conditions;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/HeatPseudoParameters.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/HeatPseudoParameters.java
new file mode 100644
index 0000000000..c822a78a93
--- /dev/null
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/HeatPseudoParameters.java
@@ -0,0 +1,61 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.heat.datatypes.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public enum HeatPseudoParameters {
+ OS_STACK_NAME("OS::stack_name"),
+ OS_STACK_ID("OS::stack_id"),
+ OS_PROJECT_ID("OS::project_id");
+
+ private static List<String> pseudoParameterNames;
+
+ static {
+ pseudoParameterNames = new ArrayList<>();
+ for (HeatPseudoParameters parameter : HeatPseudoParameters.values()) {
+ pseudoParameterNames.add(parameter.getPseudoParameter());
+ }
+ }
+
+ private String pseudoParameter;
+
+ HeatPseudoParameters(String pseudoParameter) {
+ this.pseudoParameter = pseudoParameter;
+ }
+
+ public static List<String> getPseudoParameterNames() {
+ return pseudoParameterNames;
+ }
+
+ public static void setPseudoParameterNames(List<String> pseudoParameterNames) {
+ HeatPseudoParameters.pseudoParameterNames = pseudoParameterNames;
+ }
+
+ public String getPseudoParameter() {
+ return pseudoParameter;
+ }
+
+ public void setPseudoParameter(String pseudoParameter) {
+ this.pseudoParameter = pseudoParameter;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/HeatResourcesTypes.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/HeatResourcesTypes.java
new file mode 100644
index 0000000000..d4adfe7d32
--- /dev/null
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/HeatResourcesTypes.java
@@ -0,0 +1,206 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.heat.datatypes.model;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+/**
+ * The enum Heat resources types.
+ */
+public enum HeatResourcesTypes {
+ /**
+ * Nova server resource type heat resources types.
+ */
+ NOVA_SERVER_RESOURCE_TYPE("OS::Nova::Server"),
+ /**
+ * Nova server group resource type heat resources types.
+ */
+ NOVA_SERVER_GROUP_RESOURCE_TYPE("OS::Nova::ServerGroup"),
+ /**
+ * Neutron port resource type heat resources types.
+ */
+ NEUTRON_PORT_RESOURCE_TYPE("OS::Neutron::Port"),
+ /**
+ * Contrail network rule resource type heat resources types.
+ */
+ CONTRAIL_NETWORK_RULE_RESOURCE_TYPE("OS::Contrail::NetworkPolicy"),
+ /**
+ * Contrail network attach rule resource type heat resources types.
+ */
+ CONTRAIL_NETWORK_ATTACH_RULE_RESOURCE_TYPE("OS::Contrail::AttachPolicy"),
+ /**
+ * Contrail virtual network resource type heat resources types.
+ */
+ CONTRAIL_VIRTUAL_NETWORK_RESOURCE_TYPE("OS::Contrail::VirtualNetwork"),
+ /**
+ * Cinder volume resource type heat resources types.
+ */
+ CINDER_VOLUME_RESOURCE_TYPE("OS::Cinder::Volume"),
+ /**
+ * Cinder volume attachment resource type heat resources types.
+ */
+ CINDER_VOLUME_ATTACHMENT_RESOURCE_TYPE("OS::Cinder::VolumeAttachment"),
+ /**
+ * Neutron net resource type heat resources types.
+ */
+ NEUTRON_NET_RESOURCE_TYPE("OS::Neutron::Net"),
+ /**
+ * Neutron subnet resource type heat resources types.
+ */
+ NEUTRON_SUBNET_RESOURCE_TYPE("OS::Neutron::Subnet"),
+ /**
+ * Neutron security group resource type heat resources types.
+ */
+ NEUTRON_SECURITY_GROUP_RESOURCE_TYPE("OS::Neutron::SecurityGroup"),
+ /**
+ * Heat software config type heat resources types.
+ */
+ HEAT_SOFTWARE_CONFIG_TYPE("OS::Heat::SoftwareConfig"),
+ /**
+ * Heat cloud config type heat resources types.
+ */
+ HEAT_CLOUD_CONFIG_TYPE("OS::Heat::CloudConfig"),
+ /**
+ * Heat multipart mime type heat resources types.
+ */
+ HEAT_MULTIPART_MIME_TYPE("OS::Heat::MultipartMime"),
+ /**
+ * Heat contrail network ipam type heat resources types.
+ */
+ HEAT_CONTRAIL_NETWORK_IPAM_TYPE("OS::Contrail::NetworkIpam"),
+ /**
+ * Contrail v 2 virtual network resource type heat resources types.
+ */
+ CONTRAIL_V2_VIRTUAL_NETWORK_RESOURCE_TYPE("OS::ContrailV2::VirtualNetwork"),
+ /**
+ * Contrail v 2 virtual machine interface resource type heat resources types.
+ */
+ CONTRAIL_V2_VIRTUAL_MACHINE_INTERFACE_RESOURCE_TYPE("OS::ContrailV2::VirtualMachineInterface"),
+ /**
+ * Contrail service template heat resources types.
+ */
+ CONTRAIL_SERVICE_TEMPLATE("OS::Contrail::ServiceTemplate"),
+ /**
+ * Contrail service instance heat resources types.
+ */
+ CONTRAIL_SERVICE_INSTANCE("OS::Contrail::ServiceInstance"),
+ /**
+ * Contrail v 2 network rule resource type heat resources types.
+ */
+ CONTRAIL_V2_NETWORK_RULE_RESOURCE_TYPE("OS::ContrailV2::NetworkPolicy"),
+ /**
+ * Resource group resource type heat resources types.
+ */
+ RESOURCE_GROUP_RESOURCE_TYPE("OS::Heat::ResourceGroup");
+
+ private static Map<String, HeatResourcesTypes> stringToHeatResourceTypeMap;
+
+ static {
+ stringToHeatResourceTypeMap = new HashMap<>();
+
+ for (HeatResourcesTypes type : HeatResourcesTypes.values()) {
+ stringToHeatResourceTypeMap.put(type.heatResource, type);
+ }
+ }
+
+ private String heatResource;
+
+
+ HeatResourcesTypes(String heatResource) {
+ this.heatResource = heatResource;
+ }
+
+ /**
+ * Find by heat resource heat resources types.
+ *
+ * @param heatResource the heat resource
+ * @return the heat resources types
+ */
+ public static HeatResourcesTypes findByHeatResource(String heatResource) {
+ return stringToHeatResourceTypeMap.get(heatResource);
+ }
+
+ /**
+ * Is resource type valid boolean.
+ *
+ * @param resourceType the resource type
+ * @return the boolean
+ */
+ public static boolean isResourceTypeValid(String resourceType) {
+ return Objects.nonNull(findByHeatResource(resourceType));
+ }
+
+ /**
+ * Is resource expected to be exposed boolean.
+ *
+ * @param resourceType the resource type
+ * @return the boolean
+ */
+ public static boolean isResourceExpectedToBeExposed(String resourceType) {
+ return (resourceType.equals(NOVA_SERVER_GROUP_RESOURCE_TYPE.getHeatResource())
+ || resourceType.equals(CONTRAIL_VIRTUAL_NETWORK_RESOURCE_TYPE.getHeatResource())
+ || resourceType.equals(NEUTRON_NET_RESOURCE_TYPE.getHeatResource())
+ || resourceType.equals(CINDER_VOLUME_RESOURCE_TYPE.getHeatResource())
+ || resourceType.equals(NEUTRON_SECURITY_GROUP_RESOURCE_TYPE.getHeatResource())
+ );
+ }
+
+ /**
+ * Gets list for resource type.
+ *
+ * @param types the types
+ * @return the list for resource type
+ */
+ public static Map<HeatResourcesTypes, List<String>> getListForResourceType(
+ HeatResourcesTypes... types) {
+ Map<HeatResourcesTypes, List<String>> result = new HashMap<>();
+
+ for (HeatResourcesTypes type : types) {
+ result.put(type, new ArrayList<>());
+ }
+
+ return result;
+ }
+
+ /**
+ * Gets heat resource.
+ *
+ * @return the heat resource
+ */
+ public String getHeatResource() {
+
+ return heatResource;
+ }
+
+ /**
+ * Sets heat resource.
+ *
+ * @param heatResource the heat resource
+ */
+ public void setHeatResource(String heatResource) {
+ this.heatResource = heatResource;
+ }
+
+}
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Output.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Output.java
new file mode 100644
index 0000000000..8222edded2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Output.java
@@ -0,0 +1,42 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.heat.datatypes.model;
+
+public class Output {
+ String description;
+ Object value;
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public Object getValue() {
+ return value;
+ }
+
+ public void setValue(Object value) {
+ this.value = value;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Parameter.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Parameter.java
new file mode 100644
index 0000000000..63681cc80c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Parameter.java
@@ -0,0 +1,90 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.heat.datatypes.model;
+
+import java.util.List;
+import java.util.Map;
+
+public class Parameter {
+ String type;
+ String label;
+ String description;
+ Object _default;
+ boolean hidden;
+ List<Map<String, Object>> constraints;
+ boolean immutable;
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getLabel() {
+ return label;
+ }
+
+ public void setLabel(String label) {
+ this.label = label;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public Object get_default() {
+ return _default;
+ }
+
+ public void set_default(Object defaultValue) {
+ this._default = defaultValue;
+ }
+
+ public boolean isHidden() {
+ return hidden;
+ }
+
+ public void setHidden(boolean hidden) {
+ this.hidden = hidden;
+ }
+
+ public List<Map<String, Object>> getConstraints() {
+ return constraints;
+ }
+
+ public void setConstraints(List<Map<String, Object>> constraints) {
+ this.constraints = constraints;
+ }
+
+ public boolean isImmutable() {
+ return immutable;
+ }
+
+ public void setImmutable(boolean immutable) {
+ this.immutable = immutable;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/ParameterGroup.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/ParameterGroup.java
new file mode 100644
index 0000000000..8ab066f4a4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/ParameterGroup.java
@@ -0,0 +1,53 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.heat.datatypes.model;
+
+import java.util.List;
+
+public class ParameterGroup {
+ String label;
+ String description;
+ List<String> parameters;
+
+ public String getLabel() {
+ return label;
+ }
+
+ public void setLabel(String label) {
+ this.label = label;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public List<String> getParameters() {
+ return parameters;
+ }
+
+ public void setParameters(List<String> parameters) {
+ this.parameters = parameters;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/ParameterType.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/ParameterType.java
new file mode 100644
index 0000000000..37c430ec36
--- /dev/null
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/ParameterType.java
@@ -0,0 +1,42 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.heat.datatypes.model;
+
+public enum ParameterType {
+
+ STRING("string"),
+ NUMBER("number"),
+ JSON("json"),
+ BOOLEAN("boolean"),
+ COMMA_DELIMITED_LIST("comma_delimited_list");
+
+ private String displayName;
+
+ ParameterType(String displayName) {
+ this.displayName = displayName;
+ }
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/PolicyTypes.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/PolicyTypes.java
new file mode 100644
index 0000000000..3195e61fe5
--- /dev/null
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/PolicyTypes.java
@@ -0,0 +1,61 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.heat.datatypes.model;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+public enum PolicyTypes {
+ AFFINITY("affinity"),
+ ANTI_AFFINITY("anti-affinity");
+
+ private static Map<String, PolicyTypes> stringToPolicyTypesMap;
+
+ static {
+ stringToPolicyTypesMap = new HashMap<>();
+ for (PolicyTypes type : PolicyTypes.values()) {
+ stringToPolicyTypesMap.put(type.policy, type);
+ }
+ }
+
+ private String policy;
+
+ PolicyTypes(String policy) {
+ this.policy = policy;
+ }
+
+ public static PolicyTypes findByPolicy(String policy) {
+ return stringToPolicyTypesMap.get(policy);
+ }
+
+ public static boolean isGivenPolicyValid(String policyToCheck) {
+ return Objects.nonNull(findByPolicy(policyToCheck));
+ }
+
+ public String getPolicy() {
+ return policy;
+ }
+
+ public void setPolicy(String policy) {
+ this.policy = policy;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/PropertiesMapKeyTypes.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/PropertiesMapKeyTypes.java
new file mode 100644
index 0000000000..e8d43fc10c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/PropertiesMapKeyTypes.java
@@ -0,0 +1,42 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.heat.datatypes.model;
+
+public enum PropertiesMapKeyTypes {
+ IMAGE("image"),
+ FLAVOR("flavor"),
+ NETWORKS("networks"),
+ RESOURCE_DEF("resource_def");
+
+ private String keyMap;
+
+ PropertiesMapKeyTypes(String keyMap) {
+ this.keyMap = keyMap;
+ }
+
+ public String getKeyMap() {
+ return keyMap;
+ }
+
+ public void setKeyMap(String keyMap) {
+ this.keyMap = keyMap;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Resource.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Resource.java
new file mode 100644
index 0000000000..f4c3cd91cb
--- /dev/null
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Resource.java
@@ -0,0 +1,92 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.heat.datatypes.model;
+
+import java.util.Map;
+
+public class Resource {
+ String type;
+ Map<String, Object> properties;
+ Object metadata;
+ Object depends_on;
+ Object update_policy;
+ Object deletion_policy;
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public Map<String, Object> getProperties() {
+ return properties;
+ }
+
+ public void setProperties(Map<String, Object> properties) {
+ this.properties = properties;
+ }
+
+ public Object getMetadata() {
+ return metadata;
+ }
+
+ public void setMetadata(Object metadata) {
+ this.metadata = metadata;
+ }
+
+ public Object getDepends_on() {
+ return depends_on;
+ }
+
+ public void setDepends_on(Object dependsOn) {
+ this.depends_on = dependsOn;
+ }
+
+ public Object getUpdate_policy() {
+ return update_policy;
+ }
+
+ public void setUpdate_policy(Object updatePolicy) {
+ this.update_policy = updatePolicy;
+ }
+
+ public Object getDeletion_policy() {
+ return deletion_policy;
+ }
+
+ public void setDeletion_policy(Object deletionPolicy) {
+ this.deletion_policy = deletionPolicy;
+ }
+
+ @Override
+ public String toString() {
+ return "Resource{"
+ + "type='" + type + '\''
+ + ", properties=" + properties
+ + ", metadata=" + metadata
+ + ", depends_on=" + depends_on
+ + ", update_policy='" + update_policy + '\''
+ + ", deletion_policy='" + deletion_policy + '\''
+ + '}';
+ }
+}
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/ResourceReferenceFunctions.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/ResourceReferenceFunctions.java
new file mode 100644
index 0000000000..b36d130597
--- /dev/null
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/ResourceReferenceFunctions.java
@@ -0,0 +1,44 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.heat.datatypes.model;
+
+public enum ResourceReferenceFunctions {
+ GET_RESOURCE("get_resource"),
+ GET_PARAM("get_param"),
+ GET_ATTR("get_attr"),
+ GET_FILE("get_file"),
+ SCHEDULER_HINTS("scheduler_hints");
+
+
+ private String function;
+
+ ResourceReferenceFunctions(String function) {
+ this.function = function;
+ }
+
+ public String getFunction() {
+ return function;
+ }
+
+ public void setFunction(String function) {
+ this.function = function;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/ResourceTypeToMessageString.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/ResourceTypeToMessageString.java
new file mode 100644
index 0000000000..d7ede70942
--- /dev/null
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/ResourceTypeToMessageString.java
@@ -0,0 +1,55 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.heat.datatypes.model;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public enum ResourceTypeToMessageString {
+ SERVER_GROUP(HeatResourcesTypes.NOVA_SERVER_GROUP_RESOURCE_TYPE, "ServerGroup"),
+ SECURITY_GROUP(HeatResourcesTypes.NEUTRON_SECURITY_GROUP_RESOURCE_TYPE, "SecurityGroup"),
+ NETWORK_POLICY(HeatResourcesTypes.CONTRAIL_NETWORK_RULE_RESOURCE_TYPE, "NetworkPolicy");
+
+ private static Map<HeatResourcesTypes, String> resourcesTypesStringMap;
+
+ static {
+ resourcesTypesStringMap = new HashMap<>();
+
+ for (ResourceTypeToMessageString resourceTypeToMessageString : ResourceTypeToMessageString
+ .values()) {
+ resourcesTypesStringMap
+ .put(resourceTypeToMessageString.type, resourceTypeToMessageString.messageString);
+ }
+ }
+
+ private String messageString;
+ private HeatResourcesTypes type;
+
+
+ ResourceTypeToMessageString(HeatResourcesTypes type, String messgageString) {
+ this.type = type;
+ this.messageString = messgageString;
+ }
+
+ public static String getTypeForMessageFromResourceType(HeatResourcesTypes type) {
+ return resourcesTypesStringMap.get(type);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/structure/Artifact.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/structure/Artifact.java
new file mode 100644
index 0000000000..b5c263f545
--- /dev/null
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/structure/Artifact.java
@@ -0,0 +1,105 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.heat.datatypes.structure;
+
+
+import org.openecomp.sdc.datatypes.error.ErrorMessage;
+import org.openecomp.sdc.heat.datatypes.manifest.FileData;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class Artifact implements Comparable<Artifact> {
+
+ private String fileName;
+ private FileData.Type type;
+ private List<ErrorMessage> errors;
+
+ public Artifact(String fileName, FileData.Type type) {
+ this.fileName = fileName;
+ this.type = type;
+ }
+
+
+ public String getFileName() {
+ return fileName;
+ }
+
+ public void setFileName(String name) {
+ this.fileName = name;
+ }
+
+
+ public FileData.Type getType() {
+ return type;
+ }
+
+ public List<ErrorMessage> getErrors() {
+ return errors;
+ }
+
+ public void setErrors(List<ErrorMessage> errors) {
+ this.errors = errors;
+ }
+
+ /**
+ * Add error to error list.
+ *
+ * @param error the error
+ */
+ public void addErrorToErrorList(ErrorMessage error) {
+ if (this.errors == null || this.errors.isEmpty()) {
+ this.errors = new ArrayList<>();
+ }
+
+ this.errors.add(error);
+ }
+
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null || getClass() != obj.getClass()) {
+ return false;
+ }
+
+ Artifact artifact = (Artifact) obj;
+
+ if (!fileName.equals(artifact.fileName)) {
+ return false;
+ }
+ return true;
+
+ }
+
+ @Override
+ public int hashCode() {
+ int result = fileName.hashCode();
+ return result;
+ }
+
+ @Override
+ public int compareTo(Artifact artifact) {
+ return artifact.getFileName().compareTo(this.getFileName());
+ }
+}
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/structure/HeatStructureTree.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/structure/HeatStructureTree.java
new file mode 100644
index 0000000000..c86425fd43
--- /dev/null
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/structure/HeatStructureTree.java
@@ -0,0 +1,467 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.heat.datatypes.structure;
+
+
+import org.codehaus.jackson.annotate.JsonProperty;
+import org.openecomp.sdc.datatypes.error.ErrorMessage;
+import org.openecomp.sdc.heat.datatypes.manifest.FileData;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
+
+/**
+ * The type Heat structure tree.
+ */
+public class HeatStructureTree implements Comparable<HeatStructureTree> {
+
+ private String fileName;
+ private FileData.Type type;
+ private Boolean isBase;
+ private HeatStructureTree env;
+ private List<ErrorMessage> errors;
+ private Set<HeatStructureTree> HEAT;
+ private Set<HeatStructureTree> volume;
+ private Set<HeatStructureTree> network;
+ private Set<HeatStructureTree> nested;
+ private Set<HeatStructureTree> other;
+ private Set<Artifact> artifacts;
+
+ /**
+ * Instantiates a new Heat structure tree.
+ */
+ public HeatStructureTree() {
+ }
+
+ ;
+
+ /**
+ * Instantiates a new Heat structure tree.
+ *
+ * @param fileName the file name
+ * @param isBase the is base
+ */
+ public HeatStructureTree(String fileName, boolean isBase) {
+ setBase(isBase);
+ setFileName(fileName);
+ }
+
+ /**
+ * Gets heat structure tree by name.
+ *
+ * @param filesSet the files set
+ * @param filename the filename
+ * @return the heat structure tree by name
+ */
+ public static HeatStructureTree getHeatStructureTreeByName(Set<HeatStructureTree> filesSet,
+ String filename) {
+ for (HeatStructureTree heatStructureTree : filesSet) {
+ if (heatStructureTree.getFileName().equals(filename)) {
+ return heatStructureTree;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Sets type.
+ *
+ * @param type the type
+ */
+ public void setType(FileData.Type type) {
+ this.type = type;
+ }
+
+ /**
+ * Gets base.
+ *
+ * @return the base
+ */
+ public Boolean getBase() {
+ return isBase;
+ }
+
+ /**
+ * Sets base.
+ *
+ * @param base the base
+ */
+ public void setBase(Boolean base) {
+ isBase = base;
+ }
+
+ /**
+ * Gets file name.
+ *
+ * @return the file name
+ */
+ public String getFileName() {
+ return fileName;
+ }
+
+ /**
+ * Sets file name.
+ *
+ * @param file the file
+ */
+ public void setFileName(String file) {
+ this.fileName = file;
+ }
+
+ /**
+ * Gets heat.
+ *
+ * @return the heat
+ */
+ @JsonProperty(value = "HEAT")
+ public Set<HeatStructureTree> getHEAT() {
+ return HEAT;
+ }
+
+ /**
+ * Sets heat.
+ *
+ * @param heat the heat
+ */
+ public void setHEAT(Set<HeatStructureTree> heat) {
+ this.HEAT = heat;
+ }
+
+ /**
+ * Gets nested.
+ *
+ * @return the nested
+ */
+ public Set<HeatStructureTree> getNested() {
+ return nested;
+ }
+
+ /**
+ * Sets nested.
+ *
+ * @param nested the nested
+ */
+ public void setNested(Set<HeatStructureTree> nested) {
+ this.nested = nested;
+ }
+
+ /**
+ * Gets artifacts.
+ *
+ * @return the artifacts
+ */
+ public Set<Artifact> getArtifacts() {
+ return artifacts;
+ }
+
+ /**
+ * Sets artifacts.
+ *
+ * @param artifacts the artifacts
+ */
+ public void setArtifacts(Set<Artifact> artifacts) {
+ this.artifacts = artifacts;
+ }
+
+ /**
+ * Add heat structure tree to nested heat list.
+ *
+ * @param heatStructureTree the heat structure tree
+ */
+ public void addHeatStructureTreeToNestedHeatList(HeatStructureTree heatStructureTree) {
+ if (this.nested == null) {
+ this.nested = new TreeSet<>();
+ }
+ if (!findItemInSetByName(this.nested, heatStructureTree)) {
+ this.nested.add(heatStructureTree);
+ }
+ }
+
+ /**
+ * Add artifact to artifact list.
+ *
+ * @param artifact the artifact
+ */
+ public void addArtifactToArtifactList(Artifact artifact) {
+ if (this.artifacts == null || this.artifacts.isEmpty()) {
+ this.artifacts = new TreeSet<>();
+ }
+ this.artifacts.add(artifact);
+ }
+
+ /**
+ * Gets env.
+ *
+ * @return the env
+ */
+ public HeatStructureTree getEnv() {
+ return env;
+ }
+
+ /**
+ * Sets env.
+ *
+ * @param env the env
+ */
+ public void setEnv(HeatStructureTree env) {
+ this.env = env;
+ }
+
+ /**
+ * Gets volume.
+ *
+ * @return the volume
+ */
+ public Set<HeatStructureTree> getVolume() {
+ return volume;
+ }
+
+ /**
+ * Sets volume.
+ *
+ * @param volume the volume
+ */
+ public void setVolume(Set<HeatStructureTree> volume) {
+ this.volume = volume;
+ }
+
+ /**
+ * Gets network.
+ *
+ * @return the network
+ */
+ public Set<HeatStructureTree> getNetwork() {
+ return network;
+ }
+
+ /**
+ * Sets network.
+ *
+ * @param network the network
+ */
+ public void setNetwork(Set<HeatStructureTree> network) {
+ this.network = network;
+ }
+
+ /**
+ * Add network to network list.
+ *
+ * @param heatStructureTree the heat structure tree
+ */
+ public void addNetworkToNetworkList(HeatStructureTree heatStructureTree) {
+ if (this.network == null) {
+ this.network = new TreeSet<>();
+ }
+ if (!findItemInSetByName(this.network, heatStructureTree)) {
+ this.network.add(heatStructureTree);
+ }
+ }
+
+ /**
+ * Add volume file to volume list.
+ *
+ * @param heatStructureTree the heat structure tree
+ */
+ public void addVolumeFileToVolumeList(HeatStructureTree heatStructureTree) {
+ if (this.volume == null) {
+ this.volume = new TreeSet<>();
+ }
+ if (!findItemInSetByName(this.volume, heatStructureTree)) {
+ this.volume.add(heatStructureTree);
+ }
+ }
+
+ /**
+ * Add heat to heat list.
+ *
+ * @param heat the heat
+ */
+ public void addHeatToHEATList(HeatStructureTree heat) {
+ if (this.HEAT == null) {
+ this.HEAT = new TreeSet<>();
+ }
+
+ this.HEAT.add(heat);
+ }
+
+ /**
+ * Add other to other list.
+ *
+ * @param other the other
+ */
+ public void addOtherToOtherList(HeatStructureTree other) {
+ if (this.other == null) {
+ this.other = new TreeSet<>();
+ }
+
+ this.other.add(other);
+ }
+
+ /**
+ * Find item in set by name boolean.
+ *
+ * @param searchSet the search set
+ * @param toFind the to find
+ * @return the boolean
+ */
+ public boolean findItemInSetByName(Set<HeatStructureTree> searchSet, HeatStructureTree toFind) {
+ for (HeatStructureTree heatStructureTree : searchSet) {
+ if (heatStructureTree.getFileName().equals(toFind.getFileName())) {
+ return true;
+ }
+
+ }
+
+ return false;
+ }
+
+ /**
+ * Remove from volume or network.
+ *
+ * @param fileNameToRemove the file name to remove
+ * @param type the type
+ */
+ public void removeFromVolumeOrNetwork(String fileNameToRemove, FileData.Type type) {
+ Set<HeatStructureTree> volumeOrNetworkSet =
+ type.equals(FileData.Type.HEAT_VOL) ? this.volume : this.network;
+ HeatStructureTree toRemove = getHeatStructureTreeByName(volumeOrNetworkSet, fileNameToRemove);
+
+ volumeOrNetworkSet.remove(toRemove);
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (this == other) {
+ return true;
+ }
+ if (other == null || getClass() != other.getClass()) {
+ return false;
+ }
+
+ HeatStructureTree heatStructureTree = (HeatStructureTree) other;
+
+ if (fileName != null ? !fileName.equals(heatStructureTree.fileName)
+ : heatStructureTree.fileName != null) {
+ return false;
+ }
+ if (env != null ? !env.equals(heatStructureTree.env) : heatStructureTree.env != null) {
+ return false;
+ }
+ if (HEAT != null ? !HEAT.equals(heatStructureTree.HEAT) : heatStructureTree.HEAT != null) {
+ return false;
+ }
+ if (volume != null ? !volume.equals(heatStructureTree.volume)
+ : heatStructureTree.volume != null) {
+ return false;
+ }
+ if (network != null ? !network.equals(heatStructureTree.network)
+ : heatStructureTree.network != null) {
+ return false;
+ }
+ if (artifacts != null ? !artifacts.equals(heatStructureTree.artifacts)
+ : heatStructureTree.artifacts != null) {
+ return false;
+ }
+ if (nested != null ? !nested.equals(heatStructureTree.nested)
+ : heatStructureTree.nested != null) {
+ return false;
+ }
+ if (errors != null ? !errors.equals(heatStructureTree.errors)
+ : heatStructureTree.errors != null) {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result1 = fileName != null ? fileName.hashCode() : 0;
+ result1 = 31 * result1 + (env != null ? env.hashCode() : 0);
+ result1 = 31 * result1 + (HEAT != null ? HEAT.hashCode() : 0);
+ result1 = 31 * result1 + (volume != null ? volume.hashCode() : 0);
+ result1 = 31 * result1 + (network != null ? network.hashCode() : 0);
+ result1 = 31 * result1 + (artifacts != null ? artifacts.hashCode() : 0);
+ result1 = 31 * result1 + (nested != null ? nested.hashCode() : 0);
+ result1 = 31 * result1 + (errors != null ? errors.hashCode() : 0);
+
+
+ return result1;
+ }
+
+ /**
+ * Gets errors.
+ *
+ * @return the errors
+ */
+ public List<ErrorMessage> getErrors() {
+ return errors;
+ }
+
+ /**
+ * Sets errors.
+ *
+ * @param errors the errors
+ */
+ public void setErrors(List<ErrorMessage> errors) {
+ this.errors = errors;
+ }
+
+ /**
+ * Add error to errors list.
+ *
+ * @param error the error
+ */
+ public void addErrorToErrorsList(ErrorMessage error) {
+ if (this.errors == null || this.errors.isEmpty()) {
+ this.errors = new ArrayList<>();
+ }
+ if (!this.errors.contains(error)) {
+ this.errors.add(error);
+ }
+ }
+
+ /**
+ * Gets other.
+ *
+ * @return the other
+ */
+ public Set<HeatStructureTree> getOther() {
+ return other;
+ }
+
+ /**
+ * Sets other.
+ *
+ * @param other the other
+ */
+ public void setOther(Set<HeatStructureTree> other) {
+ this.other = other;
+ }
+
+ @Override
+ public int compareTo(HeatStructureTree heatStructureTree) {
+ return heatStructureTree.getFileName().compareTo(this.getFileName());
+ }
+}
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/structure/ValidationStructureList.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/structure/ValidationStructureList.java
new file mode 100644
index 0000000000..f2acb2810d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/structure/ValidationStructureList.java
@@ -0,0 +1,40 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.heat.datatypes.structure;
+
+public class ValidationStructureList {
+ private HeatStructureTree importStructure;
+
+ public ValidationStructureList() {
+ }
+
+ public ValidationStructureList(HeatStructureTree importStructure) {
+ this.importStructure = importStructure;
+ }
+
+ public HeatStructureTree getImportStructure() {
+ return importStructure;
+ }
+
+ public void setImportStructure(HeatStructureTree importStructure) {
+ this.importStructure = importStructure;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/ErrorCodes.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/ErrorCodes.java
new file mode 100644
index 0000000000..c48d732e63
--- /dev/null
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/ErrorCodes.java
@@ -0,0 +1,25 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.heat.services;
+
+public class ErrorCodes {
+ public static final String INVALID_BOOLEAN = "INVALID_BOOLEAN";
+}
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/HeatConstants.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/HeatConstants.java
new file mode 100644
index 0000000000..e2afe89a06
--- /dev/null
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/HeatConstants.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.heat.services;
+
+public class HeatConstants {
+ public static final String GET_ATT_FROM_RESOURCE_GROUP_PREFIX = "resource.";
+ public static final String RESOURCE_GROUP_INDEX_VAR_DEFAULT_VALUE = "%index%";
+
+ public static final String INDEX_PROPERTY_NAME = "index_var";
+ public static final String SERVICE_SCALING_PROPERTY_NAME = "service_scaling";
+ public static final String INSTANCE_UUID_PROPERTY_NAME = "instance_uuid";
+ public static final String VOLUME_ID_PROPERTY_NAME = "volume_id";
+ public static final String RESOURCE_DEF_PROPERTY_NAME = "resource_def";
+ public static final String SCALE_OUT_PROPERTY_NAME = "scale_out";
+
+}
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/HeatStructureUtil.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/HeatStructureUtil.java
new file mode 100644
index 0000000000..a216b224af
--- /dev/null
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/HeatStructureUtil.java
@@ -0,0 +1,261 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.heat.services;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.MapUtils;
+import org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder;
+import org.openecomp.core.validation.errors.Messages;
+import org.openecomp.core.validation.types.GlobalValidationContext;
+import org.openecomp.sdc.datatypes.error.ErrorLevel;
+import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate;
+import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes;
+import org.openecomp.sdc.heat.datatypes.model.PropertiesMapKeyTypes;
+import org.openecomp.sdc.heat.datatypes.model.Resource;
+import org.openecomp.sdc.heat.datatypes.model.ResourceReferenceFunctions;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+
+/**
+ * The type Heat structure util.
+ */
+public class HeatStructureUtil {
+
+ /**
+ * Gets nested files.
+ *
+ * @param filename the filename
+ * @param hot the hot
+ * @param globalContext the global context
+ * @return the nested files
+ */
+ public static Set<String> getNestedFiles(String filename, HeatOrchestrationTemplate hot,
+ GlobalValidationContext globalContext) {
+
+ Set<String> nestedFileList = new HashSet<>();
+ Set<String> resourceDefNestedFiles;
+ hot.getResources().values().stream().filter(
+ resource -> (resource.getType().endsWith(".yaml") || resource.getType().endsWith(".yml")))
+ .forEach(resource -> nestedFileList.add(resource.getType()));
+
+ resourceDefNestedFiles = getResourceDefNestedFiles(filename, hot, globalContext);
+ nestedFileList.addAll(resourceDefNestedFiles);
+
+ return nestedFileList;
+ }
+
+
+ private static Set<String> getResourceDefNestedFiles(String filename,
+ HeatOrchestrationTemplate hot,
+ GlobalValidationContext globalContext) {
+ Set<String> resourceDefNestedFiles = new HashSet<>();
+ hot.getResources()
+ .entrySet()
+ .stream()
+ .filter(entry -> entry.getValue().getType()
+ .equals(HeatResourcesTypes.RESOURCE_GROUP_RESOURCE_TYPE.getHeatResource()))
+ .filter(entry ->
+ getResourceDef(filename, entry.getKey(), entry.getValue(), globalContext) != null
+ && isNestedResource(
+ getResourceDef(filename, entry.getKey(), entry.getValue(), globalContext)
+ .getType()))
+ .forEach(entry -> resourceDefNestedFiles.add(
+ getResourceDef(filename, entry.getKey(), entry.getValue(), globalContext).getType()));
+
+ return resourceDefNestedFiles;
+ }
+
+
+ /**
+ * Gets resource def.
+ *
+ * @param filename the filename
+ * @param resourceName the resource name
+ * @param resource the resource
+ * @param globalContext the global context
+ * @return the resource def
+ */
+ @SuppressWarnings("unchecked")
+ public static Resource getResourceDef(String filename, String resourceName, Resource resource,
+ GlobalValidationContext globalContext) {
+ Resource resourceDef = null;
+ Map<String, Object> resourceDefValueMap = resource.getProperties() == null ? null
+ : (Map<String, Object>) resource.getProperties()
+ .get(PropertiesMapKeyTypes.RESOURCE_DEF.getKeyMap());
+ if (MapUtils.isNotEmpty(resourceDefValueMap)) {
+ Object resourceDefType = resourceDefValueMap.get("type");
+ if (Objects.nonNull(resourceDefType)) {
+ if (resourceDefType instanceof String) {
+ boolean isNested =
+ checkIfResourceGroupTypeIsNested(filename, resourceName, (String) resourceDefType,
+ globalContext);
+ if (isNested) {
+ resourceDef = new Resource();
+ resourceDef.setType((String) resourceDefType);
+ //noinspection unchecked
+ resourceDef.setProperties((Map<String, Object>) resourceDefValueMap.get("properties"));
+ }
+ } else {
+ globalContext.addMessage(filename, ErrorLevel.WARNING, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.INVALID_RESOURCE_GROUP_TYPE.getErrorMessage(),
+ resourceName, resourceDefType.toString()));
+ }
+ } else {
+ globalContext.addMessage(filename, ErrorLevel.WARNING, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.INVALID_RESOURCE_TYPE.getErrorMessage(), "null",
+ resourceName));
+ }
+
+ }
+ return resourceDef;
+ }
+
+
+ /**
+ * Check if resource group type is nested boolean.
+ *
+ * @param filename the filename
+ * @param resourceName the resource name
+ * @param resourceDefType the resource def type
+ * @param globalContext the global context
+ * @return the boolean
+ */
+ public static boolean checkIfResourceGroupTypeIsNested(String filename, String resourceName,
+ String resourceDefType,
+ GlobalValidationContext globalContext) {
+ if (!HeatStructureUtil.isNestedResource(resourceDefType)) {
+ globalContext.addMessage(filename, ErrorLevel.WARNING, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.INVALID_RESOURCE_GROUP_TYPE.getErrorMessage(),
+ resourceName, resourceDefType));
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Gets artifact files.
+ *
+ * @param filename the filename
+ * @param hot the hot
+ * @param globalContext the global context
+ * @return the artifact files
+ */
+ public static Set<String> getArtifactFiles(String filename, HeatOrchestrationTemplate hot,
+ GlobalValidationContext globalContext) {
+ Set<String> artifactSet = new HashSet<>();
+ Collection<Resource> resourcesValue =
+ hot.getResources() == null ? null : hot.getResources().values();
+ if (CollectionUtils.isNotEmpty(resourcesValue)) {
+ for (Resource resource : resourcesValue) {
+ Collection<Object> properties =
+ resource.getProperties() == null ? null : resource.getProperties().values();
+ if (CollectionUtils.isNotEmpty(properties)) {
+ for (Object property : properties) {
+ Set<String> artifactNames =
+ getReferencedValuesByFunctionName(filename, "get_file", property, globalContext);
+ artifactSet.addAll(artifactNames);
+ }
+ }
+ }
+ }
+ return artifactSet;
+ }
+
+ /**
+ * Gets referenced values by function name.
+ *
+ * @param filename the filename
+ * @param functionName the function name
+ * @param propertyValue the property value
+ * @param globalContext the global context
+ * @return the referenced values by function name
+ */
+ public static Set<String> getReferencedValuesByFunctionName(String filename, String functionName,
+ Object propertyValue,
+ GlobalValidationContext globalContext) {
+ Set<String> valuesNames = new HashSet<>();
+ if (propertyValue instanceof Map) {
+ Map<String, Object> currPropertyMap = (Map<String, Object>) propertyValue;
+ if (currPropertyMap.containsKey(functionName)) {
+ Object getFunctionValue = currPropertyMap.get(functionName);
+ if (!(getFunctionValue instanceof String)
+ && functionName.equals(ResourceReferenceFunctions.GET_RESOURCE.getFunction())) {
+ globalContext.addMessage(filename, ErrorLevel.ERROR, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.INVALID_GET_RESOURCE_SYNTAX.getErrorMessage(),
+ getFunctionValue == null ? "null" : getFunctionValue.toString()));
+ return valuesNames;
+ }
+ if (getFunctionValue instanceof String) {
+
+ if (functionName.equals(ResourceReferenceFunctions.GET_FILE.getFunction())) {
+ getFunctionValue = ((String) getFunctionValue).replace("file:///", "");
+ }
+
+ valuesNames.add((String) getFunctionValue);
+ } else if (getFunctionValue instanceof List) {
+ if (CollectionUtils.isNotEmpty((List) getFunctionValue)) {
+ if (((List) getFunctionValue).get(0) instanceof String) {
+ valuesNames.add(((String) ((List) getFunctionValue).get(0)).replace("file:///", ""));
+ } else {
+ valuesNames.addAll(getReferencedValuesByFunctionName(filename, functionName,
+ ((List) getFunctionValue).get(0), globalContext));
+ }
+
+ }
+ } else {
+ valuesNames.addAll(
+ getReferencedValuesByFunctionName(filename, functionName, getFunctionValue,
+ globalContext));
+ }
+ } else {
+ for (Map.Entry<String, Object> nestedPropertyMap : currPropertyMap.entrySet()) {
+ valuesNames.addAll(getReferencedValuesByFunctionName(filename, functionName,
+ nestedPropertyMap.getValue(), globalContext));
+ }
+ }
+ } else if (propertyValue instanceof List) {
+ List propertyValueArray = (List) propertyValue;
+ for (Object propertyValueArrayInstance : propertyValueArray) {
+ valuesNames.addAll(
+ getReferencedValuesByFunctionName(filename, functionName, propertyValueArrayInstance,
+ globalContext));
+ }
+ }
+
+ return valuesNames;
+ }
+
+
+ /**
+ * Is nested resource boolean.
+ *
+ * @param resourceType the resource type
+ * @return the boolean
+ */
+ public static boolean isNestedResource(String resourceType) {
+ return resourceType.endsWith(".yaml") || resourceType.endsWith(".yml");
+ }
+}
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/manifest/ManifestUtil.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/manifest/ManifestUtil.java
new file mode 100644
index 0000000000..09378cebf4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/manifest/ManifestUtil.java
@@ -0,0 +1,176 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.heat.services.manifest;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.openecomp.sdc.heat.datatypes.manifest.FileData;
+import org.openecomp.sdc.heat.datatypes.manifest.ManifestContent;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+
+/**
+ * The type Manifest util.
+ */
+public class ManifestUtil {
+
+
+ /**
+ * Gets file and its env.
+ *
+ * @param manifestContent the manifest content
+ * @return the file and its env
+ */
+ public static Map<String, FileData> getFileAndItsEnv(ManifestContent manifestContent) {
+ Map<String, FileData> fileEnvMap = new HashMap<>();
+ scanFileEnvMap(null, manifestContent.getData(), fileEnvMap);
+ return fileEnvMap;
+ }
+
+
+ /**
+ * Scan file env map.
+ *
+ * @param fileData the file data
+ * @param fileDataList the file data list
+ * @param fileEnvMap the file env map
+ */
+ public static void scanFileEnvMap(FileData fileData, List<FileData> fileDataList,
+ Map<String, FileData> fileEnvMap) {
+ if (CollectionUtils.isEmpty(fileDataList)) {
+ return;
+ }
+
+ for (FileData childFileData : fileDataList) {
+ FileData.Type childType = childFileData.getType();
+ if (fileData != null) {
+ if (childType != null && childType.equals(FileData.Type.HEAT_ENV)) {
+ fileEnvMap.put(fileData.getFile(), childFileData);
+ }
+ }
+ scanFileEnvMap(childFileData, childFileData.getData(), fileEnvMap);
+ }
+ }
+
+
+ /**
+ * Gets file type map.
+ *
+ * @param manifestContent the manifest content
+ * @return the file type map
+ */
+ public static Map<String, FileData.Type> getFileTypeMap(ManifestContent manifestContent) {
+ Map<String, FileData.Type> fileTypeMap = new HashMap<>();
+ scanFileTypeMap(null, manifestContent.getData(), fileTypeMap);
+ return fileTypeMap;
+ }
+
+ private static FileData.Type scanFileTypeMap(FileData fileData, List<FileData> data,
+ Map<String, FileData.Type> fileTypeMap) {
+ if (fileData != null) {
+ fileTypeMap.put(fileData.getFile(), fileData.getType());
+ }
+ if (data == null) {
+ return null;
+ }
+
+ for (FileData chileFileData : data) {
+ FileData.Type type = scanFileTypeMap(chileFileData, chileFileData.getData(), fileTypeMap);
+ if (type != null) {
+ return type;
+ }
+ }
+ return null;
+ }
+
+
+ /**
+ * Gets artifacts.
+ *
+ * @param manifestContent the manifest content
+ * @return the artifacts
+ */
+ public static Set<String> getArtifacts(ManifestContent manifestContent) {
+ Set<String> artifacts = new HashSet<>();
+ scanArtifacts(null, manifestContent.getData(), artifacts);
+
+ return artifacts;
+ }
+
+
+ private static void scanArtifacts(FileData fileData, List<FileData> data, Set<String> artifacts) {
+ if (fileData != null && fileData.getType() != null) {
+ if (isArtifact(fileData)) {
+ artifacts.add(fileData.getFile());
+ }
+ }
+
+ if (data == null) {
+ return;
+ }
+
+ for (FileData chileFileData : data) {
+ scanArtifacts(chileFileData, chileFileData.getData(), artifacts);
+ }
+ }
+
+ private static boolean isArtifact(FileData fileData) {
+ if (FileData.Type.valueOf(fileData.getType().name()) != null
+ && !fileData.getType().equals(FileData.Type.HEAT)
+ && !fileData.getType().equals(FileData.Type.HEAT_ENV)
+ && !fileData.getType().equals(FileData.Type.HEAT_NET)
+ && !fileData.getType().equals(FileData.Type.HEAT_VOL)) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Gets base files.
+ *
+ * @param manifestContent the manifest content
+ * @return the base files
+ */
+ public static Set<String> getBaseFiles(ManifestContent manifestContent) {
+ Set<String> baseFiles = new HashSet<>();
+ scanBase(null, manifestContent.getData(), baseFiles);
+ return baseFiles;
+ }
+
+ private static void scanBase(FileData fileData, List<FileData> data, Set<String> baseFiles) {
+ if (fileData != null && fileData.getBase() != null) {
+ if (fileData.getBase()) {
+ baseFiles.add(fileData.getFile());
+ }
+ }
+ if (data == null) {
+ return;
+ }
+
+ for (FileData chileFileData : data) {
+ scanBase(chileFileData, chileFileData.getData(), baseFiles);
+ }
+ }
+}
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/tree/HeatTreeManager.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/tree/HeatTreeManager.java
new file mode 100644
index 0000000000..71c532dbd3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/tree/HeatTreeManager.java
@@ -0,0 +1,298 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.heat.services.tree;
+
+import org.openecomp.core.utilities.file.FileContentHandler;
+import org.openecomp.core.utilities.file.FileUtils;
+import org.openecomp.core.utilities.json.JsonUtil;
+import org.openecomp.core.utilities.yaml.YamlUtil;
+import org.openecomp.core.validation.types.GlobalValidationContext;
+import org.openecomp.sdc.common.utils.AsdcCommon;
+import org.openecomp.sdc.datatypes.error.ErrorMessage;
+import org.openecomp.sdc.heat.datatypes.manifest.FileData;
+import org.openecomp.sdc.heat.datatypes.manifest.ManifestContent;
+import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate;
+import org.openecomp.sdc.heat.datatypes.structure.Artifact;
+import org.openecomp.sdc.heat.datatypes.structure.HeatStructureTree;
+import org.openecomp.sdc.heat.services.HeatStructureUtil;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * The type Heat tree manager.
+ */
+public class HeatTreeManager {
+
+ private static Logger logger = LoggerFactory.getLogger(HeatTreeManager.class);
+
+
+ private FileContentHandler heatContentMap = new FileContentHandler();
+ private byte[] manifest;
+ private HeatStructureTree tree = new HeatStructureTree();
+ private Map<String, HeatStructureTree> fileTreeRef = new HashMap<>();
+ private Map<String, Artifact> artifactRef = new HashMap<>();
+ private Map<String, Artifact> candidateOrphanArtifacts = new HashMap<>();
+ private Map<String, HeatStructureTree> nestedFiles = new HashMap<>();
+ private Map<HeatStructureTree, HeatStructureTree> volumeFileToParent = new HashMap<>();
+ private Map<HeatStructureTree, HeatStructureTree> networkFileToParent = new HashMap<>();
+ private Set<String> manifestFiles = new HashSet<>();
+
+ /**
+ * Add file.
+ *
+ * @param fileName the file name
+ * @param content the content
+ */
+ public void addFile(String fileName, InputStream content) {
+ if (fileName.equals(AsdcCommon.MANIFEST_NAME)) {
+ manifest = FileUtils.toByteArray(content);
+
+ } else {
+ heatContentMap.addFile(fileName, content);
+ }
+ }
+
+ /**
+ * Create tree.
+ */
+ public void createTree() {
+ if (manifest == null) {
+ logger.error("Missing manifest file in the zip.");
+ return;
+ }
+ ManifestContent manifestData =
+ JsonUtil.json2Object(new String(manifest), ManifestContent.class);
+ scanTree(null, manifestData.getData());
+ addNonNestedVolumeNetworkToTree(volumeFileToParent, nestedFiles.keySet(), true);
+ addNonNestedVolumeNetworkToTree(networkFileToParent, nestedFiles.keySet(), false);
+ handleOrphans();
+
+ tree = fileTreeRef.get(AsdcCommon.PARENT);
+ }
+
+ private void handleOrphans() {
+ tree = fileTreeRef.get(AsdcCommon.PARENT);
+ candidateOrphanArtifacts.entrySet().stream()
+ .forEach(entry -> tree.addArtifactToArtifactList(entry.getValue()));
+ nestedFiles
+ .values()
+ .stream()
+ .filter(heatStructureTree -> tree.getHEAT().contains(heatStructureTree))
+ .forEach(heatStructureTree -> tree.getHEAT().remove(heatStructureTree));
+
+ heatContentMap.getFileList().stream().filter(fileName -> !manifestFiles.contains(fileName))
+ .forEach(fileName -> addTreeOther(fileName));
+ }
+
+ private void addTreeOther(String fileName) {
+ if (tree.getOther() == null) {
+ tree.setOther(new HashSet<>());
+ }
+ HeatStructureTree other = new HeatStructureTree(fileName, false);
+ fileTreeRef.put(fileName, other);
+ tree.getOther().add(other);
+ }
+
+
+ private void handleHeatContentReference(String filename, HeatStructureTree fileHeatStructureTree,
+ GlobalValidationContext globalContext) {
+
+ String fileName = fileHeatStructureTree.getFileName();
+ InputStream fileContent = this.heatContentMap.getFileContent(fileName);
+ if (fileContent == null) {
+ return; // file exist in manifest but does not exist in zip
+ }
+ try {
+ HeatOrchestrationTemplate hot =
+ new YamlUtil().yamlToObject(fileContent, HeatOrchestrationTemplate.class);
+
+ Set<String> nestedSet = HeatStructureUtil.getNestedFiles(filename, hot, globalContext);
+ addHeatNestedFiles(fileHeatStructureTree, nestedSet);
+
+ Set<String> artifactSet = HeatStructureUtil.getArtifactFiles(filename, hot, globalContext);
+ addHeatArtifactFiles(fileHeatStructureTree, artifactSet);
+ } catch (Exception ignore) { /* invalid yaml no need to process reference */ }
+ }
+
+ private void addHeatArtifactFiles(HeatStructureTree fileHeatStructureTree,
+ Set<String> artifactSet) {
+ Artifact artifact;
+ for (String artifactName : artifactSet) {
+ FileData.Type type =
+ candidateOrphanArtifacts.get(artifactName) != null ? candidateOrphanArtifacts
+ .get(artifactName).getType() : null;
+ artifact = new Artifact(artifactName, type);
+ artifactRef.put(artifactName, artifact);
+ candidateOrphanArtifacts.remove(artifactName);
+ fileHeatStructureTree.addArtifactToArtifactList(artifact);
+ }
+ }
+
+
+ private void addHeatNestedFiles(HeatStructureTree fileHeatStructureTree, Set<String> nestedSet) {
+ HeatStructureTree childHeatStructureTree;
+ for (String nestedName : nestedSet) {
+ childHeatStructureTree = fileTreeRef.get(nestedName);
+ if (childHeatStructureTree == null) {
+ childHeatStructureTree = new HeatStructureTree();
+ childHeatStructureTree.setFileName(nestedName);
+ fileTreeRef.put(nestedName, childHeatStructureTree);
+ }
+ fileHeatStructureTree.addHeatStructureTreeToNestedHeatList(childHeatStructureTree);
+ nestedFiles.put(childHeatStructureTree.getFileName(), childHeatStructureTree);
+ }
+ }
+
+
+ /**
+ * Add errors.
+ *
+ * @param validationErrors the validation errors
+ */
+ public void addErrors(Map<String, List<ErrorMessage>> validationErrors) {
+
+ validationErrors.entrySet().stream().filter(entry -> {
+ return fileTreeRef.get(entry.getKey()) != null;
+ }).forEach(entry -> entry.getValue().stream().forEach(error ->
+ fileTreeRef.get(entry.getKey()).addErrorToErrorsList(error)));
+
+ validationErrors.entrySet().stream().filter(entry -> {
+ return artifactRef.get(entry.getKey()) != null;
+ }).forEach(entry -> artifactRef.get(entry.getKey()).setErrors(entry.getValue()));
+
+ }
+
+ /**
+ * Scan tree.
+ *
+ * @param parent the parent
+ * @param data the data
+ */
+ public void scanTree(String parent, List<FileData> data) {
+ String fileName;
+ FileData.Type type;
+ HeatStructureTree parentHeatStructureTree;
+ HeatStructureTree fileHeatStructureTree;
+ HeatStructureTree childHeatStructureTree;
+ Artifact artifact;
+ if (parent == null) {
+ parentHeatStructureTree = new HeatStructureTree();
+ fileTreeRef.put(AsdcCommon.PARENT, parentHeatStructureTree);
+ } else {
+ parentHeatStructureTree = fileTreeRef.get(parent);
+ }
+
+ for (FileData fileData : data) {
+ fileName = fileData.getFile();
+ manifestFiles.add(fileName);
+ type = fileData.getType();
+
+ if (FileData.Type.HEAT.equals(type)) {
+ fileHeatStructureTree = fileTreeRef.get(fileName);
+ if (fileHeatStructureTree == null) {
+ fileHeatStructureTree = new HeatStructureTree();
+ fileTreeRef.put(fileName, fileHeatStructureTree);
+ }
+ fileHeatStructureTree.setFileName(fileName);
+ fileHeatStructureTree.setBase(fileData.getBase());
+ fileHeatStructureTree.setType(type);
+ handleHeatContentReference(null, fileHeatStructureTree, null);
+ parentHeatStructureTree.addHeatToHEATList(fileHeatStructureTree);
+ if (fileData.getData() != null) {
+ scanTree(fileName, fileData.getData());
+ }
+ } else {
+ childHeatStructureTree = new HeatStructureTree();
+ childHeatStructureTree.setFileName(fileName);
+ childHeatStructureTree.setBase(fileData.getBase());
+ childHeatStructureTree.setType(type);
+ fileTreeRef.put(childHeatStructureTree.getFileName(), childHeatStructureTree);
+
+ if (type == null) {
+ parentHeatStructureTree.addOtherToOtherList(childHeatStructureTree);
+ } else if (FileData.Type.HEAT_NET.equals(type)) {
+ // parentHeatStructureTree.addNetworkToNetworkList(childHeatStructureTree);
+ networkFileToParent.put(childHeatStructureTree, parentHeatStructureTree);
+ if (fileData.getData() != null) {
+ scanTree(fileName, fileData.getData());
+ }
+
+ } else if (FileData.Type.HEAT_VOL.equals(type)) {
+ // parentHeatStructureTree.addVolumeFileToVolumeList(childHeatStructureTree);
+ volumeFileToParent.put(childHeatStructureTree, parentHeatStructureTree);
+ if (fileData.getData() != null) {
+ scanTree(fileName, fileData.getData());
+ }
+ } else if (FileData.Type.HEAT_ENV.equals(type)) {
+ if (parentHeatStructureTree != null && parentHeatStructureTree.getFileName() != null) {
+ parentHeatStructureTree.setEnv(childHeatStructureTree);
+ } else {
+ if (parentHeatStructureTree.getOther() == null) {
+ parentHeatStructureTree.setOther(new HashSet<>());
+ }
+ parentHeatStructureTree.getOther().add(childHeatStructureTree);
+ }
+ } else {
+ artifact = new Artifact(fileName, type);
+ if (!artifactRef.keySet().contains(fileName)) {
+ artifactRef.put(fileName, artifact);
+ candidateOrphanArtifacts.put(fileName, artifact);
+ }
+ }
+ }
+ }
+ }
+
+
+ private void addNonNestedVolumeNetworkToTree(
+ Map<HeatStructureTree, HeatStructureTree> netVolToParent, Set<String> nestedFileNames,
+ boolean isVolume) {
+ for (Map.Entry<HeatStructureTree, HeatStructureTree> entry : netVolToParent.entrySet()) {
+ HeatStructureTree netOrVolNode = entry.getKey();
+ HeatStructureTree parent = entry.getValue();
+ if (!nestedFileNames.contains(netOrVolNode.getFileName())) {
+ if (isVolume) {
+ parent.addVolumeFileToVolumeList(netOrVolNode);
+ } else {
+ parent.addNetworkToNetworkList(netOrVolNode);
+ }
+ }
+ }
+ }
+
+
+ /**
+ * Gets tree.
+ *
+ * @return the tree
+ */
+ public HeatStructureTree getTree() {
+ return tree;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/tree/HeatTreeManagerUtil.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/tree/HeatTreeManagerUtil.java
new file mode 100644
index 0000000000..dac7cdbbcb
--- /dev/null
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/tree/HeatTreeManagerUtil.java
@@ -0,0 +1,43 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.heat.services.tree;
+
+import org.openecomp.core.utilities.file.FileContentHandler;
+
+/**
+ * The type Heat tree manager util.
+ */
+public class HeatTreeManagerUtil {
+ /**
+ * Init heat tree manager heat tree manager.
+ *
+ * @param fileContentMap the file content map
+ * @return the heat tree manager
+ */
+ public static HeatTreeManager initHeatTreeManager(FileContentHandler fileContentMap) {
+
+ HeatTreeManager heatTreeManager = new HeatTreeManager();
+ fileContentMap.getFileList().stream().forEach(
+ fileName -> heatTreeManager.addFile(fileName, fileContentMap.getFileContent(fileName)));
+
+ return heatTreeManager;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/test/java/org/openecomp/sdc/heat/datatypes/model/EnvironmentTest.java b/openecomp-be/lib/openecomp-heat-lib/src/test/java/org/openecomp/sdc/heat/datatypes/model/EnvironmentTest.java
new file mode 100644
index 0000000000..2c0cf0b1aa
--- /dev/null
+++ b/openecomp-be/lib/openecomp-heat-lib/src/test/java/org/openecomp/sdc/heat/datatypes/model/EnvironmentTest.java
@@ -0,0 +1,38 @@
+package org.openecomp.sdc.heat.datatypes.model;
+
+import org.openecomp.core.utilities.yaml.YamlUtil;
+import org.junit.Test;
+
+import java.io.InputStream;
+
+public class EnvironmentTest {
+
+ @Test
+ public void testYamlToServiceTemplateObj() {
+ YamlUtil yamlUtil = new YamlUtil();
+ InputStream yamlFile = yamlUtil.loadYamlFileIs("/mock/model/envSettings.env");
+ Environment envVars = yamlUtil.yamlToObject(yamlFile, Environment.class);
+ envVars.toString();
+ }
+
+ @Test
+ public void test() {
+ String heatResourceName = "server_abc_0u";
+ String novaServerPrefix = "server_";
+ if (heatResourceName.startsWith(novaServerPrefix)) {
+ heatResourceName = heatResourceName.substring(novaServerPrefix.length());
+ }
+ int lastIndexOfUnderscore = heatResourceName.lastIndexOf("_");
+ if (heatResourceName.length() == lastIndexOfUnderscore) {
+ System.out.println(heatResourceName);
+ } else {
+ String heatResourceNameSuffix = heatResourceName.substring(lastIndexOfUnderscore + 1);
+ try {
+ Integer.parseInt(heatResourceNameSuffix);
+ System.out.println(heatResourceName.substring(0, lastIndexOfUnderscore));
+ } catch (NumberFormatException ignored) {
+ System.out.println(heatResourceName);
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/test/java/org/openecomp/sdc/heat/datatypes/model/HeatOrchestrationTemplateTest.java b/openecomp-be/lib/openecomp-heat-lib/src/test/java/org/openecomp/sdc/heat/datatypes/model/HeatOrchestrationTemplateTest.java
new file mode 100644
index 0000000000..09c83ca217
--- /dev/null
+++ b/openecomp-be/lib/openecomp-heat-lib/src/test/java/org/openecomp/sdc/heat/datatypes/model/HeatOrchestrationTemplateTest.java
@@ -0,0 +1,122 @@
+package org.openecomp.sdc.heat.datatypes.model;
+
+import org.openecomp.core.utilities.yaml.YamlUtil;
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class HeatOrchestrationTemplateTest {
+
+ @Test
+ public void testYamlToServiceTemplateObj() {
+ YamlUtil yamlUtil = new YamlUtil();
+ InputStream yamlFile = yamlUtil.loadYamlFileIs("/mock/model/testHeat.yml");
+ HeatOrchestrationTemplate heatOrchestrationTemplate =
+ yamlUtil.yamlToObject(yamlFile, HeatOrchestrationTemplate.class);
+ heatOrchestrationTemplate.toString();
+ }
+
+ @Test
+ public void createHotTemplate() {
+ HeatOrchestrationTemplate template = new HeatOrchestrationTemplate();
+ template.setHeat_template_version("2016-04-14");
+ template.setDescription("test description for hot template");
+ Map<String, Parameter> params = createParameters();
+ template.setParameters(params);
+ List<ParameterGroup> parameterGroup = new ArrayList<>();
+ ParameterGroup paramsGroup = new ParameterGroup();
+ paramsGroup.setDescription("params group test description");
+ paramsGroup.setLabel("params group test label");
+ String paramName = params.get("param1").getLabel();
+ List<String> paramsNames = new ArrayList<>();
+ paramsNames.add(paramName);
+ paramsGroup.setParameters(paramsNames);
+ parameterGroup.add(paramsGroup);
+ template.setParameter_groups(parameterGroup);
+ Map<String, Object> conditions = new HashMap<>();
+ conditions.put("key1", "val1");
+ HashMap<String, Object> mapValue = new HashMap<>();
+ mapValue.put("innerKey", "innerVal");
+ conditions.put("key2", mapValue);
+ template.setConditions(conditions);
+
+ Map<String, Resource> resources = new HashMap<>();
+ Resource resource = new Resource();
+ resource.setMetadata("resource metadata");
+ resource.setType("resource type");
+ //Map<String, String> resourceProps = new ;
+ Map<String, Object> resourceProps = new HashMap<>();
+ resourceProps.put("aaa", "bbb");
+ //resourceProps.add(resourceProp);
+ resource.setProperties(resourceProps);
+ resources.put("R1", resource);
+ resource = new Resource();
+ resource.setMetadata("resource2 metadata");
+ resource.setType("resource2 type");
+ //resourceProps = new ArrayList<>();
+ resourceProps = new HashMap<>();
+ resourceProps.put("aaa2", "bbb2");
+ //resourceProps.add(resourceProp);
+ resource.setProperties(resourceProps);
+ List<String> dependsOn = new ArrayList<>();
+ dependsOn.add("R1");
+ resource.setDepends_on(dependsOn);
+ resource.setDeletion_policy("all");
+ resource.setUpdate_policy("once");
+ resources.put("R2", resource);
+ template.setResources(resources);
+
+ YamlUtil yamlUtil = new YamlUtil();
+ String yml = yamlUtil.objectToYaml(template);
+ Assert.assertNotNull(yml);
+ try {
+ HeatOrchestrationTemplate heatOrchestrationTemplate =
+ yamlUtil.yamlToObject(yml, HeatOrchestrationTemplate.class);
+ Assert.assertNotNull(heatOrchestrationTemplate);
+ } catch (Exception ignored) {
+ }
+ }
+
+ private Map<String, Parameter> createParameters() {
+ Map<String, Parameter> params = new HashMap<>();
+ Parameter param;
+ for (int i = 0; i < 2; i++) {
+ param = new Parameter();
+ param.setDescription("param " + i + " desc");
+ param.setLabel("param " + i + " label");
+ param.set_default("PARAM " + i + " default");
+ param.setHidden(i % 2 == 0);
+ param.setImmutable(i % 2 == 0);
+ param.setType(i % 2 == 0 ? ParameterType.STRING.getDisplayName()
+ : ParameterType.BOOLEAN.getDisplayName());
+ params.put("param" + i, param);
+ }
+
+ return params;
+ }
+
+ private List<Constraint> createConstraints() {
+ List<Constraint> constraints = new ArrayList<>();
+ Constraint constraint = new Constraint();
+ constraint.setLength(new Integer[]{2, 4});
+ constraints.add(constraint);
+ constraint = new Constraint();
+ constraint.setPattern("some regex");
+ constraints.add(constraint);
+ constraint = new Constraint();
+ constraint.setRange(new Integer[]{5, 8});
+ constraints.add(constraint);
+ constraint = new Constraint();
+ List<Object> validValues = new ArrayList<>();
+ validValues.add("abc");
+ validValues.add("def");
+ constraint.setValid_values(validValues);
+ constraints.add(constraint);
+ return constraints;
+ }
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/test/resources/mock/model/envSettings.env b/openecomp-be/lib/openecomp-heat-lib/src/test/resources/mock/model/envSettings.env
new file mode 100644
index 0000000000..4f5e20a55f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-heat-lib/src/test/resources/mock/model/envSettings.env
@@ -0,0 +1,36 @@
+parameters:
+ czid: RDM1
+ vf_inst_number: 01
+ admin_password: cisco123
+ vpc_vip_addr: 172.17.32.112
+ vpc_vip_gateway: 172.17.32.1
+ availability_zone: nova
+
+ instance_image_cf1: SGW_19.2.0v-CF1-ATTM1.0.1_nimbus
+ instance_image_cf2: SGW_19.2.0v-CF2-ATTM1.0.1_nimbus
+ instance_image_sf: SGW_19.2.0v-SFn-ATTM1.0.1_nimbus
+ instance_flavor_cf: m1.xlarge
+ instance_flavor_sf: m1.xlarge
+
+
+ instance_network: mns-oam_direct_net_0
+ cgw_int_di2_net: nimbus_int_sae_gw_di-2_net_0
+ cgw_gn_net: mns-gn_direct_net_0
+ cgw_cor_net: mns-cor_direct_net_0
+ cgw_sgi_protected_net: nimbus_sgi_protected_net_0
+ cgw_sgi_ims_net: nimbus_sgi_ims_net_0
+ cgw_oam_calea_net: nimbus_oam_calea_net_0
+ cgw_int_icsr_net: nimbus_int_icsr_net_0
+
+ # CF VNFs Neutron static IP for management port
+ CF01-OAM-IP: 172.17.32.110
+ CF02-OAM-IP: 172.17.32.111
+ # SF VNFs Neutron static IPs for port 1-6
+ SF03-IP: { gn_ip: [107.243.0.5, "2606:ae00:2e01:140::5"], cor_ip: [107.243.3.5, "fd00:ae00:2e01:40::5"], sgi_prot_ip: [107.243.1.5, "fd00:ae00:2030:a40::5"], sgi_ims_ip: [107.243.2.5, "fd00:ae00:2030:b40::5"], oam_calea_ip: [107.243.4.5], int_icsr_ip: [172.26.0.5, "fd00:2600:2600::5"]}
+ SF04-IP: { gn_ip: [107.243.0.6, "2606:ae00:2e01:140::6"], cor_ip: [107.243.3.6, "fd00:ae00:2e01:40::6"], sgi_prot_ip: [107.243.1.6, "fd00:ae00:2030:a40::6"], sgi_ims_ip: [107.243.2.6, "fd00:ae00:2030:b40::6"], oam_calea_ip: [107.243.4.6], int_icsr_ip: [172.26.0.10, "fd00:2600:2600::10"]}
+ SF05-IP: { gn_ip: [107.243.0.7, "2606:ae00:2e01:140::7"], cor_ip: [107.243.3.7, "fd00:ae00:2e01:40::7"], sgi_prot_ip: [107.243.1.7, "fd00:ae00:2030:a40::7"], sgi_ims_ip: [107.243.2.7, "fd00:ae00:2030:b40::7"], oam_calea_ip: [107.243.4.7], int_icsr_ip: [172.26.0.9, "fd00:2600:2600::9"]}
+ SF06-IP: { gn_ip: [107.243.0.8, "2606:ae00:2e01:140::8"], cor_ip: [107.243.3.8, "fd00:ae00:2e01:40::8"], sgi_prot_ip: [107.243.1.8, "fd00:ae00:2030:a40::8"], sgi_ims_ip: [107.243.2.8, "fd00:ae00:2030:b40::8"], oam_calea_ip: [107.243.4.8], int_icsr_ip: [172.26.0.8, "fd00:2600:2600::8"]}
+ # Volume size for HDD attaching to CF card for CDR storage
+ vol_size_1: 16
+ vol_size_2: 16
+
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/test/resources/mock/model/testHeat.yml b/openecomp-be/lib/openecomp-heat-lib/src/test/resources/mock/model/testHeat.yml
new file mode 100644
index 0000000000..d1eb621731
--- /dev/null
+++ b/openecomp-be/lib/openecomp-heat-lib/src/test/resources/mock/model/testHeat.yml
@@ -0,0 +1,524 @@
+heat_template_version: 2013-05-23
+
+description: vSeGW/vSRX Firewall Template
+
+parameter_groups:
+- label: System Settings
+ description: System Level Settings
+ parameters:
+ - availability_zone_0
+ - vnf_name
+ - vnf_id
+
+parameters:
+ availability_zone_0:
+ type: string
+ description: Availability Zone
+ vnf_name:
+ type: string
+ description: Unique name for this VNF instance
+ vnf_id:
+ type: string
+ description: Unique ID for this VNF instance
+
+# Note we are requesting a flavor with 10 physical CPU cores and may be limited by 16 vCPU flavor.
+ flavor_segw_name:
+ type: string
+ description: flavor type
+# The image will be provided as a qcow2 KVM image.
+ image_segw_name:
+ type: string
+ description: Image use to boot a server
+
+ flavor_vsrxfw_name:
+ type: string
+ description: flavor type
+ image_vsrxfw_name:
+ type: string
+ description: Image use to boot a server
+
+ INTERNET_direct_net_id:
+ type: string
+ description: The Internet
+
+ oam_mgmt_net_0_id:
+ type: string
+ description: Name of OAM mgmt network
+
+ oam_protected_net_0_id:
+ type: string
+ description: Name of OAM protected network
+
+ Mobility_OAM_protected_net_0_id:
+ type: string
+ description: Network name for OAM
+
+ GN_direct_net_0_id:
+ type: string
+ description: Network name for GN network
+
+ Mobility_OAM_protected_net_1_id:
+ type: string
+ description: Network name for OAM
+
+ GN_direct_net_1_id:
+ type: string
+ description: Network name for GN network
+
+ HSL_direct_net_id:
+ type: string
+ description: Name of HSL (Logging) network
+ HSL_direct_net_cidr:
+ type: string
+ description: HSL (Logging) network address (CIDR notation)
+
+ int_dummi0_net_id:
+ type: string
+ description: Dummi Parent Network for port
+ int_dummi1_net_id:
+ type: string
+ description: Dummi Parent Network for port
+# int_dummi2_net_id:
+# type: string
+# description: Dummi Parent Network for port
+# int_dummi3_net_id:
+# type: string
+# description: Dummi Parent Network for port
+# int_dummi4_net_id:
+# type: string
+# description: Dummi Parent Network for port
+# int_dummi5_net_id:
+# type: string
+# description: Dummi Parent Network for port
+
+ int_dummi0_cidr:
+ type: string
+ description: IPv4 prefix (CIDR notation)
+ int_dummi1_cidr:
+ type: string
+ description: IPv4 prefix (CIDR notation)
+# int_dummi2_cidr:
+# type: string
+# description: IPv4 prefix (CIDR notation)
+# int_dummi3_cidr:
+# type: string
+# description: IPv4 prefix (CIDR notation)
+# int_dummi4_cidr:
+# type: string
+# description: IPv4 prefix (CIDR notation)
+# int_dummi5_cidr:
+# type: string
+# description: IPv4 prefix (CIDR notation)
+
+ segw_0_inet_ip_0:
+ type: string
+ label: segw_0 port ens10 Ingress IP address alias_0
+ description: SeGW's Ingress interface IPv4 address, primary
+ segw_0_inet_ip_1:
+ type: string
+ label: segw_0 port ens10 Ingress IP address alias_1
+ description: SeGW's Ingress interface IPv4 address, alias 1
+ segw_0_inet_ip_2:
+ type: string
+ label: segw_0 port ens10 Ingress IP address alias_2
+ description: SeGW's Ingress interface IPv4 address, alias 2
+
+ segw_1_inet_ip_0:
+ type: string
+ label: segw_1 port ens10 Ingress IP address alias_0
+ description: SeGW's Ingress interface IPv4 address, primary
+ segw_1_inet_ip_1:
+ type: string
+ label: segw_1 port ens10 Ingress IP address alias_1
+ description: SeGW's Ingress interface IPv4 address, alias 1
+ segw_1_inet_ip_2:
+ type: string
+ label: segw_1 port ens10 Ingress IP address alias_2
+ description: SeGW's Ingress interface IPv4 address, alias 2
+ segw_0_oam_protected_ip:
+ type: string
+ label: segw_0 OAM MGMT IP address
+ description: segw_0 OAM MGMT IP address
+ segw_1_oam_protected_ip:
+ type: string
+ label: segw_1 OAM MGMT IP address
+ description: segw_1 OAM MGMT IP address
+
+# vsrx_fw_0_GN_direct_ip:
+# type: string
+# label: vsrx_fw_0 GN Direct IP address
+# description: vsrx_fw_0 GN Direct IP address
+# vsrx_fw_1_GN_direct_ip:
+# type: string
+# label: vsrx_fw_1 GN Direct IP address
+# description: vsrx_fw_1 GN Direct IP address
+# vsrx_fw_2_OAM_protected_ip:
+# type: string
+# label: vsrx_fw_2 OAM Protected IP address
+# description: vsrx_fw_2 OAM Protected IP address
+# vsrx_fw_3_OAM_protected_ip:
+# type: string
+# label: vsrx_fw_3 OAM Protected IP address
+# description: vsrx_fw_3 OAM Protected IP address
+
+ segw_0_name:
+ type: string
+ default: vSeGW_0
+ description: name of VM
+ segw_1_name:
+ type: string
+ default: vSeGW_1
+ description: name of VM
+ vsrx_fw_0_name:
+ type: string
+ default: vSRX_FW_0
+ description: name of VM
+ vsrx_fw_1_name:
+ type: string
+ default: vSRX_FW_1
+ description: name of VM
+ vsrx_fw_2_name:
+ type: string
+ default: vSRX_FW_2
+ description: name of VM
+ vsrx_fw_3_name:
+ type: string
+ default: vSRX_FW_3
+ description: name of VM
+
+ security_group_name:
+ type: string
+ label: SEGW security group name
+ description: SEGW security group name
+
+resources:
+
+ SeGW_Affinity:
+ type: OS::Nova::ServerGroup
+ properties:
+ policies: ["anti-affinity"]
+ vSRXFW_Affinity:
+ type: OS::Nova::ServerGroup
+ properties:
+ policies: ["anti-affinity"]
+
+ Dummi0_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: int_dummi0_net_id }
+ Dummi0_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: Dummi0_net }
+ cidr: { get_param: int_dummi0_cidr }
+
+ Dummi1_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: int_dummi1_net_id }
+ Dummi1_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: Dummi1_net }
+ cidr: { get_param: int_dummi1_cidr }
+
+ hsl_direct_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: HSL_direct_net_id }
+
+ hsl_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: hsl_direct_net }
+ cidr: { get_param: HSL_direct_net_cidr }
+
+ segw_security_group:
+ type: OS::Neutron::SecurityGroup
+ properties:
+ description: vscp security group
+ name: {get_param: security_group_name}
+# Need to add any-any rule through GUI to get SCTP traffic to work - any-any rules are not supported in heat template
+ rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}
+ ]
+
+ server_segw_segw_0:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: segw_0_name }
+ image: { get_param: image_segw_name }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: flavor_segw_name }
+ scheduler_hints: { group: { get_resource: SeGW_Affinity } }
+ networks:
+ - port: { get_resource: port_segw_0_oam_protected }
+ - port: { get_resource: port_segw_0_internet }
+ - port: { get_resource: port_segw_0_dummi }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+
+ port_segw_0_oam_protected:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_protected_net_0_id }
+ fixed_ips: [{"ip_address": {get_param: segw_0_oam_protected_ip}}]
+ security_groups: [{get_resource: segw_security_group}]
+
+ port_segw_0_internet:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: INTERNET_direct_net_id }
+ fixed_ips: [{"ip_address": {get_param: segw_0_inet_ip_0}}, {"ip_address": {get_param: segw_0_inet_ip_1}}, {"ip_address": {get_param: segw_0_inet_ip_2}}]
+ security_groups: [{get_resource: segw_security_group}]
+
+ port_segw_0_dummi:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: Dummi0_net }
+ security_groups: [{get_resource: segw_security_group}]
+
+ server_segw_segw_1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: segw_1_name }
+ image: { get_param: image_segw_name }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: flavor_segw_name }
+ scheduler_hints: { group: { get_resource: SeGW_Affinity } }
+ networks:
+ - port: { get_resource: port_segw_1_oam_protected }
+ - port: { get_resource: port_segw_1_internet }
+ - port: { get_resource: port_segw_1_dummi }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+
+ port_segw_1_oam_protected:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_protected_net_0_id }
+ fixed_ips: [{"ip_address": {get_param: segw_1_oam_protected_ip}}]
+ security_groups: [{get_resource: segw_security_group}]
+
+ port_segw_1_internet:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: INTERNET_direct_net_id }
+ fixed_ips: [{"ip_address": {get_param: segw_1_inet_ip_0}}, {"ip_address": {get_param: segw_1_inet_ip_1}}, {"ip_address": {get_param: segw_1_inet_ip_2}}]
+ security_groups: [{get_resource: segw_security_group}]
+
+ port_segw_1_dummi:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: Dummi1_net }
+ security_groups: [{get_resource: segw_security_group}]
+
+ server_vsrx_fw_0:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: vsrx_fw_0_name }
+ image: { get_param: image_vsrxfw_name }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: flavor_vsrxfw_name }
+ scheduler_hints: { group: { get_resource: vSRXFW_Affinity } }
+ networks:
+ - port: { get_resource: port_vsrx_fw_0_oam_mgmt }
+ - port: { get_resource: port_vsrx_fw_0_dummi }
+ - port: { get_resource: port_vsrx_fw_0_GN }
+ - port: { get_resource: port_vsrx_fw_0_HSL }
+
+ metadata:
+ vnf_id: { get_param: vnf_id }
+
+ port_vsrx_fw_0_oam_mgmt:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_mgmt_net_0_id }
+ security_groups: [{get_resource: segw_security_group}]
+
+ port_vsrx_fw_0_dummi:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: Dummi0_net }
+ security_groups: [{get_resource: segw_security_group}]
+
+ port_vsrx_fw_0_GN:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: GN_direct_net_0_id }
+# fixed_ips: [{"ip_address": {get_param: vsrx_fw_0_GN_direct_ip}}]
+ security_groups: [{get_resource: segw_security_group}]
+
+ port_vsrx_fw_0_HSL:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: hsl_direct_net }
+ security_groups: [{get_resource: segw_security_group}]
+
+ server_vsrx_fw_1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: vsrx_fw_1_name }
+ image: { get_param: image_vsrxfw_name }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: flavor_vsrxfw_name }
+ scheduler_hints: { group: { get_resource: vSRXFW_Affinity } }
+ networks:
+ - port: { get_resource: port_vsrx_fw_1_oam_mgmt }
+ - port: { get_resource: port_vsrx_fw_1_dummi }
+ - port: { get_resource: port_vsrx_fw_1_GN }
+ - port: { get_resource: port_vsrx_fw_1_HSL }
+
+ metadata:
+ vnf_id: { get_param: vnf_id }
+
+ port_vsrx_fw_1_oam_mgmt:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_mgmt_net_0_id }
+ security_groups: [{get_resource: segw_security_group}]
+
+ port_vsrx_fw_1_dummi:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: Dummi1_net }
+ security_groups: [{get_resource: segw_security_group}]
+
+ port_vsrx_fw_1_GN:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: GN_direct_net_1_id }
+# fixed_ips: [{"ip_address": {get_param: vsrx_fw_1_GN_direct_ip}}]
+ security_groups: [{get_resource: segw_security_group}]
+
+ port_vsrx_fw_1_HSL:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: hsl_direct_net }
+ security_groups: [{get_resource: segw_security_group}]
+
+ server_vsrx_fw_2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: vsrx_fw_2_name }
+ image: { get_param: image_vsrxfw_name }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: flavor_vsrxfw_name }
+ scheduler_hints: { group: { get_resource: vSRXFW_Affinity } }
+ networks:
+ - port: { get_resource: port_vsrx_fw_2_oam_mgmt }
+ - port: { get_resource: port_vsrx_fw_2_dummi }
+ - port: { get_resource: port_vsrx_fw_2_OAM }
+ - port: { get_resource: port_vsrx_fw_2_HSL }
+
+ metadata:
+ vnf_id: { get_param: vnf_id }
+
+ port_vsrx_fw_2_oam_mgmt:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_mgmt_net_0_id }
+ security_groups: [{get_resource: segw_security_group}]
+
+ port_vsrx_fw_2_dummi:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: Dummi0_net }
+ security_groups: [{get_resource: segw_security_group}]
+
+ port_vsrx_fw_2_OAM:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: Mobility_OAM_protected_net_0_id }
+# fixed_ips: [{"ip_address": {get_param: vsrx_fw_2_OAM_protected_ip}}]
+ security_groups: [{get_resource: segw_security_group}]
+
+ port_vsrx_fw_2_HSL:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: hsl_direct_net }
+ security_groups: [{get_resource: segw_security_group}]
+
+ server_vsrx_fw_3:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: vsrx_fw_3_name }
+ image: { get_param: image_vsrxfw_name }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: flavor_vsrxfw_name }
+ scheduler_hints: { group: { get_resource: vSRXFW_Affinity } }
+ networks:
+ - port: { get_resource: port_vsrx_fw_3_oam_mgmt }
+ - port: { get_resource: port_vsrx_fw_3_dummi }
+ - port: { get_resource: port_vsrx_fw_3_OAM }
+ - port: { get_resource: port_vsrx_fw_3_HSL }
+
+ metadata:
+ vnf_id: { get_param: vnf_id }
+
+ port_vsrx_fw_3_oam_mgmt:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_mgmt_net_0_id }
+ security_groups: [{get_resource: segw_security_group}]
+
+ port_vsrx_fw_3_dummi:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: Dummi1_net }
+ security_groups: [{get_resource: segw_security_group}]
+
+ port_vsrx_fw_3_OAM:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: Mobility_OAM_protected_net_1_id }
+# fixed_ips: [{"ip_address": {get_param: vsrx_fw_3_OAM_protected_ip}}]
+ security_groups: [{get_resource: segw_security_group}]
+
+ port_vsrx_fw_3_HSL:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: hsl_direct_net }
+ security_groups: [{get_resource: segw_security_group}]
+
+conditions:
+ cd1: True
+ cd2:
+ get_param: param1
+ cd3:
+ equals:
+ - get_param: param2
+ - yes
+ cd4:
+ not:
+ equals:
+ - get_param: param3
+ - yes
+ cd5:
+ and:
+ - equals:
+ - get_param: env_type
+ - prod
+ - not:
+ equals:
+ - get_param: zone
+ - beijing
+ cd6:
+ or:
+ - equals:
+ - get_param: zone
+ - shanghai
+ - equals:
+ - get_param: zone
+ - beijing
+ cd7:
+ not: cd4
+ cd8:
+ and:
+ - cd1
+ - cd2
+ create_prod_res: {equals : [{get_param: env_type}, "prod"]} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/pom.xml b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/pom.xml
new file mode 100644
index 0000000000..d0512a480d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/pom.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-action-lib</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>openecomp-sdc-action-api</artifactId>
+
+
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-core-lib</artifactId>
+ <type>pom</type>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-facade-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-nosqldb-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-versioning-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-annotations</artifactId>
+ <version>2.7.4</version>
+ </dependency>
+ </dependencies>
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/ActionConstants.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/ActionConstants.java
new file mode 100644
index 0000000000..625ce7efe8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/ActionConstants.java
@@ -0,0 +1,104 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.action;
+
+public class ActionConstants {
+
+ //
+ public static final long MAX_ACTION_ARTIFACT_SIZE = 20 * 1024 * 1024; //20 MB
+ //REST layer constants
+ public static final String X_ECOMP_INSTANCE_ID_HEADER_PARAM = "X-ECOMP-InstanceID";
+ public static final String X_ECOMP_REQUEST_ID_HEADER_PARAM = "X-ECOMP-RequestID";
+ public static final String WWW_AUTHENTICATE_HEADER_PARAM = "WWW-Authenticate";
+
+ public static final String ACTION_REQUEST_PARAM_NAME = "name";
+ public static final String ACTION_REQUEST_PARAM_END_POINT_URI = "endpointUri";
+ public static final String SUPPORTED_MODELS_VERSION_ID = "versionId";
+ public static final String SUPPORTED_COMPONENTS_ID = "Id";
+ public static final String ACTION_REQUEST_PARAM_SUPPORTED_MODELS = SUPPORTED_MODELS_VERSION_ID
+ + " in supportedModels";
+ public static final String ACTION_REQUEST_PARAM_SUPPORTED_COMPONENTS =
+ SUPPORTED_COMPONENTS_ID + " in supportedComponents";
+
+ public static final String REQUEST_EMPTY_BODY = "{}";
+ public static final String REQUEST_TYPE_CREATE_ACTION = "REQUEST_CREATE_ACTION";
+ public static final String REQUEST_TYPE_UPDATE_ACTION = "REQUEST_UPDATE_ACTION";
+ public static final String REQUEST_TYPE_VERSION_ACTION = "REQUEST_VERSION_ACTION";
+
+ //DAO layer constants
+ public static final String ACTION_VERSIONABLE_TYPE = "Action";
+
+ //Manager constants
+ public static final String UNIQUE_ID = "actionUuId";
+ public static final String VERSION = "version";
+ public static final String INVARIANTUUID = "actionInvariantUuId";
+ public static final String STATUS = "status";
+ public static final String ARTIFACTS = "artifacts";
+ public static final String TIMESTAMP = "timeStamp";
+ public static final String UPDATED_BY = "updatedBy";
+ public static final String ARTIFACT_NAME = "artifactName";
+ public static final String ARTIFACT_FILE = "Artifact to be uploaded";
+
+ // Status
+ public static final String UNDO_CHECKOUT_RESPONSE_TEXT =
+ "Changes to the Action object successfully reverted back.";
+
+ //GET Request Filter Types
+ public static final String FILTER_TYPE_VENDOR = "VENDOR";
+ public static final String FILTER_TYPE_CATEGORY = "CATEGORY";
+ public static final String FILTER_TYPE_NAME = "NAME";
+ public static final String FILTER_TYPE_MODEL = "MODEL";
+ public static final String FILTER_TYPE_ECOMP_COMPONENT = "ECOMP_COMPONENT";
+ public static final String FILTER_TYPE_NONE = "NONE";
+
+ public static final String ARTIFACT_METADATA_ATTR_UUID = "ARTIFACT_UUID";
+ public static final String ARTIFACT_METADATA_ATTR_NAME = "ARTIFACT_NAME";
+
+ public static final String REQUEST_ID = "uuid";
+ public static final String SERVICE_INSTANCE_ID = "serviceInstanceID";
+ public static final String PARTNER_NAME = "userId";
+ public static final String SERVICE_NAME = "ServiceName";
+ public static final String INSTANCE_UUID = "InstanceUUID";
+ public static final String REMOTE_HOST = "RemoteHost";
+ public static final String CLIENT_IP = "ClientIP";
+ public static final String CATEGORY_LOG_LEVEL = "level";
+ public static final String STATUS_CODE = "StatusCode";
+ public static final String RESPONSE_CODE = "ResponseCode";
+ public static final String RESPONSE_DESCRIPTION = "ResponseDescription";
+ public static final String ELAPSED_TIME = "ElapsedTime";
+ public static final String BEGIN_TIMESTAMP = "BeginTimestamp";
+ public static final String TARGET_SERVICE_NAME = "TargetServiceName";
+ public static final String TARGET_ENTITY = "TargetEntity";
+ public static final String TARGET_ENTITY_API = "API";
+ public static final String TARGET_ENTITY_DB = "DB";
+ public static final String END_TIMESTAMP = "EndTimestamp";
+ public static final String ERROR_CATEGORY = "ErrorCategory";
+ public static final String ERROR_CODE = "ErrorCode";
+ public static final String ERROR_DESCRIPTION = "ErrorDescription";
+ public static final String MDC_ASDC_INSTANCE_UUID = "ASDC";
+ public static final String SERVICE_METRIC_BEGIN_TIMESTAMP = "SERVICE-METRIC-BEGIN-TIMESTAMP";
+ public static final String LOCAL_ADDR = "localAddr"; //map ServerIPAddress from loggingfilter
+ public static final String BE_FQDN = "beFqdn"; //map ServerFQDN from logging filter
+
+ public final class UniqueValues {
+ public static final String ACTION_NAME = "Action name";
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/ActionArtifactDao.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/ActionArtifactDao.java
new file mode 100644
index 0000000000..a120645512
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/ActionArtifactDao.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.action.dao;
+
+import org.openecomp.core.dao.BaseDao;
+import org.openecomp.sdc.action.dao.types.ActionArtifactEntity;
+import org.openecomp.sdc.action.types.ActionArtifact;
+
+public interface ActionArtifactDao extends BaseDao<ActionArtifactEntity> {
+
+ void uploadArtifact(ActionArtifact data);
+
+ ActionArtifact downloadArtifact(int effectiveVersion, String artifactUuId);
+
+ void updateArtifact(ActionArtifact data);
+}
diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/ActionArtifactDaoFactory.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/ActionArtifactDaoFactory.java
new file mode 100644
index 0000000000..f0936976ba
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/ActionArtifactDaoFactory.java
@@ -0,0 +1,31 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.action.dao;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+public abstract class ActionArtifactDaoFactory extends AbstractComponentFactory<ActionArtifactDao> {
+
+ public static ActionArtifactDaoFactory getInstance() {
+ return AbstractFactory.getInstance(ActionArtifactDaoFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/ActionDao.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/ActionDao.java
new file mode 100644
index 0000000000..01f5014ad4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/ActionDao.java
@@ -0,0 +1,51 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.action.dao;
+
+import org.openecomp.core.dao.BaseDao;
+import org.openecomp.sdc.action.dao.types.ActionEntity;
+import org.openecomp.sdc.action.errors.ActionException;
+import org.openecomp.sdc.action.types.Action;
+import org.openecomp.sdc.action.types.EcompComponent;
+import org.openecomp.sdc.versioning.dao.VersionableDao;
+
+import java.util.List;
+
+public interface ActionDao extends VersionableDao, BaseDao<ActionEntity> {
+
+ Action createAction(Action actionDto) throws ActionException;
+
+ Action updateAction(Action actionDto) throws ActionException;
+
+ void deleteAction(String actionInvariantUuId) throws ActionException;
+
+ List<Action> getFilteredActions(String filterType, String filterId) throws ActionException;
+
+ Action getActionsByActionUuId(String uniqueId) throws ActionException;
+
+ List<EcompComponent> getEcompComponents() throws ActionException;
+
+ List<Action> getActionsByActionInvariantUuId(String actionInvariantUuId)
+ throws ActionException;
+
+ Action getLockedAction(String actionInvariantUuId, String user) throws ActionException;
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/ActionDaoFactory.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/ActionDaoFactory.java
new file mode 100644
index 0000000000..d8b0c1889e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/ActionDaoFactory.java
@@ -0,0 +1,31 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.action.dao;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+public abstract class ActionDaoFactory extends AbstractComponentFactory<ActionDao> {
+
+ public static ActionDaoFactory getInstance() {
+ return AbstractFactory.getInstance(ActionDaoFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/types/ActionArtifactEntity.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/types/ActionArtifactEntity.java
new file mode 100644
index 0000000000..7e56a04e1b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/types/ActionArtifactEntity.java
@@ -0,0 +1,89 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.action.dao.types;
+
+import com.datastax.driver.mapping.annotations.Column;
+import com.datastax.driver.mapping.annotations.PartitionKey;
+import com.datastax.driver.mapping.annotations.Table;
+import org.openecomp.sdc.action.types.ActionArtifact;
+
+import java.nio.ByteBuffer;
+
+@Table(keyspace = "dox", name = "action_artifact")
+public class ActionArtifactEntity {
+
+ @PartitionKey
+ @Column(name = "artifactuuid")
+ private String artifactUuId;
+
+ @PartitionKey(value = 1)
+ @Column(name = "effective_version")
+ private int effectiveVersion;
+
+ @Column(name = "artifact")
+ private ByteBuffer artifact;
+
+ public ActionArtifactEntity() {
+ //Default constructor implementation
+ }
+
+ public ActionArtifactEntity(String artifactUuId, int effectiveVersion) {
+ this.artifactUuId = artifactUuId;
+ this.effectiveVersion = effectiveVersion;
+ }
+
+ public String getArtifactUuId() {
+ return artifactUuId;
+ }
+
+ public void setArtifactUuId(String artifactUuId) {
+ this.artifactUuId = artifactUuId;
+ }
+
+ public int getEffectiveVersion() {
+ return effectiveVersion;
+ }
+
+ public void setEffectiveVersion(int effectiveVersion) {
+ this.effectiveVersion = effectiveVersion;
+ }
+
+ public ByteBuffer getArtifact() {
+ return artifact;
+ }
+
+ public void setArtifact(ByteBuffer artifact) {
+ this.artifact = artifact;
+ }
+
+ /**
+ * To dto action artifact.
+ *
+ * @return the action artifact
+ */
+ public ActionArtifact toDto() {
+ ActionArtifact destination = new ActionArtifact();
+ destination.setArtifactUuId(this.getArtifactUuId());
+ destination.setEffectiveVersion(this.getEffectiveVersion());
+ destination.setArtifact(this.getArtifact().array());
+ return destination;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/types/ActionEntity.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/types/ActionEntity.java
new file mode 100644
index 0000000000..9aa9e8d375
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/types/ActionEntity.java
@@ -0,0 +1,224 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.action.dao.types;
+
+import com.datastax.driver.mapping.annotations.Column;
+import com.datastax.driver.mapping.annotations.Frozen;
+import com.datastax.driver.mapping.annotations.PartitionKey;
+import com.datastax.driver.mapping.annotations.Table;
+import org.openecomp.core.utilities.json.JsonUtil;
+import org.openecomp.sdc.action.types.Action;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Table(keyspace = "dox", name = "Action")
+public class ActionEntity {
+
+ @Column(name = "actionUUID")
+ private String actionUuId;
+ @PartitionKey(value = 0)
+ @Column(name = "actionInvariantUUID")
+ private String actionInvariantUuId;
+ @PartitionKey(value = 1)
+ @Frozen
+ @Column(name = "version")
+ private Version version;
+ @Column(name = "status")
+ private String status;
+ @Column(name = "name")
+ private String name;
+ @Column(name = "vendor_list")
+ private List<String> vendorList;
+ @Column(name = "category_list")
+ private List<String> categoryList;
+ @Column(name = "timestamp")
+ private Date timestamp;
+ @Column(name = "user")
+ private String user;
+ @Column(name = "supportedModels")
+ private List<String> supportedModels;
+ @Column(name = "supportedComponents")
+ private List<String> supportedComponents;
+ @Column(name = "data")
+ private String data;
+
+ public ActionEntity() {
+ }
+
+ public ActionEntity(String actionInvariantUuId, Version version) {
+ this.actionInvariantUuId = actionInvariantUuId;
+ this.version = version;
+ }
+
+ public String getActionUuId() {
+ return actionUuId;
+ }
+
+ public void setActionUuId(String actionUuId) {
+ this.actionUuId = actionUuId;
+ }
+
+ public String getActionInvariantUuId() {
+ return actionInvariantUuId;
+ }
+
+ public void setActionInvariantUuId(String actionInvariantUuId) {
+ this.actionInvariantUuId = actionInvariantUuId;
+ }
+
+ public Version getVersion() {
+ return version;
+ }
+
+ public void setVersion(Version version) {
+ this.version = version;
+ }
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public List<String> getVendorList() {
+ return vendorList;
+ }
+
+ /**
+ * Sets vendor list.
+ *
+ * @param vendorList the vendor list
+ */
+ public void setVendorList(List<String> vendorList) {
+ if (vendorList != null && !vendorList.isEmpty()) {
+ List<String> lowerCaseVendorList = new ArrayList<>();
+ lowerCaseVendorList
+ .addAll(vendorList.stream().map(String::toLowerCase).collect(Collectors.toList()));
+ this.vendorList = lowerCaseVendorList;
+ } else {
+ this.vendorList = vendorList;
+ }
+ }
+
+ public List<String> getCategoryList() {
+ return categoryList;
+ }
+
+ /**
+ * Sets category list.
+ *
+ * @param categoryList the category list
+ */
+ public void setCategoryList(List<String> categoryList) {
+ if (categoryList != null && !categoryList.isEmpty()) {
+ List<String> lowerCaseCategoryList = new ArrayList<>();
+ lowerCaseCategoryList
+ .addAll(categoryList.stream().map(String::toLowerCase).collect(Collectors.toList()));
+ this.categoryList = lowerCaseCategoryList;
+ } else {
+ this.categoryList = categoryList;
+ }
+ }
+
+ public Date getTimestamp() {
+ return timestamp;
+ }
+
+ public void setTimestamp(Date timestamp) {
+ this.timestamp = timestamp;
+ }
+
+ public String getUser() {
+ return user;
+ }
+
+ public void setUser(String user) {
+ this.user = user;
+ }
+
+ public List<String> getSupportedModels() {
+ return supportedModels;
+ }
+
+ public void setSupportedModels(List<String> supportedModels) {
+ this.supportedModels = supportedModels;
+ }
+
+ public List<String> getSupportedComponents() {
+ return supportedComponents;
+ }
+
+ public void setSupportedComponents(List<String> supportedComponents) {
+ this.supportedComponents = supportedComponents;
+ }
+
+ public String getData() {
+ return data;
+ }
+
+ public void setData(String data) {
+ this.data = data;
+ }
+
+ /**
+ * To dto action.
+ *
+ * @return the action
+ */
+ public Action toDto() {
+ //Action destination = new Action();
+
+ Action destination = JsonUtil.json2Object(this.getData(), Action.class);
+ destination.setData(this.getData());
+ destination.setTimestamp(this.getTimestamp());
+ destination.setUser(this.getUser());
+ destination.setData(this.getData());
+ return destination;
+ }
+
+ /*private List<HashMap<String,String>> createMapFromList(List<String> list, String idName){
+ List<HashMap<String,String>> keyValueList = new ArrayList<>();
+ if(list != null && !list.isEmpty()){
+ for(String attributeId : list){
+ HashMap<String,String> attributeIdMap = new HashMap<>();
+ attributeIdMap.put(idName,attributeId);
+ keyValueList.add(attributeIdMap);
+ }
+ return keyValueList;
+ }
+ return null;
+ }*/
+}
diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/types/EcompComponentEntity.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/types/EcompComponentEntity.java
new file mode 100644
index 0000000000..9a71023629
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/types/EcompComponentEntity.java
@@ -0,0 +1,73 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.action.dao.types;
+
+import com.datastax.driver.mapping.annotations.Column;
+import com.datastax.driver.mapping.annotations.PartitionKey;
+import com.datastax.driver.mapping.annotations.Table;
+import org.openecomp.sdc.action.types.EcompComponent;
+
+@Table(keyspace = "dox", name = "ECOMPComponent")
+public class EcompComponentEntity {
+
+ @PartitionKey
+ @Column(name = "id")
+ private String id;
+
+ @Column(name = "name")
+ private String name;
+
+ public EcompComponentEntity() {
+ }
+
+ public EcompComponentEntity(String id, String name) {
+ this.id = id;
+ this.name = name;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * To dto ecomp component.
+ *
+ * @return the ecomp component
+ */
+ public EcompComponent toDto() {
+ EcompComponent destination = new EcompComponent();
+ destination.setId(this.getId());
+ destination.setName(this.getName());
+ return destination;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/errors/ActionErrorConstants.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/errors/ActionErrorConstants.java
new file mode 100644
index 0000000000..092d9abee5
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/errors/ActionErrorConstants.java
@@ -0,0 +1,136 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.action.errors;
+
+public class ActionErrorConstants {
+
+ //Error Codes
+ public static final String ACTION_REQUEST_INVALID_GENERIC_CODE = "ACT0001";
+ public static final String ACTION_AUTHENTICATION_ERR_CODE = "ACT1000";
+ public static final String ACTION_AUTHORIZATION_ERR_CODE = "ACT1001";
+ public static final String ACTION_INVALID_INSTANCE_ID_CODE = "ACT1002";
+ public static final String ACTION_INVALID_REQUEST_ID_CODE = "ACT1003";
+ public static final String ACTION_INVALID_PARAM_CODE = "ACT1004";
+ //Operation <status> is not supported
+ public static final String ACTION_INVALID_REQUEST_BODY_CODE = "ACT1005";
+ //ACTION_REQUEST_BODY_EMPTY
+ public static final String ACTION_UPDATE_NOT_ALLOWED_CODE_NAME = "ACT1007";
+ public static final String ACTION_CHECKOUT_ON_LOCKED_ENTITY = "ACT1008";
+ public static final String ACTION_ENTITY_UNIQUE_VALUE_ERROR = "ACT1009";
+
+ public static final String ACTION_INVALID_SEARCH_CRITERIA = "ACT1011";
+ public static final String ACTION_MULT_SEARCH_CRITERIA = "ACT1012";
+ public static final String ACTION_UPDATE_ON_UNLOCKED_ENTITY = "ACT1013";
+ public static final String ACTION_UPDATE_INVALID_VERSION = "ACT1014";
+ public static final String ACTION_UPDATE_NOT_ALLOWED_CODE = "ACT1015";
+
+ public static final String ACTION_CHECKIN_ON_UNLOCKED_ENTITY = "ACT1017";
+ public static final String ACTION_SUBMIT_FINALIZED_ENTITY_NOT_ALLOWED = "ACT1018";
+ public static final String ACTION_SUBMIT_LOCKED_ENTITY_NOT_ALLOWED = "ACT1019";
+ public static final String ACTION_UNDO_CHECKOUT_ON_UNLOCKED_ENTITY = "ACT1020";
+ public static final String ACTION_NOT_LOCKED_CODE = "ACT1021";
+ public static final String ACTION_ARTIFACT_CHECKSUM_ERROR_CODE = "ACT1022";
+ public static final String ACTION_ARTIFACT_TOO_BIG_ERROR_CODE = "ACT1023";
+ public static final String ACTION_ARTIFACT_ALREADY_EXISTS_CODE = "ACT1025";
+ public static final String ACTION_ARTIFACT_UPDATE_READ_ONLY = "ACT1026";
+ public static final String ACTION_ARTIFACT_DELETE_READ_ONLY = "ACT1027";
+ public static final String ACTION_ARTIFACT_INVALID_PROTECTION_CODE = "ACT1028";
+ public static final String ACTION_ARTIFACT_INVALID_NAME_CODE = "ACT1029";
+
+ public static final String ACTION_EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER = "ACT1041";
+ public static final String ACTION_CHECKIN_ON_ENTITY_LOCKED_BY_OTHER_USER = "ACT1042";
+ public static final String ACTION_CHECKOUT_ON_LOCKED_ENTITY_OTHER_USER = "ACT1043";
+ public static final String ACTION_UNDO_CHECKOUT_ON_ENTITY_LOCKED_BY_OTHER_USER = "ACT1044";
+ public static final String ACTION_ENTITY_NOT_EXIST_CODE = "ACT1045";
+ public static final String ACTION_ARTIFACT_ENTITY_NOT_EXIST_CODE = "ACT1046";
+ public static final String ACTION_ARTIFACT_DEL_LOCKED_OTHER_USER_CODE = "ACT1047";
+ public static final String ACTION_DELETE_ON_LOCKED_ENTITY_CODE = "ACT1048";
+
+ public static final String ACTION_INTERNAL_SERVER_ERR_CODE = "ACT1060";
+ public static final String ACTION_QUERY_FAILURE_CODE = "QUERY_FAILURE";
+ public static final String ACTION_QUERY_FAILURE_MSG = "Query Failure";
+
+
+ //Error Messages
+ public static final String ACTION_REQUEST_BODY_EMPTY = "Request Body is missing";
+ //"The API failed due to missing body";
+ public static final String ACTION_REQUEST_MISSING_MANDATORY_PARAM =
+ "Missing mandatory parameter(s) : ";
+ public static final String ACTION_REQUEST_ECOMP_INSTANCE_ID_INVALID =
+ "X-ECOMP-InstanceID HTTP header missing or empty";
+ public static final String ACTION_REQUEST_ECOMP_REQUEST_ID_INVALID =
+ "X-ECOMP-RequestID HTTP header missing or empty";
+ public static final String ACTION_REQUEST_CONTENT_TYPE_INVALID =
+ "Content-Type HTTP header missing or empty";
+ public static final String ACTION_REQUEST_AUTHORIZATION_HEADER_INVALID =
+ "Authentication is required to use the API";
+ public static final String ACTION_REQUEST_INVALID_NAME =
+ "Invalid syntax for action name. No whitespaces allowed.";
+ public static final String ACTION_REQUEST_FILTER_PARAM_INVALID =
+ "Invalid Search filter criteria provided";
+ public static final String ACTION_FILTER_MULTIPLE_QUERY_PARAM_NOT_SUPPORTED =
+ "Multiple filter criteria are not supported";
+ //"Operation supports filter by one property at a time";
+ public static final String ACTION_ARTIFACT_ENTITY_NOT_EXIST = "Specified artifact is not found";
+ public static final String ACTION_REQUEST_ARTIFACT_CHECKSUM_ERROR = "Checksum error";
+ public static final String ACTION_REQUEST_ARTIFACT_INVALID_PROTECTION_VALUE =
+ "Invalid artifact protection value";
+
+ public static final String ACTION_ARTIFACT_INVALID_NAME =
+ "Artifact name cannot contain any of the following characters : #<>$+%!`&*'|{}?=/:@ "
+ + "including whitespaces, double quotes and back-slash";
+ public static final String ACTION_ARTIFACT_READ_FILE_ERROR = "Error Occurred while reading file";
+ public static final String ACTION_REQUEST_ARTIFACT_OPERATION_ALLOWED =
+ "Artifacts cannot be created/updated using this operation";
+ public static final String ACTION_ARTIFACT_TOO_BIG_ERROR =
+ "Operation is not allowed. Artifact size exceeds the maximum file size limit (20MB).";
+
+ //Business Validation Error messages
+ public static final String ACTION_UPDATE_NOT_ALLOWED_FOR_NAME =
+ "Action Name update is not allowed";
+ public static final String ACTION_UPDATE_PARAM_INVALID =
+ "Update not allowed for the parameter(s) : %s";
+ public static final String ACTION_ENTITY_NOT_EXIST = "Specified Action is not found";
+ public static final String ACTION_REQUESTED_VERSION_INVALID = "Invalid requested version : %s";
+ public static final String ACTION_UNSUPPORTED_OPERATION = "Operation %s not supported";
+ public static final String ACTION_ENTITY_UNIQUE_VALUE_MSG =
+ "%s with the value '%s' already exists.";
+ public static final String ACTION_ARTIFACT_ALREADY_EXISTS =
+ "Artifact name already exists for Action with id %s. Please use another name.";
+ public static final String ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG =
+ "The request failed due to an internal ASDC problem. ECOMP Component should continue the "
+ + "attempts, with corrected data if required, to create the resource.";
+ public static final String ACTION_ARTIFACT_DELETE_READ_ONLY_MSG =
+ "Cannot delete read only artifact.";
+ public static final String ACTION_ARTIFACT_UPDATE_READ_ONLY_MSG =
+ "Cannot update read only artifact.";
+ public static final String ACTION_NOT_LOCKED_MSG =
+ "Operation is not allowed. Action status should be Locked.";
+ public static final String ACTION_ARTIFACT_UPDATE_NAME_INVALID =
+ "Artifact name cannot be updated.";
+ public static final String ACTION_ARTIFACT_DEL_LOCKED_OTHER_USER =
+ "Cannot delete artifact since it is locked by other user %s.";
+ public static final String UNDO_CHECKOUT_ON_UNLOCKED_ENTITY_MSG =
+ "Can not undo checkout on versionable entity %s with id %s since it is not checked out.";
+ public static final String UNDO_CHECKOUT_ON_ENTITY_LOCKED_BY_OTHER_USER_MSG =
+ "Can not undo checkout on versionable entity %s with id"
+ + " %s since it is checked out by other user: %s.";
+}
diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/errors/ActionException.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/errors/ActionException.java
new file mode 100644
index 0000000000..fff88d6f84
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/errors/ActionException.java
@@ -0,0 +1,52 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.action.errors;
+
+public class ActionException extends RuntimeException {
+
+ private String errorCode;
+ private String description;
+
+ public ActionException() {
+
+ }
+
+ public ActionException(String errorCode, String description) {
+ this.errorCode = errorCode;
+ this.description = description;
+ }
+
+ public String getErrorCode() {
+ return errorCode;
+ }
+
+ public void setErrorCode(String errorCode) {
+ this.errorCode = errorCode;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/errors/ActionExceptionMapper.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/errors/ActionExceptionMapper.java
new file mode 100644
index 0000000000..23c14aaaa2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/errors/ActionExceptionMapper.java
@@ -0,0 +1,114 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.action.errors;
+
+import org.openecomp.sdc.action.ActionConstants;
+
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.ext.ExceptionMapper;
+
+public class ActionExceptionMapper implements ExceptionMapper<ActionException> {
+
+ @Override
+ public Response toResponse(ActionException actionException) {
+ Response response;
+ String errorCode = actionException.getErrorCode();
+ switch (errorCode) {
+ case ActionErrorConstants.ACTION_REQUEST_INVALID_GENERIC_CODE:
+ case ActionErrorConstants.ACTION_INVALID_INSTANCE_ID_CODE:
+ case ActionErrorConstants.ACTION_INVALID_REQUEST_ID_CODE:
+ case ActionErrorConstants.ACTION_INVALID_REQUEST_BODY_CODE:
+ case ActionErrorConstants.ACTION_INVALID_PARAM_CODE:
+ case ActionErrorConstants.ACTION_UPDATE_NOT_ALLOWED_FOR_NAME:
+ case ActionErrorConstants.ACTION_CHECKOUT_ON_LOCKED_ENTITY:
+ case ActionErrorConstants.ACTION_ENTITY_UNIQUE_VALUE_ERROR:
+ case ActionErrorConstants.ACTION_INVALID_SEARCH_CRITERIA:
+ case ActionErrorConstants.ACTION_MULT_SEARCH_CRITERIA:
+ case ActionErrorConstants.ACTION_UPDATE_ON_UNLOCKED_ENTITY:
+ case ActionErrorConstants.ACTION_UPDATE_INVALID_VERSION:
+ case ActionErrorConstants.ACTION_UPDATE_NOT_ALLOWED_CODE:
+ case ActionErrorConstants.ACTION_CHECKIN_ON_UNLOCKED_ENTITY:
+ case ActionErrorConstants.ACTION_SUBMIT_FINALIZED_ENTITY_NOT_ALLOWED:
+ case ActionErrorConstants.ACTION_SUBMIT_LOCKED_ENTITY_NOT_ALLOWED:
+ case ActionErrorConstants.ACTION_UNDO_CHECKOUT_ON_UNLOCKED_ENTITY:
+ case ActionErrorConstants.ACTION_UPDATE_NOT_ALLOWED_CODE_NAME:
+ case ActionErrorConstants.ACTION_ARTIFACT_CHECKSUM_ERROR_CODE:
+ case ActionErrorConstants.ACTION_ARTIFACT_ALREADY_EXISTS_CODE:
+ case ActionErrorConstants.ACTION_ARTIFACT_INVALID_NAME_CODE:
+ case ActionErrorConstants.ACTION_ARTIFACT_TOO_BIG_ERROR_CODE:
+ case ActionErrorConstants.ACTION_ARTIFACT_INVALID_PROTECTION_CODE:
+ case ActionErrorConstants.ACTION_ARTIFACT_DELETE_READ_ONLY:
+ case ActionErrorConstants.ACTION_NOT_LOCKED_CODE:
+ response = Response
+ .status(Response.Status.BAD_REQUEST)
+ .entity(new ActionExceptionResponse(errorCode,
+ Response.Status.BAD_REQUEST.getReasonPhrase(), actionException.getDescription()))
+ .type(MediaType.APPLICATION_JSON)
+ .build();
+ break;
+ case ActionErrorConstants.ACTION_AUTHENTICATION_ERR_CODE:
+ response = Response
+ .status(Response.Status.UNAUTHORIZED)
+ .header(ActionConstants.WWW_AUTHENTICATE_HEADER_PARAM,
+ ActionErrorConstants.ACTION_REQUEST_AUTHORIZATION_HEADER_INVALID)
+ .entity(new ActionExceptionResponse(errorCode,
+ Response.Status.UNAUTHORIZED.getReasonPhrase(), actionException.getDescription()))
+ .type(MediaType.APPLICATION_JSON)
+ .build();
+ break;
+ case ActionErrorConstants.ACTION_AUTHORIZATION_ERR_CODE:
+ case ActionErrorConstants.ACTION_EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER:
+ case ActionErrorConstants.ACTION_CHECKIN_ON_ENTITY_LOCKED_BY_OTHER_USER:
+ case ActionErrorConstants.ACTION_CHECKOUT_ON_LOCKED_ENTITY_OTHER_USER:
+ case ActionErrorConstants.ACTION_UNDO_CHECKOUT_ON_ENTITY_LOCKED_BY_OTHER_USER:
+ case ActionErrorConstants.ACTION_DELETE_ON_LOCKED_ENTITY_CODE:
+ case ActionErrorConstants.ACTION_ARTIFACT_DEL_LOCKED_OTHER_USER_CODE:
+ case ActionErrorConstants.ACTION_ARTIFACT_UPDATE_READ_ONLY:
+ response = Response
+ .status(Response.Status.FORBIDDEN)
+ .entity(
+ new ActionExceptionResponse(errorCode, Response.Status.FORBIDDEN.getReasonPhrase(),
+ actionException.getDescription())).type(MediaType.APPLICATION_JSON)
+ .build();
+ break;
+ case ActionErrorConstants.ACTION_ENTITY_NOT_EXIST_CODE:
+ case ActionErrorConstants.ACTION_ARTIFACT_ENTITY_NOT_EXIST_CODE:
+ response = Response
+ .status(Response.Status.NOT_FOUND)
+ .entity(
+ new ActionExceptionResponse(errorCode, Response.Status.NOT_FOUND.getReasonPhrase(),
+ actionException.getDescription())).type(MediaType.APPLICATION_JSON)
+ .build();
+ break;
+ case ActionErrorConstants.ACTION_INTERNAL_SERVER_ERR_CODE:
+ default:
+ response = Response
+ .status(Response.Status.INTERNAL_SERVER_ERROR)
+ .entity(new ActionExceptionResponse(errorCode,
+ Response.Status.INTERNAL_SERVER_ERROR.getReasonPhrase(),
+ actionException.getDescription()))
+ .type(MediaType.APPLICATION_JSON)
+ .build();
+ }
+ return response;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/errors/ActionExceptionResponse.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/errors/ActionExceptionResponse.java
new file mode 100644
index 0000000000..51848464a7
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/errors/ActionExceptionResponse.java
@@ -0,0 +1,66 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.action.errors;
+
+public class ActionExceptionResponse {
+ private String code;
+ private String description;
+ private String message;
+
+ /**
+ * Instantiates a new Action exception response.
+ *
+ * @param code the code
+ * @param description the description
+ * @param message the message
+ */
+ public ActionExceptionResponse(String code, String description, String message) {
+ this.code = code;
+ this.description = description;
+ this.message = message;
+ }
+
+ public String getCode() {
+ return code;
+ }
+
+ public void setCode(String code) {
+ this.code = code;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/logging/CategoryLogLevel.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/logging/CategoryLogLevel.java
new file mode 100644
index 0000000000..d87bed310f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/logging/CategoryLogLevel.java
@@ -0,0 +1,29 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.action.logging;
+
+public enum CategoryLogLevel {
+ INFO,
+ WARN,
+ DEBUG,
+ ERROR,
+ FATAL
+}
diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/logging/StatusCode.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/logging/StatusCode.java
new file mode 100644
index 0000000000..b0d5bab12b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/logging/StatusCode.java
@@ -0,0 +1,26 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.action.logging;
+
+public enum StatusCode {
+ COMPLETE,
+ ERROR
+}
diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/Action.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/Action.java
new file mode 100644
index 0000000000..176d443a81
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/Action.java
@@ -0,0 +1,255 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.action.types;
+
+import org.openecomp.sdc.action.ActionConstants;
+import org.openecomp.sdc.action.dao.types.ActionEntity;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+
+public class Action implements Comparable {
+ private String actionUuId;
+ private String actionInvariantUuId;
+ private String version;
+ private ActionStatus status;
+ private String name;
+ private String displayName;
+ private String endpointUri;
+ private List<String> vendorList;
+ private List<String> categoryList;
+ private Date timestamp;
+ private String user;
+ private List<HashMap<String, String>> supportedModels;
+ private List<HashMap<String, String>> supportedComponents;
+ //private List<HashMap<String,String>> artifacts;
+ private List<ActionArtifact> artifacts;
+ private String data;
+
+ public Action() {
+ }
+
+ /**
+ * Instantiates a new Action.
+ *
+ * @param action the action
+ */
+ public Action(Action action) {
+ this.actionUuId = action.getActionUuId();
+ this.actionInvariantUuId = action.getActionInvariantUuId();
+ this.name = action.getName();
+ this.setDisplayName(action.getDisplayName());
+ this.setVendorList(action.getVendorList());
+ this.setCategoryList(action.getCategoryList());
+ this.setTimestamp(action.getTimestamp());
+ this.setUser(action.getUser());
+ this.version = action.getVersion();
+ this.status = action.getStatus();
+ this.data = action.getData();
+ this.supportedComponents = action.getSupportedComponents();
+ this.supportedModels = action.getSupportedModels();
+ this.artifacts = action.getArtifacts();
+ }
+
+ public String getActionUuId() {
+ return actionUuId;
+ }
+
+ public void setActionUuId(String actionUuId) {
+ this.actionUuId = actionUuId;
+ }
+
+ public String getActionInvariantUuId() {
+ return actionInvariantUuId;
+ }
+
+ public void setActionInvariantUuId(String actionInvariantUuId) {
+ this.actionInvariantUuId = actionInvariantUuId;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ public ActionStatus getStatus() {
+ return status;
+ }
+
+ public void setStatus(ActionStatus status) {
+ this.status = status;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+ public void setDisplayName(String displayName) {
+ this.displayName = displayName;
+ }
+
+ public String getEndpointUri() {
+ return endpointUri;
+ }
+
+ public void setEndpointUri(String endpointUri) {
+ this.endpointUri = endpointUri;
+ }
+
+ public List<String> getVendorList() {
+ return vendorList;
+ }
+
+ public void setVendorList(List<String> vendorList) {
+ this.vendorList = vendorList;
+ }
+
+ public List<String> getCategoryList() {
+ return categoryList;
+ }
+
+ public void setCategoryList(List<String> categoryList) {
+ this.categoryList = categoryList;
+ }
+
+ public Date getTimestamp() {
+ return timestamp;
+ }
+
+ public void setTimestamp(Date timestamp) {
+ this.timestamp = timestamp;
+ }
+
+ public String getUser() {
+ return user;
+ }
+
+ public void setUser(String user) {
+ this.user = user;
+ }
+
+ public List<HashMap<String, String>> getSupportedModels() {
+ return supportedModels;
+ }
+
+ public void setSupportedModels(List<HashMap<String, String>> supportedModels) {
+ this.supportedModels = supportedModels;
+ }
+
+ public List<HashMap<String, String>> getSupportedComponents() {
+ return supportedComponents;
+ }
+
+ public void setSupportedComponents(List<HashMap<String, String>> supportedComponents) {
+ this.supportedComponents = supportedComponents;
+ }
+
+ public List<ActionArtifact> getArtifacts() {
+ return artifacts;
+ }
+
+ public void setArtifacts(List<ActionArtifact> artifacts) {
+ this.artifacts = artifacts;
+ }
+
+ public String getData() {
+ return data;
+ }
+
+ public void setData(String data) {
+ this.data = data;
+ }
+
+ /**
+ * To entity action entity.
+ *
+ * @return the action entity
+ */
+ public ActionEntity toEntity() {
+ ActionEntity destination = new ActionEntity();
+
+ destination
+ .setActionUuId(this.getActionUuId() != null ? this.getActionUuId().toUpperCase() : null);
+ destination.setActionInvariantUuId(
+ this.getActionInvariantUuId() != null ? this.getActionInvariantUuId().toUpperCase() : null);
+ destination.setName(this.getName() != null ? this.getName().toLowerCase() : null);
+ destination.setVendorList(this.getVendorList());
+ destination.setCategoryList(this.getCategoryList());
+ destination.setTimestamp(this.getTimestamp());
+ destination.setUser(this.getUser());
+ destination.setVersion(Version.valueOf(this.getVersion()));
+ if (this.getStatus() != null) {
+ destination.setStatus(this.getStatus().name());
+ }
+ destination.setSupportedComponents(
+ getIdFromMap(this.getSupportedComponents(), ActionConstants.SUPPORTED_COMPONENTS_ID));
+ destination.setSupportedModels(
+ getIdFromMap(this.getSupportedModels(), ActionConstants.SUPPORTED_MODELS_VERSION_ID));
+ destination.setData(this.getData());
+ return destination;
+ }
+
+ private List<String> getIdFromMap(List<HashMap<String, String>> map, String idName) {
+ List<String> list = new ArrayList<>();
+ if (map != null && !map.isEmpty()) {
+ map.forEach(entry -> {
+ if (entry.containsKey(idName)) {
+ list.add(entry.get(idName) != null ? entry.get(idName).toLowerCase() : null);
+ }
+ });
+ return list;
+ }
+ return null;
+ }
+
+ @Override
+ public int compareTo(Object object) {
+ Action obj = (Action) object;
+ Version thisVersion = Version.valueOf(this.version);
+ Version objVersion = Version.valueOf(obj.getVersion());
+ if (obj.getName().compareTo(this.getName()) == 0) {
+ return compareVersions(objVersion, thisVersion);
+ }
+ return obj.getName().compareTo(this.getName());
+ }
+
+ private int compareVersions(Version objVersion, Version thisVersion) {
+ if (objVersion.getMajor() == thisVersion.getMajor()) {
+ return Integer.compare(objVersion.getMinor(), thisVersion.getMinor());
+ }
+ return Integer.compare(objVersion.getMajor(), thisVersion.getMajor());
+ }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionArtifact.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionArtifact.java
new file mode 100644
index 0000000000..ef41673541
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionArtifact.java
@@ -0,0 +1,139 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.action.types;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import org.openecomp.sdc.action.dao.types.ActionArtifactEntity;
+
+import java.nio.ByteBuffer;
+import java.util.Date;
+
+public class ActionArtifact {
+ private String artifactUuId;
+
+ @JsonIgnore
+ private Integer effectiveVersion;
+
+ private String artifactName;
+ private String artifactLabel;
+ private String artifactCategory;
+ private String artifactDescription;
+ private String artifactProtection;
+ private Date timestamp;
+ private byte[] artifact;
+
+ public String getArtifactUuId() {
+ return artifactUuId;
+ }
+
+ public void setArtifactUuId(String artifactUuId) {
+ this.artifactUuId = artifactUuId;
+ }
+
+ public Integer getEffectiveVersion() {
+ return effectiveVersion;
+ }
+
+ public void setEffectiveVersion(Integer effectiveVersion) {
+ this.effectiveVersion = effectiveVersion;
+ }
+
+ public String getArtifactName() {
+ return artifactName;
+ }
+
+ public void setArtifactName(String artifactName) {
+ this.artifactName = artifactName;
+ }
+
+ public String getArtifactLabel() {
+ return artifactLabel;
+ }
+
+ public void setArtifactLabel(String artifactLabel) {
+ this.artifactLabel = artifactLabel;
+ }
+
+ public String getArtifactCategory() {
+ return artifactCategory;
+ }
+
+ public void setArtifactCategory(String artifactCategory) {
+ this.artifactCategory = artifactCategory;
+ }
+
+ public String getArtifactDescription() {
+ return artifactDescription;
+ }
+
+ public void setArtifactDescription(String artifactDescription) {
+ this.artifactDescription = artifactDescription;
+ }
+
+ public String getArtifactProtection() {
+ return artifactProtection;
+ }
+
+ public void setArtifactProtection(String artifactProtection) {
+ this.artifactProtection = artifactProtection;
+ }
+
+ public Date getTimestamp() {
+ return timestamp;
+ }
+
+ public void setTimestamp(Date timestamp) {
+ this.timestamp = timestamp;
+ }
+
+ public byte[] getArtifact() {
+ return artifact;
+ }
+
+ public void setArtifact(byte[] artifact) {
+ this.artifact = artifact;
+ }
+
+ /**
+ * To entity action artifact entity.
+ *
+ * @return the action artifact entity
+ */
+ public ActionArtifactEntity toEntity() {
+ ActionArtifactEntity destination = new ActionArtifactEntity();
+ destination.setArtifactUuId(this.getArtifactUuId());
+ destination.setEffectiveVersion(this.getEffectiveVersion());
+ destination.setArtifact(ByteBuffer.wrap(this.getArtifact()));
+
+ return destination;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof ActionArtifact) {
+ ActionArtifact temp = (ActionArtifact) obj;
+ if (artifactUuId.equals(temp.getArtifactUuId())) {
+ return true;
+ }
+ }
+ return false;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionArtifactProtection.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionArtifactProtection.java
new file mode 100644
index 0000000000..636f24d781
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionArtifactProtection.java
@@ -0,0 +1,26 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.action.types;
+
+public enum ActionArtifactProtection {
+ readOnly,
+ readWrite
+}
diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionLogResponseCode.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionLogResponseCode.java
new file mode 100644
index 0000000000..c3de8aa4dc
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionLogResponseCode.java
@@ -0,0 +1,90 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.action.types;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public enum ActionLogResponseCode {
+
+ MISSING_AUTHORIZATION(100),
+ FORBIDDEN(101),
+ UPDATE_ON_LOCKED_ENTITY(102),
+ CHECKIN_ON_LOCKED_ENTITY_OTHER_USER(103),
+ CHECKOUT_ON_LOCKED_ENTITY(104),
+ UNDO_CHECKOUT_ON_LOCKED_ENTITY(105),
+ DELETE_ARTIFACT_ON_LOCKED_ENTITY(106),
+ DELETE_ON_LOCKED_ENTITY_OTHER_USER(107),
+ INTERNAL_SERVER_ERROR(201),
+ MISSING_MANDATORY_PARAMS(300),
+ MISSING_INSTANCE_ID_HEADER(301),
+ MISSING_REQUEST_ID_HEADER(302),
+ MISSING_REQUEST_BODY(303),
+ INVALID_SEARCH_FILTER_CRITERIA(304),
+ INVALID_REQUESTED_VERSION(305),
+ CHECKSUM_ERROR(306),
+ ARTIFACT_TOO_BIG(307),
+ ACTION_NOT_FOUND(308),
+ ARTIFACT_NOT_FOUND(309),
+ METHOD_NOT_ALLOWED(310),
+ INVALID_REQUEST_PARAM(311),
+ ARTIFACT_PROTECTION_INVALID(312),
+ ACTION_NAME_UPDATE_NOT_ALLOWED(501),
+ //METHOD_NOT_ALLOWED(502),
+ ACTION_NAME_ALREADY_EXISTS(503),
+ MULTIPLE_FILTER_CRITERIA_NOT_SUPPORTED(504),
+ UPDATE_ON_UNLOCKED_ENTITY(505),
+ UPDATE_NOT_ALLOWED(506),
+ //METHOD_NOT_ALLOWED(507),
+ CHECKIN_ON_UNLOCKED_ENTITY(508),
+ SUBMIT_ON_FINAL_ENTITY(509),
+ SUBMIT_ON_LOCKED_ENTITY_OTHER_USER(510),
+ UNDO_CHECKOUT_ON_UNLOCKED_ENTITY(511),
+ ACTION_NOT_LOCKED(512),
+ ARTIFACT_ALREADY_EXISTS(513),
+ ARTIFACT_UPDATE_READ_ONLY(514),
+ ARTIFACT_DELETE_READ_ONLY(515),
+ ARTIFACT_NAME_INVALID(516),
+ ARTIFACT_CREATE_UPDATE_NOT_ALLOWED(518),
+ QUERY_FAILURE(519);
+
+ private static Map<Integer, ActionLogResponseCode> mapValueToEnum = new HashMap<>();
+
+ static {
+ for (ActionLogResponseCode responseCode : ActionLogResponseCode.values()) {
+ mapValueToEnum.put(responseCode.value, responseCode);
+ }
+ }
+
+ private int value;
+
+ ActionLogResponseCode(int value) {
+ this.value = value;
+ }
+
+ public static ActionLogResponseCode parseValue(int value) {
+ return mapValueToEnum.get(value);
+ }
+
+ public int getValue() {
+ return value;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionRequest.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionRequest.java
new file mode 100644
index 0000000000..1a20f9ecb7
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionRequest.java
@@ -0,0 +1,40 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.action.types;
+
+public enum ActionRequest {
+ CREATE_ACTION,
+ UPDATE_ACTION,
+ DELETE_ACTION,
+ GET_FILTERED_ACTIONS,
+ GET_ACTIONS_INVARIANT_ID,
+ GET_ECOMP_COMPONENTS,
+ ACTION_VERSIONING,
+ CHECKOUT_ACTION,
+ CHECKIN_ACTION,
+ SUBMIT_ACTION,
+ UNDO_CHECKOUT_ACTION,
+ UPLOAD_ARTIFACT,
+ DOWNLOAD_ARTIFACT,
+ UPDATE_ARTIFACT,
+ DELETE_ARTIFACT,
+ GET_ACTION_UUID
+}
diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionStatus.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionStatus.java
new file mode 100644
index 0000000000..af3516e1eb
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionStatus.java
@@ -0,0 +1,28 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.action.types;
+
+public enum ActionStatus {
+ Locked,
+ Available,
+ Final,
+ Deleted
+}
diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionSubOperation.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionSubOperation.java
new file mode 100644
index 0000000000..0dd97e6646
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionSubOperation.java
@@ -0,0 +1,59 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.action.types;
+
+public enum ActionSubOperation {
+ //Versioning operations
+ CREATE_ACTION_VERSION,
+ CREATE_ACTION_UNIQUE_VALUE,
+ GET_ACTION_VERSION,
+ //Action DAO operations
+ CREATE_ACTION_ENTITY,
+ GET_ACTIONENTITY_BY_ACTIONINVID,
+ GET_ACTIONENTITY_BY_ACTIONUUID,
+ GET_ACTIONENTITY_BY_VENDOR,
+ GET_ACTIONENTITY_BY_CATEGORY,
+ GET_ACTIONENTITY_BY_MODEL,
+ GET_ACTIONENTITY_BY_COMPONENT,
+ GET_ACTIONENTITY_BY_VERSION,
+ GET_ALL_ACTIONS,
+ GET_ACTIONINVID_BY_NAME,
+ GET_ECOMP_COMPONENTS_ENTITY,
+ GET_VERSIONINFO_FOR_ALL_ACTIONS,
+ GET_NAME_BY_ACTIONINVID,
+ CHECKOUT_ACTION,
+ UNDO_CHECKOUT_ACTION,
+ CHECKIN_ACTION,
+ SUBMIT_ACTION,
+ UPDATE_ACTION,
+ UPDATE_ACTION_STATUS,
+ DELETE_UNIQUEVALUE,
+ DELETE_ACTIONVERSION,
+ DELETE_ARTIFACT,
+ DELETE_ACTION,
+ //Validations
+ VALIDATE_ACTION_UNIQUE_NAME,
+ //Artifacts
+ GET_ARTIFACT_BY_ARTIFACTUUID,
+ CREATE_ACTION_ARTIFACT,
+ UPDATE_ACTION_ARTIFACT,
+ DELETE_ACTION_ARTIFACT,
+}
diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/EcompComponent.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/EcompComponent.java
new file mode 100644
index 0000000000..cbcebb13ef
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/EcompComponent.java
@@ -0,0 +1,104 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.action.types;
+
+import org.openecomp.sdc.action.dao.types.EcompComponentEntity;
+
+public class EcompComponent {
+
+ private String id;
+ private String name;
+
+ public EcompComponent() {
+ //Default constructor
+ }
+
+ public EcompComponent(String name, String id) {
+ this.name = name;
+ this.id = id;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * To entity ecomp component entity.
+ *
+ * @return the ecomp component entity
+ */
+ public EcompComponentEntity toEntity() {
+ EcompComponentEntity destination = new EcompComponentEntity();
+ destination.setId(this.getId());
+ destination.setName(this.getName());
+ return destination;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((id == null) ? 0 : id.hashCode());
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object object) {
+ if (this == object) {
+ return true;
+ }
+ if (object == null) {
+ return false;
+ }
+ if (this.getClass() != object.getClass()) {
+ return false;
+ }
+ EcompComponent obj = (EcompComponent) object;
+ if (id == null) {
+ if (obj.id != null) {
+ return false;
+ }
+ } else if (!id.equals(obj.id)) {
+ return false;
+ }
+ if (name == null) {
+ if (obj.name != null) {
+ return false;
+ }
+ } else if (!name.equals(obj.name)) {
+ return false;
+ }
+ return true;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/util/ActionUtil.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/util/ActionUtil.java
new file mode 100644
index 0000000000..787f6abc26
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/util/ActionUtil.java
@@ -0,0 +1,372 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.action.util;
+
+import static org.openecomp.sdc.action.ActionConstants.BEGIN_TIMESTAMP;
+import static org.openecomp.sdc.action.ActionConstants.ELAPSED_TIME;
+import static org.openecomp.sdc.action.ActionConstants.END_TIMESTAMP;
+import static org.openecomp.sdc.action.ActionConstants.ERROR_CATEGORY;
+import static org.openecomp.sdc.action.ActionConstants.ERROR_CODE;
+import static org.openecomp.sdc.action.ActionConstants.ERROR_DESCRIPTION;
+import static org.openecomp.sdc.action.ActionConstants.RESPONSE_CODE;
+import static org.openecomp.sdc.action.ActionConstants.RESPONSE_DESCRIPTION;
+import static org.openecomp.sdc.action.ActionConstants.SERVICE_METRIC_BEGIN_TIMESTAMP;
+import static org.openecomp.sdc.action.ActionConstants.STATUS_CODE;
+import static org.openecomp.sdc.action.ActionConstants.TARGET_ENTITY;
+import static org.openecomp.sdc.action.ActionConstants.TARGET_SERVICE_NAME;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_ALREADY_EXISTS_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_CHECKSUM_ERROR_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_DELETE_READ_ONLY;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_DEL_LOCKED_OTHER_USER_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_ENTITY_NOT_EXIST_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_INVALID_NAME_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_INVALID_PROTECTION_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_TOO_BIG_ERROR_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_UPDATE_READ_ONLY;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_AUTHENTICATION_ERR_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_AUTHORIZATION_ERR_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_CHECKIN_ON_ENTITY_LOCKED_BY_OTHER_USER;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_CHECKIN_ON_UNLOCKED_ENTITY;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_CHECKOUT_ON_LOCKED_ENTITY;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_CHECKOUT_ON_LOCKED_ENTITY_OTHER_USER;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_DELETE_ON_LOCKED_ENTITY_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_NOT_EXIST_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_UNIQUE_VALUE_ERROR;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INTERNAL_SERVER_ERR_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INVALID_INSTANCE_ID_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INVALID_PARAM_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INVALID_REQUEST_BODY_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INVALID_REQUEST_ID_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INVALID_SEARCH_CRITERIA;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_MULT_SEARCH_CRITERIA;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_NOT_LOCKED_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_QUERY_FAILURE_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_INVALID_GENERIC_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_SUBMIT_FINALIZED_ENTITY_NOT_ALLOWED;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_SUBMIT_LOCKED_ENTITY_NOT_ALLOWED;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_UNDO_CHECKOUT_ON_ENTITY_LOCKED_BY_OTHER_USER;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_UNDO_CHECKOUT_ON_UNLOCKED_ENTITY;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_UPDATE_INVALID_VERSION;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_UPDATE_NOT_ALLOWED_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_UPDATE_NOT_ALLOWED_CODE_NAME;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_UPDATE_ON_UNLOCKED_ENTITY;
+import static org.openecomp.sdc.action.types.ActionLogResponseCode.ACTION_NAME_ALREADY_EXISTS;
+import static org.openecomp.sdc.action.types.ActionLogResponseCode.ACTION_NAME_UPDATE_NOT_ALLOWED;
+import static org.openecomp.sdc.action.types.ActionLogResponseCode.ACTION_NOT_FOUND;
+import static org.openecomp.sdc.action.types.ActionLogResponseCode.ACTION_NOT_LOCKED;
+import static org.openecomp.sdc.action.types.ActionLogResponseCode.ARTIFACT_ALREADY_EXISTS;
+import static org.openecomp.sdc.action.types.ActionLogResponseCode.ARTIFACT_DELETE_READ_ONLY;
+import static org.openecomp.sdc.action.types.ActionLogResponseCode.ARTIFACT_NAME_INVALID;
+import static org.openecomp.sdc.action.types.ActionLogResponseCode.ARTIFACT_NOT_FOUND;
+import static org.openecomp.sdc.action.types.ActionLogResponseCode.ARTIFACT_PROTECTION_INVALID;
+import static org.openecomp.sdc.action.types.ActionLogResponseCode.ARTIFACT_TOO_BIG;
+import static org.openecomp.sdc.action.types.ActionLogResponseCode.ARTIFACT_UPDATE_READ_ONLY;
+import static org.openecomp.sdc.action.types.ActionLogResponseCode.CHECKIN_ON_LOCKED_ENTITY_OTHER_USER;
+import static org.openecomp.sdc.action.types.ActionLogResponseCode.CHECKIN_ON_UNLOCKED_ENTITY;
+import static org.openecomp.sdc.action.types.ActionLogResponseCode.CHECKOUT_ON_LOCKED_ENTITY;
+import static org.openecomp.sdc.action.types.ActionLogResponseCode.CHECKSUM_ERROR;
+import static org.openecomp.sdc.action.types.ActionLogResponseCode.DELETE_ARTIFACT_ON_LOCKED_ENTITY;
+import static org.openecomp.sdc.action.types.ActionLogResponseCode.DELETE_ON_LOCKED_ENTITY_OTHER_USER;
+import static org.openecomp.sdc.action.types.ActionLogResponseCode.INTERNAL_SERVER_ERROR;
+import static org.openecomp.sdc.action.types.ActionLogResponseCode.INVALID_REQUESTED_VERSION;
+import static org.openecomp.sdc.action.types.ActionLogResponseCode.INVALID_REQUEST_PARAM;
+import static org.openecomp.sdc.action.types.ActionLogResponseCode.INVALID_SEARCH_FILTER_CRITERIA;
+import static org.openecomp.sdc.action.types.ActionLogResponseCode.MISSING_AUTHORIZATION;
+import static org.openecomp.sdc.action.types.ActionLogResponseCode.MISSING_INSTANCE_ID_HEADER;
+import static org.openecomp.sdc.action.types.ActionLogResponseCode.MISSING_REQUEST_BODY;
+import static org.openecomp.sdc.action.types.ActionLogResponseCode.MISSING_REQUEST_ID_HEADER;
+import static org.openecomp.sdc.action.types.ActionLogResponseCode.MULTIPLE_FILTER_CRITERIA_NOT_SUPPORTED;
+import static org.openecomp.sdc.action.types.ActionLogResponseCode.QUERY_FAILURE;
+import static org.openecomp.sdc.action.types.ActionLogResponseCode.SUBMIT_ON_FINAL_ENTITY;
+import static org.openecomp.sdc.action.types.ActionLogResponseCode.SUBMIT_ON_LOCKED_ENTITY_OTHER_USER;
+import static org.openecomp.sdc.action.types.ActionLogResponseCode.UNDO_CHECKOUT_ON_LOCKED_ENTITY;
+import static org.openecomp.sdc.action.types.ActionLogResponseCode.UNDO_CHECKOUT_ON_UNLOCKED_ENTITY;
+import static org.openecomp.sdc.action.types.ActionLogResponseCode.UPDATE_NOT_ALLOWED;
+import static org.openecomp.sdc.action.types.ActionLogResponseCode.UPDATE_ON_LOCKED_ENTITY;
+import static org.openecomp.sdc.action.types.ActionLogResponseCode.UPDATE_ON_UNLOCKED_ENTITY;
+
+import org.openecomp.sdc.action.logging.CategoryLogLevel;
+import org.openecomp.sdc.action.logging.StatusCode;
+import org.openecomp.sdc.action.types.ActionLogResponseCode;
+import org.openecomp.sdc.action.types.ActionSubOperation;
+import org.slf4j.MDC;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.time.ZoneOffset;
+import java.util.Date;
+import java.util.TimeZone;
+
+
+public class ActionUtil {
+
+ private static final String UTC_DATE_FORMAT = "dd MMM yyyy kk:mm:ss z";
+ private static final String LOG_UTC_DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSS";
+
+ /**
+ * Get Current Timestamp in UTC format.
+ *
+ * @return Current Timestamp in UTC format.
+ */
+ public static Date getCurrentTimeStampUtc() {
+ return Date.from(java.time.ZonedDateTime.now(ZoneOffset.UTC).toInstant());
+ }
+
+ /**
+ * Convert timestamp to UTC format date string.
+ *
+ * @param timeStamp UTC timestamp to be converted to the UTC Date format.
+ * @return UTC formatted Date string from timestamp.
+ */
+ public static String getUtcDateStringFromTimestamp(Date timeStamp) {
+ DateFormat df = new SimpleDateFormat(UTC_DATE_FORMAT);
+ df.setTimeZone(TimeZone.getTimeZone("GMT"));
+ return df.format(timeStamp);
+ }
+
+ /**
+ * Convert timestamp to UTC format date string.
+ *
+ * @param timeStamp UTC timestamp to be converted to the UTC Date format.
+ * @return UTC formatted Date string from timestamp.
+ */
+ public static String getLogUtcDateStringFromTimestamp(Date timeStamp) {
+ DateFormat df = new SimpleDateFormat(LOG_UTC_DATE_FORMAT);
+ df.setTimeZone(TimeZone.getTimeZone("GMT"));
+ return df.format(timeStamp);
+ }
+
+ /**
+ * Method to set up specific attributes MDC for the current logging operation.
+ *
+ * @param subOperation Request Name.
+ */
+ public static void actionLogPreProcessor(ActionSubOperation subOperation, String targetEntity) {
+ MDC.put(BEGIN_TIMESTAMP, String.valueOf(System.currentTimeMillis()));
+ if (subOperation != null) {
+ MDC.put(TARGET_SERVICE_NAME, subOperation.name());
+ }
+
+ MDC.put(TARGET_ENTITY, targetEntity);
+ }
+
+ /**
+ * Method to enhance the MDC after the logging operation for Metrics and Audit logs.
+ *
+ * @param statusCode Response code for the current operation.
+ */
+ public static void actionLogPostProcessor(StatusCode statusCode) {
+ actionLogPostProcessor(statusCode, false);
+ }
+
+ public static void actionLogPostProcessor(StatusCode statusCode, boolean isServiceMetricLog) {
+ actionLogPostProcessor(statusCode, null, isServiceMetricLog);
+ }
+
+ public static void actionLogPostProcessor(StatusCode statusCode, String responseCode,
+ boolean isServiceMetricLog) {
+ actionLogPostProcessor(statusCode, responseCode, null, isServiceMetricLog);
+ }
+
+ /**
+ * Method to enhance the MDC after the logging operation for Metrics and Audit logs.
+ *
+ * @param statusCode Response code for the current operation.
+ */
+
+ public static void actionLogPostProcessor(StatusCode statusCode, String responseCode,
+ String responseDescription,
+ boolean isServiceMetricLog) {
+ MDC.put(STATUS_CODE, statusCode.name());
+ if (responseCode != null) {
+ int logResponseCode = getLogResponseCode(responseCode);
+ MDC.put(RESPONSE_CODE, Integer.toString(logResponseCode));
+ }
+ MDC.put(RESPONSE_DESCRIPTION, responseDescription);
+ long beginTimestamp;
+ if (isServiceMetricLog) {
+ beginTimestamp = Long.valueOf(MDC.get(SERVICE_METRIC_BEGIN_TIMESTAMP));
+ } else {
+ beginTimestamp = Long.valueOf(MDC.get(BEGIN_TIMESTAMP));
+ }
+ long endTimestamp = System.currentTimeMillis();
+ MDC.put(BEGIN_TIMESTAMP, getLogUtcDateStringFromTimestamp(new Date(beginTimestamp)));
+ MDC.put(END_TIMESTAMP, getLogUtcDateStringFromTimestamp(new Date(endTimestamp)));
+ MDC.put(ELAPSED_TIME, String.valueOf(endTimestamp - beginTimestamp));
+ }
+
+ /**
+ * Action Library Error logging Helper.
+ *
+ * @param errorCategory WARN or ERROR.
+ * @param errorCode Action Library exception code.
+ * @param errorDescription Description of the error.
+ */
+ public static void actionErrorLogProcessor(CategoryLogLevel errorCategory, String errorCode,
+ String errorDescription) {
+ MDC.put(ERROR_CATEGORY, errorCategory.name());
+ if (errorCode != null) {
+ String errorType = "";
+ switch (errorCategory) {
+ case WARN:
+ errorType = "W";
+ break;
+ case ERROR:
+ errorType = "E";
+ break;
+ case FATAL:
+ errorType = "F";
+ break;
+ default:
+ break;
+ }
+ MDC.put(ERROR_CODE, getLogResponseCode(errorCode) + errorType);
+ }
+ MDC.put(ERROR_DESCRIPTION, errorDescription);
+ }
+
+ /**
+ * Method to convert Action Library exception codes to OPENECOMP Audit codes in {@link.
+ * ActionLogResponseCode} e.g: ACT1060 --> 201.
+ *
+ * @param errorCode Action library exception code.
+ * @return Audit log code corresponding to the Action Library exception.
+ */
+ public static int getLogResponseCode(String errorCode) {
+ ActionLogResponseCode responseCode = INTERNAL_SERVER_ERROR;
+ switch (errorCode) {
+ case ACTION_REQUEST_INVALID_GENERIC_CODE:
+ responseCode = INVALID_REQUEST_PARAM;
+ break;
+ case ACTION_AUTHENTICATION_ERR_CODE:
+ break;
+ case ACTION_AUTHORIZATION_ERR_CODE:
+ responseCode = MISSING_AUTHORIZATION;
+ break;
+ case ACTION_INVALID_INSTANCE_ID_CODE:
+ responseCode = MISSING_INSTANCE_ID_HEADER;
+ break;
+ case ACTION_INVALID_REQUEST_ID_CODE:
+ responseCode = MISSING_REQUEST_ID_HEADER;
+ break;
+ case ACTION_INVALID_PARAM_CODE:
+ responseCode = INVALID_REQUEST_PARAM;
+ break;
+ case ACTION_INVALID_REQUEST_BODY_CODE:
+ responseCode = MISSING_REQUEST_BODY;
+ break;
+ case ACTION_UPDATE_NOT_ALLOWED_CODE_NAME:
+ responseCode = ACTION_NAME_UPDATE_NOT_ALLOWED;
+ break;
+ case ACTION_CHECKOUT_ON_LOCKED_ENTITY:
+ responseCode = CHECKOUT_ON_LOCKED_ENTITY;
+ break;
+ case ACTION_ENTITY_UNIQUE_VALUE_ERROR:
+ responseCode = ACTION_NAME_ALREADY_EXISTS;
+ break;
+ case ACTION_INVALID_SEARCH_CRITERIA:
+ responseCode = INVALID_SEARCH_FILTER_CRITERIA;
+ break;
+ case ACTION_MULT_SEARCH_CRITERIA:
+ responseCode = MULTIPLE_FILTER_CRITERIA_NOT_SUPPORTED;
+ break;
+ case ACTION_UPDATE_ON_UNLOCKED_ENTITY:
+ responseCode = UPDATE_ON_UNLOCKED_ENTITY;
+ break;
+ case ACTION_UPDATE_INVALID_VERSION:
+ responseCode = INVALID_REQUESTED_VERSION;
+ break;
+ case ACTION_UPDATE_NOT_ALLOWED_CODE:
+ responseCode = UPDATE_NOT_ALLOWED;
+ break;
+ case ACTION_CHECKIN_ON_UNLOCKED_ENTITY:
+ responseCode = CHECKIN_ON_UNLOCKED_ENTITY;
+ break;
+ case ACTION_SUBMIT_FINALIZED_ENTITY_NOT_ALLOWED:
+ responseCode = SUBMIT_ON_FINAL_ENTITY;
+ break;
+ case ACTION_SUBMIT_LOCKED_ENTITY_NOT_ALLOWED:
+ responseCode = SUBMIT_ON_LOCKED_ENTITY_OTHER_USER;
+ break;
+ case ACTION_UNDO_CHECKOUT_ON_UNLOCKED_ENTITY:
+ responseCode = UNDO_CHECKOUT_ON_UNLOCKED_ENTITY;
+ break;
+ case ACTION_NOT_LOCKED_CODE:
+ responseCode = ACTION_NOT_LOCKED;
+ break;
+ case ACTION_ARTIFACT_CHECKSUM_ERROR_CODE:
+ responseCode = CHECKSUM_ERROR;
+ break;
+ case ACTION_ARTIFACT_TOO_BIG_ERROR_CODE:
+ responseCode = ARTIFACT_TOO_BIG;
+ break;
+ case ACTION_ARTIFACT_ALREADY_EXISTS_CODE:
+ responseCode = ARTIFACT_ALREADY_EXISTS;
+ break;
+ case ACTION_ARTIFACT_UPDATE_READ_ONLY:
+ responseCode = ARTIFACT_UPDATE_READ_ONLY;
+ break;
+ case ACTION_ARTIFACT_DELETE_READ_ONLY:
+ responseCode = ARTIFACT_DELETE_READ_ONLY;
+ break;
+ case ACTION_ARTIFACT_INVALID_PROTECTION_CODE:
+ responseCode = ARTIFACT_PROTECTION_INVALID;
+ break;
+ case ACTION_ARTIFACT_INVALID_NAME_CODE:
+ responseCode = ARTIFACT_NAME_INVALID;
+ break;
+ case ACTION_EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER:
+ responseCode = UPDATE_ON_LOCKED_ENTITY;
+ break;
+ case ACTION_CHECKIN_ON_ENTITY_LOCKED_BY_OTHER_USER:
+ responseCode = CHECKIN_ON_LOCKED_ENTITY_OTHER_USER;
+ break;
+ case ACTION_CHECKOUT_ON_LOCKED_ENTITY_OTHER_USER:
+ responseCode = CHECKOUT_ON_LOCKED_ENTITY;
+ break;
+ case ACTION_UNDO_CHECKOUT_ON_ENTITY_LOCKED_BY_OTHER_USER:
+ responseCode = UNDO_CHECKOUT_ON_LOCKED_ENTITY;
+ break;
+ case ACTION_ENTITY_NOT_EXIST_CODE:
+ responseCode = ACTION_NOT_FOUND;
+ break;
+ case ACTION_ARTIFACT_ENTITY_NOT_EXIST_CODE:
+ responseCode = ARTIFACT_NOT_FOUND;
+ break;
+ case ACTION_ARTIFACT_DEL_LOCKED_OTHER_USER_CODE:
+ responseCode = DELETE_ARTIFACT_ON_LOCKED_ENTITY;
+ break;
+ case ACTION_DELETE_ON_LOCKED_ENTITY_CODE:
+ responseCode = DELETE_ON_LOCKED_ENTITY_OTHER_USER;
+ break;
+ case ACTION_INTERNAL_SERVER_ERR_CODE:
+ responseCode = INTERNAL_SERVER_ERROR;
+ break;
+ case ACTION_QUERY_FAILURE_CODE:
+ responseCode = QUERY_FAILURE;
+ break;
+ default:
+ break;
+ }
+ return responseCode.getValue();
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/resources/factoryConfiguration.json b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/resources/factoryConfiguration.json
new file mode 100644
index 0000000000..44da8f085e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/resources/factoryConfiguration.json
@@ -0,0 +1,4 @@
+{
+ "org.openecomp.sdc.action.dao.ActionDaoFactory":"org.openecomp.sdc.action.dao.impl.ActionDaoFactoryImpl",
+ "org.openecomp.sdc.action.dao.ActionArtifactDaoFactory":"org.openecomp.sdc.action.dao.impl.ActionArtifactDaoFactoryImpl"
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/pom.xml b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/pom.xml
new file mode 100644
index 0000000000..3abcbb55e7
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/pom.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-action-lib</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+
+ <artifactId>openecomp-sdc-action-core</artifactId>
+
+
+
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-action-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-versioning-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc.sdc_common</groupId>
+ <artifactId>openecomp-logging-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionArtifactDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionArtifactDaoFactoryImpl.java
new file mode 100644
index 0000000000..2767c9eeca
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionArtifactDaoFactoryImpl.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.action.dao.impl;
+
+import org.openecomp.sdc.action.dao.ActionArtifactDao;
+import org.openecomp.sdc.action.dao.ActionArtifactDaoFactory;
+
+public class ActionArtifactDaoFactoryImpl extends ActionArtifactDaoFactory {
+ private static final ActionArtifactDao INSTANCE = new ActionArtifactDaoImpl();
+
+ @Override
+ public ActionArtifactDao createInterface() {
+ return INSTANCE;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionArtifactDaoImpl.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionArtifactDaoImpl.java
new file mode 100644
index 0000000000..3e884c24e3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionArtifactDaoImpl.java
@@ -0,0 +1,150 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.action.dao.impl;
+
+import static org.openecomp.sdc.action.ActionConstants.TARGET_ENTITY_DB;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INTERNAL_SERVER_ERR_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_QUERY_FAILURE_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_QUERY_FAILURE_MSG;
+import static org.openecomp.sdc.action.util.ActionUtil.actionLogPostProcessor;
+
+import com.datastax.driver.core.exceptions.NoHostAvailableException;
+import com.datastax.driver.mapping.Mapper;
+import com.datastax.driver.mapping.Result;
+import com.datastax.driver.mapping.annotations.Accessor;
+import com.datastax.driver.mapping.annotations.Query;
+import org.openecomp.core.dao.impl.CassandraBaseDao;
+import org.openecomp.core.logging.api.Logger;
+import org.openecomp.core.logging.api.LoggerFactory;
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
+import org.openecomp.sdc.action.dao.ActionArtifactDao;
+import org.openecomp.sdc.action.dao.types.ActionArtifactEntity;
+import org.openecomp.sdc.action.errors.ActionException;
+import org.openecomp.sdc.action.logging.CategoryLogLevel;
+import org.openecomp.sdc.action.logging.StatusCode;
+import org.openecomp.sdc.action.types.ActionArtifact;
+import org.openecomp.sdc.action.types.ActionSubOperation;
+import org.openecomp.sdc.action.util.ActionUtil;
+
+import java.util.Collection;
+import java.util.List;
+
+public class ActionArtifactDaoImpl extends CassandraBaseDao<ActionArtifactEntity>
+ implements ActionArtifactDao {
+ private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
+ private static final Mapper<ActionArtifactEntity> mapper =
+ noSqlDb.getMappingManager().mapper(ActionArtifactEntity.class);
+ private static final ActionArtifactAccessor accessor =
+ noSqlDb.getMappingManager().createAccessor(ActionArtifactAccessor.class);
+ private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName());
+
+ @Override
+ protected Mapper<ActionArtifactEntity> getMapper() {
+ return mapper;
+ }
+
+ @Override
+ protected Object[] getKeys(ActionArtifactEntity entity) {
+ return new Object[]{entity.getArtifactUuId(), entity.getEffectiveVersion()};
+ }
+
+ @Override
+ public Collection<ActionArtifactEntity> list(ActionArtifactEntity entity) {
+ return null;
+ }
+
+
+ @Override
+ public void uploadArtifact(ActionArtifact data) {
+ log.debug(" entering uploadArtifact with artifactName= " + data.getArtifactName());
+ try {
+ ActionUtil.actionLogPreProcessor(ActionSubOperation.CREATE_ACTION_ARTIFACT, TARGET_ENTITY_DB);
+ this.create(data.toEntity());
+ ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE, null, "", false);
+ log.metrics("");
+ } catch (NoHostAvailableException noHostAvailableException) {
+ logGenericException(noHostAvailableException);
+ throw new ActionException(ACTION_INTERNAL_SERVER_ERR_CODE,
+ ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG);
+ }
+ log.debug(" exit uploadArtifact with artifactName= " + data.getArtifactName());
+ }
+
+ @Override
+ public ActionArtifact downloadArtifact(int effectiveVersion, String artifactUuId) {
+ log.debug(" entering downloadArtifact with artifactUUID= " + artifactUuId);
+ ActionArtifact actionArtifact = null;
+ try {
+ ActionUtil
+ .actionLogPreProcessor(ActionSubOperation.GET_ARTIFACT_BY_ARTIFACTUUID, TARGET_ENTITY_DB);
+ Result<ActionArtifactEntity> result;
+ result = accessor.getArtifactByUuId(effectiveVersion, artifactUuId);
+ ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE, null, "", false);
+ log.metrics("");
+ List<ActionArtifactEntity> artifactEntities = result.all();
+ if (artifactEntities != null && !artifactEntities.isEmpty()) {
+ ActionArtifactEntity artifactEntity = artifactEntities.get(0);
+ actionArtifact = artifactEntity.toDto();
+ }
+ } catch (NoHostAvailableException noHostAvailableException) {
+ logGenericException(noHostAvailableException);
+ throw new ActionException(ACTION_INTERNAL_SERVER_ERR_CODE,
+ ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG);
+ }
+ log.debug(" exit downloadArtifact with artifactUUID= " + artifactUuId);
+ return actionArtifact;
+ }
+
+ @Override
+ public void updateArtifact(ActionArtifact data) {
+ log.debug(" entering updateArtifact with artifactName= " + data.getArtifactName());
+ try {
+ ActionUtil.actionLogPreProcessor(ActionSubOperation.UPDATE_ACTION_ARTIFACT, TARGET_ENTITY_DB);
+ this.update(data.toEntity());
+ ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE, null, "", false);
+ log.metrics("");
+ } catch (NoHostAvailableException noHostAvailableException) {
+ logGenericException(noHostAvailableException);
+ throw new ActionException(ACTION_INTERNAL_SERVER_ERR_CODE,
+ ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG);
+ }
+ log.debug(" exit updateArtifact with artifactName= " + data.getArtifactName());
+ }
+
+ private void logGenericException(Exception exception) {
+ ActionUtil.actionLogPostProcessor(StatusCode.ERROR, ACTION_QUERY_FAILURE_CODE,
+ ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG, false);
+ log.metrics("");
+ ActionUtil.actionErrorLogProcessor(CategoryLogLevel.FATAL, ACTION_QUERY_FAILURE_CODE,
+ ACTION_QUERY_FAILURE_MSG);
+ log.error(exception.getMessage());
+ }
+
+ @Accessor
+ interface ActionArtifactAccessor {
+
+ @Query(
+ "SELECT * FROM action_artifact WHERE effective_version <= ? and artifactuuid = ? limit 1")
+ Result<ActionArtifactEntity> getArtifactByUuId(int effectiveVersion, String artifactUuId);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionDaoFactoryImpl.java
new file mode 100644
index 0000000000..66bd20687d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionDaoFactoryImpl.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.action.dao.impl;
+
+import org.openecomp.sdc.action.dao.ActionDao;
+import org.openecomp.sdc.action.dao.ActionDaoFactory;
+
+public class ActionDaoFactoryImpl extends ActionDaoFactory {
+ private static final ActionDao INSTANCE = new ActionDaoImpl();
+
+ @Override
+ public ActionDao createInterface() {
+ return INSTANCE;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionDaoImpl.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionDaoImpl.java
new file mode 100644
index 0000000000..29b5171470
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionDaoImpl.java
@@ -0,0 +1,583 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.action.dao.impl;
+
+import static com.datastax.driver.core.querybuilder.QueryBuilder.eq;
+import static com.datastax.driver.core.querybuilder.QueryBuilder.in;
+import static com.datastax.driver.core.querybuilder.QueryBuilder.set;
+import static org.openecomp.core.nosqldb.impl.cassandra.CassandraSessionFactory.getSession;
+import static org.openecomp.sdc.action.util.ActionUtil.actionLogPostProcessor;
+
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.Row;
+import com.datastax.driver.core.Statement;
+import com.datastax.driver.core.UDTValue;
+import com.datastax.driver.core.exceptions.NoHostAvailableException;
+import com.datastax.driver.core.querybuilder.QueryBuilder;
+import com.datastax.driver.mapping.Mapper;
+import com.datastax.driver.mapping.Result;
+import com.datastax.driver.mapping.UDTMapper;
+import com.datastax.driver.mapping.annotations.Accessor;
+import com.datastax.driver.mapping.annotations.Query;
+import org.openecomp.core.dao.impl.CassandraBaseDao;
+import org.openecomp.core.logging.api.Logger;
+import org.openecomp.core.logging.api.LoggerFactory;
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
+import org.openecomp.core.utilities.json.JsonUtil;
+import org.openecomp.sdc.action.ActionConstants;
+import org.openecomp.sdc.action.dao.ActionDao;
+import org.openecomp.sdc.action.dao.types.ActionEntity;
+import org.openecomp.sdc.action.dao.types.EcompComponentEntity;
+import org.openecomp.sdc.action.errors.ActionErrorConstants;
+import org.openecomp.sdc.action.errors.ActionException;
+import org.openecomp.sdc.action.logging.CategoryLogLevel;
+import org.openecomp.sdc.action.logging.StatusCode;
+import org.openecomp.sdc.action.types.Action;
+import org.openecomp.sdc.action.types.ActionStatus;
+import org.openecomp.sdc.action.types.ActionSubOperation;
+import org.openecomp.sdc.action.types.EcompComponent;
+import org.openecomp.sdc.action.util.ActionUtil;
+import org.openecomp.sdc.versioning.VersioningManagerFactory;
+import org.openecomp.sdc.versioning.dao.VersionInfoDao;
+import org.openecomp.sdc.versioning.dao.VersionInfoDaoFactory;
+import org.openecomp.sdc.versioning.dao.VersionInfoDeletedDao;
+import org.openecomp.sdc.versioning.dao.VersionInfoDeletedDaoFactory;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.dao.types.VersionInfoDeletedEntity;
+import org.openecomp.sdc.versioning.dao.types.VersionInfoEntity;
+import org.openecomp.sdc.versioning.types.VersionableEntityMetadata;
+import org.slf4j.MDC;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+public class ActionDaoImpl extends CassandraBaseDao<ActionEntity> implements ActionDao {
+ private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
+ private static final Mapper<ActionEntity> mapper =
+ noSqlDb.getMappingManager().mapper(ActionEntity.class);
+ private static final ActionAccessor accessor =
+ noSqlDb.getMappingManager().createAccessor(ActionAccessor.class);
+ private static final UDTMapper<Version> versionMapper =
+ noSqlDb.getMappingManager().udtMapper(Version.class);
+ private static final VersionInfoDao versionInfoDao =
+ VersionInfoDaoFactory.getInstance().createInterface();
+ private static final VersionInfoDeletedDao versionInfoDeletedDao =
+ VersionInfoDeletedDaoFactory.getInstance().createInterface();
+
+ private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName());
+
+
+ @Override
+ public void registerVersioning(String versionableEntityType) {
+ VersioningManagerFactory.getInstance().createInterface()
+ .register(versionableEntityType, new VersionableEntityMetadata(
+ mapper.getTableMetadata().getName(),
+ mapper.getTableMetadata().getPartitionKey().get(0).getName(),
+ mapper.getTableMetadata().getPartitionKey().get(1).getName()));
+ }
+
+ @Override
+ public Action createAction(Action actionDto) {
+ try {
+ ActionUtil.actionLogPreProcessor(
+ ActionSubOperation.CREATE_ACTION_ENTITY, ActionConstants.TARGET_ENTITY_DB);
+ this.create(actionDto.toEntity());
+ ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE, null, "", false);
+ log.metrics("");
+ return actionDto;
+ } catch (NoHostAvailableException noHostAvailableException) {
+ logGenericException(noHostAvailableException);
+ throw new ActionException(ActionErrorConstants.ACTION_INTERNAL_SERVER_ERR_CODE,
+ ActionErrorConstants.ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG);
+ }
+ }
+
+ @Override
+ public Action updateAction(Action actionDto) {
+ try {
+ log.debug(" entering updateAction with actionUUID= " + actionDto.getActionUuId());
+ ActionUtil
+ .actionLogPreProcessor(ActionSubOperation.UPDATE_ACTION,
+ ActionConstants.TARGET_ENTITY_DB);
+ this.update(actionDto.toEntity());
+ ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE, null, "", false);
+ log.metrics("");
+ log.debug(" exit updateAction with actionUUID= " + actionDto.getActionUuId());
+ return actionDto;
+ } catch (NoHostAvailableException noHostAvailableException) {
+ logGenericException(noHostAvailableException);
+ throw new ActionException(ActionErrorConstants.ACTION_INTERNAL_SERVER_ERR_CODE,
+ ActionErrorConstants.ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG);
+ }
+ }
+
+ @Override
+ public void deleteAction(String actionInvariantUuId) {
+ try {
+ log.debug("entering deleteAction with actionInvariantUUID = " + actionInvariantUuId);
+ ActionUtil
+ .actionLogPreProcessor(ActionSubOperation.GET_ACTION_VERSION,
+ ActionConstants.TARGET_ENTITY_DB);
+ VersionInfoDeletedEntity activeVersionEntity = versionInfoDeletedDao.get(
+ new VersionInfoDeletedEntity(ActionConstants.ACTION_VERSIONABLE_TYPE,
+ actionInvariantUuId));
+ ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE, null, "", false);
+ log.metrics("");
+ Version activeVersion = activeVersionEntity.getActiveVersion();
+ Statement getNameFromInvUuId = QueryBuilder.select().column("name").from("dox", "Action")
+ .where(eq("actioninvariantuuid", actionInvariantUuId))
+ .and(in("version", versionMapper.toUDT(activeVersion)));
+ ActionUtil
+ .actionLogPreProcessor(ActionSubOperation.GET_NAME_BY_ACTIONINVID,
+ ActionConstants.TARGET_ENTITY_DB);
+ ResultSet results = getSession().execute(getNameFromInvUuId);
+ ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE, null, "", false);
+ log.metrics("");
+ if (!results.isExhausted()) {
+ String name = results.one().getString("name");
+ List<Version> versions = getVersionsByName(name);
+ updateActionStatusForDelete(actionInvariantUuId, versions);
+ }
+ } catch (NoHostAvailableException noHostAvailableException) {
+ logGenericException(noHostAvailableException);
+ throw new ActionException(ActionErrorConstants.ACTION_INTERNAL_SERVER_ERR_CODE,
+ ActionErrorConstants.ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG);
+ }
+ log.debug("exit deleteAction");
+ }
+
+
+ @Override
+ public List<Action> getActionsByActionInvariantUuId(String actionInvariantUuId) {
+ List<Action> actions = new ArrayList<>();
+ try {
+ log.debug(" entering getActionsByActionInvariantUUID with actionInvariantUUID= "
+ + actionInvariantUuId);
+ Set<Version> viewableVersions = new HashSet<>();
+ VersionPredicate filter = new VersionPredicate();
+ ActionUtil
+ .actionLogPreProcessor(ActionSubOperation.GET_ACTION_VERSION,
+ ActionConstants.TARGET_ENTITY_DB);
+ VersionInfoEntity versionInfoEntity = versionInfoDao
+ .get(new VersionInfoEntity(ActionConstants.ACTION_VERSIONABLE_TYPE, actionInvariantUuId));
+ if (versionInfoEntity == null) {
+ //Check for action in the Delete version info table
+ VersionInfoDeletedEntity versionInfoDeletedEntity = versionInfoDeletedDao.get(
+ new VersionInfoDeletedEntity(ActionConstants.ACTION_VERSIONABLE_TYPE,
+ actionInvariantUuId));
+ if (versionInfoDeletedEntity != null) {
+ viewableVersions = versionInfoDeletedEntity.getViewableVersions();
+ //Remove intermediate minor versions from viewable versions
+ if (versionInfoDeletedEntity.getActiveVersion() != null) {
+ filter.activeVersion = versionInfoDeletedEntity.getActiveVersion();
+ filter.finalVersion = versionInfoDeletedEntity.getLatestFinalVersion();
+ viewableVersions.removeIf(filter::isIntermediateMinorVersion);
+ }
+ }
+ } else {
+ viewableVersions = versionInfoEntity.getViewableVersions();
+ //Remove intermediate minor versions from viewable versions
+ if (versionInfoEntity.getActiveVersion() != null) {
+ filter.activeVersion = versionInfoEntity.getActiveVersion();
+ filter.finalVersion = versionInfoEntity.getLatestFinalVersion();
+ viewableVersions.removeIf(filter::isIntermediateMinorVersion);
+ }
+ //Add candidate version if available
+ if (versionInfoEntity.getCandidate() != null) {
+ viewableVersions.add(versionInfoEntity.getCandidate().getVersion());
+ }
+ }
+ MDC.put(ActionConstants.TARGET_ENTITY, ActionConstants.TARGET_ENTITY_DB);
+ ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE, null, "", false);
+ log.metrics("");
+
+ log.debug(
+ "Found " + viewableVersions + " viewable version for action with actionInvariantUUID "
+ + actionInvariantUuId);
+
+ //Fetch action data for the viewable versions
+ if (!viewableVersions.isEmpty()) {
+ ActionUtil.actionLogPreProcessor(ActionSubOperation.GET_ACTIONENTITY_BY_ACTIONINVID,
+ ActionConstants.TARGET_ENTITY_DB);
+ Result<ActionEntity> result =
+ accessor.getActionsByInvId(actionInvariantUuId, viewableVersions);
+ ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE, null, "", false);
+ log.metrics("");
+ if (result != null) {
+ actions
+ .addAll(result.all().stream().map(ActionEntity::toDto).collect(Collectors.toList()));
+ }
+ }
+ } catch (NoHostAvailableException noHostAvailableException) {
+ logGenericException(noHostAvailableException);
+ throw new ActionException(ActionErrorConstants.ACTION_INTERNAL_SERVER_ERR_CODE,
+ ActionErrorConstants.ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG);
+ }
+ log.debug(
+ " exit getActionsByActionInvariantUUID with actionInvariantUUID= " + actionInvariantUuId);
+ return actions;
+ }
+
+ private void logGenericException(Exception exception) {
+ ActionUtil
+ .actionLogPostProcessor(StatusCode.ERROR, ActionErrorConstants.ACTION_QUERY_FAILURE_CODE,
+ ActionErrorConstants.ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG, false);
+ log.metrics("");
+ ActionUtil.actionErrorLogProcessor(
+ CategoryLogLevel.FATAL, ActionErrorConstants.ACTION_QUERY_FAILURE_CODE,
+ ActionErrorConstants.ACTION_QUERY_FAILURE_MSG);
+ log.error(exception.getMessage());
+ }
+
+
+ @Override
+ public List<Action> getFilteredActions(String filterType, String filterId) {
+ List<Action> actions = new ArrayList<>();
+ Result<ActionEntity> result = null;
+ log.debug(
+ " entering getFilteredActions By filterType = " + filterType + " With value = " + filterId);
+ try {
+ switch (filterType) {
+ case ActionConstants.FILTER_TYPE_VENDOR:
+ ActionUtil
+ .actionLogPreProcessor(ActionSubOperation.GET_ACTIONENTITY_BY_VENDOR,
+ ActionConstants.TARGET_ENTITY_DB);
+ result = accessor.getActionsByVendor(filterId);
+ ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE);
+ log.metrics("");
+ break;
+ case ActionConstants.FILTER_TYPE_CATEGORY:
+ ActionUtil.actionLogPreProcessor(ActionSubOperation.GET_ACTIONENTITY_BY_CATEGORY,
+ ActionConstants.TARGET_ENTITY_DB);
+ result = accessor.getActionsByCategory(filterId);
+ ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE);
+ log.metrics("");
+ break;
+ case ActionConstants.FILTER_TYPE_MODEL:
+ ActionUtil
+ .actionLogPreProcessor(ActionSubOperation.GET_ACTIONENTITY_BY_MODEL,
+ ActionConstants.TARGET_ENTITY_DB);
+ result = accessor.getActionsByModel(filterId);
+ ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE);
+ log.metrics("");
+ break;
+ case ActionConstants.FILTER_TYPE_ECOMP_COMPONENT:
+ ActionUtil.actionLogPreProcessor(ActionSubOperation.GET_ACTIONENTITY_BY_COMPONENT,
+ ActionConstants.TARGET_ENTITY_DB);
+ result = accessor.getActionsByEcompComponent(filterId);
+ ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE);
+ log.metrics("");
+ break;
+ case ActionConstants.FILTER_TYPE_NONE:
+ ActionUtil
+ .actionLogPreProcessor(ActionSubOperation.GET_ALL_ACTIONS,
+ ActionConstants.TARGET_ENTITY_DB);
+ result = accessor.getAllActions();
+ ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE);
+ log.metrics("");
+ break;
+ case ActionConstants.FILTER_TYPE_NAME:
+ ActionUtil
+ .actionLogPreProcessor(ActionSubOperation.GET_ACTIONINVID_BY_NAME,
+ ActionConstants.TARGET_ENTITY_DB);
+ result = accessor.getInvIdByName(filterId);
+ ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE);
+ log.metrics("");
+ List<ActionEntity> actionEntities = result.all();
+ if (actionEntities != null && !actionEntities.isEmpty()) {
+ String actionInvariantUuId = actionEntities.get(0).getActionInvariantUuId();
+ if (actionInvariantUuId != null) {
+ return getActionsByActionInvariantUuId(actionInvariantUuId);
+ } else {
+ return actions;
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ if (result != null) {
+ actions.addAll(result.all().stream().map(ActionEntity::toDto).collect(Collectors.toList()));
+ }
+ log.debug(
+ " exit getFilteredActions By filterType = " + filterType + " With value = " + filterId);
+ } catch (NoHostAvailableException noHostAvailableException) {
+ logGenericException(noHostAvailableException);
+ throw new ActionException(ActionErrorConstants.ACTION_INTERNAL_SERVER_ERR_CODE,
+ ActionErrorConstants.ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG);
+ }
+ return actions;
+ }
+
+ @Override
+ public List<EcompComponent> getEcompComponents() {
+ List<EcompComponent> ecompComponents = new ArrayList<>();
+ Result<EcompComponentEntity> result;
+ try {
+ log.debug(" entering getECOMPComponents ");
+ ActionUtil
+ .actionLogPreProcessor(ActionSubOperation.GET_ECOMP_COMPONENTS_ENTITY,
+ ActionConstants.TARGET_ENTITY_DB);
+ result = accessor.getEcompComponents();
+ ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE, null, "", false);
+ log.metrics("");
+ if (result != null) {
+ ecompComponents.addAll(
+ result.all().stream().map(EcompComponentEntity::toDto).collect(Collectors.toList()));
+ }
+ } catch (NoHostAvailableException noHostAvailableException) {
+ logGenericException(noHostAvailableException);
+ throw new ActionException(ActionErrorConstants.ACTION_INTERNAL_SERVER_ERR_CODE,
+ ActionErrorConstants.ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG);
+ }
+ log.debug(" exit getECOMPComponents ");
+ return ecompComponents;
+ }
+
+ @Override
+ public Action getActionsByActionUuId(String uniqueId) {
+ try {
+ log.debug(" entering getActionsByActionUUID with actionUUID= " + uniqueId);
+ ActionUtil
+ .actionLogPreProcessor(ActionSubOperation.GET_ACTIONENTITY_BY_ACTIONUUID,
+ ActionConstants.TARGET_ENTITY_DB);
+ Result<ActionEntity> result = accessor.actionInvariantUuId(uniqueId);
+ ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE, null, "", false);
+ log.metrics("");
+ if (result != null) {
+ log.debug(" exit getActionsByActionUUID with actionUUID= " + uniqueId);
+ ActionEntity entity = result.one();
+ if (entity != null) {
+ return entity.toDto();
+ }
+ }
+ log.debug(" exit getActionsByActionUUID with actionUUID= " + uniqueId);
+ return null;
+ } catch (NoHostAvailableException noHostAvailableException) {
+ logGenericException(noHostAvailableException);
+ throw new ActionException(ActionErrorConstants.ACTION_INTERNAL_SERVER_ERR_CODE,
+ ActionErrorConstants.ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG);
+ }
+ }
+
+ @Override
+ public Action getLockedAction(String actionInvariantUuId, String user) throws ActionException {
+ log.debug(" entering getLockedAction with actionInvariantUUID= " + actionInvariantUuId);
+ ActionUtil
+ .actionLogPreProcessor(ActionSubOperation.GET_ACTION_VERSION,
+ ActionConstants.TARGET_ENTITY_DB);
+ Action action = null;
+ VersionInfoEntity versionInfoEntity = versionInfoDao
+ .get(new VersionInfoEntity(ActionConstants.ACTION_VERSIONABLE_TYPE, actionInvariantUuId));
+ ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE, null, "", false);
+ log.metrics("");
+ if (versionInfoEntity != null) {
+ if (versionInfoEntity.getCandidate() != null) {
+ String actionUser = versionInfoEntity.getCandidate().getUser();
+ if (actionUser != null && actionUser.equals(user)) {
+ Set<Version> versions = new HashSet<>();
+ versions.add(versionInfoEntity.getCandidate().getVersion());
+ ActionUtil.actionLogPreProcessor(ActionSubOperation.GET_ACTIONENTITY_BY_ACTIONINVID,
+ ActionConstants.TARGET_ENTITY_DB);
+ Result<ActionEntity> result = accessor.getActionsByInvId(actionInvariantUuId, versions);
+ ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE, null, "", false);
+ log.metrics("");
+ if (result != null) {
+ ActionEntity actionEntity = result.one();
+ action = actionEntity != null ? actionEntity.toDto() : null;
+ }
+ } else {
+ throw new ActionException(ActionErrorConstants.ACTION_ARTIFACT_DEL_LOCKED_OTHER_USER_CODE,
+ String
+ .format(ActionErrorConstants.ACTION_ARTIFACT_DEL_LOCKED_OTHER_USER, actionUser));
+ }
+ } else {
+ throw new ActionException(
+ ActionErrorConstants.ACTION_NOT_LOCKED_CODE,
+ ActionErrorConstants.ACTION_NOT_LOCKED_MSG);
+ }
+ } else {
+ throw new ActionException(ActionErrorConstants.ACTION_ENTITY_NOT_EXIST_CODE,
+ ActionErrorConstants.ACTION_ENTITY_NOT_EXIST);
+ }
+ return action;
+ }
+
+ @Override
+ protected Mapper<ActionEntity> getMapper() {
+ return mapper;
+ }
+
+
+ @Override
+ protected Object[] getKeys(ActionEntity entity) {
+ return new Object[]{entity.getActionInvariantUuId(), versionMapper.toUDT(entity.getVersion())};
+ }
+
+ @Override
+ public Collection<ActionEntity> list(ActionEntity entity) {
+ return accessor.getAllActions().all();
+ }
+
+ /**
+ * param actionInvariantUuId. param versions.
+ */
+ private void updateActionStatusForDelete(String actionInvariantUuId, List<Version> versions) {
+ log.debug(
+ "entering updateActionStatusForDelete with actionInvariantUUID = " + actionInvariantUuId
+ + " for versions " + versions);
+ List<UDTValue> versionUdt = new ArrayList<>();
+
+ versions.forEach(v -> versionMapper.toUDT(v));
+ ActionUtil
+ .actionLogPreProcessor(ActionSubOperation.UPDATE_ACTION_STATUS,
+ ActionConstants.TARGET_ENTITY_DB);
+
+ //Update the status column of action table
+ Statement updateStatusStatement =
+ QueryBuilder.update("dox", "Action").with(set("status", ActionStatus.Deleted.name()))
+ .where(eq("actioninvariantuuid", actionInvariantUuId)).and(in("version", versionUdt));
+ getSession().execute(updateStatusStatement);
+ ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE, null, "", false);
+ log.metrics("");
+ //Update the status in the data field of action table
+ updateStatusInActionData(actionInvariantUuId, versions, ActionStatus.Deleted);
+ log.debug("exit updateActionStatusForDelete with actionInvariantUUID = " + actionInvariantUuId
+ + " for versions " + versions);
+ }
+
+ /**
+ * Update status for a list of versions for a given action.
+ *
+ * @param actionInvariantUuId Invariant UUID of the action.
+ * @param versions List of {@link Version} for which the status has to be updated.
+ * @param status The status value.
+ */
+ private void updateStatusInActionData(String actionInvariantUuId, List<Version> versions,
+ ActionStatus status) {
+ log.debug("entering updateStatusInActionData for actionInvariantUUID = " + actionInvariantUuId
+ + " and status = " + status + " for versions " + versions);
+ for (Version v : versions) {
+ ActionEntity entity = this.get(new ActionEntity(actionInvariantUuId, v));
+ String currentData = entity.getData();
+ Map<String, Object> currentDataMap = JsonUtil.json2Object(currentData, LinkedHashMap.class);
+ currentDataMap.put(ActionConstants.STATUS, status);
+ String updatedActionData = JsonUtil.object2Json(currentDataMap);
+ entity.setData(updatedActionData);
+ this.updateAction(entity.toDto());
+ }
+ log.debug("exit updateStatusInActionData");
+ }
+
+ /**
+ * Get list of all major and minor version values for a given action by action name.
+ *
+ * @param name Name of the action
+ * @return List of {@link Version} objects for the action
+ */
+ private List<Version> getVersionsByName(String name) {
+ log.debug("entering getVersionsByName for Action Name = " + name);
+ ActionUtil
+ .actionLogPreProcessor(ActionSubOperation.GET_ACTION_VERSION,
+ ActionConstants.TARGET_ENTITY_DB);
+ Statement statement =
+ QueryBuilder.select().column("version").from("dox", "Action").where(eq("name", name));
+ ResultSet results = getSession().execute(statement);
+ ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE, null, "", false);
+ log.metrics("");
+ List<Version> versionList = new ArrayList<>();
+ for (Row row : results) {
+ Version version = versionMapper.fromUDT((UDTValue) row.getObject("version"));
+ versionList.add(version);
+ }
+ log.debug("exit getVersionsByName for Action Name = " + name);
+ return versionList;
+ }
+
+ @Accessor
+ interface ActionAccessor {
+
+ @Query("SELECT * FROM Action")
+ Result<ActionEntity> getAllActions();
+
+ @Query("SELECT * FROM Action where actionInvariantUuId = ? and version in ? ")
+ Result<ActionEntity> getActionsByInvId(String actionInvariantUuId, Set<Version> versions);
+
+ @Query("SELECT * FROM Action where supportedModels CONTAINS ?")
+ Result<ActionEntity> getActionsByModel(String resource);
+
+ @Query("SELECT * FROM Action where supportedComponents CONTAINS ?")
+ Result<ActionEntity> getActionsByEcompComponent(String resource);
+
+ @Query("SELECT * FROM Action where vendor_list CONTAINS ?")
+ Result<ActionEntity> getActionsByVendor(String vendor);
+
+ @Query("SELECT * FROM Action where category_list CONTAINS ?")
+ Result<ActionEntity> getActionsByCategory(String vendor);
+
+ @Query("SELECT actionInvariantUuId FROM Action where name = ? limit 1")
+ Result<ActionEntity> getInvIdByName(String name);
+
+ @Query("SELECT * FROM ECOMPComponent")
+ Result<EcompComponentEntity> getEcompComponents();
+
+ @Query("SELECT * FROM Action where actionUUID = ?")
+ Result<ActionEntity> actionInvariantUuId(String actionUuId);
+
+ }
+
+ class VersionPredicate {
+ Version activeVersion;
+ Version finalVersion;
+
+ public boolean isIntermediateMinorVersion(Version version) {
+ int activeMajorVersion = activeVersion.getMajor();
+ int activeMinorVersion = activeVersion.getMinor();
+ int currentMinorVersion = version.getMinor();
+ int currentMajorVersion = version.getMajor();
+
+ if (finalVersion != null) {
+ if (finalVersion.getMajor() == activeMajorVersion
+ && currentMajorVersion == finalVersion.getMajor()) {
+ if (currentMinorVersion < activeMinorVersion && currentMinorVersion != 0) {
+ return true;
+ }
+ } else {
+ return false;
+ }
+ } else {
+ if (!version.equals(activeVersion)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/pom.xml b/openecomp-be/lib/openecomp-sdc-action-lib/pom.xml
new file mode 100644
index 0000000000..7ff15d6bce
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-action-lib/pom.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-lib</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>openecomp-sdc-action-lib</artifactId>
+ <packaging>pom</packaging>
+
+
+
+
+ <modules>
+ <module>openecomp-sdc-action-api</module>
+ <module>openecomp-sdc-action-core</module>
+ </modules>
+
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-datatypes-lib/pom.xml b/openecomp-be/lib/openecomp-sdc-datatypes-lib/pom.xml
new file mode 100644
index 0000000000..d9c7beb3e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-datatypes-lib/pom.xml
@@ -0,0 +1,38 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <artifactId>openecomp-sdc-lib</artifactId>
+ <groupId>org.openecomp.sdc</groupId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>openecomp-sdc-datatypes-lib</artifactId>
+ <name>openecomp-sdc-datatypes-lib</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-collections4</artifactId>
+ <version>4.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-mapper-asl</artifactId>
+ <version>1.9.13</version>
+ </dependency>
+ <dependency>
+ <groupId>io.swagger</groupId>
+ <artifactId>swagger-annotations</artifactId>
+ <version>1.5.3</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>${commons.lang.version}</version>
+ </dependency>
+ </dependencies>
+
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/error/ErrorLevel.java b/openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/error/ErrorLevel.java
new file mode 100644
index 0000000000..44b0733388
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/error/ErrorLevel.java
@@ -0,0 +1,25 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.datatypes.error;
+
+public enum ErrorLevel {
+ ERROR, WARNING, INFO
+}
diff --git a/openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/error/ErrorMessage.java b/openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/error/ErrorMessage.java
new file mode 100644
index 0000000000..29a443c1a0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/error/ErrorMessage.java
@@ -0,0 +1,91 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.datatypes.error;
+
+import org.apache.commons.collections4.CollectionUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+public class ErrorMessage {
+ private final ErrorLevel level;
+ private final String message;
+
+ public ErrorMessage(ErrorLevel level, String message) {
+ this.level = level;
+ this.message = message;
+ }
+
+ public ErrorLevel getLevel() {
+ return level;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ @Override
+ public boolean equals(Object object) {
+ if (this == object) {
+ return true;
+ }
+ if (object == null || getClass() != object.getClass()) {
+ return false;
+ }
+
+ ErrorMessage that = (ErrorMessage) object;
+
+ return level == that.level && message.equals(that.message);
+
+ }
+
+ @Override
+ public int hashCode() {
+ int result = level.hashCode();
+ result = 31 * result + message.hashCode();
+ return result;
+ }
+
+ public static class ErrorMessageUtil {
+
+ /**
+ * Add message list.
+ *
+ * @param fileName the file name
+ * @param errorMap the error map
+ * @return the list
+ */
+ public static List<ErrorMessage> addMessage(String fileName,
+ Map<String, List<ErrorMessage>> errorMap) {
+ List<ErrorMessage> fileErrorList;
+ fileErrorList = errorMap.get(fileName);
+ if (CollectionUtils.isEmpty(fileErrorList)) {
+ fileErrorList = new ArrayList<>();
+ errorMap.put(fileName, fileErrorList);
+ }
+
+ return fileErrorList;
+ }
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/model/AsdcModel.java b/openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/model/AsdcModel.java
new file mode 100644
index 0000000000..7d873432b9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/model/AsdcModel.java
@@ -0,0 +1,24 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.datatypes.model;
+
+public interface AsdcModel {
+}
diff --git a/openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/model/heat/ForbiddenHeatResourceTypes.java b/openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/model/heat/ForbiddenHeatResourceTypes.java
new file mode 100644
index 0000000000..a8df6bbbe4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/model/heat/ForbiddenHeatResourceTypes.java
@@ -0,0 +1,56 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.datatypes.model.heat;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+public enum ForbiddenHeatResourceTypes {
+ HEAT_FLOATING_IP_TYPE("OS::Neutron::FloatingIP");
+
+
+ private static Map<String, ForbiddenHeatResourceTypes> stringToForbiddenHeatResourceTypeMap;
+
+ static {
+ stringToForbiddenHeatResourceTypeMap = new HashMap<>();
+
+ for (ForbiddenHeatResourceTypes type : ForbiddenHeatResourceTypes.values()) {
+ stringToForbiddenHeatResourceTypeMap.put(type.forbiddenType, type);
+ }
+ }
+
+ private String forbiddenType;
+
+
+ ForbiddenHeatResourceTypes(String forbiddenType) {
+ this.forbiddenType = forbiddenType;
+ }
+
+ public static ForbiddenHeatResourceTypes findByForbiddenHeatResource(String heatResource) {
+ return stringToForbiddenHeatResourceTypeMap.get(heatResource);
+ }
+
+
+ public static boolean isResourceTypeValid(String resourceType) {
+ return Objects.nonNull(findByForbiddenHeatResource(resourceType));
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/pom.xml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/pom.xml
new file mode 100644
index 0000000000..a2038a212e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/pom.xml
@@ -0,0 +1,46 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-lib</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../..</relativePath>
+ </parent>
+
+ <name>openecomp-sdc-enrichment-api</name>
+ <artifactId>openecomp-sdc-enrichment-api</artifactId>
+
+
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-facade-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>io.swagger</groupId>
+ <artifactId>swagger-annotations</artifactId>
+ <version>1.5.3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-datatypes-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <version>1.1.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-versioning-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/EnrichmentArtifactsServiceFactory.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/EnrichmentArtifactsServiceFactory.java
new file mode 100644
index 0000000000..63daa03f15
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/EnrichmentArtifactsServiceFactory.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.enrichment;
+
+import org.openecomp.core.enrichment.enrichmentartifacts.EnrichmentArtifactsService;
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+public abstract class EnrichmentArtifactsServiceFactory
+ extends AbstractComponentFactory<EnrichmentArtifactsService> {
+
+ public static EnrichmentArtifactsServiceFactory getInstance() {
+ return AbstractFactory.getInstance(EnrichmentArtifactsServiceFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/EnrichmentConstants.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/EnrichmentConstants.java
new file mode 100644
index 0000000000..c3726aa4e9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/EnrichmentConstants.java
@@ -0,0 +1,29 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.enrichment;
+
+import java.io.File;
+
+public final class EnrichmentConstants {
+ public static final String EXTERNAL_ARTIFACTS_DIR =
+ "Artifacts" + File.separator + "ExternalArtifacts";
+ //public static final String HEAT_META_FILNAME = "HEAT.meta";
+}
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/api/EnrichmentManager.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/api/EnrichmentManager.java
new file mode 100644
index 0000000000..2ddde6001b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/api/EnrichmentManager.java
@@ -0,0 +1,43 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.enrichment.api;
+
+import org.openecomp.core.enrichment.types.EntityInfo;
+import org.openecomp.sdc.datatypes.error.ErrorMessage;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.util.List;
+import java.util.Map;
+
+public interface EnrichmentManager<T> {
+
+
+ Map<String, List<ErrorMessage>> enrich();
+
+ void addEntityInput(String type, EntityInfo info);
+
+ void initInput(String key, Version version);
+
+ void addModel(T model);
+
+ T getModel();
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/enrichmentartifacts/EnrichmentArtifactsService.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/enrichmentartifacts/EnrichmentArtifactsService.java
new file mode 100644
index 0000000000..0eab0a916c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/enrichmentartifacts/EnrichmentArtifactsService.java
@@ -0,0 +1,29 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.enrichment.enrichmentartifacts;
+
+import org.openecomp.core.utilities.file.FileContentHandler;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+public interface EnrichmentArtifactsService {
+
+ FileContentHandler addMibs(String vspId, Version version);
+}
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/factory/EnrichmentManagerFactory.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/factory/EnrichmentManagerFactory.java
new file mode 100644
index 0000000000..9199aeff6c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/factory/EnrichmentManagerFactory.java
@@ -0,0 +1,32 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.enrichment.factory;
+
+import org.openecomp.core.enrichment.api.EnrichmentManager;
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+public abstract class EnrichmentManagerFactory extends AbstractComponentFactory<EnrichmentManager> {
+
+ public static EnrichmentManagerFactory getInstance() {
+ return AbstractFactory.getInstance(EnrichmentManagerFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/CeilometerInfo.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/CeilometerInfo.java
new file mode 100644
index 0000000000..71c1ff5cec
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/CeilometerInfo.java
@@ -0,0 +1,71 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.enrichment.types;
+
+public class CeilometerInfo {
+
+ private String name;
+ private String type;
+ private String unit;
+ private String category;
+ private String description;
+
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getUnit() {
+ return unit;
+ }
+
+ public void setUnit(String unit) {
+ this.unit = unit;
+ }
+
+ public String getCategory() {
+ return category;
+ }
+
+ public void setCategory(String category) {
+ this.category = category;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/ComponentArtifactType.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/ComponentArtifactType.java
new file mode 100644
index 0000000000..c91cff0e1e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/ComponentArtifactType.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.enrichment.types;
+
+public enum ComponentArtifactType {
+ SNMP_POLL,
+ SNMP_TRAP;
+
+
+ public static ComponentArtifactType getComponentArtifactType(boolean isTrap) {
+ return isTrap ? SNMP_TRAP : SNMP_POLL;
+ }
+
+}
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/ComponentCeilometerInfo.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/ComponentCeilometerInfo.java
new file mode 100644
index 0000000000..a0c1be51e9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/ComponentCeilometerInfo.java
@@ -0,0 +1,36 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.enrichment.types;
+
+import java.util.List;
+
+public class ComponentCeilometerInfo {
+
+ private List<CeilometerInfo> ceilometerInfoList;
+
+ public List<CeilometerInfo> getCeilometerInfoList() {
+ return ceilometerInfoList;
+ }
+
+ public void setCeilometerInfoList(List<CeilometerInfo> ceilometerInfoList) {
+ this.ceilometerInfoList = ceilometerInfoList;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/ComponentMibInfo.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/ComponentMibInfo.java
new file mode 100644
index 0000000000..88dbedc136
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/ComponentMibInfo.java
@@ -0,0 +1,45 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.enrichment.types;
+
+public class ComponentMibInfo {
+ private MibInfo snmpTrap;
+ private MibInfo snmpPoll;
+
+
+ public MibInfo getSnmpTrap() {
+ return snmpTrap;
+ }
+
+ public void setSnmpTrap(MibInfo snmpTrap) {
+ this.snmpTrap = snmpTrap;
+ }
+
+ public MibInfo getSnmpPoll() {
+ return snmpPoll;
+ }
+
+ public void setSnmpPoll(MibInfo snmpPoll) {
+ this.snmpPoll = snmpPoll;
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/EntityInfo.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/EntityInfo.java
new file mode 100644
index 0000000000..ac80eb9d03
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/EntityInfo.java
@@ -0,0 +1,27 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.enrichment.types;
+
+
+public interface EntityInfo {
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/MibInfo.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/MibInfo.java
new file mode 100644
index 0000000000..f5d2fcb90d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/MibInfo.java
@@ -0,0 +1,45 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.enrichment.types;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+
+public class MibInfo {
+ private String name;
+ private byte[] content;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public InputStream getContent() {
+ return new ByteArrayInputStream(this.content);
+ }
+
+ public void setContent(byte[] content) {
+ this.content = content;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/resources/factoryConfiguration.json b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/resources/factoryConfiguration.json
new file mode 100644
index 0000000000..d22184e3da
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/resources/factoryConfiguration.json
@@ -0,0 +1,4 @@
+{
+ "org.openecomp.core.enrichment.factory.EnrichmentManagerFactory": "org.openecomp.sdc.enrichment.impl.EnrichmentManagerFactoryImpl",
+ "org.openecomp.core.enrichment.EnrichmentArtifactsServiceFactory": "org.openecomp.sdc.enrichment.EnrichmentArtifactsServiceFactoryImpl"
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/pom.xml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/pom.xml
new file mode 100644
index 0000000000..1f0452cdfb
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/pom.xml
@@ -0,0 +1,90 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+
+
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-lib</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../..</relativePath>
+ </parent>
+
+ <name>openecomp-sdc-enrichment-core</name>
+ <artifactId>openecomp-sdc-enrichment-core</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.7.10</version>
+
+ </dependency>
+
+
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <version>1.1.2</version>
+
+ </dependency>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <scope>test</scope>
+ <version>6.8.5</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>snakeyaml</artifactId>
+ <groupId>org.yaml</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>RELEASE</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-utilities-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-enrichment-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-enrichment-impl</artifactId>
+ <version>${project.version}</version>
+ <!--scope>runtime</scope-->
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-datatypes-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <scope>test</scope>
+ <version>1.10.19</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <version>19.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-model-impl</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/main/java/org/openecomp/sdc/enrichment/EnrichmentArtifactsServiceFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/main/java/org/openecomp/sdc/enrichment/EnrichmentArtifactsServiceFactoryImpl.java
new file mode 100644
index 0000000000..1075b07a49
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/main/java/org/openecomp/sdc/enrichment/EnrichmentArtifactsServiceFactoryImpl.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.enrichment;
+
+import org.openecomp.core.enrichment.EnrichmentArtifactsServiceFactory;
+import org.openecomp.core.enrichment.enrichmentartifacts.EnrichmentArtifactsService;
+import org.openecomp.sdc.enrichment.enrichmentartifacts.EnrichmentArtifactsServiceImpl;
+
+public class EnrichmentArtifactsServiceFactoryImpl extends EnrichmentArtifactsServiceFactory {
+ private static EnrichmentArtifactsService INSTANCE = new EnrichmentArtifactsServiceImpl();
+
+ @Override
+ public EnrichmentArtifactsService createInterface() {
+ return INSTANCE;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/main/java/org/openecomp/sdc/enrichment/enrichmentartifacts/EnrichmentArtifactsServiceImpl.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/main/java/org/openecomp/sdc/enrichment/enrichmentartifacts/EnrichmentArtifactsServiceImpl.java
new file mode 100644
index 0000000000..2b7fef1e6b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/main/java/org/openecomp/sdc/enrichment/enrichmentartifacts/EnrichmentArtifactsServiceImpl.java
@@ -0,0 +1,61 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.enrichment.enrichmentartifacts;
+
+import org.openecomp.core.enrichment.enrichmentartifacts.EnrichmentArtifactsService;
+import org.openecomp.core.model.dao.EnrichedServiceModelDao;
+import org.openecomp.core.model.dao.EnrichedServiceModelDaoFactory;
+import org.openecomp.core.model.types.ServiceArtifact;
+import org.openecomp.core.model.types.ServiceElement;
+import org.openecomp.core.utilities.file.FileContentHandler;
+import org.openecomp.sdc.common.utils.AsdcCommon;
+import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.util.List;
+
+public class EnrichmentArtifactsServiceImpl implements EnrichmentArtifactsService {
+ EnrichedServiceModelDao<ToscaServiceModel, ServiceElement> enrichedServiceModelDao =
+ EnrichedServiceModelDaoFactory.getInstance().createInterface();
+
+ @Override
+ public FileContentHandler addMibs(String vspId, Version version) {
+ FileContentHandler externalArtifacts = new FileContentHandler();
+ List<ServiceArtifact> mibsList = enrichedServiceModelDao.getExternalArtifacts(vspId, version);
+ addMibsToFileContentHandler(mibsList, externalArtifacts);
+
+ return externalArtifacts;
+ }
+
+
+ private void addMibsToFileContentHandler(List<ServiceArtifact> mibsList,
+ FileContentHandler externalArtifacts) {
+ for (ServiceArtifact serviceArtifact : mibsList) {
+ String filename = serviceArtifact.getName();
+ externalArtifacts.addFile(filename, serviceArtifact.getContent());
+ }
+ }
+
+
+ private boolean isFileArtifact(String filename) {
+ return !filename.contains(AsdcCommon.HEAT_META) && !filename.contains(AsdcCommon.MANIFEST_NAME);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/main/java/org/openecomp/sdc/enrichment/impl/EnrichmentManagerFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/main/java/org/openecomp/sdc/enrichment/impl/EnrichmentManagerFactoryImpl.java
new file mode 100644
index 0000000000..abbb577075
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/main/java/org/openecomp/sdc/enrichment/impl/EnrichmentManagerFactoryImpl.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.enrichment.impl;
+
+
+import org.openecomp.core.enrichment.api.EnrichmentManager;
+import org.openecomp.core.enrichment.factory.EnrichmentManagerFactory;
+
+
+public class EnrichmentManagerFactoryImpl extends EnrichmentManagerFactory {
+
+ @Override
+ public EnrichmentManager createInterface() {
+ return new EnrichmentManagerImpl();
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/main/java/org/openecomp/sdc/enrichment/impl/EnrichmentManagerImpl.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/main/java/org/openecomp/sdc/enrichment/impl/EnrichmentManagerImpl.java
new file mode 100644
index 0000000000..ef29108402
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/main/java/org/openecomp/sdc/enrichment/impl/EnrichmentManagerImpl.java
@@ -0,0 +1,84 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.enrichment.impl;
+
+import org.openecomp.core.enrichment.api.EnrichmentManager;
+import org.openecomp.core.enrichment.types.EntityInfo;
+import org.openecomp.sdc.datatypes.error.ErrorMessage;
+import org.openecomp.sdc.enrichment.EnrichmentInfo;
+import org.openecomp.sdc.enrichment.factory.EnricherHandlerFactory;
+import org.openecomp.sdc.enrichment.inter.Enricher;
+import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.List;
+import java.util.Map;
+
+public class EnrichmentManagerImpl implements EnrichmentManager<ToscaServiceModel> {
+
+ private static Logger logger = LoggerFactory.getLogger(EnrichmentManagerImpl.class);
+
+ private EnrichmentInfo input = null;
+ private ToscaServiceModel model;
+
+
+ @Override
+ public Map<String, List<ErrorMessage>> enrich() {
+ List<Enricher> enricherList =
+ EnricherHandlerFactory.getInstance().createInterface().getEnrichers();
+ for (Enricher enricher : enricherList) {
+ enricher.setInput(input);
+ enricher.setModel(model);
+ enricher.enrich();
+ }
+
+ return null;
+ }
+
+ @Override
+ public void addEntityInput(String type, EntityInfo info) {
+ this.input.addEntityInfo(type, info);
+ }
+
+
+ @Override
+ public void initInput(String key, Version version) {
+ input = new EnrichmentInfo();
+ input.setKey(key);
+ input.setVersion(version);
+ }
+
+ @Override
+ public void addModel(ToscaServiceModel model) {
+
+ this.model = model;
+ }
+
+
+ @Override
+ public ToscaServiceModel getModel() {
+ return this.model;
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/java/org/openecomp/sdc/enrichment/impl/EnrichmentManagerImplTest.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/java/org/openecomp/sdc/enrichment/impl/EnrichmentManagerImplTest.java
new file mode 100644
index 0000000000..6bc5a0e864
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/java/org/openecomp/sdc/enrichment/impl/EnrichmentManagerImplTest.java
@@ -0,0 +1,245 @@
+package org.openecomp.sdc.enrichment.impl;
+
+import org.openecomp.sdc.enrichment.impl.tosca.ComponentInfo;
+import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.tosca.services.ToscaFileOutputService;
+import org.openecomp.sdc.tosca.services.impl.ToscaFileOutputServiceCsarImpl;
+import org.openecomp.sdc.tosca.services.yamlutil.ToscaExtensionYamlUtil;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.core.enrichment.api.EnrichmentManager;
+import org.openecomp.core.enrichment.factory.EnrichmentManagerFactory;
+
+import org.openecomp.core.enrichment.types.CeilometerInfo;
+import org.openecomp.core.enrichment.types.ComponentCeilometerInfo;
+import org.openecomp.core.utilities.file.FileUtils;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+import java.io.*;
+import java.net.URL;
+import java.nio.file.NotDirectoryException;
+import java.util.*;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+
+import static org.junit.Assert.assertEquals;
+
+
+public class EnrichmentManagerImplTest {
+
+
+ private static ToscaServiceModel loadToscaServiceModel(String serviceTemplatesPath,
+ String globalServiceTemplatesPath,
+ String entryDefinitionServiceTemplate)
+ throws IOException {
+ ToscaExtensionYamlUtil toscaExtensionYamlUtil = new ToscaExtensionYamlUtil();
+ Map<String, ServiceTemplate> serviceTemplates = new HashMap<>();
+ if (entryDefinitionServiceTemplate == null) {
+ entryDefinitionServiceTemplate = "MainServiceTemplate.yaml";
+ }
+
+ loadServiceTemplates(serviceTemplatesPath, toscaExtensionYamlUtil, serviceTemplates);
+ if (globalServiceTemplatesPath != null) {
+ loadServiceTemplates(globalServiceTemplatesPath, toscaExtensionYamlUtil, serviceTemplates);
+ }
+
+ return new ToscaServiceModel(null, serviceTemplates, entryDefinitionServiceTemplate);
+ }
+
+ private static void loadServiceTemplates(String serviceTemplatesPath,
+ ToscaExtensionYamlUtil toscaExtensionYamlUtil,
+ Map<String, ServiceTemplate> serviceTemplates)
+ throws IOException {
+ URL urlFile = EnrichmentManagerImplTest.class.getResource(serviceTemplatesPath);
+ if (urlFile != null) {
+ File pathFile = new File(urlFile.getFile());
+ File[] files = pathFile.listFiles();
+ if (files != null) {
+ addServiceTemplateFiles(serviceTemplates, files, toscaExtensionYamlUtil);
+ } else {
+ throw new NotDirectoryException(serviceTemplatesPath);
+ }
+ } else {
+ throw new NotDirectoryException(serviceTemplatesPath);
+ }
+ }
+
+ private static void addServiceTemplateFiles(Map<String, ServiceTemplate> serviceTemplates,
+ File[] files,
+ ToscaExtensionYamlUtil toscaExtensionYamlUtil)
+ throws IOException {
+ for (File file : files) {
+ if (!file.getName().equals("CSR.zip") && !file.isDirectory()) {
+ try (InputStream yamlFile = new FileInputStream(file)) {
+ ServiceTemplate serviceTemplateFromYaml =
+ toscaExtensionYamlUtil.yamlToObject(yamlFile, ServiceTemplate.class);
+ serviceTemplates.put(file.getName(), serviceTemplateFromYaml);
+ try {
+ yamlFile.close();
+ } catch (IOException ignore) {
+ }
+ } catch (FileNotFoundException e) {
+ throw e;
+ } catch (IOException e) {
+ throw e;
+ }
+ }
+ }
+ }
+
+// @Test
+ public void testEnrichmentManagerImpl() throws Exception {
+ Assert.assertTrue(
+ EnrichmentManagerFactory.getInstance().createInterface() instanceof EnrichmentManagerImpl);
+ }
+
+// @Test
+ public void testEnrichModel() throws Exception {
+ ToscaServiceModel toscaServiceModel =
+ loadToscaServiceModel("/extractServiceComposition/onlyComponents/",
+ "/extractServiceComposition/toscaGlobalServiceTemplates/", "OnlyComponentsST.yaml");
+ EnrichmentManager enrichmentManager = EnrichmentManagerFactory.getInstance().createInterface();
+ enrichmentManager.initInput("vsp_enrich", new Version(0, 1));
+ enrichmentManager.addModel(toscaServiceModel);
+
+ String[] componentNames = new String[]{"org.openecomp.resource.vfc.nodes.heat.pcrf_psm",
+ "org.openecomp.resource.vfc.nodes.heat.pcm"};
+ ComponentInfo componentInfo = new ComponentInfo();
+
+ CeilometerInfo ceilometerInfo;
+ ComponentCeilometerInfo componentCeilometerInfo = new ComponentCeilometerInfo();
+ componentCeilometerInfo.setCeilometerInfoList(new ArrayList<>());
+ componentInfo.setCeilometerInfo(componentCeilometerInfo);
+
+ for (String componentName : componentNames) {
+ ceilometerInfo =
+ getCeilometerInfo("instance", "Gauge", "instance", "compute", "Existence of instance");
+ componentInfo.getCeilometerInfo().getCeilometerInfoList().add(ceilometerInfo);
+ ceilometerInfo = getCeilometerInfo("memory", "Gauge", "MB", "compute",
+ "Volume of RAM allocated to the instance");
+ componentInfo.getCeilometerInfo().getCeilometerInfoList().add(ceilometerInfo);
+ ceilometerInfo = getCeilometerInfo("cpu", "Cumulative", "ns", "compute", "CPU time used");
+ componentInfo.getCeilometerInfo().getCeilometerInfoList().add(ceilometerInfo);
+ enrichmentManager.addEntityInput(componentName, componentInfo);
+ }
+
+ enrichmentManager.enrich();
+
+ File csrFile = getToscaModelAsFile(toscaServiceModel);
+ compareActualAndExpected(csrFile);
+
+ }
+
+// @Test
+ public void testAllEnrichModel() throws Exception {
+ ToscaServiceModel toscaServiceModel = loadToscaServiceModel("/extractServiceComposition/all/",
+ "/extractServiceComposition/toscaGlobalServiceTemplates/", "OnlyComponentsST.yaml");
+ EnrichmentManager enrichmentManager = EnrichmentManagerFactory.getInstance().createInterface();
+ enrichmentManager.initInput("vsp_enrich", new Version(0, 1));
+ enrichmentManager.addModel(toscaServiceModel);
+
+ String[] componentNames = new String[]{"org.openecomp.resource.vfc.nodes.heat.pcrf_psm",
+ "org.openecomp.resource.vfc.nodes.heat.pcm"};
+ ComponentInfo componentInfo = new ComponentInfo();
+
+ CeilometerInfo ceilometerInfo;
+ ComponentCeilometerInfo componentCeilometerInfo = new ComponentCeilometerInfo();
+ componentCeilometerInfo.setCeilometerInfoList(new ArrayList<>());
+ componentInfo.setCeilometerInfo(componentCeilometerInfo);
+
+ for (String componentName : componentNames) {
+ ceilometerInfo =
+ getCeilometerInfo("instance", "Gauge", "instance", "compute", "Existence of instance");
+ componentInfo.getCeilometerInfo().getCeilometerInfoList().add(ceilometerInfo);
+ ceilometerInfo = getCeilometerInfo("memory", "Gauge", "MB", "compute",
+ "Volume of RAM allocated to the instance");
+ componentInfo.getCeilometerInfo().getCeilometerInfoList().add(ceilometerInfo);
+ ceilometerInfo = getCeilometerInfo("cpu", "Cumulative", "ns", "compute", "CPU time used");
+ componentInfo.getCeilometerInfo().getCeilometerInfoList().add(ceilometerInfo);
+ enrichmentManager.addEntityInput(componentName, componentInfo);
+ }
+
+ enrichmentManager.enrich();
+
+ File csrFile = getToscaModelAsFile(toscaServiceModel);
+ compareActualAndExpected(csrFile);
+
+ }
+
+ private CeilometerInfo getCeilometerInfo(String name, String type, String unit, String category,
+ String description) {
+ CeilometerInfo ceilometerInfo = new CeilometerInfo();
+ ceilometerInfo.setName(name);
+ ceilometerInfo.setType(type);
+ ceilometerInfo.setUnit(unit);
+ ceilometerInfo.setCategory(category);
+ ceilometerInfo.setDescription(description);
+ return ceilometerInfo;
+ }
+
+ private File getToscaModelAsFile(ToscaServiceModel toscaServiceModel) throws IOException {
+
+ URL inputFilesUrl =
+ EnrichmentManagerImplTest.class.getResource("/extractServiceComposition/onlyComponents");
+ String path = inputFilesUrl.getPath();
+
+
+ File file = new File(path + "/" + "CSR.zip");
+ file.createNewFile();
+
+ try (FileOutputStream fos = new FileOutputStream(file))
+
+ {
+ ToscaFileOutputService toscaFileOutputService = new ToscaFileOutputServiceCsarImpl();
+ fos.write(toscaFileOutputService.createOutputFile(toscaServiceModel, null));
+ }
+
+ return file;
+ }
+
+ protected void compareActualAndExpected(File actualFile) throws IOException {
+
+ URL url = EnrichmentManagerImplTest.class
+ .getResource("/extractServiceComposition/onlyComponents/expectedOutput");
+ Set<String> expectedResultFileNameSet = new HashSet<>();
+ Map<String, byte[]> expectedResultMap = new HashMap<>();
+ String path = url.getPath();
+ File pathFile = new File(path);
+ File[] files = pathFile.listFiles();
+ org.junit.Assert.assertNotNull("manifest files is empty", files);
+ for (File expectedFile : files) {
+ expectedResultFileNameSet.add(expectedFile.getName());
+ try (FileInputStream input = new FileInputStream(expectedFile)) {
+ expectedResultMap.put(expectedFile.getName(), FileUtils.toByteArray(input));
+ }
+ }
+
+ try (FileInputStream fis = new FileInputStream(actualFile);
+ ZipInputStream zis = new ZipInputStream(new BufferedInputStream(fis))) {
+ ZipEntry entry;
+ String name;
+ String expected;
+ String actual;
+
+ while ((entry = zis.getNextEntry()) != null) {
+
+ name = entry.getName()
+ .substring(entry.getName().lastIndexOf(File.separator) + 1, entry.getName().length());
+ if (expectedResultFileNameSet.contains(name)) {
+ expected = new String(expectedResultMap.get(name)).trim().replace("\r", "");
+ actual = new String(FileUtils.toByteArray(zis)).trim().replace("\r", "");
+ assertEquals("difference in file: " + name, expected, actual);
+
+ expectedResultFileNameSet.remove(name);
+ }
+ }
+ if (expectedResultFileNameSet.isEmpty()) {
+ expectedResultFileNameSet.forEach(System.out::println);
+ }
+ }
+ assertEquals(0, expectedResultFileNameSet.size());
+ }
+
+
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/OnlyComponentsST.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/OnlyComponentsST.yaml
new file mode 100644
index 0000000000..54f39e4219
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/OnlyComponentsST.yaml
@@ -0,0 +1,350 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.pcrf_psm:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.pcm:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ Internal2_name:
+ label: Internal2_name
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_name
+ Internal1_shared:
+ label: Internal1_shared
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_shared
+ FSB1_volume_name:
+ label: FSB1_volume
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_volume_1
+ jsa_cidr:
+ label: jsa_cidr
+ hidden: false
+ immutable: false
+ type: string
+ description: jsa_cidr
+ default: 107.243.7.128/26
+ availabilityzone_name:
+ label: availabilityzone_name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone_name
+ fsb1-name:
+ label: FSB1_name
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_name
+ pcm_image_name:
+ label: pcm_image_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_image_name
+ Internal2_external:
+ label: Internal2_external
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_external
+ Internal2_forwarding_mode:
+ label: Internal2_forwarding_mode
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_forwarding_mode
+ pcrf_psm_flavor_name:
+ label: pcrf_psm_flavor_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_flavor_name
+ pcrf_psm_image_name:
+ label: pcrf_psm_image_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_image_name
+ FSB_1_image:
+ label: MME_FSB1
+ hidden: false
+ immutable: false
+ type: string
+ description: MME_FSB1_15B-CP04-r5a01
+ volume_size:
+ label: volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: my volume size 320GB
+ fsb1-Internal1-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ Internal2_shared:
+ label: Internal2_shared
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_shared
+ pcm_server_name:
+ label: pcm_server_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_server_name
+ Internal1_net_name:
+ label: Internal1_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_net_name
+ oam_net_name:
+ label: oam_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: oam_net_name
+ fsb1-flavor:
+ label: FSB1_flavor
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_flavor
+ fsb1-Internal2-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ volume_type:
+ label: volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: volume type Gold
+ fsb1-zone:
+ label: FSB1_zone
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_zone
+ fsb_zone:
+ label: FSB1_zone
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_zone
+ security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: String
+ jsa_net_name:
+ label: jsa_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: jsa_net_name
+ default: jsa_log_net_0
+ pcrf_psm_server_name:
+ label: pcrf_psm_server_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_server_name
+ pcm_flavor_name:
+ label: pcm_flavor_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_flavor_name
+ oam_net_id:
+ label: oam_net_id
+ hidden: false
+ immutable: false
+ type: string
+ description: oam_net_id
+ fsb2-Internal1-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ Internal1_forwarding_mode:
+ label: Internal1_forwarding_mode
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_forwarding_mode
+ pcrf_cps_net_name:
+ label: pcrf_cps_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_cps_net_name
+ cps_net_name:
+ label: cps_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: cps_net_name
+ pcrf_security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: String
+ Internal1_external:
+ label: Internal1_external
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_external
+ node_templates:
+ nova_local_type_pcm1:
+ type: org.openecomp.resource.vfc.nodes.heat.pcm
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ user_data: UNSUPPORTED_RESOURCE_server_init
+ nova_local_type_pcm2:
+ type: org.openecomp.resource.vfc.nodes.heat.pcm
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ user_data: UNSUPPORTED_RESOURCE_server_init
+ nova_local_type_pcrf_psm:
+ type: org.openecomp.resource.vfc.nodes.heat.pcrf_psm
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ user_data: UNSUPPORTED_RESOURCE_server_init
+ nova_global_type1:
+ type: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ properties:
+ flavor:
+ get_input: fsb1-flavor
+ availability_zone:
+ get_input: fsb_zone
+ name:
+ get_input: fsb1-name
+ nova_global_type2:
+ type: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ properties:
+ flavor:
+ get_input: fsb1-flavor
+ availability_zone:
+ get_input: fsb_zone
+ metadata:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: '0644'
+ content:
+ str_replace:
+ template:
+ get_artifact:
+ - SELF
+ - nimbus-ethernet
+ params:
+ $dev: eth0
+ $netmask:
+ get_input: cps_net_mask
+ $ip:
+ get_input: cps_net_ip
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth1
+ permissions: '0644'
+ content:
+ str_replace:
+ template:
+ get_artifact:
+ - SELF
+ - nimbus-ethernet-gw
+ params:
+ $dev: eth1
+ $netmask:
+ get_input: oam_net_mask
+ $gateway:
+ get_input: oam_net_gw
+ $ip:
+ get_input: oam_net_ip
+ name:
+ get_input: fsb1-name
+ artifacts:
+ nimbus-ethernet-gw:
+ type: tosca.artifacts.Deployment
+ file: ../Artifacts/nimbus-ethernet-gw
+ nimbus-ethernet:
+ type: tosca.artifacts.Deployment
+ file: ../Artifacts/nimbus-ethernet
+ groups:
+ ep-jsa_net:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/ep-jsa_net.yaml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - nova_local_type_pcm1
+ - nova_local_type_pcm2
+ - nova_local_type_pcrf_psm
+ - nova_global_type1
+ - nova_global_type2 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/OnlyComponentsST_01.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/OnlyComponentsST_01.yaml
new file mode 100644
index 0000000000..54f39e4219
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/OnlyComponentsST_01.yaml
@@ -0,0 +1,350 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.pcrf_psm:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.pcm:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ Internal2_name:
+ label: Internal2_name
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_name
+ Internal1_shared:
+ label: Internal1_shared
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_shared
+ FSB1_volume_name:
+ label: FSB1_volume
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_volume_1
+ jsa_cidr:
+ label: jsa_cidr
+ hidden: false
+ immutable: false
+ type: string
+ description: jsa_cidr
+ default: 107.243.7.128/26
+ availabilityzone_name:
+ label: availabilityzone_name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone_name
+ fsb1-name:
+ label: FSB1_name
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_name
+ pcm_image_name:
+ label: pcm_image_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_image_name
+ Internal2_external:
+ label: Internal2_external
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_external
+ Internal2_forwarding_mode:
+ label: Internal2_forwarding_mode
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_forwarding_mode
+ pcrf_psm_flavor_name:
+ label: pcrf_psm_flavor_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_flavor_name
+ pcrf_psm_image_name:
+ label: pcrf_psm_image_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_image_name
+ FSB_1_image:
+ label: MME_FSB1
+ hidden: false
+ immutable: false
+ type: string
+ description: MME_FSB1_15B-CP04-r5a01
+ volume_size:
+ label: volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: my volume size 320GB
+ fsb1-Internal1-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ Internal2_shared:
+ label: Internal2_shared
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_shared
+ pcm_server_name:
+ label: pcm_server_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_server_name
+ Internal1_net_name:
+ label: Internal1_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_net_name
+ oam_net_name:
+ label: oam_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: oam_net_name
+ fsb1-flavor:
+ label: FSB1_flavor
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_flavor
+ fsb1-Internal2-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ volume_type:
+ label: volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: volume type Gold
+ fsb1-zone:
+ label: FSB1_zone
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_zone
+ fsb_zone:
+ label: FSB1_zone
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_zone
+ security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: String
+ jsa_net_name:
+ label: jsa_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: jsa_net_name
+ default: jsa_log_net_0
+ pcrf_psm_server_name:
+ label: pcrf_psm_server_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_server_name
+ pcm_flavor_name:
+ label: pcm_flavor_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_flavor_name
+ oam_net_id:
+ label: oam_net_id
+ hidden: false
+ immutable: false
+ type: string
+ description: oam_net_id
+ fsb2-Internal1-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ Internal1_forwarding_mode:
+ label: Internal1_forwarding_mode
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_forwarding_mode
+ pcrf_cps_net_name:
+ label: pcrf_cps_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_cps_net_name
+ cps_net_name:
+ label: cps_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: cps_net_name
+ pcrf_security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: String
+ Internal1_external:
+ label: Internal1_external
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_external
+ node_templates:
+ nova_local_type_pcm1:
+ type: org.openecomp.resource.vfc.nodes.heat.pcm
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ user_data: UNSUPPORTED_RESOURCE_server_init
+ nova_local_type_pcm2:
+ type: org.openecomp.resource.vfc.nodes.heat.pcm
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ user_data: UNSUPPORTED_RESOURCE_server_init
+ nova_local_type_pcrf_psm:
+ type: org.openecomp.resource.vfc.nodes.heat.pcrf_psm
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ user_data: UNSUPPORTED_RESOURCE_server_init
+ nova_global_type1:
+ type: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ properties:
+ flavor:
+ get_input: fsb1-flavor
+ availability_zone:
+ get_input: fsb_zone
+ name:
+ get_input: fsb1-name
+ nova_global_type2:
+ type: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ properties:
+ flavor:
+ get_input: fsb1-flavor
+ availability_zone:
+ get_input: fsb_zone
+ metadata:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: '0644'
+ content:
+ str_replace:
+ template:
+ get_artifact:
+ - SELF
+ - nimbus-ethernet
+ params:
+ $dev: eth0
+ $netmask:
+ get_input: cps_net_mask
+ $ip:
+ get_input: cps_net_ip
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth1
+ permissions: '0644'
+ content:
+ str_replace:
+ template:
+ get_artifact:
+ - SELF
+ - nimbus-ethernet-gw
+ params:
+ $dev: eth1
+ $netmask:
+ get_input: oam_net_mask
+ $gateway:
+ get_input: oam_net_gw
+ $ip:
+ get_input: oam_net_ip
+ name:
+ get_input: fsb1-name
+ artifacts:
+ nimbus-ethernet-gw:
+ type: tosca.artifacts.Deployment
+ file: ../Artifacts/nimbus-ethernet-gw
+ nimbus-ethernet:
+ type: tosca.artifacts.Deployment
+ file: ../Artifacts/nimbus-ethernet
+ groups:
+ ep-jsa_net:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/ep-jsa_net.yaml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - nova_local_type_pcm1
+ - nova_local_type_pcm2
+ - nova_local_type_pcrf_psm
+ - nova_global_type1
+ - nova_global_type2 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/VariouseST.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/VariouseST.yaml
new file mode 100644
index 0000000000..1f39bfb314
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/VariouseST.yaml
@@ -0,0 +1,363 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.pcrf_psm:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.pcm:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ Internal2_name:
+ label: Internal2_name
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_name
+ Internal1_shared:
+ label: Internal1_shared
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_shared
+ FSB1_volume_name:
+ label: FSB1_volume
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_volume_1
+ jsa_cidr:
+ label: jsa_cidr
+ hidden: false
+ immutable: false
+ type: string
+ description: jsa_cidr
+ default: 107.243.7.128/26
+ availabilityzone_name:
+ label: availabilityzone_name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone_name
+ fsb1-name:
+ label: FSB1_name
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_name
+ pcm_image_name:
+ label: pcm_image_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_image_name
+ Internal2_external:
+ label: Internal2_external
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_external
+ Internal2_forwarding_mode:
+ label: Internal2_forwarding_mode
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_forwarding_mode
+ pcrf_psm_flavor_name:
+ label: pcrf_psm_flavor_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_flavor_name
+ pcrf_psm_image_name:
+ label: pcrf_psm_image_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_image_name
+ FSB_1_image:
+ label: MME_FSB1
+ hidden: false
+ immutable: false
+ type: string
+ description: MME_FSB1_15B-CP04-r5a01
+ volume_size:
+ label: volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: my volume size 320GB
+ fsb1-Internal1-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ Internal2_shared:
+ label: Internal2_shared
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_shared
+ pcm_server_name:
+ label: pcm_server_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_server_name
+ Internal1_net_name:
+ label: Internal1_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_net_name
+ oam_net_name:
+ label: oam_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: oam_net_name
+ fsb1-flavor:
+ label: FSB1_flavor
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_flavor
+ fsb1-Internal2-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ volume_type:
+ label: volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: volume type Gold
+ fsb1-zone:
+ label: FSB1_zone
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_zone
+ fsb_zone:
+ label: FSB1_zone
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_zone
+ security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: String
+ jsa_net_name:
+ label: jsa_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: jsa_net_name
+ default: jsa_log_net_0
+ pcrf_psm_server_name:
+ label: pcrf_psm_server_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_server_name
+ pcm_flavor_name:
+ label: pcm_flavor_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_flavor_name
+ oam_net_id:
+ label: oam_net_id
+ hidden: false
+ immutable: false
+ type: string
+ description: oam_net_id
+ fsb2-Internal1-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ Internal1_forwarding_mode:
+ label: Internal1_forwarding_mode
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_forwarding_mode
+ pcrf_cps_net_name:
+ label: pcrf_cps_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_cps_net_name
+ cps_net_name:
+ label: cps_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: cps_net_name
+ pcrf_security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: String
+ Internal1_external:
+ label: Internal1_external
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_external
+ node_templates:
+
+ jsa_net:
+ type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
+ properties:
+ shared: true
+ network_name:
+ get_input: jsa_net_name
+ jsa_net1:
+ type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
+ properties:
+ shared: true
+ network_name:
+ get_input: jsa_net_name
+ nova_local_type_pcm1:
+ type: org.openecomp.resource.vfc.nodes.heat.pcm
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ user_data: UNSUPPORTED_RESOURCE_server_init
+ nova_local_type_pcm2:
+ type: org.openecomp.resource.vfc.nodes.heat.pcm
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ user_data: UNSUPPORTED_RESOURCE_server_init
+ nova_local_type_pcrf_psm:
+ type: org.openecomp.resource.vfc.nodes.heat.pcrf_psm
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ user_data: UNSUPPORTED_RESOURCE_server_init
+ nova_global_type1:
+ type: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ properties:
+ flavor:
+ get_input: fsb1-flavor
+ availability_zone:
+ get_input: fsb_zone
+ name:
+ get_input: fsb1-name
+ nova_global_type2:
+ type: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ properties:
+ flavor:
+ get_input: fsb1-flavor
+ availability_zone:
+ get_input: fsb_zone
+ metadata:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: '0644'
+ content:
+ str_replace:
+ template:
+ get_artifact:
+ - SELF
+ - nimbus-ethernet
+ params:
+ $dev: eth0
+ $netmask:
+ get_input: cps_net_mask
+ $ip:
+ get_input: cps_net_ip
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth1
+ permissions: '0644'
+ content:
+ str_replace:
+ template:
+ get_artifact:
+ - SELF
+ - nimbus-ethernet-gw
+ params:
+ $dev: eth1
+ $netmask:
+ get_input: oam_net_mask
+ $gateway:
+ get_input: oam_net_gw
+ $ip:
+ get_input: oam_net_ip
+ name:
+ get_input: fsb1-name
+ artifacts:
+ nimbus-ethernet-gw:
+ type: tosca.artifacts.Deployment
+ file: ../Artifacts/nimbus-ethernet-gw
+ nimbus-ethernet:
+ type: tosca.artifacts.Deployment
+ file: ../Artifacts/nimbus-ethernet
+ groups:
+ ep-jsa_net:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/ep-jsa_net.yaml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - nova_local_type_pcm1
+ - nova_local_type_pcm2
+ - nova_local_type_pcrf_psm
+ - nova_global_type1
+ - nova_global_type2 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/expectedOutput/OnlyComponentsST.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/expectedOutput/OnlyComponentsST.yaml
new file mode 100644
index 0000000000..9ec1aa2a8d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/expectedOutput/OnlyComponentsST.yaml
@@ -0,0 +1,550 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.pcrf_psm:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ capabilities:
+ instance:
+ type: org.openecomp.capabilities.metric.Ceilometer
+ description: Existence of instance
+ properties:
+ name:
+ type: string
+ description: Ceilometer metric type name to monitor. (The name ceilometer is using)
+ required: true
+ default: instance
+ status: SUPPORTED
+ description:
+ type: string
+ description: Description of the metric
+ required: false
+ status: SUPPORTED
+ unit:
+ type: string
+ description: Unit of the metric value
+ required: true
+ default: instance
+ status: SUPPORTED
+ type:
+ type: string
+ description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc.
+ required: true
+ default: Gauge
+ status: SUPPORTED
+ category:
+ type: string
+ description: Category of the metric, for an example, compute, disk, network, storage and etc.
+ required: false
+ default: compute
+ status: SUPPORTED
+ memory:
+ type: org.openecomp.capabilities.metric.Ceilometer
+ description: Volume of RAM allocated to the instance
+ properties:
+ name:
+ type: string
+ description: Ceilometer metric type name to monitor. (The name ceilometer is using)
+ required: true
+ default: memory
+ status: SUPPORTED
+ description:
+ type: string
+ description: Description of the metric
+ required: false
+ status: SUPPORTED
+ unit:
+ type: string
+ description: Unit of the metric value
+ required: true
+ default: MB
+ status: SUPPORTED
+ type:
+ type: string
+ description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc.
+ required: true
+ default: Gauge
+ status: SUPPORTED
+ category:
+ type: string
+ description: Category of the metric, for an example, compute, disk, network, storage and etc.
+ required: false
+ default: compute
+ status: SUPPORTED
+ cpu:
+ type: org.openecomp.capabilities.metric.Ceilometer
+ description: CPU time used
+ properties:
+ name:
+ type: string
+ description: Ceilometer metric type name to monitor. (The name ceilometer is using)
+ required: true
+ default: cpu
+ status: SUPPORTED
+ description:
+ type: string
+ description: Description of the metric
+ required: false
+ status: SUPPORTED
+ unit:
+ type: string
+ description: Unit of the metric value
+ required: true
+ default: ns
+ status: SUPPORTED
+ type:
+ type: string
+ description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc.
+ required: true
+ default: Cumulative
+ status: SUPPORTED
+ category:
+ type: string
+ description: Category of the metric, for an example, compute, disk, network, storage and etc.
+ required: false
+ default: compute
+ status: SUPPORTED
+ org.openecomp.resource.vfc.nodes.heat.pcm:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ capabilities:
+ instance:
+ type: org.openecomp.capabilities.metric.Ceilometer
+ description: Existence of instance
+ properties:
+ name:
+ type: string
+ description: Ceilometer metric type name to monitor. (The name ceilometer is using)
+ required: true
+ default: instance
+ status: SUPPORTED
+ description:
+ type: string
+ description: Description of the metric
+ required: false
+ status: SUPPORTED
+ unit:
+ type: string
+ description: Unit of the metric value
+ required: true
+ default: instance
+ status: SUPPORTED
+ type:
+ type: string
+ description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc.
+ required: true
+ default: Gauge
+ status: SUPPORTED
+ category:
+ type: string
+ description: Category of the metric, for an example, compute, disk, network, storage and etc.
+ required: false
+ default: compute
+ status: SUPPORTED
+ memory:
+ type: org.openecomp.capabilities.metric.Ceilometer
+ description: Volume of RAM allocated to the instance
+ properties:
+ name:
+ type: string
+ description: Ceilometer metric type name to monitor. (The name ceilometer is using)
+ required: true
+ default: memory
+ status: SUPPORTED
+ description:
+ type: string
+ description: Description of the metric
+ required: false
+ status: SUPPORTED
+ unit:
+ type: string
+ description: Unit of the metric value
+ required: true
+ default: MB
+ status: SUPPORTED
+ type:
+ type: string
+ description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc.
+ required: true
+ default: Gauge
+ status: SUPPORTED
+ category:
+ type: string
+ description: Category of the metric, for an example, compute, disk, network, storage and etc.
+ required: false
+ default: compute
+ status: SUPPORTED
+ cpu:
+ type: org.openecomp.capabilities.metric.Ceilometer
+ description: CPU time used
+ properties:
+ name:
+ type: string
+ description: Ceilometer metric type name to monitor. (The name ceilometer is using)
+ required: true
+ default: cpu
+ status: SUPPORTED
+ description:
+ type: string
+ description: Description of the metric
+ required: false
+ status: SUPPORTED
+ unit:
+ type: string
+ description: Unit of the metric value
+ required: true
+ default: ns
+ status: SUPPORTED
+ type:
+ type: string
+ description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc.
+ required: true
+ default: Cumulative
+ status: SUPPORTED
+ category:
+ type: string
+ description: Category of the metric, for an example, compute, disk, network, storage and etc.
+ required: false
+ default: compute
+ status: SUPPORTED
+topology_template:
+ inputs:
+ Internal2_name:
+ label: Internal2_name
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_name
+ Internal1_shared:
+ label: Internal1_shared
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_shared
+ FSB1_volume_name:
+ label: FSB1_volume
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_volume_1
+ jsa_cidr:
+ label: jsa_cidr
+ hidden: false
+ immutable: false
+ type: string
+ description: jsa_cidr
+ default: 107.243.7.128/26
+ availabilityzone_name:
+ label: availabilityzone_name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone_name
+ fsb1-name:
+ label: FSB1_name
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_name
+ pcm_image_name:
+ label: pcm_image_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_image_name
+ Internal2_external:
+ label: Internal2_external
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_external
+ Internal2_forwarding_mode:
+ label: Internal2_forwarding_mode
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_forwarding_mode
+ pcrf_psm_flavor_name:
+ label: pcrf_psm_flavor_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_flavor_name
+ pcrf_psm_image_name:
+ label: pcrf_psm_image_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_image_name
+ FSB_1_image:
+ label: MME_FSB1
+ hidden: false
+ immutable: false
+ type: string
+ description: MME_FSB1_15B-CP04-r5a01
+ volume_size:
+ label: volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: my volume size 320GB
+ fsb1-Internal1-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ Internal2_shared:
+ label: Internal2_shared
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_shared
+ pcm_server_name:
+ label: pcm_server_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_server_name
+ Internal1_net_name:
+ label: Internal1_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_net_name
+ oam_net_name:
+ label: oam_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: oam_net_name
+ fsb1-flavor:
+ label: FSB1_flavor
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_flavor
+ fsb1-Internal2-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ volume_type:
+ label: volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: volume type Gold
+ fsb1-zone:
+ label: FSB1_zone
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_zone
+ fsb_zone:
+ label: FSB1_zone
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_zone
+ security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: String
+ jsa_net_name:
+ label: jsa_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: jsa_net_name
+ default: jsa_log_net_0
+ pcrf_psm_server_name:
+ label: pcrf_psm_server_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_server_name
+ pcm_flavor_name:
+ label: pcm_flavor_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_flavor_name
+ oam_net_id:
+ label: oam_net_id
+ hidden: false
+ immutable: false
+ type: string
+ description: oam_net_id
+ fsb2-Internal1-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ Internal1_forwarding_mode:
+ label: Internal1_forwarding_mode
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_forwarding_mode
+ pcrf_cps_net_name:
+ label: pcrf_cps_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_cps_net_name
+ cps_net_name:
+ label: cps_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: cps_net_name
+ pcrf_security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: String
+ Internal1_external:
+ label: Internal1_external
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_external
+ node_templates:
+ nova_local_type_pcm1:
+ type: org.openecomp.resource.vfc.nodes.heat.pcm
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ user_data: UNSUPPORTED_RESOURCE_server_init
+ nova_local_type_pcm2:
+ type: org.openecomp.resource.vfc.nodes.heat.pcm
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ user_data: UNSUPPORTED_RESOURCE_server_init
+ nova_local_type_pcrf_psm:
+ type: org.openecomp.resource.vfc.nodes.heat.pcrf_psm
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ user_data: UNSUPPORTED_RESOURCE_server_init
+ nova_global_type1:
+ type: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ properties:
+ flavor:
+ get_input: fsb1-flavor
+ availability_zone:
+ get_input: fsb_zone
+ name:
+ get_input: fsb1-name
+ nova_global_type2:
+ type: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ properties:
+ flavor:
+ get_input: fsb1-flavor
+ availability_zone:
+ get_input: fsb_zone
+ metadata:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: '0644'
+ content:
+ str_replace:
+ template:
+ get_artifact:
+ - SELF
+ - nimbus-ethernet
+ params:
+ $dev: eth0
+ $netmask:
+ get_input: cps_net_mask
+ $ip:
+ get_input: cps_net_ip
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth1
+ permissions: '0644'
+ content:
+ str_replace:
+ template:
+ get_artifact:
+ - SELF
+ - nimbus-ethernet-gw
+ params:
+ $dev: eth1
+ $netmask:
+ get_input: oam_net_mask
+ $gateway:
+ get_input: oam_net_gw
+ $ip:
+ get_input: oam_net_ip
+ name:
+ get_input: fsb1-name
+ artifacts:
+ nimbus-ethernet-gw:
+ type: tosca.artifacts.Deployment
+ file: ../Artifacts/nimbus-ethernet-gw
+ nimbus-ethernet:
+ type: tosca.artifacts.Deployment
+ file: ../Artifacts/nimbus-ethernet
+ groups:
+ ep-jsa_net:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/ep-jsa_net.yaml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - nova_local_type_pcm1
+ - nova_local_type_pcm2
+ - nova_local_type_pcrf_psm
+ - nova_global_type1
+ - nova_global_type2 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/expectedOutput/OnlyComponentsST_01.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/expectedOutput/OnlyComponentsST_01.yaml
new file mode 100644
index 0000000000..9ec1aa2a8d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/expectedOutput/OnlyComponentsST_01.yaml
@@ -0,0 +1,550 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.pcrf_psm:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ capabilities:
+ instance:
+ type: org.openecomp.capabilities.metric.Ceilometer
+ description: Existence of instance
+ properties:
+ name:
+ type: string
+ description: Ceilometer metric type name to monitor. (The name ceilometer is using)
+ required: true
+ default: instance
+ status: SUPPORTED
+ description:
+ type: string
+ description: Description of the metric
+ required: false
+ status: SUPPORTED
+ unit:
+ type: string
+ description: Unit of the metric value
+ required: true
+ default: instance
+ status: SUPPORTED
+ type:
+ type: string
+ description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc.
+ required: true
+ default: Gauge
+ status: SUPPORTED
+ category:
+ type: string
+ description: Category of the metric, for an example, compute, disk, network, storage and etc.
+ required: false
+ default: compute
+ status: SUPPORTED
+ memory:
+ type: org.openecomp.capabilities.metric.Ceilometer
+ description: Volume of RAM allocated to the instance
+ properties:
+ name:
+ type: string
+ description: Ceilometer metric type name to monitor. (The name ceilometer is using)
+ required: true
+ default: memory
+ status: SUPPORTED
+ description:
+ type: string
+ description: Description of the metric
+ required: false
+ status: SUPPORTED
+ unit:
+ type: string
+ description: Unit of the metric value
+ required: true
+ default: MB
+ status: SUPPORTED
+ type:
+ type: string
+ description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc.
+ required: true
+ default: Gauge
+ status: SUPPORTED
+ category:
+ type: string
+ description: Category of the metric, for an example, compute, disk, network, storage and etc.
+ required: false
+ default: compute
+ status: SUPPORTED
+ cpu:
+ type: org.openecomp.capabilities.metric.Ceilometer
+ description: CPU time used
+ properties:
+ name:
+ type: string
+ description: Ceilometer metric type name to monitor. (The name ceilometer is using)
+ required: true
+ default: cpu
+ status: SUPPORTED
+ description:
+ type: string
+ description: Description of the metric
+ required: false
+ status: SUPPORTED
+ unit:
+ type: string
+ description: Unit of the metric value
+ required: true
+ default: ns
+ status: SUPPORTED
+ type:
+ type: string
+ description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc.
+ required: true
+ default: Cumulative
+ status: SUPPORTED
+ category:
+ type: string
+ description: Category of the metric, for an example, compute, disk, network, storage and etc.
+ required: false
+ default: compute
+ status: SUPPORTED
+ org.openecomp.resource.vfc.nodes.heat.pcm:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ capabilities:
+ instance:
+ type: org.openecomp.capabilities.metric.Ceilometer
+ description: Existence of instance
+ properties:
+ name:
+ type: string
+ description: Ceilometer metric type name to monitor. (The name ceilometer is using)
+ required: true
+ default: instance
+ status: SUPPORTED
+ description:
+ type: string
+ description: Description of the metric
+ required: false
+ status: SUPPORTED
+ unit:
+ type: string
+ description: Unit of the metric value
+ required: true
+ default: instance
+ status: SUPPORTED
+ type:
+ type: string
+ description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc.
+ required: true
+ default: Gauge
+ status: SUPPORTED
+ category:
+ type: string
+ description: Category of the metric, for an example, compute, disk, network, storage and etc.
+ required: false
+ default: compute
+ status: SUPPORTED
+ memory:
+ type: org.openecomp.capabilities.metric.Ceilometer
+ description: Volume of RAM allocated to the instance
+ properties:
+ name:
+ type: string
+ description: Ceilometer metric type name to monitor. (The name ceilometer is using)
+ required: true
+ default: memory
+ status: SUPPORTED
+ description:
+ type: string
+ description: Description of the metric
+ required: false
+ status: SUPPORTED
+ unit:
+ type: string
+ description: Unit of the metric value
+ required: true
+ default: MB
+ status: SUPPORTED
+ type:
+ type: string
+ description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc.
+ required: true
+ default: Gauge
+ status: SUPPORTED
+ category:
+ type: string
+ description: Category of the metric, for an example, compute, disk, network, storage and etc.
+ required: false
+ default: compute
+ status: SUPPORTED
+ cpu:
+ type: org.openecomp.capabilities.metric.Ceilometer
+ description: CPU time used
+ properties:
+ name:
+ type: string
+ description: Ceilometer metric type name to monitor. (The name ceilometer is using)
+ required: true
+ default: cpu
+ status: SUPPORTED
+ description:
+ type: string
+ description: Description of the metric
+ required: false
+ status: SUPPORTED
+ unit:
+ type: string
+ description: Unit of the metric value
+ required: true
+ default: ns
+ status: SUPPORTED
+ type:
+ type: string
+ description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc.
+ required: true
+ default: Cumulative
+ status: SUPPORTED
+ category:
+ type: string
+ description: Category of the metric, for an example, compute, disk, network, storage and etc.
+ required: false
+ default: compute
+ status: SUPPORTED
+topology_template:
+ inputs:
+ Internal2_name:
+ label: Internal2_name
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_name
+ Internal1_shared:
+ label: Internal1_shared
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_shared
+ FSB1_volume_name:
+ label: FSB1_volume
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_volume_1
+ jsa_cidr:
+ label: jsa_cidr
+ hidden: false
+ immutable: false
+ type: string
+ description: jsa_cidr
+ default: 107.243.7.128/26
+ availabilityzone_name:
+ label: availabilityzone_name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone_name
+ fsb1-name:
+ label: FSB1_name
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_name
+ pcm_image_name:
+ label: pcm_image_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_image_name
+ Internal2_external:
+ label: Internal2_external
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_external
+ Internal2_forwarding_mode:
+ label: Internal2_forwarding_mode
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_forwarding_mode
+ pcrf_psm_flavor_name:
+ label: pcrf_psm_flavor_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_flavor_name
+ pcrf_psm_image_name:
+ label: pcrf_psm_image_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_image_name
+ FSB_1_image:
+ label: MME_FSB1
+ hidden: false
+ immutable: false
+ type: string
+ description: MME_FSB1_15B-CP04-r5a01
+ volume_size:
+ label: volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: my volume size 320GB
+ fsb1-Internal1-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ Internal2_shared:
+ label: Internal2_shared
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_shared
+ pcm_server_name:
+ label: pcm_server_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_server_name
+ Internal1_net_name:
+ label: Internal1_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_net_name
+ oam_net_name:
+ label: oam_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: oam_net_name
+ fsb1-flavor:
+ label: FSB1_flavor
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_flavor
+ fsb1-Internal2-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ volume_type:
+ label: volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: volume type Gold
+ fsb1-zone:
+ label: FSB1_zone
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_zone
+ fsb_zone:
+ label: FSB1_zone
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_zone
+ security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: String
+ jsa_net_name:
+ label: jsa_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: jsa_net_name
+ default: jsa_log_net_0
+ pcrf_psm_server_name:
+ label: pcrf_psm_server_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_server_name
+ pcm_flavor_name:
+ label: pcm_flavor_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_flavor_name
+ oam_net_id:
+ label: oam_net_id
+ hidden: false
+ immutable: false
+ type: string
+ description: oam_net_id
+ fsb2-Internal1-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ Internal1_forwarding_mode:
+ label: Internal1_forwarding_mode
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_forwarding_mode
+ pcrf_cps_net_name:
+ label: pcrf_cps_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_cps_net_name
+ cps_net_name:
+ label: cps_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: cps_net_name
+ pcrf_security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: String
+ Internal1_external:
+ label: Internal1_external
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_external
+ node_templates:
+ nova_local_type_pcm1:
+ type: org.openecomp.resource.vfc.nodes.heat.pcm
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ user_data: UNSUPPORTED_RESOURCE_server_init
+ nova_local_type_pcm2:
+ type: org.openecomp.resource.vfc.nodes.heat.pcm
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ user_data: UNSUPPORTED_RESOURCE_server_init
+ nova_local_type_pcrf_psm:
+ type: org.openecomp.resource.vfc.nodes.heat.pcrf_psm
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ user_data: UNSUPPORTED_RESOURCE_server_init
+ nova_global_type1:
+ type: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ properties:
+ flavor:
+ get_input: fsb1-flavor
+ availability_zone:
+ get_input: fsb_zone
+ name:
+ get_input: fsb1-name
+ nova_global_type2:
+ type: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ properties:
+ flavor:
+ get_input: fsb1-flavor
+ availability_zone:
+ get_input: fsb_zone
+ metadata:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: '0644'
+ content:
+ str_replace:
+ template:
+ get_artifact:
+ - SELF
+ - nimbus-ethernet
+ params:
+ $dev: eth0
+ $netmask:
+ get_input: cps_net_mask
+ $ip:
+ get_input: cps_net_ip
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth1
+ permissions: '0644'
+ content:
+ str_replace:
+ template:
+ get_artifact:
+ - SELF
+ - nimbus-ethernet-gw
+ params:
+ $dev: eth1
+ $netmask:
+ get_input: oam_net_mask
+ $gateway:
+ get_input: oam_net_gw
+ $ip:
+ get_input: oam_net_ip
+ name:
+ get_input: fsb1-name
+ artifacts:
+ nimbus-ethernet-gw:
+ type: tosca.artifacts.Deployment
+ file: ../Artifacts/nimbus-ethernet-gw
+ nimbus-ethernet:
+ type: tosca.artifacts.Deployment
+ file: ../Artifacts/nimbus-ethernet
+ groups:
+ ep-jsa_net:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/ep-jsa_net.yaml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - nova_local_type_pcm1
+ - nova_local_type_pcm2
+ - nova_local_type_pcrf_psm
+ - nova_global_type1
+ - nova_global_type2 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/expectedOutput/VariouseST.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/expectedOutput/VariouseST.yaml
new file mode 100644
index 0000000000..1f39bfb314
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/expectedOutput/VariouseST.yaml
@@ -0,0 +1,363 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.pcrf_psm:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.pcm:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ Internal2_name:
+ label: Internal2_name
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_name
+ Internal1_shared:
+ label: Internal1_shared
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_shared
+ FSB1_volume_name:
+ label: FSB1_volume
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_volume_1
+ jsa_cidr:
+ label: jsa_cidr
+ hidden: false
+ immutable: false
+ type: string
+ description: jsa_cidr
+ default: 107.243.7.128/26
+ availabilityzone_name:
+ label: availabilityzone_name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone_name
+ fsb1-name:
+ label: FSB1_name
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_name
+ pcm_image_name:
+ label: pcm_image_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_image_name
+ Internal2_external:
+ label: Internal2_external
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_external
+ Internal2_forwarding_mode:
+ label: Internal2_forwarding_mode
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_forwarding_mode
+ pcrf_psm_flavor_name:
+ label: pcrf_psm_flavor_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_flavor_name
+ pcrf_psm_image_name:
+ label: pcrf_psm_image_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_image_name
+ FSB_1_image:
+ label: MME_FSB1
+ hidden: false
+ immutable: false
+ type: string
+ description: MME_FSB1_15B-CP04-r5a01
+ volume_size:
+ label: volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: my volume size 320GB
+ fsb1-Internal1-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ Internal2_shared:
+ label: Internal2_shared
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_shared
+ pcm_server_name:
+ label: pcm_server_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_server_name
+ Internal1_net_name:
+ label: Internal1_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_net_name
+ oam_net_name:
+ label: oam_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: oam_net_name
+ fsb1-flavor:
+ label: FSB1_flavor
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_flavor
+ fsb1-Internal2-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ volume_type:
+ label: volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: volume type Gold
+ fsb1-zone:
+ label: FSB1_zone
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_zone
+ fsb_zone:
+ label: FSB1_zone
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_zone
+ security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: String
+ jsa_net_name:
+ label: jsa_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: jsa_net_name
+ default: jsa_log_net_0
+ pcrf_psm_server_name:
+ label: pcrf_psm_server_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_server_name
+ pcm_flavor_name:
+ label: pcm_flavor_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_flavor_name
+ oam_net_id:
+ label: oam_net_id
+ hidden: false
+ immutable: false
+ type: string
+ description: oam_net_id
+ fsb2-Internal1-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ Internal1_forwarding_mode:
+ label: Internal1_forwarding_mode
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_forwarding_mode
+ pcrf_cps_net_name:
+ label: pcrf_cps_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_cps_net_name
+ cps_net_name:
+ label: cps_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: cps_net_name
+ pcrf_security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: String
+ Internal1_external:
+ label: Internal1_external
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_external
+ node_templates:
+
+ jsa_net:
+ type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
+ properties:
+ shared: true
+ network_name:
+ get_input: jsa_net_name
+ jsa_net1:
+ type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
+ properties:
+ shared: true
+ network_name:
+ get_input: jsa_net_name
+ nova_local_type_pcm1:
+ type: org.openecomp.resource.vfc.nodes.heat.pcm
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ user_data: UNSUPPORTED_RESOURCE_server_init
+ nova_local_type_pcm2:
+ type: org.openecomp.resource.vfc.nodes.heat.pcm
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ user_data: UNSUPPORTED_RESOURCE_server_init
+ nova_local_type_pcrf_psm:
+ type: org.openecomp.resource.vfc.nodes.heat.pcrf_psm
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ user_data: UNSUPPORTED_RESOURCE_server_init
+ nova_global_type1:
+ type: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ properties:
+ flavor:
+ get_input: fsb1-flavor
+ availability_zone:
+ get_input: fsb_zone
+ name:
+ get_input: fsb1-name
+ nova_global_type2:
+ type: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ properties:
+ flavor:
+ get_input: fsb1-flavor
+ availability_zone:
+ get_input: fsb_zone
+ metadata:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: '0644'
+ content:
+ str_replace:
+ template:
+ get_artifact:
+ - SELF
+ - nimbus-ethernet
+ params:
+ $dev: eth0
+ $netmask:
+ get_input: cps_net_mask
+ $ip:
+ get_input: cps_net_ip
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth1
+ permissions: '0644'
+ content:
+ str_replace:
+ template:
+ get_artifact:
+ - SELF
+ - nimbus-ethernet-gw
+ params:
+ $dev: eth1
+ $netmask:
+ get_input: oam_net_mask
+ $gateway:
+ get_input: oam_net_gw
+ $ip:
+ get_input: oam_net_ip
+ name:
+ get_input: fsb1-name
+ artifacts:
+ nimbus-ethernet-gw:
+ type: tosca.artifacts.Deployment
+ file: ../Artifacts/nimbus-ethernet-gw
+ nimbus-ethernet:
+ type: tosca.artifacts.Deployment
+ file: ../Artifacts/nimbus-ethernet
+ groups:
+ ep-jsa_net:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/ep-jsa_net.yaml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - nova_local_type_pcm1
+ - nova_local_type_pcm2
+ - nova_local_type_pcrf_psm
+ - nova_global_type1
+ - nova_global_type2 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/onlyComponents/OnlyComponentsST.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/onlyComponents/OnlyComponentsST.yaml
new file mode 100644
index 0000000000..54f39e4219
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/onlyComponents/OnlyComponentsST.yaml
@@ -0,0 +1,350 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.pcrf_psm:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.pcm:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ Internal2_name:
+ label: Internal2_name
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_name
+ Internal1_shared:
+ label: Internal1_shared
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_shared
+ FSB1_volume_name:
+ label: FSB1_volume
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_volume_1
+ jsa_cidr:
+ label: jsa_cidr
+ hidden: false
+ immutable: false
+ type: string
+ description: jsa_cidr
+ default: 107.243.7.128/26
+ availabilityzone_name:
+ label: availabilityzone_name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone_name
+ fsb1-name:
+ label: FSB1_name
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_name
+ pcm_image_name:
+ label: pcm_image_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_image_name
+ Internal2_external:
+ label: Internal2_external
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_external
+ Internal2_forwarding_mode:
+ label: Internal2_forwarding_mode
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_forwarding_mode
+ pcrf_psm_flavor_name:
+ label: pcrf_psm_flavor_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_flavor_name
+ pcrf_psm_image_name:
+ label: pcrf_psm_image_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_image_name
+ FSB_1_image:
+ label: MME_FSB1
+ hidden: false
+ immutable: false
+ type: string
+ description: MME_FSB1_15B-CP04-r5a01
+ volume_size:
+ label: volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: my volume size 320GB
+ fsb1-Internal1-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ Internal2_shared:
+ label: Internal2_shared
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_shared
+ pcm_server_name:
+ label: pcm_server_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_server_name
+ Internal1_net_name:
+ label: Internal1_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_net_name
+ oam_net_name:
+ label: oam_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: oam_net_name
+ fsb1-flavor:
+ label: FSB1_flavor
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_flavor
+ fsb1-Internal2-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ volume_type:
+ label: volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: volume type Gold
+ fsb1-zone:
+ label: FSB1_zone
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_zone
+ fsb_zone:
+ label: FSB1_zone
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_zone
+ security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: String
+ jsa_net_name:
+ label: jsa_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: jsa_net_name
+ default: jsa_log_net_0
+ pcrf_psm_server_name:
+ label: pcrf_psm_server_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_server_name
+ pcm_flavor_name:
+ label: pcm_flavor_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_flavor_name
+ oam_net_id:
+ label: oam_net_id
+ hidden: false
+ immutable: false
+ type: string
+ description: oam_net_id
+ fsb2-Internal1-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ Internal1_forwarding_mode:
+ label: Internal1_forwarding_mode
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_forwarding_mode
+ pcrf_cps_net_name:
+ label: pcrf_cps_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_cps_net_name
+ cps_net_name:
+ label: cps_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: cps_net_name
+ pcrf_security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: String
+ Internal1_external:
+ label: Internal1_external
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_external
+ node_templates:
+ nova_local_type_pcm1:
+ type: org.openecomp.resource.vfc.nodes.heat.pcm
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ user_data: UNSUPPORTED_RESOURCE_server_init
+ nova_local_type_pcm2:
+ type: org.openecomp.resource.vfc.nodes.heat.pcm
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ user_data: UNSUPPORTED_RESOURCE_server_init
+ nova_local_type_pcrf_psm:
+ type: org.openecomp.resource.vfc.nodes.heat.pcrf_psm
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ user_data: UNSUPPORTED_RESOURCE_server_init
+ nova_global_type1:
+ type: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ properties:
+ flavor:
+ get_input: fsb1-flavor
+ availability_zone:
+ get_input: fsb_zone
+ name:
+ get_input: fsb1-name
+ nova_global_type2:
+ type: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ properties:
+ flavor:
+ get_input: fsb1-flavor
+ availability_zone:
+ get_input: fsb_zone
+ metadata:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: '0644'
+ content:
+ str_replace:
+ template:
+ get_artifact:
+ - SELF
+ - nimbus-ethernet
+ params:
+ $dev: eth0
+ $netmask:
+ get_input: cps_net_mask
+ $ip:
+ get_input: cps_net_ip
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth1
+ permissions: '0644'
+ content:
+ str_replace:
+ template:
+ get_artifact:
+ - SELF
+ - nimbus-ethernet-gw
+ params:
+ $dev: eth1
+ $netmask:
+ get_input: oam_net_mask
+ $gateway:
+ get_input: oam_net_gw
+ $ip:
+ get_input: oam_net_ip
+ name:
+ get_input: fsb1-name
+ artifacts:
+ nimbus-ethernet-gw:
+ type: tosca.artifacts.Deployment
+ file: ../Artifacts/nimbus-ethernet-gw
+ nimbus-ethernet:
+ type: tosca.artifacts.Deployment
+ file: ../Artifacts/nimbus-ethernet
+ groups:
+ ep-jsa_net:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/ep-jsa_net.yaml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - nova_local_type_pcm1
+ - nova_local_type_pcm2
+ - nova_local_type_pcrf_psm
+ - nova_global_type1
+ - nova_global_type2 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/onlyComponents/OnlyComponentsST_01.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/onlyComponents/OnlyComponentsST_01.yaml
new file mode 100644
index 0000000000..54f39e4219
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/onlyComponents/OnlyComponentsST_01.yaml
@@ -0,0 +1,350 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.pcrf_psm:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.pcm:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ Internal2_name:
+ label: Internal2_name
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_name
+ Internal1_shared:
+ label: Internal1_shared
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_shared
+ FSB1_volume_name:
+ label: FSB1_volume
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_volume_1
+ jsa_cidr:
+ label: jsa_cidr
+ hidden: false
+ immutable: false
+ type: string
+ description: jsa_cidr
+ default: 107.243.7.128/26
+ availabilityzone_name:
+ label: availabilityzone_name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone_name
+ fsb1-name:
+ label: FSB1_name
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_name
+ pcm_image_name:
+ label: pcm_image_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_image_name
+ Internal2_external:
+ label: Internal2_external
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_external
+ Internal2_forwarding_mode:
+ label: Internal2_forwarding_mode
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_forwarding_mode
+ pcrf_psm_flavor_name:
+ label: pcrf_psm_flavor_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_flavor_name
+ pcrf_psm_image_name:
+ label: pcrf_psm_image_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_image_name
+ FSB_1_image:
+ label: MME_FSB1
+ hidden: false
+ immutable: false
+ type: string
+ description: MME_FSB1_15B-CP04-r5a01
+ volume_size:
+ label: volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: my volume size 320GB
+ fsb1-Internal1-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ Internal2_shared:
+ label: Internal2_shared
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_shared
+ pcm_server_name:
+ label: pcm_server_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_server_name
+ Internal1_net_name:
+ label: Internal1_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_net_name
+ oam_net_name:
+ label: oam_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: oam_net_name
+ fsb1-flavor:
+ label: FSB1_flavor
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_flavor
+ fsb1-Internal2-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ volume_type:
+ label: volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: volume type Gold
+ fsb1-zone:
+ label: FSB1_zone
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_zone
+ fsb_zone:
+ label: FSB1_zone
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_zone
+ security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: String
+ jsa_net_name:
+ label: jsa_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: jsa_net_name
+ default: jsa_log_net_0
+ pcrf_psm_server_name:
+ label: pcrf_psm_server_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_server_name
+ pcm_flavor_name:
+ label: pcm_flavor_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_flavor_name
+ oam_net_id:
+ label: oam_net_id
+ hidden: false
+ immutable: false
+ type: string
+ description: oam_net_id
+ fsb2-Internal1-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ Internal1_forwarding_mode:
+ label: Internal1_forwarding_mode
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_forwarding_mode
+ pcrf_cps_net_name:
+ label: pcrf_cps_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_cps_net_name
+ cps_net_name:
+ label: cps_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: cps_net_name
+ pcrf_security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: String
+ Internal1_external:
+ label: Internal1_external
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_external
+ node_templates:
+ nova_local_type_pcm1:
+ type: org.openecomp.resource.vfc.nodes.heat.pcm
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ user_data: UNSUPPORTED_RESOURCE_server_init
+ nova_local_type_pcm2:
+ type: org.openecomp.resource.vfc.nodes.heat.pcm
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ user_data: UNSUPPORTED_RESOURCE_server_init
+ nova_local_type_pcrf_psm:
+ type: org.openecomp.resource.vfc.nodes.heat.pcrf_psm
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ user_data: UNSUPPORTED_RESOURCE_server_init
+ nova_global_type1:
+ type: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ properties:
+ flavor:
+ get_input: fsb1-flavor
+ availability_zone:
+ get_input: fsb_zone
+ name:
+ get_input: fsb1-name
+ nova_global_type2:
+ type: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ properties:
+ flavor:
+ get_input: fsb1-flavor
+ availability_zone:
+ get_input: fsb_zone
+ metadata:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: '0644'
+ content:
+ str_replace:
+ template:
+ get_artifact:
+ - SELF
+ - nimbus-ethernet
+ params:
+ $dev: eth0
+ $netmask:
+ get_input: cps_net_mask
+ $ip:
+ get_input: cps_net_ip
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth1
+ permissions: '0644'
+ content:
+ str_replace:
+ template:
+ get_artifact:
+ - SELF
+ - nimbus-ethernet-gw
+ params:
+ $dev: eth1
+ $netmask:
+ get_input: oam_net_mask
+ $gateway:
+ get_input: oam_net_gw
+ $ip:
+ get_input: oam_net_ip
+ name:
+ get_input: fsb1-name
+ artifacts:
+ nimbus-ethernet-gw:
+ type: tosca.artifacts.Deployment
+ file: ../Artifacts/nimbus-ethernet-gw
+ nimbus-ethernet:
+ type: tosca.artifacts.Deployment
+ file: ../Artifacts/nimbus-ethernet
+ groups:
+ ep-jsa_net:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/ep-jsa_net.yaml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - nova_local_type_pcm1
+ - nova_local_type_pcm2
+ - nova_local_type_pcrf_psm
+ - nova_global_type1
+ - nova_global_type2 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/onlyComponents/expectedOutput/OnlyComponentsST.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/onlyComponents/expectedOutput/OnlyComponentsST.yaml
new file mode 100644
index 0000000000..9ec1aa2a8d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/onlyComponents/expectedOutput/OnlyComponentsST.yaml
@@ -0,0 +1,550 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.pcrf_psm:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ capabilities:
+ instance:
+ type: org.openecomp.capabilities.metric.Ceilometer
+ description: Existence of instance
+ properties:
+ name:
+ type: string
+ description: Ceilometer metric type name to monitor. (The name ceilometer is using)
+ required: true
+ default: instance
+ status: SUPPORTED
+ description:
+ type: string
+ description: Description of the metric
+ required: false
+ status: SUPPORTED
+ unit:
+ type: string
+ description: Unit of the metric value
+ required: true
+ default: instance
+ status: SUPPORTED
+ type:
+ type: string
+ description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc.
+ required: true
+ default: Gauge
+ status: SUPPORTED
+ category:
+ type: string
+ description: Category of the metric, for an example, compute, disk, network, storage and etc.
+ required: false
+ default: compute
+ status: SUPPORTED
+ memory:
+ type: org.openecomp.capabilities.metric.Ceilometer
+ description: Volume of RAM allocated to the instance
+ properties:
+ name:
+ type: string
+ description: Ceilometer metric type name to monitor. (The name ceilometer is using)
+ required: true
+ default: memory
+ status: SUPPORTED
+ description:
+ type: string
+ description: Description of the metric
+ required: false
+ status: SUPPORTED
+ unit:
+ type: string
+ description: Unit of the metric value
+ required: true
+ default: MB
+ status: SUPPORTED
+ type:
+ type: string
+ description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc.
+ required: true
+ default: Gauge
+ status: SUPPORTED
+ category:
+ type: string
+ description: Category of the metric, for an example, compute, disk, network, storage and etc.
+ required: false
+ default: compute
+ status: SUPPORTED
+ cpu:
+ type: org.openecomp.capabilities.metric.Ceilometer
+ description: CPU time used
+ properties:
+ name:
+ type: string
+ description: Ceilometer metric type name to monitor. (The name ceilometer is using)
+ required: true
+ default: cpu
+ status: SUPPORTED
+ description:
+ type: string
+ description: Description of the metric
+ required: false
+ status: SUPPORTED
+ unit:
+ type: string
+ description: Unit of the metric value
+ required: true
+ default: ns
+ status: SUPPORTED
+ type:
+ type: string
+ description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc.
+ required: true
+ default: Cumulative
+ status: SUPPORTED
+ category:
+ type: string
+ description: Category of the metric, for an example, compute, disk, network, storage and etc.
+ required: false
+ default: compute
+ status: SUPPORTED
+ org.openecomp.resource.vfc.nodes.heat.pcm:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ capabilities:
+ instance:
+ type: org.openecomp.capabilities.metric.Ceilometer
+ description: Existence of instance
+ properties:
+ name:
+ type: string
+ description: Ceilometer metric type name to monitor. (The name ceilometer is using)
+ required: true
+ default: instance
+ status: SUPPORTED
+ description:
+ type: string
+ description: Description of the metric
+ required: false
+ status: SUPPORTED
+ unit:
+ type: string
+ description: Unit of the metric value
+ required: true
+ default: instance
+ status: SUPPORTED
+ type:
+ type: string
+ description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc.
+ required: true
+ default: Gauge
+ status: SUPPORTED
+ category:
+ type: string
+ description: Category of the metric, for an example, compute, disk, network, storage and etc.
+ required: false
+ default: compute
+ status: SUPPORTED
+ memory:
+ type: org.openecomp.capabilities.metric.Ceilometer
+ description: Volume of RAM allocated to the instance
+ properties:
+ name:
+ type: string
+ description: Ceilometer metric type name to monitor. (The name ceilometer is using)
+ required: true
+ default: memory
+ status: SUPPORTED
+ description:
+ type: string
+ description: Description of the metric
+ required: false
+ status: SUPPORTED
+ unit:
+ type: string
+ description: Unit of the metric value
+ required: true
+ default: MB
+ status: SUPPORTED
+ type:
+ type: string
+ description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc.
+ required: true
+ default: Gauge
+ status: SUPPORTED
+ category:
+ type: string
+ description: Category of the metric, for an example, compute, disk, network, storage and etc.
+ required: false
+ default: compute
+ status: SUPPORTED
+ cpu:
+ type: org.openecomp.capabilities.metric.Ceilometer
+ description: CPU time used
+ properties:
+ name:
+ type: string
+ description: Ceilometer metric type name to monitor. (The name ceilometer is using)
+ required: true
+ default: cpu
+ status: SUPPORTED
+ description:
+ type: string
+ description: Description of the metric
+ required: false
+ status: SUPPORTED
+ unit:
+ type: string
+ description: Unit of the metric value
+ required: true
+ default: ns
+ status: SUPPORTED
+ type:
+ type: string
+ description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc.
+ required: true
+ default: Cumulative
+ status: SUPPORTED
+ category:
+ type: string
+ description: Category of the metric, for an example, compute, disk, network, storage and etc.
+ required: false
+ default: compute
+ status: SUPPORTED
+topology_template:
+ inputs:
+ Internal2_name:
+ label: Internal2_name
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_name
+ Internal1_shared:
+ label: Internal1_shared
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_shared
+ FSB1_volume_name:
+ label: FSB1_volume
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_volume_1
+ jsa_cidr:
+ label: jsa_cidr
+ hidden: false
+ immutable: false
+ type: string
+ description: jsa_cidr
+ default: 107.243.7.128/26
+ availabilityzone_name:
+ label: availabilityzone_name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone_name
+ fsb1-name:
+ label: FSB1_name
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_name
+ pcm_image_name:
+ label: pcm_image_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_image_name
+ Internal2_external:
+ label: Internal2_external
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_external
+ Internal2_forwarding_mode:
+ label: Internal2_forwarding_mode
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_forwarding_mode
+ pcrf_psm_flavor_name:
+ label: pcrf_psm_flavor_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_flavor_name
+ pcrf_psm_image_name:
+ label: pcrf_psm_image_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_image_name
+ FSB_1_image:
+ label: MME_FSB1
+ hidden: false
+ immutable: false
+ type: string
+ description: MME_FSB1_15B-CP04-r5a01
+ volume_size:
+ label: volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: my volume size 320GB
+ fsb1-Internal1-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ Internal2_shared:
+ label: Internal2_shared
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_shared
+ pcm_server_name:
+ label: pcm_server_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_server_name
+ Internal1_net_name:
+ label: Internal1_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_net_name
+ oam_net_name:
+ label: oam_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: oam_net_name
+ fsb1-flavor:
+ label: FSB1_flavor
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_flavor
+ fsb1-Internal2-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ volume_type:
+ label: volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: volume type Gold
+ fsb1-zone:
+ label: FSB1_zone
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_zone
+ fsb_zone:
+ label: FSB1_zone
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_zone
+ security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: String
+ jsa_net_name:
+ label: jsa_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: jsa_net_name
+ default: jsa_log_net_0
+ pcrf_psm_server_name:
+ label: pcrf_psm_server_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_server_name
+ pcm_flavor_name:
+ label: pcm_flavor_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_flavor_name
+ oam_net_id:
+ label: oam_net_id
+ hidden: false
+ immutable: false
+ type: string
+ description: oam_net_id
+ fsb2-Internal1-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ Internal1_forwarding_mode:
+ label: Internal1_forwarding_mode
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_forwarding_mode
+ pcrf_cps_net_name:
+ label: pcrf_cps_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_cps_net_name
+ cps_net_name:
+ label: cps_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: cps_net_name
+ pcrf_security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: String
+ Internal1_external:
+ label: Internal1_external
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_external
+ node_templates:
+ nova_local_type_pcm1:
+ type: org.openecomp.resource.vfc.nodes.heat.pcm
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ user_data: UNSUPPORTED_RESOURCE_server_init
+ nova_local_type_pcm2:
+ type: org.openecomp.resource.vfc.nodes.heat.pcm
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ user_data: UNSUPPORTED_RESOURCE_server_init
+ nova_local_type_pcrf_psm:
+ type: org.openecomp.resource.vfc.nodes.heat.pcrf_psm
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ user_data: UNSUPPORTED_RESOURCE_server_init
+ nova_global_type1:
+ type: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ properties:
+ flavor:
+ get_input: fsb1-flavor
+ availability_zone:
+ get_input: fsb_zone
+ name:
+ get_input: fsb1-name
+ nova_global_type2:
+ type: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ properties:
+ flavor:
+ get_input: fsb1-flavor
+ availability_zone:
+ get_input: fsb_zone
+ metadata:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: '0644'
+ content:
+ str_replace:
+ template:
+ get_artifact:
+ - SELF
+ - nimbus-ethernet
+ params:
+ $dev: eth0
+ $netmask:
+ get_input: cps_net_mask
+ $ip:
+ get_input: cps_net_ip
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth1
+ permissions: '0644'
+ content:
+ str_replace:
+ template:
+ get_artifact:
+ - SELF
+ - nimbus-ethernet-gw
+ params:
+ $dev: eth1
+ $netmask:
+ get_input: oam_net_mask
+ $gateway:
+ get_input: oam_net_gw
+ $ip:
+ get_input: oam_net_ip
+ name:
+ get_input: fsb1-name
+ artifacts:
+ nimbus-ethernet-gw:
+ type: tosca.artifacts.Deployment
+ file: ../Artifacts/nimbus-ethernet-gw
+ nimbus-ethernet:
+ type: tosca.artifacts.Deployment
+ file: ../Artifacts/nimbus-ethernet
+ groups:
+ ep-jsa_net:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/ep-jsa_net.yaml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - nova_local_type_pcm1
+ - nova_local_type_pcm2
+ - nova_local_type_pcrf_psm
+ - nova_global_type1
+ - nova_global_type2 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/onlyComponents/expectedOutput/OnlyComponentsST_01.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/onlyComponents/expectedOutput/OnlyComponentsST_01.yaml
new file mode 100644
index 0000000000..9ec1aa2a8d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/onlyComponents/expectedOutput/OnlyComponentsST_01.yaml
@@ -0,0 +1,550 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.pcrf_psm:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ capabilities:
+ instance:
+ type: org.openecomp.capabilities.metric.Ceilometer
+ description: Existence of instance
+ properties:
+ name:
+ type: string
+ description: Ceilometer metric type name to monitor. (The name ceilometer is using)
+ required: true
+ default: instance
+ status: SUPPORTED
+ description:
+ type: string
+ description: Description of the metric
+ required: false
+ status: SUPPORTED
+ unit:
+ type: string
+ description: Unit of the metric value
+ required: true
+ default: instance
+ status: SUPPORTED
+ type:
+ type: string
+ description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc.
+ required: true
+ default: Gauge
+ status: SUPPORTED
+ category:
+ type: string
+ description: Category of the metric, for an example, compute, disk, network, storage and etc.
+ required: false
+ default: compute
+ status: SUPPORTED
+ memory:
+ type: org.openecomp.capabilities.metric.Ceilometer
+ description: Volume of RAM allocated to the instance
+ properties:
+ name:
+ type: string
+ description: Ceilometer metric type name to monitor. (The name ceilometer is using)
+ required: true
+ default: memory
+ status: SUPPORTED
+ description:
+ type: string
+ description: Description of the metric
+ required: false
+ status: SUPPORTED
+ unit:
+ type: string
+ description: Unit of the metric value
+ required: true
+ default: MB
+ status: SUPPORTED
+ type:
+ type: string
+ description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc.
+ required: true
+ default: Gauge
+ status: SUPPORTED
+ category:
+ type: string
+ description: Category of the metric, for an example, compute, disk, network, storage and etc.
+ required: false
+ default: compute
+ status: SUPPORTED
+ cpu:
+ type: org.openecomp.capabilities.metric.Ceilometer
+ description: CPU time used
+ properties:
+ name:
+ type: string
+ description: Ceilometer metric type name to monitor. (The name ceilometer is using)
+ required: true
+ default: cpu
+ status: SUPPORTED
+ description:
+ type: string
+ description: Description of the metric
+ required: false
+ status: SUPPORTED
+ unit:
+ type: string
+ description: Unit of the metric value
+ required: true
+ default: ns
+ status: SUPPORTED
+ type:
+ type: string
+ description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc.
+ required: true
+ default: Cumulative
+ status: SUPPORTED
+ category:
+ type: string
+ description: Category of the metric, for an example, compute, disk, network, storage and etc.
+ required: false
+ default: compute
+ status: SUPPORTED
+ org.openecomp.resource.vfc.nodes.heat.pcm:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ capabilities:
+ instance:
+ type: org.openecomp.capabilities.metric.Ceilometer
+ description: Existence of instance
+ properties:
+ name:
+ type: string
+ description: Ceilometer metric type name to monitor. (The name ceilometer is using)
+ required: true
+ default: instance
+ status: SUPPORTED
+ description:
+ type: string
+ description: Description of the metric
+ required: false
+ status: SUPPORTED
+ unit:
+ type: string
+ description: Unit of the metric value
+ required: true
+ default: instance
+ status: SUPPORTED
+ type:
+ type: string
+ description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc.
+ required: true
+ default: Gauge
+ status: SUPPORTED
+ category:
+ type: string
+ description: Category of the metric, for an example, compute, disk, network, storage and etc.
+ required: false
+ default: compute
+ status: SUPPORTED
+ memory:
+ type: org.openecomp.capabilities.metric.Ceilometer
+ description: Volume of RAM allocated to the instance
+ properties:
+ name:
+ type: string
+ description: Ceilometer metric type name to monitor. (The name ceilometer is using)
+ required: true
+ default: memory
+ status: SUPPORTED
+ description:
+ type: string
+ description: Description of the metric
+ required: false
+ status: SUPPORTED
+ unit:
+ type: string
+ description: Unit of the metric value
+ required: true
+ default: MB
+ status: SUPPORTED
+ type:
+ type: string
+ description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc.
+ required: true
+ default: Gauge
+ status: SUPPORTED
+ category:
+ type: string
+ description: Category of the metric, for an example, compute, disk, network, storage and etc.
+ required: false
+ default: compute
+ status: SUPPORTED
+ cpu:
+ type: org.openecomp.capabilities.metric.Ceilometer
+ description: CPU time used
+ properties:
+ name:
+ type: string
+ description: Ceilometer metric type name to monitor. (The name ceilometer is using)
+ required: true
+ default: cpu
+ status: SUPPORTED
+ description:
+ type: string
+ description: Description of the metric
+ required: false
+ status: SUPPORTED
+ unit:
+ type: string
+ description: Unit of the metric value
+ required: true
+ default: ns
+ status: SUPPORTED
+ type:
+ type: string
+ description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc.
+ required: true
+ default: Cumulative
+ status: SUPPORTED
+ category:
+ type: string
+ description: Category of the metric, for an example, compute, disk, network, storage and etc.
+ required: false
+ default: compute
+ status: SUPPORTED
+topology_template:
+ inputs:
+ Internal2_name:
+ label: Internal2_name
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_name
+ Internal1_shared:
+ label: Internal1_shared
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_shared
+ FSB1_volume_name:
+ label: FSB1_volume
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_volume_1
+ jsa_cidr:
+ label: jsa_cidr
+ hidden: false
+ immutable: false
+ type: string
+ description: jsa_cidr
+ default: 107.243.7.128/26
+ availabilityzone_name:
+ label: availabilityzone_name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone_name
+ fsb1-name:
+ label: FSB1_name
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_name
+ pcm_image_name:
+ label: pcm_image_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_image_name
+ Internal2_external:
+ label: Internal2_external
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_external
+ Internal2_forwarding_mode:
+ label: Internal2_forwarding_mode
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_forwarding_mode
+ pcrf_psm_flavor_name:
+ label: pcrf_psm_flavor_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_flavor_name
+ pcrf_psm_image_name:
+ label: pcrf_psm_image_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_image_name
+ FSB_1_image:
+ label: MME_FSB1
+ hidden: false
+ immutable: false
+ type: string
+ description: MME_FSB1_15B-CP04-r5a01
+ volume_size:
+ label: volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: my volume size 320GB
+ fsb1-Internal1-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ Internal2_shared:
+ label: Internal2_shared
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_shared
+ pcm_server_name:
+ label: pcm_server_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_server_name
+ Internal1_net_name:
+ label: Internal1_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_net_name
+ oam_net_name:
+ label: oam_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: oam_net_name
+ fsb1-flavor:
+ label: FSB1_flavor
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_flavor
+ fsb1-Internal2-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ volume_type:
+ label: volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: volume type Gold
+ fsb1-zone:
+ label: FSB1_zone
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_zone
+ fsb_zone:
+ label: FSB1_zone
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_zone
+ security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: String
+ jsa_net_name:
+ label: jsa_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: jsa_net_name
+ default: jsa_log_net_0
+ pcrf_psm_server_name:
+ label: pcrf_psm_server_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_server_name
+ pcm_flavor_name:
+ label: pcm_flavor_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_flavor_name
+ oam_net_id:
+ label: oam_net_id
+ hidden: false
+ immutable: false
+ type: string
+ description: oam_net_id
+ fsb2-Internal1-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ Internal1_forwarding_mode:
+ label: Internal1_forwarding_mode
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_forwarding_mode
+ pcrf_cps_net_name:
+ label: pcrf_cps_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_cps_net_name
+ cps_net_name:
+ label: cps_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: cps_net_name
+ pcrf_security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: String
+ Internal1_external:
+ label: Internal1_external
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_external
+ node_templates:
+ nova_local_type_pcm1:
+ type: org.openecomp.resource.vfc.nodes.heat.pcm
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ user_data: UNSUPPORTED_RESOURCE_server_init
+ nova_local_type_pcm2:
+ type: org.openecomp.resource.vfc.nodes.heat.pcm
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ user_data: UNSUPPORTED_RESOURCE_server_init
+ nova_local_type_pcrf_psm:
+ type: org.openecomp.resource.vfc.nodes.heat.pcrf_psm
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ user_data: UNSUPPORTED_RESOURCE_server_init
+ nova_global_type1:
+ type: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ properties:
+ flavor:
+ get_input: fsb1-flavor
+ availability_zone:
+ get_input: fsb_zone
+ name:
+ get_input: fsb1-name
+ nova_global_type2:
+ type: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ properties:
+ flavor:
+ get_input: fsb1-flavor
+ availability_zone:
+ get_input: fsb_zone
+ metadata:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: '0644'
+ content:
+ str_replace:
+ template:
+ get_artifact:
+ - SELF
+ - nimbus-ethernet
+ params:
+ $dev: eth0
+ $netmask:
+ get_input: cps_net_mask
+ $ip:
+ get_input: cps_net_ip
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth1
+ permissions: '0644'
+ content:
+ str_replace:
+ template:
+ get_artifact:
+ - SELF
+ - nimbus-ethernet-gw
+ params:
+ $dev: eth1
+ $netmask:
+ get_input: oam_net_mask
+ $gateway:
+ get_input: oam_net_gw
+ $ip:
+ get_input: oam_net_ip
+ name:
+ get_input: fsb1-name
+ artifacts:
+ nimbus-ethernet-gw:
+ type: tosca.artifacts.Deployment
+ file: ../Artifacts/nimbus-ethernet-gw
+ nimbus-ethernet:
+ type: tosca.artifacts.Deployment
+ file: ../Artifacts/nimbus-ethernet
+ groups:
+ ep-jsa_net:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/ep-jsa_net.yaml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - nova_local_type_pcm1
+ - nova_local_type_pcm2
+ - nova_local_type_pcrf_psm
+ - nova_global_type1
+ - nova_global_type2 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/AbstractSubstituteGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/AbstractSubstituteGlobalTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..8813b0abf6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/AbstractSubstituteGlobalTypesServiceTemplate.yaml
@@ -0,0 +1,47 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: AbstractSubstituteGlobalTypes
+ template_version: 1.0.0
+description: Abstract Substitute Global Types
+imports:
+ common_definitions:
+ file: CommonGlobalTypesServiceTemplate.yaml
+data_types:
+ org.openecomp.datatypes.heat.substitution.SubstitutionFilter:
+ derived_from: tosca.datatypes.Root
+ description: Substitution Filter
+ properties:
+ substitute_service_template:
+ type: string
+ description: Substitute Service Template
+ required: true
+ status: SUPPORTED
+ index_variable:
+ type: string
+ description: Index variable
+ required: false
+ default: '%index%'
+ status: SUPPORTED
+ constraints:
+ - min_length: 3
+ count:
+ type: string
+ description: Count
+ required: false
+ default: 1
+ status: SUPPORTED
+ mandatory:
+ type: boolean
+ description: Mandatory
+ required: false
+ default: true
+ status: SUPPORTED
+node_types:
+ org.openecomp.resource.abstract.nodes.AbstractSubstitute:
+ derived_from: tosca.nodes.Root
+ properties:
+ service_template_filter:
+ type: org.openecomp.datatypes.heat.substitution.SubstitutionFilter
+ description: Substitution Filter
+ required: true
+ status: SUPPORTED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/CinderVolumeGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/CinderVolumeGlobalTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..3ef94f22e7
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/CinderVolumeGlobalTypesServiceTemplate.yaml
@@ -0,0 +1,176 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: CinderVolumeGlobalTypes
+ template_version: 1.0.0
+description: Cinder Volume TOSCA Global Types
+relationship_types:
+ org.openecomp.relationships.heat.cinder.VolumeAttachesTo:
+ derived_from: tosca.relationships.AttachesTo
+ description: This type represents an attachment relationship for associating volume
+ properties:
+ volume_id:
+ type: string
+ description: The ID of the volume to be attached
+ required: true
+ status: SUPPORTED
+ location:
+ type: string
+ description: The location where the volume is exposed on the instance, mountpoint
+ required: false
+ status: SUPPORTED
+ instance_uuid:
+ type: string
+ description: The ID of the server to which the volume attaches
+ required: true
+ status: SUPPORTED
+ attributes:
+ show:
+ type: string
+ description: Detailed information about resource
+ status: SUPPORTED
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cinder.Volume:
+ derived_from: tosca.nodes.BlockStorage
+ properties:
+ availability_zone:
+ type: string
+ description: The availability zone in which the volume will be created
+ required: false
+ status: SUPPORTED
+ image:
+ type: string
+ description: If specified, the name or ID of the image to create the volume from
+ required: false
+ status: SUPPORTED
+ metadata:
+ type: map
+ description: Key/value pairs to associate with the volume
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ volume_type:
+ type: string
+ description: If specified, the type of volume to use, mapping to a specific backend
+ required: false
+ status: SUPPORTED
+ description:
+ type: string
+ description: A description of the volume
+ required: false
+ status: SUPPORTED
+ device_type:
+ type: string
+ description: Device type
+ required: false
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - cdrom
+ - disk
+ disk_bus:
+ type: string
+ description: 'Bus of the device: hypervisor driver chooses a suitable default
+ if omitted'
+ required: false
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - ide
+ - lame_bus
+ - scsi
+ - usb
+ - virtio
+ backup_id:
+ type: string
+ description: If specified, the backup to create the volume from
+ required: false
+ status: SUPPORTED
+ source_volid:
+ type: string
+ description: If specified, the volume to use as source
+ required: false
+ status: SUPPORTED
+ boot_index:
+ type: integer
+ description: Integer used for ordering the boot disks
+ required: false
+ status: SUPPORTED
+ size:
+ type: scalar-unit.size
+ description: The requested storage size (default unit is MB)
+ required: false
+ status: SUPPORTED
+ constraints:
+ - greater_or_equal: 1 GB
+ read_only:
+ type: boolean
+ description: Enables or disables read-only access mode of volume
+ required: false
+ status: SUPPORTED
+ name:
+ type: string
+ description: A name used to distinguish the volume
+ required: false
+ status: SUPPORTED
+ scheduler_hints:
+ type: map
+ description: Arbitrary key-value pairs specified by the client to help the Cinder scheduler creating a volume
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ swap_size:
+ type: scalar-unit.size
+ description: The size of the swap, in MB
+ required: false
+ status: SUPPORTED
+ delete_on_termination:
+ type: boolean
+ description: Indicate whether the volume should be deleted when the server is terminated
+ required: false
+ status: SUPPORTED
+ multiattach:
+ type: boolean
+ description: Whether allow the volume to be attached more than once
+ required: false
+ status: SUPPORTED
+ attributes:
+ display_description:
+ type: string
+ description: Description of the volume
+ status: SUPPORTED
+ attachments:
+ type: string
+ description: The list of attachments of the volume
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ encrypted:
+ type: boolean
+ description: Boolean indicating if the volume is encrypted or not
+ status: SUPPORTED
+ show:
+ type: string
+ description: Detailed information about resource
+ status: SUPPORTED
+ created_at:
+ type: timestamp
+ description: The timestamp indicating volume creation
+ status: SUPPORTED
+ display_name:
+ type: string
+ description: Name of the volume
+ status: SUPPORTED
+ metadata_values:
+ type: map
+ description: Key/value pairs associated with the volume in raw dict form
+ status: SUPPORTED
+ bootable:
+ type: boolean
+ description: Boolean indicating if the volume can be booted or not
+ status: SUPPORTED
+ status:
+ type: string
+ description: The current status of the volume
+ status: SUPPORTED
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/CommonGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/CommonGlobalTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..3388d5a89b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/CommonGlobalTypesServiceTemplate.yaml
@@ -0,0 +1,213 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: CommonGlobalTypes
+ template_version: 1.0.0
+description: TOSCA Global Types
+imports:
+ NativeTypesServiceTemplate:
+ file: NativeTypesServiceTemplateServiceTemplate.yaml
+data_types:
+ org.openecomp.datatypes.heat.network.AddressPair:
+ derived_from: tosca.datatypes.Root
+ description: MAC/IP address pairs
+ properties:
+ mac_address:
+ type: string
+ description: MAC address
+ required: false
+ status: SUPPORTED
+ ip_address:
+ type: string
+ description: IP address
+ required: false
+ status: SUPPORTED
+ org.openecomp.datatypes.heat.network.subnet.HostRoute:
+ derived_from: tosca.datatypes.Root
+ description: Host route info for the subnet
+ properties:
+ destination:
+ type: string
+ description: The destination for static route
+ required: false
+ status: SUPPORTED
+ nexthop:
+ type: string
+ description: The next hop for the destination
+ required: false
+ status: SUPPORTED
+ org.openecomp.datatypes.heat.network.neutron.Subnet:
+ derived_from: tosca.datatypes.Root
+ description: A subnet represents an IP address block that can be used for assigning IP addresses to virtual instances
+ properties:
+ tenant_id:
+ type: string
+ description: The ID of the tenant who owns the network
+ required: false
+ status: SUPPORTED
+ enable_dhcp:
+ type: boolean
+ description: Set to true if DHCP is enabled and false if DHCP is disabled
+ required: false
+ default: true
+ status: SUPPORTED
+ ipv6_address_mode:
+ type: string
+ description: IPv6 address mode
+ required: false
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - dhcpv6-stateful
+ - dhcpv6-stateless
+ - slaac
+ ipv6_ra_mode:
+ type: string
+ description: IPv6 RA (Router Advertisement) mode
+ required: false
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - dhcpv6-stateful
+ - dhcpv6-stateless
+ - slaac
+ value_specs:
+ type: map
+ description: Extra parameters to include in the request
+ required: false
+ default: {
+ }
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ allocation_pools:
+ type: list
+ description: The start and end addresses for the allocation pools
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.AllocationPool
+ subnetpool:
+ type: string
+ description: The name or ID of the subnet pool
+ required: false
+ status: SUPPORTED
+ dns_nameservers:
+ type: list
+ description: A specified set of DNS name servers to be used
+ required: false
+ default: [
+ ]
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ host_routes:
+ type: list
+ description: The gateway IP address
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.subnet.HostRoute
+ ip_version:
+ type: integer
+ description: The gateway IP address
+ required: false
+ default: 4
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - '4'
+ - '6'
+ name:
+ type: string
+ description: The name of the subnet
+ required: false
+ status: SUPPORTED
+ prefixlen:
+ type: integer
+ description: Prefix length for subnet allocation from subnet pool
+ required: false
+ status: SUPPORTED
+ constraints:
+ - greater_or_equal: 0
+ cidr:
+ type: string
+ description: The CIDR
+ required: false
+ status: SUPPORTED
+ gateway_ip:
+ type: string
+ description: The gateway IP address
+ required: false
+ status: SUPPORTED
+ org.openecomp.datatypes.heat.network.AllocationPool:
+ derived_from: tosca.datatypes.Root
+ description: The start and end addresses for the allocation pool
+ properties:
+ start:
+ type: string
+ description: Start address for the allocation pool
+ required: false
+ status: SUPPORTED
+ end:
+ type: string
+ description: End address for the allocation pool
+ required: false
+ status: SUPPORTED
+relationship_types:
+ org.openecomp.relationships.AttachesTo:
+ derived_from: tosca.relationships.Root
+ description: This type represents an attachment relationship
+group_types:
+ org.openecomp.groups.heat.HeatStack:
+ derived_from: tosca.groups.Root
+ description: Grouped all heat resources which are in the same heat stack
+ properties:
+ heat_file:
+ type: string
+ description: Heat file which associate to this group/heat stack
+ required: true
+ status: SUPPORTED
+ description:
+ type: string
+ description: Heat file description
+ required: false
+ status: SUPPORTED
+policy_types:
+ org.openecomp.policies.placement.Colocate:
+ derived_from: tosca.policy.placement
+ description: Keep associated nodes (groups of nodes) based upon affinity value
+ properties:
+ name:
+ type: string
+ description: The name of the policy
+ required: false
+ status: SUPPORTED
+ affinity:
+ type: string
+ description: affinity
+ required: true
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - host
+ - region
+ - compute
+ org.openecomp.policies.placement.Antilocate:
+ derived_from: tosca.policy.placement
+ description: My placement policy for separation based upon container type value
+ properties:
+ name:
+ type: string
+ description: The name of the policy
+ required: false
+ status: SUPPORTED
+ container_type:
+ type: string
+ description: container type
+ required: false
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - host
+ - region
+ - compute
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/ContrailNetworkRuleGlobalTypeServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
new file mode 100644
index 0000000000..98317310fa
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
@@ -0,0 +1,117 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: ContrailNetworkRuleGlobalType
+ template_version: 1.0.0
+description: Contrail Network Rule Global Types
+imports:
+ common_definitions:
+ file: CommonGlobalTypesServiceTemplate.yaml
+data_types:
+ org.openecomp.datatypes.heat.contrail.network.rule.PortPairs:
+ derived_from: tosca.datatypes.Root
+ description: source and destination port pairs
+ properties:
+ start_port:
+ type: string
+ description: Start port
+ required: false
+ status: SUPPORTED
+ end_port:
+ type: string
+ description: End port
+ required: false
+ status: SUPPORTED
+ org.openecomp.datatypes.heat.contrail.network.rule.Rule:
+ derived_from: tosca.datatypes.Root
+ description: policy rule
+ properties:
+ src_ports:
+ type: list
+ description: Source ports
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.contrail.network.rule.PortPairs
+ protocol:
+ type: string
+ description: Protocol
+ required: false
+ status: SUPPORTED
+ dst_addresses:
+ type: list
+ description: Destination addresses
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.contrail.network.rule.VirtualNetwork
+ apply_service:
+ type: string
+ description: Service to apply
+ required: false
+ status: SUPPORTED
+ dst_ports:
+ type: list
+ description: Destination ports
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.contrail.network.rule.PortPairs
+ src_addresses:
+ type: list
+ description: Source addresses
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.contrail.network.rule.VirtualNetwork
+ direction:
+ type: string
+ description: Direction
+ required: false
+ status: SUPPORTED
+ org.openecomp.datatypes.heat.contrail.network.rule.RuleList:
+ derived_from: tosca.datatypes.Root
+ description: list of policy rules
+ properties:
+ policy_rule:
+ type: list
+ description: Contrail network rule
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.contrail.network.rule.Rule
+ org.openecomp.datatypes.heat.contrail.network.rule.VirtualNetwork:
+ derived_from: tosca.datatypes.Root
+ description: source and destination addresses
+ properties:
+ virtual_network:
+ type: string
+ description: Virtual network
+ required: false
+ status: SUPPORTED
+node_types:
+ org.openecomp.resource.nodes.heat.network.contrail.NetworkRules:
+ derived_from: tosca.nodes.Root
+ properties:
+ entries:
+ type: org.openecomp.datatypes.heat.contrail.network.rule.RuleList
+ description: A symbolic name for this contrail network rule
+ required: false
+ status: SUPPORTED
+ name:
+ type: string
+ description: A symbolic name for this contrail network rule
+ required: false
+ status: SUPPORTED
+ attributes:
+ fq_name:
+ type: string
+ description: fq_name
+ status: SUPPORTED
+ requirements:
+ - network:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.network.Network
+ relationship: org.openecomp.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
new file mode 100644
index 0000000000..0927e3dd0e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
@@ -0,0 +1,71 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: ContrailVirtualNetworkGlobalType
+ template_version: 1.0.0
+description: Contrail Virtual Network Global Types
+imports:
+ common_definitions:
+ file: CommonGlobalTypesServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork:
+ derived_from: tosca.nodes.network.Network
+ properties:
+ shared:
+ type: string
+ description: Is virtual network shared
+ required: false
+ status: SUPPORTED
+ forwarding_mode:
+ type: string
+ description: forwarding mode of the virtual network
+ required: false
+ status: SUPPORTED
+ external:
+ type: string
+ description: Is virtual network external
+ required: false
+ status: SUPPORTED
+ flood_unknown_unicast:
+ type: string
+ description: flood L2 packets on network
+ required: false
+ status: SUPPORTED
+ route_targets:
+ type: list
+ description: route targets associated with the virtual network
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ subnets:
+ type: map
+ description: Network related subnets
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.neutron.Subnet
+ attributes:
+ subnets_name:
+ type: list
+ description: Subnets name of this network
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ subnets_show:
+ type: map
+ description: Detailed information about each subnet
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ subnets:
+ type: map
+ description: Network related subnets
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.neutron.Subnet
+ capabilities:
+ attachment:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/GlobalSubstitutionTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..08c47bc646
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/GlobalSubstitutionTypesServiceTemplate.yaml
@@ -0,0 +1,93 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: GlobalSubstitutionTypes
+imports:
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.abstract.nodes.heat.nested:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ cmaui_names:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: String
+ p1:
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ security_group_name:
+ description: not impotrtant
+ availability_zone_0:
+ type: string
+ description: availabilityzone name
+ requirements:
+ - local_storage_server_cmaui:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - link_cmaui_port_0:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ capabilities:
+ host_server_cmaui:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_cmaui:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_cmaui:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_cmaui:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_server_cmaui:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_0:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NativeTypesServiceTemplateServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NativeTypesServiceTemplateServiceTemplate.yaml
new file mode 100644
index 0000000000..e7dfd49ed9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NativeTypesServiceTemplateServiceTemplate.yaml
@@ -0,0 +1,194 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: NativeTypesServiceTemplate
+ template_version: 1.0.0
+description: TOSCA Native Node Types
+node_types:
+ tosca.nodes.Compute:
+ derived_from: tosca.nodes.Root
+ attributes:
+ private_address:
+ type: string
+ description: private address
+ status: SUPPORTED
+ public_address:
+ type: string
+ description: public_address
+ status: SUPPORTED
+ networks:
+ type: map
+ description: networks
+ status: SUPPORTED
+ entry_schema:
+ type: tosca.datatypes.network.NetworkInfo
+ ports:
+ type: map
+ description: ports
+ status: SUPPORTED
+ entry_schema:
+ type: tosca.datatypes.network.PortInfo
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ capabilities:
+ scalable:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ tosca.nodes.network.Port:
+ derived_from: tosca.nodes.Root
+ properties:
+ ip_range_end:
+ type: string
+ required: false
+ status: SUPPORTED
+ ip_range_start:
+ type: string
+ required: false
+ status: SUPPORTED
+ ip_address:
+ type: string
+ required: false
+ status: SUPPORTED
+ is_default:
+ type: boolean
+ required: false
+ default: false
+ status: SUPPORTED
+ order:
+ type: integer
+ required: true
+ default: 0
+ status: SUPPORTED
+ constraints:
+ - greater_or_equal: 0
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.BindsTo
+ tosca.nodes.Root:
+ attributes:
+ tosca_name:
+ type: string
+ description: tosca name
+ status: SUPPORTED
+ state:
+ type: string
+ description: state
+ status: SUPPORTED
+ tosca_id:
+ type: string
+ description: tosca id
+ status: SUPPORTED
+ interfaces: {
+ }
+ tosca.nodes.network.Network:
+ derived_from: tosca.nodes.Root
+ properties:
+ physical_network:
+ type: string
+ required: false
+ status: SUPPORTED
+ segmentation_id:
+ type: string
+ required: false
+ status: SUPPORTED
+ network_id:
+ type: string
+ required: false
+ status: SUPPORTED
+ ip_version:
+ type: integer
+ required: false
+ default: 4
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - 4
+ - 6
+ start_ip:
+ type: string
+ required: false
+ status: SUPPORTED
+ network_name:
+ type: string
+ required: false
+ status: SUPPORTED
+ cidr:
+ type: string
+ required: false
+ status: SUPPORTED
+ gateway_ip:
+ type: string
+ required: false
+ status: SUPPORTED
+ network_type:
+ type: string
+ required: false
+ status: SUPPORTED
+ end_ip:
+ type: string
+ required: false
+ status: SUPPORTED
+ capabilities:
+ link:
+ type: tosca.capabilities.network.Linkable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ tosca.nodes.BlockStorage:
+ derived_from: tosca.nodes.Root
+ properties:
+ size:
+ type: scalar-unit.size
+ required: false
+ status: SUPPORTED
+ constraints:
+ - greater_or_equal: 1 MB
+ volume_id:
+ type: string
+ required: false
+ status: SUPPORTED
+ snapshot_id:
+ type: string
+ required: false
+ status: SUPPORTED
+ capabilities:
+ attachment:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronNetGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronNetGlobalTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..e80e2727c7
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronNetGlobalTypesServiceTemplate.yaml
@@ -0,0 +1,97 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: NeutronNetGlobalTypes
+ template_version: 1.0.0
+description: Neutron Network TOSCA Global Types
+imports:
+ common_definitions:
+ file: CommonGlobalTypesServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vl.nodes.heat.network.neutron.Net:
+ derived_from: tosca.nodes.network.Network
+ properties:
+ dhcp_agent_ids:
+ type: list
+ description: The IDs of the DHCP agent to schedule the network
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ tenant_id:
+ type: string
+ description: The ID of the tenant which will own the network
+ required: false
+ status: SUPPORTED
+ port_security_enabled:
+ type: boolean
+ description: Flag to enable/disable port security on the network
+ required: false
+ status: SUPPORTED
+ shared:
+ type: boolean
+ description: Whether this network should be shared across all tenants
+ required: false
+ default: false
+ status: SUPPORTED
+ admin_state_up:
+ type: boolean
+ description: A boolean value specifying the administrative status of the network
+ required: false
+ default: true
+ status: SUPPORTED
+ qos_policy:
+ type: string
+ description: The name or ID of QoS policy to attach to this network
+ required: false
+ status: SUPPORTED
+ subnets:
+ type: map
+ description: Network related subnets
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.neutron.Subnet
+ value_specs:
+ type: map
+ description: Extra parameters to include in the request
+ required: false
+ default: {
+ }
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ attributes:
+ qos_policy_id:
+ type: string
+ description: The QoS policy ID attached to this network
+ status: SUPPORTED
+ show:
+ type: string
+ description: Detailed information about resource
+ status: SUPPORTED
+ subnets_name:
+ type: list
+ description: Subnets name of this network
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ subnets:
+ type: map
+ description: Network related subnets
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.neutron.Subnet
+ mtu:
+ type: scalar-unit.size
+ description: The maximum transmission unit size(in bytes) for the network
+ status: SUPPORTED
+ status:
+ type: string
+ description: The status of the network
+ status: SUPPORTED
+ capabilities:
+ attachment:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronPortGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronPortGlobalTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..a337d6ed18
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronPortGlobalTypesServiceTemplate.yaml
@@ -0,0 +1,151 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: NeutronPortGlobalTypes
+ template_version: 1.0.0
+description: Neutron Port TOSCA Global Types
+imports:
+ common_definitions:
+ file: CommonGlobalTypesServiceTemplate.yaml
+data_types:
+ org.openecomp.datatypes.heat.neutron.port.FixedIps:
+ derived_from: tosca.datatypes.Root
+ description: subnet/ip_address
+ properties:
+ subnet:
+ type: string
+ description: Subnet in which to allocate the IP address for this port
+ required: false
+ status: SUPPORTED
+ ip_address:
+ type: string
+ description: IP address desired in the subnet for this port
+ required: false
+ status: SUPPORTED
+node_types:
+ org.openecomp.resource.cp.nodes.heat.network.neutron.Port:
+ derived_from: tosca.nodes.network.Port
+ properties:
+ port_security_enabled:
+ type: boolean
+ description: Flag to enable/disable port security on the network
+ required: false
+ status: SUPPORTED
+ device_id:
+ type: string
+ description: Device ID of this port
+ required: false
+ status: SUPPORTED
+ qos_policy:
+ type: string
+ description: The name or ID of QoS policy to attach to this network
+ required: false
+ status: SUPPORTED
+ allowed_address_pairs:
+ type: list
+ description: Additional MAC/IP address pairs allowed to pass through the port
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.AddressPair
+ binding:vnic_type:
+ type: string
+ description: The vnic type to be bound on the neutron port
+ required: false
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - macvtap
+ - direct
+ - normal
+ value_specs:
+ type: map
+ description: Extra parameters to include in the request
+ required: false
+ default: {
+ }
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ device_owner:
+ type: string
+ description: Name of the network owning the port
+ required: false
+ status: SUPPORTED
+ network:
+ type: string
+ description: Network this port belongs to
+ required: false
+ status: SUPPORTED
+ replacement_policy:
+ type: string
+ description: Policy on how to respond to a stack-update for this resource
+ required: false
+ default: AUTO
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - REPLACE_ALWAYS
+ - AUTO
+ security_groups:
+ type: list
+ description: List of security group names or IDs
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ fixed_ips:
+ type: list
+ description: Desired IPs for this port
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.neutron.port.FixedIps
+ mac_address:
+ type: string
+ description: MAC address to give to this port
+ required: false
+ status: SUPPORTED
+ admin_state_up:
+ type: boolean
+ description: A boolean value specifying the administrative status of the network
+ required: false
+ default: true
+ status: SUPPORTED
+ name:
+ type: string
+ description: A symbolic name for this port
+ required: false
+ status: SUPPORTED
+ attributes:
+ tenant_id:
+ type: string
+ description: Tenant owning the port
+ status: SUPPORTED
+ network_id:
+ type: string
+ description: Unique identifier for the network owning the port
+ status: SUPPORTED
+ qos_policy_id:
+ type: string
+ description: The QoS policy ID attached to this network
+ status: SUPPORTED
+ show:
+ type: string
+ description: Detailed information about resource
+ status: SUPPORTED
+ subnets:
+ type: list
+ description: Subnets of this network
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ status:
+ type: string
+ description: The status of the network
+ status: SUPPORTED
+ capabilities:
+ attachment:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronSecurityRulesGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..49c9a102c8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
@@ -0,0 +1,116 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: NeutronSecurityRulesGlobalTypes
+ template_version: 1.0.0
+description: Neutron Security Rules TOSCA Global Types
+imports:
+ common_definitions:
+ file: CommonGlobalTypesServiceTemplate.yaml
+data_types:
+ org.openecomp.datatypes.heat.network.neutron.SecurityRules.Rule:
+ derived_from: tosca.datatypes.Root
+ description: Rules Pairs
+ properties:
+ remote_group_id:
+ type: string
+ description: The remote group ID to be associated with this security group rule
+ required: false
+ status: SUPPORTED
+ protocol:
+ type: string
+ description: The protocol that is matched by the security group rule
+ required: false
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - tcp
+ - udp
+ - icmp
+ ethertype:
+ type: string
+ description: Ethertype of the traffic
+ required: false
+ default: IPv4
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - IPv4
+ - IPv6
+ port_range_max:
+ type: integer
+ description: 'The maximum port number in the range that is matched by the
+ security group rule. '
+ required: false
+ status: SUPPORTED
+ constraints:
+ - in_range:
+ - 0
+ - 65535
+ remote_ip_prefix:
+ type: string
+ description: The remote IP prefix (CIDR) to be associated with this security group rule
+ required: false
+ status: SUPPORTED
+ remote_mode:
+ type: string
+ description: Whether to specify a remote group or a remote IP prefix
+ required: false
+ default: remote_ip_prefix
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - remote_ip_prefix
+ - remote_group_id
+ direction:
+ type: string
+ description: The direction in which the security group rule is applied
+ required: false
+ default: ingress
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - egress
+ - ingress
+ port_range_min:
+ type: integer
+ description: The minimum port number in the range that is matched by the security group rule.
+ required: false
+ status: SUPPORTED
+ constraints:
+ - in_range:
+ - 0
+ - 65535
+node_types:
+ org.openecomp.resource.nodes.heat.network.neutron.SecurityRules:
+ derived_from: tosca.nodes.Root
+ properties:
+ description:
+ type: string
+ description: Description of the security group
+ required: false
+ status: SUPPORTED
+ name:
+ type: string
+ description: A symbolic name for this security group, which is not required to be unique.
+ required: false
+ status: SUPPORTED
+ rules:
+ type: list
+ description: List of security group rules
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.neutron.SecurityRules.Rule
+ attributes:
+ show:
+ type: string
+ description: Detailed information about resource
+ status: SUPPORTED
+ requirements:
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ relationship: org.openecomp.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NovaServerGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NovaServerGlobalTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..2253a1e4af
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NovaServerGlobalTypesServiceTemplate.yaml
@@ -0,0 +1,249 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: NovaServerGlobalTypes
+ template_version: 1.0.0
+description: Nova Server TOSCA Global Types
+imports:
+ common_definitions:
+ file: CommonGlobalTypesServiceTemplate.yaml
+data_types:
+ org.openecomp.datatypes.heat.novaServer.network.PortExtraProperties:
+ derived_from: tosca.datatypes.Root
+ description: Nova server network expand properties for port
+ properties:
+ port_security_enabled:
+ type: boolean
+ description: Flag to enable/disable port security on the port
+ required: false
+ status: SUPPORTED
+ mac_address:
+ type: string
+ description: MAC address to give to this port
+ required: false
+ status: SUPPORTED
+ admin_state_up:
+ type: boolean
+ description: The administrative state of this port
+ required: false
+ default: true
+ status: SUPPORTED
+ qos_policy:
+ type: string
+ description: The name or ID of QoS policy to attach to this port
+ required: false
+ status: SUPPORTED
+ allowed_address_pairs:
+ type: list
+ description: Additional MAC/IP address pairs allowed to pass through the port
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.AddressPair
+ binding:vnic_type:
+ type: string
+ description: The vnic type to be bound on the neutron port
+ required: false
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - macvtap
+ - direct
+ - normal
+ value_specs:
+ type: map
+ description: Extra parameters to include in the request
+ required: false
+ default: {
+ }
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ org.openecomp.datatypes.heat.novaServer.network.AddressInfo:
+ derived_from: tosca.datatypes.network.NetworkInfo
+ description: Network addresses with corresponding port id
+ properties:
+ port_id:
+ type: string
+ description: Port id
+ required: false
+ status: SUPPORTED
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.nova.Server:
+ derived_from: tosca.nodes.Compute
+ properties:
+ admin_pass:
+ type: string
+ description: The administrator password for the server
+ required: false
+ status: SUPPORTED
+ availability_zone:
+ type: string
+ description: Availability zone to create servers in
+ required: false
+ status: SUPPORTED
+ image:
+ type: string
+ description: The ID or name of the image to boot with
+ required: false
+ status: SUPPORTED
+ image_update_policy:
+ type: string
+ description: Policy on how to apply an image-id update
+ required: false
+ default: REBUILD
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - REBUILD_PRESERVE_EPHEMERAL
+ - REPLACE
+ - REBUILD
+ metadata:
+ type: map
+ description: Arbitrary key/value metadata to store for this server
+ required: false
+ status: SUPPORTED
+ constraints:
+ - max_length: 255
+ entry_schema:
+ type: string
+ constraints:
+ - max_length: 255
+ user_data_update_policy:
+ type: string
+ description: Policy on how to apply a user_data update
+ required: false
+ default: REPLACE
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - REPLACE
+ - IGNORE
+ flavor_update_policy:
+ type: string
+ description: Policy on how to apply a flavor update
+ required: false
+ default: RESIZE
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - RESIZE
+ - REPLACE
+ user_data:
+ type: string
+ description: User data script to be executed by cloud-init
+ required: false
+ default: ''
+ status: SUPPORTED
+ flavor:
+ type: string
+ description: The ID or name of the flavor to boot onto
+ required: true
+ status: SUPPORTED
+ key_name:
+ type: string
+ description: Name of keypair to inject into the server
+ required: false
+ status: SUPPORTED
+ reservation_id:
+ type: string
+ description: A UUID for the set of servers being requested
+ required: false
+ status: SUPPORTED
+ security_groups:
+ type: list
+ description: List of security group names or IDs
+ required: false
+ default: [
+ ]
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ config_drive:
+ type: boolean
+ description: enable config drive on the server
+ required: false
+ status: SUPPORTED
+ personality:
+ type: map
+ description: A map of files to create/overwrite on the server upon boot
+ required: false
+ default: {
+ }
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ software_config_transport:
+ type: string
+ description: How the server should receive the metadata required for software configuration
+ required: false
+ default: POLL_SERVER_CFN
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - POLL_SERVER_CFN
+ - POLL_SERVER_HEAT
+ - POLL_TEMP_URL
+ - ZAQAR_MESSAGE
+ user_data_format:
+ type: string
+ description: How the user_data should be formatted for the server
+ required: false
+ default: HEAT_CFNTOOLS
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - SOFTWARE_CONFIG
+ - RAW
+ - HEAT_CFNTOOLS
+ diskConfig:
+ type: string
+ description: Control how the disk is partitioned when the server is created
+ required: false
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - AUTO
+ - MANUAL
+ name:
+ type: string
+ description: Server name
+ required: false
+ status: SUPPORTED
+ scheduler_hints:
+ type: map
+ description: Arbitrary key-value pairs specified by the client to help boot a server
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ attributes:
+ accessIPv4:
+ type: string
+ description: The manually assigned alternative public IPv4 address of the server
+ status: SUPPORTED
+ addresses:
+ type: map
+ description: A dict of all network addresses with corresponding port_id
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.novaServer.network.AddressInfo
+ accessIPv6:
+ type: string
+ description: The manually assigned alternative public IPv6 address of the server
+ status: SUPPORTED
+ instance_name:
+ type: string
+ description: AWS compatible instance name
+ status: SUPPORTED
+ name:
+ type: string
+ description: Name of the server
+ status: SUPPORTED
+ show:
+ type: string
+ description: Detailed information about resource
+ status: SUPPORTED
+ console_urls:
+ type: string
+ description: URLs of servers consoles
+ status: SUPPORTED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/pom.xml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/pom.xml
new file mode 100644
index 0000000000..8f82967e74
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/pom.xml
@@ -0,0 +1,102 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+
+
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-lib</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../..</relativePath>
+ </parent>
+
+ <name>openecomp-sdc-enrichment-impl</name>
+ <artifactId>openecomp-sdc-enrichment-impl</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.7.10</version>
+
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <version>1.1.2</version>
+
+ </dependency>
+
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <scope>test</scope>
+ <version>6.8.5</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>snakeyaml</artifactId>
+ <groupId>org.yaml</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>RELEASE</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-utilities-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-enrichment-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-model-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-common-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <scope>test</scope>
+ <version>1.10.19</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <version>19.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-heat-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-tosca-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-translator-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+
+ </dependencies>
+
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/EnrichmentInfo.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/EnrichmentInfo.java
new file mode 100644
index 0000000000..17c4091a28
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/EnrichmentInfo.java
@@ -0,0 +1,63 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.enrichment;
+
+import org.openecomp.core.enrichment.types.EntityInfo;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class EnrichmentInfo {
+ Map<String, List<Object>> additionalInfo = new HashMap<>();
+ Map<String, EntityInfo> entityInfo = new HashMap<>(); //componentName,EntityInfo
+ String key;
+ Version version;
+
+ public Map<String, List<Object>> getAdditionalInfo() {
+ return additionalInfo;
+ }
+
+ public Map<String, EntityInfo> getEntityInfo() {
+ return entityInfo;
+ }
+
+ public void addEntityInfo(String type, EntityInfo entityInfo) {
+ this.entityInfo.put(type, entityInfo);
+ }
+
+ public String getKey() {
+ return key;
+ }
+
+ public void setKey(String key) {
+ this.key = key;
+ }
+
+ public Version getVersion() {
+ return version;
+ }
+
+ public void setVersion(Version version) {
+ this.version = version;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/factory/EnricherHandlerFactory.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/factory/EnricherHandlerFactory.java
new file mode 100644
index 0000000000..47821f6670
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/factory/EnricherHandlerFactory.java
@@ -0,0 +1,32 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.enrichment.factory;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+import org.openecomp.sdc.enrichment.inter.EnricherHandler;
+
+public abstract class EnricherHandlerFactory extends AbstractComponentFactory<EnricherHandler> {
+
+ public static EnricherHandlerFactory getInstance() {
+ return AbstractFactory.getInstance(EnricherHandlerFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/EnricherHandlerFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/EnricherHandlerFactoryImpl.java
new file mode 100644
index 0000000000..00f5c91661
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/EnricherHandlerFactoryImpl.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.enrichment.impl;
+
+
+import org.openecomp.sdc.enrichment.factory.EnricherHandlerFactory;
+import org.openecomp.sdc.enrichment.inter.EnricherHandler;
+
+public class EnricherHandlerFactoryImpl extends EnricherHandlerFactory {
+
+ @Override
+ public EnricherHandler createInterface() {
+ return new EnricherHandlerImpl();
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/EnricherHandlerImpl.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/EnricherHandlerImpl.java
new file mode 100644
index 0000000000..e2e5b47d2a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/EnricherHandlerImpl.java
@@ -0,0 +1,89 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.enrichment.impl;
+
+import org.openecomp.core.enrichment.types.EntityInfo;
+import org.openecomp.sdc.datatypes.error.ErrorMessage;
+import org.openecomp.sdc.datatypes.model.AsdcModel;
+import org.openecomp.sdc.enrichment.EnrichmentInfo;
+import org.openecomp.sdc.enrichment.impl.external.artifact.ExternalArtifactEnricher;
+import org.openecomp.sdc.enrichment.impl.tosca.ToscaEnricher;
+import org.openecomp.sdc.enrichment.inter.Enricher;
+import org.openecomp.sdc.enrichment.inter.EnricherHandler;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * The type Enricher handler.
+ */
+public class EnricherHandlerImpl implements EnricherHandler {
+
+ private static Logger logger = LoggerFactory.getLogger(EnricherHandlerImpl.class);
+ private EnrichmentInfo input;
+ private AsdcModel model;
+
+ @Override
+ public List<Enricher> getEnrichers() {
+ List<Enricher> enricherList = new ArrayList<>();
+ enricherList.add(new ToscaEnricher());
+ enricherList.add(new ExternalArtifactEnricher());
+ return enricherList;
+ }
+
+ @Override
+ public Map<String, List<ErrorMessage>> enrich() {
+ Map<String, List<ErrorMessage>> errors = new HashMap<>();
+ Map<String, List<ErrorMessage>> enricherResponse;
+ for (Enricher enricher : getEnrichers()) {
+ enricher.setInput(this.input);
+ enricher.setModel(this.model);
+ enricherResponse = enricher.enrich();
+ errors.putAll(enricherResponse);
+ }
+ return errors;
+ }
+
+ /**
+ * Adds additional input.
+ *
+ * @param key key
+ * @param input input
+ */
+ public void addAdditionalInput(String key, Object input) {
+ if (!this.input.getAdditionalInfo().containsKey(key)) {
+ this.input.getAdditionalInfo().put(key, new ArrayList<>());
+ }
+ this.input.getAdditionalInfo().get(key).add(input);
+ }
+
+ public void addEntityInfo(String entityId, EntityInfo entityInfo) {
+ this.input.getEntityInfo().put(entityId, entityInfo);
+ }
+
+ public void setModel(AsdcModel model) {
+ this.model = model;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/external/artifact/ExternalArtifactEnricher.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/external/artifact/ExternalArtifactEnricher.java
new file mode 100644
index 0000000000..a276cfba7d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/external/artifact/ExternalArtifactEnricher.java
@@ -0,0 +1,106 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.enrichment.impl.external.artifact;
+
+import org.openecomp.core.enrichment.types.ComponentArtifactType;
+import org.openecomp.core.enrichment.types.MibInfo;
+import org.openecomp.core.model.dao.EnrichedServiceModelDao;
+import org.openecomp.core.model.dao.EnrichedServiceModelDaoFactory;
+import org.openecomp.core.model.types.ServiceArtifact;
+import org.openecomp.core.utilities.file.FileContentHandler;
+import org.openecomp.core.utilities.file.FileUtils;
+import org.openecomp.core.validation.errors.Messages;
+import org.openecomp.sdc.datatypes.error.ErrorLevel;
+import org.openecomp.sdc.datatypes.error.ErrorMessage;
+import org.openecomp.sdc.enrichment.impl.tosca.ComponentInfo;
+import org.openecomp.sdc.enrichment.inter.Enricher;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+public class ExternalArtifactEnricher extends Enricher {
+
+ private static EnrichedServiceModelDao enrichedServiceModelDao =
+ EnrichedServiceModelDaoFactory.getInstance().createInterface();
+
+
+ @Override
+ public Map<String, List<ErrorMessage>> enrich() {
+
+ Map<String, List<ErrorMessage>> errors = new HashMap<>();
+ input.getEntityInfo().entrySet().stream().forEach(
+ entry -> enrichComponentMib(entry.getKey(), (ComponentInfo) entry.getValue(), errors));
+
+
+ return errors;
+ }
+
+
+ private void enrichComponentMib(String componentName, ComponentInfo componentInfo,
+ Map<String, List<ErrorMessage>> errors) {
+
+ String vspId = input.getKey();
+ Version version = input.getVersion();
+ ServiceArtifact mibServiceArtifact = new ServiceArtifact();
+ mibServiceArtifact.setVspId(vspId);
+ mibServiceArtifact.setVersion(version);
+ enrichMibFiles(mibServiceArtifact, componentInfo, errors);
+ }
+
+ private void enrichMibFiles(ServiceArtifact mibServiceArtifact, ComponentInfo componentInfo,
+ Map<String, List<ErrorMessage>> errors) {
+ if (componentInfo.getMibInfo() == null) {
+ return;
+ }
+ enrichMibByType(componentInfo.getMibInfo().getSnmpTrap(), ComponentArtifactType.SNMP_TRAP,
+ mibServiceArtifact, errors);
+ enrichMibByType(componentInfo.getMibInfo().getSnmpPoll(), ComponentArtifactType.SNMP_POLL,
+ mibServiceArtifact, errors);
+ }
+
+ private void enrichMibByType(MibInfo mibInfo, ComponentArtifactType type,
+ ServiceArtifact mibServiceArtifact,
+ Map<String, List<ErrorMessage>> errors) {
+ if (mibInfo == null) {
+ return;
+ }
+ FileContentHandler mibs;
+ try {
+ mibs = FileUtils.getFileContentMapFromZip(FileUtils.toByteArray(mibInfo.getContent()));
+ } catch (IOException ioException) {
+ ErrorMessage.ErrorMessageUtil
+ .addMessage(mibServiceArtifact.getName() + "." + type.name(), errors)
+ .add(new ErrorMessage(ErrorLevel.ERROR, Messages.INVALID_ZIP_FILE.getErrorMessage()));
+ return;
+ }
+ Set<String> fileList = mibs.getFileList();
+ for (String fileName : fileList) {
+ mibServiceArtifact.setContentData(FileUtils.toByteArray(mibs.getFileContent(fileName)));
+ mibServiceArtifact.setName(mibInfo.getName() + File.separator + fileName);
+ enrichedServiceModelDao.storeExternalArtifact(mibServiceArtifact);
+ }
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/CeilometerEnricher.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/CeilometerEnricher.java
new file mode 100644
index 0000000000..eb79787b59
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/CeilometerEnricher.java
@@ -0,0 +1,112 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.enrichment.impl.tosca;
+
+import org.apache.commons.collections4.MapUtils;
+import org.openecomp.core.enrichment.types.CeilometerInfo;
+import org.openecomp.sdc.datatypes.error.ErrorMessage;
+import org.openecomp.sdc.enrichment.EnrichmentInfo;
+import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType;
+import org.openecomp.sdc.tosca.datatypes.ToscaElementTypes;
+import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
+import org.openecomp.sdc.tosca.datatypes.model.CapabilityDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.CapabilityType;
+import org.openecomp.sdc.tosca.datatypes.model.NodeType;
+import org.openecomp.sdc.tosca.services.ToscaAnalyzerService;
+import org.openecomp.sdc.tosca.services.ToscaUtil;
+import org.openecomp.sdc.tosca.services.impl.ToscaAnalyzerServiceImpl;
+import org.openecomp.sdc.translator.services.heattotosca.globaltypes.CommonGlobalTypes;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class CeilometerEnricher {
+ /**
+ * Enrich map.
+ *
+ * @param toscaModel the tosca model
+ * @param modelNodeType the model node type
+ * @param input the input
+ * @return the map
+ */
+ public static Map<String, List<ErrorMessage>> enrich(ToscaServiceModel toscaModel,
+ Map<String, List<NodeType>> modelNodeType,
+ EnrichmentInfo input) {
+ Map<String, List<ErrorMessage>> errors = new HashMap<>();
+ input.getEntityInfo().entrySet().stream().forEach(
+ entry -> enrichNodeType(toscaModel, (ComponentInfo) entry.getValue(),
+ modelNodeType.get(entry.getKey())));
+
+ return errors;
+ }
+
+ private static void enrichNodeType(ToscaServiceModel toscaModel, ComponentInfo componentInfo,
+ List<NodeType> nodeTypes) {
+
+ for (CeilometerInfo ceilometerInfo : componentInfo.getCeilometerInfo()
+ .getCeilometerInfoList()) {
+ String capabilityId = ceilometerInfo.getName();
+
+ Map<String, Object> properties = getCeilometerProperties(ceilometerInfo);
+
+ //CapabilityType capabilityType = CommonGlobalTypes.createServiceTemplate()
+ // .getCapability_types().
+ // get(ToscaCapabilityType.METRIC_CEILOMETER.getDisplayName());
+ //CapabilityType metricCapabilityType = CommonGlobalTypes.createServiceTemplate().
+ // getCapability_types().get(ToscaCapabilityType.METRIC.getDisplayName());
+ ToscaAnalyzerService toscaAnalyzerService = new ToscaAnalyzerServiceImpl();
+ CapabilityType capabilityType = (CapabilityType) toscaAnalyzerService
+ .getFlatEntity(ToscaElementTypes.CAPABILITY_TYPE,
+ ToscaCapabilityType.METRIC_CEILOMETER.getDisplayName(),
+ CommonGlobalTypes.createServiceTemplate(), toscaModel);
+
+
+ nodeTypes.stream().forEach(nodeType ->
+ addCapability(nodeType, capabilityId, ToscaUtil
+ .convertTypeToDefinition(ToscaCapabilityType.METRIC_CEILOMETER.getDisplayName(),
+ capabilityType, properties, ceilometerInfo.getDescription())));
+ }
+ }
+
+ private static Map<String, Object> getCeilometerProperties(CeilometerInfo ceilometerInfo) {
+ Map<String, Object> properties = new HashMap<>();
+ properties.put("name", ceilometerInfo.getName());
+ properties.put("type", ceilometerInfo.getType());
+ properties.put("unit", ceilometerInfo.getUnit());
+ if (ceilometerInfo.getCategory() != null) {
+ properties.put("category", ceilometerInfo.getCategory());
+ }
+ return properties;
+ }
+
+ private static void addCapability(NodeType nodeType, String capabilityId,
+ CapabilityDefinition capabilityDefinition) {
+ if (MapUtils.isEmpty(nodeType.getCapabilities())) {
+ nodeType.setCapabilities(new HashMap<>());
+ }
+ //clean unnecessary info
+ capabilityDefinition.setAttributes(null);
+ capabilityDefinition.setOccurrences(null);
+
+ nodeType.getCapabilities().put(capabilityId, capabilityDefinition);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/ComponentInfo.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/ComponentInfo.java
new file mode 100644
index 0000000000..0a1f3d36ff
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/ComponentInfo.java
@@ -0,0 +1,47 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.enrichment.impl.tosca;
+
+import org.openecomp.core.enrichment.types.ComponentCeilometerInfo;
+import org.openecomp.core.enrichment.types.ComponentMibInfo;
+import org.openecomp.core.enrichment.types.EntityInfo;
+
+public class ComponentInfo implements EntityInfo {
+
+ private ComponentCeilometerInfo ceilometerInfo;
+ private ComponentMibInfo mibInfo;
+
+ public ComponentCeilometerInfo getCeilometerInfo() {
+ return ceilometerInfo;
+ }
+
+ public void setCeilometerInfo(ComponentCeilometerInfo ceilometerInfo) {
+ this.ceilometerInfo = ceilometerInfo;
+ }
+
+ public ComponentMibInfo getMibInfo() {
+ return mibInfo;
+ }
+
+ public void setMibInfo(ComponentMibInfo mibInfo) {
+ this.mibInfo = mibInfo;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/SnmpEnricher.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/SnmpEnricher.java
new file mode 100644
index 0000000000..42cbcdd50b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/SnmpEnricher.java
@@ -0,0 +1,38 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.enrichment.impl.tosca;
+
+import org.openecomp.sdc.datatypes.error.ErrorMessage;
+
+import org.openecomp.sdc.enrichment.EnrichmentInfo;
+import org.openecomp.sdc.tosca.datatypes.model.NodeType;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class SnmpEnricher {
+ public static Map<String, List<ErrorMessage>> enrich(Map<String, List<NodeType>> modelNodeType,
+ EnrichmentInfo input) {
+ return new HashMap<>();
+
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/ToscaEnricher.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/ToscaEnricher.java
new file mode 100644
index 0000000000..2c0f03480f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/ToscaEnricher.java
@@ -0,0 +1,73 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.enrichment.impl.tosca;
+
+import org.openecomp.sdc.datatypes.error.ErrorMessage;
+import org.openecomp.sdc.enrichment.inter.Enricher;
+import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
+import org.openecomp.sdc.tosca.datatypes.model.NodeType;
+import org.openecomp.sdc.tosca.services.ToscaUtil;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class ToscaEnricher extends Enricher {
+
+ Map<String, List<NodeType>> componentTypNodeTypeMap;
+
+ @Override
+ public Map<String, List<ErrorMessage>> enrich() {
+ Map<String, List<ErrorMessage>> errors = new HashMap<>();
+ Map<String, List<ErrorMessage>> enrichResponse;
+ enrichResponse = enrichCilometer();
+ errors.putAll(enrichResponse);
+ enrichResponse = enrichSnmp();
+ errors.putAll(enrichResponse);
+
+
+ return errors;
+ }
+
+ private Map<String, List<ErrorMessage>> enrichCilometer() {
+ Map<String, List<ErrorMessage>> enrichResponse;
+
+ ToscaServiceModel toscaModel = (ToscaServiceModel) model;
+
+ componentTypNodeTypeMap =
+ ToscaUtil.normalizeComponentNameNodeType(toscaModel, input.getEntityInfo().keySet());
+
+ enrichResponse = CeilometerEnricher.enrich(toscaModel, componentTypNodeTypeMap, this.input);
+
+ return enrichResponse;
+ }
+
+
+ private Map<String, List<ErrorMessage>> enrichSnmp() {
+ Map<String, List<ErrorMessage>> enrichResponse;
+
+ enrichResponse = SnmpEnricher.enrich(componentTypNodeTypeMap, this.input);
+
+ return enrichResponse;
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/inter/Enricher.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/inter/Enricher.java
new file mode 100644
index 0000000000..1d6867d1f3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/inter/Enricher.java
@@ -0,0 +1,45 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.enrichment.inter;
+
+import org.openecomp.sdc.datatypes.error.ErrorMessage;
+import org.openecomp.sdc.datatypes.model.AsdcModel;
+import org.openecomp.sdc.enrichment.EnrichmentInfo;
+
+import java.util.List;
+import java.util.Map;
+
+public abstract class Enricher {
+
+
+ protected EnrichmentInfo input;
+ protected AsdcModel model;
+
+ public void setInput(EnrichmentInfo input) {
+ this.input = input;
+ }
+
+ public void setModel(AsdcModel model) {
+ this.model = model;
+ }
+
+ public abstract Map<String, List<ErrorMessage>> enrich();
+}
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/inter/EnricherHandler.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/inter/EnricherHandler.java
new file mode 100644
index 0000000000..717bbc8313
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/inter/EnricherHandler.java
@@ -0,0 +1,41 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.enrichment.inter;
+
+import org.openecomp.sdc.datatypes.error.ErrorMessage;
+import org.openecomp.sdc.datatypes.model.AsdcModel;
+
+import java.util.List;
+import java.util.Map;
+
+public interface EnricherHandler {
+
+
+ List<Enricher> getEnrichers();
+
+ Map<String, List<ErrorMessage>> enrich();
+
+ void addAdditionalInput(String key, Object input);
+
+ void setModel(AsdcModel model);
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/resources/factoryConfiguration.json b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/resources/factoryConfiguration.json
new file mode 100644
index 0000000000..56510be13c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/resources/factoryConfiguration.json
@@ -0,0 +1,3 @@
+{
+ "org.openecomp.sdc.enrichment.factory.EnricherHandlerFactory": "org.openecomp.sdc.enrichment.impl.EnricherHandlerFactoryImpl"
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/pom.xml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/pom.xml
new file mode 100644
index 0000000000..314dac2447
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/pom.xml
@@ -0,0 +1,41 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+
+
+ <parent>
+ <artifactId>openecomp-sdc-lib</artifactId>
+ <groupId>org.openecomp.sdc</groupId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>openecomp-sdc-enrichment-lib</artifactId>
+ <name>openecomp-sdc-enrichment-lib</name>
+ <packaging>pom</packaging>
+
+
+ <modules>
+ <module>openecomp-sdc-enrichment-api</module>
+ <module>openecomp-sdc-enrichment-core</module>
+ <module>openecomp-sdc-enrichment-impl</module>
+ </modules>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-enrichment-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-enrichment-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <!--dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-validation-impl</artifactId>
+ <version>${project.version}</version>
+ </dependency-->
+ </dependencies>
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/pom.xml b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/pom.xml
new file mode 100644
index 0000000000..81016a413b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/pom.xml
@@ -0,0 +1,49 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-lib</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../..</relativePath>
+ </parent>
+
+ <name>openecomp-sdc-model-api</name>
+ <artifactId>openecomp-sdc-model-api</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-facade-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-validation-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-versioning-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>io.swagger</groupId>
+ <artifactId>swagger-annotations</artifactId>
+ <version>1.5.3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-heat-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-tosca-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ </dependencies>
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceArtifactDao.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceArtifactDao.java
new file mode 100644
index 0000000000..e25845d319
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceArtifactDao.java
@@ -0,0 +1,28 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.model.dao;
+
+import org.openecomp.core.model.types.ServiceArtifact;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+public interface EnrichedServiceArtifactDao extends ServiceArtifactDaoInter {
+ ServiceArtifact getArtifactInfo(String vspId, Version version, String name);
+}
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceArtifactDaoFactory.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceArtifactDaoFactory.java
new file mode 100644
index 0000000000..3852e983e5
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceArtifactDaoFactory.java
@@ -0,0 +1,32 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.model.dao;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+public abstract class EnrichedServiceArtifactDaoFactory
+ extends AbstractComponentFactory<EnrichedServiceArtifactDao> {
+
+ public static EnrichedServiceArtifactDaoFactory getInstance() {
+ return AbstractFactory.getInstance(EnrichedServiceArtifactDaoFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceModelDao.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceModelDao.java
new file mode 100644
index 0000000000..d547316ebf
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceModelDao.java
@@ -0,0 +1,42 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.model.dao;
+
+import org.openecomp.core.model.types.ServiceArtifact;
+import org.openecomp.sdc.versioning.dao.VersionableDao;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.util.List;
+
+public interface EnrichedServiceModelDao<M, E> extends VersionableDao {
+
+ M getServiceModel(String vspId, Version version);
+
+ void storeServiceModel(String vspId, Version version, M serviceModel);
+
+ void storeExternalArtifact(ServiceArtifact serviceArtifact);
+
+ List<ServiceArtifact> getExternalArtifacts(String vspId, Version version);
+
+ E getServiceModelInfo(String vspId, Version version, String name);
+
+ List<String> getServiceModelContentNames();
+}
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceModelDaoFactory.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceModelDaoFactory.java
new file mode 100644
index 0000000000..9d18d6c9cf
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceModelDaoFactory.java
@@ -0,0 +1,32 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.model.dao;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+public abstract class EnrichedServiceModelDaoFactory
+ extends AbstractComponentFactory<EnrichedServiceModelDao> {
+
+ public static EnrichedServiceModelDaoFactory getInstance() {
+ return AbstractFactory.getInstance(EnrichedServiceModelDaoFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceTemplateDao.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceTemplateDao.java
new file mode 100644
index 0000000000..5ea2de7fd9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceTemplateDao.java
@@ -0,0 +1,26 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.model.dao;
+
+
+public interface EnrichedServiceTemplateDao extends ServiceTemplateDaoInter {
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceTemplateDaoFactory.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceTemplateDaoFactory.java
new file mode 100644
index 0000000000..cab3ca6247
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceTemplateDaoFactory.java
@@ -0,0 +1,32 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.model.dao;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+public abstract class EnrichedServiceTemplateDaoFactory
+ extends AbstractComponentFactory<EnrichedServiceTemplateDao> {
+
+ public static EnrichedServiceTemplateDaoFactory getInstance() {
+ return AbstractFactory.getInstance(EnrichedServiceTemplateDaoFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceArtifactDao.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceArtifactDao.java
new file mode 100644
index 0000000000..48f59d06ae
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceArtifactDao.java
@@ -0,0 +1,44 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.model.dao;
+
+import org.openecomp.core.model.types.ServiceArtifact;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.util.Collection;
+
+public interface ServiceArtifactDao extends ServiceArtifactDaoInter {
+
+ Collection<ServiceArtifact> list(String vspId, Version version);
+
+ void create(ServiceArtifact entity);
+
+ void update(ServiceArtifact entity);
+
+ ServiceArtifact get(String vspId, Version version);
+
+ void delete(String vspId, Version version);
+
+ Object[] getKeys(String vspId, Version version);
+
+ ServiceArtifact getArtifactInfo(String vspId, Version version, String name);
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceArtifactDaoFactory.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceArtifactDaoFactory.java
new file mode 100644
index 0000000000..07c2191a7c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceArtifactDaoFactory.java
@@ -0,0 +1,32 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.model.dao;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+public abstract class ServiceArtifactDaoFactory
+ extends AbstractComponentFactory<ServiceArtifactDao> {
+
+ public static ServiceArtifactDaoFactory getInstance() {
+ return AbstractFactory.getInstance(ServiceArtifactDaoFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceArtifactDaoInter.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceArtifactDaoInter.java
new file mode 100644
index 0000000000..20d0c56c1b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceArtifactDaoInter.java
@@ -0,0 +1,44 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.model.dao;
+
+import org.openecomp.core.model.types.ServiceArtifact;
+import org.openecomp.sdc.versioning.dao.VersionableDao;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.util.Collection;
+
+public interface ServiceArtifactDaoInter extends VersionableDao {
+
+ Collection<ServiceArtifact> list(String vspId, Version version);
+
+ void create(ServiceArtifact entity);
+
+ void update(ServiceArtifact entity);
+
+ ServiceArtifact get(String vspId, Version version);
+
+ void delete(String vspId, Version version);
+
+ Object[] getKeys(String vspId, Version version);
+
+ ServiceArtifact getArtifactInfo(String vspId, Version version, String name);
+}
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceModelDao.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceModelDao.java
new file mode 100644
index 0000000000..30bb79c100
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceModelDao.java
@@ -0,0 +1,40 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.model.dao;
+
+import org.openecomp.core.model.types.ServiceArtifact;
+import org.openecomp.sdc.versioning.dao.VersionableDao;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.util.List;
+
+public interface ServiceModelDao<M, E> extends VersionableDao {
+
+ M getServiceModel(String vspId, Version version);
+
+ void storeServiceModel(String vspId, Version version, M serviceModel);
+
+ E getServiceModelInfo(String vspId, Version version, String name);
+
+ void storeExternalArtifact(ServiceArtifact serviceArtifact);
+
+ List<String> getServiceModelContentNames();
+}
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceModelDaoFactory.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceModelDaoFactory.java
new file mode 100644
index 0000000000..19f6cb5c8c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceModelDaoFactory.java
@@ -0,0 +1,31 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.model.dao;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+public abstract class ServiceModelDaoFactory extends AbstractComponentFactory<ServiceModelDao> {
+
+ public static ServiceModelDaoFactory getInstance() {
+ return AbstractFactory.getInstance(ServiceModelDaoFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceTemplateDao.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceTemplateDao.java
new file mode 100644
index 0000000000..c0c919b8a0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceTemplateDao.java
@@ -0,0 +1,44 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.model.dao;
+
+import org.openecomp.core.model.types.ServiceTemplate;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.util.Collection;
+
+public interface ServiceTemplateDao extends ServiceTemplateDaoInter {
+ void create(ServiceTemplate entity);
+
+ void update(ServiceTemplate entity);
+
+ ServiceTemplate get(String vspId, Version version);
+
+ void delete(String vspId, Version version);
+
+ Object[] getKeys(String vspId, Version version);
+
+ ServiceTemplate getTemplateInfo(String vspId, Version version, String name);
+
+ Collection<ServiceTemplate> list(String vspId, Version version);
+
+ String getBase(String vspId, Version version);
+}
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceTemplateDaoFactory.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceTemplateDaoFactory.java
new file mode 100644
index 0000000000..65aad1bb97
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceTemplateDaoFactory.java
@@ -0,0 +1,32 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.model.dao;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+public abstract class ServiceTemplateDaoFactory
+ extends AbstractComponentFactory<ServiceTemplateDao> {
+
+ public static ServiceTemplateDaoFactory getInstance() {
+ return AbstractFactory.getInstance(ServiceTemplateDaoFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceTemplateDaoInter.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceTemplateDaoInter.java
new file mode 100644
index 0000000000..c4c4cb19b7
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceTemplateDaoInter.java
@@ -0,0 +1,46 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.model.dao;
+
+import org.openecomp.core.model.types.ServiceTemplate;
+import org.openecomp.sdc.versioning.dao.VersionableDao;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.util.Collection;
+
+public interface ServiceTemplateDaoInter extends VersionableDao {
+ void create(ServiceTemplate entity);
+
+ void update(ServiceTemplate entity);
+
+ ServiceTemplate get(String vspId, Version version);
+
+ void delete(String vspId, Version version);
+
+ Object[] getKeys(String vspId, Version version);
+
+ ServiceTemplate getTemplateInfo(String vspId, Version version, String name);
+
+ Collection<ServiceTemplate> list(String vspId, Version version);
+
+ String getBase(String vspId, Version version);
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/EnrichedServiceArtifactEntity.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/EnrichedServiceArtifactEntity.java
new file mode 100644
index 0000000000..87e25613fc
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/EnrichedServiceArtifactEntity.java
@@ -0,0 +1,136 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.model.types;
+
+import com.google.common.io.ByteStreams;
+
+import com.datastax.driver.mapping.annotations.ClusteringColumn;
+import com.datastax.driver.mapping.annotations.Column;
+import com.datastax.driver.mapping.annotations.Frozen;
+import com.datastax.driver.mapping.annotations.PartitionKey;
+import com.datastax.driver.mapping.annotations.Table;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+
+@Table(keyspace = "dox", name = "vsp_enriched_service_artifact")
+public class EnrichedServiceArtifactEntity implements ServiceElementEntity {
+ private static final String ENTITY_TYPE;
+
+ static {
+ ENTITY_TYPE = "Vendor Software Product Service artifact";
+ }
+
+ @PartitionKey
+ @Column(name = "vsp_id")
+ public String id;
+
+ @PartitionKey(value = 1)
+ @Frozen
+ public Version version;
+
+ @ClusteringColumn
+ @Column(name = "name")
+ public String name;
+
+ @Column(name = "content_data")
+ public ByteBuffer contentData;
+
+ public EnrichedServiceArtifactEntity() {
+ }
+
+ /**
+ * Instantiates a new Enriched service artifact entity.
+ *
+ * @param entity the entity
+ */
+ public EnrichedServiceArtifactEntity(ServiceArtifact entity) {
+ this.id = entity.getVspId();
+ this.version = entity.getVersion();
+ this.name = entity.getName();
+
+ try {
+ this.contentData = ByteBuffer.wrap(ByteStreams.toByteArray(entity.getContent()));
+ } catch (IOException ioException) {
+ throw new RuntimeException(ioException);
+ }
+
+ }
+
+ @Override
+ public String getEntityType() {
+ return ENTITY_TYPE;
+ }
+
+ @Override
+ public String getFirstClassCitizenId() {
+ return getId();
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ @Override
+ public Version getVersion() {
+ return version;
+ }
+
+ @Override
+ public void setVersion(Version version) {
+ this.version = version;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public ByteBuffer getContentData() {
+ return contentData;
+ }
+
+ public void setContentData(ByteBuffer contentData) {
+ this.contentData = contentData;
+ }
+
+ /**
+ * Gets service artifact.
+ *
+ * @return the service artifact
+ */
+ public ServiceArtifact getServiceArtifact() {
+ ServiceArtifact serviceArtifact = new ServiceArtifact();
+ serviceArtifact.setName(this.getName());
+ serviceArtifact.setVersion(this.getVersion());
+ serviceArtifact.setContentData(this.getContentData().array());
+ serviceArtifact.setVspId(this.getId());
+ return serviceArtifact;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/EnrichedServiceTemplateEntity.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/EnrichedServiceTemplateEntity.java
new file mode 100644
index 0000000000..526a901e47
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/EnrichedServiceTemplateEntity.java
@@ -0,0 +1,154 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.model.types;
+
+import com.google.common.io.ByteStreams;
+
+import com.datastax.driver.mapping.annotations.ClusteringColumn;
+import com.datastax.driver.mapping.annotations.Column;
+import com.datastax.driver.mapping.annotations.Frozen;
+import com.datastax.driver.mapping.annotations.PartitionKey;
+import com.datastax.driver.mapping.annotations.Table;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+
+@Table(keyspace = "dox", name = "vsp_enriched_service_template")
+public class EnrichedServiceTemplateEntity implements ServiceElementEntity {
+
+ private static final String ENTITY_TYPE;
+
+ static {
+ ENTITY_TYPE = "Vendor Software Product Service model";
+ }
+
+ @PartitionKey
+ @Column(name = "vsp_id")
+ public String id;
+
+ @PartitionKey(value = 1)
+ @Frozen
+ public Version version;
+
+ @ClusteringColumn
+ @Column(name = "name")
+ public String name;
+
+ @Column(name = "content_data")
+ public ByteBuffer contentData;
+
+
+ @Column(name = "base_name")
+ private String baseName;
+
+ public EnrichedServiceTemplateEntity() {
+ }
+
+ /**
+ * Instantiates a new Enriched service template entity.
+ *
+ * @param entity the entity
+ */
+ public EnrichedServiceTemplateEntity(ServiceTemplate entity) {
+ this.id = entity.getVspId();
+ this.version = entity.getVersion();
+ this.name = entity.getName();
+ this.setBaseName(entity.getBaseName());
+ try {
+ this.contentData = ByteBuffer.wrap(ByteStreams.toByteArray(entity.getContent()));
+ } catch (IOException ioException) {
+ throw new RuntimeException(ioException);
+ }
+
+ }
+
+
+ public String getBaseName() {
+ return baseName;
+ }
+
+ public void setBaseName(String baseName) {
+ this.baseName = baseName;
+ }
+
+
+ @Override
+ public String getEntityType() {
+ return ENTITY_TYPE;
+ }
+
+ @Override
+ public String getFirstClassCitizenId() {
+ return getId();
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ @Override
+ public Version getVersion() {
+ return version;
+ }
+
+ @Override
+ public void setVersion(Version version) {
+ this.version = version;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public ByteBuffer getContentData() {
+ return contentData;
+ }
+
+ public void setContentData(ByteBuffer contentData) {
+ this.contentData = contentData;
+ }
+
+
+ /**
+ * Gets service template.
+ *
+ * @return the service template
+ */
+ public ServiceTemplate getServiceTemplate() {
+ ServiceTemplate serviceTemplate = new ServiceTemplate();
+ serviceTemplate.setName(this.getName());
+ serviceTemplate.setVersion(this.getVersion());
+ serviceTemplate.setContentData(this.getContentData().array());
+ serviceTemplate.setVspId(this.getId());
+ serviceTemplate.setBaseName(this.getBaseName());
+ return serviceTemplate;
+
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceArtifact.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceArtifact.java
new file mode 100644
index 0000000000..fad3e604d6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceArtifact.java
@@ -0,0 +1,29 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.model.types;
+
+public class ServiceArtifact extends ServiceElement {
+
+
+ public ServiceArtifact() {
+ super();
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceArtifactEntity.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceArtifactEntity.java
new file mode 100644
index 0000000000..c5dfeced8a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceArtifactEntity.java
@@ -0,0 +1,136 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.model.types;
+
+import com.google.common.io.ByteStreams;
+
+import com.datastax.driver.mapping.annotations.ClusteringColumn;
+import com.datastax.driver.mapping.annotations.Column;
+import com.datastax.driver.mapping.annotations.Frozen;
+import com.datastax.driver.mapping.annotations.PartitionKey;
+import com.datastax.driver.mapping.annotations.Table;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+
+@Table(keyspace = "dox", name = "vsp_service_artifact")
+public class ServiceArtifactEntity implements ServiceElementEntity {
+ private static final String ENTITY_TYPE;
+
+ static {
+ ENTITY_TYPE = "Vendor Software Product Service artifact";
+ }
+
+ @PartitionKey
+ @Column(name = "vsp_id")
+ public String id;
+
+ @PartitionKey(value = 1)
+ @Frozen
+ public Version version;
+
+ @ClusteringColumn
+ @Column(name = "name")
+ public String name;
+
+ @Column(name = "content_data")
+ public ByteBuffer contentData;
+
+ public ServiceArtifactEntity() {
+ }
+
+ /**
+ * Instantiates a new Service artifact entity.
+ *
+ * @param entity the entity
+ */
+ public ServiceArtifactEntity(ServiceArtifact entity) {
+ this.id = entity.getVspId();
+ this.version = entity.getVersion();
+ this.name = entity.getName();
+
+ try {
+ this.contentData = ByteBuffer.wrap(ByteStreams.toByteArray(entity.getContent()));
+ } catch (IOException ioException) {
+ throw new RuntimeException(ioException);
+ }
+
+ }
+
+ @Override
+ public String getEntityType() {
+ return ENTITY_TYPE;
+ }
+
+ @Override
+ public String getFirstClassCitizenId() {
+ return getId();
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ @Override
+ public Version getVersion() {
+ return version;
+ }
+
+ @Override
+ public void setVersion(Version version) {
+ this.version = version;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public ByteBuffer getContentData() {
+ return contentData;
+ }
+
+ public void setContentData(ByteBuffer contentData) {
+ this.contentData = contentData;
+ }
+
+ /**
+ * Gets service artifact.
+ *
+ * @return the service artifact
+ */
+ public ServiceArtifact getServiceArtifact() {
+ ServiceArtifact serviceArtifact = new ServiceArtifact();
+ serviceArtifact.setName(this.getName());
+ serviceArtifact.setVersion(this.getVersion());
+ serviceArtifact.setContentData(this.getContentData().array());
+ serviceArtifact.setVspId(this.getId());
+ return serviceArtifact;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceElement.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceElement.java
new file mode 100644
index 0000000000..114cf03a39
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceElement.java
@@ -0,0 +1,77 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.model.types;
+
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+
+public class ServiceElement {
+
+ private String vspId;
+ private Version version;
+ private String name;
+ private byte[] contentData;
+
+ public ServiceElement() {
+ }
+
+ public String getVspId() {
+ return vspId;
+ }
+
+ public void setVspId(String vspId) {
+ this.vspId = vspId;
+ }
+
+ public Version getVersion() {
+ return version;
+ }
+
+ public void setVersion(Version version) {
+ this.version = version;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Gets content.
+ *
+ * @return the content
+ */
+ public InputStream getContent() {
+ if (this.contentData == null) {
+ return null;
+ }
+ return new ByteArrayInputStream(contentData);
+ }
+
+ public void setContentData(byte[] contentData) {
+ this.contentData = contentData;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceElementEntity.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceElementEntity.java
new file mode 100644
index 0000000000..02249039f8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceElementEntity.java
@@ -0,0 +1,31 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.model.types;
+
+import org.openecomp.sdc.versioning.dao.types.VersionableEntity;
+
+import java.nio.ByteBuffer;
+
+public interface ServiceElementEntity extends VersionableEntity {
+ String getName();
+
+ ByteBuffer getContentData();
+}
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceTemplate.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceTemplate.java
new file mode 100644
index 0000000000..aa0285d6a9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceTemplate.java
@@ -0,0 +1,38 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.model.types;
+
+public class ServiceTemplate extends ServiceElement {
+ private String baseName;
+
+ public ServiceTemplate() {
+ }
+
+
+ public String getBaseName() {
+ return baseName;
+ }
+
+
+ public void setBaseName(String baseName) {
+ this.baseName = baseName;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceTemplateEntity.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceTemplateEntity.java
new file mode 100644
index 0000000000..f29334678f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceTemplateEntity.java
@@ -0,0 +1,154 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.model.types;
+
+import com.google.common.io.ByteStreams;
+
+import com.datastax.driver.mapping.annotations.ClusteringColumn;
+import com.datastax.driver.mapping.annotations.Column;
+import com.datastax.driver.mapping.annotations.Frozen;
+import com.datastax.driver.mapping.annotations.PartitionKey;
+import com.datastax.driver.mapping.annotations.Table;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+
+@Table(keyspace = "dox", name = "vsp_service_template")
+public class ServiceTemplateEntity implements ServiceElementEntity {
+
+ private static final String ENTITY_TYPE;
+
+ static {
+ ENTITY_TYPE = "Vendor Software Product Service model";
+ }
+
+ @PartitionKey
+ @Column(name = "vsp_id")
+ public String id;
+
+ @PartitionKey(value = 1)
+ @Frozen
+ public Version version;
+
+ @ClusteringColumn
+ @Column(name = "name")
+ public String name;
+
+ @Column(name = "content_data")
+ public ByteBuffer contentData;
+
+
+ @Column(name = "base_name")
+ private String baseName;
+
+ public ServiceTemplateEntity() {
+ }
+
+ /**
+ * Instantiates a new Service template entity.
+ *
+ * @param entity the entity
+ */
+ public ServiceTemplateEntity(ServiceTemplate entity) {
+ this.id = entity.getVspId();
+ this.version = entity.getVersion();
+ this.name = entity.getName();
+ this.setBaseName(entity.getBaseName());
+ try {
+ this.contentData = ByteBuffer.wrap(ByteStreams.toByteArray(entity.getContent()));
+ } catch (IOException ioException) {
+ throw new RuntimeException(ioException);
+ }
+
+ }
+
+
+ public String getBaseName() {
+ return baseName;
+ }
+
+ public void setBaseName(String baseName) {
+ this.baseName = baseName;
+ }
+
+
+ @Override
+ public String getEntityType() {
+ return ENTITY_TYPE;
+ }
+
+ @Override
+ public String getFirstClassCitizenId() {
+ return getId();
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ @Override
+ public Version getVersion() {
+ return version;
+ }
+
+ @Override
+ public void setVersion(Version version) {
+ this.version = version;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public ByteBuffer getContentData() {
+ return contentData;
+ }
+
+ public void setContentData(ByteBuffer contentData) {
+ this.contentData = contentData;
+ }
+
+
+ /**
+ * Gets service template.
+ *
+ * @return the service template
+ */
+ public ServiceTemplate getServiceTemplate() {
+ ServiceTemplate serviceTemplate = new ServiceTemplate();
+ serviceTemplate.setName(this.getName());
+ serviceTemplate.setVersion(this.getVersion());
+ serviceTemplate.setContentData(this.getContentData().array());
+ serviceTemplate.setVspId(this.getId());
+ serviceTemplate.setBaseName(this.getBaseName());
+ return serviceTemplate;
+
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/resources/factoryConfiguration.json b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/resources/factoryConfiguration.json
new file mode 100644
index 0000000000..c228b29c57
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/resources/factoryConfiguration.json
@@ -0,0 +1,8 @@
+{
+ "org.openecomp.core.model.dao.ServiceModelDaoFactory":"org.openecomp.sdc.model.impl.ServiceModelDaoFactoryImpl",
+ "org.openecomp.core.model.dao.ServiceTemplateDaoFactory":"org.openecomp.sdc.model.impl.ServiceTemplateDaoCassandraFactoryImpl",
+ "org.openecomp.core.model.dao.ServiceArtifactDaoFactory":"org.openecomp.sdc.model.impl.ServiceArtifactDaoCassandraFactoryImpl",
+ "org.openecomp.core.model.dao.EnrichedServiceModelDaoFactory":"org.openecomp.sdc.model.impl.EnrichedServiceModelDaoFactoryImpl",
+ "org.openecomp.core.model.dao.EnrichedServiceTemplateDaoFactory":"org.openecomp.sdc.model.impl.EnrichedServiceTemplateDaoCassandraFactoryImpl",
+ "org.openecomp.core.model.dao.EnrichedServiceArtifactDaoFactory":"org.openecomp.sdc.model.impl.EnrichedServiceArtifactDaoCassandraFactoryImpl"
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-core/pom.xml b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-core/pom.xml
new file mode 100644
index 0000000000..ba4d404ae7
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-core/pom.xml
@@ -0,0 +1,65 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-lib</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../..</relativePath>
+ </parent>
+
+ <name>openecomp-sdc-model-core</name>
+ <artifactId>openecomp-sdc-model-core</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.7.10</version>
+
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <version>1.1.2</version>
+
+ </dependency>
+
+
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-utilities-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-model-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-versioning-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-datatypes-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <scope>test</scope>
+ <version>1.10.19</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <version>19.0</version>
+ </dependency>
+
+
+ </dependencies>
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-core/src/main/java/org/openecomp/sdc/model/impl/AbstractServiceModelDao.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-core/src/main/java/org/openecomp/sdc/model/impl/AbstractServiceModelDao.java
new file mode 100644
index 0000000000..eb993f6fb1
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-core/src/main/java/org/openecomp/sdc/model/impl/AbstractServiceModelDao.java
@@ -0,0 +1,191 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.model.impl;
+
+import org.openecomp.core.model.dao.ServiceArtifactDaoInter;
+import org.openecomp.core.model.dao.ServiceTemplateDaoInter;
+import org.openecomp.core.model.types.ServiceArtifact;
+import org.openecomp.core.model.types.ServiceElement;
+import org.openecomp.core.model.types.ServiceTemplate;
+import org.openecomp.core.utilities.file.FileContentHandler;
+import org.openecomp.core.utilities.file.FileUtils;
+import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
+import org.openecomp.sdc.tosca.services.yamlutil.ToscaExtensionYamlUtil;
+import org.openecomp.sdc.versioning.dao.VersionableDao;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.io.InputStream;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+public class AbstractServiceModelDao implements VersionableDao {
+
+ protected ServiceTemplateDaoInter templateDao;
+ protected ServiceArtifactDaoInter artifactDao;
+
+ @Override
+ public void registerVersioning(String versionableEntityType) {
+ templateDao.registerVersioning(versionableEntityType);
+ artifactDao.registerVersioning(versionableEntityType);
+ }
+
+
+ /**
+ * Gets service model.
+ *
+ * @param vspId the vsp id
+ * @param version the version
+ * @return the service model
+ */
+ public ToscaServiceModel getServiceModel(String vspId, Version version) {
+ if (vspId == null || version == null) {
+ //throw new CoreException()
+ throw new RuntimeException("missing service model key");
+ }
+
+
+ FileContentHandler artifactFiles = getArtifacts(vspId, version);
+ Map<String, org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate> serviceTemplates =
+ getTemplates(vspId, version);
+ String entryDefinitionServiceTemplate = getServiceBase(vspId, version);
+ return new ToscaServiceModel(artifactFiles, serviceTemplates, entryDefinitionServiceTemplate);
+ }
+
+
+ public void storeExternalArtifact(ServiceArtifact serviceArtifact) {
+ artifactDao.create(serviceArtifact);
+ //TODO: update last modification time
+ }
+
+
+ /**
+ * Store service model.
+ *
+ * @param vspId the vsp id
+ * @param version the version
+ * @param toscaServiceModel the tosca service model
+ */
+ public void storeServiceModel(String vspId, Version version,
+ ToscaServiceModel toscaServiceModel) {
+ ServiceArtifact entityArt;
+
+ for (String fileName : toscaServiceModel.getArtifactFiles().getFileList()) {
+ entityArt = new ServiceArtifact();
+ entityArt.setContentData(
+ FileUtils.toByteArray(toscaServiceModel.getArtifactFiles().getFileContent(fileName)));
+ entityArt.setVspId(vspId);
+ entityArt.setVersion(version);
+ entityArt.setName(fileName);
+
+ artifactDao.create(entityArt);
+ }
+
+ ServiceTemplate entityTmp;
+ String yaml;
+ for (Map.Entry<String, org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate>
+ entryTemplate : toscaServiceModel
+ .getServiceTemplates().entrySet()) {
+ entityTmp = new ServiceTemplate();
+
+ yaml = new ToscaExtensionYamlUtil().objectToYaml(entryTemplate.getValue());
+ entityTmp.setContentData(yaml.getBytes());
+ entityTmp.setVspId(vspId);
+ entityTmp.setVersion(version);
+ entityTmp.setName(entryTemplate.getKey());
+ entityTmp.setBaseName(toscaServiceModel.getEntryDefinitionServiceTemplate());
+
+ templateDao.create(entityTmp);
+ }
+
+ //TODO: update last modification time
+ }
+
+
+ /**
+ * Gets service model info.
+ *
+ * @param vspId the vsp id
+ * @param version the version
+ * @param name the name
+ * @return the service model info
+ */
+ public ServiceElement getServiceModelInfo(String vspId, Version version, String name) {
+ ServiceElement element = templateDao.getTemplateInfo(vspId, version, name);
+ if (element != null) {
+ return element;
+ }
+
+ element = artifactDao.getArtifactInfo(vspId, version, name);
+ if (element != null) {
+ return element;
+ }
+ return null;
+ }
+
+
+ /**
+ * Gets service model content names.
+ *
+ * @return the service model content names
+ */
+ public List<String> getServiceModelContentNames() {
+
+
+ return null;
+ }
+
+
+ private String getServiceBase(String vspId, Version version) {
+ return templateDao.getBase(vspId, version);
+ }
+
+ private Map<String, org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate> getTemplates(
+ String vspId, Version version) {
+
+ Collection<ServiceTemplate> templates = templateDao.list(vspId, version);
+ if (templates == null) {
+ return null;
+ }
+ return templates.stream().collect(Collectors.toMap(template -> template.getName(),
+ template -> getServiceTemplate(template.getContent())));
+ }
+
+ private org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate getServiceTemplate(
+ InputStream content) {
+ return new ToscaExtensionYamlUtil()
+ .yamlToObject(content, org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate.class);
+ }
+
+ private FileContentHandler getArtifacts(String vspId, Version version) {
+ Collection<ServiceArtifact> templates = artifactDao.list(vspId, version);
+ if (templates == null) {
+ return null;
+ }
+
+ FileContentHandler fileContentHandler = new FileContentHandler();
+ templates.stream().forEach(serviceArtifact -> fileContentHandler
+ .addFile(serviceArtifact.getName(), serviceArtifact.getContent()));
+
+ return fileContentHandler;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/pom.xml b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/pom.xml
new file mode 100644
index 0000000000..ff376f1e7d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/pom.xml
@@ -0,0 +1,61 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-lib</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../..</relativePath>
+ </parent>
+
+ <name>openecomp-sdc-model-impl</name>
+ <artifactId>openecomp-sdc-model-impl</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.7.10</version>
+
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <version>1.1.2</version>
+
+ </dependency>
+
+
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-utilities-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-model-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-datatypes-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <scope>test</scope>
+ <version>1.10.19</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <version>19.0</version>
+ </dependency>
+
+
+ </dependencies>
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceArtifactDaoCassandraFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceArtifactDaoCassandraFactoryImpl.java
new file mode 100644
index 0000000000..13e351c257
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceArtifactDaoCassandraFactoryImpl.java
@@ -0,0 +1,36 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.model.impl;
+
+
+import org.openecomp.core.model.dao.EnrichedServiceArtifactDao;
+import org.openecomp.core.model.dao.EnrichedServiceArtifactDaoFactory;
+
+public class EnrichedServiceArtifactDaoCassandraFactoryImpl
+ extends EnrichedServiceArtifactDaoFactory {
+ private static final EnrichedServiceArtifactDao INSTANCE =
+ new EnrichedServiceArtifactDaoCassandraImpl();
+
+ @Override
+ public EnrichedServiceArtifactDao createInterface() {
+ return INSTANCE;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceArtifactDaoCassandraImpl.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceArtifactDaoCassandraImpl.java
new file mode 100644
index 0000000000..d9ebe849e3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceArtifactDaoCassandraImpl.java
@@ -0,0 +1,137 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.model.impl;
+
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.UDTValue;
+import com.datastax.driver.mapping.Mapper;
+import com.datastax.driver.mapping.Result;
+import com.datastax.driver.mapping.UDTMapper;
+import com.datastax.driver.mapping.annotations.Accessor;
+import com.datastax.driver.mapping.annotations.Query;
+import org.openecomp.core.model.dao.EnrichedServiceArtifactDao;
+import org.openecomp.core.model.types.EnrichedServiceArtifactEntity;
+import org.openecomp.core.model.types.ServiceArtifact;
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
+import org.openecomp.sdc.versioning.VersioningManagerFactory;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.types.VersionableEntityMetadata;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class EnrichedServiceArtifactDaoCassandraImpl implements EnrichedServiceArtifactDao {
+
+ private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
+ private static final Mapper<EnrichedServiceArtifactEntity> mapper =
+ noSqlDb.getMappingManager().mapper(EnrichedServiceArtifactEntity.class);
+ private static final VspServiceArtifactAccessor accessor =
+ noSqlDb.getMappingManager().createAccessor(VspServiceArtifactAccessor.class);
+ private static final UDTMapper<Version> versionMapper =
+ noSqlDb.getMappingManager().udtMapper(Version.class);
+
+ @Override
+ public void registerVersioning(String versionableEntityType) {
+ VersioningManagerFactory.getInstance().createInterface()
+ .register(versionableEntityType, new VersionableEntityMetadata(
+ mapper.getTableMetadata().getName(),
+ mapper.getTableMetadata().getPartitionKey().get(0).getName(),
+ mapper.getTableMetadata().getPartitionKey().get(1).getName()));
+ }
+
+ @Override
+ public Collection<ServiceArtifact> list(String vspId, Version version) {
+ List<EnrichedServiceArtifactEntity> entityList;
+ if (vspId != null && version != null) {
+ entityList = accessor.list(vspId, versionMapper.toUDT(version)).all();
+ } else {
+ entityList = accessor.listAll().all();
+ }
+
+ return entityList.stream().map(entity -> entity.getServiceArtifact())
+ .collect(Collectors.toList());
+ }
+
+ @Override
+ public void create(ServiceArtifact entity) {
+ EnrichedServiceArtifactEntity vspEnrichedServiceArtifactEntity =
+ new EnrichedServiceArtifactEntity(entity);
+ mapper.save(vspEnrichedServiceArtifactEntity);
+ }
+
+ @Override
+ public void update(ServiceArtifact entity) {
+ EnrichedServiceArtifactEntity vspEnrichedServiceArtifactEntity =
+ new EnrichedServiceArtifactEntity(entity);
+ mapper.save(vspEnrichedServiceArtifactEntity);
+ }
+
+ @Override
+ public ServiceArtifact get(String vspId, Version version) {
+ return mapper.get(getKeys(vspId, version)).getServiceArtifact();
+ }
+
+ @Override
+ public void delete(String vspId, Version version) {
+ accessor.delete(vspId, versionMapper.toUDT(version));
+ }
+
+ @Override
+ public Object[] getKeys(String vspId, Version version) {
+ return new Object[]{vspId, versionMapper.toUDT(version)};
+ }
+
+ @Override
+ public ServiceArtifact getArtifactInfo(String vspId, Version version, String name) {
+ EnrichedServiceArtifactEntity enrichedServiceArtifactEntity =
+ accessor.getArtifactInfo(vspId, versionMapper.toUDT(version), name).one();
+ if (enrichedServiceArtifactEntity == null) {
+ return null;
+ }
+
+ return enrichedServiceArtifactEntity.getServiceArtifact();
+ }
+
+
+ @Accessor
+ interface VspServiceArtifactAccessor {
+
+ @Query("SELECT vsp_id, version, name ,content_data FROM vsp_enriched_service_artifact")
+ Result<EnrichedServiceArtifactEntity> listAll();
+
+ @Query(
+ "SELECT vsp_id, version, name ,content_data FROM vsp_enriched_service_artifact "
+ + "where vsp_id=? and version=? ")
+ Result<EnrichedServiceArtifactEntity> list(String vspId, UDTValue version);
+
+
+ @Query(
+ "SELECT vsp_id,version,name,content_data FROM vsp_enriched_service_artifact "
+ + "where vsp_id=? and version=? and name=?")
+ Result<EnrichedServiceArtifactEntity> getArtifactInfo(String vspId, UDTValue version,
+ String name);
+
+ @Query("DELETE from vsp_enriched_service_artifact where vsp_id=? and version=?")
+ ResultSet delete(String vspId, UDTValue version);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceModelDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceModelDaoFactoryImpl.java
new file mode 100644
index 0000000000..326e5e78fc
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceModelDaoFactoryImpl.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.model.impl;
+
+
+import org.openecomp.core.model.dao.EnrichedServiceModelDao;
+import org.openecomp.core.model.dao.EnrichedServiceModelDaoFactory;
+
+public class EnrichedServiceModelDaoFactoryImpl extends EnrichedServiceModelDaoFactory {
+ private static final EnrichedServiceModelDao INSTANCE = new EnrichedServiceModelDaoImpl();
+
+ @Override
+ public EnrichedServiceModelDao createInterface() {
+ return INSTANCE;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceModelDaoImpl.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceModelDaoImpl.java
new file mode 100644
index 0000000000..9e784c7fef
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceModelDaoImpl.java
@@ -0,0 +1,44 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.model.impl;
+
+import org.openecomp.core.model.dao.EnrichedServiceArtifactDaoFactory;
+import org.openecomp.core.model.dao.EnrichedServiceModelDao;
+import org.openecomp.core.model.dao.EnrichedServiceTemplateDaoFactory;
+import org.openecomp.core.model.types.ServiceArtifact;
+import org.openecomp.core.model.types.ServiceElement;
+import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.util.List;
+
+public class EnrichedServiceModelDaoImpl extends AbstractServiceModelDao
+ implements EnrichedServiceModelDao<ToscaServiceModel, ServiceElement> {
+ public EnrichedServiceModelDaoImpl() {
+ templateDao = EnrichedServiceTemplateDaoFactory.getInstance().createInterface();
+ artifactDao = EnrichedServiceArtifactDaoFactory.getInstance().createInterface();
+ }
+
+ @Override
+ public List<ServiceArtifact> getExternalArtifacts(String vspId, Version version) {
+ return (List<ServiceArtifact>) artifactDao.list(vspId, version);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceTemplateDaoCassandraFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceTemplateDaoCassandraFactoryImpl.java
new file mode 100644
index 0000000000..8103b2cea6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceTemplateDaoCassandraFactoryImpl.java
@@ -0,0 +1,36 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.model.impl;
+
+
+import org.openecomp.core.model.dao.EnrichedServiceTemplateDao;
+import org.openecomp.core.model.dao.EnrichedServiceTemplateDaoFactory;
+
+public class EnrichedServiceTemplateDaoCassandraFactoryImpl
+ extends EnrichedServiceTemplateDaoFactory {
+ private static final EnrichedServiceTemplateDao INSTANCE =
+ new EnrichedServiceTemplateDaoCassandraImpl();
+
+ @Override
+ public EnrichedServiceTemplateDao createInterface() {
+ return INSTANCE;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceTemplateDaoCassandraImpl.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceTemplateDaoCassandraImpl.java
new file mode 100644
index 0000000000..f0d4b56204
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceTemplateDaoCassandraImpl.java
@@ -0,0 +1,147 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.model.impl;
+
+import com.datastax.driver.core.UDTValue;
+import com.datastax.driver.mapping.Mapper;
+import com.datastax.driver.mapping.Result;
+import com.datastax.driver.mapping.UDTMapper;
+import com.datastax.driver.mapping.annotations.Accessor;
+import com.datastax.driver.mapping.annotations.Query;
+import org.openecomp.core.model.dao.EnrichedServiceTemplateDao;
+import org.openecomp.core.model.types.EnrichedServiceTemplateEntity;
+import org.openecomp.core.model.types.ServiceTemplate;
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
+import org.openecomp.sdc.versioning.VersioningManagerFactory;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.types.VersionableEntityMetadata;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class EnrichedServiceTemplateDaoCassandraImpl implements EnrichedServiceTemplateDao {
+
+ private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
+ private static final Mapper<EnrichedServiceTemplateEntity> mapper =
+ noSqlDb.getMappingManager().mapper(EnrichedServiceTemplateEntity.class);
+ private static final VspServiceTemplateAccessor accessor =
+ noSqlDb.getMappingManager().createAccessor(VspServiceTemplateAccessor.class);
+ private static final UDTMapper<Version> versionMapper =
+ noSqlDb.getMappingManager().udtMapper(Version.class);
+
+ @Override
+ public void registerVersioning(String versionableEntityType) {
+ VersioningManagerFactory.getInstance().createInterface()
+ .register(versionableEntityType, new VersionableEntityMetadata(
+ mapper.getTableMetadata().getName(),
+ mapper.getTableMetadata().getPartitionKey().get(0).getName(),
+ mapper.getTableMetadata().getPartitionKey().get(1).getName()));
+ }
+
+ @Override
+ public Collection<ServiceTemplate> list(String vspId, Version version) {
+
+ List<EnrichedServiceTemplateEntity> entityList = accessor.list(vspId, version).all();
+ return entityList.stream().map(entity -> entity.getServiceTemplate())
+ .collect(Collectors.toList());
+ }
+
+ @Override
+ public void create(ServiceTemplate entity) {
+ EnrichedServiceTemplateEntity vspEnrichedServiceTemplateEntity =
+ new EnrichedServiceTemplateEntity(entity);
+ mapper.save(vspEnrichedServiceTemplateEntity);
+ }
+
+ @Override
+ public void update(ServiceTemplate entity) {
+ EnrichedServiceTemplateEntity vspEnrichedServiceTemplateEntity =
+ new EnrichedServiceTemplateEntity(entity);
+ mapper.save(vspEnrichedServiceTemplateEntity);
+ }
+
+ @Override
+ public ServiceTemplate get(String vspId, Version version) {
+ return (mapper.get(getKeys(vspId, version))).getServiceTemplate();
+ }
+
+ @Override
+ public void delete(String vspId, Version version) {
+ mapper.delete(vspId, version);
+ }
+
+
+ @Override
+ public Object[] getKeys(String vspId, Version version) {
+ return new Object[]{vspId, versionMapper.toUDT(version)};
+ }
+
+ @Override
+ public ServiceTemplate getTemplateInfo(String vspId, Version version, String name) {
+ EnrichedServiceTemplateEntity enrichedServiceTemplateEntity =
+ accessor.getTemplateInfo(vspId, versionMapper.toUDT(version), name).one();
+ if (enrichedServiceTemplateEntity == null) {
+ return null;
+ }
+ return enrichedServiceTemplateEntity.getServiceTemplate();
+ }
+
+ @Override
+ public String getBase(String vspId, Version version) {
+ Result<EnrichedServiceTemplateEntity> element =
+ accessor.getBase(vspId, versionMapper.toUDT(version));
+ if (element != null) {
+ EnrichedServiceTemplateEntity vspEnrichedServiceTemplateEntity = element.one();
+ if (vspEnrichedServiceTemplateEntity != null) {
+ return element.one().getBaseName();
+ }
+ }
+ return null;
+ }
+
+
+ @Accessor
+ interface VspServiceTemplateAccessor {
+
+ @Query(
+ "SELECT vsp_id, version, name, base_name ,content_data FROM vsp_enriched_service_template")
+ Result<EnrichedServiceTemplateEntity> listAll();
+
+ @Query(
+ "SELECT vsp_id, version, name, base_name ,content_data FROM vsp_enriched_service_template "
+ + "where vsp_id=? and version=?")
+ Result<EnrichedServiceTemplateEntity> list(String vspId, Version version);
+
+
+ @Query(
+ "SELECT vsp_id, version, name, base_name ,content_data FROM vsp_enriched_service_template "
+ + "where vsp_id=? and version=? and name=?")
+ Result<EnrichedServiceTemplateEntity> getTemplateInfo(String vspId, UDTValue version,
+ String name);
+
+ @Query(
+ "SELECT vsp_id, version, name, base_name FROM vsp_enriched_service_template "
+ + "where vsp_id=? and version=?")
+ Result<EnrichedServiceTemplateEntity> getBase(String vspId, UDTValue version);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceArtifactDaoCassandraFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceArtifactDaoCassandraFactoryImpl.java
new file mode 100644
index 0000000000..f24fb1b475
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceArtifactDaoCassandraFactoryImpl.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.model.impl;
+
+
+import org.openecomp.core.model.dao.ServiceArtifactDao;
+import org.openecomp.core.model.dao.ServiceArtifactDaoFactory;
+
+public class ServiceArtifactDaoCassandraFactoryImpl extends ServiceArtifactDaoFactory {
+ private static final ServiceArtifactDao INSTANCE = new ServiceArtifactDaoCassandraImpl();
+
+ @Override
+ public ServiceArtifactDao createInterface() {
+ return INSTANCE;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceArtifactDaoCassandraImpl.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceArtifactDaoCassandraImpl.java
new file mode 100644
index 0000000000..c7851c0fd9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceArtifactDaoCassandraImpl.java
@@ -0,0 +1,139 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.model.impl;
+
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.UDTValue;
+import com.datastax.driver.mapping.Mapper;
+import com.datastax.driver.mapping.Result;
+import com.datastax.driver.mapping.UDTMapper;
+import com.datastax.driver.mapping.annotations.Accessor;
+import com.datastax.driver.mapping.annotations.Query;
+import org.openecomp.core.model.dao.ServiceArtifactDao;
+import org.openecomp.core.model.types.ServiceArtifact;
+import org.openecomp.core.model.types.ServiceArtifactEntity;
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
+import org.openecomp.sdc.versioning.VersioningManagerFactory;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.types.VersionableEntityMetadata;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class ServiceArtifactDaoCassandraImpl implements ServiceArtifactDao {
+
+ private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
+ private static final Mapper<ServiceArtifactEntity> mapper =
+ noSqlDb.getMappingManager().mapper(ServiceArtifactEntity.class);
+ private static final VspServiceArtifactAccessor accessor =
+ noSqlDb.getMappingManager().createAccessor(VspServiceArtifactAccessor.class);
+ private static final UDTMapper<Version> versionMapper =
+ noSqlDb.getMappingManager().udtMapper(Version.class);
+
+ @Override
+ public void registerVersioning(String versionableEntityType) {
+ VersioningManagerFactory.getInstance().createInterface()
+ .register(versionableEntityType, new VersionableEntityMetadata(
+ mapper.getTableMetadata().getName(),
+ mapper.getTableMetadata().getPartitionKey().get(0).getName(),
+ mapper.getTableMetadata().getPartitionKey().get(1).getName()));
+ }
+
+ @Override
+ public Collection<ServiceArtifact> list(String vspId, Version version) {
+ List<ServiceArtifactEntity> entityList;
+ if (vspId != null && version != null) {
+ entityList = accessor.list(vspId, versionMapper.toUDT(version)).all();
+ } else {
+ entityList = accessor.listAll().all();
+ }
+
+ return entityList.stream().map(entity -> entity.getServiceArtifact())
+ .collect(Collectors.toList());
+ }
+
+ @Override
+ public void create(ServiceArtifact entity) {
+ ServiceArtifactEntity vspServiceArtifactEntity = new ServiceArtifactEntity(entity);
+ mapper.save(vspServiceArtifactEntity);
+ }
+
+ @Override
+ public void update(ServiceArtifact entity) {
+ ServiceArtifactEntity vspServiceArtifactEntity = new ServiceArtifactEntity(entity);
+ mapper.save(vspServiceArtifactEntity);
+ }
+
+ @Override
+ public ServiceArtifact get(String vspId, Version version) {
+ return mapper.get(getKeys(vspId, version)).getServiceArtifact();
+ }
+
+ @Override
+ public void delete(String vspId, Version version) {
+ accessor.delete(vspId, versionMapper.toUDT(version));
+ }
+
+ // @Override
+ // public void deleteArtifacts(String vspId, Version version){
+ // accessor.delete(vspId, versionMapper.toUDT(version));
+ // }
+
+ @Override
+ public Object[] getKeys(String vspId, Version version) {
+ return new Object[]{vspId, versionMapper.toUDT(version)};
+ }
+
+ @Override
+ public ServiceArtifact getArtifactInfo(String vspId, Version version, String name) {
+ ServiceArtifactEntity serviceArtifactEntity =
+ accessor.getArtifactInfo(vspId, versionMapper.toUDT(version), name).one();
+ if (serviceArtifactEntity == null) {
+ return null;
+ }
+
+ return serviceArtifactEntity.getServiceArtifact();
+ }
+
+
+ @Accessor
+ interface VspServiceArtifactAccessor {
+
+ @Query("SELECT vsp_id, version, name ,content_data FROM vsp_service_artifact")
+ Result<ServiceArtifactEntity> listAll();
+
+ @Query(
+ "SELECT vsp_id, version, name ,content_data "
+ + "FROM vsp_service_artifact where vsp_id=? and version=? ")
+ Result<ServiceArtifactEntity> list(String vspId, UDTValue version);
+
+ @Query(
+ "SELECT vsp_id,version,name,content_data FROM "
+ + "vsp_service_artifact where vsp_id=? and version=? and name=?")
+ Result<ServiceArtifactEntity> getArtifactInfo(String vspId, UDTValue version, String name);
+
+ @Query("DELETE from vsp_service_artifact where vsp_id=? and version=?")
+ ResultSet delete(String vspId, UDTValue version);
+ }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceModelDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceModelDaoFactoryImpl.java
new file mode 100644
index 0000000000..1347636bf1
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceModelDaoFactoryImpl.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.model.impl;
+
+
+import org.openecomp.core.model.dao.ServiceModelDao;
+import org.openecomp.core.model.dao.ServiceModelDaoFactory;
+
+public class ServiceModelDaoFactoryImpl extends ServiceModelDaoFactory {
+ private static final ServiceModelDao INSTANCE = new ServiceModelDaoImpl();
+
+ @Override
+ public ServiceModelDao createInterface() {
+ return INSTANCE;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceModelDaoImpl.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceModelDaoImpl.java
new file mode 100644
index 0000000000..c397aec61d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceModelDaoImpl.java
@@ -0,0 +1,38 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.model.impl;
+
+import org.openecomp.core.model.dao.ServiceArtifactDaoFactory;
+import org.openecomp.core.model.dao.ServiceModelDao;
+import org.openecomp.core.model.dao.ServiceTemplateDaoFactory;
+import org.openecomp.core.model.types.ServiceElement;
+import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
+
+public class ServiceModelDaoImpl extends AbstractServiceModelDao
+ implements ServiceModelDao<ToscaServiceModel, ServiceElement> {
+
+
+ public ServiceModelDaoImpl() {
+ templateDao = ServiceTemplateDaoFactory.getInstance().createInterface();
+ artifactDao = ServiceArtifactDaoFactory.getInstance().createInterface();
+ }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceTemplateDaoCassandraFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceTemplateDaoCassandraFactoryImpl.java
new file mode 100644
index 0000000000..23c43b76d3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceTemplateDaoCassandraFactoryImpl.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.model.impl;
+
+
+import org.openecomp.core.model.dao.ServiceTemplateDao;
+import org.openecomp.core.model.dao.ServiceTemplateDaoFactory;
+
+public class ServiceTemplateDaoCassandraFactoryImpl extends ServiceTemplateDaoFactory {
+ private static final ServiceTemplateDao INSTANCE = new ServiceTemplateDaoCassandraImpl();
+
+ @Override
+ public ServiceTemplateDao createInterface() {
+ return INSTANCE;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceTemplateDaoCassandraImpl.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceTemplateDaoCassandraImpl.java
new file mode 100644
index 0000000000..ffc9a24677
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceTemplateDaoCassandraImpl.java
@@ -0,0 +1,145 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.model.impl;
+
+import com.datastax.driver.core.UDTValue;
+import com.datastax.driver.mapping.Mapper;
+import com.datastax.driver.mapping.Result;
+import com.datastax.driver.mapping.UDTMapper;
+import com.datastax.driver.mapping.annotations.Accessor;
+import com.datastax.driver.mapping.annotations.Query;
+import org.openecomp.core.model.dao.ServiceTemplateDao;
+import org.openecomp.core.model.types.ServiceTemplate;
+import org.openecomp.core.model.types.ServiceTemplateEntity;
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
+import org.openecomp.sdc.versioning.VersioningManagerFactory;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.types.VersionableEntityMetadata;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class ServiceTemplateDaoCassandraImpl implements ServiceTemplateDao {
+
+
+ private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
+ private static final Mapper<ServiceTemplateEntity> mapper =
+ noSqlDb.getMappingManager().mapper(ServiceTemplateEntity.class);
+ private static final VspServiceTemplateAccessor accessor =
+ noSqlDb.getMappingManager().createAccessor(VspServiceTemplateAccessor.class);
+ private static final UDTMapper<Version> versionMapper =
+ noSqlDb.getMappingManager().udtMapper(Version.class);
+
+ @Override
+ public void registerVersioning(String versionableEntityType) {
+ VersioningManagerFactory.getInstance().createInterface()
+ .register(versionableEntityType, new VersionableEntityMetadata(
+ mapper.getTableMetadata().getName(),
+ mapper.getTableMetadata().getPartitionKey().get(0).getName(),
+ mapper.getTableMetadata().getPartitionKey().get(1).getName()));
+ }
+
+ @Override
+ public Collection<ServiceTemplate> list(String vspId, Version version) {
+
+ List<ServiceTemplateEntity> entityList = accessor.list(vspId, version).all();
+ return entityList.stream().map(entity -> entity.getServiceTemplate())
+ .collect(Collectors.toList());
+ }
+
+ @Override
+ public void create(ServiceTemplate entity) {
+ ServiceTemplateEntity vspServiceTemplateEntity = new ServiceTemplateEntity(entity);
+ mapper.save(vspServiceTemplateEntity);
+ }
+
+ @Override
+ public void update(ServiceTemplate entity) {
+ ServiceTemplateEntity vspServiceTemplateEntity = new ServiceTemplateEntity(entity);
+ mapper.save(vspServiceTemplateEntity);
+ }
+
+ @Override
+ public ServiceTemplate get(String vspId, Version version) {
+ return (mapper.get(getKeys(vspId, version))).getServiceTemplate();
+ }
+
+ @Override
+ public void delete(String vspId, Version version) {
+ mapper.delete(vspId, version);
+ }
+
+
+ @Override
+ public Object[] getKeys(String vspId, Version version) {
+ return new Object[]{vspId, versionMapper.toUDT(version)};
+ }
+
+ @Override
+ public ServiceTemplate getTemplateInfo(String vspId, Version version, String name) {
+ ServiceTemplateEntity serviceTemplateEntity =
+ accessor.getTemplateInfo(vspId, versionMapper.toUDT(version), name).one();
+ if (serviceTemplateEntity == null) {
+ return null;
+ }
+ return serviceTemplateEntity.getServiceTemplate();
+ }
+
+ @Override
+ public String getBase(String vspId, Version version) {
+ Result<ServiceTemplateEntity> element = accessor.getBase(vspId, versionMapper.toUDT(version));
+ if (element != null) {
+ ServiceTemplateEntity vspServiceTemplateEntity = element.one();
+ if (vspServiceTemplateEntity != null) {
+ return element.one().getBaseName();
+ }
+ }
+ return null;
+ }
+
+
+ @Accessor
+ interface VspServiceTemplateAccessor {
+
+ @Query("SELECT vsp_id, version, name, base_name ,content_data FROM vsp_service_template")
+ Result<ServiceTemplateEntity> listAll();
+
+ @Query(
+ "SELECT vsp_id, version, name, base_name ,content_data"
+ + " FROM vsp_service_template where vsp_id=? and version=?")
+ Result<ServiceTemplateEntity> list(String vspId, Version version);
+
+
+ @Query(
+ "SELECT vsp_id, version, name, base_name ,content_data "
+ + "FROM vsp_service_template where vsp_id=? and version=? and name=?")
+ Result<ServiceTemplateEntity> getTemplateInfo(String vspId, UDTValue version, String name);
+
+ @Query(
+ "SELECT vsp_id, version, name, base_name "
+ + "FROM vsp_service_template where vsp_id=? and version=?")
+ Result<ServiceTemplateEntity> getBase(String vspId, UDTValue version);
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/pom.xml b/openecomp-be/lib/openecomp-sdc-model-lib/pom.xml
new file mode 100644
index 0000000000..e8b51d8a49
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/pom.xml
@@ -0,0 +1,43 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <packaging>pom</packaging>
+ <parent>
+ <artifactId>openecomp-sdc-lib</artifactId>
+ <groupId>org.openecomp.sdc</groupId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <name>openecomp-sdc-model-lib</name>
+ <artifactId>openecomp-sdc-model-lib</artifactId>
+
+ <modules>
+ <module>openecomp-sdc-model-api</module>
+ <module>openecomp-sdc-model-core</module>
+ <module>openecomp-sdc-model-impl</module>
+ </modules>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-model-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-model-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-model-impl</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <!--dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-common-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency-->
+ </dependencies>
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/pom.xml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/pom.xml
new file mode 100644
index 0000000000..e6eca41134
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/pom.xml
@@ -0,0 +1,43 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-lib</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../..</relativePath>
+ </parent>
+
+ <name>openecomp-sdc-translator-api</name>
+ <artifactId>openecomp-sdc-translator-api</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-facade-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-validation-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>io.swagger</groupId>
+ <artifactId>swagger-annotations</artifactId>
+ <version>1.5.3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-heat-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-tosca-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/src/main/java/org/openecomp/core/translator/api/HeatToToscaTranslator.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/src/main/java/org/openecomp/core/translator/api/HeatToToscaTranslator.java
new file mode 100644
index 0000000000..62c098d146
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/src/main/java/org/openecomp/core/translator/api/HeatToToscaTranslator.java
@@ -0,0 +1,48 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.translator.api;
+
+import org.openecomp.core.translator.datatypes.TranslatorOutput;
+import org.openecomp.sdc.datatypes.error.ErrorMessage;
+
+import java.io.InputStream;
+import java.util.List;
+import java.util.Map;
+
+public interface HeatToToscaTranslator {
+
+ void addManifest(String name, byte[] content);
+
+ void addFile(String name, byte[] content);
+
+ void addFile(String name, InputStream content);
+
+ // return Map, key - file name which has error
+ // value - the error code
+ Map<String, List<ErrorMessage>> validate();
+
+ TranslatorOutput translate();
+
+ void addExternalArtifacts(String name, byte[] content);
+
+ void addExternalArtifacts(String name, InputStream content);
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/src/main/java/org/openecomp/core/translator/datatypes/TranslatorOutput.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/src/main/java/org/openecomp/core/translator/datatypes/TranslatorOutput.java
new file mode 100644
index 0000000000..ec36625ced
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/src/main/java/org/openecomp/core/translator/datatypes/TranslatorOutput.java
@@ -0,0 +1,48 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.translator.datatypes;
+
+import org.openecomp.sdc.datatypes.error.ErrorMessage;
+import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
+
+import java.util.List;
+import java.util.Map;
+
+public class TranslatorOutput {
+ private Map<String, List<ErrorMessage>> errorMessages;
+ private ToscaServiceModel toscaServiceModel;
+
+ public Map<String, List<ErrorMessage>> getErrorMessages() {
+ return errorMessages;
+ }
+
+ public void setErrorMessages(Map<String, List<ErrorMessage>> errorMessages) {
+ this.errorMessages = errorMessages;
+ }
+
+ public ToscaServiceModel getToscaServiceModel() {
+ return toscaServiceModel;
+ }
+
+ public void setToscaServiceModel(ToscaServiceModel toscaServiceModel) {
+ this.toscaServiceModel = toscaServiceModel;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/src/main/java/org/openecomp/core/translator/factory/HeatToToscaTranslatorFactory.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/src/main/java/org/openecomp/core/translator/factory/HeatToToscaTranslatorFactory.java
new file mode 100644
index 0000000000..b9234cd87a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/src/main/java/org/openecomp/core/translator/factory/HeatToToscaTranslatorFactory.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.translator.factory;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+import org.openecomp.core.translator.api.HeatToToscaTranslator;
+
+public abstract class HeatToToscaTranslatorFactory
+ extends AbstractComponentFactory<HeatToToscaTranslator> {
+
+ public static HeatToToscaTranslatorFactory getInstance() {
+ return AbstractFactory.getInstance(HeatToToscaTranslatorFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/src/main/resources/factoryConfiguration.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/src/main/resources/factoryConfiguration.json
new file mode 100644
index 0000000000..4e4e2c23f9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/src/main/resources/factoryConfiguration.json
@@ -0,0 +1,3 @@
+{
+ "org.openecomp.core.translator.factory.HeatToToscaTranslatorFactory": "org.openecomp.sdc.translator.impl.heattotosca.HeatToToscaTranslatorFactoryImpl"
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/pom.xml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/pom.xml
new file mode 100644
index 0000000000..2bfa7dfd31
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/pom.xml
@@ -0,0 +1,89 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-lib</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../..</relativePath>
+ </parent>
+
+ <name>openecomp-sdc-translator-core</name>
+ <artifactId>openecomp-sdc-translator-core</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <version>2.3.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.yaml</groupId>
+ <artifactId>snakeyaml</artifactId>
+ <version>1.14</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.7.10</version>
+
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <version>1.1.2</version>
+
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>RELEASE</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-utilities-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-translator-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-validation-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-datatypes-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <scope>test</scope>
+ <version>1.10.19</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <version>19.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-validation-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-heat-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/AttachedResourceId.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/AttachedResourceId.java
new file mode 100644
index 0000000000..4286666392
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/AttachedResourceId.java
@@ -0,0 +1,65 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.datatypes.heattotosca;
+
+public class AttachedResourceId {
+ private Object translatedId;
+ private Object entityId;
+ private ResourceReferenceType resourceReferenceType;
+
+ /**
+ * Instantiates a new Attached resource id.
+ *
+ * @param translatedId the translated id
+ * @param entityId the entity id
+ * @param resourceReferenceType the resource reference type
+ */
+ public AttachedResourceId(Object translatedId, Object entityId,
+ ResourceReferenceType resourceReferenceType) {
+ this.translatedId = translatedId;
+ this.resourceReferenceType = resourceReferenceType;
+ this.entityId = entityId;
+ }
+
+ public Object getEntityId() {
+ return entityId;
+ }
+
+ public Object getTranslatedId() {
+ return translatedId;
+ }
+
+ public ResourceReferenceType getResourceReferenceType() {
+ return resourceReferenceType;
+ }
+
+ public boolean isGetResource() {
+ return resourceReferenceType == ResourceReferenceType.GET_RESOURCE;
+ }
+
+ public boolean isGetParam() {
+ return resourceReferenceType == ResourceReferenceType.GET_PARAM;
+ }
+
+ public boolean isGetAttr() {
+ return resourceReferenceType == ResourceReferenceType.GET_ATTR;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/ResourceReferenceType.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/ResourceReferenceType.java
new file mode 100644
index 0000000000..81ccd69a66
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/ResourceReferenceType.java
@@ -0,0 +1,25 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.datatypes.heattotosca;
+
+public enum ResourceReferenceType {
+ GET_RESOURCE, GET_PARAM, GET_ATTR, OTHER
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/to/FileDataCollection.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/to/FileDataCollection.java
new file mode 100644
index 0000000000..a9147b838f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/to/FileDataCollection.java
@@ -0,0 +1,123 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.datatypes.heattotosca.to;
+
+
+import org.openecomp.sdc.heat.datatypes.manifest.FileData;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+public class FileDataCollection {
+
+ Collection<FileData> baseFiles;
+ Collection<FileData> addOnFiles;
+ Collection<FileData> nestedFiles;
+ Collection<FileData> artifactFiles;
+
+ public Collection<FileData> getBaseFile() {
+ return baseFiles;
+ }
+
+ public void setBaseFile(Collection<FileData> baseFiles) {
+ this.baseFiles = baseFiles;
+ }
+
+ public Collection<FileData> getAddOnFiles() {
+ return addOnFiles;
+ }
+
+ public void setAddOnFiles(Collection<FileData> addOnFiles) {
+ this.addOnFiles = addOnFiles;
+ }
+
+ public Collection<FileData> getNestedFiles() {
+ return nestedFiles;
+ }
+
+ public void setNestedFiles(Collection<FileData> nestedFiles) {
+ this.nestedFiles = nestedFiles;
+ }
+
+ public Collection<FileData> getBaseFiles() {
+ return baseFiles;
+ }
+
+ public void setBaseFiles(Collection<FileData> baseFiles) {
+ this.baseFiles = baseFiles;
+ }
+
+ public Collection<FileData> getArtifactFiles() {
+ return artifactFiles;
+ }
+
+ public void setArtifactFiles(Collection<FileData> artifactFiles) {
+ this.artifactFiles = artifactFiles;
+ }
+
+ /**
+ * Add add on files.
+ *
+ * @param addonFile the addon file
+ */
+ public void addAddOnFiles(FileData addonFile) {
+ if (this.addOnFiles == null) {
+ this.addOnFiles = new ArrayList<>();
+ }
+ this.addOnFiles.add(addonFile);
+ }
+
+ /**
+ * Add nested files.
+ *
+ * @param nestedFile the nested file
+ */
+ public void addNestedFiles(FileData nestedFile) {
+ if (this.nestedFiles == null) {
+ this.nestedFiles = new ArrayList<>();
+ }
+ this.nestedFiles.add(nestedFile);
+ }
+
+ /**
+ * Add base files.
+ *
+ * @param baseFile the base file
+ */
+ public void addBaseFiles(FileData baseFile) {
+ if (this.baseFiles == null) {
+ this.baseFiles = new ArrayList<>();
+ }
+ this.baseFiles.add(baseFile);
+ }
+
+ /**
+ * Add artifact files.
+ *
+ * @param artifactFile the artifact file
+ */
+ public void addArtifactFiles(FileData artifactFile) {
+ if (this.artifactFiles == null) {
+ this.artifactFiles = new ArrayList<>();
+ }
+ this.artifactFiles.add(artifactFile);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/to/ResourceFileDataAndIDs.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/to/ResourceFileDataAndIDs.java
new file mode 100644
index 0000000000..b8349444d7
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/to/ResourceFileDataAndIDs.java
@@ -0,0 +1,70 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.datatypes.heattotosca.to;
+
+
+import org.openecomp.sdc.heat.datatypes.manifest.FileData;
+
+public class ResourceFileDataAndIDs {
+ private String resourceId;
+ private String translatedResourceId;
+ private FileData fileData;
+
+ public ResourceFileDataAndIDs() {
+ }
+
+ /**
+ * Instantiates a new Resource file data and i ds.
+ *
+ * @param resourceId the resource id
+ * @param translatedResourceId the translated resource id
+ * @param fileData the file data
+ */
+ public ResourceFileDataAndIDs(String resourceId, String translatedResourceId, FileData fileData) {
+ this.resourceId = resourceId;
+ this.translatedResourceId = translatedResourceId;
+ this.fileData = fileData;
+ }
+
+ public String getResourceId() {
+ return resourceId;
+ }
+
+ public void setResourceId(String resourceId) {
+ this.resourceId = resourceId;
+ }
+
+ public String getTranslatedResourceId() {
+ return translatedResourceId;
+ }
+
+ public void setTranslatedResourceId(String translatedResourceId) {
+ this.translatedResourceId = translatedResourceId;
+ }
+
+ public FileData getFileData() {
+ return fileData;
+ }
+
+ public void setFileData(FileData fileData) {
+ this.fileData = fileData;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/to/TranslateTo.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/to/TranslateTo.java
new file mode 100644
index 0000000000..6c56715f79
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/to/TranslateTo.java
@@ -0,0 +1,132 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.datatypes.heattotosca.to;
+
+
+import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate;
+import org.openecomp.sdc.heat.datatypes.model.Resource;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.translator.services.heattotosca.TranslationContext;
+
+public class TranslateTo {
+ private String heatFileName;
+ private ServiceTemplate serviceTemplate;
+ private HeatOrchestrationTemplate heatOrchestrationTemplate;
+ private Resource resource;
+ private String resourceId;
+ private String translatedId;
+ private TranslationContext context;
+
+ public TranslateTo() {
+ }
+
+ /**
+ * Instantiates a new Translate to.
+ *
+ * @param heatFileName the heat file name
+ * @param serviceTemplate the service template
+ * @param heatOrchestrationTemplate the heat orchestration template
+ * @param resource the resource
+ * @param resourceId the resource id
+ * @param translatedId the translated id
+ * @param context the context
+ */
+ public TranslateTo(String heatFileName, ServiceTemplate serviceTemplate,
+ HeatOrchestrationTemplate heatOrchestrationTemplate, Resource resource,
+ String resourceId, String translatedId, TranslationContext context) {
+ this.heatFileName = heatFileName;
+ this.serviceTemplate = serviceTemplate;
+ this.heatOrchestrationTemplate = heatOrchestrationTemplate;
+ this.resource = resource;
+ this.resourceId = resourceId;
+ this.translatedId = translatedId;
+ this.context = context;
+ }
+
+ public String getHeatFileName() {
+ return heatFileName;
+ }
+
+ public void setHeatFileName(String heatFileName) {
+ this.heatFileName = heatFileName;
+ }
+
+ public ServiceTemplate getServiceTemplate() {
+ return serviceTemplate;
+ }
+
+ public void setServiceTemplate(ServiceTemplate serviceTemplate) {
+ this.serviceTemplate = serviceTemplate;
+ }
+
+ public HeatOrchestrationTemplate getHeatOrchestrationTemplate() {
+ return heatOrchestrationTemplate;
+ }
+
+ public void setHeatOrchestrationTemplate(HeatOrchestrationTemplate heatOrchestrationTemplate) {
+ this.heatOrchestrationTemplate = heatOrchestrationTemplate;
+ }
+
+ public Resource getResource() {
+ return resource;
+ }
+
+ public void setResource(Resource resource) {
+ this.resource = resource;
+ }
+
+ public String getResourceId() {
+ return resourceId;
+ }
+
+ public void setResourceId(String resourceId) {
+ this.resourceId = resourceId;
+ }
+
+ public String getTranslatedId() {
+ return translatedId;
+ }
+
+ public void setTranslatedId(String translatedId) {
+ this.translatedId = translatedId;
+ }
+
+ public TranslationContext getContext() {
+ return context;
+ }
+
+ public void setContext(TranslationContext context) {
+ this.context = context;
+ }
+
+ @Override
+ public String toString() {
+ return "TranslateTo{"
+ + "heatFileName='" + heatFileName + '\''
+ + ", serviceTemplate=" + serviceTemplate
+ + ", heatOrchestrationTemplate=" + heatOrchestrationTemplate
+ + ", resource=" + resource
+ + ", resourceId='" + resourceId + '\''
+ + ", translatedId='" + translatedId + '\''
+ + ", context=" + context
+ + '}';
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/to/TranslatedHeatResource.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/to/TranslatedHeatResource.java
new file mode 100644
index 0000000000..da46e56018
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/to/TranslatedHeatResource.java
@@ -0,0 +1,49 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.datatypes.heattotosca.to;
+
+import org.openecomp.sdc.heat.datatypes.model.Resource;
+
+public class TranslatedHeatResource {
+ private String translatedId;
+ private Resource heatResource;
+
+ public TranslatedHeatResource(String translatedId, Resource heatResource) {
+ this.translatedId = translatedId;
+ this.heatResource = heatResource;
+ }
+
+ public String getTranslatedId() {
+ return translatedId;
+ }
+
+ public void setTranslatedId(String translatedId) {
+ this.translatedId = translatedId;
+ }
+
+ public Resource getHeatResource() {
+ return heatResource;
+ }
+
+ public void setHeatResource(Resource heatResource) {
+ this.heatResource = heatResource;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/impl/heattotosca/HeatToToscaTranslatorFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/impl/heattotosca/HeatToToscaTranslatorFactoryImpl.java
new file mode 100644
index 0000000000..57f753f103
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/impl/heattotosca/HeatToToscaTranslatorFactoryImpl.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.impl.heattotosca;
+
+import org.openecomp.core.translator.api.HeatToToscaTranslator;
+import org.openecomp.core.translator.factory.HeatToToscaTranslatorFactory;
+
+public class HeatToToscaTranslatorFactoryImpl extends HeatToToscaTranslatorFactory {
+
+ private static HeatToToscaTranslator INSTANCE = new HeatToToscaTranslatorImpl();
+
+ @Override
+ public HeatToToscaTranslator createInterface() {
+ return new HeatToToscaTranslatorImpl();
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/impl/heattotosca/HeatToToscaTranslatorImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/impl/heattotosca/HeatToToscaTranslatorImpl.java
new file mode 100644
index 0000000000..0a6986816c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/impl/heattotosca/HeatToToscaTranslatorImpl.java
@@ -0,0 +1,134 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.impl.heattotosca;
+
+import org.apache.commons.collections4.MapUtils;
+import org.openecomp.core.translator.api.HeatToToscaTranslator;
+import org.openecomp.core.translator.datatypes.TranslatorOutput;
+import org.openecomp.core.utilities.file.FileUtils;
+import org.openecomp.core.utilities.json.JsonUtil;
+import org.openecomp.core.validation.api.ValidationManager;
+import org.openecomp.core.validation.errors.Messages;
+import org.openecomp.core.validation.factory.ValidationManagerFactory;
+import org.openecomp.core.validation.types.MessageContainerUtil;
+import org.openecomp.sdc.common.utils.AsdcCommon;
+import org.openecomp.sdc.datatypes.error.ErrorLevel;
+import org.openecomp.sdc.datatypes.error.ErrorMessage;
+import org.openecomp.sdc.heat.datatypes.manifest.FileData;
+import org.openecomp.sdc.heat.datatypes.manifest.ManifestContent;
+import org.openecomp.sdc.heat.datatypes.manifest.ManifestFile;
+import org.openecomp.sdc.translator.services.heattotosca.TranslationContext;
+import org.openecomp.sdc.translator.services.heattotosca.TranslationService;
+
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class HeatToToscaTranslatorImpl implements HeatToToscaTranslator {
+
+ private TranslationContext translationContext = new TranslationContext();
+ private ValidationManager validationManager =
+ ValidationManagerFactory.getInstance().createInterface();
+ private boolean isValid = false;
+
+
+ @Override
+ public void addManifest(String name, byte[] content) {
+ ManifestContent manifestData = JsonUtil.json2Object(new String(content), ManifestContent.class);
+ ManifestFile manifest = new ManifestFile();
+ manifest.setName(name);
+ manifest.setContent(manifestData);
+ translationContext.setManifest(manifest);
+ translationContext.addFile(name, content);
+ validationManager.addFile(AsdcCommon.MANIFEST_NAME, content);
+ addFilesFromManifestToTranslationContextManifestFilesMap(manifestData.getData());
+ isValid = false;
+ }
+
+ @Override
+ public void addFile(String name, byte[] content) {
+ translationContext.addFile(name, content);
+ validationManager.addFile(name, content);
+ isValid = false;
+ }
+
+ @Override
+ public void addFile(String name, InputStream content) {
+ addFile(name, FileUtils.toByteArray(content));
+ }
+
+
+ @Override
+ public Map<String, List<ErrorMessage>> validate() {
+
+ Map<String, List<ErrorMessage>> errors = new HashMap<>();
+ if (translationContext.getManifest() == null) {
+ ErrorMessage.ErrorMessageUtil.addMessage(AsdcCommon.MANIFEST_NAME, errors)
+ .add(new ErrorMessage(ErrorLevel.ERROR, Messages.MANIFEST_NOT_EXIST.getErrorMessage()));
+ return errors;
+ }
+
+ if (MapUtils.isEmpty(errors)) {
+ errors = validationManager.validate();
+ }
+ if (MapUtils.isEmpty(errors)) {
+ isValid = true;
+ }
+ return errors;
+ }
+
+ @Override
+ public TranslatorOutput translate() {
+ TranslationService translationService = new TranslationService();
+ TranslatorOutput translatorOutput = new TranslatorOutput();
+ if (!isValid) {
+ Map<String, List<ErrorMessage>> errors = validate();
+
+ if (MapUtils.isNotEmpty(MessageContainerUtil.getMessageByLevel(ErrorLevel.ERROR, errors))) {
+ translatorOutput.setErrorMessages(errors);
+ return translatorOutput;
+ }
+ }
+
+ translatorOutput = translationService.translateHeatFiles(translationContext);
+ return translatorOutput;
+ }
+
+ @Override
+ public void addExternalArtifacts(String name, byte[] content) {
+ translationContext.addExternalArtifacts(name, content);
+ }
+
+ @Override
+ public void addExternalArtifacts(String name, InputStream content) {
+ addExternalArtifacts(name, FileUtils.toByteArray(content));
+ }
+
+ private void addFilesFromManifestToTranslationContextManifestFilesMap(
+ List<FileData> fileDataListFromManifest) {
+ for (FileData fileFromManfiest : fileDataListFromManifest) {
+ translationContext.addManifestFile(fileFromManfiest.getFile(), fileFromManfiest.getType());
+ }
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/Constants.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/Constants.java
new file mode 100644
index 0000000000..abd6c27a21
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/Constants.java
@@ -0,0 +1,60 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca;
+
+public class Constants {
+ //Service Template - Template Names
+ public static final String COMMON_GLOBAL_TEMPLATE_NAME = "CommonGlobalTypes";
+ public static final String CINDER_VOLUME_TEMPLATE_NAME = "CinderVolumeGlobalTypes";
+ public static final String CONTRAIL_VIRTUAL_NETWORK_TEMPLATE_NAME =
+ "ContrailVirtualNetworkGlobalType";
+ public static final String CONTRAIL_NETWORK_RULE_TEMPLATE_NAME = "ContrailNetworkRuleGlobalType";
+ public static final String CONTRAILV2_VIRTUAL_NETWORK_TEMPLATE_NAME =
+ "ContrailV2VirtualNetworkGlobalType";
+ public static final String CONTRAILV2_NETWORK_RULE_TEMPLATE_NAME =
+ "ContrailV2NetworkRuleGlobalType";
+ public static final String CONTRAILV2_VIRTUAL_MACHINE_INTERFACE_TEMPLATE_NAME =
+ "ContrailV2VirtualMachineInterfaceGlobalType";
+ public static final String NEUTRON_NET_TEMPLATE_NAME = "NeutronNetGlobalTypes";
+ public static final String NEUTRON_PORT_TEMPLATE_NAME = "NeutronPortGlobalTypes";
+ public static final String NEUTRON_SECURITY_RULES_TEMPLATE_NAME =
+ "NeutronSecurityRulesGlobalTypes";
+ public static final String NOVA_SERVER_TEMPLATE_NAME = "NovaServerGlobalTypes";
+ public static final String ABSTRACT_SUBSTITUTE_TEMPLATE_NAME = "AbstractSubstituteGlobalTypes";
+ public static final String GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME = "GlobalSubstitutionTypes";
+ public static final String CONTRAIL_COMPUTE_TEMPLATE_NAME = "ContrailComputeGlobalTypes";
+ public static final String CONTRAIL_PORT_TEMPLATE_NAME = "ContrailPortGlobalTypes";
+ public static final String CONTRAIL_ABSTRACT_SUBSTITUTE_TEMPLATE_NAME =
+ "ContrailAbstractSubstituteGlobalTypes";
+ //properties
+ public static final String MAX_INSTANCES_PROPERTY_NAME = "max_instances";
+ public static final String DESCRIPTION_PROPERTY_NAME = "description";
+ public static final String NAME_PROPERTY_NAME = "name";
+ public static final String RULES_PROPERTY_NAME = "rules";
+ public static final String SECURITY_GROUPS_PROPERTY_NAME = "security_groups";
+ public static final String PORT_PROPERTY_NAME = "port";
+ //General
+ public static final String PROP = "properties";
+ public static final String ATTR = "attributes";
+
+ private Constants() {
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/HeatToToscaUtil.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/HeatToToscaUtil.java
new file mode 100644
index 0000000000..f245a6dee6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/HeatToToscaUtil.java
@@ -0,0 +1,503 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.openecomp.core.utilities.yaml.YamlUtil;
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.heat.datatypes.HeatBoolean;
+import org.openecomp.sdc.heat.datatypes.manifest.FileData;
+import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate;
+import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes;
+import org.openecomp.sdc.heat.datatypes.model.Resource;
+import org.openecomp.sdc.heat.services.HeatConstants;
+import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
+import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.tosca.services.ToscaUtil;
+import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId;
+import org.openecomp.sdc.translator.datatypes.heattotosca.ResourceReferenceType;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.FileDataCollection;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo;
+import org.openecomp.sdc.translator.services.heattotosca.errors.ResourceNotFoundInHeatFileErrorBuilder;
+import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaFunctionConverter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+public class HeatToToscaUtil {
+
+ protected static Logger logger = LoggerFactory.getLogger(HeatToToscaUtil.class);
+
+
+ /**
+ * Build list of files to search optional.
+ *
+ * @param heatFileName the heat file name
+ * @param filesDataList the files data list
+ * @param types the types
+ * @return the optional
+ */
+ public static Optional<List<FileData>> buildListOfFilesToSearch(String heatFileName,
+ List<FileData> filesDataList,
+ FileData.Type... types) {
+ List<FileData> list = new ArrayList<>(filesDataList);
+ Optional<FileData> resourceFileData = HeatToToscaUtil.getFileData(heatFileName, filesDataList);
+ if (resourceFileData.isPresent() && Objects.nonNull(resourceFileData.get().getData())) {
+ list.addAll(resourceFileData.get().getData());
+ }
+ return Optional.ofNullable(HeatToToscaUtil.getFilteredListOfFileDataByTypes(list, types));
+ }
+
+ public static List<FileData> getFilteredListOfFileDataByTypes(List<FileData> filesToSearch,
+ FileData.Type... types) {
+ return filesToSearch.stream().filter(FileData.buildFileDataPredicateByType(types))
+ .collect(Collectors.toList());
+ }
+
+ /**
+ * Gets file data.
+ *
+ * @param heatFileName the heat file name
+ * @param fileDataList the file data list
+ * @return the file data
+ */
+ public static Optional<FileData> getFileData(String heatFileName,
+ Collection<FileData> fileDataList) {
+ for (FileData file : fileDataList) {
+ if (file.getFile().equals(heatFileName)) {
+ return Optional.of(file);
+ }
+ }
+ return Optional.empty();
+ }
+
+ static FileDataCollection getFileCollectionsByFilter(List<FileData> fileDataList,
+ Set<FileData.Type> typeFilter,
+ TranslationContext translationContext) {
+ FileDataCollection fileDataCollection = new FileDataCollection();
+ Map<String, FileData> filteredFiles = filterFileDataListByType(fileDataList, typeFilter);
+ Set<String> referenced = new HashSet<>();
+ List<String> filenames = extractFilenamesFromFileDataList(filteredFiles.values());
+
+ for (FileData fileData : filteredFiles.values()) {
+ String fileName = fileData.getFile();
+
+ if (FileData.isHeatFile(fileData.getType())) {
+ if (fileData.getBase() != null && fileData.getBase().equals(true)) {
+ fileDataCollection.addBaseFiles(fileData);
+ }
+ HeatOrchestrationTemplate heatOrchestrationTemplate = new YamlUtil()
+ .yamlToObject(translationContext.getFileContent(fileName),
+ HeatOrchestrationTemplate.class);
+ for (Resource resource : heatOrchestrationTemplate.getResources().values()) {
+ if (filenames.contains(resource.getType())) {
+ handleNestedFile(translationContext, fileDataCollection, filteredFiles, referenced,
+ resource.getType());
+ } else if (resource.getType()
+ .equals(HeatResourcesTypes.RESOURCE_GROUP_RESOURCE_TYPE.getHeatResource())) {
+ Object resourceDef =
+ resource.getProperties().get(HeatConstants.RESOURCE_DEF_PROPERTY_NAME);
+ Object innerTypeDef = ((Map) resourceDef).get("type");
+ if (innerTypeDef instanceof String) {
+ String internalResourceType = (String) innerTypeDef;
+ if (filenames.contains(internalResourceType)) {
+ handleNestedFile(translationContext, fileDataCollection, filteredFiles, referenced,
+ internalResourceType);
+ }
+ }
+ }
+ }
+
+ } else {
+ fileDataCollection.addArtifactFiles(fileData);
+ filteredFiles.remove(fileData.getFile());
+ }
+ }
+
+ referenced.forEach(filteredFiles::remove);
+ if (!CollectionUtils.isEmpty(fileDataCollection.getBaseFile())) {
+ for (FileData fileData : fileDataCollection.getBaseFile()) {
+ filteredFiles.remove(fileData.getFile());
+ }
+ }
+ fileDataCollection.setAddOnFiles(filteredFiles.values());
+ return fileDataCollection;
+ }
+
+ private static void handleNestedFile(TranslationContext translationContext,
+ FileDataCollection fileDataCollection,
+ Map<String, FileData> filteredFiles, Set<String> referenced,
+ String nestedFileName) {
+ referenced.add(nestedFileName);
+ fileDataCollection.addNestedFiles(filteredFiles.get(nestedFileName));
+ translationContext.getNestedHeatsFiles().add(nestedFileName);
+ }
+
+ private static Map<String, FileData> filterFileDataListByType(List<FileData> fileDataList,
+ Set<FileData.Type> typesToGet) {
+ Map<String, FileData> filtered = new HashMap<>();
+ fileDataList.stream().filter(file -> typesToGet.contains(file.getType()))
+ .forEach(file -> filtered.put(file.getFile(), file));
+ return filtered;
+ }
+
+ private static List<String> extractFilenamesFromFileDataList(Collection<FileData> fileDataList) {
+ return fileDataList.stream().map(FileData::getFile).collect(Collectors.toList());
+ }
+
+ /**
+ * Extract attached resource id optional.
+ *
+ * @param translateTo the translate to
+ * @param propertyName the property name
+ * @return the optional
+ */
+ public static Optional<AttachedResourceId> extractAttachedResourceId(TranslateTo translateTo,
+ String propertyName) {
+ Object propertyValue = translateTo.getResource().getProperties().get(propertyName);
+ if (propertyValue == null) {
+ return Optional.empty();
+ }
+ return extractAttachedResourceId(translateTo.getHeatFileName(),
+ translateTo.getHeatOrchestrationTemplate(), translateTo.getContext(), propertyValue);
+ }
+
+ /**
+ * Extract attached resource id optional.
+ *
+ * @param heatFileName the heat file name
+ * @param heatOrchestrationTemplate the heat orchestration template
+ * @param context the context
+ * @param propertyValue the property value
+ * @return the optional
+ */
+ public static Optional<AttachedResourceId> extractAttachedResourceId(String heatFileName,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ TranslationContext context,
+ Object propertyValue) {
+
+ Object entity;
+ Object translatedId;
+
+ if (Objects.isNull(propertyValue)) {
+ return Optional.empty();
+ }
+
+ ResourceReferenceType referenceType = ResourceReferenceType.OTHER;
+ if (propertyValue instanceof Map && !((Map) propertyValue).isEmpty()) {
+ Map<String, Object> propMap = (Map) propertyValue;
+ Map.Entry<String, Object> entry = propMap.entrySet().iterator().next();
+ entity = entry.getValue();
+ String key = entry.getKey();
+ switch (key) {
+ case "get_resource":
+ referenceType = ResourceReferenceType.GET_RESOURCE;
+ break;
+ case "get_param":
+ referenceType = ResourceReferenceType.GET_PARAM;
+ break;
+ case "get_attr":
+ referenceType = ResourceReferenceType.GET_ATTR;
+ break;
+ default:
+ }
+ translatedId = TranslatorHeatToToscaFunctionConverter
+ .getToscaFunction(entry.getKey(), entry.getValue(), heatFileName,
+ heatOrchestrationTemplate, null, context);
+ if (translatedId instanceof String
+ && !TranslatorHeatToToscaFunctionConverter.isResourceSupported((String) translatedId)) {
+ translatedId = null;
+ }
+
+ } else {
+ translatedId = propertyValue;
+ entity = propertyValue;
+ }
+
+ return Optional.of(new AttachedResourceId(translatedId, entity, referenceType));
+ }
+
+ /**
+ * Gets contrail attached heat resource id.
+ *
+ * @param attachedResource the attached resource
+ * @return the contrail attached heat resource id
+ */
+ public static Optional<String> getContrailAttachedHeatResourceId(
+ AttachedResourceId attachedResource) {
+ if (attachedResource == null) {
+ return Optional.empty();
+ }
+
+ if (attachedResource.isGetResource()) {
+ return Optional.of((String) attachedResource.getEntityId());
+ }
+ if (attachedResource.isGetAttr() && (attachedResource.getEntityId() instanceof List)
+ && ((List) attachedResource.getEntityId()).size() > 1
+ && ((List) attachedResource.getEntityId()).get(1).equals("fq_name")) {
+ return Optional.of((String) ((List) attachedResource.getEntityId()).get(0));
+ }
+
+ return Optional.empty();
+ }
+
+ /**
+ * Extract property optional.
+ *
+ * @param propertyValue the property value
+ * @return the optional
+ */
+ public static Optional<AttachedResourceId> extractProperty(Object propertyValue) {
+
+ Object entity;
+ if (Objects.isNull(propertyValue)) {
+ return Optional.empty();
+ }
+
+ ResourceReferenceType referenceType = ResourceReferenceType.OTHER;
+ if (propertyValue instanceof Map && !((Map) propertyValue).isEmpty()) {
+ Map<String, Object> propMap = (Map) propertyValue;
+ Map.Entry<String, Object> entry = propMap.entrySet().iterator().next();
+ entity = entry.getValue();
+ String key = entry.getKey();
+ switch (key) {
+ case "get_resource":
+ referenceType = ResourceReferenceType.GET_RESOURCE;
+ break;
+ case "get_param":
+ referenceType = ResourceReferenceType.GET_PARAM;
+ break;
+ case "get_attr":
+ referenceType = ResourceReferenceType.GET_ATTR;
+ break;
+ default:
+ }
+
+ } else {
+ entity = propertyValue;
+ }
+
+ return Optional.of(new AttachedResourceId(null, entity, referenceType));
+ }
+
+ /**
+ * Map boolean.
+ *
+ * @param nodeTemplate the node template
+ * @param propertyKey the property key
+ */
+ public static void mapBoolean(NodeTemplate nodeTemplate, String propertyKey) {
+ Object value = nodeTemplate.getProperties().get(propertyKey);
+ if (value != null && !(value instanceof Map)) {
+ nodeTemplate.getProperties().put(propertyKey, HeatBoolean.eval(value));
+ }
+ }
+
+ /**
+ * Map boolean list.
+ *
+ * @param nodeTemplate the node template
+ * @param propertyListKey the property list key
+ */
+ public static void mapBooleanList(NodeTemplate nodeTemplate, String propertyListKey) {
+ Object listValue = nodeTemplate.getProperties().get(propertyListKey);
+ if (listValue instanceof List) {
+ List booleanList = ((List) listValue);
+ for (int i = 0; i < booleanList.size(); i++) {
+ Object value = booleanList.get(i);
+ if (value != null && !(value instanceof Map)) {
+ booleanList.set(i, HeatBoolean.eval(value));
+ }
+ }
+ }
+ }
+
+
+ public static boolean isYmlFileType(String filename) {
+ return (filename.indexOf("yaml") > 0 || filename.indexOf("yml") > 0);
+ }
+
+ /**
+ * Is nested resource boolean.
+ *
+ * @param resource the resource
+ * @return the boolean
+ */
+ public static boolean isNestedResource(Resource resource) {
+ String resourceType = resource.getType();
+
+ if (resourceType.equals(HeatResourcesTypes.RESOURCE_GROUP_RESOURCE_TYPE.getHeatResource())) {
+ Object resourceDef = resource.getProperties().get(HeatConstants.RESOURCE_DEF_PROPERTY_NAME);
+ String internalResourceType = (String) ((Map) resourceDef).get("type");
+ if (isYamlFile(internalResourceType)) {
+ return true;
+ }
+ } else if (isYamlFile(resourceType)) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Gets nested file.
+ *
+ * @param resource the resource
+ * @return the nested file
+ */
+ public static Optional<String> getNestedFile(Resource resource) {
+ if (!isNestedResource(resource)) {
+ return Optional.empty();
+ }
+ String resourceType = resource.getType();
+ if (resourceType.equals(HeatResourcesTypes.RESOURCE_GROUP_RESOURCE_TYPE.getHeatResource())) {
+ Object resourceDef = resource.getProperties().get(HeatConstants.RESOURCE_DEF_PROPERTY_NAME);
+ String internalResourceType = (String) ((Map) resourceDef).get("type");
+ return Optional.of(internalResourceType);
+ } else {
+ return Optional.of(resourceType);
+ }
+ }
+
+ private static boolean isYamlFile(String fileName) {
+ return fileName.endsWith(".yaml") || fileName.endsWith(".yml");
+ }
+
+ /**
+ * Gets resource.
+ *
+ * @param heatOrchestrationTemplate the heat orchestration template
+ * @param resourceId the resource id
+ * @param heatFileName the heat file name
+ * @return the resource
+ */
+ public static Resource getResource(HeatOrchestrationTemplate heatOrchestrationTemplate,
+ String resourceId, String heatFileName) {
+ Resource resource = heatOrchestrationTemplate.getResources().get(resourceId);
+ if (resource == null) {
+ throw new CoreException(
+ new ResourceNotFoundInHeatFileErrorBuilder(resourceId, heatFileName).build());
+ }
+ return resource;
+ }
+
+ public static boolean isHeatFileNested(TranslateTo translateTo, String heatFileName) {
+ return translateTo.getContext().getNestedHeatsFiles().contains(heatFileName);
+ }
+
+ /**
+ * Extract contrail get resource attached heat resource id string.
+ *
+ * @param propertyValue the property value
+ * @return the string
+ */
+ public static String extractContrailGetResourceAttachedHeatResourceId(Object propertyValue) {
+ if (propertyValue == null) {
+ return null;
+ }
+
+ Object value;
+ if (propertyValue instanceof Map) {
+ if (((Map) propertyValue).containsKey("get_attr")) {
+ value = ((Map) propertyValue).get("get_attr");
+ if (value instanceof List) {
+ if (((List) value).size() == 2 && ((List) value).get(1).equals("fq_name")) {
+ if (((List) value).get(0) instanceof String) {
+ return (String) ((List) value).get(0);
+ } else {
+ logger.warn("invalid format of 'get_attr' function - " + propertyValue.toString());
+ }
+ }
+ }
+ } else if (((Map) propertyValue).containsKey("get_resource")) {
+ value = ((Map) propertyValue).get("get_resource");
+ if (value instanceof String) {
+ return (String) value;
+ } else {
+ logger.warn("invalid format of 'get_resource' function - " + propertyValue.toString());
+ }
+ } else {
+ Collection<Object> valCollection = ((Map) propertyValue).values();
+ for (Object entryValue : valCollection) {
+ String ret = extractContrailGetResourceAttachedHeatResourceId(entryValue);
+ if (ret != null) {
+ return ret;
+ }
+
+ }
+ }
+ } else if (propertyValue instanceof List) {
+ for (Object prop : (List) propertyValue) {
+ String ret = extractContrailGetResourceAttachedHeatResourceId(prop);
+ if (ret != null) {
+ return ret;
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Gets tosca service model.
+ *
+ * @param translateTo the translate to
+ * @return the tosca service model
+ */
+ public static ToscaServiceModel getToscaServiceModel(TranslateTo translateTo) {
+ Map<String, ServiceTemplate> serviceTemplates =
+ new HashMap<>(translateTo.getContext().getGlobalServiceTemplates());
+ Collection<ServiceTemplate> tmpServiceTemplates =
+ translateTo.getContext().getTranslatedServiceTemplates().values();
+ for (ServiceTemplate serviceTemplate : tmpServiceTemplates) {
+ ToscaUtil.addServiceTemplateToMapWithKeyFileName(serviceTemplates, serviceTemplate);
+ }
+ return new ToscaServiceModel(null, serviceTemplates,
+ ToscaUtil.getServiceTemplateFileName(translateTo.getResource().getType()));
+ }
+
+ /**
+ * Gets service template from context.
+ *
+ * @param serviceTemplateFileName the service template file name
+ * @param context the context
+ * @return the service template from context
+ */
+ public static Optional<ServiceTemplate> getServiceTemplateFromContext(
+ String serviceTemplateFileName, TranslationContext context) {
+ for (ServiceTemplate serviceTemplate : context.getTranslatedServiceTemplates().values()) {
+ if (ToscaUtil.getServiceTemplateFileName(serviceTemplate).equals(serviceTemplateFileName)) {
+ return Optional.of(serviceTemplate);
+ }
+ }
+
+ return Optional.empty();
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/ResourceTranslation.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/ResourceTranslation.java
new file mode 100644
index 0000000000..231eb42c03
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/ResourceTranslation.java
@@ -0,0 +1,37 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca;
+
+
+import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate;
+import org.openecomp.sdc.heat.datatypes.model.Resource;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+
+import java.util.Optional;
+
+public interface ResourceTranslation {
+
+ //return the Id of translated object (NodeTemplate, RelationshipTemplate and etc)
+ Optional<String> translateResource(String heatFileName, ServiceTemplate serviceTemplate,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ Resource resource, String resourceId,
+ TranslationContext context);
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/ResourceTranslationFactory.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/ResourceTranslationFactory.java
new file mode 100644
index 0000000000..730c2ddd7a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/ResourceTranslationFactory.java
@@ -0,0 +1,107 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca;
+
+
+import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes;
+import org.openecomp.sdc.heat.datatypes.model.Resource;
+
+import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationBase;
+import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationCinderVolumeAttachmentImpl;
+import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationCinderVolumeImpl;
+import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationContrailAttachPolicyImpl;
+import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationContrailNetworkPolicyImpl;
+import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationContrailServiceInstanceImpl;
+import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationContrailServiceTemplateImpl;
+import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationContrailV2NetworkPolicyImpl;
+import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationContrailV2VirtualNetworkImpl;
+import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationContrailV2VmInterfaceImpl;
+import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationContrailVirtualNetworkImpl;
+import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationDefaultImpl;
+import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationNestedImpl;
+import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationNeutronNetImpl;
+import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationNeutronPortImpl;
+import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationNeutronSecurityGroupImpl;
+import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationNeutronSubnetImpl;
+import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationNovaServerGroupsImpl;
+import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationNovaServerImpl;
+import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationResourceGroupImpl;
+
+import java.util.Objects;
+
+public class ResourceTranslationFactory {
+
+ /**
+ * Gets instance.
+ *
+ * @param resource the resource
+ * @return the instance
+ */
+ public static ResourceTranslationBase getInstance(Resource resource) {
+ HeatResourcesTypes heatResource = HeatResourcesTypes.findByHeatResource(resource.getType());
+ if (Objects.isNull(heatResource)) {
+ if (HeatToToscaUtil.isYmlFileType(resource.getType())) {
+ return new ResourceTranslationNestedImpl();
+ }
+ return new ResourceTranslationDefaultImpl();
+ }
+ switch (heatResource) {
+ case NOVA_SERVER_RESOURCE_TYPE:
+ return new ResourceTranslationNovaServerImpl();
+ case NOVA_SERVER_GROUP_RESOURCE_TYPE:
+ return new ResourceTranslationNovaServerGroupsImpl();
+ case NEUTRON_SECURITY_GROUP_RESOURCE_TYPE:
+ return new ResourceTranslationNeutronSecurityGroupImpl();
+ case NEUTRON_PORT_RESOURCE_TYPE:
+ return new ResourceTranslationNeutronPortImpl();
+ case CONTRAIL_VIRTUAL_NETWORK_RESOURCE_TYPE:
+ return new ResourceTranslationContrailVirtualNetworkImpl();
+ case CONTRAIL_V2_VIRTUAL_NETWORK_RESOURCE_TYPE:
+ return new ResourceTranslationContrailV2VirtualNetworkImpl();
+ case CONTRAIL_V2_VIRTUAL_MACHINE_INTERFACE_RESOURCE_TYPE:
+ return new ResourceTranslationContrailV2VmInterfaceImpl();
+ case CINDER_VOLUME_RESOURCE_TYPE:
+ return new ResourceTranslationCinderVolumeImpl();
+ case CINDER_VOLUME_ATTACHMENT_RESOURCE_TYPE:
+ return new ResourceTranslationCinderVolumeAttachmentImpl();
+ case NEUTRON_NET_RESOURCE_TYPE:
+ return new ResourceTranslationNeutronNetImpl();
+ case NEUTRON_SUBNET_RESOURCE_TYPE:
+ return new ResourceTranslationNeutronSubnetImpl();
+ case CONTRAIL_NETWORK_RULE_RESOURCE_TYPE:
+ return new ResourceTranslationContrailNetworkPolicyImpl();
+ case CONTRAIL_V2_NETWORK_RULE_RESOURCE_TYPE:
+ return new ResourceTranslationContrailV2NetworkPolicyImpl();
+ case CONTRAIL_NETWORK_ATTACH_RULE_RESOURCE_TYPE:
+ return new ResourceTranslationContrailAttachPolicyImpl();
+ case RESOURCE_GROUP_RESOURCE_TYPE:
+ return new ResourceTranslationResourceGroupImpl();
+ case CONTRAIL_SERVICE_TEMPLATE:
+ return new ResourceTranslationContrailServiceTemplateImpl();
+ case CONTRAIL_SERVICE_INSTANCE:
+ return new ResourceTranslationContrailServiceInstanceImpl();
+ default:
+ return new ResourceTranslationDefaultImpl();
+ }
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/TranslationContext.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/TranslationContext.java
new file mode 100644
index 0000000000..a242eda3f0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/TranslationContext.java
@@ -0,0 +1,172 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca;
+
+import org.openecomp.core.utilities.file.FileContentHandler;
+import org.openecomp.core.utilities.file.FileUtils;
+import org.openecomp.core.utilities.json.JsonUtil;
+import org.openecomp.sdc.common.utils.AsdcCommon;
+import org.openecomp.sdc.heat.datatypes.manifest.FileData;
+import org.openecomp.sdc.heat.datatypes.manifest.ManifestFile;
+import org.openecomp.sdc.heat.datatypes.model.Resource;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslatedHeatResource;
+import org.openecomp.sdc.translator.services.heattotosca.globaltypes.GlobalTypesGenerator;
+
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+
+public class TranslationContext {
+
+
+ private static Map<String, Map<String, Map<String, String>>> translationMapping;
+ private static Map<String, ServiceTemplate> globalServiceTemplates;
+
+ static {
+
+ String propertyFileName = AsdcCommon.HEAT_TO_TOSCA_MAPPING_CONF;
+ InputStream is = FileUtils.getFileInputStream(propertyFileName);
+ translationMapping = JsonUtil.json2Object(is, Map.class);
+ globalServiceTemplates = GlobalTypesGenerator.getGlobalTypesServiceTemplate();
+ }
+
+ private ManifestFile manifest;
+
+ private FileContentHandler files = new FileContentHandler();
+
+ private Map<String, FileData.Type> manifestFiles = new HashMap<>();
+ //Key - file name, value - file type
+ private Set<String> nestedHeatsFiles = new HashSet<>();
+ private FileContentHandler externalArtifacts = new FileContentHandler();
+
+ private Map<String, Set<String>> translatedResources = new HashMap<>();
+ // Key - heat file name,value - set of heat resource ids which were translated
+ private Map<String, Set<String>> heatStackGroupMembers = new HashMap<>();
+ // Key - heat file name, value - translated Node template id
+ private Map<String, Map<String, String>> translatedIds = new HashMap<>();
+ // Key - heat file name, value - Map with Key - heat resource Id, Value - tosca entity template id
+ private Map<String, ServiceTemplate> translatedServiceTemplates = new HashMap<>();
+ // key - service template type, value - translated service templates
+ private Map<String, TranslatedHeatResource> heatSharedResourcesByParam = new HashMap<>();
+ //key - heat param name, value - shared resource data
+
+ public void addManifestFile(String fileName, FileData.Type fileType) {
+ this.manifestFiles.put(fileName, fileType);
+ }
+
+ public Set<String> getNestedHeatsFiles() {
+ return nestedHeatsFiles;
+ }
+
+ public Map<String, Set<String>> getHeatStackGroupMembers() {
+ return heatStackGroupMembers;
+ }
+
+ public FileContentHandler getFiles() {
+ return files;
+ }
+
+ public void setFiles(Map<String, byte[]> files) {
+ this.files.putAll(files);
+ }
+
+ public InputStream getFileContent(String fileName) {
+ return files.getFileContent(fileName);
+ }
+
+ public void addFile(String name, byte[] content) {
+ files.addFile(name, content);
+ }
+
+ public ManifestFile getManifest() {
+ return manifest;
+ }
+
+ public void setManifest(ManifestFile manifest) {
+ this.manifest = manifest;
+ }
+
+ public Map<String, Set<String>> getTranslatedResources() {
+ return translatedResources;
+ }
+
+ public Map<String, Map<String, String>> getTranslatedIds() {
+ return translatedIds;
+ }
+
+ // get tosca name from mapping configuration file
+ //element type - parameter/attribute
+ // element name - heat parameter/attribute name
+ //return value - tosca parameter/attribute name
+ public String getElementMapping(String resourceType, String elementType, String elementName) {
+ return translationMapping.get(resourceType).get(elementType).get(elementName);
+ }
+
+ public Map<String, String> getElementMapping(String resourceType, String elementType) {
+ return translationMapping.get(resourceType).get(elementType);
+ }
+
+ public Set<String> getElementSet(String resourceType, String elementType) {
+ return translationMapping.get(resourceType).get(elementType).keySet();
+ }
+
+ public Map<String, ServiceTemplate> getTranslatedServiceTemplates() {
+ return translatedServiceTemplates;
+ }
+
+ public ServiceTemplate getGlobalSubstitutionServiceTemplate() {
+ return getTranslatedServiceTemplates().get(Constants.GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME);
+ }
+
+ public FileContentHandler getExternalArtifacts() {
+ return externalArtifacts;
+ }
+
+ public void addExternalArtifacts(String name, byte[] content) {
+ this.externalArtifacts.addFile(name, content);
+ }
+
+
+ public Map<String, TranslatedHeatResource> getHeatSharedResourcesByParam() {
+ return heatSharedResourcesByParam;
+ }
+
+ public void addHeatSharedResourcesByParam(String parameterName, String resourceId,
+ Resource resource) {
+ this.addHeatSharedResourcesByParam(parameterName,
+ new TranslatedHeatResource(resourceId, resource));
+ }
+
+ public void addHeatSharedResourcesByParam(String parameterName,
+ TranslatedHeatResource translatedHeatResource) {
+ this.heatSharedResourcesByParam.put(parameterName, translatedHeatResource);
+ }
+
+ public Map<String, ServiceTemplate> getGlobalServiceTemplates() {
+ return globalServiceTemplates;
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/TranslationService.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/TranslationService.java
new file mode 100644
index 0000000000..1d90d8b2af
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/TranslationService.java
@@ -0,0 +1,344 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca;
+
+import org.openecomp.core.translator.datatypes.TranslatorOutput;
+import org.openecomp.core.utilities.file.FileContentHandler;
+import org.openecomp.core.utilities.file.FileUtils;
+import org.openecomp.core.utilities.yaml.YamlUtil;
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.heat.datatypes.manifest.FileData;
+import org.openecomp.sdc.heat.datatypes.model.Environment;
+import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate;
+import org.openecomp.sdc.heat.datatypes.model.Output;
+import org.openecomp.sdc.heat.datatypes.model.Resource;
+import org.openecomp.sdc.heat.datatypes.structure.ValidationStructureList;
+import org.openecomp.sdc.heat.services.tree.HeatTreeManager;
+import org.openecomp.sdc.heat.services.tree.HeatTreeManagerUtil;
+import org.openecomp.sdc.tosca.datatypes.ToscaGroupType;
+import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
+import org.openecomp.sdc.tosca.datatypes.model.GroupDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.Metadata;
+import org.openecomp.sdc.tosca.datatypes.model.ParameterDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.TopologyTemplate;
+import org.openecomp.sdc.tosca.services.ToscaConstants;
+import org.openecomp.sdc.tosca.services.ToscaFileOutputService;
+import org.openecomp.sdc.tosca.services.ToscaUtil;
+import org.openecomp.sdc.tosca.services.impl.ToscaFileOutputServiceCsarImpl;
+import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.FileDataCollection;
+import org.openecomp.sdc.translator.services.heattotosca.errors.ResourceNotFoundInHeatFileErrorBuilder;
+import org.openecomp.sdc.translator.services.heattotosca.globaltypes.GlobalTypesGenerator;
+import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaParameterConverter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.Set;
+
+
+public class TranslationService {
+
+ protected static Logger logger = LoggerFactory.getLogger(TranslationService.class);
+
+ /**
+ * Gets types to process by translator.
+ *
+ * @return the types to process by translator
+ */
+ public static Set<FileData.Type> getTypesToProcessByTranslator() {
+ Set<FileData.Type> types = new HashSet<>();
+ types.add(FileData.Type.HEAT);
+ types.add(FileData.Type.HEAT_VOL);
+ return types;
+ }
+
+ /**
+ * Translate heat files translator output.
+ *
+ * @param translationContext the translation context
+ * @return the translator output
+ */
+ public TranslatorOutput translateHeatFiles(TranslationContext translationContext) {
+ ServiceTemplate mainServiceTemplate = createMainServiceTemplate(translationContext);
+ List<FileData> fileDataList = translationContext.getManifest().getContent().getData();
+ FileDataCollection fileDataCollection = HeatToToscaUtil.getFileCollectionsByFilter(fileDataList,
+ TranslationService.getTypesToProcessByTranslator(), translationContext);
+
+ if (fileDataCollection.getBaseFile() != null) {
+ for (FileData fileData : fileDataCollection.getBaseFile()) {
+ translateHeatFile(mainServiceTemplate, fileData, translationContext);
+ }
+ }
+ if (fileDataCollection.getAddOnFiles() != null) {
+ for (FileData fileData : fileDataCollection.getAddOnFiles()) {
+ translateHeatFile(mainServiceTemplate, fileData, translationContext);
+ }
+ }
+
+ ToscaServiceModel toscaServiceModel =
+ createToscaServiceModel(mainServiceTemplate, translationContext);
+
+ TranslatorOutput translatorOutput = new TranslatorOutput();
+ translatorOutput.setToscaServiceModel(toscaServiceModel);
+ return translatorOutput;
+ }
+
+ private ToscaServiceModel createToscaServiceModel(ServiceTemplate entryDefinitionServiceTemplate,
+ TranslationContext translationContext) {
+ return new ToscaServiceModel(getCsarArtifactFiles(translationContext),
+ getServiceTemplates(translationContext),
+ ToscaUtil.getServiceTemplateFileName(entryDefinitionServiceTemplate));
+ }
+
+ private Map<String, ServiceTemplate> getServiceTemplates(TranslationContext translationContext) {
+ List<ServiceTemplate> serviceTemplates = new ArrayList<>();
+ serviceTemplates.addAll(GlobalTypesGenerator.getGlobalTypesServiceTemplate().values());
+ serviceTemplates.addAll(translationContext.getTranslatedServiceTemplates().values());
+ Map<String, ServiceTemplate> serviceTemplatesMap = new HashMap<>();
+
+ for (ServiceTemplate template : serviceTemplates) {
+ serviceTemplatesMap.put(ToscaUtil.getServiceTemplateFileName(template), template);
+ }
+ return serviceTemplatesMap;
+ }
+
+ private FileContentHandler getCsarArtifactFiles(TranslationContext translationContext) {
+ FileContentHandler artifactFiles = new FileContentHandler();
+ artifactFiles.setFiles(translationContext.getFiles());
+ artifactFiles.setFiles(translationContext.getExternalArtifacts());
+
+ HeatTreeManager heatTreeManager =
+ HeatTreeManagerUtil.initHeatTreeManager(translationContext.getFiles());
+ heatTreeManager.createTree();
+ ValidationStructureList validationStructureList =
+ new ValidationStructureList(heatTreeManager.getTree());
+ byte[] validationStructureFile =
+ FileUtils.convertToBytes(validationStructureList, FileUtils.FileExtension.JSON);
+ artifactFiles.addFile("HEAT.meta", validationStructureFile);
+
+ return artifactFiles;
+ }
+
+ private ServiceTemplate createMainServiceTemplate(TranslationContext translationContext) {
+ ServiceTemplate mainServiceTemplate = new ServiceTemplate();
+ translationContext.getTranslatedServiceTemplates().put("Main", mainServiceTemplate);
+ Metadata templateMetadata = new Metadata();
+ templateMetadata.setTemplate_name("Main");
+ mainServiceTemplate.setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION);
+ mainServiceTemplate.setMetadata(templateMetadata);
+ mainServiceTemplate.setTopology_template(new TopologyTemplate());
+ mainServiceTemplate.setImports(GlobalTypesGenerator.getGlobalTypesImportList());
+
+ return mainServiceTemplate;
+ }
+
+ /**
+ * Translate heat file.
+ *
+ * @param serviceTemplate the service template
+ * @param heatFileData the heat file data
+ * @param context the context
+ */
+ public void translateHeatFile(ServiceTemplate serviceTemplate, FileData heatFileData,
+ TranslationContext context) {
+ String heatFileName = heatFileData.getFile();
+ HeatOrchestrationTemplate heatOrchestrationTemplate = new YamlUtil()
+ .yamlToObject(context.getFileContent(heatFileName), HeatOrchestrationTemplate.class);
+
+ translateInputParameters(serviceTemplate, heatOrchestrationTemplate, heatFileData, context,
+ heatFileName);
+ translateResources(heatFileName, serviceTemplate, heatOrchestrationTemplate, context);
+ translateOutputParameters(serviceTemplate, heatOrchestrationTemplate, heatFileData,
+ heatFileName, context);
+ createHeatStackGroup(serviceTemplate, heatFileData, heatOrchestrationTemplate, context);
+
+ if (Objects.nonNull(heatFileData.getData())) {
+ heatFileData.getData().stream().filter(data -> data.getType() == FileData.Type.HEAT_VOL)
+ .forEach(data -> translateHeatFile(serviceTemplate, data, context));
+ }
+ }
+
+ private void createHeatStackGroup(ServiceTemplate serviceTemplate, FileData heatFileData,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ TranslationContext context) {
+ ToscaFileOutputService toscaFileOutputService = new ToscaFileOutputServiceCsarImpl();
+ String fileName = heatFileData.getFile();
+ final String fileNameWoExtension =
+ FileUtils.getFileWithoutExtention(fileName);//.heatFileData.getFile().split("\\.")[0];
+
+ GroupDefinition groupDefinition = new GroupDefinition();
+ groupDefinition.setType(ToscaGroupType.HEAT_STACK.getDisplayName());
+ groupDefinition.setProperties(new HashMap<>());
+ groupDefinition.getProperties()
+ .put("heat_file", "../" + toscaFileOutputService.getArtifactsFolderName() + "/" + fileName);
+ String hotDescription = heatOrchestrationTemplate.getDescription();
+ if (hotDescription != null && !hotDescription.isEmpty()) {
+ groupDefinition.getProperties().put(Constants.DESCRIPTION_PROPERTY_NAME, hotDescription);
+ }
+ groupDefinition.setMembers(new ArrayList<>());
+ Map<String, Set<String>> heatStackGroupMembers = context.getHeatStackGroupMembers();
+ if (heatStackGroupMembers.get(fileName) == null) {
+ return; //not creating a group when no resources are present in the heat input
+ }
+ groupDefinition.getMembers().addAll(heatStackGroupMembers.get(fileName));
+ if (serviceTemplate.getTopology_template().getGroups() == null) {
+ Map<String, GroupDefinition> groups = new HashMap<>();
+ serviceTemplate.getTopology_template().setGroups(groups);
+ }
+ serviceTemplate.getTopology_template().getGroups().put(fileNameWoExtension, groupDefinition);
+ }
+
+ private void translateInputParameters(ServiceTemplate serviceTemplate,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ FileData heatFileData, TranslationContext context,
+ String heatFileName) {
+
+ if (heatOrchestrationTemplate.getParameters() == null) {
+ return;
+ }
+
+ Map<String, ParameterDefinition> parameterDefinitionMap =
+ TranslatorHeatToToscaParameterConverter
+ .parameterConverter(heatOrchestrationTemplate.getParameters(),
+ heatOrchestrationTemplate, heatFileName, context);
+ Environment heatEnvFile = getHeatEnvFile(heatFileData, context);
+ Map<String, Object> parameters = heatEnvFile.getParameters();
+ Object parameterValue;
+ if (parameters != null) {
+ for (Map.Entry<String, ParameterDefinition> entry : parameterDefinitionMap.entrySet()) {
+ String paramName = entry.getKey();
+ parameterValue = parameters.get(paramName);
+ if (parameterValue != null) {
+ entry.getValue().set_default(TranslatorHeatToToscaParameterConverter
+ .getToscaParameterDefaultValue(parameterValue, entry.getValue().getType(),
+ heatFileName, heatOrchestrationTemplate, context));
+ }
+ }
+ }
+
+ Map<String, ParameterDefinition> inputs = serviceTemplate.getTopology_template().getInputs();
+ if (Objects.isNull(inputs)) {
+ serviceTemplate.getTopology_template().setInputs(parameterDefinitionMap);
+ } else {
+ inputs.putAll(parameterDefinitionMap);
+ }
+ }
+
+ private void translateOutputParameters(ServiceTemplate serviceTemplate,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ FileData heatFileData, String heatFileName,
+ TranslationContext context) {
+ if (heatOrchestrationTemplate.getOutputs() == null) {
+ return;
+ }
+ Map<String, ParameterDefinition> parameterDefinitionMap =
+ TranslatorHeatToToscaParameterConverter
+ .parameterOutputConverter(heatOrchestrationTemplate.getOutputs(),
+ heatOrchestrationTemplate, heatFileName, context);
+ if (serviceTemplate.getTopology_template().getOutputs() != null) {
+ serviceTemplate.getTopology_template().getOutputs().putAll(parameterDefinitionMap);
+ } else {
+ serviceTemplate.getTopology_template().setOutputs(parameterDefinitionMap);
+ }
+
+ if (heatFileData.getBase() != null && heatFileData.getBase().equals(true)) {
+ updateSharedResources(serviceTemplate, heatFileName, heatOrchestrationTemplate,
+ heatOrchestrationTemplate.getOutputs(), context);
+ }
+ }
+
+ private void updateSharedResources(ServiceTemplate serviceTemplate, String heatFileName,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ Map<String, Output> outputs, TranslationContext context) {
+ for (Map.Entry<String, Output> paramName : outputs.entrySet()) {
+ Optional<AttachedResourceId> attachedSharedResourceId = HeatToToscaUtil
+ .extractAttachedResourceId(heatFileName, heatOrchestrationTemplate, context,
+ paramName.getValue().getValue());
+ if (attachedSharedResourceId.isPresent() && attachedSharedResourceId.get().isGetResource()
+ && attachedSharedResourceId.get().getTranslatedId() != null) {
+ String sharedTranslatedResourceId =
+ attachedSharedResourceId.get().getTranslatedId().toString();
+ updateSharedResource(serviceTemplate, context, paramName, sharedTranslatedResourceId,
+ heatOrchestrationTemplate.getResources()
+ .get(attachedSharedResourceId.get().getEntityId()));
+ } else {
+ String contrailSharedResourceId = HeatToToscaUtil
+ .extractContrailGetResourceAttachedHeatResourceId(paramName.getValue().getValue());
+ if (contrailSharedResourceId != null
+ && context.getTranslatedIds().get(heatFileName).get(contrailSharedResourceId) != null) {
+ updateSharedResource(serviceTemplate, context, paramName,
+ context.getTranslatedIds().get(heatFileName).get(contrailSharedResourceId),
+ heatOrchestrationTemplate.getResources().get(contrailSharedResourceId));
+ }
+ }
+ }
+ if (serviceTemplate.getTopology_template().getOutputs() != null
+ && serviceTemplate.getTopology_template().getOutputs().size() == 0) {
+ serviceTemplate.getTopology_template().setOutputs(null);
+ }
+ }
+
+ private void updateSharedResource(ServiceTemplate serviceTemplate, TranslationContext context,
+ Map.Entry<String, Output> paramName,
+ String sharedTranslatedResourceId, Resource resource) {
+ context.addHeatSharedResourcesByParam(paramName.getKey(), sharedTranslatedResourceId, resource);
+ serviceTemplate.getTopology_template().getOutputs().remove(paramName.getKey());
+ }
+
+ private void translateResources(String heatFileName, ServiceTemplate serviceTemplate,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ TranslationContext context) {
+ for (String resourceId : heatOrchestrationTemplate.getResources().keySet()) {
+ Resource resource = heatOrchestrationTemplate.getResources().get(resourceId);
+ if (resource == null) {
+ throw new CoreException(
+ new ResourceNotFoundInHeatFileErrorBuilder(resourceId, heatFileName).build());
+ }
+ ResourceTranslationFactory.getInstance(resource)
+ .translateResource(heatFileName, serviceTemplate, heatOrchestrationTemplate, resource,
+ resourceId, context);
+ }
+ }
+
+ private Environment getHeatEnvFile(FileData heatFileData, TranslationContext context) {
+ List<FileData> fileRelatedDataList = heatFileData.getData();
+ if (fileRelatedDataList == null) {
+ return new Environment();
+ }
+ for (FileData fileRelatedData : fileRelatedDataList) {
+ if (fileRelatedData.getType().equals(FileData.Type.HEAT_ENV)) {
+ return new YamlUtil().yamlToObject(context.getFileContent(fileRelatedData.getFile()),
+ Environment.class);
+ }
+ }
+ return new Environment();
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/IncorrectResourceReferenceErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/IncorrectResourceReferenceErrorBuilder.java
new file mode 100644
index 0000000000..c713855f60
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/IncorrectResourceReferenceErrorBuilder.java
@@ -0,0 +1,51 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.errors;
+
+import org.openecomp.sdc.common.errors.BaseErrorBuilder;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+
+public class IncorrectResourceReferenceErrorBuilder extends BaseErrorBuilder {
+
+ private static final String INCORRECT_RESOURCE_REFERENCE_MSG =
+ "resource id '%s' with type '%s' has reference to resource '%s' with"
+ + " type '%s' in property '%s'. Invalid type, resource type should be type of '%s'.";
+
+ /**
+ * Instantiates a new Incorrect resource reference error builder.
+ *
+ * @param sourceResourceId the source resource id
+ * @param sourceResourceType the source resource type
+ * @param targetResourceId the target resource id
+ * @param targetResourceType the target resource type
+ * @param property the property
+ * @param validType the valid type
+ */
+ public IncorrectResourceReferenceErrorBuilder(String sourceResourceId, String sourceResourceType,
+ String targetResourceId, String targetResourceType,
+ String property, String validType) {
+ getErrorCodeBuilder().withId(TranslatorErrorCodes.INCORRECT_RESOURCE_REFERENCE);
+ getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION);
+ getErrorCodeBuilder().withMessage(String
+ .format(INCORRECT_RESOURCE_REFERENCE_MSG, sourceResourceId, sourceResourceType,
+ targetResourceId, targetResourceType, property, validType));
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/InvalidPropertyValueErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/InvalidPropertyValueErrorBuilder.java
new file mode 100644
index 0000000000..a16c341545
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/InvalidPropertyValueErrorBuilder.java
@@ -0,0 +1,47 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.errors;
+
+import org.openecomp.sdc.common.errors.BaseErrorBuilder;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+
+
+public class InvalidPropertyValueErrorBuilder extends BaseErrorBuilder {
+
+ private static final String INVALID_FILED_VALUE_MSG =
+ "'%s' property has invalid value. Actual value is '%s' while '%s' value expected.";
+
+ /**
+ * Instantiates a new Invalid property value error builder.
+ *
+ * @param propertyName the property name
+ * @param actualValue the actual value
+ * @param expectedValue the expected value
+ */
+ public InvalidPropertyValueErrorBuilder(String propertyName, String actualValue,
+ String expectedValue) {
+ getErrorCodeBuilder().withId(TranslatorErrorCodes.INVALID_PROPERTY_VALUE);
+ getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION);
+ getErrorCodeBuilder().withMessage(
+ String.format(INVALID_FILED_VALUE_MSG, propertyName, actualValue, expectedValue));
+ }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/MissingMandatoryPropertyErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/MissingMandatoryPropertyErrorBuilder.java
new file mode 100644
index 0000000000..6e06fef930
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/MissingMandatoryPropertyErrorBuilder.java
@@ -0,0 +1,43 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.errors;
+
+import org.openecomp.sdc.common.errors.BaseErrorBuilder;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+
+
+public class MissingMandatoryPropertyErrorBuilder extends BaseErrorBuilder {
+
+ private static final String MANDATORY_PROPERTY_IS_MISSING_MSG =
+ "Mandatory property '%s' is missing";
+
+ /**
+ * Instantiates a new Missing mandatory property error builder.
+ *
+ * @param propertyName the property name
+ */
+ public MissingMandatoryPropertyErrorBuilder(String propertyName) {
+ getErrorCodeBuilder().withId(TranslatorErrorCodes.MISSING_MANDATORY_PROPERTY);
+ getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION);
+ getErrorCodeBuilder()
+ .withMessage(String.format(MANDATORY_PROPERTY_IS_MISSING_MSG, propertyName));
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/NotInSyncNumberOfInterfacesErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/NotInSyncNumberOfInterfacesErrorBuilder.java
new file mode 100644
index 0000000000..810c09880e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/NotInSyncNumberOfInterfacesErrorBuilder.java
@@ -0,0 +1,44 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.errors;
+
+import org.openecomp.sdc.common.errors.BaseErrorBuilder;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+
+
+public class NotInSyncNumberOfInterfacesErrorBuilder extends BaseErrorBuilder {
+
+ private static final String NOT_IN_SYNC_NUMBER_OF_INTERFACES_MSG =
+ "More than one ServiceInstance pointing to the same "
+ + "ServiceTemplate '%s', with different number of interfaces.";
+
+ /**
+ * Instantiates a new Not in sync number of interfaces error builder.
+ *
+ * @param serviceTemplateResourceId the service template resource id
+ */
+ public NotInSyncNumberOfInterfacesErrorBuilder(String serviceTemplateResourceId) {
+ getErrorCodeBuilder().withId(TranslatorErrorCodes.NOT_IN_SYNC_NUMBER_OF_INTERFACES);
+ getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION);
+ getErrorCodeBuilder().withMessage(
+ String.format(NOT_IN_SYNC_NUMBER_OF_INTERFACES_MSG, serviceTemplateResourceId));
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/ReferenceToUnsupportedResourceErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/ReferenceToUnsupportedResourceErrorBuilder.java
new file mode 100644
index 0000000000..5b48cb2c59
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/ReferenceToUnsupportedResourceErrorBuilder.java
@@ -0,0 +1,52 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.errors;
+
+import org.openecomp.sdc.common.errors.BaseErrorBuilder;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+
+
+public class ReferenceToUnsupportedResourceErrorBuilder extends BaseErrorBuilder {
+
+ private static final String REFERENCE_TO_UNSUPPORTED_RESOURCE_MSG =
+ "Resource id '%s' with type '%s' has reference to"
+ + " unsupported resource '%s' with type '%s' in property '%s'";
+
+ /**
+ * Instantiates a new Reference to unsupported resource error builder.
+ *
+ * @param sourceResourceId the source resource id
+ * @param sourceResourceType the source resource type
+ * @param targetResourceId the target resource id
+ * @param targetResourceType the target resource type
+ * @param property the property
+ */
+ public ReferenceToUnsupportedResourceErrorBuilder(String sourceResourceId,
+ String sourceResourceType,
+ String targetResourceId,
+ String targetResourceType, String property) {
+ getErrorCodeBuilder().withId(TranslatorErrorCodes.REFERENCE_TO_UNSUPPORTED_RESOURCE);
+ getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION);
+ getErrorCodeBuilder().withMessage(String
+ .format(REFERENCE_TO_UNSUPPORTED_RESOURCE_MSG, sourceResourceId, sourceResourceType,
+ targetResourceId, targetResourceType, property));
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/ResourceNotFoundInHeatFileErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/ResourceNotFoundInHeatFileErrorBuilder.java
new file mode 100644
index 0000000000..7fac501e76
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/ResourceNotFoundInHeatFileErrorBuilder.java
@@ -0,0 +1,52 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.errors;
+
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+
+public class ResourceNotFoundInHeatFileErrorBuilder {
+
+ private static final String RESOURCE_NOT_FOUND_IN_FILE_ERR_ID =
+ "RESOURCE_NOT_FOUND_IN_FILE_ERR_ID";
+ private static final String RESOURCE_NOT_FOUND_IN_FILE_ERR_MSG =
+ "resource with id = %s was not found in heat file = %s.";
+
+ private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
+
+ /**
+ * Instantiates a new Resource not found in heat file error builder.
+ *
+ * @param resourceId the resource id
+ * @param heatfileName the heatfile name
+ */
+ public ResourceNotFoundInHeatFileErrorBuilder(String resourceId, String heatfileName) {
+ builder.withId(RESOURCE_NOT_FOUND_IN_FILE_ERR_ID);
+ builder.withCategory(ErrorCategory.APPLICATION);
+ builder
+ .withMessage(String.format(RESOURCE_NOT_FOUND_IN_FILE_ERR_MSG, resourceId, heatfileName));
+ }
+
+ public ErrorCode build() {
+ return builder.build();
+ }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/TranslatorErrorCodes.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/TranslatorErrorCodes.java
new file mode 100644
index 0000000000..f9b873adca
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/TranslatorErrorCodes.java
@@ -0,0 +1,31 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.errors;
+
+public class TranslatorErrorCodes {
+ public static final String MISSING_MANDATORY_PROPERTY = "MISSING_MANDATORY_PROPERTY";
+ public static final String HEAT_TO_TOSCA_MAPPING_COLLISION = "HEAT_TO_TOSCA_MAPPING_COLLISION";
+ public static final String INCORRECT_RESOURCE_REFERENCE = "INCORRECT_RESOURCE_REFERENCE";
+ public static final String REFERENCE_TO_UNSUPPORTED_RESOURCE =
+ "REFERENCE_TO_UNSUPPORTED_RESOURCE";
+ public static final String NOT_IN_SYNC_NUMBER_OF_INTERFACES = "NOT_IN_SYNC_NUMBER_OF_INTERFACES";
+ public static final String INVALID_PROPERTY_VALUE = "INVALID_PROPERTY_VALUE";
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/AbstractSubstituteGlobalType.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/AbstractSubstituteGlobalType.java
new file mode 100644
index 0000000000..221a9e522b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/AbstractSubstituteGlobalType.java
@@ -0,0 +1,167 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.globaltypes;
+
+import org.openecomp.sdc.tosca.datatypes.ToscaDataType;
+import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
+import org.openecomp.sdc.tosca.datatypes.model.Constraint;
+import org.openecomp.sdc.tosca.datatypes.model.DataType;
+import org.openecomp.sdc.tosca.datatypes.model.NodeType;
+import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.PropertyType;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.tosca.services.DataModelUtil;
+import org.openecomp.sdc.tosca.services.ToscaConstants;
+import org.openecomp.sdc.translator.services.heattotosca.Constants;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+
+public class AbstractSubstituteGlobalType {
+
+ private AbstractSubstituteGlobalType() {
+ }
+
+ /**
+ * Create service template service template.
+ *
+ * @return the service template
+ */
+ public static ServiceTemplate createServiceTemplate() {
+ ServiceTemplate serviceTemplate = new ServiceTemplate();
+ serviceTemplate.setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION);
+ serviceTemplate.setMetadata(
+ DataModelUtil.createMetadata(Constants.ABSTRACT_SUBSTITUTE_TEMPLATE_NAME, "1.0.0", null));
+ serviceTemplate.setImports(GlobalTypesUtil.createCommonImportList());
+ serviceTemplate.setDescription("Abstract Substitute Global Types");
+ serviceTemplate.setData_types(createGlobalDataTypes());
+ serviceTemplate.setNode_types(createGlobalNodeTypes());
+ return serviceTemplate;
+ }
+
+ private static Map<String, NodeType> createGlobalNodeTypes() {
+ Map<String, NodeType> globalNodeTypes = new HashMap<>();
+ globalNodeTypes.put(ToscaNodeType.ABSTRACT_SUBSTITUTE.getDisplayName(),
+ createAbstractSubstituteNodeType());
+ return globalNodeTypes;
+ }
+
+ private static NodeType createAbstractSubstituteNodeType() {
+ NodeType nodeType = new NodeType();
+ nodeType.setDerived_from(ToscaNodeType.ROOT.getDisplayName());
+ nodeType.setProperties(createAbstractSubstituteProperties());
+ return nodeType;
+ }
+
+ private static Map<String, PropertyDefinition> createAbstractSubstituteProperties() {
+ Map<String, PropertyDefinition> props = new HashMap<>();
+ props.put(ToscaConstants.SERVICE_TEMPLATE_FILTER_PROPERTY_NAME, DataModelUtil
+ .createPropertyDefinition(ToscaDataType.SUBSTITUTION_FILTERING.getDisplayName(),
+ "Substitution Filter", true, null, null, null, null));
+
+ return props;
+ }
+
+
+ private static Map<String, DataType> createGlobalDataTypes() {
+ Map<String, DataType> globalDataTypes = new HashMap<>();
+ globalDataTypes.put(ToscaDataType.SUBSTITUTION_FILTER.getDisplayName(),
+ createSubstitutionFilterDataType());
+ globalDataTypes.put(ToscaDataType.SUBSTITUTION_FILTERING.getDisplayName(),
+ createSubstitutionFilteringDataType());
+ return globalDataTypes;
+ }
+
+ private static DataType createSubstitutionFilterDataType() {
+ DataType dataType = new DataType();
+ dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName());
+ dataType.setDescription("Substitution Filter");
+ Map<String, PropertyDefinition> properties = new HashMap<>();
+ properties.put(ToscaConstants.COUNT_PROPERTY_NAME, DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Count", false, null, null,
+ null, 1));
+ properties.put(ToscaConstants.SCALING_ENABLED_PROPERTY_NAME, DataModelUtil
+ .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(),
+ "Indicates whether service scaling is enabled", false, null, null, null, true));
+ properties.put(ToscaConstants.SUBSTITUTE_SERVICE_TEMPLATE_PROPERTY_NAME, DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "Substitute Service Template", true, null, null, null, null));
+ properties.put("mandatory", DataModelUtil
+ .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(), "Mandatory", false, null,
+ null, null, true));
+ properties.put("index_variable", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Index variable", false,
+ createMinLengthConstraint(), null, null, "%index%"));
+
+ dataType.setProperties(properties);
+ return dataType;
+ }
+
+ private static List<Constraint> createMinLengthConstraint() {
+ List<Constraint> constraints;
+ constraints = new ArrayList<>();
+ Constraint constraint = new Constraint();
+ constraint.setMin_length(3);
+ constraints.add(constraint);
+ return constraints;
+ }
+
+ private static DataType createSubstitutionFilteringDataType() {
+ DataType dataType = new DataType();
+ dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName());
+ dataType.setDescription("Substitution Filter");
+ Map<String, PropertyDefinition> properties = new HashMap<>();
+ properties.put(ToscaConstants.COUNT_PROPERTY_NAME, DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Count", false, null, null,
+ null, 1));
+ properties.put(ToscaConstants.INDEX_VALUE_PROPERTY_NAME, DataModelUtil
+ .createPropertyDefinition(PropertyType.INTEGER.getDisplayName(),
+ "Index value of the substitution service template runtime instance", false,
+ createIndexValueConstraint(), null, null, 0));
+ properties.put(ToscaConstants.SCALING_ENABLED_PROPERTY_NAME, DataModelUtil
+ .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(),
+ "Indicates whether service scaling is enabled", false, null, null, null, true));
+ properties.put(ToscaConstants.SUBSTITUTE_SERVICE_TEMPLATE_PROPERTY_NAME, DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "Substitute Service Template", true, null, null, null, null));
+ properties.put("mandatory", DataModelUtil
+ .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(), "Mandatory", false, null,
+ null, null, true));
+
+
+ dataType.setProperties(properties);
+ return dataType;
+ }
+
+ private static List<Constraint> createIndexValueConstraint() {
+ List<Constraint> constraints;
+ constraints = new ArrayList<>();
+ Constraint constraint = new Constraint();
+ constraint.setGreater_or_equal(0);
+ constraints.add(constraint);
+ return constraints;
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/CinderVolumeGlobalType.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/CinderVolumeGlobalType.java
new file mode 100644
index 0000000000..72f3043225
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/CinderVolumeGlobalType.java
@@ -0,0 +1,242 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.globaltypes;
+
+import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
+import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType;
+import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.Constraint;
+import org.openecomp.sdc.tosca.datatypes.model.NodeType;
+import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.PropertyType;
+import org.openecomp.sdc.tosca.datatypes.model.RelationshipType;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.tosca.services.DataModelUtil;
+import org.openecomp.sdc.tosca.services.ToscaConstants;
+import org.openecomp.sdc.translator.services.heattotosca.Constants;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class CinderVolumeGlobalType {
+
+ /**
+ * Create service template service template.
+ *
+ * @return the service template
+ */
+ public static ServiceTemplate createServiceTemplate() {
+ ServiceTemplate cinderVolumeServiceTemplate = new ServiceTemplate();
+ cinderVolumeServiceTemplate
+ .setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION);
+ cinderVolumeServiceTemplate.setMetadata(
+ DataModelUtil.createMetadata(Constants.CINDER_VOLUME_TEMPLATE_NAME, "1.0.0", null));
+ cinderVolumeServiceTemplate.setDescription("Cinder Volume TOSCA Global Types");
+ cinderVolumeServiceTemplate.setRelationship_types(createGlobalRelationshipTypes());
+ cinderVolumeServiceTemplate.setNode_types(createGlobalNodeTypes());
+ return cinderVolumeServiceTemplate;
+ }
+
+ private static Map<String, NodeType> createGlobalNodeTypes() {
+ Map<String, NodeType> globalNodeTypes = new HashMap<>();
+ globalNodeTypes.put(ToscaNodeType.CINDER_VOLUME.getDisplayName(), createCinderVolumeNodeType());
+ return globalNodeTypes;
+ }
+
+ private static NodeType createCinderVolumeNodeType() {
+ NodeType cinderVolumeNodeType = new NodeType();
+ cinderVolumeNodeType.setDerived_from(ToscaNodeType.BLOCK_STORAGE.getDisplayName());
+ cinderVolumeNodeType.setProperties(createCinderVolumeProperties());
+ cinderVolumeNodeType.setAttributes(createCinderVolumeAttributes());
+ return cinderVolumeNodeType;
+ }
+
+ private static Map<String, RelationshipType> createGlobalRelationshipTypes() {
+ Map<String, RelationshipType> globalRelationshipTypes = new HashMap<>();
+ globalRelationshipTypes.put(ToscaRelationshipType.CINDER_VOLUME_ATTACHES_TO.getDisplayName(),
+ createCinderVolumeAttachesToRelationshipType());
+ return globalRelationshipTypes;
+ }
+
+ private static RelationshipType createCinderVolumeAttachesToRelationshipType() {
+ RelationshipType cinderVolumeAttachesToRelationType = new RelationshipType();
+ cinderVolumeAttachesToRelationType
+ .setDerived_from(ToscaRelationshipType.NATIVE_ATTACHES_TO.getDisplayName());
+ cinderVolumeAttachesToRelationType
+ .setDescription("This type represents an attachment relationship for associating volume");
+
+ Map<String, PropertyDefinition> cinderVolumeAttachesToProps = new HashMap<>();
+ cinderVolumeAttachesToProps.put("location", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "The location where the volume is exposed on the instance, mountpoint", false, null,
+ null, null, null)); //overridden location prop from attachesTo
+ cinderVolumeAttachesToProps.put("instance_uuid", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "The ID of the server to which the volume attaches", true, null, null, null, null));
+ cinderVolumeAttachesToProps.put("volume_id", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "The ID of the volume to be attached", true, null, null, null, null));
+ cinderVolumeAttachesToRelationType.setProperties(cinderVolumeAttachesToProps);
+
+ Map<String, AttributeDefinition> cinderVolumeAttachesToAttributes = new HashMap<>();
+ cinderVolumeAttachesToAttributes.put("show", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(),
+ "Detailed information about resource", null, null, null));
+ cinderVolumeAttachesToRelationType.setAttributes(cinderVolumeAttachesToAttributes);
+
+ return cinderVolumeAttachesToRelationType;
+ }
+
+ private static Map<String, PropertyDefinition> createCinderVolumeProperties() {
+ Map<String, PropertyDefinition> cinderVolumePropertyDefMap = new HashMap<>();
+ cinderVolumePropertyDefMap.put("availability_zone", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "The availability zone in which the volume will be created", false, null, null, null,
+ null));
+ cinderVolumePropertyDefMap.put("backup_id", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "If specified, the backup to create the volume from", false, null, null, null, null));
+ cinderVolumePropertyDefMap.put(Constants.DESCRIPTION_PROPERTY_NAME, DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "A description of the volume", false, null, null, null, null));
+ cinderVolumePropertyDefMap.put("image", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "If specified, the name or ID of the image to create the volume from", false, null,
+ null, null, null));
+ cinderVolumePropertyDefMap.put("metadata", DataModelUtil
+ .createPropertyDefinition(PropertyType.MAP.getDisplayName(),
+ "Key/value pairs to associate with the volume", false, null, null,
+ DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null),
+ null));
+ cinderVolumePropertyDefMap.put("multiattach", DataModelUtil
+ .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(),
+ "Whether allow the volume to be attached more than once", false, null, null, null,
+ null));
+ cinderVolumePropertyDefMap.put(Constants.NAME_PROPERTY_NAME, DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "A name used to distinguish the volume", false, null, null, null, null));
+ cinderVolumePropertyDefMap.put("read_only", DataModelUtil
+ .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(),
+ "Enables or disables read-only access mode of volume", false, null, null, null, null));
+ cinderVolumePropertyDefMap.put("scheduler_hints", DataModelUtil
+ .createPropertyDefinition(PropertyType.MAP.getDisplayName(),
+ "Arbitrary key-value pairs specified by the client "
+ + "to help the Cinder scheduler creating a volume",
+ false, null, null,
+ DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null),
+ null));
+ cinderVolumePropertyDefMap.put("size", DataModelUtil
+ .createPropertyDefinition(PropertyType.SCALAR_UNIT_SIZE.getDisplayName(),
+ "The requested storage size (default unit is MB)", false, getSizeConstraints(), null,
+ null, null));
+ cinderVolumePropertyDefMap.put("source_volid", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "If specified, the volume to use as source", false, null, null, null, null));
+ cinderVolumePropertyDefMap.put("volume_type", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "If specified, the type of volume to use, mapping to a specific backend", false, null,
+ null, null, null));
+ cinderVolumePropertyDefMap.put("delete_on_termination", DataModelUtil
+ .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(),
+ "Indicate whether the volume should be deleted when the server is terminated", false,
+ null, null, null, null));
+ cinderVolumePropertyDefMap.put("boot_index", DataModelUtil
+ .createPropertyDefinition(PropertyType.INTEGER.getDisplayName(),
+ "Integer used for ordering the boot disks", false, null, null, null, null));
+ cinderVolumePropertyDefMap.put("device_type", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Device type", false,
+ getDeviceTypeConstraints(), null, null, null));
+ cinderVolumePropertyDefMap.put("disk_bus", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "Bus of the device: hypervisor driver chooses a suitable default if omitted", false,
+ getDiskBusConstraints(), null, null, null));
+ cinderVolumePropertyDefMap.put("swap_size", DataModelUtil
+ .createPropertyDefinition(PropertyType.SCALAR_UNIT_SIZE.getDisplayName(),
+ "The size of the swap, in MB", false, null, null, null, null));
+
+ return cinderVolumePropertyDefMap;
+ }
+
+ private static Map<String, AttributeDefinition> createCinderVolumeAttributes() {
+ Map<String, AttributeDefinition> cinderVolumeAttributesDefMap = new HashMap<>();
+ cinderVolumeAttributesDefMap.put("attachments", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(),
+ "The list of attachments of the volume", null,
+ DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null),
+ null));
+ cinderVolumeAttributesDefMap.put("bootable", DataModelUtil
+ .createAttributeDefinition(PropertyType.BOOLEAN.getDisplayName(),
+ "Boolean indicating if the volume can be booted or not", null, null, null));
+ cinderVolumeAttributesDefMap.put("created_at", DataModelUtil
+ .createAttributeDefinition(PropertyType.TIMESTAMP.getDisplayName(),
+ "The timestamp indicating volume creation", null, null, null));
+ cinderVolumeAttributesDefMap.put("display_description", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(),
+ "Description of the volume", null, null, null));
+ cinderVolumeAttributesDefMap.put("display_name", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "Name of the volume", null,
+ null, null));
+ cinderVolumeAttributesDefMap.put("encrypted", DataModelUtil
+ .createAttributeDefinition(PropertyType.BOOLEAN.getDisplayName(),
+ "Boolean indicating if the volume is encrypted or not", null, null, null));
+ cinderVolumeAttributesDefMap.put("metadata_values", DataModelUtil
+ .createAttributeDefinition(PropertyType.MAP.getDisplayName(),
+ "Key/value pairs associated with the volume in raw dict form", null,
+ DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null),
+ null));
+ cinderVolumeAttributesDefMap.put("show", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(),
+ "Detailed information about resource", null, null, null));
+ cinderVolumeAttributesDefMap.put("status", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(),
+ "The current status of the volume", null, null, null));
+ return cinderVolumeAttributesDefMap;
+ }
+
+ private static List<Constraint> getDeviceTypeConstraints() {
+ Constraint validValues;
+ List<Constraint> constraints = new ArrayList<>();
+ validValues = DataModelUtil.createValidValuesConstraint("cdrom", "disk");
+ constraints.add(validValues);
+ return constraints;
+ }
+
+ private static List<Constraint> getDiskBusConstraints() {
+ Constraint validValues;
+ List<Constraint> constraints = new ArrayList<>();
+ validValues =
+ DataModelUtil.createValidValuesConstraint("ide", "lame_bus", "scsi", "usb", "virtio");
+ constraints.add(validValues);
+ return constraints;
+ }
+
+
+ private static List<Constraint> getSizeConstraints() {
+ List<Constraint> constraints;
+ constraints = new ArrayList<>();
+ Constraint constraint = new Constraint();
+ constraint.setGreater_or_equal("1 GB");
+ constraints.add(constraint);
+ return constraints;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/CommonGlobalTypes.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/CommonGlobalTypes.java
new file mode 100644
index 0000000000..43a4782149
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/CommonGlobalTypes.java
@@ -0,0 +1,500 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.globaltypes;
+
+
+import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType;
+import org.openecomp.sdc.tosca.datatypes.ToscaDataType;
+import org.openecomp.sdc.tosca.datatypes.ToscaGroupType;
+import org.openecomp.sdc.tosca.datatypes.ToscaPolicyType;
+import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType;
+import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.CapabilityType;
+import org.openecomp.sdc.tosca.datatypes.model.Constraint;
+import org.openecomp.sdc.tosca.datatypes.model.DataType;
+import org.openecomp.sdc.tosca.datatypes.model.GroupType;
+import org.openecomp.sdc.tosca.datatypes.model.Import;
+import org.openecomp.sdc.tosca.datatypes.model.PolicyType;
+import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.PropertyType;
+import org.openecomp.sdc.tosca.datatypes.model.RelationshipType;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.tosca.services.DataModelUtil;
+import org.openecomp.sdc.tosca.services.ToscaConstants;
+import org.openecomp.sdc.tosca.services.ToscaUtil;
+import org.openecomp.sdc.translator.services.heattotosca.Constants;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class CommonGlobalTypes {
+
+ /**
+ * Create service template service template.
+ *
+ * @return the service template
+ */
+ public static ServiceTemplate createServiceTemplate() {
+ ServiceTemplate serviceTemplate = new ServiceTemplate();
+ serviceTemplate.setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION);
+ serviceTemplate.setMetadata(
+ DataModelUtil.createMetadata(Constants.COMMON_GLOBAL_TEMPLATE_NAME, "1.0.0", null));
+ serviceTemplate.setDescription("TOSCA Global Types");
+ serviceTemplate.setData_types(createGlobalDataTypes());
+ serviceTemplate.setGroup_types(createGroupTypes());
+ serviceTemplate.setPolicy_types(createPolicyTypes());
+ serviceTemplate.setRelationship_types(createRelationTypes());
+ serviceTemplate.setCapability_types(createCapabilityTypes());
+ serviceTemplate.setImports(createImportList());
+ return serviceTemplate;
+ }
+
+ private static Map<String, CapabilityType> createCapabilityTypes() {
+ Map<String, CapabilityType> capabilityMap = new HashMap<>();
+ capabilityMap.put(ToscaCapabilityType.METRIC.getDisplayName(), createMetricCapabilityType());
+ capabilityMap
+ .put(ToscaCapabilityType.METRIC_CEILOMETER.getDisplayName(), createMetricCeilometerType());
+ capabilityMap.put(ToscaCapabilityType.METRIC_SNMP_TRAP.getDisplayName(), createMetricSnmpType(
+ "A node type that includes the Metric capability"
+ + " indicates that it can be monitored using snmp trap."));
+ capabilityMap.put(ToscaCapabilityType.METRIC_SNMP_POLLING.getDisplayName(),
+ createMetricSnmpType(
+ "A node type that includes the Metric capability indicates"
+ + " that it can be monitored using snmp polling."));
+ return capabilityMap;
+ }
+
+
+ private static CapabilityType createMetricSnmpType(String description) {
+ CapabilityType capabilityType = new CapabilityType();
+ capabilityType.setDerived_from(ToscaCapabilityType.METRIC.getDisplayName());
+ capabilityType.setDescription(description);
+ capabilityType.setProperties(createCapabilityMetricSnmpProperties());
+
+ return capabilityType;
+ }
+
+
+ private static Map<String, PropertyDefinition> createCapabilityMetricSnmpProperties() {
+ Map<String, PropertyDefinition> propertyDefinitionMap = new HashMap<>();
+ propertyDefinitionMap.put("oid", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Object Id of the metric",
+ true, null, null, null, null));
+ return propertyDefinitionMap;
+ }
+
+ private static CapabilityType createMetricCeilometerType() {
+ CapabilityType capabilityType = new CapabilityType();
+ capabilityType.setDerived_from(ToscaCapabilityType.METRIC.getDisplayName());
+ capabilityType.setDescription(
+ "A node type that includes the Metric capability"
+ + " indicates that it can be monitored using ceilometer.");
+ capabilityType.setProperties(createCapabilityMetricCeilometerProperties());
+ return capabilityType;
+ }
+
+
+ private static Map<String, PropertyDefinition> createCapabilityMetricCeilometerProperties() {
+ Map<String, PropertyDefinition> propertyDefinitionMap = new HashMap<>();
+ propertyDefinitionMap.put(Constants.NAME_PROPERTY_NAME, DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "Ceilometer metric type name to monitor. (The name ceilometer is using)", true, null,
+ null, null, null));
+ return propertyDefinitionMap;
+ }
+
+ private static Map<String, Import> createImportList() {
+ Map<String, Import> importsMap = new HashMap<>();
+ importsMap.put(ToscaConstants.NATIVE_TYPES_SERVICE_TEMPLATE_NAME, GlobalTypesUtil
+ .createServiceTemplateImport(ToscaConstants.NATIVE_TYPES_SERVICE_TEMPLATE_NAME));
+ return importsMap;
+ }
+
+ /**
+ * Create metric capability type capability type.
+ *
+ * @return the capability type
+ */
+ public static CapabilityType createMetricCapabilityType() {
+ CapabilityType capabilityType = new CapabilityType();
+ capabilityType.setDerived_from(ToscaCapabilityType.NFV_METRIC.getDisplayName());
+ capabilityType.setDescription(
+ "A node type that includes the Metric capability indicates that it can be monitored.");
+ capabilityType.setProperties(createCapabilityMetricProperties());
+ capabilityType.setAttributes(createCapabilityMetricAttributes());
+ return capabilityType;
+ }
+
+ private static Map<String, AttributeDefinition> createCapabilityMetricAttributes() {
+ Map<String, AttributeDefinition> attributeDefinitionMap = new HashMap<>();
+
+ attributeDefinitionMap.put("value", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "Runtime monitored value",
+ null, null, null));
+ return attributeDefinitionMap;
+ }
+
+ private static Map<String, PropertyDefinition> createCapabilityMetricProperties() {
+ Map<String, PropertyDefinition> propertyDefinitionMap = new HashMap<>();
+ propertyDefinitionMap.put("type", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "Type of the metric value, for an example, Cumulative, Delta, Gauge and etc.", true,
+ null, null, null, null));
+ propertyDefinitionMap.put("unit", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Unit of the metric value",
+ true, null, null, null, null));
+ propertyDefinitionMap.put("category", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "Category of the metric, for an example, compute, disk, network, storage and etc.",
+ false, null, null, null, null));
+ propertyDefinitionMap.put(Constants.DESCRIPTION_PROPERTY_NAME, DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Description of the metric",
+ false, null, null, null, null));
+ return propertyDefinitionMap;
+ }
+
+ private static Map<String, RelationshipType> createRelationTypes() {
+ Map<String, RelationshipType> globalRelationshipTypes = new HashMap<>();
+ globalRelationshipTypes.put(ToscaRelationshipType.ATTACHES_TO.getDisplayName(),
+ createAttachesToRelationshipType());
+ return globalRelationshipTypes;
+ }
+
+ private static RelationshipType createAttachesToRelationshipType() {
+ RelationshipType attachesToRelationType = new RelationshipType();
+ attachesToRelationType.setDerived_from(ToscaRelationshipType.ROOT.getDisplayName());
+ attachesToRelationType.setDescription("This type represents an attachment relationship");
+ return attachesToRelationType;
+ }
+
+ private static Map<String, PolicyType> createPolicyTypes() {
+ Map<String, PolicyType> globalPolicyTypes = new HashMap<>();
+ globalPolicyTypes
+ .put(ToscaPolicyType.PLACEMENT_ANTILOCATE.getDisplayName(), createAntilocatePolicyType());
+ globalPolicyTypes
+ .put(ToscaPolicyType.PLACEMENT_COLOCATE.getDisplayName(), createColocatePolicyType());
+ globalPolicyTypes.put(ToscaPolicyType.PLACEMENT_VALET_AFFINITY.getDisplayName(),
+ createValetAffinityPolicyType());
+ globalPolicyTypes.put(ToscaPolicyType.PLACEMENT_VALET_DIVERSITY.getDisplayName(),
+ createValetDiversityPolicyType());
+ globalPolicyTypes.put(ToscaPolicyType.PLACEMENT_VALET_EXCLUSIVITY.getDisplayName(),
+ createValetExclusivityPolicyType());
+ return globalPolicyTypes;
+ }
+
+ private static PolicyType createValetDiversityPolicyType() {
+ PolicyType policyType = new PolicyType();
+ policyType.setDerived_from(ToscaPolicyType.PLACEMENT.getDisplayName());
+ policyType.setDescription("Valet Diversity");
+ policyType.setProperties(new HashMap<>());
+ policyType.getProperties().put("level", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "diversity", false,
+ DataModelUtil.createValidValuesConstraintsList("host", "rack"), null, null, "host"));
+
+ return policyType;
+ }
+
+ private static PolicyType createValetExclusivityPolicyType() {
+ PolicyType policyType = new PolicyType();
+ policyType.setDerived_from(ToscaPolicyType.PLACEMENT.getDisplayName());
+ policyType.setDescription("Valet Exclusivity");
+ policyType.setProperties(addNamePropertyToPolicyType());
+ policyType.setProperties(new HashMap<>());
+ policyType.getProperties().put("level", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "exclusivity", false,
+ DataModelUtil.createValidValuesConstraintsList("host", "rack"), null, null, "host"));
+ return policyType;
+ }
+
+ private static PolicyType createValetAffinityPolicyType() {
+ PolicyType policyType = new PolicyType();
+ policyType.setDerived_from(ToscaPolicyType.PLACEMENT.getDisplayName());
+ policyType.setDescription("Valet Affinity");
+ policyType.setProperties(new HashMap<>());
+ policyType.getProperties().put("level", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "affinity", false,
+ DataModelUtil.createValidValuesConstraintsList("host", "rack"), null, null, "host"));
+
+ return policyType;
+ }
+
+
+ private static PolicyType createColocatePolicyType() {
+ PolicyType policyType = new PolicyType();
+ policyType.setDerived_from(ToscaPolicyType.PLACEMENT.getDisplayName());
+ policyType.setDescription("Keep associated nodes (groups of nodes) based upon affinity value");
+ policyType.setProperties(addNamePropertyToPolicyType());
+ policyType.getProperties().put("affinity", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "affinity", true,
+ DataModelUtil.createValidValuesConstraintsList("host", "region", "compute"), null, null,
+ null));
+
+ return policyType;
+ }
+
+ private static PolicyType createAntilocatePolicyType() {
+ PolicyType policyType = new PolicyType();
+ policyType.setDerived_from(ToscaPolicyType.PLACEMENT.getDisplayName());
+ policyType.setDescription("My placement policy for separation based upon container type value");
+ policyType.setProperties(addNamePropertyToPolicyType());
+ policyType.getProperties().put("container_type", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "container type", false,
+ DataModelUtil.createValidValuesConstraintsList("host", "region", "compute"), null, null,
+ null));
+ return policyType;
+ }
+
+ private static Map<String, PropertyDefinition> addNamePropertyToPolicyType() {
+ Map<String, PropertyDefinition> policyTypeProperties = new HashMap<>();
+ policyTypeProperties.put(Constants.NAME_PROPERTY_NAME, DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "The name of the policy",
+ false, null, null, null, null));
+ return policyTypeProperties;
+ }
+
+ private static Map<String, GroupType> createGroupTypes() {
+ Map<String, GroupType> globalGroupTypes = new HashMap<>();
+ globalGroupTypes.put(ToscaGroupType.HEAT_STACK.getDisplayName(), createHeatStackGroupType());
+ return globalGroupTypes;
+ }
+
+ private static GroupType createHeatStackGroupType() {
+ GroupType heatStackGroupType = new GroupType();
+ heatStackGroupType.setDerived_from(ToscaGroupType.ROOT.getDisplayName());
+ heatStackGroupType
+ .setDescription("Grouped all heat resources which are in the same heat stack");
+ heatStackGroupType.setProperties(createHeatStackGroupProperties());
+
+ return heatStackGroupType;
+ }
+
+ private static Map<String, PropertyDefinition> createHeatStackGroupProperties() {
+ Map<String, PropertyDefinition> propertiesDef = new HashMap<>();
+ propertiesDef.put("heat_file", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "Heat file which associate to this group/heat stack", true, null, null, null, null));
+ propertiesDef.put(Constants.DESCRIPTION_PROPERTY_NAME, DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Heat file description",
+ false, null, null, null, null));
+ return propertiesDef;
+ }
+
+
+ /**
+ * Create common service template import import.
+ *
+ * @return the import
+ */
+ public static Import createCommonServiceTemplateImport() {
+ Import commonServiceTemplateImport = new Import();
+ commonServiceTemplateImport
+ .setFile(ToscaUtil.getServiceTemplateFileName(Constants.COMMON_GLOBAL_TEMPLATE_NAME));
+ return commonServiceTemplateImport;
+ }
+
+ private static Map<String, DataType> createGlobalDataTypes() {
+ Map<String, DataType> globalDataTypes = new HashMap<>();
+ globalDataTypes.put(ToscaDataType.NETWORK_ALLOCATION_POOL.getDisplayName(),
+ createAllocationPoolDataType());
+ globalDataTypes
+ .put(ToscaDataType.NETWORK_HOST_ROUTE.getDisplayName(), createHostRouteDataType());
+ globalDataTypes.put(ToscaDataType.NEUTRON_SUBNET.getDisplayName(), createSubnetDataType());
+ globalDataTypes
+ .put(ToscaDataType.NETWORK_ADDRESS_PAIR.getDisplayName(), createAddressPairDataType());
+ globalDataTypes.put(ToscaDataType.CONTRAIL_STATIC_ROUTE.getDisplayName(),
+ createContrailStaticRouteDataType());
+ globalDataTypes.put(ToscaDataType.CONTRAIL_ADDRESS_PAIR.getDisplayName(),
+ createContrailAddressPairDataType());
+ return globalDataTypes;
+ }
+
+ private static DataType createContrailStaticRouteDataType() {
+ DataType dataType = new DataType();
+ dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName());
+ dataType.setDescription("static route");
+ Map<String, PropertyDefinition> prop = new HashMap<>();
+
+ prop.put("prefix", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Route prefix", false, null,
+ null, null, null));
+ prop.put("next_hop", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Next hop", false, null,
+ null, null, null));
+ prop.put("next_hop_type", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Next hop type", false,
+ null, null, null, null));
+
+ dataType.setProperties(prop);
+ return dataType;
+ }
+
+ private static DataType createContrailAddressPairDataType() {
+ DataType dataType = new DataType();
+ dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName());
+ dataType.setDescription("Address Pair");
+ Map<String, PropertyDefinition> prop = new HashMap<>();
+
+ prop.put("prefix", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "IP address prefix", false,
+ null, null, null, null));
+ prop.put("mac_address", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Mac address", false, null,
+ null, null, null));
+ prop.put("address_mode", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "Address mode active-active or active-standy", false,
+ DataModelUtil.createValidValuesConstraintsList("active-active", "active-standby"), null,
+ null, null));
+
+ dataType.setProperties(prop);
+ return dataType;
+ }
+
+ private static DataType createAddressPairDataType() {
+ DataType addressPairDataType = new DataType();
+ addressPairDataType.setDerived_from(ToscaDataType.ROOT.getDisplayName());
+ addressPairDataType.setDescription("MAC/IP address pairs");
+ Map<String, PropertyDefinition> addressPairProp = new HashMap<>();
+
+ addressPairProp.put("ip_address", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "IP address", false, null,
+ null, null, null));
+ addressPairProp.put("mac_address", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "MAC address", false, null,
+ null, null, null));
+ addressPairDataType.setProperties(addressPairProp);
+
+ return addressPairDataType;
+ }
+
+ private static DataType createHostRouteDataType() {
+ DataType hostRouteDataType = new DataType();
+ hostRouteDataType.setDerived_from(ToscaDataType.ROOT.getDisplayName());
+ hostRouteDataType.setDescription("Host route info for the subnet");
+
+ Map<String, PropertyDefinition> hostRoutePoolProp = new HashMap<>();
+ hostRoutePoolProp.put("destination", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "The destination for static route", false, null, null, null, null));
+ hostRoutePoolProp.put("nexthop", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "The next hop for the destination", false, null, null, null, null));
+ hostRouteDataType.setProperties(hostRoutePoolProp);
+
+ return hostRouteDataType;
+ }
+
+ private static DataType createAllocationPoolDataType() {
+ DataType allocationPoolDataType = new DataType();
+ allocationPoolDataType.setDerived_from(ToscaDataType.ROOT.getDisplayName());
+ allocationPoolDataType.setDescription("The start and end addresses for the allocation pool");
+
+ Map<String, PropertyDefinition> allocationPoolProp = new HashMap<>();
+ allocationPoolProp.put("start", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "Start address for the allocation pool", false, null, null, null, null));
+ allocationPoolProp.put("end", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "End address for the allocation pool", false, null, null, null, null));
+ allocationPoolDataType.setProperties(allocationPoolProp);
+
+ return allocationPoolDataType;
+ }
+
+ private static DataType createSubnetDataType() {
+ DataType subnetDataType = new DataType();
+ subnetDataType.setDerived_from(ToscaDataType.ROOT.getDisplayName());
+ subnetDataType.setDescription(
+ "A subnet represents an IP address block that can "
+ + "be used for assigning IP addresses to virtual instances");
+
+ Map<String, PropertyDefinition> subnetProp = new HashMap<>();
+ subnetProp.put("allocation_pools", DataModelUtil
+ .createPropertyDefinition(PropertyType.LIST.getDisplayName(),
+ "The start and end addresses for the allocation pools", false, null, null, DataModelUtil
+ .createEntrySchema(ToscaDataType.NETWORK_ALLOCATION_POOL.getDisplayName(), null,
+ null), null));
+ subnetProp.put("cidr", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "The CIDR", false, null,
+ null, null, null));
+ subnetProp.put("dns_nameservers", DataModelUtil
+ .createPropertyDefinition(PropertyType.LIST.getDisplayName(),
+ "A specified set of DNS name servers to be used", false, null, null,
+ DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null),
+ new ArrayList<String>()));
+ subnetProp.put("enable_dhcp", DataModelUtil
+ .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(),
+ "Set to true if DHCP is enabled and false if DHCP is disabled", false, null, null, null,
+ true));
+ subnetProp.put("gateway_ip", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "The gateway IP address",
+ false, null, null, null, null));
+ subnetProp.put("host_routes", DataModelUtil
+ .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "The gateway IP address",
+ false, null, null, DataModelUtil
+ .createEntrySchema(ToscaDataType.NETWORK_HOST_ROUTE.getDisplayName(), null, null),
+ null));
+ subnetProp.put("ip_version", DataModelUtil
+ .createPropertyDefinition(PropertyType.INTEGER.getDisplayName(), "The gateway IP address",
+ false, DataModelUtil.createValidValuesConstraintsList("4", "6"), null, null, 4));
+ subnetProp.put("ipv6_address_mode", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "IPv6 address mode", false,
+ DataModelUtil
+ .createValidValuesConstraintsList("dhcpv6-stateful", "dhcpv6-stateless", "slaac"),
+ null, null, null));
+ subnetProp.put("ipv6_ra_mode", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "IPv6 RA (Router Advertisement) mode", false, DataModelUtil
+ .createValidValuesConstraintsList("dhcpv6-stateful", "dhcpv6-stateless", "slaac"),
+ null, null, null));
+ subnetProp.put(Constants.NAME_PROPERTY_NAME, DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "The name of the subnet",
+ false, null, null, null, null));
+ subnetProp.put("prefixlen", DataModelUtil
+ .createPropertyDefinition(PropertyType.INTEGER.getDisplayName(),
+ "Prefix length for subnet allocation from subnet pool", false,
+ createPrefixlenConstraint(), null, null, null));
+ subnetProp.put("subnetpool", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "The name or ID of the subnet pool", false, null, null, null, null));
+ subnetProp.put("tenant_id", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "The ID of the tenant who owns the network", false, null, null, null, null));
+ subnetProp.put("value_specs", DataModelUtil
+ .createPropertyDefinition(PropertyType.MAP.getDisplayName(),
+ "Extra parameters to include in the request", false, null, null,
+ DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null),
+ new HashMap<>()));
+ subnetDataType.setProperties(subnetProp);
+
+ return subnetDataType;
+ }
+
+ private static List<Constraint> createPrefixlenConstraint() {
+ List<Constraint> constraints = new ArrayList<>();
+ Constraint constraint = new Constraint();
+ constraint.setGreater_or_equal(0);
+ constraints.add(constraint);
+ return constraints;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailAbstractSubstituteGlobalType.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailAbstractSubstituteGlobalType.java
new file mode 100644
index 0000000000..7b0b810b61
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailAbstractSubstituteGlobalType.java
@@ -0,0 +1,196 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.globaltypes;
+
+import org.openecomp.sdc.tosca.datatypes.ToscaDataType;
+import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
+import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.DataType;
+import org.openecomp.sdc.tosca.datatypes.model.NodeType;
+import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.PropertyType;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.tosca.services.DataModelUtil;
+import org.openecomp.sdc.tosca.services.ToscaConstants;
+import org.openecomp.sdc.translator.services.heattotosca.Constants;
+
+import java.util.HashMap;
+import java.util.Map;
+
+
+public class ContrailAbstractSubstituteGlobalType {
+
+ /**
+ * Create service template service template.
+ *
+ * @return the service template
+ */
+ public static ServiceTemplate createServiceTemplate() {
+ ServiceTemplate serviceTemplate = new ServiceTemplate();
+ serviceTemplate.setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION);
+ serviceTemplate.setMetadata(
+ DataModelUtil.createMetadata(Constants
+ .CONTRAIL_ABSTRACT_SUBSTITUTE_TEMPLATE_NAME, "1.0.0", null));
+ serviceTemplate.setImports(GlobalTypesUtil.createCommonImportList());
+ serviceTemplate.setDescription("Contrail Abstract Substitute Global Types");
+ serviceTemplate.setData_types(createGlobalDataTypes());
+ serviceTemplate.setNode_types(createGlobalNodeTypes());
+ return serviceTemplate;
+ }
+
+ private static Map<String, NodeType> createGlobalNodeTypes() {
+ Map<String, NodeType> globalNodeTypes = new HashMap<>();
+ globalNodeTypes.put(ToscaNodeType.CONTRAIL_ABSTRACT_SUBSTITUTE.getDisplayName(),
+ createContrailAbstractSubstituteNodeType());
+ return globalNodeTypes;
+ }
+
+ private static NodeType createContrailAbstractSubstituteNodeType() {
+ NodeType nodeType = new NodeType();
+ nodeType.setDerived_from(ToscaNodeType.ABSTRACT_SUBSTITUTE.getDisplayName());
+ nodeType.setProperties(createContrailAbstractSubstituteProperties());
+ nodeType.setAttributes(createContrailAbstractSubstituteAttributes());
+
+ return nodeType;
+ }
+
+ private static Map<String, AttributeDefinition> createContrailAbstractSubstituteAttributes() {
+ Map<String, AttributeDefinition> attributesDefMap = new HashMap<>();
+ attributesDefMap.put("service_instance_name", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(),
+ "The name of the service instance", null, null, null));
+ attributesDefMap.put("fq_name", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(),
+ "The FQ name of the service instance", null, null, null));
+ attributesDefMap.put("status", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(),
+ "Status of the service instance", null, null, null));
+ attributesDefMap.put("service_template_name", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(),
+ "Service Template of the Service Instance", null, null, null));
+ attributesDefMap.put("virtual_machines", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(),
+ "Service VMs for the Service Instance", null, null, null));
+ attributesDefMap.put("active_vms", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(),
+ "Number of service VMs active for this Service Instance", null, null, null));
+ attributesDefMap.put("tenant_id", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(),
+ "Tenant id of the Service Instance", null, null, null));
+ attributesDefMap.put("show", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "All attributes", null,
+ null, null));
+
+ return attributesDefMap;
+ }
+
+ private static Map<String, PropertyDefinition> createContrailAbstractSubstituteProperties() {
+ Map<String, PropertyDefinition> props = new HashMap<>();
+ props.put("service_template_name", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Service template name",
+ false, null, null, null, null));
+ props.put("service_mode", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Service mode", true,
+ DataModelUtil
+ .createValidValuesConstraintsList("transparent", "in-network", "in-network-nat"),
+ null, null, null));
+ props.put("service_type", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Service type", true,
+ DataModelUtil.createValidValuesConstraintsList("firewall", "analyzer", "source-nat",
+ "loadbalancer"), null, null, null));
+ props.put("image_name", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Image name", true, null,
+ null, null, null));
+ props.put("flavor", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "flavor", false, null, null,
+ null, null));
+ props.put("service_interface_type_list", DataModelUtil
+ .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "List of interface types",
+ true, null, null, DataModelUtil
+ .createEntrySchema(PropertyType.STRING.getDisplayName(), null, DataModelUtil
+ .createValidValuesConstraintsList("management", "left", "right", "other")),
+ null));
+ props.put("shared_ip_list", DataModelUtil
+ .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "Shared ips enabled", false,
+ null, null,
+ DataModelUtil.createEntrySchema(PropertyType.BOOLEAN.getDisplayName(), null, null),
+ null));
+ props.put("static_routes_list", DataModelUtil
+ .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "Static routes enabled",
+ false, null, null,
+ DataModelUtil.createEntrySchema(PropertyType.BOOLEAN.getDisplayName(), null, null),
+ null));
+ props.put("ordered_interfaces", DataModelUtil
+ .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(),
+ "Indicates if service interface are ordered", false, null, null, null, false));
+ props.put("availability_zone_enable", DataModelUtil
+ .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(),
+ "Indicates availability zone is enabled", false, null, null, null, false));
+ props.put("availability_zone", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "Availability zone to create servers in", false, null, null, null, null));
+ props.put("service_instance_name", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Service instance name",
+ true, null, null, null, null));
+ props.put("interface_list", DataModelUtil
+ .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "List of interfaces", false,
+ null, null, DataModelUtil
+ .createEntrySchema(ToscaDataType.CONTRAIL_INTERFACE_DATA.getDisplayName(), null,
+ null), null));
+ return props;
+ }
+
+
+ private static Map<String, DataType> createGlobalDataTypes() {
+ Map<String, DataType> globalDataTypes = new HashMap<>();
+ globalDataTypes
+ .put(ToscaDataType.CONTRAIL_INTERFACE_DATA.getDisplayName(), createInterfaceDataType());
+ return globalDataTypes;
+ }
+
+ private static DataType createInterfaceDataType() {
+ DataType dataType = new DataType();
+ dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName());
+ dataType.setDescription("Interface Data");
+ Map<String, PropertyDefinition> propertyDefMap = new HashMap<>();
+ propertyDefMap.put("virtual_network", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "Virtual Network for this interface", true, null, null, null, null));
+ propertyDefMap.put("ip_address", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "IP for this interface",
+ false, null, null, null, null));
+ propertyDefMap.put("static_routes", DataModelUtil
+ .createPropertyDefinition(PropertyType.LIST.getDisplayName(),
+ "An ordered list of static routes to be added to this interface", false, null, null,
+ DataModelUtil
+ .createEntrySchema(ToscaDataType.CONTRAIL_STATIC_ROUTE.getDisplayName(), null,
+ null), null));
+ propertyDefMap.put("allowed_address_pairs", DataModelUtil
+ .createPropertyDefinition(PropertyType.LIST.getDisplayName(),
+ "List of allowed address pair for this interface", false, null, null, DataModelUtil
+ .createEntrySchema(ToscaDataType.CONTRAIL_ADDRESS_PAIR.getDisplayName(), null,
+ null), null));
+ dataType.setProperties(propertyDefMap);
+ return dataType;
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailComputeGlobalType.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailComputeGlobalType.java
new file mode 100644
index 0000000000..50faec0c69
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailComputeGlobalType.java
@@ -0,0 +1,128 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.globaltypes;
+
+import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
+import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.NodeType;
+import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.PropertyType;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.tosca.services.DataModelUtil;
+import org.openecomp.sdc.tosca.services.ToscaConstants;
+import org.openecomp.sdc.translator.services.heattotosca.Constants;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class ContrailComputeGlobalType {
+
+ /**
+ * Create service template service template.
+ *
+ * @return the service template
+ */
+ public static ServiceTemplate createServiceTemplate() {
+ ServiceTemplate serviceTemplate = new ServiceTemplate();
+ serviceTemplate.setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION);
+ serviceTemplate.setMetadata(
+ DataModelUtil.createMetadata(Constants.CONTRAIL_COMPUTE_TEMPLATE_NAME, "1.0.0", null));
+ serviceTemplate.setDescription("Contrail Compute TOSCA Global Types");
+ serviceTemplate.setImports(GlobalTypesUtil.createCommonImportList());
+ serviceTemplate.setNode_types(createGlobalNodeTypes());
+ return serviceTemplate;
+ }
+
+
+ private static Map<String, NodeType> createGlobalNodeTypes() {
+ Map<String, NodeType> globalNodeTypes = new HashMap<>();
+ globalNodeTypes
+ .put(ToscaNodeType.CONTRAIL_COMPUTE.getDisplayName(), createContrailComputeNodeType());
+ return globalNodeTypes;
+ }
+
+ private static NodeType createContrailComputeNodeType() {
+ NodeType nodeType = new NodeType();
+ nodeType.setDerived_from(ToscaNodeType.COMPUTE.getDisplayName());
+ nodeType.setProperties(createContrailComputeProperties());
+ nodeType.setAttributes(createContrailComputeAttributes());
+ return nodeType;
+ }
+
+
+ private static Map<String, PropertyDefinition> createContrailComputeProperties() {
+ Map<String, PropertyDefinition> propertyDefMap = new HashMap<>();
+ propertyDefMap.put("service_instance_name", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Service instance name",
+ true, null, null, null, null));
+ propertyDefMap.put("service_template_name", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Service template name",
+ false, null, null, null, null));
+ propertyDefMap.put("image_name", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Image name", true, null,
+ null, null, null));
+ propertyDefMap.put("service_mode", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Service mode", true,
+ DataModelUtil
+ .createValidValuesConstraintsList("transparent", "in-network", "in-network-nat"),
+ null, null, null));
+ propertyDefMap.put("service_type", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Service type", true,
+ DataModelUtil.createValidValuesConstraintsList("firewall", "analyzer", "source-nat",
+ "loadbalancer"), null, null, null));
+ propertyDefMap.put("image_name", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Image name", true, null,
+ null, null, null));
+ propertyDefMap.put("flavor", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "flavor", false, null, null,
+ null, null));
+ propertyDefMap.put("availability_zone_enable", DataModelUtil
+ .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(),
+ "Indicates availability zone is enabled", false, null, null, null, false));
+ propertyDefMap.put("availability_zone", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "Availability zone to create servers in", false, null, null, null, null));
+ return propertyDefMap;
+ }
+
+ private static Map<String, AttributeDefinition> createContrailComputeAttributes() {
+ Map<String, AttributeDefinition> attributesDefMap = new HashMap<>();
+ attributesDefMap.put("fq_name", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "fq_name", null, null,
+ null));
+ attributesDefMap.put("status", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "status of the compute",
+ null, null, null));
+ attributesDefMap.put("virtual_machines", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "VMs of this compute",
+ null, null, null));
+ attributesDefMap.put("active_vms", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "Number of active VMs",
+ null, null, null));
+ attributesDefMap.put("tenant_id", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "Tenant id of the VM",
+ null, null, null));
+ attributesDefMap.put("show", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "All attributes", null,
+ null, null));
+ return attributesDefMap;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailNetworkRuleGlobalType.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailNetworkRuleGlobalType.java
new file mode 100644
index 0000000000..0081ad5a78
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailNetworkRuleGlobalType.java
@@ -0,0 +1,227 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.globaltypes;
+
+import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType;
+import org.openecomp.sdc.tosca.datatypes.ToscaDataType;
+import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
+import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType;
+import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.DataType;
+import org.openecomp.sdc.tosca.datatypes.model.NodeType;
+import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.PropertyType;
+import org.openecomp.sdc.tosca.datatypes.model.RequirementDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.tosca.services.DataModelUtil;
+import org.openecomp.sdc.tosca.services.ToscaConstants;
+import org.openecomp.sdc.translator.services.heattotosca.Constants;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class ContrailNetworkRuleGlobalType {
+ /**
+ * Create service template service template.
+ *
+ * @return the service template
+ */
+ public static ServiceTemplate createServiceTemplate() {
+ ServiceTemplate contrailNetworkRuleServiceTemplate = new ServiceTemplate();
+ contrailNetworkRuleServiceTemplate
+ .setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION);
+ contrailNetworkRuleServiceTemplate.setMetadata(
+ DataModelUtil.createMetadata(Constants.CONTRAIL_NETWORK_RULE_TEMPLATE_NAME, "1.0.0", null));
+ contrailNetworkRuleServiceTemplate.setImports(GlobalTypesUtil.createCommonImportList());
+ contrailNetworkRuleServiceTemplate.setDescription("Contrail Network Rule Global Types");
+ contrailNetworkRuleServiceTemplate.setData_types(createGlobalDataTypes());
+ contrailNetworkRuleServiceTemplate.setNode_types(createGlobalNodeTypes());
+ return contrailNetworkRuleServiceTemplate;
+ }
+
+
+ private static Map<String, DataType> createGlobalDataTypes() {
+ Map<String, DataType> globalDataTypes = new HashMap<>();
+ globalDataTypes.put(ToscaDataType.CONTRAIL_NETWORK_RULE_PORT_PAIRS.getDisplayName(),
+ createRulePortPairsDataType());
+ globalDataTypes.put(ToscaDataType.CONTRAIL_NETWORK_RULE.getDisplayName(), createRuleDataType());
+ globalDataTypes.put(ToscaDataType.CONTRAIL_NETWORK_RULE_VIRTUAL_NETWORK.getDisplayName(),
+ createRuleVirtualNetworkDataType());
+ globalDataTypes.put(ToscaDataType.CONTRAIL_NETWORK_RULE_LIST.getDisplayName(),
+ createPolicyRulesListDataType());
+ return globalDataTypes;
+ }
+
+ private static DataType createRuleDataType() {
+ DataType dataType = new DataType();
+ dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName());
+ dataType.setDescription("policy rule");
+ Map<String, PropertyDefinition> properties = new HashMap<>();
+ properties.put("direction", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Direction", false, null,
+ null, null, null));
+ properties.put("protocol", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Protocol", false, null,
+ null, null, null));
+ properties.put("src_ports", DataModelUtil
+ .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "Source ports", false, null,
+ null, DataModelUtil
+ .createEntrySchema(ToscaDataType.CONTRAIL_NETWORK_RULE_PORT_PAIRS.getDisplayName(),
+ null, null), null));
+ properties.put("dst_ports", DataModelUtil
+ .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "Destination ports", false,
+ null, null, DataModelUtil
+ .createEntrySchema(ToscaDataType.CONTRAIL_NETWORK_RULE_PORT_PAIRS.getDisplayName(),
+ null, null), null));
+ properties.put("dst_addresses", DataModelUtil
+ .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "Destination addresses",
+ false, null, null, DataModelUtil.createEntrySchema(
+ ToscaDataType.CONTRAIL_NETWORK_RULE_VIRTUAL_NETWORK.getDisplayName(), null, null),
+ null));
+ properties.put("apply_service", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Service to apply", false,
+ null, null, null, null));
+ properties.put("src_addresses", DataModelUtil
+ .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "Source addresses", false,
+ null, null, DataModelUtil.createEntrySchema(
+ ToscaDataType.CONTRAIL_NETWORK_RULE_VIRTUAL_NETWORK.getDisplayName(), null, null),
+ null));
+
+ dataType.setProperties(properties);
+ return dataType;
+
+ }
+
+
+ private static DataType createRuleVirtualNetworkDataType() {
+ DataType dataType = new DataType();
+ dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName());
+ dataType.setDescription("source and destination addresses");
+ Map<String, PropertyDefinition> properties = new HashMap<>();
+
+ properties.put("virtual_network", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Virtual network", false,
+ null, null, null, null));
+
+ dataType.setProperties(properties);
+ return dataType;
+ }
+
+ private static DataType createPolicyRulesListDataType() {
+ DataType dataType = new DataType();
+ dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName());
+ dataType.setDescription("list of policy rules");
+ Map<String, PropertyDefinition> properties = new HashMap<>();
+
+ properties.put("policy_rule", DataModelUtil
+ .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "Contrail network rule",
+ false, null, null, DataModelUtil
+ .createEntrySchema(ToscaDataType.CONTRAIL_NETWORK_RULE.getDisplayName(), null,
+ null), null));
+
+ dataType.setProperties(properties);
+ return dataType;
+ }
+
+
+ private static DataType createRulePortPairsDataType() {
+ DataType dataType = new DataType();
+ dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName());
+ dataType.setDescription("source and destination port pairs");
+ Map<String, PropertyDefinition> properties = new HashMap<>();
+
+ properties.put("start_port", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Start port", false, null,
+ null, null, null));
+ properties.put("end_port", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "End port", false, null,
+ null, null, null));
+
+ dataType.setProperties(properties);
+ return dataType;
+ }
+
+ private static Map<String, NodeType> createGlobalNodeTypes() {
+ Map<String, NodeType> globalNodeTypes = new HashMap<>();
+ globalNodeTypes.put(ToscaNodeType.CONTRAIL_NETWORK_RULE.getDisplayName(),
+ createContrailNetworkRuleNodeType());
+ return globalNodeTypes;
+ }
+
+ private static NodeType createContrailNetworkRuleNodeType() {
+ NodeType contrailNetworkRuleNodeType = new NodeType();
+ contrailNetworkRuleNodeType.setDerived_from(ToscaNodeType.ROOT.getDisplayName());
+ contrailNetworkRuleNodeType.setProperties(createContrailNetworkRuleProperties());
+ contrailNetworkRuleNodeType.setAttributes(createContrailNetworkRuleAttributes());
+ contrailNetworkRuleNodeType.setRequirements(createContrailNetworkRuleRequirements());
+ return contrailNetworkRuleNodeType;
+ }
+
+
+ private static Map<String, PropertyDefinition> createContrailNetworkRuleProperties() {
+ Map<String, PropertyDefinition> contrailNetworkRulePropertyDefMap = new HashMap<>();
+ contrailNetworkRulePropertyDefMap.put(Constants.NAME_PROPERTY_NAME, DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "A symbolic name for this contrail network rule", false, null, null, null, null));
+ contrailNetworkRulePropertyDefMap.put("entries", DataModelUtil
+ .createPropertyDefinition(ToscaDataType.CONTRAIL_NETWORK_RULE_LIST.getDisplayName(),
+ "A symbolic name for this contrail network rule", false, null, null, null, null));
+
+ return contrailNetworkRulePropertyDefMap;
+ }
+
+
+ private static Map<String, AttributeDefinition> createContrailNetworkRuleAttributes() {
+ Map<String, AttributeDefinition> contrailNetworkRuleAttributesDefMap = new HashMap<>();
+ contrailNetworkRuleAttributesDefMap.put("fq_name", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "fq_name", null, null,
+ null));
+ contrailNetworkRuleAttributesDefMap.put("tenant_id", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "tenant_id", null, null,
+ null));
+ contrailNetworkRuleAttributesDefMap.put("rules", DataModelUtil
+ .createAttributeDefinition(PropertyType.LIST.getDisplayName(), "List of rules", null,
+ DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null),
+ null));
+ contrailNetworkRuleAttributesDefMap.put("show", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "All attributes.", null,
+ null, null));
+
+ return contrailNetworkRuleAttributesDefMap;
+ }
+
+ private static List<Map<String, RequirementDefinition>> createContrailNetworkRuleRequirements() {
+ final List<Map<String, RequirementDefinition>> requirements = new ArrayList<>();
+ final Map<String, RequirementDefinition>
+ contrailNetworkRuleRequirementsDefMap = new HashMap<>();
+ RequirementDefinition req = new RequirementDefinition();
+ req.setCapability(ToscaCapabilityType.ATTACHMENT.getDisplayName());
+ req.setOccurrences(new Object[]{0, ToscaConstants.UNBOUNDED});
+ req.setNode(ToscaNodeType.NETWORK.getDisplayName());
+ req.setRelationship(ToscaRelationshipType.ATTACHES_TO.getDisplayName());
+ contrailNetworkRuleRequirementsDefMap.put("network", req);
+ requirements.add(contrailNetworkRuleRequirementsDefMap);
+
+ return requirements;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailPortGlobalType.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailPortGlobalType.java
new file mode 100644
index 0000000000..1590372813
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailPortGlobalType.java
@@ -0,0 +1,107 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.globaltypes;
+
+import org.openecomp.sdc.tosca.datatypes.ToscaDataType;
+import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
+import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.NodeType;
+import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.PropertyType;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.tosca.services.DataModelUtil;
+import org.openecomp.sdc.tosca.services.ToscaConstants;
+import org.openecomp.sdc.translator.services.heattotosca.Constants;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class ContrailPortGlobalType {
+ /**
+ * Create service template service template.
+ *
+ * @return the service template
+ */
+ public static ServiceTemplate createServiceTemplate() {
+ ServiceTemplate serviceTemplate = new ServiceTemplate();
+ serviceTemplate.setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION);
+ serviceTemplate.setMetadata(
+ DataModelUtil.createMetadata(Constants.CONTRAIL_PORT_TEMPLATE_NAME, "1.0.0", null));
+ serviceTemplate.setImports(GlobalTypesUtil.createCommonImportList());
+ serviceTemplate.setDescription("Contrail Port TOSCA Global Types");
+ serviceTemplate.setNode_types(createGlobalNodeTypes());
+ return serviceTemplate;
+ }
+
+ private static Map<String, NodeType> createGlobalNodeTypes() {
+ Map<String, NodeType> globalNodeTypes = new HashMap<>();
+ globalNodeTypes.put(ToscaNodeType.CONTRAIL_PORT.getDisplayName(), createContrailPortNodeType());
+ return globalNodeTypes;
+ }
+
+ private static NodeType createContrailPortNodeType() {
+ NodeType nodeType = new NodeType();
+ nodeType.setDerived_from(ToscaNodeType.NETWORK_PORT.getDisplayName());
+ nodeType.setProperties(createContrailPortProperties());
+ nodeType.setAttributes(createContrailPortAttributes());
+ return nodeType;
+ }
+
+ private static Map<String, PropertyDefinition> createContrailPortProperties() {
+ Map<String, PropertyDefinition> propertyDefMap = new HashMap<>();
+ propertyDefMap.put("interface_type", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Interface type", true,
+ DataModelUtil.createValidValuesConstraintsList("management", "left", "right", "other"),
+ null, null, null));
+ propertyDefMap.put("shared_ip", DataModelUtil
+ .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(), "Shared ip enabled", false,
+ null, null, null, false));
+ propertyDefMap.put("static_route", DataModelUtil
+ .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(), "Static route enabled",
+ false, null, null, null, false));
+ propertyDefMap.put("virtual_network", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "Virtual Network for this interface", true, null, null, null, null));
+ propertyDefMap.put("static_routes", DataModelUtil
+ .createPropertyDefinition(PropertyType.LIST.getDisplayName(),
+ "An ordered list of static routes to be added to this interface", false, null, null,
+ DataModelUtil
+ .createEntrySchema(ToscaDataType.CONTRAIL_STATIC_ROUTE.getDisplayName(), null,
+ null), null));
+ propertyDefMap.put("allowed_address_pairs", DataModelUtil
+ .createPropertyDefinition(PropertyType.LIST.getDisplayName(),
+ "List of allowed address pair for this interface", false, null, null, DataModelUtil
+ .createEntrySchema(ToscaDataType.CONTRAIL_ADDRESS_PAIR.getDisplayName(), null,
+ null), null));
+ propertyDefMap.put("ip_address", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "IP for this interface",
+ false, null, null, null, null));
+ return propertyDefMap;
+ }
+
+ private static Map<String, AttributeDefinition> createContrailPortAttributes() {
+ Map<String, AttributeDefinition> attributesDefMap = new HashMap<>();
+ attributesDefMap.put("fq_name", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "fq_name", null, null,
+ null));
+ return attributesDefMap;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailV2NetworkRuleGlobalType.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailV2NetworkRuleGlobalType.java
new file mode 100644
index 0000000000..4141aa7f0a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailV2NetworkRuleGlobalType.java
@@ -0,0 +1,274 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.globaltypes;
+
+import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType;
+import org.openecomp.sdc.tosca.datatypes.ToscaDataType;
+import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
+import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType;
+import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.DataType;
+import org.openecomp.sdc.tosca.datatypes.model.NodeType;
+import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.PropertyType;
+import org.openecomp.sdc.tosca.datatypes.model.RequirementDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.tosca.services.DataModelUtil;
+import org.openecomp.sdc.tosca.services.ToscaConstants;
+import org.openecomp.sdc.translator.services.heattotosca.Constants;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class ContrailV2NetworkRuleGlobalType {
+ /**
+ * Create service template service template.
+ *
+ * @return the service template
+ */
+ public static ServiceTemplate createServiceTemplate() {
+ ServiceTemplate contrailNetworkRuleServiceTemplate = new ServiceTemplate();
+ contrailNetworkRuleServiceTemplate
+ .setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION);
+ contrailNetworkRuleServiceTemplate.setMetadata(
+ DataModelUtil.createMetadata(Constants
+ .CONTRAILV2_NETWORK_RULE_TEMPLATE_NAME, "1.0.0", null));
+ contrailNetworkRuleServiceTemplate.setImports(GlobalTypesUtil.createCommonImportList());
+ contrailNetworkRuleServiceTemplate.setDescription("Contrail V2 Network Rule Global Types");
+ contrailNetworkRuleServiceTemplate.setData_types(createGlobalDataTypes());
+ contrailNetworkRuleServiceTemplate.setNode_types(createGlobalNodeTypes());
+ return contrailNetworkRuleServiceTemplate;
+ }
+
+
+ private static Map<String, DataType> createGlobalDataTypes() {
+ Map<String, DataType> globalDataTypes = new HashMap<>();
+ globalDataTypes.put(ToscaDataType.CONTRAILV2_NETWORK_RULE_SRC_PORT_PAIRS.getDisplayName(),
+ createRuleSrcPortPairsDataType());
+ globalDataTypes.put(ToscaDataType.CONTRAILV2_NETWORK_RULE_DST_PORT_PAIRS.getDisplayName(),
+ createRuleDstPortPairsDataType());
+ globalDataTypes
+ .put(ToscaDataType.CONTRAILV2_NETWORK_RULE.getDisplayName(), createRuleDataType());
+ globalDataTypes.put(ToscaDataType.CONTRAILV2_NETWORK_RULE_DST_VIRTUAL_NETWORK.getDisplayName(),
+ createRuleDstVirtualNetworkDataType());
+ globalDataTypes.put(ToscaDataType.CONTRAILV2_NETWORK_RULE_SRC_VIRTUAL_NETWORK.getDisplayName(),
+ createRuleSrcVirtualNetworkDataType());
+ globalDataTypes.put(ToscaDataType.CONTRAILV2_NETWORK_RULE_LIST.getDisplayName(),
+ createPolicyRulesListDataType());
+ globalDataTypes.put(ToscaDataType.CONTRAILV2_NETWORK_RULE_ACTION_LIST.getDisplayName(),
+ createRuleActionListDataType());
+ return globalDataTypes;
+ }
+
+ private static DataType createRuleDataType() {
+ DataType dataType = new DataType();
+ dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName());
+ dataType.setDescription("policy rule");
+ Map<String, PropertyDefinition> properties = new HashMap<>();
+ properties.put("network_policy_entries_policy_rule_direction", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Direction", false, null,
+ null, null, null));
+ properties.put("network_policy_entries_policy_rule_protocol", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Protocol", false, null,
+ null, null, null));
+ properties.put("network_policy_entries_policy_rule_src_ports", DataModelUtil
+ .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "Source ports", false, null,
+ null, DataModelUtil.createEntrySchema(
+ ToscaDataType.CONTRAILV2_NETWORK_RULE_SRC_PORT_PAIRS.getDisplayName(), null, null),
+ null));
+ properties.put("network_policy_entries_policy_rule_dst_ports", DataModelUtil
+ .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "Destination ports", false,
+ null, null, DataModelUtil.createEntrySchema(
+ ToscaDataType.CONTRAILV2_NETWORK_RULE_DST_PORT_PAIRS.getDisplayName(), null, null),
+ null));
+ properties.put("network_policy_entries_policy_rule_dst_addresses", DataModelUtil
+ .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "Destination addresses",
+ false, null, null, DataModelUtil.createEntrySchema(
+ ToscaDataType.CONTRAILV2_NETWORK_RULE_DST_VIRTUAL_NETWORK.getDisplayName(), null,
+ null), null));
+ properties.put("network_policy_entries_policy_rule_src_addresses", DataModelUtil
+ .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "Source addresses", false,
+ null, null, DataModelUtil.createEntrySchema(
+ ToscaDataType.CONTRAILV2_NETWORK_RULE_SRC_VIRTUAL_NETWORK.getDisplayName(), null,
+ null), null));
+ properties.put("network_policy_entries_policy_rule_action_list", DataModelUtil
+ .createPropertyDefinition(
+ ToscaDataType.CONTRAILV2_NETWORK_RULE_ACTION_LIST.getDisplayName(), "Action list",
+ false, null, null, null, null));
+
+ dataType.setProperties(properties);
+ return dataType;
+
+ }
+
+
+ private static DataType createRuleDstVirtualNetworkDataType() {
+ DataType dataType = new DataType();
+ dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName());
+ dataType.setDescription("destination addresses");
+ Map<String, PropertyDefinition> properties = new HashMap<>();
+
+ properties.put("network_policy_entries_policy_rule_dst_addresses_virtual_network", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "Destination addresses Virtual network", false, null, null, null, null));
+
+ dataType.setProperties(properties);
+ return dataType;
+ }
+
+ private static DataType createRuleSrcVirtualNetworkDataType() {
+ DataType dataType = new DataType();
+ dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName());
+ dataType.setDescription("source addresses");
+ Map<String, PropertyDefinition> properties = new HashMap<>();
+
+ properties.put("network_policy_entries_policy_rule_src_addresses_virtual_network", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "Source addresses Virtual network", false, null, null, null, null));
+
+ dataType.setProperties(properties);
+ return dataType;
+ }
+
+ private static DataType createPolicyRulesListDataType() {
+ DataType dataType = new DataType();
+ dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName());
+ dataType.setDescription("list of policy rules");
+ Map<String, PropertyDefinition> properties = new HashMap<>();
+
+ properties.put("network_policy_entries_policy_rule", DataModelUtil
+ .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "Contrail network rule",
+ false, null, null, DataModelUtil
+ .createEntrySchema(ToscaDataType.CONTRAILV2_NETWORK_RULE.getDisplayName(), null,
+ null), null));
+
+ dataType.setProperties(properties);
+ return dataType;
+ }
+
+ private static DataType createRuleActionListDataType() {
+ DataType dataType = new DataType();
+ dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName());
+ dataType.setDescription("Action List");
+ Map<String, PropertyDefinition> properties = new HashMap<>();
+
+ properties.put("network_policy_entries_policy_rule_action_list_simple_action", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Simple Action", false,
+ null, null, null, null));
+ properties.put("network_policy_entries_policy_rule_action_list_apply_service", DataModelUtil
+ .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "Apply Service", false, null,
+ null, DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null),
+ null));
+
+ dataType.setProperties(properties);
+ return dataType;
+ }
+
+ private static DataType createRuleDstPortPairsDataType() {
+ DataType dataType = new DataType();
+ dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName());
+ dataType.setDescription("destination port pairs");
+ Map<String, PropertyDefinition> properties = new HashMap<>();
+
+ properties.put("network_policy_entries_policy_rule_dst_ports_start_port", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Start port", false, null,
+ null, null, null));
+ properties.put("network_policy_entries_policy_rule_dst_ports_end_port", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "End port", false, null,
+ null, null, null));
+
+ dataType.setProperties(properties);
+ return dataType;
+ }
+
+ private static DataType createRuleSrcPortPairsDataType() {
+ DataType dataType = new DataType();
+ dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName());
+ dataType.setDescription("source port pairs");
+ Map<String, PropertyDefinition> properties = new HashMap<>();
+
+ properties.put("network_policy_entries_policy_rule_src_ports_start_port", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Start port", false, null,
+ null, null, null));
+ properties.put("network_policy_entries_policy_rule_src_ports_end_port", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "End port", false, null,
+ null, null, null));
+
+ dataType.setProperties(properties);
+ return dataType;
+ }
+
+ private static Map<String, NodeType> createGlobalNodeTypes() {
+ Map<String, NodeType> globalNodeTypes = new HashMap<>();
+ globalNodeTypes.put(ToscaNodeType.CONTRAILV2_NETWORK_RULE.getDisplayName(),
+ createContrailV2NetworkRuleNodeType());
+ return globalNodeTypes;
+ }
+
+ private static NodeType createContrailV2NetworkRuleNodeType() {
+ NodeType contrailNetworkRuleNodeType = new NodeType();
+ contrailNetworkRuleNodeType.setDerived_from(ToscaNodeType.ROOT.getDisplayName());
+ contrailNetworkRuleNodeType.setProperties(createContrailNetworkRuleProperties());
+ contrailNetworkRuleNodeType.setAttributes(createContrailNetworkRuleAttributes());
+ contrailNetworkRuleNodeType.setRequirements(createContrailNetworkRuleRequirements());
+ return contrailNetworkRuleNodeType;
+ }
+
+
+ private static Map<String, PropertyDefinition> createContrailNetworkRuleProperties() {
+ Map<String, PropertyDefinition> contrailNetworkRulePropertyDefMap = new HashMap<>();
+ contrailNetworkRulePropertyDefMap.put(Constants.NAME_PROPERTY_NAME, DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "A symbolic name for this contrail v2 network rule", false, null, null, null, null));
+ contrailNetworkRulePropertyDefMap.put("network_policy_entries", DataModelUtil
+ .createPropertyDefinition(ToscaDataType.CONTRAILV2_NETWORK_RULE_LIST.getDisplayName(),
+ "A symbolic name for this contrail v2 network rule", false, null, null, null, null));
+
+ return contrailNetworkRulePropertyDefMap;
+ }
+
+
+ private static Map<String, AttributeDefinition> createContrailNetworkRuleAttributes() {
+ Map<String, AttributeDefinition> contrailNetworkRuleAttributesDefMap = new HashMap<>();
+ contrailNetworkRuleAttributesDefMap.put("fq_name", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "fq_name", null, null,
+ null));
+
+ return contrailNetworkRuleAttributesDefMap;
+ }
+
+ private static List<Map<String, RequirementDefinition>> createContrailNetworkRuleRequirements() {
+ final List<Map<String, RequirementDefinition>> requirements = new ArrayList<>();
+ final Map<String, RequirementDefinition>
+ contrailNetworkRuleRequirementsDefMap = new HashMap<>();
+ RequirementDefinition req = new RequirementDefinition();
+ req.setCapability(ToscaCapabilityType.ATTACHMENT.getDisplayName());
+ req.setOccurrences(new Object[]{0, ToscaConstants.UNBOUNDED});
+ req.setNode(ToscaNodeType.NETWORK.getDisplayName());
+ req.setRelationship(ToscaRelationshipType.ATTACHES_TO.getDisplayName());
+ contrailNetworkRuleRequirementsDefMap.put("network", req);
+ requirements.add(contrailNetworkRuleRequirementsDefMap);
+
+ return requirements;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailV2VirtualMachineInterfaceGlobalType.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailV2VirtualMachineInterfaceGlobalType.java
new file mode 100644
index 0000000000..75501cb8d4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailV2VirtualMachineInterfaceGlobalType.java
@@ -0,0 +1,136 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.globaltypes;
+
+import org.openecomp.sdc.tosca.datatypes.ToscaDataType;
+import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
+import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.DataType;
+import org.openecomp.sdc.tosca.datatypes.model.NodeType;
+import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.PropertyType;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.tosca.services.DataModelUtil;
+import org.openecomp.sdc.tosca.services.ToscaConstants;
+import org.openecomp.sdc.translator.services.heattotosca.Constants;
+
+import java.util.HashMap;
+import java.util.Map;
+
+class ContrailV2VirtualMachineInterfaceGlobalType {
+ private ContrailV2VirtualMachineInterfaceGlobalType() {
+ }
+
+ public static ServiceTemplate createServiceTemplate() {
+ ServiceTemplate contrailVirtualMachineInterface = new ServiceTemplate();
+ contrailVirtualMachineInterface
+ .setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION);
+ contrailVirtualMachineInterface.setMetadata(DataModelUtil
+ .createMetadata(Constants.CONTRAILV2_VIRTUAL_MACHINE_INTERFACE_TEMPLATE_NAME, "1.0.0",
+ null));
+ contrailVirtualMachineInterface.setImports(GlobalTypesUtil.createCommonImportList());
+ contrailVirtualMachineInterface
+ .setDescription("Contrail Virtual Machine Interface TOSCA Global Types");
+ contrailVirtualMachineInterface.setNode_types(createGlobalNodeTypes());
+ contrailVirtualMachineInterface.setData_types(createGlobalDataTypes());
+ return contrailVirtualMachineInterface;
+ }
+
+ private static Map<String, DataType> createGlobalDataTypes() {
+ Map<String, DataType> globalDataTypes = new HashMap<>();
+ globalDataTypes
+ .put(ToscaDataType.CONTRAILV2_VIRTUAL_MACHINE_INTERFACE_PROPERTIES.getDisplayName(),
+ createVmiPropertiesDataType());
+ return globalDataTypes;
+ }
+
+ private static DataType createVmiPropertiesDataType() {
+ DataType dataType = new DataType();
+ dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName());
+ dataType.setDescription("Virtual Machine Interface Properties.");
+ Map<String, PropertyDefinition> properties = new HashMap<>();
+
+ properties.put("virtual_machine_interface_properties_service_interface_type", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Service Interface Type.",
+ false, null, null, null, null));
+ dataType.setProperties(properties);
+ return dataType;
+ }
+
+ private static Map<String, NodeType> createGlobalNodeTypes() {
+ Map<String, NodeType> globalNodeTypes = new HashMap<>();
+ globalNodeTypes.put(ToscaNodeType.CONTRAILV2_VIRTUAL_MACHINE_INTERFACE.getDisplayName(),
+ createVmiNodeType());
+ return globalNodeTypes;
+ }
+
+ private static NodeType createVmiNodeType() {
+ NodeType nodeType = new NodeType();
+ nodeType.setDerived_from(ToscaNodeType.NETWORK_PORT.getDisplayName());
+ nodeType.setProperties(createVmiProperties());
+ nodeType.setAttributes(createVmiAttributes());
+ return nodeType;
+ }
+
+ private static Map<String, AttributeDefinition> createVmiAttributes() {
+ Map<String, AttributeDefinition> vmiAttributesDefMap = new HashMap<>();
+ vmiAttributesDefMap.put("fq_name", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(),
+ "The FQ name of the Virtual Network.", null, null, null));
+ vmiAttributesDefMap.put("show", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "All attributes.", null,
+ null, null));
+ return vmiAttributesDefMap;
+ }
+
+ private static Map<String, PropertyDefinition> createVmiProperties() {
+ Map<String, PropertyDefinition> virtualMachineInterfacePropertyDefMap = new HashMap<>();
+ virtualMachineInterfacePropertyDefMap.put(Constants.NAME_PROPERTY_NAME, DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "Virtual Machine Interface name", false, null, null, null, null));
+ virtualMachineInterfacePropertyDefMap.put("virtual_machine_intefrace_mac_addresses",
+ DataModelUtil
+ .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "List of mac addresses.",
+ false, null, null,
+ DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null),
+ null));
+ virtualMachineInterfacePropertyDefMap.put("virtual_network_refs", DataModelUtil
+ .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "List of virtual networks.",
+ false, null, null,
+ DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null),
+ null));
+ virtualMachineInterfacePropertyDefMap.put("port_tuple_refs", DataModelUtil
+ .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "List of port tuples.", false,
+ null, null,
+ DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null),
+ null));
+ virtualMachineInterfacePropertyDefMap.put("security_group_refs", DataModelUtil
+ .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "List of security groups.",
+ false, null, null,
+ DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null),
+ null));
+ virtualMachineInterfacePropertyDefMap.put("virtual_machine_interface_properties", DataModelUtil
+ .createPropertyDefinition(
+ ToscaDataType.CONTRAILV2_VIRTUAL_MACHINE_INTERFACE_PROPERTIES.getDisplayName(),
+ "virtual machine interface properties.", false, null, null, null, null));
+ return virtualMachineInterfacePropertyDefMap;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailV2VirtualNetworkGlobalType.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailV2VirtualNetworkGlobalType.java
new file mode 100644
index 0000000000..728b9f6149
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailV2VirtualNetworkGlobalType.java
@@ -0,0 +1,239 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.globaltypes;
+
+import org.openecomp.sdc.tosca.datatypes.ToscaDataType;
+import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
+import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.CapabilityDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.DataType;
+import org.openecomp.sdc.tosca.datatypes.model.NodeType;
+import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.PropertyType;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.tosca.services.DataModelUtil;
+import org.openecomp.sdc.tosca.services.ToscaConstants;
+import org.openecomp.sdc.translator.services.heattotosca.Constants;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class ContrailV2VirtualNetworkGlobalType {
+
+ /**
+ * Create service template service template.
+ *
+ * @return the service template
+ */
+ public static ServiceTemplate createServiceTemplate() {
+ ServiceTemplate contrailVirtualNetworkServiceTemplate = new ServiceTemplate();
+ contrailVirtualNetworkServiceTemplate
+ .setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION);
+ contrailVirtualNetworkServiceTemplate.setMetadata(DataModelUtil
+ .createMetadata(Constants.CONTRAILV2_VIRTUAL_NETWORK_TEMPLATE_NAME, "1.0.0", null));
+ contrailVirtualNetworkServiceTemplate
+ .setDescription("Contrail V2 Virtual Network Global Types");
+ contrailVirtualNetworkServiceTemplate.setImports(GlobalTypesUtil.createCommonImportList());
+ contrailVirtualNetworkServiceTemplate.setNode_types(createGlobalNodeTypes());
+ contrailVirtualNetworkServiceTemplate.setData_types(createGlobalDataTypes());
+ return contrailVirtualNetworkServiceTemplate;
+ }
+
+ private static Map<String, NodeType> createGlobalNodeTypes() {
+ Map<String, NodeType> globalNodeTypes = new HashMap<>();
+ globalNodeTypes.put(ToscaNodeType.CONTRAILV2_VIRTUAL_NETWORK.getDisplayName(),
+ createContrailVirtualNetworkNodeType());
+ return globalNodeTypes;
+ }
+
+ private static NodeType createContrailVirtualNetworkNodeType() {
+ NodeType contrailV2VirtualNetworkNodeType = new NodeType();
+ contrailV2VirtualNetworkNodeType.setDerived_from(ToscaNodeType.NETWORK.getDisplayName());
+ contrailV2VirtualNetworkNodeType.setProperties(createContrailVirtualNetworkProperties());
+ contrailV2VirtualNetworkNodeType.setAttributes(createContrailVirtualNetworkAttributes());
+ contrailV2VirtualNetworkNodeType.setCapabilities(createContrailVirtualNetworkCapabilities());
+ return contrailV2VirtualNetworkNodeType;
+ }
+
+ private static Map<String, CapabilityDefinition> createContrailVirtualNetworkCapabilities() {
+ Map<String, CapabilityDefinition> capabilities = new HashMap<>();
+ capabilities.put("attachment", GlobalTypesUtil.createAttachmentCapability());
+ return capabilities;
+ }
+
+ private static Map<String, PropertyDefinition> createContrailVirtualNetworkProperties() {
+ Map<String, PropertyDefinition> contrailVirtualNetworkPropertyDefMap = new HashMap<>();
+ //contrailVirtualNetworkPropertyDefMap.put("name", DataModelUtil.
+ // createPropertyDefinition(PropertyType.STRING.getDisplayName()
+ // , "Name", false, null, null, null, null));
+ contrailVirtualNetworkPropertyDefMap.put("network_ipam_refs", DataModelUtil
+ .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "IPAM references", false,
+ null, null,
+ DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null),
+ null));
+ contrailVirtualNetworkPropertyDefMap.put("network_ipam_refs_data", DataModelUtil
+ .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "IPAM references Data", false,
+ null, null, DataModelUtil.createEntrySchema(
+ ToscaDataType.CONTRAILV2_VIRTUAL_NETWORK_IPAM_REF_DATA.getDisplayName(), null,
+ null), null));
+ contrailVirtualNetworkPropertyDefMap.put("network_policy_refs", DataModelUtil
+ .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "Policy references", false,
+ null, null,
+ DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null),
+ null));
+ contrailVirtualNetworkPropertyDefMap.put("network_policy_refs_data", DataModelUtil
+ .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "Policy references data",
+ false, null, null, DataModelUtil.createEntrySchema(
+ ToscaDataType.CONTRAILV2_VIRTUAL_NETWORK_POLICY_REF_DATA.getDisplayName(), null,
+ null), null));
+ contrailVirtualNetworkPropertyDefMap.put("subnets", DataModelUtil
+ .createPropertyDefinition(PropertyType.MAP.getDisplayName(), "Network related subnets",
+ false, null, null, DataModelUtil
+ .createEntrySchema(ToscaDataType.NEUTRON_SUBNET.getDisplayName(), null, null),
+ null));
+ return contrailVirtualNetworkPropertyDefMap;
+ }
+
+ private static Map<String, DataType> createGlobalDataTypes() {
+ Map<String, DataType> globalDataTypes = new HashMap<>();
+ globalDataTypes.put(ToscaDataType.CONTRAILV2_VIRTUAL_NETWORK_IPAM_REF_DATA.getDisplayName(),
+ createVirtualNetworkIpamRefDataDataType());
+ globalDataTypes.put(
+ ToscaDataType.CONTRAILV2_VIRTUAL_NETWORK_IPAM_REF_DATA_IPAM_SUBNET_LIST.getDisplayName(),
+ createVirtualNetworkIpamRefDataIpanSubnetListDataType());
+ globalDataTypes
+ .put(ToscaDataType.CONTRAILV2_VIRTUAL_NETWORK_IPAM_REF_DATA_IPAM_SUBNET.getDisplayName(),
+ createVirtualNetworkIpamRefDataIpanSubnetDataType());
+ globalDataTypes.put(ToscaDataType.CONTRAILV2_VIRTUAL_NETWORK_POLICY_REF_DATA.getDisplayName(),
+ createVirtualNetworkPolicyRefDataDataType());
+ globalDataTypes
+ .put(ToscaDataType.CONTRAILV2_VIRTUAL_NETWORK_POLICY_REF_DATA_SEQUENCE.getDisplayName(),
+ createVirtualNetworkPolicyRefSequenceDataDataType());
+ return globalDataTypes;
+ }
+
+ private static DataType createVirtualNetworkIpamRefDataDataType() {
+ DataType dataType = new DataType();
+ dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName());
+ dataType.setDescription("Network Ipam Ref Data");
+ Map<String, PropertyDefinition> properties = new HashMap<>();
+
+ properties.put("network_ipam_refs_data_ipam_subnets", DataModelUtil
+ .createPropertyDefinition(PropertyType.LIST.getDisplayName(),
+ "Network ipam refs data ipam subnets", false, null, null, DataModelUtil
+ .createEntrySchema(
+ ToscaDataType.CONTRAILV2_VIRTUAL_NETWORK_IPAM_REF_DATA_IPAM_SUBNET_LIST
+ .getDisplayName(), null, null), null));
+ dataType.setProperties(properties);
+ return dataType;
+ }
+
+ private static DataType createVirtualNetworkIpamRefDataIpanSubnetListDataType() {
+ DataType dataType = new DataType();
+ dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName());
+ dataType.setDescription("Network Ipam Ref Data Subnet List");
+ Map<String, PropertyDefinition> properties = new HashMap<>();
+
+ properties.put("network_ipam_refs_data_ipam_subnets_subnet", DataModelUtil
+ .createPropertyDefinition(
+ ToscaDataType.CONTRAILV2_VIRTUAL_NETWORK_IPAM_REF_DATA_IPAM_SUBNET.getDisplayName(),
+ "Network ipam refs data ipam subnets", false, null, null, null, null));
+ properties.put("network_ipam_refs_data_ipam_subnets_addr_from_start", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "Network ipam refs data ipam subnets addr from start", false, null, null, null, null));
+
+ dataType.setProperties(properties);
+ return dataType;
+ }
+
+ private static DataType createVirtualNetworkIpamRefDataIpanSubnetDataType() {
+ DataType dataType = new DataType();
+ dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName());
+ dataType.setDescription("Network Ipam Ref Data Subnet");
+ Map<String, PropertyDefinition> properties = new HashMap<>();
+
+ properties.put("network_ipam_refs_data_ipam_subnets_subnet_ip_prefix", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "Network ipam refs data ipam subnets ip prefix", false, null, null, null, null));
+ properties.put("network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "Network ipam refs data ipam subnets ip prefix len", false, null, null, null, null));
+ dataType.setProperties(properties);
+ return dataType;
+ }
+
+
+ private static DataType createVirtualNetworkPolicyRefDataDataType() {
+ DataType dataType = new DataType();
+ dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName());
+ dataType.setDescription("network policy refs data");
+ Map<String, PropertyDefinition> properties = new HashMap<>();
+
+ properties.put("network_policy_refs_data_sequence", DataModelUtil.createPropertyDefinition(
+ ToscaDataType.CONTRAILV2_VIRTUAL_NETWORK_POLICY_REF_DATA_SEQUENCE.getDisplayName(),
+ "Network Policy ref data sequence", false, null, null, null, null));
+
+
+ dataType.setProperties(properties);
+ return dataType;
+ }
+
+
+ private static DataType createVirtualNetworkPolicyRefSequenceDataDataType() {
+ DataType dataType = new DataType();
+ dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName());
+ dataType.setDescription("network policy refs data sequence");
+ Map<String, PropertyDefinition> properties = new HashMap<>();
+
+ properties.put("network_policy_refs_data_sequence_major", DataModelUtil
+ .createPropertyDefinition(PropertyType.INTEGER.getDisplayName(),
+ "Network Policy ref data sequence Major", false, null, null, null, null));
+ properties.put("network_policy_refs_data_sequence_minor", DataModelUtil
+ .createPropertyDefinition(PropertyType.INTEGER.getDisplayName(),
+ "Network Policy ref data sequence Minor", false, null, null, null, null));
+
+ dataType.setProperties(properties);
+ return dataType;
+ }
+
+ private static Map<String, AttributeDefinition> createContrailVirtualNetworkAttributes() {
+ Map<String, AttributeDefinition> contrailVirtualNetworkAttributesDefMap = new HashMap<>();
+ contrailVirtualNetworkAttributesDefMap.put("subnets_name", DataModelUtil
+ .createAttributeDefinition(PropertyType.LIST.getDisplayName(),
+ "Subnets name of this network", null,
+ DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null),
+ null));
+ contrailVirtualNetworkAttributesDefMap.put("subnets", DataModelUtil
+ .createAttributeDefinition(PropertyType.MAP.getDisplayName(), "Network related subnets",
+ null, DataModelUtil
+ .createEntrySchema(ToscaDataType.NEUTRON_SUBNET.getDisplayName(), null, null),
+ null));
+ contrailVirtualNetworkAttributesDefMap.put("subnets_show", DataModelUtil
+ .createAttributeDefinition(PropertyType.MAP.getDisplayName(),
+ "Detailed information about each subnet", null,
+ DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null),
+ null));
+ contrailVirtualNetworkAttributesDefMap.put("fq_name", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "fq_name", null, null,
+ null));
+ return contrailVirtualNetworkAttributesDefMap;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailVirtualNetworkGlobalType.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailVirtualNetworkGlobalType.java
new file mode 100644
index 0000000000..1014757a2c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailVirtualNetworkGlobalType.java
@@ -0,0 +1,134 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.globaltypes;
+
+import org.openecomp.sdc.tosca.datatypes.ToscaDataType;
+import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
+import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.CapabilityDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.NodeType;
+import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.PropertyType;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.tosca.services.DataModelUtil;
+import org.openecomp.sdc.tosca.services.ToscaConstants;
+import org.openecomp.sdc.translator.services.heattotosca.Constants;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class ContrailVirtualNetworkGlobalType {
+
+ /**
+ * Create service template service template.
+ *
+ * @return the service template
+ */
+ public static ServiceTemplate createServiceTemplate() {
+ ServiceTemplate contrailVirtualNetworkServiceTemplate = new ServiceTemplate();
+ contrailVirtualNetworkServiceTemplate
+ .setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION);
+ contrailVirtualNetworkServiceTemplate.setMetadata(DataModelUtil
+ .createMetadata(Constants.CONTRAIL_VIRTUAL_NETWORK_TEMPLATE_NAME, "1.0.0", null));
+ contrailVirtualNetworkServiceTemplate.setDescription("Contrail Virtual Network Global Types");
+ contrailVirtualNetworkServiceTemplate.setImports(GlobalTypesUtil.createCommonImportList());
+ contrailVirtualNetworkServiceTemplate.setNode_types(createGlobalNodeTypes());
+ return contrailVirtualNetworkServiceTemplate;
+ }
+
+ private static Map<String, NodeType> createGlobalNodeTypes() {
+ Map<String, NodeType> globalNodeTypes = new HashMap<>();
+ globalNodeTypes.put(ToscaNodeType.CONTRAIL_VIRTUAL_NETWORK.getDisplayName(),
+ createContrailVirtualNetworkNodeType());
+ return globalNodeTypes;
+ }
+
+ private static NodeType createContrailVirtualNetworkNodeType() {
+ NodeType contrailVirtualNetworkNodeType = new NodeType();
+ contrailVirtualNetworkNodeType.setDerived_from(ToscaNodeType.NETWORK.getDisplayName());
+ contrailVirtualNetworkNodeType.setProperties(createContrailVirtualNetworkProperties());
+ contrailVirtualNetworkNodeType.setAttributes(createContrailVirtualNetworkAttributes());
+ contrailVirtualNetworkNodeType.setCapabilities(createContrailVirtualNetworkCapabilities());
+ return contrailVirtualNetworkNodeType;
+ }
+
+ private static Map<String, CapabilityDefinition> createContrailVirtualNetworkCapabilities() {
+ Map<String, CapabilityDefinition> capabilities = new HashMap<>();
+ capabilities.put("attachment", GlobalTypesUtil.createAttachmentCapability());
+ return capabilities;
+ }
+
+ private static Map<String, PropertyDefinition> createContrailVirtualNetworkProperties() {
+ Map<String, PropertyDefinition> contrailVirtualNetworkPropertyDefMap = new HashMap<>();
+ contrailVirtualNetworkPropertyDefMap.put("shared", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Is virtual network shared",
+ false, null, null, null, null));
+ contrailVirtualNetworkPropertyDefMap.put("external", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "Is virtual network external", false, null, null, null, null));
+ contrailVirtualNetworkPropertyDefMap.put("allow_transit", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "Whether this network should be transitive.", false, null, null, null, null));
+ contrailVirtualNetworkPropertyDefMap.put("route_targets", DataModelUtil
+ .createPropertyDefinition(PropertyType.LIST.getDisplayName(),
+ "route targets associated with the virtual network", false, null, null,
+ DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null),
+ null));
+ contrailVirtualNetworkPropertyDefMap.put("forwarding_mode", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "forwarding mode of the virtual network", false, null, null, null, null));
+ contrailVirtualNetworkPropertyDefMap.put("flood_unknown_unicast", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "flood L2 packets on network", false, null, null, null, null));
+ contrailVirtualNetworkPropertyDefMap.put("subnets", DataModelUtil
+ .createPropertyDefinition(PropertyType.MAP.getDisplayName(), "Network related subnets",
+ false, null, null, DataModelUtil
+ .createEntrySchema(ToscaDataType.NEUTRON_SUBNET.getDisplayName(), null, null),
+ null));
+ return contrailVirtualNetworkPropertyDefMap;
+ }
+
+ private static Map<String, AttributeDefinition> createContrailVirtualNetworkAttributes() {
+ Map<String, AttributeDefinition> contrailVirtualNetworkAttributesDefMap = new HashMap<>();
+ contrailVirtualNetworkAttributesDefMap.put("subnets_name", DataModelUtil
+ .createAttributeDefinition(PropertyType.LIST.getDisplayName(),
+ "Subnets name of this network", null,
+ DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null),
+ null));
+ contrailVirtualNetworkAttributesDefMap.put("subnets", DataModelUtil
+ .createAttributeDefinition(PropertyType.MAP.getDisplayName(), "Network related subnets",
+ null, DataModelUtil
+ .createEntrySchema(ToscaDataType.NEUTRON_SUBNET.getDisplayName(), null, null),
+ null));
+ contrailVirtualNetworkAttributesDefMap.put("subnets_show", DataModelUtil
+ .createAttributeDefinition(PropertyType.MAP.getDisplayName(),
+ "Detailed information about each subnet", null,
+ DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null),
+ null));
+ contrailVirtualNetworkAttributesDefMap.put("fq_name", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "fq_name", null, null,
+ null));
+ contrailVirtualNetworkAttributesDefMap.put("show", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "All attributes.", null,
+ null, null));
+ return contrailVirtualNetworkAttributesDefMap;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/GlobalTypesGenerator.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/GlobalTypesGenerator.java
new file mode 100644
index 0000000000..a4ec764e14
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/GlobalTypesGenerator.java
@@ -0,0 +1,128 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.globaltypes;
+
+import org.openecomp.sdc.tosca.datatypes.model.Import;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.tosca.services.ToscaNativeTypesServiceTemplate;
+import org.openecomp.sdc.tosca.services.ToscaUtil;
+import org.openecomp.sdc.translator.services.heattotosca.Constants;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class GlobalTypesGenerator {
+
+ private GlobalTypesGenerator() {
+ }
+
+ /**
+ * Gets global types service template.
+ *
+ * @return the global types service template
+ */
+ public static Map<String, ServiceTemplate> getGlobalTypesServiceTemplate() {
+ Map<String, ServiceTemplate> serviceTemplates = new HashMap<>();
+
+ ToscaUtil.addServiceTemplateToMapWithKeyFileName(serviceTemplates,
+ CommonGlobalTypes.createServiceTemplate());
+ ToscaUtil.addServiceTemplateToMapWithKeyFileName(serviceTemplates,
+ NovaServerGlobalType.createServiceTemplate());
+ ToscaUtil.addServiceTemplateToMapWithKeyFileName(serviceTemplates,
+ CinderVolumeGlobalType.createServiceTemplate());
+ ToscaUtil.addServiceTemplateToMapWithKeyFileName(serviceTemplates,
+ ContrailVirtualNetworkGlobalType.createServiceTemplate());
+ ToscaUtil.addServiceTemplateToMapWithKeyFileName(serviceTemplates,
+ ContrailV2VirtualNetworkGlobalType.createServiceTemplate());
+ ToscaUtil.addServiceTemplateToMapWithKeyFileName(serviceTemplates,
+ ContrailV2VirtualMachineInterfaceGlobalType.createServiceTemplate());
+ ToscaUtil.addServiceTemplateToMapWithKeyFileName(serviceTemplates,
+ NeutronNetGlobalType.createServiceTemplate());
+ ToscaUtil.addServiceTemplateToMapWithKeyFileName(serviceTemplates,
+ NeutronPortGlobalType.createServiceTemplate());
+ ToscaUtil.addServiceTemplateToMapWithKeyFileName(serviceTemplates,
+ ContrailNetworkRuleGlobalType.createServiceTemplate());
+ ToscaUtil.addServiceTemplateToMapWithKeyFileName(serviceTemplates,
+ ContrailV2NetworkRuleGlobalType.createServiceTemplate());
+ ToscaUtil.addServiceTemplateToMapWithKeyFileName(serviceTemplates,
+ NeutronSecurityRulesGlobalType.createServiceTemplate());
+ ToscaUtil.addServiceTemplateToMapWithKeyFileName(serviceTemplates,
+ AbstractSubstituteGlobalType.createServiceTemplate());
+ ToscaUtil.addServiceTemplateToMapWithKeyFileName(serviceTemplates,
+ ToscaNativeTypesServiceTemplate.createServiceTemplate());
+ ToscaUtil.addServiceTemplateToMapWithKeyFileName(serviceTemplates,
+ ContrailComputeGlobalType.createServiceTemplate());
+ ToscaUtil.addServiceTemplateToMapWithKeyFileName(serviceTemplates,
+ ContrailPortGlobalType.createServiceTemplate());
+ ToscaUtil.addServiceTemplateToMapWithKeyFileName(serviceTemplates,
+ ContrailV2NetworkRuleGlobalType.createServiceTemplate());
+ ToscaUtil.addServiceTemplateToMapWithKeyFileName(serviceTemplates,
+ ContrailV2VirtualNetworkGlobalType.createServiceTemplate());
+ ToscaUtil.addServiceTemplateToMapWithKeyFileName(serviceTemplates,
+ ContrailAbstractSubstituteGlobalType.createServiceTemplate());
+ return serviceTemplates;
+ }
+
+ private static void addGlobalServiceTemplate(Map<String, ServiceTemplate> serviceTemplates,
+ ServiceTemplate commonServiceTemplate) {
+ serviceTemplates
+ .put(ToscaUtil.getServiceTemplateFileName(commonServiceTemplate), commonServiceTemplate);
+ }
+
+ /**
+ * Gets global types import list.
+ *
+ * @return the global types import list
+ */
+ public static Map<String, Import> getGlobalTypesImportList() {
+ Map<String, Import> globalImportMap = new HashMap<>();
+ globalImportMap.put(Constants.COMMON_GLOBAL_TEMPLATE_NAME,
+ GlobalTypesUtil.createServiceTemplateImport(Constants.COMMON_GLOBAL_TEMPLATE_NAME));
+ globalImportMap.put(Constants.NOVA_SERVER_TEMPLATE_NAME,
+ GlobalTypesUtil.createServiceTemplateImport(Constants.NOVA_SERVER_TEMPLATE_NAME));
+ globalImportMap.put(Constants.NEUTRON_PORT_TEMPLATE_NAME,
+ GlobalTypesUtil.createServiceTemplateImport(Constants.NEUTRON_PORT_TEMPLATE_NAME));
+ globalImportMap.put(Constants.NEUTRON_SECURITY_RULES_TEMPLATE_NAME, GlobalTypesUtil
+ .createServiceTemplateImport(Constants.NEUTRON_SECURITY_RULES_TEMPLATE_NAME));
+ globalImportMap.put(Constants.NEUTRON_NET_TEMPLATE_NAME,
+ GlobalTypesUtil.createServiceTemplateImport(Constants.NEUTRON_NET_TEMPLATE_NAME));
+ globalImportMap.put(Constants.CINDER_VOLUME_TEMPLATE_NAME,
+ GlobalTypesUtil.createServiceTemplateImport(Constants.CINDER_VOLUME_TEMPLATE_NAME));
+ globalImportMap.put(Constants.CONTRAIL_VIRTUAL_NETWORK_TEMPLATE_NAME, GlobalTypesUtil
+ .createServiceTemplateImport(Constants.CONTRAIL_VIRTUAL_NETWORK_TEMPLATE_NAME));
+ globalImportMap.put(Constants.CONTRAIL_NETWORK_RULE_TEMPLATE_NAME,
+ GlobalTypesUtil.createServiceTemplateImport(Constants.CONTRAIL_NETWORK_RULE_TEMPLATE_NAME));
+ globalImportMap.put(Constants.ABSTRACT_SUBSTITUTE_TEMPLATE_NAME,
+ GlobalTypesUtil.createServiceTemplateImport(Constants.ABSTRACT_SUBSTITUTE_TEMPLATE_NAME));
+ globalImportMap.put(Constants.CONTRAILV2_VIRTUAL_MACHINE_INTERFACE_TEMPLATE_NAME,
+ GlobalTypesUtil.createServiceTemplateImport(
+ Constants.CONTRAILV2_VIRTUAL_MACHINE_INTERFACE_TEMPLATE_NAME));
+ globalImportMap.put(Constants.CONTRAIL_COMPUTE_TEMPLATE_NAME,
+ GlobalTypesUtil.createServiceTemplateImport(Constants.CONTRAIL_COMPUTE_TEMPLATE_NAME));
+ globalImportMap.put(Constants.CONTRAIL_PORT_TEMPLATE_NAME,
+ GlobalTypesUtil.createServiceTemplateImport(Constants.CONTRAIL_PORT_TEMPLATE_NAME));
+ globalImportMap.put(Constants.CONTRAIL_ABSTRACT_SUBSTITUTE_TEMPLATE_NAME, GlobalTypesUtil
+ .createServiceTemplateImport(Constants.CONTRAIL_ABSTRACT_SUBSTITUTE_TEMPLATE_NAME));
+ return globalImportMap;
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/GlobalTypesUtil.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/GlobalTypesUtil.java
new file mode 100644
index 0000000000..9566dec581
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/GlobalTypesUtil.java
@@ -0,0 +1,69 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.globaltypes;
+
+
+import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType;
+import org.openecomp.sdc.tosca.datatypes.model.CapabilityDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.Import;
+import org.openecomp.sdc.tosca.services.ToscaUtil;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class GlobalTypesUtil {
+
+
+ /**
+ * Create common import list map.
+ *
+ * @return the map
+ */
+ public static Map<String, Import> createCommonImportList() {
+ Map<String, Import> importsMap = new HashMap<>();
+ importsMap.put("common_definitions", CommonGlobalTypes.createCommonServiceTemplateImport());
+ return importsMap;
+ }
+
+ /**
+ * Create attachment capability capability definition.
+ *
+ * @return the capability definition
+ */
+ public static CapabilityDefinition createAttachmentCapability() {
+ CapabilityDefinition capability = new CapabilityDefinition();
+ capability.setType(ToscaCapabilityType.ATTACHMENT.getDisplayName());
+
+ return capability;
+ }
+
+ /**
+ * Create service template import import.
+ *
+ * @param serviceTemplateName the service template name
+ * @return the import
+ */
+ public static Import createServiceTemplateImport(String serviceTemplateName) {
+ Import serviceTemplateImport = new Import();
+ serviceTemplateImport.setFile(ToscaUtil.getServiceTemplateFileName(serviceTemplateName));
+ return serviceTemplateImport;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/NeutronNetGlobalType.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/NeutronNetGlobalType.java
new file mode 100644
index 0000000000..2532f87cf5
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/NeutronNetGlobalType.java
@@ -0,0 +1,143 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.globaltypes;
+
+import org.openecomp.sdc.tosca.datatypes.ToscaDataType;
+import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
+import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.CapabilityDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.NodeType;
+import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.PropertyType;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.tosca.services.DataModelUtil;
+import org.openecomp.sdc.tosca.services.ToscaConstants;
+import org.openecomp.sdc.translator.services.heattotosca.Constants;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class NeutronNetGlobalType {
+ /**
+ * Create service template service template.
+ *
+ * @return the service template
+ */
+ public static ServiceTemplate createServiceTemplate() {
+ ServiceTemplate neutronNetServiceTemplate = new ServiceTemplate();
+ neutronNetServiceTemplate
+ .setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION);
+ neutronNetServiceTemplate.setMetadata(
+ DataModelUtil.createMetadata(Constants.NEUTRON_NET_TEMPLATE_NAME, "1.0.0", null));
+ neutronNetServiceTemplate.setDescription("Neutron Network TOSCA Global Types");
+ neutronNetServiceTemplate.setImports(GlobalTypesUtil.createCommonImportList());
+ neutronNetServiceTemplate.setNode_types(createGlobalNodeTypes());
+ return neutronNetServiceTemplate;
+ }
+
+
+ private static Map<String, NodeType> createGlobalNodeTypes() {
+ Map<String, NodeType> globalNodeTypes = new HashMap<>();
+ globalNodeTypes.put(ToscaNodeType.NEUTRON_NET.getDisplayName(), createNeutronNetworkNodeType());
+ return globalNodeTypes;
+ }
+
+ private static NodeType createNeutronNetworkNodeType() {
+ NodeType neutronNetworkNode = new NodeType();
+ neutronNetworkNode.setDerived_from(ToscaNodeType.NETWORK.getDisplayName());
+ neutronNetworkNode.setProperties(createNeutronNetworkProperties());
+ neutronNetworkNode.setAttributes(createNeutronNetworkAttributes());
+ neutronNetworkNode.setCapabilities(createNeutronNetworkCapabilities());
+
+ return neutronNetworkNode;
+ }
+
+ private static Map<String, CapabilityDefinition> createNeutronNetworkCapabilities() {
+ Map<String, CapabilityDefinition> capabilities = new HashMap<>();
+ capabilities.put("attachment", GlobalTypesUtil.createAttachmentCapability());
+ return capabilities;
+ }
+
+ private static Map<String, PropertyDefinition> createNeutronNetworkProperties() {
+ Map<String, PropertyDefinition> neutronNetworkPropertyDefMap = new HashMap<>();
+ neutronNetworkPropertyDefMap.put("admin_state_up", DataModelUtil
+ .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(),
+ "A boolean value specifying the administrative status of the network", false, null,
+ null, null, true));
+ neutronNetworkPropertyDefMap.put("dhcp_agent_ids", DataModelUtil
+ .createPropertyDefinition(PropertyType.LIST.getDisplayName(),
+ "The IDs of the DHCP agent to schedule the network", false, null, null,
+ DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null),
+ null));
+ neutronNetworkPropertyDefMap.put("port_security_enabled", DataModelUtil
+ .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(),
+ "Flag to enable/disable port security on the network", false, null, null, null, null));
+ neutronNetworkPropertyDefMap.put("qos_policy", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "The name or ID of QoS policy to attach to this network", false, null, null, null,
+ null));
+ neutronNetworkPropertyDefMap.put("shared", DataModelUtil
+ .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(),
+ "Whether this network should be shared across all tenants", false, null, null, null,
+ false));
+ neutronNetworkPropertyDefMap.put("tenant_id", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "The ID of the tenant which will own the network", false, null, null, null, null));
+ neutronNetworkPropertyDefMap.put("value_specs", DataModelUtil
+ .createPropertyDefinition(PropertyType.MAP.getDisplayName(),
+ "Extra parameters to include in the request", false, null, null,
+ DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null),
+ new HashMap<String, String>()));
+ neutronNetworkPropertyDefMap.put("subnets", DataModelUtil
+ .createPropertyDefinition(PropertyType.MAP.getDisplayName(), "Network related subnets",
+ false, null, null, DataModelUtil
+ .createEntrySchema(ToscaDataType.NEUTRON_SUBNET.getDisplayName(), null, null),
+ null));
+ return neutronNetworkPropertyDefMap;
+ }
+
+ private static Map<String, AttributeDefinition> createNeutronNetworkAttributes() {
+ Map<String, AttributeDefinition> neutronNetworkAttributesDefMap = new HashMap<>();
+ neutronNetworkAttributesDefMap.put("mtu", DataModelUtil
+ .createAttributeDefinition(PropertyType.SCALAR_UNIT_SIZE.getDisplayName(),
+ "The maximum transmission unit size(in bytes) for the network", null, null, null));
+ neutronNetworkAttributesDefMap.put("qos_policy_id", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(),
+ "The QoS policy ID attached to this network", null, null, null));
+ neutronNetworkAttributesDefMap.put("show", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(),
+ "Detailed information about resource", null, null, null));
+ neutronNetworkAttributesDefMap.put("status", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(),
+ "The status of the network", null, null, null));
+ neutronNetworkAttributesDefMap.put("subnets_name", DataModelUtil
+ .createAttributeDefinition(PropertyType.LIST.getDisplayName(),
+ "Subnets name of this network", null,
+ DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null),
+ null));
+ neutronNetworkAttributesDefMap.put("subnets", DataModelUtil
+ .createAttributeDefinition(PropertyType.MAP.getDisplayName(), "Network related subnets",
+ null, DataModelUtil
+ .createEntrySchema(ToscaDataType.NEUTRON_SUBNET.getDisplayName(), null, null),
+ null));
+ return neutronNetworkAttributesDefMap;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/NeutronPortGlobalType.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/NeutronPortGlobalType.java
new file mode 100644
index 0000000000..2106b9b3bc
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/NeutronPortGlobalType.java
@@ -0,0 +1,203 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.globaltypes;
+
+import org.openecomp.sdc.tosca.datatypes.ToscaDataType;
+import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
+import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.CapabilityDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.Constraint;
+import org.openecomp.sdc.tosca.datatypes.model.DataType;
+import org.openecomp.sdc.tosca.datatypes.model.NodeType;
+import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.PropertyType;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.tosca.services.DataModelUtil;
+import org.openecomp.sdc.tosca.services.ToscaConstants;
+import org.openecomp.sdc.translator.services.heattotosca.Constants;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class NeutronPortGlobalType {
+ /**
+ * Create service template service template.
+ *
+ * @return the service template
+ */
+ public static ServiceTemplate createServiceTemplate() {
+ ServiceTemplate neutronPortServiceTemplate = new ServiceTemplate();
+ neutronPortServiceTemplate
+ .setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION);
+ neutronPortServiceTemplate.setMetadata(
+ DataModelUtil.createMetadata(Constants.NEUTRON_PORT_TEMPLATE_NAME, "1.0.0", null));
+ neutronPortServiceTemplate.setImports(GlobalTypesUtil.createCommonImportList());
+ neutronPortServiceTemplate.setDescription("Neutron Port TOSCA Global Types");
+ neutronPortServiceTemplate.setData_types(createGlobalDataTypes());
+ neutronPortServiceTemplate.setNode_types(createGlobalNodeTypes());
+ return neutronPortServiceTemplate;
+ }
+
+ private static Map<String, DataType> createGlobalDataTypes() {
+ Map<String, DataType> globalDataTypes = new HashMap<>();
+ globalDataTypes
+ .put(ToscaDataType.NEUTRON_PORT_FIXED_IPS.getDisplayName(), createFixedIpsDataType());
+ return globalDataTypes;
+ }
+
+ private static DataType createFixedIpsDataType() {
+ DataType dataType = new DataType();
+ dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName());
+ dataType.setDescription("subnet/ip_address");
+ Map<String, PropertyDefinition> prop = new HashMap<>();
+
+ prop.put("subnet", DataModelUtil.createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "Subnet in which to allocate the IP address for this port", false, null, null, null, null));
+ prop.put("ip_address", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "IP address desired in the subnet for this port", false, null, null, null, null));
+
+ dataType.setProperties(prop);
+ return dataType;
+ }
+
+ private static Map<String, NodeType> createGlobalNodeTypes() {
+ Map<String, NodeType> globalNodeTypes = new HashMap<>();
+ globalNodeTypes.put(ToscaNodeType.NEUTRON_PORT.getDisplayName(), createNeutronPortNodeType());
+ return globalNodeTypes;
+ }
+
+ private static NodeType createNeutronPortNodeType() {
+ NodeType nodeType = new NodeType();
+ nodeType.setDerived_from(ToscaNodeType.NETWORK_PORT.getDisplayName());
+ nodeType.setProperties(createNeutronPortProperties());
+ nodeType.setAttributes(createNeutronPortAttributes());
+ nodeType.setCapabilities(createNeutronPortCapabilities());
+ return nodeType;
+ }
+
+ private static Map<String, CapabilityDefinition> createNeutronPortCapabilities() {
+ Map<String, CapabilityDefinition> capabilities = new HashMap<>();
+ capabilities.put("attachment", GlobalTypesUtil.createAttachmentCapability());
+ return capabilities;
+ }
+
+ private static Map<String, PropertyDefinition> createNeutronPortProperties() {
+ Map<String, PropertyDefinition> neutronPortPropertyDefMap = new HashMap<>();
+ neutronPortPropertyDefMap.put("admin_state_up", DataModelUtil
+ .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(),
+ "A boolean value specifying the administrative status of the network", false, null,
+ null, null, true));
+ neutronPortPropertyDefMap.put("allowed_address_pairs", DataModelUtil
+ .createPropertyDefinition(PropertyType.LIST.getDisplayName(),
+ "Additional MAC/IP address pairs allowed to pass through the port", false, null, null,
+ DataModelUtil
+ .createEntrySchema(ToscaDataType.NETWORK_ADDRESS_PAIR.getDisplayName(), null, null),
+ null));
+ neutronPortPropertyDefMap.put("binding:vnic_type", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "The vnic type to be bound on the neutron port", false, createBindingConstraint(), null,
+ null, null));
+ neutronPortPropertyDefMap.put("device_id", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Device ID of this port",
+ false, null, null, null, null));
+ neutronPortPropertyDefMap.put("device_owner", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "Name of the network owning the port", false, null, null, null, null));
+ neutronPortPropertyDefMap.put("fixed_ips", DataModelUtil
+ .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "Desired IPs for this port",
+ false, null, null, DataModelUtil
+ .createEntrySchema(ToscaDataType.NEUTRON_PORT_FIXED_IPS.getDisplayName(), null,
+ null), null));
+ neutronPortPropertyDefMap.put("mac_address", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "MAC address to give to this port", false, null, null, null, null));
+ neutronPortPropertyDefMap.put(Constants.NAME_PROPERTY_NAME, DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "A symbolic name for this port", false, null, null, null, null));
+ neutronPortPropertyDefMap.put("port_security_enabled", DataModelUtil
+ .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(),
+ "Flag to enable/disable port security on the network", false, null, null, null, null));
+ neutronPortPropertyDefMap.put("qos_policy", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "The name or ID of QoS policy to attach to this network", false, null, null, null,
+ null));
+ neutronPortPropertyDefMap.put(Constants.SECURITY_GROUPS_PROPERTY_NAME, DataModelUtil
+ .createPropertyDefinition(PropertyType.LIST.getDisplayName(),
+ "List of security group names or IDs", false, null, null,
+ DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null),
+ null));
+ neutronPortPropertyDefMap.put("value_specs", DataModelUtil
+ .createPropertyDefinition(PropertyType.MAP.getDisplayName(),
+ "Extra parameters to include in the request", false, null, null,
+ DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null),
+ new HashMap<String, String>()));
+ neutronPortPropertyDefMap.put("replacement_policy", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "Policy on how to respond to a stack-update for this resource", false,
+ createReplacementPolicyConstrain(), null, null, "AUTO"));
+ neutronPortPropertyDefMap.put("network", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "Network this port belongs to", false, null, null, null, null));
+ return neutronPortPropertyDefMap;
+ }
+
+ private static List<Constraint> createBindingConstraint() {
+ List<Constraint> constraints = new ArrayList<>();
+ Constraint validValues =
+ DataModelUtil.createValidValuesConstraint("macvtap", "direct", "normal");
+ constraints.add(validValues);
+ return constraints;
+ }
+
+ private static List<Constraint> createReplacementPolicyConstrain() {
+ List<Constraint> constraints = new ArrayList<>();
+ Constraint validValues = DataModelUtil.createValidValuesConstraint("REPLACE_ALWAYS", "AUTO");
+ constraints.add(validValues);
+ return constraints;
+ }
+
+ private static Map<String, AttributeDefinition> createNeutronPortAttributes() {
+ Map<String, AttributeDefinition> neutronPortAttributesDefMap = new HashMap<>();
+ neutronPortAttributesDefMap.put("network_id", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(),
+ "Unique identifier for the network owning the port", null, null, null));
+ neutronPortAttributesDefMap.put("qos_policy_id", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(),
+ "The QoS policy ID attached to this network", null, null, null));
+ neutronPortAttributesDefMap.put("show", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(),
+ "Detailed information about resource", null, null, null));
+ neutronPortAttributesDefMap.put("status", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(),
+ "The status of the network", null, null, null));
+ neutronPortAttributesDefMap.put("subnets", DataModelUtil
+ .createAttributeDefinition(PropertyType.LIST.getDisplayName(), "Subnets of this network",
+ null, DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null),
+ null));
+ neutronPortAttributesDefMap.put("tenant_id", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "Tenant owning the port",
+ null, null, null));
+ return neutronPortAttributesDefMap;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/NeutronSecurityRulesGlobalType.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/NeutronSecurityRulesGlobalType.java
new file mode 100644
index 0000000000..4c5b033e0e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/NeutronSecurityRulesGlobalType.java
@@ -0,0 +1,175 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.globaltypes;
+
+import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType;
+import org.openecomp.sdc.tosca.datatypes.ToscaDataType;
+import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
+import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType;
+import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.Constraint;
+import org.openecomp.sdc.tosca.datatypes.model.DataType;
+import org.openecomp.sdc.tosca.datatypes.model.NodeType;
+import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.PropertyType;
+import org.openecomp.sdc.tosca.datatypes.model.RequirementDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.tosca.services.DataModelUtil;
+import org.openecomp.sdc.tosca.services.ToscaConstants;
+import org.openecomp.sdc.translator.services.heattotosca.Constants;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class NeutronSecurityRulesGlobalType {
+ /**
+ * Create service template service template.
+ *
+ * @return the service template
+ */
+ public static ServiceTemplate createServiceTemplate() {
+ ServiceTemplate neutronSecurityRulesServiceTemplate = new ServiceTemplate();
+ neutronSecurityRulesServiceTemplate
+ .setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION);
+ neutronSecurityRulesServiceTemplate.setMetadata(DataModelUtil
+ .createMetadata(Constants.NEUTRON_SECURITY_RULES_TEMPLATE_NAME, "1.0.0", null));
+ neutronSecurityRulesServiceTemplate.setImports(GlobalTypesUtil.createCommonImportList());
+ neutronSecurityRulesServiceTemplate.setDescription("Neutron Security Rules TOSCA Global Types");
+ neutronSecurityRulesServiceTemplate.setData_types(createGlobalDataTypes());
+ neutronSecurityRulesServiceTemplate.setNode_types(createGlobalNodeTypes());
+ return neutronSecurityRulesServiceTemplate;
+ }
+
+
+ private static Map<String, DataType> createGlobalDataTypes() {
+ Map<String, DataType> globalDataTypes = new HashMap<>();
+ globalDataTypes.put(ToscaDataType.NEUTRON_SECURITY_RULES_RULE.getDisplayName(),
+ createSecurityRulesDataType());
+ return globalDataTypes;
+ }
+
+ private static DataType createSecurityRulesDataType() {
+ DataType addressPairDataType = new DataType();
+ addressPairDataType.setDerived_from(ToscaDataType.ROOT.getDisplayName());
+ addressPairDataType.setDescription("Rules Pairs");
+ Map<String, PropertyDefinition> addressPairProp = new HashMap<>();
+
+ addressPairProp.put("direction", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "The direction in which the security group rule is applied", false,
+ DataModelUtil.createValidValuesConstraintsList("egress", "ingress"), null, null,
+ "ingress"));
+ addressPairProp.put("ethertype", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Ethertype of the traffic",
+ false, DataModelUtil.createValidValuesConstraintsList("IPv4", "IPv6"), null, null,
+ "IPv4"));
+ Constraint portRangeMaxConstraint = new Constraint();
+ portRangeMaxConstraint.setIn_range(new Integer[]{0, 65535});
+ addressPairProp.put("port_range_max", DataModelUtil
+ .createPropertyDefinition(PropertyType.INTEGER.getDisplayName(),
+ "The maximum port number in the range that is matched by the security group rule. ",
+ false, DataModelUtil.getConstrainList(portRangeMaxConstraint), null, null, null));
+ Constraint portRangeMinConstraint = new Constraint();
+ portRangeMinConstraint.setIn_range(new Integer[]{0, 65535});
+ addressPairProp.put("port_range_min", DataModelUtil
+ .createPropertyDefinition(PropertyType.INTEGER.getDisplayName(),
+ "The minimum port number in the range that is matched by the security group rule.",
+ false, DataModelUtil.getConstrainList(portRangeMinConstraint), null, null, null));
+ addressPairProp.put("protocol", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "The protocol that is matched by the security group rule", false,
+ DataModelUtil.createValidValuesConstraintsList("tcp", "udp", "icmp"), null, null,
+ null));
+ addressPairProp.put("remote_group_id", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "The remote group ID to be associated with this security group rule", false, null, null,
+ null, null));
+ addressPairProp.put("remote_ip_prefix", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "The remote IP prefix (CIDR) to be associated with this security group rule", false,
+ null, null, null, null));
+ addressPairProp.put("remote_mode", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "Whether to specify a remote group or a remote IP prefix", false,
+ DataModelUtil.createValidValuesConstraintsList("remote_ip_prefix", "remote_group_id"),
+ null, null, "remote_ip_prefix"));
+ addressPairDataType.setProperties(addressPairProp);
+
+ return addressPairDataType;
+ }
+
+ private static Map<String, NodeType> createGlobalNodeTypes() {
+ Map<String, NodeType> globalNodeTypes = new HashMap<>();
+ globalNodeTypes.put(ToscaNodeType.NEUTRON_SECURITY_RULES.getDisplayName(),
+ createNeutronSecurityRulesNodeType());
+ return globalNodeTypes;
+ }
+
+ private static NodeType createNeutronSecurityRulesNodeType() {
+ NodeType novaServerNodeType = new NodeType();
+ novaServerNodeType.setDerived_from(ToscaNodeType.ROOT.getDisplayName());
+ novaServerNodeType.setProperties(createNeutronSecurityRulesProperties());
+ novaServerNodeType.setAttributes(createNeutronSecurityRulesAttributes());
+ novaServerNodeType.setRequirements(createNeutronSecurityRequirements());
+ return novaServerNodeType;
+ }
+
+ private static List<Map<String, RequirementDefinition>> createNeutronSecurityRequirements() {
+ final List<Map<String, RequirementDefinition>> requirements = new ArrayList<>();
+ final Map<String, RequirementDefinition> portRequirement = new HashMap<>();
+ RequirementDefinition requirementDefinition = new RequirementDefinition();
+ requirementDefinition.setCapability(ToscaCapabilityType.ATTACHMENT.getDisplayName());
+ requirementDefinition.setNode(ToscaNodeType.NEUTRON_PORT.getDisplayName());
+ requirementDefinition.setRelationship(ToscaRelationshipType.ATTACHES_TO.getDisplayName());
+ requirementDefinition.setOccurrences(new Object[]{0, ToscaConstants.UNBOUNDED});
+ portRequirement.put(ToscaConstants.PORT_REQUIREMENT_ID, requirementDefinition);
+ requirements.add(portRequirement);
+
+ return requirements;
+ }
+
+ private static Map<String, PropertyDefinition> createNeutronSecurityRulesProperties() {
+ Map<String, PropertyDefinition> neutronSecurityRulesPropertyDefMap = new HashMap<>();
+ neutronSecurityRulesPropertyDefMap.put(Constants.NAME_PROPERTY_NAME, DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "A symbolic name for this security group, which is not required to be unique.", false,
+ null, null, null, null));
+ neutronSecurityRulesPropertyDefMap.put(Constants.DESCRIPTION_PROPERTY_NAME, DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "Description of the security group", false, null, null, null, null));
+ neutronSecurityRulesPropertyDefMap.put(Constants.RULES_PROPERTY_NAME, DataModelUtil
+ .createPropertyDefinition(PropertyType.LIST.getDisplayName(),
+ "List of security group rules", false, null, null, DataModelUtil
+ .createEntrySchema(ToscaDataType.NEUTRON_SECURITY_RULES_RULE.getDisplayName(), null,
+ null), null));
+ return neutronSecurityRulesPropertyDefMap;
+ }
+
+ private static Map<String, AttributeDefinition> createNeutronSecurityRulesAttributes() {
+ Map<String, AttributeDefinition> neutronSecurityRulesAttributesDefMap = new HashMap<>();
+ neutronSecurityRulesAttributesDefMap.put("show", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(),
+ "Detailed information about resource", null, null, null));
+ return neutronSecurityRulesAttributesDefMap;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/NovaServerGlobalType.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/NovaServerGlobalType.java
new file mode 100644
index 0000000000..d38d70a4f7
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/NovaServerGlobalType.java
@@ -0,0 +1,307 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.globaltypes;
+
+import org.openecomp.sdc.tosca.datatypes.ToscaDataType;
+import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
+import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.Constraint;
+import org.openecomp.sdc.tosca.datatypes.model.DataType;
+import org.openecomp.sdc.tosca.datatypes.model.NodeType;
+import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.PropertyType;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.heatextend.PropertyTypeExt;
+import org.openecomp.sdc.tosca.services.DataModelUtil;
+import org.openecomp.sdc.tosca.services.ToscaConstants;
+import org.openecomp.sdc.translator.services.heattotosca.Constants;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class NovaServerGlobalType {
+
+ /**
+ * Create service template service template.
+ *
+ * @return the service template
+ */
+ public static ServiceTemplate createServiceTemplate() {
+ ServiceTemplate novaeServerServiceTemplate = new ServiceTemplate();
+ novaeServerServiceTemplate
+ .setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION);
+ novaeServerServiceTemplate.setMetadata(
+ DataModelUtil.createMetadata(Constants.NOVA_SERVER_TEMPLATE_NAME, "1.0.0", null));
+ novaeServerServiceTemplate.setDescription("Nova Server TOSCA Global Types");
+ novaeServerServiceTemplate.setImports(GlobalTypesUtil.createCommonImportList());
+ novaeServerServiceTemplate.setData_types(createGlobalDataTypes());
+ novaeServerServiceTemplate.setNode_types(createGlobalNodeTypes());
+ return novaeServerServiceTemplate;
+ }
+
+
+ private static Map<String, NodeType> createGlobalNodeTypes() {
+ Map<String, NodeType> globalNodeTypes = new HashMap<>();
+ globalNodeTypes.put(ToscaNodeType.NOVA_SERVER.getDisplayName(), createNovaServerNodeType());
+ return globalNodeTypes;
+ }
+
+ private static NodeType createNovaServerNodeType() {
+ NodeType novaServerNodeType = new NodeType();
+ novaServerNodeType.setDerived_from(ToscaNodeType.COMPUTE.getDisplayName());
+ novaServerNodeType.setProperties(createNovaServerProperties());
+ novaServerNodeType.setAttributes(createNovaServerAttributes());
+ return novaServerNodeType;
+ }
+
+
+ private static Map<String, PropertyDefinition> createNovaServerProperties() {
+ Map<String, PropertyDefinition> novaServerPropertyDefMap = new HashMap<>();
+ novaServerPropertyDefMap.put("flavor", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "The ID or name of the flavor to boot onto", true, null, null, null, null));
+ novaServerPropertyDefMap.put("admin_pass", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "The administrator password for the server", false, null, null, null, null));
+ novaServerPropertyDefMap.put("availability_zone", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "Availability zone to create servers in", false, null, null, null, null));
+ novaServerPropertyDefMap.put("config_drive", DataModelUtil
+ .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(),
+ "enable config drive on the server", false, null, null, null, null));
+ novaServerPropertyDefMap.put("contrail_service_instance_ind", DataModelUtil
+ .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(),
+ "Nova server related to service instance indicator", false, null, null, null, false));
+ novaServerPropertyDefMap.put("diskConfig", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "Control how the disk is partitioned when the server is created", false,
+ getDiskConfigConstraints(), null, null, null));
+ novaServerPropertyDefMap.put("flavor_update_policy", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "Policy on how to apply a flavor update", false, getFlavorUpdatePolicyConstraints(),
+ null, null, "RESIZE"));
+ novaServerPropertyDefMap.put("image", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "The ID or name of the image to boot with", false, null, null, null, null));
+ novaServerPropertyDefMap.put("image_update_policy", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "Policy on how to apply an image-id update", false, getImageUpdatePolicyConstraints(),
+ null, null, "REBUILD"));
+ novaServerPropertyDefMap.put("key_name", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "Name of keypair to inject into the server", false, null, null, null, null));
+ novaServerPropertyDefMap.put("metadata", DataModelUtil
+ .createPropertyDefinition(PropertyTypeExt.JSON.getDisplayName(),
+ "Arbitrary JSON metadata to store for this server", false, null, null, null, null));
+ novaServerPropertyDefMap.put(Constants.NAME_PROPERTY_NAME, DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Server name", false, null,
+ null, null, null));
+ novaServerPropertyDefMap.put("personality", DataModelUtil
+ .createPropertyDefinition(PropertyType.MAP.getDisplayName(),
+ "A map of files to create/overwrite on the server upon boot", false, null, null,
+ DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null),
+ new HashMap<String, String>()));
+ novaServerPropertyDefMap.put("reservation_id", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "A UUID for the set of servers being requested", false, null, null, null, null));
+ novaServerPropertyDefMap.put("scheduler_hints", DataModelUtil
+ .createPropertyDefinition(PropertyType.MAP.getDisplayName(),
+ "Arbitrary key-value pairs specified by the client to help boot a server", false, null,
+ null, DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null),
+ null));
+ novaServerPropertyDefMap.put(Constants.SECURITY_GROUPS_PROPERTY_NAME, DataModelUtil
+ .createPropertyDefinition(PropertyType.LIST.getDisplayName(),
+ "List of security group names or IDs", false, null, null,
+ DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null),
+ new ArrayList<>()));
+ novaServerPropertyDefMap.put("software_config_transport", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "How the server should receive the metadata required for software configuration", false,
+ getSoftwareConfigTransportConstraints(), null, null, "POLL_SERVER_CFN"));
+ novaServerPropertyDefMap.put("user_data", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "User data script to be executed by cloud-init", false, null, null, null, ""));
+ novaServerPropertyDefMap.put("user_data_format", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "How the user_data should be formatted for the server", false,
+ getUserDataFormatConstraint(), null, null, "HEAT_CFNTOOLS"));
+ novaServerPropertyDefMap.put("user_data_update_policy", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "Policy on how to apply a user_data update", false,
+ getUserDataUpdatePolicyConstraints(), null, null, "REPLACE"));
+ return novaServerPropertyDefMap;
+ }
+
+ private static Map<String, AttributeDefinition> createNovaServerAttributes() {
+ Map<String, AttributeDefinition> novaServerAttributesDefMap = new HashMap<>();
+ novaServerAttributesDefMap.put("accessIPv4", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(),
+ "The manually assigned alternative public IPv4 address of the server", null, null,
+ null));
+ novaServerAttributesDefMap.put("accessIPv6", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(),
+ "The manually assigned alternative public IPv6 address of the server", null, null,
+ null));
+ novaServerAttributesDefMap.put("addresses", DataModelUtil
+ .createAttributeDefinition(PropertyType.MAP.getDisplayName(),
+ "A dict of all network addresses with corresponding port_id", null, DataModelUtil
+ .createEntrySchema(ToscaDataType.NOVA_SERVER_NETWORK_ADDRESS_INFO.getDisplayName(),
+ null, null), null));
+ novaServerAttributesDefMap.put("console_urls", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "URLs of servers consoles",
+ null, null, null));
+ novaServerAttributesDefMap.put("instance_name", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(),
+ "AWS compatible instance name", null, null, null));
+ novaServerAttributesDefMap.put(Constants.NAME_PROPERTY_NAME, DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "Name of the server", null,
+ null, null));
+ novaServerAttributesDefMap.put("show", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(),
+ "Detailed information about resource", null, null, null));
+ return novaServerAttributesDefMap;
+ }
+
+ private static List<Constraint> getUserDataFormatConstraint() {
+ List<Constraint> constraints;
+ Constraint validValues;
+ constraints = new ArrayList<>();
+ validValues =
+ DataModelUtil.createValidValuesConstraint("SOFTWARE_CONFIG", "RAW", "HEAT_CFNTOOLS");
+ constraints.add(validValues);
+ return constraints;
+ }
+
+ private static List<Constraint> getUserDataUpdatePolicyConstraints() {
+ List<Constraint> constraints;
+ Constraint validValues;
+ constraints = new ArrayList<>();
+ validValues = DataModelUtil.createValidValuesConstraint("REPLACE", "IGNORE");
+ constraints.add(validValues);
+ return constraints;
+ }
+
+ private static List<Constraint> getSoftwareConfigTransportConstraints() {
+ List<Constraint> constraints;
+ Constraint validValues;
+ constraints = new ArrayList<>();
+ validValues = DataModelUtil
+ .createValidValuesConstraint("POLL_SERVER_CFN", "POLL_SERVER_HEAT", "POLL_TEMP_URL",
+ "ZAQAR_MESSAGE");
+ constraints.add(validValues);
+ return constraints;
+ }
+
+ private static List<Constraint> getImageUpdatePolicyConstraints() {
+ List<Constraint> constraints;
+ Constraint validValues;
+ constraints = new ArrayList<>();
+ validValues = DataModelUtil
+ .createValidValuesConstraint("REBUILD_PRESERVE_EPHEMERAL", "REPLACE", "REBUILD");
+ constraints.add(validValues);
+ return constraints;
+ }
+
+ private static List<Constraint> getFlavorUpdatePolicyConstraints() {
+ Constraint validValues;
+ List<Constraint> constraints = new ArrayList<>();
+ validValues = DataModelUtil.createValidValuesConstraint("RESIZE", "REPLACE");
+ constraints.add(validValues);
+ return constraints;
+ }
+
+ private static List<Constraint> getDiskConfigConstraints() {
+ List<Constraint> constraints = new ArrayList<>();
+ Constraint validValues = DataModelUtil.createValidValuesConstraint("AUTO", "MANUAL");
+ constraints.add(validValues);
+ return constraints;
+ }
+
+ private static Map<String, DataType> createGlobalDataTypes() {
+ Map<String, DataType> globalDataTypes = new HashMap<>();
+ globalDataTypes.put(ToscaDataType.NOVA_SERVER_PORT_EXTRA_PROPERTIES.getDisplayName(),
+ createPortExtraDataDataType());
+ globalDataTypes.put(ToscaDataType.NOVA_SERVER_NETWORK_ADDRESS_INFO.getDisplayName(),
+ createAddressInfoDataType());
+ return globalDataTypes;
+ }
+
+ private static DataType createAddressInfoDataType() {
+ DataType addressInfoDataType = new DataType();
+ addressInfoDataType.setDerived_from(ToscaDataType.NETWORK_NETWORK_INFO.getDisplayName());
+ addressInfoDataType.setDescription("Network addresses with corresponding port id");
+
+ Map<String, PropertyDefinition> addressInfoProp = new HashMap<>();
+ addressInfoProp.put("port_id", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Port id", false, null,
+ null, null, null));
+ addressInfoDataType.setProperties(addressInfoProp);
+
+ return addressInfoDataType;
+ }
+
+
+ private static DataType createPortExtraDataDataType() {
+ DataType portExtraDataType = new DataType();
+ portExtraDataType.setDerived_from(ToscaDataType.ROOT.getDisplayName());
+ portExtraDataType.setDescription("Nova server network expand properties for port");
+ Map<String, PropertyDefinition> portExtraPropMap = new HashMap<>();
+
+ portExtraPropMap.put("admin_state_up", DataModelUtil
+ .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(),
+ "The administrative state of this port", false, null, null, null, true));
+ portExtraPropMap.put("allowed_address_pairs", DataModelUtil
+ .createPropertyDefinition(PropertyType.LIST.getDisplayName(),
+ "Additional MAC/IP address pairs allowed to pass through the port", false, null, null,
+ DataModelUtil
+ .createEntrySchema(ToscaDataType.NETWORK_ADDRESS_PAIR.getDisplayName(), null, null),
+ null));
+
+ List<Constraint> bindingVnicConstraints = new ArrayList<>();
+ Constraint validValues =
+ DataModelUtil.createValidValuesConstraint("macvtap", "direct", "normal");
+ bindingVnicConstraints.add(validValues);
+ portExtraPropMap.put("binding:vnic_type", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "The vnic type to be bound on the neutron port", false, bindingVnicConstraints, null,
+ null, null));
+
+ portExtraPropMap.put("mac_address", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "MAC address to give to this port", false, null, null, null, null));
+ portExtraPropMap.put("port_security_enabled", DataModelUtil
+ .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(),
+ "Flag to enable/disable port security on the port", false, null, null, null, null));
+ portExtraPropMap.put("qos_policy", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(),
+ "The name or ID of QoS policy to attach to this port", false, null, null, null, null));
+ portExtraPropMap.put("value_specs", DataModelUtil
+ .createPropertyDefinition(PropertyType.MAP.getDisplayName(),
+ "Extra parameters to include in the request", false, null, null,
+ DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null),
+ new HashMap<String, String>()));
+ portExtraDataType.setProperties(portExtraPropMap);
+ return portExtraDataType;
+ }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/ContrailTranslationHelper.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/ContrailTranslationHelper.java
new file mode 100644
index 0000000000..2e1aa9e372
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/ContrailTranslationHelper.java
@@ -0,0 +1,65 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.helper;
+
+import org.openecomp.sdc.heat.datatypes.model.Resource;
+import org.openecomp.sdc.tosca.services.ToscaConstants;
+import org.openecomp.sdc.translator.services.heattotosca.helper.impl.NameExtractorServiceImpl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Optional;
+
+public class ContrailTranslationHelper {
+ /**
+ * Gets compute node type id.
+ *
+ * @param serviceTemplateTranslatedId the service template translated id
+ * @param serviceTemplateResource the service template resource
+ * @return the compute node type id
+ */
+ public String getComputeNodeTypeId(String serviceTemplateTranslatedId,
+ Resource serviceTemplateResource) {
+ NameExtractorService nodeTypeNameExtractor = new NameExtractorServiceImpl();
+ List<PropertyRegexMatcher> propertyRegexMatchers =
+ getPropertiesAndRegexMatchers(nodeTypeNameExtractor);
+ Optional<String> extractedNodeTypeName = nodeTypeNameExtractor
+ .extractNodeTypeNameByPropertiesPriority(serviceTemplateResource.getProperties(),
+ propertyRegexMatchers);
+
+ return ToscaConstants.NODES_PREFIX
+ + (extractedNodeTypeName.isPresent() ? extractedNodeTypeName.get()
+ : "compute_" + serviceTemplateTranslatedId);
+ }
+
+ private List<PropertyRegexMatcher> getPropertiesAndRegexMatchers(
+ NameExtractorService nodeTypeNameExtractor) {
+ List<PropertyRegexMatcher> propertyRegexMatchers = new ArrayList<>();
+ propertyRegexMatchers.add(nodeTypeNameExtractor
+ .getPropertyRegexMatcher("image_name", Collections.singletonList(".+_image_name$"),
+ "_image_name"));
+ propertyRegexMatchers.add(nodeTypeNameExtractor
+ .getPropertyRegexMatcher("flavor", Collections.singletonList(".+_flavor_name$"),
+ "_flavor_name"));
+ return propertyRegexMatchers;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/NameExtractorService.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/NameExtractorService.java
new file mode 100644
index 0000000000..ed338e2bf5
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/NameExtractorService.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.helper;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+
+public interface NameExtractorService {
+ Optional<String> extractNodeTypeNameByPropertiesPriority(
+ Map<String, Object> properties,List<PropertyRegexMatcher> propertiesRegexMatchers);
+
+ PropertyRegexMatcher getPropertyRegexMatcher(String propertyName, List<String> regexMatchers,
+ String propertyValueSearchTerm);
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/PropertyRegexMatcher.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/PropertyRegexMatcher.java
new file mode 100644
index 0000000000..b04234b413
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/PropertyRegexMatcher.java
@@ -0,0 +1,69 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.helper;
+
+import org.apache.commons.collections.CollectionUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Pattern;
+
+public class PropertyRegexMatcher {
+ private String propertyName;
+ private List<Pattern> regexPatterns;
+ private String stringToSearchForPropertyValue;
+
+ public String getPropertyName() {
+ return propertyName;
+ }
+
+ public void setPropertyName(String propertyName) {
+ this.propertyName = propertyName;
+ }
+
+ /**
+ * Sets regex.
+ *
+ * @param regexPatterns the regex patterns
+ */
+ public void setRegex(List<String> regexPatterns) {
+ if (CollectionUtils.isEmpty(this.regexPatterns)) {
+ this.regexPatterns = new ArrayList<>();
+ }
+
+ for (String regexPattern : regexPatterns) {
+ this.regexPatterns.add(Pattern.compile(regexPattern));
+ }
+ }
+
+ public List<Pattern> getRegexPatterns() {
+ return regexPatterns;
+ }
+
+ public String getStringToSearchForPropertyValue() {
+ return stringToSearchForPropertyValue;
+ }
+
+ public void setStringToSearchForPropertyValue(String stringToSearchForPropertyValue) {
+ this.stringToSearchForPropertyValue = stringToSearchForPropertyValue;
+ }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/VolumeTranslationHelper.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/VolumeTranslationHelper.java
new file mode 100644
index 0000000000..ebd38c89d2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/VolumeTranslationHelper.java
@@ -0,0 +1,172 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.helper;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.openecomp.core.utilities.yaml.YamlUtil;
+import org.openecomp.sdc.heat.datatypes.manifest.FileData;
+import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate;
+import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes;
+import org.openecomp.sdc.heat.datatypes.model.Output;
+import org.openecomp.sdc.heat.datatypes.model.Resource;
+import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.ResourceFileDataAndIDs;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo;
+import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil;
+import org.openecomp.sdc.translator.services.heattotosca.TranslationContext;
+import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationBase;
+import org.slf4j.Logger;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.function.Predicate;
+import java.util.stream.Collectors;
+
+public class VolumeTranslationHelper {
+ private final Logger logger;
+
+ public VolumeTranslationHelper(Logger logger) {
+ this.logger = logger;
+ }
+
+ /**
+ * Gets file data containing volume.
+ *
+ * @param filesToSearch the files to search
+ * @param resourceId the resource id
+ * @param translateTo the translate to
+ * @param types the types
+ * @return the file data containing volume
+ */
+ public Optional<ResourceFileDataAndIDs> getFileDataContainingVolume(List<FileData> filesToSearch,
+ String resourceId,
+ TranslateTo translateTo,
+ FileData.Type... types) {
+ if (CollectionUtils.isEmpty(filesToSearch)) {
+ return Optional.empty();
+ }
+
+ List<FileData> fileDatas = Objects.isNull(types) ? filesToSearch
+ : HeatToToscaUtil.getFilteredListOfFileDataByTypes(filesToSearch, types);
+ Optional<ResourceFileDataAndIDs> fileDataAndIDs =
+ getResourceFileDataAndIDsForVolumeConnection(resourceId, translateTo, fileDatas);
+ if (fileDataAndIDs.isPresent()) {
+ return fileDataAndIDs;
+ }
+ return Optional.empty();
+ }
+
+ private Optional<ResourceFileDataAndIDs> getResourceFileDataAndIDsForVolumeConnection(
+ String resourceId, TranslateTo translateTo, List<FileData> fileDatas) {
+ for (FileData data : fileDatas) {
+ HeatOrchestrationTemplate heatOrchestrationTemplate = new YamlUtil()
+ .yamlToObject(translateTo.getContext().getFiles().getFileContent(data.getFile()),
+ HeatOrchestrationTemplate.class);
+ Map<String, Output> outputs = heatOrchestrationTemplate.getOutputs();
+ if (Objects.isNull(outputs)) {
+ continue;
+ }
+ Output output = outputs.get(resourceId);
+ if (Objects.nonNull(output)) {
+ Optional<AttachedResourceId> attachedOutputId = HeatToToscaUtil
+ .extractAttachedResourceId(data.getFile(), heatOrchestrationTemplate,
+ translateTo.getContext(), output.getValue());
+ if (attachedOutputId.isPresent()) {
+ AttachedResourceId attachedResourceId = attachedOutputId.get();
+ if (!isOutputIsGetResource(resourceId, data, attachedResourceId)) {
+ continue;
+ }
+ String translatedId = (String) attachedResourceId.getTranslatedId();
+ if (isOutputOfTypeCinderVolume(translateTo, data, heatOrchestrationTemplate,
+ translatedId)) {
+ ResourceFileDataAndIDs fileDataAndIDs =
+ new ResourceFileDataAndIDs((String) attachedResourceId.getEntityId(),
+ translatedId,
+ data);
+ return Optional.of(fileDataAndIDs);
+ } else {
+ logger.warn(
+ "output: '" + resourceId + "' in file '" + data.getFile() + "' is not of type '"
+ + HeatResourcesTypes.CINDER_VOLUME_RESOURCE_TYPE.getHeatResource() + "'");
+ }
+ }
+ } else {
+ logger.warn("output: '" + resourceId + "' in file '" + data.getFile() + "' is not found");
+ }
+ }
+ return Optional.empty();
+ }
+
+ private boolean isOutputOfTypeCinderVolume(TranslateTo translateTo, FileData data,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ String translatedId) {
+ return getResourceByTranslatedResourceId(data.getFile(), heatOrchestrationTemplate,
+ translatedId, translateTo,
+ HeatResourcesTypes.CINDER_VOLUME_RESOURCE_TYPE.getHeatResource())
+ .isPresent();
+ }
+
+ private Optional<List<Map.Entry<String, Resource>>> getResourceByTranslatedResourceId(
+ String fileName, HeatOrchestrationTemplate heatOrchestrationTemplate,
+ String translatedResourceId, TranslateTo translateTo, String heatResourceType) {
+ List<Map.Entry<String, Resource>> list = heatOrchestrationTemplate.getResources().entrySet()
+ .stream()
+ .filter(
+ entry -> getPredicatesForTranslatedIdToResourceId(fileName, heatOrchestrationTemplate,
+ translatedResourceId, translateTo.getContext(), heatResourceType)
+ .stream()
+ .allMatch(p -> p.test(entry)))
+ .collect(Collectors.toList());
+ if (CollectionUtils.isEmpty(list)) {
+ return Optional.empty();
+ } else {
+ return Optional.of(list);
+ }
+ }
+
+ private List<Predicate<Map.Entry<String, Resource>>> getPredicatesForTranslatedIdToResourceId(
+ String fileName, HeatOrchestrationTemplate heatOrchestrationTemplate,
+ String translatedResourceId, TranslationContext context, String heatResourceType) {
+ List<Predicate<Map.Entry<String, Resource>>> list = new ArrayList<>();
+ list.add(entry -> entry.getValue().getType().equals(heatResourceType));
+ list.add(entry -> {
+ Optional<String> resourceTranslatedId = ResourceTranslationBase
+ .getResourceTranslatedId(fileName, heatOrchestrationTemplate, entry.getKey(), context);
+ return resourceTranslatedId.isPresent()
+ && resourceTranslatedId.get().equals(translatedResourceId);
+ });
+ return list;
+ }
+
+ private boolean isOutputIsGetResource(String resourceId, FileData data,
+ AttachedResourceId attachedResourceId) {
+ if (attachedResourceId.isGetResource()) {
+ return true;
+ } else {
+ logger.warn("output: '" + resourceId + "' in file '" + data.getFile()
+ + "' is not defined as get_resource and therefor not supported.");
+ return false;
+ }
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/impl/NameExtractorServiceImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/impl/NameExtractorServiceImpl.java
new file mode 100644
index 0000000000..9bd3494698
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/impl/NameExtractorServiceImpl.java
@@ -0,0 +1,95 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.helper.impl;
+
+import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId;
+import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil;
+import org.openecomp.sdc.translator.services.heattotosca.helper.NameExtractorService;
+import org.openecomp.sdc.translator.services.heattotosca.helper.PropertyRegexMatcher;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.regex.Pattern;
+
+public class NameExtractorServiceImpl implements NameExtractorService {
+
+ @Override
+ public Optional<String> extractNodeTypeNameByPropertiesPriority(
+ Map<String, Object> properties,List<PropertyRegexMatcher> propertiesRegexMatchers) {
+ for (PropertyRegexMatcher propertyRegexMatcher : propertiesRegexMatchers) {
+ Optional<String> parameterNameValue =
+ getPropertyParameterNameValue(properties, propertyRegexMatcher.getPropertyName());
+ if (parameterNameValue.isPresent()) {
+ if (isPropertyValueMatchNamingConvention(propertyRegexMatcher, parameterNameValue.get())) {
+ return Optional.of(parameterNameValue.get().substring(0, parameterNameValue.get()
+ .lastIndexOf(propertyRegexMatcher.getStringToSearchForPropertyValue())));
+ }
+ }
+ }
+
+ return Optional.empty();
+ }
+
+ private boolean isPropertyValueMatchNamingConvention(PropertyRegexMatcher propertyRegexMatcher,
+ String propertyValue) {
+ for (Pattern pattern : propertyRegexMatcher.getRegexPatterns()) {
+ if (pattern.matcher(propertyValue).matches()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private Optional<String> getPropertyParameterNameValue(Map<String, Object> properties,
+ String prop) {
+ Object propObj = properties.get(prop);
+ Optional<AttachedResourceId> property = HeatToToscaUtil.extractProperty(propObj);
+ if (property.isPresent()) {
+ AttachedResourceId extractedProperty = property.get();
+ return getParameterName(extractedProperty);
+ }
+ return Optional.empty();
+ }
+
+ private Optional<String> getParameterName(AttachedResourceId extractedProperty) {
+ if (!extractedProperty.isGetParam()) {
+ return Optional.empty();
+ }
+ Object entityId = extractedProperty.getEntityId();
+ if (entityId instanceof String) {
+ return Optional.of((String) entityId);
+ } else {
+ return Optional.of((String) ((List) entityId).get(0));
+ }
+ }
+
+ @Override
+ public PropertyRegexMatcher getPropertyRegexMatcher(String propertyName,
+ List<String> regexMatchers,
+ String propertyValueSearchTerm) {
+ PropertyRegexMatcher propertyRegexMatcher = new PropertyRegexMatcher();
+ propertyRegexMatcher.setPropertyName(propertyName);
+ propertyRegexMatcher.setRegex(regexMatchers);
+ propertyRegexMatcher.setStringToSearchForPropertyValue(propertyValueSearchTerm);
+ return propertyRegexMatcher;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/BaseResourceConnection.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/BaseResourceConnection.java
new file mode 100644
index 0000000000..d901ae9c98
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/BaseResourceConnection.java
@@ -0,0 +1,174 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.apache.commons.collections4.MapUtils;
+import org.openecomp.core.utilities.yaml.YamlUtil;
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+import org.openecomp.sdc.heat.datatypes.manifest.FileData;
+import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate;
+import org.openecomp.sdc.heat.datatypes.model.Resource;
+import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.NodeType;
+import org.openecomp.sdc.tosca.datatypes.model.RequirementAssignment;
+import org.openecomp.sdc.tosca.datatypes.model.RequirementDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.tosca.services.DataModelUtil;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo;
+import org.openecomp.sdc.translator.services.heattotosca.errors.TranslatorErrorCodes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.function.Predicate;
+
+abstract class BaseResourceConnection<T> {
+ protected static Logger logger =
+ LoggerFactory.getLogger(ResourceTranslationCinderVolumeAttachmentImpl.class);
+ protected TranslateTo translateTo;
+ FileData nestedFileData;
+ NodeTemplate substitutionNodeTemplate;
+ NodeType nodeType;
+ ResourceTranslationBase resourceTranslationBase;
+
+ BaseResourceConnection(ResourceTranslationBase resourceTranslationBase, TranslateTo translateTo,
+ FileData nestedFileData, NodeTemplate substitutionNodeTemplate,
+ NodeType nodeType) {
+ this.translateTo = translateTo;
+ this.nestedFileData = nestedFileData;
+ this.substitutionNodeTemplate = substitutionNodeTemplate;
+ this.nodeType = nodeType;
+ this.resourceTranslationBase = resourceTranslationBase;
+ }
+
+ abstract boolean isDesiredNodeTemplateType(NodeTemplate nodeTemplate);
+
+ abstract List<Predicate<T>> getPredicatesListForConnectionPoints();
+
+ abstract Optional<List<String>> getConnectorParamName(String heatResourceId,
+ Resource heatResource,
+ HeatOrchestrationTemplate
+ nestedHeatOrchestrationTemplate);
+
+ abstract String getDesiredResourceType();
+
+ abstract String getTranslatedResourceIdFromSubstitutionMapping(
+ ServiceTemplate nestedServiceTemplate, Map.Entry<String, T> entry);
+
+ abstract void addRequirementToConnectResources(Map.Entry<String, T> entry,
+ List<String> paramNames);
+
+ abstract List<Map<String, T>> getAllConnectionPoints();
+
+ void connect() {
+ ServiceTemplate nestedServiceTemplate = translateTo.getContext().getTranslatedServiceTemplates()
+ .get(translateTo.getResource().getType());
+ List<String> paramNames = null;
+ HeatOrchestrationTemplate nestedHeatOrchestrationTemplate = new YamlUtil()
+ .yamlToObject(translateTo.getContext().getFileContent(nestedFileData.getFile()),
+ HeatOrchestrationTemplate.class);
+ List<Map<String, T>> exposedConnectionPoints = getAllConnectionPoints();
+ for (Map<String, T> connectionPointsMap : exposedConnectionPoints) {
+ for (Map.Entry<String, T> entry : connectionPointsMap.entrySet()) {
+ String translatedResourceId =
+ getTranslatedResourceIdFromSubstitutionMapping(nestedServiceTemplate, entry);
+ NodeTemplate nodeTemplate = nestedServiceTemplate.getTopology_template().getNode_templates()
+ .get(translatedResourceId);
+ if (!isDesiredNodeTemplateType(nodeTemplate)) {
+ continue;
+ }
+ paramNames = createResourcesConnection(translatedResourceId, paramNames,
+ nestedHeatOrchestrationTemplate, entry);
+ }
+ }
+ }
+
+ private List<String> createResourcesConnection(String translatedResourceId,
+ List<String> paramNames,
+ HeatOrchestrationTemplate
+ nestedHeatOrchestrationTemplate,
+ Map.Entry<String, T> entry) {
+ List<String> params = paramNames;
+ Optional<List<Map.Entry<String, Resource>>> heatResources =
+ getResourceByTranslatedResourceId(translatedResourceId, nestedHeatOrchestrationTemplate);
+ if (heatResources.isPresent()) {
+ params =
+ addRequirementAndGetConnectorParamsFromResourceProperties(nestedHeatOrchestrationTemplate,
+ entry, params, heatResources.get());
+ }
+ return params;
+ }
+
+ private List<String> addRequirementAndGetConnectorParamsFromResourceProperties(
+ HeatOrchestrationTemplate nestedHeatOrchestrationTemplate, Map.Entry<String, T> entry,
+ List<String> params, List<Map.Entry<String, Resource>> heatResources) {
+ Resource heatResource;
+ for (Map.Entry<String, Resource> resourceEntry : heatResources) {
+ heatResource = resourceEntry.getValue();
+ if (!MapUtils.isEmpty(heatResource.getProperties())) {
+ Optional<List<String>> connectorParamName =
+ getConnectorParamName(resourceEntry.getKey(), heatResource,
+ nestedHeatOrchestrationTemplate);
+ if (!connectorParamName.isPresent()) {
+ break;
+ } else {
+ params = connectorParamName.get();
+ }
+ }
+ Objects.requireNonNull(params);
+ addRequirementToConnectResources(entry, params);
+ }
+ return params;
+ }
+
+ protected Optional<List<Map.Entry<String, Resource>>> getResourceByTranslatedResourceId(
+ String translatedResourceId, HeatOrchestrationTemplate nestedHeatOrchestrationTemplate) {
+ Optional<List<Map.Entry<String, Resource>>> resourceByTranslatedResourceId =
+ resourceTranslationBase.getResourceByTranslatedResourceId(nestedFileData.getFile(),
+ nestedHeatOrchestrationTemplate, translatedResourceId, translateTo,
+ getDesiredResourceType());
+ if (!resourceByTranslatedResourceId.isPresent()) {
+ throw new CoreException((new ErrorCode.ErrorCodeBuilder()).withMessage(
+ "Failed to get original resource from heat for translate resource id '"
+ + translatedResourceId + "'")
+ .withId(TranslatorErrorCodes.HEAT_TO_TOSCA_MAPPING_COLLISION)
+ .withCategory(ErrorCategory.APPLICATION).build());
+ }
+ return resourceByTranslatedResourceId;
+ }
+
+ void createRequirementAssignment(Map.Entry<String, RequirementDefinition> entry, String node,
+ NodeTemplate nodeTemplate) {
+ if (Objects.nonNull(node)) {
+ RequirementAssignment requirementAssignment;
+ requirementAssignment = new RequirementAssignment();
+ requirementAssignment.setRelationship(entry.getValue().getRelationship());
+ requirementAssignment.setCapability(entry.getValue().getCapability());
+ requirementAssignment.setNode(node);
+ DataModelUtil.addRequirementAssignment(nodeTemplate, entry.getKey(), requirementAssignment);
+ }
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ContrailV2VmInterfaceToNetResourceConnection.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ContrailV2VmInterfaceToNetResourceConnection.java
new file mode 100644
index 0000000000..890d2a76af
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ContrailV2VmInterfaceToNetResourceConnection.java
@@ -0,0 +1,139 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.openecomp.sdc.heat.datatypes.manifest.FileData;
+import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate;
+import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes;
+import org.openecomp.sdc.heat.datatypes.model.Resource;
+import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType;
+import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
+import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType;
+import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.NodeType;
+import org.openecomp.sdc.tosca.datatypes.model.RequirementDefinition;
+import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslatedHeatResource;
+import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.function.Predicate;
+
+public class ContrailV2VmInterfaceToNetResourceConnection extends PortToNetResourceConnection {
+
+ public ContrailV2VmInterfaceToNetResourceConnection(
+ ResourceTranslationBase resourceTranslationBase, TranslateTo translateTo,
+ FileData nestedFileData, NodeTemplate substitutionNodeTemplate, NodeType nodeType) {
+ super(resourceTranslationBase, translateTo, nestedFileData, substitutionNodeTemplate, nodeType);
+ }
+
+ @Override
+ protected boolean isDesiredNodeTemplateType(NodeTemplate nodeTemplate) {
+ return nodeTemplate.getType()
+ .equals(ToscaNodeType.CONTRAILV2_VIRTUAL_MACHINE_INTERFACE.getDisplayName());
+ }
+
+ @Override
+ protected Optional<List<String>> getConnectorParamName(String heatResourceId,
+ Resource heatResource,
+ HeatOrchestrationTemplate nestedHeatOrchestrationTemplate) {
+ List<String> networks = new ArrayList<>();
+ Object virtualNetworkRefs = heatResource.getProperties().get("virtual_network_refs");
+ if (Objects.isNull(virtualNetworkRefs) || !(virtualNetworkRefs instanceof List)
+ || ((List) virtualNetworkRefs).size() == 0) {
+ return Optional.empty();
+ }
+ if (((List) virtualNetworkRefs).size() > 1) {
+ logger.warn("Heat resource: '" + translateTo.getResourceId() + "' with nested heat file: '"
+ + translateTo.getResource().getType()
+ + "' has resource '" + heatResourceId + "' with type '"
+ + HeatResourcesTypes.CONTRAIL_V2_VIRTUAL_MACHINE_INTERFACE_RESOURCE_TYPE.getHeatResource()
+ + "' which include 'virtual_network_refs' property with more than one network values, "
+ + "only the first network will be translated, all rest will be ignored in TOSCA "
+ + "translation.");
+ }
+ Object virtualNetworkRef = ((List) virtualNetworkRefs).get(0);
+ Optional<AttachedResourceId> network = HeatToToscaUtil
+ .extractAttachedResourceId(nestedFileData.getFile(), nestedHeatOrchestrationTemplate,
+ translateTo.getContext(), virtualNetworkRef);
+ if (network.isPresent() && network.get().isGetParam()) {
+ networks.add((String) network.get().getEntityId());
+ }
+ return Optional.of(networks);
+ }
+
+ @Override
+ protected String getDesiredResourceType() {
+ return HeatResourcesTypes.CONTRAIL_V2_VIRTUAL_MACHINE_INTERFACE_RESOURCE_TYPE.getHeatResource();
+ }
+
+ @Override
+ protected void addRequirementToConnectResources(Map.Entry<String, RequirementDefinition> entry,
+ List<String> paramNames) {
+ for (String paramName : paramNames) {
+ Object paramValue = translateTo.getResource().getProperties().get(paramName);
+ String contrailAttachedResourceId =
+ HeatToToscaUtil.extractContrailGetResourceAttachedHeatResourceId(paramValue);
+ Optional<String> node;
+ if (contrailAttachedResourceId != null) { // contrail get resource
+ node = ResourceTranslationBase.getResourceTranslatedId(translateTo.getHeatFileName(),
+ translateTo.getHeatOrchestrationTemplate(), contrailAttachedResourceId,
+ translateTo.getContext());
+ if (node.isPresent()) {
+ createRequirementAssignment(entry, node.get(), substitutionNodeTemplate);
+ }
+ } else {
+ Optional<AttachedResourceId> attachedResourceId =
+ HeatToToscaUtil.extractAttachedResourceId(translateTo, paramName);
+ if (!attachedResourceId.isPresent()) {
+ return;
+ }
+ AttachedResourceId resourceId = attachedResourceId.get();
+ if (resourceId.isGetParam()) {
+ TranslatedHeatResource shareResource =
+ translateTo.getContext().getHeatSharedResourcesByParam()
+ .get(resourceId.getEntityId());
+ if (Objects.nonNull(shareResource)
+ && !HeatToToscaUtil.isHeatFileNested(translateTo, translateTo.getHeatFileName())) {
+ createRequirementAssignment(entry, shareResource.getTranslatedId(),
+ substitutionNodeTemplate);
+ }
+ }
+ }
+ }
+ }
+
+ @Override
+ protected List<Predicate<RequirementDefinition>> getPredicatesListForConnectionPoints() {
+ ArrayList<Predicate<RequirementDefinition>> predicates = new ArrayList<>();
+ predicates.add(
+ req -> req.getCapability().equals(ToscaCapabilityType.NETWORK_LINKABLE.getDisplayName())
+ && req.getNode().equals(ToscaNodeType.ROOT.getDisplayName())
+ && req.getRelationship().equals(ToscaRelationshipType.NETWORK_LINK_TO.getDisplayName())
+ );
+ return predicates;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/NovaAndPortResourceConnectionHelper.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/NovaAndPortResourceConnectionHelper.java
new file mode 100644
index 0000000000..bc60a24223
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/NovaAndPortResourceConnectionHelper.java
@@ -0,0 +1,106 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.openecomp.sdc.heat.datatypes.manifest.FileData;
+import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate;
+import org.openecomp.sdc.heat.datatypes.model.Resource;
+import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.NodeType;
+import org.openecomp.sdc.tosca.datatypes.model.RequirementDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.function.Predicate;
+
+public class NovaAndPortResourceConnectionHelper
+ extends BaseResourceConnection<RequirementDefinition> {
+ public NovaAndPortResourceConnectionHelper(ResourceTranslationBase resourceTranslationBase,
+ TranslateTo translateTo, FileData nestedFileData,
+ NodeTemplate substitutionNodeTemplate,
+ NodeType nodeType) {
+ super(resourceTranslationBase, translateTo, nestedFileData, substitutionNodeTemplate, nodeType);
+ }
+
+ @Override
+ boolean isDesiredNodeTemplateType(NodeTemplate nodeTemplate) {
+ return false;
+ }
+
+ @Override
+ List<Predicate<RequirementDefinition>> getPredicatesListForConnectionPoints() {
+ return null;
+ }
+
+ @Override
+ Optional<List<String>> getConnectorParamName(String heatResourceId,
+ Resource heatResource,
+ HeatOrchestrationTemplate
+ nestedHeatOrchestrationTemplate) {
+ return null;
+ }
+
+ @Override
+ String getDesiredResourceType() {
+ return null;
+ }
+
+ @Override
+ String getTranslatedResourceIdFromSubstitutionMapping(
+ ServiceTemplate nestedServiceTemplate,Map.Entry<String,
+ RequirementDefinition> entry) {
+ return null;
+ }
+
+ @Override
+ void addRequirementToConnectResources(Map.Entry<String, RequirementDefinition> entry,
+ List<String> paramNames) {
+
+ }
+
+ @Override
+ List<Map<String, RequirementDefinition>> getAllConnectionPoints() {
+ List<Map<String, RequirementDefinition>> exposedRequirementsList = new ArrayList<>();
+ List<Predicate<RequirementDefinition>> predicates = getPredicatesListForConnectionPoints();
+ List<Map<String, RequirementDefinition>> requirements = this.nodeType.getRequirements();
+ if (requirements == null) {
+ return exposedRequirementsList;
+ }
+ requirements.stream()
+ .map(Map::entrySet)
+ .forEach(x -> x.stream()
+ .filter(entry -> predicates
+ .stream()
+ .anyMatch(p -> p.test(entry.getValue())))
+ .forEach(entry -> {
+ Map<String, RequirementDefinition> exposedRequirementsMap = new HashMap<>();
+ exposedRequirementsMap.put(entry.getKey(), entry.getValue());
+ exposedRequirementsList.add(exposedRequirementsMap);
+ }));
+
+ return exposedRequirementsList;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/NovaToVolResourceConnection.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/NovaToVolResourceConnection.java
new file mode 100644
index 0000000000..8bab0dbc50
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/NovaToVolResourceConnection.java
@@ -0,0 +1,228 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.heat.datatypes.manifest.FileData;
+import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate;
+import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes;
+import org.openecomp.sdc.heat.datatypes.model.Resource;
+import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType;
+import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
+import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType;
+import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
+import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.NodeType;
+import org.openecomp.sdc.tosca.datatypes.model.RequirementDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.tosca.services.ToscaAnalyzerService;
+import org.openecomp.sdc.tosca.services.impl.ToscaAnalyzerServiceImpl;
+import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.ResourceFileDataAndIDs;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslatedHeatResource;
+import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil;
+import org.openecomp.sdc.translator.services.heattotosca.TranslationContext;
+import org.openecomp.sdc.translator.services.heattotosca.errors.MissingMandatoryPropertyErrorBuilder;
+import org.openecomp.sdc.translator.services.heattotosca.helper.VolumeTranslationHelper;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.function.Predicate;
+import java.util.stream.Collectors;
+
+class NovaToVolResourceConnection extends NovaAndPortResourceConnectionHelper {
+
+ public NovaToVolResourceConnection(ResourceTranslationBase resourceTranslationBase,
+ TranslateTo translateTo, FileData nestedFileData,
+ NodeTemplate substitutionNodeTemplate, NodeType nodeType) {
+ super(resourceTranslationBase, translateTo, nestedFileData, substitutionNodeTemplate, nodeType);
+ }
+
+ @Override
+ boolean isDesiredNodeTemplateType(NodeTemplate nodeTemplate) {
+ ToscaAnalyzerService toscaAnalyzerService = new ToscaAnalyzerServiceImpl();
+ ToscaServiceModel toscaServiceModel = HeatToToscaUtil.getToscaServiceModel(translateTo);
+ return toscaAnalyzerService.isTypeOf(nodeTemplate, ToscaNodeType.NOVA_SERVER.getDisplayName(),
+ translateTo.getContext().getTranslatedServiceTemplates()
+ .get(translateTo.getResource().getType()), toscaServiceModel);
+ }
+
+ @Override
+ List<Predicate<RequirementDefinition>> getPredicatesListForConnectionPoints() {
+ ArrayList<Predicate<RequirementDefinition>> predicates = new ArrayList<>();
+ predicates
+ .add(req -> req.getCapability().equals(ToscaCapabilityType.ATTACHMENT.getDisplayName())
+ && req.getNode().equals(ToscaNodeType.BLOCK_STORAGE.getDisplayName())
+ && req.getRelationship()
+ .equals(ToscaRelationshipType.NATIVE_ATTACHES_TO.getDisplayName()));
+ return predicates;
+ }
+
+ @Override
+ Optional<List<String>> getConnectorParamName(
+ String heatResourceId, Resource heatResource,
+ HeatOrchestrationTemplate nestedHeatOrchestrationTemplate) {
+ Optional<AttachedResourceId> volumeId = HeatToToscaUtil
+ .extractAttachedResourceId(nestedFileData.getFile(), nestedHeatOrchestrationTemplate,
+ translateTo.getContext(), heatResource.getProperties().get("volume_id"));
+ if (volumeId.isPresent() && volumeId.get().isGetParam()) {
+ return Optional.of(Collections.singletonList((String) volumeId.get().getEntityId()));
+ } else {
+ return Optional.empty();
+ }
+ }
+
+ @Override
+ String getDesiredResourceType() {
+ return HeatResourcesTypes.CINDER_VOLUME_ATTACHMENT_RESOURCE_TYPE.getHeatResource();
+ }
+
+ @Override
+ protected Optional<List<Map.Entry<String, Resource>>> getResourceByTranslatedResourceId(
+ String translatedResourceId, HeatOrchestrationTemplate nestedHeatOrchestrationTemplate) {
+
+ List<Predicate<Map.Entry<String, Resource>>> predicates =
+ buildPredicates(nestedFileData.getFile(), nestedHeatOrchestrationTemplate,
+ translatedResourceId);
+ List<Map.Entry<String, Resource>> list =
+ nestedHeatOrchestrationTemplate.getResources().entrySet()
+ .stream()
+ .filter(entry -> predicates
+ .stream()
+ .allMatch(p -> p.test(entry)))
+ .collect(Collectors.toList());
+ if (CollectionUtils.isEmpty(list)) {
+ return Optional.empty();
+ } else {
+ return Optional.of(list);
+ }
+ }
+
+ private List<Predicate<Map.Entry<String, Resource>>> buildPredicates(String fileName,
+ HeatOrchestrationTemplate
+ heatOrchestrationTemplate,
+ String
+ novaTranslatedResourceId) {
+ List<Predicate<Map.Entry<String, Resource>>> list = new ArrayList<>();
+ list.add(entry -> entry.getValue().getType().equals(getDesiredResourceType()));
+ list.add(entry -> {
+ Object instanceUuidProp = entry.getValue().getProperties().get("instance_uuid");
+ TranslationContext context = translateTo.getContext();
+ Optional<AttachedResourceId> instanceUuid = HeatToToscaUtil
+ .extractAttachedResourceId(fileName, heatOrchestrationTemplate, context,
+ instanceUuidProp);
+ if (instanceUuid.isPresent()) {
+ Optional<String> resourceTranslatedId = ResourceTranslationBase
+ .getResourceTranslatedId(fileName, heatOrchestrationTemplate,
+ (String) instanceUuid.get().getTranslatedId(), context);
+ return resourceTranslatedId.isPresent()
+ && resourceTranslatedId.get().equals(novaTranslatedResourceId);
+
+ } else {
+ throw new CoreException(new MissingMandatoryPropertyErrorBuilder("instance_uuid").build());
+ }
+ });
+ return list;
+ }
+
+ @Override
+ String getTranslatedResourceIdFromSubstitutionMapping(ServiceTemplate nestedServiceTemplate,
+ Map.Entry<String,
+ RequirementDefinition> entry) {
+ List<String> substitutionMapping =
+ nestedServiceTemplate.getTopology_template().getSubstitution_mappings().getRequirements()
+ .get(entry.getKey());
+ return substitutionMapping.get(0);
+ }
+
+ @Override
+ void addRequirementToConnectResources(Map.Entry<String, RequirementDefinition> entry,
+ List<String> paramNames) {
+ String paramName = paramNames.get(0);
+ Optional<AttachedResourceId> attachedResourceId =
+ HeatToToscaUtil.extractAttachedResourceId(translateTo, paramName);
+ String node;
+ if (!attachedResourceId.isPresent()) {
+ return;
+ }
+ AttachedResourceId attachedResource = attachedResourceId.get();
+ if (attachedResource.isGetResource()) {
+ String volTranslatedId = (String) attachedResource.getTranslatedId();
+ Resource volServerResource = HeatToToscaUtil
+ .getResource(translateTo.getHeatOrchestrationTemplate(), volTranslatedId,
+ translateTo.getHeatFileName());
+ if (!StringUtils.equals(HeatResourcesTypes.CINDER_VOLUME_RESOURCE_TYPE.getHeatResource(),
+ volServerResource.getType())) {
+ logger.warn("Volume attachment used from nested resource " + translateTo.getResourceId()
+ + " is pointing to incorrect resource type(" + volServerResource.getType()
+ + ") for relation through the parameter '" + paramName + "."
+ + " The connection to the volume is ignored. "
+ + "Supported types are: "
+ + HeatResourcesTypes.CINDER_VOLUME_RESOURCE_TYPE.getHeatResource());
+ return;
+ }
+ node = volTranslatedId;
+ createRequirementAssignment(entry, node, substitutionNodeTemplate);
+ } else if (attachedResource.isGetParam()) {
+ TranslatedHeatResource shareResource =
+ translateTo.getContext().getHeatSharedResourcesByParam()
+ .get(attachedResource.getEntityId());
+ if (Objects.nonNull(shareResource)
+ && !HeatToToscaUtil.isHeatFileNested(translateTo, translateTo.getHeatFileName())) {
+ if (!StringUtils.equals(HeatResourcesTypes.CINDER_VOLUME_RESOURCE_TYPE.getHeatResource(),
+ shareResource.getHeatResource().getType())) {
+ logger.warn("Volume attachment used from nested resource " + translateTo.getResourceId()
+ + " is pointing to incorrect resource type("
+ + shareResource.getHeatResource().getType() + ") for relation through the parameter '"
+ + paramName + "."
+ + " The connection to the volume is ignored. "
+ + "Supported types are: "
+ + HeatResourcesTypes.CINDER_VOLUME_RESOURCE_TYPE.getHeatResource());
+ return;
+ }
+ node = shareResource.getTranslatedId();
+ createRequirementAssignment(entry, node, substitutionNodeTemplate);
+ } else if (Objects.isNull(shareResource)) {
+ List<FileData> allFilesData = translateTo.getContext().getManifest().getContent().getData();
+ Optional<FileData> fileData =
+ HeatToToscaUtil.getFileData(translateTo.getHeatFileName(), allFilesData);
+ if (fileData.isPresent()) {
+ Optional<ResourceFileDataAndIDs> fileDataContainingResource =
+ new VolumeTranslationHelper(logger)
+ .getFileDataContainingVolume(fileData.get().getData(),
+ (String) attachedResource.getEntityId(), translateTo, FileData.Type.HEAT_VOL);
+ if (fileDataContainingResource.isPresent()) {
+ createRequirementAssignment(entry,
+ fileDataContainingResource.get().getTranslatedResourceId(),
+ substitutionNodeTemplate);
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/PortToNetResourceConnection.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/PortToNetResourceConnection.java
new file mode 100644
index 0000000000..8adfca305e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/PortToNetResourceConnection.java
@@ -0,0 +1,200 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.openecomp.sdc.heat.datatypes.manifest.FileData;
+import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate;
+import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes;
+import org.openecomp.sdc.heat.datatypes.model.Resource;
+import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType;
+import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
+import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType;
+import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.NodeType;
+import org.openecomp.sdc.tosca.datatypes.model.RequirementDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslatedHeatResource;
+import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.function.Predicate;
+
+public class PortToNetResourceConnection extends NovaAndPortResourceConnectionHelper {
+
+ public PortToNetResourceConnection(ResourceTranslationBase resourceTranslationBase,
+ TranslateTo translateTo, FileData nestedFileData,
+ NodeTemplate substitutionNodeTemplate, NodeType nodeType) {
+ super(resourceTranslationBase, translateTo, nestedFileData, substitutionNodeTemplate, nodeType);
+ }
+
+ @Override
+ protected boolean isDesiredNodeTemplateType(NodeTemplate nodeTemplate) {
+ return nodeTemplate.getType().equals(ToscaNodeType.NEUTRON_PORT.getDisplayName());
+ }
+
+ @Override
+ protected List<Predicate<RequirementDefinition>> getPredicatesListForConnectionPoints() {
+ ArrayList<Predicate<RequirementDefinition>> predicates = new ArrayList<>();
+ predicates.add(
+ req -> req.getCapability().equals(ToscaCapabilityType.NETWORK_LINKABLE.getDisplayName())
+ && req.getNode().equals(ToscaNodeType.ROOT.getDisplayName())
+ && req.getRelationship().equals(
+ ToscaRelationshipType.NETWORK_LINK_TO.getDisplayName()));
+ return predicates;
+ }
+
+ @Override
+ protected Optional<List<String>> getConnectorParamName(String heatResourceId,
+ Resource heatResource,
+ HeatOrchestrationTemplate
+ nestedHeatOrchestrationTemplate) {
+ Optional<AttachedResourceId> network = HeatToToscaUtil
+ .extractAttachedResourceId(nestedFileData.getFile(), nestedHeatOrchestrationTemplate,
+ translateTo.getContext(), heatResource.getProperties().get("network"));
+ if (network.isPresent() && network.get().isGetParam()) {
+ return Optional.of(Collections.singletonList((String) network.get().getEntityId()));
+ } else {
+ network = HeatToToscaUtil
+ .extractAttachedResourceId(nestedFileData.getFile(), nestedHeatOrchestrationTemplate,
+ translateTo.getContext(), heatResource.getProperties().get("network_id"));
+ if (network.isPresent() && network.get().isGetParam()) {
+ return Optional.of(Collections.singletonList((String) network.get().getEntityId()));
+ } else {
+ return Optional.empty();
+ }
+ }
+ }
+
+ @Override
+ protected String getDesiredResourceType() {
+ return HeatResourcesTypes.NEUTRON_PORT_RESOURCE_TYPE.getHeatResource();
+ }
+
+ @Override
+ protected String getTranslatedResourceIdFromSubstitutionMapping(
+ ServiceTemplate nestedServiceTemplate, Map.Entry<String, RequirementDefinition> entry) {
+ List<String> substitutionMapping =
+ nestedServiceTemplate.getTopology_template().getSubstitution_mappings().getRequirements()
+ .get(entry.getKey());
+ return substitutionMapping.get(0);
+ }
+
+ @Override
+ protected void addRequirementToConnectResources(Map.Entry<String, RequirementDefinition> entry,
+ List<String> paramNames) {
+ String paramName = paramNames.get(
+ 0); // port can connect to one network only and
+ // we are expecting to have only one param(unlike security rules to port)
+ Object paramValue = translateTo.getResource().getProperties().get(paramName);
+ if (paramValue == null) {
+ logger.warn(
+ "Nested resource '" + translateTo.getResourceId() + "' is not including property '"
+ + paramName + "' with value for the nested heat file, therefore, '" + entry.getKey()
+ + "' TOSCA requirement will not be connected.");
+ return;
+ }
+ List<String> supportedNetworkTypes =
+ Arrays.asList(HeatResourcesTypes.NEUTRON_NET_RESOURCE_TYPE.getHeatResource(),
+ HeatResourcesTypes.CONTRAIL_VIRTUAL_NETWORK_RESOURCE_TYPE.getHeatResource(),
+ HeatResourcesTypes.CONTRAIL_V2_VIRTUAL_NETWORK_RESOURCE_TYPE.getHeatResource());
+
+ Optional<String> targetTranslatedNodeId =
+ getConnectionTargetNodeUsingGetResourceFunc(entry, paramName, paramValue,
+ supportedNetworkTypes);
+ if (targetTranslatedNodeId.isPresent()) {
+ createRequirementAssignment(entry, targetTranslatedNodeId.get(), substitutionNodeTemplate);
+ } else {
+ targetTranslatedNodeId =
+ getConnectionTargetNodeUsingGetParam(entry, paramName, supportedNetworkTypes);
+ if (targetTranslatedNodeId.isPresent()) {
+ createRequirementAssignment(entry, targetTranslatedNodeId.get(), substitutionNodeTemplate);
+ }
+ }
+ }
+
+ private boolean validateResourceTypeSupportedForReqCreation(String sourceResourceId,
+ final String sourcePropertyName,
+ String sourceReqId,
+ Resource targetResource,
+ List<String> supportedTypes) {
+ if (!resourceTranslationBase.isResourceTypeSupported(targetResource, supportedTypes)) {
+ logger.warn("Nested resource '" + sourceResourceId + "' property '" + sourcePropertyName
+ + "' is pointing to a resource with type '" + targetResource.getType()
+ + "' which is not supported for requirement '" + sourceReqId
+ + "' that connect port to network. \nSupported types are: '" + supportedTypes.toString()
+ + "', therefore, this TOSCA requirement will not be connected.");
+ return false;
+ }
+ return true;
+ }
+
+ private Optional<String> getConnectionTargetNodeUsingGetParam(
+ Map.Entry<String, RequirementDefinition> requirementDefinitionEntry, String paramName,
+ List<String> supportedTargetNodeTypes) {
+ Optional<AttachedResourceId> attachedResourceId =
+ HeatToToscaUtil.extractAttachedResourceId(translateTo, paramName);
+ if (!attachedResourceId.isPresent()) {
+ return Optional.empty();
+ }
+ AttachedResourceId resourceId = attachedResourceId.get();
+ if (resourceId.isGetParam()) {
+ TranslatedHeatResource shareResource =
+ translateTo.getContext().getHeatSharedResourcesByParam().get(resourceId.getEntityId());
+ if (Objects.nonNull(shareResource)
+ && !HeatToToscaUtil.isHeatFileNested(translateTo, translateTo.getHeatFileName())) {
+ if (validateResourceTypeSupportedForReqCreation(translateTo.getResourceId(), paramName,
+ requirementDefinitionEntry.getKey(), shareResource.getHeatResource(),
+ supportedTargetNodeTypes)) {
+ return Optional.of(shareResource.getTranslatedId());
+ }
+ }
+ }
+
+ return Optional.empty();
+ }
+
+ private Optional<String> getConnectionTargetNodeUsingGetResourceFunc(
+ Map.Entry<String, RequirementDefinition> requirementDefinitionEntry, String paramName,
+ Object paramValue, List<String> supportedTargetNodeTypes) {
+ String getResourceAttachedResourceId =
+ HeatToToscaUtil.extractContrailGetResourceAttachedHeatResourceId(paramValue);
+ if (getResourceAttachedResourceId != null) { // get resource
+ Resource resource = translateTo.getHeatOrchestrationTemplate().getResources()
+ .get(getResourceAttachedResourceId);
+ if (validateResourceTypeSupportedForReqCreation(translateTo.getResourceId(), paramName,
+ requirementDefinitionEntry.getKey(), resource, supportedTargetNodeTypes)) {
+ return ResourceTranslationBase.getResourceTranslatedId(translateTo.getHeatFileName(),
+ translateTo.getHeatOrchestrationTemplate(), getResourceAttachedResourceId,
+ translateTo.getContext());
+ }
+ }
+
+ return Optional.empty();
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationBase.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationBase.java
new file mode 100644
index 0000000000..45e3830f6f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationBase.java
@@ -0,0 +1,456 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.MapUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.openecomp.core.utilities.yaml.YamlUtil;
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.heat.datatypes.manifest.FileData;
+import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate;
+import org.openecomp.sdc.heat.datatypes.model.Output;
+import org.openecomp.sdc.heat.datatypes.model.Resource;
+import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType;
+import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType;
+import org.openecomp.sdc.tosca.datatypes.model.ArtifactDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.CapabilityDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.Import;
+import org.openecomp.sdc.tosca.datatypes.model.InterfaceDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.NodeType;
+import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.RequirementAssignment;
+import org.openecomp.sdc.tosca.datatypes.model.RequirementDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.tosca.services.DataModelUtil;
+import org.openecomp.sdc.tosca.services.ToscaConstants;
+import org.openecomp.sdc.tosca.services.ToscaNativeTypesServiceTemplate;
+import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.ResourceFileDataAndIDs;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo;
+import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil;
+import org.openecomp.sdc.translator.services.heattotosca.ResourceTranslation;
+import org.openecomp.sdc.translator.services.heattotosca.ResourceTranslationFactory;
+import org.openecomp.sdc.translator.services.heattotosca.TranslationContext;
+import org.openecomp.sdc.translator.services.heattotosca.TranslationService;
+import org.openecomp.sdc.translator.services.heattotosca.errors.ResourceNotFoundInHeatFileErrorBuilder;
+import org.openecomp.sdc.translator.services.heattotosca.globaltypes.GlobalTypesGenerator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.function.Predicate;
+import java.util.stream.Collectors;
+
+public abstract class ResourceTranslationBase implements ResourceTranslation {
+
+ protected static Logger logger = LoggerFactory.getLogger(ResourceTranslationBase.class);
+
+ static Optional<ResourceFileDataAndIDs> getFileDataContainingResource(
+ List<FileData> filesToSearch, String resourceId, TranslationContext context,
+ FileData.Type... types) {
+ if (CollectionUtils.isEmpty(filesToSearch)) {
+ return Optional.empty();
+ }
+
+ List<FileData> fileDatas = Objects.isNull(types) ? filesToSearch
+ : HeatToToscaUtil.getFilteredListOfFileDataByTypes(filesToSearch, types);
+ for (FileData data : fileDatas) {
+ HeatOrchestrationTemplate heatOrchestrationTemplate = new YamlUtil()
+ .yamlToObject(context.getFiles().getFileContent(data.getFile()),
+ HeatOrchestrationTemplate.class);
+ Map<String, Output> outputs = heatOrchestrationTemplate.getOutputs();
+ if (Objects.isNull(outputs)) {
+ continue;
+ }
+ Output output = outputs.get(resourceId);
+ if (Objects.nonNull(output)) {
+ Optional<AttachedResourceId> attachedOutputId = HeatToToscaUtil
+ .extractAttachedResourceId(data.getFile(), heatOrchestrationTemplate, context,
+ output.getValue());
+ if (attachedOutputId.isPresent()) {
+ AttachedResourceId attachedResourceId = attachedOutputId.get();
+ if (!attachedResourceId.isGetResource()) {
+ logger.warn("output: '" + resourceId + "' in file '" + data.getFile()
+ + "' is not defined as get_resource and therefor not supported.");
+ continue;
+ }
+ ResourceFileDataAndIDs fileDataAndIDs =
+ new ResourceFileDataAndIDs((String) attachedResourceId.getEntityId(),
+ (String) attachedResourceId.getTranslatedId(),
+ data);
+ return Optional.of(fileDataAndIDs);
+ }
+ }
+ }
+ return Optional.empty();
+ }
+
+ /**
+ * Gets resource translated id.
+ *
+ * @param heatFileName the heat file name
+ * @param heatOrchestrationTemplate the heat orchestration template
+ * @param resourceId the resource id
+ * @param context the context
+ * @return the resource translated id
+ */
+ public static Optional<String> getResourceTranslatedId(String heatFileName,
+ HeatOrchestrationTemplate
+ heatOrchestrationTemplate,
+ String resourceId,
+ TranslationContext context) {
+ if (!context.getTranslatedIds().containsKey(heatFileName)) {
+ context.getTranslatedIds().put(heatFileName, new HashMap<>());
+ }
+
+ Map<String, String> translatedIdsPerFile = context.getTranslatedIds().get(heatFileName);
+ String translatedId = translatedIdsPerFile.get(resourceId);
+ if (translatedId != null) {
+ return Optional.of(translatedId);
+ }
+
+ Resource resource = heatOrchestrationTemplate.getResources().get(resourceId);
+ if (resource == null) {
+ throw new CoreException(
+ new ResourceNotFoundInHeatFileErrorBuilder(resourceId, heatFileName).build());
+ }
+ TranslateTo translateTo =
+ generateTranslationTo(heatFileName, null, heatOrchestrationTemplate, resource, resourceId,
+ null, context);
+ translatedId =
+ ResourceTranslationFactory.getInstance(resource).generateTranslatedId(translateTo);
+ if (translatedId != null) {
+ context.getTranslatedIds().get(heatFileName).put(resourceId, translatedId);
+ }
+ return Optional.ofNullable(translatedId);
+ }
+
+ private static TranslateTo generateTranslationTo(String heatFileName,
+ ServiceTemplate serviceTemplate,
+ HeatOrchestrationTemplate
+ heatOrchestrationTemplate,
+ Resource resource, String resourceId,
+ String translatedId,
+ TranslationContext context) {
+ TranslateTo to = new TranslateTo();
+ to.setHeatFileName(heatFileName);
+ to.setServiceTemplate(serviceTemplate);
+ to.setHeatOrchestrationTemplate(heatOrchestrationTemplate);
+ to.setResource(resource);
+ to.setResourceId(resourceId);
+ to.setTranslatedId(translatedId);
+ to.setContext(context);
+ return to;
+ }
+
+ protected abstract void translate(TranslateTo translateTo);
+
+ protected String generateTranslatedId(TranslateTo translateTo) {
+ isEssentialRequirementsValid(translateTo);
+ return translateTo.getResourceId();
+ }
+
+ protected boolean isEssentialRequirementsValid(TranslateTo translateTo) {
+ return true;
+ }
+
+ @Override
+ public Optional<String> translateResource(String heatFileName, ServiceTemplate serviceTemplate,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ Resource resource, String resourceId,
+ TranslationContext context) {
+ Optional<String> translatedId =
+ getResourceTranslatedId(heatFileName, heatOrchestrationTemplate, resourceId, context);
+ context.getTranslatedResources().putIfAbsent(heatFileName, new HashSet<>());
+ if (context.getTranslatedResources().get(heatFileName).contains(resourceId)) {
+ return translatedId;
+ }
+ if (!translatedId.isPresent()) {
+ return Optional.empty();
+ }
+ logger.debug("Translate- file:" + heatFileName + " resource Id:" + resourceId
+ + " translated resource id:" + translatedId.get());
+ translate(new TranslateTo(heatFileName, serviceTemplate, heatOrchestrationTemplate, resource,
+ resourceId, translatedId.get(), context));
+ context.getTranslatedResources().get(heatFileName).add(resourceId);
+
+ if (isNodeTemplate(translatedId.get(), serviceTemplate)) {
+ if (!context.getHeatStackGroupMembers().containsKey(heatFileName)) {
+ context.getHeatStackGroupMembers().put(heatFileName, new HashSet<>());
+ }
+ context.getHeatStackGroupMembers().get(heatFileName).add(translatedId.get());
+ updateResourceDependency(heatFileName, resource, heatOrchestrationTemplate,
+ translatedId.get(), serviceTemplate, context);
+ }
+
+ return translatedId;
+ }
+
+ private void updateResourceDependency(String heatFileName, Resource resource,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ String translatedId, ServiceTemplate serviceTemplate,
+ TranslationContext context) {
+ if (resource.getDepends_on() == null) {
+ return;
+ }
+
+ if (resource.getDepends_on() instanceof List) {
+ List<String> dependsOnList = (List<String>) resource.getDepends_on();
+ for (String dependsOnResourceId : dependsOnList) {
+ addDependOnRequirement(dependsOnResourceId, translatedId, serviceTemplate, heatFileName,
+ heatOrchestrationTemplate, context);
+ }
+ } else {
+ String dependsOnResourceId = (String) resource.getDepends_on();
+ addDependOnRequirement(dependsOnResourceId, translatedId, serviceTemplate, heatFileName,
+ heatOrchestrationTemplate, context);
+ }
+
+ }
+
+ private void addDependOnRequirement(String dependsOnResourceId, String nodeTemplateId,
+ ServiceTemplate serviceTemplate, String heatFileName,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ TranslationContext context) {
+ RequirementAssignment requirementAssignment = new RequirementAssignment();
+ Optional<String> resourceTranslatedId =
+ getResourceTranslatedId(heatFileName, heatOrchestrationTemplate, dependsOnResourceId,
+ context);
+
+ if (resourceTranslatedId.isPresent()
+ && isNodeTemplate(resourceTranslatedId.get(), serviceTemplate)) {
+ requirementAssignment.setNode(resourceTranslatedId.get());
+ requirementAssignment.setCapability(ToscaCapabilityType.NODE.getDisplayName());
+ requirementAssignment.setRelationship(ToscaRelationshipType.DEPENDS_ON.getDisplayName());
+ DataModelUtil.addRequirementAssignment(
+ serviceTemplate.getTopology_template().getNode_templates().get(nodeTemplateId),
+ ToscaConstants.DEPENDS_ON_REQUIREMENT_ID, requirementAssignment);
+ }
+ }
+
+ private boolean isNodeTemplate(String entryId, ServiceTemplate serviceTemplate) {
+ return serviceTemplate.getTopology_template().getNode_templates() != null
+ && serviceTemplate.getTopology_template().getNode_templates().get(entryId) != null;
+ }
+
+ FileData getFileData(String fileName, TranslationContext context) {
+
+ List<FileData> fileDataList = context.getManifest().getContent().getData();
+ for (FileData fileData : fileDataList) {
+ if (TranslationService.getTypesToProcessByTranslator().contains(fileData.getType())
+ && fileData.getFile().equals(fileName)) {
+ return fileData;
+ }
+ }
+ return null;
+ }
+
+ NodeType getNodeTypeWithFlatHierarchy(String nodeTypeId, ServiceTemplate serviceTemplate,
+ TranslationContext context) {
+ NodeType nodeType;
+ if (serviceTemplate != null && serviceTemplate.getNode_types() != null) {
+ nodeType = serviceTemplate.getNode_types().get(nodeTypeId);
+
+ if (nodeType != null) {
+ return enrichNodeType(nodeType, serviceTemplate, context);
+ }
+ }
+ Map<String, Map<String, NodeType>> globalNodeTypesMap = new HashMap<>();
+ Collection<ServiceTemplate> globalNodeTypes =
+ GlobalTypesGenerator.getGlobalTypesServiceTemplate().values();
+ ServiceTemplate nativeNodeTypeServiceTemplate =
+ ToscaNativeTypesServiceTemplate.createServiceTemplate();
+ for (ServiceTemplate globalNodeType : globalNodeTypes) {
+ globalNodeTypesMap
+ .put(globalNodeType.getMetadata().getTemplate_name(), globalNodeType.getNode_types());
+ }
+ if (Objects.nonNull(serviceTemplate) && MapUtils.isNotEmpty(serviceTemplate.getImports())) {
+ for (Map.Entry<String, Import> entry : serviceTemplate.getImports().entrySet()) {
+ if (globalNodeTypesMap.containsKey(entry.getKey())) {
+ Map<String, NodeType> nodeTypes = globalNodeTypesMap.get(entry.getKey());
+ if (nodeTypes != null && nodeTypes.containsKey(nodeTypeId)) {
+ return enrichNodeType(nodeTypes.get(nodeTypeId), serviceTemplate, context);
+ }
+ }
+ if (context.getGlobalSubstitutionServiceTemplate() != null
+ && context.getGlobalSubstitutionServiceTemplate().getNode_types() != null
+ && context.getGlobalSubstitutionServiceTemplate().getNode_types()
+ .containsKey(nodeTypeId)) {
+ return enrichNodeType(
+ context.getGlobalSubstitutionServiceTemplate().getNode_types().get(nodeTypeId),
+ serviceTemplate, context);
+ }
+ if (nativeNodeTypeServiceTemplate.getNode_types().containsKey(nodeTypeId)) {
+ return enrichNodeType(nativeNodeTypeServiceTemplate.getNode_types().get(nodeTypeId),
+ serviceTemplate, context);
+ }
+ }
+ }
+ return new NodeType();
+
+ }
+
+ private NodeType enrichNodeType(NodeType nodeType, ServiceTemplate serviceTemplate,
+ TranslationContext context) {
+ NodeType clonedNodeType;
+
+ if (StringUtils.isEmpty(nodeType.getDerived_from())) {
+ return nodeType.clone();
+ }
+
+ clonedNodeType = enrichNodeType(
+ getNodeTypeWithFlatHierarchy(nodeType.getDerived_from(), serviceTemplate, context),
+ serviceTemplate, context);
+ mergeNodeTypes(clonedNodeType, nodeType);
+ return clonedNodeType;
+
+ }
+
+ private void mergeNodeTypes(NodeType target, NodeType source) {
+ target.setDerived_from(source.getDerived_from());
+ target.setDescription(source.getDescription());
+ target.setVersion(source.getVersion());
+ target.setProperties(
+ mergeMaps(target.getProperties(), source.getProperties(), PropertyDefinition.class));
+ target.setInterfaces(
+ mergeMaps(target.getInterfaces(), source.getInterfaces(), InterfaceDefinition.class));
+ target.setArtifacts(
+ mergeMaps(target.getArtifacts(), source.getArtifacts(), ArtifactDefinition.class));
+ target.setAttributes(
+ mergeMaps(target.getAttributes(), source.getAttributes(), AttributeDefinition.class));
+ target.setCapabilities(
+ mergeMaps(target.getCapabilities(), source.getCapabilities(), CapabilityDefinition.class));
+ target.setRequirements(mergeLists(target.getRequirements(), source.getRequirements(),
+ RequirementDefinition.class));
+ }
+
+ private <T, S> List<Map<T, S>> mergeLists(List<Map<T, S>> target, List<Map<T, S>> source,
+ Class<S> value) {
+ List<Map<T, S>> retList = new ArrayList<>();
+ if (Objects.nonNull(target)) {
+ retList.addAll(target);
+ }
+
+ if (Objects.nonNull(source)) {
+ for (Map<T, S> sourceMap : source) {
+ for (Map.Entry<T, S> entry : sourceMap.entrySet()) {
+ mergeEntryInList(entry.getKey(), entry.getValue(), retList);
+ }
+ }
+ }
+ return retList;
+ }
+
+ <T, S> void mergeEntryInList(T key, S value, List<Map<T, S>> target) {
+ boolean found = false;
+ for (Map<T, S> map : target) {
+ if (map.containsKey(key)) {
+ map.put(key, value);
+ found = true;
+ }
+ }
+
+ if (!found) {
+ Map<T, S> newMap = new HashMap<>();
+ newMap.put(key, value);
+ target.add(newMap);
+ }
+ }
+
+
+ private <T, S> Map<T, S> mergeMaps(Map<T, S> target, Map<T, S> source, Class<S> value) {
+ Map<T, S> retMap = new HashMap<>();
+ if (MapUtils.isNotEmpty(target)) {
+ retMap.putAll(target);
+ }
+
+ if (MapUtils.isNotEmpty(source)) {
+ retMap.putAll(source);
+ }
+ return retMap;
+ }
+
+ Optional<List<Map.Entry<String, Resource>>> getResourceByTranslatedResourceId(
+ String fileName,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ String translatedResourceId,TranslateTo translateTo,String heatResourceType) {
+ List<Map.Entry<String, Resource>> list = heatOrchestrationTemplate.getResources().entrySet()
+ .stream()
+ .filter(
+ entry -> getPredicatesForTranslatedIdToResourceId(fileName, heatOrchestrationTemplate,
+ translatedResourceId, translateTo.getContext(), heatResourceType)
+ .stream()
+ .allMatch(p -> p.test(entry)))
+ .collect(Collectors.toList());
+ if (CollectionUtils.isEmpty(list)) {
+ return Optional.empty();
+ } else {
+ return Optional.of(list);
+ }
+ }
+
+ private List<Predicate<Map.Entry<String, Resource>>> getPredicatesForTranslatedIdToResourceId(
+ String fileName, HeatOrchestrationTemplate heatOrchestrationTemplate,
+ String translatedResourceId, TranslationContext context, String heatResourceType) {
+ List<Predicate<Map.Entry<String, Resource>>> list = new ArrayList<>();
+ list.add(entry ->
+ entry.getValue().getType().equals(heatResourceType));
+ list.add(entry -> {
+ Optional<String> resourceTranslatedId =
+ getResourceTranslatedId(fileName, heatOrchestrationTemplate, entry.getKey(), context);
+ return resourceTranslatedId.isPresent()
+ && resourceTranslatedId.get().equals(translatedResourceId);
+ });
+ return list;
+ }
+
+ void addBindingReqFromPortToCompute(String computeNodeTemplateId, NodeTemplate portNodeTemplate) {
+ RequirementAssignment requirementAssignment = new RequirementAssignment();
+ requirementAssignment.setCapability(ToscaCapabilityType.NETWORK_BINDABLE.getDisplayName());
+ requirementAssignment.setRelationship(ToscaRelationshipType.NETWORK_BINDS_TO.getDisplayName());
+ requirementAssignment.setNode(computeNodeTemplateId);
+ DataModelUtil.addRequirementAssignment(portNodeTemplate, ToscaConstants.BINDING_REQUIREMENT_ID,
+ requirementAssignment);
+ }
+
+ void addLinkReqFromPortToNetwork(NodeTemplate nodeTemplate, String translatedId) {
+ RequirementAssignment requirement = new RequirementAssignment();
+ requirement.setCapability(ToscaCapabilityType.NETWORK_LINKABLE.getDisplayName());
+ requirement.setRelationship(ToscaRelationshipType.NETWORK_LINK_TO.getDisplayName());
+ requirement.setNode(translatedId);
+ DataModelUtil
+ .addRequirementAssignment(nodeTemplate, ToscaConstants.LINK_REQUIREMENT_ID, requirement);
+ }
+
+ boolean isResourceTypeSupported(Resource resource, List<String> supportedTypes) {
+ return Objects.nonNull(resource) && supportedTypes.contains(resource.getType());
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationCinderVolumeAttachmentImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationCinderVolumeAttachmentImpl.java
new file mode 100644
index 0000000000..cbad52a95d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationCinderVolumeAttachmentImpl.java
@@ -0,0 +1,202 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import static org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil.getResource;
+
+import org.apache.commons.lang3.StringUtils;
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.heat.datatypes.manifest.FileData;
+import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes;
+import org.openecomp.sdc.heat.datatypes.model.Resource;
+import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType;
+import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.RelationshipTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.RequirementAssignment;
+import org.openecomp.sdc.tosca.services.DataModelUtil;
+import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.ResourceFileDataAndIDs;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo;
+import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil;
+import org.openecomp.sdc.translator.services.heattotosca.ResourceTranslationFactory;
+import org.openecomp.sdc.translator.services.heattotosca.errors.MissingMandatoryPropertyErrorBuilder;
+import org.openecomp.sdc.translator.services.heattotosca.helper.VolumeTranslationHelper;
+import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaPropertyConverter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.List;
+import java.util.Optional;
+
+public class ResourceTranslationCinderVolumeAttachmentImpl extends ResourceTranslationBase {
+ protected static Logger logger =
+ LoggerFactory.getLogger(ResourceTranslationCinderVolumeAttachmentImpl.class);
+
+ @Override
+ protected void translate(TranslateTo translateTo) {
+ String volumeIdPropertyName = "volume_id";
+ RelationshipTemplate relationTemplate = new RelationshipTemplate();
+ relationTemplate.setType(ToscaRelationshipType.CINDER_VOLUME_ATTACHES_TO.getDisplayName());
+ String relationshipTemplateId = translateTo.getTranslatedId();
+ String heatFileName = translateTo.getHeatFileName();
+ relationTemplate.setProperties(TranslatorHeatToToscaPropertyConverter
+ .getToscaPropertiesSimpleConversion(translateTo.getResource().getProperties(),
+ relationTemplate.getProperties(), heatFileName,
+ translateTo.getHeatOrchestrationTemplate(), translateTo.getResource().getType(),
+ relationTemplate, translateTo.getContext()));
+
+ AttachedResourceId attachedVolumeId = getAttachedResourceId(translateTo, volumeIdPropertyName);
+ String instanceUuid = "instance_uuid";
+ AttachedResourceId attachedNovaServerId = getAttachedResourceId(translateTo, instanceUuid);
+
+ if (attachedNovaServerId.isGetResource()) {
+ handleNovaGetResource(translateTo, relationTemplate, relationshipTemplateId, heatFileName,
+ attachedVolumeId, (String) attachedNovaServerId.getEntityId());
+ } else {
+ logger.warn("Heat resource: '" + translateTo.getResourceId() + "' with type: '"
+ + translateTo.getResource().getType()
+ + "' include 'instance_uuid' property without 'get_resource' function, therefore this "
+ + "resource will be ignored in TOSCA translation.");
+ }
+ }
+
+ private AttachedResourceId getAttachedResourceId(TranslateTo translateTo, String propertyName) {
+ Optional<AttachedResourceId> attachedResourceId =
+ HeatToToscaUtil.extractAttachedResourceId(translateTo, propertyName);
+ if (!attachedResourceId.isPresent()) {
+ throw new CoreException(new MissingMandatoryPropertyErrorBuilder(propertyName).build());
+ }
+
+ return attachedResourceId.get();
+ }
+
+ private void handleNovaGetResource(TranslateTo translateTo, RelationshipTemplate relationTemplate,
+ String relationshipTemplateId, String heatFileName,
+ AttachedResourceId volResourceId, String novaResourceId) {
+ String toscaCapabilityAttachment = "tosca.capabilities.Attachment";
+ RequirementAssignment requirement = new RequirementAssignment();
+ requirement.setCapability(toscaCapabilityAttachment);
+ if (volResourceId.isGetResource()) {
+ Resource volServerResource = getResource(translateTo.getHeatOrchestrationTemplate(),
+ (String) volResourceId.getTranslatedId(), heatFileName);
+ if (!StringUtils.equals(HeatResourcesTypes.CINDER_VOLUME_RESOURCE_TYPE.getHeatResource(),
+ volServerResource.getType())) {
+ logger.warn("Volume attachment with id '" + translateTo.getResourceId()
+ + "' is pointing to unsupported resource type(" + volServerResource.getType()
+ + ") through the property 'volume_id'."
+ + " The connection to the volume is ignored. "
+ + "Supported types are: "
+ + HeatResourcesTypes.CINDER_VOLUME_RESOURCE_TYPE.getHeatResource());
+ return;
+ }
+ requirement.setNode((String) volResourceId.getTranslatedId());
+ requirement.setRelationship(relationshipTemplateId);
+ DataModelUtil
+ .addRelationshipTemplate(translateTo.getServiceTemplate(), relationshipTemplateId,
+ relationTemplate);
+ } else if (volResourceId.isGetParam()) {
+ String volumeResourceIdParamName = (String) volResourceId.getEntityId();
+ if (translateTo.getContext().getHeatSharedResourcesByParam()
+ .containsKey(volumeResourceIdParamName) && !isHeatFileNested(translateTo, heatFileName)) {
+ Resource volServerResource =
+ translateTo.getContext().getHeatSharedResourcesByParam().get(volumeResourceIdParamName)
+ .getHeatResource();
+ if (!StringUtils.equals(HeatResourcesTypes.CINDER_VOLUME_RESOURCE_TYPE.getHeatResource(),
+ volServerResource.getType())) {
+ logger.warn("Volume attachment with id '" + translateTo.getResourceId()
+ + "' is pointing to unsupported resource type(" + volServerResource.getType()
+ + ") through the property 'volume_id'."
+ + " The connection to the volume is ignored. "
+ + "Supported types are: "
+ + HeatResourcesTypes.CINDER_VOLUME_RESOURCE_TYPE.getHeatResource());
+ return;
+ }
+ requirement.setNode(
+ translateTo.getContext().getHeatSharedResourcesByParam().get(volumeResourceIdParamName)
+ .getTranslatedId());
+ requirement.setRelationship(relationshipTemplateId);
+ DataModelUtil
+ .addRelationshipTemplate(translateTo.getServiceTemplate(), relationshipTemplateId,
+ relationTemplate);
+ } else {
+ handleUnsharedVolume(translateTo, relationTemplate, relationshipTemplateId, heatFileName,
+ requirement, volumeResourceIdParamName);
+ }
+ }
+ Resource novaServerResource =
+ getResource(translateTo.getHeatOrchestrationTemplate(), novaResourceId, heatFileName);
+ if (!StringUtils.equals(HeatResourcesTypes.NOVA_SERVER_RESOURCE_TYPE.getHeatResource(),
+ novaServerResource.getType())) {
+ logger.warn("Volume attachment with id '" + translateTo.getResourceId()
+ + "' is pointing to unsupported resource type(" + novaServerResource.getType()
+ + ") through the property 'instance_uuid'."
+ + " The connection to the nova server is ignored. "
+ + "Supported types are: " + HeatResourcesTypes.NOVA_SERVER_RESOURCE_TYPE
+ .getHeatResource());
+ return;
+ }
+ Optional<String> translatedNovaServerId =
+ ResourceTranslationFactory.getInstance(novaServerResource)
+ .translateResource(heatFileName, translateTo.getServiceTemplate(),
+ translateTo.getHeatOrchestrationTemplate(), novaServerResource, novaResourceId,
+ translateTo.getContext());
+
+ if (translatedNovaServerId.isPresent() && StringUtils.isNotEmpty(requirement.getNode())) {
+ NodeTemplate novaServerNodeTemplate = DataModelUtil
+ .getNodeTemplate(translateTo.getServiceTemplate(), translatedNovaServerId.get());
+ DataModelUtil.addRequirementAssignment(novaServerNodeTemplate, "local_storage", requirement);
+ }
+ }
+
+ private void handleUnsharedVolume(TranslateTo translateTo, RelationshipTemplate relationTemplate,
+ String relationshipTemplateId, String heatFileName,
+ RequirementAssignment requirement, String volumeResourceId) {
+ List<FileData> allFilesData = translateTo.getContext().getManifest().getContent().getData();
+ Optional<FileData> fileData = HeatToToscaUtil.getFileData(heatFileName, allFilesData);
+ if (fileData.isPresent()) {
+ Optional<ResourceFileDataAndIDs> fileDataContainingResource =
+ new VolumeTranslationHelper(logger)
+ .getFileDataContainingVolume(fileData.get().getData(), volumeResourceId, translateTo,
+ FileData.Type.HEAT_VOL);
+ if (fileDataContainingResource.isPresent()) {
+ addRelationshipToServiceTemplate(translateTo, relationTemplate, relationshipTemplateId,
+ requirement, fileDataContainingResource.get());
+ }
+ }
+ }
+
+ private boolean isHeatFileNested(TranslateTo translateTo, String heatFileName) {
+ return translateTo.getContext().getNestedHeatsFiles().contains(heatFileName);
+ }
+
+ private void addRelationshipToServiceTemplate(TranslateTo translateTo,
+ RelationshipTemplate relationTemplate,
+ String relationshipTemplateId,
+ RequirementAssignment requirement,
+ ResourceFileDataAndIDs resourceFileDataAndIDs) {
+ String translatedId = resourceFileDataAndIDs.getTranslatedResourceId();
+ relationTemplate.getProperties().put("volume_id", translatedId);
+ requirement.setNode(translatedId);
+ requirement.setRelationship(relationshipTemplateId);
+ DataModelUtil.addRelationshipTemplate(translateTo.getServiceTemplate(), relationshipTemplateId,
+ relationTemplate);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationCinderVolumeImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationCinderVolumeImpl.java
new file mode 100644
index 0000000000..c1e5fe3900
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationCinderVolumeImpl.java
@@ -0,0 +1,77 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.openecomp.sdc.heat.datatypes.HeatBoolean;
+import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
+import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
+import org.openecomp.sdc.tosca.services.DataModelUtil;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo;
+import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaPropertyConverter;
+
+import java.util.Map;
+import java.util.Optional;
+
+public class ResourceTranslationCinderVolumeImpl extends ResourceTranslationBase {
+
+ @Override
+ public void translate(TranslateTo translateTo) {
+ NodeTemplate nodeTemplate = new NodeTemplate();
+ nodeTemplate.setType(ToscaNodeType.CINDER_VOLUME.getDisplayName());
+
+ nodeTemplate.setProperties(TranslatorHeatToToscaPropertyConverter
+ .getToscaPropertiesSimpleConversion(translateTo.getResource().getProperties(),
+ nodeTemplate.getProperties(), translateTo.getHeatFileName(),
+ translateTo.getHeatOrchestrationTemplate(), translateTo.getResource().getType(),
+ nodeTemplate, translateTo.getContext()));
+ handleSizeProperty(nodeTemplate.getProperties());
+ Object readOnly = nodeTemplate.getProperties().get("read_only");
+ if (readOnly != null && !(readOnly instanceof Map)) {
+ nodeTemplate.getProperties().put("read_only", HeatBoolean.eval(readOnly));
+ }
+ Optional<String> resourceTranslatedId = getResourceTranslatedId(translateTo.getHeatFileName(),
+ translateTo.getHeatOrchestrationTemplate(), translateTo.getResourceId(),
+ translateTo.getContext());
+ if (resourceTranslatedId.isPresent()) {
+ DataModelUtil.addNodeTemplate(translateTo.getServiceTemplate(), resourceTranslatedId.get(),
+ nodeTemplate);
+ }
+ }
+
+ private void handleSizeProperty(Map<String, Object> nodeTemplateProperties) {
+ Object size = nodeTemplateProperties.get("size");
+ if (size == null) {
+ return;
+ }
+
+ if (size instanceof Map) {
+ Map<String, Object> propMap = (Map) size;
+ if (propMap.entrySet().iterator().hasNext()) {
+ Map.Entry entry = propMap.entrySet().iterator().next();
+ String val = "(" + entry.getKey() + " : " + entry.getValue() + ") * 1024";
+ nodeTemplateProperties.put("size", val);
+ return;
+ }
+ } else {
+ nodeTemplateProperties.put("size", size + "*1024");
+ }
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailAttachPolicyImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailAttachPolicyImpl.java
new file mode 100644
index 0000000000..307e407119
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailAttachPolicyImpl.java
@@ -0,0 +1,141 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.heat.datatypes.model.Resource;
+import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType;
+import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType;
+import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.RequirementAssignment;
+import org.openecomp.sdc.tosca.services.DataModelUtil;
+import org.openecomp.sdc.tosca.services.ToscaConstants;
+import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo;
+import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil;
+import org.openecomp.sdc.translator.services.heattotosca.ResourceTranslationFactory;
+import org.openecomp.sdc.translator.services.heattotosca.errors.MissingMandatoryPropertyErrorBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Optional;
+
+public class ResourceTranslationContrailAttachPolicyImpl extends ResourceTranslationBase {
+ protected static Logger logger =
+ LoggerFactory.getLogger(ResourceTranslationContrailAttachPolicyImpl.class);
+
+ @Override
+ protected void translate(TranslateTo translateTo) {
+ String heatFileName = translateTo.getHeatFileName();
+ String translatedNetworkResourceId = getTranslatedNetworkResourceId(translateTo);
+ if (translatedNetworkResourceId == null) {
+ return;
+ }
+
+ NodeTemplate policyNodeTemplate = getTranslatedPolicyNodeTemplate(translateTo, heatFileName);
+ if (policyNodeTemplate != null) {
+ DataModelUtil
+ .addRequirementAssignment(policyNodeTemplate, ToscaConstants.NETWORK_REQUIREMENT_ID,
+ createRequirementAssignment(translatedNetworkResourceId));
+ }
+ }
+
+ private NodeTemplate getTranslatedPolicyNodeTemplate(TranslateTo translateTo,
+ String heatFileName) {
+ Optional<AttachedResourceId> attachedPolicyResourceId =
+ extractAttachedResourceIdHandleMissing(translateTo, "policy");
+ NodeTemplate policyNodeTemplate = new NodeTemplate();
+ Optional<String> policyResourceId =
+ HeatToToscaUtil.getContrailAttachedHeatResourceId(attachedPolicyResourceId.get());
+ if (policyResourceId.isPresent()) {
+ policyNodeTemplate = getPolicyNodeTemplate(translateTo, heatFileName, policyResourceId.get());
+ } else {
+ logger.warn("Heat resource: '" + translateTo.getResourceId() + "' with type: '"
+ + translateTo.getResource().getType()
+ + "' include 'policy' property without 'get_attr' of 'fq_name'/'get_resource'"
+ + " function, therefore this resource will be ignored in TOSCA translation.");
+ }
+ return policyNodeTemplate;
+ }
+
+ private NodeTemplate getPolicyNodeTemplate(TranslateTo translateTo, String heatFileName,
+ String policyResourceId) {
+ Resource policyResource = HeatToToscaUtil
+ .getResource(translateTo.getHeatOrchestrationTemplate(), policyResourceId, heatFileName);
+ Optional<String> translatedPolicyResourceId =
+ ResourceTranslationFactory.getInstance(policyResource)
+ .translateResource(heatFileName, translateTo.getServiceTemplate(),
+ translateTo.getHeatOrchestrationTemplate(), policyResource, policyResourceId,
+ translateTo.getContext());
+ if (!translatedPolicyResourceId.isPresent()) {
+ logger.warn("Heat resource: '" + translateTo.getResourceId() + "' with type: '"
+ + translateTo.getResource().getType()
+ + "' include unsupported policy resource, therefore this "
+ + "resource will be ignored in TOSCA translation. ");
+ return null;
+ }
+ return DataModelUtil
+ .getNodeTemplate(translateTo.getServiceTemplate(),
+ translatedPolicyResourceId.get());
+ }
+
+ private String getTranslatedNetworkResourceId(TranslateTo translateTo) {
+ Optional<AttachedResourceId> attachedNetworkResourceId =
+ extractAttachedResourceIdHandleMissing(translateTo, "network");
+
+ String translatedNetworkResourceId = null;
+ if (attachedNetworkResourceId.get().isGetResource()) {
+ translatedNetworkResourceId = (String) attachedNetworkResourceId.get().getTranslatedId();
+ } else {
+ logger.warn("Heat resource: '" + translateTo.getResourceId() + "' with type: '"
+ + translateTo.getResource().getType()
+ + "' include 'network' property without 'get_resource' function, "
+ + "therefore this resource will be ignored in TOSCA translation.");
+ }
+ return translatedNetworkResourceId;
+ }
+
+ private RequirementAssignment createRequirementAssignment(String translatedNetworkResourceId) {
+ RequirementAssignment requirement = new RequirementAssignment();
+ requirement.setCapability(ToscaCapabilityType.ATTACHMENT.getDisplayName());
+ requirement.setNode(translatedNetworkResourceId);
+ requirement.setRelationship(ToscaRelationshipType.ATTACHES_TO.getDisplayName());
+ return requirement;
+ }
+
+ private Optional<AttachedResourceId> extractAttachedResourceIdHandleMissing(
+ TranslateTo translateTo, String propertyName) {
+ Optional<AttachedResourceId> attachedResourceId =
+ HeatToToscaUtil.extractAttachedResourceId(translateTo, propertyName);
+
+ if (!attachedResourceId.isPresent()) {
+ throw new CoreException(new MissingMandatoryPropertyErrorBuilder(propertyName).build());
+ }
+ return attachedResourceId;
+ }
+
+
+ @Override
+ protected String generateTranslatedId(TranslateTo translateTo) {
+ return extractAttachedResourceIdHandleMissing(translateTo, "network").get().getEntityId()
+ .toString();
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailNetworkPolicyImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailNetworkPolicyImpl.java
new file mode 100644
index 0000000000..8084433fd5
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailNetworkPolicyImpl.java
@@ -0,0 +1,53 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
+import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
+import org.openecomp.sdc.tosca.services.DataModelUtil;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo;
+import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaPropertyConverter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ResourceTranslationContrailNetworkPolicyImpl extends ResourceTranslationBase {
+
+ protected static Logger logger =
+ LoggerFactory.getLogger(ResourceTranslationContrailNetworkPolicyImpl.class);
+
+ @Override
+ protected void translate(TranslateTo translateTo) {
+
+ NodeTemplate nodeTemplate = new NodeTemplate();
+ nodeTemplate.setType(ToscaNodeType.CONTRAIL_NETWORK_RULE.getDisplayName());
+
+ nodeTemplate.setProperties(TranslatorHeatToToscaPropertyConverter
+ .getToscaPropertiesSimpleConversion(translateTo.getResource().getProperties(),
+ nodeTemplate.getProperties(), translateTo.getHeatFileName(),
+ translateTo.getHeatOrchestrationTemplate(), translateTo.getResource().getType(),
+ nodeTemplate, translateTo.getContext()));
+
+ DataModelUtil.addNodeTemplate(translateTo.getServiceTemplate(), translateTo.getTranslatedId(),
+ nodeTemplate);
+
+
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailServiceInstanceImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailServiceInstanceImpl.java
new file mode 100644
index 0000000000..b2475f28a9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailServiceInstanceImpl.java
@@ -0,0 +1,663 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.heat.datatypes.HeatBoolean;
+import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes;
+import org.openecomp.sdc.heat.datatypes.model.Resource;
+import org.openecomp.sdc.heat.services.HeatConstants;
+import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType;
+import org.openecomp.sdc.tosca.datatypes.ToscaFunctions;
+import org.openecomp.sdc.tosca.datatypes.ToscaGroupType;
+import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
+import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType;
+import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.GroupDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.Metadata;
+import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.NodeType;
+import org.openecomp.sdc.tosca.datatypes.model.ParameterDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.RequirementAssignment;
+import org.openecomp.sdc.tosca.datatypes.model.RequirementDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.SubstitutionMapping;
+import org.openecomp.sdc.tosca.datatypes.model.TopologyTemplate;
+import org.openecomp.sdc.tosca.services.DataModelUtil;
+import org.openecomp.sdc.tosca.services.ToscaConstants;
+import org.openecomp.sdc.tosca.services.ToscaUtil;
+import org.openecomp.sdc.tosca.services.impl.ToscaFileOutputServiceCsarImpl;
+import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslatedHeatResource;
+import org.openecomp.sdc.translator.services.heattotosca.Constants;
+import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil;
+import org.openecomp.sdc.translator.services.heattotosca.ResourceTranslationFactory;
+import org.openecomp.sdc.translator.services.heattotosca.errors.MissingMandatoryPropertyErrorBuilder;
+import org.openecomp.sdc.translator.services.heattotosca.globaltypes.ContrailAbstractSubstituteGlobalType;
+import org.openecomp.sdc.translator.services.heattotosca.globaltypes.ContrailComputeGlobalType;
+import org.openecomp.sdc.translator.services.heattotosca.globaltypes.GlobalTypesGenerator;
+import org.openecomp.sdc.translator.services.heattotosca.globaltypes.GlobalTypesUtil;
+import org.openecomp.sdc.translator.services.heattotosca.helper.ContrailTranslationHelper;
+import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaFunctionConverter;
+import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaPropertyConverter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+
+public class ResourceTranslationContrailServiceInstanceImpl extends ResourceTranslationBase {
+ protected static Logger logger =
+ LoggerFactory.getLogger(ResourceTranslationContrailServiceInstanceImpl.class);
+
+ @Override
+ public void translate(TranslateTo translateTo) {
+ Resource serviceInstanceResource = translateTo.getResource();
+ AttachedResourceId contrailServiceTemplateAttached =
+ getServiceTemplateAttachedId(translateTo, serviceInstanceResource);
+ if (contrailServiceTemplateAttached.isGetResource()) {
+ String contrailServiceTemplateResourceId =
+ (String) contrailServiceTemplateAttached.getEntityId();
+ Resource contrailServiceTemplateResource = HeatToToscaUtil
+ .getResource(translateTo.getHeatOrchestrationTemplate(),
+ contrailServiceTemplateResourceId, translateTo.getHeatFileName());
+ if (!contrailServiceTemplateResource.getType()
+ .equals(HeatResourcesTypes.CONTRAIL_SERVICE_TEMPLATE.getHeatResource())) {
+ logger.warn("resource id '" + translateTo.getResourceId() + "' with type '"
+ + translateTo.getResource().getType()
+ + "+ has reference to resource '" + contrailServiceTemplateResourceId + "' with type "
+ + "'"
+ + contrailServiceTemplateResource.getType()
+ + "' in property service_template. Invalid type, resource type should be type of '"
+ + HeatResourcesTypes.CONTRAIL_SERVICE_TEMPLATE.getHeatResource()
+ + "', therefore this resource will be ignored in TOSCA translation.");
+ return;
+ }
+ Optional<String> contrailServiceTemplateTranslatedId =
+ ResourceTranslationFactory.getInstance(contrailServiceTemplateResource)
+ .translateResource(translateTo.getHeatFileName(), translateTo.getServiceTemplate(),
+ translateTo.getHeatOrchestrationTemplate(), contrailServiceTemplateResource,
+ contrailServiceTemplateResourceId, translateTo.getContext());
+ if (!contrailServiceTemplateTranslatedId.isPresent()) {
+ logger.warn("Resource id '" + translateTo.getResourceId() + "' with type '"
+ + translateTo.getResource().getType()
+ + "' has reference to unsupported resource '" + contrailServiceTemplateResourceId
+ + "' with type '" + contrailServiceTemplateResource.getType()
+ + "' in property 'service_template'"
+ + ", therefore this resource will be ignored in TOSCA translation.");
+ return;
+ }
+
+ ServiceTemplate globalSubstitutionServiceTemplate =
+ translateTo.getContext().getTranslatedServiceTemplates()
+ .get(Constants.GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME);
+ String contrailStId = ResourceTranslationContrailServiceTemplateImpl
+ .getContrailSubstitutedNodeTypeId(contrailServiceTemplateTranslatedId.get());
+ NodeType substitutedNodeType =
+ DataModelUtil.getNodeType(globalSubstitutionServiceTemplate, contrailStId);
+
+ int numberOfPorts = getServiceInstanceNumberOfPorts(serviceInstanceResource);
+ if (substitutedNodeType.getRequirements() != null
+ && substitutedNodeType.getRequirements().size() != numberOfPorts) {
+ logger.warn("More than one ServiceInstance pointing to the same ServiceTemplate '"
+ + contrailServiceTemplateResourceId + " ' with different number of interfaces."
+ + ", therefore this resource will be ignored in TOSCA translation.");
+ return;
+ }
+
+ addNetworkLinkRequirements(substitutedNodeType, numberOfPorts);
+ NodeTemplate substitutedNodeTemplate =
+ createSubstitutedNodeTemplate(translateTo, contrailServiceTemplateResource, contrailStId,
+ numberOfPorts);
+
+ String computeNodeTypeId = new ContrailTranslationHelper()
+ .getComputeNodeTypeId(contrailServiceTemplateTranslatedId.get(),
+ contrailServiceTemplateResource);
+ boolean orderedInterfaces = getOrderedInterfaces(contrailServiceTemplateResource);
+ ServiceTemplate nestedServiceTemplate =
+ createNestedServiceTemplate(translateTo, computeNodeTypeId, contrailStId,
+ substitutedNodeTemplate, orderedInterfaces);
+ addAbstractSubstitutionProperty(translateTo, substitutedNodeTemplate.getProperties(),
+ nestedServiceTemplate, contrailServiceTemplateResource);
+ translateTo.getContext().getTranslatedServiceTemplates()
+ .put(translateTo.getTranslatedId(), nestedServiceTemplate);
+
+ } else {
+ logger.warn("Heat resource: '" + translateTo.getResourceId() + "' with type: '"
+ + translateTo.getResource().getType()
+ + "' include 'service_template' property without 'get_resource' function, currently not "
+ + "supported, therefore this resource will be ignored in TOSCA translation.");
+ }
+
+ }
+
+ private void addAbstractSubstitutionProperty(TranslateTo translateTo,
+ Map<String, Object> substitutionProperties,
+ ServiceTemplate nestedServiceTemplate,
+ Resource contrailServiceTemplateResource) {
+ Map<String, Object> innerProps = new HashMap<>();
+ innerProps.put(ToscaConstants.SUBSTITUTE_SERVICE_TEMPLATE_PROPERTY_NAME,
+ ToscaUtil.getServiceTemplateFileName(nestedServiceTemplate));
+
+ Object countValue = handleScaleOutProperty(translateTo, innerProps);
+ handleServiceScalingProperty(translateTo, innerProps, contrailServiceTemplateResource);
+
+ boolean mandatory = false;
+ if (countValue instanceof Integer && (Integer) countValue > 0) {
+ mandatory = true;
+ }
+ if (countValue == null) {
+ mandatory = true;
+ }
+ innerProps.put("mandatory", mandatory);
+ substitutionProperties.put(ToscaConstants.SERVICE_TEMPLATE_FILTER_PROPERTY_NAME, innerProps);
+ }
+
+ private Object handleScaleOutProperty(TranslateTo translateTo, Map<String, Object> innerProps) {
+ Object scaleOutPropertyValue =
+ translateTo.getResource().getProperties().get(HeatConstants.SCALE_OUT_PROPERTY_NAME);
+ Object countValue = null;
+ if (scaleOutPropertyValue != null && scaleOutPropertyValue instanceof Map) {
+ countValue = TranslatorHeatToToscaPropertyConverter
+ .getToscaPropertyValue(Constants.MAX_INSTANCES_PROPERTY_NAME,
+ ((Map) scaleOutPropertyValue).get(Constants.MAX_INSTANCES_PROPERTY_NAME), null,
+ translateTo.getHeatFileName(), translateTo.getHeatOrchestrationTemplate(), null,
+ translateTo.getContext());
+ if (countValue != null) {
+ innerProps.put(ToscaConstants.COUNT_PROPERTY_NAME, countValue);
+ } else {
+ innerProps.put(ToscaConstants.COUNT_PROPERTY_NAME, 1);
+ }
+ } else {
+ innerProps.put(ToscaConstants.COUNT_PROPERTY_NAME, 1);
+ }
+ return countValue;
+ }
+
+ private void handleServiceScalingProperty(TranslateTo translateTo, Map<String, Object> innerProps,
+ Resource contrailServiceTemplateResource) {
+ Object serviceScalingPropertyValue = contrailServiceTemplateResource.getProperties()
+ .get(HeatConstants.SERVICE_SCALING_PROPERTY_NAME);
+ Object serviceScalingValue = null;
+ if (serviceScalingPropertyValue != null) {
+ serviceScalingValue = TranslatorHeatToToscaPropertyConverter
+ .getToscaPropertyValue(HeatConstants.SERVICE_SCALING_PROPERTY_NAME,
+ serviceScalingPropertyValue, null, translateTo.getHeatFileName(),
+ translateTo.getHeatOrchestrationTemplate(), null, translateTo.getContext());
+ if (serviceScalingValue != null) {
+ innerProps.put(ToscaConstants.SCALING_ENABLED_PROPERTY_NAME,
+ (HeatBoolean.isValueBoolean(serviceScalingValue)) ? HeatBoolean
+ .eval(serviceScalingValue) : serviceScalingValue);
+ }
+ }
+ }
+
+ private boolean getOrderedInterfaces(Resource contrailServiceTemplate) {
+ Object orderedInterfaces = contrailServiceTemplate.getProperties().get("ordered_interfaces");
+ if (orderedInterfaces == null) {
+ return false;
+ }
+ if (orderedInterfaces instanceof String) {
+ return HeatBoolean.eval(orderedInterfaces);
+ }
+ //if get_param, set default value to true
+ return true;
+ }
+
+ private ServiceTemplate createNestedServiceTemplate(TranslateTo translateTo,
+ String computeNodeTypeId,
+ String substitutedNodeTypeId,
+ NodeTemplate substitutedNodeTemplate,
+ boolean orderedInterfaces) {
+ ServiceTemplate nestedSubstitutionServiceTemplate = new ServiceTemplate();
+ setNestedServiceTemplateGeneralDetails(translateTo, nestedSubstitutionServiceTemplate);
+ String heatStackGroupKey = addHeatStackGroup(translateTo, nestedSubstitutionServiceTemplate);
+ addSubstitutionMappingEntry(nestedSubstitutionServiceTemplate, substitutedNodeTypeId);
+
+ handleInputParameters(nestedSubstitutionServiceTemplate);
+ String computeNodeTemplateId =
+ handleComputeNodeTemplate(translateTo, computeNodeTypeId, nestedSubstitutionServiceTemplate,
+ heatStackGroupKey);
+ handleOutputParameters(nestedSubstitutionServiceTemplate, computeNodeTemplateId);
+ handleServiceInstanceInterfaces(translateTo, nestedSubstitutionServiceTemplate,
+ substitutedNodeTemplate, heatStackGroupKey, orderedInterfaces, computeNodeTemplateId);
+
+ return nestedSubstitutionServiceTemplate;
+ }
+
+ private void handleOutputParameters(ServiceTemplate nestedSubstitutionServiceTemplate,
+ String nodeTemplateId) {
+ if (nodeTemplateId == null) {
+ return;
+ }
+ NodeType contrailAbstractNodeType =
+ ContrailAbstractSubstituteGlobalType.createServiceTemplate().getNode_types()
+ .get(ToscaNodeType.CONTRAIL_ABSTRACT_SUBSTITUTE.getDisplayName());
+ Map<String, AttributeDefinition> contrailAbstractAttributes =
+ contrailAbstractNodeType.getAttributes();
+ Map<String, ParameterDefinition> nestedSubstitutionServiceTemplateOutputs = new HashMap<>();
+
+ if (contrailAbstractAttributes == null) {
+ return;
+ }
+
+ for (String attributeKey : contrailAbstractAttributes.keySet()) {
+ AttributeDefinition abstractAttributeDef = contrailAbstractAttributes.get(attributeKey);
+ if (abstractAttributeDef != null) {
+ Map<String, List> outputValue = new HashMap<>();
+ List outputGetAttributeList = new ArrayList<>();
+ outputGetAttributeList.add(nodeTemplateId);
+ outputGetAttributeList.add(attributeKey);
+ outputValue.put(ToscaFunctions.GET_ATTRIBUTE.getDisplayName(), outputGetAttributeList);
+ nestedSubstitutionServiceTemplateOutputs.put(attributeKey,
+ DataModelUtil.convertAttributeDefToParameterDef(abstractAttributeDef, outputValue));
+ }
+ }
+ if (!nestedSubstitutionServiceTemplateOutputs.isEmpty()) {
+ nestedSubstitutionServiceTemplate.getTopology_template()
+ .setOutputs(nestedSubstitutionServiceTemplateOutputs);
+ }
+ }
+
+ private void handleServiceInstanceInterfaces(TranslateTo translateTo,
+ ServiceTemplate nestedSubstitutionServiceTemplate,
+ NodeTemplate substitutedNodeTemplate,
+ String heatStackGroupKey, boolean orderedInterfaces,
+ String computeNodeTemplateId) {
+ Resource serviceInstanceResource = translateTo.getResource();
+ Object interfaceListProperty = serviceInstanceResource.getProperties().get("interface_list");
+ if (interfaceListProperty == null) {
+ return;
+ }
+ if (interfaceListProperty instanceof List) {
+ for (int index = 0; index < ((List) interfaceListProperty).size(); index++) {
+ Object interfaceEntry = ((List) interfaceListProperty).get(index);
+ handleInterface(translateTo, interfaceEntry, index, nestedSubstitutionServiceTemplate,
+ heatStackGroupKey, substitutedNodeTemplate, orderedInterfaces, computeNodeTemplateId);
+ }
+ } else if (interfaceListProperty instanceof Map) {
+ handleInterface(translateTo, interfaceListProperty, null, nestedSubstitutionServiceTemplate,
+ heatStackGroupKey, substitutedNodeTemplate, orderedInterfaces, computeNodeTemplateId);
+ }
+ }
+
+ private void handleInterface(TranslateTo translateTo, Object interfacePropertyValue,
+ Integer index,
+ ServiceTemplate nestedSubstitutionServiceTemplate,
+ String heatStackGroupKey, NodeTemplate substitutedNodeTemplate,
+ boolean orderedInterfaces, String computeNodeTemplateId) {
+ if (index == null) {
+ index = new Integer(0);
+ }
+ NodeTemplate portNodeTemplate =
+ createPortNodeTemplate(index, orderedInterfaces, computeNodeTemplateId);
+ String portNodeTemplateId = "port_" + index;
+ String portReqMappingKey = "link_" + portNodeTemplateId;
+
+ DataModelUtil
+ .addNodeTemplate(nestedSubstitutionServiceTemplate, portNodeTemplateId, portNodeTemplate);
+ updateSubstitutionMappingRequirement(nestedSubstitutionServiceTemplate, portReqMappingKey,
+ portNodeTemplateId);
+ updateHeatStackGroup(nestedSubstitutionServiceTemplate, heatStackGroupKey, portNodeTemplateId);
+ connectPortToNetwork(translateTo, interfacePropertyValue, substitutedNodeTemplate,
+ portReqMappingKey);
+ }
+
+ private void connectPortToNetwork(TranslateTo translateTo, Object interfacePropertyValue,
+ NodeTemplate substitutedNodeTemplate,
+ String portReqMappingKey) {
+ List<String> validNetworksForConnections = Arrays
+ .asList(HeatResourcesTypes.NEUTRON_NET_RESOURCE_TYPE.getHeatResource(),
+ HeatResourcesTypes.CONTRAIL_VIRTUAL_NETWORK_RESOURCE_TYPE.getHeatResource());
+
+ if (interfacePropertyValue instanceof Map) {
+ Object virtualNetworkValue = ((Map) interfacePropertyValue).get("virtual_network");
+ if (virtualNetworkValue != null) {
+ Optional<AttachedResourceId> networkAttachedResourceId = HeatToToscaUtil
+ .extractAttachedResourceId(translateTo.getHeatFileName(),
+ translateTo.getHeatOrchestrationTemplate(), translateTo.getContext(),
+ virtualNetworkValue);
+ if (networkAttachedResourceId.isPresent()) {
+ Optional<String> networkResourceId =
+ HeatToToscaUtil.getContrailAttachedHeatResourceId(networkAttachedResourceId.get());
+ if (networkResourceId.isPresent()) {
+ Resource networkResource = HeatToToscaUtil
+ .getResource(translateTo.getHeatOrchestrationTemplate(), networkResourceId.get(),
+ translateTo.getHeatFileName());
+ if (validNetworksForConnections.contains(networkResource.getType())) {
+ Optional<String> networkTranslatedId =
+ getResourceTranslatedId(translateTo.getHeatFileName(),
+ translateTo.getHeatOrchestrationTemplate(), networkResourceId.get(),
+ translateTo.getContext());
+ if (networkTranslatedId.isPresent()) {
+ addLinkToNetworkRequirementAssignment(substitutedNodeTemplate,
+ networkTranslatedId.get(), portReqMappingKey);
+ }
+ } else {
+ logger.warn("Heat resource " + translateTo.getResourceId() + " with type "
+ + translateTo.getResource().getType()
+ + " has connection to invalid/not supported network resource, therefore, this "
+ + "connection will be ignored in the translation.");
+ }
+ } else if (networkAttachedResourceId.get().isGetParam()) {
+ TranslatedHeatResource translatedSharedResourceId =
+ translateTo.getContext().getHeatSharedResourcesByParam()
+ .get(networkAttachedResourceId.get().getEntityId());
+ if (Objects.nonNull(translatedSharedResourceId)
+ && !HeatToToscaUtil.isHeatFileNested(translateTo, translateTo.getHeatFileName())) {
+ addLinkToNetworkRequirementAssignment(substitutedNodeTemplate,
+ translatedSharedResourceId.getTranslatedId(), portReqMappingKey);
+ }
+ } else {
+ logger.warn("Heat resource: '" + translateTo.getResourceId() + "' with type: '"
+ + translateTo.getResource().getType()
+ + "' include 'virtual_network' property with value '"
+ + virtualNetworkValue.toString()
+ + "', the connection to this network wasn't found/not supported therefore this "
+ + "connection will be ignored in TOSCA translation for this property.");
+ }
+ }
+ } else {
+ logger.warn("Heat resource: '" + translateTo.getResourceId() + "' with type: '"
+ + translateTo.getResource().getType()
+ + "' missing 'virtual_network' property in 'interface_list' entry, therefore, no "
+ + "network connection is define for this entry.");
+ }
+ }
+ }
+
+ private NodeTemplate createPortNodeTemplate(Integer index, boolean orderedInterfaces,
+ String computeNodeTemplateId) {
+ NodeTemplate portNodeTemplate = new NodeTemplate();
+ portNodeTemplate.setType(ToscaNodeType.CONTRAIL_PORT.getDisplayName());
+ Map<String, Object> portProperties = new HashMap<>();
+ portProperties.put("static_routes", DataModelUtil
+ .createGetInputPropertyValueFromListParameter("interface_list", index, "static_routes"));
+ portProperties.put("virtual_network", DataModelUtil
+ .createGetInputPropertyValueFromListParameter("interface_list", index, "virtual_network"));
+ portProperties.put("allowed_address_pairs", DataModelUtil
+ .createGetInputPropertyValueFromListParameter("interface_list", index,
+ "allowed_address_pairs"));
+ portProperties.put("ip_address", DataModelUtil
+ .createGetInputPropertyValueFromListParameter("interface_list", index, "ip_address"));
+ portProperties.put("static_route",
+ DataModelUtil.createGetInputPropertyValueFromListParameter("static_routes_list", index));
+ portProperties.put("shared_ip",
+ DataModelUtil.createGetInputPropertyValueFromListParameter("shared_ip_list", index));
+ portProperties.put("interface_type", DataModelUtil
+ .createGetInputPropertyValueFromListParameter("service_interface_type_list", index));
+ if (orderedInterfaces) {
+ portProperties.put("order", index);
+ }
+ portNodeTemplate.setProperties(portProperties);
+ addBindingReqFromPortToCompute(computeNodeTemplateId, portNodeTemplate);
+ return portNodeTemplate;
+ }
+
+
+ private void addLinkToNetworkRequirementAssignment(NodeTemplate nodeTemplate,
+ String connectedNodeTranslatedId,
+ String requirementId) {
+ if (nodeTemplate == null || connectedNodeTranslatedId == null) {
+ return;
+ }
+
+ RequirementAssignment requirement = new RequirementAssignment();
+ requirement.setCapability(ToscaCapabilityType.NETWORK_LINKABLE.getDisplayName());
+ requirement.setRelationship(ToscaRelationshipType.NETWORK_LINK_TO.getDisplayName());
+ requirement.setNode(connectedNodeTranslatedId);
+ DataModelUtil.addRequirementAssignment(nodeTemplate, requirementId, requirement);
+ }
+
+ private void updateHeatStackGroup(ServiceTemplate serviceTemplate, String heatStackGroupKey,
+ String memberId) {
+ serviceTemplate.getTopology_template().getGroups().get(heatStackGroupKey).getMembers()
+ .add(memberId);
+ }
+
+ private void updateSubstitutionMappingRequirement(ServiceTemplate serviceTemplate,
+ String portReqMappingKey,
+ String portNodeTemplateId) {
+ List<String> portReqMappingValue = new ArrayList<>();
+ portReqMappingValue.add(portNodeTemplateId);
+ portReqMappingValue.add(ToscaConstants.LINK_REQUIREMENT_ID);
+ DataModelUtil
+ .addSubstitutionMappingReq(serviceTemplate, portReqMappingKey, portReqMappingValue);
+ }
+
+ private void addSubstitutionMappingEntry(ServiceTemplate nestedSubstitutionServiceTemplate,
+ String substitutedNodeTypeId) {
+ SubstitutionMapping substitutionMappings = new SubstitutionMapping();
+ substitutionMappings.setNode_type(substitutedNodeTypeId);
+ DataModelUtil.addSubstitutionMapping(nestedSubstitutionServiceTemplate, substitutionMappings);
+ }
+
+ private void handleInputParameters(ServiceTemplate nestedSubstitutionServiceTemplate) {
+ NodeType contrailAbstractNodeType =
+ ContrailAbstractSubstituteGlobalType.createServiceTemplate().getNode_types()
+ .get(ToscaNodeType.CONTRAIL_ABSTRACT_SUBSTITUTE.getDisplayName());
+ Map<String, PropertyDefinition> contrailAbstractProperties =
+ contrailAbstractNodeType.getProperties();
+ Map<String, ParameterDefinition> nestedSubstitutionServiceTemplateInputs = new HashMap<>();
+
+ for (String propertyKey : contrailAbstractProperties.keySet()) {
+ PropertyDefinition abstractPropertyDef = contrailAbstractProperties.get(propertyKey);
+ if (abstractPropertyDef != null) {
+ nestedSubstitutionServiceTemplateInputs
+ .put(propertyKey, DataModelUtil.convertPropertyDefToParameterDef(abstractPropertyDef));
+
+ }
+ }
+ if (!nestedSubstitutionServiceTemplateInputs.isEmpty()) {
+ nestedSubstitutionServiceTemplate.getTopology_template()
+ .setInputs(nestedSubstitutionServiceTemplateInputs);
+ }
+ }
+
+ private String handleComputeNodeTemplate(TranslateTo translateTo, String computeNodeTypeId,
+ ServiceTemplate nestedSubstitutionServiceTemplate,
+ String heatStackGroupKey) {
+ NodeType contrailComputeNodeType =
+ ContrailComputeGlobalType.createServiceTemplate().getNode_types()
+ .get(ToscaNodeType.CONTRAIL_COMPUTE.getDisplayName());
+ Map<String, PropertyDefinition> contrailComputeProperties =
+ contrailComputeNodeType.getProperties();
+ Map<String, Object> computeNodeTemplateProperties = new HashMap<>();
+
+ if (contrailComputeProperties != null) {
+ for (String computePropertyKey : contrailComputeProperties.keySet()) {
+ Map getInputProperty = new HashMap<>();
+ getInputProperty.put(ToscaFunctions.GET_INPUT.getDisplayName(), computePropertyKey);
+ computeNodeTemplateProperties.put(computePropertyKey, getInputProperty);
+ }
+ }
+
+ NodeTemplate computeNodeTemplate = new NodeTemplate();
+ computeNodeTemplate.setType(computeNodeTypeId);
+ if (!computeNodeTemplateProperties.isEmpty()) {
+ computeNodeTemplate.setProperties(computeNodeTemplateProperties);
+ }
+ String computeNodeTemplateId = translateTo.getTranslatedId();
+ DataModelUtil.addNodeTemplate(nestedSubstitutionServiceTemplate, computeNodeTemplateId,
+ computeNodeTemplate);
+ nestedSubstitutionServiceTemplate.getTopology_template().getGroups().get(heatStackGroupKey)
+ .getMembers().add(computeNodeTemplateId);
+
+ return computeNodeTemplateId;
+ }
+
+ private String addHeatStackGroup(TranslateTo translateTo, ServiceTemplate serviceTemplate) {
+ GroupDefinition serviceInstanceGroupDefinition = new GroupDefinition();
+ serviceInstanceGroupDefinition.setType(ToscaGroupType.HEAT_STACK.getDisplayName());
+ Map<String, Object> groupProperties = new HashMap<>();
+ groupProperties.put("heat_file",
+ "../" + (new ToscaFileOutputServiceCsarImpl()).getArtifactsFolderName() + "/"
+ + translateTo.getHeatFileName());
+ serviceInstanceGroupDefinition.setProperties(groupProperties);
+ serviceInstanceGroupDefinition.setMembers(new ArrayList<>());
+ String heatStackGroupKey = translateTo.getTranslatedId();
+ DataModelUtil.addGroupDefinitionToTopologyTemplate(serviceTemplate, heatStackGroupKey,
+ serviceInstanceGroupDefinition);
+
+ return heatStackGroupKey;
+ }
+
+
+ private void setNestedServiceTemplateGeneralDetails(TranslateTo translateTo,
+ ServiceTemplate nestedSubstitutionServiceTemplate) {
+ Metadata nestedTemplateMetadata = new Metadata();
+ String nestedTemplateName = translateTo.getResourceId();
+ nestedTemplateMetadata.setTemplate_name(nestedTemplateName);
+ nestedSubstitutionServiceTemplate.setMetadata(nestedTemplateMetadata);
+ nestedSubstitutionServiceTemplate
+ .setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION);
+ nestedSubstitutionServiceTemplate.setTopology_template(new TopologyTemplate());
+ nestedSubstitutionServiceTemplate.setImports(GlobalTypesGenerator.getGlobalTypesImportList());
+ nestedSubstitutionServiceTemplate.getImports()
+ .put(Constants.GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME, GlobalTypesUtil
+ .createServiceTemplateImport(Constants.GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME));
+ }
+
+ private NodeTemplate createSubstitutedNodeTemplate(TranslateTo translateTo,
+ Resource contrailServiceTemplateResource,
+ String contrailServiceTemplateTranslatedId,
+ int numberOfPorts) {
+
+ translateTo.getServiceTemplate().getImports()
+ .put(Constants.GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME, GlobalTypesUtil
+ .createServiceTemplateImport(Constants.GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME));
+ NodeTemplate substitutesNodeTemplate = new NodeTemplate();
+ substitutesNodeTemplate.setType(contrailServiceTemplateTranslatedId);
+ List<String> directiveList = new ArrayList<>();
+ directiveList.add(ToscaConstants.NODE_TEMPLATE_DIRECTIVE_SUBSTITUTABLE);
+ substitutesNodeTemplate.setDirectives(directiveList);
+ substitutesNodeTemplate.setProperties(TranslatorHeatToToscaPropertyConverter
+ .getToscaPropertiesSimpleConversion(translateTo.getResource().getProperties(),
+ substitutesNodeTemplate.getProperties(), translateTo.getHeatFileName(),
+ translateTo.getHeatOrchestrationTemplate(),
+ HeatResourcesTypes.CONTRAIL_SERVICE_INSTANCE.getHeatResource(), substitutesNodeTemplate,
+ translateTo.getContext()));
+ substitutesNodeTemplate.setProperties(TranslatorHeatToToscaPropertyConverter
+ .getToscaPropertiesSimpleConversion(contrailServiceTemplateResource.getProperties(),
+ substitutesNodeTemplate.getProperties(), translateTo.getHeatFileName(),
+ translateTo.getHeatOrchestrationTemplate(),
+ HeatResourcesTypes.CONTRAIL_SERVICE_TEMPLATE.getHeatResource(), substitutesNodeTemplate,
+ translateTo.getContext()));
+ HeatToToscaUtil.mapBoolean(substitutesNodeTemplate, "availability_zone_enable");
+ HeatToToscaUtil.mapBoolean(substitutesNodeTemplate, "ordered_interfaces");
+
+ Object sharedIpListPropertyValue =
+ contrailServiceTemplateResource.getProperties().get("shared_ip_list");
+ Optional<List<Map<String, List>>> sharedIpTranslatedSplitFun =
+ TranslatorHeatToToscaFunctionConverter
+ .translateFnSplitFunction(sharedIpListPropertyValue, numberOfPorts, true);
+ if (sharedIpTranslatedSplitFun.isPresent()) {
+ substitutesNodeTemplate.getProperties()
+ .put("shared_ip_list", sharedIpTranslatedSplitFun.get());
+ } else {
+ HeatToToscaUtil.mapBooleanList(substitutesNodeTemplate, "shared_ip_list");
+ }
+
+ Object staticRouteListPropertyValue =
+ contrailServiceTemplateResource.getProperties().get("static_routes_list");
+ Optional<List<Map<String, List>>> staticRouteTranslatedSplitFun =
+ TranslatorHeatToToscaFunctionConverter
+ .translateFnSplitFunction(staticRouteListPropertyValue, numberOfPorts, true);
+ if (staticRouteTranslatedSplitFun.isPresent()) {
+ substitutesNodeTemplate.getProperties()
+ .put("static_routes_list", staticRouteTranslatedSplitFun.get());
+ } else {
+ HeatToToscaUtil.mapBooleanList(substitutesNodeTemplate, "static_routes_list");
+ }
+
+ Object serviceInterfaceTypeListPropertyValue =
+ contrailServiceTemplateResource.getProperties().get("service_interface_type_list");
+ Optional<List<Map<String, List>>> serviceInterfaceTypeTranslatedSplitFun =
+ TranslatorHeatToToscaFunctionConverter
+ .translateFnSplitFunction(serviceInterfaceTypeListPropertyValue, numberOfPorts, false);
+ if (serviceInterfaceTypeTranslatedSplitFun.isPresent()) {
+ substitutesNodeTemplate.getProperties()
+ .put("service_interface_type_list", serviceInterfaceTypeTranslatedSplitFun.get());
+ }
+
+ String substitutedNodeTemplateId = translateTo.getTranslatedId();
+ DataModelUtil.addNodeTemplate(translateTo.getServiceTemplate(), substitutedNodeTemplateId,
+ substitutesNodeTemplate);
+ return substitutesNodeTemplate;
+ }
+
+ private void addNetworkLinkRequirements(NodeType nodeType, int numberOfPorts) {
+ if (nodeType.getRequirements() == null) {
+ List<Map<String, RequirementDefinition>> requirementList = new ArrayList<>();
+ for (int i = 0; i < numberOfPorts; i++) {
+ Map<String, RequirementDefinition> requirementDefinitionMap = new HashMap<>();
+ requirementDefinitionMap.put(ToscaConstants.LINK_REQUIREMENT_ID + "_port_" + i,
+ DataModelUtil.createRequirement(ToscaCapabilityType.NETWORK_LINKABLE.getDisplayName(),
+ ToscaNodeType.ROOT.getDisplayName(),
+ ToscaRelationshipType.NETWORK_LINK_TO.getDisplayName(), null));
+ requirementList.add(requirementDefinitionMap);
+ }
+ if (numberOfPorts > 0) {
+ nodeType.setRequirements(requirementList);
+ }
+ }
+ }
+
+ private int getServiceInstanceNumberOfPorts(Resource serviceInstanceResource) {
+ int numberOfPorts;
+ Object interfaceTypeProperty = serviceInstanceResource.getProperties().get("interface_list");
+ if (interfaceTypeProperty == null) {
+ numberOfPorts = 0;
+ } else if (interfaceTypeProperty instanceof List) {
+ numberOfPorts = ((List) interfaceTypeProperty).size();
+ } else if (interfaceTypeProperty instanceof Map) {
+ numberOfPorts = 1;
+ } else {
+ numberOfPorts = 0;
+ }
+
+ return numberOfPorts;
+ }
+
+ private AttachedResourceId getServiceTemplateAttachedId(TranslateTo translateTo,
+ Resource serviceInstanceResource) {
+ Object serviceTemplateProperty =
+ serviceInstanceResource.getProperties().get("service_template");
+ Optional<AttachedResourceId> serviceTemplateId = HeatToToscaUtil
+ .extractAttachedResourceId(translateTo.getHeatFileName(),
+ translateTo.getHeatOrchestrationTemplate(), translateTo.getContext(),
+ serviceTemplateProperty);
+ if (serviceTemplateId.isPresent()) {
+ return serviceTemplateId.get();
+ } else {
+ throw new CoreException(new MissingMandatoryPropertyErrorBuilder("service_template").build());
+ }
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailServiceTemplateImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailServiceTemplateImpl.java
new file mode 100644
index 0000000000..e0a3ed422f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailServiceTemplateImpl.java
@@ -0,0 +1,100 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
+import org.openecomp.sdc.tosca.datatypes.model.Metadata;
+import org.openecomp.sdc.tosca.datatypes.model.NodeType;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.tosca.services.DataModelUtil;
+import org.openecomp.sdc.tosca.services.ToscaConstants;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo;
+import org.openecomp.sdc.translator.services.heattotosca.Constants;
+import org.openecomp.sdc.translator.services.heattotosca.errors.MissingMandatoryPropertyErrorBuilder;
+import org.openecomp.sdc.translator.services.heattotosca.globaltypes.GlobalTypesGenerator;
+import org.openecomp.sdc.translator.services.heattotosca.helper.ContrailTranslationHelper;
+
+import java.util.Map;
+import java.util.Objects;
+
+public class ResourceTranslationContrailServiceTemplateImpl extends ResourceTranslationBase {
+
+ static String getContrailSubstitutedNodeTypeId(String serviceTemplateTranslatedId) {
+ return ToscaConstants.NODES_SUBSTITUTION_PREFIX + serviceTemplateTranslatedId;
+ }
+
+ @Override
+ protected boolean isEssentialRequirementsValid(TranslateTo translateTo) {
+ Map<String, Object> properties = translateTo.getResource().getProperties();
+ if (Objects.isNull(properties) || Objects.isNull(properties.get("image_name"))) {
+ throw new CoreException(new MissingMandatoryPropertyErrorBuilder("image_name").build());
+ }
+ return true;
+ }
+
+ @Override
+ public void translate(TranslateTo translateTo) {
+
+ ServiceTemplate globalSubstitutionServiceTemplate =
+ getGlobalSubstitutionTypesServiceTemplate(translateTo);
+ addSubstitutedNodeType(translateTo, globalSubstitutionServiceTemplate);
+ addComputeNodeType(translateTo, globalSubstitutionServiceTemplate);
+ }
+
+ private void addComputeNodeType(TranslateTo translateTo,
+ ServiceTemplate globalSubstitutionServiceTemplate) {
+ NodeType computeNodeType = new NodeType();
+ computeNodeType.setDerived_from(ToscaNodeType.CONTRAIL_COMPUTE.getDisplayName());
+ String computeNodeTypeId = new ContrailTranslationHelper()
+ .getComputeNodeTypeId(translateTo.getTranslatedId(), translateTo.getResource());
+ DataModelUtil
+ .addNodeType(globalSubstitutionServiceTemplate, computeNodeTypeId, computeNodeType);
+ }
+
+ private void addSubstitutedNodeType(TranslateTo translateTo,
+ ServiceTemplate globalSubstitutionServiceTemplate) {
+ NodeType substitutedNodeType = new NodeType();
+ substitutedNodeType
+ .setDerived_from(ToscaNodeType.CONTRAIL_ABSTRACT_SUBSTITUTE.getDisplayName());
+ DataModelUtil.addNodeType(globalSubstitutionServiceTemplate,
+ getContrailSubstitutedNodeTypeId(translateTo.getTranslatedId()), substitutedNodeType);
+ }
+
+ private ServiceTemplate getGlobalSubstitutionTypesServiceTemplate(TranslateTo translateTo) {
+ ServiceTemplate globalSubstitutionServiceTemplate =
+ translateTo.getContext().getTranslatedServiceTemplates()
+ .get(Constants.GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME);
+ if (globalSubstitutionServiceTemplate == null) {
+ globalSubstitutionServiceTemplate = new ServiceTemplate();
+ Metadata templateMetadata = new Metadata();
+ templateMetadata.setTemplate_name(Constants.GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME);
+ globalSubstitutionServiceTemplate.setMetadata(templateMetadata);
+ globalSubstitutionServiceTemplate.setImports(GlobalTypesGenerator.getGlobalTypesImportList());
+ globalSubstitutionServiceTemplate
+ .setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION);
+ translateTo.getContext().getTranslatedServiceTemplates()
+ .put(Constants.GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME,
+ globalSubstitutionServiceTemplate);
+ }
+ return globalSubstitutionServiceTemplate;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailV2NetworkPolicyImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailV2NetworkPolicyImpl.java
new file mode 100644
index 0000000000..72a25985a8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailV2NetworkPolicyImpl.java
@@ -0,0 +1,49 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
+import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
+import org.openecomp.sdc.tosca.services.DataModelUtil;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo;
+import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaPropertyConverter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ResourceTranslationContrailV2NetworkPolicyImpl extends ResourceTranslationBase {
+
+ protected static Logger logger =
+ LoggerFactory.getLogger(ResourceTranslationContrailV2NetworkPolicyImpl.class);
+
+ @Override
+ protected void translate(TranslateTo translateTo) {
+
+ NodeTemplate nodeTemplate = new NodeTemplate();
+ nodeTemplate.setType(ToscaNodeType.CONTRAILV2_NETWORK_RULE.getDisplayName());
+ nodeTemplate.setProperties(TranslatorHeatToToscaPropertyConverter
+ .getToscaPropertiesSimpleConversion(translateTo.getResource().getProperties(),
+ nodeTemplate.getProperties(), translateTo.getHeatFileName(),
+ translateTo.getHeatOrchestrationTemplate(), translateTo.getResource().getType(),
+ nodeTemplate, translateTo.getContext()));
+ DataModelUtil.addNodeTemplate(translateTo.getServiceTemplate(), translateTo.getTranslatedId(),
+ nodeTemplate);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailV2VirtualNetworkImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailV2VirtualNetworkImpl.java
new file mode 100644
index 0000000000..d81f3196a3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailV2VirtualNetworkImpl.java
@@ -0,0 +1,209 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.apache.commons.collections.CollectionUtils;
+import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes;
+import org.openecomp.sdc.heat.datatypes.model.Resource;
+import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType;
+import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
+import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType;
+import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.RequirementAssignment;
+import org.openecomp.sdc.tosca.services.DataModelUtil;
+import org.openecomp.sdc.tosca.services.ToscaConstants;
+import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId;
+import org.openecomp.sdc.translator.datatypes.heattotosca.ResourceReferenceType;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo;
+import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil;
+import org.openecomp.sdc.translator.services.heattotosca.ResourceTranslationFactory;
+import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaPropertyConverter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+
+public class ResourceTranslationContrailV2VirtualNetworkImpl extends ResourceTranslationBase {
+
+ protected static Logger logger =
+ LoggerFactory.getLogger(ResourceTranslationContrailV2VirtualNetworkImpl.class);
+
+ @Override
+ public void translate(TranslateTo translateTo) {
+
+ NodeTemplate nodeTemplate = new NodeTemplate();
+ nodeTemplate.setType(ToscaNodeType.CONTRAILV2_VIRTUAL_NETWORK.getDisplayName());
+ nodeTemplate.setProperties(TranslatorHeatToToscaPropertyConverter
+ .getToscaPropertiesSimpleConversion(translateTo.getResource().getProperties(),
+ nodeTemplate.getProperties(), translateTo.getHeatFileName(),
+ translateTo.getHeatOrchestrationTemplate(), translateTo.getResource().getType(),
+ nodeTemplate, translateTo.getContext()));
+ Optional<String> resourceTranslatedId = getResourceTranslatedId(translateTo.getHeatFileName(),
+ translateTo.getHeatOrchestrationTemplate(), translateTo.getResourceId(),
+ translateTo.getContext());
+ if (resourceTranslatedId.isPresent()) {
+ DataModelUtil.addNodeTemplate(translateTo.getServiceTemplate(), resourceTranslatedId.get(),
+ nodeTemplate);
+ }
+ linkToPolicyNodeTemplate(translateTo);
+ }
+
+ private void linkToPolicyNodeTemplate(TranslateTo translateTo) {
+ List<AttachedResourceId> networkPolicyIdList = extractNetworkPolicyIdList(translateTo);
+ if (CollectionUtils.isEmpty(networkPolicyIdList)) {
+ return;
+ }
+ for (AttachedResourceId attachedResourceId : networkPolicyIdList) {
+ NodeTemplate policyNodeTemplate = DataModelUtil
+ .getNodeTemplate(translateTo.getServiceTemplate(),
+ (String) attachedResourceId.getTranslatedId());
+ DataModelUtil
+ .addRequirementAssignment(policyNodeTemplate, ToscaConstants.NETWORK_REQUIREMENT_ID,
+ createRequirementAssignment(translateTo.getTranslatedId()));
+ }
+ }
+
+ private List<AttachedResourceId> extractNetworkPolicyIdList(TranslateTo translateTo) {
+
+ Object propertyValue = translateTo.getResource().getProperties().get("network_policy_refs");
+ if (propertyValue != null) {
+ return extractNetworkPolicyId(propertyValue, translateTo);
+ } else {
+ return null;
+ }
+ }
+
+ private List<AttachedResourceId> extractNetworkPolicyId(Object propertyValue,
+ TranslateTo translateTo) {
+ List<AttachedResourceId> attachedResourceIdList = new ArrayList<>();
+
+ if (propertyValue instanceof List) {
+ for (Object value : (List) propertyValue) {
+ attachedResourceIdList.addAll(extractNetworkPolicyId(value, translateTo));
+ }
+ } else {
+ AttachedResourceId resourceId = parsNetworkPolicyId(propertyValue, translateTo);
+ if (resourceId != null) {
+ attachedResourceIdList.add(resourceId);
+ }
+ }
+ return attachedResourceIdList;
+ }
+
+ private AttachedResourceId parsNetworkPolicyId(Object propertyValue, TranslateTo translateTo) {
+
+ Optional<String> translatedPolicyResourceId;
+ String policyResourceId = extractResourceId(propertyValue, translateTo);
+ if (policyResourceId == null) {
+ return null;
+ }
+
+ Resource policyResource = HeatToToscaUtil
+ .getResource(translateTo.getHeatOrchestrationTemplate(), policyResourceId,
+ translateTo.getHeatFileName());
+ if (!policyResource.getType()
+ .equals(HeatResourcesTypes.CONTRAIL_V2_NETWORK_RULE_RESOURCE_TYPE.getHeatResource())) {
+ return null;
+ }
+ translatedPolicyResourceId = ResourceTranslationFactory.getInstance(policyResource)
+ .translateResource(translateTo.getHeatFileName(), translateTo.getServiceTemplate(),
+ translateTo.getHeatOrchestrationTemplate(), policyResource, policyResourceId,
+ translateTo.getContext());
+ if (!translatedPolicyResourceId.isPresent()) {
+ logger.warn("Heat resource: '" + translateTo.getResourceId() + "' with type: '"
+ + translateTo.getResource().getType()
+ + "' property network_policy_refs is referenced to an "
+ + "unsupported resource the connection will be ignored in TOSCA translation.");
+ return null;
+ }
+ return
+ new AttachedResourceId(translatedPolicyResourceId.get(), policyResourceId,
+ ResourceReferenceType.GET_ATTR);
+ }
+
+ private String extractResourceId(Object propertyValue, TranslateTo translateTo) {
+
+ Object value;
+ if (propertyValue instanceof Map) {
+ if (((Map) propertyValue).containsKey("get_attr")) {
+ value = ((Map) propertyValue).get("get_attr");
+ if (value instanceof List) {
+ if (((List) value).size() == 2 && ((List) value).get(1).equals("fq_name")) {
+ if (((List) value).get(0) instanceof String) {
+ return (String) ((List) value).get(0);
+ } else {
+ logger.warn("Heat resource: '" + translateTo.getResourceId() + "' with type: '"
+ + translateTo.getResource().getType()
+ + "' has property with invalid format of 'get_attr' function "
+ + "with 'fq_name' value, therefore this property"
+ + " will be ignored in TOSCA translation.");
+ }
+ }
+ }
+ } else if (((Map) propertyValue).containsKey("get_resource")) {
+ value = ((Map) propertyValue).get("get_resource");
+ if (value instanceof String) {
+ return (String) value;
+ } else {
+ logger.warn("Heat resource: '" + translateTo.getResourceId() + "' with type: '"
+ + translateTo.getResource().getType()
+ + "' has property invalid format of 'get_resource' function, therefore"
+ + " this property will be ignored in TOSCA translation.");
+ }
+ } else {
+ Collection<Object> valCollection = ((Map) propertyValue).values();
+ for (Object entryValue : valCollection) {
+ String ret = extractResourceId(entryValue, translateTo);
+ if (ret != null) {
+ return ret;
+ }
+
+ }
+ }
+ } else if (propertyValue instanceof List) {
+ for (Object prop : (List) propertyValue) {
+ String ret = extractResourceId(prop, translateTo);
+ if (ret != null) {
+ return ret;
+ }
+ }
+ }
+ logger.warn("Heat resource: '" + translateTo.getResourceId() + "' with type: '"
+ + translateTo.getResource().getType()
+ + "' invalid format of property value, therefore "
+ + "this resource will be ignored in TOSCA translation.");
+ return null;
+ }
+
+ private RequirementAssignment createRequirementAssignment(String translatedNetworkResourceId) {
+ RequirementAssignment requirement = new RequirementAssignment();
+ requirement.setCapability(ToscaCapabilityType.ATTACHMENT.getDisplayName());
+ requirement.setNode(translatedNetworkResourceId);
+ requirement.setRelationship(ToscaRelationshipType.ATTACHES_TO.getDisplayName());
+ return requirement;
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailV2VmInterfaceImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailV2VmInterfaceImpl.java
new file mode 100644
index 0000000000..14403df002
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailV2VmInterfaceImpl.java
@@ -0,0 +1,126 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes;
+import org.openecomp.sdc.heat.datatypes.model.Resource;
+import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
+import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
+import org.openecomp.sdc.tosca.services.DataModelUtil;
+import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslatedHeatResource;
+import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil;
+import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaPropertyConverter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Objects;
+import java.util.Optional;
+
+
+public class ResourceTranslationContrailV2VmInterfaceImpl extends ResourceTranslationBase {
+ protected static Logger logger =
+ LoggerFactory.getLogger(ResourceTranslationContrailV2VmInterfaceImpl.class);
+
+ @Override
+ protected void translate(TranslateTo translateTo) {
+ NodeTemplate nodeTemplate = new NodeTemplate();
+ nodeTemplate.setType(ToscaNodeType.CONTRAILV2_VIRTUAL_MACHINE_INTERFACE.getDisplayName());
+
+ nodeTemplate.setProperties(TranslatorHeatToToscaPropertyConverter
+ .getToscaPropertiesSimpleConversion(translateTo.getResource().getProperties(),
+ nodeTemplate.getProperties(), translateTo.getHeatFileName(),
+ translateTo.getHeatOrchestrationTemplate(), translateTo.getResource().getType(),
+ nodeTemplate, translateTo.getContext()));
+ handleNetworkRequirement(translateTo, nodeTemplate);
+ Optional<String> resourceTranslatedId = getResourceTranslatedId(translateTo.getHeatFileName(),
+ translateTo.getHeatOrchestrationTemplate(), translateTo.getResourceId(),
+ translateTo.getContext());
+ if (resourceTranslatedId.isPresent()) {
+ DataModelUtil.addNodeTemplate(translateTo.getServiceTemplate(), resourceTranslatedId.get(),
+ nodeTemplate);
+ }
+ }
+
+ private void handleNetworkRequirement(TranslateTo translateTo, NodeTemplate nodeTemplate) {
+ Object virtualNetworkRefs =
+ translateTo.getResource().getProperties().get("virtual_network_refs");
+ if (Objects.isNull(virtualNetworkRefs) || !(virtualNetworkRefs instanceof List)
+ || ((List) virtualNetworkRefs).size() == 0) {
+ return;
+ }
+ List<String> acceptableResourceTypes = Arrays
+ .asList(HeatResourcesTypes.NEUTRON_NET_RESOURCE_TYPE.getHeatResource(),
+ HeatResourcesTypes.CONTRAIL_V2_VIRTUAL_NETWORK_RESOURCE_TYPE.getHeatResource());
+ List virtualNetworkRefList = (List) virtualNetworkRefs;
+ if (virtualNetworkRefList.size() > 1) {
+ logger.warn("Heat resource: '" + translateTo.getResourceId() + "' with type: '"
+ + translateTo.getResource().getType()
+ + "' include 'virtual_network_refs' property with more than one network values,"
+ + " only the first network will be translated, "
+ + "all rest will be ignored in TOSCA translation.");
+ }
+ Object virtualNetworkRef = virtualNetworkRefList.get(0);
+ String networkResourceId =
+ HeatToToscaUtil.extractContrailGetResourceAttachedHeatResourceId(virtualNetworkRef);
+ if (Objects.nonNull(networkResourceId)) { // get_resource
+ Resource networkResource = HeatToToscaUtil
+ .getResource(translateTo.getHeatOrchestrationTemplate(), networkResourceId,
+ translateTo.getHeatFileName());
+ if (acceptableResourceTypes.contains(networkResource.getType())) {
+ Optional<String> resourceTranslatedId =
+ getResourceTranslatedId(translateTo.getHeatFileName(),
+ translateTo.getHeatOrchestrationTemplate(), networkResourceId,
+ translateTo.getContext());
+ if (resourceTranslatedId.isPresent()) {
+ addLinkReqFromPortToNetwork(nodeTemplate, resourceTranslatedId.get());
+ }
+ } else {
+ logger.warn("Heat resource: '" + translateTo.getResourceId() + "' with type: '"
+ + translateTo.getResource().getType()
+ + "' include 'virtual_network_refs' property which is connect"
+ + " to unsupported/incorrect resource with type '"
+ + networkResource.getType()
+ + "', therefore, this connection will be ignored in TOSCA translation.");
+ }
+ } else {
+ Optional<AttachedResourceId> attachedResourceId = HeatToToscaUtil
+ .extractAttachedResourceId(translateTo.getHeatFileName(),
+ translateTo.getHeatOrchestrationTemplate(), translateTo.getContext(),
+ virtualNetworkRef);
+ if (attachedResourceId.isPresent() && attachedResourceId.get().isGetParam()) {
+ TranslatedHeatResource translatedSharedResourceId =
+ translateTo.getContext().getHeatSharedResourcesByParam()
+ .get(attachedResourceId.get().getEntityId());
+ if (Objects.nonNull(translatedSharedResourceId)
+ && !HeatToToscaUtil.isHeatFileNested(translateTo, translateTo.getHeatFileName())) {
+ addLinkReqFromPortToNetwork(nodeTemplate, translatedSharedResourceId.getTranslatedId());
+ }
+ }
+ }
+
+
+ }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailVirtualNetworkImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailVirtualNetworkImpl.java
new file mode 100644
index 0000000000..3a3a532d59
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailVirtualNetworkImpl.java
@@ -0,0 +1,51 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
+import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
+import org.openecomp.sdc.tosca.services.DataModelUtil;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo;
+import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaPropertyConverter;
+
+import java.util.Optional;
+
+public class ResourceTranslationContrailVirtualNetworkImpl extends ResourceTranslationBase {
+
+ @Override
+ public void translate(TranslateTo translateTo) {
+
+ NodeTemplate nodeTemplate = new NodeTemplate();
+ nodeTemplate.setType(ToscaNodeType.CONTRAIL_VIRTUAL_NETWORK.getDisplayName());
+ nodeTemplate.setProperties(TranslatorHeatToToscaPropertyConverter
+ .getToscaPropertiesSimpleConversion(translateTo.getResource().getProperties(),
+ nodeTemplate.getProperties(), translateTo.getHeatFileName(),
+ translateTo.getHeatOrchestrationTemplate(), translateTo.getResource().getType(),
+ nodeTemplate, translateTo.getContext()));
+ Optional<String> resourceTranslatedId = getResourceTranslatedId(translateTo.getHeatFileName(),
+ translateTo.getHeatOrchestrationTemplate(), translateTo.getResourceId(),
+ translateTo.getContext());
+ if (resourceTranslatedId.isPresent()) {
+ DataModelUtil.addNodeTemplate(translateTo.getServiceTemplate(), resourceTranslatedId.get(),
+ nodeTemplate);
+ }
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationDefaultImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationDefaultImpl.java
new file mode 100644
index 0000000000..1182b60a6a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationDefaultImpl.java
@@ -0,0 +1,41 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo;
+
+public class ResourceTranslationDefaultImpl extends ResourceTranslationBase {
+
+ @Override
+ protected String generateTranslatedId(TranslateTo translateTo) {
+ return null;
+ }
+
+ @Override
+ public void translate(TranslateTo translateTo) {
+ //no translation is needed, this default is used for unsupported resources
+ logger.warn("Heat resource: '" + translateTo.getResourceId() + "' with type: '"
+ + translateTo.getResource().getType()
+ + "' is not supported, will be ignored in TOSCA translation");
+
+ }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNestedImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNestedImpl.java
new file mode 100644
index 0000000000..2573b6849d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNestedImpl.java
@@ -0,0 +1,781 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.MapUtils;
+import org.openecomp.core.utilities.file.FileUtils;
+import org.openecomp.sdc.heat.datatypes.manifest.FileData;
+import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate;
+import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes;
+import org.openecomp.sdc.heat.datatypes.model.Resource;
+import org.openecomp.sdc.heat.services.HeatConstants;
+import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType;
+import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
+import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType;
+import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.CapabilityDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.Metadata;
+import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.NodeType;
+import org.openecomp.sdc.tosca.datatypes.model.ParameterDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.PropertyType;
+import org.openecomp.sdc.tosca.datatypes.model.RequirementAssignment;
+import org.openecomp.sdc.tosca.datatypes.model.RequirementDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.SubstitutionMapping;
+import org.openecomp.sdc.tosca.datatypes.model.Template;
+import org.openecomp.sdc.tosca.datatypes.model.TopologyTemplate;
+import org.openecomp.sdc.tosca.services.DataModelUtil;
+import org.openecomp.sdc.tosca.services.ToscaConstants;
+import org.openecomp.sdc.tosca.services.ToscaUtil;
+import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.ResourceFileDataAndIDs;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo;
+import org.openecomp.sdc.translator.services.heattotosca.Constants;
+import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil;
+import org.openecomp.sdc.translator.services.heattotosca.TranslationContext;
+import org.openecomp.sdc.translator.services.heattotosca.TranslationService;
+import org.openecomp.sdc.translator.services.heattotosca.globaltypes.GlobalTypesGenerator;
+import org.openecomp.sdc.translator.services.heattotosca.globaltypes.GlobalTypesUtil;
+import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaPropertyConverter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+
+public class ResourceTranslationNestedImpl extends ResourceTranslationBase {
+
+ protected static Logger logger = LoggerFactory.getLogger(ResourceTranslationNestedImpl.class);
+
+ @Override
+ public void translate(TranslateTo translateTo) {
+ FileData nestedFileData =
+ getFileData(translateTo.getResource().getType(), translateTo.getContext());
+ String templateName = FileUtils.getFileWithoutExtention(translateTo.getResource().getType());
+ String substitutionNodeTypeKey = ToscaConstants.NODES_SUBSTITUTION_PREFIX + templateName;
+
+ if (!translateTo.getContext().getTranslatedServiceTemplates()
+ .containsKey(translateTo.getResource().getType())) {
+
+ //substitution template
+ ServiceTemplate nestedSubstitutionServiceTemplate = new ServiceTemplate();
+ Metadata templateMetadata = new Metadata();
+ templateMetadata.setTemplate_name(templateName);
+ nestedSubstitutionServiceTemplate.setMetadata(templateMetadata);
+ nestedSubstitutionServiceTemplate
+ .setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION);
+ nestedSubstitutionServiceTemplate.setTopology_template(new TopologyTemplate());
+ nestedSubstitutionServiceTemplate.setImports(GlobalTypesGenerator.getGlobalTypesImportList());
+ nestedSubstitutionServiceTemplate.getImports()
+ .put(Constants.GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME, GlobalTypesUtil
+ .createServiceTemplateImport(Constants.GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME));
+
+ TranslationService translationService = new TranslationService();
+
+ translationService.translateHeatFile(nestedSubstitutionServiceTemplate, nestedFileData,
+ translateTo.getContext());
+
+ //global substitution template
+ ServiceTemplate globalSubstitutionServiceTemplate;
+ globalSubstitutionServiceTemplate = translateTo.getContext().getTranslatedServiceTemplates()
+ .get(Constants.GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME);
+ if (globalSubstitutionServiceTemplate == null) {
+ globalSubstitutionServiceTemplate = new ServiceTemplate();
+ templateMetadata = new Metadata();
+ templateMetadata.setTemplate_name(Constants.GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME);
+ globalSubstitutionServiceTemplate.setMetadata(templateMetadata);
+ globalSubstitutionServiceTemplate
+ .setImports(GlobalTypesGenerator.getGlobalTypesImportList());
+ globalSubstitutionServiceTemplate
+ .setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION);
+ }
+ translateTo.getServiceTemplate().getImports()
+ .put(Constants.GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME, GlobalTypesUtil
+ .createServiceTemplateImport(Constants.GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME));
+
+
+ //substitution node type
+ NodeType substitutionNodeType = new NodeType();
+ substitutionNodeType.setDerived_from(ToscaNodeType.ABSTRACT_SUBSTITUTE.getDisplayName());
+ substitutionNodeType.setDescription(nestedSubstitutionServiceTemplate.getDescription());
+ substitutionNodeType
+ .setProperties(manageSubstitutionNodeTypeProperties(nestedSubstitutionServiceTemplate));
+ substitutionNodeType
+ .setAttributes(manageSubstitutionNodeTypeAttributes(nestedSubstitutionServiceTemplate));
+ DataModelUtil.addNodeType(globalSubstitutionServiceTemplate, substitutionNodeTypeKey,
+ substitutionNodeType);
+ Map<String, Map<String, List<String>>> substitutionMapping =
+ manageSubstitutionNodeTypeCapabilitiesAndRequirements(substitutionNodeType,
+ nestedSubstitutionServiceTemplate, translateTo);
+ //calculate substitution mapping after capability and requirement expose calculation
+ nestedSubstitutionServiceTemplate.getTopology_template().setSubstitution_mappings(
+ manageSubstitutionTemplateSubstitutionMapping(substitutionNodeTypeKey,
+ substitutionNodeType, substitutionMapping));
+
+ //add new service template
+ translateTo.getContext().getTranslatedServiceTemplates()
+ .put(Constants.GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME,
+ globalSubstitutionServiceTemplate);
+ translateTo.getContext().getTranslatedServiceTemplates()
+ .put(translateTo.getResource().getType(), nestedSubstitutionServiceTemplate);
+ }
+
+ NodeTemplate substitutionNodeTemplate = new NodeTemplate();
+ List<String> directiveList = new ArrayList<>();
+ directiveList.add(ToscaConstants.NODE_TEMPLATE_DIRECTIVE_SUBSTITUTABLE);
+ substitutionNodeTemplate.setDirectives(directiveList);
+ substitutionNodeTemplate.setType(substitutionNodeTypeKey);
+ substitutionNodeTemplate.setProperties(
+ managerSubstitutionNodeTemplateProperties(translateTo, substitutionNodeTemplate,
+ templateName));
+ manageSubstitutionNodeTemplateConnectionPoint(translateTo, nestedFileData,
+ substitutionNodeTemplate);
+ DataModelUtil.addNodeTemplate(translateTo.getServiceTemplate(), translateTo.getTranslatedId(),
+ substitutionNodeTemplate);
+ }
+
+ private void manageSubstitutionNodeTemplateConnectionPoint(TranslateTo translateTo,
+ FileData nestedFileData,
+ NodeTemplate substitutionNodeTemplate) {
+ ServiceTemplate globalSubstitutionTemplate =
+ translateTo.getContext().getTranslatedServiceTemplates()
+ .get(Constants.GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME);
+ NodeType nodeType = globalSubstitutionTemplate.getNode_types().get(
+ ToscaConstants.NODES_SUBSTITUTION_PREFIX
+ + FileUtils.getFileWithoutExtention(translateTo.getResource().getType()));
+ handlePortToNetConnections(translateTo, nestedFileData, substitutionNodeTemplate, nodeType);
+ handleSecurityRulesToPortConnections(translateTo, nestedFileData, substitutionNodeTemplate,
+ nodeType);
+ handleNovaToVolConnection(translateTo, nestedFileData, substitutionNodeTemplate, nodeType);
+ handleContrailV2VmInterfaceToNetworkConnection(translateTo, nestedFileData,
+ substitutionNodeTemplate, nodeType);
+ }
+
+ private void handleContrailV2VmInterfaceToNetworkConnection(TranslateTo translateTo,
+ FileData nestedFileData,
+ NodeTemplate substitutionNodeTemplate,
+ NodeType nodeType) {
+ ContrailV2VmInterfaceToNetResourceConnection linker =
+ new ContrailV2VmInterfaceToNetResourceConnection(this, translateTo, nestedFileData,
+ substitutionNodeTemplate, nodeType);
+ linker.connect();
+ }
+
+ private void handleNovaToVolConnection(TranslateTo translateTo, FileData nestedFileData,
+ NodeTemplate substitutionNodeTemplate, NodeType nodeType) {
+ NovaToVolResourceConnection linker =
+ new NovaToVolResourceConnection(this, translateTo, nestedFileData, substitutionNodeTemplate,
+ nodeType);
+ linker.connect();
+ }
+
+ private void handleSecurityRulesToPortConnections(TranslateTo translateTo,
+ FileData nestedFileData,
+ NodeTemplate substitutionNodeTemplate,
+ NodeType nodeType) {
+ SecurityRulesToPortResourceConnection linker =
+ new SecurityRulesToPortResourceConnection(this, translateTo, nestedFileData,
+ substitutionNodeTemplate, nodeType);
+ linker.connect();
+ }
+
+ private void handlePortToNetConnections(TranslateTo translateTo, FileData nestedFileData,
+ NodeTemplate substitutionNodeTemplate,
+ NodeType nodeType) {
+ PortToNetResourceConnection linker =
+ new PortToNetResourceConnection(this, translateTo, nestedFileData, substitutionNodeTemplate,
+ nodeType);
+ linker.connect();
+ }
+
+ private List<Map<String, RequirementDefinition>> getVolumeRequirements(NodeType nodeType) {
+ List<Map<String, RequirementDefinition>> volumeRequirementsList = new ArrayList<>();
+ List<Map<String, RequirementDefinition>> requirementsList = nodeType.getRequirements();
+
+ for (int i = 0; requirementsList != null && i < requirementsList.size(); i++) {
+ RequirementDefinition req;
+ for (Map.Entry<String, RequirementDefinition> entry : requirementsList.get(i).entrySet()) {
+ req = entry.getValue();
+ if (isVolumeRequirement(req, ToscaCapabilityType.ATTACHMENT.getDisplayName(),
+ ToscaNodeType.BLOCK_STORAGE.getDisplayName(),
+ ToscaRelationshipType.NATIVE_ATTACHES_TO.getDisplayName())) {
+ Map<String, RequirementDefinition> volumeRequirementsMap = new HashMap<>();
+ volumeRequirementsMap.put(entry.getKey(), entry.getValue());
+ volumeRequirementsList.add(volumeRequirementsMap);
+ }
+
+ }
+ }
+ return volumeRequirementsList;
+ }
+
+ private boolean isVolumeRequirement(RequirementDefinition req, String capability, String node,
+ String relationship) {
+ return req.getCapability().equals(capability) && req.getRelationship().equals(relationship)
+ && req.getNode().equals(node);
+ }
+
+ private String getVolumeIdProperty(HeatOrchestrationTemplate heatOrchestrationTemplate,
+ String resourceId) {
+
+ String novaResourceId;
+ String volumeId = null;
+ for (Resource resource : heatOrchestrationTemplate.getResources().values()) {
+ if (resource.getType()
+ .equals(HeatResourcesTypes.CINDER_VOLUME_ATTACHMENT_RESOURCE_TYPE.getHeatResource())) {
+ Optional<String> optNovaResourceId =
+ getToscaPropertyValueSource(HeatConstants.INSTANCE_UUID_PROPERTY_NAME, resource,
+ "get_resource");
+ if (optNovaResourceId.isPresent()) {
+ novaResourceId = optNovaResourceId.get();
+ if (novaResourceId.equals(resourceId)) {
+ Optional<String> optVolumeId =
+ getToscaPropertyValueSource(HeatConstants.VOLUME_ID_PROPERTY_NAME, resource,
+ "get_param");
+ if (optVolumeId.isPresent()) {
+ volumeId = optVolumeId.get();
+ }
+ } else {
+ logger.warn("property:" + HeatConstants.VOLUME_ID_PROPERTY_NAME + " of resource type:"
+ + resource.getType() + " should contain 'get_param' function");
+ }
+ }
+ }
+ }
+ return volumeId;
+ }
+
+ private String getTranslatedVolumeIdByVolumeIdProperty(String volumeId, TranslateTo translateTo) {
+ Optional<AttachedResourceId> volumeIdInfo =
+ HeatToToscaUtil.extractAttachedResourceId(translateTo, volumeId);
+ if (volumeIdInfo.isPresent()) {
+ if (volumeIdInfo.get().isGetResource()) {
+ return null;//(String) volumeIdInfo.get().getTranslatedId();
+ } else if (volumeIdInfo.get().isGetParam()) {
+ List<FileData> allFilesData = translateTo.getContext().getManifest().getContent().getData();
+ Optional<List<FileData>> fileDataList = HeatToToscaUtil
+ .buildListOfFilesToSearch(translateTo.getHeatFileName(), allFilesData,
+ FileData.Type.HEAT_VOL);
+ if (fileDataList.isPresent()) {
+ Optional<ResourceFileDataAndIDs> resourceFileDataAndIDs =
+ getFileDataContainingResource(fileDataList.get(),
+ (String) volumeIdInfo.get().getEntityId(), translateTo.getContext(),
+ FileData.Type.HEAT_VOL);
+ if (resourceFileDataAndIDs.isPresent()) {
+ return resourceFileDataAndIDs.get().getTranslatedResourceId();
+ } else {
+ logger.warn("The attached volume based on volume_id property: " + volumeId + " in "
+ + translateTo.getResourceId()
+ + " can't be found, searching for volume resource id - "
+ + volumeIdInfo.get().getEntityId());
+ return null;
+ }
+ } else {
+ return null;
+ }
+ } else {
+ logger.warn("property:" + volumeId + " of resource :" + volumeIdInfo.get().getEntityId()
+ + " should contain 'get_param' or 'get_resource' function");
+ return null;
+ }
+ } else {
+ logger.warn("property:" + volumeId + " of resource :" + translateTo.getResource().toString()
+ + " is not exist");
+ return null;
+ }
+ }
+
+ private Optional<String> getToscaPropertyValueSource(String propertyName, Resource resource,
+ String key) {
+ Object propertyInstanceUuIdValue;
+ propertyInstanceUuIdValue = resource.getProperties().get(propertyName);
+ if (propertyInstanceUuIdValue instanceof Map) {
+ return Optional.ofNullable((String) ((Map) propertyInstanceUuIdValue).get(key));
+ } else {
+ logger.warn("property:" + propertyName + " of resource type:" + resource.getType()
+ + " should have a value in key value format");
+
+ }
+ return Optional.empty();
+
+ }
+
+ private Map<String, Map<String, List<String>>>
+ manageSubstitutionNodeTypeCapabilitiesAndRequirements(
+ NodeType substitutionNodeType, ServiceTemplate substitutionServiceTemplate,
+ TranslateTo translateTo) {
+
+ Map<String, NodeTemplate> nodeTemplates =
+ substitutionServiceTemplate.getTopology_template().getNode_templates();
+ String templateName;
+ NodeTemplate template;
+ String type;
+ Map<String, Map<String, List<String>>> substitutionMapping = new HashMap<>();
+ if (nodeTemplates == null) {
+ return substitutionMapping;
+ }
+
+ Map<String, List<String>> capabilitySubstitutionMapping = new HashMap<>();
+ Map<String, List<String>> requirementSubstitutionMapping = new HashMap<>();
+ substitutionMapping.put("capability", capabilitySubstitutionMapping);
+ substitutionMapping.put("requirement", requirementSubstitutionMapping);
+ List<Map<String, RequirementDefinition>> nodeTypeRequirementsDefinition;
+ Map<String, RequirementAssignment> nodeTemplateRequirementsAssignment;
+ List<Map<String, RequirementDefinition>> exposedRequirementsDefinition;
+ Map<String, Map<String, RequirementAssignment>> fullFilledRequirementsDefinition =
+ new HashMap<>();
+ Map<String, CapabilityDefinition> nodeTypeCapabilitiesDefinition = new HashMap<>();
+ Map<String, CapabilityDefinition> exposedCapabilitiesDefinition;
+
+ for (Map.Entry<String, NodeTemplate> entry : nodeTemplates.entrySet()) {
+ templateName = entry.getKey();
+ template = entry.getValue();
+ type = template.getType();
+
+ // get requirements
+ nodeTypeRequirementsDefinition =
+ getNodeTypeRequirements(type, templateName, substitutionServiceTemplate,
+ requirementSubstitutionMapping, translateTo.getContext());
+ nodeTemplateRequirementsAssignment = getNodeTemplateRequirements(template);
+ fullFilledRequirementsDefinition.put(templateName, nodeTemplateRequirementsAssignment);
+ //set substitution node type requirements
+ exposedRequirementsDefinition = calculateExposedRequirements(nodeTypeRequirementsDefinition,
+ nodeTemplateRequirementsAssignment);
+ addSubstitutionNodeTypeRequirements(substitutionNodeType, exposedRequirementsDefinition,
+ templateName);
+
+ //get capabilities
+ getNodeTypeCapabilities(nodeTypeCapabilitiesDefinition, capabilitySubstitutionMapping, type,
+ templateName, substitutionServiceTemplate, translateTo.getContext());
+
+ }
+
+ exposedCapabilitiesDefinition = calculateExposedCapabilities(nodeTypeCapabilitiesDefinition,
+ fullFilledRequirementsDefinition);
+ addSubstitutionNodeTypeCapabilities(substitutionNodeType, exposedCapabilitiesDefinition);
+ return substitutionMapping;
+ }
+
+ private Map<String, CapabilityDefinition> calculateExposedCapabilities(
+ Map<String, CapabilityDefinition> nodeTypeCapabilitiesDefinition,
+ Map<String, Map<String, RequirementAssignment>> fullFilledRequirementsDefinitionMap) {
+
+ String capabilityKey;
+ String capability;
+ String node;
+ CapabilityDefinition capabilityDefinition;
+ CapabilityDefinition clonedCapabilityDefinition;
+ for (Map.Entry<String, Map<String, RequirementAssignment>> entry
+ : fullFilledRequirementsDefinitionMap.entrySet()) {
+ for (Map.Entry<String, RequirementAssignment> fullFilledEntry : entry.getValue().entrySet()) {
+
+ capability = fullFilledEntry.getValue().getCapability();
+ fullFilledEntry.getValue().getOccurrences();
+ node = fullFilledEntry.getValue().getNode();
+ capabilityKey = capability + "_" + node;
+ capabilityDefinition = nodeTypeCapabilitiesDefinition.get(capabilityKey);
+ if (capabilityDefinition != null) {
+ clonedCapabilityDefinition = capabilityDefinition.clone();
+ nodeTypeCapabilitiesDefinition.put(capabilityKey, capabilityDefinition.clone());
+ if (evaluateCapabilityFullFilament(clonedCapabilityDefinition)) {
+ nodeTypeCapabilitiesDefinition.remove(capabilityKey);
+ } else {
+ nodeTypeCapabilitiesDefinition.put(capabilityKey, clonedCapabilityDefinition);
+ }
+ }
+ }
+ }
+
+ Map<String, CapabilityDefinition> exposedCapabilitiesDefinition = new HashMap<>();
+ for (Map.Entry<String, CapabilityDefinition> entry : nodeTypeCapabilitiesDefinition
+ .entrySet()) {
+ exposedCapabilitiesDefinition.put(entry.getKey(), entry.getValue());
+ }
+ return exposedCapabilitiesDefinition;
+ }
+
+ private boolean evaluateCapabilityFullFilament(CapabilityDefinition capabilityDefinition) {
+ Object[] occurrences = capabilityDefinition.getOccurrences();
+ if (occurrences == null) {
+ capabilityDefinition.setOccurrences(new Object[]{"0", ToscaConstants.UNBOUNDED});
+ return false;
+ }
+ if (occurrences[1].equals(ToscaConstants.UNBOUNDED)) {
+ return false;
+ }
+
+ if (occurrences[1].equals(1)) {
+ return true;
+ }
+ occurrences[1] = (Integer) occurrences[1] - 1;
+ return false;
+ }
+
+ private boolean evaluateRequirementFullFilament(RequirementDefinition requirementDefinition) {
+ Object[] occurrences = requirementDefinition.getOccurrences();
+ if (occurrences == null) {
+ requirementDefinition.setOccurrences(new Object[]{"0", ToscaConstants.UNBOUNDED});
+ return false;
+ }
+ if (occurrences[1].equals(ToscaConstants.UNBOUNDED)) {
+ return false;
+ }
+
+ if (occurrences[1].equals(1)) {
+ return true;
+ }
+ occurrences[1] = (Integer) occurrences[1] - 1;
+ return false;
+ }
+
+ private void getNodeTypeCapabilities(
+ Map<String, CapabilityDefinition> nodeTypeCapabilitiesDefinition,
+ Map<String, List<String>> capabilitySubstitutionMapping, String type, String templateName,
+ ServiceTemplate serviceTemplate, TranslationContext context) {
+ NodeType nodeType = getNodeTypeWithFlatHierarchy(type, serviceTemplate, context);
+ String capabilityKey;
+ List<String> capabilityMapping;
+ if (nodeType.getCapabilities() != null) {
+ for (Map.Entry<String, CapabilityDefinition> capabilityNodeEntry : nodeType.getCapabilities()
+ .entrySet()) {
+ capabilityKey = capabilityNodeEntry.getKey() + "_" + templateName;
+ nodeTypeCapabilitiesDefinition.put(capabilityKey, capabilityNodeEntry.getValue().clone());
+ capabilityMapping = new ArrayList<>();
+ capabilityMapping.add(templateName);
+ capabilityMapping.add(capabilityNodeEntry.getKey());
+ capabilitySubstitutionMapping.put(capabilityKey, capabilityMapping);
+ }
+ }
+
+ String derivedFrom = nodeType.getDerived_from();
+ if (derivedFrom != null) {
+ getNodeTypeCapabilities(nodeTypeCapabilitiesDefinition, capabilitySubstitutionMapping,
+ derivedFrom, templateName, serviceTemplate, context);
+ }
+ }
+
+ private List<Map<String, RequirementDefinition>> calculateExposedRequirements(
+ List<Map<String, RequirementDefinition>> nodeTypeRequirementsDefinitionList,
+ Map<String, RequirementAssignment> nodeTemplateRequirementsAssignment) {
+ if (nodeTypeRequirementsDefinitionList == null) {
+ return null;
+ }
+ for (Map.Entry<String, RequirementAssignment> entry : nodeTemplateRequirementsAssignment
+ .entrySet()) {
+ if (entry.getValue().getNode() != null) {
+ RequirementDefinition requirementDefinition =
+ getRequirementDefinition(nodeTypeRequirementsDefinitionList, entry.getKey());
+ RequirementDefinition cloneRequirementDefinition;
+ if (requirementDefinition != null) {
+ cloneRequirementDefinition = requirementDefinition.clone();
+ if (!evaluateRequirementFullFilament(cloneRequirementDefinition)) {
+ this.mergeEntryInList(entry.getKey(), cloneRequirementDefinition,
+ nodeTypeRequirementsDefinitionList);
+ } else {
+ removeRequirementsDefinition(nodeTypeRequirementsDefinitionList, entry.getKey());
+ }
+ }
+ } else {
+ for (Map<String, RequirementDefinition> nodeTypeRequirementsMap
+ : nodeTypeRequirementsDefinitionList) {
+ Object max = nodeTypeRequirementsMap.get(entry.getKey()).getOccurrences() != null
+ && nodeTypeRequirementsMap.get(entry.getKey()).getOccurrences().length > 0
+ ? nodeTypeRequirementsMap.get(entry.getKey()).getOccurrences()[1] : 1;
+ Object min = nodeTypeRequirementsMap.get(entry.getKey()).getOccurrences() != null
+ && nodeTypeRequirementsMap.get(entry.getKey()).getOccurrences().length > 0
+ ? nodeTypeRequirementsMap.get(entry.getKey()).getOccurrences()[0] : 1;
+ nodeTypeRequirementsMap.get(entry.getKey()).setOccurrences(new Object[]{min, max});
+ }
+ }
+ }
+ return nodeTypeRequirementsDefinitionList;
+ }
+
+ private void removeRequirementsDefinition(
+ List<Map<String, RequirementDefinition>> nodeTypeRequirementsDefinitionList,
+ String requirementKey) {
+ for (Map<String, RequirementDefinition> reqMap : nodeTypeRequirementsDefinitionList) {
+ reqMap.remove(requirementKey);
+ }
+ }
+
+ private RequirementDefinition getRequirementDefinition(
+ List<Map<String, RequirementDefinition>> nodeTypeRequirementsDefinitionList,
+ String requirementKey) {
+ for (Map<String, RequirementDefinition> requirementMap : nodeTypeRequirementsDefinitionList) {
+ if (requirementMap.containsKey(requirementKey)) {
+ return requirementMap.get(requirementKey);
+ }
+ }
+ return null;
+ }
+
+ private Map<String, RequirementAssignment> getNodeTemplateRequirements(NodeTemplate template) {
+ List<Map<String, RequirementAssignment>> templateRequirements = template.getRequirements();
+
+ Map<String, RequirementAssignment> nodeTemplateRequirementsDefinition = new HashMap<>();
+ if (CollectionUtils.isEmpty(templateRequirements)) {
+ return nodeTemplateRequirementsDefinition;
+ }
+ for (Map<String, RequirementAssignment> requirementAssignmentMap : templateRequirements) {
+ for (Map.Entry<String, RequirementAssignment> requirementEntry : requirementAssignmentMap
+ .entrySet()) {
+ nodeTemplateRequirementsDefinition
+ .put(requirementEntry.getKey(), requirementEntry.getValue());
+ }
+ }
+ return nodeTemplateRequirementsDefinition;
+ }
+
+ private List<Map<String, RequirementDefinition>> getNodeTypeRequirements(String type,
+ String templateName,
+ ServiceTemplate serviceTemplate,
+ Map<String, List<String>> requirementSubstitutionMapping,
+ TranslationContext context) {
+ List<Map<String, RequirementDefinition>> requirementList = null;
+ NodeType nodeType = getNodeTypeWithFlatHierarchy(type, serviceTemplate, context);
+ String derivedFrom = nodeType.getDerived_from();
+ List<String> requirementMapping;
+ if (derivedFrom != null) {
+ requirementList = getNodeTypeRequirements(derivedFrom, templateName, serviceTemplate,
+ requirementSubstitutionMapping, context);
+ }
+ if (requirementList == null) {
+ requirementList = new ArrayList<>();
+ }
+
+ if (nodeType.getRequirements() != null) {
+ for (Map<String, RequirementDefinition> requirementMap : nodeType.getRequirements()) {
+ for (Map.Entry<String, RequirementDefinition> requirementNodeEntry : requirementMap
+ .entrySet()) {
+ if (requirementNodeEntry.getValue().getOccurrences() == null) {
+ requirementNodeEntry.getValue().setOccurrences(new Object[]{1, 1});
+ }
+ Map<String, RequirementDefinition> requirementDef = new HashMap<>();
+ requirementDef.put(requirementNodeEntry.getKey(), requirementNodeEntry.getValue());
+ addRequirementToList(requirementList, requirementDef);
+ requirementMapping = new ArrayList<>();
+ requirementMapping.add(templateName);
+ requirementMapping.add(requirementNodeEntry.getKey());
+ requirementSubstitutionMapping
+ .put(requirementNodeEntry.getKey() + "_" + templateName, requirementMapping);
+ if (requirementNodeEntry.getValue().getNode() == null) {
+ requirementNodeEntry.getValue().setOccurrences(new Object[]{1, 1});
+ }
+ }
+ }
+ }
+
+ return requirementList;
+ }
+
+ private void addRequirementToList(List<Map<String, RequirementDefinition>> requirementList,
+ Map<String, RequirementDefinition> requirementDef) {
+ for (Map.Entry<String, RequirementDefinition> entry : requirementDef.entrySet()) {
+ this.mergeEntryInList(entry.getKey(), entry.getValue(), requirementList);
+ }
+ }
+
+ private void addSubstitutionNodeTypeCapabilities(NodeType substitutionNodeType,
+ Map<String, CapabilityDefinition> capabilities) {
+ if (capabilities == null || capabilities.entrySet().size() == 0) {
+ return;
+ }
+
+ if (MapUtils.isEmpty(substitutionNodeType.getCapabilities())) {
+ substitutionNodeType.setCapabilities(new HashMap<>());
+ }
+ if (capabilities.size() > 0) {
+ substitutionNodeType.setCapabilities(new HashMap<>());
+ }
+ for (Map.Entry<String, CapabilityDefinition> entry : capabilities.entrySet()) {
+ substitutionNodeType.getCapabilities().put(entry.getKey(), entry.getValue());
+ }
+ }
+
+ private void addSubstitutionNodeTypeRequirements(NodeType substitutionNodeType,
+ List<Map<String, RequirementDefinition>> requirementsList,
+ String templateName) {
+ if (requirementsList == null || requirementsList.size() == 0) {
+ return;
+ }
+
+ if (substitutionNodeType.getRequirements() == null) {
+ substitutionNodeType.setRequirements(new ArrayList<>());
+ }
+
+ for (Map<String, RequirementDefinition> requirementDef : requirementsList) {
+ for (Map.Entry<String, RequirementDefinition> entry : requirementDef.entrySet()) {
+ Map<String, RequirementDefinition> requirementMap = new HashMap<>();
+ requirementMap.put(entry.getKey() + "_" + templateName, entry.getValue().clone());
+ substitutionNodeType.getRequirements().add(requirementMap);
+ }
+ }
+ }
+
+
+ private SubstitutionMapping manageSubstitutionTemplateSubstitutionMapping(String nodeTypeKey,
+ NodeType substitutionNodeType,
+ Map<String, Map<String, List<String>>> mapping) {
+ SubstitutionMapping substitutionMapping = new SubstitutionMapping();
+ substitutionMapping.setNode_type(nodeTypeKey);
+ substitutionMapping.setCapabilities(
+ manageCapabilityMapping(substitutionNodeType.getCapabilities(), mapping.get("capability")));
+ substitutionMapping.setRequirements(
+ manageRequirementMapping(substitutionNodeType.getRequirements(),
+ mapping.get("requirement")));
+ return substitutionMapping;
+ }
+
+ private Map<String, List<String>> manageCapabilityMapping(
+ Map<String, CapabilityDefinition> capabilities,
+ Map<String, List<String>> capabilitySubstitutionMapping) {
+ if (capabilities == null) {
+ return null;
+ }
+
+ Map<String, List<String>> capabilityMapping = new HashMap<>();
+ String capabilityKey;
+ List<String> capabilityMap;
+ for (Map.Entry<String, CapabilityDefinition> entry : capabilities.entrySet()) {
+ capabilityKey = entry.getKey();
+ capabilityMap = capabilitySubstitutionMapping.get(capabilityKey);
+ capabilityMapping.put(capabilityKey, capabilityMap);
+ }
+ return capabilityMapping;
+ }
+
+ private Map<String, List<String>> manageRequirementMapping(
+ List<Map<String, RequirementDefinition>> requirementList,
+ Map<String, List<String>> requirementSubstitutionMapping) {
+ if (requirementList == null) {
+ return null;
+ }
+ Map<String, List<String>> requirementMapping = new HashMap<>();
+ String requirementKey;
+ List<String> requirementMap;
+ for (Map<String, RequirementDefinition> requirementDefMap : requirementList) {
+ for (Map.Entry<String, RequirementDefinition> entry : requirementDefMap.entrySet()) {
+ requirementKey = entry.getKey();
+ requirementMap = requirementSubstitutionMapping.get(requirementKey);
+ requirementMapping.put(requirementKey, requirementMap);
+ }
+ }
+ return requirementMapping;
+ }
+
+
+ private Map<String, AttributeDefinition> manageSubstitutionNodeTypeAttributes(
+ ServiceTemplate substitutionServiceTemplate) {
+
+ Map<String, AttributeDefinition> substitutionNodeTypeAttributes = new HashMap<>();
+ Map<String, ParameterDefinition> attributes =
+ substitutionServiceTemplate.getTopology_template().getOutputs();
+ if (attributes == null) {
+ return null;
+ }
+ AttributeDefinition attributeDefinition;
+ String toscaAttributeName;
+
+ for (Map.Entry<String, ParameterDefinition> entry : attributes.entrySet()) {
+ attributeDefinition = new AttributeDefinition();
+ toscaAttributeName = entry.getKey();
+ ParameterDefinition parameterDefinition =
+ substitutionServiceTemplate.getTopology_template().getOutputs().get(toscaAttributeName);
+ if (parameterDefinition.getType() != null && !parameterDefinition.getType().isEmpty()) {
+ attributeDefinition.setType(parameterDefinition.getType());
+ } else {
+ attributeDefinition.setType(PropertyType.STRING.getDisplayName());
+ }
+ attributeDefinition.setDescription(parameterDefinition.getDescription());
+ attributeDefinition.set_default(parameterDefinition.get_default());
+ attributeDefinition.setEntry_schema(parameterDefinition.getEntry_schema());
+ attributeDefinition.setStatus(parameterDefinition.getStatus());
+ substitutionNodeTypeAttributes.put(toscaAttributeName, attributeDefinition);
+ }
+ return substitutionNodeTypeAttributes;
+ }
+
+ private Map<String, PropertyDefinition> manageSubstitutionNodeTypeProperties(
+ ServiceTemplate substitutionServiceTemplate) {
+ Map<String, PropertyDefinition> substitutionNodeTypeProperties = new HashMap<>();
+ Map<String, ParameterDefinition> properties =
+ substitutionServiceTemplate.getTopology_template().getInputs();
+ if (properties == null) {
+ return null;
+ }
+
+ PropertyDefinition propertyDefinition;
+ String toscaPropertyName;
+ for (Map.Entry<String, ParameterDefinition> entry : properties.entrySet()) {
+ toscaPropertyName = entry.getKey();
+ propertyDefinition = new PropertyDefinition();
+ ParameterDefinition parameterDefinition =
+ substitutionServiceTemplate.getTopology_template().getInputs().get(toscaPropertyName);
+ propertyDefinition.setType(parameterDefinition.getType());
+ propertyDefinition.setDescription(parameterDefinition.getDescription());
+ propertyDefinition.setRequired(parameterDefinition.getRequired());
+ propertyDefinition.set_default(parameterDefinition.get_default());
+ propertyDefinition.setConstraints(parameterDefinition.getConstraints());
+ propertyDefinition.setEntry_schema(parameterDefinition.getEntry_schema());
+ propertyDefinition.setStatus(parameterDefinition.getStatus());
+ substitutionNodeTypeProperties.put(toscaPropertyName, propertyDefinition);
+ }
+ return substitutionNodeTypeProperties;
+ }
+
+ private Map<String, Object> managerSubstitutionNodeTemplateProperties(TranslateTo translateTo,
+ Template template,
+ String templateName) {
+ Map<String, Object> substitutionProperties = new HashMap<>();
+ Map<String, Object> heatProperties = translateTo.getResource().getProperties();
+ if (Objects.nonNull(heatProperties)) {
+ for (Map.Entry<String, Object> entry : heatProperties.entrySet()) {
+
+ Object property = TranslatorHeatToToscaPropertyConverter
+ .getToscaPropertyValue(entry.getKey(), entry.getValue(), null,
+ translateTo.getHeatFileName(), translateTo.getHeatOrchestrationTemplate(), template,
+ translateTo.getContext());
+ substitutionProperties.put(entry.getKey(), property);
+ }
+ }
+
+ return addAbstractSubstitutionProperty(templateName, substitutionProperties);
+ }
+
+ private Map<String, Object> addAbstractSubstitutionProperty(String templateName,
+ Map<String, Object> substitutionProperties) {
+ Map<String, Object> innerProps = new HashMap<>();
+ innerProps.put(ToscaConstants.SUBSTITUTE_SERVICE_TEMPLATE_PROPERTY_NAME,
+ ToscaUtil.getServiceTemplateFileName(templateName));
+ substitutionProperties.put(ToscaConstants.SERVICE_TEMPLATE_FILTER_PROPERTY_NAME, innerProps);
+ return substitutionProperties;
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronNetImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronNetImpl.java
new file mode 100644
index 0000000000..0b4ed61753
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronNetImpl.java
@@ -0,0 +1,52 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
+import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
+import org.openecomp.sdc.tosca.services.DataModelUtil;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo;
+import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil;
+import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaPropertyConverter;
+
+public class ResourceTranslationNeutronNetImpl extends ResourceTranslationBase {
+
+ @Override
+ public void translate(TranslateTo translateTo) {
+
+ NodeTemplate nodeTemplate = new NodeTemplate();
+ nodeTemplate.setType(ToscaNodeType.NEUTRON_NET.getDisplayName());
+ nodeTemplate.setProperties(TranslatorHeatToToscaPropertyConverter
+ .getToscaPropertiesSimpleConversion(translateTo.getResource().getProperties(),
+ nodeTemplate.getProperties(), translateTo.getHeatFileName(),
+ translateTo.getHeatOrchestrationTemplate(), translateTo.getResource().getType(),
+ nodeTemplate, translateTo.getContext()));
+
+ HeatToToscaUtil.mapBoolean(nodeTemplate, "port_security_enabled");
+ HeatToToscaUtil.mapBoolean(nodeTemplate, "shared");
+ HeatToToscaUtil.mapBoolean(nodeTemplate, "admin_state_up");
+
+ DataModelUtil.addNodeTemplate(translateTo.getServiceTemplate(), translateTo.getTranslatedId(),
+ nodeTemplate);
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronPortImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronPortImpl.java
new file mode 100644
index 0000000000..343462d266
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronPortImpl.java
@@ -0,0 +1,233 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes;
+import org.openecomp.sdc.heat.datatypes.model.Resource;
+import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType;
+import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
+import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType;
+import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.RequirementAssignment;
+import org.openecomp.sdc.tosca.services.DataModelUtil;
+import org.openecomp.sdc.tosca.services.ToscaConstants;
+import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslatedHeatResource;
+import org.openecomp.sdc.translator.services.heattotosca.Constants;
+import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil;
+import org.openecomp.sdc.translator.services.heattotosca.ResourceTranslationFactory;
+import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaPropertyConverter;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+
+
+public class ResourceTranslationNeutronPortImpl extends ResourceTranslationBase {
+
+ @Override
+ public void translate(TranslateTo translateTo) {
+
+ NodeTemplate nodeTemplate = new NodeTemplate();
+ nodeTemplate.setType(ToscaNodeType.NEUTRON_PORT.getDisplayName());
+
+ nodeTemplate.setProperties(TranslatorHeatToToscaPropertyConverter
+ .getToscaPropertiesSimpleConversion(translateTo.getResource().getProperties(),
+ nodeTemplate.getProperties(), translateTo.getHeatFileName(),
+ translateTo.getHeatOrchestrationTemplate(), translateTo.getResource().getType(),
+ nodeTemplate, translateTo.getContext()));
+ handleNetworkRequirement(translateTo, nodeTemplate);
+ String resourceTranslatedId = handleSecurityRulesRequirement(translateTo);
+ DataModelUtil
+ .addNodeTemplate(translateTo.getServiceTemplate(), resourceTranslatedId, nodeTemplate);
+ }
+
+ private String handleSecurityRulesRequirement(TranslateTo translateTo) {
+ String resourceTranslatedId = translateTo.getTranslatedId();
+ Map<String, Object> properties = translateTo.getResource().getProperties();
+ Optional<Object> securityGroups =
+ Optional.ofNullable(properties.get(Constants.SECURITY_GROUPS_PROPERTY_NAME));
+ if (securityGroups.isPresent() && securityGroups.get() instanceof List) {
+ List securityGroupsList = (List) securityGroups.get();
+ securityGroupsList.forEach(resourceValue -> {
+ Optional<AttachedResourceId> securityGroupResourceId = HeatToToscaUtil
+ .extractAttachedResourceId(translateTo.getHeatFileName(),
+ translateTo.getHeatOrchestrationTemplate(), translateTo.getContext(),
+ resourceValue);
+ if (securityGroupResourceId.isPresent()) {
+ handleSecurityGroupResourceId(translateTo, resourceTranslatedId,
+ securityGroupResourceId.get());
+ }
+ });
+ }
+ return resourceTranslatedId;
+ }
+
+ private void handleSecurityGroupResourceId(TranslateTo translateTo, String resourceTranslatedId,
+ AttachedResourceId securityGroupResourceId) {
+ List<String> supportedSecurityGroupsTypes = Collections
+ .singletonList(HeatResourcesTypes.NEUTRON_SECURITY_GROUP_RESOURCE_TYPE.getHeatResource());
+ if (securityGroupResourceId.isGetResource()) {
+ handleGetResource(translateTo, resourceTranslatedId, securityGroupResourceId,
+ supportedSecurityGroupsTypes);
+ } else if (securityGroupResourceId.isGetParam()) {
+ handleGetParam(translateTo, resourceTranslatedId, securityGroupResourceId,
+ supportedSecurityGroupsTypes);
+ }
+ }
+
+ private void handleGetParam(TranslateTo translateTo, String resourceTranslatedId,
+ AttachedResourceId securityGroupResourceId,
+ List<String> supportedSecurityGroupsTypes) {
+ TranslatedHeatResource translatedSharedResourceId =
+ translateTo.getContext().getHeatSharedResourcesByParam()
+ .get(securityGroupResourceId.getEntityId());
+ if (Objects.nonNull(translatedSharedResourceId)
+ && !HeatToToscaUtil.isHeatFileNested(translateTo, translateTo.getHeatFileName())) {
+ if (validateResourceTypeSupportedForReqCreation(translateTo, supportedSecurityGroupsTypes,
+ translatedSharedResourceId.getHeatResource(), "security_groups")) {
+ return;
+ }
+ final NodeTemplate securityGroupNodeTemplate = DataModelUtil
+ .getNodeTemplate(translateTo.getServiceTemplate(),
+ translatedSharedResourceId.getTranslatedId());
+ RequirementAssignment requirement = new RequirementAssignment();
+ requirement.setCapability(ToscaCapabilityType.ATTACHMENT.getDisplayName());
+ requirement.setNode(resourceTranslatedId);
+ requirement.setRelationship(ToscaRelationshipType.ATTACHES_TO.getDisplayName());
+ DataModelUtil
+ .addRequirementAssignment(securityGroupNodeTemplate, ToscaConstants.PORT_REQUIREMENT_ID,
+ requirement);
+ }
+ }
+
+ private void handleGetResource(TranslateTo translateTo, String resourceTranslatedId,
+ AttachedResourceId securityGroupResourceId,
+ List<String> supportedSecurityGroupsTypes) {
+ String resourceId = (String) securityGroupResourceId.getEntityId();
+ Resource securityGroupResource = HeatToToscaUtil
+ .getResource(translateTo.getHeatOrchestrationTemplate(), resourceId,
+ translateTo.getHeatFileName());
+ Optional<String> securityGroupTranslatedId =
+ ResourceTranslationFactory.getInstance(securityGroupResource)
+ .translateResource(translateTo.getHeatFileName(), translateTo.getServiceTemplate(),
+ translateTo.getHeatOrchestrationTemplate(), securityGroupResource, resourceId,
+ translateTo.getContext());
+ if (securityGroupTranslatedId.isPresent()) {
+ if (validateResourceTypeSupportedForReqCreation(translateTo, supportedSecurityGroupsTypes,
+ securityGroupResource, "security_groups")) {
+ return;
+ }
+ final NodeTemplate securityGroupNodeTemplate = DataModelUtil
+ .getNodeTemplate(translateTo.getServiceTemplate(), securityGroupTranslatedId.get());
+ RequirementAssignment requirement = new RequirementAssignment();
+ requirement.setCapability(ToscaCapabilityType.ATTACHMENT.getDisplayName());
+ requirement.setNode(resourceTranslatedId);
+ requirement.setRelationship(ToscaRelationshipType.ATTACHES_TO.getDisplayName());
+ DataModelUtil
+ .addRequirementAssignment(securityGroupNodeTemplate, ToscaConstants.PORT_REQUIREMENT_ID,
+ requirement);
+ }
+ }
+
+ private void handleNetworkRequirement(TranslateTo translateTo, NodeTemplate nodeTemplate) {
+ Optional<AttachedResourceId> networkResourceId =
+ HeatToToscaUtil.extractAttachedResourceId(translateTo, "network");
+ if (networkResourceId.isPresent()) {
+ AttachedResourceId attachedResourceId = networkResourceId.get();
+ addRequirementAssignmentForNetworkResource(translateTo, nodeTemplate, attachedResourceId);
+ } else {
+ networkResourceId = HeatToToscaUtil.extractAttachedResourceId(translateTo, "network_id");
+ if (networkResourceId.isPresent()) {
+ AttachedResourceId attachedResourceId = networkResourceId.get();
+ addRequirementAssignmentForNetworkResource(translateTo, nodeTemplate, attachedResourceId);
+ }
+ }
+ }
+
+ private void addRequirementAssignmentForNetworkResource(TranslateTo translateTo,
+ NodeTemplate nodeTemplate,
+ AttachedResourceId attachedResourceId) {
+ String networkTranslatedId;
+ List<String> supportedNetworkTypes =
+ Arrays.asList(HeatResourcesTypes.NEUTRON_NET_RESOURCE_TYPE.getHeatResource(),
+ HeatResourcesTypes.CONTRAIL_VIRTUAL_NETWORK_RESOURCE_TYPE.getHeatResource(),
+ HeatResourcesTypes.CONTRAIL_V2_VIRTUAL_NETWORK_RESOURCE_TYPE.getHeatResource());
+ if (attachedResourceId.isGetResource()) {
+ Resource networkHeatResource = translateTo.getHeatOrchestrationTemplate().getResources()
+ .get(attachedResourceId.getEntityId());
+ if (validateResourceTypeSupportedForReqCreation(translateTo, supportedNetworkTypes,
+ networkHeatResource, "network'\\'network_id")) {
+ return;
+ }
+ networkTranslatedId = (String) attachedResourceId.getTranslatedId();
+ addRequirementAssignment(nodeTemplate, networkTranslatedId);
+ } else if (attachedResourceId.isGetParam()) {
+ TranslatedHeatResource translatedSharedResourceId =
+ translateTo.getContext().getHeatSharedResourcesByParam()
+ .get(attachedResourceId.getEntityId());
+ if (Objects.nonNull(translatedSharedResourceId)
+ && !HeatToToscaUtil.isHeatFileNested(translateTo, translateTo.getHeatFileName())) {
+ if (validateResourceTypeSupportedForReqCreation(translateTo, supportedNetworkTypes,
+ translatedSharedResourceId.getHeatResource(), "network'\\'network_id")) {
+ return;
+ }
+ addRequirementAssignment(nodeTemplate, translatedSharedResourceId.getTranslatedId());
+ }
+ }
+ }
+
+ private void addRequirementAssignment(NodeTemplate nodeTemplate, String translatedId) {
+ RequirementAssignment requirement = new RequirementAssignment();
+ requirement.setCapability(ToscaCapabilityType.NETWORK_LINKABLE.getDisplayName());
+ requirement.setRelationship(ToscaRelationshipType.NETWORK_LINK_TO.getDisplayName());
+ requirement.setNode(translatedId);
+ DataModelUtil
+ .addRequirementAssignment(nodeTemplate, ToscaConstants.LINK_REQUIREMENT_ID, requirement);
+ }
+
+
+ private boolean validateResourceTypeSupportedForReqCreation(TranslateTo translateTo,
+ List<String> supportedTypes,
+ Resource heatResource,
+ final String propertyName) {
+ if (!isResourceTypeValidForRequirement(heatResource, supportedTypes)) {
+ logger.warn(
+ "'" + propertyName + "' property of port resource('" + translateTo.getResourceId()
+ + "') is pointing to a resource of type '" + heatResource.getType() + "' "
+ + "which is not supported for this requirement. "
+ + "Supported types are: " + supportedTypes.toString());
+ return true;
+ }
+ return false;
+ }
+
+ private boolean isResourceTypeValidForRequirement(Resource networkHeatResource,
+ List<String> supportedNetworkTypes) {
+ return Objects.nonNull(networkHeatResource)
+ && supportedNetworkTypes.contains(networkHeatResource.getType());
+ }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronSecurityGroupImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronSecurityGroupImpl.java
new file mode 100644
index 0000000000..cacaf4c5c7
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronSecurityGroupImpl.java
@@ -0,0 +1,47 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
+import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
+import org.openecomp.sdc.tosca.services.DataModelUtil;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo;
+import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaPropertyConverter;
+
+public class ResourceTranslationNeutronSecurityGroupImpl extends ResourceTranslationBase {
+
+ @Override
+ public void translate(TranslateTo translateTo) {
+
+ NodeTemplate nodeTemplate = new NodeTemplate();
+ nodeTemplate.setType(ToscaNodeType.NEUTRON_SECURITY_RULES.getDisplayName());
+ nodeTemplate.setProperties(TranslatorHeatToToscaPropertyConverter
+ .getToscaPropertiesSimpleConversion(translateTo.getResource().getProperties(),
+ nodeTemplate.getProperties(), translateTo.getHeatFileName(),
+ translateTo.getHeatOrchestrationTemplate(), translateTo.getResource().getType(),
+ nodeTemplate, translateTo.getContext()));
+
+ DataModelUtil.addNodeTemplate(translateTo.getServiceTemplate(), translateTo.getTranslatedId(),
+ nodeTemplate);
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronSubnetImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronSubnetImpl.java
new file mode 100644
index 0000000000..8306f57146
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronSubnetImpl.java
@@ -0,0 +1,170 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.heat.datatypes.HeatBoolean;
+import org.openecomp.sdc.heat.datatypes.model.Resource;
+import org.openecomp.sdc.tosca.datatypes.ToscaFunctions;
+import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.ParameterDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.PropertyType;
+import org.openecomp.sdc.tosca.services.DataModelUtil;
+import org.openecomp.sdc.tosca.services.ToscaConstants;
+import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo;
+
+import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil;
+import org.openecomp.sdc.translator.services.heattotosca.ResourceTranslationFactory;
+import org.openecomp.sdc.translator.services.heattotosca.errors.MissingMandatoryPropertyErrorBuilder;
+import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaPropertyConverter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+
+public class ResourceTranslationNeutronSubnetImpl extends ResourceTranslationBase {
+ protected static Logger logger =
+ LoggerFactory.getLogger(ResourceTranslationNeutronSubnetImpl.class);
+
+ @Override
+ protected String generateTranslatedId(TranslateTo translateTo) {
+ Optional<AttachedResourceId> subnetNetwork = getAttachedNetworkResource(translateTo);
+
+ if (!subnetNetwork.get().isGetResource()) {
+ logger.warn("Heat resource: '" + translateTo.getResourceId() + "' with type: '"
+ + translateTo.getResource().getType()
+ + "' include 'network_id/'network'' property without 'get_resource' function,"
+ + " therefore this resource will be ignored in TOSCA translation.");
+ return null;
+ }
+ return (String) subnetNetwork.get().getTranslatedId();
+ }
+
+ @Override
+ public void translate(TranslateTo translateTo) {
+
+ Optional<AttachedResourceId> subnetNetwork = getAttachedNetworkResource(translateTo);
+
+ if (!subnetNetwork.get().isGetResource()) {
+ return;
+ }
+
+ Resource networkResource = HeatToToscaUtil
+ .getResource(translateTo.getHeatOrchestrationTemplate(),
+ (String) subnetNetwork.get().getEntityId(), translateTo.getHeatFileName());
+ Optional<String> translatedNetworkId = ResourceTranslationFactory.getInstance(networkResource)
+ .translateResource(translateTo.getHeatFileName(), translateTo.getServiceTemplate(),
+ translateTo.getHeatOrchestrationTemplate(), networkResource,
+ (String) subnetNetwork.get().getEntityId(), translateTo.getContext());
+ if (translatedNetworkId.isPresent()) {
+ NodeTemplate networkNodeTemplate = DataModelUtil
+ .getNodeTemplate(translateTo.getServiceTemplate(), translatedNetworkId.get());
+
+ Map<String, Map<String, Object>> subNetMap =
+ (Map<String, Map<String, Object>>) networkNodeTemplate.getProperties().get("subnets");
+ if (subNetMap == null) {
+ subNetMap = new HashMap<>();
+ networkNodeTemplate.getProperties().put("subnets", subNetMap);
+ TranslatorHeatToToscaPropertyConverter
+ .setSimpleProperty(translateTo.getResource().getProperties(),
+ translateTo.getHeatFileName(), translateTo.getResource().getType(),
+ translateTo.getHeatOrchestrationTemplate(), translateTo.getContext(),
+ networkNodeTemplate.getProperties(), "enable_dhcp",
+ ToscaConstants.DHCP_ENABLED_PROPERTY_NAME, networkNodeTemplate); //dhcp_enabled
+ TranslatorHeatToToscaPropertyConverter
+ .setSimpleProperty(translateTo.getResource().getProperties(),
+ translateTo.getHeatFileName(), translateTo.getResource().getType(),
+ translateTo.getHeatOrchestrationTemplate(), translateTo.getContext(),
+ networkNodeTemplate.getProperties(), "ip_version", null, networkNodeTemplate);
+ handleDhcpProperty(translateTo, networkNodeTemplate);
+ }
+
+ Map<String, Object> properties;
+ properties = TranslatorHeatToToscaPropertyConverter
+ .getToscaPropertiesSimpleConversion(translateTo.getResource().getProperties(), null,
+ translateTo.getHeatFileName(), translateTo.getHeatOrchestrationTemplate(),
+ translateTo.getResource().getType(), networkNodeTemplate, translateTo.getContext());
+
+ subNetMap.put(translateTo.getResourceId(), properties);
+ }
+ }
+
+ private void handleDhcpProperty(TranslateTo translateTo, NodeTemplate networkNodeTemplate) {
+ Object dhcpEnabled =
+ networkNodeTemplate.getProperties().get(ToscaConstants.DHCP_ENABLED_PROPERTY_NAME);
+ if (dhcpEnabled instanceof Map) {
+ Object dhcpEnabledParameterName =
+ ((Map) dhcpEnabled).get(ToscaFunctions.GET_INPUT.getDisplayName());
+ if (dhcpEnabledParameterName != null) {
+ ParameterDefinition dhcpParameterDefinition = null;
+ if (translateTo.getServiceTemplate().getTopology_template().getInputs() != null) {
+ dhcpParameterDefinition =
+ translateTo.getServiceTemplate().getTopology_template().getInputs()
+ .get(dhcpEnabledParameterName);
+ }
+ if (dhcpParameterDefinition == null) {
+ logger.warn("Missing input parameter " + dhcpEnabledParameterName);
+ } else {
+ Object defaultVal = dhcpParameterDefinition.get_default();
+ if (defaultVal != null) {
+ try {
+ Boolean booleanValue = HeatBoolean.eval(defaultVal);
+ dhcpParameterDefinition.set_default(booleanValue);
+ } catch (CoreException coreException) {
+ //if value is not valid value for boolean set with dhcp_enabled default value = true
+ dhcpParameterDefinition.set_default(true);
+ logger.warn("Parameter '" + dhcpEnabledParameterName + "' used for "
+ + ToscaConstants.DHCP_ENABLED_PROPERTY_NAME
+ + " boolean property, but it's value is not a valid boolean value, therefore "
+ + ToscaConstants.DHCP_ENABLED_PROPERTY_NAME
+ + " property will be set with default value of 'true'.");
+ }
+ dhcpParameterDefinition.setType(PropertyType.BOOLEAN.getDisplayName());
+ }
+ }
+ }
+ }
+ }
+
+ private Optional<AttachedResourceId> getAttachedNetworkResource(TranslateTo translateTo) {
+ Optional<AttachedResourceId> subnetNetwork = Optional.empty();
+ Optional<AttachedResourceId> attachedNetworkId =
+ HeatToToscaUtil.extractAttachedResourceId(translateTo, "network_id");
+ if (!attachedNetworkId.isPresent()) {
+ Optional<AttachedResourceId> attachedNetwork =
+ HeatToToscaUtil.extractAttachedResourceId(translateTo, "network");
+ if (!attachedNetwork.isPresent()) {
+ throw new CoreException(
+ new MissingMandatoryPropertyErrorBuilder("network_id/'network'").build());
+ } else {
+ subnetNetwork = attachedNetwork;
+ }
+ } else {
+ subnetNetwork = attachedNetworkId;
+ }
+ return subnetNetwork;
+ }
+}
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNovaServerGroupsImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNovaServerGroupsImpl.java
new file mode 100644
index 0000000000..7bc0a10957
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNovaServerGroupsImpl.java
@@ -0,0 +1,119 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.openecomp.sdc.heat.datatypes.model.Resource;
+import org.openecomp.sdc.tosca.datatypes.ToscaGroupType;
+import org.openecomp.sdc.tosca.datatypes.ToscaPolicyType;
+import org.openecomp.sdc.tosca.datatypes.model.GroupDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.PolicyDefinition;
+import org.openecomp.sdc.tosca.services.DataModelUtil;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo;
+import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaPropertyConverter;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+public class ResourceTranslationNovaServerGroupsImpl extends ResourceTranslationBase {
+ private static final String AFFINITY = "affinity";
+ private static final String ANTI_AFFINITY = "anti-affinity";
+ private static List<String> supportedPolicies = Arrays.asList(AFFINITY, ANTI_AFFINITY);
+
+ @Override
+ protected void translate(TranslateTo translateTo) {
+ String resourceId = translateTo.getResourceId();
+ List<String> toscaPolicyTypes = getToscaPolicies(translateTo.getResource(), resourceId);
+ if (!CollectionUtils.isEmpty(toscaPolicyTypes)) {
+ addGroupToTopology(translateTo, resourceId);
+ addPoliciesToTopology(translateTo, resourceId, toscaPolicyTypes);
+ }
+ }
+
+ private void addPoliciesToTopology(TranslateTo translateTo, String resourceId,
+ List<String> toscaPolicyTypes) {
+ logger.info("******** Start creating policies for resource '%s' ********", resourceId);
+ for (int i = 0; i < toscaPolicyTypes.size(); i++) {
+ String policy = toscaPolicyTypes.get(i);
+ logger.info("******** Creating policy '%s' ********", policy);
+ PolicyDefinition policyDefinition = new PolicyDefinition();
+ policyDefinition.setType(policy);
+ policyDefinition.setTargets(Arrays.asList(resourceId));
+ policyDefinition.setProperties(TranslatorHeatToToscaPropertyConverter
+ .getToscaPropertiesSimpleConversion(translateTo.getResource().getProperties(),
+ policyDefinition.getProperties(), translateTo.getHeatFileName(),
+ translateTo.getHeatOrchestrationTemplate(), translateTo.getResource().getType(),
+ policyDefinition, translateTo.getContext()));
+ policyDefinition.getProperties().put(
+ policy.equals(ToscaPolicyType.PLACEMENT_ANTILOCATE.getDisplayName()) ? "container_type"
+ : AFFINITY, "host");
+ String policyId = resourceId + (toscaPolicyTypes.size() > 1 ? i : "");
+ DataModelUtil
+ .addPolicyDefinition(translateTo.getServiceTemplate(), policyId, policyDefinition);
+ logger.info("******** Policy '%s' created ********", policy);
+ }
+
+ logger
+ .info("******** All policies for resource '%s' created successfully ********", resourceId);
+ }
+
+ private void addGroupToTopology(TranslateTo translateTo, String resourceId) {
+ logger.info("******** Start creating group for resource '%s' ********", resourceId);
+ GroupDefinition group = new GroupDefinition();
+ group.setMembers(new ArrayList<>());
+ group.setType(ToscaGroupType.ROOT.getDisplayName());
+ DataModelUtil
+ .addGroupDefinitionToTopologyTemplate(translateTo.getServiceTemplate(), resourceId, group);
+ logger.info("******** Creating group '%s' for resource '%s' ********", resourceId, resourceId);
+ }
+
+ private List<String> getToscaPolicies(Resource resource, String resourceId) {
+
+ Map<String, Object> properties = resource.getProperties();
+ if (Objects.isNull(properties) || Objects.isNull(properties.get("policies"))) {
+ return Arrays.asList(ToscaPolicyType.PLACEMENT_ANTILOCATE.getDisplayName());
+ }
+
+ List policies = (List) properties.get("policies");
+ List<String> retList = new ArrayList<>();
+ policies.forEach(policy -> {
+ if (!supportedPolicies.contains(policy)) {
+ logger.warn("Resource '" + resourceId + "'(" + resource.getType()
+ + ") contains unsupported policy '" + policy.toString()
+ + "'. This resource is been ignored during the translation");
+ } else {
+ retList.add(getToscaPolicyByHotPolicy((String) policy));
+ }
+ });
+ return retList;
+ }
+
+ private String getToscaPolicyByHotPolicy(String name) {
+ if (Objects.equals(name, AFFINITY)) {
+ return ToscaPolicyType.PLACEMENT_COLOCATE.getDisplayName();
+ } else {
+ return ToscaPolicyType.PLACEMENT_ANTILOCATE.getDisplayName();
+ }
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNovaServerImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNovaServerImpl.java
new file mode 100644
index 0000000000..59e0691b2b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNovaServerImpl.java
@@ -0,0 +1,419 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.MapUtils;
+import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate;
+import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes;
+import org.openecomp.sdc.heat.datatypes.model.Resource;
+import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType;
+import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
+import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType;
+import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.NodeType;
+import org.openecomp.sdc.tosca.datatypes.model.RelationshipTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.RequirementAssignment;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.tosca.services.DataModelUtil;
+import org.openecomp.sdc.tosca.services.ToscaConstants;
+import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslatedHeatResource;
+import org.openecomp.sdc.translator.services.heattotosca.Constants;
+import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil;
+import org.openecomp.sdc.translator.services.heattotosca.ResourceTranslationFactory;
+import org.openecomp.sdc.translator.services.heattotosca.TranslationContext;
+import org.openecomp.sdc.translator.services.heattotosca.helper.NameExtractorService;
+import org.openecomp.sdc.translator.services.heattotosca.helper.PropertyRegexMatcher;
+import org.openecomp.sdc.translator.services.heattotosca.helper.impl.NameExtractorServiceImpl;
+import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaPropertyConverter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+
+public class ResourceTranslationNovaServerImpl extends ResourceTranslationBase {
+ protected static Logger logger = LoggerFactory.getLogger(ResourceTranslationNovaServerImpl.class);
+
+ @Override
+ protected void translate(TranslateTo translateTo) {
+ TranslationContext context = translateTo.getContext();
+ Map<String, Object> properties = translateTo.getResource().getProperties();
+ String heatFileName = translateTo.getHeatFileName();
+
+ ServiceTemplate serviceTemplate = translateTo.getServiceTemplate();
+
+ String nodeTypeRef =
+ createLocalNodeType(serviceTemplate, translateTo.getResource().getProperties(),
+ translateTo.getTranslatedId());
+
+ NodeTemplate novaNodeTemplate = new NodeTemplate();
+ novaNodeTemplate.setType(nodeTypeRef);
+ HeatOrchestrationTemplate heatOrchestrationTemplate =
+ translateTo.getHeatOrchestrationTemplate();
+ novaNodeTemplate.setProperties(TranslatorHeatToToscaPropertyConverter
+ .getToscaPropertiesSimpleConversion(properties, novaNodeTemplate.getProperties(),
+ heatFileName, heatOrchestrationTemplate, translateTo.getResource().getType(),
+ novaNodeTemplate, context));
+
+ manageNovaServerNetwork(heatFileName, serviceTemplate, heatOrchestrationTemplate,
+ translateTo.getResource(), translateTo.getTranslatedId(), context, novaNodeTemplate);
+ manageNovaServerBlockDeviceMapping(heatFileName, serviceTemplate, novaNodeTemplate,
+ heatOrchestrationTemplate, translateTo.getResource(), translateTo.getResourceId(),
+ translateTo.getTranslatedId(), context);
+
+ manageNovaServerGroupMapping(translateTo, context, properties, heatFileName, serviceTemplate,
+ heatOrchestrationTemplate);
+ DataModelUtil.addNodeTemplate(serviceTemplate, translateTo.getTranslatedId(), novaNodeTemplate);
+ }
+
+ private void manageNovaServerGroupMapping(TranslateTo translateTo, TranslationContext context,
+ Map<String, Object> properties, String heatFileName,
+ ServiceTemplate serviceTemplate,
+ HeatOrchestrationTemplate heatOrchestrationTemplate) {
+ if (isSchedulerHintsPropExist(properties)) {
+ Object schedulerHints = properties.get("scheduler_hints");
+ if (schedulerHints instanceof Map) {
+ addServerGroupHintsToPoliciesProups(translateTo, context, heatFileName, serviceTemplate,
+ heatOrchestrationTemplate, (Map<String, Object>) schedulerHints);
+ } else {
+ logger.warn("'scheduler_hints' property of resource '" + translateTo.getResourceId()
+ + "' is not valid. This property should be a map");
+ }
+ }
+ }
+
+ private void addServerGroupHintsToPoliciesProups(TranslateTo translateTo,
+ TranslationContext context, String heatFileName,
+ ServiceTemplate serviceTemplate,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ Map<String, Object> schedulerHints) {
+ for (Object hint : schedulerHints.values()) {
+ Optional<AttachedResourceId> attachedResourceId = HeatToToscaUtil
+ .extractAttachedResourceId(heatFileName, heatOrchestrationTemplate, context, hint);
+ if (attachedResourceId.isPresent()) {
+ AttachedResourceId serverGroupResourceId = attachedResourceId.get();
+ Object serverGroupResourceToTranslate = serverGroupResourceId.getEntityId();
+ if (serverGroupResourceId.isGetResource()) {
+ boolean isHintOfTypeNovaServerGroup =
+ isHintOfTypeNovaServerGroup(heatOrchestrationTemplate,
+ serverGroupResourceToTranslate);
+ if (isHintOfTypeNovaServerGroup) {
+ addNovaServerToPolicyGroup(translateTo, context, heatFileName, serviceTemplate,
+ heatOrchestrationTemplate, (String) serverGroupResourceToTranslate);
+ }
+ } else if (serverGroupResourceId.isGetParam()) {
+ TranslatedHeatResource translatedServerGroupResource =
+ context.getHeatSharedResourcesByParam().get(serverGroupResourceToTranslate);
+ if (Objects.nonNull(translatedServerGroupResource)
+ && !HeatToToscaUtil.isHeatFileNested(translateTo, translateTo.getHeatFileName())) {
+ serviceTemplate.getTopology_template().getGroups()
+ .get(translatedServerGroupResource.getTranslatedId()).getMembers()
+ .add(translateTo.getTranslatedId());
+ }
+ }
+ }
+ }
+ }
+
+ private boolean isHintOfTypeNovaServerGroup(HeatOrchestrationTemplate heatOrchestrationTemplate,
+ Object resourceToTranslate) {
+ return heatOrchestrationTemplate.getResources().get(resourceToTranslate).getType()
+ .equals(HeatResourcesTypes.NOVA_SERVER_GROUP_RESOURCE_TYPE.getHeatResource());
+ }
+
+ private void addNovaServerToPolicyGroup(TranslateTo translateTo, TranslationContext context,
+ String heatFileName, ServiceTemplate serviceTemplate,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ String resourceToTranslate) {
+ Resource serverGroup =
+ HeatToToscaUtil.getResource(heatOrchestrationTemplate, resourceToTranslate, heatFileName);
+ Optional<String> serverGroupTranslatedId = ResourceTranslationFactory.getInstance(serverGroup)
+ .translateResource(heatFileName, serviceTemplate, heatOrchestrationTemplate, serverGroup,
+ resourceToTranslate, context);
+ if (serverGroupTranslatedId.isPresent()) {
+ serviceTemplate.getTopology_template().getGroups().get(serverGroupTranslatedId.get())
+ .getMembers().add(translateTo.getTranslatedId());
+ }
+ }
+
+ private boolean isSchedulerHintsPropExist(Map<String, Object> properties) {
+ return !MapUtils.isEmpty(properties) && Objects.nonNull(properties.get("scheduler_hints"));
+ }
+
+ private void manageNovaServerBlockDeviceMapping(String heatFileName,
+ ServiceTemplate serviceTemplate,
+ NodeTemplate novaNodeTemplate,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ Resource resource, String resourceId,
+ String novaServerTranslatedId,
+ TranslationContext context) {
+
+ List<Map<String, Object>> blockDeviceMappingList = getBlockDeviceMappingList(resource);
+ if (CollectionUtils.isEmpty(blockDeviceMappingList)) {
+ return;
+ }
+
+ Object volumeIdObject;
+ Object snapshotIdObject;
+ String volumeResourceId;
+ int index = 0;
+ for (Map<String, Object> blockDeviceMapping : blockDeviceMappingList) {
+ volumeIdObject = blockDeviceMapping.get("volume_id");
+ snapshotIdObject = blockDeviceMapping.get("snapshot_id");
+
+ if (volumeIdObject == null && snapshotIdObject == null) {
+ logger.warn("Resource '" + resourceId
+ + "' has block_device_mapping property with empty/missing volume_id and snapshot_id "
+ + "properties. Entry number "
+ + (index + 1) + ", this entry will be ignored in TOSCA translation.");
+ index++;
+ continue;
+ }
+ if (volumeIdObject == null) {
+ String deviceName = (String) blockDeviceMapping.get("device_name");
+ String relationshipId = novaServerTranslatedId + "_" + index;
+
+ Optional<AttachedResourceId> attachedSnapshotId = HeatToToscaUtil
+ .extractAttachedResourceId(heatFileName, heatOrchestrationTemplate, context,
+ snapshotIdObject);
+ volumeResourceId = novaServerTranslatedId + "_" + attachedSnapshotId.get().getEntityId();
+ createVolumeAttachesToRelationship(serviceTemplate, deviceName, novaServerTranslatedId,
+ volumeResourceId, relationshipId);
+ createCinderVolumeNodeTemplate(serviceTemplate, volumeResourceId, heatFileName,
+ blockDeviceMapping, heatOrchestrationTemplate, context);
+ connectNovaServerToVolume(novaNodeTemplate, volumeResourceId, relationshipId);
+ } else {
+ Optional<AttachedResourceId> attachedVolumeId = HeatToToscaUtil
+ .extractAttachedResourceId(heatFileName, heatOrchestrationTemplate, context,
+ volumeIdObject);
+ if (attachedVolumeId.get().isGetResource()) {
+ connectNovaServerToVolume(novaNodeTemplate,
+ (String) attachedVolumeId.get().getTranslatedId(), null);
+ }
+ }
+ index++;
+ }
+ }
+
+ private void connectNovaServerToVolume(NodeTemplate novaNodeTemplate, String volumeResourceId,
+ String relationshipId) {
+ RequirementAssignment requirementAssignment = new RequirementAssignment();
+ requirementAssignment.setCapability(ToscaCapabilityType.ATTACHMENT.getDisplayName());
+ requirementAssignment.setNode(volumeResourceId);
+ if (relationshipId != null) {
+ requirementAssignment.setRelationship(relationshipId);
+ } else {
+ requirementAssignment
+ .setRelationship(ToscaRelationshipType.NATIVE_ATTACHES_TO.getDisplayName());
+ }
+ DataModelUtil
+ .addRequirementAssignment(novaNodeTemplate, ToscaConstants.LOCAL_STORAGE_REQUIREMENT_ID,
+ requirementAssignment);
+ }
+
+ private void createCinderVolumeNodeTemplate(ServiceTemplate serviceTemplate,
+ String volumeResourceId, String heatFileName,
+ Map<String, Object> blockDeviceMapping,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ TranslationContext context) {
+ NodeTemplate cinderVolumeNodeTemplate = new NodeTemplate();
+ cinderVolumeNodeTemplate.setType(ToscaNodeType.CINDER_VOLUME.getDisplayName());
+ cinderVolumeNodeTemplate.setProperties(TranslatorHeatToToscaPropertyConverter
+ .getToscaPropertiesSimpleConversion(blockDeviceMapping, null, heatFileName,
+ heatOrchestrationTemplate,
+ HeatResourcesTypes.CINDER_VOLUME_RESOURCE_TYPE.getHeatResource(),
+ cinderVolumeNodeTemplate, context));
+ DataModelUtil.addNodeTemplate(serviceTemplate, volumeResourceId, cinderVolumeNodeTemplate);
+ }
+
+ private void createVolumeAttachesToRelationship(ServiceTemplate serviceTemplate,
+ String deviceName, String novaServerTranslatedId,
+ String volumeId, String relationshipId) {
+ RelationshipTemplate relationshipTemplate = new RelationshipTemplate();
+ relationshipTemplate.setType(ToscaRelationshipType.CINDER_VOLUME_ATTACHES_TO.getDisplayName());
+ Map<String, Object> properties = new HashMap<>();
+ properties.put("instance_uuid", novaServerTranslatedId);
+ properties.put("volume_id", volumeId);
+ if (deviceName != null) {
+ properties.put("device", deviceName);
+ }
+ relationshipTemplate.setProperties(properties);
+
+ DataModelUtil.addRelationshipTemplate(serviceTemplate, relationshipId, relationshipTemplate);
+ }
+
+ private List<Map<String, Object>> getBlockDeviceMappingList(Resource resource) {
+
+ if (Objects.isNull(resource.getProperties())) {
+ return Collections.emptyList();
+ }
+ List<Map<String, Object>> blockDeviceMappingList =
+ (List<Map<String, Object>>) resource.getProperties().get("block_device_mapping");
+ List<Map<String, Object>> blockDeviceMappingV2List =
+ (List<Map<String, Object>>) resource.getProperties().get("block_device_mapping_v2");
+
+ if (blockDeviceMappingList != null && blockDeviceMappingV2List != null) {
+ blockDeviceMappingList.addAll(blockDeviceMappingV2List);
+ } else if (CollectionUtils.isEmpty(blockDeviceMappingList)
+ && CollectionUtils.isEmpty(blockDeviceMappingV2List)) {
+ return null;
+
+ } else {
+ blockDeviceMappingList =
+ blockDeviceMappingList != null ? blockDeviceMappingList : blockDeviceMappingV2List;
+ }
+ return blockDeviceMappingList;
+ }
+
+ private void manageNovaServerNetwork(String heatFileName, ServiceTemplate serviceTemplate,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ Resource resource, String translatedId,
+ TranslationContext context, NodeTemplate novaNodeTemplate) {
+
+ if (resource.getProperties() == null) {
+ return;
+ }
+ List<Map<String, Object>> heatNetworkList =
+ (List<Map<String, Object>>) resource.getProperties().get("networks");
+
+ if (CollectionUtils.isEmpty(heatNetworkList)) {
+ return;
+ }
+
+ for (Map<String, Object> heatNetwork : heatNetworkList) {
+ getOrTranslatePortTemplate(heatFileName, heatOrchestrationTemplate,
+ heatNetwork.get(Constants.PORT_PROPERTY_NAME), serviceTemplate, translatedId, context,
+ novaNodeTemplate);
+ }
+
+ }
+
+ private void getOrTranslatePortTemplate(String heatFileName,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ Object port, ServiceTemplate serviceTemplate,
+ String novaServerResourceId, TranslationContext context,
+ NodeTemplate novaNodeTemplate) {
+ Optional<AttachedResourceId> attachedPortId = HeatToToscaUtil
+ .extractAttachedResourceId(heatFileName, heatOrchestrationTemplate, context, port);
+
+ if (!attachedPortId.isPresent()) {
+ return;
+ }
+
+ if (attachedPortId.get().isGetResource()) {
+ String resourceId = (String) attachedPortId.get().getEntityId();
+ Resource portResource =
+ HeatToToscaUtil.getResource(heatOrchestrationTemplate, resourceId, heatFileName);
+ if (!Arrays.asList(HeatResourcesTypes.NEUTRON_PORT_RESOURCE_TYPE.getHeatResource(),
+ HeatResourcesTypes.CONTRAIL_V2_VIRTUAL_MACHINE_INTERFACE_RESOURCE_TYPE.getHeatResource())
+ .contains(portResource.getType())) {
+ logger.warn("NovaServer connect to port resource with id : " + resourceId + " and type : "
+ + portResource.getType()
+ + ". This resource type is not supported, therefore the connection to the port is "
+ + "ignored. "
+ + "Supported types are: "
+ + HeatResourcesTypes.NEUTRON_PORT_RESOURCE_TYPE.getHeatResource() + ", "
+ + HeatResourcesTypes.CONTRAIL_V2_VIRTUAL_MACHINE_INTERFACE_RESOURCE_TYPE
+ .getHeatResource());
+ return;
+ } else if (HeatResourcesTypes.CONTRAIL_V2_VIRTUAL_MACHINE_INTERFACE_RESOURCE_TYPE
+ .getHeatResource().equals(portResource.getType())) {
+ Map<String, Object> properties = portResource.getProperties();
+ if (!MapUtils.isEmpty(properties) && Objects.nonNull(properties.get("port_tuple_refs"))) {
+ novaNodeTemplate.getProperties().put("contrail_service_instance_ind", true);
+ }
+ }
+ Optional<String> translatedPortId = ResourceTranslationFactory.getInstance(portResource)
+ .translateResource(heatFileName, serviceTemplate, heatOrchestrationTemplate, portResource,
+ resourceId, context);
+ if (translatedPortId.isPresent()) {
+ NodeTemplate portNodeTemplate =
+ DataModelUtil.getNodeTemplate(serviceTemplate, translatedPortId.get());
+ addBindingReqFromPortToCompute(novaServerResourceId, portNodeTemplate);
+ } else {
+ logger.warn("NovaServer connect to port resource with id : " + resourceId + " and type : "
+ + portResource.getType()
+ + ". This resource type is not supported, therefore the connection to the port is "
+ + "ignored.");
+ }
+ }
+ }
+
+ /**
+ * Create local node type string.
+ *
+ * @param serviceTemplate the service template
+ * @param properties the properties
+ * @param resourceTranslatedId the resource translated id
+ * @return the string
+ */
+ public String createLocalNodeType(ServiceTemplate serviceTemplate, Map<String, Object> properties,
+ String resourceTranslatedId) {
+ NameExtractorService nodeTypeNameExtractor = new NameExtractorServiceImpl();
+ List<PropertyRegexMatcher> propertyRegexMatchers =
+ getPropertiesAndRegexMatchers(nodeTypeNameExtractor);
+ Optional<String> extractedNodeTypeName = nodeTypeNameExtractor
+ .extractNodeTypeNameByPropertiesPriority(properties, propertyRegexMatchers);
+
+ String nodeTypeName = ToscaConstants.NODES_PREFIX
+ + (extractedNodeTypeName.isPresent() ? extractedNodeTypeName.get()
+ : resourceTranslatedId.replace(".", "_"));
+ if (!isNodeTypeCreated(serviceTemplate, nodeTypeName)) {
+ DataModelUtil.addNodeType(serviceTemplate, nodeTypeName, createNodeType());
+ }
+ return nodeTypeName;
+ }
+
+ private List<PropertyRegexMatcher> getPropertiesAndRegexMatchers(
+ NameExtractorService nodeTypeNameExtractor) {
+ List<PropertyRegexMatcher> propertyRegexMatchers = new ArrayList<>();
+ propertyRegexMatchers.add(nodeTypeNameExtractor
+ .getPropertyRegexMatcher(Constants.NAME_PROPERTY_NAME,
+ Arrays.asList(".+_name$", ".+_names$", ".+_name_[0-9]+"), "_name"));
+ propertyRegexMatchers.add(nodeTypeNameExtractor
+ .getPropertyRegexMatcher("image", Collections.singletonList(".+_image_name$"),
+ "_image_name"));
+ propertyRegexMatchers.add(nodeTypeNameExtractor
+ .getPropertyRegexMatcher("flavor", Collections.singletonList(".+_flavor_name$"),
+ "_flavor_name"));
+ return propertyRegexMatchers;
+ }
+
+ private boolean isNodeTypeCreated(ServiceTemplate serviceTemplate, String nodeTypeName) {
+ return !MapUtils.isEmpty(serviceTemplate.getNode_types())
+ && Objects.nonNull(serviceTemplate.getNode_types().get(nodeTypeName));
+ }
+
+ private NodeType createNodeType() {
+ NodeType nodeType = new NodeType();
+ nodeType.setDerived_from(ToscaNodeType.NOVA_SERVER.getDisplayName());
+ return nodeType;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationResourceGroupImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationResourceGroupImpl.java
new file mode 100644
index 0000000000..4665249351
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationResourceGroupImpl.java
@@ -0,0 +1,202 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes;
+import org.openecomp.sdc.heat.datatypes.model.Resource;
+import org.openecomp.sdc.heat.services.HeatConstants;
+import org.openecomp.sdc.tosca.datatypes.ToscaFunctions;
+import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
+import org.openecomp.sdc.tosca.services.DataModelUtil;
+import org.openecomp.sdc.tosca.services.ToscaConstants;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo;
+import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil;
+import org.openecomp.sdc.translator.services.heattotosca.ResourceTranslationFactory;
+import org.openecomp.sdc.translator.services.heattotosca.errors.InvalidPropertyValueErrorBuilder;
+import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaPropertyConverter;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+
+public class ResourceTranslationResourceGroupImpl extends ResourceTranslationBase {
+
+ @Override
+ protected void translate(TranslateTo translateTo) {
+ final String heatFileName = translateTo.getHeatFileName();
+ Object resourceDef =
+ translateTo.getResource().getProperties().get(HeatConstants.RESOURCE_DEF_PROPERTY_NAME);
+ Resource nestedResource = new Resource();
+ Object typeDefinition = ((Map) resourceDef).get("type");
+ if (!(typeDefinition instanceof String)) {
+ logger.warn("Resource '" + translateTo.getResourceId() + "' of type'"
+ + HeatResourcesTypes.RESOURCE_GROUP_RESOURCE_TYPE.getHeatResource()
+ + "' with resourceDef which is not pointing to nested heat file "
+ + "is not supported and will be ignored in the translation ");
+ return;
+ }
+ String type = (String) typeDefinition;
+ if (!HeatToToscaUtil.isYmlFileType(type)) {
+ logger.warn("Resource '" + translateTo.getResourceId() + "' of type'"
+ + HeatResourcesTypes.RESOURCE_GROUP_RESOURCE_TYPE.getHeatResource()
+ + "' with resourceDef which is not pointing to nested heat "
+ + "file is not supported and will be ignored in the translation ");
+ return;
+ }
+
+ nestedResource.setType(type);
+ nestedResource.setProperties((Map<String, Object>) ((Map) resourceDef).get("properties"));
+ nestedResource.setMetadata(((Map) resourceDef).get("metadata"));
+
+ Optional<String> substitutionNodeTemplateId =
+ ResourceTranslationFactory.getInstance(nestedResource)
+ .translateResource(heatFileName, translateTo.getServiceTemplate(),
+ translateTo.getHeatOrchestrationTemplate(), nestedResource,
+ translateTo.getResourceId(), translateTo.getContext());
+ if (substitutionNodeTemplateId.isPresent()) {
+ NodeTemplate substitutionNodeTemplate = DataModelUtil
+ .getNodeTemplate(translateTo.getServiceTemplate(), substitutionNodeTemplateId.get());
+ Map serviceTemplateFilter = (Map<String, Object>) substitutionNodeTemplate.getProperties()
+ .get(ToscaConstants.SERVICE_TEMPLATE_FILTER_PROPERTY_NAME);
+
+ populateServiceTemplateFilterProperties(translateTo, substitutionNodeTemplate,
+ serviceTemplateFilter);
+ handlingIndexVar(translateTo, substitutionNodeTemplate);
+ DataModelUtil
+ .addNodeTemplate(translateTo.getServiceTemplate(), substitutionNodeTemplateId.get(),
+ substitutionNodeTemplate);
+ }
+
+ }
+
+ private void handlingIndexVar(TranslateTo translateTo, NodeTemplate substitutionNodeTemplate) {
+ String indexVarValue = getIndexVarValue(translateTo);
+ replacePropertiesIndexVarValue(indexVarValue, substitutionNodeTemplate.getProperties());
+ }
+
+ private Map<String, List> getNewIndexVarValue() {
+ final Map<String, List> newIndexVarValue = new HashMap<>();
+ List indexVarValList = new ArrayList<>();
+ indexVarValList.add(ToscaConstants.MODELABLE_ENTITY_NAME_SELF);
+ indexVarValList.add(ToscaConstants.SERVICE_TEMPLATE_FILTER_PROPERTY_NAME);
+ indexVarValList.add(ToscaConstants.INDEX_VALUE_PROPERTY_NAME);
+ newIndexVarValue.put(ToscaFunctions.GET_PROPERTY.getDisplayName(), indexVarValList);
+ return newIndexVarValue;
+ }
+
+ private void replacePropertiesIndexVarValue(String indexVarValue,
+ Map<String, Object> properties) {
+ if (properties == null || properties.isEmpty()) {
+ return;
+ }
+
+ for (Map.Entry<String, Object> propertyEntry : properties.entrySet()) {
+ Object propertyValue = propertyEntry.getValue();
+ Object newPropertyValue = getUpdatedPropertyValueWithIndex(indexVarValue, propertyValue);
+ if (newPropertyValue != null) {
+ properties.put(propertyEntry.getKey(), newPropertyValue);
+ }
+ }
+ }
+
+ private Object getUpdatedPropertyValueWithIndex(String indexVarValue, Object propertyValue) {
+ if (propertyValue instanceof String && propertyValue != null) {
+ if (propertyValue.equals(indexVarValue)) {
+ return getNewIndexVarValue();
+ }
+ if (((String) propertyValue).contains(indexVarValue)) {
+ Map<String, List<Object>> concatMap = new HashMap<>();
+ List<Object> concatList = new ArrayList<>();
+ String value = (String) propertyValue;
+
+ while (value.contains(indexVarValue)) {
+ if (value.indexOf(indexVarValue) == 0) {
+ concatList.add(getNewIndexVarValue());
+ value = value.substring(indexVarValue.length());
+ } else {
+ int end = value.indexOf(indexVarValue);
+ concatList.add(value.substring(0, end));
+ value = value.substring(end);
+ }
+ }
+ if (!value.isEmpty()) {
+ concatList.add(value);
+ }
+
+ concatMap.put(ToscaFunctions.CONCAT.getDisplayName(), concatList);
+ return concatMap;
+ }
+ return propertyValue; //no update is needed
+ } else if (propertyValue instanceof Map && !((Map) propertyValue).isEmpty()) {
+ replacePropertiesIndexVarValue(indexVarValue, (Map<String, Object>) propertyValue);
+ return propertyValue;
+ } else if (propertyValue instanceof List && !((List) propertyValue).isEmpty()) {
+ List newPropertyValueList = new ArrayList<>();
+ for (Object entry : ((List) propertyValue)) {
+ newPropertyValueList.add(getUpdatedPropertyValueWithIndex(indexVarValue, entry));
+ }
+ return newPropertyValueList;
+ }
+ return propertyValue;
+ }
+
+ private String getIndexVarValue(TranslateTo translateTo) {
+ Object indexVar =
+ translateTo.getResource().getProperties().get(HeatConstants.INDEX_PROPERTY_NAME);
+ if (indexVar == null) {
+ return HeatConstants.RESOURCE_GROUP_INDEX_VAR_DEFAULT_VALUE;
+ }
+
+ if (indexVar instanceof String) {
+ return (String) indexVar;
+ } else {
+ throw new CoreException(
+ new InvalidPropertyValueErrorBuilder("index_var", indexVar.toString(), "String").build());
+ }
+ }
+
+ private void populateServiceTemplateFilterProperties(TranslateTo translateTo,
+ NodeTemplate substitutionNodeTemplate,
+ Map serviceTemplateFilter) {
+ boolean mandatory = false;
+ Object countValue = TranslatorHeatToToscaPropertyConverter
+ .getToscaPropertyValue(ToscaConstants.COUNT_PROPERTY_NAME,
+ translateTo.getResource().getProperties().get(ToscaConstants.COUNT_PROPERTY_NAME), null,
+ translateTo.getHeatFileName(), translateTo.getHeatOrchestrationTemplate(),
+ substitutionNodeTemplate, translateTo.getContext());
+
+ if (countValue != null) {
+ serviceTemplateFilter.put(ToscaConstants.COUNT_PROPERTY_NAME, countValue);
+ } else {
+ serviceTemplateFilter.put(ToscaConstants.COUNT_PROPERTY_NAME, 1);
+ }
+ if (countValue instanceof Integer && (Integer) countValue > 0) {
+ mandatory = true;
+ }
+ if (countValue == null) {
+ mandatory = true;
+ }
+ serviceTemplateFilter.put("mandatory", mandatory);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/SecurityRulesToPortResourceConnection.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/SecurityRulesToPortResourceConnection.java
new file mode 100644
index 0000000000..3c6fef7ffb
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/SecurityRulesToPortResourceConnection.java
@@ -0,0 +1,203 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+
+import org.openecomp.sdc.heat.datatypes.manifest.FileData;
+import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate;
+import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes;
+import org.openecomp.sdc.heat.datatypes.model.Resource;
+import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType;
+import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
+import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType;
+import org.openecomp.sdc.tosca.datatypes.model.CapabilityDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.NodeType;
+import org.openecomp.sdc.tosca.datatypes.model.RequirementDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.tosca.services.DataModelUtil;
+import org.openecomp.sdc.tosca.services.ToscaConstants;
+import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo;
+import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslatedHeatResource;
+import org.openecomp.sdc.translator.services.heattotosca.Constants;
+import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil;
+import org.openecomp.sdc.translator.services.heattotosca.ResourceTranslationFactory;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.function.Predicate;
+
+
+class SecurityRulesToPortResourceConnection extends BaseResourceConnection<CapabilityDefinition> {
+ SecurityRulesToPortResourceConnection(ResourceTranslationNestedImpl resourceTranslationNested,
+ TranslateTo translateTo, FileData nestedFileData,
+ NodeTemplate substitutionNodeTemplate, NodeType nodeType) {
+ super(resourceTranslationNested, translateTo, nestedFileData, substitutionNodeTemplate,
+ nodeType);
+ }
+
+ @Override
+ protected boolean isDesiredNodeTemplateType(NodeTemplate nodeTemplate) {
+ return nodeTemplate.getType().equals(ToscaNodeType.NEUTRON_PORT.getDisplayName());
+ }
+
+ @Override
+ protected List<Predicate<CapabilityDefinition>> getPredicatesListForConnectionPoints() {
+ ArrayList<Predicate<CapabilityDefinition>> predicates = new ArrayList<>();
+ predicates.add(cap -> cap.getType().equals(ToscaCapabilityType.ATTACHMENT.getDisplayName()));
+ return predicates;
+ }
+
+ @Override
+ protected Optional<List<String>> getConnectorParamName(
+ String heatResourceId,Resource heatResource,
+ HeatOrchestrationTemplate nestedHeatOrchestrationTemplate) {
+ Object securityGroups =
+ heatResource.getProperties().get(Constants.SECURITY_GROUPS_PROPERTY_NAME);
+ List<String> paramsList = new ArrayList<>();
+ if (securityGroups instanceof List) {
+ ((List) securityGroups).forEach(group -> {
+ Optional<AttachedResourceId> attachedResourceId = HeatToToscaUtil
+ .extractAttachedResourceId(nestedFileData.getFile(), nestedHeatOrchestrationTemplate,
+ translateTo.getContext(), group);
+ if (attachedResourceId.isPresent()) {
+ paramsList.add((String) attachedResourceId.get().getEntityId());
+ }
+ });
+ return Optional.of(paramsList);
+ }
+ return Optional.empty();
+ }
+
+ @Override
+ protected String getDesiredResourceType() {
+ return HeatResourcesTypes.NEUTRON_PORT_RESOURCE_TYPE.getHeatResource();
+ }
+
+ @Override
+ protected List<Map<String, CapabilityDefinition>> getAllConnectionPoints() {
+ List<Map<String, CapabilityDefinition>> exposedRequirementsList = new ArrayList<>();
+ List<Predicate<CapabilityDefinition>> predicates = getPredicatesListForConnectionPoints();
+ Map<String, CapabilityDefinition> capabilities = this.nodeType.getCapabilities();
+ if (capabilities == null) {
+ return exposedRequirementsList;
+ }
+ capabilities.entrySet()
+ .stream()
+ .filter(entry -> predicates
+ .stream()
+ .anyMatch(p -> p.test(entry.getValue())))
+ .forEach(entry -> {
+ Map<String, CapabilityDefinition> exposedRequirementsMap = new HashMap<>();
+ exposedRequirementsMap.put(entry.getKey(), entry.getValue());
+ exposedRequirementsList.add(exposedRequirementsMap);
+ });
+
+ return exposedRequirementsList;
+ }
+
+ @Override
+ void addRequirementToConnectResources(Map.Entry<String, CapabilityDefinition> entry,
+ List<String> paramNames) {
+ paramNames.forEach(p -> {
+ Optional<AttachedResourceId> attachedResourceId =
+ HeatToToscaUtil.extractAttachedResourceId(translateTo, p);
+ String securityRulesNodeId;
+ if (!attachedResourceId.isPresent()) {
+ return;
+ }
+ Map.Entry<String, RequirementDefinition> requirementDefinition =
+ createRequirementDefinition(entry.getKey());
+ AttachedResourceId securityGroupAttachedId = attachedResourceId.get();
+ if (securityGroupAttachedId.isGetResource()) {
+ String securityGroupResourceId = (String) attachedResourceId.get().getEntityId();
+ Resource securityGroupResource = HeatToToscaUtil
+ .getResource(translateTo.getHeatOrchestrationTemplate(), securityGroupResourceId,
+ translateTo.getHeatFileName());
+ Optional<String> translatedSecurityRuleId =
+ ResourceTranslationFactory.getInstance(securityGroupResource)
+ .translateResource(translateTo.getHeatFileName(), translateTo.getServiceTemplate(),
+ translateTo.getHeatOrchestrationTemplate(), securityGroupResource,
+ securityGroupResourceId, translateTo.getContext());
+ if (translatedSecurityRuleId.isPresent()) {
+ NodeTemplate securityRuleNodeTemplate = DataModelUtil
+ .getNodeTemplate(translateTo.getServiceTemplate(), translatedSecurityRuleId.get());
+ createRequirementAssignment(requirementDefinition, translateTo.getTranslatedId(),
+ securityRuleNodeTemplate);
+ } else {
+ logger.warn(
+ securityGroupResource.getType() + "connection to " + securityGroupResource.getType()
+ + " is not supported/invalid, therefore this connection "
+ + "will be ignored in the TOSCA translation");
+ }
+ } else if (securityGroupAttachedId.isGetParam()) {
+ TranslatedHeatResource shareResource =
+ translateTo.getContext().getHeatSharedResourcesByParam()
+ .get(securityGroupAttachedId.getEntityId());
+ if (Objects.nonNull(shareResource)
+ && !HeatToToscaUtil.isHeatFileNested(translateTo, translateTo.getHeatFileName())) {
+ NodeTemplate sharedNodeTemplate = DataModelUtil
+ .getNodeTemplate(translateTo.getServiceTemplate(), shareResource.getTranslatedId());
+ createRequirementAssignment(requirementDefinition, translateTo.getTranslatedId(),
+ sharedNodeTemplate);
+ }
+ }
+ });
+ }
+
+ @Override
+ protected String getTranslatedResourceIdFromSubstitutionMapping(
+ ServiceTemplate nestedServiceTemplate, Map.Entry<String, CapabilityDefinition> entry) {
+ List<String> substitutionMapping =
+ nestedServiceTemplate.getTopology_template().getSubstitution_mappings().getCapabilities()
+ .get(entry.getKey());
+ return substitutionMapping.get(0);
+ }
+
+ private Map.Entry<String, RequirementDefinition> createRequirementDefinition(String key) {
+ RequirementDefinition definition = new RequirementDefinition();
+ definition.setCapability(key);
+ definition.setRelationship(ToscaRelationshipType.ATTACHES_TO.getDisplayName());
+ return new Map.Entry<String, RequirementDefinition>() {
+ @Override
+ public String getKey() {
+ return ToscaConstants.PORT_REQUIREMENT_ID;
+ }
+
+ @Override
+ public RequirementDefinition getValue() {
+ return definition;
+ }
+
+ @Override
+ public RequirementDefinition setValue(RequirementDefinition value) {
+ return null;
+ }
+ };
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaFunctionConverter.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaFunctionConverter.java
new file mode 100644
index 0000000000..0aa5c5ff96
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaFunctionConverter.java
@@ -0,0 +1,410 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.mapping;
+
+import org.openecomp.core.utilities.yaml.YamlUtil;
+import org.openecomp.sdc.heat.datatypes.HeatBoolean;
+import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate;
+import org.openecomp.sdc.heat.datatypes.model.Resource;
+import org.openecomp.sdc.heat.services.HeatConstants;
+import org.openecomp.sdc.tosca.datatypes.ToscaArtifactType;
+import org.openecomp.sdc.tosca.datatypes.ToscaFunctions;
+import org.openecomp.sdc.tosca.datatypes.model.ArtifactDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.Template;
+import org.openecomp.sdc.tosca.services.ToscaConstants;
+import org.openecomp.sdc.tosca.services.ToscaFileOutputService;
+import org.openecomp.sdc.tosca.services.impl.ToscaFileOutputServiceCsarImpl;
+import org.openecomp.sdc.translator.services.heattotosca.Constants;
+import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil;
+import org.openecomp.sdc.translator.services.heattotosca.TranslationContext;
+import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationBase;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+
+public class TranslatorHeatToToscaFunctionConverter {
+ private static final String UNSUPPORTED_RESOURCE = "UNSUPPORTED_RESOURCE_";
+ private static final String UNSUPPORTED_ATTRIBUTE = "UNSUPPORTED_ATTRIBUTE_";
+
+ protected static Set<String> functionNameSet;
+
+ static {
+ functionNameSet = new HashSet<>();
+ functionNameSet.add("get_param");
+ functionNameSet.add("get_attr");
+ functionNameSet.add("get_resource");
+ functionNameSet.add("get_file");
+ }
+
+ /**
+ * Gets tosca function.
+ *
+ * @param functionName the function name
+ * @param function the function
+ * @param heatFileName the heat file name
+ * @param heatOrchestrationTemplate the heat orchestration template
+ * @param template the template
+ * @param context the context
+ * @return the tosca function
+ */
+ public static Object getToscaFunction(String functionName, Object function, String heatFileName,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ Template template, TranslationContext context) {
+ Object returnValue = null;
+ if ("get_param".equals(functionName)) {
+ returnValue =
+ handleGetParamFunction(function, heatFileName, heatOrchestrationTemplate, context);
+ } else if ("get_attr".equals(functionName)) {
+ returnValue =
+ handleGetAttrFunction(function, heatFileName, heatOrchestrationTemplate, context);
+ } else if ("get_resource".equals(functionName)) {
+ returnValue =
+ handleGetResourceFunction(function, heatFileName, heatOrchestrationTemplate, context);
+ } else if ("get_file".equals(functionName)) {
+ returnValue = handleGetFileFunction(function, template);
+ }
+ return returnValue;
+ }
+
+ private static Object handleGetFileFunction(Object function, Template template) {
+ String file = ((String) function).replace("file:///", "");
+ Object returnValue;
+ final String artifactId = file.split("\\.")[0];
+
+ returnValue = new HashMap<>();
+ List artifactParameters = new ArrayList();
+ artifactParameters.add(0, ToscaConstants.MODELABLE_ENTITY_NAME_SELF);
+ ((Map) returnValue).put(ToscaFunctions.GET_ARTIFACT.getDisplayName(), artifactParameters);
+ artifactParameters.add(1, artifactId);
+
+ ToscaFileOutputService toscaFileOutputService = new ToscaFileOutputServiceCsarImpl();
+ if (template != null) {
+ if (template instanceof NodeTemplate) {
+ NodeTemplate nodeTemplate = (NodeTemplate) template;
+ ArtifactDefinition artifactDefinition =
+ createArtifactDefinition(file, toscaFileOutputService);
+ if (nodeTemplate.getArtifacts() == null) {
+ nodeTemplate.setArtifacts(new HashMap<>());
+ }
+ nodeTemplate.getArtifacts().put(artifactId, artifactDefinition);
+ }
+ }
+ return returnValue;
+ }
+
+ private static Object handleGetResourceFunction(Object function, String heatFileName,
+ HeatOrchestrationTemplate
+ heatOrchestrationTemplate,
+ TranslationContext context) {
+ Object returnValue;
+ Optional<String> resourceTranslatedId = ResourceTranslationBase
+ .getResourceTranslatedId(heatFileName, heatOrchestrationTemplate, (String) function,
+ context);
+ if (resourceTranslatedId.isPresent()) {
+ returnValue = resourceTranslatedId.get();
+ } else {
+ returnValue = UNSUPPORTED_RESOURCE + function;
+ }
+ return returnValue;
+ }
+
+ private static Object handleGetAttrFunction(Object function, String heatFileName,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ TranslationContext context) {
+ Object returnValue = new HashMap<>();
+ List<Object> attributeFunctionExpression =
+ translateGetAttributeFunctionExpression(function, heatFileName, heatOrchestrationTemplate,
+ context);
+ if (isResourceSupported(attributeFunctionExpression.get(0).toString())
+ && isAttributeSupported(attributeFunctionExpression.get(0).toString())) {
+ ((Map) returnValue)
+ .put(ToscaFunctions.GET_ATTRIBUTE.getDisplayName(), attributeFunctionExpression);
+ } else {
+ returnValue = attributeFunctionExpression;
+ }
+ return returnValue;
+ }
+
+ private static Object handleGetParamFunction(Object function, String heatFileName,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ TranslationContext context) {
+ Map returnValue = new HashMap<>();
+ returnValue.put(ToscaFunctions.GET_INPUT.getDisplayName(),
+ translateGetParamFunctionExpression(function, heatFileName, heatOrchestrationTemplate,
+ context));
+ return returnValue;
+ }
+
+ private static ArtifactDefinition createArtifactDefinition(Object function,
+ ToscaFileOutputService
+ toscaFileOutputService) {
+ ArtifactDefinition artifactDefinition = new ArtifactDefinition();
+ artifactDefinition.setType(ToscaArtifactType.DEPLOYMENT.getDisplayName());
+ artifactDefinition
+ .setFile("../" + toscaFileOutputService.getArtifactsFolderName() + "/" + function);
+ return artifactDefinition;
+ }
+
+ private static Object translateGetParamFunctionExpression(Object function, String heatFileName,
+ HeatOrchestrationTemplate
+ heatOrchestrationTemplate,
+ TranslationContext context) {
+ Object returnValue = null;
+ if (function instanceof String) {
+ returnValue = function;
+ } else {
+ if (function instanceof List) {
+ returnValue = new ArrayList<>();
+ for (int i = 0; i < ((List) function).size(); i++) {
+ Object paramValue = ((List) function).get(i);
+ if ((paramValue instanceof Map && !((Map) paramValue).isEmpty())) {
+ Map<String, Object> paramMap = (Map) paramValue;
+ Map.Entry<String, Object> entry = paramMap.entrySet().iterator().next();
+ ((List) returnValue).add(
+ getToscaFunction(entry.getKey(), entry.getValue(), heatFileName,
+ heatOrchestrationTemplate, null, context));
+ } else {
+ ((List) returnValue).add(paramValue);
+ }
+ }
+ }
+ }
+
+ return returnValue;
+ }
+
+ private static List<Object> translateGetAttributeFunctionExpression(
+ Object function,String heatFileName,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ TranslationContext context) {
+ List<String> attributeParamList = (List) function;
+ List<Object> toscaAttributeParamList = new ArrayList<>();
+
+ Optional<String> resourceTranslatedId =
+ handleResourceName(attributeParamList.get(0), heatFileName, heatOrchestrationTemplate,
+ context);
+ if (!resourceTranslatedId.isPresent()) {
+ //unsupported resource
+ toscaAttributeParamList.add(UNSUPPORTED_RESOURCE + attributeParamList.get(0));
+ return toscaAttributeParamList;
+ } else {
+ toscaAttributeParamList.add(resourceTranslatedId.get());
+ }
+
+ Optional<List<Object>> toscaAttList =
+ handleAttributeName(attributeParamList, heatOrchestrationTemplate, heatFileName, context);
+ if (!toscaAttList.isPresent()) {
+ //Unsupported attribute
+ toscaAttributeParamList.clear();
+ toscaAttributeParamList
+ .add(UNSUPPORTED_ATTRIBUTE + attributeParamList.get(0) + "." + attributeParamList.get(1));
+ return toscaAttributeParamList;
+ } else {
+ toscaAttributeParamList.addAll(toscaAttList.get());
+ }
+
+ Optional<List<String>> toscaIndexOrKey = handleAttributeIndexOrKey(attributeParamList);
+ if (toscaIndexOrKey.isPresent()) {
+ toscaAttributeParamList.addAll(toscaIndexOrKey.get());
+ }
+
+ return toscaAttributeParamList;
+ }
+
+ private static Optional<List<String>> handleAttributeIndexOrKey(List<String> attributeParamList) {
+ List<String> attributeIndexOrKey = new ArrayList<>();
+ if (attributeParamList.size() < 2) {
+ return Optional.empty();
+ }
+
+ for (int i = 2; i < attributeParamList.size(); i++) {
+ attributeIndexOrKey.add(attributeParamList.get(i));
+ }
+
+ return Optional.of(attributeIndexOrKey);
+ }
+
+ private static Optional<List<Object>> handleAttributeName(List<String> attributeParamList,
+ HeatOrchestrationTemplate
+ heatOrchestrationTemplate,
+ String heatFileName,
+ TranslationContext context) {
+ String resourceId = attributeParamList.get(0);
+ Resource resource =
+ HeatToToscaUtil.getResource(heatOrchestrationTemplate, resourceId, heatFileName);
+
+ if (attributeParamList.size() == 1) {
+ return getResourceTranslatedAttributesList(resource, context);
+ }
+
+ if (HeatToToscaUtil.isNestedResource(resource)) {
+ return getNestedResourceTranslatedAttribute(attributeParamList.get(1));
+ } else {
+ return getResourceTranslatedAttribute(resource, attributeParamList.get(1), context);
+ }
+ }
+
+ private static Optional<List<Object>> getResourceTranslatedAttribute(Resource resource,
+ String attributeName,
+ TranslationContext context) {
+ List<Object> translatedAttributesList = new ArrayList<>();
+ String translatedAttribute =
+ context.getElementMapping(resource.getType(), Constants.ATTR, attributeName);
+ if (translatedAttribute != null) {
+ translatedAttributesList.add(translatedAttribute);
+ return Optional.of(translatedAttributesList);
+ } else { //unsupported attribute
+ return Optional.empty();
+ }
+ }
+
+ private static Optional<List<Object>> getNestedResourceTranslatedAttribute(String attributeName) {
+ List<Object> translatedAttributesList = new ArrayList<>();
+
+ if (attributeName.startsWith(HeatConstants.GET_ATT_FROM_RESOURCE_GROUP_PREFIX)) {
+ String[] attributeSplit = attributeName.split("\\.");
+ if (attributeSplit.length == 2) {
+ translatedAttributesList.add(attributeSplit[1]);
+ } else if (attributeSplit.length == 3) {
+ translatedAttributesList.add(attributeSplit[2]);
+ translatedAttributesList.add(Integer.valueOf(attributeSplit[1]));
+ } else {
+ return Optional.empty();
+ }
+ } else {
+ translatedAttributesList.add(attributeName);
+ }
+ return Optional.of(translatedAttributesList);
+ }
+
+ private static Optional<List<Object>> getResourceTranslatedAttributesList(Resource resource,
+ TranslationContext
+ context) {
+ List<Object> translatedAttributes = new ArrayList<>();
+ if (HeatToToscaUtil.isNestedResource(resource)) {
+ Optional<String> nestedFile = HeatToToscaUtil.getNestedFile(resource);
+ if (!nestedFile.isPresent()) {
+ return Optional.empty();
+ }
+ HeatOrchestrationTemplate nestedHeatOrchestrationTemplate = new YamlUtil()
+ .yamlToObject(context.getFiles().getFileContent(nestedFile.get()),
+ HeatOrchestrationTemplate.class);
+ translatedAttributes.addAll(nestedHeatOrchestrationTemplate.getOutputs().keySet());
+ return Optional.of(translatedAttributes);
+
+ } else {
+ Map<String, String> resourceMappingAttributes =
+ context.getElementMapping(resource.getType(), Constants.ATTR);
+ Set<String> mappingAttributes = new HashSet<>();
+ mappingAttributes
+ .addAll(resourceMappingAttributes.values().stream().collect(Collectors.toList()));
+ translatedAttributes.addAll(mappingAttributes);
+ return Optional.of(translatedAttributes);
+ }
+ }
+
+ private static Optional<String> handleResourceName(String resourceId, String heatFileName,
+ HeatOrchestrationTemplate
+ heatOrchestrationTemplate,
+ TranslationContext context) {
+ return ResourceTranslationBase
+ .getResourceTranslatedId(heatFileName, heatOrchestrationTemplate, resourceId, context);
+ }
+
+ public static boolean isResourceSupported(String translatedResourceId) {
+ return !translatedResourceId.startsWith(UNSUPPORTED_RESOURCE);
+ }
+
+ public static boolean isAttributeSupported(String translatedAttName) {
+ return !translatedAttName.startsWith(UNSUPPORTED_ATTRIBUTE);
+ }
+
+ /**
+ * Translate fn split function optional.
+ *
+ * @param propertyValue the property value
+ * @param listSize the list size
+ * @param includeBooleanValue the include boolean value
+ * @return the optional
+ */
+ public static Optional<List<Map<String, List>>> translateFnSplitFunction(
+ Object propertyValue,int listSize,
+ boolean includeBooleanValue) {
+ List<Map<String, List>> tokenPropertyValueList = new ArrayList<>();
+
+ if (propertyValue instanceof Map && !((Map) propertyValue).isEmpty()) {
+ Map<String, Object> propMap = (Map) propertyValue;
+ Map.Entry<String, Object> entry = propMap.entrySet().iterator().next();
+ Object entity = entry.getValue();
+ String key = entry.getKey();
+ String tokenChar;
+
+ if (key.equals("Fn::Split") && entity instanceof List) {
+ tokenChar = (String) ((List) entity).get(0);
+ Object refParameter = ((List) entity).get(1);
+
+ for (int substringIndex = 0; substringIndex < listSize; substringIndex++) {
+ Map<String, List> tokenPropertyValue = new HashMap<>();
+ tokenPropertyValue.put("token", new ArrayList<>());
+
+ if (refParameter instanceof Map && ((Map) refParameter).get("Ref") != null) {
+ Map<String, String> stringWithToken = new HashMap<>();
+ ((Map) stringWithToken)
+ .put(ToscaFunctions.GET_INPUT.getDisplayName(), ((Map) refParameter).get("Ref"));
+ tokenPropertyValue.get("token").add(stringWithToken);
+ } else if (refParameter instanceof String) {
+ if (includeBooleanValue) {
+ StringBuffer booleanBuffer = new StringBuffer();
+ String[] booleanValueList = ((String) refParameter).split(tokenChar);
+ for (int i = 0; i < booleanValueList.length; i++) {
+ if (i == 0) {
+ booleanBuffer.append(HeatBoolean.eval(booleanValueList[i]));
+ } else {
+ booleanBuffer.append(tokenChar);
+ booleanBuffer.append(HeatBoolean.eval(booleanValueList[i]));
+ }
+ }
+ tokenPropertyValue.get("token").add(booleanBuffer.toString());
+ } else {
+ tokenPropertyValue.get("token").add(refParameter);
+ }
+ }
+ tokenPropertyValue.get("token").add(tokenChar);
+ tokenPropertyValue.get("token").add(substringIndex);
+ tokenPropertyValueList.add(tokenPropertyValue);
+ }
+
+ return Optional.of(tokenPropertyValueList);
+
+ }
+ }
+
+ return Optional.empty();
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaParameterConverter.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaParameterConverter.java
new file mode 100644
index 0000000000..07ab6d1542
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaParameterConverter.java
@@ -0,0 +1,271 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.mapping;
+
+import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate;
+import org.openecomp.sdc.heat.datatypes.model.Output;
+import org.openecomp.sdc.heat.datatypes.model.Parameter;
+import org.openecomp.sdc.tosca.datatypes.model.Constraint;
+import org.openecomp.sdc.tosca.datatypes.model.EntrySchema;
+import org.openecomp.sdc.tosca.datatypes.model.ParameterDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.heatextend.ParameterDefinitionExt;
+import org.openecomp.sdc.translator.services.heattotosca.TranslationContext;
+
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class TranslatorHeatToToscaParameterConverter {
+
+
+ private static Map<String, String> parameterTypeMapping;
+ private static Map<String, String> parameterEntrySchemaTypeMapping;
+
+ static {
+ parameterEntrySchemaTypeMapping = new HashMap<>();
+ parameterEntrySchemaTypeMapping.put("list", "string");
+ }
+
+ static {
+ parameterTypeMapping = new HashMap<>();
+ parameterTypeMapping.put("string", "string");
+ parameterTypeMapping.put("number", "float");
+ parameterTypeMapping.put("comma_delimited_list", "list");
+ parameterTypeMapping.put("json", "json");
+ parameterTypeMapping.put("boolean", "boolean");
+ }
+
+ /**
+ * Parameter converter map.
+ *
+ * @param parameters the parameters
+ * @param heatOrchestrationTemplate the heat orchestration template
+ * @param heatFileName the heat file name
+ * @param context the context
+ * @return the map
+ */
+ public static Map<String, ParameterDefinition> parameterConverter(
+ Map<String, Parameter> parameters, HeatOrchestrationTemplate heatOrchestrationTemplate,
+ String heatFileName, TranslationContext context) {
+ Map<String, ParameterDefinition> parameterDefinitionMap = new HashMap<>();
+ for (Map.Entry<String, Parameter> entry : parameters.entrySet()) {
+ //parameterDefinitionMap.put(entry.getKey()+"_"+ FileUtils
+ // .getFileWithoutExtention(heatFileName),getToscaParameter(entry.getValue(),
+ // heatOrchestrationTemplate, heatFileName, context));
+ parameterDefinitionMap.put(entry.getKey(),
+ getToscaParameter(entry.getValue(), heatOrchestrationTemplate, heatFileName, context));
+ }
+ return parameterDefinitionMap;
+ }
+
+ /**
+ * Parameter output converter map.
+ *
+ * @param parameters the parameters
+ * @param heatOrchestrationTemplate the heat orchestration template
+ * @param heatFileName the heat file name
+ * @param context the context
+ * @return the map
+ */
+ public static Map<String, ParameterDefinition> parameterOutputConverter(
+ Map<String, Output> parameters, HeatOrchestrationTemplate heatOrchestrationTemplate,
+ String heatFileName, TranslationContext context) {
+ Map<String, ParameterDefinition> parameterDefinitionMap = new HashMap<>();
+ for (Map.Entry<String, Output> entry : parameters.entrySet()) {
+ //parameterDefinitionMap.put(entry.getKey()+"_"+FileUtils
+ // .getFileWithoutExtention(heatFileName),getToscaOutputParameter(entry.getValue(),
+ // heatOrchestrationTemplate, heatFileName, context));
+ parameterDefinitionMap.put(entry.getKey(),
+ getToscaOutputParameter(entry.getValue(), heatOrchestrationTemplate, heatFileName,
+ context));
+ }
+ return parameterDefinitionMap;
+ }
+
+ /**
+ * Gets tosca parameter.
+ *
+ * @param heatParameter the heat parameter
+ * @param heatOrchestrationTemplate the heat orchestration template
+ * @param heatFileName the heat file name
+ * @param context the context
+ * @return the tosca parameter
+ */
+ public static ParameterDefinitionExt getToscaParameter(Parameter heatParameter,
+ HeatOrchestrationTemplate
+ heatOrchestrationTemplate,
+ String heatFileName,
+ TranslationContext context) {
+
+ ParameterDefinitionExt toscaParameter = new ParameterDefinitionExt();
+ toscaParameter.setType(getToscaParameterType(heatParameter.getType()));
+ toscaParameter.setEntry_schema(getToscaParameterEntrySchema(toscaParameter.getType()));
+ toscaParameter.setLabel(heatParameter.getLabel());
+ toscaParameter.setDescription(heatParameter.getDescription());
+ toscaParameter.set_default(
+ getToscaParameterDefaultValue(heatParameter.get_default(), toscaParameter.getType(),
+ heatFileName, heatOrchestrationTemplate, context));
+ toscaParameter.setHidden(heatParameter.isHidden());
+ toscaParameter.setImmutable(heatParameter.isImmutable());
+ toscaParameter.setConstraints(getToscaConstrains(heatParameter.getConstraints()));
+ return toscaParameter;
+ }
+
+ /**
+ * Gets tosca output parameter.
+ *
+ * @param heatOutputParameter the heat output parameter
+ * @param heatOrchestrationTemplate the heat orchestration template
+ * @param heatFileName the heat file name
+ * @param context the context
+ * @return the tosca output parameter
+ */
+ public static ParameterDefinitionExt getToscaOutputParameter(Output heatOutputParameter,
+ HeatOrchestrationTemplate
+ heatOrchestrationTemplate,
+ String heatFileName,
+ TranslationContext context) {
+
+ ParameterDefinitionExt toscaParameter = new ParameterDefinitionExt();
+ toscaParameter.setDescription(heatOutputParameter.getDescription());
+ toscaParameter.setValue(
+ getToscaParameterDefaultValue(heatOutputParameter.getValue(), toscaParameter.getType(),
+ heatFileName, heatOrchestrationTemplate, context));
+ return toscaParameter;
+ }
+
+ /**
+ * Gets tosca parameter default value.
+ *
+ * @param defaultObj the a default
+ * @param type the type
+ * @param heatFileName the heat file name
+ * @param heatOrchestrationTemplate the heat orchestration template
+ * @param context the context
+ * @return the tosca parameter default value
+ */
+ public static Object getToscaParameterDefaultValue(Object defaultObj, String type,
+ String heatFileName,
+ HeatOrchestrationTemplate
+ heatOrchestrationTemplate,
+ TranslationContext context) {
+
+ if (defaultObj == null) {
+ return null;
+ }
+ if ("list".equals(type)) {
+ if (defaultObj instanceof String) {
+ return Arrays.asList(((String) defaultObj).split(","));
+ } else {
+ return defaultObj;
+ }
+ }
+
+ return getToscaParameterValue(defaultObj, heatFileName, heatOrchestrationTemplate,
+ context);
+ }
+
+ private static Object getToscaParameterValue(Object paramValue, String heatFileName,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ TranslationContext context) {
+ if (paramValue instanceof Map) {
+ Map.Entry<String, Object> functionMapEntry =
+ (Map.Entry<String, Object>) ((Map) paramValue).entrySet().iterator().next();
+ if (TranslatorHeatToToscaFunctionConverter.functionNameSet
+ .contains(functionMapEntry.getKey())) {
+ return TranslatorHeatToToscaFunctionConverter
+ .getToscaFunction(functionMapEntry.getKey(), functionMapEntry.getValue(), heatFileName,
+ heatOrchestrationTemplate, null, context);
+ }
+ }
+
+ return paramValue;
+ }
+
+ private static List<Constraint> getToscaConstrains(List<Map<String, Object>> constraints) {
+ if (constraints == null) {
+ return null;
+ }
+
+ List<Constraint> constraintList = new ArrayList<>();
+
+ for (Map<String, Object> constraint : constraints) {
+ constraintList.addAll(getToscaParameterConstraint(constraint));
+ }
+
+ return constraintList;
+ }
+
+ private static List<Constraint> getToscaParameterConstraint(Map<String, Object> constraint) {
+ List<Constraint> convertedConstraintList = new ArrayList<>();
+ Constraint convertedConstraint;
+
+ if (constraint.containsKey("range")) {
+ convertedConstraint = new Constraint();
+ convertedConstraintList.add(convertedConstraint);
+ Integer min = (Integer) ((Map) constraint.get("range")).get("min");
+ Integer max = (Integer) ((Map) constraint.get("range")).get("max");
+ convertedConstraint.setIn_range(new Integer[]{min, max});
+
+ } else if (constraint.containsKey("length")) {
+ Integer min = (Integer) ((Map) constraint.get("length")).get("min");
+ Integer max = (Integer) ((Map) constraint.get("length")).get("max");
+ if (max != null) {
+ convertedConstraint = new Constraint();
+ convertedConstraintList.add(convertedConstraint);
+ convertedConstraint.setMax_length(max);
+ }
+ if (min != null) {
+ convertedConstraint = new Constraint();
+ convertedConstraintList.add(convertedConstraint);
+ convertedConstraint.setMin_length(min);
+ }
+ } else if (constraint.containsKey("allowed_values")) {
+ convertedConstraint = new Constraint();
+ convertedConstraintList.add(convertedConstraint);
+ convertedConstraint.setValid_values((List) constraint.get("allowed_values"));
+ } else if (constraint.containsKey("allowed_pattern")) {
+ convertedConstraint = new Constraint();
+ convertedConstraintList.add(convertedConstraint);
+ convertedConstraint.setPattern(constraint.get("allowed_pattern"));
+ }
+
+ return convertedConstraintList;
+ }
+
+ private static EntrySchema getToscaParameterEntrySchema(String type) {
+
+ if (!parameterEntrySchemaTypeMapping.containsKey(type)) {
+ return null;
+ }
+
+ EntrySchema entrySchema = new EntrySchema();
+ entrySchema.setType(parameterEntrySchemaTypeMapping.get(type));
+ return entrySchema;
+ }
+
+ protected static String getToscaParameterType(String heatParameterType) {
+ return parameterTypeMapping.get(heatParameterType);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaPropertyConverter.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaPropertyConverter.java
new file mode 100644
index 0000000000..d1079c2dc5
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaPropertyConverter.java
@@ -0,0 +1,146 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.translator.services.heattotosca.mapping;
+
+import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.Template;
+import org.openecomp.sdc.translator.services.heattotosca.Constants;
+import org.openecomp.sdc.translator.services.heattotosca.TranslationContext;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class TranslatorHeatToToscaPropertyConverter {
+
+ /**
+ * Gets tosca properties simple conversion.
+ *
+ * @param heatProperties the heat properties
+ * @param toscaProperties the tosca properties
+ * @param heatFileName the heat file name
+ * @param heatOrchestrationTemplate the heat orchestration template
+ * @param resourceType the resource type
+ * @param template the template
+ * @param context the context
+ * @return the tosca properties simple conversion
+ */
+ //Convert property assuming the property type in heat is same as the property type in tosca
+ public static Map<String, Object> getToscaPropertiesSimpleConversion(
+ Map<String, Object> heatProperties, Map<String, Object> toscaProperties, String heatFileName,
+ HeatOrchestrationTemplate heatOrchestrationTemplate, String resourceType, Template template,
+ TranslationContext context) {
+
+ toscaProperties = toscaProperties != null ? toscaProperties : new HashMap<>();
+
+ for (String heatPropertyName : context.getElementSet(resourceType, Constants.PROP)) {
+
+ setSimpleProperty(heatProperties, heatFileName, resourceType, heatOrchestrationTemplate,
+ context, toscaProperties, heatPropertyName, null, template);
+ }
+ return toscaProperties;
+ }
+
+ /**
+ * Sets simple property.
+ *
+ * @param heatProperties the heat properties
+ * @param heatFileName the heat file name
+ * @param resourceType the resource type
+ * @param heatOrchestrationTemplate the heat orchestration template
+ * @param context the context
+ * @param toscaProperties the tosca properties
+ * @param heatPropertyName the heat property name
+ * @param toscaPropertyName the tosca property name
+ * @param template the template
+ */
+ public static void setSimpleProperty(Map<String, Object> heatProperties, String heatFileName,
+ String resourceType,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ TranslationContext context,
+ Map<String, Object> toscaProperties, String heatPropertyName,
+ String toscaPropertyName, Template template) {
+ Object propertyValue = null;
+ if (heatProperties != null) {
+ propertyValue = heatProperties.get(heatPropertyName);
+ }
+ if (propertyValue == null) {
+ return;
+ }
+
+ if (toscaPropertyName == null) {
+ toscaPropertyName = resourceType == null ? heatPropertyName
+ : context.getElementMapping(resourceType, Constants.PROP, heatPropertyName);
+ }
+ toscaProperties.put(toscaPropertyName,
+ getToscaPropertyValue(heatPropertyName, propertyValue, resourceType, heatFileName,
+ heatOrchestrationTemplate, template, context));
+ }
+
+
+ /**
+ * Gets tosca property value.
+ *
+ * @param propertyName the property name
+ * @param propertyValue the property value
+ * @param resourceType the resource type
+ * @param heatFileName the heat file name
+ * @param heatOrchestrationTemplate the heat orchestration template
+ * @param template the template
+ * @param context the context
+ * @return the tosca property value
+ */
+ public static Object getToscaPropertyValue(String propertyName, Object propertyValue,
+ String resourceType, String heatFileName,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ Template template, TranslationContext context) {
+ if (propertyValue instanceof Map && !((Map) propertyValue).isEmpty()) {
+ Map.Entry<String, Object> functionMapEntry =
+ (Map.Entry<String, Object>) ((Map) propertyValue).entrySet().iterator().next();
+ if (TranslatorHeatToToscaFunctionConverter.functionNameSet
+ .contains(functionMapEntry.getKey())) {
+ return TranslatorHeatToToscaFunctionConverter
+ .getToscaFunction(functionMapEntry.getKey(), functionMapEntry.getValue(), heatFileName,
+ heatOrchestrationTemplate, template, context);
+ }
+ Map<String, Object> propertyValueMap = new HashMap<>();
+ for (Map.Entry<String, Object> entry : ((Map<String, Object>) propertyValue).entrySet()) {
+ String toscaPropertyName = resourceType == null ? null : context
+ .getElementMapping(resourceType, Constants.PROP, propertyName + "." + entry.getKey());
+ toscaPropertyName = toscaPropertyName != null ? toscaPropertyName : entry.getKey();
+ propertyValueMap.put(toscaPropertyName,
+ getToscaPropertyValue(propertyName, entry.getValue(), resourceType, heatFileName,
+ heatOrchestrationTemplate, template, context));
+ }
+ return propertyValueMap;
+ } else if (propertyValue instanceof List && !((List) propertyValue).isEmpty()) {
+ List propertyValueArray = new ArrayList<>();
+ for (int i = 0; i < ((List) propertyValue).size(); i++) {
+ propertyValueArray.add(
+ getToscaPropertyValue(propertyName, ((List) propertyValue).get(i), resourceType,
+ heatFileName, heatOrchestrationTemplate, template, context));
+ }
+ return propertyValueArray;
+ }
+ return propertyValue;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/resources/heatToToscaMapping.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/resources/heatToToscaMapping.json
new file mode 100644
index 0000000000..ebe5df6b50
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/resources/heatToToscaMapping.json
@@ -0,0 +1,298 @@
+{
+ "OS::Contrail::VirtualNetwork": {
+ "properties": {
+ "name": "network_name",
+ "shared": "shared",
+ "external": "external",
+ "route_targets": "route_targets",
+ "forwarding_mode": "forwarding_mode",
+ "flood_unknown_unicast": "flood_unknown_unicast",
+ "allow_transit": "allow_transit"
+ },
+ "attributes": {
+ "fq_name": "fq_name",
+ "name": "network_name",
+ "shared": "shared",
+ "external": "external",
+ "route_targets": "route_targets",
+ "forwarding_mode": "forwarding_mode",
+ "flood_unknown_unicast": "flood_unknown_unicast",
+ "allow_transit": "allow_transit"
+ }
+ },
+ "OS::Contrail::NetworkPolicy": {
+ "properties": {
+ "name": "name",
+ "entries": "entries"
+ },
+ "attributes": {
+ "fq_name": "fq_name",
+ "name": "name",
+ "entries": "entries",
+ "tenant_id": "tenant_id",
+ "rules": "rules",
+ "show": "show"
+ }
+ },
+
+ "OS::ContrailV2::VirtualNetwork": {
+ "properties": {
+ "name": "network_name",
+ "network_ipam_refs": "network_ipam_refs",
+ "network_ipam_refs_data": "network_ipam_refs_data",
+ "network_policy_refs": "network_policy_refs",
+ "network_policy_refs_data": "network_policy_refs_data"
+ },
+ "attributes": {
+ "fq_name": "fq_name",
+ "name": "network_name",
+ "network_ipam_refs": "network_ipam_refs",
+ "network_ipam_refs_data": "network_ipam_refs_data",
+ "network_policy_refs": "network_policy_refs",
+ "network_policy_refs_data": "network_policy_refs_data"
+ }
+ },
+ "OS::ContrailV2::VirtualMachineInterface": {
+ "properties": {
+ "name": "name",
+ "virtual_machine_intefrace_mac_addresses": "virtual_machine_intefrace_mac_addresses",
+ "virtual_network_refs": "virtual_network_refs",
+ "port_tuple_refs": "port_tuple_refs",
+ "security_group_refs": "security_group_refs",
+ "virtual_machine_interface_properties": "virtual_machine_interface_properties"
+ },
+ "attributes": {
+ "name": "name",
+ "virtual_machine_intefrace_mac_addresses": "virtual_machine_intefrace_mac_addresses",
+ "virtual_network_refs": "virtual_network_refs",
+ "port_tuple_refs": "port_tuple_refs",
+ "virtual_machine_interface_properties": "virtual_machine_interface_properties",
+ "fq_name": "fq_name",
+ "show": "show"
+ }
+ },
+ "OS::ContrailV2::NetworkPolicy": {
+ "properties": {
+ "name":"name",
+ "network_policy_entries":"network_policy_entries"
+ },
+ "attributes": {
+ "fq_name": "fq_name",
+ "name":"name",
+ "network_policy_entries":"network_policy_entries"
+ }
+ },
+ "OS::Cinder::Volume": {
+ "properties": {
+ "availability_zone": "availability_zone",
+ "backup_id": "backup_id",
+ "description": "description",
+ "image": "image",
+ "metadata": "metadata",
+ "multiattach": "multiattach",
+ "name": "name",
+ "read_only": "read_only",
+ "scheduler_hints": "scheduler_hints",
+ "size": "size",
+ "snapshot_id": "snapshot_id",
+ "source_volid": "source_volid",
+ "volume_id": "volume_id",
+ "volume_type": "volume_type",
+ "delete_on_termination": "delete_on_termination",
+ "volume_size": "size",
+ "device_type": "device_type",
+ "disk_bus": "disk_bus",
+ "swap_size": "swap_size",
+ "image_id": "image"
+ },
+ "attributes": {
+ "attachments": "attachments",
+ "availability_zone": "availability_zone",
+ "created_at": "created_at",
+ "display_description": "display_description",
+ "display_name": "display_name",
+ "encrypted": "encrypted",
+ "metadata": "metadata",
+ "metadata_values": "metadata_values",
+ "multiattach": "multiattach",
+ "show": "show",
+ "size": "size",
+ "snapshot_id": "snapshot_id",
+ "source_volid": "source_volid",
+ "status": "status",
+ "volume_type": "volume_type"
+ }
+ },
+ "OS::Cinder::VolumeAttachment": {
+ "properties": {
+ "instance_uuid": "instance_uuid",
+ "volume_id": "volume_id",
+ "mountpoint": "location"
+ },
+ "attributes": {
+ "show": "show"
+ }
+ },
+ "OS::Neutron::Net": {
+ "properties": {
+ "name": "network_name",
+ "dhcp_agent_ids": "dhcp_agent_ids",
+ "tenant_id": "tenant_id",
+ "port_security_enabled": "port_security_enabled",
+ "shared": "shared",
+ "admin_state_up": "admin_state_up",
+ "qos_policy": "qos_policy",
+ "value_specs": "value_specs"
+ },
+ "attributes": {
+ "admin_state_up": "admin_state_up",
+ "mtu": "mtu",
+ "name": "network_name",
+ "port_security_enabled": "port_security_enabled",
+ "qos_policy_id": "qos_policy_id",
+ "show": "show",
+ "status": "status",
+ "subnets": "subnets",
+ "tenant_id": "tenant_id"
+ }
+ },
+ "OS::Neutron::Subnet": {
+ "properties": {
+ "allocation_pools": "allocation_pools",
+ "cidr": "cidr",
+ "enable_dhcp": "enable_dhcp",
+ "gateway_ip": "gateway_ip",
+ "host_routes": "host_routes",
+ "ip_version": "ip_version",
+ "ipv6_address_mode": "ipv6_address_mode",
+ "ipv6_ra_mode": "ipv6_ra_mode",
+ "name": "name",
+ "prefixlen": "prefixlen",
+ "subnetpool": "subnetpool",
+ "tenant_id": "tenant_id",
+ "value_specs": "value_specs",
+ "dns_nameservers": "dns_nameservers"
+ }
+ },
+ "OS::Nova::Server": {
+ "properties": {
+ "flavor": "flavor",
+ "admin_pass": "admin_pass",
+ "availability_zone": "availability_zone",
+ "config_drive": "config_drive",
+ "diskConfig": "diskConfig",
+ "flavor_update_policy": "flavor_update_policy",
+ "image": "image",
+ "image_update_policy": "image_update_policy",
+ "key_name": "key_name",
+ "metadata": "metadata",
+ "name": "name",
+ "personality": "personality",
+ "reservation_id": "reservation_id",
+ "scheduler_hints": "scheduler_hints",
+ "security_groups": "security_groups",
+ "software_config_transport": "software_config_transport",
+ "user_data_format": "user_data_format",
+ "user_data_update_policy": "user_data_update_policy"
+ },
+ "attributes": {
+ "accessIPv4": "accessIPv4",
+ "accessIPv6": "accessIPv6",
+ "addresses": "addresses",
+ "console_urls": "console_urls",
+ "instance_name": "instance_name",
+
+ "show": "show"
+ }
+ },
+ "OS::Neutron::Port": {
+ "properties": {
+ "network": "network",
+ "network_id": "network",
+ "admin_state_up": "admin_state_up",
+ "allowed_address_pairs": "allowed_address_pairs",
+ "binding:vnic_type": "binding:vnic_type",
+ "device_id": "device_id",
+ "device_owner": "device_owner",
+ "fixed_ips": "fixed_ips",
+ "mac_address": "mac_address",
+ "name": "name",
+ "port_security_enabled": "port_security_enabled",
+ "qos_policy": "qos_policy",
+ "security_groups": "security_groups",
+ "value_specs": "value_specs",
+ "replacement_policy": "replacement_policy",
+ "fixed_ips.subnet":"subnet",
+ "fixed_ips.ip_address":"ip_address"
+ },
+ "attributes": {
+ "admin_state_up": "admin_state_up",
+ "allowed_address_pairs": "allowed_address_pairs",
+ "device_id": "device_id",
+ "device_owner": "device_owner",
+ "fixed_ips": "fixed_ips",
+ "mac_address": "mac_address",
+ "name": "name",
+ "network_id": "network",
+ "network": "network",
+ "port_security_enabled": "port_security_enabled",
+ "qos_policy": "qos_policy",
+ "security_groups": "security_groups",
+ "show": "show",
+ "status": "status",
+ "subnets": "subnets",
+ "tenant_id": "tenant_id"
+ }
+ },
+ "OS::Nova::ServerGroup": {
+ "properties": {
+ "name": "name"
+ },
+ "attributes": {
+ "show": "show"
+ }
+ },
+ "OS::Neutron::SecurityGroup": {
+ "properties": {
+ "description": "description",
+ "name": "name",
+ "rules": "rules"
+ },
+ "attributes": {
+ "show": "show"
+ }
+ },
+ "OS::Contrail::ServiceTemplate": {
+ "properties": {
+ "name": "service_template_name",
+ "service_mode": "service_mode",
+ "service_type": "service_type",
+ "image_name": "image_name",
+ "availability_zone_enable": "availability_zone_enable",
+ "flavor": "flavor",
+ "service_interface_type_list": "service_interface_type_list",
+ "shared_ip_list": "shared_ip_list",
+ "static_routes_list": "static_routes_list",
+ "ordered_interfaces": "ordered_interfaces"
+ },
+ "attributes": {
+ }
+ },
+ "OS::Contrail::ServiceInstance": {
+ "properties": {
+ "availability_zone": "availability_zone",
+ "interface_list": "interface_list",
+ "name": "service_instance_name"
+ },
+ "attributes": {
+ "fq_name": "fq_name",
+ "name": "service_instance_name",
+ "status": "status",
+ "service_template": "service_template_name",
+ "virtual_machines": "virtual_machines",
+ "active_service_vms": "active_vms",
+ "tenant_id": "tenant_id",
+ "show": "show"
+ }
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/TestUtils.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/TestUtils.java
new file mode 100644
index 0000000000..b52abfa927
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/TestUtils.java
@@ -0,0 +1,43 @@
+package org.openecomp.sdc.translator;
+
+import org.openecomp.sdc.common.utils.AsdcCommon;
+import org.openecomp.core.translator.api.HeatToToscaTranslator;
+import org.openecomp.core.utilities.file.FileUtils;
+import org.junit.Assert;
+
+import java.io.*;
+
+public class TestUtils {
+ private static final String MANIFEST_NAME = AsdcCommon.MANIFEST_NAME;
+ private static String zipFilename = "VSP.zip";
+ private static String validationFilename = "validationOutput.json";
+
+ private TestUtils() {
+ }
+
+
+ public static void addFilesToTranslator(HeatToToscaTranslator heatToToscaTranslator, String path)
+ throws IOException {
+ File manifestFile = new File(path);
+ File[] files = manifestFile.listFiles();
+ byte[] fileContent;
+
+ Assert.assertNotNull("manifest files is empty", files);
+
+ for (File file : files) {
+
+ try (FileInputStream fis = new FileInputStream(file)) {
+
+ fileContent = FileUtils.toByteArray(fis);
+
+ if (file.getName().equals(MANIFEST_NAME)) {
+ heatToToscaTranslator.addManifest(MANIFEST_NAME, fileContent);
+ } else {
+ if (!file.getName().equals(zipFilename) && (!file.getName().equals(validationFilename))) {
+ heatToToscaTranslator.addFile(file.getName(), fileContent);
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/multi/Translate_Heat_Nested_Multi.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/multi/Translate_Heat_Nested_Multi.java
new file mode 100644
index 0000000000..4be63258ae
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/multi/Translate_Heat_Nested_Multi.java
@@ -0,0 +1,17 @@
+package org.openecomp.sdc.translator.impl.heattotosca.nested.multi;
+
+import org.openecomp.sdc.translator.services.heattotosca.impl.BaseResourceTranslationTest;
+import org.junit.Test;
+
+public class Translate_Heat_Nested_Multi extends BaseResourceTranslationTest {
+
+ {
+ inputFilesPath = "/mock/heat/nested/multi/inputs";
+ outputFilesPath = "/mock/heat/nested/multi/expectedoutputfiles";
+ }
+
+ @Test
+ public void testTranslate() throws Exception {
+ testTranslation();
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/nestedvolumelocal/NestedVolumelocal.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/nestedvolumelocal/NestedVolumelocal.java
new file mode 100644
index 0000000000..4f2f3af33a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/nestedvolumelocal/NestedVolumelocal.java
@@ -0,0 +1,17 @@
+package org.openecomp.sdc.translator.impl.heattotosca.nested.nestedvolumelocal;
+
+import org.openecomp.sdc.translator.services.heattotosca.impl.BaseResourceTranslationTest;
+import org.junit.Test;
+
+public class NestedVolumelocal extends BaseResourceTranslationTest {
+
+ {
+ inputFilesPath = "/mock/heat/nested/nestedvolumelocal/inputs";
+ outputFilesPath = "/mock/heat/nested/nestedvolumelocal/expectedoutputfiles";
+ }
+
+ @Test
+ public void testTranslate() throws Exception {
+ testTranslation();
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/nestedvolumeseperatefile/NestedVolumeSeperateFile.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/nestedvolumeseperatefile/NestedVolumeSeperateFile.java
new file mode 100644
index 0000000000..02a8fb6ce4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/nestedvolumeseperatefile/NestedVolumeSeperateFile.java
@@ -0,0 +1,17 @@
+package org.openecomp.sdc.translator.impl.heattotosca.nested.nestedvolumeseperatefile;
+
+import org.openecomp.sdc.translator.services.heattotosca.impl.BaseResourceTranslationTest;
+import org.junit.Test;
+
+public class NestedVolumeSeperateFile extends BaseResourceTranslationTest {
+
+ {
+ inputFilesPath = "/mock/heat/nested/nestedvolumeseperatefile/inputs";
+ outputFilesPath = "/mock/heat/nested/nestedvolumeseperatefile/expectedoutputfiles";
+ }
+
+ @Test
+ public void testTranslate() throws Exception {
+ testTranslation();
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/recursive/TranslateHeatNestedRecursiveTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/recursive/TranslateHeatNestedRecursiveTest.java
new file mode 100644
index 0000000000..792f4f4bf5
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/recursive/TranslateHeatNestedRecursiveTest.java
@@ -0,0 +1,43 @@
+package org.openecomp.sdc.translator.impl.heattotosca.nested.recursive;
+
+import org.openecomp.sdc.translator.services.heattotosca.impl.BaseResourceTranslationTest;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.IOException;
+
+public class TranslateHeatNestedRecursiveTest extends BaseResourceTranslationTest {
+
+
+ @Override
+ @Before
+ public void setUp() throws IOException {
+ // do not delete this function. it prevents the superclass setup from running
+ }
+
+ @Test
+ public void testTranslateRecursive() throws Exception {
+ inputFilesPath = "/mock/heat/nested/recursive/inputs";
+ outputFilesPath = "/mock/heat/nested/recursive/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+ @Test
+ public void testTranslateExposedReq2Level() throws Exception {
+ inputFilesPath = "/mock/heat/nested/nested2levels/inputs";
+ outputFilesPath = "/mock/heat/nested/nested2levels/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+ @Test
+ public void testTranslateExposedReq3Level() throws Exception {
+ inputFilesPath = "/mock/heat/nested/nested3levels/inputs";
+ outputFilesPath = "/mock/heat/nested/nested3levels/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/reusenestedfrommultibase/Translate_Heat_Nested_From_Multi_Base.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/reusenestedfrommultibase/Translate_Heat_Nested_From_Multi_Base.java
new file mode 100644
index 0000000000..005bcd0db0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/reusenestedfrommultibase/Translate_Heat_Nested_From_Multi_Base.java
@@ -0,0 +1,18 @@
+package org.openecomp.sdc.translator.impl.heattotosca.nested.reusenestedfrommultibase;
+
+import org.openecomp.sdc.translator.services.heattotosca.impl.BaseResourceTranslationTest;
+import org.junit.Test;
+
+public class Translate_Heat_Nested_From_Multi_Base extends BaseResourceTranslationTest {
+
+ {
+ inputFilesPath = "/mock/heat/nested/reusenestedfrommultibase/inputs";
+ outputFilesPath = "/mock/heat/nested/reusenestedfrommultibase/expectedoutputfiles";
+ }
+
+ @Test
+ public void testTranslate() throws Exception {
+ testTranslation();
+ }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/separatevol/NestedAndSeparateVolTranslationTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/separatevol/NestedAndSeparateVolTranslationTest.java
new file mode 100644
index 0000000000..4269705923
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/separatevol/NestedAndSeparateVolTranslationTest.java
@@ -0,0 +1,22 @@
+package org.openecomp.sdc.translator.impl.heattotosca.nested.separatevol;
+
+import org.openecomp.sdc.translator.services.heattotosca.impl.BaseResourceTranslationTest;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.IOException;
+
+public class NestedAndSeparateVolTranslationTest extends BaseResourceTranslationTest {
+
+ @Before
+ public void setUp() throws IOException {
+ inputFilesPath = "/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles";
+ outputFilesPath = "/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out";
+ super.setUp();
+ }
+
+ @Test
+ public void testTranslate() throws Exception {
+ testTranslation();
+ }
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/single/TranslateHeatNestedSingle.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/single/TranslateHeatNestedSingle.java
new file mode 100644
index 0000000000..1d80551f27
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/single/TranslateHeatNestedSingle.java
@@ -0,0 +1,17 @@
+package org.openecomp.sdc.translator.impl.heattotosca.nested.single;
+
+import org.openecomp.sdc.translator.services.heattotosca.impl.BaseResourceTranslationTest;
+import org.junit.Test;
+
+public class TranslateHeatNestedSingle extends BaseResourceTranslationTest {
+
+ {
+ inputFilesPath = "/mock/heat/nested/single/inputs";
+ outputFilesPath = "/mock/heat/nested/single/expectedoutputfiles";
+ }
+
+ @Test
+ public void testTranslate() throws Exception {
+ testTranslation();
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/outputs/HeatOutputConversionTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/outputs/HeatOutputConversionTest.java
new file mode 100644
index 0000000000..fd3543a051
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/outputs/HeatOutputConversionTest.java
@@ -0,0 +1,50 @@
+package org.openecomp.sdc.translator.impl.heattotosca.outputs;
+
+import org.openecomp.sdc.translator.services.heattotosca.impl.BaseResourceTranslationTest;
+import org.junit.Test;
+
+public class HeatOutputConversionTest extends BaseResourceTranslationTest {
+
+ {
+ inputFilesPath = "/mock/heat/outputs/inputs";
+ outputFilesPath = "/mock/heat/outputs/expectedoutputfiles";
+ }
+
+ @Test
+ public void testTranslate() throws Exception {
+ testTranslation();
+ }
+
+
+ //private static final String MANIFEST_NAME = "MANIFEST.json";
+
+ /* @Test
+ public void testTranslate_outputs() throws IOException {
+
+ HeatToToscaTranslator heatToToscaTranslator = HeatToToscaTranslatorFactory.getInstance().createInterface();
+ URL url = this.getClass().getResource("/mock/heat/outputs");
+ File manifestFile = new File(url.getPath());
+ File[] files = manifestFile.listFiles();
+ FileInputStream fis;
+ byte[] fileContent;
+ for (File file : files) {
+ fis = new FileInputStream(file);
+ fileContent = FileUtils.toByteArray(fis);
+ if (file.getName().equals(MANIFEST_NAME)) {
+ heatToToscaTranslator.addManifest(MANIFEST_NAME, new String(fileContent));
+ } else {
+ heatToToscaTranslator.addFile(file.getName(), fileContent);
+ }
+ }
+
+ TranslatorOutput translatorOutput = heatToToscaTranslator.translate();
+ Assert.assertNotNull(translatorOutput);
+ File file = new File("Outputs.zip");
+ FileOutputStream fos = new FileOutputStream(file);
+ fos.write(translatorOutput.getTranslationContent());
+ fos.close();
+
+ }*/
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/parameters/HeatParameterConversionTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/parameters/HeatParameterConversionTest.java
new file mode 100644
index 0000000000..4feef0e094
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/parameters/HeatParameterConversionTest.java
@@ -0,0 +1,54 @@
+package org.openecomp.sdc.translator.impl.heattotosca.parameters;
+
+import org.openecomp.sdc.translator.services.heattotosca.impl.BaseResourceTranslationTest;
+import org.junit.Test;
+
+public class HeatParameterConversionTest extends BaseResourceTranslationTest {
+
+ {
+ inputFilesPath = "/mock/heat/parameters/inputs";
+ outputFilesPath = "/mock/heat/parameters/expectedoutputfiles";
+ }
+
+ @Test
+ public void testTranslate() throws Exception {
+ testTranslation();
+ }
+
+
+ /*
+
+ private static final String MANIFEST_NAME = "MANIFEST.json";
+
+ @Test
+ public void testTranslate_parameters() throws IOException {
+
+
+
+ HeatToToscaTranslator heatToToscaTranslator = HeatToToscaTranslatorFactory.getInstance().createInterface();
+ URL url = this.getClass().getResource("/mock/heat/parameters");
+ File manifestFile = new File(url.getPath());
+ File[] files = manifestFile.listFiles();
+ FileInputStream fis;
+ byte[] fileContent;
+ for (File file : files) {
+ fis = new FileInputStream(file);
+ fileContent = FileUtils.toByteArray(fis);
+ if (file.getName().equals(MANIFEST_NAME)) {
+ heatToToscaTranslator.addManifest(MANIFEST_NAME, new String(fileContent));
+ } else {
+ heatToToscaTranslator.addFile(file.getName(), fileContent);
+ }
+ }
+
+ TranslatorOutput translatorOutput = heatToToscaTranslator.translate();
+ Assert.assertNotNull(translatorOutput);
+ File file = new File("Parameters.zip");
+ FileOutputStream fos = new FileOutputStream(file);
+ fos.write(translatorOutput.getTranslationContent());
+ fos.close();
+
+ }
+ */
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/resources/ContrailNetworkRuleTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/resources/ContrailNetworkRuleTest.java
new file mode 100644
index 0000000000..f8b3022155
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/resources/ContrailNetworkRuleTest.java
@@ -0,0 +1,18 @@
+package org.openecomp.sdc.translator.impl.heattotosca.resources;
+
+import org.openecomp.sdc.translator.services.heattotosca.impl.BaseResourceTranslationTest;
+import org.junit.Test;
+
+
+public class ContrailNetworkRuleTest extends BaseResourceTranslationTest {
+
+ {
+ inputFilesPath = "/mock/heat/resources/OS_Contrail_Network_Rule/inputs";
+ outputFilesPath = "/mock/heat/resources/OS_Contrail_Network_Rule/expectedoutputfiles";
+ }
+
+ @Test
+ public void testTranslate() throws Exception {
+ testTranslation();
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/resources/OSContrailVirtualNetworkTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/resources/OSContrailVirtualNetworkTest.java
new file mode 100644
index 0000000000..b1305c3b2c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/resources/OSContrailVirtualNetworkTest.java
@@ -0,0 +1,18 @@
+package org.openecomp.sdc.translator.impl.heattotosca.resources;
+
+import org.openecomp.sdc.translator.services.heattotosca.impl.BaseResourceTranslationTest;
+import org.junit.Test;
+
+
+public class OSContrailVirtualNetworkTest extends BaseResourceTranslationTest {
+
+ {
+ inputFilesPath = "/mock/heat/resources/OS_Contrail_VirtualNetwork/inputs";
+ outputFilesPath = "/mock/heat/resources/OS_Contrail_VirtualNetwork/expectedoutputfiles";
+ }
+
+ @Test
+ public void testTranslate() throws Exception {
+ testTranslation();
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/resources/OSNeutronNetTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/resources/OSNeutronNetTest.java
new file mode 100644
index 0000000000..3b312a804d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/resources/OSNeutronNetTest.java
@@ -0,0 +1,17 @@
+package org.openecomp.sdc.translator.impl.heattotosca.resources;
+
+import org.openecomp.sdc.translator.services.heattotosca.impl.BaseResourceTranslationTest;
+import org.junit.Test;
+
+public class OSNeutronNetTest extends BaseResourceTranslationTest {
+
+ {
+ inputFilesPath = "/mock/heat/resources/OS_Neutron_Net/inputs";
+ outputFilesPath = "/mock/heat/resources/OS_Neutron_Net/expectedoutputfiles";
+ }
+
+ @Test
+ public void testTranslate() throws Exception {
+ testTranslation();
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/resources/OSNovaServerTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/resources/OSNovaServerTest.java
new file mode 100644
index 0000000000..6d194ea220
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/resources/OSNovaServerTest.java
@@ -0,0 +1,17 @@
+package org.openecomp.sdc.translator.impl.heattotosca.resources;
+
+import org.openecomp.sdc.translator.services.heattotosca.impl.BaseResourceTranslationTest;
+import org.junit.Test;
+
+public class OSNovaServerTest extends BaseResourceTranslationTest {
+
+ {
+ inputFilesPath = "/mock/heat/resources/OS_Nova_Server/inputs";
+ outputFilesPath = "/mock/heat/resources/OS_Nova_Server/expectedoutputfiles";
+ }
+
+ @Test
+ public void testTranslate() throws Exception {
+ testTranslation();
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/sharedresource/HeatSharedResourceTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/sharedresource/HeatSharedResourceTest.java
new file mode 100644
index 0000000000..2395fa00db
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/sharedresource/HeatSharedResourceTest.java
@@ -0,0 +1,19 @@
+package org.openecomp.sdc.translator.impl.heattotosca.sharedresource;
+
+import org.openecomp.sdc.translator.services.heattotosca.impl.BaseResourceTranslationTest;
+import org.junit.Test;
+
+public class HeatSharedResourceTest extends BaseResourceTranslationTest {
+
+ {
+ inputFilesPath = "/mock/heat/sharedresources/inputs";
+ outputFilesPath = "/mock/heat/sharedresources/expectedoutputfiles";
+ }
+
+ @Test
+ public void testTranslate() throws Exception {
+ testTranslation();
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/GlobalTypesGeneratorTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/GlobalTypesGeneratorTest.java
new file mode 100644
index 0000000000..6afa9c1ea2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/GlobalTypesGeneratorTest.java
@@ -0,0 +1,18 @@
+package org.openecomp.sdc.translator.services.heattotosca;
+
+import org.openecomp.sdc.translator.services.heattotosca.impl.BaseResourceTranslationTest;
+import org.junit.Test;
+
+public class GlobalTypesGeneratorTest extends BaseResourceTranslationTest {
+
+ {
+ inputFilesPath = "/mock/services/heattotosca/global_types/inputfiles";
+ outputFilesPath = "/mock/services/heattotosca/global_types/expectedoutputfiles";
+ }
+
+ @Test
+ public void testTranslate() throws Exception {
+ testTranslation();
+ }
+
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/fullvfexample/hotmog/HotMogTranslationTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/fullvfexample/hotmog/HotMogTranslationTest.java
new file mode 100644
index 0000000000..13be7235d9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/fullvfexample/hotmog/HotMogTranslationTest.java
@@ -0,0 +1,17 @@
+package org.openecomp.sdc.translator.services.heattotosca.fullvfexample.hotmog;
+
+import org.openecomp.sdc.translator.services.heattotosca.impl.BaseResourceTranslationTest;
+import org.junit.Test;
+
+public class HotMogTranslationTest extends BaseResourceTranslationTest {
+
+ {
+ inputFilesPath = "/mock/services/heattotosca/hot-mog-0108-bs1271/inputfiles";
+ outputFilesPath = "/mock/services/heattotosca/hot-mog-0108-bs1271/expectedoutputfiles";
+ }
+
+ @Test
+ public void testTranslate() throws Exception {
+ testTranslation();
+ }
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/fullvfexample/vmmesmall/VmmeSmallTranslationTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/fullvfexample/vmmesmall/VmmeSmallTranslationTest.java
new file mode 100644
index 0000000000..4db0bdf339
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/fullvfexample/vmmesmall/VmmeSmallTranslationTest.java
@@ -0,0 +1,17 @@
+package org.openecomp.sdc.translator.services.heattotosca.fullvfexample.vmmesmall;
+
+import org.openecomp.sdc.translator.services.heattotosca.impl.BaseResourceTranslationTest;
+import org.junit.Test;
+
+public class VmmeSmallTranslationTest extends BaseResourceTranslationTest {
+
+ {
+ inputFilesPath = "/mock/services/heattotosca/vmme_small/inputfiles";
+ outputFilesPath = "/mock/services/heattotosca/vmme_small/expectedoutputfiles";
+ }
+
+ @Test
+ public void testTranslate() throws Exception {
+ testTranslation();
+ }
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/helper/impl/NameExtractorServiceImplTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/helper/impl/NameExtractorServiceImplTest.java
new file mode 100644
index 0000000000..1fb1b023e0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/helper/impl/NameExtractorServiceImplTest.java
@@ -0,0 +1,118 @@
+package org.openecomp.sdc.translator.services.heattotosca.helper.impl;
+
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.translator.services.heattotosca.Constants;
+import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationNovaServerImpl;
+import org.junit.Test;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import static org.junit.Assert.assertTrue;
+
+/**
+ * @author Avrahamg
+ * @since August 04, 2016
+ */
+public class NameExtractorServiceImplTest {
+ @Test
+ public void shouldReturnNamePrefixIfPropertyNameMatchWithIndex() throws Exception {
+ Map<String, Object> propertiesMap = new HashMap();
+ propertiesMap.put("a", "sss");
+ HashMap imageMap = new HashMap();
+ String name = "avi_test_name_1";
+ imageMap.put("get_param", name);
+ propertiesMap.put(Constants.NAME_PROPERTY_NAME, imageMap);
+ ResourceTranslationNovaServerImpl resourceTranslationNovaServer =
+ new ResourceTranslationNovaServerImpl();
+ String localNodeType = resourceTranslationNovaServer
+ .createLocalNodeType(new ServiceTemplate(), propertiesMap, "Ignore");
+ assertTrue(localNodeType.equals("org.openecomp.resource.vfc.nodes.heat.avi_test"));
+ }
+
+ @Test
+ public void shouldReturnNamePrefixIfPropertyNameMatchWithListObjectInGetParamVal()
+ throws Exception {
+ Map<String, Object> propertiesMap = new HashMap();
+ propertiesMap.put("a", "sss");
+ HashMap imageMap = new HashMap();
+ List val = Arrays.asList("virc_vm_names", "2");
+ imageMap.put("get_param", val);
+ propertiesMap.put(Constants.NAME_PROPERTY_NAME, imageMap);
+ ResourceTranslationNovaServerImpl resourceTranslationNovaServer =
+ new ResourceTranslationNovaServerImpl();
+ String localNodeType = resourceTranslationNovaServer
+ .createLocalNodeType(new ServiceTemplate(), propertiesMap, "Ignore");
+ assertTrue(localNodeType.equals("org.openecomp.resource.vfc.nodes.heat.virc_vm"));
+ }
+
+ @Test
+ public void shouldReturnNamePrefixIfPropertyNameMatchWithListObjectInGetParamValAndGetParamAsGetParamVal()
+ throws Exception {
+ Map<String, Object> propertiesMap = new HashMap();
+ propertiesMap.put("a", "sss");
+ HashMap nameMap = new HashMap();
+ HashMap nameValMap = new HashMap();
+ nameValMap.put("get_param", "anyParam");
+ List val = Arrays.asList("virc_vm_names", nameValMap);
+ nameMap.put("get_param", val);
+ propertiesMap.put(Constants.NAME_PROPERTY_NAME, nameMap);
+ ResourceTranslationNovaServerImpl resourceTranslationNovaServer =
+ new ResourceTranslationNovaServerImpl();
+ String localNodeType = resourceTranslationNovaServer
+ .createLocalNodeType(new ServiceTemplate(), propertiesMap, "Ignore");
+ assertTrue(localNodeType.equals("org.openecomp.resource.vfc.nodes.heat.virc_vm"));
+ }
+
+
+ @Test
+ public void shouldReturnNamePrefixIfPropertyNameMatchWithoutIndex() throws Exception {
+ Map<String, Object> propertiesMap = new HashMap();
+ propertiesMap.put("a", "sss");
+ HashMap imageMap = new HashMap();
+ String name = "avi_test_names";
+ imageMap.put("get_param", name);
+ propertiesMap.put(Constants.NAME_PROPERTY_NAME, imageMap);
+ ResourceTranslationNovaServerImpl resourceTranslationNovaServer =
+ new ResourceTranslationNovaServerImpl();
+ String localNodeType = resourceTranslationNovaServer
+ .createLocalNodeType(new ServiceTemplate(), propertiesMap, "Ignore");
+ assertTrue(localNodeType.equals("org.openecomp.resource.vfc.nodes.heat.avi_test"));
+ }
+
+ @Test
+ public void shouldReturnPrefixByPropertyOrder() throws Exception {
+ Map<String, Object> propertiesMap = new HashMap();
+ propertiesMap.put("a", "sss");
+ HashMap imageMap = new HashMap();
+ String name = "avi_test1_namesw";
+ imageMap.put("get_param", name);
+ propertiesMap.put(Constants.NAME_PROPERTY_NAME, imageMap);
+ String flavor = "avi_test2_flavor_name";
+ imageMap = new HashMap();
+ imageMap.put("get_param", flavor);
+ propertiesMap.put("flavor", imageMap);
+ ResourceTranslationNovaServerImpl resourceTranslationNovaServer =
+ new ResourceTranslationNovaServerImpl();
+ String localNodeType = resourceTranslationNovaServer
+ .createLocalNodeType(new ServiceTemplate(), propertiesMap, "Ignore");
+ assertTrue(localNodeType.equals("org.openecomp.resource.vfc.nodes.heat.avi_test2"));
+ }
+
+ @Test
+ public void shouldReturnEmptyIfPropertiesAreNotAsNamingConvention() throws Exception {
+ Map<String, Object> propertiesMap = new HashMap();
+ propertiesMap.put("a", "sss");
+ HashMap imageMap = new HashMap();
+ String name = "avi_test_namesw";
+ imageMap.put("get_param", name);
+ propertiesMap.put(Constants.NAME_PROPERTY_NAME, imageMap);
+ ResourceTranslationNovaServerImpl resourceTranslationNovaServer =
+ new ResourceTranslationNovaServerImpl();
+ String localNodeType = resourceTranslationNovaServer
+ .createLocalNodeType(new ServiceTemplate(), propertiesMap, "this.is.test.resource");
+ assertTrue(localNodeType.equals("org.openecomp.resource.vfc.nodes.heat.this_is_test_resource"));
+ }
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/BaseResourceTranslationTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/BaseResourceTranslationTest.java
new file mode 100644
index 0000000000..9282d4e4eb
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/BaseResourceTranslationTest.java
@@ -0,0 +1,130 @@
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+import org.openecomp.sdc.tosca.services.ToscaFileOutputService;
+import org.openecomp.sdc.tosca.services.impl.ToscaFileOutputServiceCsarImpl;
+import org.openecomp.sdc.translator.TestUtils;
+import org.openecomp.core.translator.api.HeatToToscaTranslator;
+import org.openecomp.core.translator.datatypes.TranslatorOutput;
+import org.openecomp.core.translator.factory.HeatToToscaTranslatorFactory;
+import org.openecomp.core.utilities.file.FileUtils;
+import org.openecomp.core.validation.types.MessageContainerUtil;
+import org.apache.commons.collections4.MapUtils;
+import org.junit.Assert;
+import org.junit.Before;
+
+import java.io.*;
+import java.net.URL;
+import java.util.*;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+
+import static org.junit.Assert.assertEquals;
+
+public class BaseResourceTranslationTest {
+
+ protected String inputFilesPath;
+ protected String outputFilesPath;
+ private HeatToToscaTranslator heatToToscaTranslator;
+ private File translatedZipFile;
+
+ private Map<String, byte[]> expectedResultMap = new HashMap<>();
+ private Set<String> expectedResultFileNameSet = new HashSet<>();
+
+ @Before
+ public void setUp() throws IOException {
+ initTranslatorAndTranslate();
+ }
+
+ protected void initTranslatorAndTranslate() throws IOException {
+ heatToToscaTranslator = HeatToToscaTranslatorFactory.getInstance().createInterface();
+ translatedZipFile = translateZipFile();
+ }
+
+ protected void testTranslation() throws IOException {
+
+ URL url = BaseResourceTranslationTest.class.getResource(outputFilesPath);
+
+ String path = url.getPath();
+ File pathFile = new File(path);
+ File[] files = pathFile.listFiles();
+ Assert.assertNotNull("manifest files is empty", files);
+ for (File expectedFile : files) {
+ expectedResultFileNameSet.add(expectedFile.getName());
+ try (FileInputStream input = new FileInputStream(expectedFile)) {
+ expectedResultMap.put(expectedFile.getName(), FileUtils.toByteArray(input));
+ }
+ }
+
+ try (FileInputStream fis = new FileInputStream(translatedZipFile);
+ ZipInputStream zis = new ZipInputStream(new BufferedInputStream(fis))) {
+ ZipEntry entry;
+ String name;
+ String expected;
+ String actual;
+
+ while ((entry = zis.getNextEntry()) != null) {
+
+ name = entry.getName()
+ .substring(entry.getName().lastIndexOf(File.separator) + 1, entry.getName().length());
+ if (expectedResultFileNameSet.contains(name)) {
+ expected = new String(expectedResultMap.get(name)).trim().replace("\r", "");
+ actual = new String(FileUtils.toByteArray(zis)).trim().replace("\r", "");
+ assertEquals("difference in file: " + name, expected, actual);
+
+ expectedResultFileNameSet.remove(name);
+ }
+ }
+ if (expectedResultFileNameSet.isEmpty()) {
+ expectedResultFileNameSet.forEach(System.out::println);
+ }
+ }
+ assertEquals(0, expectedResultFileNameSet.size());
+ }
+
+ private File translateZipFile() throws IOException {
+ String zipFilename = "VSP.zip";
+ URL inputFilesUrl = this.getClass().getResource(inputFilesPath);
+ String path = inputFilesUrl.getPath();
+ TestUtils.addFilesToTranslator(heatToToscaTranslator, path);
+ TranslatorOutput translatorOutput = heatToToscaTranslator.translate();
+ Assert.assertNotNull(translatorOutput);
+ if (MapUtils.isNotEmpty(translatorOutput.getErrorMessages()) && MapUtils.isNotEmpty(
+ MessageContainerUtil
+ .getMessageByLevel(org.openecomp.sdc.datatypes.error.ErrorLevel.ERROR, translatorOutput.getErrorMessages()))) {
+ throw new CoreException((new ErrorCode.ErrorCodeBuilder()).withMessage(
+ "Error in validation " + getErrorAsString(translatorOutput.getErrorMessages()))
+ .withId("Validation Error").withCategory(ErrorCategory.APPLICATION).build());
+ }
+ File file = new File(path + "/" + zipFilename);
+ file.createNewFile();
+
+ try (FileOutputStream fos = new FileOutputStream(file)) {
+ ToscaFileOutputService toscaFileOutputService = new ToscaFileOutputServiceCsarImpl();
+ fos.write(
+ toscaFileOutputService.createOutputFile(translatorOutput.getToscaServiceModel(), null));
+ }
+
+ return file;
+ }
+
+ private String getErrorAsString(Map<String, List<org.openecomp.sdc.datatypes.error.ErrorMessage>> errorMessages) {
+ StringBuilder sb = new StringBuilder();
+ errorMessages.entrySet().forEach(
+ entry -> sb.append("File:").append(entry.getKey()).append(System.lineSeparator())
+ .append(getErrorList(entry.getValue())));
+
+ return sb.toString();
+ }
+
+ private String getErrorList(List<org.openecomp.sdc.datatypes.error.ErrorMessage> errors) {
+ StringBuilder sb = new StringBuilder();
+ errors.stream().forEach(
+ error -> sb.append(error.getMessage()).append("[").append(error.getLevel()).append("]")
+ .append(System.lineSeparator()));
+ return sb.toString();
+ }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ContrailV2VMInterfaceToNetResourceConnectionTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ContrailV2VMInterfaceToNetResourceConnectionTest.java
new file mode 100644
index 0000000000..1dce2c8d70
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ContrailV2VMInterfaceToNetResourceConnectionTest.java
@@ -0,0 +1,46 @@
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.IOException;
+
+/**
+ * @author Avrahamg
+ * @since August 10, 2016
+ */
+public class ContrailV2VMInterfaceToNetResourceConnectionTest extends BaseResourceTranslationTest {
+ @Override
+ @Before
+ public void setUp() throws IOException {
+ // do not delete this function. it prevents the superclass setup from running
+ }
+
+ @Test
+ public void testTranslateVMIToNetNestedConnection() throws Exception {
+ inputFilesPath = "/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/inputfiles";
+ outputFilesPath =
+ "/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+ @Test
+ public void testTranslateVMIToSharedNetNestedConnection() throws Exception {
+ inputFilesPath = "/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles";
+ outputFilesPath =
+ "/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+ @Test
+ public void testTranslateVMIToNetMultiConnection() throws Exception {
+ inputFilesPath = "/mock/services/heattotosca/VMInterfaceToNettworkConnection/multi/inputfiles";
+ outputFilesPath =
+ "/mock/services/heattotosca/VMInterfaceToNettworkConnection/multi/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/DependsOnResourceBaseTranslationlTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/DependsOnResourceBaseTranslationlTest.java
new file mode 100644
index 0000000000..2ba2d936e8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/DependsOnResourceBaseTranslationlTest.java
@@ -0,0 +1,15 @@
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.junit.Test;
+
+public class DependsOnResourceBaseTranslationlTest extends BaseResourceTranslationTest {
+ public DependsOnResourceBaseTranslationlTest() {
+ inputFilesPath = "/mock/services/heattotosca/baseResourceTranslation/inputfiles";
+ outputFilesPath = "/mock/services/heattotosca/baseResourceTranslation/expectedoutputfiles";
+ }
+
+ @Test
+ public void testTranslate() throws Exception {
+ testTranslation();
+ }
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/MultipleHeatTranslationTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/MultipleHeatTranslationTest.java
new file mode 100644
index 0000000000..caec80c11b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/MultipleHeatTranslationTest.java
@@ -0,0 +1,31 @@
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.IOException;
+
+public class MultipleHeatTranslationTest extends BaseResourceTranslationTest {
+
+ @Override
+ @Before
+ public void setUp() throws IOException {
+ // do not delete this function. it prevents the superclass setup from running
+ }
+
+ @Test
+ public void testTranslateBaseHeats() throws Exception {
+ inputFilesPath = "/mock/multiHeat/allHeatsAreBase/inputs";
+ outputFilesPath = "/mock/multiHeat/allHeatsAreBase/expectedOutput/";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+ @Test
+ public void testTranslateOneOutOfFourFilesIsNotBase() throws Exception {
+ inputFilesPath = "/mock/multiHeat/referencedHeatResources/inputs";
+ outputFilesPath = "/mock/multiHeat/referencedHeatResources/expectedOutput/";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/NovaToVolResourceConnectionTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/NovaToVolResourceConnectionTest.java
new file mode 100644
index 0000000000..93a8668a2f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/NovaToVolResourceConnectionTest.java
@@ -0,0 +1,91 @@
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.IOException;
+
+/**
+ * @author avrahamg
+ * @since July 26, 2016
+ */
+public class NovaToVolResourceConnectionTest extends BaseResourceTranslationTest {
+ @Override
+ @Before
+ public void setUp() throws IOException {
+ // do not delete this function. it prevents the superclass setup from running
+ }
+
+ @Test
+ public void testNovaToVolumeConnectionMultiConnection() throws Exception {
+ inputFilesPath = "/mock/services/heattotosca/novatovolumeconnection/multiconnection/inputfiles";
+ outputFilesPath =
+ "/mock/services/heattotosca/novatovolumeconnection/multiconnection/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+ @Test
+ public void testNovaToVolumeConnectionMultiNotCreatedIfVolPorpertyInVolAttacheIsNotAReferenceToVolume()
+ throws Exception {
+ inputFilesPath =
+ "/mock/services/heattotosca/novatovolumeconnection/multinotconnected/inputfiles";
+ outputFilesPath =
+ "/mock/services/heattotosca/novatovolumeconnection/multinotconnected/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+ @Test
+ public void testNovaToVolumeConnectionNestedNotCreatedIfVolPorpertyInVolAttacheIsNotAReferenceToVolume()
+ throws Exception {
+ inputFilesPath =
+ "/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/inputfiles";
+ outputFilesPath =
+ "/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+ @Test
+ public void testTranslateNovaToVolumeNestedConnection() throws Exception {
+ inputFilesPath =
+ "/mock/services/heattotosca/novatovolumeconnection/nestedconnection/inputfiles";
+ outputFilesPath =
+ "/mock/services/heattotosca/novatovolumeconnection/nestedconnection/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+ @Test
+ public void testTranslateNovaToVolumeSharedNestedConnection() throws Exception {
+ inputFilesPath =
+ "/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/inputfiles";
+ outputFilesPath =
+ "/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+ @Test
+ public void testTranslateNovaToVolumeSharedNestedNotCreatedIfVolPorpertyInVolAttacheIsNotAReferenceToVolume()
+ throws Exception {
+ inputFilesPath =
+ "/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/inputfiles";
+ outputFilesPath =
+ "/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+ @Test
+ public void testTranslateNovaToVolumeInnerNestedConnection() throws Exception {
+ inputFilesPath =
+ "/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/inputfiles";
+ outputFilesPath =
+ "/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/PortToContrailV2VirtualNetworkResourceConnectionTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/PortToContrailV2VirtualNetworkResourceConnectionTest.java
new file mode 100644
index 0000000000..156008edb9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/PortToContrailV2VirtualNetworkResourceConnectionTest.java
@@ -0,0 +1,45 @@
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.IOException;
+
+public class PortToContrailV2VirtualNetworkResourceConnectionTest
+ extends BaseResourceTranslationTest {
+ @Override
+ @Before
+ public void setUp() throws IOException {
+ // do not delete this function. it prevents the superclass setup from running
+ }
+
+ @Test
+ public void testPortToNetNestedConnection() throws Exception {
+ inputFilesPath =
+ "/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/inputfiles";
+ outputFilesPath =
+ "/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+ @Test
+ public void testPortToSharedNetNestedConnection() throws Exception {
+ inputFilesPath =
+ "/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles";
+ outputFilesPath =
+ "/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+ @Test
+ public void testPortToNetMultiConnection() throws Exception {
+ inputFilesPath =
+ "/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/multi/inputfiles";
+ outputFilesPath =
+ "/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/multi/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/PortToNetResourceConnectionTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/PortToNetResourceConnectionTest.java
new file mode 100644
index 0000000000..6411d4759e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/PortToNetResourceConnectionTest.java
@@ -0,0 +1,38 @@
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.IOException;
+
+public class PortToNetResourceConnectionTest extends BaseResourceTranslationTest {
+ @Override
+ @Before
+ public void setUp() throws IOException {
+ // do not delete this function. it prevents the superclass setup from running
+ }
+
+ @Test
+ public void testTranslatePortToNetNestedConnection() throws Exception {
+ inputFilesPath = "/mock/services/heattotosca/porttonetconnection/nested/inputfiles";
+ outputFilesPath = "/mock/services/heattotosca/porttonetconnection/nested/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+ @Test
+ public void testTranslatePortToSharedNetNestedConnection() throws Exception {
+ inputFilesPath = "/mock/services/heattotosca/porttonetconnection/shared/inputfiles";
+ outputFilesPath = "/mock/services/heattotosca/porttonetconnection/shared/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+ @Test
+ public void testTranslatePortToNetMultiConnection() throws Exception {
+ inputFilesPath = "/mock/services/heattotosca/porttonetconnection/multi/inputfiles";
+ outputFilesPath = "/mock/services/heattotosca/porttonetconnection/multi/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationCinderVolumeAttachmentImplTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationCinderVolumeAttachmentImplTest.java
new file mode 100644
index 0000000000..54c06dd0d0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationCinderVolumeAttachmentImplTest.java
@@ -0,0 +1,52 @@
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.IOException;
+
+public class ResourceTranslationCinderVolumeAttachmentImplTest extends BaseResourceTranslationTest {
+
+ @Override
+ @Before
+ public void setUp() throws IOException {
+ // do not delete this function. it prevents the superclass setup from running
+ }
+
+ @Test
+ public void testTranslateAllResourcesInOneFile() throws Exception {
+ inputFilesPath = "/mock/services/heattotosca/vol_att/volume_and_attach_one_file/inputfiles";
+ outputFilesPath =
+ "/mock/services/heattotosca/vol_att/volume_and_attach_one_file/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+ @Test
+ public void testVolFileIsNestedInMainHeatFile() throws Exception {
+ inputFilesPath =
+ "/mock/services/heattotosca/vol_att/volume_file_nested_in_main_file_in_manifest/inputfiles";
+ outputFilesPath =
+ "/mock/services/heattotosca/vol_att/volume_file_nested_in_main_file_in_manifest/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+ @Test
+ public void testVolFileAsDataOfNested() throws Exception {
+ inputFilesPath = "/mock/services/heattotosca/vol_att/nested_with_inner_vol/inputfiles";
+ outputFilesPath = "/mock/services/heattotosca/vol_att/nested_with_inner_vol/out";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+ @Test
+ public void testVolFileIsParallelToMainHeatFile() throws Exception {
+ inputFilesPath =
+ "/mock/services/heattotosca/vol_att/volume_file_parallel_to_main_file/inputfiles";
+ outputFilesPath =
+ "/mock/services/heattotosca/vol_att/volume_file_parallel_to_main_file/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationCinderVolumeImplTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationCinderVolumeImplTest.java
new file mode 100644
index 0000000000..30ccbdd53d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationCinderVolumeImplTest.java
@@ -0,0 +1,15 @@
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.junit.Test;
+
+public class ResourceTranslationCinderVolumeImplTest extends BaseResourceTranslationTest {
+ public ResourceTranslationCinderVolumeImplTest() {
+ inputFilesPath = "/mock/services/heattotosca/cinder_volume_translation/inputfiles";
+ outputFilesPath = "/mock/services/heattotosca/cinder_volume_translation/expectedoutputfiles";
+ }
+
+ @Test
+ public void testTranslate() throws Exception {
+ testTranslation();
+ }
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailServiceInstanceImplTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailServiceInstanceImplTest.java
new file mode 100644
index 0000000000..40f5eb1200
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailServiceInstanceImplTest.java
@@ -0,0 +1,72 @@
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.IOException;
+
+/**
+ * @author shiria
+ * @since August 07, 2016.
+ */
+public class ResourceTranslationContrailServiceInstanceImplTest
+ extends BaseResourceTranslationTest {
+
+ @Override
+ @Before
+ public void setUp() throws IOException {
+ // do not delete this function. it prevents the superclass setup from running
+ }
+
+ @Test
+ public void testTranslateOneServiceInstance() throws Exception {
+ inputFilesPath =
+ "/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/inputfiles";
+ outputFilesPath =
+ "/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+ @Test
+ public void testTranslateDiffServiceTemplate() throws Exception {
+ inputFilesPath =
+ "/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/inputfiles";
+ outputFilesPath =
+ "/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+ @Test
+ public void testTranslateSharedNetworkMulti() throws Exception {
+ inputFilesPath =
+ "/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/inputfiles";
+ outputFilesPath =
+ "/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+ @Test
+ public void testTranslateSameServiceTemplate() throws Exception {
+ inputFilesPath =
+ "/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/inputfiles";
+ outputFilesPath =
+ "/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+
+ /*
+ //TODO -- need to be tested once the 2 level nested For shared resources bug will be fixed - ATTASDC-1065
+ @Test
+ public void testTranslateSharedNetworkNested() throws Exception {
+ inputFilesPath = "/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/inputfiles";
+ outputFilesPath = "/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+ */
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailServiceTemplateImplTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailServiceTemplateImplTest.java
new file mode 100644
index 0000000000..42b6db0e71
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailServiceTemplateImplTest.java
@@ -0,0 +1,55 @@
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.openecomp.sdc.heat.datatypes.model.Resource;
+import org.openecomp.sdc.translator.services.heattotosca.helper.ContrailTranslationHelper;
+import org.junit.Assert;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author shiria
+ * @since August 09, 2016.
+ */
+public class ResourceTranslationContrailServiceTemplateImplTest {
+
+ @Rule
+ public ExpectedException thrown = ExpectedException.none();
+
+ @Test
+ public void testStaticGetComputeNodeTypeId() throws Exception {
+ Resource serviceTemplate = new Resource();
+ serviceTemplate.setProperties(new HashMap<>());
+ serviceTemplate.getProperties().put("image_name", "aaaa");
+ String computeNodeTypeId =
+ new ContrailTranslationHelper().getComputeNodeTypeId("123", serviceTemplate);
+ Assert.assertEquals("org.openecomp.resource.vfc.nodes.heat.compute_123", computeNodeTypeId);
+ }
+
+ @Test
+ public void testNamingConventionGetComputeNodeTypeId() throws Exception {
+ Resource serviceTemplate = new Resource();
+ serviceTemplate.setProperties(new HashMap<>());
+ Map image = new HashMap<>();
+ image.put("get_param", "bbb_image_name");
+ serviceTemplate.getProperties().put("image_name", image);
+ String computeNodeTypeId =
+ new ContrailTranslationHelper().getComputeNodeTypeId("123", serviceTemplate);
+ Assert.assertEquals(computeNodeTypeId, "org.openecomp.resource.vfc.nodes.heat.bbb");
+ }
+
+ @Test
+ public void testNoNamingConventionGetComputeNodeTypeId() throws Exception {
+ Resource serviceTemplate = new Resource();
+ serviceTemplate.setProperties(new HashMap<>());
+ Map image = new HashMap<>();
+ image.put("get_file", "bbb_image");
+ serviceTemplate.getProperties().put("image_name", image);
+ String computeNodeTypeId =
+ new ContrailTranslationHelper().getComputeNodeTypeId("123", serviceTemplate);
+ Assert.assertEquals(computeNodeTypeId, "org.openecomp.resource.vfc.nodes.heat.compute_123");
+ }
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailV2Test.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailV2Test.java
new file mode 100644
index 0000000000..e4e1ad9216
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailV2Test.java
@@ -0,0 +1,56 @@
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.IOException;
+
+public class ResourceTranslationContrailV2Test extends BaseResourceTranslationTest {
+
+ @Override
+ @Before
+ public void setUp() throws IOException {
+ // do not delete this function. it prevents the superclass setup from running
+ }
+
+ @Test
+ public void testTranslate() throws Exception {
+ inputFilesPath = "/mock/services/heattotosca/ContrailV2_translation/simple/inputfiles";
+ outputFilesPath =
+ "/mock/services/heattotosca/ContrailV2_translation/simple/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+ @Test
+ public void testMultiPolicySingleNetTranslate() throws Exception {
+ inputFilesPath =
+ "/mock/services/heattotosca/ContrailV2_translation/ContrailV2_MultiPolicy_single_net_translation/inputfiles";
+ outputFilesPath =
+ "/mock/services/heattotosca/ContrailV2_translation/ContrailV2_MultiPolicy_single_net_translation/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+ @Test
+ public void testMultiNetSinglePolicyTranslate() throws Exception {
+ inputFilesPath =
+ "/mock/services/heattotosca/ContrailV2_translation/ContrailV2_Multi_net_single_policy_translation/inputfiles";
+ outputFilesPath =
+ "/mock/services/heattotosca/ContrailV2_translation/ContrailV2_Multi_net_single_policy_translation/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+ @Test
+ public void testInvalidPolicyResourceTypeTranslate() throws Exception {
+ inputFilesPath =
+ "/mock/services/heattotosca/ContrailV2_translation/invalid_policy_resource_type/inputfiles";
+ outputFilesPath =
+ "/mock/services/heattotosca/ContrailV2_translation/invalid_policy_resource_type/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailV2VMInterfaceImplTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailV2VMInterfaceImplTest.java
new file mode 100644
index 0000000000..95757e7cf9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailV2VMInterfaceImplTest.java
@@ -0,0 +1,36 @@
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.IOException;
+
+/**
+ * @author Avrahamg
+ * @since August 10, 2016
+ */
+public class ResourceTranslationContrailV2VMInterfaceImplTest extends BaseResourceTranslationTest {
+
+ @Override
+ @Before
+ public void setUp() throws IOException {
+ // do not delete this function. it prevents the superclass setup from running
+ }
+
+ @Test
+ public void testTranslateVMIWithGetResource() throws Exception {
+ inputFilesPath = "/mock/services/heattotosca/contrailv2VMinterface/oneNet/inputfiles";
+ outputFilesPath = "/mock/services/heattotosca/contrailv2VMinterface/oneNet/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+ @Test
+ public void testTranslateVMIWithListOfNetworks() throws Exception {
+ inputFilesPath = "/mock/services/heattotosca/contrailv2VMinterface/listNet/inputfiles";
+ outputFilesPath =
+ "/mock/services/heattotosca/contrailv2VMinterface/listNet/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronPortImplTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronPortImplTest.java
new file mode 100644
index 0000000000..6e2c298346
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronPortImplTest.java
@@ -0,0 +1,17 @@
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.junit.Test;
+
+public class ResourceTranslationNeutronPortImplTest extends BaseResourceTranslationTest {
+
+ {
+ inputFilesPath = "/mock/services/heattotosca/neutron_port_translation/inputfiles";
+ outputFilesPath = "/mock/services/heattotosca/neutron_port_translation/expectedoutputfiles";
+ }
+
+ @Test
+ public void testTranslate() throws Exception {
+ testTranslation();
+ }
+
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronSecurityGroupImplTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronSecurityGroupImplTest.java
new file mode 100644
index 0000000000..1791f10b1c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronSecurityGroupImplTest.java
@@ -0,0 +1,19 @@
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.junit.Test;
+
+public class ResourceTranslationNeutronSecurityGroupImplTest extends BaseResourceTranslationTest {
+
+ {
+ inputFilesPath = "/mock/services/heattotosca/neutron_security_group_translation/inputfiles";
+ outputFilesPath =
+ "/mock/services/heattotosca/neutron_security_group_translation/expectedoutputfiles";
+ }
+
+ @Test
+ public void testTranslate() throws Exception {
+ testTranslation();
+ }
+
+
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNovaServerGroupsImplTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNovaServerGroupsImplTest.java
new file mode 100644
index 0000000000..aabee8f56f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNovaServerGroupsImplTest.java
@@ -0,0 +1,16 @@
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.junit.Test;
+
+public class ResourceTranslationNovaServerGroupsImplTest extends BaseResourceTranslationTest {
+ {
+ inputFilesPath = "/mock/services/heattotosca/novaservergroups/inputfiles";
+ outputFilesPath = "/mock/services/heattotosca/novaservergroups/expectedoutputfiles";
+ }
+
+ @Test
+ public void testTranslate() throws Exception {
+ testTranslation();
+ }
+
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationResourceGroupImplTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationResourceGroupImplTest.java
new file mode 100644
index 0000000000..de1b0bfe29
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationResourceGroupImplTest.java
@@ -0,0 +1,110 @@
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.openecomp.sdc.common.errors.CoreException;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.junit.runner.RunWith;
+import org.mockito.runners.MockitoJUnitRunner;
+
+import java.io.IOException;
+
+/**
+ * @author shiria
+ * @since July 21, 2016.
+ */
+@RunWith(MockitoJUnitRunner.class)
+public class ResourceTranslationResourceGroupImplTest extends BaseResourceTranslationTest {
+ @Rule
+ public ExpectedException thrown = ExpectedException.none();
+
+ @Override
+ @Before
+ public void setUp() throws IOException {
+ // do not delete this function. it prevents the superclass setup from running
+ }
+
+ @Test
+ public void testTranslateResourceGroup() throws Exception {
+ inputFilesPath = "/mock/heat/nested/resource_group/inputs";
+ outputFilesPath = "/mock/heat/nested/resource_group/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+ @Test
+ public void testTranslateMultiResourceGroup() throws Exception {
+ inputFilesPath = "/mock/heat/nested/multiple_resource_groups/inputs";
+ outputFilesPath = "/mock/heat/nested/multiple_resource_groups/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+ @Test
+ public void testTranslateResourceGroupDynamicCount() throws Exception {
+ inputFilesPath = "/mock/heat/nested/resource_group_with_dynamic_count/inputs";
+ outputFilesPath = "/mock/heat/nested/resource_group_with_dynamic_count/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+
+ @Test
+ public void testTranslatePortToNetNestedByResourceGroupConnection() throws Exception {
+ inputFilesPath = "/mock/services/heattotosca/porttonetresourcegroupconnection/inputfiles";
+ outputFilesPath =
+ "/mock/services/heattotosca/porttonetresourcegroupconnection/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+ @Test
+ public void testTranslatePortToNetSharedConnection() throws Exception {
+ inputFilesPath = "/mock/services/heattotosca/porttosharednetresourcegrouplinking/inputfiles";
+ outputFilesPath =
+ "/mock/services/heattotosca/porttosharednetresourcegrouplinking/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+ @Test
+ public void testTranslateSecurityGroupToSharedPortConnection() throws Exception {
+ inputFilesPath =
+ "/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/inputfiles";
+ outputFilesPath =
+ "/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+ @Test
+ public void testTranslateResourceGroupIndexVar() throws Exception {
+ inputFilesPath = "/mock/heat/nested/resourceGroupIndexVar/inputs";
+ outputFilesPath = "/mock/heat/nested/resourceGroupIndexVar/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+ @Test
+ public void testTranslateResourceGroupInvalidIndexVar() throws Exception {
+ thrown.expect(CoreException.class);
+ thrown.expectMessage(
+ "'index_var' property has invalid value. Actual value is '{get_param=index_parameter}' while 'String' value expected.");
+
+ inputFilesPath = "/mock/heat/nested/resourceGroupInvalid/inputs";
+ outputFilesPath = "/mock/heat/nested/resourceGroupInvalid/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+ @Test
+ public void testTranslateMDNS() throws Exception {
+ inputFilesPath = "/mock/heat/nested/resourceGroupMDNS/inputs";
+ outputFilesPath = "/mock/heat/nested/resourceGroupMDNS/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/SecurityGroupToNovaResourceConnectionTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/SecurityGroupToNovaResourceConnectionTest.java
new file mode 100644
index 0000000000..ce55800d3a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/SecurityGroupToNovaResourceConnectionTest.java
@@ -0,0 +1,24 @@
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.IOException;
+
+public class SecurityGroupToNovaResourceConnectionTest extends BaseResourceTranslationTest {
+ @Override
+ @Before
+ public void setUp() throws IOException {
+ // do not delete this function. it prevents the superclass setup from running
+ }
+
+ @Test
+ public void testSecurityGroupToPortConnectionMultiConnection() throws Exception {
+ inputFilesPath = "/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles";
+ outputFilesPath =
+ "/mock/services/heattotosca/securitygrouptonovaconnectionmulti/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/SecurityRulesToPortResourceConnectionTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/SecurityRulesToPortResourceConnectionTest.java
new file mode 100644
index 0000000000..a75e0133d9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/SecurityRulesToPortResourceConnectionTest.java
@@ -0,0 +1,55 @@
+package org.openecomp.sdc.translator.services.heattotosca.impl;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.IOException;
+
+public class SecurityRulesToPortResourceConnectionTest extends BaseResourceTranslationTest {
+ @Override
+ @Before
+ public void setUp() throws IOException {
+ // do not delete this function. it prevents the superclass setup from running
+ }
+
+ @Test
+ public void testTranslateSecurityRuleToPortNestedConnection() throws Exception {
+ inputFilesPath =
+ "/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/inputfiles";
+ outputFilesPath =
+ "/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+ @Test
+ public void testTranslateSecurityRuleToPortSharedPortNestedConnection() throws Exception {
+ inputFilesPath =
+ "/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/inputfiles";
+ outputFilesPath =
+ "/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+ @Test
+ public void testSecurityRuleToPortConnectionMultiConnection() throws Exception {
+ inputFilesPath =
+ "/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectionmulti/inputfiles";
+ outputFilesPath =
+ "/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectionmulti/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+ @Test
+ public void testSecurityRuleToPortConnectionNestedGetResource() throws Exception {
+ inputFilesPath =
+ "/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles";
+ outputFilesPath =
+ "/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/expectedoutputfiles";
+ initTranslatorAndTranslate();
+ testTranslation();
+ }
+
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaFunctionConverterTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaFunctionConverterTest.java
new file mode 100644
index 0000000000..7fccd6c080
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaFunctionConverterTest.java
@@ -0,0 +1,68 @@
+package org.openecomp.sdc.translator.services.heattotosca.mapping;
+
+import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
+import org.openecomp.sdc.tosca.services.ToscaConstants;
+import org.openecomp.sdc.tosca.services.ToscaFileOutputService;
+import org.openecomp.sdc.tosca.services.impl.ToscaFileOutputServiceCsarImpl;
+import org.openecomp.sdc.translator.services.heattotosca.TranslationContext;
+import org.openecomp.core.utilities.file.FileUtils;
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.util.HashMap;
+import java.util.List;
+
+public class TranslatorHeatToToscaFunctionConverterTest {
+
+ @Test
+ public void testGetFileWithExtensionFunction() {
+ String functionName = "get_file";
+ Object function = "scripFileName.sh";
+ String heatFileName = "heatFileName";
+ HeatOrchestrationTemplate heatOrchestrationTemplate = new HeatOrchestrationTemplate();
+ NodeTemplate nodeTemplate = new NodeTemplate();
+ TranslationContext context = new TranslationContext();
+
+ testGetToscaFunctionForGetFile(functionName, function, heatFileName, heatOrchestrationTemplate,
+ nodeTemplate, context);
+ }
+
+ @Test
+ public void testGetFileWithoutExtensionFunction() {
+ String functionName = "get_file";
+ Object function = "scripFileName";
+ String heatFileName = "heatFileName";
+ HeatOrchestrationTemplate heatOrchestrationTemplate = new HeatOrchestrationTemplate();
+ NodeTemplate nodeTemplate = new NodeTemplate();
+ TranslationContext context = new TranslationContext();
+
+ //# route_targets: { "Fn::Split" : [ ",", Ref: route_targets ] }
+ testGetToscaFunctionForGetFile(functionName, function, heatFileName, heatOrchestrationTemplate,
+ nodeTemplate, context);
+ }
+
+ private void testGetToscaFunctionForGetFile(String functionName, Object function,
+ String heatFileName,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ NodeTemplate nodeTemplate,
+ TranslationContext context) {
+ Object result = TranslatorHeatToToscaFunctionConverter
+ .getToscaFunction(functionName, function, heatFileName, heatOrchestrationTemplate,
+ nodeTemplate, context);
+ Assert.assertNotNull(((HashMap) result).get("get_artifact"));
+ List artifactParameters = (List) ((HashMap) result).get("get_artifact");
+ Assert.assertNotNull(artifactParameters);
+ Assert.assertEquals(artifactParameters.size(), 2);
+ Assert.assertEquals(artifactParameters.get(0), ToscaConstants.MODELABLE_ENTITY_NAME_SELF);
+ Assert.assertEquals(artifactParameters.get(1), ((String) function).split("\\.")[0]);
+
+ Assert.assertNotNull(nodeTemplate.getArtifacts());
+ Assert.assertNotNull(
+ nodeTemplate.getArtifacts().get(FileUtils.getFileWithoutExtention((String) function)));
+ ToscaFileOutputService toscaFileOutputService = new ToscaFileOutputServiceCsarImpl();
+ Assert.assertEquals(
+ nodeTemplate.getArtifacts().get(FileUtils.getFileWithoutExtention((String) function))
+ .getFile(), "../" + toscaFileOutputService.getArtifactsFolderName() + "/" + function);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/ep-jsa-si.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/ep-jsa-si.env
new file mode 100644
index 0000000000..d1d7d9625f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/ep-jsa-si.env
@@ -0,0 +1,14 @@
+parameters:
+ service_instance_name: ZRDM1LOGS01JSA
+ st_name: JSA-EP-Template
+ st_mode: in-network
+ st_type: firewall
+ st_image: MNS_JSA_2014R5.1-LATEST
+ st_flavor: lc.3xlarge
+ st_service_interface_type_list: management,left
+ st_shared_ip_list: False,True
+ st_static_routes_list: True,True
+ st_scaling: "True"
+ max_num_fw_instances: 24
+ mgmt_net: 'default-domain:MNS-25180-L-01Shared:oam_direct_net_0'
+ jsa_net: 'default-domain:MNS-25180-L-01Shared:jsa_log_net_0' \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/ep-jsa-si.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/ep-jsa-si.yaml
new file mode 100644
index 0000000000..d9f9e5b944
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/ep-jsa-si.yaml
@@ -0,0 +1,76 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ mgmt_net:
+ type: string
+ description: network name of OAM network
+ jsa_net:
+ type: string
+ description: network name of jsa log network
+ st_name:
+ type: string
+ description: service template name or ID
+ st_type:
+ type: string
+ description: service type
+ st_image:
+ type: string
+ description: Name of the image
+ st_flavor:
+ type: string
+ description: Flavor
+ st_service_interface_type_list:
+ type: string
+ description: List of interface types
+ st_shared_ip_list:
+ type: string
+ description: List of shared ip enabled-disabled
+ st_static_routes_list:
+ type: string
+ description: List of static routes enabled-disabled
+ st_scaling:
+ type: string
+ description: Indicates whether service scaling is enabled
+ st_mode:
+ type: string
+ description: service mode
+ max_num_fw_instances:
+ type: number
+ description: maximum number of firewall instances for scaling
+ service_instance_name:
+ type: string
+ description: service instance name
+
+resources:
+ service_template:
+ type: OS::Contrail::ServiceTemplate
+ properties:
+ name: { get_param: st_name }
+ service_mode: { get_param: st_mode }
+ service_type: { get_param: st_type }
+ image_name: { get_param: st_image }
+ flavor: { get_param: st_flavor }
+ service_interface_type_list: { "Fn::Split" : [ ",", Ref: st_service_interface_type_list ] }
+ shared_ip_list: { "Fn::Split" : [ ",", Ref: st_shared_ip_list ] }
+ static_routes_list: { "Fn::Split" : [ ",", Ref: st_static_routes_list ]}
+ service_scaling: { get_param: st_scaling }
+
+ service_instance:
+ type: OS::Contrail::ServiceInstance
+ properties:
+ name: { get_param: service_instance_name }
+ service_template: { get_resource: service_template }
+ scale_out:
+ max_instances: { get_param: max_num_fw_instances }
+ interface_list: [
+ {
+ virtual_network: {get_param: mgmt_net}
+ },
+ {
+ virtual_network: {get_param: jsa_net}
+ },
+ ]
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/ep-jsa_net.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/ep-jsa_net.env
new file mode 100644
index 0000000000..9dd1cd441f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/ep-jsa_net.env
@@ -0,0 +1,4 @@
+parameters:
+ jsa_net_name: jsa_log_net_0
+ jsa_cidr: 107.243.7.128/26
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/ep-jsa_net.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/ep-jsa_net.yaml
new file mode 100644
index 0000000000..1f7aec90fa
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/ep-jsa_net.yaml
@@ -0,0 +1,26 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ jsa_net_name:
+ type: string
+ description: network name of jsa log network
+ jsa_cidr:
+ type: string
+ description: CIDR of jsa log network
+
+resources:
+ jsa_net:
+ type: OS::Neutron::Net
+ properties:
+ name: {get_param: jsa_net_name}
+ shared: True
+
+ jsa_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: {get_resource: jsa_net}
+ cidr: {get_param: jsa_cidr}
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/master-jsa.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/master-jsa.env
new file mode 100644
index 0000000000..9170b98627
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/master-jsa.env
@@ -0,0 +1,6 @@
+parameters:
+ oam_net_name: oam_direct_net_0
+ security_group_name: jsa_security_group
+ MASTER_names: ZRDM1LOGS01CSL001
+ MASTER_image_name: MNS_JSA_2014R5.1-LATEST
+ MASTER_flavor_name: lc.4xlarge4
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/master-jsa.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/master-jsa.yaml
new file mode 100644
index 0000000000..6c6f52a681
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/master-jsa.yaml
@@ -0,0 +1,57 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-11-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ oam_net_name:
+ type: string
+ description: network name of OAM network
+ security_group_name:
+ type: string
+ description: security group name of JSA
+ MASTER_names:
+ type: string
+ description: JSA MASTER instance name
+ MASTER_image_name:
+ type: string
+ description: JSA MASTER instance image name
+ MASTER_flavor_name:
+ type: string
+ description: the flavor name of JSA MASTER instance
+
+resources:
+ jsa_security_group:
+ type: OS::Neutron::SecurityGroup
+ properties:
+ description: ems security group
+ name: {get_param: security_group_name}
+ rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"},
+ {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"},
+ {"direction": egress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"}
+ ]
+
+
+ MASTER_instance:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: MASTER_names}
+ image: {get_param: MASTER_image_name}
+ flavor: {get_param: MASTER_flavor_name}
+ networks:
+ - port: {get_resource: MASTER_mgmt_port}
+
+ MASTER_mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ security_groups: [{get_resource: jsa_security_group}]
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..9e0e6efecd
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
@@ -0,0 +1,236 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: GlobalSubstitutionTypes
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1_2:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ pcm_flavor_name:
+ type: string
+ description: flavor name of PCRF CM instance
+ availabilityzone_name:
+ type: string
+ description: availabilityzone name
+ pcm_image_name:
+ type: string
+ description: PCRF CM image name
+ pcm_vol:
+ type: string
+ description: CPS Cluman Cinder Volume
+ security_group_name:
+ type: string
+ description: the name of security group
+ cps_net_ip:
+ type: string
+ description: CPS network ip
+ pcm_server_name:
+ type: string
+ description: PCRF CM server name
+ cps_net_name:
+ type: string
+ description: CPS network name
+ cps_net_mask:
+ type: string
+ description: CPS network mask
+ oam_net_ip:
+ type: string
+ oam_net_name:
+ type: string
+ description: OAM network name
+ attributes:
+ server_pcm_id:
+ type: string
+ description: the pcm nova service id
+ requirements:
+ - link_pcm_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - local_storage_server_pcm:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - link_pcm_port_0:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ capabilities:
+ endpoint_server_pcm:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_pcm:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_server_pcm:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_server_pcm:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_pcm:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_pcm_port_0:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_pcm_port_1:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ availabilityzone_name:
+ type: string
+ description: availabilityzone name
+ oam_net_gw:
+ type: string
+ description: CPS network gateway
+ pcm_image_name:
+ type: string
+ description: PCRF CM image name
+ security_group_name:
+ type: string
+ description: the name of security group
+ cps_net_ip:
+ type: string
+ description: CPS network ip
+ pcm_flavor_name:
+ type: string
+ description: flavor name of PCRF CM instance
+ pcm_vol:
+ type: string
+ description: CPS Cluman Cinder Volume
+ pcm_server_name:
+ type: string
+ description: PCRF CM server name
+ cps_net_name:
+ type: string
+ description: CPS network name
+ cps_net_mask:
+ type: string
+ description: CPS network mask
+ oam_net_ip:
+ type: string
+ description: OAM network ip
+ oam_net_mask:
+ type: string
+ description: CPS network mask
+ oam_net_name:
+ type: string
+ description: OAM network name
+ attributes:
+ server_pcm_id:
+ type: string
+ description: the pcm nova service id
+ requirements:
+ - link_pcm_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - local_storage_server_pcm:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - link_pcm_port_0:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ capabilities:
+ endpoint_server_pcm:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_pcm:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_server_pcm:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_server_pcm:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_pcm:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_pcm_port_0:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_pcm_port_1:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..a0063b174e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,240 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ oam_net_ips:
+ label: OAM network ips
+ hidden: false
+ immutable: false
+ type: list
+ description: OAM network ips
+ entry_schema:
+ type: string
+ availabilityzone_name:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ oam_net_gw:
+ label: CPS network gateway
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network gateway
+ pcm_server_names:
+ label: PCRF CM server names
+ hidden: false
+ immutable: false
+ type: list
+ description: name of the PCRF CM instance
+ entry_schema:
+ type: string
+ pcm_image_name:
+ label: PCRF CM image name
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF CM image name
+ cps_net_ips:
+ label: CPS network ips
+ hidden: false
+ immutable: false
+ type: list
+ description: CPS network ips
+ entry_schema:
+ type: string
+ security_group_name:
+ label: security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of security group
+ pcm_volumes:
+ label: CPS Cluman Cinder Volume
+ hidden: false
+ immutable: false
+ type: list
+ description: CPS Cluman Cinder Volume
+ entry_schema:
+ type: string
+ pcm_flavor_name:
+ label: PCRF CM flavor name
+ hidden: false
+ immutable: false
+ type: string
+ description: flavor name of PCRF CM instance
+ cps_net_name:
+ label: CPS network name
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network name
+ cps_net_mask:
+ label: CPS network mask
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network mask
+ oam_net_mask:
+ label: CPS network mask
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network mask
+ oam_net_name:
+ label: OAM network name
+ hidden: false
+ immutable: false
+ type: string
+ description: OAM network name
+ node_templates:
+ server_pcm_002:
+ type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1
+ directives:
+ - substitutable
+ properties:
+ pcm_flavor_name:
+ get_input: pcm_flavor_name
+ service_template_filter:
+ substitute_service_template: nested-pcm_v0.1ServiceTemplate.yaml
+ availabilityzone_name:
+ get_input: availabilityzone_name
+ pcm_image_name:
+ get_input: pcm_image_name
+ pcm_vol:
+ get_input:
+ - pcm_volumes
+ - 0
+ security_group_name:
+ get_input: security_group_name
+ pcm_server_name:
+ get_input:
+ - pcm_server_names
+ - 0
+ server_pcm_001:
+ type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1
+ directives:
+ - substitutable
+ properties:
+ service_template_filter:
+ substitute_service_template: nested-pcm_v0.1ServiceTemplate.yaml
+ availabilityzone_name:
+ get_input: availabilityzone_name
+ oam_net_gw:
+ get_input: oam_net_gw
+ pcm_vol:
+ get_input:
+ - pcm_volumes
+ - 0
+ security_group_name:
+ get_input: security_group_name
+ cps_net_ip:
+ get_input:
+ - cps_net_ips
+ - 0
+ cps_net_name:
+ get_input: cps_net_name
+ cps_net_mask:
+ get_input: cps_net_mask
+ oam_net_ip:
+ get_input:
+ - oam_net_ips
+ - 0
+ oam_net_mask:
+ get_input: oam_net_mask
+ oam_net_name:
+ get_input: oam_net_name
+ server_pcm_004:
+ type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1_2
+ directives:
+ - substitutable
+ properties:
+ service_template_filter:
+ substitute_service_template: nested-pcm_v0.1_2ServiceTemplate.yaml
+ availabilityzone_name:
+ get_input: availabilityzone_name
+ pcm_vol:
+ get_input:
+ - pcm_volumes
+ - 0
+ security_group_name:
+ get_input: security_group_name
+ cps_net_ip:
+ get_input:
+ - cps_net_ips
+ - 0
+ cps_net_name:
+ get_input: cps_net_name
+ cps_net_mask:
+ get_input: cps_net_mask
+ server_pcm_003:
+ type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1
+ directives:
+ - substitutable
+ properties:
+ service_template_filter:
+ substitute_service_template: nested-pcm_v0.1ServiceTemplate.yaml
+ availabilityzone_name:
+ get_input: availabilityzone_name
+ pcm_vol:
+ get_input:
+ - pcm_volumes
+ - 0
+ security_group_name:
+ get_input: security_group_name
+ cps_net_ip:
+ get_input:
+ - cps_net_ips
+ - 0
+ cps_net_name:
+ get_input: cps_net_name
+ cps_net_mask:
+ get_input: cps_net_mask
+ groups:
+ hot-nimbus-pcm_v0.4_2:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/hot-nimbus-pcm_v0.4_2.yaml
+ description: heat template that creates PCRF Cluman stack
+ members:
+ - server_pcm_004
+ - server_pcm_003
+ hot-nimbus-pcm_v0.4:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/hot-nimbus-pcm_v0.4.yaml
+ description: heat template that creates PCRF Cluman stack
+ members:
+ - server_pcm_002
+ - server_pcm_001 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml
new file mode 100644
index 0000000000..1b03021742
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml
@@ -0,0 +1,207 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested-pcm_v0.1
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.pcm_server:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ availabilityzone_name:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ oam_net_gw:
+ label: CPS network gateway
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network gateway
+ pcm_image_name:
+ label: image name
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF CM image name
+ security_group_name:
+ label: security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of security group
+ cps_net_ip:
+ label: CPS network ip
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network ip
+ pcm_flavor_name:
+ label: PCRF CM flavor name
+ hidden: false
+ immutable: false
+ type: string
+ description: flavor name of PCRF CM instance
+ pcm_vol:
+ label: CPS Cluman Cinder Volume
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS Cluman Cinder Volume
+ pcm_server_name:
+ label: PCRF CM server name
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF CM server name
+ cps_net_name:
+ label: CPS network name
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network name
+ cps_net_mask:
+ label: CPS network mask
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network mask
+ oam_net_ip:
+ label: OAM network ip
+ hidden: false
+ immutable: false
+ type: string
+ description: OAM network ip
+ oam_net_mask:
+ label: CPS network mask
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network mask
+ oam_net_name:
+ label: OAM network name
+ hidden: false
+ immutable: false
+ type: string
+ description: OAM network name
+ node_templates:
+ pcm_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: oam_net_ip
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_pcm
+ relationship: tosca.relationships.network.BindsTo
+ server_pcm:
+ type: org.openecomp.resource.vfc.nodes.heat.pcm_server
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ pcm_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: cps_net_ip
+ network:
+ get_input: cps_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_pcm
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ nested-pcm_v0.1:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested-pcm_v0.1.yaml
+ description: heat template that creates PCRF Cluman stack
+ members:
+ - pcm_port_1
+ - server_pcm
+ - pcm_port_0
+ outputs:
+ server_pcm_id:
+ description: the pcm nova service id
+ value: server_pcm
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1
+ capabilities:
+ endpoint_server_pcm:
+ - server_pcm
+ - endpoint
+ os_server_pcm:
+ - server_pcm
+ - os
+ host_server_pcm:
+ - server_pcm
+ - host
+ scalable_server_pcm:
+ - server_pcm
+ - scalable
+ binding_server_pcm:
+ - server_pcm
+ - binding
+ attachment_pcm_port_0:
+ - pcm_port_0
+ - attachment
+ attachment_pcm_port_1:
+ - pcm_port_1
+ - attachment
+ requirements:
+ link_pcm_port_0:
+ - pcm_port_0
+ - link
+ link_pcm_port_1:
+ - pcm_port_1
+ - link
+ local_storage_server_pcm:
+ - server_pcm
+ - local_storage \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/expectedoutputfiles/nested-pcm_v0.1_2ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/expectedoutputfiles/nested-pcm_v0.1_2ServiceTemplate.yaml
new file mode 100644
index 0000000000..34d0c6d899
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/expectedoutputfiles/nested-pcm_v0.1_2ServiceTemplate.yaml
@@ -0,0 +1,193 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested-pcm_v0.1_2
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.pcm_server:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ pcm_flavor_name:
+ label: PCRF CM flavor name
+ hidden: false
+ immutable: false
+ type: string
+ description: flavor name of PCRF CM instance
+ availabilityzone_name:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ pcm_image_name:
+ label: image name
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF CM image name
+ pcm_vol:
+ label: CPS Cluman Cinder Volume
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS Cluman Cinder Volume
+ security_group_name:
+ label: security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of security group
+ cps_net_ip:
+ label: CPS network ip
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network ip
+ pcm_server_name:
+ label: PCRF CM server name
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF CM server name
+ cps_net_name:
+ label: CPS network name
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network name
+ cps_net_mask:
+ label: CPS network mask
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network mask
+ oam_net_ip:
+ hidden: false
+ immutable: false
+ type: string
+ oam_net_name:
+ label: OAM network name
+ hidden: false
+ immutable: false
+ type: string
+ description: OAM network name
+ node_templates:
+ pcm_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: oam_net_ip
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_pcm
+ relationship: tosca.relationships.network.BindsTo
+ server_pcm:
+ type: org.openecomp.resource.vfc.nodes.heat.pcm_server
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ pcm_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: cps_net_ip
+ network:
+ get_input: cps_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_pcm
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ nested-pcm_v0.1_2:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested-pcm_v0.1_2.yaml
+ description: heat template that creates PCRF Cluman stack
+ members:
+ - pcm_port_1
+ - server_pcm
+ - pcm_port_0
+ outputs:
+ server_pcm_id:
+ description: the pcm nova service id
+ value: server_pcm
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1_2
+ capabilities:
+ endpoint_server_pcm:
+ - server_pcm
+ - endpoint
+ os_server_pcm:
+ - server_pcm
+ - os
+ host_server_pcm:
+ - server_pcm
+ - host
+ scalable_server_pcm:
+ - server_pcm
+ - scalable
+ binding_server_pcm:
+ - server_pcm
+ - binding
+ attachment_pcm_port_0:
+ - pcm_port_0
+ - attachment
+ attachment_pcm_port_1:
+ - pcm_port_1
+ - attachment
+ requirements:
+ link_pcm_port_0:
+ - pcm_port_0
+ - link
+ link_pcm_port_1:
+ - pcm_port_1
+ - link
+ local_storage_server_pcm:
+ - server_pcm
+ - local_storage \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/MANIFEST.json
new file mode 100644
index 0000000000..b32b92ca11
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/MANIFEST.json
@@ -0,0 +1,30 @@
+{
+ "name": "vEP_JSA_Net",
+ "description": "Version 2.0 02-09-2016 (Authors: John Doe, user PROD)",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pcm_v0.4.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-pcm_v0.4.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },{
+ "file": "nested-pcm_v0.1.yaml",
+ "type": "HEAT"
+ },{
+ "file": "hot-nimbus-pcm_v0.4_2.yaml",
+ "type": "HEAT"
+ },{
+ "file": "nested-pcm_v0.1_2.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "nimbus-ethernet",
+ "type": "OTHER"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/hot-nimbus-pcm_v0.4.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/hot-nimbus-pcm_v0.4.env
new file mode 100644
index 0000000000..78cc03e2ea
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/hot-nimbus-pcm_v0.4.env
@@ -0,0 +1,14 @@
+parameters:
+ pcm_server_names: ZRDM1PCRF01PCM001
+ pcm_image_name: rhel2
+ pcm_flavor_name: cps
+ availabilityzone_name: nova
+ cps_net_name: int_pcrf_net_0
+ cps_net_ips: 172.26.16.113
+ cps_net_mask: 255.255.255.0
+ oam_net_name: oam_protected_net_0
+ oam_net_ips: 107.239.64.121
+ oam_net_gw: 107.239.64.1
+ oam_net_mask: 255.255.255.0
+ pcm_volumes: 249cb355-8fdf-4382-9c3c-a2ebe767d45b
+ security_group_name: nimbus_security_group
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/hot-nimbus-pcm_v0.4.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/hot-nimbus-pcm_v0.4.yaml
new file mode 100644
index 0000000000..f7d050790f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/hot-nimbus-pcm_v0.4.yaml
@@ -0,0 +1,82 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Cluman stack
+
+parameters:
+ pcm_server_names:
+ type: comma_delimited_list
+ label: PCRF CM server names
+ description: name of the PCRF CM instance
+ pcm_image_name:
+ type: string
+ label: PCRF CM image name
+ description: PCRF CM image name
+ pcm_flavor_name:
+ type: string
+ label: PCRF CM flavor name
+ description: flavor name of PCRF CM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ oam_net_name:
+ type: string
+ label: OAM network name
+ description: OAM network name
+ oam_net_ips:
+ type: comma_delimited_list
+ label: OAM network ips
+ description: OAM network ips
+ oam_net_gw:
+ type: string
+ label: CPS network gateway
+ description: CPS network gateway
+ oam_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcm_volumes:
+ type: comma_delimited_list
+ label: CPS Cluman Cinder Volume
+ description: CPS Cluman Cinder Volume
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+
+resources:
+ server_pcm_001:
+ type: nested-pcm_v0.1.yaml
+ properties:
+ availabilityzone_name: { get_param: availabilityzone_name }
+ security_group_name: { get_param: security_group_name }
+ pcm_vol: { get_param: [pcm_volumes, 0] }
+ cps_net_name: { get_param: cps_net_name }
+ cps_net_ip: { get_param: [cps_net_ips, 0] }
+ cps_net_mask: { get_param: cps_net_mask }
+ oam_net_name: { get_param: oam_net_name }
+ oam_net_ip: { get_param: [oam_net_ips, 0] }
+ oam_net_mask: { get_param: oam_net_mask }
+ oam_net_gw: { get_param: oam_net_gw }
+
+ server_pcm_002:
+ type: nested-pcm_v0.1.yaml
+ properties:
+ pcm_server_name: { get_param: [pcm_server_names, 0] }
+ pcm_image_name: { get_param: pcm_image_name }
+ pcm_flavor_name: { get_param: pcm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ security_group_name: { get_param: security_group_name }
+ pcm_vol: { get_param: [pcm_volumes, 0] }
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/hot-nimbus-pcm_v0.4_2.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/hot-nimbus-pcm_v0.4_2.yaml
new file mode 100644
index 0000000000..b59df84764
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/hot-nimbus-pcm_v0.4_2.yaml
@@ -0,0 +1,79 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Cluman stack
+
+parameters:
+ pcm_server_names:
+ type: comma_delimited_list
+ label: PCRF CM server names
+ description: name of the PCRF CM instance
+ pcm_image_name:
+ type: string
+ label: PCRF CM image name
+ description: PCRF CM image name
+ pcm_flavor_name:
+ type: string
+ label: PCRF CM flavor name
+ description: flavor name of PCRF CM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ oam_net_name:
+ type: string
+ label: OAM network name
+ description: OAM network name
+ oam_net_ips:
+ type: comma_delimited_list
+ label: OAM network ips
+ description: OAM network ips
+ oam_net_gw:
+ type: string
+ label: CPS network gateway
+ description: CPS network gateway
+ oam_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcm_volumes:
+ type: comma_delimited_list
+ label: CPS Cluman Cinder Volume
+ description: CPS Cluman Cinder Volume
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+
+resources:
+ server_pcm_003:
+ type: nested-pcm_v0.1.yaml
+ properties:
+ availabilityzone_name: { get_param: availabilityzone_name }
+ security_group_name: { get_param: security_group_name }
+ pcm_vol: { get_param: [pcm_volumes, 0] }
+ cps_net_name: { get_param: cps_net_name }
+ cps_net_ip: { get_param: [cps_net_ips, 0] }
+ cps_net_mask: { get_param: cps_net_mask }
+
+ server_pcm_004:
+ type: nested-pcm_v0.1_2.yaml
+ properties:
+ availabilityzone_name: { get_param: availabilityzone_name }
+ security_group_name: { get_param: security_group_name }
+ pcm_vol: { get_param: [pcm_volumes, 0] }
+ cps_net_name: { get_param: cps_net_name }
+ cps_net_ip: { get_param: [cps_net_ips, 0] }
+ cps_net_mask: { get_param: cps_net_mask }
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/nested-pcm_v0.1.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/nested-pcm_v0.1.yaml
new file mode 100644
index 0000000000..109bf86d24
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/nested-pcm_v0.1.yaml
@@ -0,0 +1,114 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Cluman stack
+
+parameters:
+ pcm_server_name:
+ type: string
+ label: PCRF CM server name
+ description: PCRF CM server name
+ pcm_image_name:
+ type: string
+ label: image name
+ description: PCRF CM image name
+ pcm_flavor_name:
+ type: string
+ label: PCRF CM flavor name
+ description: flavor name of PCRF CM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ oam_net_name:
+ type: string
+ label: OAM network name
+ description: OAM network name
+ oam_net_ip:
+ type: string
+ label: OAM network ip
+ description: OAM network ip
+ oam_net_gw:
+ type: string
+ label: CPS network gateway
+ description: CPS network gateway
+ oam_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcm_vol:
+ type: string
+ label: CPS Cluman Cinder Volume
+ description: CPS Cluman Cinder Volume
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+
+resources:
+ network:
+ type: net
+ script_init:
+ type: OS:INIT
+ server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ server_pcm:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcm_server_name }
+ image: { get_param: pcm_image_name }
+ flavor: { get_param: pcm_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: pcm_port_0}
+ - port: { get_resource: pcm_port_1}
+ block_device_mapping:
+ - device_name: vdb
+ volume_id: { get_param: pcm_vol}
+ user_data_format: RAW
+ user_data:
+ get_resource: server_init
+
+ pcm_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: cps_net_ip }
+ security_groups: [{ get_param: security_group_name }]
+
+ pcm_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips:
+ - ip_address: { get_param: oam_net_ip }
+ security_groups: [{ get_param: security_group_name }]
+
+ #pcm_vol_attachment:
+ # type: OS:: Cinder::VolumeAttachment
+ # properties:
+ # volume_id: { get_param: pcm_vol }
+ # mountpoint: /dev/vdb
+ # instance_uuid: { get_resource: server_pcm }
+outputs:
+ server_pcm_id:
+ description: the pcm nova service id
+ value: { get_resource: server_pcm } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/nested-pcm_v0.1_2.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/nested-pcm_v0.1_2.yaml
new file mode 100644
index 0000000000..3f117a8410
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/nested-pcm_v0.1_2.yaml
@@ -0,0 +1,120 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Cluman stack
+
+parameters:
+ pcm_server_name:
+ type: string
+ label: PCRF CM server name
+ description: PCRF CM server name
+ pcm_image_name:
+ type: string
+ label: image name
+ description: PCRF CM image name
+ pcm_flavor_name:
+ type: string
+ label: PCRF CM flavor name
+ description: flavor name of PCRF CM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcm_vol:
+ type: string
+ label: CPS Cluman Cinder Volume
+ description: CPS Cluman Cinder Volume
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ oam_net_name:
+ type: string
+ label: OAM network name
+ description: OAM network name
+ oam_net_ip:
+ type: string
+resources:
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: "file:///nimbus-ethernet" }
+ params:
+ $dev: eth0
+ $ip: { get_param: cps_net_ip }
+ $netmask: { get_param: cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+ - ifdown eth1 && ifup eth1
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ server_pcm:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcm_server_name }
+ image: { get_param: pcm_image_name }
+ flavor: { get_param: pcm_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: pcm_port_0}
+ - port: { get_resource: pcm_port_1}
+ block_device_mapping:
+ - device_name: vdb
+ volume_id: { get_param: pcm_vol}
+ user_data_format: RAW
+ user_data:
+ get_resource: server_init
+
+ pcm_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: cps_net_ip }
+ security_groups: [{ get_param: security_group_name }]
+
+ pcm_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips:
+ - ip_address: { get_param: oam_net_ip }
+ security_groups: [{ get_param: security_group_name }]
+
+ #pcm_vol_attachment:
+ # type: OS:: Cinder::VolumeAttachment
+ # properties:
+ # volume_id: { get_param: pcm_vol }
+ # mountpoint: /dev/vdb
+ # instance_uuid: { get_resource: server_pcm }
+outputs:
+ server_pcm_id:
+ description: the pcm nova service id
+ value: { get_resource: server_pcm } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/nimbus-ethernet b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/nimbus-ethernet
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/nimbus-ethernet
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..1b1c4dd621
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
@@ -0,0 +1,166 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: GlobalSubstitutionTypes
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.abstract.nodes.heat.mvs.nested.heat:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ vf_module_id:
+ type: string
+ description: Unique ID for this VF_MODULE instance
+ vf_name:
+ type: string
+ description: The VF Name; defaults to VMVM for the virtual MVM VNF.
+ constraints:
+ - pattern: '[a-zA-Z0-9]+'
+ - max_length: 4
+ - min_length: 4
+ cloud_zone_id:
+ type: string
+ description: The cloud zone for this VF instance
+ vf_instance_num:
+ type: string
+ description: The number for this VF instance
+ constraints:
+ - pattern: '[0-9]+'
+ - max_length: 2
+ - min_length: 2
+ virtual_mgmt_ip_0:
+ type: string
+ description: Virtual management network ip address
+ indx:
+ type: float
+ description: Index of the current instance
+ mvs_mgmt_ip_0:
+ type: list
+ description: List of Management network IP addresses for IPv4
+ entry_schema:
+ type: string
+ flavor:
+ type: string
+ description: Server flavor
+ constraints: [
+ ]
+ key_name:
+ type: string
+ description: SSH key name
+ constraints: [
+ ]
+ vnf_id:
+ type: string
+ description: Unique ID for this VF instance
+ availability_zone_0:
+ type: list
+ description: List of Availability Zone IDs or Names
+ entry_schema:
+ type: string
+ mgmt_net_id:
+ type: string
+ description: Neutron UUID for the Management network
+ constraints: [
+ ]
+ vm_instance_num:
+ type: list
+ description: VM instance number list must be a list of three-digit numeric value
+ entry_schema:
+ type: string
+ bootimage:
+ type: string
+ description: Master bootimage volume id
+ sec_groups:
+ type: list
+ description: Security groups
+ entry_schema:
+ type: string
+ vf_component:
+ type: string
+ description: The component that this VF instance is running
+ constraints:
+ - pattern: '[a-zA-Z0-9]+'
+ - max_length: 3
+ - min_length: 3
+ requirements:
+ - local_storage_vnfci:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - link_mgmt_port:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ capabilities:
+ os_vnfci:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_mgmt_port:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_vnfci:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_vnfci:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_vnfci:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_boot_volume:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_vnfci:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_data_volume:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..ffddcce43c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,240 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ vf_module_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique ID for this VF_MODULE instance
+ vf_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: The VF Name; defaults to VMVM for the virtual MVM VNF.
+ constraints:
+ - pattern: '[a-zA-Z0-9]+'
+ - max_length: 4
+ - min_length: 4
+ cloud_zone_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: The cloud zone for this VF instance
+ vf_instance_num:
+ hidden: false
+ immutable: false
+ type: string
+ description: The number for this VF instance
+ constraints:
+ - pattern: '[0-9]+'
+ - max_length: 2
+ - min_length: 2
+ virtual_mgmt_ip_0:
+ hidden: false
+ immutable: false
+ type: string
+ description: Virtual management network ip address
+ mvs_mgmt_ip_0:
+ hidden: false
+ immutable: false
+ type: list
+ description: List of Management network IP addresses for IPv4
+ entry_schema:
+ type: string
+ flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Server flavor
+ constraints: [
+ ]
+ key_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: SSH key name
+ constraints: [
+ ]
+ vnf_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique ID for this VF instance
+ availability_zone_0:
+ hidden: false
+ immutable: false
+ type: list
+ description: List of Availability Zone IDs or Names
+ entry_schema:
+ type: string
+ mgmt_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Neutron UUID for the Management network
+ constraints: [
+ ]
+ vm_instance_num:
+ hidden: false
+ immutable: false
+ type: list
+ description: VM instance number list must be a list of three-digit numeric value
+ entry_schema:
+ type: string
+ bootimage:
+ hidden: false
+ immutable: false
+ type: string
+ description: Master bootimage volume id
+ sec_groups:
+ hidden: false
+ immutable: false
+ type: list
+ description: Security groups
+ entry_schema:
+ type: string
+ vf_component:
+ hidden: false
+ immutable: false
+ type: string
+ description: The component that this VF instance is running
+ constraints:
+ - pattern: '[a-zA-Z0-9]+'
+ - max_length: 3
+ - min_length: 3
+ num_instances:
+ hidden: false
+ immutable: false
+ type: float
+ description: number of instance of the VF_module
+ node_templates:
+ mvs_modules:
+ type: org.openecomp.resource.abstract.nodes.heat.mvs.nested.heat
+ directives:
+ - substitutable
+ properties:
+ vf_module_id:
+ get_input: vf_module_id
+ vf_name:
+ get_input: vf_name
+ cloud_zone_id:
+ get_input: cloud_zone_id
+ vf_instance_num:
+ get_input: vf_instance_num
+ virtual_mgmt_ip_0:
+ get_input: virtual_mgmt_ip_0
+ indx:
+ get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ mvs_mgmt_ip_0:
+ get_input: mvs_mgmt_ip_0
+ flavor:
+ get_input: flavor
+ key_name:
+ get_input: key_name
+ service_template_filter:
+ substitute_service_template: mvs.nested.heatServiceTemplate.yaml
+ count:
+ get_input: num_instances
+ mandatory: false
+ vnf_id:
+ get_input: vnf_id
+ availability_zone_0:
+ get_input: availability_zone_0
+ mgmt_net_id:
+ get_input: mgmt_net_id
+ vm_instance_num:
+ get_input: vm_instance_num
+ bootimage:
+ get_input: bootimage
+ sec_groups:
+ get_input: sec_groups
+ vf_component:
+ get_input: vf_component
+ mvs_modules_same_nested_heat_file_no_count:
+ type: org.openecomp.resource.abstract.nodes.heat.mvs.nested.heat
+ directives:
+ - substitutable
+ properties:
+ vf_module_id:
+ get_input: vf_module_id
+ vf_name:
+ get_input: vf_name
+ cloud_zone_id:
+ get_input: cloud_zone_id
+ vf_instance_num:
+ get_input: vf_instance_num
+ virtual_mgmt_ip_0:
+ get_input: virtual_mgmt_ip_0
+ indx:
+ get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ mvs_mgmt_ip_0:
+ get_input: mvs_mgmt_ip_0
+ flavor:
+ get_input: flavor
+ key_name:
+ get_input: key_name
+ service_template_filter:
+ substitute_service_template: mvs.nested.heatServiceTemplate.yaml
+ count: 1
+ mandatory: true
+ vnf_id:
+ get_input: vnf_id
+ availability_zone_0:
+ get_input: availability_zone_0
+ mgmt_net_id:
+ get_input: mgmt_net_id
+ vm_instance_num:
+ get_input: vm_instance_num
+ bootimage:
+ get_input: bootimage
+ sec_groups:
+ get_input: sec_groups
+ vf_component:
+ get_input: vf_component
+ groups:
+ mvs.vfmodule.heat:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/mvs.vfmodule.heat.yaml
+ description: |
+ Metaswitch MVS (Metaview Server)
+ members:
+ - mvs_modules
+ - mvs_modules_same_nested_heat_file_no_count \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/expectedoutputfiles/mvs.nested.heatServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/expectedoutputfiles/mvs.nested.heatServiceTemplate.yaml
new file mode 100644
index 0000000000..315318d4f6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/expectedoutputfiles/mvs.nested.heatServiceTemplate.yaml
@@ -0,0 +1,320 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: mvs.nested.heat
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.vnfci:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ vf_module_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique ID for this VF_MODULE instance
+ vf_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: The VF Name; defaults to VMVM for the virtual MVM VNF.
+ constraints:
+ - pattern: '[a-zA-Z0-9]+'
+ - max_length: 4
+ - min_length: 4
+ cloud_zone_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: The cloud zone for this VF instance
+ vf_instance_num:
+ hidden: false
+ immutable: false
+ type: string
+ description: The number for this VF instance
+ constraints:
+ - pattern: '[0-9]+'
+ - max_length: 2
+ - min_length: 2
+ virtual_mgmt_ip_0:
+ hidden: false
+ immutable: false
+ type: string
+ description: Virtual management network ip address
+ indx:
+ hidden: false
+ immutable: false
+ type: float
+ description: Index of the current instance
+ mvs_mgmt_ip_0:
+ hidden: false
+ immutable: false
+ type: list
+ description: List of Management network IP addresses for IPv4
+ entry_schema:
+ type: string
+ flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Server flavor
+ constraints: [
+ ]
+ key_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: SSH key name
+ constraints: [
+ ]
+ vnf_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique ID for this VF instance
+ availability_zone_0:
+ hidden: false
+ immutable: false
+ type: list
+ description: List of Availability Zone IDs or Names
+ entry_schema:
+ type: string
+ mgmt_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Neutron UUID for the Management network
+ constraints: [
+ ]
+ vm_instance_num:
+ hidden: false
+ immutable: false
+ type: list
+ description: VM instance number list must be a list of three-digit numeric value
+ entry_schema:
+ type: string
+ bootimage:
+ hidden: false
+ immutable: false
+ type: string
+ description: Master bootimage volume id
+ sec_groups:
+ hidden: false
+ immutable: false
+ type: list
+ description: Security groups
+ entry_schema:
+ type: string
+ vf_component:
+ hidden: false
+ immutable: false
+ type: string
+ description: The component that this VF instance is running
+ constraints:
+ - pattern: '[a-zA-Z0-9]+'
+ - max_length: 3
+ - min_length: 3
+ node_templates:
+ boot_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ availability_zone:
+ Fn::Select:
+ - get_input: indx
+ - get_input:
+ - availability_zone_0
+ image:
+ get_input: bootimage
+ size: 35*1024
+ name:
+ str_replace:
+ template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM-boot-volume
+ params:
+ $VF_NAME:
+ get_input: vf_name
+ $CLOUD_ZONE_ID:
+ get_input: cloud_zone_id
+ $VM_INSTANCE_NUM:
+ Fn::Select:
+ - get_input: indx
+ - get_input:
+ - vm_instance_num
+ $VF_COMPONENT:
+ get_input: vf_component
+ $VF_INSTANCE_NUM:
+ get_input: vf_instance_num
+ vnfci:
+ type: org.openecomp.resource.vfc.nodes.heat.vnfci
+ properties:
+ flavor:
+ get_input: flavor
+ key_name:
+ get_input: key_name
+ availability_zone:
+ Fn::Select:
+ - get_input: indx
+ - get_input:
+ - availability_zone_0
+ name:
+ str_replace:
+ template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM
+ params:
+ $VF_NAME:
+ get_input: vf_name
+ $CLOUD_ZONE_ID:
+ get_input: cloud_zone_id
+ $VM_INSTANCE_NUM:
+ Fn::Select:
+ - get_input: indx
+ - get_input:
+ - vm_instance_num
+ $VF_COMPONENT:
+ get_input: vf_component
+ $VF_INSTANCE_NUM:
+ get_input: vf_instance_num
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: boot_volume
+ relationship: tosca.relationships.AttachesTo
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: data_volume
+ relationship: tosca.relationships.AttachesTo
+ data_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ availability_zone:
+ Fn::Select:
+ - get_input: indx
+ - get_input:
+ - availability_zone_0
+ size: 265*1024
+ name:
+ str_replace:
+ template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM-data-volume
+ params:
+ $VF_NAME:
+ get_input: vf_name
+ $CLOUD_ZONE_ID:
+ get_input: cloud_zone_id
+ $VM_INSTANCE_NUM:
+ Fn::Select:
+ - get_input: indx
+ - get_input:
+ - vm_instance_num
+ $VF_COMPONENT:
+ get_input: vf_component
+ $VF_INSTANCE_NUM:
+ get_input: vf_instance_num
+ mgmt_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: sec_groups
+ fixed_ips:
+ - ip_address:
+ Fn::Select:
+ - get_input: indx
+ - get_input:
+ - get_input: mvs_mgmt_ip_0
+ allowed_address_pairs:
+ - ip_address:
+ get_input: virtual_mgmt_ip_0
+ name:
+ str_replace:
+ template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM-mgmt-port
+ params:
+ $VF_NAME:
+ get_input: vf_name
+ $CLOUD_ZONE_ID:
+ get_input: cloud_zone_id
+ $VM_INSTANCE_NUM:
+ Fn::Select:
+ - get_input: indx
+ - get_input:
+ - vm_instance_num
+ $VF_COMPONENT:
+ get_input: vf_component
+ $VF_INSTANCE_NUM:
+ get_input: vf_instance_num
+ network:
+ get_input: mgmt_net_id
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: vnfci
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ mvs.nested.heat:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/mvs.nested.heat.yaml
+ description: |
+ Metaswitch MVS (Metaview Server)
+ members:
+ - boot_volume
+ - vnfci
+ - data_volume
+ - mgmt_port
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.mvs.nested.heat
+ capabilities:
+ os_vnfci:
+ - vnfci
+ - os
+ attachment_mgmt_port:
+ - mgmt_port
+ - attachment
+ endpoint_vnfci:
+ - vnfci
+ - endpoint
+ host_vnfci:
+ - vnfci
+ - host
+ binding_vnfci:
+ - vnfci
+ - binding
+ attachment_boot_volume:
+ - boot_volume
+ - attachment
+ scalable_vnfci:
+ - vnfci
+ - scalable
+ attachment_data_volume:
+ - data_volume
+ - attachment
+ requirements:
+ local_storage_vnfci:
+ - vnfci
+ - local_storage
+ link_mgmt_port:
+ - mgmt_port
+ - link \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/inputs/MANIFEST.json
new file mode 100644
index 0000000000..c7729c8653
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/inputs/MANIFEST.json
@@ -0,0 +1,19 @@
+{
+ "name": "mvs.vfmodule.heat.yaml",
+ "description": "Metaswitch MVS (Metaview Server)",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "mvs.vfmodule.heat.yaml",
+ "type": "HEAT",
+ "data": [
+ ]
+ },
+ {
+ "file": "mvs.nested.heat.yaml",
+ "type": "HEAT",
+ "data": [
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/inputs/mvs.nested.heat.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/inputs/mvs.nested.heat.yaml
new file mode 100644
index 0000000000..8ddc5c6488
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/inputs/mvs.nested.heat.yaml
@@ -0,0 +1,165 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Metaswitch MVS (Metaview Server)
+
+parameters:
+ cloud_zone_id:
+ type: string
+ description: The cloud zone for this VF instance
+ vf_name:
+ type: string
+ description: The VF Name; defaults to VMVM for the virtual MVM VNF.
+ constraints:
+ - allowed_pattern: "[a-zA-Z0-9]+"
+ - length: { min: 4, max: 4 }
+ description: Each VF will have a 4-character alphanumeric identifier
+ vf_instance_num:
+ type: string
+ description: The number for this VF instance
+ constraints:
+ - allowed_pattern: "[0-9]+"
+ - length: { min: 2, max: 2 }
+ description: VF instance number must be a two-digit numeric value
+ vf_component:
+ type: string
+ description: The component that this VF instance is running
+ constraints:
+ - allowed_pattern: "[a-zA-Z0-9]+"
+ - length: { min: 3, max: 3 }
+ description: Each VF component will have a 3-character alphanumeric identifier
+ vm_instance_num:
+ type: comma_delimited_list
+ description: VM instance number list must be a list of three-digit numeric value
+ vnf_id:
+ type: string
+ description: Unique ID for this VF instance
+ vf_module_id:
+ type: string
+ description: Unique ID for this VF_MODULE instance
+ bootimage:
+ type: string
+ description: Master bootimage volume id
+ flavor:
+ type: string
+ description: Server flavor
+ constraints:
+ - custom_constraint: nova.flavor
+ key_name:
+ type: string
+ description: SSH key name
+ constraints:
+ - custom_constraint: nova.keypair
+
+ availability_zone_0:
+ type: comma_delimited_list
+ description: List of Availability Zone IDs or Names
+
+ sec_groups:
+ type: comma_delimited_list
+ description: Security groups
+ mgmt_net_id:
+ type: string
+ description: Neutron UUID for the Management network
+ constraints:
+ - custom_constraint: neutron.network
+ virtual_mgmt_ip_0:
+ type: string
+ description: Virtual management network ip address
+
+ mvs_mgmt_ip_0:
+ type: comma_delimited_list
+ description: List of Management network IP addresses for IPv4
+
+ indx:
+ type: number
+ description: Index of the current instance
+
+resources:
+ mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ name:
+ str_replace:
+ template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM-mgmt-port
+ params:
+ $CLOUD_ZONE_ID: { get_param: cloud_zone_id }
+ $VF_NAME: { get_param: vf_name }
+ $VF_INSTANCE_NUM: { get_param: vf_instance_num }
+ $VF_COMPONENT: { get_param: vf_component }
+ $VM_INSTANCE_NUM: { "Fn::Select" : [ { get_param: indx }, { get_param: [vm_instance_num] } ] }
+ network_id: { get_param: mgmt_net_id }
+ security_groups: [{ get_param: sec_groups }]
+
+ fixed_ips:
+ - ip_address: { "Fn::Select" : [ { get_param: indx }, { get_param: [{ get_param: mvs_mgmt_ip_0 }] } ] }
+
+ allowed_address_pairs:
+ - ip_address: { get_param: virtual_mgmt_ip_0 }
+
+ boot_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: 35
+ name:
+ str_replace:
+ template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM-boot-volume
+ params:
+ $CLOUD_ZONE_ID: { get_param: cloud_zone_id }
+ $VF_NAME: { get_param: vf_name }
+ $VF_INSTANCE_NUM: { get_param: vf_instance_num }
+ $VF_COMPONENT: { get_param: vf_component }
+ $VM_INSTANCE_NUM: { "Fn::Select" : [ { get_param: indx }, { get_param: [vm_instance_num] } ] }
+
+ image: { get_param: bootimage }
+
+
+ availability_zone: { "Fn::Select" : [ { get_param: indx }, { get_param: [availability_zone_0] } ] }
+
+
+ data_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: 265
+ name:
+ str_replace:
+ template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM-data-volume
+ params:
+ $CLOUD_ZONE_ID: { get_param: cloud_zone_id }
+ $VF_NAME: { get_param: vf_name }
+ $VF_INSTANCE_NUM: { get_param: vf_instance_num }
+ $VF_COMPONENT: { get_param: vf_component }
+ $VM_INSTANCE_NUM: { "Fn::Select" : [ { get_param: indx }, { get_param: [vm_instance_num] } ] }
+
+ availability_zone: { "Fn::Select" : [ { get_param: indx }, { get_param: [availability_zone_0] } ] }
+
+
+ vnfci:
+ type: OS::Nova::Server
+ properties:
+ name:
+ str_replace:
+ template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM
+ params:
+ $CLOUD_ZONE_ID: { get_param: cloud_zone_id }
+ $VF_NAME: { get_param: vf_name }
+ $VF_INSTANCE_NUM: { get_param: vf_instance_num }
+ $VF_COMPONENT: { get_param: vf_component }
+ $VM_INSTANCE_NUM: { "Fn::Select" : [ { get_param: indx }, { get_param: [vm_instance_num] } ] }
+ block_device_mapping:
+ - device_name: vda
+ volume_id: { get_resource: boot_volume }
+ delete_on_termination: false
+ - device_name: vdb
+ volume_id: { get_resource: data_volume }
+ delete_on_termination: false
+ flavor: { get_param: flavor }
+ key_name: { get_param: key_name }
+ networks:
+ - port: { get_resource: mgmt_port }
+
+ availability_zone: { "Fn::Select" : [ { get_param: indx }, { get_param: [availability_zone_0] } ] }
+
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ vf_module_id: { get_param: vf_module_id }
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/inputs/mvs.vfmodule.heat.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/inputs/mvs.vfmodule.heat.yaml
new file mode 100644
index 0000000000..55c98053a4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/inputs/mvs.vfmodule.heat.yaml
@@ -0,0 +1,158 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Metaswitch MVS (Metaview Server)
+
+parameters:
+ cloud_zone_id:
+ type: string
+ description: The cloud zone for this VF instance
+ vf_name:
+ type: string
+ description: The VF Name; defaults to VMVM for the virtual MVM VNF.
+ constraints:
+ - allowed_pattern: "[a-zA-Z0-9]+"
+ - length: { min: 4, max: 4 }
+ description: Each VF will have a 4-character alphanumeric identifier
+ vf_instance_num:
+ type: string
+ description: The number for this VF instance
+ constraints:
+ - allowed_pattern: "[0-9]+"
+ - length: { min: 2, max: 2 }
+ description: VF instance number must be a two-digit numeric value
+ vf_component:
+ type: string
+ description: The component that this VF instance is running
+ constraints:
+ - allowed_pattern: "[a-zA-Z0-9]+"
+ - length: { min: 3, max: 3 }
+ description: Each VF component will have a 3-character alphanumeric identifier
+ vm_instance_num:
+ type: comma_delimited_list
+ description: VM instance number list must be a list of three-digit numeric value
+ vnf_id:
+ type: string
+ description: Unique ID for this VF instance
+ vf_module_id:
+ type: string
+ description: Unique ID for this VF_MODULE instance
+ bootimage:
+ type: string
+ description: Master bootimage volume id
+ flavor:
+ type: string
+ description: Server flavor
+ constraints:
+ - custom_constraint: nova.flavor
+ key_name:
+ type: string
+ description: SSH key name
+ constraints:
+ - custom_constraint: nova.keypair
+
+ availability_zone_0:
+ type: comma_delimited_list
+ description: List of Availability Zone IDs or Names
+
+ sec_groups:
+ type: comma_delimited_list
+ description: Security groups
+ mgmt_net_id:
+ type: string
+ description: Neutron UUID for the Management network
+ constraints:
+ - custom_constraint: neutron.network
+ virtual_mgmt_ip_0:
+ type: string
+ description: Virtual management network ip address
+
+ mvs_mgmt_ip_0:
+ type: comma_delimited_list
+ description: List of Management network IP addresses for IPv4
+
+ num_instances:
+ type: number
+ description: number of instance of the VF_module
+
+resources:
+ mvs_modules:
+ type: OS::Heat::ResourceGroup
+ properties:
+ count: { get_param: num_instances }
+ resource_def:
+ type: mvs.nested.heat.yaml
+ properties:
+ cloud_zone_id: { get_param: cloud_zone_id }
+ vf_name: { get_param: vf_name }
+ vf_instance_num: { get_param: vf_instance_num }
+ vf_component: { get_param: vf_component }
+ vm_instance_num: { get_param: vm_instance_num }
+ vnf_id: { get_param: vnf_id }
+ vf_module_id: { get_param: vf_module_id }
+ bootimage: { get_param: bootimage }
+ flavor: { get_param: flavor }
+ key_name: { get_param: key_name }
+
+ availability_zone_0: { get_param: availability_zone_0 }
+
+ sec_groups: { get_param: sec_groups }
+ mgmt_net_id: { get_param: mgmt_net_id }
+ virtual_mgmt_ip_0: { get_param: virtual_mgmt_ip_0 }
+
+ mvs_mgmt_ip_0: { get_param: mvs_mgmt_ip_0 }
+
+ indx: "%index%"
+ mvs_modules_same_nested_heat_file_no_count:
+ type: OS::Heat::ResourceGroup
+ properties:
+ resource_def:
+ type: mvs.nested.heat.yaml
+ properties:
+ cloud_zone_id: { get_param: cloud_zone_id }
+ vf_name: { get_param: vf_name }
+ vf_instance_num: { get_param: vf_instance_num }
+ vf_component: { get_param: vf_component }
+ vm_instance_num: { get_param: vm_instance_num }
+ vnf_id: { get_param: vnf_id }
+ vf_module_id: { get_param: vf_module_id }
+ bootimage: { get_param: bootimage }
+ flavor: { get_param: flavor }
+ key_name: { get_param: key_name }
+
+ availability_zone_0: { get_param: availability_zone_0 }
+
+ sec_groups: { get_param: sec_groups }
+ mgmt_net_id: { get_param: mgmt_net_id }
+ virtual_mgmt_ip_0: { get_param: virtual_mgmt_ip_0 }
+
+ mvs_mgmt_ip_0: { get_param: mvs_mgmt_ip_0 }
+
+ indx: "%index%"
+ shouldnt_get_translated:
+ type: OS::Heat::ResourceGroup
+ properties:
+ count: { get_param: num_instances }
+ resource_def:
+ type: OS::Nova::Server
+ properties:
+ cloud_zone_id: { get_param: cloud_zone_id }
+ vf_name: { get_param: vf_name }
+ vf_instance_num: { get_param: vf_instance_num }
+ vf_component: { get_param: vf_component }
+ vm_instance_num: { get_param: vm_instance_num }
+ vnf_id: { get_param: vnf_id }
+ vf_module_id: { get_param: vf_module_id }
+ bootimage: { get_param: bootimage }
+ flavor: { get_param: flavor }
+ key_name: { get_param: key_name }
+
+ availability_zone_0: { get_param: availability_zone_0 }
+
+ sec_groups: { get_param: sec_groups }
+ mgmt_net_id: { get_param: mgmt_net_id }
+ virtual_mgmt_ip_0: { get_param: virtual_mgmt_ip_0 }
+
+ mvs_mgmt_ip_0: { get_param: mvs_mgmt_ip_0 }
+
+ indx: "%index%" \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..e5cffd7233
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
@@ -0,0 +1,267 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: GlobalSubstitutionTypes
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.abstract.nodes.heat.nested:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ cmaui_names:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p2:
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ availability_zone_0:
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ type: string
+ description: cmaui_port_1
+ net:
+ type: string
+ description: UID of OAM network
+ shared_security_group_id1:
+ type: string
+ description: UID of OAM network
+ requirements:
+ - link_cmaui_port_2:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_cmaui_port_11_test_nested2:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_cmaui_port_22_test_nested2:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - local_storage_server_cmaui_test_nested2:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - local_storage_server_cmaui:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - link_cmaui_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ capabilities:
+ os_server_cmaui:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_server_cmaui:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_server_cmaui:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_cmaui:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_11_test_nested2:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_cmaui:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_2:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_cmaui_test_nested2:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_server_cmaui_test_nested2:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_cmaui_test_nested2:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_server_cmaui_test_nested2:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_cmaui_test_nested2:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_22_test_nested2:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_1:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ org.openecomp.resource.abstract.nodes.heat.nested2level:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ cmaui_names:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p2:
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ availability_zone_0:
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ type: string
+ description: cmaui_port_1
+ net:
+ type: string
+ description: UID of OAM network
+ shared_security_group_id1:
+ type: string
+ description: UID of OAM network
+ requirements:
+ - link_cmaui_port_11:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_cmaui_port_22:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - local_storage_server_cmaui:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ capabilities:
+ host_server_cmaui:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_cmaui:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_11:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_22:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_cmaui:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_cmaui:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_server_cmaui:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..b619c99256
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,241 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ security_group_name:
+ label: security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of security group
+ shared_security_group_id2:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ jsa_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ shared_security_group_id1:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ node_templates:
+ jsa_security_group1:
+ type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules
+ properties:
+ name:
+ get_input: security_group_name
+ description: ems security group
+ rules:
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ - protocol: tcp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: egress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: egress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv6
+ remote_ip_prefix: ::/0
+ direction: egress
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ - protocol: tcp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv6
+ remote_ip_prefix: ::/0
+ direction: ingress
+ requirements:
+ - port:
+ capability: attachment_cmaui_port_2
+ node: test_nested
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: attachment_cmaui_port_1
+ node: test_nested
+ relationship: org.openecomp.relationships.AttachesTo
+ jsa_security_group2:
+ type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules
+ properties:
+ name:
+ get_input: security_group_name
+ description: ems security group
+ rules:
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ - protocol: tcp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: egress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: egress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv6
+ remote_ip_prefix: ::/0
+ direction: egress
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ - protocol: tcp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv6
+ remote_ip_prefix: ::/0
+ direction: ingress
+ requirements:
+ - port:
+ capability: attachment_cmaui_port_1
+ node: test_nested
+ relationship: org.openecomp.relationships.AttachesTo
+ test_nested:
+ type: org.openecomp.resource.abstract.nodes.heat.nested
+ directives:
+ - substitutable
+ properties:
+ service_template_filter:
+ substitute_service_template: nestedServiceTemplate.yaml
+ p2:
+ get_input: shared_security_group_id2
+ shared_security_group_id1:
+ get_input: shared_security_group_id1
+ groups:
+ addOn:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/addOn.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - test_nested
+ base:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/base.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - jsa_security_group1
+ - jsa_security_group2 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/expectedoutputfiles/nested2levelServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/expectedoutputfiles/nested2levelServiceTemplate.yaml
new file mode 100644
index 0000000000..e26b5c6c18
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/expectedoutputfiles/nested2levelServiceTemplate.yaml
@@ -0,0 +1,175 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested2level
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cmaui:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p2:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ hidden: false
+ immutable: false
+ type: string
+ description: cmaui_port_1
+ net:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ shared_security_group_id1:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ node_templates:
+ cmaui_port_11:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: shared_security_group_id1
+ - get_input: p2
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: net
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ cmaui_port_22:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: shared_security_group_id1
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: net
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ server_cmaui:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ groups:
+ nested2level:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested2level.yml
+ description: cmaui server template for vMMSC
+ members:
+ - cmaui_port_11
+ - cmaui_port_22
+ - server_cmaui
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested2level
+ capabilities:
+ host_server_cmaui:
+ - server_cmaui
+ - host
+ os_server_cmaui:
+ - server_cmaui
+ - os
+ attachment_cmaui_port_11:
+ - cmaui_port_11
+ - attachment
+ attachment_cmaui_port_22:
+ - cmaui_port_22
+ - attachment
+ endpoint_server_cmaui:
+ - server_cmaui
+ - endpoint
+ binding_server_cmaui:
+ - server_cmaui
+ - binding
+ scalable_server_cmaui:
+ - server_cmaui
+ - scalable
+ requirements:
+ local_storage_server_cmaui:
+ - server_cmaui
+ - local_storage
+ link_cmaui_port_11:
+ - cmaui_port_11
+ - link
+ link_cmaui_port_22:
+ - cmaui_port_22
+ - link \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/expectedoutputfiles/nestedServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/expectedoutputfiles/nestedServiceTemplate.yaml
new file mode 100644
index 0000000000..8001ba9d7d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/expectedoutputfiles/nestedServiceTemplate.yaml
@@ -0,0 +1,217 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cmaui:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p2:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ hidden: false
+ immutable: false
+ type: string
+ description: cmaui_port_1
+ net:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ shared_security_group_id1:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ node_templates:
+ cmaui_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: shared_security_group_id1
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: net
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ test_nested2:
+ type: org.openecomp.resource.abstract.nodes.heat.nested2level
+ directives:
+ - substitutable
+ properties:
+ service_template_filter:
+ substitute_service_template: nested2levelServiceTemplate.yaml
+ p2:
+ get_input: p2
+ shared_security_group_id1:
+ get_input: shared_security_group_id1
+ server_cmaui:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ cmaui_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: shared_security_group_id1
+ - get_input: p2
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: net
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ nested:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested.yml
+ description: cmaui server template for vMMSC
+ members:
+ - cmaui_port_2
+ - test_nested2
+ - server_cmaui
+ - cmaui_port_1
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested
+ capabilities:
+ os_server_cmaui:
+ - server_cmaui
+ - os
+ scalable_server_cmaui:
+ - server_cmaui
+ - scalable
+ host_server_cmaui:
+ - server_cmaui
+ - host
+ endpoint_server_cmaui:
+ - server_cmaui
+ - endpoint
+ attachment_cmaui_port_11_test_nested2:
+ - test_nested2
+ - attachment_cmaui_port_11
+ binding_server_cmaui:
+ - server_cmaui
+ - binding
+ attachment_cmaui_port_2:
+ - cmaui_port_2
+ - attachment
+ endpoint_server_cmaui_test_nested2:
+ - test_nested2
+ - endpoint_server_cmaui
+ host_server_cmaui_test_nested2:
+ - test_nested2
+ - host_server_cmaui
+ binding_server_cmaui_test_nested2:
+ - test_nested2
+ - binding_server_cmaui
+ scalable_server_cmaui_test_nested2:
+ - test_nested2
+ - scalable_server_cmaui
+ os_server_cmaui_test_nested2:
+ - test_nested2
+ - os_server_cmaui
+ attachment_cmaui_port_22_test_nested2:
+ - test_nested2
+ - attachment_cmaui_port_22
+ attachment_cmaui_port_1:
+ - cmaui_port_1
+ - attachment
+ requirements:
+ local_storage_server_cmaui_test_nested2:
+ - test_nested2
+ - local_storage_server_cmaui
+ local_storage_server_cmaui:
+ - server_cmaui
+ - local_storage
+ link_cmaui_port_22_test_nested2:
+ - test_nested2
+ - link_cmaui_port_22
+ link_cmaui_port_2:
+ - cmaui_port_2
+ - link
+ link_cmaui_port_11_test_nested2:
+ - test_nested2
+ - link_cmaui_port_11
+ link_cmaui_port_1:
+ - cmaui_port_1
+ - link \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/inputs/MANIFEST.json
new file mode 100644
index 0000000000..992097af43
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/inputs/MANIFEST.json
@@ -0,0 +1,27 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "base.yml",
+ "type": "HEAT",
+ "isBase": "true"
+ },
+ {
+ "file": "nested.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ },
+ {
+ "file": "nested2level.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ },
+ {
+ "file": "addOn.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/inputs/addOn.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/inputs/addOn.yml
new file mode 100644
index 0000000000..0e7619a478
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/inputs/addOn.yml
@@ -0,0 +1,26 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ shared_security_group_id1:
+ type: string
+ description: network name of jsa log network
+ shared_security_group_id2:
+ type: string
+ description: network name of jsa log network
+ jsa_net_name:
+ type: string
+ description: network name of jsa log network
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+
+resources:
+ test_nested:
+ type: nested.yml
+ properties:
+ shared_security_group_id1: { get_param: shared_security_group_id1}
+ p2: { get_param: shared_security_group_id2}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/inputs/base.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/inputs/base.yml
new file mode 100644
index 0000000000..9167ffbafd
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/inputs/base.yml
@@ -0,0 +1,58 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ jsa_net_name:
+ type: string
+ description: network name of jsa log network
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+
+resources:
+ jsa_security_group1:
+ type: OS::Neutron::SecurityGroup
+ properties:
+ description: ems security group
+ name: {get_param: security_group_name}
+ rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"},
+ {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"},
+ {"direction": egress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"}
+ ]
+
+ jsa_security_group2:
+ type: OS::Neutron::SecurityGroup
+ properties:
+ description: ems security group
+ name: {get_param: security_group_name}
+ rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"},
+ {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"},
+ {"direction": egress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"}
+ ]
+outputs:
+ shared_security_group_id1:
+ value: {get_resource: jsa_security_group1}
+
+ shared_security_group_id2:
+ value: {get_resource: jsa_security_group2}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/inputs/nested.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/inputs/nested.yml
new file mode 100644
index 0000000000..b202fef7b0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/inputs/nested.yml
@@ -0,0 +1,65 @@
+heat_template_version: 2013-05-23
+
+description: cmaui server template for vMMSC
+
+parameters:
+ shared_security_group_id1:
+ type: string
+ description: UID of OAM network
+ p2:
+ type: string
+ description: UID of OAM network
+ net:
+ type: string
+ description: UID of OAM network
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_oam_ips:
+ type: string
+ description: cmaui_port_1
+
+resources:
+
+ cmaui_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: net }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: shared_security_group_id1}, {get_param: p2}]
+ replacement_policy: AUTO
+
+ cmaui_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: net }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: shared_security_group_id1}]
+ replacement_policy: AUTO
+
+ server_cmaui:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_1 }
+ - port: { get_resource: cmaui_port_2 }
+
+ test_nested2:
+ type: nested2level.yml
+ properties:
+ shared_security_group_id1: { get_param: shared_security_group_id1}
+ p2: { get_param: p2} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/inputs/nested2level.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/inputs/nested2level.yml
new file mode 100644
index 0000000000..6a123d1641
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/inputs/nested2level.yml
@@ -0,0 +1,59 @@
+heat_template_version: 2013-05-23
+
+description: cmaui server template for vMMSC
+
+parameters:
+ shared_security_group_id1:
+ type: string
+ description: UID of OAM network
+ p2:
+ type: string
+ description: UID of OAM network
+ net:
+ type: string
+ description: UID of OAM network
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_oam_ips:
+ type: string
+ description: cmaui_port_1
+
+resources:
+
+ cmaui_port_11:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: net }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: shared_security_group_id1}, {get_param: p2}]
+ replacement_policy: AUTO
+
+ cmaui_port_22:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: net }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: shared_security_group_id1}]
+ replacement_policy: AUTO
+
+ server_cmaui:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_11 }
+ - port: { get_resource: cmaui_port_22 } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..9aaa8caf18
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
@@ -0,0 +1,472 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: GlobalSubstitutionTypes
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.abstract.nodes.heat.nested:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ cmaui_names:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p2:
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ availability_zone_0:
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ type: string
+ description: cmaui_port_1
+ net:
+ type: string
+ description: UID of OAM network
+ shared_security_group_id1:
+ type: string
+ description: UID of OAM network
+ requirements:
+ - link_cmaui_port_2:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_cmaui_port_11_test_nested2:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_cmaui_port_22_test_nested2:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_cmaui_port_11_test_nested3_test_nested2:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_cmaui_port_22_test_nested3_test_nested2:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - local_storage_server_cmaui_test_nested3_test_nested2:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - local_storage_server_cmaui_test_nested2:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - local_storage_server_cmaui:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - link_cmaui_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ capabilities:
+ os_server_cmaui:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_cmaui_test_nested3_test_nested2:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_server_cmaui_test_nested3_test_nested2:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_server_cmaui_test_nested3_test_nested2:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_server_cmaui:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_22_test_nested3_test_nested2:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_server_cmaui:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_11_test_nested3_test_nested2:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_cmaui:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_11_test_nested2:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_cmaui:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_2:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_cmaui_test_nested2:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_cmaui_test_nested3_test_nested2:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_server_cmaui_test_nested2:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_server_cmaui_test_nested2:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_cmaui_test_nested2:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_cmaui_test_nested2:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_22_test_nested2:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_cmaui_test_nested3_test_nested2:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_1:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ org.openecomp.resource.abstract.nodes.heat.nested3level:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ cmaui_names:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p2:
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ availability_zone_0:
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ type: string
+ description: cmaui_port_1
+ net:
+ type: string
+ description: UID of OAM network
+ shared_security_group_id1:
+ type: string
+ description: UID of OAM network
+ requirements:
+ - link_cmaui_port_11:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_cmaui_port_22:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - local_storage_server_cmaui:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ capabilities:
+ host_server_cmaui:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_cmaui:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_11:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_22:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_cmaui:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_cmaui:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_server_cmaui:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ org.openecomp.resource.abstract.nodes.heat.nested2level:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ cmaui_names:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p2:
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ availability_zone_0:
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ type: string
+ description: cmaui_port_1
+ net:
+ type: string
+ description: UID of OAM network
+ shared_security_group_id1:
+ type: string
+ description: UID of OAM network
+ requirements:
+ - link_cmaui_port_11:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_cmaui_port_22:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_cmaui_port_11_test_nested3:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_cmaui_port_22_test_nested3:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - local_storage_server_cmaui_test_nested3:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - local_storage_server_cmaui:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ capabilities:
+ os_server_cmaui:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_22_test_nested3:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_11_test_nested3:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_server_cmaui:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_server_cmaui:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_11:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_22:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_server_cmaui_test_nested3:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_cmaui:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_cmaui:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_cmaui_test_nested3:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_cmaui_test_nested3:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_cmaui_test_nested3:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_server_cmaui_test_nested3:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..b619c99256
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,241 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ security_group_name:
+ label: security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of security group
+ shared_security_group_id2:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ jsa_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ shared_security_group_id1:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ node_templates:
+ jsa_security_group1:
+ type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules
+ properties:
+ name:
+ get_input: security_group_name
+ description: ems security group
+ rules:
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ - protocol: tcp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: egress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: egress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv6
+ remote_ip_prefix: ::/0
+ direction: egress
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ - protocol: tcp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv6
+ remote_ip_prefix: ::/0
+ direction: ingress
+ requirements:
+ - port:
+ capability: attachment_cmaui_port_2
+ node: test_nested
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: attachment_cmaui_port_1
+ node: test_nested
+ relationship: org.openecomp.relationships.AttachesTo
+ jsa_security_group2:
+ type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules
+ properties:
+ name:
+ get_input: security_group_name
+ description: ems security group
+ rules:
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ - protocol: tcp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: egress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: egress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv6
+ remote_ip_prefix: ::/0
+ direction: egress
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ - protocol: tcp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv6
+ remote_ip_prefix: ::/0
+ direction: ingress
+ requirements:
+ - port:
+ capability: attachment_cmaui_port_1
+ node: test_nested
+ relationship: org.openecomp.relationships.AttachesTo
+ test_nested:
+ type: org.openecomp.resource.abstract.nodes.heat.nested
+ directives:
+ - substitutable
+ properties:
+ service_template_filter:
+ substitute_service_template: nestedServiceTemplate.yaml
+ p2:
+ get_input: shared_security_group_id2
+ shared_security_group_id1:
+ get_input: shared_security_group_id1
+ groups:
+ addOn:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/addOn.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - test_nested
+ base:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/base.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - jsa_security_group1
+ - jsa_security_group2 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/expectedoutputfiles/nested2levelServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/expectedoutputfiles/nested2levelServiceTemplate.yaml
new file mode 100644
index 0000000000..2c64802a2b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/expectedoutputfiles/nested2levelServiceTemplate.yaml
@@ -0,0 +1,217 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested2level
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cmaui:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p2:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ hidden: false
+ immutable: false
+ type: string
+ description: cmaui_port_1
+ net:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ shared_security_group_id1:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ node_templates:
+ cmaui_port_11:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: shared_security_group_id1
+ - get_input: p2
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: net
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ cmaui_port_22:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: shared_security_group_id1
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: net
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ test_nested3:
+ type: org.openecomp.resource.abstract.nodes.heat.nested3level
+ directives:
+ - substitutable
+ properties:
+ service_template_filter:
+ substitute_service_template: nested3levelServiceTemplate.yaml
+ p2:
+ get_input: p2
+ shared_security_group_id1:
+ get_input: shared_security_group_id1
+ server_cmaui:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ groups:
+ nested2level:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested2level.yml
+ description: cmaui server template for vMMSC
+ members:
+ - cmaui_port_11
+ - cmaui_port_22
+ - test_nested3
+ - server_cmaui
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested2level
+ capabilities:
+ os_server_cmaui:
+ - server_cmaui
+ - os
+ attachment_cmaui_port_22_test_nested3:
+ - test_nested3
+ - attachment_cmaui_port_22
+ attachment_cmaui_port_11_test_nested3:
+ - test_nested3
+ - attachment_cmaui_port_11
+ scalable_server_cmaui:
+ - server_cmaui
+ - scalable
+ host_server_cmaui:
+ - server_cmaui
+ - host
+ attachment_cmaui_port_11:
+ - cmaui_port_11
+ - attachment
+ attachment_cmaui_port_22:
+ - cmaui_port_22
+ - attachment
+ host_server_cmaui_test_nested3:
+ - test_nested3
+ - host_server_cmaui
+ endpoint_server_cmaui:
+ - server_cmaui
+ - endpoint
+ binding_server_cmaui:
+ - server_cmaui
+ - binding
+ endpoint_server_cmaui_test_nested3:
+ - test_nested3
+ - endpoint_server_cmaui
+ os_server_cmaui_test_nested3:
+ - test_nested3
+ - os_server_cmaui
+ binding_server_cmaui_test_nested3:
+ - test_nested3
+ - binding_server_cmaui
+ scalable_server_cmaui_test_nested3:
+ - test_nested3
+ - scalable_server_cmaui
+ requirements:
+ local_storage_server_cmaui_test_nested3:
+ - test_nested3
+ - local_storage_server_cmaui
+ local_storage_server_cmaui:
+ - server_cmaui
+ - local_storage
+ link_cmaui_port_11:
+ - cmaui_port_11
+ - link
+ link_cmaui_port_22:
+ - cmaui_port_22
+ - link
+ link_cmaui_port_22_test_nested3:
+ - test_nested3
+ - link_cmaui_port_22
+ link_cmaui_port_11_test_nested3:
+ - test_nested3
+ - link_cmaui_port_11 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/expectedoutputfiles/nested3levelServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/expectedoutputfiles/nested3levelServiceTemplate.yaml
new file mode 100644
index 0000000000..d270626fa7
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/expectedoutputfiles/nested3levelServiceTemplate.yaml
@@ -0,0 +1,175 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested3level
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cmaui:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p2:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ hidden: false
+ immutable: false
+ type: string
+ description: cmaui_port_1
+ net:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ shared_security_group_id1:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ node_templates:
+ cmaui_port_11:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: shared_security_group_id1
+ - get_input: p2
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: net
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ cmaui_port_22:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: shared_security_group_id1
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: net
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ server_cmaui:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ groups:
+ nested3level:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested3level.yml
+ description: cmaui server template for vMMSC
+ members:
+ - cmaui_port_11
+ - cmaui_port_22
+ - server_cmaui
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested3level
+ capabilities:
+ host_server_cmaui:
+ - server_cmaui
+ - host
+ os_server_cmaui:
+ - server_cmaui
+ - os
+ attachment_cmaui_port_11:
+ - cmaui_port_11
+ - attachment
+ attachment_cmaui_port_22:
+ - cmaui_port_22
+ - attachment
+ endpoint_server_cmaui:
+ - server_cmaui
+ - endpoint
+ binding_server_cmaui:
+ - server_cmaui
+ - binding
+ scalable_server_cmaui:
+ - server_cmaui
+ - scalable
+ requirements:
+ local_storage_server_cmaui:
+ - server_cmaui
+ - local_storage
+ link_cmaui_port_11:
+ - cmaui_port_11
+ - link
+ link_cmaui_port_22:
+ - cmaui_port_22
+ - link \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/expectedoutputfiles/nestedServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/expectedoutputfiles/nestedServiceTemplate.yaml
new file mode 100644
index 0000000000..d78a252f4f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/expectedoutputfiles/nestedServiceTemplate.yaml
@@ -0,0 +1,247 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cmaui:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p2:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ hidden: false
+ immutable: false
+ type: string
+ description: cmaui_port_1
+ net:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ shared_security_group_id1:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ node_templates:
+ cmaui_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: shared_security_group_id1
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: net
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ test_nested2:
+ type: org.openecomp.resource.abstract.nodes.heat.nested2level
+ directives:
+ - substitutable
+ properties:
+ service_template_filter:
+ substitute_service_template: nested2levelServiceTemplate.yaml
+ p2:
+ get_input: p2
+ shared_security_group_id1:
+ get_input: shared_security_group_id1
+ server_cmaui:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ cmaui_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: shared_security_group_id1
+ - get_input: p2
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: net
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ nested:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested.yml
+ description: cmaui server template for vMMSC
+ members:
+ - cmaui_port_2
+ - test_nested2
+ - server_cmaui
+ - cmaui_port_1
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested
+ capabilities:
+ os_server_cmaui:
+ - server_cmaui
+ - os
+ binding_server_cmaui_test_nested3_test_nested2:
+ - test_nested2
+ - binding_server_cmaui_test_nested3
+ scalable_server_cmaui_test_nested3_test_nested2:
+ - test_nested2
+ - scalable_server_cmaui_test_nested3
+ host_server_cmaui_test_nested3_test_nested2:
+ - test_nested2
+ - host_server_cmaui_test_nested3
+ scalable_server_cmaui:
+ - server_cmaui
+ - scalable
+ attachment_cmaui_port_22_test_nested3_test_nested2:
+ - test_nested2
+ - attachment_cmaui_port_22_test_nested3
+ host_server_cmaui:
+ - server_cmaui
+ - host
+ attachment_cmaui_port_11_test_nested3_test_nested2:
+ - test_nested2
+ - attachment_cmaui_port_11_test_nested3
+ endpoint_server_cmaui:
+ - server_cmaui
+ - endpoint
+ attachment_cmaui_port_11_test_nested2:
+ - test_nested2
+ - attachment_cmaui_port_11
+ binding_server_cmaui:
+ - server_cmaui
+ - binding
+ attachment_cmaui_port_2:
+ - cmaui_port_2
+ - attachment
+ endpoint_server_cmaui_test_nested2:
+ - test_nested2
+ - endpoint_server_cmaui
+ endpoint_server_cmaui_test_nested3_test_nested2:
+ - test_nested2
+ - endpoint_server_cmaui_test_nested3
+ scalable_server_cmaui_test_nested2:
+ - test_nested2
+ - scalable_server_cmaui
+ host_server_cmaui_test_nested2:
+ - test_nested2
+ - host_server_cmaui
+ binding_server_cmaui_test_nested2:
+ - test_nested2
+ - binding_server_cmaui
+ os_server_cmaui_test_nested2:
+ - test_nested2
+ - os_server_cmaui
+ attachment_cmaui_port_22_test_nested2:
+ - test_nested2
+ - attachment_cmaui_port_22
+ os_server_cmaui_test_nested3_test_nested2:
+ - test_nested2
+ - os_server_cmaui_test_nested3
+ attachment_cmaui_port_1:
+ - cmaui_port_1
+ - attachment
+ requirements:
+ local_storage_server_cmaui_test_nested2:
+ - test_nested2
+ - local_storage_server_cmaui
+ local_storage_server_cmaui:
+ - server_cmaui
+ - local_storage
+ link_cmaui_port_11_test_nested3_test_nested2:
+ - test_nested2
+ - link_cmaui_port_11_test_nested3
+ link_cmaui_port_22_test_nested2:
+ - test_nested2
+ - link_cmaui_port_22
+ link_cmaui_port_22_test_nested3_test_nested2:
+ - test_nested2
+ - link_cmaui_port_22_test_nested3
+ local_storage_server_cmaui_test_nested3_test_nested2:
+ - test_nested2
+ - local_storage_server_cmaui_test_nested3
+ link_cmaui_port_2:
+ - cmaui_port_2
+ - link
+ link_cmaui_port_11_test_nested2:
+ - test_nested2
+ - link_cmaui_port_11
+ link_cmaui_port_1:
+ - cmaui_port_1
+ - link \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/MANIFEST.json
new file mode 100644
index 0000000000..ea06fcc95a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/MANIFEST.json
@@ -0,0 +1,32 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "base.yml",
+ "type": "HEAT",
+ "isBase": "true"
+ },
+ {
+ "file": "nested.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ },
+ {
+ "file": "nested2level.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ },
+ {
+ "file": "nested3level.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ },
+ {
+ "file": "addOn.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/addOn.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/addOn.yml
new file mode 100644
index 0000000000..0e7619a478
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/addOn.yml
@@ -0,0 +1,26 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ shared_security_group_id1:
+ type: string
+ description: network name of jsa log network
+ shared_security_group_id2:
+ type: string
+ description: network name of jsa log network
+ jsa_net_name:
+ type: string
+ description: network name of jsa log network
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+
+resources:
+ test_nested:
+ type: nested.yml
+ properties:
+ shared_security_group_id1: { get_param: shared_security_group_id1}
+ p2: { get_param: shared_security_group_id2}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/base.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/base.yml
new file mode 100644
index 0000000000..9167ffbafd
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/base.yml
@@ -0,0 +1,58 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ jsa_net_name:
+ type: string
+ description: network name of jsa log network
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+
+resources:
+ jsa_security_group1:
+ type: OS::Neutron::SecurityGroup
+ properties:
+ description: ems security group
+ name: {get_param: security_group_name}
+ rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"},
+ {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"},
+ {"direction": egress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"}
+ ]
+
+ jsa_security_group2:
+ type: OS::Neutron::SecurityGroup
+ properties:
+ description: ems security group
+ name: {get_param: security_group_name}
+ rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"},
+ {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"},
+ {"direction": egress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"}
+ ]
+outputs:
+ shared_security_group_id1:
+ value: {get_resource: jsa_security_group1}
+
+ shared_security_group_id2:
+ value: {get_resource: jsa_security_group2}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/nested.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/nested.yml
new file mode 100644
index 0000000000..b202fef7b0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/nested.yml
@@ -0,0 +1,65 @@
+heat_template_version: 2013-05-23
+
+description: cmaui server template for vMMSC
+
+parameters:
+ shared_security_group_id1:
+ type: string
+ description: UID of OAM network
+ p2:
+ type: string
+ description: UID of OAM network
+ net:
+ type: string
+ description: UID of OAM network
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_oam_ips:
+ type: string
+ description: cmaui_port_1
+
+resources:
+
+ cmaui_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: net }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: shared_security_group_id1}, {get_param: p2}]
+ replacement_policy: AUTO
+
+ cmaui_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: net }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: shared_security_group_id1}]
+ replacement_policy: AUTO
+
+ server_cmaui:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_1 }
+ - port: { get_resource: cmaui_port_2 }
+
+ test_nested2:
+ type: nested2level.yml
+ properties:
+ shared_security_group_id1: { get_param: shared_security_group_id1}
+ p2: { get_param: p2} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/nested2level.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/nested2level.yml
new file mode 100644
index 0000000000..14c137a884
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/nested2level.yml
@@ -0,0 +1,65 @@
+heat_template_version: 2013-05-23
+
+description: cmaui server template for vMMSC
+
+parameters:
+ shared_security_group_id1:
+ type: string
+ description: UID of OAM network
+ p2:
+ type: string
+ description: UID of OAM network
+ net:
+ type: string
+ description: UID of OAM network
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_oam_ips:
+ type: string
+ description: cmaui_port_1
+
+resources:
+
+ cmaui_port_11:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: net }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: shared_security_group_id1}, {get_param: p2}]
+ replacement_policy: AUTO
+
+ cmaui_port_22:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: net }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: shared_security_group_id1}]
+ replacement_policy: AUTO
+
+ server_cmaui:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_11 }
+ - port: { get_resource: cmaui_port_22 }
+
+ test_nested3:
+ type: nested3level.yml
+ properties:
+ shared_security_group_id1: { get_param: shared_security_group_id1}
+ p2: { get_param: p2} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/nested3level.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/nested3level.yml
new file mode 100644
index 0000000000..6a123d1641
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/nested3level.yml
@@ -0,0 +1,59 @@
+heat_template_version: 2013-05-23
+
+description: cmaui server template for vMMSC
+
+parameters:
+ shared_security_group_id1:
+ type: string
+ description: UID of OAM network
+ p2:
+ type: string
+ description: UID of OAM network
+ net:
+ type: string
+ description: UID of OAM network
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_oam_ips:
+ type: string
+ description: cmaui_port_1
+
+resources:
+
+ cmaui_port_11:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: net }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: shared_security_group_id1}, {get_param: p2}]
+ replacement_policy: AUTO
+
+ cmaui_port_22:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: net }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: shared_security_group_id1}]
+ replacement_policy: AUTO
+
+ server_cmaui:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_11 }
+ - port: { get_resource: cmaui_port_22 } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..ef081a9bec
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
@@ -0,0 +1,79 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: GlobalSubstitutionTypes
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ nova_image_name:
+ type: string
+ description: PCRF CM server name
+ pcm_server_name:
+ type: string
+ description: PCRF CM server name
+ nove_001_vol_property:
+ type: string
+ description: PCRF CM server name
+ requirements:
+ - local_storage_nova_001:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ capabilities:
+ scalable_nova_001:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_nova_001:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_nova_001:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_nova_001:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_nova_001:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..136eb6309a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,65 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ not_null:
+ hidden: false
+ immutable: false
+ type: string
+ node_templates:
+ server_pcm_001:
+ type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1
+ directives:
+ - substitutable
+ properties:
+ service_template_filter:
+ substitute_service_template: nested-pcm_v0.1ServiceTemplate.yaml
+ nove_001_vol_property: nove_001_vol
+ requirements:
+ - local_storage_nova_001:
+ capability: tosca.capabilities.Attachment
+ node: nove_001_vol
+ relationship: tosca.relationships.AttachesTo
+ nove_001_vol:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties: {
+ }
+ groups:
+ hot-nimbus-pcm_v0.4:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/hot-nimbus-pcm_v0.4.yaml
+ description: heat template that creates PCRF Cluman stack
+ members:
+ - server_pcm_001
+ - nove_001_vol \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml
new file mode 100644
index 0000000000..1b9c34f1da
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml
@@ -0,0 +1,91 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested-pcm_v0.1
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.nova:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ nova_image_name:
+ label: nova_001 image name
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF CM server name
+ pcm_server_name:
+ label: PCRF CM server name
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF CM server name
+ nove_001_vol_property:
+ label: PCRF CM server name
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF CM server name
+ node_templates:
+ nova_001:
+ type: org.openecomp.resource.vfc.nodes.heat.nova
+ properties:
+ image:
+ get_input: nova_image_name
+ groups:
+ nested-pcm_v0.1:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested-pcm_v0.1.yaml
+ description: heat template that creates PCRF Cluman stack
+ members:
+ - nova_001
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1
+ capabilities:
+ scalable_nova_001:
+ - nova_001
+ - scalable
+ host_nova_001:
+ - nova_001
+ - host
+ endpoint_nova_001:
+ - nova_001
+ - endpoint
+ os_nova_001:
+ - nova_001
+ - os
+ binding_nova_001:
+ - nova_001
+ - binding
+ requirements:
+ local_storage_nova_001:
+ - nova_001
+ - local_storage \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/inputs/MANIFEST.json
new file mode 100644
index 0000000000..44c5652ed6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/inputs/MANIFEST.json
@@ -0,0 +1,14 @@
+{
+ "name": "vEP_JSA_Net",
+ "description": "Version 2.0 02-09-2016 (Authors: John Doe, user PROD)",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pcm_v0.4.yaml",
+ "type": "HEAT"
+ },{
+ "file": "nested-pcm_v0.1.yaml",
+ "type": "HEAT"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/inputs/hot-nimbus-pcm_v0.4.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/inputs/hot-nimbus-pcm_v0.4.yaml
new file mode 100644
index 0000000000..93dd4470b8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/inputs/hot-nimbus-pcm_v0.4.yaml
@@ -0,0 +1,22 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Cluman stack
+
+parameters:
+ not_null:
+ type: string
+
+
+
+resources:
+ server_pcm_001:
+ type: nested-pcm_v0.1.yaml
+ properties:
+ nove_001_vol_property: { get_resource: nove_001_vol }
+
+ nove_001_vol:
+ type: OS::Cinder::Volume
+ properties:
+ not_null: not_null
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/inputs/nested-pcm_v0.1.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/inputs/nested-pcm_v0.1.yaml
new file mode 100644
index 0000000000..d444a691ff
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/inputs/nested-pcm_v0.1.yaml
@@ -0,0 +1,29 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Cluman stack
+
+parameters:
+ pcm_server_name:
+ type: string
+ label: PCRF CM server name
+ description: PCRF CM server name
+ nove_001_vol_property:
+ type: string
+ label: PCRF CM server name
+ description: PCRF CM server name
+ nova_image_name:
+ type: string
+ label: nova_001 image name
+ description: PCRF CM server name
+
+resources:
+ nova_001:
+ type: OS::Nova::Server
+ properties:
+ not_null: not_null
+ image: {get_param: nova_image_name}
+ nove_001_vol_attach:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_param: nove_001_vol_property}
+ instance_uuid: {get_resource: nova_001}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..5edf602a57
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
@@ -0,0 +1,79 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: GlobalSubstitutionTypes
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ nova_image_name:
+ type: string
+ description: nova image name
+ pcm_server_name:
+ type: string
+ description: PCRF CM server name
+ nove_001_vol_property:
+ type: string
+ description: volume name
+ requirements:
+ - local_storage_nova_001:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ capabilities:
+ scalable_nova_001:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_nova_001:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_nova_001:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_nova_001:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_nova_001:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..30e792209b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,72 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ not_null:
+ hidden: false
+ immutable: false
+ type: string
+ nove_001_vol:
+ label: volume
+ hidden: false
+ immutable: false
+ type: string
+ description: volume name
+ node_templates:
+ server_pcm_001:
+ type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1
+ directives:
+ - substitutable
+ properties:
+ service_template_filter:
+ substitute_service_template: nested-pcm_v0.1ServiceTemplate.yaml
+ nove_001_vol_property:
+ get_input: nove_001_vol
+ nove_001_vol:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties: {
+ }
+ groups:
+ volume:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/volume.yaml
+ members:
+ - nove_001_vol
+ hot-nimbus-pcm_v0.4:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/hot-nimbus-pcm_v0.4.yaml
+ description: heat template that creates PCRF Cluman stack
+ members:
+ - server_pcm_001 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml
new file mode 100644
index 0000000000..3f03905588
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml
@@ -0,0 +1,91 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested-pcm_v0.1
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.nova:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ nova_image_name:
+ label: volume
+ hidden: false
+ immutable: false
+ type: string
+ description: nova image name
+ pcm_server_name:
+ label: PCRF CM server name
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF CM server name
+ nove_001_vol_property:
+ label: volume
+ hidden: false
+ immutable: false
+ type: string
+ description: volume name
+ node_templates:
+ nova_001:
+ type: org.openecomp.resource.vfc.nodes.heat.nova
+ properties:
+ image:
+ get_input: nova_image_name
+ groups:
+ nested-pcm_v0.1:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested-pcm_v0.1.yaml
+ description: heat template that creates PCRF Cluman stack
+ members:
+ - nova_001
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1
+ capabilities:
+ scalable_nova_001:
+ - nova_001
+ - scalable
+ host_nova_001:
+ - nova_001
+ - host
+ endpoint_nova_001:
+ - nova_001
+ - endpoint
+ os_nova_001:
+ - nova_001
+ - os
+ binding_nova_001:
+ - nova_001
+ - binding
+ requirements:
+ local_storage_nova_001:
+ - nova_001
+ - local_storage \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/inputs/MANIFEST.json
new file mode 100644
index 0000000000..63b14401c8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/inputs/MANIFEST.json
@@ -0,0 +1,17 @@
+{
+ "name": "vEP_JSA_Net",
+ "description": "Version 2.0 02-09-2016 (Authors: John Doe, user PROD)",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pcm_v0.4.yaml",
+ "type": "HEAT"
+ },{
+ "file": "nested-pcm_v0.1.yaml",
+ "type": "HEAT"
+ },{
+ "file": "volume.yaml",
+ "type": "HEAT_VOL"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/inputs/hot-nimbus-pcm_v0.4.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/inputs/hot-nimbus-pcm_v0.4.yaml
new file mode 100644
index 0000000000..f6cfa047ef
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/inputs/hot-nimbus-pcm_v0.4.yaml
@@ -0,0 +1,23 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Cluman stack
+
+parameters:
+ not_null:
+ type: string
+
+ nove_001_vol:
+ type: string
+ label: volume
+ description: volume name
+
+
+
+resources:
+ server_pcm_001:
+ type: nested-pcm_v0.1.yaml
+ properties:
+ nove_001_vol_property: { get_param: nove_001_vol }
+
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/inputs/nested-pcm_v0.1.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/inputs/nested-pcm_v0.1.yaml
new file mode 100644
index 0000000000..b8ab56319a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/inputs/nested-pcm_v0.1.yaml
@@ -0,0 +1,31 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Cluman stack
+
+parameters:
+ pcm_server_name:
+ type: string
+ label: PCRF CM server name
+ description: PCRF CM server name
+
+ nove_001_vol_property:
+ type: string
+ label: volume
+ description: volume name
+
+ nova_image_name:
+ type: string
+ label: volume
+ description: nova image name
+
+resources:
+ nova_001:
+ type: OS::Nova::Server
+ properties:
+ not_null: not_null
+ image: {get_param: nova_image_name}
+ nove_001_vol_attach:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_param: nove_001_vol_property}
+ instance_uuid: {get_resource: nova_001}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/inputs/volume.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/inputs/volume.yaml
new file mode 100644
index 0000000000..dbb3859b37
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/inputs/volume.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+parameters:
+ not_null:
+ type: number
+ label: not_number
+
+
+resources:
+ nove_001_vol:
+ type: OS::Cinder::Volume
+ properties:
+ not_null: not_null
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..2dee4a9971
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
@@ -0,0 +1,330 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: GlobalSubstitutionTypes
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1_2:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ pcm_flavor_name:
+ type: string
+ description: flavor name of PCRF CM instance
+ availabilityzone_name:
+ type: string
+ description: availabilityzone name
+ pcm_image_name:
+ type: string
+ description: PCRF CM image name
+ pcm_vol:
+ type: string
+ description: CPS Cluman Cinder Volume
+ security_group_name:
+ type: string
+ description: the name of security group
+ cps_net_ip:
+ type: string
+ description: CPS network ip
+ pcm_server_name:
+ type: string
+ description: PCRF CM server name
+ cps_net_name:
+ type: string
+ description: CPS network name
+ cps_net_mask:
+ type: string
+ description: CPS network mask
+ oam_net_ip:
+ type: string
+ oam_net_name:
+ type: string
+ description: OAM network name
+ attributes:
+ server_pcm_id:
+ type: string
+ description: the pcm nova service id
+ requirements:
+ - link_pcm_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - local_storage_server_pcm:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - link_pcm_port_0:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ capabilities:
+ endpoint_server_pcm:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ link_network:
+ type: tosca.capabilities.network.Linkable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_pcm:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_server_pcm:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_server_pcm:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_network:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_pcm:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_pcm_port_0:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_pcm_port_1:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ availabilityzone_name:
+ type: string
+ description: availabilityzone name
+ oam_net_gw:
+ type: string
+ description: CPS network gateway
+ pcm_image_name:
+ type: string
+ description: PCRF CM image name
+ cps_net_ips:
+ type: string
+ description: CPS network ip
+ security_group_name:
+ type: string
+ description: the name of security group
+ cps_net_ip:
+ type: string
+ description: CPS network ip
+ pcm_volumes:
+ type: string
+ description: CPS Cluman Cinder Volume
+ pcm_flavor_name:
+ type: string
+ description: flavor name of PCRF CM instance
+ pcm_vol:
+ type: string
+ description: CPS Cluman Cinder Volume
+ pcm_server_name:
+ type: string
+ description: PCRF CM server name
+ cps_net_name:
+ type: string
+ description: CPS network name
+ cps_net_mask:
+ type: string
+ description: CPS network mask
+ oam_net_ip:
+ type: string
+ description: OAM network ip
+ oam_net_mask:
+ type: string
+ description: CPS network mask
+ oam_net_name:
+ type: string
+ description: OAM network name
+ attributes:
+ server_pcm_id:
+ type: string
+ description: the pcm nova service id
+ requirements:
+ - link_pcm_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - local_storage_server_pcm:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - link_pcm_port_1_server_pcm_005:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - local_storage_server_pcm_server_pcm_005:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - link_pcm_port_0_server_pcm_005:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_pcm_port_0:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ capabilities:
+ endpoint_server_pcm:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_server_pcm:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_server_pcm_server_pcm_005:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_pcm_server_pcm_005:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_server_pcm_server_pcm_005:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_pcm_server_pcm_005:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_pcm_server_pcm_005:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_network_server_pcm_005:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_network:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_pcm:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ link_network:
+ type: tosca.capabilities.network.Linkable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_pcm_port_0_server_pcm_005:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_pcm:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ link_network_server_pcm_005:
+ type: tosca.capabilities.network.Linkable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_server_pcm:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_pcm_port_0:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_pcm_port_1:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_pcm_port_1_server_pcm_005:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..a0063b174e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,240 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ oam_net_ips:
+ label: OAM network ips
+ hidden: false
+ immutable: false
+ type: list
+ description: OAM network ips
+ entry_schema:
+ type: string
+ availabilityzone_name:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ oam_net_gw:
+ label: CPS network gateway
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network gateway
+ pcm_server_names:
+ label: PCRF CM server names
+ hidden: false
+ immutable: false
+ type: list
+ description: name of the PCRF CM instance
+ entry_schema:
+ type: string
+ pcm_image_name:
+ label: PCRF CM image name
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF CM image name
+ cps_net_ips:
+ label: CPS network ips
+ hidden: false
+ immutable: false
+ type: list
+ description: CPS network ips
+ entry_schema:
+ type: string
+ security_group_name:
+ label: security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of security group
+ pcm_volumes:
+ label: CPS Cluman Cinder Volume
+ hidden: false
+ immutable: false
+ type: list
+ description: CPS Cluman Cinder Volume
+ entry_schema:
+ type: string
+ pcm_flavor_name:
+ label: PCRF CM flavor name
+ hidden: false
+ immutable: false
+ type: string
+ description: flavor name of PCRF CM instance
+ cps_net_name:
+ label: CPS network name
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network name
+ cps_net_mask:
+ label: CPS network mask
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network mask
+ oam_net_mask:
+ label: CPS network mask
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network mask
+ oam_net_name:
+ label: OAM network name
+ hidden: false
+ immutable: false
+ type: string
+ description: OAM network name
+ node_templates:
+ server_pcm_002:
+ type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1
+ directives:
+ - substitutable
+ properties:
+ pcm_flavor_name:
+ get_input: pcm_flavor_name
+ service_template_filter:
+ substitute_service_template: nested-pcm_v0.1ServiceTemplate.yaml
+ availabilityzone_name:
+ get_input: availabilityzone_name
+ pcm_image_name:
+ get_input: pcm_image_name
+ pcm_vol:
+ get_input:
+ - pcm_volumes
+ - 0
+ security_group_name:
+ get_input: security_group_name
+ pcm_server_name:
+ get_input:
+ - pcm_server_names
+ - 0
+ server_pcm_001:
+ type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1
+ directives:
+ - substitutable
+ properties:
+ service_template_filter:
+ substitute_service_template: nested-pcm_v0.1ServiceTemplate.yaml
+ availabilityzone_name:
+ get_input: availabilityzone_name
+ oam_net_gw:
+ get_input: oam_net_gw
+ pcm_vol:
+ get_input:
+ - pcm_volumes
+ - 0
+ security_group_name:
+ get_input: security_group_name
+ cps_net_ip:
+ get_input:
+ - cps_net_ips
+ - 0
+ cps_net_name:
+ get_input: cps_net_name
+ cps_net_mask:
+ get_input: cps_net_mask
+ oam_net_ip:
+ get_input:
+ - oam_net_ips
+ - 0
+ oam_net_mask:
+ get_input: oam_net_mask
+ oam_net_name:
+ get_input: oam_net_name
+ server_pcm_004:
+ type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1_2
+ directives:
+ - substitutable
+ properties:
+ service_template_filter:
+ substitute_service_template: nested-pcm_v0.1_2ServiceTemplate.yaml
+ availabilityzone_name:
+ get_input: availabilityzone_name
+ pcm_vol:
+ get_input:
+ - pcm_volumes
+ - 0
+ security_group_name:
+ get_input: security_group_name
+ cps_net_ip:
+ get_input:
+ - cps_net_ips
+ - 0
+ cps_net_name:
+ get_input: cps_net_name
+ cps_net_mask:
+ get_input: cps_net_mask
+ server_pcm_003:
+ type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1
+ directives:
+ - substitutable
+ properties:
+ service_template_filter:
+ substitute_service_template: nested-pcm_v0.1ServiceTemplate.yaml
+ availabilityzone_name:
+ get_input: availabilityzone_name
+ pcm_vol:
+ get_input:
+ - pcm_volumes
+ - 0
+ security_group_name:
+ get_input: security_group_name
+ cps_net_ip:
+ get_input:
+ - cps_net_ips
+ - 0
+ cps_net_name:
+ get_input: cps_net_name
+ cps_net_mask:
+ get_input: cps_net_mask
+ groups:
+ hot-nimbus-pcm_v0.4_2:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/hot-nimbus-pcm_v0.4_2.yaml
+ description: heat template that creates PCRF Cluman stack
+ members:
+ - server_pcm_004
+ - server_pcm_003
+ hot-nimbus-pcm_v0.4:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/hot-nimbus-pcm_v0.4.yaml
+ description: heat template that creates PCRF Cluman stack
+ members:
+ - server_pcm_002
+ - server_pcm_001 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml
new file mode 100644
index 0000000000..39fb736465
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml
@@ -0,0 +1,291 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested-pcm_v0.1
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.pcm_server:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ availabilityzone_name:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ oam_net_gw:
+ label: CPS network gateway
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network gateway
+ pcm_image_name:
+ label: image name
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF CM image name
+ cps_net_ips:
+ label: CPS network ip
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network ip
+ security_group_name:
+ label: security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of security group
+ cps_net_ip:
+ label: CPS network ip
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network ip
+ pcm_volumes:
+ label: CPS Cluman Cinder Volume
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS Cluman Cinder Volume
+ pcm_flavor_name:
+ label: PCRF CM flavor name
+ hidden: false
+ immutable: false
+ type: string
+ description: flavor name of PCRF CM instance
+ pcm_vol:
+ label: CPS Cluman Cinder Volume
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS Cluman Cinder Volume
+ pcm_server_name:
+ label: PCRF CM server name
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF CM server name
+ cps_net_name:
+ label: CPS network name
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network name
+ cps_net_mask:
+ label: CPS network mask
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network mask
+ oam_net_ip:
+ label: OAM network ip
+ hidden: false
+ immutable: false
+ type: string
+ description: OAM network ip
+ oam_net_mask:
+ label: CPS network mask
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network mask
+ oam_net_name:
+ label: OAM network name
+ hidden: false
+ immutable: false
+ type: string
+ description: OAM network name
+ node_templates:
+ pcm_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: oam_net_ip
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_pcm
+ relationship: tosca.relationships.network.BindsTo
+ server_pcm:
+ type: org.openecomp.resource.vfc.nodes.heat.pcm_server
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ server_pcm_005:
+ type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1_2
+ directives:
+ - substitutable
+ properties:
+ service_template_filter:
+ substitute_service_template: nested-pcm_v0.1_2ServiceTemplate.yaml
+ availabilityzone_name:
+ get_input: availabilityzone_name
+ pcm_vol:
+ get_input:
+ - pcm_volumes
+ - 0
+ security_group_name:
+ get_input: security_group_name
+ cps_net_ip:
+ get_input:
+ - cps_net_ips
+ - 0
+ cps_net_name:
+ get_input: cps_net_name
+ cps_net_mask:
+ get_input: cps_net_mask
+ pcm_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: cps_net_ip
+ network:
+ get_input: cps_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_pcm
+ relationship: tosca.relationships.network.BindsTo
+ network:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ network_name:
+ get_input: cps_net_name
+ groups:
+ nested-pcm_v0.1:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested-pcm_v0.1.yaml
+ description: heat template that creates PCRF Cluman stack
+ members:
+ - pcm_port_1
+ - server_pcm
+ - server_pcm_005
+ - pcm_port_0
+ - network
+ outputs:
+ server_pcm_id:
+ description: the pcm nova service id
+ value: server_pcm
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1
+ capabilities:
+ endpoint_server_pcm:
+ - server_pcm
+ - endpoint
+ host_server_pcm:
+ - server_pcm
+ - host
+ host_server_pcm_server_pcm_005:
+ - server_pcm_005
+ - host_server_pcm
+ os_server_pcm_server_pcm_005:
+ - server_pcm_005
+ - os_server_pcm
+ scalable_server_pcm_server_pcm_005:
+ - server_pcm_005
+ - scalable_server_pcm
+ binding_server_pcm_server_pcm_005:
+ - server_pcm_005
+ - binding_server_pcm
+ endpoint_server_pcm_server_pcm_005:
+ - server_pcm_005
+ - endpoint_server_pcm
+ attachment_network_server_pcm_005:
+ - server_pcm_005
+ - attachment_network
+ attachment_network:
+ - network
+ - attachment
+ binding_server_pcm:
+ - server_pcm
+ - binding
+ link_network:
+ - network
+ - link
+ attachment_pcm_port_0_server_pcm_005:
+ - server_pcm_005
+ - attachment_pcm_port_0
+ os_server_pcm:
+ - server_pcm
+ - os
+ link_network_server_pcm_005:
+ - server_pcm_005
+ - link_network
+ scalable_server_pcm:
+ - server_pcm
+ - scalable
+ attachment_pcm_port_0:
+ - pcm_port_0
+ - attachment
+ attachment_pcm_port_1:
+ - pcm_port_1
+ - attachment
+ attachment_pcm_port_1_server_pcm_005:
+ - server_pcm_005
+ - attachment_pcm_port_1
+ requirements:
+ link_pcm_port_0:
+ - pcm_port_0
+ - link
+ link_pcm_port_1:
+ - pcm_port_1
+ - link
+ link_pcm_port_1_server_pcm_005:
+ - server_pcm_005
+ - link_pcm_port_1
+ link_pcm_port_0_server_pcm_005:
+ - server_pcm_005
+ - link_pcm_port_0
+ local_storage_server_pcm:
+ - server_pcm
+ - local_storage
+ local_storage_server_pcm_server_pcm_005:
+ - server_pcm_005
+ - local_storage_server_pcm \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/expectedoutputfiles/nested-pcm_v0.1_2ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/expectedoutputfiles/nested-pcm_v0.1_2ServiceTemplate.yaml
new file mode 100644
index 0000000000..a80a5811b1
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/expectedoutputfiles/nested-pcm_v0.1_2ServiceTemplate.yaml
@@ -0,0 +1,205 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested-pcm_v0.1_2
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.pcm_server:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ pcm_flavor_name:
+ label: PCRF CM flavor name
+ hidden: false
+ immutable: false
+ type: string
+ description: flavor name of PCRF CM instance
+ availabilityzone_name:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ pcm_image_name:
+ label: image name
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF CM image name
+ pcm_vol:
+ label: CPS Cluman Cinder Volume
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS Cluman Cinder Volume
+ security_group_name:
+ label: security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of security group
+ cps_net_ip:
+ label: CPS network ip
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network ip
+ pcm_server_name:
+ label: PCRF CM server name
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF CM server name
+ cps_net_name:
+ label: CPS network name
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network name
+ cps_net_mask:
+ label: CPS network mask
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network mask
+ oam_net_ip:
+ hidden: false
+ immutable: false
+ type: string
+ oam_net_name:
+ label: OAM network name
+ hidden: false
+ immutable: false
+ type: string
+ description: OAM network name
+ node_templates:
+ pcm_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: oam_net_ip
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_pcm
+ relationship: tosca.relationships.network.BindsTo
+ server_pcm:
+ type: org.openecomp.resource.vfc.nodes.heat.pcm_server
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ pcm_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: cps_net_ip
+ network:
+ get_input: cps_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_pcm
+ relationship: tosca.relationships.network.BindsTo
+ network:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ network_name:
+ get_input: cps_net_name
+ groups:
+ nested-pcm_v0.1_2:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested-pcm_v0.1_2.yaml
+ description: heat template that creates PCRF Cluman stack
+ members:
+ - pcm_port_1
+ - server_pcm
+ - pcm_port_0
+ - network
+ outputs:
+ server_pcm_id:
+ description: the pcm nova service id
+ value: server_pcm
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1_2
+ capabilities:
+ endpoint_server_pcm:
+ - server_pcm
+ - endpoint
+ link_network:
+ - network
+ - link
+ os_server_pcm:
+ - server_pcm
+ - os
+ host_server_pcm:
+ - server_pcm
+ - host
+ scalable_server_pcm:
+ - server_pcm
+ - scalable
+ attachment_network:
+ - network
+ - attachment
+ binding_server_pcm:
+ - server_pcm
+ - binding
+ attachment_pcm_port_0:
+ - pcm_port_0
+ - attachment
+ attachment_pcm_port_1:
+ - pcm_port_1
+ - attachment
+ requirements:
+ link_pcm_port_0:
+ - pcm_port_0
+ - link
+ link_pcm_port_1:
+ - pcm_port_1
+ - link
+ local_storage_server_pcm:
+ - server_pcm
+ - local_storage \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/MANIFEST.json
new file mode 100644
index 0000000000..b4a1b43a1e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/MANIFEST.json
@@ -0,0 +1,26 @@
+{
+ "name": "vEP_JSA_Net",
+ "description": "Version 2.0 02-09-2016 (Authors: John Doe, user PROD)",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pcm_v0.4.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-pcm_v0.4.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },{
+ "file": "nested-pcm_v0.1.yaml",
+ "type": "HEAT"
+ },{
+ "file": "hot-nimbus-pcm_v0.4_2.yaml",
+ "type": "HEAT"
+ },{
+ "file": "nested-pcm_v0.1_2.yaml",
+ "type": "HEAT"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/hot-nimbus-pcm_v0.4.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/hot-nimbus-pcm_v0.4.env
new file mode 100644
index 0000000000..78cc03e2ea
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/hot-nimbus-pcm_v0.4.env
@@ -0,0 +1,14 @@
+parameters:
+ pcm_server_names: ZRDM1PCRF01PCM001
+ pcm_image_name: rhel2
+ pcm_flavor_name: cps
+ availabilityzone_name: nova
+ cps_net_name: int_pcrf_net_0
+ cps_net_ips: 172.26.16.113
+ cps_net_mask: 255.255.255.0
+ oam_net_name: oam_protected_net_0
+ oam_net_ips: 107.239.64.121
+ oam_net_gw: 107.239.64.1
+ oam_net_mask: 255.255.255.0
+ pcm_volumes: 249cb355-8fdf-4382-9c3c-a2ebe767d45b
+ security_group_name: nimbus_security_group
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/hot-nimbus-pcm_v0.4.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/hot-nimbus-pcm_v0.4.yaml
new file mode 100644
index 0000000000..f7d050790f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/hot-nimbus-pcm_v0.4.yaml
@@ -0,0 +1,82 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Cluman stack
+
+parameters:
+ pcm_server_names:
+ type: comma_delimited_list
+ label: PCRF CM server names
+ description: name of the PCRF CM instance
+ pcm_image_name:
+ type: string
+ label: PCRF CM image name
+ description: PCRF CM image name
+ pcm_flavor_name:
+ type: string
+ label: PCRF CM flavor name
+ description: flavor name of PCRF CM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ oam_net_name:
+ type: string
+ label: OAM network name
+ description: OAM network name
+ oam_net_ips:
+ type: comma_delimited_list
+ label: OAM network ips
+ description: OAM network ips
+ oam_net_gw:
+ type: string
+ label: CPS network gateway
+ description: CPS network gateway
+ oam_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcm_volumes:
+ type: comma_delimited_list
+ label: CPS Cluman Cinder Volume
+ description: CPS Cluman Cinder Volume
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+
+resources:
+ server_pcm_001:
+ type: nested-pcm_v0.1.yaml
+ properties:
+ availabilityzone_name: { get_param: availabilityzone_name }
+ security_group_name: { get_param: security_group_name }
+ pcm_vol: { get_param: [pcm_volumes, 0] }
+ cps_net_name: { get_param: cps_net_name }
+ cps_net_ip: { get_param: [cps_net_ips, 0] }
+ cps_net_mask: { get_param: cps_net_mask }
+ oam_net_name: { get_param: oam_net_name }
+ oam_net_ip: { get_param: [oam_net_ips, 0] }
+ oam_net_mask: { get_param: oam_net_mask }
+ oam_net_gw: { get_param: oam_net_gw }
+
+ server_pcm_002:
+ type: nested-pcm_v0.1.yaml
+ properties:
+ pcm_server_name: { get_param: [pcm_server_names, 0] }
+ pcm_image_name: { get_param: pcm_image_name }
+ pcm_flavor_name: { get_param: pcm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ security_group_name: { get_param: security_group_name }
+ pcm_vol: { get_param: [pcm_volumes, 0] }
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/hot-nimbus-pcm_v0.4_2.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/hot-nimbus-pcm_v0.4_2.yaml
new file mode 100644
index 0000000000..b59df84764
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/hot-nimbus-pcm_v0.4_2.yaml
@@ -0,0 +1,79 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Cluman stack
+
+parameters:
+ pcm_server_names:
+ type: comma_delimited_list
+ label: PCRF CM server names
+ description: name of the PCRF CM instance
+ pcm_image_name:
+ type: string
+ label: PCRF CM image name
+ description: PCRF CM image name
+ pcm_flavor_name:
+ type: string
+ label: PCRF CM flavor name
+ description: flavor name of PCRF CM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ oam_net_name:
+ type: string
+ label: OAM network name
+ description: OAM network name
+ oam_net_ips:
+ type: comma_delimited_list
+ label: OAM network ips
+ description: OAM network ips
+ oam_net_gw:
+ type: string
+ label: CPS network gateway
+ description: CPS network gateway
+ oam_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcm_volumes:
+ type: comma_delimited_list
+ label: CPS Cluman Cinder Volume
+ description: CPS Cluman Cinder Volume
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+
+resources:
+ server_pcm_003:
+ type: nested-pcm_v0.1.yaml
+ properties:
+ availabilityzone_name: { get_param: availabilityzone_name }
+ security_group_name: { get_param: security_group_name }
+ pcm_vol: { get_param: [pcm_volumes, 0] }
+ cps_net_name: { get_param: cps_net_name }
+ cps_net_ip: { get_param: [cps_net_ips, 0] }
+ cps_net_mask: { get_param: cps_net_mask }
+
+ server_pcm_004:
+ type: nested-pcm_v0.1_2.yaml
+ properties:
+ availabilityzone_name: { get_param: availabilityzone_name }
+ security_group_name: { get_param: security_group_name }
+ pcm_vol: { get_param: [pcm_volumes, 0] }
+ cps_net_name: { get_param: cps_net_name }
+ cps_net_ip: { get_param: [cps_net_ips, 0] }
+ cps_net_mask: { get_param: cps_net_mask }
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/nested-pcm_v0.1.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/nested-pcm_v0.1.yaml
new file mode 100644
index 0000000000..66a03796fb
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/nested-pcm_v0.1.yaml
@@ -0,0 +1,138 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Cluman stack
+
+parameters:
+ pcm_server_name:
+ type: string
+ label: PCRF CM server name
+ description: PCRF CM server name
+ pcm_image_name:
+ type: string
+ label: image name
+ description: PCRF CM image name
+ pcm_flavor_name:
+ type: string
+ label: PCRF CM flavor name
+ description: flavor name of PCRF CM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ cps_net_ips:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ oam_net_name:
+ type: string
+ label: OAM network name
+ description: OAM network name
+ oam_net_ip:
+ type: string
+ label: OAM network ip
+ description: OAM network ip
+ oam_net_gw:
+ type: string
+ label: CPS network gateway
+ description: CPS network gateway
+ oam_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcm_vol:
+ type: string
+ label: CPS Cluman Cinder Volume
+ description: CPS Cluman Cinder Volume
+ pcm_volumes:
+ type: string
+ label: CPS Cluman Cinder Volume
+ description: CPS Cluman Cinder Volume
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+
+resources:
+ server_pcm_005:
+ type: nested-pcm_v0.1_2.yaml
+ properties:
+ availabilityzone_name: { get_param: availabilityzone_name }
+ security_group_name: { get_param: security_group_name }
+ pcm_vol: { get_param: [pcm_volumes, 0] }
+ cps_net_name: { get_param: cps_net_name }
+ cps_net_ip: { get_param: [cps_net_ips, 0] }
+ cps_net_mask: { get_param: cps_net_mask }
+ server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ script_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+
+ network:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: cps_net_name}
+
+ server_pcm:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcm_server_name }
+ image: { get_param: pcm_image_name }
+ flavor: { get_param: pcm_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: pcm_port_0}
+ - port: { get_resource: pcm_port_1}
+ block_device_mapping:
+ - device_name: vdb
+ volume_id: { get_param: pcm_vol}
+ user_data_format: RAW
+ user_data:
+ get_resource: server_init
+
+ pcm_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: cps_net_ip }
+ security_groups: [{ get_param: security_group_name }]
+
+ pcm_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips:
+ - ip_address: { get_param: oam_net_ip }
+ security_groups: [{ get_param: security_group_name }]
+
+ #pcm_vol_attachment:
+ # type: OS::Cinder::VolumeAttachment
+ # properties:
+ # volume_id: { get_param: pcm_vol }
+ # mountpoint: /dev/vdb
+ # instance_uuid: { get_resource: server_pcm }
+outputs:
+ server_pcm_id:
+ description: the pcm nova service id
+ value: { get_resource: server_pcm } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/nested-pcm_v0.1_2.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/nested-pcm_v0.1_2.yaml
new file mode 100644
index 0000000000..11be0dd63b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/nested-pcm_v0.1_2.yaml
@@ -0,0 +1,110 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Cluman stack
+
+parameters:
+ pcm_server_name:
+ type: string
+ label: PCRF CM server name
+ description: PCRF CM server name
+ pcm_image_name:
+ type: string
+ label: image name
+ description: PCRF CM image name
+ pcm_flavor_name:
+ type: string
+ label: PCRF CM flavor name
+ description: flavor name of PCRF CM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcm_vol:
+ type: string
+ label: CPS Cluman Cinder Volume
+ description: CPS Cluman Cinder Volume
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ oam_net_name:
+ type: string
+ label: OAM network name
+ description: OAM network name
+ oam_net_ip:
+ type: string
+resources:
+ server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ script_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+
+ network:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: cps_net_name}
+
+ server_pcm:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcm_server_name }
+ image: { get_param: pcm_image_name }
+ flavor: { get_param: pcm_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: pcm_port_0}
+ - port: { get_resource: pcm_port_1}
+ block_device_mapping:
+ - device_name: vdb
+ volume_id: { get_param: pcm_vol}
+ user_data_format: RAW
+ user_data:
+ get_resource: server_init
+
+ pcm_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: cps_net_ip }
+ security_groups: [{ get_param: security_group_name }]
+
+ pcm_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips:
+ - ip_address: { get_param: oam_net_ip }
+ security_groups: [{ get_param: security_group_name }]
+
+ #pcm_vol_attachment:
+ # type: OS::Cinder::VolumeAttachment
+ # properties:
+ # volume_id: { get_param: pcm_vol }
+ # mountpoint: /dev/vdb
+ # instance_uuid: { get_resource: server_pcm }
+outputs:
+ server_pcm_id:
+ description: the pcm nova service id
+ value: { get_resource: server_pcm } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..15b5e3b3a8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
@@ -0,0 +1,161 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: GlobalSubstitutionTypes
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.abstract.nodes.heat.mvs.nested.heat:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ vf_module_id:
+ type: string
+ description: Unique ID for this VF_MODULE instance
+ vf_name:
+ type: string
+ description: The VF Name; defaults to VMVM for the virtual MVM VNF.
+ constraints:
+ - pattern: '[a-zA-Z0-9]+'
+ - max_length: 4
+ - min_length: 4
+ cloud_zone_id:
+ type: string
+ description: The cloud zone for this VF instance
+ vf_instance_num:
+ type: string
+ description: The number for this VF instance
+ constraints:
+ - pattern: '[0-9]+'
+ - max_length: 2
+ - min_length: 2
+ virtual_mgmt_ip_0:
+ type: string
+ description: Virtual management network ip address
+ indx:
+ type: float
+ description: Index of the current instance
+ mvs_mgmt_ip_0:
+ type: list
+ description: List of Management network IP addresses for IPv4
+ entry_schema:
+ type: string
+ flavor:
+ type: string
+ description: Server flavor
+ constraints: [
+ ]
+ key_name:
+ type: string
+ description: SSH key name
+ constraints: [
+ ]
+ vnf_id:
+ type: string
+ description: Unique ID for this VF instance
+ availability_zone_0:
+ type: list
+ description: List of Availability Zone IDs or Names
+ entry_schema:
+ type: string
+ mgmt_net_id:
+ type: string
+ description: Neutron UUID for the Management network
+ constraints: [
+ ]
+ vm_instance_num:
+ type: list
+ description: VM instance number list must be a list of three-digit numeric value
+ entry_schema:
+ type: string
+ bootimage:
+ type: string
+ description: Master bootimage volume id
+ sec_groups:
+ type: list
+ description: Security groups
+ entry_schema:
+ type: string
+ vf_component:
+ type: string
+ description: The component that this VF instance is running
+ constraints:
+ - pattern: '[a-zA-Z0-9]+'
+ - max_length: 3
+ - min_length: 3
+ attributes:
+ vnfci_id_2:
+ type: string
+ vnfci_id_1:
+ type: string
+ requirements:
+ - local_storage_vnfci:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - link_mgmt_port:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ capabilities:
+ os_vnfci:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_mgmt_port:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_vnfci:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_vnfci:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_vnfci:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_vnfci:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..b07fa5b70b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,569 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.compute:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ vf_module_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique ID for this VF_MODULE instance
+ vf_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: The VF Name; defaults to VMVM for the virtual MVM VNF.
+ constraints:
+ - pattern: '[a-zA-Z0-9]+'
+ - max_length: 4
+ - min_length: 4
+ type_name:
+ hidden: false
+ immutable: false
+ type: string
+ cloud_zone_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: The cloud zone for this VF instance
+ vf_instance_num:
+ hidden: false
+ immutable: false
+ type: string
+ description: The number for this VF instance
+ constraints:
+ - pattern: '[0-9]+'
+ - max_length: 2
+ - min_length: 2
+ virtual_mgmt_ip_0:
+ hidden: false
+ immutable: false
+ type: string
+ description: Virtual management network ip address
+ mvs_mgmt_ip_0:
+ hidden: false
+ immutable: false
+ type: list
+ description: List of Management network IP addresses for IPv4
+ entry_schema:
+ type: string
+ compute_image_name:
+ hidden: false
+ immutable: false
+ type: string
+ flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Server flavor
+ constraints: [
+ ]
+ key_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: SSH key name
+ constraints: [
+ ]
+ vnf_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique ID for this VF instance
+ availability_zone_0:
+ hidden: false
+ immutable: false
+ type: list
+ description: List of Availability Zone IDs or Names
+ entry_schema:
+ type: string
+ mgmt_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Neutron UUID for the Management network
+ constraints: [
+ ]
+ vm_instance_num:
+ hidden: false
+ immutable: false
+ type: list
+ description: VM instance number list must be a list of three-digit numeric value
+ entry_schema:
+ type: string
+ bootimage:
+ hidden: false
+ immutable: false
+ type: string
+ description: Master bootimage volume id
+ sec_groups:
+ hidden: false
+ immutable: false
+ type: list
+ description: Security groups
+ entry_schema:
+ type: string
+ vf_component:
+ hidden: false
+ immutable: false
+ type: string
+ description: The component that this VF instance is running
+ constraints:
+ - pattern: '[a-zA-Z0-9]+'
+ - max_length: 3
+ - min_length: 3
+ num_instances:
+ hidden: false
+ immutable: false
+ type: float
+ description: number of instance of the VF_module
+ node_templates:
+ mvs_modules_custIndexVar2:
+ type: org.openecomp.resource.abstract.nodes.heat.mvs.nested.heat
+ directives:
+ - substitutable
+ properties:
+ vf_module_id:
+ - get_input: vf_module_id
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ - concat:
+ - fff
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ vf_name:
+ concat:
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ - vf_name
+ cloud_zone_id:
+ concat:
+ - cloud_zone_id_
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ vf_instance_num:
+ concat:
+ - vf_instance_num_
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ - _bbbb
+ virtual_mgmt_ip_0:
+ get_input: virtual_mgmt_ip_0
+ indx:
+ get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ mvs_mgmt_ip_0: mvs_mgmt_ip_0
+ flavor:
+ a: a
+ b: b
+ e:
+ get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ w:
+ concat:
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ - _pp
+ key_name:
+ - a
+ - b
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ - concat:
+ - p
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ service_template_filter:
+ substitute_service_template: mvs.nested.heatServiceTemplate.yaml
+ count: 2
+ mandatory: true
+ vnf_id: null
+ availability_zone_0:
+ get_input: availability_zone_0
+ mgmt_net_id:
+ get_input: mgmt_net_id
+ vm_instance_num:
+ concat:
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ - _vm_instance_num_
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ - _hhh_
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ - _pppp
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ bootimage:
+ get_input: bootimage
+ sec_groups:
+ get_input: sec_groups
+ vf_component:
+ get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ mvs_modules_custIndexVar1:
+ type: org.openecomp.resource.abstract.nodes.heat.mvs.nested.heat
+ directives:
+ - substitutable
+ properties:
+ vf_module_id:
+ - get_input: vf_module_id
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ - concat:
+ - fff
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ vf_name:
+ concat:
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ - vf_name
+ cloud_zone_id:
+ concat:
+ - cloud_zone_id_
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ vf_instance_num:
+ concat:
+ - vf_instance_num_
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ - _bbbb
+ virtual_mgmt_ip_0:
+ get_input: virtual_mgmt_ip_0
+ indx:
+ get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ mvs_mgmt_ip_0: mvs_mgmt_ip_0
+ flavor:
+ a: a
+ b: b
+ e:
+ get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ w:
+ concat:
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ - _pp
+ key_name:
+ - a
+ - b
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ - concat:
+ - p
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ service_template_filter:
+ substitute_service_template: mvs.nested.heatServiceTemplate.yaml
+ count: 2
+ mandatory: true
+ vnf_id: null
+ availability_zone_0:
+ get_input: availability_zone_0
+ mgmt_net_id:
+ get_input: mgmt_net_id
+ vm_instance_num:
+ concat:
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ - _vm_instance_num_
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ - _hhh_
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ - _pppp
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ bootimage:
+ get_input: bootimage
+ sec_groups:
+ get_input: sec_groups
+ vf_component:
+ get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ mvs_modules_defaultIndexVar:
+ type: org.openecomp.resource.abstract.nodes.heat.mvs.nested.heat
+ directives:
+ - substitutable
+ properties:
+ vf_module_id:
+ - get_input: vf_module_id
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ - concat:
+ - fff
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ vf_name:
+ concat:
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ - vf_name
+ cloud_zone_id:
+ concat:
+ - cloud_zone_id_
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ vf_instance_num:
+ concat:
+ - vf_instance_num_
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ - _bbbb
+ virtual_mgmt_ip_0:
+ get_input: virtual_mgmt_ip_0
+ indx:
+ get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ mvs_mgmt_ip_0: mvs_mgmt_ip_0
+ flavor:
+ a: a
+ b:
+ aa:
+ - sss
+ - concat:
+ - dddd
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ - ppp
+ - sd
+ ppp:
+ concat:
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ - _pppp___
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ eeee: eeeeeee
+ e:
+ get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ w:
+ concat:
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ - _pp
+ key_name:
+ - a
+ - b
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ - concat:
+ - p
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ service_template_filter:
+ substitute_service_template: mvs.nested.heatServiceTemplate.yaml
+ count: 3
+ mandatory: true
+ vnf_id: null
+ availability_zone_0:
+ get_input: availability_zone_0
+ mgmt_net_id:
+ get_input: mgmt_net_id
+ vm_instance_num:
+ concat:
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ - _vm_instance_num_
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ - _hhh_
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ - _pppp
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ bootimage:
+ get_input: bootimage
+ sec_groups:
+ get_input: sec_groups
+ vf_component:
+ get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ server_compute_get_attr_test:
+ type: org.openecomp.resource.vfc.nodes.heat.compute
+ properties:
+ flavor: compute_flavor_name
+ image:
+ get_input: compute_image_name
+ config_drive:
+ get_attribute:
+ - mvs_modules_defaultIndexVar
+ - vnfci_id_1
+ - vnfci_id_2
+ user_data_format:
+ get_attribute:
+ - mvs_modules_defaultIndexVar
+ - vnfci_id_1
+ - 1
+ name: compute_name
+ groups:
+ mvs.vfmodule.heat:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/mvs.vfmodule.heat.yaml
+ description: |
+ Metaswitch MVS (Metaview Server)
+ members:
+ - mvs_modules_custIndexVar2
+ - mvs_modules_custIndexVar1
+ - mvs_modules_defaultIndexVar
+ - server_compute_get_attr_test \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/expectedoutputfiles/mvs.nested.heatServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/expectedoutputfiles/mvs.nested.heatServiceTemplate.yaml
new file mode 100644
index 0000000000..11369f9b68
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/expectedoutputfiles/mvs.nested.heatServiceTemplate.yaml
@@ -0,0 +1,254 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: mvs.nested.heat
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.vnfci:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ vf_module_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique ID for this VF_MODULE instance
+ vf_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: The VF Name; defaults to VMVM for the virtual MVM VNF.
+ constraints:
+ - pattern: '[a-zA-Z0-9]+'
+ - max_length: 4
+ - min_length: 4
+ cloud_zone_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: The cloud zone for this VF instance
+ vf_instance_num:
+ hidden: false
+ immutable: false
+ type: string
+ description: The number for this VF instance
+ constraints:
+ - pattern: '[0-9]+'
+ - max_length: 2
+ - min_length: 2
+ virtual_mgmt_ip_0:
+ hidden: false
+ immutable: false
+ type: string
+ description: Virtual management network ip address
+ indx:
+ hidden: false
+ immutable: false
+ type: float
+ description: Index of the current instance
+ mvs_mgmt_ip_0:
+ hidden: false
+ immutable: false
+ type: list
+ description: List of Management network IP addresses for IPv4
+ entry_schema:
+ type: string
+ flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Server flavor
+ constraints: [
+ ]
+ key_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: SSH key name
+ constraints: [
+ ]
+ vnf_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique ID for this VF instance
+ availability_zone_0:
+ hidden: false
+ immutable: false
+ type: list
+ description: List of Availability Zone IDs or Names
+ entry_schema:
+ type: string
+ mgmt_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Neutron UUID for the Management network
+ constraints: [
+ ]
+ vm_instance_num:
+ hidden: false
+ immutable: false
+ type: list
+ description: VM instance number list must be a list of three-digit numeric value
+ entry_schema:
+ type: string
+ bootimage:
+ hidden: false
+ immutable: false
+ type: string
+ description: Master bootimage volume id
+ sec_groups:
+ hidden: false
+ immutable: false
+ type: list
+ description: Security groups
+ entry_schema:
+ type: string
+ vf_component:
+ hidden: false
+ immutable: false
+ type: string
+ description: The component that this VF instance is running
+ constraints:
+ - pattern: '[a-zA-Z0-9]+'
+ - max_length: 3
+ - min_length: 3
+ node_templates:
+ vnfci:
+ type: org.openecomp.resource.vfc.nodes.heat.vnfci
+ properties:
+ flavor:
+ get_input: flavor
+ key_name:
+ get_input: key_name
+ availability_zone:
+ Fn::Select:
+ - get_input: indx
+ - get_input:
+ - availability_zone_0
+ name:
+ str_replace:
+ template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM
+ params:
+ $VF_NAME:
+ get_input: vf_name
+ $CLOUD_ZONE_ID:
+ get_input: cloud_zone_id
+ $VM_INSTANCE_NUM:
+ Fn::Select:
+ - get_input: indx
+ - get_input:
+ - vm_instance_num
+ $VF_COMPONENT:
+ get_input: vf_component
+ $VF_INSTANCE_NUM:
+ get_input: vf_instance_num
+ mgmt_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: sec_groups
+ fixed_ips:
+ - ip_address:
+ Fn::Select:
+ - get_input: indx
+ - get_input:
+ - get_input: mvs_mgmt_ip_0
+ allowed_address_pairs:
+ - ip_address:
+ get_input: virtual_mgmt_ip_0
+ name:
+ str_replace:
+ template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM-mgmt-port
+ params:
+ $VF_NAME:
+ get_input: vf_name
+ $CLOUD_ZONE_ID:
+ get_input: cloud_zone_id
+ $VM_INSTANCE_NUM:
+ Fn::Select:
+ - get_input: indx
+ - get_input:
+ - vm_instance_num
+ $VF_COMPONENT:
+ get_input: vf_component
+ $VF_INSTANCE_NUM:
+ get_input: vf_instance_num
+ network:
+ get_input: mgmt_net_id
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: vnfci
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ mvs.nested.heat:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/mvs.nested.heat.yaml
+ description: |
+ Metaswitch MVS (Metaview Server)
+ members:
+ - vnfci
+ - mgmt_port
+ outputs:
+ vnfci_id_2:
+ value: vnfci
+ vnfci_id_1:
+ value: vnfci
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.mvs.nested.heat
+ capabilities:
+ os_vnfci:
+ - vnfci
+ - os
+ attachment_mgmt_port:
+ - mgmt_port
+ - attachment
+ endpoint_vnfci:
+ - vnfci
+ - endpoint
+ host_vnfci:
+ - vnfci
+ - host
+ binding_vnfci:
+ - vnfci
+ - binding
+ scalable_vnfci:
+ - vnfci
+ - scalable
+ requirements:
+ local_storage_vnfci:
+ - vnfci
+ - local_storage
+ link_mgmt_port:
+ - mgmt_port
+ - link \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/inputs/MANIFEST.json
new file mode 100644
index 0000000000..c7729c8653
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/inputs/MANIFEST.json
@@ -0,0 +1,19 @@
+{
+ "name": "mvs.vfmodule.heat.yaml",
+ "description": "Metaswitch MVS (Metaview Server)",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "mvs.vfmodule.heat.yaml",
+ "type": "HEAT",
+ "data": [
+ ]
+ },
+ {
+ "file": "mvs.nested.heat.yaml",
+ "type": "HEAT",
+ "data": [
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/inputs/mvs.nested.heat.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/inputs/mvs.nested.heat.yaml
new file mode 100644
index 0000000000..01adb51d71
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/inputs/mvs.nested.heat.yaml
@@ -0,0 +1,129 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Metaswitch MVS (Metaview Server)
+
+parameters:
+ cloud_zone_id:
+ type: string
+ description: The cloud zone for this VF instance
+ vf_name:
+ type: string
+ description: The VF Name; defaults to VMVM for the virtual MVM VNF.
+ constraints:
+ - allowed_pattern: "[a-zA-Z0-9]+"
+ - length: { min: 4, max: 4 }
+ description: Each VF will have a 4-character alphanumeric identifier
+ vf_instance_num:
+ type: string
+ description: The number for this VF instance
+ constraints:
+ - allowed_pattern: "[0-9]+"
+ - length: { min: 2, max: 2 }
+ description: VF instance number must be a two-digit numeric value
+ vf_component:
+ type: string
+ description: The component that this VF instance is running
+ constraints:
+ - allowed_pattern: "[a-zA-Z0-9]+"
+ - length: { min: 3, max: 3 }
+ description: Each VF component will have a 3-character alphanumeric identifier
+ vm_instance_num:
+ type: comma_delimited_list
+ description: VM instance number list must be a list of three-digit numeric value
+ vnf_id:
+ type: string
+ description: Unique ID for this VF instance
+ vf_module_id:
+ type: string
+ description: Unique ID for this VF_MODULE instance
+ bootimage:
+ type: string
+ description: Master bootimage volume id
+ flavor:
+ type: string
+ description: Server flavor
+ constraints:
+ - custom_constraint: nova.flavor
+ key_name:
+ type: string
+ description: SSH key name
+ constraints:
+ - custom_constraint: nova.keypair
+
+ availability_zone_0:
+ type: comma_delimited_list
+ description: List of Availability Zone IDs or Names
+
+ sec_groups:
+ type: comma_delimited_list
+ description: Security groups
+ mgmt_net_id:
+ type: string
+ description: Neutron UUID for the Management network
+ constraints:
+ - custom_constraint: neutron.network
+ virtual_mgmt_ip_0:
+ type: string
+ description: Virtual management network ip address
+
+ mvs_mgmt_ip_0:
+ type: comma_delimited_list
+ description: List of Management network IP addresses for IPv4
+
+ indx:
+ type: number
+ description: Index of the current instance
+
+resources:
+ mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ name:
+ str_replace:
+ template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM-mgmt-port
+ params:
+ $CLOUD_ZONE_ID: { get_param: cloud_zone_id }
+ $VF_NAME: { get_param: vf_name }
+ $VF_INSTANCE_NUM: { get_param: vf_instance_num }
+ $VF_COMPONENT: { get_param: vf_component }
+ $VM_INSTANCE_NUM: { "Fn::Select" : [ { get_param: indx }, { get_param: [vm_instance_num] } ] }
+ network_id: { get_param: mgmt_net_id }
+ security_groups: [{ get_param: sec_groups }]
+
+ fixed_ips:
+ - ip_address: { "Fn::Select" : [ { get_param: indx }, { get_param: [{ get_param: mvs_mgmt_ip_0 }] } ] }
+
+ allowed_address_pairs:
+ - ip_address: { get_param: virtual_mgmt_ip_0 }
+
+
+
+ vnfci:
+ type: OS::Nova::Server
+ properties:
+ name:
+ str_replace:
+ template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM
+ params:
+ $CLOUD_ZONE_ID: { get_param: cloud_zone_id }
+ $VF_NAME: { get_param: vf_name }
+ $VF_INSTANCE_NUM: { get_param: vf_instance_num }
+ $VF_COMPONENT: { get_param: vf_component }
+ $VM_INSTANCE_NUM: { "Fn::Select" : [ { get_param: indx }, { get_param: [vm_instance_num] } ] }
+ flavor: { get_param: flavor }
+ key_name: { get_param: key_name }
+ networks:
+ - port: { get_resource: mgmt_port }
+
+ availability_zone: { "Fn::Select" : [ { get_param: indx }, { get_param: [availability_zone_0] } ] }
+
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ vf_module_id: { get_param: vf_module_id }
+
+outputs:
+ vnfci_id_1:
+ value: { get_resource: vnfci }
+ vnfci_id_2:
+ value: { get_resource: vnfci } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/inputs/mvs.vfmodule.heat.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/inputs/mvs.vfmodule.heat.yaml
new file mode 100644
index 0000000000..6b42078b21
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/inputs/mvs.vfmodule.heat.yaml
@@ -0,0 +1,228 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Metaswitch MVS (Metaview Server)
+
+parameters:
+ cloud_zone_id:
+ type: string
+ description: The cloud zone for this VF instance
+ vf_name:
+ type: string
+ description: The VF Name; defaults to VMVM for the virtual MVM VNF.
+ constraints:
+ - allowed_pattern: "[a-zA-Z0-9]+"
+ - length: { min: 4, max: 4 }
+ description: Each VF will have a 4-character alphanumeric identifier
+ vf_instance_num:
+ type: string
+ description: The number for this VF instance
+ constraints:
+ - allowed_pattern: "[0-9]+"
+ - length: { min: 2, max: 2 }
+ description: VF instance number must be a two-digit numeric value
+ vf_component:
+ type: string
+ description: The component that this VF instance is running
+ constraints:
+ - allowed_pattern: "[a-zA-Z0-9]+"
+ - length: { min: 3, max: 3 }
+ description: Each VF component will have a 3-character alphanumeric identifier
+ vm_instance_num:
+ type: comma_delimited_list
+ description: VM instance number list must be a list of three-digit numeric value
+ vnf_id:
+ type: string
+ description: Unique ID for this VF instance
+ vf_module_id:
+ type: string
+ description: Unique ID for this VF_MODULE instance
+ bootimage:
+ type: string
+ description: Master bootimage volume id
+ flavor:
+ type: string
+ description: Server flavor
+ constraints:
+ - custom_constraint: nova.flavor
+ key_name:
+ type: string
+ description: SSH key name
+ constraints:
+ - custom_constraint: nova.keypair
+ type_name:
+ type: string
+ availability_zone_0:
+ type: comma_delimited_list
+ description: List of Availability Zone IDs or Names
+
+ sec_groups:
+ type: comma_delimited_list
+ description: Security groups
+ mgmt_net_id:
+ type: string
+ description: Neutron UUID for the Management network
+ constraints:
+ - custom_constraint: neutron.network
+ virtual_mgmt_ip_0:
+ type: string
+ description: Virtual management network ip address
+
+ mvs_mgmt_ip_0:
+ type: comma_delimited_list
+ description: List of Management network IP addresses for IPv4
+
+ num_instances:
+ type: number
+ description: number of instance of the VF_module
+
+ compute_image_name:
+ type: string
+
+resources:
+ mvs_modules_defaultIndexVar:
+ type: OS::Heat::ResourceGroup
+ properties:
+ count: 3
+ resource_def:
+ type: mvs.nested.heat.yaml
+ properties:
+ cloud_zone_id: cloud_zone_id_%index%
+ vf_name: "%index%vf_name"
+ vf_instance_num: "vf_instance_num_%index%_bbbb"
+ vf_component: "%index%"
+ vm_instance_num: "%index%_vm_instance_num_%index%_hhh_%index%%index%%index%_pppp%index%"
+ vnf_id:
+ vf_module_id: [{ get_param: vf_module_id }, "%index%", fff%index% ]
+ bootimage: { get_param: bootimage }
+ flavor:
+ a: a
+ b:
+ aa: [sss,dddd%index%ppp, sd]
+ ppp: "%index%_pppp___%index%"
+ eeee: eeeeeee
+ e: "%index%"
+ w: "%index%_pp"
+ key_name: [a,b,"%index%",p%index%]
+ availability_zone_0: { get_param: availability_zone_0 }
+ sec_groups: { get_param: sec_groups }
+ mgmt_net_id: { get_param: mgmt_net_id }
+ virtual_mgmt_ip_0: { get_param: virtual_mgmt_ip_0 }
+ mvs_mgmt_ip_0: mvs_mgmt_ip_0
+ indx: "%index%"
+
+ mvs_modules_custIndexVar1:
+ type: OS::Heat::ResourceGroup
+ properties:
+ count: 2
+ index_var: myIndex
+ resource_def:
+ type: mvs.nested.heat.yaml
+ properties:
+ cloud_zone_id: cloud_zone_id_myIndex
+ vf_name: "myIndexvf_name"
+ vf_instance_num: "vf_instance_num_myIndex_bbbb"
+ vf_component: "myIndex"
+ vm_instance_num: "myIndex_vm_instance_num_myIndex_hhh_myIndexmyIndexmyIndex_ppppmyIndex"
+ vnf_id:
+ vf_module_id: [{ get_param: vf_module_id }, "myIndex", fffmyIndex ]
+ bootimage: { get_param: bootimage }
+ flavor:
+ a: a
+ b: b
+ e: myIndex
+ w: myIndex_pp
+ key_name: [a,b,myIndex,pmyIndex]
+ availability_zone_0: { get_param: availability_zone_0 }
+ sec_groups: { get_param: sec_groups }
+ mgmt_net_id: { get_param: mgmt_net_id }
+ virtual_mgmt_ip_0: { get_param: virtual_mgmt_ip_0 }
+ mvs_mgmt_ip_0: mvs_mgmt_ip_0
+ indx: "myIndex"
+
+ mvs_modules_custIndexVar2:
+ type: OS::Heat::ResourceGroup
+ properties:
+ count: 2
+ index_var: "%myIndex%"
+ resource_def:
+ type: mvs.nested.heat.yaml
+ properties:
+ cloud_zone_id: cloud_zone_id_%myIndex%
+ vf_name: "%myIndex%vf_name"
+ vf_instance_num: "vf_instance_num_%myIndex%_bbbb"
+ vf_component: "%myIndex%"
+ vm_instance_num: "%myIndex%_vm_instance_num_%myIndex%_hhh_%myIndex%%myIndex%%myIndex%_pppp%myIndex%"
+ vnf_id:
+ vf_module_id: [{ get_param: vf_module_id }, "%myIndex%", fff%myIndex% ]
+ bootimage: { get_param: bootimage }
+ flavor:
+ a: a
+ b: b
+ e: "%myIndex%"
+ w: "%myIndex%_pp"
+ key_name: [a,b,"%myIndex%",p%myIndex%]
+ availability_zone_0: { get_param: availability_zone_0 }
+ sec_groups: { get_param: sec_groups }
+ mgmt_net_id: { get_param: mgmt_net_id }
+ virtual_mgmt_ip_0: { get_param: virtual_mgmt_ip_0 }
+ mvs_mgmt_ip_0: mvs_mgmt_ip_0
+ indx: "%myIndex%"
+
+ not_supported_resourceGroup1:
+ type: OS::Heat::ResourceGroup
+ properties:
+ count: 3
+ resource_def:
+ type: OS::Heat::ResourceGroup
+ properties:
+ cloud_zone_id: { get_param: cloud_zone_id }
+ vf_name: { get_param: vf_name }
+ vf_instance_num: { get_param: vf_instance_num }
+ vf_component: { get_param: vf_component }
+ vm_instance_num: { get_param: vm_instance_num }
+ vnf_id: { get_param: vnf_id }
+ vf_module_id: { get_param: vf_module_id }
+ bootimage: { get_param: bootimage }
+ flavor: { get_param: flavor }
+ key_name: { get_param: key_name }
+ availability_zone_0: { get_param: availability_zone_0 }
+ sec_groups: { get_param: sec_groups }
+ mgmt_net_id: { get_param: mgmt_net_id }
+ virtual_mgmt_ip_0: { get_param: virtual_mgmt_ip_0 }
+ mvs_mgmt_ip_0: { get_param: mvs_mgmt_ip_0 }
+ indx: "%index%"
+
+ not_supported_resourceGroup2:
+ type: OS::Heat::ResourceGroup
+ properties:
+ count: 3
+ resource_def:
+ type: { get_param: type_name }
+ properties:
+ cloud_zone_id: { get_param: cloud_zone_id }
+ vf_name: { get_param: vf_name }
+ vf_instance_num: { get_param: vf_instance_num }
+ vf_component: { get_param: vf_component }
+ vm_instance_num: { get_param: vm_instance_num }
+ vnf_id: { get_param: vnf_id }
+ vf_module_id: { get_param: vf_module_id }
+ bootimage: { get_param: bootimage }
+ flavor: { get_param: flavor }
+ key_name: { get_param: key_name }
+ availability_zone_0: { get_param: availability_zone_0 }
+ sec_groups: { get_param: sec_groups }
+ mgmt_net_id: { get_param: mgmt_net_id }
+ virtual_mgmt_ip_0: { get_param: virtual_mgmt_ip_0 }
+ mvs_mgmt_ip_0: { get_param: mvs_mgmt_ip_0 }
+ indx: "%index%"
+
+ server_compute_get_attr_test:
+ type: OS::Nova::Server
+ properties:
+ config_drive: {get_attr: [mvs_modules_defaultIndexVar]}
+ name: compute_name
+ image: { get_param: compute_image_name }
+ flavor: compute_flavor_name
+ user_data_format: { get_attr: [mvs_modules_defaultIndexVar , resource.1.vnfci_id_1] }
+ user_data: { get_attr: [mvs_modules_defaultIndexVar, resource.vnfci_id_2]}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupInvalid/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupInvalid/inputs/MANIFEST.json
new file mode 100644
index 0000000000..c7729c8653
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupInvalid/inputs/MANIFEST.json
@@ -0,0 +1,19 @@
+{
+ "name": "mvs.vfmodule.heat.yaml",
+ "description": "Metaswitch MVS (Metaview Server)",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "mvs.vfmodule.heat.yaml",
+ "type": "HEAT",
+ "data": [
+ ]
+ },
+ {
+ "file": "mvs.nested.heat.yaml",
+ "type": "HEAT",
+ "data": [
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupInvalid/inputs/mvs.nested.heat.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupInvalid/inputs/mvs.nested.heat.yaml
new file mode 100644
index 0000000000..01adb51d71
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupInvalid/inputs/mvs.nested.heat.yaml
@@ -0,0 +1,129 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Metaswitch MVS (Metaview Server)
+
+parameters:
+ cloud_zone_id:
+ type: string
+ description: The cloud zone for this VF instance
+ vf_name:
+ type: string
+ description: The VF Name; defaults to VMVM for the virtual MVM VNF.
+ constraints:
+ - allowed_pattern: "[a-zA-Z0-9]+"
+ - length: { min: 4, max: 4 }
+ description: Each VF will have a 4-character alphanumeric identifier
+ vf_instance_num:
+ type: string
+ description: The number for this VF instance
+ constraints:
+ - allowed_pattern: "[0-9]+"
+ - length: { min: 2, max: 2 }
+ description: VF instance number must be a two-digit numeric value
+ vf_component:
+ type: string
+ description: The component that this VF instance is running
+ constraints:
+ - allowed_pattern: "[a-zA-Z0-9]+"
+ - length: { min: 3, max: 3 }
+ description: Each VF component will have a 3-character alphanumeric identifier
+ vm_instance_num:
+ type: comma_delimited_list
+ description: VM instance number list must be a list of three-digit numeric value
+ vnf_id:
+ type: string
+ description: Unique ID for this VF instance
+ vf_module_id:
+ type: string
+ description: Unique ID for this VF_MODULE instance
+ bootimage:
+ type: string
+ description: Master bootimage volume id
+ flavor:
+ type: string
+ description: Server flavor
+ constraints:
+ - custom_constraint: nova.flavor
+ key_name:
+ type: string
+ description: SSH key name
+ constraints:
+ - custom_constraint: nova.keypair
+
+ availability_zone_0:
+ type: comma_delimited_list
+ description: List of Availability Zone IDs or Names
+
+ sec_groups:
+ type: comma_delimited_list
+ description: Security groups
+ mgmt_net_id:
+ type: string
+ description: Neutron UUID for the Management network
+ constraints:
+ - custom_constraint: neutron.network
+ virtual_mgmt_ip_0:
+ type: string
+ description: Virtual management network ip address
+
+ mvs_mgmt_ip_0:
+ type: comma_delimited_list
+ description: List of Management network IP addresses for IPv4
+
+ indx:
+ type: number
+ description: Index of the current instance
+
+resources:
+ mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ name:
+ str_replace:
+ template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM-mgmt-port
+ params:
+ $CLOUD_ZONE_ID: { get_param: cloud_zone_id }
+ $VF_NAME: { get_param: vf_name }
+ $VF_INSTANCE_NUM: { get_param: vf_instance_num }
+ $VF_COMPONENT: { get_param: vf_component }
+ $VM_INSTANCE_NUM: { "Fn::Select" : [ { get_param: indx }, { get_param: [vm_instance_num] } ] }
+ network_id: { get_param: mgmt_net_id }
+ security_groups: [{ get_param: sec_groups }]
+
+ fixed_ips:
+ - ip_address: { "Fn::Select" : [ { get_param: indx }, { get_param: [{ get_param: mvs_mgmt_ip_0 }] } ] }
+
+ allowed_address_pairs:
+ - ip_address: { get_param: virtual_mgmt_ip_0 }
+
+
+
+ vnfci:
+ type: OS::Nova::Server
+ properties:
+ name:
+ str_replace:
+ template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM
+ params:
+ $CLOUD_ZONE_ID: { get_param: cloud_zone_id }
+ $VF_NAME: { get_param: vf_name }
+ $VF_INSTANCE_NUM: { get_param: vf_instance_num }
+ $VF_COMPONENT: { get_param: vf_component }
+ $VM_INSTANCE_NUM: { "Fn::Select" : [ { get_param: indx }, { get_param: [vm_instance_num] } ] }
+ flavor: { get_param: flavor }
+ key_name: { get_param: key_name }
+ networks:
+ - port: { get_resource: mgmt_port }
+
+ availability_zone: { "Fn::Select" : [ { get_param: indx }, { get_param: [availability_zone_0] } ] }
+
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ vf_module_id: { get_param: vf_module_id }
+
+outputs:
+ vnfci_id_1:
+ value: { get_resource: vnfci }
+ vnfci_id_2:
+ value: { get_resource: vnfci } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupInvalid/inputs/mvs.vfmodule.heat.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupInvalid/inputs/mvs.vfmodule.heat.yaml
new file mode 100644
index 0000000000..d71dd81fbf
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupInvalid/inputs/mvs.vfmodule.heat.yaml
@@ -0,0 +1,166 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Metaswitch MVS (Metaview Server)
+
+parameters:
+ cloud_zone_id:
+ type: string
+ description: The cloud zone for this VF instance
+ index_parameter:
+ type: string
+ vf_name:
+ type: string
+ description: The VF Name; defaults to VMVM for the virtual MVM VNF.
+ constraints:
+ - allowed_pattern: "[a-zA-Z0-9]+"
+ - length: { min: 4, max: 4 }
+ description: Each VF will have a 4-character alphanumeric identifier
+ vf_instance_num:
+ type: string
+ description: The number for this VF instance
+ constraints:
+ - allowed_pattern: "[0-9]+"
+ - length: { min: 2, max: 2 }
+ description: VF instance number must be a two-digit numeric value
+ vf_component:
+ type: string
+ description: The component that this VF instance is running
+ constraints:
+ - allowed_pattern: "[a-zA-Z0-9]+"
+ - length: { min: 3, max: 3 }
+ description: Each VF component will have a 3-character alphanumeric identifier
+ vm_instance_num:
+ type: comma_delimited_list
+ description: VM instance number list must be a list of three-digit numeric value
+ vnf_id:
+ type: string
+ description: Unique ID for this VF instance
+ vf_module_id:
+ type: string
+ description: Unique ID for this VF_MODULE instance
+ bootimage:
+ type: string
+ description: Master bootimage volume id
+ flavor:
+ type: string
+ description: Server flavor
+ constraints:
+ - custom_constraint: nova.flavor
+ key_name:
+ type: string
+ description: SSH key name
+ constraints:
+ - custom_constraint: nova.keypair
+ type_name:
+ type: string
+ availability_zone_0:
+ type: comma_delimited_list
+ description: List of Availability Zone IDs or Names
+
+ sec_groups:
+ type: comma_delimited_list
+ description: Security groups
+ mgmt_net_id:
+ type: string
+ description: Neutron UUID for the Management network
+ constraints:
+ - custom_constraint: neutron.network
+ virtual_mgmt_ip_0:
+ type: string
+ description: Virtual management network ip address
+
+ mvs_mgmt_ip_0:
+ type: comma_delimited_list
+ description: List of Management network IP addresses for IPv4
+
+ num_instances:
+ type: number
+ description: number of instance of the VF_module
+
+ compute_image_name:
+ type: string
+
+resources:
+ mvs_modules:
+ type: OS::Heat::ResourceGroup
+ properties:
+ count: 3
+ index_var: { get_param: index_parameter }
+ resource_def:
+ type: mvs.nested.heat.yaml
+ properties:
+ cloud_zone_id: { get_param: cloud_zone_id }
+ vf_name: { get_param: vf_name }
+ vf_instance_num: { get_param: vf_instance_num }
+ vf_component: { get_param: vf_component }
+ vm_instance_num: { get_param: vm_instance_num }
+ vnf_id: { get_param: vnf_id }
+ vf_module_id: { get_param: vf_module_id }
+ bootimage: { get_param: bootimage }
+ flavor: { get_param: flavor }
+ key_name: { get_param: key_name }
+ availability_zone_0: { get_param: availability_zone_0 }
+ sec_groups: { get_param: sec_groups }
+ mgmt_net_id: { get_param: mgmt_net_id }
+ virtual_mgmt_ip_0: { get_param: virtual_mgmt_ip_0 }
+ mvs_mgmt_ip_0: { get_param: mvs_mgmt_ip_0 }
+ indx: "%index%"
+
+ not_supported_resourceGroup1:
+ type: OS::Heat::ResourceGroup
+ properties:
+ count: 3
+ resource_def:
+ type: OS::Heat::ResourceGroup
+ properties:
+ cloud_zone_id: { get_param: cloud_zone_id }
+ vf_name: { get_param: vf_name }
+ vf_instance_num: { get_param: vf_instance_num }
+ vf_component: { get_param: vf_component }
+ vm_instance_num: { get_param: vm_instance_num }
+ vnf_id: { get_param: vnf_id }
+ vf_module_id: { get_param: vf_module_id }
+ bootimage: { get_param: bootimage }
+ flavor: { get_param: flavor }
+ key_name: { get_param: key_name }
+ availability_zone_0: { get_param: availability_zone_0 }
+ sec_groups: { get_param: sec_groups }
+ mgmt_net_id: { get_param: mgmt_net_id }
+ virtual_mgmt_ip_0: { get_param: virtual_mgmt_ip_0 }
+ mvs_mgmt_ip_0: { get_param: mvs_mgmt_ip_0 }
+ indx: "%index%"
+
+ not_supported_resourceGroup2:
+ type: OS::Heat::ResourceGroup
+ properties:
+ count: 3
+ resource_def:
+ type: { get_param: type_name }
+ properties:
+ cloud_zone_id: { get_param: cloud_zone_id }
+ vf_name: { get_param: vf_name }
+ vf_instance_num: { get_param: vf_instance_num }
+ vf_component: { get_param: vf_component }
+ vm_instance_num: { get_param: vm_instance_num }
+ vnf_id: { get_param: vnf_id }
+ vf_module_id: { get_param: vf_module_id }
+ bootimage: { get_param: bootimage }
+ flavor: { get_param: flavor }
+ key_name: { get_param: key_name }
+ availability_zone_0: { get_param: availability_zone_0 }
+ sec_groups: { get_param: sec_groups }
+ mgmt_net_id: { get_param: mgmt_net_id }
+ virtual_mgmt_ip_0: { get_param: virtual_mgmt_ip_0 }
+ mvs_mgmt_ip_0: { get_param: mvs_mgmt_ip_0 }
+ indx: "%index%"
+
+ server_compute_get_attr_test:
+ type: OS::Nova::Server
+ properties:
+ config_drive: {get_attr: [mvs_modules]}
+ name: compute_name
+ image: { get_param: compute_image_name }
+ flavor: compute_flavor_name
+ user_data_format: { get_attr: [mvs_modules , resource.1.vnfci_id_1] }
+ user_data: { get_attr: [mvs_modules, resource.vnfci_id_2]}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..ec3b692135
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
@@ -0,0 +1,153 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: GlobalSubstitutionTypes
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.abstract.nodes.heat.dns_nested_01:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ vf_module_id:
+ type: string
+ description: Unique ID for this VF module instance
+ name_with_index:
+ type: string
+ description: name parameter which will include the index value
+ dns_int_bearer_ips:
+ type: list
+ description: DNS Bearer IP list
+ entry_schema:
+ type: string
+ vnf_name:
+ type: string
+ description: Unique name for this VF instance
+ index:
+ type: float
+ description: index parameter
+ security_group:
+ type: string
+ description: security group
+ oam_protected_net_name:
+ type: string
+ description: OAM network where instaces will connect
+ dns_oam_protected_ips:
+ type: list
+ description: DNS OAM IP list
+ entry_schema:
+ type: string
+ dns_key:
+ type: string
+ description: server key
+ int_bearer_net_name:
+ type: string
+ description: Bearer network where instaces will connect
+ route_eth0:
+ type: string
+ description: OAM network routes
+ dns_names:
+ type: list
+ description: server name
+ entry_schema:
+ type: string
+ vnf_id:
+ type: string
+ description: Unique ID for this VF instance
+ availability_zone_0:
+ type: string
+ description: availability zone ID or Name
+ dns_image_name:
+ type: string
+ description: server image
+ dns_int_bearer_ipv6_ips:
+ type: list
+ description: fixed IPv6 assignment for VM's on the Bearer network
+ entry_schema:
+ type: string
+ dns_flavor_name:
+ type: string
+ description: server flavor
+ requirements:
+ - link_dns_oam_protected_0_port:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_dns_int_bearer_0_port:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - local_storage_dns_servers:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ capabilities:
+ host_dns_servers:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_dns_int_bearer_0_port:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_dns_oam_protected_0_port:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_dns_servers:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_dns_servers:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_dns_servers:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_dns_servers:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..6eae1ff185
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,246 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ vf_module_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique ID for this VF module instance
+ dns_int_bearer_ips:
+ hidden: false
+ immutable: false
+ type: list
+ description: DNS Bearer IP list
+ entry_schema:
+ type: string
+ vnf_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique name for this VF instance
+ oam_protected_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: OAM network where instaces will connect
+ dns_oam_protected_ips:
+ hidden: false
+ immutable: false
+ type: list
+ description: DNS OAM IP list
+ entry_schema:
+ type: string
+ dns_key:
+ hidden: false
+ immutable: false
+ type: string
+ description: creator's ssh public key
+ int_bearer_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Bearer network where instaces will connect
+ route_eth0:
+ hidden: false
+ immutable: false
+ type: string
+ description: OAM network routes
+ vnf_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique ID for this VF instance
+ availability_zone_0:
+ hidden: false
+ immutable: false
+ type: string
+ description: availability zone ID or Name
+ DNS_shared_sec_grp_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: security group UUID
+ node_count:
+ hidden: false
+ immutable: false
+ type: float
+ description: the number of DNS nested instances
+ default: 4
+ dns_image_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: operative system image
+ default: NIMBUS_DNS_3.0.2.qcow2
+ dns_int_bearer_ipv6_ips:
+ hidden: false
+ immutable: false
+ type: list
+ description: fixed IP assignment for VM's on the Bearer network
+ entry_schema:
+ type: string
+ dns_server_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: DNS VM server name list
+ entry_schema:
+ type: string
+ dns_flavor_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: resources to by appplied on instances
+ default: nv.c4r4d80
+ node_templates:
+ dns_server_group_az:
+ type: org.openecomp.resource.abstract.nodes.heat.dns_nested_01
+ directives:
+ - substitutable
+ properties:
+ vf_module_id:
+ get_input: vf_module_id
+ name_with_index:
+ concat:
+ - name_
+ - get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ dns_int_bearer_ips:
+ get_input: dns_int_bearer_ips
+ vnf_name:
+ get_input: vnf_name
+ index:
+ get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ security_group:
+ get_input: DNS_shared_sec_grp_id
+ oam_protected_net_name:
+ get_input: oam_protected_net_name
+ dns_oam_protected_ips:
+ get_input: dns_oam_protected_ips
+ dns_key:
+ get_input: dns_key
+ int_bearer_net_name:
+ get_input: int_bearer_net_name
+ route_eth0:
+ get_input: route_eth0
+ service_template_filter:
+ substitute_service_template: dns_nested_01ServiceTemplate.yaml
+ count:
+ get_input: node_count
+ mandatory: false
+ dns_names:
+ get_input: dns_server_names
+ vnf_id:
+ get_input: vnf_id
+ availability_zone_0:
+ get_input: availability_zone_0
+ dns_image_name:
+ get_input: dns_image_name
+ dns_int_bearer_ipv6_ips:
+ get_input: dns_int_bearer_ipv6_ips
+ dns_flavor_name:
+ get_input: dns_flavor_name
+ DNS_SECURITY_GROUP:
+ type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules
+ properties:
+ name:
+ str_replace:
+ template: VF_NAME_sec_grp_DNS
+ params:
+ VF_NAME:
+ get_input: vnf_name
+ description: vscp security group
+ rules:
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ requirements:
+ - port:
+ capability: attachment_dns_int_bearer_0_port
+ node: dns_server_group_az
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: attachment_dns_oam_protected_0_port
+ node: dns_server_group_az
+ relationship: org.openecomp.relationships.AttachesTo
+ groups:
+ base_dns:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/base_dns.yaml
+ description: |
+ Base HOT template to create The Security Group for the the DNS VNF
+ members:
+ - DNS_SECURITY_GROUP
+ dns_az_01:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/dns_az_01.yaml
+ description: DNS master template
+ members:
+ - dns_server_group_az \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/expectedoutputfiles/dns_nested_01ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/expectedoutputfiles/dns_nested_01ServiceTemplate.yaml
new file mode 100644
index 0000000000..db6b3a0179
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/expectedoutputfiles/dns_nested_01ServiceTemplate.yaml
@@ -0,0 +1,249 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: dns_nested_01
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.dns:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ vf_module_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique ID for this VF module instance
+ name_with_index:
+ hidden: false
+ immutable: false
+ type: string
+ description: name parameter which will include the index value
+ dns_int_bearer_ips:
+ hidden: false
+ immutable: false
+ type: list
+ description: DNS Bearer IP list
+ entry_schema:
+ type: string
+ vnf_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique name for this VF instance
+ index:
+ hidden: false
+ immutable: false
+ type: float
+ description: index parameter
+ security_group:
+ hidden: false
+ immutable: false
+ type: string
+ description: security group
+ oam_protected_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: OAM network where instaces will connect
+ dns_oam_protected_ips:
+ hidden: false
+ immutable: false
+ type: list
+ description: DNS OAM IP list
+ entry_schema:
+ type: string
+ dns_key:
+ hidden: false
+ immutable: false
+ type: string
+ description: server key
+ int_bearer_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Bearer network where instaces will connect
+ route_eth0:
+ hidden: false
+ immutable: false
+ type: string
+ description: OAM network routes
+ dns_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: server name
+ entry_schema:
+ type: string
+ vnf_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique ID for this VF instance
+ availability_zone_0:
+ hidden: false
+ immutable: false
+ type: string
+ description: availability zone ID or Name
+ dns_image_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: server image
+ dns_int_bearer_ipv6_ips:
+ hidden: false
+ immutable: false
+ type: list
+ description: fixed IPv6 assignment for VM's on the Bearer network
+ entry_schema:
+ type: string
+ dns_flavor_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: server flavor
+ node_templates:
+ dns_oam_protected_0_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: security_group
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - dns_oam_protected_ips
+ - get_input: index
+ name:
+ str_replace:
+ template: VNF_NAME_dns_oam_port
+ params:
+ VNF_NAME:
+ get_input: vnf_name
+ network:
+ get_input: oam_protected_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: dns_servers
+ relationship: tosca.relationships.network.BindsTo
+ dns_int_bearer_0_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: security_group
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - dns_int_bearer_ips
+ - get_input: index
+ - ip_address:
+ get_input:
+ - dns_int_bearer_ipv6_ips
+ - get_input: index
+ name:
+ str_replace:
+ template: VNF_NAME_dns_bearer_port
+ params:
+ VNF_NAME:
+ get_input: vnf_name
+ network:
+ get_input: int_bearer_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: dns_servers
+ relationship: tosca.relationships.network.BindsTo
+ dns_servers:
+ type: org.openecomp.resource.vfc.nodes.heat.dns
+ properties:
+ flavor:
+ get_input: dns_flavor_name
+ key_name:
+ get_input: dns_key
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: dns_image_name
+ metadata:
+ vf_module_id:
+ get_input: vf_module_id
+ vnf_name {get_param: vnf_name }
+ vnf_id:
+ get_input: vnf_id
+ user_data_format: RAW
+ name:
+ get_input:
+ - dns_names
+ - get_input: index
+ groups:
+ dns_nested_01:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/dns_nested_01.yaml
+ description: |
+ nested DNS template for a single VM
+ all parameters are passed from calling heat template of resourcegroup
+ members:
+ - dns_oam_protected_0_port
+ - dns_int_bearer_0_port
+ - dns_servers
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.dns_nested_01
+ capabilities:
+ host_dns_servers:
+ - dns_servers
+ - host
+ attachment_dns_int_bearer_0_port:
+ - dns_int_bearer_0_port
+ - attachment
+ attachment_dns_oam_protected_0_port:
+ - dns_oam_protected_0_port
+ - attachment
+ os_dns_servers:
+ - dns_servers
+ - os
+ endpoint_dns_servers:
+ - dns_servers
+ - endpoint
+ binding_dns_servers:
+ - dns_servers
+ - binding
+ scalable_dns_servers:
+ - dns_servers
+ - scalable
+ requirements:
+ local_storage_dns_servers:
+ - dns_servers
+ - local_storage
+ link_dns_oam_protected_0_port:
+ - dns_oam_protected_0_port
+ - link
+ link_dns_int_bearer_0_port:
+ - dns_int_bearer_0_port
+ - link \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/MANIFEST.json
new file mode 100644
index 0000000000..0fa0f714da
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/MANIFEST.json
@@ -0,0 +1,37 @@
+{
+ "name": "",
+ "description": "",
+ "data": [
+ {
+ "file": "dns_nested_01.yaml",
+ "type": "HEAT",
+ "isBase": "false"
+ },
+ {
+ "file": "base_dns.yaml",
+ "type": "HEAT",
+ "isBase": "true",
+ "data": [
+ {
+ "file": "base_dns.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "dns_az_01.yaml",
+ "type": "HEAT",
+ "isBase": "false",
+ "data": [
+ {
+ "file": "dns_az_01.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "nimbus-willows-2.pem",
+ "type": "OTHER"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/base_dns.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/base_dns.env
new file mode 100644
index 0000000000..3ab724f7ab
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/base_dns.env
@@ -0,0 +1,8 @@
+##NIMBUS - DNS Base Template ENV File
+#AUTHORS:
+
+#####################
+parameters:
+#####################
+
+# vnf_name: 'zrdm3mdns01'
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/base_dns.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/base_dns.yaml
new file mode 100644
index 0000000000..821f10212f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/base_dns.yaml
@@ -0,0 +1,43 @@
+heat_template_version: 2015-04-30
+#Nimbus DNS Base Template
+#AUTHORS:
+description: >
+ Base HOT template to create The Security Group for the the DNS VNF
+
+#####################
+parameters:
+#####################
+
+## GLOBAL//Basic Parameters
+ vnf_name:
+ type: string
+ description: Unique name for this VF instance
+# For manual spinups, value must be in the ENV file. Must be removed from ENV before uploading to ASDC
+
+#####################
+resources:
+#####################
+
+ DNS_SECURITY_GROUP:
+ type: OS::Neutron::SecurityGroup
+ properties:
+ description: vscp security group
+ name:
+ str_replace:
+ template: VF_NAME_sec_grp_DNS
+ params:
+ VF_NAME: {get_param: vnf_name}
+ rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}
+ ]
+
+
+outputs:
+ DNS_shared_sec_grp_id:
+ description: UUID of DNS Resource SecurityGroup
+ value: { get_resource: DNS_SECURITY_GROUP }
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/dns_az_01.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/dns_az_01.env
new file mode 100644
index 0000000000..8e0e80c67f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/dns_az_01.env
@@ -0,0 +1,21 @@
+parameters:
+ dns_image_name: NIMBUS_DNS_3.0.2.qcow2
+ dns_flavor_name: nv.c4r4d80
+# dns_key: nimbus-willows-1
+# oam_protected_net_name: MNS-25180-L-06Shared_OAM_PROTECTED_NET_1
+# int_bearer_net_name: Nimbus-25193-T-Willows1_int_fw_dns_trusted_net_1
+ node_count: 4
+# dns_oam_protected_ips: 107.239.81.114,107.239.81.115,107.239.81.116,107.239.81.117
+# dns_int_bearer_ips: 172.26.18.64,172.26.18.65,172.26.18.66,172.26.18.67
+# dns_int_bearer_ipv6_ips: fd00:2600:2600:101::40,fd00:2600:2600:101::41,fd00:2600:2600:101::42,fd00:2600:2600:101::43
+# dns_server_names: zrdm3mdns01cmd001,zrdm3mdns01cmd002,zrdm3mdns01cmd003,zrdm3mdns01cmd004
+# route_eth0: |
+# 10.147.38.211/32 via 107.239.81.1 dev eth0
+# 155.165.201.253/32 via 107.239.81.1 dev eth0
+# 141.204.0.0/16 via 107.239.81.1 dev eth0
+# DNS_shared_sec_grp_id: 5f809b4c-a1af-4064-86ef-0aebb761a749
+# availability_zone_0: rdm3-kvm-az01
+# vnf_name: 'zrdm3mdns01'
+# vnf_id: 'dummy'
+# vf_module_id: 'dummy'
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/dns_az_01.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/dns_az_01.yaml
new file mode 100644
index 0000000000..84aacaba35
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/dns_az_01.yaml
@@ -0,0 +1,94 @@
+heat_template_version: 2014-10-16
+
+description: DNS master template
+
+parameters:
+ dns_image_name:
+ type: string
+ description: operative system image
+ dns_flavor_name:
+ type: string
+ description: resources to by appplied on instances
+ dns_key:
+ type: string
+ description: creator's ssh public key
+ node_count:
+ type: number
+ description: the number of DNS nested instances
+ oam_protected_net_name:
+ type: string
+ description: OAM network where instaces will connect
+ int_bearer_net_name:
+ type: string
+ description: Bearer network where instaces will connect
+ dns_oam_protected_ips:
+ type: comma_delimited_list
+ description: DNS OAM IP list
+ dns_int_bearer_ips:
+ type: comma_delimited_list
+ description: DNS Bearer IP list
+ dns_int_bearer_ipv6_ips:
+ type: comma_delimited_list
+ description: fixed IP assignment for VM's on the Bearer network
+ dns_server_names:
+ type: comma_delimited_list
+ description: DNS VM server name list
+ route_eth0:
+ type: string
+ description: OAM network routes
+ DNS_shared_sec_grp_id:
+ type: string
+ description: security group UUID
+ availability_zone_0:
+ type: string
+ description: availability zone ID or Name
+ vnf_name:
+ type: string
+ description: Unique name for this VF instance
+# For manual spinups, value must be in the ENV file. Must be removed from ENV before uploading to ASDC
+ vnf_id:
+ type: string
+ description: Unique ID for this VF instance
+# For manual spinups, value must be in the ENV file. Must be removed from ENV before uploading to ASDC
+ vf_module_id:
+ type: string
+ description: Unique ID for this VF module instance
+# For manual spinups, value must be in the ENV file. Must be removed from ENV before uploading to ASDC
+
+
+resources:
+ dns_server_group_az:
+ type: OS::Heat::ResourceGroup
+ properties:
+ count: { get_param: node_count }
+ index_var: index
+ resource_def:
+ type: dns_nested_01.yaml
+ properties:
+ index: index
+ name_with_index: name_index
+ dns_image_name: { get_param: dns_image_name }
+ dns_flavor_name: { get_param: dns_flavor_name }
+ dns_key: { get_param: dns_key }
+ availability_zone_0: { get_param: availability_zone_0 }
+ security_group: { get_param: DNS_shared_sec_grp_id }
+ oam_protected_net_name: { get_param: oam_protected_net_name }
+ int_bearer_net_name: { get_param: int_bearer_net_name }
+ dns_oam_protected_ips: { get_param: dns_oam_protected_ips }
+ dns_int_bearer_ips: { get_param: dns_int_bearer_ips }
+ dns_int_bearer_ipv6_ips: { get_param: dns_int_bearer_ipv6_ips }
+ dns_names: { get_param: dns_server_names }
+ route_eth0: { get_param: route_eth0 }
+ vnf_name: { get_param: vnf_name }
+ vnf_id: { get_param: vnf_id }
+ vf_module_id: {get_param: vf_module_id}
+
+#outputs:
+# vm_name:
+# description: VM name
+# value: { get_attr: [ dns_server_group_az, vm_name ] }
+# networks:
+# description: networks
+# value: { get_attr: [ dns_server_group_az, networks ] }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/dns_nested_01.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/dns_nested_01.yaml
new file mode 100644
index 0000000000..5be9d49bb0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/dns_nested_01.yaml
@@ -0,0 +1,127 @@
+heat_template_version: 2014-10-16
+
+description: |
+ nested DNS template for a single VM
+ all parameters are passed from calling heat template of resourcegroup
+
+parameters:
+ dns_image_name:
+ type: string
+ description: server image
+ dns_flavor_name:
+ type: string
+ description: server flavor
+ dns_key:
+ type: string
+ description: server key
+ oam_protected_net_name:
+ type: string
+ description: OAM network where instaces will connect
+ int_bearer_net_name:
+ type: string
+ description: Bearer network where instaces will connect
+ dns_oam_protected_ips:
+ type: comma_delimited_list
+ description: DNS OAM IP list
+ dns_int_bearer_ips:
+ type: comma_delimited_list
+ description: DNS Bearer IP list
+ dns_int_bearer_ipv6_ips:
+ type: comma_delimited_list
+ description: fixed IPv6 assignment for VM's on the Bearer network
+ dns_names:
+ type: comma_delimited_list
+ description: server name
+ route_eth0:
+ type: string
+ description: OAM network routes
+ index:
+ type: number
+ description: index parameter
+ name_with_index:
+ type: string
+ description: name parameter which will include the index value
+ security_group:
+ type: string
+ description: security group
+ availability_zone_0:
+ type: string
+ description: availability zone ID or Name
+# this parameter does not follow the D2 Guidelines. This value will be az0 or az1.
+ vnf_name:
+ type: string
+ description: Unique name for this VF instance
+# For manual spinups, value must be in the ENV file. Must be removed from ENV before uploading to ASDC
+ vnf_id:
+ type: string
+ description: Unique ID for this VF instance
+# For manual spinups, value must be in the ENV file. Must be removed from ENV before uploading to ASDC
+ vf_module_id:
+ type: string
+ description: Unique ID for this VF module instance
+# For manual spinups, value must be in the ENV file. Must be removed from ENV before uploading to ASDC
+
+
+resources:
+
+ dns_oam_protected_0_port:
+ type: OS::Neutron::Port
+ properties:
+ name:
+ str_replace:
+ template: VNF_NAME_dns_oam_port
+ params:
+ VNF_NAME: {get_param: vnf_name}
+ network: { get_param: oam_protected_net_name }
+ fixed_ips: [{ "ip_address": { get_param: [ dns_oam_protected_ips, get_param: index ]}}]
+ security_groups: [{ get_param: security_group }]
+
+ dns_int_bearer_0_port:
+ type: OS::Neutron::Port
+ properties:
+ name:
+ str_replace:
+ template: VNF_NAME_dns_bearer_port
+ params:
+ VNF_NAME: {get_param: vnf_name}
+ network: { get_param: int_bearer_net_name }
+ fixed_ips: [{ "ip_address": { get_param: [ dns_int_bearer_ips, get_param: index ]}}, { "ip_address": { get_param: [ dns_int_bearer_ipv6_ips, get_param: index ]}}]
+ security_groups: [{ get_param: security_group }]
+
+ dns_servers:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [ dns_names, get_param: index ] }
+ image: { get_param: dns_image_name }
+ flavor: { get_param: dns_flavor_name }
+ key_name: { get_param: dns_key }
+ availability_zone: { get_param: availability_zone_0 }
+ networks:
+ - port: { get_resource: dns_oam_protected_0_port }
+ - port: { get_resource: dns_int_bearer_0_port }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ vf_module_id: { get_param: vf_module_id }
+ vnf_name {get_param: vnf_name }
+ user_data_format: RAW
+ user_data: { get_resource: server_interface_config }
+
+ server_interface_config:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/route-eth0
+ permissions: "0644"
+# content: { get_file: route-eth0 }
+ content: { get_param: route_eth0 }
+
+#outputs:
+# vm_name:
+# description: VM name
+# value: { get_attr: [ dns_servers, name] }
+# networks:
+# description: networks
+# value: { get_attr: [ dns_servers, networks ] }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/nimbus-willows-2.pem b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/nimbus-willows-2.pem
new file mode 100644
index 0000000000..ca613f176c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/nimbus-willows-2.pem
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEpAIBAAKCAQEA4JxAkJFmleoEjB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6jA5L5Hv4VDQ+yYbq
++kErp/raYld8zQt3svxi27KfVDj7/yEZE1DtrsuhPmVug81sIPPXmC13DyolC9+B
+KIssA/SRbpteGiI6NEqcpuL+TzTd5l9BR65ni7+qBwlI1NA7gxmqvtKp/jVxN/+j
+8dhff33JP4RUTlsRmz7cG9sCgYBBxE4PXQ6WMo3dSfj8T255C42S5Uhuxvg9Hrru
+cHAk/VmrQrdclXfTBPfVLpq7cIMBUlk0fGV/T8Nu2qc5/2eLgRLQ4v7pdAmLKO4s
+PJqhU3ECEJYH3/Nx2rtjrQojwkaGFSsiNHX9nmZdSAcoi8tOIgVOGMCCIhEbMMBx
+vhZ+7wKBgQDizYvqTOyODzi3cebk7LzbSg+r1cNE9onvCVej+pnznt5oQtniAzS6
+GbGyKsDHDtmQ15tXdnU2KkTcsXEs9nFxIsOR2QZtQRcMSuRtye5o2qPXf0HdHW/M
+5mheJi2LfaNP5csauJ/WUJYbAS4cn7dz4xUos+7la58upB/or+Q/cg==
+-----END RSA PRIVATE KEY-----
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..15b5e3b3a8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
@@ -0,0 +1,161 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: GlobalSubstitutionTypes
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.abstract.nodes.heat.mvs.nested.heat:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ vf_module_id:
+ type: string
+ description: Unique ID for this VF_MODULE instance
+ vf_name:
+ type: string
+ description: The VF Name; defaults to VMVM for the virtual MVM VNF.
+ constraints:
+ - pattern: '[a-zA-Z0-9]+'
+ - max_length: 4
+ - min_length: 4
+ cloud_zone_id:
+ type: string
+ description: The cloud zone for this VF instance
+ vf_instance_num:
+ type: string
+ description: The number for this VF instance
+ constraints:
+ - pattern: '[0-9]+'
+ - max_length: 2
+ - min_length: 2
+ virtual_mgmt_ip_0:
+ type: string
+ description: Virtual management network ip address
+ indx:
+ type: float
+ description: Index of the current instance
+ mvs_mgmt_ip_0:
+ type: list
+ description: List of Management network IP addresses for IPv4
+ entry_schema:
+ type: string
+ flavor:
+ type: string
+ description: Server flavor
+ constraints: [
+ ]
+ key_name:
+ type: string
+ description: SSH key name
+ constraints: [
+ ]
+ vnf_id:
+ type: string
+ description: Unique ID for this VF instance
+ availability_zone_0:
+ type: list
+ description: List of Availability Zone IDs or Names
+ entry_schema:
+ type: string
+ mgmt_net_id:
+ type: string
+ description: Neutron UUID for the Management network
+ constraints: [
+ ]
+ vm_instance_num:
+ type: list
+ description: VM instance number list must be a list of three-digit numeric value
+ entry_schema:
+ type: string
+ bootimage:
+ type: string
+ description: Master bootimage volume id
+ sec_groups:
+ type: list
+ description: Security groups
+ entry_schema:
+ type: string
+ vf_component:
+ type: string
+ description: The component that this VF instance is running
+ constraints:
+ - pattern: '[a-zA-Z0-9]+'
+ - max_length: 3
+ - min_length: 3
+ attributes:
+ vnfci_id_2:
+ type: string
+ vnfci_id_1:
+ type: string
+ requirements:
+ - local_storage_vnfci:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - link_mgmt_port:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ capabilities:
+ os_vnfci:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_mgmt_port:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_vnfci:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_vnfci:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_vnfci:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_vnfci:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..632afc51b3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,223 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.compute:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ vf_module_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique ID for this VF_MODULE instance
+ vf_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: The VF Name; defaults to VMVM for the virtual MVM VNF.
+ constraints:
+ - pattern: '[a-zA-Z0-9]+'
+ - max_length: 4
+ - min_length: 4
+ type_name:
+ hidden: false
+ immutable: false
+ type: string
+ cloud_zone_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: The cloud zone for this VF instance
+ vf_instance_num:
+ hidden: false
+ immutable: false
+ type: string
+ description: The number for this VF instance
+ constraints:
+ - pattern: '[0-9]+'
+ - max_length: 2
+ - min_length: 2
+ virtual_mgmt_ip_0:
+ hidden: false
+ immutable: false
+ type: string
+ description: Virtual management network ip address
+ mvs_mgmt_ip_0:
+ hidden: false
+ immutable: false
+ type: list
+ description: List of Management network IP addresses for IPv4
+ entry_schema:
+ type: string
+ compute_image_name:
+ hidden: false
+ immutable: false
+ type: string
+ flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Server flavor
+ constraints: [
+ ]
+ key_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: SSH key name
+ constraints: [
+ ]
+ vnf_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique ID for this VF instance
+ availability_zone_0:
+ hidden: false
+ immutable: false
+ type: list
+ description: List of Availability Zone IDs or Names
+ entry_schema:
+ type: string
+ mgmt_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Neutron UUID for the Management network
+ constraints: [
+ ]
+ vm_instance_num:
+ hidden: false
+ immutable: false
+ type: list
+ description: VM instance number list must be a list of three-digit numeric value
+ entry_schema:
+ type: string
+ bootimage:
+ hidden: false
+ immutable: false
+ type: string
+ description: Master bootimage volume id
+ sec_groups:
+ hidden: false
+ immutable: false
+ type: list
+ description: Security groups
+ entry_schema:
+ type: string
+ vf_component:
+ hidden: false
+ immutable: false
+ type: string
+ description: The component that this VF instance is running
+ constraints:
+ - pattern: '[a-zA-Z0-9]+'
+ - max_length: 3
+ - min_length: 3
+ num_instances:
+ hidden: false
+ immutable: false
+ type: float
+ description: number of instance of the VF_module
+ node_templates:
+ mvs_modules:
+ type: org.openecomp.resource.abstract.nodes.heat.mvs.nested.heat
+ directives:
+ - substitutable
+ properties:
+ vf_module_id:
+ get_input: vf_module_id
+ vf_name:
+ get_input: vf_name
+ cloud_zone_id:
+ get_input: cloud_zone_id
+ vf_instance_num:
+ get_input: vf_instance_num
+ virtual_mgmt_ip_0:
+ get_input: virtual_mgmt_ip_0
+ indx:
+ get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ mvs_mgmt_ip_0:
+ get_input: mvs_mgmt_ip_0
+ flavor:
+ get_input: flavor
+ key_name:
+ get_input: key_name
+ service_template_filter:
+ substitute_service_template: mvs.nested.heatServiceTemplate.yaml
+ count: 3
+ mandatory: true
+ vnf_id:
+ get_input: vnf_id
+ availability_zone_0:
+ get_input: availability_zone_0
+ mgmt_net_id:
+ get_input: mgmt_net_id
+ vm_instance_num:
+ get_input: vm_instance_num
+ bootimage:
+ get_input: bootimage
+ sec_groups:
+ get_input: sec_groups
+ vf_component:
+ get_input: vf_component
+ server_compute_get_attr_test:
+ type: org.openecomp.resource.vfc.nodes.heat.compute
+ properties:
+ flavor: compute_flavor_name
+ image:
+ get_input: compute_image_name
+ config_drive:
+ get_attribute:
+ - mvs_modules
+ - vnfci_id_1
+ - vnfci_id_2
+ user_data_format:
+ get_attribute:
+ - mvs_modules
+ - vnfci_id_1
+ - 1
+ name: compute_name
+ groups:
+ mvs.vfmodule.heat:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/mvs.vfmodule.heat.yaml
+ description: |
+ Metaswitch MVS (Metaview Server)
+ members:
+ - mvs_modules
+ - server_compute_get_attr_test \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/expectedoutputfiles/mvs.nested.heatServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/expectedoutputfiles/mvs.nested.heatServiceTemplate.yaml
new file mode 100644
index 0000000000..11369f9b68
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/expectedoutputfiles/mvs.nested.heatServiceTemplate.yaml
@@ -0,0 +1,254 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: mvs.nested.heat
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.vnfci:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ vf_module_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique ID for this VF_MODULE instance
+ vf_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: The VF Name; defaults to VMVM for the virtual MVM VNF.
+ constraints:
+ - pattern: '[a-zA-Z0-9]+'
+ - max_length: 4
+ - min_length: 4
+ cloud_zone_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: The cloud zone for this VF instance
+ vf_instance_num:
+ hidden: false
+ immutable: false
+ type: string
+ description: The number for this VF instance
+ constraints:
+ - pattern: '[0-9]+'
+ - max_length: 2
+ - min_length: 2
+ virtual_mgmt_ip_0:
+ hidden: false
+ immutable: false
+ type: string
+ description: Virtual management network ip address
+ indx:
+ hidden: false
+ immutable: false
+ type: float
+ description: Index of the current instance
+ mvs_mgmt_ip_0:
+ hidden: false
+ immutable: false
+ type: list
+ description: List of Management network IP addresses for IPv4
+ entry_schema:
+ type: string
+ flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Server flavor
+ constraints: [
+ ]
+ key_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: SSH key name
+ constraints: [
+ ]
+ vnf_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique ID for this VF instance
+ availability_zone_0:
+ hidden: false
+ immutable: false
+ type: list
+ description: List of Availability Zone IDs or Names
+ entry_schema:
+ type: string
+ mgmt_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Neutron UUID for the Management network
+ constraints: [
+ ]
+ vm_instance_num:
+ hidden: false
+ immutable: false
+ type: list
+ description: VM instance number list must be a list of three-digit numeric value
+ entry_schema:
+ type: string
+ bootimage:
+ hidden: false
+ immutable: false
+ type: string
+ description: Master bootimage volume id
+ sec_groups:
+ hidden: false
+ immutable: false
+ type: list
+ description: Security groups
+ entry_schema:
+ type: string
+ vf_component:
+ hidden: false
+ immutable: false
+ type: string
+ description: The component that this VF instance is running
+ constraints:
+ - pattern: '[a-zA-Z0-9]+'
+ - max_length: 3
+ - min_length: 3
+ node_templates:
+ vnfci:
+ type: org.openecomp.resource.vfc.nodes.heat.vnfci
+ properties:
+ flavor:
+ get_input: flavor
+ key_name:
+ get_input: key_name
+ availability_zone:
+ Fn::Select:
+ - get_input: indx
+ - get_input:
+ - availability_zone_0
+ name:
+ str_replace:
+ template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM
+ params:
+ $VF_NAME:
+ get_input: vf_name
+ $CLOUD_ZONE_ID:
+ get_input: cloud_zone_id
+ $VM_INSTANCE_NUM:
+ Fn::Select:
+ - get_input: indx
+ - get_input:
+ - vm_instance_num
+ $VF_COMPONENT:
+ get_input: vf_component
+ $VF_INSTANCE_NUM:
+ get_input: vf_instance_num
+ mgmt_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: sec_groups
+ fixed_ips:
+ - ip_address:
+ Fn::Select:
+ - get_input: indx
+ - get_input:
+ - get_input: mvs_mgmt_ip_0
+ allowed_address_pairs:
+ - ip_address:
+ get_input: virtual_mgmt_ip_0
+ name:
+ str_replace:
+ template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM-mgmt-port
+ params:
+ $VF_NAME:
+ get_input: vf_name
+ $CLOUD_ZONE_ID:
+ get_input: cloud_zone_id
+ $VM_INSTANCE_NUM:
+ Fn::Select:
+ - get_input: indx
+ - get_input:
+ - vm_instance_num
+ $VF_COMPONENT:
+ get_input: vf_component
+ $VF_INSTANCE_NUM:
+ get_input: vf_instance_num
+ network:
+ get_input: mgmt_net_id
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: vnfci
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ mvs.nested.heat:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/mvs.nested.heat.yaml
+ description: |
+ Metaswitch MVS (Metaview Server)
+ members:
+ - vnfci
+ - mgmt_port
+ outputs:
+ vnfci_id_2:
+ value: vnfci
+ vnfci_id_1:
+ value: vnfci
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.mvs.nested.heat
+ capabilities:
+ os_vnfci:
+ - vnfci
+ - os
+ attachment_mgmt_port:
+ - mgmt_port
+ - attachment
+ endpoint_vnfci:
+ - vnfci
+ - endpoint
+ host_vnfci:
+ - vnfci
+ - host
+ binding_vnfci:
+ - vnfci
+ - binding
+ scalable_vnfci:
+ - vnfci
+ - scalable
+ requirements:
+ local_storage_vnfci:
+ - vnfci
+ - local_storage
+ link_mgmt_port:
+ - mgmt_port
+ - link \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/inputs/MANIFEST.json
new file mode 100644
index 0000000000..c7729c8653
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/inputs/MANIFEST.json
@@ -0,0 +1,19 @@
+{
+ "name": "mvs.vfmodule.heat.yaml",
+ "description": "Metaswitch MVS (Metaview Server)",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "mvs.vfmodule.heat.yaml",
+ "type": "HEAT",
+ "data": [
+ ]
+ },
+ {
+ "file": "mvs.nested.heat.yaml",
+ "type": "HEAT",
+ "data": [
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/inputs/mvs.nested.heat.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/inputs/mvs.nested.heat.yaml
new file mode 100644
index 0000000000..01adb51d71
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/inputs/mvs.nested.heat.yaml
@@ -0,0 +1,129 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Metaswitch MVS (Metaview Server)
+
+parameters:
+ cloud_zone_id:
+ type: string
+ description: The cloud zone for this VF instance
+ vf_name:
+ type: string
+ description: The VF Name; defaults to VMVM for the virtual MVM VNF.
+ constraints:
+ - allowed_pattern: "[a-zA-Z0-9]+"
+ - length: { min: 4, max: 4 }
+ description: Each VF will have a 4-character alphanumeric identifier
+ vf_instance_num:
+ type: string
+ description: The number for this VF instance
+ constraints:
+ - allowed_pattern: "[0-9]+"
+ - length: { min: 2, max: 2 }
+ description: VF instance number must be a two-digit numeric value
+ vf_component:
+ type: string
+ description: The component that this VF instance is running
+ constraints:
+ - allowed_pattern: "[a-zA-Z0-9]+"
+ - length: { min: 3, max: 3 }
+ description: Each VF component will have a 3-character alphanumeric identifier
+ vm_instance_num:
+ type: comma_delimited_list
+ description: VM instance number list must be a list of three-digit numeric value
+ vnf_id:
+ type: string
+ description: Unique ID for this VF instance
+ vf_module_id:
+ type: string
+ description: Unique ID for this VF_MODULE instance
+ bootimage:
+ type: string
+ description: Master bootimage volume id
+ flavor:
+ type: string
+ description: Server flavor
+ constraints:
+ - custom_constraint: nova.flavor
+ key_name:
+ type: string
+ description: SSH key name
+ constraints:
+ - custom_constraint: nova.keypair
+
+ availability_zone_0:
+ type: comma_delimited_list
+ description: List of Availability Zone IDs or Names
+
+ sec_groups:
+ type: comma_delimited_list
+ description: Security groups
+ mgmt_net_id:
+ type: string
+ description: Neutron UUID for the Management network
+ constraints:
+ - custom_constraint: neutron.network
+ virtual_mgmt_ip_0:
+ type: string
+ description: Virtual management network ip address
+
+ mvs_mgmt_ip_0:
+ type: comma_delimited_list
+ description: List of Management network IP addresses for IPv4
+
+ indx:
+ type: number
+ description: Index of the current instance
+
+resources:
+ mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ name:
+ str_replace:
+ template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM-mgmt-port
+ params:
+ $CLOUD_ZONE_ID: { get_param: cloud_zone_id }
+ $VF_NAME: { get_param: vf_name }
+ $VF_INSTANCE_NUM: { get_param: vf_instance_num }
+ $VF_COMPONENT: { get_param: vf_component }
+ $VM_INSTANCE_NUM: { "Fn::Select" : [ { get_param: indx }, { get_param: [vm_instance_num] } ] }
+ network_id: { get_param: mgmt_net_id }
+ security_groups: [{ get_param: sec_groups }]
+
+ fixed_ips:
+ - ip_address: { "Fn::Select" : [ { get_param: indx }, { get_param: [{ get_param: mvs_mgmt_ip_0 }] } ] }
+
+ allowed_address_pairs:
+ - ip_address: { get_param: virtual_mgmt_ip_0 }
+
+
+
+ vnfci:
+ type: OS::Nova::Server
+ properties:
+ name:
+ str_replace:
+ template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM
+ params:
+ $CLOUD_ZONE_ID: { get_param: cloud_zone_id }
+ $VF_NAME: { get_param: vf_name }
+ $VF_INSTANCE_NUM: { get_param: vf_instance_num }
+ $VF_COMPONENT: { get_param: vf_component }
+ $VM_INSTANCE_NUM: { "Fn::Select" : [ { get_param: indx }, { get_param: [vm_instance_num] } ] }
+ flavor: { get_param: flavor }
+ key_name: { get_param: key_name }
+ networks:
+ - port: { get_resource: mgmt_port }
+
+ availability_zone: { "Fn::Select" : [ { get_param: indx }, { get_param: [availability_zone_0] } ] }
+
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ vf_module_id: { get_param: vf_module_id }
+
+outputs:
+ vnfci_id_1:
+ value: { get_resource: vnfci }
+ vnfci_id_2:
+ value: { get_resource: vnfci } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/inputs/mvs.vfmodule.heat.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/inputs/mvs.vfmodule.heat.yaml
new file mode 100644
index 0000000000..380ceae2ff
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/inputs/mvs.vfmodule.heat.yaml
@@ -0,0 +1,163 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Metaswitch MVS (Metaview Server)
+
+parameters:
+ cloud_zone_id:
+ type: string
+ description: The cloud zone for this VF instance
+ vf_name:
+ type: string
+ description: The VF Name; defaults to VMVM for the virtual MVM VNF.
+ constraints:
+ - allowed_pattern: "[a-zA-Z0-9]+"
+ - length: { min: 4, max: 4 }
+ description: Each VF will have a 4-character alphanumeric identifier
+ vf_instance_num:
+ type: string
+ description: The number for this VF instance
+ constraints:
+ - allowed_pattern: "[0-9]+"
+ - length: { min: 2, max: 2 }
+ description: VF instance number must be a two-digit numeric value
+ vf_component:
+ type: string
+ description: The component that this VF instance is running
+ constraints:
+ - allowed_pattern: "[a-zA-Z0-9]+"
+ - length: { min: 3, max: 3 }
+ description: Each VF component will have a 3-character alphanumeric identifier
+ vm_instance_num:
+ type: comma_delimited_list
+ description: VM instance number list must be a list of three-digit numeric value
+ vnf_id:
+ type: string
+ description: Unique ID for this VF instance
+ vf_module_id:
+ type: string
+ description: Unique ID for this VF_MODULE instance
+ bootimage:
+ type: string
+ description: Master bootimage volume id
+ flavor:
+ type: string
+ description: Server flavor
+ constraints:
+ - custom_constraint: nova.flavor
+ key_name:
+ type: string
+ description: SSH key name
+ constraints:
+ - custom_constraint: nova.keypair
+ type_name:
+ type: string
+ availability_zone_0:
+ type: comma_delimited_list
+ description: List of Availability Zone IDs or Names
+
+ sec_groups:
+ type: comma_delimited_list
+ description: Security groups
+ mgmt_net_id:
+ type: string
+ description: Neutron UUID for the Management network
+ constraints:
+ - custom_constraint: neutron.network
+ virtual_mgmt_ip_0:
+ type: string
+ description: Virtual management network ip address
+
+ mvs_mgmt_ip_0:
+ type: comma_delimited_list
+ description: List of Management network IP addresses for IPv4
+
+ num_instances:
+ type: number
+ description: number of instance of the VF_module
+
+ compute_image_name:
+ type: string
+
+resources:
+ mvs_modules:
+ type: OS::Heat::ResourceGroup
+ properties:
+ count: 3
+ resource_def:
+ type: mvs.nested.heat.yaml
+ properties:
+ cloud_zone_id: { get_param: cloud_zone_id }
+ vf_name: { get_param: vf_name }
+ vf_instance_num: { get_param: vf_instance_num }
+ vf_component: { get_param: vf_component }
+ vm_instance_num: { get_param: vm_instance_num }
+ vnf_id: { get_param: vnf_id }
+ vf_module_id: { get_param: vf_module_id }
+ bootimage: { get_param: bootimage }
+ flavor: { get_param: flavor }
+ key_name: { get_param: key_name }
+ availability_zone_0: { get_param: availability_zone_0 }
+ sec_groups: { get_param: sec_groups }
+ mgmt_net_id: { get_param: mgmt_net_id }
+ virtual_mgmt_ip_0: { get_param: virtual_mgmt_ip_0 }
+ mvs_mgmt_ip_0: { get_param: mvs_mgmt_ip_0 }
+ indx: "%index%"
+
+ not_supported_resourceGroup1:
+ type: OS::Heat::ResourceGroup
+ properties:
+ count: 3
+ resource_def:
+ type: OS::Heat::ResourceGroup
+ properties:
+ cloud_zone_id: { get_param: cloud_zone_id }
+ vf_name: { get_param: vf_name }
+ vf_instance_num: { get_param: vf_instance_num }
+ vf_component: { get_param: vf_component }
+ vm_instance_num: { get_param: vm_instance_num }
+ vnf_id: { get_param: vnf_id }
+ vf_module_id: { get_param: vf_module_id }
+ bootimage: { get_param: bootimage }
+ flavor: { get_param: flavor }
+ key_name: { get_param: key_name }
+ availability_zone_0: { get_param: availability_zone_0 }
+ sec_groups: { get_param: sec_groups }
+ mgmt_net_id: { get_param: mgmt_net_id }
+ virtual_mgmt_ip_0: { get_param: virtual_mgmt_ip_0 }
+ mvs_mgmt_ip_0: { get_param: mvs_mgmt_ip_0 }
+ indx: "%index%"
+
+ not_supported_resourceGroup2:
+ type: OS::Heat::ResourceGroup
+ properties:
+ count: 3
+ resource_def:
+ type: { get_param: type_name }
+ properties:
+ cloud_zone_id: { get_param: cloud_zone_id }
+ vf_name: { get_param: vf_name }
+ vf_instance_num: { get_param: vf_instance_num }
+ vf_component: { get_param: vf_component }
+ vm_instance_num: { get_param: vm_instance_num }
+ vnf_id: { get_param: vnf_id }
+ vf_module_id: { get_param: vf_module_id }
+ bootimage: { get_param: bootimage }
+ flavor: { get_param: flavor }
+ key_name: { get_param: key_name }
+ availability_zone_0: { get_param: availability_zone_0 }
+ sec_groups: { get_param: sec_groups }
+ mgmt_net_id: { get_param: mgmt_net_id }
+ virtual_mgmt_ip_0: { get_param: virtual_mgmt_ip_0 }
+ mvs_mgmt_ip_0: { get_param: mvs_mgmt_ip_0 }
+ indx: "%index%"
+
+ server_compute_get_attr_test:
+ type: OS::Nova::Server
+ properties:
+ config_drive: {get_attr: [mvs_modules]}
+ name: compute_name
+ image: { get_param: compute_image_name }
+ flavor: compute_flavor_name
+ user_data_format: { get_attr: [mvs_modules , resource.1.vnfci_id_1] }
+ user_data: { get_attr: [mvs_modules, resource.vnfci_id_2]}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..1b1c4dd621
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
@@ -0,0 +1,166 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: GlobalSubstitutionTypes
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.abstract.nodes.heat.mvs.nested.heat:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ vf_module_id:
+ type: string
+ description: Unique ID for this VF_MODULE instance
+ vf_name:
+ type: string
+ description: The VF Name; defaults to VMVM for the virtual MVM VNF.
+ constraints:
+ - pattern: '[a-zA-Z0-9]+'
+ - max_length: 4
+ - min_length: 4
+ cloud_zone_id:
+ type: string
+ description: The cloud zone for this VF instance
+ vf_instance_num:
+ type: string
+ description: The number for this VF instance
+ constraints:
+ - pattern: '[0-9]+'
+ - max_length: 2
+ - min_length: 2
+ virtual_mgmt_ip_0:
+ type: string
+ description: Virtual management network ip address
+ indx:
+ type: float
+ description: Index of the current instance
+ mvs_mgmt_ip_0:
+ type: list
+ description: List of Management network IP addresses for IPv4
+ entry_schema:
+ type: string
+ flavor:
+ type: string
+ description: Server flavor
+ constraints: [
+ ]
+ key_name:
+ type: string
+ description: SSH key name
+ constraints: [
+ ]
+ vnf_id:
+ type: string
+ description: Unique ID for this VF instance
+ availability_zone_0:
+ type: list
+ description: List of Availability Zone IDs or Names
+ entry_schema:
+ type: string
+ mgmt_net_id:
+ type: string
+ description: Neutron UUID for the Management network
+ constraints: [
+ ]
+ vm_instance_num:
+ type: list
+ description: VM instance number list must be a list of three-digit numeric value
+ entry_schema:
+ type: string
+ bootimage:
+ type: string
+ description: Master bootimage volume id
+ sec_groups:
+ type: list
+ description: Security groups
+ entry_schema:
+ type: string
+ vf_component:
+ type: string
+ description: The component that this VF instance is running
+ constraints:
+ - pattern: '[a-zA-Z0-9]+'
+ - max_length: 3
+ - min_length: 3
+ requirements:
+ - local_storage_vnfci:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - link_mgmt_port:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ capabilities:
+ os_vnfci:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_mgmt_port:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_vnfci:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_vnfci:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_vnfci:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_boot_volume:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_vnfci:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_data_volume:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..b3b1349b36
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,195 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ vf_module_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique ID for this VF_MODULE instance
+ vf_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: The VF Name; defaults to VMVM for the virtual MVM VNF.
+ constraints:
+ - pattern: '[a-zA-Z0-9]+'
+ - max_length: 4
+ - min_length: 4
+ cloud_zone_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: The cloud zone for this VF instance
+ vf_instance_num:
+ hidden: false
+ immutable: false
+ type: string
+ description: The number for this VF instance
+ constraints:
+ - pattern: '[0-9]+'
+ - max_length: 2
+ - min_length: 2
+ virtual_mgmt_ip_0:
+ hidden: false
+ immutable: false
+ type: string
+ description: Virtual management network ip address
+ mvs_mgmt_ip_0:
+ hidden: false
+ immutable: false
+ type: list
+ description: List of Management network IP addresses for IPv4
+ entry_schema:
+ type: string
+ flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Server flavor
+ constraints: [
+ ]
+ key_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: SSH key name
+ constraints: [
+ ]
+ vnf_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique ID for this VF instance
+ availability_zone_0:
+ hidden: false
+ immutable: false
+ type: list
+ description: List of Availability Zone IDs or Names
+ entry_schema:
+ type: string
+ mgmt_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Neutron UUID for the Management network
+ constraints: [
+ ]
+ vm_instance_num:
+ hidden: false
+ immutable: false
+ type: list
+ description: VM instance number list must be a list of three-digit numeric value
+ entry_schema:
+ type: string
+ bootimage:
+ hidden: false
+ immutable: false
+ type: string
+ description: Master bootimage volume id
+ sec_groups:
+ hidden: false
+ immutable: false
+ type: list
+ description: Security groups
+ entry_schema:
+ type: string
+ vf_component:
+ hidden: false
+ immutable: false
+ type: string
+ description: The component that this VF instance is running
+ constraints:
+ - pattern: '[a-zA-Z0-9]+'
+ - max_length: 3
+ - min_length: 3
+ num_instances:
+ hidden: false
+ immutable: false
+ type: float
+ description: number of instance of the VF_module
+ node_templates:
+ mvs_modules:
+ type: org.openecomp.resource.abstract.nodes.heat.mvs.nested.heat
+ directives:
+ - substitutable
+ properties:
+ vf_module_id:
+ get_input: vf_module_id
+ vf_name:
+ get_input: vf_name
+ cloud_zone_id:
+ get_input: cloud_zone_id
+ vf_instance_num:
+ get_input: vf_instance_num
+ virtual_mgmt_ip_0:
+ get_input: virtual_mgmt_ip_0
+ indx:
+ get_property:
+ - SELF
+ - service_template_filter
+ - index_value
+ mvs_mgmt_ip_0:
+ get_input: mvs_mgmt_ip_0
+ flavor:
+ get_input: flavor
+ key_name:
+ get_input: key_name
+ service_template_filter:
+ substitute_service_template: mvs.nested.heatServiceTemplate.yaml
+ count:
+ get_input: num_instances
+ mandatory: false
+ vnf_id:
+ get_input: vnf_id
+ availability_zone_0:
+ get_input: availability_zone_0
+ mgmt_net_id:
+ get_input: mgmt_net_id
+ vm_instance_num:
+ get_input: vm_instance_num
+ bootimage:
+ get_input: bootimage
+ sec_groups:
+ get_input: sec_groups
+ vf_component:
+ get_input: vf_component
+ groups:
+ mvs.vfmodule.heat:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/mvs.vfmodule.heat.yaml
+ description: |
+ Metaswitch MVS (Metaview Server)
+ members:
+ - mvs_modules \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/expectedoutputfiles/mvs.nested.heatServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/expectedoutputfiles/mvs.nested.heatServiceTemplate.yaml
new file mode 100644
index 0000000000..315318d4f6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/expectedoutputfiles/mvs.nested.heatServiceTemplate.yaml
@@ -0,0 +1,320 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: mvs.nested.heat
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.vnfci:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ vf_module_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique ID for this VF_MODULE instance
+ vf_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: The VF Name; defaults to VMVM for the virtual MVM VNF.
+ constraints:
+ - pattern: '[a-zA-Z0-9]+'
+ - max_length: 4
+ - min_length: 4
+ cloud_zone_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: The cloud zone for this VF instance
+ vf_instance_num:
+ hidden: false
+ immutable: false
+ type: string
+ description: The number for this VF instance
+ constraints:
+ - pattern: '[0-9]+'
+ - max_length: 2
+ - min_length: 2
+ virtual_mgmt_ip_0:
+ hidden: false
+ immutable: false
+ type: string
+ description: Virtual management network ip address
+ indx:
+ hidden: false
+ immutable: false
+ type: float
+ description: Index of the current instance
+ mvs_mgmt_ip_0:
+ hidden: false
+ immutable: false
+ type: list
+ description: List of Management network IP addresses for IPv4
+ entry_schema:
+ type: string
+ flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Server flavor
+ constraints: [
+ ]
+ key_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: SSH key name
+ constraints: [
+ ]
+ vnf_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique ID for this VF instance
+ availability_zone_0:
+ hidden: false
+ immutable: false
+ type: list
+ description: List of Availability Zone IDs or Names
+ entry_schema:
+ type: string
+ mgmt_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Neutron UUID for the Management network
+ constraints: [
+ ]
+ vm_instance_num:
+ hidden: false
+ immutable: false
+ type: list
+ description: VM instance number list must be a list of three-digit numeric value
+ entry_schema:
+ type: string
+ bootimage:
+ hidden: false
+ immutable: false
+ type: string
+ description: Master bootimage volume id
+ sec_groups:
+ hidden: false
+ immutable: false
+ type: list
+ description: Security groups
+ entry_schema:
+ type: string
+ vf_component:
+ hidden: false
+ immutable: false
+ type: string
+ description: The component that this VF instance is running
+ constraints:
+ - pattern: '[a-zA-Z0-9]+'
+ - max_length: 3
+ - min_length: 3
+ node_templates:
+ boot_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ availability_zone:
+ Fn::Select:
+ - get_input: indx
+ - get_input:
+ - availability_zone_0
+ image:
+ get_input: bootimage
+ size: 35*1024
+ name:
+ str_replace:
+ template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM-boot-volume
+ params:
+ $VF_NAME:
+ get_input: vf_name
+ $CLOUD_ZONE_ID:
+ get_input: cloud_zone_id
+ $VM_INSTANCE_NUM:
+ Fn::Select:
+ - get_input: indx
+ - get_input:
+ - vm_instance_num
+ $VF_COMPONENT:
+ get_input: vf_component
+ $VF_INSTANCE_NUM:
+ get_input: vf_instance_num
+ vnfci:
+ type: org.openecomp.resource.vfc.nodes.heat.vnfci
+ properties:
+ flavor:
+ get_input: flavor
+ key_name:
+ get_input: key_name
+ availability_zone:
+ Fn::Select:
+ - get_input: indx
+ - get_input:
+ - availability_zone_0
+ name:
+ str_replace:
+ template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM
+ params:
+ $VF_NAME:
+ get_input: vf_name
+ $CLOUD_ZONE_ID:
+ get_input: cloud_zone_id
+ $VM_INSTANCE_NUM:
+ Fn::Select:
+ - get_input: indx
+ - get_input:
+ - vm_instance_num
+ $VF_COMPONENT:
+ get_input: vf_component
+ $VF_INSTANCE_NUM:
+ get_input: vf_instance_num
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: boot_volume
+ relationship: tosca.relationships.AttachesTo
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: data_volume
+ relationship: tosca.relationships.AttachesTo
+ data_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ availability_zone:
+ Fn::Select:
+ - get_input: indx
+ - get_input:
+ - availability_zone_0
+ size: 265*1024
+ name:
+ str_replace:
+ template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM-data-volume
+ params:
+ $VF_NAME:
+ get_input: vf_name
+ $CLOUD_ZONE_ID:
+ get_input: cloud_zone_id
+ $VM_INSTANCE_NUM:
+ Fn::Select:
+ - get_input: indx
+ - get_input:
+ - vm_instance_num
+ $VF_COMPONENT:
+ get_input: vf_component
+ $VF_INSTANCE_NUM:
+ get_input: vf_instance_num
+ mgmt_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: sec_groups
+ fixed_ips:
+ - ip_address:
+ Fn::Select:
+ - get_input: indx
+ - get_input:
+ - get_input: mvs_mgmt_ip_0
+ allowed_address_pairs:
+ - ip_address:
+ get_input: virtual_mgmt_ip_0
+ name:
+ str_replace:
+ template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM-mgmt-port
+ params:
+ $VF_NAME:
+ get_input: vf_name
+ $CLOUD_ZONE_ID:
+ get_input: cloud_zone_id
+ $VM_INSTANCE_NUM:
+ Fn::Select:
+ - get_input: indx
+ - get_input:
+ - vm_instance_num
+ $VF_COMPONENT:
+ get_input: vf_component
+ $VF_INSTANCE_NUM:
+ get_input: vf_instance_num
+ network:
+ get_input: mgmt_net_id
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: vnfci
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ mvs.nested.heat:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/mvs.nested.heat.yaml
+ description: |
+ Metaswitch MVS (Metaview Server)
+ members:
+ - boot_volume
+ - vnfci
+ - data_volume
+ - mgmt_port
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.mvs.nested.heat
+ capabilities:
+ os_vnfci:
+ - vnfci
+ - os
+ attachment_mgmt_port:
+ - mgmt_port
+ - attachment
+ endpoint_vnfci:
+ - vnfci
+ - endpoint
+ host_vnfci:
+ - vnfci
+ - host
+ binding_vnfci:
+ - vnfci
+ - binding
+ attachment_boot_volume:
+ - boot_volume
+ - attachment
+ scalable_vnfci:
+ - vnfci
+ - scalable
+ attachment_data_volume:
+ - data_volume
+ - attachment
+ requirements:
+ local_storage_vnfci:
+ - vnfci
+ - local_storage
+ link_mgmt_port:
+ - mgmt_port
+ - link \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/inputs/MANIFEST.json
new file mode 100644
index 0000000000..c7729c8653
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/inputs/MANIFEST.json
@@ -0,0 +1,19 @@
+{
+ "name": "mvs.vfmodule.heat.yaml",
+ "description": "Metaswitch MVS (Metaview Server)",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "mvs.vfmodule.heat.yaml",
+ "type": "HEAT",
+ "data": [
+ ]
+ },
+ {
+ "file": "mvs.nested.heat.yaml",
+ "type": "HEAT",
+ "data": [
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/inputs/mvs.nested.heat.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/inputs/mvs.nested.heat.yaml
new file mode 100644
index 0000000000..8ddc5c6488
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/inputs/mvs.nested.heat.yaml
@@ -0,0 +1,165 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Metaswitch MVS (Metaview Server)
+
+parameters:
+ cloud_zone_id:
+ type: string
+ description: The cloud zone for this VF instance
+ vf_name:
+ type: string
+ description: The VF Name; defaults to VMVM for the virtual MVM VNF.
+ constraints:
+ - allowed_pattern: "[a-zA-Z0-9]+"
+ - length: { min: 4, max: 4 }
+ description: Each VF will have a 4-character alphanumeric identifier
+ vf_instance_num:
+ type: string
+ description: The number for this VF instance
+ constraints:
+ - allowed_pattern: "[0-9]+"
+ - length: { min: 2, max: 2 }
+ description: VF instance number must be a two-digit numeric value
+ vf_component:
+ type: string
+ description: The component that this VF instance is running
+ constraints:
+ - allowed_pattern: "[a-zA-Z0-9]+"
+ - length: { min: 3, max: 3 }
+ description: Each VF component will have a 3-character alphanumeric identifier
+ vm_instance_num:
+ type: comma_delimited_list
+ description: VM instance number list must be a list of three-digit numeric value
+ vnf_id:
+ type: string
+ description: Unique ID for this VF instance
+ vf_module_id:
+ type: string
+ description: Unique ID for this VF_MODULE instance
+ bootimage:
+ type: string
+ description: Master bootimage volume id
+ flavor:
+ type: string
+ description: Server flavor
+ constraints:
+ - custom_constraint: nova.flavor
+ key_name:
+ type: string
+ description: SSH key name
+ constraints:
+ - custom_constraint: nova.keypair
+
+ availability_zone_0:
+ type: comma_delimited_list
+ description: List of Availability Zone IDs or Names
+
+ sec_groups:
+ type: comma_delimited_list
+ description: Security groups
+ mgmt_net_id:
+ type: string
+ description: Neutron UUID for the Management network
+ constraints:
+ - custom_constraint: neutron.network
+ virtual_mgmt_ip_0:
+ type: string
+ description: Virtual management network ip address
+
+ mvs_mgmt_ip_0:
+ type: comma_delimited_list
+ description: List of Management network IP addresses for IPv4
+
+ indx:
+ type: number
+ description: Index of the current instance
+
+resources:
+ mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ name:
+ str_replace:
+ template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM-mgmt-port
+ params:
+ $CLOUD_ZONE_ID: { get_param: cloud_zone_id }
+ $VF_NAME: { get_param: vf_name }
+ $VF_INSTANCE_NUM: { get_param: vf_instance_num }
+ $VF_COMPONENT: { get_param: vf_component }
+ $VM_INSTANCE_NUM: { "Fn::Select" : [ { get_param: indx }, { get_param: [vm_instance_num] } ] }
+ network_id: { get_param: mgmt_net_id }
+ security_groups: [{ get_param: sec_groups }]
+
+ fixed_ips:
+ - ip_address: { "Fn::Select" : [ { get_param: indx }, { get_param: [{ get_param: mvs_mgmt_ip_0 }] } ] }
+
+ allowed_address_pairs:
+ - ip_address: { get_param: virtual_mgmt_ip_0 }
+
+ boot_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: 35
+ name:
+ str_replace:
+ template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM-boot-volume
+ params:
+ $CLOUD_ZONE_ID: { get_param: cloud_zone_id }
+ $VF_NAME: { get_param: vf_name }
+ $VF_INSTANCE_NUM: { get_param: vf_instance_num }
+ $VF_COMPONENT: { get_param: vf_component }
+ $VM_INSTANCE_NUM: { "Fn::Select" : [ { get_param: indx }, { get_param: [vm_instance_num] } ] }
+
+ image: { get_param: bootimage }
+
+
+ availability_zone: { "Fn::Select" : [ { get_param: indx }, { get_param: [availability_zone_0] } ] }
+
+
+ data_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: 265
+ name:
+ str_replace:
+ template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM-data-volume
+ params:
+ $CLOUD_ZONE_ID: { get_param: cloud_zone_id }
+ $VF_NAME: { get_param: vf_name }
+ $VF_INSTANCE_NUM: { get_param: vf_instance_num }
+ $VF_COMPONENT: { get_param: vf_component }
+ $VM_INSTANCE_NUM: { "Fn::Select" : [ { get_param: indx }, { get_param: [vm_instance_num] } ] }
+
+ availability_zone: { "Fn::Select" : [ { get_param: indx }, { get_param: [availability_zone_0] } ] }
+
+
+ vnfci:
+ type: OS::Nova::Server
+ properties:
+ name:
+ str_replace:
+ template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM
+ params:
+ $CLOUD_ZONE_ID: { get_param: cloud_zone_id }
+ $VF_NAME: { get_param: vf_name }
+ $VF_INSTANCE_NUM: { get_param: vf_instance_num }
+ $VF_COMPONENT: { get_param: vf_component }
+ $VM_INSTANCE_NUM: { "Fn::Select" : [ { get_param: indx }, { get_param: [vm_instance_num] } ] }
+ block_device_mapping:
+ - device_name: vda
+ volume_id: { get_resource: boot_volume }
+ delete_on_termination: false
+ - device_name: vdb
+ volume_id: { get_resource: data_volume }
+ delete_on_termination: false
+ flavor: { get_param: flavor }
+ key_name: { get_param: key_name }
+ networks:
+ - port: { get_resource: mgmt_port }
+
+ availability_zone: { "Fn::Select" : [ { get_param: indx }, { get_param: [availability_zone_0] } ] }
+
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ vf_module_id: { get_param: vf_module_id }
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/inputs/mvs.vfmodule.heat.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/inputs/mvs.vfmodule.heat.yaml
new file mode 100644
index 0000000000..95ca069bf8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/inputs/mvs.vfmodule.heat.yaml
@@ -0,0 +1,105 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Metaswitch MVS (Metaview Server)
+
+parameters:
+ cloud_zone_id:
+ type: string
+ description: The cloud zone for this VF instance
+ vf_name:
+ type: string
+ description: The VF Name; defaults to VMVM for the virtual MVM VNF.
+ constraints:
+ - allowed_pattern: "[a-zA-Z0-9]+"
+ - length: { min: 4, max: 4 }
+ description: Each VF will have a 4-character alphanumeric identifier
+ vf_instance_num:
+ type: string
+ description: The number for this VF instance
+ constraints:
+ - allowed_pattern: "[0-9]+"
+ - length: { min: 2, max: 2 }
+ description: VF instance number must be a two-digit numeric value
+ vf_component:
+ type: string
+ description: The component that this VF instance is running
+ constraints:
+ - allowed_pattern: "[a-zA-Z0-9]+"
+ - length: { min: 3, max: 3 }
+ description: Each VF component will have a 3-character alphanumeric identifier
+ vm_instance_num:
+ type: comma_delimited_list
+ description: VM instance number list must be a list of three-digit numeric value
+ vnf_id:
+ type: string
+ description: Unique ID for this VF instance
+ vf_module_id:
+ type: string
+ description: Unique ID for this VF_MODULE instance
+ bootimage:
+ type: string
+ description: Master bootimage volume id
+ flavor:
+ type: string
+ description: Server flavor
+ constraints:
+ - custom_constraint: nova.flavor
+ key_name:
+ type: string
+ description: SSH key name
+ constraints:
+ - custom_constraint: nova.keypair
+
+ availability_zone_0:
+ type: comma_delimited_list
+ description: List of Availability Zone IDs or Names
+
+ sec_groups:
+ type: comma_delimited_list
+ description: Security groups
+ mgmt_net_id:
+ type: string
+ description: Neutron UUID for the Management network
+ constraints:
+ - custom_constraint: neutron.network
+ virtual_mgmt_ip_0:
+ type: string
+ description: Virtual management network ip address
+
+ mvs_mgmt_ip_0:
+ type: comma_delimited_list
+ description: List of Management network IP addresses for IPv4
+
+ num_instances:
+ type: number
+ description: number of instance of the VF_module
+
+resources:
+ mvs_modules:
+ type: OS::Heat::ResourceGroup
+ properties:
+ count: { get_param: num_instances }
+ resource_def:
+ type: mvs.nested.heat.yaml
+ properties:
+ cloud_zone_id: { get_param: cloud_zone_id }
+ vf_name: { get_param: vf_name }
+ vf_instance_num: { get_param: vf_instance_num }
+ vf_component: { get_param: vf_component }
+ vm_instance_num: { get_param: vm_instance_num }
+ vnf_id: { get_param: vnf_id }
+ vf_module_id: { get_param: vf_module_id }
+ bootimage: { get_param: bootimage }
+ flavor: { get_param: flavor }
+ key_name: { get_param: key_name }
+
+ availability_zone_0: { get_param: availability_zone_0 }
+
+ sec_groups: { get_param: sec_groups }
+ mgmt_net_id: { get_param: mgmt_net_id }
+ virtual_mgmt_ip_0: { get_param: virtual_mgmt_ip_0 }
+
+ mvs_mgmt_ip_0: { get_param: mvs_mgmt_ip_0 }
+
+ indx: "%index%"
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..b99ba37305
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
@@ -0,0 +1,137 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: GlobalSubstitutionTypes
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ availabilityzone_name:
+ type: string
+ description: availabilityzone name
+ oam_net_gw:
+ type: string
+ description: CPS network gateway
+ pcm_image_name:
+ type: string
+ description: PCRF CM image name
+ security_group_name:
+ type: string
+ description: the name of security group
+ cps_net_ip:
+ type: string
+ description: CPS network ip
+ pcm_flavor_name:
+ type: string
+ description: flavor name of PCRF CM instance
+ pcm_vol:
+ type: string
+ description: CPS Cluman Cinder Volume
+ pcm_server_name:
+ type: string
+ description: PCRF CM server name
+ cps_net_name:
+ type: string
+ description: CPS network name
+ cps_net_mask:
+ type: string
+ description: CPS network mask
+ oam_net_ip:
+ type: string
+ description: OAM network ip
+ oam_net_mask:
+ type: string
+ description: CPS network mask
+ oam_net_name:
+ type: string
+ description: OAM network name
+ attributes:
+ server_pcm_id:
+ type: string
+ description: the pcm nova service id
+ requirements:
+ - link_pcm_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - local_storage_server_pcm:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - link_pcm_port_0:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ capabilities:
+ endpoint_server_pcm:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_pcm:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_server_pcm:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_server_pcm:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_pcm:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_pcm_port_0:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_pcm_port_1:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..ed5854c2fd
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,216 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ oam_net_ips:
+ label: OAM network ips
+ hidden: false
+ immutable: false
+ type: list
+ description: OAM network ips
+ entry_schema:
+ type: string
+ availabilityzone_name:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ oam_net_gw:
+ label: CPS network gateway
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network gateway
+ pcm_server_names:
+ label: PCRF CM server names
+ hidden: false
+ immutable: false
+ type: list
+ description: name of the PCRF CM instance
+ entry_schema:
+ type: string
+ pcm_image_name:
+ label: PCRF CM image name
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF CM image name
+ cps_net_ips:
+ label: CPS network ips
+ hidden: false
+ immutable: false
+ type: list
+ description: CPS network ips
+ entry_schema:
+ type: string
+ security_group_name:
+ label: security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of security group
+ pcm_volumes:
+ label: CPS Cluman Cinder Volume
+ hidden: false
+ immutable: false
+ type: list
+ description: CPS Cluman Cinder Volume
+ entry_schema:
+ type: string
+ pcm_flavor_name:
+ label: PCRF CM flavor name
+ hidden: false
+ immutable: false
+ type: string
+ description: flavor name of PCRF CM instance
+ cps_net_name:
+ label: CPS network name
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network name
+ cps_net_mask:
+ label: CPS network mask
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network mask
+ oam_net_mask:
+ label: CPS network mask
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network mask
+ oam_net_name:
+ label: OAM network name
+ hidden: false
+ immutable: false
+ type: string
+ description: OAM network name
+ node_templates:
+ server_pcm_002:
+ type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1
+ directives:
+ - substitutable
+ properties:
+ pcm_flavor_name:
+ get_input: pcm_flavor_name
+ service_template_filter:
+ substitute_service_template: nested-pcm_v0.1ServiceTemplate.yaml
+ availabilityzone_name:
+ get_input: availabilityzone_name
+ pcm_image_name:
+ get_input: pcm_image_name
+ pcm_vol:
+ get_input:
+ - pcm_volumes
+ - 0
+ security_group_name:
+ get_input: security_group_name
+ pcm_server_name:
+ get_input:
+ - pcm_server_names
+ - 0
+ server_pcm_001:
+ type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1
+ directives:
+ - substitutable
+ properties:
+ service_template_filter:
+ substitute_service_template: nested-pcm_v0.1ServiceTemplate.yaml
+ availabilityzone_name:
+ get_input: availabilityzone_name
+ oam_net_gw:
+ get_input: oam_net_gw
+ pcm_vol:
+ get_input:
+ - pcm_volumes
+ - 0
+ security_group_name:
+ get_input: security_group_name
+ cps_net_ip:
+ get_input:
+ - cps_net_ips
+ - 0
+ cps_net_name:
+ get_input: cps_net_name
+ cps_net_mask:
+ get_input: cps_net_mask
+ oam_net_ip:
+ get_input:
+ - oam_net_ips
+ - 0
+ oam_net_mask:
+ get_input: oam_net_mask
+ oam_net_name:
+ get_input: oam_net_name
+ server_pcm_003:
+ type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1
+ directives:
+ - substitutable
+ properties:
+ service_template_filter:
+ substitute_service_template: nested-pcm_v0.1ServiceTemplate.yaml
+ availabilityzone_name:
+ get_input: availabilityzone_name
+ pcm_vol:
+ get_input:
+ - pcm_volumes
+ - 0
+ security_group_name:
+ get_input: security_group_name
+ cps_net_ip:
+ get_input:
+ - cps_net_ips
+ - 0
+ cps_net_name:
+ get_input: cps_net_name
+ cps_net_mask:
+ get_input: cps_net_mask
+ groups:
+ hot-nimbus-pcm_v0.4_2:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/hot-nimbus-pcm_v0.4_2.yaml
+ description: heat template that creates PCRF Cluman stack
+ members:
+ - server_pcm_003
+ hot-nimbus-pcm_v0.4:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/hot-nimbus-pcm_v0.4.yaml
+ description: heat template that creates PCRF Cluman stack
+ members:
+ - server_pcm_002
+ - server_pcm_001 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml
new file mode 100644
index 0000000000..1b03021742
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml
@@ -0,0 +1,207 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested-pcm_v0.1
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.pcm_server:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ availabilityzone_name:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ oam_net_gw:
+ label: CPS network gateway
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network gateway
+ pcm_image_name:
+ label: image name
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF CM image name
+ security_group_name:
+ label: security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of security group
+ cps_net_ip:
+ label: CPS network ip
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network ip
+ pcm_flavor_name:
+ label: PCRF CM flavor name
+ hidden: false
+ immutable: false
+ type: string
+ description: flavor name of PCRF CM instance
+ pcm_vol:
+ label: CPS Cluman Cinder Volume
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS Cluman Cinder Volume
+ pcm_server_name:
+ label: PCRF CM server name
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF CM server name
+ cps_net_name:
+ label: CPS network name
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network name
+ cps_net_mask:
+ label: CPS network mask
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network mask
+ oam_net_ip:
+ label: OAM network ip
+ hidden: false
+ immutable: false
+ type: string
+ description: OAM network ip
+ oam_net_mask:
+ label: CPS network mask
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network mask
+ oam_net_name:
+ label: OAM network name
+ hidden: false
+ immutable: false
+ type: string
+ description: OAM network name
+ node_templates:
+ pcm_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: oam_net_ip
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_pcm
+ relationship: tosca.relationships.network.BindsTo
+ server_pcm:
+ type: org.openecomp.resource.vfc.nodes.heat.pcm_server
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ pcm_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: cps_net_ip
+ network:
+ get_input: cps_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_pcm
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ nested-pcm_v0.1:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested-pcm_v0.1.yaml
+ description: heat template that creates PCRF Cluman stack
+ members:
+ - pcm_port_1
+ - server_pcm
+ - pcm_port_0
+ outputs:
+ server_pcm_id:
+ description: the pcm nova service id
+ value: server_pcm
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1
+ capabilities:
+ endpoint_server_pcm:
+ - server_pcm
+ - endpoint
+ os_server_pcm:
+ - server_pcm
+ - os
+ host_server_pcm:
+ - server_pcm
+ - host
+ scalable_server_pcm:
+ - server_pcm
+ - scalable
+ binding_server_pcm:
+ - server_pcm
+ - binding
+ attachment_pcm_port_0:
+ - pcm_port_0
+ - attachment
+ attachment_pcm_port_1:
+ - pcm_port_1
+ - attachment
+ requirements:
+ link_pcm_port_0:
+ - pcm_port_0
+ - link
+ link_pcm_port_1:
+ - pcm_port_1
+ - link
+ local_storage_server_pcm:
+ - server_pcm
+ - local_storage \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/inputs/MANIFEST.json
new file mode 100644
index 0000000000..6f151c4f36
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/inputs/MANIFEST.json
@@ -0,0 +1,23 @@
+{
+ "name": "vEP_JSA_Net",
+ "description": "Version 2.0 02-09-2016 (Authors: John Doe, user PROD)",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pcm_v0.4.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-pcm_v0.4.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },{
+ "file": "nested-pcm_v0.1.yaml",
+ "type": "HEAT"
+ },{
+ "file": "hot-nimbus-pcm_v0.4_2.yaml",
+ "type": "HEAT"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/inputs/hot-nimbus-pcm_v0.4.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/inputs/hot-nimbus-pcm_v0.4.env
new file mode 100644
index 0000000000..78cc03e2ea
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/inputs/hot-nimbus-pcm_v0.4.env
@@ -0,0 +1,14 @@
+parameters:
+ pcm_server_names: ZRDM1PCRF01PCM001
+ pcm_image_name: rhel2
+ pcm_flavor_name: cps
+ availabilityzone_name: nova
+ cps_net_name: int_pcrf_net_0
+ cps_net_ips: 172.26.16.113
+ cps_net_mask: 255.255.255.0
+ oam_net_name: oam_protected_net_0
+ oam_net_ips: 107.239.64.121
+ oam_net_gw: 107.239.64.1
+ oam_net_mask: 255.255.255.0
+ pcm_volumes: 249cb355-8fdf-4382-9c3c-a2ebe767d45b
+ security_group_name: nimbus_security_group
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/inputs/hot-nimbus-pcm_v0.4.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/inputs/hot-nimbus-pcm_v0.4.yaml
new file mode 100644
index 0000000000..f7d050790f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/inputs/hot-nimbus-pcm_v0.4.yaml
@@ -0,0 +1,82 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Cluman stack
+
+parameters:
+ pcm_server_names:
+ type: comma_delimited_list
+ label: PCRF CM server names
+ description: name of the PCRF CM instance
+ pcm_image_name:
+ type: string
+ label: PCRF CM image name
+ description: PCRF CM image name
+ pcm_flavor_name:
+ type: string
+ label: PCRF CM flavor name
+ description: flavor name of PCRF CM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ oam_net_name:
+ type: string
+ label: OAM network name
+ description: OAM network name
+ oam_net_ips:
+ type: comma_delimited_list
+ label: OAM network ips
+ description: OAM network ips
+ oam_net_gw:
+ type: string
+ label: CPS network gateway
+ description: CPS network gateway
+ oam_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcm_volumes:
+ type: comma_delimited_list
+ label: CPS Cluman Cinder Volume
+ description: CPS Cluman Cinder Volume
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+
+resources:
+ server_pcm_001:
+ type: nested-pcm_v0.1.yaml
+ properties:
+ availabilityzone_name: { get_param: availabilityzone_name }
+ security_group_name: { get_param: security_group_name }
+ pcm_vol: { get_param: [pcm_volumes, 0] }
+ cps_net_name: { get_param: cps_net_name }
+ cps_net_ip: { get_param: [cps_net_ips, 0] }
+ cps_net_mask: { get_param: cps_net_mask }
+ oam_net_name: { get_param: oam_net_name }
+ oam_net_ip: { get_param: [oam_net_ips, 0] }
+ oam_net_mask: { get_param: oam_net_mask }
+ oam_net_gw: { get_param: oam_net_gw }
+
+ server_pcm_002:
+ type: nested-pcm_v0.1.yaml
+ properties:
+ pcm_server_name: { get_param: [pcm_server_names, 0] }
+ pcm_image_name: { get_param: pcm_image_name }
+ pcm_flavor_name: { get_param: pcm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ security_group_name: { get_param: security_group_name }
+ pcm_vol: { get_param: [pcm_volumes, 0] }
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/inputs/hot-nimbus-pcm_v0.4_2.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/inputs/hot-nimbus-pcm_v0.4_2.yaml
new file mode 100644
index 0000000000..72d84b64a4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/inputs/hot-nimbus-pcm_v0.4_2.yaml
@@ -0,0 +1,71 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Cluman stack
+
+parameters:
+ pcm_server_names:
+ type: comma_delimited_list
+ label: PCRF CM server names
+ description: name of the PCRF CM instance
+ pcm_image_name:
+ type: string
+ label: PCRF CM image name
+ description: PCRF CM image name
+ pcm_flavor_name:
+ type: string
+ label: PCRF CM flavor name
+ description: flavor name of PCRF CM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ oam_net_name:
+ type: string
+ label: OAM network name
+ description: OAM network name
+ oam_net_ips:
+ type: comma_delimited_list
+ label: OAM network ips
+ description: OAM network ips
+ oam_net_gw:
+ type: string
+ label: CPS network gateway
+ description: CPS network gateway
+ oam_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcm_volumes:
+ type: comma_delimited_list
+ label: CPS Cluman Cinder Volume
+ description: CPS Cluman Cinder Volume
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+
+resources:
+ server_pcm_003:
+ type: nested-pcm_v0.1.yaml
+ properties:
+ availabilityzone_name: { get_param: availabilityzone_name }
+ security_group_name: { get_param: security_group_name }
+ pcm_vol: { get_param: [pcm_volumes, 0] }
+ cps_net_name: { get_param: cps_net_name }
+ cps_net_ip: { get_param: [cps_net_ips, 0] }
+ cps_net_mask: { get_param: cps_net_mask }
+
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/inputs/nested-pcm_v0.1.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/inputs/nested-pcm_v0.1.yaml
new file mode 100644
index 0000000000..4e12676aa8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/inputs/nested-pcm_v0.1.yaml
@@ -0,0 +1,114 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Cluman stack
+
+parameters:
+ pcm_server_name:
+ type: string
+ label: PCRF CM server name
+ description: PCRF CM server name
+ pcm_image_name:
+ type: string
+ label: image name
+ description: PCRF CM image name
+ pcm_flavor_name:
+ type: string
+ label: PCRF CM flavor name
+ description: flavor name of PCRF CM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ oam_net_name:
+ type: string
+ label: OAM network name
+ description: OAM network name
+ oam_net_ip:
+ type: string
+ label: OAM network ip
+ description: OAM network ip
+ oam_net_gw:
+ type: string
+ label: CPS network gateway
+ description: CPS network gateway
+ oam_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcm_vol:
+ type: string
+ label: CPS Cluman Cinder Volume
+ description: CPS Cluman Cinder Volume
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+
+resources:
+ network:
+ type: net
+ script_init:
+ type: OS:INIT
+ server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ server_pcm:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcm_server_name }
+ image: { get_param: pcm_image_name }
+ flavor: { get_param: pcm_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: pcm_port_0}
+ - port: { get_resource: pcm_port_1}
+ block_device_mapping:
+ - device_name: vdb
+ volume_id: { get_param: pcm_vol}
+ user_data_format: RAW
+ user_data:
+ get_resource: server_init
+
+ pcm_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: cps_net_ip }
+ security_groups: [{ get_param: security_group_name }]
+
+ pcm_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips:
+ - ip_address: { get_param: oam_net_ip }
+ security_groups: [{ get_param: security_group_name }]
+
+ #pcm_vol_attachment:
+ # type: OS::Cinder::VolumeAttachment
+ # properties:
+ # volume_id: { get_param: pcm_vol }
+ # mountpoint: /dev/vdb
+ # instance_uuid: { get_resource: server_pcm }
+outputs:
+ server_pcm_id:
+ description: the pcm nova service id
+ value: { get_resource: server_pcm } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..b99ba37305
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
@@ -0,0 +1,137 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: GlobalSubstitutionTypes
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ availabilityzone_name:
+ type: string
+ description: availabilityzone name
+ oam_net_gw:
+ type: string
+ description: CPS network gateway
+ pcm_image_name:
+ type: string
+ description: PCRF CM image name
+ security_group_name:
+ type: string
+ description: the name of security group
+ cps_net_ip:
+ type: string
+ description: CPS network ip
+ pcm_flavor_name:
+ type: string
+ description: flavor name of PCRF CM instance
+ pcm_vol:
+ type: string
+ description: CPS Cluman Cinder Volume
+ pcm_server_name:
+ type: string
+ description: PCRF CM server name
+ cps_net_name:
+ type: string
+ description: CPS network name
+ cps_net_mask:
+ type: string
+ description: CPS network mask
+ oam_net_ip:
+ type: string
+ description: OAM network ip
+ oam_net_mask:
+ type: string
+ description: CPS network mask
+ oam_net_name:
+ type: string
+ description: OAM network name
+ attributes:
+ server_pcm_id:
+ type: string
+ description: the pcm nova service id
+ requirements:
+ - link_pcm_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - local_storage_server_pcm:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - link_pcm_port_0:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ capabilities:
+ endpoint_server_pcm:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_pcm:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_server_pcm:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_server_pcm:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_pcm:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_pcm_port_0:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_pcm_port_1:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..dcc2a9abbb
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,236 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.compute:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ oam_net_ips:
+ label: OAM network ips
+ hidden: false
+ immutable: false
+ type: list
+ description: OAM network ips
+ default:
+ - 107.239.64.121
+ entry_schema:
+ type: string
+ availabilityzone_name:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ default: nova
+ oam_net_gw:
+ label: CPS network gateway
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network gateway
+ default: 107.239.64.1
+ pcm_server_names:
+ label: PCRF CM server names
+ hidden: false
+ immutable: false
+ type: list
+ description: name of the PCRF CM instance
+ default:
+ - ZRDM1PCRF01PCM001
+ entry_schema:
+ type: string
+ pcm_image_name:
+ label: PCRF CM image name
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF CM image name
+ default: rhel2
+ cps_net_ips:
+ label: CPS network ips
+ hidden: false
+ immutable: false
+ type: list
+ description: CPS network ips
+ default:
+ - 172.26.16.113
+ entry_schema:
+ type: string
+ security_group_name:
+ label: security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of security group
+ default: nimbus_security_group
+ pcm_volumes:
+ label: CPS Cluman Cinder Volume
+ hidden: false
+ immutable: false
+ type: list
+ description: CPS Cluman Cinder Volume
+ default:
+ - 249cb355-8fdf-4382-9c3c-a2ebe767d45b
+ entry_schema:
+ type: string
+ compute_image_name:
+ hidden: false
+ immutable: false
+ type: string
+ pcm_flavor_name:
+ label: PCRF CM flavor name
+ hidden: false
+ immutable: false
+ type: string
+ description: flavor name of PCRF CM instance
+ default: cps
+ net_name:
+ hidden: false
+ immutable: false
+ type: string
+ cps_net_name:
+ label: CPS network name
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network name
+ default: int_pcrf_net_0
+ cps_net_mask:
+ label: CPS network mask
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network mask
+ default: 255.255.255.0
+ oam_net_mask:
+ label: CPS network mask
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network mask
+ default: 255.255.255.0
+ oam_net_name:
+ label: OAM network name
+ hidden: false
+ immutable: false
+ type: string
+ description: OAM network name
+ default: oam_protected_net_0
+ node_templates:
+ server_pcm_001:
+ type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1
+ directives:
+ - substitutable
+ properties:
+ availabilityzone_name:
+ get_input: availabilityzone_name
+ oam_net_gw:
+ get_input: oam_net_gw
+ pcm_image_name:
+ get_input: pcm_image_name
+ security_group_name:
+ get_input: security_group_name
+ cps_net_ip:
+ get_input:
+ - cps_net_ips
+ - 0
+ pcm_flavor_name:
+ get_input: pcm_flavor_name
+ service_template_filter:
+ substitute_service_template: nested-pcm_v0.1ServiceTemplate.yaml
+ pcm_vol:
+ get_input:
+ - pcm_volumes
+ - 0
+ pcm_server_name:
+ get_input:
+ - pcm_server_names
+ - 0
+ cps_net_name:
+ get_input: cps_net_name
+ cps_net_mask:
+ get_input: cps_net_mask
+ oam_net_ip:
+ get_input:
+ - oam_net_ips
+ - 0
+ oam_net_mask:
+ get_input: oam_net_mask
+ oam_net_name:
+ get_input: oam_net_name
+ compute_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ network:
+ get_input: net_name
+ server_compute_get_attr_test:
+ type: org.openecomp.resource.vfc.nodes.heat.compute
+ properties:
+ flavor:
+ compute_flavor_name: null
+ image:
+ get_input: compute_image_name
+ config_drive:
+ get_attribute:
+ - compute_port_0
+ - tenant_id
+ - port_security_enabled
+ - device_id
+ - qos_policy
+ - allowed_address_pairs
+ - show
+ - device_owner
+ - network
+ - security_groups
+ - fixed_ips
+ - mac_address
+ - admin_state_up
+ - name
+ - subnets
+ - status
+ user_data_format:
+ get_attribute:
+ - server_pcm_001
+ - oam_net_gw
+ name:
+ compute_name: null
+ groups:
+ hot-nimbus-pcm_v0.4:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/hot-nimbus-pcm_v0.4.yaml
+ description: heat template that creates PCRF Cluman stack
+ members:
+ - server_pcm_001
+ - compute_port_0
+ - server_compute_get_attr_test \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml
new file mode 100644
index 0000000000..1b03021742
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml
@@ -0,0 +1,207 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested-pcm_v0.1
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.pcm_server:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ availabilityzone_name:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ oam_net_gw:
+ label: CPS network gateway
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network gateway
+ pcm_image_name:
+ label: image name
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF CM image name
+ security_group_name:
+ label: security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of security group
+ cps_net_ip:
+ label: CPS network ip
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network ip
+ pcm_flavor_name:
+ label: PCRF CM flavor name
+ hidden: false
+ immutable: false
+ type: string
+ description: flavor name of PCRF CM instance
+ pcm_vol:
+ label: CPS Cluman Cinder Volume
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS Cluman Cinder Volume
+ pcm_server_name:
+ label: PCRF CM server name
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF CM server name
+ cps_net_name:
+ label: CPS network name
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network name
+ cps_net_mask:
+ label: CPS network mask
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network mask
+ oam_net_ip:
+ label: OAM network ip
+ hidden: false
+ immutable: false
+ type: string
+ description: OAM network ip
+ oam_net_mask:
+ label: CPS network mask
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network mask
+ oam_net_name:
+ label: OAM network name
+ hidden: false
+ immutable: false
+ type: string
+ description: OAM network name
+ node_templates:
+ pcm_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: oam_net_ip
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_pcm
+ relationship: tosca.relationships.network.BindsTo
+ server_pcm:
+ type: org.openecomp.resource.vfc.nodes.heat.pcm_server
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ pcm_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: cps_net_ip
+ network:
+ get_input: cps_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_pcm
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ nested-pcm_v0.1:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested-pcm_v0.1.yaml
+ description: heat template that creates PCRF Cluman stack
+ members:
+ - pcm_port_1
+ - server_pcm
+ - pcm_port_0
+ outputs:
+ server_pcm_id:
+ description: the pcm nova service id
+ value: server_pcm
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1
+ capabilities:
+ endpoint_server_pcm:
+ - server_pcm
+ - endpoint
+ os_server_pcm:
+ - server_pcm
+ - os
+ host_server_pcm:
+ - server_pcm
+ - host
+ scalable_server_pcm:
+ - server_pcm
+ - scalable
+ binding_server_pcm:
+ - server_pcm
+ - binding
+ attachment_pcm_port_0:
+ - pcm_port_0
+ - attachment
+ attachment_pcm_port_1:
+ - pcm_port_1
+ - attachment
+ requirements:
+ link_pcm_port_0:
+ - pcm_port_0
+ - link
+ link_pcm_port_1:
+ - pcm_port_1
+ - link
+ local_storage_server_pcm:
+ - server_pcm
+ - local_storage \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/inputs/MANIFEST.json
new file mode 100644
index 0000000000..345ca77b2a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/inputs/MANIFEST.json
@@ -0,0 +1,20 @@
+{
+ "name": "vEP_JSA_Net",
+ "description": "Version 2.0 02-09-2016 (Authors: John Doe, user PROD)",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pcm_v0.4.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-pcm_v0.4.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },{
+ "file": "nested-pcm_v0.1.yaml",
+ "type": "HEAT"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/inputs/hot-nimbus-pcm_v0.4.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/inputs/hot-nimbus-pcm_v0.4.env
new file mode 100644
index 0000000000..78cc03e2ea
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/inputs/hot-nimbus-pcm_v0.4.env
@@ -0,0 +1,14 @@
+parameters:
+ pcm_server_names: ZRDM1PCRF01PCM001
+ pcm_image_name: rhel2
+ pcm_flavor_name: cps
+ availabilityzone_name: nova
+ cps_net_name: int_pcrf_net_0
+ cps_net_ips: 172.26.16.113
+ cps_net_mask: 255.255.255.0
+ oam_net_name: oam_protected_net_0
+ oam_net_ips: 107.239.64.121
+ oam_net_gw: 107.239.64.1
+ oam_net_mask: 255.255.255.0
+ pcm_volumes: 249cb355-8fdf-4382-9c3c-a2ebe767d45b
+ security_group_name: nimbus_security_group
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/inputs/hot-nimbus-pcm_v0.4.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/inputs/hot-nimbus-pcm_v0.4.yaml
new file mode 100644
index 0000000000..e4a79f34ba
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/inputs/hot-nimbus-pcm_v0.4.yaml
@@ -0,0 +1,94 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Cluman stack
+
+parameters:
+ pcm_server_names:
+ type: comma_delimited_list
+ label: PCRF CM server names
+ description: name of the PCRF CM instance
+ pcm_image_name:
+ type: string
+ label: PCRF CM image name
+ description: PCRF CM image name
+ pcm_flavor_name:
+ type: string
+ label: PCRF CM flavor name
+ description: flavor name of PCRF CM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ oam_net_name:
+ type: string
+ label: OAM network name
+ description: OAM network name
+ oam_net_ips:
+ type: comma_delimited_list
+ label: OAM network ips
+ description: OAM network ips
+ oam_net_gw:
+ type: string
+ label: CPS network gateway
+ description: CPS network gateway
+ oam_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcm_volumes:
+ type: comma_delimited_list
+ label: CPS Cluman Cinder Volume
+ description: CPS Cluman Cinder Volume
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ compute_image_name:
+ type: string
+ net_name:
+ type: string
+
+resources:
+ server_pcm_001:
+ type: nested-pcm_v0.1.yaml
+ properties:
+ pcm_server_name: { get_param: [pcm_server_names, 0] }
+ pcm_image_name: { get_param: pcm_image_name }
+ pcm_flavor_name: { get_param: pcm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ security_group_name: { get_param: security_group_name }
+ pcm_vol: { get_param: [pcm_volumes, 0] }
+ cps_net_name: { get_param: cps_net_name }
+ cps_net_ip: { get_param: [cps_net_ips, 0] }
+ cps_net_mask: { get_param: cps_net_mask }
+ oam_net_name: { get_param: oam_net_name }
+ oam_net_ip: { get_param: [oam_net_ips, 0] }
+ oam_net_mask: { get_param: oam_net_mask }
+ oam_net_gw: { get_param: oam_net_gw }
+
+ server_compute_get_attr_test:
+ type: OS::Nova::Server
+ properties:
+ config_drive: {get_attr: [compute_port_0]}
+ name: { compute_name }
+ image: { get_param: compute_image_name }
+ flavor: { compute_flavor_name }
+ user_data_format: { get_attr: [server_pcm_001 , oam_net_gw] }
+ user_data: { get_attr: [server_pcm_001]}
+
+ compute_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: net_name } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/inputs/nested-pcm_v0.1.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/inputs/nested-pcm_v0.1.yaml
new file mode 100644
index 0000000000..4e12676aa8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/inputs/nested-pcm_v0.1.yaml
@@ -0,0 +1,114 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Cluman stack
+
+parameters:
+ pcm_server_name:
+ type: string
+ label: PCRF CM server name
+ description: PCRF CM server name
+ pcm_image_name:
+ type: string
+ label: image name
+ description: PCRF CM image name
+ pcm_flavor_name:
+ type: string
+ label: PCRF CM flavor name
+ description: flavor name of PCRF CM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ oam_net_name:
+ type: string
+ label: OAM network name
+ description: OAM network name
+ oam_net_ip:
+ type: string
+ label: OAM network ip
+ description: OAM network ip
+ oam_net_gw:
+ type: string
+ label: CPS network gateway
+ description: CPS network gateway
+ oam_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcm_vol:
+ type: string
+ label: CPS Cluman Cinder Volume
+ description: CPS Cluman Cinder Volume
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+
+resources:
+ network:
+ type: net
+ script_init:
+ type: OS:INIT
+ server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ server_pcm:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcm_server_name }
+ image: { get_param: pcm_image_name }
+ flavor: { get_param: pcm_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: pcm_port_0}
+ - port: { get_resource: pcm_port_1}
+ block_device_mapping:
+ - device_name: vdb
+ volume_id: { get_param: pcm_vol}
+ user_data_format: RAW
+ user_data:
+ get_resource: server_init
+
+ pcm_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: cps_net_ip }
+ security_groups: [{ get_param: security_group_name }]
+
+ pcm_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips:
+ - ip_address: { get_param: oam_net_ip }
+ security_groups: [{ get_param: security_group_name }]
+
+ #pcm_vol_attachment:
+ # type: OS::Cinder::VolumeAttachment
+ # properties:
+ # volume_id: { get_param: pcm_vol }
+ # mountpoint: /dev/vdb
+ # instance_uuid: { get_resource: server_pcm }
+outputs:
+ server_pcm_id:
+ description: the pcm nova service id
+ value: { get_resource: server_pcm } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/outputs/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/outputs/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..eac8fd673d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/outputs/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,86 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ node_templates:
+ jsa_net:
+ type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
+ properties:
+ shared: true
+ network_name:
+ get_input: jsa_net_name
+ jsa_net_test_full_attribute:
+ type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
+ properties:
+ dhcp_agent_ids:
+ - '1000'
+ - '1001'
+ - '1002'
+ tenant_id: 23456
+ port_security_enabled: true
+ shared: true
+ admin_state_up: false
+ qos_policy: full
+ network_name:
+ get_input: jsa_net_name
+ subnets:
+ jsa_net_test_full_attribute_subnet:
+ cidr:
+ get_input: jsa_cidr
+ value_specs:
+ key1: spec1
+ key2: spec2
+ groups:
+ outputs:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/outputs.yaml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - jsa_net
+ - jsa_net_test_full_attribute
+ outputs:
+ output_regular:
+ description: output_regula
+ value: regular
+ output_func_getParam:
+ description: output_func_getParam
+ value:
+ get_input: jsa_cidr
+ output_func_getAttr:
+ description: output_func_getAttr
+ value:
+ get_attribute:
+ - jsa_net_test_full_attribute
+ - network_name
+ output_func_getResource:
+ description: output_func_getResource
+ value: jsa_net_test_full_attribute \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/outputs/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/outputs/inputs/MANIFEST.json
new file mode 100644
index 0000000000..3997ee80ff
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/outputs/inputs/MANIFEST.json
@@ -0,0 +1,11 @@
+{
+ "name": "vEP_JSA_Net",
+ "description": "Version 2.0 02-09-2016 (Authors: John Doe, user PROD)",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "outputs.yaml",
+ "type": "HEAT"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/outputs/inputs/outputs.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/outputs/inputs/outputs.yaml
new file mode 100644
index 0000000000..8d48c82e65
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/outputs/inputs/outputs.yaml
@@ -0,0 +1,48 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+outputs:
+ output_regular:
+ description: output_regula
+ value: regular
+ output_func_getParam:
+ description: output_func_getParam
+ value: {get_param: jsa_cidr}
+ output_func_getAttr:
+ description: output_func_getAttr
+ value: {get_attr: [jsa_net_test_full_attribute, name]}
+ output_func_getResource:
+ description: output_func_getResource
+ value: {get_resource: jsa_net_test_full_attribute_subnet}
+
+resources:
+ jsa_net:
+ type: OS::Neutron::Net
+ properties:
+ name: {get_param: jsa_net_name}
+ shared: True
+
+ jsa_net_test_full_attribute:
+ type: OS::Neutron::Net
+ properties:
+ name: {get_param: jsa_net_name}
+ shared: True
+ dhcp_agent_ids: ['1000','1001','1002']
+ tenant_id: 23456
+ port_security_enabled: t
+ admin_state_up: 0
+ qos_policy: full
+ value_specs:
+ key1: "spec1"
+ key2: "spec2"
+
+ jsa_net_test_full_attribute_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: {get_resource: jsa_net_test_full_attribute}
+ cidr: {get_param: jsa_cidr}
+
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/parameters/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/parameters/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..5cd5d0e597
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/parameters/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,181 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ param_type_comma_delimited_list:
+ hidden: false
+ immutable: false
+ type: list
+ description: param comma_delimited_list - List
+ entry_schema:
+ type: string
+ param_type_string_default_value_with_env:
+ hidden: false
+ immutable: false
+ type: string
+ description: param value should be - HEAT_ENV_default string
+ default: HEAT_ENV default string
+ volume_type:
+ label: FSB Volume
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB Volume type
+ FSB1_volume_name:
+ label: FSB Volume
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB Volume name
+ param_constraint_length_allowed_pattern_range_hidden:
+ label: User Name
+ hidden: true
+ immutable: false
+ type: string
+ description: User name to be configured for the application
+ constraints:
+ - max_length: 8
+ - min_length: 6
+ - pattern: '[A-Z]+[a-zA-Z0-9]*'
+ - in_range:
+ - 0
+ - 10
+ param_type_boolean_default_value_with_env:
+ hidden: false
+ immutable: false
+ type: boolean
+ description: param value should be false
+ default: false
+ param_type_string:
+ hidden: false
+ immutable: false
+ type: string
+ description: param String - string
+ param_type_string_default_value:
+ hidden: false
+ immutable: false
+ type: string
+ description: param value should be - HEAT_default string
+ default: HEAT_default string
+ param_type_number:
+ hidden: false
+ immutable: false
+ type: float
+ description: param number - float
+ param_type_boolean:
+ hidden: false
+ immutable: false
+ type: boolean
+ description: param boolean - boolean
+ param_type_comma_delimited_list_default_value_with_env:
+ hidden: false
+ immutable: false
+ type: list
+ description: param value should be [b1,b2,b3,b4]
+ default:
+ - b1
+ - b2
+ - b3
+ - b4
+ entry_schema:
+ type: string
+ param_type_boolean_default_value:
+ hidden: false
+ immutable: false
+ type: boolean
+ description: param value should be true
+ default: true
+ param_type_number_default_value:
+ hidden: false
+ immutable: false
+ type: float
+ description: param value should be 12345
+ default: 12345
+ FSB_1_image:
+ label: FSB Image
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB Image name
+ param_type_comma_delimited_list_default_value:
+ hidden: false
+ immutable: false
+ type: list
+ description: param value should be [a1,a2,a3,a4]
+ default:
+ - a1
+ - a2
+ - a3
+ - a4
+ entry_schema:
+ type: string
+ param_type_number_default_value_with_env:
+ hidden: false
+ immutable: false
+ type: float
+ description: param value should be 54321
+ default: 54321
+ param_type_json:
+ hidden: false
+ immutable: false
+ type: json
+ description: param json - map<String>
+ param_allowed_values:
+ label: Instance Type
+ hidden: false
+ immutable: false
+ type: string
+ description: Instance type for compute instances
+ constraints:
+ - valid_values:
+ - m1.small
+ - m1.medium
+ - m1.large
+ node_templates:
+ FSB1_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ image:
+ get_input: FSB_1_image
+ volume_type:
+ get_input: volume_type
+ size: 3*1024
+ name:
+ get_input: FSB1_volume_name
+ groups:
+ parameters:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/parameters.yaml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - FSB1_volume \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/parameters/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/parameters/inputs/MANIFEST.json
new file mode 100644
index 0000000000..bc0e397432
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/parameters/inputs/MANIFEST.json
@@ -0,0 +1,17 @@
+{
+ "name": "vEP_JSA_Net",
+ "description": "Version 2.0 02-09-2016 (Authors: John Doe, user PROD)",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "parameters.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "parameters.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/parameters/inputs/parameters.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/parameters/inputs/parameters.env
new file mode 100644
index 0000000000..21978f2482
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/parameters/inputs/parameters.env
@@ -0,0 +1,6 @@
+parameters:
+ param_type_string_default_value_with_env: HEAT_ENV default string
+ param_type_number_default_value_with_env: 54321
+ param_type_boolean_default_value_with_env: false
+ param_type_comma_delimited_list_default_value_with_env: b1,b2,b3,b4
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/parameters/inputs/parameters.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/parameters/inputs/parameters.yaml
new file mode 100644
index 0000000000..6f1b69ac59
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/parameters/inputs/parameters.yaml
@@ -0,0 +1,101 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ param_type_string:
+ type: string
+ description: param String - string
+ param_type_number:
+ type: number
+ description: param number - float
+ param_type_json:
+ type: json
+ description: param json - map<String>
+ param_type_boolean:
+ type: boolean
+ description: param boolean - boolean
+ param_type_comma_delimited_list:
+ type: comma_delimited_list
+ description: param comma_delimited_list - List
+
+ volume_type:
+ type: string
+ label: FSB Volume
+ description: FSB Volume type
+
+ FSB1_volume_name:
+ type: string
+ label: FSB Volume
+ description: FSB Volume name
+
+ FSB_1_image:
+ type: string
+ label: FSB Image
+ description: FSB Image name
+
+ param_constraint_length_allowed_pattern_range_hidden:
+ type: string
+ label: User Name
+ description: User name to be configured for the application
+ hidden: true
+ constraints:
+ - length: { min: 6, max: 8 }
+ description: User name must be between 6 and 8 characters
+ - allowed_pattern: "[A-Z]+[a-zA-Z0-9]*"
+ description: User name must start with an uppercase character
+ - range: { min: 0, max: 10 }
+ param_allowed_values:
+ type: string
+ label: Instance Type
+ description: Instance type for compute instances
+ constraints:
+ - allowed_values:
+ - m1.small
+ - m1.medium
+ - m1.large
+
+ param_type_string_default_value:
+ type: string
+ default: HEAT_default string
+ description: param value should be - HEAT_default string
+ param_type_string_default_value_with_env:
+ type: string
+ description: param value should be - HEAT_ENV_default string
+ default: HEAT_default string
+
+ param_type_number_default_value:
+ type: number
+ description: param value should be 12345
+ default: 12345
+ param_type_number_default_value_with_env:
+ type: number
+ description: param value should be 54321
+ default: 12345
+ param_type_boolean_default_value:
+ type: boolean
+ description: param value should be true
+ default: true
+ param_type_boolean_default_value_with_env:
+ type: boolean
+ description: param value should be false
+ default: true
+ param_type_comma_delimited_list_default_value:
+ type: comma_delimited_list
+ description: param value should be [a1,a2,a3,a4]
+ default: a1,a2,a3,a4
+ param_type_comma_delimited_list_default_value_with_env:
+ type: comma_delimited_list
+ description: param value should be [b1,b2,b3,b4]
+ default: a1,a2,a3,a4
+resources:
+ FSB1_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: 3
+ volume_type: {get_param: volume_type}
+ name: {get_param: FSB1_volume_name}
+ image: {get_param: FSB_1_image}
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_Network_Rule/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_Network_Rule/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..0d9ec35ce7
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_Network_Rule/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,197 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ start_src_ports:
+ hidden: false
+ immutable: false
+ type: float
+ description: Start of src port
+ private_net_1_gateway:
+ hidden: false
+ immutable: false
+ type: string
+ description: Private network gateway address
+ private_net_2_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of private network to be created
+ private_net_2_gateway:
+ hidden: false
+ immutable: false
+ type: string
+ description: Private network gateway address
+ policy_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Virtual network id
+ private_net_1_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of private network to be created
+ private_net_2_pool_start:
+ hidden: false
+ immutable: false
+ type: string
+ description: Start of private network IP address allocation pool
+ private_net_2_cidr:
+ hidden: false
+ immutable: false
+ type: string
+ description: Private network address (CIDR notation)
+ private_net_1_pool_end:
+ hidden: false
+ immutable: false
+ type: string
+ description: End of private network IP address allocation pool
+ end_src_ports:
+ hidden: false
+ immutable: false
+ type: float
+ description: End of src port
+ apply_service:
+ hidden: false
+ immutable: false
+ type: string
+ description: service to apply
+ start_dst_ports:
+ hidden: false
+ immutable: false
+ type: float
+ description: Start of dst port
+ end_dst_ports:
+ hidden: false
+ immutable: false
+ type: float
+ description: End of dst port
+ private_net_1_cidr:
+ hidden: false
+ immutable: false
+ type: string
+ description: Private network address (CIDR notation)
+ private_net_1_pool_start:
+ hidden: false
+ immutable: false
+ type: string
+ description: Start of private network IP address allocation pool
+ private_net_2_pool_end:
+ hidden: false
+ immutable: false
+ type: string
+ description: End of private network IP address allocation pool
+ direction:
+ hidden: false
+ immutable: false
+ type: string
+ description: Direction of Policy
+ node_templates:
+ private_net_1:
+ type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
+ properties:
+ network_name:
+ get_input: private_net_1_name
+ subnets:
+ private_subnet_1:
+ cidr:
+ get_input: private_net_1_cidr
+ gateway_ip:
+ get_input: private_net_1_gateway
+ allocation_pools:
+ - start:
+ get_input: private_net_1_pool_start
+ end:
+ get_input: private_net_1_pool_end
+ private_policy:
+ type: org.openecomp.resource.vfc.rules.nodes.heat.network.contrail.NetworkRules
+ properties:
+ entries:
+ policy_rule:
+ - src_ports:
+ - start_port:
+ get_input: start_src_ports
+ end_port:
+ get_input: end_src_ports
+ protocol: any
+ action_list:
+ apply_service:
+ - get_input: apply_service
+ dst_addresses:
+ - virtual_network: private_net_1
+ dst_ports:
+ - start_port:
+ get_input: start_dst_ports
+ end_port:
+ get_input: end_dst_ports
+ src_addresses:
+ - virtual_network: private_net_2
+ direction:
+ get_input: direction
+ name:
+ get_input: policy_name
+ requirements:
+ - network:
+ capability: tosca.capabilities.Attachment
+ node: private_net_1
+ relationship: org.openecomp.relationships.AttachesTo
+ - network:
+ capability: tosca.capabilities.Attachment
+ node: private_net_2
+ relationship: org.openecomp.relationships.AttachesTo
+ private_net_2:
+ type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
+ properties:
+ network_name:
+ get_input: private_net_2_name
+ subnets:
+ private_subnet_2:
+ cidr:
+ get_input: private_net_2_cidr
+ gateway_ip:
+ get_input: private_net_2_gateway
+ allocation_pools:
+ - start:
+ get_input: private_net_2_pool_start
+ end:
+ get_input: private_net_2_pool_end
+ groups:
+ network_policy_chain:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/network_policy_chain.yaml
+ description: |
+ HOT template to creates two virtual network with one subnet each. Creates a network policy for applying service between two VNs created before. Attach the network policy to two virtual networks
+ members:
+ - private_net_1
+ - private_policy
+ - private_net_2 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_Network_Rule/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_Network_Rule/inputs/MANIFEST.json
new file mode 100644
index 0000000000..81b11d1a77
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_Network_Rule/inputs/MANIFEST.json
@@ -0,0 +1,12 @@
+{
+ "name": "network_policy_chain",
+ "description": "network_policy_chain",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "network_policy_chain.yaml",
+ "type": "HEAT",
+ "data": []
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_Network_Rule/inputs/network_policy_chain.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_Network_Rule/inputs/network_policy_chain.yaml
new file mode 100644
index 0000000000..8963b1ff75
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_Network_Rule/inputs/network_policy_chain.yaml
@@ -0,0 +1,117 @@
+heat_template_version: 2013-05-23
+
+description: >
+ HOT template to creates two virtual network with one subnet each.
+ Creates a network policy for applying service between two VNs created before.
+ Attach the network policy to two virtual networks
+parameters:
+ policy_name:
+ type: string
+ description: Virtual network id
+ direction:
+ type: string
+ description: Direction of Policy
+ start_src_ports:
+ type: number
+ description: Start of src port
+ end_src_ports:
+ type: number
+ description: End of src port
+ start_dst_ports:
+ type: number
+ description: Start of dst port
+ end_dst_ports:
+ type: number
+ description: End of dst port
+ apply_service:
+ type: string
+ description: service to apply
+ private_net_1_name:
+ type: string
+ description: Name of private network to be created
+ private_net_1_cidr:
+ type: string
+ description: Private network address (CIDR notation)
+ private_net_1_gateway:
+ type: string
+ description: Private network gateway address
+ private_net_1_pool_start:
+ type: string
+ description: Start of private network IP address allocation pool
+ private_net_1_pool_end:
+ type: string
+ description: End of private network IP address allocation pool
+ private_net_2_name:
+ type: string
+ description: Name of private network to be created
+ private_net_2_cidr:
+ type: string
+ description: Private network address (CIDR notation)
+ private_net_2_gateway:
+ type: string
+ description: Private network gateway address
+ private_net_2_pool_start:
+ type: string
+ description: Start of private network IP address allocation pool
+ private_net_2_pool_end:
+ type: string
+ description: End of private network IP address allocation pool
+
+resources:
+ private_net_1:
+ type: OS::Neutron::Net
+ properties:
+ name: { get_param: private_net_1_name }
+
+ private_net_2:
+ type: OS::Neutron::Net
+ properties:
+ name: { get_param: private_net_2_name }
+
+ private_subnet_1:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: private_net_1 }
+ cidr: { get_param: private_net_1_cidr }
+ gateway_ip: { get_param: private_net_1_gateway }
+ allocation_pools:
+ - start: { get_param: private_net_1_pool_start }
+ end: { get_param: private_net_1_pool_end }
+
+ private_subnet_2:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: private_net_2 }
+ cidr: { get_param: private_net_2_cidr }
+ gateway_ip: { get_param: private_net_2_gateway }
+ allocation_pools:
+ - start: { get_param: private_net_2_pool_start }
+ end: { get_param: private_net_2_pool_end }
+
+ private_policy:
+ type: OS::Contrail::NetworkPolicy
+ properties:
+ name: { get_param: policy_name }
+ entries:
+ policy_rule: [
+ {
+ "direction": { get_param: direction },
+ "protocol": "any",
+ "src_ports": [{"start_port": {get_param: start_src_ports}, "end_port": {get_param: end_src_ports}}],
+ "dst_ports": [{"start_port": {get_param: start_dst_ports}, "end_port": {get_param: end_dst_ports}}],
+ "dst_addresses": [{ "virtual_network": {get_resource: private_net_1}}],
+ "action_list": {"apply_service": [{get_param: apply_service}]},
+ "src_addresses": [{ "virtual_network": {get_resource: private_net_2}}]
+ },
+ ]
+ private_policy_attach_net1:
+ type: OS::Contrail::AttachPolicy
+ properties:
+ network: { get_resource: private_net_1 }
+ policy: { get_attr: [private_policy, fq_name] }
+
+ private_policy_attach_net2:
+ type: OS::Contrail::AttachPolicy
+ properties:
+ network: { get_resource: private_net_2 }
+ policy: { get_attr: [private_policy, fq_name] } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..2b047dd8ae
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,1308 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.NCB1:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.GPB2:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.NCB2:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.GPB1:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.FSB2:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.VLC1:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.FSB1:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.VLC2:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ Internal2_name:
+ hidden: false
+ immutable: false
+ type: string
+ default: Internal2-subnet
+ vlc2-Internal2-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to vlc2-Internal2
+ default: 00:81:37:0E:02:12
+ epc-sctp-a-net-rt:
+ hidden: false
+ immutable: false
+ type: string
+ description: epc-sctp-a route target
+ default: 13979:105717
+ epc-sctp-b-net-rt:
+ hidden: false
+ immutable: false
+ type: string
+ description: epc-sctp-b route target
+ default: 13979:105719
+ gpb-flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor to use for servers gpb
+ default: m4.xlarge4
+ Internal1_cidr:
+ hidden: false
+ immutable: false
+ type: string
+ default: 169.253.0.0/17
+ epc-sctp-a-pool-start:
+ hidden: false
+ immutable: false
+ type: string
+ description: epc-sctp-a-net network ip pool start IP address
+ default: 107.243.37.3
+ Internal2_subnet_name:
+ hidden: false
+ immutable: false
+ type: string
+ default: vmme_int_int_sub_2
+ Internal1_subnet_name:
+ hidden: false
+ immutable: false
+ type: string
+ default: vmme_int_int_sub_1
+ gpb1-Internal1-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to gpb1-Internal1
+ default: 00:80:37:0E:01:22
+ gpb1-Internal1-ip:
+ hidden: false
+ immutable: false
+ type: string
+ default: 169.254.0.101
+ FSB_1_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: image name
+ fsb1-Internal2-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to fsb1-Internal2
+ default: 00:81:37:0E:0B:12
+ ncb_zone:
+ hidden: false
+ immutable: false
+ type: string
+ description: cluster for spawnning ncb instances
+ default: nova
+ Internal2_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ default: vmme_int_int_2
+ epc-sctp-a-pool-end:
+ hidden: false
+ immutable: false
+ type: string
+ description: epc-sctp-a-net network ip pool end IP address
+ default: 107.243.37.30
+ Internal1_name:
+ hidden: false
+ immutable: false
+ type: string
+ default: Internal1-subnet
+ gpb2-name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of gpb2
+ default: ZRDM1MMEX33GPB002
+ fsb2-Internal1-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to fsb2-Internal1
+ default: 00:80:37:0E:0D:12
+ fsb2-name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of fsb1
+ default: ZRDM1MMEX33FSB002
+ static_prefix_sctp_b_1:
+ hidden: false
+ immutable: false
+ type: string
+ description: Static Prefix
+ default: 107.239.40.64/30
+ fsb2-oam-ip:
+ hidden: false
+ immutable: false
+ type: string
+ default: 107.250.172.222
+ fsb2-flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor to use for servers fsb2
+ default: m4.xlarge4
+ fsb2-Internal2-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to fsb2-Internal2
+ default: 00:81:37:0E:0D:12
+ ncb2-Internal1-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to ncb2-Internal1
+ default: 00:80:37:0E:0F:12
+ ncb2-name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of ncb2
+ default: ZRDM1MMEX33NCB002
+ epc-sctp-b-pool-end:
+ hidden: false
+ immutable: false
+ type: string
+ description: epc-sctp-b-net network ip pool end IP address
+ default: 107.243.37.62
+ vlc1-gtp-ip:
+ hidden: false
+ immutable: false
+ type: string
+ default: 107.243.37.67
+ epc-sctp-b-pool-start:
+ hidden: false
+ immutable: false
+ type: string
+ description: epc-sctp-b-net network ip pool start IP address
+ default: 107.243.37.35
+ my_instance:
+ hidden: false
+ immutable: false
+ type: string
+ description: instance
+ Internal2_shared:
+ hidden: false
+ immutable: false
+ type: string
+ default: 'False'
+ Internal1_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ default: vmme_int_int_1
+ vlc2-name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of vlc2
+ default: ZRDM1MMEX33VLC002
+ Internal2_ipam_name:
+ hidden: false
+ immutable: false
+ type: string
+ default: vmme_ipam_int2
+ vlc1-sctp-b-ip:
+ hidden: false
+ immutable: false
+ type: string
+ default: 107.243.37.35
+ Internal1_net_pool_end:
+ hidden: false
+ immutable: false
+ type: string
+ default: 169.253.0.254
+ Internal1_default_gateway:
+ hidden: false
+ immutable: false
+ type: string
+ default: 169.253.0.3
+ ncb1-Internal1-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to ncb1-Internal1
+ default: 00:80:37:0E:09:12
+ epc-gtp-net-name:
+ hidden: false
+ immutable: false
+ type: string
+ description: gtp net name
+ default: EPC-GTP
+ vlc1-Internal1-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to vlc1-Internal1
+ default: 00:80:37:0E:01:12
+ gpb2-Internal1-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to gpb2-Internal1
+ default: 00:80:37:0E:02:22
+ epc-gtp-net-cidr:
+ hidden: false
+ immutable: false
+ type: string
+ description: gtp stubnet
+ default: 107.243.37.64/27
+ oam_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: uuid of oam network
+ default: 47bf4cca-0961-422f-bcd6-d5a4fbb1a351
+ vlc_zone:
+ hidden: false
+ immutable: false
+ type: string
+ description: cluster for spawnning vlc instances
+ default: nova
+ vlc2-Internal1-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to vlc2-Internal1
+ default: 00:80:37:0E:02:12
+ epc-sctp-a-net-cidr:
+ hidden: false
+ immutable: false
+ type: string
+ description: epc-sctp-a subnet
+ default: 107.243.37.0/27
+ Internal1_forwarding_mode:
+ hidden: false
+ immutable: false
+ type: string
+ default: l2
+ Internal2_dhcp:
+ hidden: false
+ immutable: false
+ type: boolean
+ default: false
+ fsb1-oam-ip:
+ hidden: false
+ immutable: false
+ type: string
+ default: 107.250.172.221
+ FSB_2_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: image name
+ vlc1-oam-ip:
+ hidden: false
+ immutable: false
+ type: string
+ default: 107.250.172.227
+ epc-sctp-a-net-name:
+ hidden: false
+ immutable: false
+ type: string
+ description: epc-sctp-a net name
+ default: EPC-SCTP-A
+ vlc2-oam-ip:
+ hidden: false
+ immutable: false
+ type: string
+ default: 107.250.172.228
+ Internal2_net_pool_start:
+ hidden: false
+ immutable: false
+ type: string
+ default: 169.255.0.100
+ FSB1_volume_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: volume name
+ vlc1-sctp-a-ip:
+ hidden: false
+ immutable: false
+ type: string
+ default: 107.243.37.3
+ Internal1_ipam_name:
+ hidden: false
+ immutable: false
+ type: string
+ default: vmme_ipam_int1
+ Internal1_dhcp:
+ hidden: false
+ immutable: false
+ type: boolean
+ default: false
+ Internal2_external:
+ hidden: false
+ immutable: false
+ type: string
+ default: 'False'
+ Internal2_forwarding_mode:
+ hidden: false
+ immutable: false
+ type: string
+ default: l2
+ vlc1-name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of vlc1
+ default: ZRDM1MMEX33VLC002
+ vlc-flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor to use for servers vlc
+ default: m4.xlarge4
+ epc-gtp-net-rt:
+ hidden: false
+ immutable: false
+ type: string
+ description: gtp route target
+ default: 13979:105715
+ gpb_zone:
+ hidden: false
+ immutable: false
+ type: string
+ description: cluster for spawnning gpb instances
+ default: nova
+ Internal1-net:
+ hidden: false
+ immutable: false
+ type: string
+ description: net
+ gpb1-Internal2-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to gpb1-Internal2
+ default: 00:81:37:0E:01:22
+ fsb1-Internal1-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to fsb1-Internal1
+ default: 00:80:37:0E:0B:12
+ FSB2_volume_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: volume name
+ VMME_FSB2_boot_volume:
+ hidden: false
+ immutable: false
+ type: string
+ default: 089a0d11-4b15-4370-8343-3f90907b1221
+ fsb_zone:
+ hidden: false
+ immutable: false
+ type: string
+ description: cluster for spawnning fsb instances
+ default: nova
+ VMME_FSB1_boot_volume:
+ hidden: false
+ immutable: false
+ type: string
+ default: 8248e794-6173-4b49-b9c3-8219b0b56f4e
+ Internal2_default_gateway:
+ hidden: false
+ immutable: false
+ type: string
+ default: 169.255.0.3
+ Internal1_external:
+ hidden: false
+ immutable: false
+ type: string
+ default: 'False'
+ vlc2-sctp-a-ip:
+ hidden: false
+ immutable: false
+ type: string
+ default: 107.243.37.4
+ ncb-flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor to use for servers ncb
+ default: m4.xlarge4
+ Internal1_shared:
+ hidden: false
+ immutable: false
+ type: string
+ default: 'False'
+ fsb1-name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of fsb1
+ default: ZRDM1MMEX33FSB001
+ static_prefix_gtp_1:
+ hidden: false
+ immutable: false
+ type: string
+ description: Static Prefix
+ default: 107.239.40.96/30
+ epc-sctp-b-net-gateway:
+ hidden: false
+ immutable: false
+ type: string
+ description: epc-sctp-b-net network gateway
+ default: 107.243.37.33
+ epc-sctp-b-net-cidr:
+ hidden: false
+ immutable: false
+ type: string
+ description: epc-sctp-b subnet
+ default: 107.243.37.32/24
+ epc-gtp-pool-end:
+ hidden: false
+ immutable: false
+ type: string
+ description: gtp network ip pool end IP address
+ default: 107.243.37.94
+ epc-sctp-a-net-gateway:
+ hidden: false
+ immutable: false
+ type: string
+ description: epc-sctp-a-net network gateway
+ default: 107.243.37.1
+ vlc2-gtp-ip:
+ hidden: false
+ immutable: false
+ type: string
+ default: 107.243.37.68
+ vlc2-sctp-b-ip:
+ hidden: false
+ immutable: false
+ type: string
+ default: 107.243.37.36
+ Internal1_net_pool_start:
+ hidden: false
+ immutable: false
+ type: string
+ default: 169.253.0.100
+ volume_size:
+ hidden: false
+ immutable: false
+ type: string
+ description: volume
+ fsb2-image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of image to use for server fsb2
+ default: MME_FSB2_15B-CP04-r5a01
+ ncb2-Internal2-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to ncb2-Internal2
+ default: 00:81:37:0E:0F:12
+ ncb1-name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of ncb1
+ default: ZRDM1MMEX33NCB001
+ fsb1-image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of image to use for server fsb1
+ default: MME_FSB1_15B-CP04-r5a01
+ fsb1-flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor to use for servers fsb1
+ default: m4.xlarge4
+ volume_type:
+ hidden: false
+ immutable: false
+ type: string
+ description: volume
+ Internal2_net_pool_end:
+ hidden: false
+ immutable: false
+ type: string
+ default: 169.255.0.254
+ epc-sctp-b-net-name:
+ hidden: false
+ immutable: false
+ type: string
+ description: epc-sctp-b net name
+ default: EPC-SCTP-B
+ Internal2_cidr:
+ hidden: false
+ immutable: false
+ type: string
+ default: 169.255.0.0/17
+ epc-gtp-net-gateway:
+ hidden: false
+ immutable: false
+ type: string
+ description: gtp network gateway
+ default: 107.243.37.65
+ gpb2-Internal2-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to gpb2-Internal2
+ default: 00:81:37:0E:02:22
+ ncb1-Internal2-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to ncb1-Internal2
+ default: 00:81:37:0E:09:12
+ epc-gtp-pool-start:
+ hidden: false
+ immutable: false
+ type: string
+ description: gtp network ip pool start IP address
+ default: 107.243.37.67
+ static_prefix_sctp_a_1:
+ hidden: false
+ immutable: false
+ type: string
+ description: Static Prefix
+ default: 107.239.40.32/30
+ gpb1-name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of gpb1
+ default: ZRDM1MMEX33GPB001
+ pxe-image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of image to use for server ncb
+ default: MME_PXE-BOOT_cxp9025898_2r5a01.qcow2
+ vlc1-Internal2-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to vlc1-Internal2
+ default: 00:81:37:0E:01:12
+ node_templates:
+ NCB1:
+ type: org.openecomp.resource.vfc.nodes.heat.NCB1
+ properties:
+ flavor:
+ get_input: ncb-flavor
+ availability_zone:
+ get_input: ncb_zone
+ image:
+ get_input: pxe-image
+ name:
+ get_input: ncb1-name
+ NCB2:
+ type: org.openecomp.resource.vfc.nodes.heat.NCB2
+ properties:
+ flavor:
+ get_input: ncb-flavor
+ availability_zone:
+ get_input: ncb_zone
+ image:
+ get_input: pxe-image
+ name:
+ get_input: ncb2-name
+ VLC2_OAM:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ fixed_ips:
+ - ip_address:
+ get_input: vlc2-oam-ip
+ network:
+ get_input: oam_net_id
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: VLC2
+ relationship: tosca.relationships.network.BindsTo
+ epc-gtp-net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ route_targets:
+ - get_input: epc-gtp-net-rt
+ network_name:
+ get_input: epc-gtp-net-name
+ subnets:
+ epc-gtp-subnet:
+ cidr:
+ get_input: epc-gtp-net-cidr
+ gateway_ip:
+ get_input: epc-gtp-net-gateway
+ allocation_pools:
+ - start:
+ get_input: epc-gtp-pool-start
+ end:
+ get_input: epc-gtp-pool-end
+ NCB1_Internal1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ mac_address:
+ get_input: ncb1-Internal1-mac
+ network: Internal1-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal1-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: NCB1
+ relationship: tosca.relationships.network.BindsTo
+ VLC2_Internal2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ mac_address:
+ get_input: vlc2-Internal2-mac
+ network: Internal2-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal2-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: VLC2
+ relationship: tosca.relationships.network.BindsTo
+ NCB1_Internal2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ mac_address:
+ get_input: ncb1-Internal2-mac
+ network: Internal2-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal2-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: NCB1
+ relationship: tosca.relationships.network.BindsTo
+ VLC2_Internal1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ mac_address:
+ get_input: vlc2-Internal1-mac
+ network: Internal1-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal1-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: VLC2
+ relationship: tosca.relationships.network.BindsTo
+ VLC2_GTP:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ fixed_ips:
+ - ip_address:
+ get_input: vlc2-gtp-ip
+ network: epc-gtp-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: epc-gtp-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: VLC2
+ relationship: tosca.relationships.network.BindsTo
+ FSB1_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ image:
+ get_input: FSB_1_image
+ volume_type:
+ get_input: volume_type
+ size: 3*1024
+ name:
+ get_input: FSB1_volume_name
+ testConvertGetParamFunctions:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ shared:
+ get_input: Internal1_shared
+ forwarding_mode:
+ get_input: Internal1_forwarding_mode
+ external:
+ get_input:
+ - my_instance
+ - networks
+ - private
+ - 0
+ network_name:
+ get_input: Internal1_net_name
+ FSB2_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ image:
+ get_input: FSB_2_image
+ volume_type:
+ get_input: volume_type
+ size: '(get_input : volume_size) * 1024'
+ name:
+ get_input: FSB2_volume_name
+ FSB1_OAM:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ fixed_ips:
+ - ip_address:
+ get_input: fsb1-oam-ip
+ network:
+ get_input: oam_net_id
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: FSB1
+ relationship: tosca.relationships.network.BindsTo
+ Internal1-net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ dhcp_enabled:
+ get_input: Internal1_dhcp
+ shared:
+ get_input: Internal1_shared
+ forwarding_mode:
+ get_input: Internal1_forwarding_mode
+ external: true
+ route_targets:
+ get_artifact:
+ - SELF
+ - nimbus-ethernet
+ network_name:
+ get_input: Internal1_net_name
+ subnets:
+ Internal3-subnet:
+ enable_dhcp:
+ get_input: Internal2_dhcp
+ cidr:
+ get_input: Internal2_cidr
+ gateway_ip:
+ get_input: Internal2_default_gateway
+ Internal1-subnet:
+ enable_dhcp:
+ get_input: Internal1_dhcp
+ cidr:
+ get_input: Internal1_cidr
+ gateway_ip:
+ get_input: Internal1_default_gateway
+ Internal4-subnet:
+ enable_dhcp: false
+ cidr:
+ get_input: Internal1_cidr
+ gateway_ip:
+ get_input: Internal1_default_gateway
+ artifacts:
+ nimbus-ethernet:
+ type: tosca.artifacts.Deployment
+ file: ../Artifacts/nimbus-ethernet.sh
+ GPB2_Internal1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ mac_address:
+ get_input: gpb2-Internal1-mac
+ network: Internal1-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal1-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: GPB2
+ relationship: tosca.relationships.network.BindsTo
+ GPB2_Internal2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ mac_address:
+ get_input: gpb2-Internal2-mac
+ network: Internal2-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal2-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: GPB2
+ relationship: tosca.relationships.network.BindsTo
+ testConvertGetAttributeFunctions:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ shared:
+ get_input: Internal1_shared
+ forwarding_mode:
+ get_input: Internal1_forwarding_mode
+ external:
+ get_input: Internal1_external
+ network_name:
+ get_input: Internal1_net_name
+ NCB2_Internal2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ mac_address:
+ get_input: ncb2-Internal2-mac
+ network: Internal2-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal2-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: NCB2
+ relationship: tosca.relationships.network.BindsTo
+ NCB2_Internal1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ mac_address:
+ get_input: ncb2-Internal1-mac
+ network: Internal1-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal1-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: NCB2
+ relationship: tosca.relationships.network.BindsTo
+ FSB2:
+ type: org.openecomp.resource.vfc.nodes.heat.FSB2
+ properties:
+ flavor:
+ get_input: fsb2-flavor
+ availability_zone:
+ get_input: fsb_zone
+ name:
+ get_input: fsb2-name
+ FSB1:
+ type: org.openecomp.resource.vfc.nodes.heat.FSB1
+ properties:
+ flavor:
+ get_input: fsb1-flavor
+ availability_zone:
+ get_input: fsb_zone
+ name:
+ get_input: fsb1-name
+ Internal2-net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ dhcp_enabled:
+ get_input: Internal2_dhcp
+ shared:
+ get_input: Internal2_shared
+ forwarding_mode:
+ get_input: Internal2_forwarding_mode
+ external:
+ get_input: Internal2_external
+ network_name:
+ get_input: Internal2_name
+ subnets:
+ Internal2-subnet:
+ enable_dhcp:
+ get_input: Internal2_dhcp
+ cidr:
+ get_input: Internal2_cidr
+ gateway_ip:
+ get_input: Internal2_default_gateway
+ VLC1_Internal1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ mac_address:
+ get_input: vlc1-Internal1-mac
+ network: Internal1-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal1-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: VLC1
+ relationship: tosca.relationships.network.BindsTo
+ epc-sctp-a-net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ route_targets:
+ - get_input: epc-sctp-a-net-rt
+ network_name:
+ get_input: epc-sctp-a-net-name
+ subnets:
+ epc-sctp-a-subnet:
+ cidr:
+ get_input: epc-sctp-a-net-cidr
+ gateway_ip:
+ get_input: epc-sctp-a-net-gateway
+ allocation_pools:
+ - start:
+ get_input: epc-sctp-a-pool-start
+ end:
+ get_input: epc-sctp-a-pool-end
+ VLC1_Internal2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ mac_address:
+ get_input: vlc1-Internal2-mac
+ network: Internal2-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal2-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: VLC1
+ relationship: tosca.relationships.network.BindsTo
+ VLC1_SCTP_B:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ fixed_ips:
+ - ip_address:
+ get_input: vlc1-sctp-b-ip
+ network: epc-sctp-b-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: epc-sctp-b-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: VLC1
+ relationship: tosca.relationships.network.BindsTo
+ VLC2_SCTP_B:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ fixed_ips:
+ - ip_address:
+ get_input: vlc2-sctp-b-ip
+ network: epc-sctp-b-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: epc-sctp-b-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: VLC2
+ relationship: tosca.relationships.network.BindsTo
+ VLC1_SCTP_A:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ fixed_ips:
+ - ip_address:
+ get_input: vlc1-sctp-a-ip
+ network: epc-sctp-a-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: epc-sctp-a-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: VLC1
+ relationship: tosca.relationships.network.BindsTo
+ VLC2_SCTP_A:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ fixed_ips:
+ - ip_address:
+ get_input: vlc2-sctp-a-ip
+ network: epc-sctp-a-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: epc-sctp-a-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: VLC2
+ relationship: tosca.relationships.network.BindsTo
+ VLC1:
+ type: org.openecomp.resource.vfc.nodes.heat.VLC1
+ properties:
+ flavor:
+ get_input: vlc-flavor
+ availability_zone:
+ get_input: vlc_zone
+ image:
+ get_input: pxe-image
+ name:
+ get_input: vlc1-name
+ FSB1_Internal2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ mac_address:
+ get_input: fsb1-Internal2-mac
+ network: Internal2-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal2-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: FSB1
+ relationship: tosca.relationships.network.BindsTo
+ VLC2:
+ type: org.openecomp.resource.vfc.nodes.heat.VLC2
+ properties:
+ flavor:
+ get_input: vlc-flavor
+ availability_zone:
+ get_input: vlc_zone
+ image:
+ get_input: pxe-image
+ name:
+ get_input: vlc2-name
+ FSB1_Internal1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ mac_address:
+ get_input: fsb1-Internal1-mac
+ network: Internal1-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal1-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: FSB1
+ relationship: tosca.relationships.network.BindsTo
+ FSB2_Internal2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ mac_address:
+ get_input: fsb2-Internal2-mac
+ network: Internal2-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal2-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: FSB2
+ relationship: tosca.relationships.network.BindsTo
+ FSB2_Internal1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ mac_address:
+ get_input: fsb2-Internal1-mac
+ network: Internal1-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal1-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: FSB2
+ relationship: tosca.relationships.network.BindsTo
+ VLC1_OAM:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ fixed_ips:
+ - ip_address:
+ get_input: vlc1-oam-ip
+ network:
+ get_input: oam_net_id
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: VLC1
+ relationship: tosca.relationships.network.BindsTo
+ epc-sctp-b-net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ route_targets:
+ - get_input: epc-sctp-b-net-rt
+ network_name:
+ get_input: epc-sctp-b-net-name
+ subnets:
+ epc-sctp-b-subnet:
+ cidr:
+ get_input: epc-sctp-b-net-cidr
+ gateway_ip:
+ get_input: epc-sctp-b-net-gateway
+ allocation_pools:
+ - start:
+ get_input: epc-sctp-b-pool-start
+ end:
+ get_input: epc-sctp-b-pool-end
+ GPB2:
+ type: org.openecomp.resource.vfc.nodes.heat.GPB2
+ properties:
+ flavor:
+ get_input: gpb-flavor
+ availability_zone:
+ get_input: gpb_zone
+ image:
+ get_input: pxe-image
+ name:
+ get_input: gpb2-name
+ GPB1:
+ type: org.openecomp.resource.vfc.nodes.heat.GPB1
+ properties:
+ flavor:
+ get_input: gpb-flavor
+ availability_zone:
+ get_input: gpb_zone
+ image:
+ get_input: pxe-image
+ name:
+ get_input: gpb1-name
+ VLC1_GTP:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ fixed_ips:
+ - ip_address:
+ get_input: vlc1-gtp-ip
+ network: epc-gtp-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: epc-gtp-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: VLC1
+ relationship: tosca.relationships.network.BindsTo
+ FSB2_OAM:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ fixed_ips:
+ - ip_address:
+ get_input: fsb2-oam-ip
+ network:
+ get_input: oam_net_id
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: FSB2
+ relationship: tosca.relationships.network.BindsTo
+ GPB1_Internal2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ mac_address:
+ get_input: gpb1-Internal2-mac
+ network: Internal2-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal2-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: GPB1
+ relationship: tosca.relationships.network.BindsTo
+ GPB1_Internal1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ mac_address:
+ get_input: gpb1-Internal1-mac
+ network: Internal1-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal1-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: GPB1
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ vmme_small:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/vmme_small.yml
+ description: |
+ HOT template to create vmme 2 fsb 2 ncb 2 gbp 2 vlc
+ members:
+ - NCB1
+ - NCB2
+ - VLC2_OAM
+ - epc-gtp-net
+ - NCB1_Internal1
+ - VLC2_Internal2
+ - NCB1_Internal2
+ - VLC2_Internal1
+ - VLC2_GTP
+ - FSB1_volume
+ - testConvertGetParamFunctions
+ - FSB2_volume
+ - FSB1_OAM
+ - Internal1-net
+ - GPB2_Internal1
+ - GPB2_Internal2
+ - testConvertGetAttributeFunctions
+ - NCB2_Internal2
+ - NCB2_Internal1
+ - FSB2
+ - FSB1
+ - Internal2-net
+ - VLC1_Internal1
+ - epc-sctp-a-net
+ - VLC1_Internal2
+ - VLC1_SCTP_B
+ - VLC2_SCTP_B
+ - VLC1_SCTP_A
+ - VLC2_SCTP_A
+ - VLC1
+ - FSB1_Internal2
+ - VLC2
+ - FSB1_Internal1
+ - FSB2_Internal2
+ - FSB2_Internal1
+ - VLC1_OAM
+ - epc-sctp-b-net
+ - GPB2
+ - GPB1
+ - VLC1_GTP
+ - FSB2_OAM
+ - GPB1_Internal2
+ - GPB1_Internal1 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/inputs/MANIFEST.json
new file mode 100644
index 0000000000..9b0de07788
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/inputs/MANIFEST.json
@@ -0,0 +1,21 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create vmme 2 fsb 2 ncb 2 gbp 2 vlc",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "vmme_small.yml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "vmme_small.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "nimbus-ethernet.sh",
+ "type": "OTHER"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/inputs/nimbus-ethernet.sh b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/inputs/nimbus-ethernet.sh
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/inputs/nimbus-ethernet.sh
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/inputs/vmme_small.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/inputs/vmme_small.env
new file mode 100644
index 0000000000..e46cfd2a2d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/inputs/vmme_small.env
@@ -0,0 +1,97 @@
+parameters:
+ oam_net_id: 47bf4cca-0961-422f-bcd6-d5a4fbb1a351
+ fsb1-name: ZRDM1MMEX33FSB001
+ fsb2-name: ZRDM1MMEX33FSB002
+ ncb1-name: ZRDM1MMEX33NCB001
+ ncb2-name: ZRDM1MMEX33NCB002
+ vlc1-name: ZRDM1MMEX33VLC002
+ vlc2-name: ZRDM1MMEX33VLC002
+ gpb1-name: ZRDM1MMEX33GPB001
+ gpb2-name: ZRDM1MMEX33GPB002
+ epc-sctp-a-net-name: EPC-SCTP-A
+ epc-sctp-a-net-rt: 13979:105717
+ epc-sctp-a-net-cidr: 107.243.37.0/27
+ epc-sctp-a-net-gateway: 107.243.37.1
+ epc-sctp-a-pool-start: 107.243.37.3
+ epc-sctp-a-pool-end: 107.243.37.30
+ epc-sctp-b-net-name: EPC-SCTP-B
+ epc-sctp-b-net-rt: 13979:105719
+ epc-sctp-b-net-cidr: 107.243.37.32/24
+ epc-sctp-b-net-gateway: 107.243.37.33
+ epc-sctp-b-pool-start: 107.243.37.35
+ epc-sctp-b-pool-end: 107.243.37.62
+ epc-gtp-net-name: EPC-GTP
+ epc-gtp-net-rt: 13979:105715
+ epc-gtp-net-cidr: 107.243.37.64/27
+ epc-gtp-net-gateway: 107.243.37.65
+ epc-gtp-pool-start: 107.243.37.67
+ epc-gtp-pool-end: 107.243.37.94
+ fsb1-image: MME_FSB1_15B-CP04-r5a01
+ fsb2-image: MME_FSB2_15B-CP04-r5a01
+ fsb1-flavor: m4.xlarge4
+ fsb2-flavor: m4.xlarge4
+ fsb_zone: nova
+ fsb1-Internal1-mac: 00:80:37:0E:0B:12
+ fsb1-Internal2-mac: 00:81:37:0E:0B:12
+ fsb1-oam-ip: 107.250.172.221
+ fsb2-Internal1-mac: 00:80:37:0E:0D:12
+ fsb2-Internal2-mac: 00:81:37:0E:0D:12
+ fsb2-oam-ip: 107.250.172.222
+ pxe-image: MME_PXE-BOOT_cxp9025898_2r5a01.qcow2
+ ncb-flavor: m4.xlarge4
+ ncb_zone: nova
+ ncb1-Internal1-mac: 00:80:37:0E:09:12
+ ncb1-Internal2-mac: 00:81:37:0E:09:12
+ ncb2-Internal1-mac: 00:80:37:0E:0F:12
+ ncb2-Internal2-mac: 00:81:37:0E:0F:12
+ gpb-flavor: m4.xlarge4
+ gpb_zone: nova
+ gpb1-Internal1-mac: 00:80:37:0E:01:22
+ gpb1-Internal1-ip: 169.254.0.101
+ gpb1-Internal2-mac: 00:81:37:0E:01:22
+ gpb2-Internal1-mac: 00:80:37:0E:02:22
+ gpb2-Internal2-mac: 00:81:37:0E:02:22
+ vlc-flavor: m4.xlarge4
+ vlc_zone: nova
+ vlc1-sctp-a-ip: 107.243.37.3
+ vlc1-sctp-b-ip: 107.243.37.35
+ vlc1-gtp-ip: 107.243.37.67
+ vlc1-oam-ip: 107.250.172.227
+ vlc2-sctp-a-ip: 107.243.37.4
+ vlc2-sctp-b-ip: 107.243.37.36
+ vlc2-gtp-ip: 107.243.37.68
+ vlc2-oam-ip: 107.250.172.228
+ vlc1-Internal1-mac: 00:80:37:0E:01:12
+ vlc1-Internal2-mac: 00:81:37:0E:01:12
+ vlc2-Internal1-mac: 00:80:37:0E:02:12
+ vlc2-Internal2-mac: 00:81:37:0E:02:12
+ Internal1_net_name: vmme_int_int_1
+ Internal1_subnet_name: vmme_int_int_sub_1
+ Internal1_ipam_name: vmme_ipam_int1
+ Internal1_cidr: 169.253.0.0/17
+ Internal1_forwarding_mode: "l2"
+ Internal1_dhcp: "False"
+ Internal1_shared: "False"
+ Internal1_external: "False"
+ Internal1_name: "Internal1-subnet"
+ Internal1_default_gateway: 169.253.0.3
+ Internal1_net_pool_start: 169.253.0.100
+ Internal1_net_pool_end: 169.253.0.254
+ Internal2_net_name: vmme_int_int_2
+ Internal2_subnet_name: vmme_int_int_sub_2
+ Internal2_ipam_name: vmme_ipam_int2
+ Internal2_cidr: 169.255.0.0/17
+ Internal2_shared: "False"
+ Internal2_external: "False"
+ Internal2_forwarding_mode: "l2"
+ Internal2_dhcp: "False"
+ Internal2_name: "Internal2-subnet"
+ Internal2_default_gateway: 169.255.0.3
+ Internal2_net_pool_start: 169.255.0.100
+ Internal2_net_pool_end: 169.255.0.254
+ static_prefix_sctp_a_1: 107.239.40.32/30
+ static_prefix_gtp_1: 107.239.40.96/30
+ static_prefix_sctp_b_1: 107.239.40.64/30
+ VMME_FSB1_boot_volume: 8248e794-6173-4b49-b9c3-8219b0b56f4e
+ VMME_FSB2_boot_volume: 089a0d11-4b15-4370-8343-3f90907b1221
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/inputs/vmme_small.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/inputs/vmme_small.yml
new file mode 100644
index 0000000000..21df075c4a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/inputs/vmme_small.yml
@@ -0,0 +1,722 @@
+heat_template_version: 2013-05-23
+
+description: >
+ HOT template to create vmme 2 fsb 2 ncb 2 gbp 2 vlc
+
+parameters:
+ fsb1-oam-ip:
+ type: string
+ fsb2-oam-ip:
+ type: string
+ vlc1-oam-ip:
+ type: string
+ vlc2-oam-ip:
+ type: string
+ Internal1_net_pool_start:
+ type: string
+ Internal1_net_pool_end:
+ type: string
+ Internal2_net_pool_start:
+ type: string
+ Internal2_net_pool_end:
+ type: string
+ Internal1_default_gateway:
+ type: string
+ Internal2_default_gateway:
+ type: string
+ Internal1_shared:
+ type: string
+ Internal1_external:
+ type: string
+ Internal1_net_name:
+ type: string
+ Internal1_subnet_name:
+ type: string
+ Internal1_ipam_name:
+ type: string
+ Internal1_cidr:
+ type: string
+ Internal1_forwarding_mode:
+ type: string
+ Internal1_dhcp:
+ type: string
+ Internal1_name:
+ type: string
+ Internal2_net_name:
+ type: string
+ Internal2_subnet_name:
+ type: string
+ Internal2_ipam_name:
+ type: string
+ Internal2_cidr:
+ type: string
+ Internal2_forwarding_mode:
+ type: string
+ Internal2_dhcp:
+ type: string
+ Internal2_name:
+ type: string
+ Internal2_shared:
+ type: string
+ Internal2_external:
+ type: string
+ vlc1-sctp-a-ip:
+ type: string
+ vlc1-sctp-b-ip:
+ type: string
+ vlc1-gtp-ip:
+ type: string
+ vlc2-sctp-a-ip:
+ type: string
+ vlc2-sctp-b-ip:
+ type: string
+ vlc2-gtp-ip:
+ type: string
+ fsb1-name:
+ type: string
+ description: Name of fsb1
+ fsb2-name:
+ type: string
+ description: Name of fsb1
+ ncb1-name:
+ type: string
+ description: Name of ncb1
+ ncb2-name:
+ type: string
+ description: Name of ncb2
+ vlc1-name:
+ type: string
+ description: Name of vlc1
+ vlc2-name:
+ type: string
+ description: Name of vlc2
+ gpb1-name:
+ type: string
+ description: Name of gpb1
+ gpb2-name:
+ type: string
+ description: Name of gpb2
+ fsb_zone:
+ type: string
+ description: cluster for spawnning fsb instances
+ fsb1-image:
+ type: string
+ description: Name of image to use for server fsb1
+ fsb1-flavor:
+ type: string
+ description: Flavor to use for servers fsb1
+ oam_net_id:
+ type: string
+ description: uuid of oam network
+ fsb1-Internal1-mac:
+ type: string
+ description: static mac address assigned to fsb1-Internal1
+ fsb1-Internal2-mac:
+ type: string
+ description: static mac address assigned to fsb1-Internal2
+ fsb2-image:
+ type: string
+ description: Name of image to use for server fsb2
+ fsb2-flavor:
+ type: string
+ description: Flavor to use for servers fsb2
+ fsb2-Internal1-mac:
+ type: string
+ description: static mac address assigned to fsb2-Internal1
+ fsb2-Internal2-mac:
+ type: string
+ description: static mac address assigned to fsb2-Internal2
+ pxe-image:
+ type: string
+ description: Name of image to use for server ncb
+ ncb-flavor:
+ type: string
+ description: Flavor to use for servers ncb
+ ncb_zone:
+ type: string
+ description: cluster for spawnning ncb instances
+ ncb1-Internal1-mac:
+ type: string
+ description: static mac address assigned to ncb1-Internal1
+ ncb1-Internal2-mac:
+ type: string
+ description: static mac address assigned to ncb1-Internal2
+ ncb2-Internal1-mac:
+ type: string
+ description: static mac address assigned to ncb2-Internal1
+ ncb2-Internal2-mac:
+ type: string
+ description: static mac address assigned to ncb2-Internal2
+ gpb-flavor:
+ type: string
+ description: Flavor to use for servers gpb
+ gpb_zone:
+ type: string
+ description: cluster for spawnning gpb instances
+ gpb1-Internal1-ip:
+ type: string
+ gpb1-Internal1-mac:
+ type: string
+ description: static mac address assigned to gpb1-Internal1
+ gpb1-Internal2-mac:
+ type: string
+ description: static mac address assigned to gpb1-Internal2
+ gpb2-Internal1-mac:
+ type: string
+ description: static mac address assigned to gpb2-Internal1
+ gpb2-Internal2-mac:
+ type: string
+ description: static mac address assigned to gpb2-Internal2
+ vlc-flavor:
+ type: string
+ description: Flavor to use for servers vlc
+ vlc_zone:
+ type: string
+ description: cluster for spawnning vlc instances
+ vlc1-Internal1-mac:
+ type: string
+ description: static mac address assigned to vlc1-Internal1
+ vlc1-Internal2-mac:
+ type: string
+ description: static mac address assigned to vlc1-Internal2
+ vlc2-Internal1-mac:
+ type: string
+ description: static mac address assigned to vlc2-Internal1
+ vlc2-Internal2-mac:
+ type: string
+ description: static mac address assigned to vlc2-Internal2
+ epc-sctp-a-net-name:
+ type: string
+ description: epc-sctp-a net name
+ epc-sctp-a-net-rt:
+ type: string
+ description: epc-sctp-a route target
+ epc-sctp-a-net-cidr:
+ type: string
+ description: epc-sctp-a subnet
+ epc-sctp-a-net-gateway:
+ type: string
+ description: epc-sctp-a-net network gateway
+ epc-sctp-a-pool-start:
+ type: string
+ description: epc-sctp-a-net network ip pool start IP address
+ epc-sctp-a-pool-end:
+ type: string
+ description: epc-sctp-a-net network ip pool end IP address
+ epc-sctp-b-net-name:
+ type: string
+ description: epc-sctp-b net name
+ epc-sctp-b-net-rt:
+ type: string
+ description: epc-sctp-b route target
+ epc-sctp-b-net-cidr:
+ type: string
+ description: epc-sctp-b subnet
+ epc-sctp-b-net-gateway:
+ type: string
+ description: epc-sctp-b-net network gateway
+ epc-sctp-b-pool-start:
+ type: string
+ description: epc-sctp-b-net network ip pool start IP address
+ epc-sctp-b-pool-end:
+ type: string
+ description: epc-sctp-b-net network ip pool end IP address
+ epc-gtp-net-name:
+ type: string
+ description: gtp net name
+ epc-gtp-net-rt:
+ type: string
+ description: gtp route target
+ epc-gtp-net-cidr:
+ type: string
+ description: gtp stubnet
+ epc-gtp-net-gateway:
+ type: string
+ description: gtp network gateway
+ epc-gtp-pool-start:
+ type: string
+ description: gtp network ip pool start IP address
+ epc-gtp-pool-end:
+ type: string
+ description: gtp network ip pool end IP address
+ static_prefix_sctp_a_1:
+ type: string
+ description: Static Prefix
+ static_prefix_sctp_b_1:
+ type: string
+ description: Static Prefix
+ static_prefix_gtp_1:
+ type: string
+ description: Static Prefix
+ VMME_FSB1_boot_volume:
+ type: string
+ VMME_FSB2_boot_volume:
+ type: string
+ volume_type:
+ type: string
+ description: volume
+ volume_size:
+ type: string
+ description: volume
+ FSB1_volume_name:
+ type: string
+ description: volume name
+ FSB_1_image:
+ type: string
+ description: image name
+ FSB2_volume_name:
+ type: string
+ description: volume name
+ FSB_2_image:
+ type: string
+ description: image name
+ my_instance:
+ type: string
+ description: instance
+ Internal1-net:
+ type: string
+ description: net
+
+resources:
+ FSB1_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: 3
+ volume_type: {get_param: volume_type}
+ name: {get_param: FSB1_volume_name}
+ image: {get_param: FSB_1_image}
+
+ FSB2_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: volume_size}
+ volume_type: {get_param: volume_type}
+ name: {get_param: FSB2_volume_name}
+ image: {get_param: FSB_2_image}
+
+ Internal1_ipam:
+ type: OS::Contrail::NetworkIpam
+ properties:
+ name: { get_param: Internal1_ipam_name }
+
+ Internal2_ipam:
+ type: OS::Contrail::NetworkIpam
+ properties:
+ name: { get_param: Internal2_ipam_name }
+
+ Internal1-net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: Internal1_net_name }
+ forwarding_mode: { get_param: Internal1_forwarding_mode }
+ shared: { get_param: Internal1_shared }
+ external: true
+ route_targets: { get_file: 'file:///nimbus-ethernet.sh' }
+ testConvertGetParamFunctions:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: Internal1_net_name }
+ forwarding_mode: { get_param: Internal1_forwarding_mode }
+ shared: { get_param: Internal1_shared }
+ external: { get_param: [my_instance, networks, private, 0] }
+# route_targets: { "Fn::Split" : [ ",", Ref: route_targets ] }
+ testConvertGetAttributeFunctions:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: Internal1_net_name }
+ forwarding_mode: { get_param: Internal1_forwarding_mode }
+ shared: { get_param: Internal1_shared }
+ external: { get_param: Internal1_external }
+# route_targets: { "Fn::Split" : [ ",", Ref: route_targets ] }
+
+ Internal1-subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: Internal1-net }
+ cidr: { get_param: Internal1_cidr }
+ gateway_ip: { get_param: Internal1_default_gateway }
+ enable_dhcp: { get_param: Internal1_dhcp }
+
+ Internal3-subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: Internal1-net }
+ cidr: { get_param: Internal2_cidr }
+ gateway_ip: { get_param: Internal2_default_gateway }
+ enable_dhcp: { get_param: Internal2_dhcp }
+
+ Internal4-subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: Internal1-net }
+ cidr: { get_param: Internal1_cidr }
+ gateway_ip: { get_param: Internal1_default_gateway }
+ enable_dhcp: off
+
+# Internal1-subnet:
+# type: OS::Contrail::VnSubnet
+# properties:
+# name: { get_param: Internal1_subnet_name }
+# network: { get_resource: Internal1-net }
+# ip_prefix: { get_param: Internal1_cidr }
+ # ipam: { get_resource: Internal1_ipam }
+ # enable_dhcp: { get_param: Internal1_dhcp }
+ # default_gateway: { get_param: Internal1_default_gateway }
+ # allocation_pools:
+ # - start: { get_param: Internal1_net_pool_start }
+ # end: { get_param: Internal1_net_pool_end }
+
+
+
+ Internal2-net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: Internal2_name }
+ forwarding_mode: { get_param: Internal2_forwarding_mode }
+ shared: { get_param: Internal2_shared }
+ external: { get_param: Internal2_external }
+# route_targets: { "Fn::Split" : [ ",", Ref: route_targets ] }
+
+# Internal2-subnet:
+# type: OS::Contrail::VnSubnet
+# properties:
+# name: { get_param: Internal2_subnet_name }
+# network: { get_resource: Internal2-net }
+# ip_prefix: { get_param: Internal2_cidr }
+# ipam: { get_resource: Internal2_ipam }
+# enable_dhcp: { get_param: Internal2_dhcp }
+# default_gateway: { get_param: Internal2_default_gateway }
+# allocation_pools:
+# - start: { get_param: Internal2_net_pool_start }
+# end: { get_param: Internal2_net_pool_end }
+
+ Internal2-subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: Internal2-net }
+ cidr: { get_param: Internal2_cidr }
+ gateway_ip: { get_param: Internal2_default_gateway }
+ enable_dhcp: { get_param: Internal2_dhcp }
+
+ epc-sctp-a-net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: epc-sctp-a-net-name }
+ route_targets: [ get_param: epc-sctp-a-net-rt ]
+
+
+ epc-sctp-a-subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: epc-sctp-a-net }
+ cidr: { get_param: epc-sctp-a-net-cidr }
+ gateway_ip: { get_param: epc-sctp-a-net-gateway }
+ allocation_pools:
+ - start: { get_param: epc-sctp-a-pool-start }
+ end: { get_param: epc-sctp-a-pool-end }
+
+ epc-sctp-b-net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: epc-sctp-b-net-name }
+ route_targets: [ get_param: epc-sctp-b-net-rt ]
+
+ epc-sctp-b-subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: epc-sctp-b-net }
+ cidr: { get_param: epc-sctp-b-net-cidr }
+ gateway_ip: { get_param: epc-sctp-b-net-gateway }
+ allocation_pools:
+ - start: { get_param: epc-sctp-b-pool-start }
+ end: { get_param: epc-sctp-b-pool-end }
+
+ epc-gtp-net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: epc-gtp-net-name }
+ route_targets: [ get_param: epc-gtp-net-rt ]
+
+ epc-gtp-subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: epc-gtp-net }
+ cidr: { get_param: epc-gtp-net-cidr }
+ gateway_ip: { get_param: epc-gtp-net-gateway }
+ allocation_pools:
+ - start: { get_param: epc-gtp-pool-start }
+ end: { get_param: epc-gtp-pool-end }
+
+ FSB1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: fsb1-name }
+ block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB1_boot_volume }, delete_on_termination: "false" }]
+ flavor: { get_param: fsb1-flavor }
+ availability_zone: { get_param: fsb_zone }
+ networks:
+ - port: { get_resource: FSB1_Internal1 }
+ - port: { get_resource: FSB1_Internal2 }
+ - port: { get_resource: FSB1_OAM }
+
+ FSB1_Internal1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: Internal1-net }
+ mac_address: { get_param: fsb1-Internal1-mac }
+
+ FSB1_Internal2:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: Internal2-net }
+ mac_address: { get_param: fsb1-Internal2-mac }
+
+ FSB1_OAM:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_id }
+ fixed_ips:
+ - ip_address: { get_param: fsb1-oam-ip }
+
+ FSB2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: fsb2-name }
+ block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }]
+ flavor: { get_param: fsb2-flavor }
+ availability_zone: { get_param: fsb_zone }
+ networks:
+ - port: { get_resource: FSB2_Internal1 }
+ - port: { get_resource: FSB2_Internal2 }
+ - port: { get_resource: FSB2_OAM }
+
+ FSB2_Internal1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: Internal1-net }
+ mac_address: { get_param: fsb2-Internal1-mac }
+
+
+ FSB2_Internal2:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: Internal2-net }
+ mac_address: { get_param: fsb2-Internal2-mac }
+
+ FSB2_OAM:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_id }
+ fixed_ips:
+ - ip_address: { get_param: fsb2-oam-ip }
+
+ NCB1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: ncb1-name }
+ image: { get_param: pxe-image }
+ flavor: { get_param: ncb-flavor }
+ availability_zone: { get_param: ncb_zone }
+ networks:
+ - port: { get_resource: NCB1_Internal1 }
+ - port: { get_resource: NCB1_Internal2 }
+
+ NCB1_Internal1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: Internal1-net }
+ mac_address: { get_param: ncb1-Internal1-mac }
+
+ NCB1_Internal2:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: Internal2-net }
+ mac_address: { get_param: ncb1-Internal2-mac }
+
+ NCB2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: ncb2-name }
+ image: { get_param: pxe-image }
+ flavor: { get_param: ncb-flavor }
+ availability_zone: { get_param: ncb_zone }
+ networks:
+ - port: { get_resource: NCB2_Internal1 }
+ - port: { get_resource: NCB2_Internal2 }
+
+ NCB2_Internal1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: Internal1-net }
+ mac_address: { get_param: ncb2-Internal1-mac }
+
+ NCB2_Internal2:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: Internal2-net }
+ mac_address: { get_param: ncb2-Internal2-mac }
+
+ GPB1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: gpb1-name }
+ image: { get_param: pxe-image }
+ flavor: { get_param: gpb-flavor }
+ availability_zone: { get_param: gpb_zone }
+ networks:
+ - port: { get_resource: GPB1_Internal1 }
+ - port: { get_resource: GPB1_Internal2 }
+
+ GPB1_Internal1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: Internal1-net }
+ mac_address: { get_param: gpb1-Internal1-mac }
+
+ GPB1_Internal2:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: Internal2-net }
+ mac_address: { get_param: gpb1-Internal2-mac }
+
+ GPB2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: gpb2-name }
+ image: { get_param: pxe-image }
+ flavor: { get_param: gpb-flavor }
+ availability_zone: { get_param: gpb_zone }
+ networks:
+ - port: { get_resource: GPB2_Internal1 }
+ - port: { get_resource: GPB2_Internal2 }
+
+ GPB2_Internal1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: Internal1-net }
+ mac_address: { get_param: gpb2-Internal1-mac }
+
+ GPB2_Internal2:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: Internal2-net }
+ mac_address: { get_param: gpb2-Internal2-mac }
+
+ VLC1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: vlc1-name }
+ image: { get_param: pxe-image }
+ flavor: { get_param: vlc-flavor }
+ availability_zone: { get_param: vlc_zone }
+ networks:
+ - port: { get_resource: VLC1_Internal1 }
+ - port: { get_resource: VLC1_Internal2 }
+ - port: { get_resource: VLC1_OAM }
+ - port: { get_resource: VLC1_SCTP_A }
+ - port: { get_resource: VLC1_SCTP_B }
+ - port: { get_resource: VLC1_GTP }
+
+ VLC1_Internal1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: Internal1-net }
+ mac_address: { get_param: vlc1-Internal1-mac }
+
+ VLC1_Internal2:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: Internal2-net }
+ mac_address: { get_param: vlc1-Internal2-mac }
+
+ VLC1_OAM:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_id }
+ fixed_ips:
+ - ip_address: { get_param: vlc1-oam-ip }
+
+ VLC1_SCTP_A:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: epc-sctp-a-net }
+ fixed_ips:
+ - ip_address: { get_param: vlc1-sctp-a-ip }
+
+ VLC1_SCTP_B:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: epc-sctp-b-net }
+ fixed_ips:
+ - ip_address: { get_param: vlc1-sctp-b-ip }
+
+ VLC1_GTP:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: epc-gtp-net }
+ fixed_ips:
+ - ip_address: { get_param: vlc1-gtp-ip }
+
+ VLC2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: vlc2-name }
+ image: { get_param: pxe-image }
+ flavor: { get_param: vlc-flavor }
+ availability_zone: { get_param: vlc_zone }
+ networks:
+ - port: { get_resource: VLC2_Internal1 }
+ - port: { get_resource: VLC2_Internal2 }
+ - port: { get_resource: VLC2_OAM }
+ - port: { get_resource: VLC2_SCTP_A }
+ - port: { get_resource: VLC2_SCTP_B }
+ - port: { get_resource: VLC2_GTP }
+
+
+ VLC2_Internal1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: Internal1-net }
+ mac_address: { get_param: vlc2-Internal1-mac }
+
+ VLC2_OAM:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_id }
+ fixed_ips:
+ - ip_address: { get_param: vlc2-oam-ip }
+
+ VLC2_Internal2:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: Internal2-net }
+ mac_address: { get_param: vlc2-Internal2-mac }
+
+ VLC2_SCTP_A:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: epc-sctp-a-net }
+ fixed_ips:
+ - ip_address: { get_param: vlc2-sctp-a-ip }
+
+ VLC2_SCTP_B:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: epc-sctp-b-net }
+ fixed_ips:
+ - ip_address: { get_param: vlc2-sctp-b-ip }
+
+ VLC2_GTP:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: epc-gtp-net }
+ fixed_ips:
+ - ip_address: { get_param: vlc2-gtp-ip }
+
+ Test-empty-network-in-subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_param: Internal1-net }
+ cidr: { get_param: Internal1_cidr }
+ gateway_ip: { get_param: Internal1_default_gateway }
+ enable_dhcp: { get_param: Internal1_dhcp } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Neutron_Net/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Neutron_Net/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..c93363e850
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Neutron_Net/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,219 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ param_number:
+ hidden: false
+ immutable: false
+ type: float
+ description: param number - float
+ jsa_cidr:
+ hidden: false
+ immutable: false
+ type: string
+ description: CIDR of jsa log network
+ default: 107.243.7.128/26
+ param_string:
+ hidden: false
+ immutable: false
+ type: string
+ description: param String - string
+ param_json:
+ hidden: false
+ immutable: false
+ type: json
+ description: param json - map<String>
+ param_comma_delimited_list:
+ hidden: false
+ immutable: false
+ type: list
+ description: param comma_delimited_list - List
+ entry_schema:
+ type: string
+ user_name:
+ label: User Name
+ hidden: true
+ immutable: false
+ type: string
+ description: User name to be configured for the application
+ constraints:
+ - max_length: 8
+ - min_length: 6
+ - pattern: '[A-Z]+[a-zA-Z0-9]*'
+ - in_range:
+ - 0
+ - 10
+ param_boolean:
+ hidden: false
+ immutable: false
+ type: boolean
+ description: param boolean - boolean
+ instance_type:
+ label: Instance Type
+ hidden: false
+ immutable: false
+ type: string
+ description: Instance type for compute instances
+ constraints:
+ - valid_values:
+ - m1.small
+ - m1.medium
+ - m1.large
+ jsa_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ default: jsa_log_net_0
+ node_templates:
+ jsa_net:
+ type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
+ properties:
+ shared: true
+ network_name:
+ get_input: jsa_net_name
+ subnets:
+ jsa_subnet:
+ cidr:
+ get_input: jsa_cidr
+ jsa_net_test_get_attribute_2_params:
+ type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
+ properties:
+ dhcp_agent_ids:
+ - '1000'
+ - '1001'
+ - '1002'
+ tenant_id: 23456
+ port_security_enabled: true
+ shared: true
+ admin_state_up: false
+ qos_policy: full
+ network_name:
+ get_attribute:
+ - jsa_net
+ - network_name
+ value_specs:
+ key1: spec1
+ jsa_net_test_get_attribute_3_params:
+ type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
+ properties:
+ dhcp_agent_ids:
+ - '1000'
+ - '1001'
+ - '1002'
+ tenant_id: 23456
+ port_security_enabled: true
+ shared: true
+ admin_state_up: false
+ qos_policy: full
+ network_name:
+ get_attribute:
+ - jsa_net
+ - network_name
+ - 0
+ value_specs:
+ key1: spec1
+ jsa_net_test_get_attribute_4_params:
+ type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
+ properties:
+ dhcp_agent_ids:
+ - '1000'
+ - '1001'
+ - '1002'
+ tenant_id: 23456
+ port_security_enabled: true
+ shared: true
+ admin_state_up: false
+ qos_policy: full
+ network_name:
+ get_attribute:
+ - jsa_net
+ - network_name
+ - 0
+ - a1
+ value_specs:
+ key1: spec1
+ jsa_net_test_get_attribute_5_params:
+ type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
+ properties:
+ dhcp_agent_ids:
+ - '1000'
+ - '1001'
+ - '1002'
+ tenant_id: 23456
+ port_security_enabled: true
+ shared: true
+ admin_state_up: false
+ qos_policy: full
+ network_name:
+ get_attribute:
+ - jsa_net
+ - network_name
+ - 0
+ - a1
+ - a2
+ value_specs:
+ key1: spec1
+ jsa_net_test_full_attribute:
+ type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
+ properties:
+ dhcp_agent_ids:
+ - '1000'
+ - '1001'
+ - '1002'
+ tenant_id: 23456
+ port_security_enabled: true
+ shared: true
+ admin_state_up: false
+ qos_policy: full
+ network_name:
+ get_input: jsa_net_name
+ subnets:
+ jsa_net_test_full_attribute_subnet:
+ cidr:
+ get_input: jsa_cidr
+ value_specs:
+ key1: spec1
+ key2: spec2
+ groups:
+ ep-jsa_net:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/ep-jsa_net.yaml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - jsa_net
+ - jsa_net_test_get_attribute_2_params
+ - jsa_net_test_get_attribute_3_params
+ - jsa_net_test_get_attribute_4_params
+ - jsa_net_test_get_attribute_5_params
+ - jsa_net_test_full_attribute \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Neutron_Net/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Neutron_Net/inputs/MANIFEST.json
new file mode 100644
index 0000000000..0d0f2bd7cf
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Neutron_Net/inputs/MANIFEST.json
@@ -0,0 +1,17 @@
+{
+ "name": "vEP_JSA_Net",
+ "description": "Version 2.0 02-09-2016 (Authors: John Doe, user PROD)",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "ep-jsa_net.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "ep-jsa_net.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Neutron_Net/inputs/ep-jsa_net.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Neutron_Net/inputs/ep-jsa_net.env
new file mode 100644
index 0000000000..9dd1cd441f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Neutron_Net/inputs/ep-jsa_net.env
@@ -0,0 +1,4 @@
+parameters:
+ jsa_net_name: jsa_log_net_0
+ jsa_cidr: 107.243.7.128/26
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Neutron_Net/inputs/ep-jsa_net.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Neutron_Net/inputs/ep-jsa_net.yaml
new file mode 100644
index 0000000000..3c5b00dc48
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Neutron_Net/inputs/ep-jsa_net.yaml
@@ -0,0 +1,135 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ param_string:
+ type: string
+ description: param String - string
+ param_number:
+ type: number
+ description: param number - float
+ param_json:
+ type: json
+ description: param json - map<String>
+ param_boolean:
+ type: boolean
+ description: param boolean - boolean
+ param_comma_delimited_list:
+ type: comma_delimited_list
+ description: param comma_delimited_list - List
+
+ jsa_net_name:
+ type: string
+ description: network name of jsa log network
+ jsa_cidr:
+ type: string
+ description: CIDR of jsa log network
+ user_name:
+ type: string
+ label: User Name
+ description: User name to be configured for the application
+ hidden: true
+ constraints:
+ - length: { min: 6, max: 8 }
+ description: User name must be between 6 and 8 characters
+ - allowed_pattern: "[A-Z]+[a-zA-Z0-9]*"
+ description: User name must start with an uppercase character
+ - range: { min: 0, max: 10 }
+ instance_type:
+ type: string
+ label: Instance Type
+ description: Instance type for compute instances
+ constraints:
+ - allowed_values:
+ - m1.small
+ - m1.medium
+ - m1.large
+
+resources:
+ jsa_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: {get_resource: jsa_net}
+ cidr: {get_param: jsa_cidr}
+
+ jsa_net:
+ type: OS::Neutron::Net
+ properties:
+ name: {get_param: jsa_net_name}
+ shared: True
+
+ jsa_net_test_full_attribute:
+ type: OS::Neutron::Net
+ properties:
+ name: {get_param: jsa_net_name}
+ shared: True
+ dhcp_agent_ids: ['1000','1001','1002']
+ tenant_id: 23456
+ port_security_enabled: t
+ admin_state_up: 0
+ qos_policy: full
+ value_specs:
+ key1: "spec1"
+ key2: "spec2"
+
+ jsa_net_test_full_attribute_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: {get_resource: jsa_net_test_full_attribute}
+ cidr: {get_param: jsa_cidr}
+
+ jsa_net_test_get_attribute_2_params:
+ type: OS::Neutron::Net
+ properties:
+ name: {get_attr: [jsa_net, name]}
+ shared: True
+ dhcp_agent_ids: ['1000','1001','1002']
+ tenant_id: 23456
+ port_security_enabled: t
+ admin_state_up: 0
+ qos_policy: full
+ value_specs:
+ key1: "spec1"
+
+ jsa_net_test_get_attribute_3_params:
+ type: OS::Neutron::Net
+ properties:
+ name: {get_attr: [jsa_net, name, 0]}
+ shared: True
+ dhcp_agent_ids: ['1000','1001','1002']
+ tenant_id: 23456
+ port_security_enabled: t
+ admin_state_up: 0
+ qos_policy: full
+ value_specs:
+ key1: "spec1"
+
+ jsa_net_test_get_attribute_4_params:
+ type: OS::Neutron::Net
+ properties:
+ name: {get_attr: [jsa_net, name, 0,a1]}
+ shared: True
+ dhcp_agent_ids: ['1000','1001','1002']
+ tenant_id: 23456
+ port_security_enabled: t
+ admin_state_up: 0
+ qos_policy: full
+ value_specs:
+ key1: "spec1"
+
+ jsa_net_test_get_attribute_5_params:
+ type: OS::Neutron::Net
+ properties:
+ name: {get_attr: [jsa_net, name, 0, a1, a2]}
+ shared: True
+ dhcp_agent_ids: ['1000','1001','1002']
+ tenant_id: 23456
+ port_security_enabled: t
+ admin_state_up: 0
+ qos_policy: full
+ value_specs:
+ key1: "spec1"
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..4eacd2f60a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,602 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.FSB2:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.FSB1:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.pcm_server:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.pcrf_psm_server:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ Internal2_name:
+ label: Internal2_name
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_name
+ Internal1_shared:
+ label: Internal1_shared
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_shared
+ FSB1_volume_name:
+ label: FSB1_volume
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_volume_1
+ jsa_cidr:
+ label: jsa_cidr
+ hidden: false
+ immutable: false
+ type: string
+ description: jsa_cidr
+ default: 107.243.7.128/26
+ availabilityzone_name:
+ label: availabilityzone_name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone_name
+ fsb1-name:
+ label: FSB1_name
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_name
+ pcm_image_name:
+ label: pcm_image_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_image_name
+ Internal2_external:
+ label: Internal2_external
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_external
+ Internal2_forwarding_mode:
+ label: Internal2_forwarding_mode
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_forwarding_mode
+ pcrf_psm_flavor_name:
+ label: pcrf_psm_flavor_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_flavor_name
+ pcrf_psm_image_name:
+ label: pcrf_psm_image_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_image_name
+ pcrf_vnf_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: prop
+ FSB_1_image:
+ label: MME_FSB1
+ hidden: false
+ immutable: false
+ type: string
+ description: MME_FSB1_15B-CP04-r5a01
+ snapshot01:
+ hidden: false
+ immutable: false
+ type: string
+ description: prop
+ volume_size:
+ label: volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: my volume size 320GB
+ snapshot02:
+ hidden: false
+ immutable: false
+ type: string
+ description: prop
+ fsb1-Internal1-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ Internal2_shared:
+ label: Internal2_shared
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal2_shared
+ pcm_server_name:
+ label: pcm_server_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_server_name
+ cps_net_mask:
+ hidden: false
+ immutable: false
+ type: string
+ description: prop
+ Internal1_net_name:
+ label: Internal1_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_net_name
+ oam_net_name:
+ label: oam_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: oam_net_name
+ fsb1-flavor:
+ label: FSB1_flavor
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_flavor
+ fsb1-Internal2-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ pcm_vol_01:
+ hidden: false
+ immutable: false
+ type: string
+ description: prop
+ volume_type:
+ label: volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: volume type Gold
+ fsb1-zone:
+ label: FSB1_zone
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_zone
+ fsb_zone:
+ label: FSB1_zone
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_zone
+ oam_net_gw:
+ hidden: false
+ immutable: false
+ type: string
+ description: prop
+ VMME_FSB1_boot_volume:
+ hidden: false
+ immutable: false
+ type: string
+ network_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: prop
+ security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ cps_net_ip:
+ hidden: false
+ immutable: false
+ type: string
+ description: prop
+ jsa_net_name:
+ label: jsa_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: jsa_net_name
+ default: jsa_log_net_0
+ pcrf_psm_server_name:
+ label: pcrf_psm_server_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_psm_server_name
+ pcm_flavor_name:
+ label: pcm_flavor_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcm_flavor_name
+ oam_net_id:
+ label: oam_net_id
+ hidden: false
+ immutable: false
+ type: string
+ description: oam_net_id
+ pcrf_cps_net_ip:
+ hidden: false
+ immutable: false
+ type: string
+ description: prop
+ fsb2-Internal1-mac:
+ label: FSB1_internal_mac
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_internal_mac
+ Internal1_forwarding_mode:
+ label: Internal1_forwarding_mode
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_forwarding_mode
+ pcrf_cps_net_name:
+ label: pcrf_cps_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: pcrf_cps_net_name
+ pcm_vol:
+ hidden: false
+ immutable: false
+ type: string
+ description: prop
+ cps_net_name:
+ label: cps_net_name
+ hidden: false
+ immutable: false
+ type: string
+ description: cps_net_name
+ oam_net_ip:
+ hidden: false
+ immutable: false
+ type: string
+ description: prop
+ oam_net_mask:
+ hidden: false
+ immutable: false
+ type: string
+ description: prop
+ fsb1-oam-ip:
+ hidden: false
+ immutable: false
+ type: string
+ description: prop
+ pcrf_security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ Internal1_external:
+ label: Internal1_external
+ hidden: false
+ immutable: false
+ type: string
+ description: Internal1_external
+ node_templates:
+ pcm_vol_02:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ image:
+ get_input: FSB_1_image
+ volume_type:
+ get_input: volume_type
+ size: '(get_input : volume_size) * 1024'
+ read_only: true
+ name:
+ get_input: FSB1_volume_name
+ Internal2-net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ shared:
+ get_input: Internal2_shared
+ forwarding_mode:
+ get_input: Internal2_forwarding_mode
+ external:
+ get_input: Internal2_external
+ network_name:
+ get_input: Internal2_name
+ pcm_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: oam_net_ip
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_pcm
+ relationship: tosca.relationships.network.BindsTo
+ server_VolumeTest_snapshot02:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ snapshot_id:
+ get_input: snapshot02
+ FSB1_Internal2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ mac_address:
+ get_input: fsb1-Internal2-mac
+ network: Internal2-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal2-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: FSB1
+ relationship: tosca.relationships.network.BindsTo
+ server_VolumeTest_snapshot01:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ snapshot_id:
+ get_input: snapshot01
+ FSB1_Internal1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ mac_address:
+ get_input: fsb1-Internal1-mac
+ network: Internal1-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal1-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: FSB1
+ relationship: tosca.relationships.network.BindsTo
+ FSB1_OAM:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ fixed_ips:
+ - ip_address:
+ get_input: fsb1-oam-ip
+ network:
+ get_input: oam_net_id
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: FSB1
+ relationship: tosca.relationships.network.BindsTo
+ psm01_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: pcrf_security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: pcrf_cps_net_ip
+ network:
+ get_input: pcrf_cps_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: pcrf_server_psm
+ relationship: tosca.relationships.network.BindsTo
+ pcm_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: cps_net_ip
+ network:
+ get_input: cps_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_pcm
+ relationship: tosca.relationships.network.BindsTo
+ network:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ network_name:
+ get_input: Internal1_net_name
+ server_pcm:
+ type: org.openecomp.resource.vfc.nodes.heat.pcm_server
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ Internal1-net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ shared:
+ get_input: Internal1_shared
+ forwarding_mode:
+ get_input: Internal1_forwarding_mode
+ external:
+ get_input: Internal1_external
+ network_name:
+ get_input: Internal1_net_name
+ pcrf_server_psm:
+ type: org.openecomp.resource.vfc.nodes.heat.pcrf_psm_server
+ properties:
+ flavor:
+ get_input: pcrf_psm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcrf_psm_image_name
+ config_drive: 'True'
+ metadata:
+ vnf_id:
+ get_input: pcrf_vnf_id
+ user_data_format: RAW
+ name:
+ get_input: pcrf_psm_server_name
+ server_VolumeTest:
+ type: org.openecomp.resource.vfc.nodes.heat.pcm_server
+ properties:
+ flavor:
+ get_input: pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcm_image_name
+ config_drive: 'True'
+ user_data_format: RAW
+ name:
+ get_input: pcm_server_name
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: pcm_vol_02
+ relationship: tosca.relationships.AttachesTo
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: server_VolumeTest_snapshot01
+ relationship: server_VolumeTest_4
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: server_VolumeTest_snapshot02
+ relationship: server_VolumeTest_5
+ FSB2:
+ type: org.openecomp.resource.vfc.nodes.heat.FSB2
+ properties:
+ flavor:
+ get_input: fsb1-flavor
+ availability_zone:
+ get_input: fsb_zone
+ name:
+ get_input: fsb1-name
+ FSB1:
+ type: org.openecomp.resource.vfc.nodes.heat.FSB1
+ properties:
+ flavor:
+ get_input: fsb1-flavor
+ availability_zone:
+ get_input: fsb_zone
+ metadata:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: '0644'
+ content:
+ str_replace:
+ template:
+ get_artifact:
+ - SELF
+ - nimbus-ethernet
+ params:
+ $dev: eth0
+ $netmask:
+ get_input: cps_net_mask
+ $ip:
+ get_input: cps_net_ip
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth1
+ permissions: '0644'
+ content:
+ str_replace:
+ template:
+ get_artifact:
+ - SELF
+ - nimbus-ethernet-gw
+ params:
+ $dev: eth1
+ $netmask:
+ get_input: oam_net_mask
+ $gateway:
+ get_input: oam_net_gw
+ $ip:
+ get_input: oam_net_ip
+ name:
+ get_input: fsb1-name
+ artifacts:
+ nimbus-ethernet-gw:
+ type: tosca.artifacts.Deployment
+ file: ../Artifacts/nimbus-ethernet-gw
+ nimbus-ethernet:
+ type: tosca.artifacts.Deployment
+ file: ../Artifacts/nimbus-ethernet
+ relationship_templates:
+ server_VolumeTest_4:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id: server_VolumeTest_snapshot01
+ instance_uuid: server_VolumeTest
+ device: vdb
+ server_VolumeTest_5:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id: server_VolumeTest_snapshot02
+ instance_uuid: server_VolumeTest
+ groups:
+ ep-jsa_net:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/ep-jsa_net.yaml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - pcm_vol_02
+ - Internal2-net
+ - pcm_port_1
+ - FSB1_Internal2
+ - FSB1_Internal1
+ - FSB1_OAM
+ - psm01_port_0
+ - pcm_port_0
+ - network
+ - server_pcm
+ - Internal1-net
+ - pcrf_server_psm
+ - server_VolumeTest
+ - FSB2
+ - FSB1 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/inputs/MANIFEST.json
new file mode 100644
index 0000000000..cd0c5e8803
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/inputs/MANIFEST.json
@@ -0,0 +1,25 @@
+{
+ "name": "vEP_JSA_Net",
+ "description": "Version 2.0 02-09-2016 (Authors: John Doe, user PROD)",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "ep-jsa_net.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "ep-jsa_net.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "nimbus-ethernet",
+ "type": "OTHER"
+ },
+ {
+ "file": "nimbus-ethernet-gw",
+ "type": "OTHER"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/inputs/ep-jsa_net.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/inputs/ep-jsa_net.env
new file mode 100644
index 0000000000..9dd1cd441f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/inputs/ep-jsa_net.env
@@ -0,0 +1,4 @@
+parameters:
+ jsa_net_name: jsa_log_net_0
+ jsa_cidr: 107.243.7.128/26
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/inputs/ep-jsa_net.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/inputs/ep-jsa_net.yaml
new file mode 100644
index 0000000000..3e6d1ec2e4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/inputs/ep-jsa_net.yaml
@@ -0,0 +1,411 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ security_group_name:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ pcrf_security_group_name:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ volume_type:
+ type: string
+ label: volume type
+ description: volume type Gold
+
+ volume_size:
+ type: number
+ label: volume size
+ description: my volume size 320GB
+
+ FSB_1_image:
+ type: string
+ label: MME_FSB1
+ description: MME_FSB1_15B-CP04-r5a01
+
+ FSB1_volume_name:
+ type: string
+ label: FSB1_volume
+ description: FSB1_volume_1
+
+ fsb1-name:
+ type: string
+ label: FSB1_name
+ description: FSB1_name
+
+ fsb1-flavor:
+ type: string
+ label: FSB1_flavor
+ description: FSB1_flavor
+
+ fsb1-zone:
+ type: string
+ label: FSB1_zone
+ description: FSB1_zone
+
+ fsb_zone:
+ type: string
+ label: FSB1_zone
+ description: FSB1_zone
+
+ fsb1-Internal1-mac:
+ type: string
+ label: FSB1_internal_mac
+ description: FSB1_internal_mac
+
+ fsb1-Internal2-mac:
+ type: string
+ label: FSB1_internal_mac
+ description: FSB1_internal_mac
+
+ fsb2-Internal1-mac:
+ type: string
+ label: FSB1_internal_mac
+ description: FSB1_internal_mac
+
+ oam_net_id:
+ type: string
+ label: oam_net_id
+ description: oam_net_id
+
+ jsa_net_name:
+ type: string
+ label: jsa_net_name
+ description: jsa_net_name
+
+ jsa_cidr:
+ type: string
+ label: jsa_cidr
+ description: jsa_cidr
+
+ pcrf_cps_net_name:
+ type: string
+ label: pcrf_cps_net_name
+ description: pcrf_cps_net_name
+
+ pcrf_psm_server_name:
+ type: string
+ label: pcrf_psm_server_name
+ description: pcrf_psm_server_name
+
+ pcrf_psm_image_name:
+ type: string
+ label: pcrf_psm_image_name
+ description: pcrf_psm_image_name
+
+ pcrf_psm_flavor_name:
+ type: string
+ label: pcrf_psm_flavor_name
+ description: pcrf_psm_flavor_name
+
+ availabilityzone_name:
+ type: string
+ label: availabilityzone_name
+ description: availabilityzone_name
+
+ pcm_server_name:
+ type: string
+ label: pcm_server_name
+ description: pcm_server_name
+
+ pcm_image_name:
+ type: string
+ label: pcm_image_name
+ description: pcm_image_name
+
+ pcm_flavor_name:
+ type: string
+ label: pcm_flavor_name
+ description: pcm_flavor_name
+
+ Internal1_net_name:
+ type: string
+ label: Internal1_net_name
+ description: Internal1_net_name
+
+ Internal1_forwarding_mode:
+ type: string
+ label: Internal1_forwarding_mode
+ description: Internal1_forwarding_mode
+
+ Internal1_shared:
+ type: string
+ label: Internal1_shared
+ description: Internal1_shared
+
+ Internal1_external:
+ type: string
+ label: Internal1_external
+ description: Internal1_external
+
+ Internal2_name:
+ type: string
+ label: Internal2_name
+ description: Internal2_name
+
+ Internal2_shared:
+ type: string
+ label: Internal2_shared
+ description: Internal2_shared
+
+ Internal2_external:
+ type: string
+ label: Internal2_external
+ description: Internal2_external
+
+ Internal2_forwarding_mode:
+ type: string
+ label: Internal2_forwarding_mode
+ description: Internal2_forwarding_mode
+
+ cps_net_name:
+ type: string
+ label: cps_net_name
+ description: cps_net_name
+
+ oam_net_name:
+ type: string
+ label: oam_net_name
+ description: oam_net_name
+ oam_net_gw:
+ type: string
+ description: prop
+ cps_net_ip:
+ type: string
+ description: prop
+ cps_net_mask:
+ type: string
+ description: prop
+ oam_net_ip:
+ type: string
+ description: prop
+ oam_net_mask:
+ type: string
+ description: prop
+ fsb1-oam-ip:
+ type: string
+ description: prop
+ pcrf_cps_net_ip:
+ type: string
+ description: prop
+ pcrf_vnf_id:
+ type: string
+ description: prop
+ pcm_vol:
+ type: string
+ description: prop
+ pcm_vol_01:
+ type: string
+ description: prop
+ snapshot01:
+ type: string
+ description: prop
+ snapshot02:
+ type: string
+ description: prop
+ VMME_FSB1_boot_volume:
+ type: string
+ network_name:
+ type: string
+ description: prop
+
+
+resources:
+ FSB1:
+ type: OS::Nova::Server
+ depends_on: script_init
+ properties:
+ name: { get_param: fsb1-name }
+ block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB1_boot_volume }, delete_on_termination: "false" }]
+ flavor: { get_param: fsb1-flavor }
+ availability_zone: { get_param: fsb_zone }
+ networks:
+ - port: { get_resource: FSB1_Internal1 }
+ fixed_ip: 10.0.0.0
+ floating_ip: 10.0.0.1
+ network: 100_1000_0011
+ port_extra_properties: {admin_state_up: true , allowed_address_pairs: 10}
+ subnet: 10.0.0.2
+ - port: { get_resource: FSB1_Internal2 }
+ - port: { get_resource: FSB1_OAM }
+ metadata:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: "file:///nimbus-ethernet" }
+ params:
+ $dev: eth0
+ $ip: { get_param: cps_net_ip }
+ $netmask: { get_param: cps_net_mask }
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth1
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: "file:///nimbus-ethernet-gw" }
+ params:
+ $dev: eth1
+ $ip: { get_param: oam_net_ip }
+ $netmask: { get_param: oam_net_mask }
+ $gateway: { get_param: oam_net_gw }
+
+
+ FSB1_Internal1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: Internal1-net }
+ mac_address: { get_param: fsb1-Internal1-mac }
+
+ FSB1_Internal2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: Internal2-net }
+ mac_address: { get_param: fsb1-Internal2-mac }
+
+ FSB1_OAM:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_param: oam_net_id }
+ fixed_ips:
+ - ip_address: { get_param: fsb1-oam-ip }
+
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ psm01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
+
+ pcrf_server_psm:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_psm_server_name }
+ image: { get_param: pcrf_psm_image_name }
+ flavor: { get_param: pcrf_psm_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: psm01_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+ server_pcm:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcm_server_name }
+ image: { get_param: pcm_image_name }
+ flavor: { get_param: pcm_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: pcm_port_0}
+ - port: { get_resource: pcm_port_1}
+ block_device_mapping:
+ - device_name: vdb
+ volume_id: { get_param: pcm_vol}
+ user_data_format: RAW
+ user_data:
+ get_resource: server_init
+ server_VolumeTest:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcm_server_name }
+ image: { get_param: pcm_image_name }
+ flavor: { get_param: pcm_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ block_device_mapping:
+ - device_name: vdb
+ - device_name: vdb
+ volume_id: { get_param: pcm_vol}
+ - device_name: vdb
+ volume_id: { get_param: pcm_vol_01}
+ - device_name: vdb
+ volume_id: { get_resource: pcm_vol_02}
+ - device_name: vdb
+ snapshot_id: { get_param: snapshot01}
+ - snapshot_id: { get_param: snapshot02}
+ user_data_format: RAW
+ user_data:
+ get_resource: server_init
+ server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+ script_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+
+ network:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: Internal1_net_name }
+
+ pcm_vol_02:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: volume_size}
+ volume_type: {get_param: volume_type}
+ name: {get_param: FSB1_volume_name}
+ image: {get_param: FSB_1_image}
+ read_only: 1
+
+ pcm_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: cps_net_ip }
+ security_groups: [{ get_param: security_group_name }]
+
+ pcm_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips:
+ - ip_address: { get_param: oam_net_ip }
+ security_groups: [{ get_param: security_group_name }]
+
+ Internal1-net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: Internal1_net_name }
+ forwarding_mode: { get_param: Internal1_forwarding_mode }
+ shared: { get_param: Internal1_shared }
+ external: { get_param: Internal1_external }
+# route_targets: { "Fn::Split" : [ ",", Ref: route_targets ] }
+
+ Internal2-net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: Internal2_name }
+ forwarding_mode: { get_param: Internal2_forwarding_mode }
+ shared: { get_param: Internal2_shared }
+ external: { get_param: Internal2_external }
+# route_targets: { "Fn::Split" : [ ",", Ref: route_targets ] }
+
+ FSB2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: fsb1-name }
+ flavor: { get_param: fsb1-flavor }
+ availability_zone: { get_param: fsb_zone }
+ networks:
+ - network: {get_param: network_name} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/inputs/nimbus-ethernet b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/inputs/nimbus-ethernet
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/inputs/nimbus-ethernet
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/inputs/nimbus-ethernet-gw b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/inputs/nimbus-ethernet-gw
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/inputs/nimbus-ethernet-gw
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/sharedresources/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/sharedresources/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..6d35846244
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/sharedresources/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,95 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.server_pcm_002:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.server_pcm_001:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ fsb1-flavor:
+ label: FSB1_flavor
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_flavor
+ fsb_zone:
+ label: FSB1_zone
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_zone
+ fsb1-name:
+ label: FSB1_name
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_name
+ FSB_1_image:
+ label: MME_FSB1
+ hidden: false
+ immutable: false
+ type: string
+ description: MME_FSB1_15B-CP04-r5a01
+ node_templates:
+ server_pcm_002:
+ type: org.openecomp.resource.vfc.nodes.heat.server_pcm_002
+ properties:
+ flavor:
+ get_input: fsb1-flavor
+ availability_zone:
+ get_input: fsb_zone
+ name:
+ get_input: fsb1-name
+ server_pcm_001:
+ type: org.openecomp.resource.vfc.nodes.heat.server_pcm_001
+ properties:
+ flavor:
+ get_input: fsb1-flavor
+ availability_zone:
+ get_input: fsb_zone
+ name:
+ get_input: fsb1-name
+ groups:
+ sharedDefinitionOutParam:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/sharedDefinitionOutParam.yaml
+ description: heat template that creates PCRF Cluman stack
+ members:
+ - server_pcm_002
+ - server_pcm_001
+ outputs:
+ out_id2:
+ value: static value
+ out_id1:
+ value:
+ get_input: oam_net_gw \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/sharedresources/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/sharedresources/inputs/MANIFEST.json
new file mode 100644
index 0000000000..786c357838
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/sharedresources/inputs/MANIFEST.json
@@ -0,0 +1,12 @@
+{
+ "name": "vEP_JSA_Net",
+ "description": "Version 2.0 02-09-2016 (Authors: John Doe, user PROD)",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "sharedDefinitionOutParam.yaml",
+ "type": "HEAT",
+ "isBase": "true"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/sharedresources/inputs/sharedDefinitionOutParam.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/sharedresources/inputs/sharedDefinitionOutParam.yaml
new file mode 100644
index 0000000000..778375425b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/sharedresources/inputs/sharedDefinitionOutParam.yaml
@@ -0,0 +1,45 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Cluman stack
+
+parameters:
+ FSB_1_image:
+ type: string
+ label: MME_FSB1
+ description: MME_FSB1_15B-CP04-r5a01
+ fsb1-flavor:
+ type: string
+ label: FSB1_flavor
+ description: FSB1_flavor
+ fsb_zone:
+ type: string
+ label: FSB1_zone
+ description: FSB1_zone
+ fsb1-name:
+ type: string
+ label: FSB1_name
+ description: FSB1_name
+resources:
+ server_pcm_001:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: fsb1-name }
+ flavor: { get_param: fsb1-flavor }
+ availability_zone: { get_param: fsb_zone }
+
+ server_pcm_002:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: fsb1-name }
+ flavor: { get_param: fsb1-flavor }
+ availability_zone: { get_param: fsb_zone }
+
+outputs:
+ server_pcm_001_id:
+ value: {get_resource: server_pcm_001}
+ server_pcm_002_id:
+ value: {get_resource: server_pcm_002}
+ out_id1:
+ value: {get_param: oam_net_gw}
+ out_id2:
+ value: "static value"
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/expectedOutput/validationOutput.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/expectedOutput/validationOutput.json
new file mode 100644
index 0000000000..9e26dfeeb6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/expectedOutput/validationOutput.json
@@ -0,0 +1 @@
+{} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/MANIFEST.json
new file mode 100644
index 0000000000..e5bfbd157d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/MANIFEST.json
@@ -0,0 +1,83 @@
+{
+ "name": "multiple_not_nested",
+ "description": "multiple heat files in zip, no nesting",
+ "version": "2013-05-23",
+ "data": [{
+ "file": "cmaui.yml",
+ "type": "HEAT",
+ "isBase": true,
+ "data": [{
+ "file": "cmaui.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "cmaui_net.yaml",
+ "type": "HEAT_NET"
+ }]
+ },
+ {
+ "file": "eca_oam.yaml",
+ "type": "HEAT",
+ "data": [{
+ "file": "eca_oam.env",
+ "type": "HEAT_ENV"
+ }]
+ },
+ {
+ "file": "eca_oam_nested.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "nested1.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "nested2.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "MMSC_Capacity_Line.yml",
+ "type": "HEAT",
+ "data": [{
+ "file": "MMSC_Capacity_Line_1.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "VOLUME.yaml",
+ "type": "HEAT_VOL",
+ "data": [{
+ "file": "volume.env",
+ "type": "HEAT_ENV"
+ }]
+ }]
+ },
+ {
+ "file": "SG_ECA_MGMT.yaml",
+ "type": "HEAT",
+ "data": [{
+ "file": "sg_eca_mgmt.env",
+ "type": "HEAT_ENV"
+ }]
+ },
+ {
+ "file": "VOLUME_OUT.yaml",
+ "type": "HEAT_VOL",
+ "data": [{
+ "file": "volume_out.env",
+ "type": "HEAT_ENV"
+ }]
+ },
+ {
+ "file": "NETWORK_OUT.yaml",
+ "type": "HEAT_NET",
+ "data": [{
+ "file": "network_out.env",
+ "type": "HEAT_ENV"
+ }]
+ },
+ {
+ "file": "art.sh",
+ "type": "SHELL"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/MMSC_Capacity_Line.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/MMSC_Capacity_Line.yml
new file mode 100644
index 0000000000..746b96dfe8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/MMSC_Capacity_Line.yml
@@ -0,0 +1,3234 @@
+heat_template_version: 2013-05-23
+
+description: >
+ HOT template that creates internal networks, load balancers and servers for vMMSC capacity Line 1.
+ #11/23: updated the network definition to meet the juniper best practices way of defining the gateway, DHCP enable for internal networks (L457-L547)
+
+parameters:
+ vnf_id:
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_the_MMSC_id
+ oam_net_name:
+ type: string
+ label: UID of OAM network
+ description: UID of OAM network
+ oam_network_netmask:
+ type: string
+ label: oam network netmask
+ description: oam network gateway
+ oam_network_gateway:
+ type: string
+ label: oam network gateway
+ description: oam network gateway
+ oam_network_route_1:
+ type: string
+ label: oam network route 1
+ description: oam network route 1
+ oam_network_route_2:
+ type: string
+ label: oam network route 2
+ description: oam network route 2
+ external_dns:
+ type: string
+ label: dns server
+ description: dns server for MMSC
+ external_ntp:
+ type: string
+ label: ntp server
+ description: ntp server for MMSC
+ lb_oam_ips:
+ type: comma_delimited_list
+ label: management network ips for mmsc lb
+ description: the ips of the management network for mmsc lb
+ dmz_protected_net_name:
+ type: string
+ label: UID of dmz_protected network
+ description: UID of dmz_protected network
+ lb_dmz_protected_ips:
+ type: comma_delimited_list
+ label: dmz protected network local ips for lb VM
+ description: local ips of the dmz protected network for lb VM
+ cor_direct_net_name:
+ type: string
+ label: cor direct net UID
+ description: cor direct net
+ lb_cor_direct_ips:
+ type: comma_delimited_list
+ label: cor direct network local ips for lb VM
+ description: local ips of cor direct network for lb VM
+ mms_traffic_net_name:
+ type: string
+ label: Name of MMS traffic network
+ description: Name of MMS traffic network
+ mms_traffic_netmask:
+ type: string
+ label: MMS traffic network subnet mask
+ description: MMS traffic network subnet mask
+ mms_traffic_net_gateway:
+ type: string
+ label: MMS traffic network gateway address
+ description: MMS traffic network gateway address
+ mms_traffic_start:
+ type: string
+ label: mmsc traffic start IP
+ description: mmsc traffic start IP
+ mms_traffic_end:
+ type: string
+ label: mmsc traffic end IP
+ description: mmsc traffic end IP
+ mms_traffic_net_cidr:
+ type: string
+ label: mmsc traffic cidr
+ description: mmsc traffic cidr
+ mms_traffic_net_local_ip1:
+ type: string
+ label: mmsc traffic network local ip1
+ description: the local ip1 of the mmsc traffic network
+ mms_traffic_net_local_ip2:
+ type: string
+ label: mmsc traffic network local ip2
+ description: the local ip2 of the mmsc traffic network
+ mms_traffic_net_floating_ip:
+ type: string
+ label: mmsc traffic floating ip
+ description: mmsc traffic floating ip
+ nems_internal_name:
+ type: string
+ label: nems internal network name
+ description: nems internal network name
+ nems_internal_start:
+ type: string
+ label: nems internal start
+ description: nems internal start
+ nems_internal_end:
+ type: string
+ label: nems internal end
+ description: nems internal end
+ nems_internal_cidr:
+ type: string
+ label: nems ineternal cidr
+ description: nems internal cidr
+ nems_internal_netmask:
+ type: string
+ label: NEMS internal network subnet mask
+ description: NEMS internal network subnet mask
+ nems_internal_gateway:
+ type: string
+ label: nems internal gw
+ description: nems internal gw
+ nems_traffic_name:
+ type: string
+ label: nems traffic name
+ description: nems traffic name
+ nems_traffic_start:
+ type: string
+ label: nems traffic start
+ description: nems traffic start
+ nems_traffic_end:
+ type: string
+ label: nems traffic end
+ description: nems traffic end
+ nems_traffic_cidr:
+ type: string
+ label: nems traffic cidr
+ description: nems traffic cidr
+ nems_traffic_netmask:
+ type: string
+ label: NEMS traffic network subnet mask
+ description: NEMS traffic network subnet mask
+ nems_traffic_gateway:
+ type: string
+ label: NEMS traffic network gateway
+ description: NEMS traffic network gateway
+ nems_traffic_net_local_ip1:
+ type: string
+ label: nems traffic network local ip1
+ description: the local ip1 of the nems traffic network
+ nems_traffic_net_local_ip2:
+ type: string
+ label: nems traffic network local ip2
+ description: the local ip2 of the nems traffic network
+ nems_traffic_net_floating_ip:
+ type: string
+ label: nems traffic floating ip
+ description: nems traffic floating ip
+ nems_user_web_name:
+ type: string
+ label: nems user web name
+ description: nems user web name
+ nems_user_web_start:
+ type: string
+ label: nems user web start
+ description: nems user web end
+ nems_user_web_end:
+ type: string
+ label: nems user web end
+ description: nems user web end
+ nems_user_web_cidr:
+ type: string
+ label: nems user web cidr
+ description: nems user web cidr
+ nems_user_web_netmask:
+ type: string
+ label: NEMS user web network subnet mask
+ description: NEMS user web network subnet mask
+ nems_user_web_gateway:
+ type: string
+ label: NEMS user web network gateway
+ description: NEMS user web network gateway
+ nems_user_web_net_local_ip1:
+ type: string
+ label: nems user web network local ip1
+ description: the local ip1 of the nems user web network
+ nems_user_web_net_local_ip2:
+ type: string
+ label: nems user web network local ip2
+ description: the local ip2 of the nems user web network
+ nems_user_web_net_floating_ip:
+ type: string
+ label: nems user web floating ip
+ description: nems user web floating ip
+ nems_imap_name:
+ type: string
+ label: nems imap name
+ description: nems imap name
+ nems_imap_netmask:
+ type: string
+ label: nems imap subnet mask
+ description: nems imap subnet mask
+ nems_imap_start:
+ type: string
+ label: nems imap start
+ description: nems imap start
+ nems_imap_end:
+ type: string
+ label: nems imap end
+ description: nems imap end
+ nems_imap_cidr:
+ type: string
+ label: nems imap cidr
+ description: nems imap cidr
+ nems_imap_gateway:
+ type: string
+ label: nems imap gateway
+ description: nems imap gateway
+ eca_traffic_name:
+ type: string
+ label: eca traffic name
+ description: eca traffic name
+ eca_traffic_start:
+ type: string
+ label: eca traffic start
+ description: eca traffic start
+ eca_traffic_end:
+ type: string
+ label: eca traffic end
+ description: eca traffic end
+ eca_traffic_cidr:
+ type: string
+ label: eca traffic cidr
+ description: eca traffic cidr
+ eca_traffic_netmask:
+ type: string
+ label: ECA traffic network subnet mask
+ description: ECA traffic network subnet mask
+ eca_traffic_net_gateway:
+ type: string
+ label: eca_traffic network gateway
+ description: eca_traffic network gateway
+ eca_traffic_net_local_ip1:
+ type: string
+ label: eca traffic network local ip1
+ description: the local ip1 of the eca traffic network
+ eca_traffic_net_local_ip2:
+ type: string
+ label: eca traffic network local ip2
+ description: the local ip2 of the eca traffic network
+ eca_traffic_net_floating_ip:
+ type: string
+ label: eca traffic floating ip
+ description: eca traffic floating ip
+ ha_net_name:
+ type: string
+ label: ha_failover network name
+ description: ha_failover network name
+ ha_net_start:
+ type: string
+ label: ha net start
+ description: ha net start
+ ha_net_end:
+ type: string
+ label: ha net end
+ description: ha net end
+ ha_net_cidr:
+ type: string
+ label: ha net cidr
+ description: ha net cidr
+ ha_net_local_ip1:
+ type: string
+ label: ha net network local ip1
+ description: the local ip1 of the ha network
+ ha_net_local_ip2:
+ type: string
+ label: ha net network local ip2
+ description: the local ip2 of the ha network
+ lb_names:
+ type: comma_delimited_list
+ label: MMSC load balancer instance names
+ description: MMSC load balancer instance names
+ lb_image_name:
+ type: string
+ label: MMSC load balancer image name
+ description: MMSC load balancer image name
+ lb_flavor_name:
+ type: string
+ label: Load balancer flavor name
+ description: the flavor name of MMSC load balancer instance
+ availability_zone_0:
+ type: string
+ label: MMSC availabilityzone name
+ description: MMSC availabilityzone name
+ security_group_name:
+ type: string
+ label: MMSC security group name
+ description: MMSC security group name
+ mmsc_image:
+ type: string
+ label: Image for MMSC server
+ description: Image for MMSC server
+ mmsc_flavor:
+ type: string
+ label: Flavor for MMSC server
+ description: Flavor for MMSC server
+ mmsc_cinder_volume_size:
+ type: number
+ label: MMSC Cinder volume size
+ description: the size of the MMSC Cinder volume
+ nems_fe_image:
+ type: string
+ label: Image for NEMS FE server
+ description: Image for NEMS FE server
+ nems_fe_flavor:
+ type: string
+ label: Flavor for NEMS FE server
+ description: Flavor for NEMS FE server
+ nems_be_image:
+ type: string
+ label: Image for NEMS BE server
+ description: Image for NEMS BE server
+ nems_be_flavor:
+ type: string
+ label: Flavor for NEMS BE server
+ description: Flavor for NEMS BE server
+ eca_trx_image:
+ type: string
+ label: Image for ECA TRX server
+ description: Image for ECA TRX server
+ eca_trx_flavor:
+ type: string
+ label: Flavor for ECA TRX server
+ description: Flavor for ECA TRX server
+ mmsc_oam_ips:
+ type: comma_delimited_list
+ label: MMSC oam_net IP addresses
+ description: MMSC oam_net IP addresses
+ mmsc_mms_traffic_net_ips:
+ type: comma_delimited_list
+ label: MMSC mms_traffic_net IP addresses
+ description: MMSC mms_traffic_net IP addresses
+ nems_fe_names:
+ type: comma_delimited_list
+ label: NEMS_FE server names
+ description: NEMS_FE server names
+ nems_fe_node_roles:
+ type: comma_delimited_list
+ label: nems fe node roles
+ description: nems fe node roles
+ nems_fe_oam_ips:
+ type: comma_delimited_list
+ label: OAM_net IP for NEMS_FE
+ description: OAM_net IP for NEMS_FE
+ nems_fe_nems_traffic_net_ips:
+ type: comma_delimited_list
+ label: nems_traffic_net IPs for NEMS_FE
+ description: nems_traffic_net IPs for NEMS_FE
+ nems_fe_nems_user_web_net_ips:
+ type: comma_delimited_list
+ label: nems_web_user_net IPs for NEMS_FE
+ description: nems_web_user_net IPs for NEMS_FE
+ nems_fe_nems_internal_net_ips:
+ type: comma_delimited_list
+ label: nems_internal_net IPs for NEMS_FE
+ description: nems_internal_net IPs for NEMS_FE
+ nems_fe_nems_imap_net_ips:
+ type: comma_delimited_list
+ label: nems_imap_net IPs for NEMS_FE
+ description: nems_imap_net IPs for NEMS_FE
+ nems_be_names:
+ type: string
+ label: NEMS_BE server names
+ description: NEMS_BE server names
+ nems_be_node_roles:
+ type: string
+ label: nems node roles
+ description: nems node roles
+ nems_be_oam_ips:
+ type: string
+ label: OAM net IPs for NEMS_BE
+ description: OAM net IPs for NEMS_BE
+ nems_be_nems_internal_net_ips:
+ type: string
+ label: nems internal net IPs for NEMS_BE
+ description: nems internal net IPs for NEMS_BE
+ nems_be_nems_imap_net_ips:
+ type: string
+ label: nems imap_net IPs for NEMS_BE
+ description: nems imap net IPs for NEMS_BE
+ eca_trx_oam_ips:
+ type: comma_delimited_list
+ label: OAM net IP for ECA_TRX
+ description: OAM net IP for ECA_TRX
+ eca_trx_mgmt_ips:
+ type: comma_delimited_list
+ label: eca mgmt net IP for ECA_TRX
+ description: eca mgmt net IP for ECA_TRX
+ timezone:
+ type: string
+ label: timezone
+ description: timezone
+ eca_trx_names:
+ type: comma_delimited_list
+ label: ECA_TRX server names
+ description: ECA_TRX server names
+ eca_trx_eca_traffic_net_ips:
+ type: comma_delimited_list
+ label: eca traffic net IPs for ECA_TRX
+ description: eca traffic net IPs for ECA_TRX
+ mmsc_names:
+ type: comma_delimited_list
+ label: MMSC server names
+ description: MMSC server names
+ nems_volume_size:
+ type: number
+ label: nems fe volume size
+ description: nems fe volume size
+ nems_be_volume_size:
+ type: number
+ label: nems be volume size
+ description: nems be volume size
+ MMSC_volume_type:
+ type: string
+ label: MMSC vm volume type
+ description: the name of the target volume backend
+ NEMS_FE_volume_type:
+ type: string
+ label: nems fe vm volume type
+ description: the name of the target volume backend
+ NEMS_BE_volume_type:
+ type: string
+ label: nems be vm volume type
+ description: the name of the target volume backend
+ mmsc_core_virtual_server_ips:
+ type: comma_delimited_list
+ label: mmsc core virtual server ips
+ description: mmsc core virtual server ips
+ mmsc_core_snat_ips:
+ type: comma_delimited_list
+ label: mmsc core snat ips
+ description: mmsc core snat ips
+ mmsc_dmz_protected_virtual_server_ips:
+ type: comma_delimited_list
+ label: mmsc dmz_protected virtual server ips
+ description: mmsc dmz_protected virtual server ips
+ mmsc_dmz_protected_snat_ips:
+ type: comma_delimited_list
+ label: mmsc dmz_protected snat ips
+ description: mmsc dmz_protected snat ips
+ eca_mgmt_net_name:
+ type: string
+ label: eca management network ID
+ description: Network ID for eca management
+
+resources:
+ mms_traffic_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: mms_traffic_net_name }
+
+ mms_traffic_artifact:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ property_get_file_name: { get_file: art.sh }
+
+ mms_traffic_net_nested_1:
+ type: nested1.yaml
+ properties:
+ cmaui_names: { get_param: mms_traffic_net_name }
+
+ mms_traffic_net_nested_2:
+ type: nested2.yaml
+ properties:
+ cmaui_names: { get_param: mms_traffic_net_name }
+
+ mms_traffic_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: mms_traffic_net_name}
+ network_id: { get_resource: mms_traffic_net }
+ cidr: { get_param: mms_traffic_net_cidr }
+ allocation_pools: [{"start": {get_param: mms_traffic_start}, "end": {get_param: mms_traffic_end}}]
+
+ nems_internal_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: {get_param: nems_internal_name}
+
+ nems_internal_network_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: nems_internal_name}
+ allocation_pools: [{"start": {get_param: nems_internal_start}, "end": {get_param: nems_internal_end}}]
+ cidr: {get_param: nems_internal_cidr}
+ network_id: {get_resource: nems_internal_net}
+
+ nems_traffic_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: {get_param: nems_traffic_name}
+
+ nems_traffic_network_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: nems_traffic_name}
+ allocation_pools: [{"start": {get_param: nems_traffic_start}, "end": {get_param: nems_traffic_end}}]
+ cidr: {get_param: nems_traffic_cidr}
+ network_id: {get_resource: nems_traffic_net}
+
+ nems_user_web_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: {get_param: nems_user_web_name}
+
+ nems_user_web_network_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: nems_user_web_name}
+ allocation_pools: [{"start": {get_param: nems_user_web_start}, "end": {get_param: nems_user_web_end}}]
+ cidr: {get_param: nems_user_web_cidr}
+ network_id: {get_resource: nems_user_web_net}
+
+ nems_imap_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: {get_param: nems_imap_name}
+
+ nems_imap_network_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: nems_imap_name}
+ allocation_pools: [{"start": {get_param: nems_imap_start}, "end": {get_param: nems_imap_end}}]
+ cidr: {get_param: nems_imap_cidr}
+ network_id: {get_resource: nems_imap_net}
+
+ eca_traffic_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: {get_param: eca_traffic_name}
+
+ eca_traffic_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: eca_traffic_name}
+ allocation_pools: [{"start": {get_param: eca_traffic_start}, "end": {get_param: eca_traffic_end}}]
+ cidr: {get_param: eca_traffic_cidr}
+ network_id: {get_resource: eca_traffic_net}
+
+ ha_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: {get_param: ha_net_name}
+
+ ha_net_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: ha_net_name}
+ allocation_pools: [{"start": {get_param: ha_net_start}, "end": {get_param: ha_net_end}}]
+ cidr: {get_param: ha_net_cidr}
+ network_id: {get_resource: ha_net}
+
+ lb1_instance:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: [lb_names, 0]}
+ image: {get_param: lb_image_name}
+ flavor: {get_param: lb_flavor_name}
+ availability_zone: {get_param: availability_zone_0}
+ networks:
+ - port: {get_resource: lb1_mgmt_port}
+ - port: {get_resource: lb1_dmz_protected_port}
+ - port: {get_resource: lb1_cor_direct_port}
+ - port: {get_resource: lb1_mms_traffic_port}
+ - port: {get_resource: lb1_nems_traffic_port}
+ - port: {get_resource: lb1_nems_user_web_port}
+ - port: {get_resource: lb1_eca_traffic_port}
+ - port: {get_resource: lb1_ha_net_port}
+ metadata:
+ vnf_id: { get_param: vnf_id }
+
+ lb1_mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [lb_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb1_mms_traffic_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: mms_traffic_net}
+ fixed_ips: [{"ip_address": {get_param: mms_traffic_net_local_ip1}}]
+ allowed_address_pairs: [{"ip_address": {get_param: mms_traffic_net_floating_ip} }]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb1_dmz_protected_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: dmz_protected_net_name}
+ fixed_ips: [{"ip_address": {get_param: [lb_dmz_protected_ips, 0]}}]
+ allowed_address_pairs: [{"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 0]}}, {"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 1]}}, {"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 2]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 0]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 1]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 2]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 3]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb1_cor_direct_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: cor_direct_net_name}
+ fixed_ips: [{"ip_address": {get_param: [lb_cor_direct_ips, 0]}}]
+ allowed_address_pairs: [{"ip_address": {get_param: [mmsc_core_virtual_server_ips, 0]}}, {"ip_address": {get_param: [mmsc_core_virtual_server_ips, 1]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 0]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 1]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 2]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 3]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 4]}} ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb1_nems_traffic_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: nems_traffic_net}
+ fixed_ips: [{"ip_address": {get_param: nems_traffic_net_local_ip1}}]
+ allowed_address_pairs: [{"ip_address": {get_param: nems_traffic_net_floating_ip} }]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb1_nems_user_web_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: nems_user_web_net}
+ fixed_ips: [{"ip_address": {get_param: nems_user_web_net_local_ip1}}]
+ allowed_address_pairs: [{"ip_address": {get_param: nems_user_web_net_floating_ip} }]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb1_ha_net_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: ha_net}
+ fixed_ips: [{"ip_address": {get_param: ha_net_local_ip1}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb1_eca_traffic_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: eca_traffic_net}
+ fixed_ips: [{"ip_address": {get_param: eca_traffic_net_local_ip1}}]
+ allowed_address_pairs: [{"ip_address": {get_param: eca_traffic_net_floating_ip} }]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb2_instance:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: [lb_names, 1]}
+ image: {get_param: lb_image_name}
+ flavor: {get_param: lb_flavor_name}
+ availability_zone: {get_param: availability_zone_0}
+ networks:
+ - port: {get_resource: lb2_mgmt_port}
+ - port: {get_resource: lb2_dmz_protected_port}
+ - port: {get_resource: lb2_cor_direct_port}
+ - port: {get_resource: lb2_mms_traffic_port}
+ - port: {get_resource: lb2_nems_traffic_port}
+ - port: {get_resource: lb2_nems_user_web_port}
+ - port: {get_resource: lb2_eca_traffic_port}
+ - port: {get_resource: lb2_ha_net_port}
+ metadata:
+ vnf_id: { get_param: vnf_id }
+
+ lb2_mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [lb_oam_ips, 1]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb2_mms_traffic_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: mms_traffic_net}
+ fixed_ips: [{"ip_address": {get_param: mms_traffic_net_local_ip2}}]
+ allowed_address_pairs: [{"ip_address": {get_param: mms_traffic_net_floating_ip}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb2_dmz_protected_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: dmz_protected_net_name}
+ fixed_ips: [{"ip_address": {get_param: [lb_dmz_protected_ips, 1]}}]
+ allowed_address_pairs: [{"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 0]}}, {"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 1]}}, {"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 2]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 0]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 1]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 2]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 3]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb2_cor_direct_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: cor_direct_net_name}
+ fixed_ips: [{"ip_address": {get_param: [lb_cor_direct_ips, 1]}}]
+ allowed_address_pairs: [{"ip_address": {get_param: [mmsc_core_virtual_server_ips, 0]}}, {"ip_address": {get_param: [mmsc_core_virtual_server_ips, 1]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 0]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 1]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 2]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 3]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 4]}} ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb2_nems_traffic_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: nems_traffic_net}
+ fixed_ips: [{"ip_address": {get_param: nems_traffic_net_local_ip2}}]
+ allowed_address_pairs: [{"ip_address": {get_param: nems_traffic_net_floating_ip}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb2_nems_user_web_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: nems_user_web_net}
+ fixed_ips: [{"ip_address": {get_param: nems_user_web_net_local_ip2}}]
+ allowed_address_pairs: [{"ip_address": {get_param: nems_user_web_net_floating_ip}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb2_ha_net_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: ha_net}
+ fixed_ips: [{"ip_address": {get_param: ha_net_local_ip2}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb2_eca_traffic_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: eca_traffic_net}
+ fixed_ips: [{"ip_address": {get_param: eca_traffic_net_local_ip2}}]
+ allowed_address_pairs: [{"ip_address": {get_param: eca_traffic_net_floating_ip} }]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_mmsc1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [mmsc_names, 0]}
+ image: { get_param: mmsc_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: mmsc_flavor }
+ networks:
+ - port: { get_resource: mmsc1_port_0 }
+ - port: { get_resource: mmsc1_port_1 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ mmsc.mgmt.ip=${mmsc.mgmt.ip}
+ mmsc.mgmt.netmask=${mmsc.mgmt.netmask}
+ mmsc.mgmt.gateway=${mmsc.mgmt.gateway}
+ mmsc.traffic.ip=${mmsc.traffic.ip}
+ mmsc.traffic.netmask=${mmsc.traffic.netmask}
+ mmsc.traffic.gateway=${mmsc.traffic.gateway}
+ mmsc.mgmt.route.1=${mmsc.mgmt.route.1}
+ mmsc.mgmt.route.2=${mmsc.mgmt.route.2}
+ mmsc.external.dns=${mmsc.external.dns}
+ mmsc.external.ntp=${mmsc.external.ntp}
+ mmsc.hostname=${mmsc.hostname}
+ mmsc.timezone=${mmsc.timezone}
+ params:
+ ${mmsc.mgmt.ip}: {get_param: [mmsc_oam_ips, 0]}
+ ${mmsc.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${mmsc.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${mmsc.traffic.ip}: {get_param: [mmsc_mms_traffic_net_ips, 0]}
+ ${mmsc.traffic.netmask}: {get_param: mms_traffic_netmask}
+ ${mmsc.traffic.gateway}: {get_param: mms_traffic_net_gateway}
+ ${mmsc.mgmt.route.1}: {get_param: oam_network_route_1}
+ ${mmsc.mgmt.route.2}: {get_param: oam_network_route_2}
+ ${mmsc.external.dns}: {get_param: external_dns}
+ ${mmsc.external.ntp}: {get_param: external_ntp}
+ ${mmsc.hostname}: {get_param: [mmsc_names, 0]}
+ ${mmsc.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ mmsc1_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: mmsc_cinder_volume_size}
+ volume_type: {get_param: MMSC_volume_type}
+
+ mmsc1_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: mmsc1_volume}
+ instance_uuid: {get_resource: server_mmsc1}
+
+ mmsc1_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [
+ "ip_address": {get_param: [mmsc_oam_ips, 0]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ mmsc1_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: mms_traffic_net}
+ fixed_ips: [
+ "ip_address": {get_param: [mmsc_mms_traffic_net_ips, 0]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_mmsc2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [mmsc_names, 1]}
+ image: { get_param: mmsc_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: mmsc_flavor }
+ networks:
+ - port: { get_resource: mmsc2_port_0 }
+ - port: { get_resource: mmsc2_port_1 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ mmsc.mgmt.ip=${mmsc.mgmt.ip}
+ mmsc.mgmt.netmask=${mmsc.mgmt.netmask}
+ mmsc.mgmt.gateway=${mmsc.mgmt.gateway}
+ mmsc.traffic.ip=${mmsc.traffic.ip}
+ mmsc.traffic.netmask=${mmsc.traffic.netmask}
+ mmsc.traffic.gateway=${mmsc.traffic.gateway}
+ mmsc.mgmt.route.1=${mmsc.mgmt.route.1}
+ mmsc.mgmt.route.2=${mmsc.mgmt.route.2}
+ mmsc.external.dns=${mmsc.external.dns}
+ mmsc.external.ntp=${mmsc.external.ntp}
+ mmsc.hostname=${mmsc.hostname}
+ mmsc.timezone=${mmsc.timezone}
+ params:
+ ${mmsc.mgmt.ip}: {get_param: [mmsc_oam_ips, 1]}
+ ${mmsc.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${mmsc.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${mmsc.traffic.ip}: {get_param: [mmsc_mms_traffic_net_ips, 1]}
+ ${mmsc.traffic.netmask}: {get_param: mms_traffic_netmask}
+ ${mmsc.traffic.gateway}: {get_param: mms_traffic_net_gateway}
+ ${mmsc.mgmt.route.1}: {get_param: oam_network_route_1}
+ ${mmsc.mgmt.route.2}: {get_param: oam_network_route_2}
+ ${mmsc.external.dns}: {get_param: external_dns}
+ ${mmsc.external.ntp}: {get_param: external_ntp}
+ ${mmsc.hostname}: {get_param: [mmsc_names, 1]}
+ ${mmsc.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ mmsc2_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: mmsc_cinder_volume_size}
+ volume_type: {get_param: MMSC_volume_type}
+
+ mmsc2_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: mmsc2_volume}
+ instance_uuid: {get_resource: server_mmsc2}
+
+ mmsc2_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [
+ "ip_address": {get_param: [mmsc_oam_ips, 1]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ mmsc2_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: mms_traffic_net}
+ fixed_ips: [
+ "ip_address": {get_param: [mmsc_mms_traffic_net_ips, 1]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_mmsc3:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [mmsc_names, 2]}
+ image: { get_param: mmsc_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: mmsc_flavor }
+ networks:
+ - port: { get_resource: mmsc3_port_0 }
+ - port: { get_resource: mmsc3_port_1 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ mmsc.mgmt.ip=${mmsc.mgmt.ip}
+ mmsc.mgmt.netmask=${mmsc.mgmt.netmask}
+ mmsc.mgmt.gateway=${mmsc.mgmt.gateway}
+ mmsc.traffic.ip=${mmsc.traffic.ip}
+ mmsc.traffic.netmask=${mmsc.traffic.netmask}
+ mmsc.traffic.gateway=${mmsc.traffic.gateway}
+ mmsc.mgmt.route.1=${mmsc.mgmt.route.1}
+ mmsc.mgmt.route.2=${mmsc.mgmt.route.2}
+ mmsc.external.dns=${mmsc.external.dns}
+ mmsc.external.ntp=${mmsc.external.ntp}
+ mmsc.hostname=${mmsc.hostname}
+ mmsc.timezone=${mmsc.timezone}
+ params:
+ ${mmsc.mgmt.ip}: {get_param: [mmsc_oam_ips, 2]}
+ ${mmsc.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${mmsc.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${mmsc.traffic.ip}: {get_param: [mmsc_mms_traffic_net_ips, 2]}
+ ${mmsc.traffic.netmask}: {get_param: mms_traffic_netmask}
+ ${mmsc.traffic.gateway}: {get_param: mms_traffic_net_gateway}
+ ${mmsc.mgmt.route.1}: {get_param: oam_network_route_1}
+ ${mmsc.mgmt.route.2}: {get_param: oam_network_route_2}
+ ${mmsc.external.dns}: {get_param: external_dns}
+ ${mmsc.external.ntp}: {get_param: external_ntp}
+ ${mmsc.hostname}: {get_param: [mmsc_names, 2]}
+ ${mmsc.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ mmsc3_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: mmsc_cinder_volume_size}
+ volume_type: {get_param: MMSC_volume_type}
+
+ mmsc3_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: mmsc3_volume}
+ instance_uuid: {get_resource: server_mmsc3}
+
+ mmsc3_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [
+ "ip_address": {get_param: [mmsc_oam_ips, 2]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ mmsc3_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: mms_traffic_net}
+ fixed_ips: [
+ "ip_address": {get_param: [mmsc_mms_traffic_net_ips, 2]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_mmsc4:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [mmsc_names, 3]}
+ image: { get_param: mmsc_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: mmsc_flavor }
+ networks:
+ - port: { get_resource: mmsc4_port_0 }
+ - port: { get_resource: mmsc4_port_1 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ mmsc.mgmt.ip=${mmsc.mgmt.ip}
+ mmsc.mgmt.netmask=${mmsc.mgmt.netmask}
+ mmsc.mgmt.gateway=${mmsc.mgmt.gateway}
+ mmsc.traffic.ip=${mmsc.traffic.ip}
+ mmsc.traffic.netmask=${mmsc.traffic.netmask}
+ mmsc.traffic.gateway=${mmsc.traffic.gateway}
+ mmsc.mgmt.route.1=${mmsc.mgmt.route.1}
+ mmsc.mgmt.route.2=${mmsc.mgmt.route.2}
+ mmsc.external.dns=${mmsc.external.dns}
+ mmsc.external.ntp=${mmsc.external.ntp}
+ mmsc.hostname=${mmsc.hostname}
+ mmsc.timezone=${mmsc.timezone}
+ params:
+ ${mmsc.mgmt.ip}: {get_param: [mmsc_oam_ips, 3]}
+ ${mmsc.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${mmsc.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${mmsc.traffic.ip}: {get_param: [mmsc_mms_traffic_net_ips, 3]}
+ ${mmsc.traffic.netmask}: {get_param: mms_traffic_netmask}
+ ${mmsc.traffic.gateway}: {get_param: mms_traffic_net_gateway}
+ ${mmsc.mgmt.route.1}: {get_param: oam_network_route_1}
+ ${mmsc.mgmt.route.2}: {get_param: oam_network_route_2}
+ ${mmsc.external.dns}: {get_param: external_dns}
+ ${mmsc.external.ntp}: {get_param: external_ntp}
+ ${mmsc.hostname}: {get_param: [mmsc_names, 3]}
+ ${mmsc.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ mmsc4_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: mmsc_cinder_volume_size}
+ volume_type: {get_param: MMSC_volume_type}
+
+ mmsc4_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: mmsc4_volume}
+ instance_uuid: {get_resource: server_mmsc4}
+
+ mmsc4_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [
+ "ip_address": {get_param: [mmsc_oam_ips, 3]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ mmsc4_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: mms_traffic_net}
+ fixed_ips: [
+ "ip_address": {get_param: [mmsc_mms_traffic_net_ips, 3]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_mmsc5:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [mmsc_names, 4]}
+ image: { get_param: mmsc_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: mmsc_flavor }
+ networks:
+ - port: { get_resource: mmsc5_port_0 }
+ - port: { get_resource: mmsc5_port_1 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ mmsc.mgmt.ip=${mmsc.mgmt.ip}
+ mmsc.mgmt.netmask=${mmsc.mgmt.netmask}
+ mmsc.mgmt.gateway=${mmsc.mgmt.gateway}
+ mmsc.traffic.ip=${mmsc.traffic.ip}
+ mmsc.traffic.netmask=${mmsc.traffic.netmask}
+ mmsc.traffic.gateway=${mmsc.traffic.gateway}
+ mmsc.mgmt.route.1=${mmsc.mgmt.route.1}
+ mmsc.mgmt.route.2=${mmsc.mgmt.route.2}
+ mmsc.external.dns=${mmsc.external.dns}
+ mmsc.external.ntp=${mmsc.external.ntp}
+ mmsc.hostname=${mmsc.hostname}
+ mmsc.timezone=${mmsc.timezone}
+ params:
+ ${mmsc.mgmt.ip}: {get_param: [mmsc_oam_ips, 4]}
+ ${mmsc.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${mmsc.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${mmsc.traffic.ip}: {get_param: [mmsc_mms_traffic_net_ips, 4]}
+ ${mmsc.traffic.netmask}: {get_param: mms_traffic_netmask}
+ ${mmsc.traffic.gateway}: {get_param: mms_traffic_net_gateway}
+ ${mmsc.mgmt.route.1}: {get_param: oam_network_route_1}
+ ${mmsc.mgmt.route.2}: {get_param: oam_network_route_2}
+ ${mmsc.external.dns}: {get_param: external_dns}
+ ${mmsc.external.ntp}: {get_param: external_ntp}
+ ${mmsc.hostname}: {get_param: [mmsc_names, 4]}
+ ${mmsc.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ mmsc5_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: mmsc_cinder_volume_size}
+ volume_type: {get_param: MMSC_volume_type}
+
+ mmsc5_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: mmsc5_volume}
+ instance_uuid: {get_resource: server_mmsc5}
+
+ mmsc5_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [
+ "ip_address": {get_param: [mmsc_oam_ips, 4]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ mmsc5_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: mms_traffic_net}
+ fixed_ips: [
+ "ip_address": {get_param: [mmsc_mms_traffic_net_ips, 4]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_nems_fe1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [nems_fe_names, 0] }
+ image: { get_param: nems_fe_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: nems_fe_flavor }
+ networks:
+ - port: { get_resource: nems_fe1_port_0 }
+ - port: { get_resource: nems_fe1_port_1 }
+ - port: { get_resource: nems_fe1_port_2 }
+ - port: { get_resource: nems_fe1_port_3 }
+ - port: { get_resource: nems_fe1_port_4 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ nems.mgmt.ip=${nems.mgmt.ip}
+ nems.mgmt.netmask=${nems.mgmt.netmask}
+ nems.mgmt.gateway=${nems.mgmt.gateway}
+ nems.traffic.ip=${nems.traffic.ip}
+ nems.traffic.netmask=${nems.traffic.netmask}
+ nems.traffic.gateway=${nems.traffic.gateway}
+ nems.fe0.internal.ip=${nems.fe0.internal.ip}
+ nems.fe1.internal.ip=${nems.fe1.internal.ip}
+ nems.internal.netmask=${nems.internal.netmask}
+ nems.userweb.ip=${nems.userweb.ip}
+ nems.userweb.netmask=${nems.userweb.netmask}
+ nems.userweb.gateway=${nems.userweb.gateway}
+ nems.imap.ip=${nems.imap.ip}
+ nems.imap.netmask=${nems.imap.netmask}
+ nems.be.internal.ip=${nems.be.internal.ip}
+ nems.be.imap.ip=${nems.be.imap.ip}
+ nems.mgmt.route.1=${nems.mgmt.route.1}
+ nems.mgmt.route.2=${nems.mgmt.route.2}
+ nems.external.dns=${nems.external.dns}
+ nems.external.ntp=${nems.external.ntp}
+ nems.node=${nems.node}
+ nems.be0.host.name=${nems.be0.host.name}
+ nems.fe0.host.name=${nems.fe0.host.name}
+ nems.fe1.host.name=${nems.fe1.host.name}
+ nems.timezone=${nems.timezone}
+ params:
+ ${nems.mgmt.ip}: {get_param: [nems_fe_oam_ips, 0]}
+ ${nems.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${nems.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${nems.traffic.ip}: {get_param: [nems_fe_nems_traffic_net_ips, 0]}
+ ${nems.traffic.netmask}: {get_param: nems_traffic_netmask}
+ ${nems.traffic.gateway}: {get_param: nems_traffic_gateway}
+ ${nems.fe0.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 0]}
+ ${nems.fe1.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 1]}
+ ${nems.internal.netmask}: {get_param: nems_internal_netmask}
+ ${nems.userweb.ip}: {get_param: [nems_fe_nems_user_web_net_ips, 0]}
+ ${nems.userweb.netmask}: {get_param: nems_user_web_netmask}
+ ${nems.userweb.gateway}: {get_param: nems_user_web_gateway}
+ ${nems.imap.ip}: {get_param: [nems_fe_nems_imap_net_ips, 0]}
+ ${nems.imap.netmask}: {get_param: nems_imap_netmask}
+ ${nems.be.internal.ip}: {get_param: nems_be_nems_internal_net_ips}
+ ${nems.be.imap.ip}: {get_param: nems_be_nems_imap_net_ips}
+ ${nems.mgmt.route.1}: {get_param: oam_network_route_1}
+ ${nems.mgmt.route.2}: {get_param: oam_network_route_2}
+ ${nems.external.dns}: {get_param: external_dns}
+ ${nems.external.ntp}: {get_param: external_ntp}
+ ${nems.node}: {get_param: [nems_fe_node_roles, 0]}
+ ${nems.fe0.host.name}: {get_param: [nems_fe_names, 0]}
+ ${nems.fe1.host.name}: {get_param: [nems_fe_names, 1]}
+ ${nems.be0.host.name}: {get_param: nems_be_names}
+ ${nems.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ nems1_fe_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: nems_volume_size}
+ volume_type: {get_param: NEMS_FE_volume_type}
+
+ nems1_fe_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: nems1_fe_volume}
+ instance_uuid: {get_resource: server_nems_fe1}
+
+ nems_fe1_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [
+ "ip_address": { get_param: [nems_fe_oam_ips, 0] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ nems_fe1_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: nems_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [nems_fe_nems_traffic_net_ips, 0] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ nems_fe1_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: nems_user_web_net }
+ fixed_ips: [
+ "ip_address": { get_param: [nems_fe_nems_user_web_net_ips, 0] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ nems_fe1_port_3:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: nems_internal_net }
+ fixed_ips: [
+ "ip_address": { get_param: [nems_fe_nems_internal_net_ips, 0] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ nems_fe1_port_4:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: nems_imap_net }
+ fixed_ips: [
+ "ip_address": { get_param: [nems_fe_nems_imap_net_ips, 0] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_nems_fe2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [nems_fe_names, 1] }
+ image: { get_param: nems_fe_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: nems_fe_flavor }
+ networks:
+ - port: { get_resource: nems_fe2_port_0 }
+ - port: { get_resource: nems_fe2_port_1 }
+ - port: { get_resource: nems_fe2_port_2 }
+ - port: { get_resource: nems_fe2_port_3 }
+ - port: { get_resource: nems_fe2_port_4 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ nems.mgmt.ip=${nems.mgmt.ip}
+ nems.mgmt.netmask=${nems.mgmt.netmask}
+ nems.mgmt.gateway=${nems.mgmt.gateway}
+ nems.traffic.ip=${nems.traffic.ip}
+ nems.traffic.netmask=${nems.traffic.netmask}
+ nems.traffic.gateway=${nems.traffic.gateway}
+ nems.fe0.internal.ip=${nems.fe0.internal.ip}
+ nems.fe1.internal.ip=${nems.fe1.internal.ip}
+ nems.internal.netmask=${nems.internal.netmask}
+ nems.userweb.ip=${nems.userweb.ip}
+ nems.userweb.netmask=${nems.userweb.netmask}
+ nems.userweb.gateway=${nems.userweb.gateway}
+ nems.imap.ip=${nems.imap.ip}
+ nems.imap.netmask=${nems.imap.netmask}
+ nems.be.internal.ip=${nems.be.internal.ip}
+ nems.be.imap.ip=${nems.be.imap.ip}
+ nems.mgmt.route.1=${nems.mgmt.route.1}
+ nems.mgmt.route.2=${nems.mgmt.route.2}
+ nems.external.dns=${nems.external.dns}
+ nems.external.ntp=${nems.external.ntp}
+ nems.node=${nems.node}
+ nems.be0.host.name=${nems.be0.host.name}
+ nems.fe0.host.name=${nems.fe0.host.name}
+ nems.fe1.host.name=${nems.fe1.host.name}
+ nems.timezone=${nems.timezone}
+ params:
+ ${nems.mgmt.ip}: {get_param: [nems_fe_oam_ips, 1]}
+ ${nems.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${nems.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${nems.traffic.ip}: {get_param: [nems_fe_nems_traffic_net_ips, 1]}
+ ${nems.traffic.netmask}: {get_param: nems_traffic_netmask}
+ ${nems.traffic.gateway}: {get_param: nems_traffic_gateway}
+ ${nems.fe0.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 0]}
+ ${nems.fe1.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 1]}
+ ${nems.internal.netmask}: {get_param: nems_internal_netmask}
+ ${nems.userweb.ip}: {get_param: [nems_fe_nems_user_web_net_ips, 1]}
+ ${nems.userweb.netmask}: {get_param: nems_user_web_netmask}
+ ${nems.userweb.gateway}: {get_param: nems_user_web_gateway}
+ ${nems.imap.ip}: {get_param: [nems_fe_nems_imap_net_ips, 1]}
+ ${nems.imap.netmask}: {get_param: nems_imap_netmask}
+ ${nems.be.internal.ip}: {get_param: nems_be_nems_internal_net_ips}
+ ${nems.be.imap.ip}: {get_param: nems_be_nems_imap_net_ips}
+ ${nems.mgmt.route.1}: {get_param: oam_network_route_1}
+ ${nems.mgmt.route.2}: {get_param: oam_network_route_2}
+ ${nems.external.dns}: {get_param: external_dns}
+ ${nems.external.ntp}: {get_param: external_ntp}
+ ${nems.node}: {get_param: [nems_fe_node_roles, 1]}
+ ${nems.fe0.host.name}: {get_param: [nems_fe_names, 0]}
+ ${nems.fe1.host.name}: {get_param: [nems_fe_names, 1]}
+ ${nems.be0.host.name}: {get_param: nems_be_names}
+ ${nems.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ nems2_fe_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: nems_volume_size}
+ volume_type: {get_param: NEMS_FE_volume_type}
+
+ nems2_fe_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: nems2_fe_volume}
+ instance_uuid: {get_resource: server_nems_fe2}
+
+ nems_fe2_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [
+ "ip_address": {get_param: [nems_fe_oam_ips, 1]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ nems_fe2_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: nems_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [nems_fe_nems_traffic_net_ips, 1] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ nems_fe2_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: nems_user_web_net }
+ fixed_ips: [
+ "ip_address": { get_param: [nems_fe_nems_user_web_net_ips, 1] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ nems_fe2_port_3:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: nems_internal_net }
+ fixed_ips: [
+ "ip_address": { get_param: [nems_fe_nems_internal_net_ips, 1] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+
+ nems_fe2_port_4:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: nems_imap_net }
+ fixed_ips: [
+ "ip_address": { get_param: [nems_fe_nems_imap_net_ips, 1] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_nems_be1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: nems_be_names }
+ image: { get_param: nems_be_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: nems_be_flavor }
+ networks:
+ - port: { get_resource: nems_be1_port_0 }
+ - port: { get_resource: nems_be1_port_1 }
+ - port: { get_resource: nems_be1_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ nems.be.mgmt.ip=${nems.be.mgmt.ip}
+ nems.mgmt.netmask=${nems.mgmt.netmask}
+ nems.mgmt.gateway=${nems.mgmt.gateway}
+ nems.be.internal.ip=${nems.be.internal.ip}
+ nems.internal.netmask=${nems.internal.netmask}
+ nems.imap.netmask=${nems.imap.netmask}
+ nems.fe0.internal.ip=${nems.fe0.internal.ip}
+ nems.fe1.internal.ip=${nems.fe1.internal.ip}
+ nems.be.imap.ip=${nems.be.imap.ip}
+ nems.mgmt.route.1=${nems.mgmt.route.1}
+ nems.mgmt.route.2=${nems.mgmt.route.2}
+ nems.external.dns=${nems.external.dns}
+ nems.external.ntp=${nems.external.ntp}
+ nems.node=${nems.node}
+ nems.be0.host.name=${nems.be0.host.name}
+ nems.fe0.host.name=${nems.fe0.host.name}
+ nems.fe1.host.name=${nems.fe1.host.name}
+ nems.timezone=${nems.timezone}
+ params:
+ ${nems.be.mgmt.ip}: {get_param: nems_be_oam_ips}
+ ${nems.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${nems.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${nems.fe0.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 0]}
+ ${nems.fe1.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 1]}
+ ${nems.be.internal.ip}: {get_param: nems_be_nems_internal_net_ips}
+ ${nems.internal.netmask}: {get_param: nems_internal_netmask}
+ ${nems.imap.netmask}: {get_param: nems_imap_netmask}
+ ${nems.be.imap.ip}: {get_param: nems_be_nems_imap_net_ips}
+ ${nems.mgmt.route.1}: {get_param: oam_network_route_1}
+ ${nems.mgmt.route.2}: {get_param: oam_network_route_2}
+ ${nems.external.dns}: {get_param: external_dns}
+ ${nems.external.ntp}: {get_param: external_ntp}
+ ${nems.node}: {get_param: nems_be_node_roles}
+ ${nems.be0.host.name}: {get_param: nems_be_names}
+ ${nems.fe0.host.name}: {get_param: [nems_fe_names, 0]}
+ ${nems.fe1.host.name}: {get_param: [nems_fe_names, 1]}
+ ${nems.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ nems_be_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: nems_be_volume_size}
+ volume_type: {get_param: NEMS_BE_volume_type}
+
+ nems_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: nems_be_volume}
+ instance_uuid: {get_resource: server_nems_be1}
+
+
+ nems_be1_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [
+ "ip_address": { get_param: nems_be_oam_ips}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ nems_be1_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: nems_internal_net }
+ fixed_ips: [
+ "ip_address": { get_param: nems_be_nems_internal_net_ips}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ nems_be1_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: nems_imap_net }
+ fixed_ips: [
+ "ip_address": { get_param: nems_be_nems_imap_net_ips}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 0]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx1_port_0 }
+ - port: { get_resource: eca_trx1_port_1 }
+ - port: { get_resource: eca_trx1_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 0]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 0]}
+
+ eca_trx1_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 0] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx1_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 0] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx1_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 0] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+
+ server_eca_trx2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 1]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx2_port_0 }
+ - port: { get_resource: eca_trx2_port_1 }
+ - port: { get_resource: eca_trx2_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 1]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 1]}
+
+ eca_trx2_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 1] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx2_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 1] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx2_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 1] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx3:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 2]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx3_port_0 }
+ - port: { get_resource: eca_trx3_port_1 }
+ - port: { get_resource: eca_trx3_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 2]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 2]}
+
+ eca_trx3_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 2] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx3_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 2] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx3_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 2] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx4:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 3]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx4_port_0 }
+ - port: { get_resource: eca_trx4_port_1 }
+ - port: { get_resource: eca_trx4_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 3]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 3]}
+
+ eca_trx4_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 3] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx4_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 3] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx4_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 3] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx5:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 4]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx5_port_0 }
+ - port: { get_resource: eca_trx5_port_1 }
+ - port: { get_resource: eca_trx5_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 4]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 4]}
+
+ eca_trx5_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 4] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx5_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 4] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx5_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 4] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx6:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 5]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx6_port_0 }
+ - port: { get_resource: eca_trx6_port_1 }
+ - port: { get_resource: eca_trx6_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 5]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 5]}
+
+ eca_trx6_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 5] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx6_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 5] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx6_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 5] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx7:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 6]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx7_port_0 }
+ - port: { get_resource: eca_trx7_port_1 }
+ - port: { get_resource: eca_trx7_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 6]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 6]}
+
+ eca_trx7_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 6] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx7_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 6] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx7_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 6] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx8:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 7]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx8_port_0 }
+ - port: { get_resource: eca_trx8_port_1 }
+ - port: { get_resource: eca_trx8_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 7]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 7]}
+
+ eca_trx8_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 7] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx8_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 7] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx8_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 7] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx9:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 8]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx9_port_0 }
+ - port: { get_resource: eca_trx9_port_1 }
+ - port: { get_resource: eca_trx9_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 8]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 8]}
+
+ eca_trx9_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 8] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx9_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 8] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx9_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 8] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx10:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 9]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx10_port_0 }
+ - port: { get_resource: eca_trx10_port_1 }
+ - port: { get_resource: eca_trx10_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 9]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 9]}
+
+ eca_trx10_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 9] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx10_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 9] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx10_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 9] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx11:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 10]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx11_port_0 }
+ - port: { get_resource: eca_trx11_port_1 }
+ - port: { get_resource: eca_trx11_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 10]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 10]}
+
+ eca_trx11_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 10] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx11_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 10] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx11_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 10] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+
+ server_eca_trx12:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 11]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx12_port_0 }
+ - port: { get_resource: eca_trx12_port_1 }
+ - port: { get_resource: eca_trx12_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 11]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 11]}
+
+ eca_trx12_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 11] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx12_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 11] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx12_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 11] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx13:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 12]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx13_port_0 }
+ - port: { get_resource: eca_trx13_port_1 }
+ - port: { get_resource: eca_trx13_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 12]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 12]}
+
+ eca_trx13_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 12] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx13_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 12] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx13_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 12] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx14:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 13]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx14_port_0 }
+ - port: { get_resource: eca_trx14_port_1 }
+ - port: { get_resource: eca_trx14_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 13]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 13]}
+
+ eca_trx14_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 13] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx14_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 13] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx14_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 13] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx15:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 14]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx15_port_0 }
+ - port: { get_resource: eca_trx15_port_1 }
+ - port: { get_resource: eca_trx15_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 14]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 14]}
+
+ eca_trx15_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 14] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx15_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 14] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx15_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 14] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx16:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 15]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx16_port_0 }
+ - port: { get_resource: eca_trx16_port_1 }
+ - port: { get_resource: eca_trx16_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 15]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 15]}
+
+ eca_trx16_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 15] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx16_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 15] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx16_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 15] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+
+ server_eca_trx17:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 16]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx17_port_0 }
+ - port: { get_resource: eca_trx17_port_1 }
+ - port: { get_resource: eca_trx17_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 16]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 16]}
+
+ eca_trx17_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 16] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx17_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 16] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx17_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 16] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx18:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 17]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx18_port_0 }
+ - port: { get_resource: eca_trx18_port_1 }
+ - port: { get_resource: eca_trx18_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 17]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 17]}
+
+ eca_trx18_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 17] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx18_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 17] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx18_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 17] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx19:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 18]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx19_port_0 }
+ - port: { get_resource: eca_trx19_port_1 }
+ - port: { get_resource: eca_trx19_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 8]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 18]}
+
+ eca_trx19_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 18] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx19_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 18] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx19_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 18] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx20:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 19]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx20_port_0 }
+ - port: { get_resource: eca_trx20_port_1 }
+ - port: { get_resource: eca_trx20_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 19]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 19]}
+
+ eca_trx20_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 19] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx20_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 19] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx20_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 19] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/MMSC_Capacity_Line_1.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/MMSC_Capacity_Line_1.env
new file mode 100644
index 0000000000..b346d67d97
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/MMSC_Capacity_Line_1.env
@@ -0,0 +1,111 @@
+parameters:
+ oam_net_name: oam_protected_net_0
+ oam_network_netmask: 255.255.254.0
+ oam_network_gateway: 107.250.172.1
+ oam_network_route_1: 155.165.201.250/32,107.250.172.1
+ oam_network_route_2: 155.165.194.100/32,107.250.172.1
+ external_dns: 155.165.194.100
+ external_ntp: 155.165.201.250
+ lb_oam_ips: 107.250.172.50,107.250.172.51
+ dmz_protected_net_name: dmz_protected_net_0
+ lb_dmz_protected_ips: 107.239.14.19,107.239.14.20
+ cor_direct_net_name: cor_direct_net_0
+ lb_cor_direct_ips: 172.31.10.19,172.31.10.20
+ mms_traffic_net_name: int_mms_mms_traffic_net_2
+ mms_traffic_net_cidr: 172.26.2.0/24
+ mms_traffic_netmask: 255.255.255.0
+ mms_traffic_net_gateway: 172.26.2.1
+ mms_traffic_start: 172.26.2.3
+ mms_traffic_end: 172.26.2.254
+ mms_traffic_net_local_ip1: 172.26.2.3
+ mms_traffic_net_local_ip2: 172.26.2.4
+ mms_traffic_net_floating_ip: 172.26.2.5
+ nems_internal_name: int_mms_nems_internal_net_2
+ nems_internal_start: 172.26.6.3
+ nems_internal_end: 172.26.6.254
+ nems_internal_cidr: 172.26.6.0/24
+ nems_internal_netmask: 255.255.255.0
+ nems_internal_gateway: 172.26.6.1
+ nems_traffic_name: int_mms_nems_traffic_net_2
+ nems_traffic_start: 172.26.3.3
+ nems_traffic_end: 172.26.3.254
+ nems_traffic_cidr: 172.26.3.0/24
+ nems_traffic_netmask: 255.255.255.0
+ nems_traffic_gateway: 172.26.3.1
+ nems_traffic_net_local_ip1: 172.26.3.3
+ nems_traffic_net_local_ip2: 172.26.3.4
+ nems_traffic_net_floating_ip: 172.26.3.5
+ nems_user_web_name: int_mms_nems_web_net_2
+ nems_user_web_start: 172.26.4.3
+ nems_user_web_end: 172.26.4.254
+ nems_user_web_cidr: 172.26.4.0/24
+ nems_user_web_netmask: 255.255.255.0
+ nems_user_web_gateway: 172.26.4.1
+ nems_user_web_net_local_ip1: 172.26.4.3
+ nems_user_web_net_local_ip2: 172.26.4.4
+ nems_user_web_net_floating_ip: 172.26.4.5
+ nems_imap_name: int_mms_nems_imap_net_2
+ nems_imap_start: 172.26.7.3
+ nems_imap_end: 172.26.7.254
+ nems_imap_cidr: 172.26.7.0/24
+ nems_imap_netmask: 255.255.255.0
+ nems_imap_gateway: 172.26.7.1
+ eca_traffic_name: int_mms_eca_traffic_net_2
+ eca_traffic_cidr: 172.26.5.0/24
+ eca_traffic_netmask: 255.255.255.0
+ eca_traffic_net_gateway: 172.26.5.1
+ eca_traffic_start: 172.26.5.3
+ eca_traffic_end: 172.26.5.254
+ eca_traffic_net_local_ip1: 172.26.5.3
+ eca_traffic_net_local_ip2: 172.26.5.4
+ eca_traffic_net_floating_ip: 172.26.5.5
+ ha_net_name: int_mms_ha_net_2
+ ha_net_cidr: 172.26.1.0/24
+ ha_net_start: 172.26.1.3
+ ha_net_end: 172.26.1.254
+ ha_net_local_ip1: 172.26.1.3
+ ha_net_local_ip2: 172.26.1.4
+ lb_names: ZRDM1MMSC03ALB001,ZRDM1MMSC03ALB002
+ lb_image_name: BIGIP-11.5.3.0.0.163
+ lb_flavor_name: m1.xlarge
+ security_group_name: mmsc_security_group_1
+ availability_zone_0: nova
+ mmsc_mms_traffic_net_ips: 172.26.2.11,172.26.2.12,172.26.2.13,172.26.2.14,172.26.2.15
+ mmsc_oam_ips: 107.250.172.54,107.250.172.55,107.250.172.56,107.250.172.57,107.250.172.58
+ mmsc_flavor: lc.4xlarge4
+ mmsc_image: mmsc-6.0.2_v5
+ mmsc_cinder_volume_size: 480
+ nems_fe_flavor: m1.large2
+ nems_fe_image: nems-2.1.2_v29
+ nems_fe_names: ZRDM1MMSC03NFE001,ZRDM1MMSC03NFE002
+ nems_fe_node_roles: FE0,FE1
+ nems_fe_oam_ips: 107.250.172.64,107.250.172.65
+ nems_fe_nems_traffic_net_ips: 172.26.3.11,172.26.3.12
+ nems_fe_nems_user_web_net_ips: 172.26.4.11,172.26.4.12
+ nems_fe_nems_internal_net_ips: 172.26.6.11,172.26.6.12
+ nems_fe_nems_imap_net_ips: 172.26.7.11,172.26.7.12
+ nems_be_names: ZRDM1MMSC03NBE001
+ nems_be_node_roles: BE0
+ nems_be_oam_ips: 107.250.172.66
+ nems_be_nems_internal_net_ips: 172.26.6.13
+ nems_be_nems_imap_net_ips: 172.26.7.13
+ nems_be_flavor: m1.large2
+ nems_be_image: nems-2.1.2_v29
+ eca_trx_oam_ips: 107.250.172.70,107.250.172.71,107.250.172.72,107.250.172.73,107.250.172.74,107.250.172.75,107.250.172.76,107.250.172.77,107.250.172.78,107.250.172.79,107.250.172.80,107.250.172.81,107.250.172.82,107.250.172.83,107.250.172.84,107.250.172.85,107.250.172.86,107.250.172.87,107.250.172.88,107.250.172.89
+ eca_trx_mgmt_ips: 172.25.137.202,172.25.137.203,172.25.137.204,172.25.137.205,172.25.137.206,172.25.137.207,172.25.137.208,172.25.137.209,172.25.137.210,172.25.137.211,172.25.137.212,172.25.137.213,172.25.137.214,172.25.137.215,172.25.137.216,172.25.137.217,172.25.137.218,172.25.137.219,172.25.137.220,172.25.137.221
+ eca_trx_flavor: m1.xlarge
+ eca_trx_image: ECABASE
+ timezone: UTC
+ eca_trx_names: ZRDM1MMSC03TRX001,ZRDM1MMSC03TRX002,ZRDM1MMSC03TRX003,ZRDM1MMSC03TRX004,ZRDM1MMSC03TRX005,ZRDM1MMSC03TRX006,ZRDM1MMSC03TRX007,ZRDM1MMSC03TRX008,ZRDM1MMSC03TRX009,ZRDM1MMSC03TRX010,ZRDM1MMSC03TRX011,ZRDM1MMSC03TRX012,ZRDM1MMSC03TRX013,ZRDM1MMSC03TRX014,ZRDM1MMSC03TRX015,ZRDM1MMSC03TRX016,ZRDM1MMSC03TRX017,ZRDM1MMSC03TRX018,ZRDM1MMSC03TRX019,ZRDM1MMSC03TRX020
+ eca_trx_eca_traffic_net_ips: 172.26.5.11,172.26.5.12,172.26.5.13,172.26.5.14,172.26.5.15,172.26.5.16,172.26.5.17,172.26.5.18,172.26.5.19,172.26.5.20,172.26.5.21,172.26.5.22,172.26.5.23,172.26.5.24,172.26.5.25,172.26.5.26,172.26.5.27,172.26.5.28,172.26.5.29,172.26.5.30
+ mmsc_names: ZRDM1MMSC03MMS001,ZRDM1MMSC03MMS002,ZRDM1MMSC03MMS003,ZRDM1MMSC03MMS004,ZRDM1MMSC03MMS005
+ nems_volume_size: 50
+ nems_be_volume_size: 610
+ MMSC_volume_type: Platinum
+ NEMS_FE_volume_type: Platinum
+ NEMS_BE_volume_type: Platinum
+ mmsc_core_virtual_server_ips: 172.31.10.21,172.31.10.22
+ mmsc_core_snat_ips: 172.31.10.23,172.31.10.24,172.31.10.25,172.31.10.26,172.31.10.27
+ mmsc_dmz_protected_virtual_server_ips: 107.239.14.21,107.239.14.22,107.239.14.23
+ mmsc_dmz_protected_snat_ips: 107.239.14.24,107.239.14.25,107.239.14.26,107.239.14.27
+ eca_mgmt_net_name: int_eca_mgmt_net_1 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/NETWORK_OUT.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/NETWORK_OUT.yaml
new file mode 100644
index 0000000000..53efc5e36e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/NETWORK_OUT.yaml
@@ -0,0 +1,76 @@
+heat_template_version: 2013-05-23
+
+#################################
+#
+# Changes from MSO - 11/5/2015
+# - Parameter changes as below
+# - CDLs for vmNames, IPs
+# - aZone->availability_zone_0
+# - nwName->{nwRole}_net_name
+# - nwID->{nwRole}_net_id
+# - vmName->{vmType}_names
+# - ips ->{vmType}_{nwRole}_ips
+# - fips->{vmType}_{nwRole}_floating_ip
+# - added replacement_policy: AUTO to all ports
+# - added vnf_id for metadata to all servers
+# - externalized security group resource
+# - externalized eca_mgmt network
+#
+#################################
+
+description: >
+ HOT template that creates Security Group and ECA network
+
+parameters:
+ eca_mgmt_name:
+ type: string
+ label: eca management name
+ description: eca management name
+ eca_mgmt_start:
+ type: string
+ label: eca management start
+ description: eca management start
+ eca_mgmt_end:
+ type: string
+ label: eca management end
+ description: eca management end
+ eca_mgmt_cidr:
+ type: string
+ label: eca management cidr
+ description: eca management cidr
+ eca_mgmt_netmask:
+ type: string
+ label: ECA mgmt network subnet mask
+ description: ECA mgmt network subnet mask
+ security_group_name:
+ type: string
+ label: MMSC security group name
+ description: MMSC security group name
+
+resources:
+ mms_security_group:
+ type: OS::Neutron::SecurityGroup
+ properties:
+ description: mmsc security group
+ name: {get_param: security_group_name}
+ rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}
+ ]
+ eca_mgmt_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: {get_param: eca_mgmt_name}
+
+ eca_mgmt_network_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: eca_mgmt_name}
+ allocation_pools: [{"start": {get_param: eca_mgmt_start}, "end": {get_param: eca_mgmt_end}}]
+ cidr: {get_param: eca_mgmt_cidr}
+ #enable_dhcp: false
+ #gateway_ip: null
+ network_id: {get_resource: eca_mgmt_net}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/SG_ECA_MGMT.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/SG_ECA_MGMT.yaml
new file mode 100644
index 0000000000..6e68fd8783
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/SG_ECA_MGMT.yaml
@@ -0,0 +1,81 @@
+heat_template_version: 2013-05-23
+
+#################################
+#
+# Changes from MSO - 11/5/2015
+# - Parameter changes as below
+# - CDLs for vmNames, IPs
+# - aZone->availability_zone_0
+# - nwName->{nwRole}_net_name
+# - nwID->{nwRole}_net_id
+# - vmName->{vmType}_names
+# - ips ->{vmType}_{nwRole}_ips
+# - fips->{vmType}_{nwRole}_floating_ip
+# - added replacement_policy: AUTO to all ports
+# - added vnf_id for metadata to all servers
+# - externalized security group resource
+# - externalized eca_mgmt network
+#
+#################################
+
+description: >
+ HOT template that creates Security Group and ECA network
+
+parameters:
+ eca_mgmt_name:
+ type: string
+ label: eca management name
+ description: eca management name
+ eca_mgmt_start:
+ type: string
+ label: eca management start
+ description: eca management start
+ eca_mgmt_end:
+ type: string
+ label: eca management end
+ description: eca management end
+ eca_mgmt_cidr:
+ type: string
+ label: eca management cidr
+ description: eca management cidr
+ eca_mgmt_netmask:
+ type: string
+ label: ECA mgmt network subnet mask
+ description: ECA mgmt network subnet mask
+ security_group_name:
+ type: string
+ label: MMSC security group name
+ description: MMSC security group name
+
+resources:
+ mms_traffic_artifact:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ property_get_file_name: { get_file: "file:///art.sh" }
+
+ mms_security_group:
+ type: OS::Neutron::SecurityGroup
+ properties:
+ description: mmsc security group
+ name: {get_param: security_group_name}
+ rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}
+ ]
+ eca_mgmt_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: {get_param: eca_mgmt_name}
+
+ eca_mgmt_network_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: eca_mgmt_name}
+ allocation_pools: [{"start": {get_param: eca_mgmt_start}, "end": {get_param: eca_mgmt_end}}]
+ cidr: {get_param: eca_mgmt_cidr}
+ #enable_dhcp: false
+ #gateway_ip: null
+ network_id: {get_resource: eca_mgmt_net}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/VOLUME.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/VOLUME.yaml
new file mode 100644
index 0000000000..53efc5e36e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/VOLUME.yaml
@@ -0,0 +1,76 @@
+heat_template_version: 2013-05-23
+
+#################################
+#
+# Changes from MSO - 11/5/2015
+# - Parameter changes as below
+# - CDLs for vmNames, IPs
+# - aZone->availability_zone_0
+# - nwName->{nwRole}_net_name
+# - nwID->{nwRole}_net_id
+# - vmName->{vmType}_names
+# - ips ->{vmType}_{nwRole}_ips
+# - fips->{vmType}_{nwRole}_floating_ip
+# - added replacement_policy: AUTO to all ports
+# - added vnf_id for metadata to all servers
+# - externalized security group resource
+# - externalized eca_mgmt network
+#
+#################################
+
+description: >
+ HOT template that creates Security Group and ECA network
+
+parameters:
+ eca_mgmt_name:
+ type: string
+ label: eca management name
+ description: eca management name
+ eca_mgmt_start:
+ type: string
+ label: eca management start
+ description: eca management start
+ eca_mgmt_end:
+ type: string
+ label: eca management end
+ description: eca management end
+ eca_mgmt_cidr:
+ type: string
+ label: eca management cidr
+ description: eca management cidr
+ eca_mgmt_netmask:
+ type: string
+ label: ECA mgmt network subnet mask
+ description: ECA mgmt network subnet mask
+ security_group_name:
+ type: string
+ label: MMSC security group name
+ description: MMSC security group name
+
+resources:
+ mms_security_group:
+ type: OS::Neutron::SecurityGroup
+ properties:
+ description: mmsc security group
+ name: {get_param: security_group_name}
+ rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}
+ ]
+ eca_mgmt_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: {get_param: eca_mgmt_name}
+
+ eca_mgmt_network_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: eca_mgmt_name}
+ allocation_pools: [{"start": {get_param: eca_mgmt_start}, "end": {get_param: eca_mgmt_end}}]
+ cidr: {get_param: eca_mgmt_cidr}
+ #enable_dhcp: false
+ #gateway_ip: null
+ network_id: {get_resource: eca_mgmt_net}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/VOLUME_OUT.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/VOLUME_OUT.yaml
new file mode 100644
index 0000000000..53efc5e36e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/VOLUME_OUT.yaml
@@ -0,0 +1,76 @@
+heat_template_version: 2013-05-23
+
+#################################
+#
+# Changes from MSO - 11/5/2015
+# - Parameter changes as below
+# - CDLs for vmNames, IPs
+# - aZone->availability_zone_0
+# - nwName->{nwRole}_net_name
+# - nwID->{nwRole}_net_id
+# - vmName->{vmType}_names
+# - ips ->{vmType}_{nwRole}_ips
+# - fips->{vmType}_{nwRole}_floating_ip
+# - added replacement_policy: AUTO to all ports
+# - added vnf_id for metadata to all servers
+# - externalized security group resource
+# - externalized eca_mgmt network
+#
+#################################
+
+description: >
+ HOT template that creates Security Group and ECA network
+
+parameters:
+ eca_mgmt_name:
+ type: string
+ label: eca management name
+ description: eca management name
+ eca_mgmt_start:
+ type: string
+ label: eca management start
+ description: eca management start
+ eca_mgmt_end:
+ type: string
+ label: eca management end
+ description: eca management end
+ eca_mgmt_cidr:
+ type: string
+ label: eca management cidr
+ description: eca management cidr
+ eca_mgmt_netmask:
+ type: string
+ label: ECA mgmt network subnet mask
+ description: ECA mgmt network subnet mask
+ security_group_name:
+ type: string
+ label: MMSC security group name
+ description: MMSC security group name
+
+resources:
+ mms_security_group:
+ type: OS::Neutron::SecurityGroup
+ properties:
+ description: mmsc security group
+ name: {get_param: security_group_name}
+ rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}
+ ]
+ eca_mgmt_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: {get_param: eca_mgmt_name}
+
+ eca_mgmt_network_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: eca_mgmt_name}
+ allocation_pools: [{"start": {get_param: eca_mgmt_start}, "end": {get_param: eca_mgmt_end}}]
+ cidr: {get_param: eca_mgmt_cidr}
+ #enable_dhcp: false
+ #gateway_ip: null
+ network_id: {get_resource: eca_mgmt_net}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/art.sh b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/art.sh
new file mode 100644
index 0000000000..186d1c34fb
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/art.sh
@@ -0,0 +1 @@
+heat stack-create vMME -e vmme_small.env -f vmme_small.yml
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/cmaui.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/cmaui.env
new file mode 100644
index 0000000000..2e6012d1c5
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/cmaui.env
@@ -0,0 +1,15 @@
+parameters:
+ cmaui_names: ZRDM1MMSC02CMI001,ZRDM1MMSC02CMI002
+ cmaui_flavor: m1.large
+ cmaui_image: cmaui-5.0.2.5_v25
+ cmaui_cinder_volume_size: 55
+ oam_net_name: oam_protected_net_0
+ oam_network_netmask: 255.255.254.0
+ oam_network_gateway: 107.250.172.1
+ external_dns: 155.165.201.250
+ external_ntp: 155.165.194.100
+ security_group_name: mmsc_security_group_1
+ availability_zone_0: nova
+ timezone: UTC
+ cmaui_oam_ips: 107.250.172.42,107.250.172.43
+ CMAUI_volume_type: Platinum \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/cmaui.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/cmaui.yml
new file mode 100644
index 0000000000..3d757b1631
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/cmaui.yml
@@ -0,0 +1,179 @@
+heat_template_version: 2013-05-23
+
+#################################
+#
+# Changes from MSO 01/26/2016
+# Updated per ECOMP feedback
+#
+#################################
+
+description: cmaui server template for vMMSC
+
+parameters:
+ vnf_id:
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-CMAUI_id
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_cinder_volume_size:
+ type: number
+ label: CMAUI Cinder volume size
+ description: the size of the CMAUI Cinder volume
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ oam_net_name:
+ type: string
+ description: UID of OAM network
+ oam_network_netmask:
+ type: string
+ label: oam network netmask
+ description: oam network gateway
+ oam_network_gateway:
+ type: string
+ label: oam network gateway
+ description: oam network gateway
+ external_dns:
+ type: string
+ label: dns server
+ description: dns server
+ external_ntp:
+ type: string
+ label: ntp server
+ description: ntp server
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ timezone:
+ type: string
+ label: timezone
+ description: timezone
+ cmaui_oam_ips:
+ type: comma_delimited_list
+ label: CMAUI oam_net IP addresses
+ description: CMAUI oam_net IP addresses
+ CMAUI_volume_type:
+ type: string
+ label: CMAUI vm volume type
+ description: the name of the target volume backend
+
+resources:
+ server_cmaui:
+ type: eca_oam.yaml
+ properties:
+ cmaui_name: { get_param: [cmaui_names, 0]}
+ cmaui_image: { get_param: cmaui_image }
+ availability_zone_0: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_0 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ cmaui.mgmt.ip=${cmaui.mgmt.ip}
+ cmaui.mgmt.netmask=${cmaui.mgmt.netmask}
+ cmaui.mgmt.gateway=${cmaui.mgmt.gateway}
+ cmaui.external.dns=${cmaui.external.dns}
+ cmaui.external.ntp=${cmaui.external.ntp}
+ cmaui.node=${cmaui.node}
+ cmaui.timezone=${cmaui.timezone}
+ params:
+ ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]}
+ ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${cmaui.external.dns}: {get_param: external_dns}
+ ${cmaui.external.ntp}: {get_param: external_ntp}
+ ${cmaui.node}: {get_param: [cmaui_names, 0]}
+ ${cmaui.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ cmaui_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: cmaui_cinder_volume_size}
+ volume_type: {get_param: CMAUI_volume_type}
+
+ cmaui_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: cmaui_volume}
+ instance_uuid: {get_resource: server_cmaui}
+
+ cmaui_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_cmaui1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 1]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui1_port_0 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ cmaui.mgmt.ip=${cmaui.mgmt.ip}
+ cmaui.mgmt.netmask=${cmaui.mgmt.netmask}
+ cmaui.mgmt.gateway=${cmaui.mgmt.gateway}
+ cmaui.external.dns=${cmaui.external.dns}
+ cmaui.external.ntp=${cmaui.external.ntp}
+ cmaui.node=${cmaui.node}
+ cmaui.timezone=${cmaui.timezone}
+ params:
+ ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 1]}
+ ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${cmaui.external.dns}: {get_param: external_dns}
+ ${cmaui.external.ntp}: {get_param: external_ntp}
+ ${cmaui.node}: {get_param: [cmaui_names, 1]}
+ ${cmaui.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ cmaui1_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: cmaui_cinder_volume_size}
+ volume_type: {get_param: CMAUI_volume_type}
+
+ cmaui1_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: cmaui1_volume}
+ instance_uuid: {get_resource: server_cmaui1}
+
+ cmaui1_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 1]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+outputs:
+ expose_1:
+ description: the pcrf_server
+ value: { get_resource: cmaui_volume }
+ expose_2:
+ description: the pcrf_server
+ value: { get_resource: cmaui1_volume }
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/cmaui_net.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/cmaui_net.yaml
new file mode 100644
index 0000000000..53efc5e36e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/cmaui_net.yaml
@@ -0,0 +1,76 @@
+heat_template_version: 2013-05-23
+
+#################################
+#
+# Changes from MSO - 11/5/2015
+# - Parameter changes as below
+# - CDLs for vmNames, IPs
+# - aZone->availability_zone_0
+# - nwName->{nwRole}_net_name
+# - nwID->{nwRole}_net_id
+# - vmName->{vmType}_names
+# - ips ->{vmType}_{nwRole}_ips
+# - fips->{vmType}_{nwRole}_floating_ip
+# - added replacement_policy: AUTO to all ports
+# - added vnf_id for metadata to all servers
+# - externalized security group resource
+# - externalized eca_mgmt network
+#
+#################################
+
+description: >
+ HOT template that creates Security Group and ECA network
+
+parameters:
+ eca_mgmt_name:
+ type: string
+ label: eca management name
+ description: eca management name
+ eca_mgmt_start:
+ type: string
+ label: eca management start
+ description: eca management start
+ eca_mgmt_end:
+ type: string
+ label: eca management end
+ description: eca management end
+ eca_mgmt_cidr:
+ type: string
+ label: eca management cidr
+ description: eca management cidr
+ eca_mgmt_netmask:
+ type: string
+ label: ECA mgmt network subnet mask
+ description: ECA mgmt network subnet mask
+ security_group_name:
+ type: string
+ label: MMSC security group name
+ description: MMSC security group name
+
+resources:
+ mms_security_group:
+ type: OS::Neutron::SecurityGroup
+ properties:
+ description: mmsc security group
+ name: {get_param: security_group_name}
+ rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}
+ ]
+ eca_mgmt_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: {get_param: eca_mgmt_name}
+
+ eca_mgmt_network_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: eca_mgmt_name}
+ allocation_pools: [{"start": {get_param: eca_mgmt_start}, "end": {get_param: eca_mgmt_end}}]
+ cidr: {get_param: eca_mgmt_cidr}
+ #enable_dhcp: false
+ #gateway_ip: null
+ network_id: {get_resource: eca_mgmt_net}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/eca_oam.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/eca_oam.env
new file mode 100644
index 0000000000..f9991722b3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/eca_oam.env
@@ -0,0 +1,20 @@
+parameters:
+ eca_names: ZRDM1MMSC02OAM001,ZRDM1MMSC02OAM002
+ arb_names: ZRDM1MMSC02ARB001
+ oam_image_name: ECABASE
+ oam_flavor: lc.xlarge4
+ arbiter_flavor: m1.large2
+ availability_zone_0: nova
+ oam_net_name: oam_protected_net_0
+ eca_mgmt_net_name: int_mms_eca_mgmt_net_1
+ eca_oam_ips: 107.250.172.44,107.250.172.45
+ eca_eca_mgmt_ips: 172.25.137.242,172.25.137.243
+ eca_oam_gateway: 107.250.172.1
+ arb_oam_ips: 107.250.172.46
+ arb_eca_mgmt_ips: 172.25.137.244
+ security_group_name: mmsc_security_group_1
+ oam_volume_size: 1800
+ arb_volume_size: 40
+ swift_eca_url: http://object-store.rdm2.cci.com:8080/v1/AUTH_1bbab536a19b4756926e7d0ec1eb543c/eca
+ ECA_OAM_volume_type: Platinum
+ ARB_volume_type: Platinum
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/eca_oam.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/eca_oam.yaml
new file mode 100644
index 0000000000..243bccf3d0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/eca_oam.yaml
@@ -0,0 +1,453 @@
+heat_template_version: 2013-05-23
+
+##########################################################
+#
+# Changes from MSO
+# - Updated per ECOMP Feedback
+#
+#
+##########################################################
+
+description: This stack creates two ECA OAM VM and one ARB VM
+
+parameters:
+ vnf_id:
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-ECA_id
+ eca_names:
+ type: comma_delimited_list
+ label: oam servers names
+ description: the names of the OAM1,OAM2 VM instances
+ cmaui_name:
+ type: comma_delimited_list
+ label: oam servers names
+ cmaui_image:
+ type: comma_delimited_list
+ label: oam servers names
+ description: the names of the OAM1,OAM2 VM instances
+ networks:
+ type: string
+ label: internal network name
+ description: the name of the internal network
+ flavor:
+ type: string
+ label: internal network name
+ description: the name of the internal network
+ metadata:
+ type: string
+ label: internal network name
+ description: the name of the internal network
+ user_data:
+ type: string
+ label: internal network name
+ description: the name of the internal network
+ user_data_format:
+ type: string
+ label: internal network name
+ description: the name of the internal network
+ cmaui_names:
+ type: comma_delimited_list
+ label: oam servers names
+ description: the names of the OAM1,OAM2 VM instances
+ cmaui_flavor:
+ type: comma_delimited_list
+ label: oam servers names
+ description: the names of the OAM1,OAM2 VM instances
+ arb_names:
+ type: comma_delimited_list
+ label: arbiter server names
+ description: the names of the arbiter VM instances
+ oam_image_name:
+ type: string
+ label: image name
+ description: the OAM image name
+ oam_flavor:
+ type: string
+ label: flavor name
+ description: OAM flavor name
+ arbiter_flavor:
+ type: string
+ label: flavor name
+ description: arbiter flavor name
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ oam_net_name:
+ type: string
+ label: oam network name
+ description: the name of the oam network
+ eca_mgmt_net_name:
+ type: string
+ label: internal network name
+ description: the name of the internal network
+ eca_oam_ips:
+ type: comma_delimited_list
+ label: oam network ips
+ description: the ips of oam networks for eca VM
+ eca_eca_mgmt_ips:
+ type: comma_delimited_list
+ label: eca_mgmt network ips for eca VM
+ description: internal eca_mgmt network ips for eca VM
+ arb_oam_ips:
+ type: comma_delimited_list
+ label: oam network ips for arb VM
+ description: oam network ips for eca VM
+ arb_eca_mgmt_ips:
+ type: comma_delimited_list
+ label: eca_mgmt network ips
+ description: internal eca_mgmt network ips for arb VM
+ eca_oam_gateway:
+ type: string
+ label: oam network gateway
+ description: oam network gateway
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ oam_volume_size:
+ type: number
+ label: volume size
+ description: the size of the OAM volume
+ arb_volume_size:
+ type: number
+ label: volume size
+ description: the size of the ARB volume
+ swift_eca_url:
+ type: string
+ label: Swift URL
+ description: Base URL for eca swift object store
+ ECA_OAM_volume_type:
+ type: string
+ label: eca oam vm volume type
+ description: the name of the target volume backend
+ ARB_volume_type:
+ type: string
+ label: arb vm volume type
+ description: the name of the target volume backend
+
+resources:
+ server_cmaui_nested:
+ type: eca_oam_nested.yaml
+ properties:
+ cmaui_name: { get_param: [cmaui_names, 0]}
+ cmaui_image: { get_param: cmaui_image }
+ availability_zone_0: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_0 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ cmaui.mgmt.ip=${cmaui.mgmt.ip}
+ cmaui.mgmt.netmask=${cmaui.mgmt.netmask}
+ cmaui.mgmt.gateway=${cmaui.mgmt.gateway}
+ cmaui.external.dns=${cmaui.external.dns}
+ cmaui.external.ntp=${cmaui.external.ntp}
+ cmaui.node=${cmaui.node}
+ cmaui.timezone=${cmaui.timezone}
+ params:
+ ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]}
+ ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${cmaui.external.dns}: {get_param: external_dns}
+ ${cmaui.external.ntp}: {get_param: external_ntp}
+ ${cmaui.node}: {get_param: [cmaui_names, 0]}
+ ${cmaui.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ oam1_instance:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: [eca_names, 0]}
+ image: {get_param: oam_image_name}
+ flavor: {get_param: oam_flavor}
+ availability_zone: {get_param: availability_zone_0}
+ networks:
+ - port: {get_resource: oam1_int_port}
+ - port: {get_resource: oam1_mgmt_port}
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ sed -i s/HOSTNAME.*/"HOSTNAME=oam1_hostname"/g /etc/sysconfig/network
+ eth1_ip_address='oam1_mgt_ip'
+ eth1_gateway='oam_gateway'
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ mkdir /etc/puppet/files/roles/transcoder
+ mkdir /etc/puppet/files/roles/oam_primary
+ curl swift_url/etc/puppet/manifests/roles/oam_primary.pp > /etc/puppet/manifests/roles/oam_primary.pp
+ curl swift_url/etc/puppet/manifests/roles/transcoder.pp > /etc/puppet/manifests/roles/transcoder.pp
+ curl swift_url/etc/puppet/files/roles/oam_primary/config.yaml > /etc/puppet/files/roles/oam_primary/config.yaml
+ curl swift_url/etc/puppet/files/roles/transcoder/config.yaml > /etc/puppet/files/roles/transcoder/config.yaml
+ curl swift_url/etc/puppet/files/roles/transcoder/hpm.conf > /etc/puppet/files/roles/transcoder/hpm.conf
+ curl swift_url/etc/puppet/files/roles/transcoder/trx.conf > /etc/puppet/files/roles/transcoder/trx.conf
+ curl swift_url/etc/puppet/files/roles/transcoder/plugins-mo.conf > /etc/puppet/files/roles/transcoder/plugins-mo.conf
+ curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
+ curl swift_url/etc/puppet/manifests/site.pp > /etc/puppet/manifests/site.pp
+ curl swift_url/scripts/van-init-replicaset > /usr/sbin/van-init-replicaset
+ van-role oam_primary > /root/startup-van-role.out
+ curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
+ fdisk /dev/vdb < /root/fdisk-keystrokes
+ curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
+ chmod 755 /root/os-conf-cinder-vol
+ /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
+ params:
+ oam1_mgt_ip: {get_param: [eca_oam_ips, 0] }
+ oam_gateway: {get_param: eca_oam_gateway }
+ oam1_hostname: {get_param: [eca_names, 0]}
+ swift_url: {get_param: swift_eca_url}
+
+ oam1_mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ cmaui_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ oam1_int_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: eca_mgmt_net_name}
+ fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ oam1_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: oam_volume_size}
+ volume_type: {get_param: ECA_OAM_volume_type}
+
+ oam1_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: oam1_volume}
+ instance_uuid: {get_resource: oam1_instance}
+
+ oam2_instance:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: [eca_names, 1]}
+ image: {get_param: oam_image_name}
+ flavor: {get_param: oam_flavor}
+ availability_zone: {get_param: availability_zone_0}
+ networks:
+ - port: {get_resource: oam2_int_port}
+ - port: {get_resource: oam2_mgmt_port}
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ sed -i s/HOSTNAME.*/"HOSTNAME=oam2_hostname"/g /etc/sysconfig/network
+ eth1_ip_address='oam2_mgt_ip'
+ eth1_gateway='oam_gateway'
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ curl swift_url/etc/puppet/manifests/roles/oam_secondary.pp > /etc/puppet/manifests/roles/oam_secondary.pp
+ curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml
+ curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
+ van-role oam_secondary > /root/startup-van-role.out
+ curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
+ fdisk /dev/vdb < /root/fdisk-keystrokes
+ curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
+ chmod 755 /root/os-conf-cinder-vol
+ /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
+
+ params:
+ oam2_mgt_ip: {get_param: [eca_oam_ips, 1] }
+ oam2_hostname: {get_param: [eca_names, 1]}
+ swift_url: {get_param: swift_eca_url}
+ oam_gateway: {get_param: eca_oam_gateway }
+
+ oam2_mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 1]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ oam2_int_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: eca_mgmt_net_name}
+ fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 1]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ oam2_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: oam_volume_size}
+ volume_type: {get_param: ECA_OAM_volume_type}
+
+ oam2_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: oam2_volume}
+ instance_uuid: {get_resource: oam2_instance}
+
+ arb_instance:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: [arb_names, 0]}
+ image: {get_param: oam_image_name}
+ flavor: {get_param: arbiter_flavor}
+ availability_zone: {get_param: availability_zone_0}
+ networks:
+ - port: {get_resource: arb_int_port}
+ - port: {get_resource: arb_mgmt_port}
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ sed -i s/HOSTNAME.*/"HOSTNAME=arb_hostname"/g /etc/sysconfig/network
+ eth1_ip_address='arb_mgt_ip'
+ eth1_gateway='oam_gateway'
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ curl swift_url/etc/puppet/manifests/roles/oam_arbiter.pp > /etc/puppet/manifests/roles/oam_arbiter.pp
+ curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml
+ curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
+ van-role oam_arbiter > /root/startup-van-role.out
+ curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
+ fdisk /dev/vdb < /root/fdisk-keystrokes
+ curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
+ chmod 755 /root/os-conf-cinder-vol
+ /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
+ params:
+ arb_mgt_ip: {get_param: [arb_oam_ips, 0] }
+ arb_hostname: {get_param: [arb_names, 0]}
+ swift_url: {get_param: swift_eca_url}
+ oam_gateway: {get_param: eca_oam_gateway }
+
+ arb_mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [arb_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ arb_int_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: eca_mgmt_net_name}
+ fixed_ips: [{"ip_address": {get_param: [arb_eca_mgmt_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ arb_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: arb_volume_size}
+ volume_type: {get_param: ARB_volume_type}
+ arb_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: arb_volume}
+ instance_uuid: {get_resource: arb_instance}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/eca_oam_nested.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/eca_oam_nested.yaml
new file mode 100644
index 0000000000..c8b9527555
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/eca_oam_nested.yaml
@@ -0,0 +1,406 @@
+heat_template_version: 2013-05-23
+
+##########################################################
+#
+# Changes from MSO
+# - Updated per ECOMP Feedback
+#
+#
+##########################################################
+
+description: This stack creates two ECA OAM VM and one ARB VM
+
+parameters:
+ vnf_id:
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-ECA_id
+ cmaui_name:
+ type: comma_delimited_list
+ label: oam servers names
+ cmaui_image:
+ type: comma_delimited_list
+ label: oam servers names
+ description: the names of the OAM1,OAM2 VM instances
+ networks:
+ type: string
+ label: internal network name
+ description: the name of the internal network
+ flavor:
+ type: string
+ label: internal network name
+ description: the name of the internal network
+ metadata:
+ type: string
+ label: internal network name
+ description: the name of the internal network
+ user_data:
+ type: string
+ label: internal network name
+ description: the name of the internal network
+ user_data_format:
+ type: string
+ label: internal network name
+ description: the name of the internal network
+ eca_names:
+ type: comma_delimited_list
+ label: oam servers names
+ description: the names of the OAM1,OAM2 VM instances
+ arb_names:
+ type: comma_delimited_list
+ label: arbiter server names
+ description: the names of the arbiter VM instances
+ oam_image_name:
+ type: string
+ label: image name
+ description: the OAM image name
+ oam_flavor:
+ type: string
+ label: flavor name
+ description: OAM flavor name
+ arbiter_flavor:
+ type: string
+ label: flavor name
+ description: arbiter flavor name
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ oam_net_name:
+ type: string
+ label: oam network name
+ description: the name of the oam network
+ eca_mgmt_net_name:
+ type: string
+ label: internal network name
+ description: the name of the internal network
+ eca_oam_ips:
+ type: comma_delimited_list
+ label: oam network ips
+ description: the ips of oam networks for eca VM
+ eca_eca_mgmt_ips:
+ type: comma_delimited_list
+ label: eca_mgmt network ips for eca VM
+ description: internal eca_mgmt network ips for eca VM
+ arb_oam_ips:
+ type: comma_delimited_list
+ label: oam network ips for arb VM
+ description: oam network ips for eca VM
+ arb_eca_mgmt_ips:
+ type: comma_delimited_list
+ label: eca_mgmt network ips
+ description: internal eca_mgmt network ips for arb VM
+ eca_oam_gateway:
+ type: string
+ label: oam network gateway
+ description: oam network gateway
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ oam_volume_size:
+ type: number
+ label: volume size
+ description: the size of the OAM volume
+ arb_volume_size:
+ type: number
+ label: volume size
+ description: the size of the ARB volume
+ swift_eca_url:
+ type: string
+ label: Swift URL
+ description: Base URL for eca swift object store
+ ECA_OAM_volume_type:
+ type: string
+ label: eca oam vm volume type
+ description: the name of the target volume backend
+ ARB_volume_type:
+ type: string
+ label: arb vm volume type
+ description: the name of the target volume backend
+
+resources:
+ oam1_instance:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: [eca_names, 0]}
+ image: {get_param: oam_image_name}
+ flavor: {get_param: oam_flavor}
+ availability_zone: {get_param: availability_zone_0}
+ networks:
+ - port: {get_resource: oam1_int_port}
+ - port: {get_resource: oam1_mgmt_port}
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ sed -i s/HOSTNAME.*/"HOSTNAME=oam1_hostname"/g /etc/sysconfig/network
+ eth1_ip_address='oam1_mgt_ip'
+ eth1_gateway='oam_gateway'
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ mkdir /etc/puppet/files/roles/transcoder
+ mkdir /etc/puppet/files/roles/oam_primary
+ curl swift_url/etc/puppet/manifests/roles/oam_primary.pp > /etc/puppet/manifests/roles/oam_primary.pp
+ curl swift_url/etc/puppet/manifests/roles/transcoder.pp > /etc/puppet/manifests/roles/transcoder.pp
+ curl swift_url/etc/puppet/files/roles/oam_primary/config.yaml > /etc/puppet/files/roles/oam_primary/config.yaml
+ curl swift_url/etc/puppet/files/roles/transcoder/config.yaml > /etc/puppet/files/roles/transcoder/config.yaml
+ curl swift_url/etc/puppet/files/roles/transcoder/hpm.conf > /etc/puppet/files/roles/transcoder/hpm.conf
+ curl swift_url/etc/puppet/files/roles/transcoder/trx.conf > /etc/puppet/files/roles/transcoder/trx.conf
+ curl swift_url/etc/puppet/files/roles/transcoder/plugins-mo.conf > /etc/puppet/files/roles/transcoder/plugins-mo.conf
+ curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
+ curl swift_url/etc/puppet/manifests/site.pp > /etc/puppet/manifests/site.pp
+ curl swift_url/scripts/van-init-replicaset > /usr/sbin/van-init-replicaset
+ van-role oam_primary > /root/startup-van-role.out
+ curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
+ fdisk /dev/vdb < /root/fdisk-keystrokes
+ curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
+ chmod 755 /root/os-conf-cinder-vol
+ /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
+ params:
+ oam1_mgt_ip: {get_param: [eca_oam_ips, 0] }
+ oam_gateway: {get_param: eca_oam_gateway }
+ oam1_hostname: {get_param: [eca_names, 0]}
+ swift_url: {get_param: swift_eca_url}
+
+ oam1_mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ oam1_int_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: eca_mgmt_net_name}
+ fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ oam1_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: oam_volume_size}
+ volume_type: {get_param: ECA_OAM_volume_type}
+
+ oam1_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: oam1_volume}
+ instance_uuid: {get_resource: oam1_instance}
+
+ oam2_instance:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: [eca_names, 1]}
+ image: {get_param: oam_image_name}
+ flavor: {get_param: oam_flavor}
+ availability_zone: {get_param: availability_zone_0}
+ networks:
+ - port: {get_resource: oam2_int_port}
+ - port: {get_resource: oam2_mgmt_port}
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ sed -i s/HOSTNAME.*/"HOSTNAME=oam2_hostname"/g /etc/sysconfig/network
+ eth1_ip_address='oam2_mgt_ip'
+ eth1_gateway='oam_gateway'
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ curl swift_url/etc/puppet/manifests/roles/oam_secondary.pp > /etc/puppet/manifests/roles/oam_secondary.pp
+ curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml
+ curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
+ van-role oam_secondary > /root/startup-van-role.out
+ curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
+ fdisk /dev/vdb < /root/fdisk-keystrokes
+ curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
+ chmod 755 /root/os-conf-cinder-vol
+ /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
+
+ params:
+ oam2_mgt_ip: {get_param: [eca_oam_ips, 1] }
+ oam2_hostname: {get_param: [eca_names, 1]}
+ swift_url: {get_param: swift_eca_url}
+ oam_gateway: {get_param: eca_oam_gateway }
+
+ oam2_mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 1]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ oam2_int_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: eca_mgmt_net_name}
+ fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 1]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ oam2_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: oam_volume_size}
+ volume_type: {get_param: ECA_OAM_volume_type}
+
+ oam2_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: oam2_volume}
+ instance_uuid: {get_resource: oam2_instance}
+
+ arb_instance:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: [arb_names, 0]}
+ image: {get_param: oam_image_name}
+ flavor: {get_param: arbiter_flavor}
+ availability_zone: {get_param: availability_zone_0}
+ networks:
+ - port: {get_resource: arb_int_port}
+ - port: {get_resource: arb_mgmt_port}
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ sed -i s/HOSTNAME.*/"HOSTNAME=arb_hostname"/g /etc/sysconfig/network
+ eth1_ip_address='arb_mgt_ip'
+ eth1_gateway='oam_gateway'
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ curl swift_url/etc/puppet/manifests/roles/oam_arbiter.pp > /etc/puppet/manifests/roles/oam_arbiter.pp
+ curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml
+ curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
+ van-role oam_arbiter > /root/startup-van-role.out
+ curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
+ fdisk /dev/vdb < /root/fdisk-keystrokes
+ curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
+ chmod 755 /root/os-conf-cinder-vol
+ /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
+ params:
+ arb_mgt_ip: {get_param: [arb_oam_ips, 0] }
+ arb_hostname: {get_param: [arb_names, 0]}
+ swift_url: {get_param: swift_eca_url}
+ oam_gateway: {get_param: eca_oam_gateway }
+
+ arb_mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [arb_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ arb_int_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: eca_mgmt_net_name}
+ fixed_ips: [{"ip_address": {get_param: [arb_eca_mgmt_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ arb_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: arb_volume_size}
+ volume_type: {get_param: ARB_volume_type}
+ arb_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: arb_volume}
+ instance_uuid: {get_resource: arb_instance}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/nested1.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/nested1.yaml
new file mode 100644
index 0000000000..a0c56d9da7
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/nested1.yaml
@@ -0,0 +1,430 @@
+heat_template_version: 2013-05-23
+
+##########################################################
+#
+# Changes from MSO
+# - Updated per ECOMP Feedback
+#
+#
+##########################################################
+
+description: This stack creates two ECA OAM VM and one ARB VM
+
+parameters:
+ vnf_id:
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-ECA_id
+ cmaui_names:
+ type: comma_delimited_list
+ label: oam servers names
+ description: the names of the OAM1,OAM2 VM instances
+ cmaui_image:
+ type: comma_delimited_list
+ label: oam servers names
+ description: the names of the OAM1,OAM2 VM instances
+ cmaui_flavor:
+ type: comma_delimited_list
+ label: oam servers names
+ description: the names of the OAM1,OAM2 VM instances
+ eca_names:
+ type: comma_delimited_list
+ label: oam servers names
+ description: the names of the OAM1,OAM2 VM instances
+ arb_names:
+ type: comma_delimited_list
+ label: arbiter server names
+ description: the names of the arbiter VM instances
+ oam_image_name:
+ type: string
+ label: image name
+ description: the OAM image name
+ oam_flavor:
+ type: string
+ label: flavor name
+ description: OAM flavor name
+ arbiter_flavor:
+ type: string
+ label: flavor name
+ description: arbiter flavor name
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ oam_net_name:
+ type: string
+ label: oam network name
+ description: the name of the oam network
+ eca_mgmt_net_name:
+ type: string
+ label: internal network name
+ description: the name of the internal network
+ eca_oam_ips:
+ type: comma_delimited_list
+ label: oam network ips
+ description: the ips of oam networks for eca VM
+ eca_eca_mgmt_ips:
+ type: comma_delimited_list
+ label: eca_mgmt network ips for eca VM
+ description: internal eca_mgmt network ips for eca VM
+ arb_oam_ips:
+ type: comma_delimited_list
+ label: oam network ips for arb VM
+ description: oam network ips for eca VM
+ arb_eca_mgmt_ips:
+ type: comma_delimited_list
+ label: eca_mgmt network ips
+ description: internal eca_mgmt network ips for arb VM
+ eca_oam_gateway:
+ type: string
+ label: oam network gateway
+ description: oam network gateway
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ oam_volume_size:
+ type: number
+ label: volume size
+ description: the size of the OAM volume
+ arb_volume_size:
+ type: number
+ label: volume size
+ description: the size of the ARB volume
+ swift_eca_url:
+ type: string
+ label: Swift URL
+ description: Base URL for eca swift object store
+ ECA_OAM_volume_type:
+ type: string
+ label: eca oam vm volume type
+ description: the name of the target volume backend
+ ARB_volume_type:
+ type: string
+ label: arb vm volume type
+ description: the name of the target volume backend
+
+resources:
+ server_cmaui_nested:
+ type: eca_oam_nested.yaml
+ properties:
+ cmaui_name: { get_param: [cmaui_names, 0]}
+ cmaui_image: { get_param: cmaui_image }
+ availability_zone_0: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_0 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ cmaui.mgmt.ip=${cmaui.mgmt.ip}
+ cmaui.mgmt.netmask=${cmaui.mgmt.netmask}
+ cmaui.mgmt.gateway=${cmaui.mgmt.gateway}
+ cmaui.external.dns=${cmaui.external.dns}
+ cmaui.external.ntp=${cmaui.external.ntp}
+ cmaui.node=${cmaui.node}
+ cmaui.timezone=${cmaui.timezone}
+ params:
+ ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]}
+ ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${cmaui.external.dns}: {get_param: external_dns}
+ ${cmaui.external.ntp}: {get_param: external_ntp}
+ ${cmaui.node}: {get_param: [cmaui_names, 0]}
+ ${cmaui.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ oam1_instance:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: [eca_names, 0]}
+ image: {get_param: oam_image_name}
+ flavor: {get_param: oam_flavor}
+ availability_zone: {get_param: availability_zone_0}
+ networks:
+ - port: {get_resource: oam1_int_port}
+ - port: {get_resource: oam1_mgmt_port}
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ sed -i s/HOSTNAME.*/"HOSTNAME=oam1_hostname"/g /etc/sysconfig/network
+ eth1_ip_address='oam1_mgt_ip'
+ eth1_gateway='oam_gateway'
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ mkdir /etc/puppet/files/roles/transcoder
+ mkdir /etc/puppet/files/roles/oam_primary
+ curl swift_url/etc/puppet/manifests/roles/oam_primary.pp > /etc/puppet/manifests/roles/oam_primary.pp
+ curl swift_url/etc/puppet/manifests/roles/transcoder.pp > /etc/puppet/manifests/roles/transcoder.pp
+ curl swift_url/etc/puppet/files/roles/oam_primary/config.yaml > /etc/puppet/files/roles/oam_primary/config.yaml
+ curl swift_url/etc/puppet/files/roles/transcoder/config.yaml > /etc/puppet/files/roles/transcoder/config.yaml
+ curl swift_url/etc/puppet/files/roles/transcoder/hpm.conf > /etc/puppet/files/roles/transcoder/hpm.conf
+ curl swift_url/etc/puppet/files/roles/transcoder/trx.conf > /etc/puppet/files/roles/transcoder/trx.conf
+ curl swift_url/etc/puppet/files/roles/transcoder/plugins-mo.conf > /etc/puppet/files/roles/transcoder/plugins-mo.conf
+ curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
+ curl swift_url/etc/puppet/manifests/site.pp > /etc/puppet/manifests/site.pp
+ curl swift_url/scripts/van-init-replicaset > /usr/sbin/van-init-replicaset
+ van-role oam_primary > /root/startup-van-role.out
+ curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
+ fdisk /dev/vdb < /root/fdisk-keystrokes
+ curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
+ chmod 755 /root/os-conf-cinder-vol
+ /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
+ params:
+ oam1_mgt_ip: {get_param: [eca_oam_ips, 0] }
+ oam_gateway: {get_param: eca_oam_gateway }
+ oam1_hostname: {get_param: [eca_names, 0]}
+ swift_url: {get_param: swift_eca_url}
+
+ oam1_mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ cmaui_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ oam1_int_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: eca_mgmt_net_name}
+ fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ oam1_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: oam_volume_size}
+ volume_type: {get_param: ECA_OAM_volume_type}
+
+ oam1_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: oam1_volume}
+ instance_uuid: {get_resource: oam1_instance}
+
+ oam2_instance:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: [eca_names, 1]}
+ image: {get_param: oam_image_name}
+ flavor: {get_param: oam_flavor}
+ availability_zone: {get_param: availability_zone_0}
+ networks:
+ - port: {get_resource: oam2_int_port}
+ - port: {get_resource: oam2_mgmt_port}
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ sed -i s/HOSTNAME.*/"HOSTNAME=oam2_hostname"/g /etc/sysconfig/network
+ eth1_ip_address='oam2_mgt_ip'
+ eth1_gateway='oam_gateway'
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ curl swift_url/etc/puppet/manifests/roles/oam_secondary.pp > /etc/puppet/manifests/roles/oam_secondary.pp
+ curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml
+ curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
+ van-role oam_secondary > /root/startup-van-role.out
+ curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
+ fdisk /dev/vdb < /root/fdisk-keystrokes
+ curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
+ chmod 755 /root/os-conf-cinder-vol
+ /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
+
+ params:
+ oam2_mgt_ip: {get_param: [eca_oam_ips, 1] }
+ oam2_hostname: {get_param: [eca_names, 1]}
+ swift_url: {get_param: swift_eca_url}
+ oam_gateway: {get_param: eca_oam_gateway }
+
+ oam2_mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 1]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ oam2_int_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: eca_mgmt_net_name}
+ fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 1]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ oam2_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: oam_volume_size}
+ volume_type: {get_param: ECA_OAM_volume_type}
+
+ oam2_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: oam2_volume}
+ instance_uuid: {get_resource: oam2_instance}
+
+ arb_instance:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: [arb_names, 0]}
+ image: {get_param: oam_image_name}
+ flavor: {get_param: arbiter_flavor}
+ availability_zone: {get_param: availability_zone_0}
+ networks:
+ - port: {get_resource: arb_int_port}
+ - port: {get_resource: arb_mgmt_port}
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ sed -i s/HOSTNAME.*/"HOSTNAME=arb_hostname"/g /etc/sysconfig/network
+ eth1_ip_address='arb_mgt_ip'
+ eth1_gateway='oam_gateway'
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ curl swift_url/etc/puppet/manifests/roles/oam_arbiter.pp > /etc/puppet/manifests/roles/oam_arbiter.pp
+ curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml
+ curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
+ van-role oam_arbiter > /root/startup-van-role.out
+ curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
+ fdisk /dev/vdb < /root/fdisk-keystrokes
+ curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
+ chmod 755 /root/os-conf-cinder-vol
+ /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
+ params:
+ arb_mgt_ip: {get_param: [arb_oam_ips, 0] }
+ arb_hostname: {get_param: [arb_names, 0]}
+ swift_url: {get_param: swift_eca_url}
+ oam_gateway: {get_param: eca_oam_gateway }
+
+ arb_mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [arb_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ arb_int_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: eca_mgmt_net_name}
+ fixed_ips: [{"ip_address": {get_param: [arb_eca_mgmt_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ arb_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: arb_volume_size}
+ volume_type: {get_param: ARB_volume_type}
+ arb_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: arb_volume}
+ instance_uuid: {get_resource: arb_instance}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/nested2.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/nested2.yaml
new file mode 100644
index 0000000000..8775ffc72e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/nested2.yaml
@@ -0,0 +1,431 @@
+heat_template_version: 2013-05-23
+
+##########################################################
+#
+# Changes from MSO
+# - Updated per ECOMP Feedback
+#
+#
+##########################################################
+
+description: This stack creates two ECA OAM VM and one ARB VM
+
+parameters:
+ vnf_id:
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-ECA_id
+ cmaui_names:
+ type: comma_delimited_list
+ label: oam servers names
+ description: the names of the OAM1,OAM2 VM instances
+ cmaui_image:
+ type: comma_delimited_list
+ label: oam servers names
+ description: the names of the OAM1,OAM2 VM instances
+ cmaui_flavor:
+ type: comma_delimited_list
+ label: oam servers names
+ description: the names of the OAM1,OAM2 VM instances
+ eca_names:
+ type: comma_delimited_list
+ label: oam servers names
+ description: the names of the OAM1,OAM2 VM instances
+ arb_names:
+ type: comma_delimited_list
+ label: arbiter server names
+ description: the names of the arbiter VM instances
+ oam_image_name:
+ type: string
+ label: image name
+ description: the OAM image name
+ oam_flavor:
+ type: string
+ label: flavor name
+ description: OAM flavor name
+ arbiter_flavor:
+ type: string
+ label: flavor name
+ description: arbiter flavor name
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ oam_net_name:
+ type: string
+ label: oam network name
+ description: the name of the oam network
+ eca_mgmt_net_name:
+ type: string
+ label: internal network name
+ description: the name of the internal network
+ eca_oam_ips:
+ type: comma_delimited_list
+ label: oam network ips
+ description: the ips of oam networks for eca VM
+ eca_eca_mgmt_ips:
+ type: comma_delimited_list
+ label: eca_mgmt network ips for eca VM
+ description: internal eca_mgmt network ips for eca VM
+ arb_oam_ips:
+ type: comma_delimited_list
+ label: oam network ips for arb VM
+ description: oam network ips for eca VM
+ arb_eca_mgmt_ips:
+ type: comma_delimited_list
+ label: eca_mgmt network ips
+ description: internal eca_mgmt network ips for arb VM
+ eca_oam_gateway:
+ type: string
+ label: oam network gateway
+ description: oam network gateway
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ oam_volume_size:
+ type: number
+ label: volume size
+ description: the size of the OAM volume
+ arb_volume_size:
+ type: number
+ label: volume size
+ description: the size of the ARB volume
+ swift_eca_url:
+ type: string
+ label: Swift URL
+ description: Base URL for eca swift object store
+ ECA_OAM_volume_type:
+ type: string
+ label: eca oam vm volume type
+ description: the name of the target volume backend
+ ARB_volume_type:
+ type: string
+ label: arb vm volume type
+ description: the name of the target volume backend
+
+resources:
+ server_cmaui_nested:
+ type: eca_oam_nested.yaml
+ properties:
+ cmaui_name: { get_param: [cmaui_names, 0]}
+ cmaui_image: { get_param: cmaui_image }
+ availability_zone_0: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_0 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ cmaui.mgmt.ip=${cmaui.mgmt.ip}
+ cmaui.mgmt.netmask=${cmaui.mgmt.netmask}
+ cmaui.mgmt.gateway=${cmaui.mgmt.gateway}
+ cmaui.external.dns=${cmaui.external.dns}
+ cmaui.external.ntp=${cmaui.external.ntp}
+ cmaui.node=${cmaui.node}
+ cmaui.timezone=${cmaui.timezone}
+ params:
+ ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]}
+ ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${cmaui.external.dns}: {get_param: external_dns}
+ ${cmaui.external.ntp}: {get_param: external_ntp}
+ ${cmaui.node}: {get_param: [cmaui_names, 0]}
+ ${cmaui.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ oam1_instance:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: [eca_names, 0]}
+ image: {get_param: oam_image_name}
+ flavor: {get_param: oam_flavor}
+ availability_zone: {get_param: availability_zone_0}
+ networks:
+ - port: {get_resource: oam1_int_port}
+ - port: {get_resource: oam1_mgmt_port}
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ sed -i s/HOSTNAME.*/"HOSTNAME=oam1_hostname"/g /etc/sysconfig/network
+ eth1_ip_address='oam1_mgt_ip'
+ eth1_gateway='oam_gateway'
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ mkdir /etc/puppet/files/roles/transcoder
+ mkdir /etc/puppet/files/roles/oam_primary
+ curl swift_url/etc/puppet/manifests/roles/oam_primary.pp > /etc/puppet/manifests/roles/oam_primary.pp
+ curl swift_url/etc/puppet/manifests/roles/transcoder.pp > /etc/puppet/manifests/roles/transcoder.pp
+ curl swift_url/etc/puppet/files/roles/oam_primary/config.yaml > /etc/puppet/files/roles/oam_primary/config.yaml
+ curl swift_url/etc/puppet/files/roles/transcoder/config.yaml > /etc/puppet/files/roles/transcoder/config.yaml
+ curl swift_url/etc/puppet/files/roles/transcoder/hpm.conf > /etc/puppet/files/roles/transcoder/hpm.conf
+ curl swift_url/etc/puppet/files/roles/transcoder/trx.conf > /etc/puppet/files/roles/transcoder/trx.conf
+ curl swift_url/etc/puppet/files/roles/transcoder/plugins-mo.conf > /etc/puppet/files/roles/transcoder/plugins-mo.conf
+ curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
+ curl swift_url/etc/puppet/manifests/site.pp > /etc/puppet/manifests/site.pp
+ curl swift_url/scripts/van-init-replicaset > /usr/sbin/van-init-replicaset
+ van-role oam_primary > /root/startup-van-role.out
+ curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
+ fdisk /dev/vdb < /root/fdisk-keystrokes
+ curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
+ chmod 755 /root/os-conf-cinder-vol
+ /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
+ params:
+ oam1_mgt_ip: {get_param: [eca_oam_ips, 0] }
+ oam_gateway: {get_param: eca_oam_gateway }
+ oam1_hostname: {get_param: [eca_names, 0]}
+ swift_url: {get_param: swift_eca_url}
+
+ oam1_mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+
+ cmaui_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ oam1_int_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: eca_mgmt_net_name}
+ fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ oam1_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: oam_volume_size}
+ volume_type: {get_param: ECA_OAM_volume_type}
+
+ oam1_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: oam1_volume}
+ instance_uuid: {get_resource: oam1_instance}
+
+ oam2_instance:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: [eca_names, 1]}
+ image: {get_param: oam_image_name}
+ flavor: {get_param: oam_flavor}
+ availability_zone: {get_param: availability_zone_0}
+ networks:
+ - port: {get_resource: oam2_int_port}
+ - port: {get_resource: oam2_mgmt_port}
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ sed -i s/HOSTNAME.*/"HOSTNAME=oam2_hostname"/g /etc/sysconfig/network
+ eth1_ip_address='oam2_mgt_ip'
+ eth1_gateway='oam_gateway'
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ curl swift_url/etc/puppet/manifests/roles/oam_secondary.pp > /etc/puppet/manifests/roles/oam_secondary.pp
+ curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml
+ curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
+ van-role oam_secondary > /root/startup-van-role.out
+ curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
+ fdisk /dev/vdb < /root/fdisk-keystrokes
+ curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
+ chmod 755 /root/os-conf-cinder-vol
+ /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
+
+ params:
+ oam2_mgt_ip: {get_param: [eca_oam_ips, 1] }
+ oam2_hostname: {get_param: [eca_names, 1]}
+ swift_url: {get_param: swift_eca_url}
+ oam_gateway: {get_param: eca_oam_gateway }
+
+ oam2_mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 1]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ oam2_int_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: eca_mgmt_net_name}
+ fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 1]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ oam2_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: oam_volume_size}
+ volume_type: {get_param: ECA_OAM_volume_type}
+
+ oam2_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: oam2_volume}
+ instance_uuid: {get_resource: oam2_instance}
+
+ arb_instance:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: [arb_names, 0]}
+ image: {get_param: oam_image_name}
+ flavor: {get_param: arbiter_flavor}
+ availability_zone: {get_param: availability_zone_0}
+ networks:
+ - port: {get_resource: arb_int_port}
+ - port: {get_resource: arb_mgmt_port}
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ sed -i s/HOSTNAME.*/"HOSTNAME=arb_hostname"/g /etc/sysconfig/network
+ eth1_ip_address='arb_mgt_ip'
+ eth1_gateway='oam_gateway'
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ curl swift_url/etc/puppet/manifests/roles/oam_arbiter.pp > /etc/puppet/manifests/roles/oam_arbiter.pp
+ curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml
+ curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
+ van-role oam_arbiter > /root/startup-van-role.out
+ curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
+ fdisk /dev/vdb < /root/fdisk-keystrokes
+ curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
+ chmod 755 /root/os-conf-cinder-vol
+ /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
+ params:
+ arb_mgt_ip: {get_param: [arb_oam_ips, 0] }
+ arb_hostname: {get_param: [arb_names, 0]}
+ swift_url: {get_param: swift_eca_url}
+ oam_gateway: {get_param: eca_oam_gateway }
+
+ arb_mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [arb_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ arb_int_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: eca_mgmt_net_name}
+ fixed_ips: [{"ip_address": {get_param: [arb_eca_mgmt_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ arb_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: arb_volume_size}
+ volume_type: {get_param: ARB_volume_type}
+ arb_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: arb_volume}
+ instance_uuid: {get_resource: arb_instance}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/network_out.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/network_out.env
new file mode 100644
index 0000000000..8012063ac0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/network_out.env
@@ -0,0 +1,7 @@
+parameters:
+ eca_mgmt_name: int_eca_mgmt_net_1
+ eca_mgmt_cidr: 172.25.137.192/26
+ eca_mgmt_netmask: 255.255.255.192
+ eca_mgmt_start: 172.25.137.195
+ eca_mgmt_end: 172.25.137.254
+ security_group_name: mmsc_security_group_1
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/sg_eca_mgmt.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/sg_eca_mgmt.env
new file mode 100644
index 0000000000..8012063ac0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/sg_eca_mgmt.env
@@ -0,0 +1,7 @@
+parameters:
+ eca_mgmt_name: int_eca_mgmt_net_1
+ eca_mgmt_cidr: 172.25.137.192/26
+ eca_mgmt_netmask: 255.255.255.192
+ eca_mgmt_start: 172.25.137.195
+ eca_mgmt_end: 172.25.137.254
+ security_group_name: mmsc_security_group_1
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/volume.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/volume.env
new file mode 100644
index 0000000000..8012063ac0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/volume.env
@@ -0,0 +1,7 @@
+parameters:
+ eca_mgmt_name: int_eca_mgmt_net_1
+ eca_mgmt_cidr: 172.25.137.192/26
+ eca_mgmt_netmask: 255.255.255.192
+ eca_mgmt_start: 172.25.137.195
+ eca_mgmt_end: 172.25.137.254
+ security_group_name: mmsc_security_group_1
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/volume_out.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/volume_out.env
new file mode 100644
index 0000000000..8012063ac0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/volume_out.env
@@ -0,0 +1,7 @@
+parameters:
+ eca_mgmt_name: int_eca_mgmt_net_1
+ eca_mgmt_cidr: 172.25.137.192/26
+ eca_mgmt_netmask: 255.255.255.192
+ eca_mgmt_start: 172.25.137.195
+ eca_mgmt_end: 172.25.137.254
+ security_group_name: mmsc_security_group_1
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/expectedOutput/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/expectedOutput/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..5aa6e2e213
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/expectedOutput/MainServiceTemplate.yaml
@@ -0,0 +1,4518 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.nems_be:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.lb:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.eca:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.arb:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.eca_trx:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.cmaui:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.nems_fe:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.mmsc:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ lb_flavor_name:
+ label: Load balancer flavor name
+ hidden: false
+ immutable: false
+ type: string
+ description: the flavor name of MMSC load balancer instance
+ default: m1.xlarge
+ ha_net_local_ip2:
+ label: ha net network local ip2
+ hidden: false
+ immutable: false
+ type: string
+ description: the local ip2 of the ha network
+ default: 172.26.1.4
+ mmsc_dmz_protected_snat_ips:
+ label: mmsc dmz_protected snat ips
+ hidden: false
+ immutable: false
+ type: list
+ description: mmsc dmz_protected snat ips
+ default:
+ - 107.239.14.24
+ - 107.239.14.25
+ - 107.239.14.26
+ - 107.239.14.27
+ entry_schema:
+ type: string
+ ha_net_local_ip1:
+ label: ha net network local ip1
+ hidden: false
+ immutable: false
+ type: string
+ description: the local ip1 of the ha network
+ default: 172.26.1.3
+ mms_traffic_end:
+ label: mmsc traffic end IP
+ hidden: false
+ immutable: false
+ type: string
+ description: mmsc traffic end IP
+ default: 172.26.2.254
+ nems_traffic_end:
+ label: nems traffic end
+ hidden: false
+ immutable: false
+ type: string
+ description: nems traffic end
+ default: 172.26.3.254
+ mmsc_cinder_volume_size:
+ label: MMSC Cinder volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: the size of the MMSC Cinder volume
+ default: 480
+ nems_internal_cidr:
+ label: nems ineternal cidr
+ hidden: false
+ immutable: false
+ type: string
+ description: nems internal cidr
+ default: 172.26.6.0/24
+ eca_mgmt_cidr:
+ label: eca management cidr
+ hidden: false
+ immutable: false
+ type: string
+ description: eca management cidr
+ default: 172.25.137.192/26
+ nems_traffic_start:
+ label: nems traffic start
+ hidden: false
+ immutable: false
+ type: string
+ description: nems traffic start
+ default: 172.26.3.3
+ oam_volume_size:
+ label: volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: the size of the OAM volume
+ default: 1800
+ eca_trx_names:
+ label: ECA_TRX server names
+ hidden: false
+ immutable: false
+ type: list
+ description: ECA_TRX server names
+ default:
+ - ZRDM1MMSC03TRX001
+ - ZRDM1MMSC03TRX002
+ - ZRDM1MMSC03TRX003
+ - ZRDM1MMSC03TRX004
+ - ZRDM1MMSC03TRX005
+ - ZRDM1MMSC03TRX006
+ - ZRDM1MMSC03TRX007
+ - ZRDM1MMSC03TRX008
+ - ZRDM1MMSC03TRX009
+ - ZRDM1MMSC03TRX010
+ - ZRDM1MMSC03TRX011
+ - ZRDM1MMSC03TRX012
+ - ZRDM1MMSC03TRX013
+ - ZRDM1MMSC03TRX014
+ - ZRDM1MMSC03TRX015
+ - ZRDM1MMSC03TRX016
+ - ZRDM1MMSC03TRX017
+ - ZRDM1MMSC03TRX018
+ - ZRDM1MMSC03TRX019
+ - ZRDM1MMSC03TRX020
+ entry_schema:
+ type: string
+ nems_internal_name:
+ label: nems internal network name
+ hidden: false
+ immutable: false
+ type: string
+ description: nems internal network name
+ default: int_mms_nems_internal_net_2
+ nems_traffic_net_local_ip1:
+ label: nems traffic network local ip1
+ hidden: false
+ immutable: false
+ type: string
+ description: the local ip1 of the nems traffic network
+ default: 172.26.3.3
+ nems_traffic_net_local_ip2:
+ label: nems traffic network local ip2
+ hidden: false
+ immutable: false
+ type: string
+ description: the local ip2 of the nems traffic network
+ default: 172.26.3.4
+ nems_fe_names:
+ label: NEMS_FE server names
+ hidden: false
+ immutable: false
+ type: list
+ description: NEMS_FE server names
+ default:
+ - ZRDM1MMSC03NFE001
+ - ZRDM1MMSC03NFE002
+ entry_schema:
+ type: string
+ eca_names:
+ label: oam servers names
+ hidden: false
+ immutable: false
+ type: list
+ description: the names of the OAM1,OAM2 VM instances
+ default:
+ - ZRDM1MMSC02OAM001
+ - ZRDM1MMSC02OAM002
+ entry_schema:
+ type: string
+ nems_be_nems_imap_net_ips:
+ label: nems imap_net IPs for NEMS_BE
+ hidden: false
+ immutable: false
+ type: string
+ description: nems imap net IPs for NEMS_BE
+ default: 172.26.7.13
+ nems_be_names:
+ label: NEMS_BE server names
+ hidden: false
+ immutable: false
+ type: string
+ description: NEMS_BE server names
+ default: ZRDM1MMSC03NBE001
+ nems_traffic_netmask:
+ label: NEMS traffic network subnet mask
+ hidden: false
+ immutable: false
+ type: string
+ description: NEMS traffic network subnet mask
+ default: 255.255.255.0
+ nems_fe_nems_imap_net_ips:
+ label: nems_imap_net IPs for NEMS_FE
+ hidden: false
+ immutable: false
+ type: list
+ description: nems_imap_net IPs for NEMS_FE
+ default:
+ - 172.26.7.11
+ - 172.26.7.12
+ entry_schema:
+ type: string
+ nems_fe_nems_user_web_net_ips:
+ label: nems_web_user_net IPs for NEMS_FE
+ hidden: false
+ immutable: false
+ type: list
+ description: nems_web_user_net IPs for NEMS_FE
+ default:
+ - 172.26.4.11
+ - 172.26.4.12
+ entry_schema:
+ type: string
+ nems_user_web_gateway:
+ label: NEMS user web network gateway
+ hidden: false
+ immutable: false
+ type: string
+ description: NEMS user web network gateway
+ default: 172.26.4.1
+ nems_imap_end:
+ label: nems imap end
+ hidden: false
+ immutable: false
+ type: string
+ description: nems imap end
+ default: 172.26.7.254
+ eca_traffic_net_local_ip1:
+ label: eca traffic network local ip1
+ hidden: false
+ immutable: false
+ type: string
+ description: the local ip1 of the eca traffic network
+ default: 172.26.5.3
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ default: cmaui-5.0.2.5_v25
+ eca_traffic_net_local_ip2:
+ label: eca traffic network local ip2
+ hidden: false
+ immutable: false
+ type: string
+ description: the local ip2 of the eca traffic network
+ default: 172.26.5.4
+ nems_volume_size:
+ label: nems fe volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: nems fe volume size
+ default: 50
+ mms_traffic_start:
+ label: mmsc traffic start IP
+ hidden: false
+ immutable: false
+ type: string
+ description: mmsc traffic start IP
+ default: 172.26.2.3
+ ha_net_start:
+ label: ha net start
+ hidden: false
+ immutable: false
+ type: string
+ description: ha net start
+ default: 172.26.1.3
+ nems_imap_gateway:
+ label: nems imap gateway
+ hidden: false
+ immutable: false
+ type: string
+ description: nems imap gateway
+ default: 172.26.7.1
+ mmsc_core_virtual_server_ips:
+ label: mmsc core virtual server ips
+ hidden: false
+ immutable: false
+ type: list
+ description: mmsc core virtual server ips
+ default:
+ - 172.31.10.21
+ - 172.31.10.22
+ entry_schema:
+ type: string
+ cmaui_oam_ips:
+ label: CMAUI oam_net IP addresses
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI oam_net IP addresses
+ default:
+ - 107.250.172.42
+ - 107.250.172.43
+ entry_schema:
+ type: string
+ CMAUI_volume_type:
+ label: CMAUI vm volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the target volume backend
+ default: Platinum
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ default:
+ - ZRDM1MMSC02CMI001
+ - ZRDM1MMSC02CMI002
+ entry_schema:
+ type: string
+ eca_trx_eca_traffic_net_ips:
+ label: eca traffic net IPs for ECA_TRX
+ hidden: false
+ immutable: false
+ type: list
+ description: eca traffic net IPs for ECA_TRX
+ default:
+ - 172.26.5.11
+ - 172.26.5.12
+ - 172.26.5.13
+ - 172.26.5.14
+ - 172.26.5.15
+ - 172.26.5.16
+ - 172.26.5.17
+ - 172.26.5.18
+ - 172.26.5.19
+ - 172.26.5.20
+ - 172.26.5.21
+ - 172.26.5.22
+ - 172.26.5.23
+ - 172.26.5.24
+ - 172.26.5.25
+ - 172.26.5.26
+ - 172.26.5.27
+ - 172.26.5.28
+ - 172.26.5.29
+ - 172.26.5.30
+ entry_schema:
+ type: string
+ eca_trx_image:
+ label: Image for ECA TRX server
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for ECA TRX server
+ default: ECABASE
+ lb_names:
+ label: MMSC load balancer instance names
+ hidden: false
+ immutable: false
+ type: list
+ description: MMSC load balancer instance names
+ default:
+ - ZRDM1MMSC03ALB001
+ - ZRDM1MMSC03ALB002
+ entry_schema:
+ type: string
+ eca_mgmt_end:
+ label: eca management end
+ hidden: false
+ immutable: false
+ type: string
+ description: eca management end
+ default: 172.25.137.254
+ nems_user_web_end:
+ label: nems user web end
+ hidden: false
+ immutable: false
+ type: string
+ description: nems user web end
+ default: 172.26.4.254
+ ECA_OAM_volume_type:
+ label: eca oam vm volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the target volume backend
+ default: Platinum
+ arb_eca_mgmt_ips:
+ label: eca_mgmt network ips
+ hidden: false
+ immutable: false
+ type: list
+ description: internal eca_mgmt network ips for arb VM
+ default:
+ - 172.25.137.244
+ entry_schema:
+ type: string
+ eca_traffic_cidr:
+ label: eca traffic cidr
+ hidden: false
+ immutable: false
+ type: string
+ description: eca traffic cidr
+ default: 172.26.5.0/24
+ ha_net_cidr:
+ label: ha net cidr
+ hidden: false
+ immutable: false
+ type: string
+ description: ha net cidr
+ default: 172.26.1.0/24
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ default: nova
+ ARB_volume_type:
+ label: arb vm volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the target volume backend
+ default: Platinum
+ nems_fe_nems_internal_net_ips:
+ label: nems_internal_net IPs for NEMS_FE
+ hidden: false
+ immutable: false
+ type: list
+ description: nems_internal_net IPs for NEMS_FE
+ default:
+ - 172.26.6.11
+ - 172.26.6.12
+ entry_schema:
+ type: string
+ NEMS_FE_volume_type:
+ label: nems fe vm volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the target volume backend
+ default: Platinum
+ security_group_name:
+ label: security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of security group
+ default: mmsc_security_group_1
+ nems_fe_nems_traffic_net_ips:
+ label: nems_traffic_net IPs for NEMS_FE
+ hidden: false
+ immutable: false
+ type: list
+ description: nems_traffic_net IPs for NEMS_FE
+ default:
+ - 172.26.3.11
+ - 172.26.3.12
+ entry_schema:
+ type: string
+ nems_imap_start:
+ label: nems imap start
+ hidden: false
+ immutable: false
+ type: string
+ description: nems imap start
+ default: 172.26.7.3
+ ha_net_name:
+ label: ha_failover network name
+ hidden: false
+ immutable: false
+ type: string
+ description: ha_failover network name
+ default: int_mms_ha_net_2
+ arb_names:
+ label: arbiter server names
+ hidden: false
+ immutable: false
+ type: list
+ description: the names of the arbiter VM instances
+ default:
+ - ZRDM1MMSC02ARB001
+ entry_schema:
+ type: string
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ default: m1.large
+ eca_oam_gateway:
+ label: oam1 oam gateway
+ hidden: false
+ immutable: false
+ type: string
+ description: the ip of oam gateway
+ default: 107.250.172.1
+ eca_traffic_start:
+ label: eca traffic start
+ hidden: false
+ immutable: false
+ type: string
+ description: eca traffic start
+ default: 172.26.5.3
+ NEMS_BE_volume_type:
+ label: nems be vm volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the target volume backend
+ default: Platinum
+ lb_image_name:
+ label: MMSC load balancer image name
+ hidden: false
+ immutable: false
+ type: string
+ description: MMSC load balancer image name
+ default: BIGIP-11.5.3.0.0.163
+ nems_internal_start:
+ label: nems internal start
+ hidden: false
+ immutable: false
+ type: string
+ description: nems internal start
+ default: 172.26.6.3
+ nems_internal_gateway:
+ label: nems internal gw
+ hidden: false
+ immutable: false
+ type: string
+ description: nems internal gw
+ default: 172.26.6.1
+ arb_oam_ips:
+ label: oam network ips for arb VM
+ hidden: false
+ immutable: false
+ type: list
+ description: oam network ips for eca VM
+ default:
+ - 107.250.172.46
+ entry_schema:
+ type: string
+ dmz_protected_net_name:
+ label: UID of dmz_protected network
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of dmz_protected network
+ default: dmz_protected_net_0
+ nems_be_volume_size:
+ label: nems be volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: nems be volume size
+ default: 610
+ mms_traffic_netmask:
+ label: MMS traffic network subnet mask
+ hidden: false
+ immutable: false
+ type: string
+ description: MMS traffic network subnet mask
+ default: 255.255.255.0
+ nems_be_image:
+ label: Image for NEMS BE server
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for NEMS BE server
+ default: nems-2.1.2_v29
+ nems_user_web_net_local_ip1:
+ label: nems user web network local ip1
+ hidden: false
+ immutable: false
+ type: string
+ description: the local ip1 of the nems user web network
+ default: 172.26.4.3
+ eca_trx_mgmt_ips:
+ label: eca mgmt net IP for ECA_TRX
+ hidden: false
+ immutable: false
+ type: list
+ description: eca mgmt net IP for ECA_TRX
+ default:
+ - 172.25.137.202
+ - 172.25.137.203
+ - 172.25.137.204
+ - 172.25.137.205
+ - 172.25.137.206
+ - 172.25.137.207
+ - 172.25.137.208
+ - 172.25.137.209
+ - 172.25.137.210
+ - 172.25.137.211
+ - 172.25.137.212
+ - 172.25.137.213
+ - 172.25.137.214
+ - 172.25.137.215
+ - 172.25.137.216
+ - 172.25.137.217
+ - 172.25.137.218
+ - 172.25.137.219
+ - 172.25.137.220
+ - 172.25.137.221
+ entry_schema:
+ type: string
+ nems_user_web_cidr:
+ label: nems user web cidr
+ hidden: false
+ immutable: false
+ type: string
+ description: nems user web cidr
+ default: 172.26.4.0/24
+ nems_user_web_net_local_ip2:
+ label: nems user web network local ip2
+ hidden: false
+ immutable: false
+ type: string
+ description: the local ip2 of the nems user web network
+ default: 172.26.4.4
+ nems_traffic_gateway:
+ label: NEMS traffic network gateway
+ hidden: false
+ immutable: false
+ type: string
+ description: NEMS traffic network gateway
+ default: 172.26.3.1
+ nems_imap_name:
+ label: nems imap name
+ hidden: false
+ immutable: false
+ type: string
+ description: nems imap name
+ default: int_mms_nems_imap_net_2
+ mms_traffic_net_floating_ip:
+ label: mmsc traffic floating ip
+ hidden: false
+ immutable: false
+ type: string
+ description: mmsc traffic floating ip
+ default: 172.26.2.5
+ nems_internal_netmask:
+ label: NEMS internal network subnet mask
+ hidden: false
+ immutable: false
+ type: string
+ description: NEMS internal network subnet mask
+ default: 255.255.255.0
+ nems_user_web_netmask:
+ label: NEMS user web network subnet mask
+ hidden: false
+ immutable: false
+ type: string
+ description: NEMS user web network subnet mask
+ default: 255.255.255.0
+ mms_traffic_net_local_ip1:
+ label: mmsc traffic network local ip1
+ hidden: false
+ immutable: false
+ type: string
+ description: the local ip1 of the mmsc traffic network
+ default: 172.26.2.3
+ mms_traffic_net_local_ip2:
+ label: mmsc traffic network local ip2
+ hidden: false
+ immutable: false
+ type: string
+ description: the local ip2 of the mmsc traffic network
+ default: 172.26.2.4
+ oam_image_name:
+ label: image name
+ hidden: false
+ immutable: false
+ type: string
+ description: the OAM image name
+ default: ECABASE
+ oam_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ default: oam_protected_net_0
+ external_ntp:
+ label: ntp server
+ hidden: false
+ immutable: false
+ type: string
+ description: ntp server
+ default: 155.165.194.100
+ mms_traffic_net_cidr:
+ label: MMS traffic network address (CIDR notation)
+ hidden: false
+ immutable: false
+ type: string
+ description: MMS traffic network address (CIDR notation)
+ default: 172.26.2.0/24
+ lb_dmz_protected_ips:
+ label: dmz protected network local ips for lb VM
+ hidden: false
+ immutable: false
+ type: list
+ description: local ips of the dmz protected network for lb VM
+ default:
+ - 107.239.14.19
+ - 107.239.14.20
+ entry_schema:
+ type: string
+ eca_mgmt_start:
+ label: eca management start
+ hidden: false
+ immutable: false
+ type: string
+ description: eca management start
+ default: 172.25.137.195
+ eca_oam_ips:
+ label: oam network ips
+ hidden: false
+ immutable: false
+ type: list
+ description: the ips of oam networks for eca VM
+ default:
+ - 107.250.172.44
+ - 107.250.172.45
+ entry_schema:
+ type: string
+ MMSC_volume_type:
+ label: MMSC vm volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the target volume backend
+ default: Platinum
+ nems_fe_flavor:
+ label: Flavor for NEMS FE server
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for NEMS FE server
+ default: m1.large2
+ eca_mgmt_netmask:
+ label: ECA mgmt network subnet mask
+ hidden: false
+ immutable: false
+ type: string
+ description: ECA mgmt network subnet mask
+ default: 255.255.255.192
+ oam_network_netmask:
+ label: oam network netmask
+ hidden: false
+ immutable: false
+ type: string
+ description: oam network gateway
+ default: 255.255.255.192
+ oam_network_route_1:
+ label: oam network route 1
+ hidden: false
+ immutable: false
+ type: string
+ description: oam network route 1
+ default: 155.165.201.250/32,107.250.172.1
+ oam_network_route_2:
+ label: oam network route 2
+ hidden: false
+ immutable: false
+ type: string
+ description: oam network route 2
+ default: 155.165.194.100/32,107.250.172.1
+ mms_traffic_net_name:
+ label: Name of MMS traffic network
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of MMS traffic network
+ default: int_mms_mms_traffic_net_2
+ nems_user_web_name:
+ label: nems user web name
+ hidden: false
+ immutable: false
+ type: string
+ description: nems user web name
+ default: int_mms_nems_web_net_2
+ eca_traffic_net_floating_ip:
+ label: eca traffic floating ip
+ hidden: false
+ immutable: false
+ type: string
+ description: eca traffic floating ip
+ default: 172.26.5.5
+ eca_traffic_end:
+ label: eca traffic end
+ hidden: false
+ immutable: false
+ type: string
+ description: eca traffic end
+ default: 172.26.5.254
+ eca_trx_flavor:
+ label: Flavor for ECA TRX server
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for ECA TRX server
+ default: m1.xlarge
+ lb_oam_ips:
+ label: management network ips for mmsc lb
+ hidden: false
+ immutable: false
+ type: list
+ description: the ips of the management network for mmsc lb
+ default:
+ - 107.250.172.50
+ - 107.250.172.51
+ entry_schema:
+ type: string
+ nems_fe_oam_ips:
+ label: OAM_net IP for NEMS_FE
+ hidden: false
+ immutable: false
+ type: list
+ description: OAM_net IP for NEMS_FE
+ default:
+ - 107.250.172.64
+ - 107.250.172.65
+ entry_schema:
+ type: string
+ nems_be_flavor:
+ label: Flavor for NEMS BE server
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for NEMS BE server
+ default: m1.large2
+ lb_cor_direct_ips:
+ label: cor direct network local ips for lb VM
+ hidden: false
+ immutable: false
+ type: list
+ description: local ips of cor direct network for lb VM
+ default:
+ - 172.31.10.19
+ - 172.31.10.20
+ entry_schema:
+ type: string
+ nems_traffic_name:
+ label: nems traffic name
+ hidden: false
+ immutable: false
+ type: string
+ description: nems traffic name
+ default: int_mms_nems_traffic_net_2
+ timezone:
+ label: timezone
+ hidden: false
+ immutable: false
+ type: string
+ description: timezone
+ default: UTC
+ oam_flavor:
+ label: flavor name
+ hidden: false
+ immutable: false
+ type: string
+ description: OAM flavor name
+ default: lc.xlarge4
+ cmaui_cinder_volume_size:
+ label: CMAUI Cinder volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: the size of the CMAUI Cinder volume
+ default: 55
+ nems_user_web_start:
+ label: nems user web start
+ hidden: false
+ immutable: false
+ type: string
+ description: nems user web end
+ default: 172.26.4.3
+ eca_eca_mgmt_ips:
+ label: eca_mgmt network ips for eca VM
+ hidden: false
+ immutable: false
+ type: list
+ description: internal eca_mgmt network ips for eca VM
+ default:
+ - 172.25.137.242
+ - 172.25.137.243
+ entry_schema:
+ type: string
+ mmsc_names:
+ label: MMSC server names
+ hidden: false
+ immutable: false
+ type: list
+ description: MMSC server names
+ default:
+ - ZRDM1MMSC03MMS001
+ - ZRDM1MMSC03MMS002
+ - ZRDM1MMSC03MMS003
+ - ZRDM1MMSC03MMS004
+ - ZRDM1MMSC03MMS005
+ entry_schema:
+ type: string
+ eca_mgmt_net_name:
+ label: internal network name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the internal network
+ default: int_mms_eca_mgmt_net_1
+ eca_traffic_name:
+ label: eca traffic name
+ hidden: false
+ immutable: false
+ type: string
+ description: eca traffic name
+ default: int_mms_eca_traffic_net_2
+ nems_internal_end:
+ label: nems internal end
+ hidden: false
+ immutable: false
+ type: string
+ description: nems internal end
+ default: 172.26.6.254
+ nems_be_nems_internal_net_ips:
+ label: nems internal net IPs for NEMS_BE
+ hidden: false
+ immutable: false
+ type: string
+ description: nems internal net IPs for NEMS_BE
+ default: 172.26.6.13
+ arb_volume_size:
+ label: volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: the size of the ARB volume
+ default: 40
+ mmsc_dmz_protected_virtual_server_ips:
+ label: mmsc dmz_protected virtual server ips
+ hidden: false
+ immutable: false
+ type: list
+ description: mmsc dmz_protected virtual server ips
+ default:
+ - 107.239.14.21
+ - 107.239.14.22
+ - 107.239.14.23
+ entry_schema:
+ type: string
+ cor_direct_net_name:
+ label: cor direct net UID
+ hidden: false
+ immutable: false
+ type: string
+ description: cor direct net
+ default: cor_direct_net_0
+ vnf_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-CMAUI_id
+ oam_network_gateway:
+ label: oam network gateway
+ hidden: false
+ immutable: false
+ type: string
+ description: oam network gateway
+ default: 10.20.30.1
+ mmsc_flavor:
+ label: Flavor for MMSC server
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for MMSC server
+ default: lc.4xlarge4
+ ha_net_end:
+ label: ha net end
+ hidden: false
+ immutable: false
+ type: string
+ description: ha net end
+ default: 172.26.1.254
+ nems_imap_netmask:
+ label: nems imap subnet mask
+ hidden: false
+ immutable: false
+ type: string
+ description: nems imap subnet mask
+ default: 255.255.255.0
+ external_dns:
+ label: dns server
+ hidden: false
+ immutable: false
+ type: string
+ description: dns server
+ default: 155.165.201.250
+ swift_eca_url:
+ label: Swift URL
+ hidden: false
+ immutable: false
+ type: string
+ description: Base URL for eca swift object store
+ default: http://object-store.rdm2.cci.com:8080/v1/AUTH_1bbab536a19b4756926e7d0ec1eb543c/eca
+ eca_traffic_net_gateway:
+ label: eca_traffic network gateway
+ hidden: false
+ immutable: false
+ type: string
+ description: eca_traffic network gateway
+ default: 172.26.5.1
+ nems_be_oam_ips:
+ label: OAM net IPs for NEMS_BE
+ hidden: false
+ immutable: false
+ type: string
+ description: OAM net IPs for NEMS_BE
+ default: 107.250.172.66
+ eca_trx_oam_ips:
+ label: OAM net IP for ECA_TRX
+ hidden: false
+ immutable: false
+ type: list
+ description: OAM net IP for ECA_TRX
+ default:
+ - 107.250.172.70
+ - 107.250.172.71
+ - 107.250.172.72
+ - 107.250.172.73
+ - 107.250.172.74
+ - 107.250.172.75
+ - 107.250.172.76
+ - 107.250.172.77
+ - 107.250.172.78
+ - 107.250.172.79
+ - 107.250.172.80
+ - 107.250.172.81
+ - 107.250.172.82
+ - 107.250.172.83
+ - 107.250.172.84
+ - 107.250.172.85
+ - 107.250.172.86
+ - 107.250.172.87
+ - 107.250.172.88
+ - 107.250.172.89
+ entry_schema:
+ type: string
+ mmsc_image:
+ label: Image for MMSC server
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for MMSC server
+ default: mmsc-6.0.2_v5
+ arbiter_flavor:
+ label: flavor name
+ hidden: false
+ immutable: false
+ type: string
+ description: arbiter flavor name
+ default: m1.large2
+ nems_imap_cidr:
+ label: nems imap cidr
+ hidden: false
+ immutable: false
+ type: string
+ description: nems imap cidr
+ default: 172.26.7.0/24
+ eca_traffic_netmask:
+ label: ECA traffic network subnet mask
+ hidden: false
+ immutable: false
+ type: string
+ description: ECA traffic network subnet mask
+ default: 255.255.255.0
+ nems_fe_node_roles:
+ label: nems fe node roles
+ hidden: false
+ immutable: false
+ type: list
+ description: nems fe node roles
+ default:
+ - FE0
+ - FE1
+ entry_schema:
+ type: string
+ mmsc_mms_traffic_net_ips:
+ label: MMSC mms_traffic_net IP addresses
+ hidden: false
+ immutable: false
+ type: list
+ description: MMSC mms_traffic_net IP addresses
+ default:
+ - 172.26.2.11
+ - 172.26.2.12
+ - 172.26.2.13
+ - 172.26.2.14
+ - 172.26.2.15
+ entry_schema:
+ type: string
+ nems_traffic_net_floating_ip:
+ label: nems traffic floating ip
+ hidden: false
+ immutable: false
+ type: string
+ description: nems traffic floating ip
+ default: 172.26.3.5
+ mms_traffic_net_gateway:
+ label: MMS traffic network gateway address
+ hidden: false
+ immutable: false
+ type: string
+ description: MMS traffic network gateway address
+ default: 172.26.2.1
+ nems_fe_image:
+ label: Image for NEMS FE server
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for NEMS FE server
+ default: nems-2.1.2_v29
+ mmsc_oam_ips:
+ label: MMSC oam_net IP addresses
+ hidden: false
+ immutable: false
+ type: list
+ description: MMSC oam_net IP addresses
+ default:
+ - 107.250.172.54
+ - 107.250.172.55
+ - 107.250.172.56
+ - 107.250.172.57
+ - 107.250.172.58
+ entry_schema:
+ type: string
+ eca_mgmt_name:
+ label: eca management name
+ hidden: false
+ immutable: false
+ type: string
+ description: eca management name
+ default: int_eca_mgmt_net_1
+ nems_traffic_cidr:
+ label: nems traffic cidr
+ hidden: false
+ immutable: false
+ type: string
+ description: nems traffic cidr
+ default: 172.26.3.0/24
+ nems_be_node_roles:
+ label: nems node roles
+ hidden: false
+ immutable: false
+ type: string
+ description: nems node roles
+ default: BE0
+ mmsc_core_snat_ips:
+ label: mmsc core snat ips
+ hidden: false
+ immutable: false
+ type: list
+ description: mmsc core snat ips
+ default:
+ - 172.31.10.23
+ - 172.31.10.24
+ - 172.31.10.25
+ - 172.31.10.26
+ - 172.31.10.27
+ entry_schema:
+ type: string
+ nems_user_web_net_floating_ip:
+ label: nems user web floating ip
+ hidden: false
+ immutable: false
+ type: string
+ description: nems user web floating ip
+ default: 172.26.4.5
+ node_templates:
+ server_eca_trx9:
+ type: org.openecomp.resource.vfc.nodes.heat.eca_trx
+ properties:
+ flavor:
+ get_input: eca_trx_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: eca_trx_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_trx_names
+ - 8
+ server_eca_trx8:
+ type: org.openecomp.resource.vfc.nodes.heat.eca_trx
+ properties:
+ flavor:
+ get_input: eca_trx_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: eca_trx_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_trx_names
+ - 7
+ server_eca_trx7:
+ type: org.openecomp.resource.vfc.nodes.heat.eca_trx
+ properties:
+ flavor:
+ get_input: eca_trx_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: eca_trx_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_trx_names
+ - 6
+ server_eca_trx6:
+ type: org.openecomp.resource.vfc.nodes.heat.eca_trx
+ properties:
+ flavor:
+ get_input: eca_trx_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: eca_trx_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_trx_names
+ - 5
+ arb_instance:
+ type: org.openecomp.resource.vfc.nodes.heat.arb
+ properties:
+ flavor:
+ get_input: arbiter_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: oam_image_name
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - arb_names
+ - 0
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: arb_volume
+ relationship: arb_volume_attachment
+ server_eca_trx5:
+ type: org.openecomp.resource.vfc.nodes.heat.eca_trx
+ properties:
+ flavor:
+ get_input: eca_trx_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: eca_trx_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_trx_names
+ - 4
+ nems_internal_net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ network_name:
+ get_input: nems_internal_name
+ subnets:
+ nems_internal_network_ip_subnet:
+ name:
+ get_input: nems_internal_name
+ cidr:
+ get_input: nems_internal_cidr
+ allocation_pools:
+ - start:
+ get_input: nems_internal_start
+ end:
+ get_input: nems_internal_end
+ server_eca_trx4:
+ type: org.openecomp.resource.vfc.nodes.heat.eca_trx
+ properties:
+ flavor:
+ get_input: eca_trx_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: eca_trx_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_trx_names
+ - 3
+ server_eca_trx3:
+ type: org.openecomp.resource.vfc.nodes.heat.eca_trx
+ properties:
+ flavor:
+ get_input: eca_trx_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: eca_trx_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_trx_names
+ - 2
+ server_eca_trx2:
+ type: org.openecomp.resource.vfc.nodes.heat.eca_trx
+ properties:
+ flavor:
+ get_input: eca_trx_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: eca_trx_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_trx_names
+ - 1
+ lb1_mgmt_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - lb_oam_ips
+ - 0
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: lb1_instance
+ relationship: tosca.relationships.network.BindsTo
+ lb2_mms_traffic_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: mms_traffic_net_local_ip2
+ allowed_address_pairs:
+ - ip_address:
+ get_input: mms_traffic_net_floating_ip
+ network: mms_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: mms_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: lb2_instance
+ relationship: tosca.relationships.network.BindsTo
+ nems_fe1_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - nems_fe_nems_traffic_net_ips
+ - 0
+ network: nems_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: nems_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_nems_fe1
+ relationship: tosca.relationships.network.BindsTo
+ nems_fe2_port_3:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - nems_fe_nems_internal_net_ips
+ - 1
+ network: nems_internal_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: nems_internal_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_nems_fe2
+ relationship: tosca.relationships.network.BindsTo
+ server_eca_trx1:
+ type: org.openecomp.resource.vfc.nodes.heat.eca_trx
+ properties:
+ flavor:
+ get_input: eca_trx_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: eca_trx_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_trx_names
+ - 0
+ nems_fe1_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - nems_fe_nems_user_web_net_ips
+ - 0
+ network: nems_user_web_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: nems_user_web_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_nems_fe1
+ relationship: tosca.relationships.network.BindsTo
+ nems_fe2_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - nems_fe_nems_user_web_net_ips
+ - 1
+ network: nems_user_web_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: nems_user_web_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_nems_fe2
+ relationship: tosca.relationships.network.BindsTo
+ nems_fe2_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - nems_fe_nems_traffic_net_ips
+ - 1
+ network: nems_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: nems_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_nems_fe2
+ relationship: tosca.relationships.network.BindsTo
+ nems_fe1_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - nems_fe_oam_ips
+ - 0
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_nems_fe1
+ relationship: tosca.relationships.network.BindsTo
+ nems_fe2_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - nems_fe_oam_ips
+ - 1
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_nems_fe2
+ relationship: tosca.relationships.network.BindsTo
+ nems_fe1_port_3:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - nems_fe_nems_internal_net_ips
+ - 0
+ network: nems_internal_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: nems_internal_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_nems_fe1
+ relationship: tosca.relationships.network.BindsTo
+ nems_fe1_port_4:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - nems_fe_nems_imap_net_ips
+ - 0
+ network: nems_imap_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: nems_imap_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_nems_fe1
+ relationship: tosca.relationships.network.BindsTo
+ nems_fe2_port_4:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - nems_fe_nems_imap_net_ips
+ - 1
+ network: nems_imap_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: nems_imap_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_nems_fe2
+ relationship: tosca.relationships.network.BindsTo
+ mms_security_group:
+ type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules
+ properties:
+ name:
+ get_input: security_group_name
+ description: mmsc security group
+ rules:
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ mmsc4_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: MMSC_volume_type
+ size: '(get_input : mmsc_cinder_volume_size) * 1024'
+ lb2_eca_traffic_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: eca_traffic_net_local_ip2
+ allowed_address_pairs:
+ - ip_address:
+ get_input: eca_traffic_net_floating_ip
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: lb2_instance
+ relationship: tosca.relationships.network.BindsTo
+ lb2_ha_net_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: ha_net_local_ip2
+ network: ha_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: ha_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: lb2_instance
+ relationship: tosca.relationships.network.BindsTo
+ oam2_mgmt_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_oam_ips
+ - 1
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: oam2_instance
+ relationship: tosca.relationships.network.BindsTo
+ nems_user_web_net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ network_name:
+ get_input: nems_user_web_name
+ subnets:
+ nems_user_web_network_ip_subnet:
+ name:
+ get_input: nems_user_web_name
+ cidr:
+ get_input: nems_user_web_cidr
+ allocation_pools:
+ - start:
+ get_input: nems_user_web_start
+ end:
+ get_input: nems_user_web_end
+ lb1_ha_net_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: ha_net_local_ip1
+ network: ha_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: ha_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: lb1_instance
+ relationship: tosca.relationships.network.BindsTo
+ mmsc2_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: MMSC_volume_type
+ size: '(get_input : mmsc_cinder_volume_size) * 1024'
+ cmaui1_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: CMAUI_volume_type
+ size: '(get_input : cmaui_cinder_volume_size) * 1024'
+ nems_traffic_net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ network_name:
+ get_input: nems_traffic_name
+ subnets:
+ nems_traffic_network_ip_subnet:
+ name:
+ get_input: nems_traffic_name
+ cidr:
+ get_input: nems_traffic_cidr
+ allocation_pools:
+ - start:
+ get_input: nems_traffic_start
+ end:
+ get_input: nems_traffic_end
+ eca_trx16_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_oam_ips
+ - 15
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx16
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx19_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_eca_traffic_net_ips
+ - 18
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx19
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx16_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_mgmt_ips
+ - 15
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx16
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx19_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_mgmt_ips
+ - 18
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx19
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx15_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_oam_ips
+ - 14
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx15
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx19_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_oam_ips
+ - 18
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx19
+ relationship: tosca.relationships.network.BindsTo
+ lb1_nems_traffic_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: nems_traffic_net_local_ip1
+ allowed_address_pairs:
+ - ip_address:
+ get_input: nems_traffic_net_floating_ip
+ network: nems_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: nems_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: lb1_instance
+ relationship: tosca.relationships.network.BindsTo
+ oam2_instance:
+ type: org.openecomp.resource.vfc.nodes.heat.eca
+ properties:
+ flavor:
+ get_input: oam_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: oam_image_name
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_names
+ - 1
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: oam2_volume
+ relationship: oam2_volume_attachment
+ eca_trx11_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_mgmt_ips
+ - 10
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx11
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx11_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_eca_traffic_net_ips
+ - 10
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx11
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx12_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_eca_traffic_net_ips
+ - 11
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx12
+ relationship: tosca.relationships.network.BindsTo
+ arb_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: ARB_volume_type
+ size: '(get_input : arb_volume_size) * 1024'
+ eca_trx12_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_mgmt_ips
+ - 11
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx12
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx11_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_oam_ips
+ - 10
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx11
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx12_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_oam_ips
+ - 11
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx12
+ relationship: tosca.relationships.network.BindsTo
+ mmsc4_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - mmsc_oam_ips
+ - 3
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_mmsc4
+ relationship: tosca.relationships.network.BindsTo
+ cmaui1_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 1
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui1
+ relationship: tosca.relationships.network.BindsTo
+ mmsc3_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - mmsc_oam_ips
+ - 2
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_mmsc3
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx15_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_eca_traffic_net_ips
+ - 14
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx15
+ relationship: tosca.relationships.network.BindsTo
+ mmsc3_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - mmsc_mms_traffic_net_ips
+ - 2
+ network: mms_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: mms_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_mmsc3
+ relationship: tosca.relationships.network.BindsTo
+ mmsc4_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - mmsc_mms_traffic_net_ips
+ - 3
+ network: mms_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: mms_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_mmsc4
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx15_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_mgmt_ips
+ - 14
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx15
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx16_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_eca_traffic_net_ips
+ - 15
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx16
+ relationship: tosca.relationships.network.BindsTo
+ arb_mgmt_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - arb_oam_ips
+ - 0
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: arb_instance
+ relationship: tosca.relationships.network.BindsTo
+ lb2_mgmt_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - lb_oam_ips
+ - 1
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: lb2_instance
+ relationship: tosca.relationships.network.BindsTo
+ mmsc5_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: MMSC_volume_type
+ size: '(get_input : mmsc_cinder_volume_size) * 1024'
+ eca_trx7_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_eca_traffic_net_ips
+ - 6
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx7
+ relationship: tosca.relationships.network.BindsTo
+ oam1_mgmt_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_oam_ips
+ - 0
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: oam1_instance
+ relationship: tosca.relationships.network.BindsTo
+ server_cmaui:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ user_data_format: RAW
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: cmaui_volume
+ relationship: cmaui_volume_attachment
+ eca_trx7_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_oam_ips
+ - 6
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx7
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx7_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_mgmt_ips
+ - 6
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx7
+ relationship: tosca.relationships.network.BindsTo
+ cmaui_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: CMAUI_volume_type
+ size: '(get_input : cmaui_cinder_volume_size) * 1024'
+ eca_trx3_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_mgmt_ips
+ - 2
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx3
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx3_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_oam_ips
+ - 2
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx3
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx3_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_eca_traffic_net_ips
+ - 2
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx3
+ relationship: tosca.relationships.network.BindsTo
+ mmsc1_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: MMSC_volume_type
+ size: '(get_input : mmsc_cinder_volume_size) * 1024'
+ nems_imap_net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ network_name:
+ get_input: nems_imap_name
+ subnets:
+ nems_imap_network_ip_subnet:
+ name:
+ get_input: nems_imap_name
+ cidr:
+ get_input: nems_imap_cidr
+ allocation_pools:
+ - start:
+ get_input: nems_imap_start
+ end:
+ get_input: nems_imap_end
+ server_cmaui1:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ user_data_format: RAW
+ name:
+ get_input:
+ - cmaui_names
+ - 1
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: cmaui1_volume
+ relationship: cmaui1_volume_attachment
+ lb2_dmz_protected_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - lb_dmz_protected_ips
+ - 1
+ allowed_address_pairs:
+ - ip_address:
+ get_input:
+ - mmsc_dmz_protected_virtual_server_ips
+ - 0
+ - ip_address:
+ get_input:
+ - mmsc_dmz_protected_virtual_server_ips
+ - 1
+ - ip_address:
+ get_input:
+ - mmsc_dmz_protected_virtual_server_ips
+ - 2
+ - ip_address:
+ get_input:
+ - mmsc_dmz_protected_snat_ips
+ - 0
+ - ip_address:
+ get_input:
+ - mmsc_dmz_protected_snat_ips
+ - 1
+ - ip_address:
+ get_input:
+ - mmsc_dmz_protected_snat_ips
+ - 2
+ - ip_address:
+ get_input:
+ - mmsc_dmz_protected_snat_ips
+ - 3
+ network:
+ get_input: dmz_protected_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: lb2_instance
+ relationship: tosca.relationships.network.BindsTo
+ lb1_eca_traffic_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: eca_traffic_net_local_ip1
+ allowed_address_pairs:
+ - ip_address:
+ get_input: eca_traffic_net_floating_ip
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: lb1_instance
+ relationship: tosca.relationships.network.BindsTo
+ lb1_dmz_protected_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - lb_dmz_protected_ips
+ - 0
+ allowed_address_pairs:
+ - ip_address:
+ get_input:
+ - mmsc_dmz_protected_virtual_server_ips
+ - 0
+ - ip_address:
+ get_input:
+ - mmsc_dmz_protected_virtual_server_ips
+ - 1
+ - ip_address:
+ get_input:
+ - mmsc_dmz_protected_virtual_server_ips
+ - 2
+ - ip_address:
+ get_input:
+ - mmsc_dmz_protected_snat_ips
+ - 0
+ - ip_address:
+ get_input:
+ - mmsc_dmz_protected_snat_ips
+ - 1
+ - ip_address:
+ get_input:
+ - mmsc_dmz_protected_snat_ips
+ - 2
+ - ip_address:
+ get_input:
+ - mmsc_dmz_protected_snat_ips
+ - 3
+ network:
+ get_input: dmz_protected_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: lb1_instance
+ relationship: tosca.relationships.network.BindsTo
+ lb1_mms_traffic_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: mms_traffic_net_local_ip1
+ allowed_address_pairs:
+ - ip_address:
+ get_input: mms_traffic_net_floating_ip
+ network: mms_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: mms_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: lb1_instance
+ relationship: tosca.relationships.network.BindsTo
+ eca_mgmt_net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ network_name:
+ get_input: eca_mgmt_name
+ subnets:
+ eca_mgmt_network_ip_subnet:
+ name:
+ get_input: eca_mgmt_name
+ cidr:
+ get_input: eca_mgmt_cidr
+ allocation_pools:
+ - start:
+ get_input: eca_mgmt_start
+ end:
+ get_input: eca_mgmt_end
+ eca_trx1_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_eca_traffic_net_ips
+ - 0
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx1
+ relationship: tosca.relationships.network.BindsTo
+ nems2_fe_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: NEMS_FE_volume_type
+ size: '(get_input : nems_volume_size) * 1024'
+ server_nems_be1:
+ type: org.openecomp.resource.vfc.nodes.heat.nems_be
+ properties:
+ flavor:
+ get_input: nems_be_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: nems_be_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ user_data_format: RAW
+ name:
+ get_input: nems_be_names
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: nems_be_volume
+ relationship: nems_volume_attachment
+ server_nems_fe1:
+ type: org.openecomp.resource.vfc.nodes.heat.nems_fe
+ properties:
+ flavor:
+ get_input: nems_fe_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: nems_fe_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ user_data_format: RAW
+ name:
+ get_input:
+ - nems_fe_names
+ - 0
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: nems1_fe_volume
+ relationship: nems1_fe_volume_attachment
+ oam2_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: ECA_OAM_volume_type
+ size: '(get_input : oam_volume_size) * 1024'
+ server_nems_fe2:
+ type: org.openecomp.resource.vfc.nodes.heat.nems_fe
+ properties:
+ flavor:
+ get_input: nems_fe_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: nems_fe_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ user_data_format: RAW
+ name:
+ get_input:
+ - nems_fe_names
+ - 1
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: nems2_fe_volume
+ relationship: nems2_fe_volume_attachment
+ oam1_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: ECA_OAM_volume_type
+ size: '(get_input : oam_volume_size) * 1024'
+ lb2_cor_direct_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - lb_cor_direct_ips
+ - 1
+ allowed_address_pairs:
+ - ip_address:
+ get_input:
+ - mmsc_core_virtual_server_ips
+ - 0
+ - ip_address:
+ get_input:
+ - mmsc_core_virtual_server_ips
+ - 1
+ - ip_address:
+ get_input:
+ - mmsc_core_snat_ips
+ - 0
+ - ip_address:
+ get_input:
+ - mmsc_core_snat_ips
+ - 1
+ - ip_address:
+ get_input:
+ - mmsc_core_snat_ips
+ - 2
+ - ip_address:
+ get_input:
+ - mmsc_core_snat_ips
+ - 3
+ - ip_address:
+ get_input:
+ - mmsc_core_snat_ips
+ - 4
+ network:
+ get_input: cor_direct_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: lb2_instance
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx20_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_oam_ips
+ - 19
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx20
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx20_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_eca_traffic_net_ips
+ - 19
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx20
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx20_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_mgmt_ips
+ - 19
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx20
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx8_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_oam_ips
+ - 7
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx8
+ relationship: tosca.relationships.network.BindsTo
+ oam1_int_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_eca_mgmt_ips
+ - 0
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: oam1_instance
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx6_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_oam_ips
+ - 5
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx6
+ relationship: tosca.relationships.network.BindsTo
+ lb2_nems_user_web_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: nems_user_web_net_local_ip2
+ allowed_address_pairs:
+ - ip_address:
+ get_input: nems_user_web_net_floating_ip
+ network: nems_user_web_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: nems_user_web_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: lb2_instance
+ relationship: tosca.relationships.network.BindsTo
+ lb2_instance:
+ type: org.openecomp.resource.vfc.nodes.heat.lb
+ properties:
+ flavor:
+ get_input: lb_flavor_name
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: lb_image_name
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - lb_names
+ - 1
+ eca_trx6_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_eca_traffic_net_ips
+ - 5
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx6
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx8_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_eca_traffic_net_ips
+ - 7
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx8
+ relationship: tosca.relationships.network.BindsTo
+ lb1_nems_user_web_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: nems_user_web_net_local_ip1
+ allowed_address_pairs:
+ - ip_address:
+ get_input: nems_user_web_net_floating_ip
+ network: nems_user_web_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: nems_user_web_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: lb1_instance
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx6_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_mgmt_ips
+ - 5
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx6
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx8_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_mgmt_ips
+ - 7
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx8
+ relationship: tosca.relationships.network.BindsTo
+ arb_int_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - arb_eca_mgmt_ips
+ - 0
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: arb_instance
+ relationship: tosca.relationships.network.BindsTo
+ ha_net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ network_name:
+ get_input: ha_net_name
+ subnets:
+ ha_net_ip_subnet:
+ name:
+ get_input: ha_net_name
+ cidr:
+ get_input: ha_net_cidr
+ allocation_pools:
+ - start:
+ get_input: ha_net_start
+ end:
+ get_input: ha_net_end
+ server_mmsc1:
+ type: org.openecomp.resource.vfc.nodes.heat.mmsc
+ properties:
+ flavor:
+ get_input: mmsc_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: mmsc_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ user_data_format: RAW
+ name:
+ get_input:
+ - mmsc_names
+ - 0
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: mmsc1_volume
+ relationship: mmsc1_volume_attachment
+ nems_be1_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: nems_be_oam_ips
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_nems_be1
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx2_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_oam_ips
+ - 1
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx2
+ relationship: tosca.relationships.network.BindsTo
+ server_mmsc2:
+ type: org.openecomp.resource.vfc.nodes.heat.mmsc
+ properties:
+ flavor:
+ get_input: mmsc_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: mmsc_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ user_data_format: RAW
+ name:
+ get_input:
+ - mmsc_names
+ - 1
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: mmsc2_volume
+ relationship: mmsc2_volume_attachment
+ nems_be1_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: nems_be_nems_internal_net_ips
+ network: nems_internal_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: nems_internal_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_nems_be1
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx2_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_mgmt_ips
+ - 1
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx2
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx4_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_mgmt_ips
+ - 3
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx4
+ relationship: tosca.relationships.network.BindsTo
+ server_mmsc3:
+ type: org.openecomp.resource.vfc.nodes.heat.mmsc
+ properties:
+ flavor:
+ get_input: mmsc_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: mmsc_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ user_data_format: RAW
+ name:
+ get_input:
+ - mmsc_names
+ - 2
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: mmsc3_volume
+ relationship: mmsc3_volume_attachment
+ nems_be1_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: nems_be_nems_imap_net_ips
+ network: nems_imap_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: nems_imap_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_nems_be1
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx2_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_eca_traffic_net_ips
+ - 1
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx2
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx4_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_eca_traffic_net_ips
+ - 3
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx4
+ relationship: tosca.relationships.network.BindsTo
+ server_eca_trx20:
+ type: org.openecomp.resource.vfc.nodes.heat.eca_trx
+ properties:
+ flavor:
+ get_input: eca_trx_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: eca_trx_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_trx_names
+ - 19
+ eca_trx4_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_oam_ips
+ - 3
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx4
+ relationship: tosca.relationships.network.BindsTo
+ nems_be_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: NEMS_BE_volume_type
+ size: '(get_input : nems_be_volume_size) * 1024'
+ server_mmsc4:
+ type: org.openecomp.resource.vfc.nodes.heat.mmsc
+ properties:
+ flavor:
+ get_input: mmsc_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: mmsc_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ user_data_format: RAW
+ name:
+ get_input:
+ - mmsc_names
+ - 3
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: mmsc4_volume
+ relationship: mmsc4_volume_attachment
+ server_mmsc5:
+ type: org.openecomp.resource.vfc.nodes.heat.mmsc
+ properties:
+ flavor:
+ get_input: mmsc_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: mmsc_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ user_data_format: RAW
+ name:
+ get_input:
+ - mmsc_names
+ - 4
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: mmsc5_volume
+ relationship: mmsc5_volume_attachment
+ oam2_int_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_eca_mgmt_ips
+ - 1
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: oam2_instance
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx17_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_oam_ips
+ - 16
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx17
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx18_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_eca_traffic_net_ips
+ - 17
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx18
+ relationship: tosca.relationships.network.BindsTo
+ lb1_cor_direct_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - lb_cor_direct_ips
+ - 0
+ allowed_address_pairs:
+ - ip_address:
+ get_input:
+ - mmsc_core_virtual_server_ips
+ - 0
+ - ip_address:
+ get_input:
+ - mmsc_core_virtual_server_ips
+ - 1
+ - ip_address:
+ get_input:
+ - mmsc_core_snat_ips
+ - 0
+ - ip_address:
+ get_input:
+ - mmsc_core_snat_ips
+ - 1
+ - ip_address:
+ get_input:
+ - mmsc_core_snat_ips
+ - 2
+ - ip_address:
+ get_input:
+ - mmsc_core_snat_ips
+ - 3
+ - ip_address:
+ get_input:
+ - mmsc_core_snat_ips
+ - 4
+ network:
+ get_input: cor_direct_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: lb1_instance
+ relationship: tosca.relationships.network.BindsTo
+ mmsc1_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - mmsc_oam_ips
+ - 0
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_mmsc1
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx17_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_eca_traffic_net_ips
+ - 16
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx17
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx18_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_oam_ips
+ - 17
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx18
+ relationship: tosca.relationships.network.BindsTo
+ mmsc1_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - mmsc_mms_traffic_net_ips
+ - 0
+ network: mms_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: mms_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_mmsc1
+ relationship: tosca.relationships.network.BindsTo
+ mmsc2_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - mmsc_mms_traffic_net_ips
+ - 1
+ network: mms_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: mms_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_mmsc2
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx17_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_mgmt_ips
+ - 16
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx17
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx18_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_mgmt_ips
+ - 17
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx18
+ relationship: tosca.relationships.network.BindsTo
+ mms_traffic_net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ network_name:
+ get_input: mms_traffic_net_name
+ subnets:
+ mms_traffic_ip_subnet:
+ name:
+ get_input: mms_traffic_net_name
+ cidr:
+ get_input: mms_traffic_net_cidr
+ allocation_pools:
+ - start:
+ get_input: mms_traffic_start
+ end:
+ get_input: mms_traffic_end
+ cmaui_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx10_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_mgmt_ips
+ - 9
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx10
+ relationship: tosca.relationships.network.BindsTo
+ server_eca_trx13:
+ type: org.openecomp.resource.vfc.nodes.heat.eca_trx
+ properties:
+ flavor:
+ get_input: eca_trx_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: eca_trx_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_trx_names
+ - 12
+ lb1_instance:
+ type: org.openecomp.resource.vfc.nodes.heat.lb
+ properties:
+ flavor:
+ get_input: lb_flavor_name
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: lb_image_name
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - lb_names
+ - 0
+ eca_trx10_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_oam_ips
+ - 9
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx10
+ relationship: tosca.relationships.network.BindsTo
+ server_eca_trx14:
+ type: org.openecomp.resource.vfc.nodes.heat.eca_trx
+ properties:
+ flavor:
+ get_input: eca_trx_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: eca_trx_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_trx_names
+ - 13
+ server_eca_trx15:
+ type: org.openecomp.resource.vfc.nodes.heat.eca_trx
+ properties:
+ flavor:
+ get_input: eca_trx_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: eca_trx_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_trx_names
+ - 14
+ nems1_fe_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: NEMS_FE_volume_type
+ size: '(get_input : nems_volume_size) * 1024'
+ eca_trx10_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_eca_traffic_net_ips
+ - 9
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx10
+ relationship: tosca.relationships.network.BindsTo
+ server_eca_trx16:
+ type: org.openecomp.resource.vfc.nodes.heat.eca_trx
+ properties:
+ flavor:
+ get_input: eca_trx_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: eca_trx_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_trx_names
+ - 15
+ server_eca_trx10:
+ type: org.openecomp.resource.vfc.nodes.heat.eca_trx
+ properties:
+ flavor:
+ get_input: eca_trx_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: eca_trx_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_trx_names
+ - 9
+ server_eca_trx11:
+ type: org.openecomp.resource.vfc.nodes.heat.eca_trx
+ properties:
+ flavor:
+ get_input: eca_trx_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: eca_trx_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_trx_names
+ - 10
+ server_eca_trx12:
+ type: org.openecomp.resource.vfc.nodes.heat.eca_trx
+ properties:
+ flavor:
+ get_input: eca_trx_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: eca_trx_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_trx_names
+ - 11
+ eca_trx14_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_mgmt_ips
+ - 13
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx14
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx13_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_oam_ips
+ - 12
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx13
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx14_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_oam_ips
+ - 13
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx14
+ relationship: tosca.relationships.network.BindsTo
+ mmsc5_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - mmsc_mms_traffic_net_ips
+ - 4
+ network: mms_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: mms_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_mmsc5
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx13_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_mgmt_ips
+ - 12
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx13
+ relationship: tosca.relationships.network.BindsTo
+ mmsc5_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - mmsc_oam_ips
+ - 4
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_mmsc5
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx13_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_eca_traffic_net_ips
+ - 12
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx13
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx14_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_eca_traffic_net_ips
+ - 13
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx14
+ relationship: tosca.relationships.network.BindsTo
+ mmsc2_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - mmsc_oam_ips
+ - 1
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_mmsc2
+ relationship: tosca.relationships.network.BindsTo
+ server_eca_trx17:
+ type: org.openecomp.resource.vfc.nodes.heat.eca_trx
+ properties:
+ flavor:
+ get_input: eca_trx_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: eca_trx_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_trx_names
+ - 16
+ server_eca_trx18:
+ type: org.openecomp.resource.vfc.nodes.heat.eca_trx
+ properties:
+ flavor:
+ get_input: eca_trx_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: eca_trx_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_trx_names
+ - 17
+ server_eca_trx19:
+ type: org.openecomp.resource.vfc.nodes.heat.eca_trx
+ properties:
+ flavor:
+ get_input: eca_trx_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: eca_trx_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_trx_names
+ - 18
+ eca_trx9_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_oam_ips
+ - 8
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx9
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx9_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_mgmt_ips
+ - 8
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx9
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx9_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_eca_traffic_net_ips
+ - 8
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx9
+ relationship: tosca.relationships.network.BindsTo
+ lb2_nems_traffic_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: nems_traffic_net_local_ip2
+ allowed_address_pairs:
+ - ip_address:
+ get_input: nems_traffic_net_floating_ip
+ network: nems_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: nems_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: lb2_instance
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx5_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_eca_traffic_net_ips
+ - 4
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx5
+ relationship: tosca.relationships.network.BindsTo
+ eca_traffic_net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ network_name:
+ get_input: eca_traffic_name
+ subnets:
+ eca_traffic_ip_subnet:
+ name:
+ get_input: eca_traffic_name
+ cidr:
+ get_input: eca_traffic_cidr
+ allocation_pools:
+ - start:
+ get_input: eca_traffic_start
+ end:
+ get_input: eca_traffic_end
+ eca_trx1_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_mgmt_ips
+ - 0
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx1
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx5_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_mgmt_ips
+ - 4
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx5
+ relationship: tosca.relationships.network.BindsTo
+ oam1_instance:
+ type: org.openecomp.resource.vfc.nodes.heat.eca
+ properties:
+ flavor:
+ get_input: oam_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: oam_image_name
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_names
+ - 0
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: oam1_volume
+ relationship: oam1_volume_attachment
+ eca_trx1_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_oam_ips
+ - 0
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx1
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx5_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_oam_ips
+ - 4
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx5
+ relationship: tosca.relationships.network.BindsTo
+ mmsc3_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: MMSC_volume_type
+ size: '(get_input : mmsc_cinder_volume_size) * 1024'
+ relationship_templates:
+ mmsc1_volume_attachment:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id: mmsc1_volume
+ instance_uuid: server_mmsc1
+ mmsc4_volume_attachment:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id: mmsc4_volume
+ instance_uuid: server_mmsc4
+ arb_volume_attachment:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id: arb_volume
+ instance_uuid: arb_instance
+ cmaui_volume_attachment:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id: cmaui_volume
+ instance_uuid: server_cmaui
+ nems1_fe_volume_attachment:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id: nems1_fe_volume
+ instance_uuid: server_nems_fe1
+ mmsc3_volume_attachment:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id: mmsc3_volume
+ instance_uuid: server_mmsc3
+ oam2_volume_attachment:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id: oam2_volume
+ instance_uuid: oam2_instance
+ cmaui1_volume_attachment:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id: cmaui1_volume
+ instance_uuid: server_cmaui1
+ nems_volume_attachment:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id: nems_be_volume
+ instance_uuid: server_nems_be1
+ oam1_volume_attachment:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id: oam1_volume
+ instance_uuid: oam1_instance
+ nems2_fe_volume_attachment:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id: nems2_fe_volume
+ instance_uuid: server_nems_fe2
+ mmsc5_volume_attachment:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id: mmsc5_volume
+ instance_uuid: server_mmsc5
+ mmsc2_volume_attachment:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id: mmsc2_volume
+ instance_uuid: server_mmsc2
+ groups:
+ MMSC_Capacity_Line:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/MMSC_Capacity_Line.yml
+ description: |
+ HOT template that creates internal networks, load balancers and servers for vMMSC capacity Line 1. #11/23: updated the network definition to meet the juniper best practices way of defining the gateway, DHCP enable for internal networks (L457-L547)
+ members:
+ - server_eca_trx9
+ - server_eca_trx8
+ - server_eca_trx7
+ - server_eca_trx6
+ - server_eca_trx5
+ - nems_internal_net
+ - server_eca_trx4
+ - server_eca_trx3
+ - server_eca_trx2
+ - lb1_mgmt_port
+ - lb2_mms_traffic_port
+ - nems_fe1_port_1
+ - nems_fe2_port_3
+ - server_eca_trx1
+ - nems_fe1_port_2
+ - nems_fe2_port_2
+ - nems_fe2_port_1
+ - nems_fe1_port_0
+ - nems_fe2_port_0
+ - nems_fe1_port_3
+ - nems_fe1_port_4
+ - nems_fe2_port_4
+ - mmsc4_volume
+ - lb2_eca_traffic_port
+ - lb2_ha_net_port
+ - nems_user_web_net
+ - lb1_ha_net_port
+ - mmsc2_volume
+ - nems_traffic_net
+ - eca_trx16_port_0
+ - eca_trx19_port_2
+ - eca_trx16_port_1
+ - eca_trx19_port_1
+ - eca_trx15_port_0
+ - eca_trx19_port_0
+ - lb1_nems_traffic_port
+ - eca_trx11_port_1
+ - eca_trx11_port_2
+ - eca_trx12_port_2
+ - eca_trx12_port_1
+ - eca_trx11_port_0
+ - eca_trx12_port_0
+ - mmsc4_port_0
+ - mmsc3_port_0
+ - eca_trx15_port_2
+ - mmsc3_port_1
+ - mmsc4_port_1
+ - eca_trx15_port_1
+ - eca_trx16_port_2
+ - lb2_mgmt_port
+ - mmsc5_volume
+ - eca_trx7_port_2
+ - eca_trx7_port_0
+ - eca_trx7_port_1
+ - eca_trx3_port_1
+ - eca_trx3_port_0
+ - eca_trx3_port_2
+ - mmsc1_volume
+ - nems_imap_net
+ - lb2_dmz_protected_port
+ - lb1_eca_traffic_port
+ - lb1_dmz_protected_port
+ - lb1_mms_traffic_port
+ - eca_trx1_port_2
+ - nems2_fe_volume
+ - server_nems_be1
+ - server_nems_fe1
+ - server_nems_fe2
+ - lb2_cor_direct_port
+ - eca_trx20_port_0
+ - eca_trx20_port_2
+ - eca_trx20_port_1
+ - eca_trx8_port_0
+ - eca_trx6_port_0
+ - lb2_nems_user_web_port
+ - lb2_instance
+ - eca_trx6_port_2
+ - eca_trx8_port_2
+ - lb1_nems_user_web_port
+ - eca_trx6_port_1
+ - eca_trx8_port_1
+ - ha_net
+ - server_mmsc1
+ - nems_be1_port_0
+ - eca_trx2_port_0
+ - server_mmsc2
+ - nems_be1_port_1
+ - eca_trx2_port_1
+ - eca_trx4_port_1
+ - server_mmsc3
+ - nems_be1_port_2
+ - eca_trx2_port_2
+ - eca_trx4_port_2
+ - server_eca_trx20
+ - eca_trx4_port_0
+ - nems_be_volume
+ - server_mmsc4
+ - server_mmsc5
+ - eca_trx17_port_0
+ - eca_trx18_port_2
+ - lb1_cor_direct_port
+ - mmsc1_port_0
+ - eca_trx17_port_2
+ - eca_trx18_port_0
+ - mmsc1_port_1
+ - mmsc2_port_1
+ - eca_trx17_port_1
+ - eca_trx18_port_1
+ - mms_traffic_net
+ - eca_trx10_port_1
+ - server_eca_trx13
+ - lb1_instance
+ - eca_trx10_port_0
+ - server_eca_trx14
+ - server_eca_trx15
+ - nems1_fe_volume
+ - eca_trx10_port_2
+ - server_eca_trx16
+ - server_eca_trx10
+ - server_eca_trx11
+ - server_eca_trx12
+ - eca_trx14_port_1
+ - eca_trx13_port_0
+ - eca_trx14_port_0
+ - mmsc5_port_1
+ - eca_trx13_port_1
+ - mmsc5_port_0
+ - eca_trx13_port_2
+ - eca_trx14_port_2
+ - mmsc2_port_0
+ - server_eca_trx17
+ - server_eca_trx18
+ - server_eca_trx19
+ - eca_trx9_port_0
+ - eca_trx9_port_1
+ - eca_trx9_port_2
+ - lb2_nems_traffic_port
+ - eca_trx5_port_2
+ - eca_traffic_net
+ - eca_trx1_port_1
+ - eca_trx5_port_1
+ - eca_trx1_port_0
+ - eca_trx5_port_0
+ - mmsc3_volume
+ eca_oam:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/eca_oam.yaml
+ description: This stack creates two ECA OAM VM and one ARB VM
+ members:
+ - arb_mgmt_port
+ - oam2_mgmt_port
+ - arb_instance
+ - arb_volume
+ - oam1_instance
+ - oam2_volume
+ - oam1_volume
+ - oam1_int_port
+ - oam1_mgmt_port
+ - arb_int_port
+ - oam2_int_port
+ - oam2_instance
+ SG_ECA_MGMT:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/SG_ECA_MGMT.yaml
+ description: |
+ HOT template that creates Security Group and ECA network
+ members:
+ - mms_security_group
+ - eca_mgmt_net
+ cmaui:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/cmaui.yml
+ description: cmaui server template for vMMSC
+ members:
+ - server_cmaui1
+ - server_cmaui
+ - cmaui1_port_0
+ - cmaui_volume
+ - cmaui1_volume
+ - cmaui_port_0 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/MANIFEST.json
new file mode 100644
index 0000000000..167ae4e9d8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/MANIFEST.json
@@ -0,0 +1,37 @@
+{
+ "name": "multiple_not_nested",
+ "description": "multiple heat files in zip, no nesting",
+ "version": "2013-05-23",
+ "data": [{
+ "file": "cmaui.yml",
+ "type": "HEAT",
+ "data": [{
+ "file": "cmaui.env",
+ "type": "HEAT_ENV"
+ }]
+ },
+ {
+ "file": "eca_oam.yaml",
+ "type": "HEAT",
+ "data": [{
+ "file": "eca_oam.env",
+ "type": "HEAT_ENV"
+ }]
+ },
+ {
+ "file": "MMSC_Capacity_Line.yml",
+ "type": "HEAT",
+ "data": [{
+ "file": "MMSC_Capacity_Line_1.env",
+ "type": "HEAT_ENV"
+ }]
+ },
+ {
+ "file": "SG_ECA_MGMT.yaml",
+ "type": "HEAT",
+ "data": [{
+ "file": "sg_eca_mgmt.env",
+ "type": "HEAT_ENV"
+ }]
+ }]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/MMSC_Capacity_Line.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/MMSC_Capacity_Line.yml
new file mode 100644
index 0000000000..9e36eb9cd4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/MMSC_Capacity_Line.yml
@@ -0,0 +1,3219 @@
+heat_template_version: 2013-05-23
+
+description: >
+ HOT template that creates internal networks, load balancers and servers for vMMSC capacity Line 1.
+ #11/23: updated the network definition to meet the juniper best practices way of defining the gateway, DHCP enable for internal networks (L457-L547)
+
+parameters:
+ vnf_id:
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_the_MMSC_id
+ oam_net_name:
+ type: string
+ label: UID of OAM network
+ description: UID of OAM network
+ oam_network_netmask:
+ type: string
+ label: oam network netmask
+ description: oam network gateway
+ oam_network_gateway:
+ type: string
+ label: oam network gateway
+ description: oam network gateway
+ oam_network_route_1:
+ type: string
+ label: oam network route 1
+ description: oam network route 1
+ oam_network_route_2:
+ type: string
+ label: oam network route 2
+ description: oam network route 2
+ external_dns:
+ type: string
+ label: dns server
+ description: dns server for MMSC
+ external_ntp:
+ type: string
+ label: ntp server
+ description: ntp server for MMSC
+ lb_oam_ips:
+ type: comma_delimited_list
+ label: management network ips for mmsc lb
+ description: the ips of the management network for mmsc lb
+ dmz_protected_net_name:
+ type: string
+ label: UID of dmz_protected network
+ description: UID of dmz_protected network
+ lb_dmz_protected_ips:
+ type: comma_delimited_list
+ label: dmz protected network local ips for lb VM
+ description: local ips of the dmz protected network for lb VM
+ cor_direct_net_name:
+ type: string
+ label: cor direct net UID
+ description: cor direct net
+ lb_cor_direct_ips:
+ type: comma_delimited_list
+ label: cor direct network local ips for lb VM
+ description: local ips of cor direct network for lb VM
+ mms_traffic_net_name:
+ type: string
+ label: Name of MMS traffic network
+ description: Name of MMS traffic network
+ mms_traffic_net_cidr:
+ type: string
+ label: MMS traffic network address (CIDR notation)
+ description: MMS traffic network address (CIDR notation)
+ mms_traffic_netmask:
+ type: string
+ label: MMS traffic network subnet mask
+ description: MMS traffic network subnet mask
+ mms_traffic_net_gateway:
+ type: string
+ label: MMS traffic network gateway address
+ description: MMS traffic network gateway address
+ mms_traffic_start:
+ type: string
+ label: mmsc traffic start IP
+ description: mmsc traffic start IP
+ mms_traffic_end:
+ type: string
+ label: mmsc traffic end IP
+ description: mmsc traffic end IP
+ mms_traffic_net_local_ip1:
+ type: string
+ label: mmsc traffic network local ip1
+ description: the local ip1 of the mmsc traffic network
+ mms_traffic_net_local_ip2:
+ type: string
+ label: mmsc traffic network local ip2
+ description: the local ip2 of the mmsc traffic network
+ mms_traffic_net_floating_ip:
+ type: string
+ label: mmsc traffic floating ip
+ description: mmsc traffic floating ip
+ nems_internal_name:
+ type: string
+ label: nems internal network name
+ description: nems internal network name
+ nems_internal_start:
+ type: string
+ label: nems internal start
+ description: nems internal start
+ nems_internal_end:
+ type: string
+ label: nems internal end
+ description: nems internal end
+ nems_internal_cidr:
+ type: string
+ label: nems ineternal cidr
+ description: nems internal cidr
+ nems_internal_netmask:
+ type: string
+ label: NEMS internal network subnet mask
+ description: NEMS internal network subnet mask
+ nems_internal_gateway:
+ type: string
+ label: nems internal gw
+ description: nems internal gw
+ nems_traffic_name:
+ type: string
+ label: nems traffic name
+ description: nems traffic name
+ nems_traffic_start:
+ type: string
+ label: nems traffic start
+ description: nems traffic start
+ nems_traffic_end:
+ type: string
+ label: nems traffic end
+ description: nems traffic end
+ nems_traffic_cidr:
+ type: string
+ label: nems traffic cidr
+ description: nems traffic cidr
+ nems_traffic_netmask:
+ type: string
+ label: NEMS traffic network subnet mask
+ description: NEMS traffic network subnet mask
+ nems_traffic_gateway:
+ type: string
+ label: NEMS traffic network gateway
+ description: NEMS traffic network gateway
+ nems_traffic_net_local_ip1:
+ type: string
+ label: nems traffic network local ip1
+ description: the local ip1 of the nems traffic network
+ nems_traffic_net_local_ip2:
+ type: string
+ label: nems traffic network local ip2
+ description: the local ip2 of the nems traffic network
+ nems_traffic_net_floating_ip:
+ type: string
+ label: nems traffic floating ip
+ description: nems traffic floating ip
+ nems_user_web_name:
+ type: string
+ label: nems user web name
+ description: nems user web name
+ nems_user_web_start:
+ type: string
+ label: nems user web start
+ description: nems user web end
+ nems_user_web_end:
+ type: string
+ label: nems user web end
+ description: nems user web end
+ nems_user_web_cidr:
+ type: string
+ label: nems user web cidr
+ description: nems user web cidr
+ nems_user_web_netmask:
+ type: string
+ label: NEMS user web network subnet mask
+ description: NEMS user web network subnet mask
+ nems_user_web_gateway:
+ type: string
+ label: NEMS user web network gateway
+ description: NEMS user web network gateway
+ nems_user_web_net_local_ip1:
+ type: string
+ label: nems user web network local ip1
+ description: the local ip1 of the nems user web network
+ nems_user_web_net_local_ip2:
+ type: string
+ label: nems user web network local ip2
+ description: the local ip2 of the nems user web network
+ nems_user_web_net_floating_ip:
+ type: string
+ label: nems user web floating ip
+ description: nems user web floating ip
+ nems_imap_name:
+ type: string
+ label: nems imap name
+ description: nems imap name
+ nems_imap_netmask:
+ type: string
+ label: nems imap subnet mask
+ description: nems imap subnet mask
+ nems_imap_start:
+ type: string
+ label: nems imap start
+ description: nems imap start
+ nems_imap_end:
+ type: string
+ label: nems imap end
+ description: nems imap end
+ nems_imap_cidr:
+ type: string
+ label: nems imap cidr
+ description: nems imap cidr
+ nems_imap_gateway:
+ type: string
+ label: nems imap gateway
+ description: nems imap gateway
+ eca_traffic_name:
+ type: string
+ label: eca traffic name
+ description: eca traffic name
+ eca_traffic_start:
+ type: string
+ label: eca traffic start
+ description: eca traffic start
+ eca_traffic_end:
+ type: string
+ label: eca traffic end
+ description: eca traffic end
+ eca_traffic_cidr:
+ type: string
+ label: eca traffic cidr
+ description: eca traffic cidr
+ eca_traffic_netmask:
+ type: string
+ label: ECA traffic network subnet mask
+ description: ECA traffic network subnet mask
+ eca_traffic_net_gateway:
+ type: string
+ label: eca_traffic network gateway
+ description: eca_traffic network gateway
+ eca_traffic_net_local_ip1:
+ type: string
+ label: eca traffic network local ip1
+ description: the local ip1 of the eca traffic network
+ eca_traffic_net_local_ip2:
+ type: string
+ label: eca traffic network local ip2
+ description: the local ip2 of the eca traffic network
+ eca_traffic_net_floating_ip:
+ type: string
+ label: eca traffic floating ip
+ description: eca traffic floating ip
+ ha_net_name:
+ type: string
+ label: ha_failover network name
+ description: ha_failover network name
+ ha_net_start:
+ type: string
+ label: ha net start
+ description: ha net start
+ ha_net_end:
+ type: string
+ label: ha net end
+ description: ha net end
+ ha_net_cidr:
+ type: string
+ label: ha net cidr
+ description: ha net cidr
+ ha_net_local_ip1:
+ type: string
+ label: ha net network local ip1
+ description: the local ip1 of the ha network
+ ha_net_local_ip2:
+ type: string
+ label: ha net network local ip2
+ description: the local ip2 of the ha network
+ lb_names:
+ type: comma_delimited_list
+ label: MMSC load balancer instance names
+ description: MMSC load balancer instance names
+ lb_image_name:
+ type: string
+ label: MMSC load balancer image name
+ description: MMSC load balancer image name
+ lb_flavor_name:
+ type: string
+ label: Load balancer flavor name
+ description: the flavor name of MMSC load balancer instance
+ availability_zone_0:
+ type: string
+ label: MMSC availabilityzone name
+ description: MMSC availabilityzone name
+ security_group_name:
+ type: string
+ label: MMSC security group name
+ description: MMSC security group name
+ mmsc_image:
+ type: string
+ label: Image for MMSC server
+ description: Image for MMSC server
+ mmsc_flavor:
+ type: string
+ label: Flavor for MMSC server
+ description: Flavor for MMSC server
+ mmsc_cinder_volume_size:
+ type: number
+ label: MMSC Cinder volume size
+ description: the size of the MMSC Cinder volume
+ nems_fe_image:
+ type: string
+ label: Image for NEMS FE server
+ description: Image for NEMS FE server
+ nems_fe_flavor:
+ type: string
+ label: Flavor for NEMS FE server
+ description: Flavor for NEMS FE server
+ nems_be_image:
+ type: string
+ label: Image for NEMS BE server
+ description: Image for NEMS BE server
+ nems_be_flavor:
+ type: string
+ label: Flavor for NEMS BE server
+ description: Flavor for NEMS BE server
+ eca_trx_image:
+ type: string
+ label: Image for ECA TRX server
+ description: Image for ECA TRX server
+ eca_trx_flavor:
+ type: string
+ label: Flavor for ECA TRX server
+ description: Flavor for ECA TRX server
+ mmsc_oam_ips:
+ type: comma_delimited_list
+ label: MMSC oam_net IP addresses
+ description: MMSC oam_net IP addresses
+ mmsc_mms_traffic_net_ips:
+ type: comma_delimited_list
+ label: MMSC mms_traffic_net IP addresses
+ description: MMSC mms_traffic_net IP addresses
+ nems_fe_names:
+ type: comma_delimited_list
+ label: NEMS_FE server names
+ description: NEMS_FE server names
+ nems_fe_node_roles:
+ type: comma_delimited_list
+ label: nems fe node roles
+ description: nems fe node roles
+ nems_fe_oam_ips:
+ type: comma_delimited_list
+ label: OAM_net IP for NEMS_FE
+ description: OAM_net IP for NEMS_FE
+ nems_fe_nems_traffic_net_ips:
+ type: comma_delimited_list
+ label: nems_traffic_net IPs for NEMS_FE
+ description: nems_traffic_net IPs for NEMS_FE
+ nems_fe_nems_user_web_net_ips:
+ type: comma_delimited_list
+ label: nems_web_user_net IPs for NEMS_FE
+ description: nems_web_user_net IPs for NEMS_FE
+ nems_fe_nems_internal_net_ips:
+ type: comma_delimited_list
+ label: nems_internal_net IPs for NEMS_FE
+ description: nems_internal_net IPs for NEMS_FE
+ nems_fe_nems_imap_net_ips:
+ type: comma_delimited_list
+ label: nems_imap_net IPs for NEMS_FE
+ description: nems_imap_net IPs for NEMS_FE
+ nems_be_names:
+ type: string
+ label: NEMS_BE server names
+ description: NEMS_BE server names
+ nems_be_node_roles:
+ type: string
+ label: nems node roles
+ description: nems node roles
+ nems_be_oam_ips:
+ type: string
+ label: OAM net IPs for NEMS_BE
+ description: OAM net IPs for NEMS_BE
+ nems_be_nems_internal_net_ips:
+ type: string
+ label: nems internal net IPs for NEMS_BE
+ description: nems internal net IPs for NEMS_BE
+ nems_be_nems_imap_net_ips:
+ type: string
+ label: nems imap_net IPs for NEMS_BE
+ description: nems imap net IPs for NEMS_BE
+ eca_trx_oam_ips:
+ type: comma_delimited_list
+ label: OAM net IP for ECA_TRX
+ description: OAM net IP for ECA_TRX
+ eca_trx_mgmt_ips:
+ type: comma_delimited_list
+ label: eca mgmt net IP for ECA_TRX
+ description: eca mgmt net IP for ECA_TRX
+ timezone:
+ type: string
+ label: timezone
+ description: timezone
+ eca_trx_names:
+ type: comma_delimited_list
+ label: ECA_TRX server names
+ description: ECA_TRX server names
+ eca_trx_eca_traffic_net_ips:
+ type: comma_delimited_list
+ label: eca traffic net IPs for ECA_TRX
+ description: eca traffic net IPs for ECA_TRX
+ mmsc_names:
+ type: comma_delimited_list
+ label: MMSC server names
+ description: MMSC server names
+ nems_volume_size:
+ type: number
+ label: nems fe volume size
+ description: nems fe volume size
+ nems_be_volume_size:
+ type: number
+ label: nems be volume size
+ description: nems be volume size
+ MMSC_volume_type:
+ type: string
+ label: MMSC vm volume type
+ description: the name of the target volume backend
+ NEMS_FE_volume_type:
+ type: string
+ label: nems fe vm volume type
+ description: the name of the target volume backend
+ NEMS_BE_volume_type:
+ type: string
+ label: nems be vm volume type
+ description: the name of the target volume backend
+ mmsc_core_virtual_server_ips:
+ type: comma_delimited_list
+ label: mmsc core virtual server ips
+ description: mmsc core virtual server ips
+ mmsc_core_snat_ips:
+ type: comma_delimited_list
+ label: mmsc core snat ips
+ description: mmsc core snat ips
+ mmsc_dmz_protected_virtual_server_ips:
+ type: comma_delimited_list
+ label: mmsc dmz_protected virtual server ips
+ description: mmsc dmz_protected virtual server ips
+ mmsc_dmz_protected_snat_ips:
+ type: comma_delimited_list
+ label: mmsc dmz_protected snat ips
+ description: mmsc dmz_protected snat ips
+ eca_mgmt_net_name:
+ type: string
+ label: eca management network ID
+ description: Network ID for eca management
+
+resources:
+ mms_traffic_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: mms_traffic_net_name }
+
+ mms_traffic_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: mms_traffic_net_name}
+ network_id: { get_resource: mms_traffic_net }
+ cidr: { get_param: mms_traffic_net_cidr }
+ allocation_pools: [{"start": {get_param: mms_traffic_start}, "end": {get_param: mms_traffic_end}}]
+
+ nems_internal_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: {get_param: nems_internal_name}
+
+ nems_internal_network_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: nems_internal_name}
+ allocation_pools: [{"start": {get_param: nems_internal_start}, "end": {get_param: nems_internal_end}}]
+ cidr: {get_param: nems_internal_cidr}
+ network_id: {get_resource: nems_internal_net}
+
+ nems_traffic_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: {get_param: nems_traffic_name}
+
+ nems_traffic_network_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: nems_traffic_name}
+ allocation_pools: [{"start": {get_param: nems_traffic_start}, "end": {get_param: nems_traffic_end}}]
+ cidr: {get_param: nems_traffic_cidr}
+ network_id: {get_resource: nems_traffic_net}
+
+ nems_user_web_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: {get_param: nems_user_web_name}
+
+ nems_user_web_network_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: nems_user_web_name}
+ allocation_pools: [{"start": {get_param: nems_user_web_start}, "end": {get_param: nems_user_web_end}}]
+ cidr: {get_param: nems_user_web_cidr}
+ network_id: {get_resource: nems_user_web_net}
+
+ nems_imap_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: {get_param: nems_imap_name}
+
+ nems_imap_network_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: nems_imap_name}
+ allocation_pools: [{"start": {get_param: nems_imap_start}, "end": {get_param: nems_imap_end}}]
+ cidr: {get_param: nems_imap_cidr}
+ network_id: {get_resource: nems_imap_net}
+
+ eca_traffic_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: {get_param: eca_traffic_name}
+
+ eca_traffic_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: eca_traffic_name}
+ allocation_pools: [{"start": {get_param: eca_traffic_start}, "end": {get_param: eca_traffic_end}}]
+ cidr: {get_param: eca_traffic_cidr}
+ network_id: {get_resource: eca_traffic_net}
+
+ ha_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: {get_param: ha_net_name}
+
+ ha_net_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: ha_net_name}
+ allocation_pools: [{"start": {get_param: ha_net_start}, "end": {get_param: ha_net_end}}]
+ cidr: {get_param: ha_net_cidr}
+ network_id: {get_resource: ha_net}
+
+ lb1_instance:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: [lb_names, 0]}
+ image: {get_param: lb_image_name}
+ flavor: {get_param: lb_flavor_name}
+ availability_zone: {get_param: availability_zone_0}
+ networks:
+ - port: {get_resource: lb1_mgmt_port}
+ - port: {get_resource: lb1_dmz_protected_port}
+ - port: {get_resource: lb1_cor_direct_port}
+ - port: {get_resource: lb1_mms_traffic_port}
+ - port: {get_resource: lb1_nems_traffic_port}
+ - port: {get_resource: lb1_nems_user_web_port}
+ - port: {get_resource: lb1_eca_traffic_port}
+ - port: {get_resource: lb1_ha_net_port}
+ metadata:
+ vnf_id: { get_param: vnf_id }
+
+ lb1_mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [lb_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb1_mms_traffic_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: mms_traffic_net}
+ fixed_ips: [{"ip_address": {get_param: mms_traffic_net_local_ip1}}]
+ allowed_address_pairs: [{"ip_address": {get_param: mms_traffic_net_floating_ip} }]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb1_dmz_protected_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: dmz_protected_net_name}
+ fixed_ips: [{"ip_address": {get_param: [lb_dmz_protected_ips, 0]}}]
+ allowed_address_pairs: [{"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 0]}}, {"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 1]}}, {"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 2]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 0]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 1]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 2]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 3]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb1_cor_direct_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: cor_direct_net_name}
+ fixed_ips: [{"ip_address": {get_param: [lb_cor_direct_ips, 0]}}]
+ allowed_address_pairs: [{"ip_address": {get_param: [mmsc_core_virtual_server_ips, 0]}}, {"ip_address": {get_param: [mmsc_core_virtual_server_ips, 1]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 0]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 1]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 2]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 3]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 4]}} ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb1_nems_traffic_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: nems_traffic_net}
+ fixed_ips: [{"ip_address": {get_param: nems_traffic_net_local_ip1}}]
+ allowed_address_pairs: [{"ip_address": {get_param: nems_traffic_net_floating_ip} }]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb1_nems_user_web_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: nems_user_web_net}
+ fixed_ips: [{"ip_address": {get_param: nems_user_web_net_local_ip1}}]
+ allowed_address_pairs: [{"ip_address": {get_param: nems_user_web_net_floating_ip} }]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb1_ha_net_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: ha_net}
+ fixed_ips: [{"ip_address": {get_param: ha_net_local_ip1}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb1_eca_traffic_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: eca_traffic_net}
+ fixed_ips: [{"ip_address": {get_param: eca_traffic_net_local_ip1}}]
+ allowed_address_pairs: [{"ip_address": {get_param: eca_traffic_net_floating_ip} }]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb2_instance:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: [lb_names, 1]}
+ image: {get_param: lb_image_name}
+ flavor: {get_param: lb_flavor_name}
+ availability_zone: {get_param: availability_zone_0}
+ networks:
+ - port: {get_resource: lb2_mgmt_port}
+ - port: {get_resource: lb2_dmz_protected_port}
+ - port: {get_resource: lb2_cor_direct_port}
+ - port: {get_resource: lb2_mms_traffic_port}
+ - port: {get_resource: lb2_nems_traffic_port}
+ - port: {get_resource: lb2_nems_user_web_port}
+ - port: {get_resource: lb2_eca_traffic_port}
+ - port: {get_resource: lb2_ha_net_port}
+ metadata:
+ vnf_id: { get_param: vnf_id }
+
+ lb2_mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [lb_oam_ips, 1]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb2_mms_traffic_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: mms_traffic_net}
+ fixed_ips: [{"ip_address": {get_param: mms_traffic_net_local_ip2}}]
+ allowed_address_pairs: [{"ip_address": {get_param: mms_traffic_net_floating_ip}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb2_dmz_protected_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: dmz_protected_net_name}
+ fixed_ips: [{"ip_address": {get_param: [lb_dmz_protected_ips, 1]}}]
+ allowed_address_pairs: [{"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 0]}}, {"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 1]}}, {"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 2]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 0]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 1]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 2]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 3]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb2_cor_direct_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: cor_direct_net_name}
+ fixed_ips: [{"ip_address": {get_param: [lb_cor_direct_ips, 1]}}]
+ allowed_address_pairs: [{"ip_address": {get_param: [mmsc_core_virtual_server_ips, 0]}}, {"ip_address": {get_param: [mmsc_core_virtual_server_ips, 1]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 0]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 1]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 2]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 3]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 4]}} ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb2_nems_traffic_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: nems_traffic_net}
+ fixed_ips: [{"ip_address": {get_param: nems_traffic_net_local_ip2}}]
+ allowed_address_pairs: [{"ip_address": {get_param: nems_traffic_net_floating_ip}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb2_nems_user_web_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: nems_user_web_net}
+ fixed_ips: [{"ip_address": {get_param: nems_user_web_net_local_ip2}}]
+ allowed_address_pairs: [{"ip_address": {get_param: nems_user_web_net_floating_ip}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb2_ha_net_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: ha_net}
+ fixed_ips: [{"ip_address": {get_param: ha_net_local_ip2}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb2_eca_traffic_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: eca_traffic_net}
+ fixed_ips: [{"ip_address": {get_param: eca_traffic_net_local_ip2}}]
+ allowed_address_pairs: [{"ip_address": {get_param: eca_traffic_net_floating_ip} }]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_mmsc1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [mmsc_names, 0]}
+ image: { get_param: mmsc_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: mmsc_flavor }
+ networks:
+ - port: { get_resource: mmsc1_port_0 }
+ - port: { get_resource: mmsc1_port_1 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ mmsc.mgmt.ip=${mmsc.mgmt.ip}
+ mmsc.mgmt.netmask=${mmsc.mgmt.netmask}
+ mmsc.mgmt.gateway=${mmsc.mgmt.gateway}
+ mmsc.traffic.ip=${mmsc.traffic.ip}
+ mmsc.traffic.netmask=${mmsc.traffic.netmask}
+ mmsc.traffic.gateway=${mmsc.traffic.gateway}
+ mmsc.mgmt.route.1=${mmsc.mgmt.route.1}
+ mmsc.mgmt.route.2=${mmsc.mgmt.route.2}
+ mmsc.external.dns=${mmsc.external.dns}
+ mmsc.external.ntp=${mmsc.external.ntp}
+ mmsc.hostname=${mmsc.hostname}
+ mmsc.timezone=${mmsc.timezone}
+ params:
+ ${mmsc.mgmt.ip}: {get_param: [mmsc_oam_ips, 0]}
+ ${mmsc.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${mmsc.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${mmsc.traffic.ip}: {get_param: [mmsc_mms_traffic_net_ips, 0]}
+ ${mmsc.traffic.netmask}: {get_param: mms_traffic_netmask}
+ ${mmsc.traffic.gateway}: {get_param: mms_traffic_net_gateway}
+ ${mmsc.mgmt.route.1}: {get_param: oam_network_route_1}
+ ${mmsc.mgmt.route.2}: {get_param: oam_network_route_2}
+ ${mmsc.external.dns}: {get_param: external_dns}
+ ${mmsc.external.ntp}: {get_param: external_ntp}
+ ${mmsc.hostname}: {get_param: [mmsc_names, 0]}
+ ${mmsc.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ mmsc1_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: mmsc_cinder_volume_size}
+ volume_type: {get_param: MMSC_volume_type}
+
+ mmsc1_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: mmsc1_volume}
+ instance_uuid: {get_resource: server_mmsc1}
+
+ mmsc1_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [
+ "ip_address": {get_param: [mmsc_oam_ips, 0]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ mmsc1_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: mms_traffic_net}
+ fixed_ips: [
+ "ip_address": {get_param: [mmsc_mms_traffic_net_ips, 0]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_mmsc2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [mmsc_names, 1]}
+ image: { get_param: mmsc_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: mmsc_flavor }
+ networks:
+ - port: { get_resource: mmsc2_port_0 }
+ - port: { get_resource: mmsc2_port_1 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ mmsc.mgmt.ip=${mmsc.mgmt.ip}
+ mmsc.mgmt.netmask=${mmsc.mgmt.netmask}
+ mmsc.mgmt.gateway=${mmsc.mgmt.gateway}
+ mmsc.traffic.ip=${mmsc.traffic.ip}
+ mmsc.traffic.netmask=${mmsc.traffic.netmask}
+ mmsc.traffic.gateway=${mmsc.traffic.gateway}
+ mmsc.mgmt.route.1=${mmsc.mgmt.route.1}
+ mmsc.mgmt.route.2=${mmsc.mgmt.route.2}
+ mmsc.external.dns=${mmsc.external.dns}
+ mmsc.external.ntp=${mmsc.external.ntp}
+ mmsc.hostname=${mmsc.hostname}
+ mmsc.timezone=${mmsc.timezone}
+ params:
+ ${mmsc.mgmt.ip}: {get_param: [mmsc_oam_ips, 1]}
+ ${mmsc.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${mmsc.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${mmsc.traffic.ip}: {get_param: [mmsc_mms_traffic_net_ips, 1]}
+ ${mmsc.traffic.netmask}: {get_param: mms_traffic_netmask}
+ ${mmsc.traffic.gateway}: {get_param: mms_traffic_net_gateway}
+ ${mmsc.mgmt.route.1}: {get_param: oam_network_route_1}
+ ${mmsc.mgmt.route.2}: {get_param: oam_network_route_2}
+ ${mmsc.external.dns}: {get_param: external_dns}
+ ${mmsc.external.ntp}: {get_param: external_ntp}
+ ${mmsc.hostname}: {get_param: [mmsc_names, 1]}
+ ${mmsc.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ mmsc2_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: mmsc_cinder_volume_size}
+ volume_type: {get_param: MMSC_volume_type}
+
+ mmsc2_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: mmsc2_volume}
+ instance_uuid: {get_resource: server_mmsc2}
+
+ mmsc2_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [
+ "ip_address": {get_param: [mmsc_oam_ips, 1]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ mmsc2_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: mms_traffic_net}
+ fixed_ips: [
+ "ip_address": {get_param: [mmsc_mms_traffic_net_ips, 1]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_mmsc3:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [mmsc_names, 2]}
+ image: { get_param: mmsc_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: mmsc_flavor }
+ networks:
+ - port: { get_resource: mmsc3_port_0 }
+ - port: { get_resource: mmsc3_port_1 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ mmsc.mgmt.ip=${mmsc.mgmt.ip}
+ mmsc.mgmt.netmask=${mmsc.mgmt.netmask}
+ mmsc.mgmt.gateway=${mmsc.mgmt.gateway}
+ mmsc.traffic.ip=${mmsc.traffic.ip}
+ mmsc.traffic.netmask=${mmsc.traffic.netmask}
+ mmsc.traffic.gateway=${mmsc.traffic.gateway}
+ mmsc.mgmt.route.1=${mmsc.mgmt.route.1}
+ mmsc.mgmt.route.2=${mmsc.mgmt.route.2}
+ mmsc.external.dns=${mmsc.external.dns}
+ mmsc.external.ntp=${mmsc.external.ntp}
+ mmsc.hostname=${mmsc.hostname}
+ mmsc.timezone=${mmsc.timezone}
+ params:
+ ${mmsc.mgmt.ip}: {get_param: [mmsc_oam_ips, 2]}
+ ${mmsc.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${mmsc.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${mmsc.traffic.ip}: {get_param: [mmsc_mms_traffic_net_ips, 2]}
+ ${mmsc.traffic.netmask}: {get_param: mms_traffic_netmask}
+ ${mmsc.traffic.gateway}: {get_param: mms_traffic_net_gateway}
+ ${mmsc.mgmt.route.1}: {get_param: oam_network_route_1}
+ ${mmsc.mgmt.route.2}: {get_param: oam_network_route_2}
+ ${mmsc.external.dns}: {get_param: external_dns}
+ ${mmsc.external.ntp}: {get_param: external_ntp}
+ ${mmsc.hostname}: {get_param: [mmsc_names, 2]}
+ ${mmsc.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ mmsc3_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: mmsc_cinder_volume_size}
+ volume_type: {get_param: MMSC_volume_type}
+
+ mmsc3_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: mmsc3_volume}
+ instance_uuid: {get_resource: server_mmsc3}
+
+ mmsc3_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [
+ "ip_address": {get_param: [mmsc_oam_ips, 2]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ mmsc3_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: mms_traffic_net}
+ fixed_ips: [
+ "ip_address": {get_param: [mmsc_mms_traffic_net_ips, 2]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_mmsc4:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [mmsc_names, 3]}
+ image: { get_param: mmsc_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: mmsc_flavor }
+ networks:
+ - port: { get_resource: mmsc4_port_0 }
+ - port: { get_resource: mmsc4_port_1 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ mmsc.mgmt.ip=${mmsc.mgmt.ip}
+ mmsc.mgmt.netmask=${mmsc.mgmt.netmask}
+ mmsc.mgmt.gateway=${mmsc.mgmt.gateway}
+ mmsc.traffic.ip=${mmsc.traffic.ip}
+ mmsc.traffic.netmask=${mmsc.traffic.netmask}
+ mmsc.traffic.gateway=${mmsc.traffic.gateway}
+ mmsc.mgmt.route.1=${mmsc.mgmt.route.1}
+ mmsc.mgmt.route.2=${mmsc.mgmt.route.2}
+ mmsc.external.dns=${mmsc.external.dns}
+ mmsc.external.ntp=${mmsc.external.ntp}
+ mmsc.hostname=${mmsc.hostname}
+ mmsc.timezone=${mmsc.timezone}
+ params:
+ ${mmsc.mgmt.ip}: {get_param: [mmsc_oam_ips, 3]}
+ ${mmsc.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${mmsc.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${mmsc.traffic.ip}: {get_param: [mmsc_mms_traffic_net_ips, 3]}
+ ${mmsc.traffic.netmask}: {get_param: mms_traffic_netmask}
+ ${mmsc.traffic.gateway}: {get_param: mms_traffic_net_gateway}
+ ${mmsc.mgmt.route.1}: {get_param: oam_network_route_1}
+ ${mmsc.mgmt.route.2}: {get_param: oam_network_route_2}
+ ${mmsc.external.dns}: {get_param: external_dns}
+ ${mmsc.external.ntp}: {get_param: external_ntp}
+ ${mmsc.hostname}: {get_param: [mmsc_names, 3]}
+ ${mmsc.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ mmsc4_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: mmsc_cinder_volume_size}
+ volume_type: {get_param: MMSC_volume_type}
+
+ mmsc4_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: mmsc4_volume}
+ instance_uuid: {get_resource: server_mmsc4}
+
+ mmsc4_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [
+ "ip_address": {get_param: [mmsc_oam_ips, 3]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ mmsc4_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: mms_traffic_net}
+ fixed_ips: [
+ "ip_address": {get_param: [mmsc_mms_traffic_net_ips, 3]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_mmsc5:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [mmsc_names, 4]}
+ image: { get_param: mmsc_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: mmsc_flavor }
+ networks:
+ - port: { get_resource: mmsc5_port_0 }
+ - port: { get_resource: mmsc5_port_1 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ mmsc.mgmt.ip=${mmsc.mgmt.ip}
+ mmsc.mgmt.netmask=${mmsc.mgmt.netmask}
+ mmsc.mgmt.gateway=${mmsc.mgmt.gateway}
+ mmsc.traffic.ip=${mmsc.traffic.ip}
+ mmsc.traffic.netmask=${mmsc.traffic.netmask}
+ mmsc.traffic.gateway=${mmsc.traffic.gateway}
+ mmsc.mgmt.route.1=${mmsc.mgmt.route.1}
+ mmsc.mgmt.route.2=${mmsc.mgmt.route.2}
+ mmsc.external.dns=${mmsc.external.dns}
+ mmsc.external.ntp=${mmsc.external.ntp}
+ mmsc.hostname=${mmsc.hostname}
+ mmsc.timezone=${mmsc.timezone}
+ params:
+ ${mmsc.mgmt.ip}: {get_param: [mmsc_oam_ips, 4]}
+ ${mmsc.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${mmsc.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${mmsc.traffic.ip}: {get_param: [mmsc_mms_traffic_net_ips, 4]}
+ ${mmsc.traffic.netmask}: {get_param: mms_traffic_netmask}
+ ${mmsc.traffic.gateway}: {get_param: mms_traffic_net_gateway}
+ ${mmsc.mgmt.route.1}: {get_param: oam_network_route_1}
+ ${mmsc.mgmt.route.2}: {get_param: oam_network_route_2}
+ ${mmsc.external.dns}: {get_param: external_dns}
+ ${mmsc.external.ntp}: {get_param: external_ntp}
+ ${mmsc.hostname}: {get_param: [mmsc_names, 4]}
+ ${mmsc.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ mmsc5_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: mmsc_cinder_volume_size}
+ volume_type: {get_param: MMSC_volume_type}
+
+ mmsc5_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: mmsc5_volume}
+ instance_uuid: {get_resource: server_mmsc5}
+
+ mmsc5_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [
+ "ip_address": {get_param: [mmsc_oam_ips, 4]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ mmsc5_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: mms_traffic_net}
+ fixed_ips: [
+ "ip_address": {get_param: [mmsc_mms_traffic_net_ips, 4]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_nems_fe1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [nems_fe_names, 0] }
+ image: { get_param: nems_fe_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: nems_fe_flavor }
+ networks:
+ - port: { get_resource: nems_fe1_port_0 }
+ - port: { get_resource: nems_fe1_port_1 }
+ - port: { get_resource: nems_fe1_port_2 }
+ - port: { get_resource: nems_fe1_port_3 }
+ - port: { get_resource: nems_fe1_port_4 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ nems.mgmt.ip=${nems.mgmt.ip}
+ nems.mgmt.netmask=${nems.mgmt.netmask}
+ nems.mgmt.gateway=${nems.mgmt.gateway}
+ nems.traffic.ip=${nems.traffic.ip}
+ nems.traffic.netmask=${nems.traffic.netmask}
+ nems.traffic.gateway=${nems.traffic.gateway}
+ nems.fe0.internal.ip=${nems.fe0.internal.ip}
+ nems.fe1.internal.ip=${nems.fe1.internal.ip}
+ nems.internal.netmask=${nems.internal.netmask}
+ nems.userweb.ip=${nems.userweb.ip}
+ nems.userweb.netmask=${nems.userweb.netmask}
+ nems.userweb.gateway=${nems.userweb.gateway}
+ nems.imap.ip=${nems.imap.ip}
+ nems.imap.netmask=${nems.imap.netmask}
+ nems.be.internal.ip=${nems.be.internal.ip}
+ nems.be.imap.ip=${nems.be.imap.ip}
+ nems.mgmt.route.1=${nems.mgmt.route.1}
+ nems.mgmt.route.2=${nems.mgmt.route.2}
+ nems.external.dns=${nems.external.dns}
+ nems.external.ntp=${nems.external.ntp}
+ nems.node=${nems.node}
+ nems.be0.host.name=${nems.be0.host.name}
+ nems.fe0.host.name=${nems.fe0.host.name}
+ nems.fe1.host.name=${nems.fe1.host.name}
+ nems.timezone=${nems.timezone}
+ params:
+ ${nems.mgmt.ip}: {get_param: [nems_fe_oam_ips, 0]}
+ ${nems.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${nems.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${nems.traffic.ip}: {get_param: [nems_fe_nems_traffic_net_ips, 0]}
+ ${nems.traffic.netmask}: {get_param: nems_traffic_netmask}
+ ${nems.traffic.gateway}: {get_param: nems_traffic_gateway}
+ ${nems.fe0.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 0]}
+ ${nems.fe1.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 1]}
+ ${nems.internal.netmask}: {get_param: nems_internal_netmask}
+ ${nems.userweb.ip}: {get_param: [nems_fe_nems_user_web_net_ips, 0]}
+ ${nems.userweb.netmask}: {get_param: nems_user_web_netmask}
+ ${nems.userweb.gateway}: {get_param: nems_user_web_gateway}
+ ${nems.imap.ip}: {get_param: [nems_fe_nems_imap_net_ips, 0]}
+ ${nems.imap.netmask}: {get_param: nems_imap_netmask}
+ ${nems.be.internal.ip}: {get_param: nems_be_nems_internal_net_ips}
+ ${nems.be.imap.ip}: {get_param: nems_be_nems_imap_net_ips}
+ ${nems.mgmt.route.1}: {get_param: oam_network_route_1}
+ ${nems.mgmt.route.2}: {get_param: oam_network_route_2}
+ ${nems.external.dns}: {get_param: external_dns}
+ ${nems.external.ntp}: {get_param: external_ntp}
+ ${nems.node}: {get_param: [nems_fe_node_roles, 0]}
+ ${nems.fe0.host.name}: {get_param: [nems_fe_names, 0]}
+ ${nems.fe1.host.name}: {get_param: [nems_fe_names, 1]}
+ ${nems.be0.host.name}: {get_param: nems_be_names}
+ ${nems.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ nems1_fe_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: nems_volume_size}
+ volume_type: {get_param: NEMS_FE_volume_type}
+
+ nems1_fe_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: nems1_fe_volume}
+ instance_uuid: {get_resource: server_nems_fe1}
+
+ nems_fe1_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [
+ "ip_address": { get_param: [nems_fe_oam_ips, 0] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ nems_fe1_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: nems_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [nems_fe_nems_traffic_net_ips, 0] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ nems_fe1_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: nems_user_web_net }
+ fixed_ips: [
+ "ip_address": { get_param: [nems_fe_nems_user_web_net_ips, 0] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ nems_fe1_port_3:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: nems_internal_net }
+ fixed_ips: [
+ "ip_address": { get_param: [nems_fe_nems_internal_net_ips, 0] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ nems_fe1_port_4:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: nems_imap_net }
+ fixed_ips: [
+ "ip_address": { get_param: [nems_fe_nems_imap_net_ips, 0] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_nems_fe2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [nems_fe_names, 1] }
+ image: { get_param: nems_fe_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: nems_fe_flavor }
+ networks:
+ - port: { get_resource: nems_fe2_port_0 }
+ - port: { get_resource: nems_fe2_port_1 }
+ - port: { get_resource: nems_fe2_port_2 }
+ - port: { get_resource: nems_fe2_port_3 }
+ - port: { get_resource: nems_fe2_port_4 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ nems.mgmt.ip=${nems.mgmt.ip}
+ nems.mgmt.netmask=${nems.mgmt.netmask}
+ nems.mgmt.gateway=${nems.mgmt.gateway}
+ nems.traffic.ip=${nems.traffic.ip}
+ nems.traffic.netmask=${nems.traffic.netmask}
+ nems.traffic.gateway=${nems.traffic.gateway}
+ nems.fe0.internal.ip=${nems.fe0.internal.ip}
+ nems.fe1.internal.ip=${nems.fe1.internal.ip}
+ nems.internal.netmask=${nems.internal.netmask}
+ nems.userweb.ip=${nems.userweb.ip}
+ nems.userweb.netmask=${nems.userweb.netmask}
+ nems.userweb.gateway=${nems.userweb.gateway}
+ nems.imap.ip=${nems.imap.ip}
+ nems.imap.netmask=${nems.imap.netmask}
+ nems.be.internal.ip=${nems.be.internal.ip}
+ nems.be.imap.ip=${nems.be.imap.ip}
+ nems.mgmt.route.1=${nems.mgmt.route.1}
+ nems.mgmt.route.2=${nems.mgmt.route.2}
+ nems.external.dns=${nems.external.dns}
+ nems.external.ntp=${nems.external.ntp}
+ nems.node=${nems.node}
+ nems.be0.host.name=${nems.be0.host.name}
+ nems.fe0.host.name=${nems.fe0.host.name}
+ nems.fe1.host.name=${nems.fe1.host.name}
+ nems.timezone=${nems.timezone}
+ params:
+ ${nems.mgmt.ip}: {get_param: [nems_fe_oam_ips, 1]}
+ ${nems.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${nems.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${nems.traffic.ip}: {get_param: [nems_fe_nems_traffic_net_ips, 1]}
+ ${nems.traffic.netmask}: {get_param: nems_traffic_netmask}
+ ${nems.traffic.gateway}: {get_param: nems_traffic_gateway}
+ ${nems.fe0.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 0]}
+ ${nems.fe1.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 1]}
+ ${nems.internal.netmask}: {get_param: nems_internal_netmask}
+ ${nems.userweb.ip}: {get_param: [nems_fe_nems_user_web_net_ips, 1]}
+ ${nems.userweb.netmask}: {get_param: nems_user_web_netmask}
+ ${nems.userweb.gateway}: {get_param: nems_user_web_gateway}
+ ${nems.imap.ip}: {get_param: [nems_fe_nems_imap_net_ips, 1]}
+ ${nems.imap.netmask}: {get_param: nems_imap_netmask}
+ ${nems.be.internal.ip}: {get_param: nems_be_nems_internal_net_ips}
+ ${nems.be.imap.ip}: {get_param: nems_be_nems_imap_net_ips}
+ ${nems.mgmt.route.1}: {get_param: oam_network_route_1}
+ ${nems.mgmt.route.2}: {get_param: oam_network_route_2}
+ ${nems.external.dns}: {get_param: external_dns}
+ ${nems.external.ntp}: {get_param: external_ntp}
+ ${nems.node}: {get_param: [nems_fe_node_roles, 1]}
+ ${nems.fe0.host.name}: {get_param: [nems_fe_names, 0]}
+ ${nems.fe1.host.name}: {get_param: [nems_fe_names, 1]}
+ ${nems.be0.host.name}: {get_param: nems_be_names}
+ ${nems.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ nems2_fe_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: nems_volume_size}
+ volume_type: {get_param: NEMS_FE_volume_type}
+
+ nems2_fe_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: nems2_fe_volume}
+ instance_uuid: {get_resource: server_nems_fe2}
+
+ nems_fe2_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [
+ "ip_address": {get_param: [nems_fe_oam_ips, 1]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ nems_fe2_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: nems_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [nems_fe_nems_traffic_net_ips, 1] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ nems_fe2_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: nems_user_web_net }
+ fixed_ips: [
+ "ip_address": { get_param: [nems_fe_nems_user_web_net_ips, 1] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ nems_fe2_port_3:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: nems_internal_net }
+ fixed_ips: [
+ "ip_address": { get_param: [nems_fe_nems_internal_net_ips, 1] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+
+ nems_fe2_port_4:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: nems_imap_net }
+ fixed_ips: [
+ "ip_address": { get_param: [nems_fe_nems_imap_net_ips, 1] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_nems_be1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: nems_be_names }
+ image: { get_param: nems_be_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: nems_be_flavor }
+ networks:
+ - port: { get_resource: nems_be1_port_0 }
+ - port: { get_resource: nems_be1_port_1 }
+ - port: { get_resource: nems_be1_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ nems.be.mgmt.ip=${nems.be.mgmt.ip}
+ nems.mgmt.netmask=${nems.mgmt.netmask}
+ nems.mgmt.gateway=${nems.mgmt.gateway}
+ nems.be.internal.ip=${nems.be.internal.ip}
+ nems.internal.netmask=${nems.internal.netmask}
+ nems.imap.netmask=${nems.imap.netmask}
+ nems.fe0.internal.ip=${nems.fe0.internal.ip}
+ nems.fe1.internal.ip=${nems.fe1.internal.ip}
+ nems.be.imap.ip=${nems.be.imap.ip}
+ nems.mgmt.route.1=${nems.mgmt.route.1}
+ nems.mgmt.route.2=${nems.mgmt.route.2}
+ nems.external.dns=${nems.external.dns}
+ nems.external.ntp=${nems.external.ntp}
+ nems.node=${nems.node}
+ nems.be0.host.name=${nems.be0.host.name}
+ nems.fe0.host.name=${nems.fe0.host.name}
+ nems.fe1.host.name=${nems.fe1.host.name}
+ nems.timezone=${nems.timezone}
+ params:
+ ${nems.be.mgmt.ip}: {get_param: nems_be_oam_ips}
+ ${nems.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${nems.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${nems.fe0.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 0]}
+ ${nems.fe1.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 1]}
+ ${nems.be.internal.ip}: {get_param: nems_be_nems_internal_net_ips}
+ ${nems.internal.netmask}: {get_param: nems_internal_netmask}
+ ${nems.imap.netmask}: {get_param: nems_imap_netmask}
+ ${nems.be.imap.ip}: {get_param: nems_be_nems_imap_net_ips}
+ ${nems.mgmt.route.1}: {get_param: oam_network_route_1}
+ ${nems.mgmt.route.2}: {get_param: oam_network_route_2}
+ ${nems.external.dns}: {get_param: external_dns}
+ ${nems.external.ntp}: {get_param: external_ntp}
+ ${nems.node}: {get_param: nems_be_node_roles}
+ ${nems.be0.host.name}: {get_param: nems_be_names}
+ ${nems.fe0.host.name}: {get_param: [nems_fe_names, 0]}
+ ${nems.fe1.host.name}: {get_param: [nems_fe_names, 1]}
+ ${nems.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ nems_be_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: nems_be_volume_size}
+ volume_type: {get_param: NEMS_BE_volume_type}
+
+ nems_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: nems_be_volume}
+ instance_uuid: {get_resource: server_nems_be1}
+
+
+ nems_be1_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [
+ "ip_address": { get_param: nems_be_oam_ips}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ nems_be1_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: nems_internal_net }
+ fixed_ips: [
+ "ip_address": { get_param: nems_be_nems_internal_net_ips}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ nems_be1_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: nems_imap_net }
+ fixed_ips: [
+ "ip_address": { get_param: nems_be_nems_imap_net_ips}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 0]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx1_port_0 }
+ - port: { get_resource: eca_trx1_port_1 }
+ - port: { get_resource: eca_trx1_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 0]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 0]}
+
+ eca_trx1_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 0] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx1_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 0] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx1_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 0] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+
+ server_eca_trx2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 1]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx2_port_0 }
+ - port: { get_resource: eca_trx2_port_1 }
+ - port: { get_resource: eca_trx2_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 1]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 1]}
+
+ eca_trx2_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 1] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx2_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 1] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx2_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 1] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx3:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 2]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx3_port_0 }
+ - port: { get_resource: eca_trx3_port_1 }
+ - port: { get_resource: eca_trx3_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 2]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 2]}
+
+ eca_trx3_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 2] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx3_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 2] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx3_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 2] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx4:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 3]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx4_port_0 }
+ - port: { get_resource: eca_trx4_port_1 }
+ - port: { get_resource: eca_trx4_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 3]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 3]}
+
+ eca_trx4_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 3] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx4_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 3] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx4_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 3] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx5:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 4]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx5_port_0 }
+ - port: { get_resource: eca_trx5_port_1 }
+ - port: { get_resource: eca_trx5_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 4]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 4]}
+
+ eca_trx5_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 4] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx5_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 4] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx5_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 4] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx6:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 5]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx6_port_0 }
+ - port: { get_resource: eca_trx6_port_1 }
+ - port: { get_resource: eca_trx6_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 5]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 5]}
+
+ eca_trx6_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 5] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx6_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 5] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx6_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 5] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx7:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 6]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx7_port_0 }
+ - port: { get_resource: eca_trx7_port_1 }
+ - port: { get_resource: eca_trx7_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 6]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 6]}
+
+ eca_trx7_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 6] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx7_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 6] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx7_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 6] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx8:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 7]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx8_port_0 }
+ - port: { get_resource: eca_trx8_port_1 }
+ - port: { get_resource: eca_trx8_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 7]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 7]}
+
+ eca_trx8_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 7] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx8_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 7] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx8_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 7] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx9:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 8]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx9_port_0 }
+ - port: { get_resource: eca_trx9_port_1 }
+ - port: { get_resource: eca_trx9_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 8]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 8]}
+
+ eca_trx9_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 8] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx9_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 8] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx9_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 8] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx10:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 9]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx10_port_0 }
+ - port: { get_resource: eca_trx10_port_1 }
+ - port: { get_resource: eca_trx10_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 9]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 9]}
+
+ eca_trx10_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 9] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx10_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 9] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx10_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 9] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx11:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 10]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx11_port_0 }
+ - port: { get_resource: eca_trx11_port_1 }
+ - port: { get_resource: eca_trx11_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 10]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 10]}
+
+ eca_trx11_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 10] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx11_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 10] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx11_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 10] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+
+ server_eca_trx12:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 11]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx12_port_0 }
+ - port: { get_resource: eca_trx12_port_1 }
+ - port: { get_resource: eca_trx12_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 11]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 11]}
+
+ eca_trx12_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 11] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx12_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 11] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx12_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 11] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx13:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 12]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx13_port_0 }
+ - port: { get_resource: eca_trx13_port_1 }
+ - port: { get_resource: eca_trx13_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 12]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 12]}
+
+ eca_trx13_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 12] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx13_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 12] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx13_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 12] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx14:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 13]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx14_port_0 }
+ - port: { get_resource: eca_trx14_port_1 }
+ - port: { get_resource: eca_trx14_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 13]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 13]}
+
+ eca_trx14_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 13] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx14_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 13] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx14_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 13] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx15:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 14]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx15_port_0 }
+ - port: { get_resource: eca_trx15_port_1 }
+ - port: { get_resource: eca_trx15_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 14]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 14]}
+
+ eca_trx15_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 14] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx15_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 14] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx15_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 14] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx16:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 15]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx16_port_0 }
+ - port: { get_resource: eca_trx16_port_1 }
+ - port: { get_resource: eca_trx16_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 15]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 15]}
+
+ eca_trx16_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 15] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx16_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 15] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx16_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 15] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+
+ server_eca_trx17:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 16]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx17_port_0 }
+ - port: { get_resource: eca_trx17_port_1 }
+ - port: { get_resource: eca_trx17_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 16]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 16]}
+
+ eca_trx17_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 16] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx17_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 16] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx17_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 16] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx18:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 17]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx18_port_0 }
+ - port: { get_resource: eca_trx18_port_1 }
+ - port: { get_resource: eca_trx18_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 17]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 17]}
+
+ eca_trx18_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 17] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx18_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 17] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx18_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 17] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx19:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 18]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx19_port_0 }
+ - port: { get_resource: eca_trx19_port_1 }
+ - port: { get_resource: eca_trx19_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 8]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 18]}
+
+ eca_trx19_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 18] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx19_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 18] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx19_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 18] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx20:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 19]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx20_port_0 }
+ - port: { get_resource: eca_trx20_port_1 }
+ - port: { get_resource: eca_trx20_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 19]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 19]}
+
+ eca_trx20_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 19] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx20_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 19] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx20_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 19] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/MMSC_Capacity_Line_1.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/MMSC_Capacity_Line_1.env
new file mode 100644
index 0000000000..b346d67d97
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/MMSC_Capacity_Line_1.env
@@ -0,0 +1,111 @@
+parameters:
+ oam_net_name: oam_protected_net_0
+ oam_network_netmask: 255.255.254.0
+ oam_network_gateway: 107.250.172.1
+ oam_network_route_1: 155.165.201.250/32,107.250.172.1
+ oam_network_route_2: 155.165.194.100/32,107.250.172.1
+ external_dns: 155.165.194.100
+ external_ntp: 155.165.201.250
+ lb_oam_ips: 107.250.172.50,107.250.172.51
+ dmz_protected_net_name: dmz_protected_net_0
+ lb_dmz_protected_ips: 107.239.14.19,107.239.14.20
+ cor_direct_net_name: cor_direct_net_0
+ lb_cor_direct_ips: 172.31.10.19,172.31.10.20
+ mms_traffic_net_name: int_mms_mms_traffic_net_2
+ mms_traffic_net_cidr: 172.26.2.0/24
+ mms_traffic_netmask: 255.255.255.0
+ mms_traffic_net_gateway: 172.26.2.1
+ mms_traffic_start: 172.26.2.3
+ mms_traffic_end: 172.26.2.254
+ mms_traffic_net_local_ip1: 172.26.2.3
+ mms_traffic_net_local_ip2: 172.26.2.4
+ mms_traffic_net_floating_ip: 172.26.2.5
+ nems_internal_name: int_mms_nems_internal_net_2
+ nems_internal_start: 172.26.6.3
+ nems_internal_end: 172.26.6.254
+ nems_internal_cidr: 172.26.6.0/24
+ nems_internal_netmask: 255.255.255.0
+ nems_internal_gateway: 172.26.6.1
+ nems_traffic_name: int_mms_nems_traffic_net_2
+ nems_traffic_start: 172.26.3.3
+ nems_traffic_end: 172.26.3.254
+ nems_traffic_cidr: 172.26.3.0/24
+ nems_traffic_netmask: 255.255.255.0
+ nems_traffic_gateway: 172.26.3.1
+ nems_traffic_net_local_ip1: 172.26.3.3
+ nems_traffic_net_local_ip2: 172.26.3.4
+ nems_traffic_net_floating_ip: 172.26.3.5
+ nems_user_web_name: int_mms_nems_web_net_2
+ nems_user_web_start: 172.26.4.3
+ nems_user_web_end: 172.26.4.254
+ nems_user_web_cidr: 172.26.4.0/24
+ nems_user_web_netmask: 255.255.255.0
+ nems_user_web_gateway: 172.26.4.1
+ nems_user_web_net_local_ip1: 172.26.4.3
+ nems_user_web_net_local_ip2: 172.26.4.4
+ nems_user_web_net_floating_ip: 172.26.4.5
+ nems_imap_name: int_mms_nems_imap_net_2
+ nems_imap_start: 172.26.7.3
+ nems_imap_end: 172.26.7.254
+ nems_imap_cidr: 172.26.7.0/24
+ nems_imap_netmask: 255.255.255.0
+ nems_imap_gateway: 172.26.7.1
+ eca_traffic_name: int_mms_eca_traffic_net_2
+ eca_traffic_cidr: 172.26.5.0/24
+ eca_traffic_netmask: 255.255.255.0
+ eca_traffic_net_gateway: 172.26.5.1
+ eca_traffic_start: 172.26.5.3
+ eca_traffic_end: 172.26.5.254
+ eca_traffic_net_local_ip1: 172.26.5.3
+ eca_traffic_net_local_ip2: 172.26.5.4
+ eca_traffic_net_floating_ip: 172.26.5.5
+ ha_net_name: int_mms_ha_net_2
+ ha_net_cidr: 172.26.1.0/24
+ ha_net_start: 172.26.1.3
+ ha_net_end: 172.26.1.254
+ ha_net_local_ip1: 172.26.1.3
+ ha_net_local_ip2: 172.26.1.4
+ lb_names: ZRDM1MMSC03ALB001,ZRDM1MMSC03ALB002
+ lb_image_name: BIGIP-11.5.3.0.0.163
+ lb_flavor_name: m1.xlarge
+ security_group_name: mmsc_security_group_1
+ availability_zone_0: nova
+ mmsc_mms_traffic_net_ips: 172.26.2.11,172.26.2.12,172.26.2.13,172.26.2.14,172.26.2.15
+ mmsc_oam_ips: 107.250.172.54,107.250.172.55,107.250.172.56,107.250.172.57,107.250.172.58
+ mmsc_flavor: lc.4xlarge4
+ mmsc_image: mmsc-6.0.2_v5
+ mmsc_cinder_volume_size: 480
+ nems_fe_flavor: m1.large2
+ nems_fe_image: nems-2.1.2_v29
+ nems_fe_names: ZRDM1MMSC03NFE001,ZRDM1MMSC03NFE002
+ nems_fe_node_roles: FE0,FE1
+ nems_fe_oam_ips: 107.250.172.64,107.250.172.65
+ nems_fe_nems_traffic_net_ips: 172.26.3.11,172.26.3.12
+ nems_fe_nems_user_web_net_ips: 172.26.4.11,172.26.4.12
+ nems_fe_nems_internal_net_ips: 172.26.6.11,172.26.6.12
+ nems_fe_nems_imap_net_ips: 172.26.7.11,172.26.7.12
+ nems_be_names: ZRDM1MMSC03NBE001
+ nems_be_node_roles: BE0
+ nems_be_oam_ips: 107.250.172.66
+ nems_be_nems_internal_net_ips: 172.26.6.13
+ nems_be_nems_imap_net_ips: 172.26.7.13
+ nems_be_flavor: m1.large2
+ nems_be_image: nems-2.1.2_v29
+ eca_trx_oam_ips: 107.250.172.70,107.250.172.71,107.250.172.72,107.250.172.73,107.250.172.74,107.250.172.75,107.250.172.76,107.250.172.77,107.250.172.78,107.250.172.79,107.250.172.80,107.250.172.81,107.250.172.82,107.250.172.83,107.250.172.84,107.250.172.85,107.250.172.86,107.250.172.87,107.250.172.88,107.250.172.89
+ eca_trx_mgmt_ips: 172.25.137.202,172.25.137.203,172.25.137.204,172.25.137.205,172.25.137.206,172.25.137.207,172.25.137.208,172.25.137.209,172.25.137.210,172.25.137.211,172.25.137.212,172.25.137.213,172.25.137.214,172.25.137.215,172.25.137.216,172.25.137.217,172.25.137.218,172.25.137.219,172.25.137.220,172.25.137.221
+ eca_trx_flavor: m1.xlarge
+ eca_trx_image: ECABASE
+ timezone: UTC
+ eca_trx_names: ZRDM1MMSC03TRX001,ZRDM1MMSC03TRX002,ZRDM1MMSC03TRX003,ZRDM1MMSC03TRX004,ZRDM1MMSC03TRX005,ZRDM1MMSC03TRX006,ZRDM1MMSC03TRX007,ZRDM1MMSC03TRX008,ZRDM1MMSC03TRX009,ZRDM1MMSC03TRX010,ZRDM1MMSC03TRX011,ZRDM1MMSC03TRX012,ZRDM1MMSC03TRX013,ZRDM1MMSC03TRX014,ZRDM1MMSC03TRX015,ZRDM1MMSC03TRX016,ZRDM1MMSC03TRX017,ZRDM1MMSC03TRX018,ZRDM1MMSC03TRX019,ZRDM1MMSC03TRX020
+ eca_trx_eca_traffic_net_ips: 172.26.5.11,172.26.5.12,172.26.5.13,172.26.5.14,172.26.5.15,172.26.5.16,172.26.5.17,172.26.5.18,172.26.5.19,172.26.5.20,172.26.5.21,172.26.5.22,172.26.5.23,172.26.5.24,172.26.5.25,172.26.5.26,172.26.5.27,172.26.5.28,172.26.5.29,172.26.5.30
+ mmsc_names: ZRDM1MMSC03MMS001,ZRDM1MMSC03MMS002,ZRDM1MMSC03MMS003,ZRDM1MMSC03MMS004,ZRDM1MMSC03MMS005
+ nems_volume_size: 50
+ nems_be_volume_size: 610
+ MMSC_volume_type: Platinum
+ NEMS_FE_volume_type: Platinum
+ NEMS_BE_volume_type: Platinum
+ mmsc_core_virtual_server_ips: 172.31.10.21,172.31.10.22
+ mmsc_core_snat_ips: 172.31.10.23,172.31.10.24,172.31.10.25,172.31.10.26,172.31.10.27
+ mmsc_dmz_protected_virtual_server_ips: 107.239.14.21,107.239.14.22,107.239.14.23
+ mmsc_dmz_protected_snat_ips: 107.239.14.24,107.239.14.25,107.239.14.26,107.239.14.27
+ eca_mgmt_net_name: int_eca_mgmt_net_1 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/SG_ECA_MGMT.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/SG_ECA_MGMT.yaml
new file mode 100644
index 0000000000..53efc5e36e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/SG_ECA_MGMT.yaml
@@ -0,0 +1,76 @@
+heat_template_version: 2013-05-23
+
+#################################
+#
+# Changes from MSO - 11/5/2015
+# - Parameter changes as below
+# - CDLs for vmNames, IPs
+# - aZone->availability_zone_0
+# - nwName->{nwRole}_net_name
+# - nwID->{nwRole}_net_id
+# - vmName->{vmType}_names
+# - ips ->{vmType}_{nwRole}_ips
+# - fips->{vmType}_{nwRole}_floating_ip
+# - added replacement_policy: AUTO to all ports
+# - added vnf_id for metadata to all servers
+# - externalized security group resource
+# - externalized eca_mgmt network
+#
+#################################
+
+description: >
+ HOT template that creates Security Group and ECA network
+
+parameters:
+ eca_mgmt_name:
+ type: string
+ label: eca management name
+ description: eca management name
+ eca_mgmt_start:
+ type: string
+ label: eca management start
+ description: eca management start
+ eca_mgmt_end:
+ type: string
+ label: eca management end
+ description: eca management end
+ eca_mgmt_cidr:
+ type: string
+ label: eca management cidr
+ description: eca management cidr
+ eca_mgmt_netmask:
+ type: string
+ label: ECA mgmt network subnet mask
+ description: ECA mgmt network subnet mask
+ security_group_name:
+ type: string
+ label: MMSC security group name
+ description: MMSC security group name
+
+resources:
+ mms_security_group:
+ type: OS::Neutron::SecurityGroup
+ properties:
+ description: mmsc security group
+ name: {get_param: security_group_name}
+ rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}
+ ]
+ eca_mgmt_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: {get_param: eca_mgmt_name}
+
+ eca_mgmt_network_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: eca_mgmt_name}
+ allocation_pools: [{"start": {get_param: eca_mgmt_start}, "end": {get_param: eca_mgmt_end}}]
+ cidr: {get_param: eca_mgmt_cidr}
+ #enable_dhcp: false
+ #gateway_ip: null
+ network_id: {get_resource: eca_mgmt_net}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/cmaui.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/cmaui.env
new file mode 100644
index 0000000000..2e0f4c0796
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/cmaui.env
@@ -0,0 +1,15 @@
+parameters:
+ cmaui_names: ZRDM1MMSC02CMI001,ZRDM1MMSC02CMI002
+ cmaui_flavor: m1.large
+ cmaui_image: cmaui-5.0.2.5_v25
+ cmaui_cinder_volume_size: 55
+ oam_net_name: oam_protected_net_0
+ oam_network_netmask: 255.255.255.192
+ oam_network_gateway: 10.20.30.1
+ external_dns: 155.165.201.250
+ external_ntp: 155.165.194.100
+ security_group_name: mmsc_security_group_1
+ availability_zone_0: nova
+ timezone: UTC
+ cmaui_oam_ips: 107.250.172.42,107.250.172.43
+ CMAUI_volume_type: Platinum \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/cmaui.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/cmaui.yml
new file mode 100644
index 0000000000..1b575858fb
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/cmaui.yml
@@ -0,0 +1,171 @@
+heat_template_version: 2013-05-23
+
+#################################
+#
+# Changes from MSO 01/26/2016
+# Updated per ECOMP feedback
+#
+#################################
+
+description: cmaui server template for vMMSC
+
+parameters:
+ vnf_id:
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-CMAUI_id
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_cinder_volume_size:
+ type: number
+ label: CMAUI Cinder volume size
+ description: the size of the CMAUI Cinder volume
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ oam_net_name:
+ type: string
+ description: UID of OAM network
+ oam_network_netmask:
+ type: string
+ label: oam network netmask
+ description: oam network gateway
+ oam_network_gateway:
+ type: string
+ label: oam network gateway
+ description: oam network gateway
+ external_dns:
+ type: string
+ label: dns server
+ description: dns server
+ external_ntp:
+ type: string
+ label: ntp server
+ description: ntp server
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ timezone:
+ type: string
+ label: timezone
+ description: timezone
+ cmaui_oam_ips:
+ type: comma_delimited_list
+ label: CMAUI oam_net IP addresses
+ description: CMAUI oam_net IP addresses
+ CMAUI_volume_type:
+ type: string
+ label: CMAUI vm volume type
+ description: the name of the target volume backend
+
+resources:
+ server_cmaui:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_0 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ cmaui.mgmt.ip=${cmaui.mgmt.ip}
+ cmaui.mgmt.netmask=${cmaui.mgmt.netmask}
+ cmaui.mgmt.gateway=${cmaui.mgmt.gateway}
+ cmaui.external.dns=${cmaui.external.dns}
+ cmaui.external.ntp=${cmaui.external.ntp}
+ cmaui.node=${cmaui.node}
+ cmaui.timezone=${cmaui.timezone}
+ params:
+ ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]}
+ ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${cmaui.external.dns}: {get_param: external_dns}
+ ${cmaui.external.ntp}: {get_param: external_ntp}
+ ${cmaui.node}: {get_param: [cmaui_names, 0]}
+ ${cmaui.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ cmaui_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: cmaui_cinder_volume_size}
+ volume_type: {get_param: CMAUI_volume_type}
+
+ cmaui_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: cmaui_volume}
+ instance_uuid: {get_resource: server_cmaui}
+
+ cmaui_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_cmaui1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 1]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui1_port_0 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ cmaui.mgmt.ip=${cmaui.mgmt.ip}
+ cmaui.mgmt.netmask=${cmaui.mgmt.netmask}
+ cmaui.mgmt.gateway=${cmaui.mgmt.gateway}
+ cmaui.external.dns=${cmaui.external.dns}
+ cmaui.external.ntp=${cmaui.external.ntp}
+ cmaui.node=${cmaui.node}
+ cmaui.timezone=${cmaui.timezone}
+ params:
+ ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 1]}
+ ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${cmaui.external.dns}: {get_param: external_dns}
+ ${cmaui.external.ntp}: {get_param: external_ntp}
+ ${cmaui.node}: {get_param: [cmaui_names, 1]}
+ ${cmaui.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ cmaui1_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: cmaui_cinder_volume_size}
+ volume_type: {get_param: CMAUI_volume_type}
+
+ cmaui1_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: cmaui1_volume}
+ instance_uuid: {get_resource: server_cmaui1}
+
+ cmaui1_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 1]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/eca_oam.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/eca_oam.env
new file mode 100644
index 0000000000..f9991722b3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/eca_oam.env
@@ -0,0 +1,20 @@
+parameters:
+ eca_names: ZRDM1MMSC02OAM001,ZRDM1MMSC02OAM002
+ arb_names: ZRDM1MMSC02ARB001
+ oam_image_name: ECABASE
+ oam_flavor: lc.xlarge4
+ arbiter_flavor: m1.large2
+ availability_zone_0: nova
+ oam_net_name: oam_protected_net_0
+ eca_mgmt_net_name: int_mms_eca_mgmt_net_1
+ eca_oam_ips: 107.250.172.44,107.250.172.45
+ eca_eca_mgmt_ips: 172.25.137.242,172.25.137.243
+ eca_oam_gateway: 107.250.172.1
+ arb_oam_ips: 107.250.172.46
+ arb_eca_mgmt_ips: 172.25.137.244
+ security_group_name: mmsc_security_group_1
+ oam_volume_size: 1800
+ arb_volume_size: 40
+ swift_eca_url: http://object-store.rdm2.cci.com:8080/v1/AUTH_1bbab536a19b4756926e7d0ec1eb543c/eca
+ ECA_OAM_volume_type: Platinum
+ ARB_volume_type: Platinum
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/eca_oam.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/eca_oam.yaml
new file mode 100644
index 0000000000..84e8f7c6c9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/eca_oam.yaml
@@ -0,0 +1,379 @@
+heat_template_version: 2013-05-23
+
+##########################################################
+#
+# Changes from MSO
+# - Updated per ECOMP Feedback
+#
+#
+##########################################################
+
+description: This stack creates two ECA OAM VM and one ARB VM
+
+parameters:
+ vnf_id:
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-ECA_id
+ eca_names:
+ type: comma_delimited_list
+ label: oam servers names
+ description: the names of the OAM1,OAM2 VM instances
+ arb_names:
+ type: comma_delimited_list
+ label: arbiter server names
+ description: the names of the arbiter VM instances
+ oam_image_name:
+ type: string
+ label: image name
+ description: the OAM image name
+ oam_flavor:
+ type: string
+ label: flavor name
+ description: OAM flavor name
+ arbiter_flavor:
+ type: string
+ label: flavor name
+ description: arbiter flavor name
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ oam_net_name:
+ type: string
+ label: oam network name
+ description: the name of the oam network
+ eca_mgmt_net_name:
+ type: string
+ label: internal network name
+ description: the name of the internal network
+ eca_oam_ips:
+ type: comma_delimited_list
+ label: oam network ips
+ description: the ips of oam networks for eca VM
+ eca_oam_gateway:
+ type: string
+ label: oam1 oam gateway
+ description: the ip of oam gateway
+ eca_eca_mgmt_ips:
+ type: comma_delimited_list
+ label: eca_mgmt network ips for eca VM
+ description: internal eca_mgmt network ips for eca VM
+ arb_oam_ips:
+ type: comma_delimited_list
+ label: oam network ips for arb VM
+ description: oam network ips for eca VM
+ arb_eca_mgmt_ips:
+ type: comma_delimited_list
+ label: eca_mgmt network ips
+ description: internal eca_mgmt network ips for arb VM
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ oam_volume_size:
+ type: number
+ label: volume size
+ description: the size of the OAM volume
+ arb_volume_size:
+ type: number
+ label: volume size
+ description: the size of the ARB volume
+ swift_eca_url:
+ type: string
+ label: Swift URL
+ description: Base URL for eca swift object store
+ ECA_OAM_volume_type:
+ type: string
+ label: eca oam vm volume type
+ description: the name of the target volume backend
+ ARB_volume_type:
+ type: string
+ label: arb vm volume type
+ description: the name of the target volume backend
+
+resources:
+ oam1_instance:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: [eca_names, 0]}
+ image: {get_param: oam_image_name}
+ flavor: {get_param: oam_flavor}
+ availability_zone: {get_param: availability_zone_0}
+ networks:
+ - port: {get_resource: oam1_int_port}
+ - port: {get_resource: oam1_mgmt_port}
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ sed -i s/HOSTNAME.*/"HOSTNAME=oam1_hostname"/g /etc/sysconfig/network
+ eth1_ip_address='oam1_mgt_ip'
+ eth1_gateway='oam_gateway'
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ mkdir /etc/puppet/files/roles/transcoder
+ mkdir /etc/puppet/files/roles/oam_primary
+ curl swift_url/etc/puppet/manifests/roles/oam_primary.pp > /etc/puppet/manifests/roles/oam_primary.pp
+ curl swift_url/etc/puppet/manifests/roles/transcoder.pp > /etc/puppet/manifests/roles/transcoder.pp
+ curl swift_url/etc/puppet/files/roles/oam_primary/config.yaml > /etc/puppet/files/roles/oam_primary/config.yaml
+ curl swift_url/etc/puppet/files/roles/transcoder/config.yaml > /etc/puppet/files/roles/transcoder/config.yaml
+ curl swift_url/etc/puppet/files/roles/transcoder/hpm.conf > /etc/puppet/files/roles/transcoder/hpm.conf
+ curl swift_url/etc/puppet/files/roles/transcoder/trx.conf > /etc/puppet/files/roles/transcoder/trx.conf
+ curl swift_url/etc/puppet/files/roles/transcoder/plugins-mo.conf > /etc/puppet/files/roles/transcoder/plugins-mo.conf
+ curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
+ curl swift_url/etc/puppet/manifests/site.pp > /etc/puppet/manifests/site.pp
+ curl swift_url/scripts/van-init-replicaset > /usr/sbin/van-init-replicaset
+ van-role oam_primary > /root/startup-van-role.out
+ curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
+ fdisk /dev/vdb < /root/fdisk-keystrokes
+ curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
+ chmod 755 /root/os-conf-cinder-vol
+ /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
+ params:
+ oam1_mgt_ip: {get_param: [eca_oam_ips, 0] }
+ oam_gateway: {get_param: eca_oam_gateway }
+ oam1_hostname: {get_param: [eca_names, 0]}
+ swift_url: {get_param: swift_eca_url}
+
+ oam1_mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ oam1_int_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: eca_mgmt_net_name}
+ fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ oam1_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: oam_volume_size}
+ volume_type: {get_param: ECA_OAM_volume_type}
+
+ oam1_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: oam1_volume}
+ instance_uuid: {get_resource: oam1_instance}
+
+ oam2_instance:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: [eca_names, 1]}
+ image: {get_param: oam_image_name}
+ flavor: {get_param: oam_flavor}
+ availability_zone: {get_param: availability_zone_0}
+ networks:
+ - port: {get_resource: oam2_int_port}
+ - port: {get_resource: oam2_mgmt_port}
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ sed -i s/HOSTNAME.*/"HOSTNAME=oam2_hostname"/g /etc/sysconfig/network
+ eth1_ip_address='oam2_mgt_ip'
+ eth1_gateway='oam_gateway'
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ curl swift_url/etc/puppet/manifests/roles/oam_secondary.pp > /etc/puppet/manifests/roles/oam_secondary.pp
+ curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml
+ curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
+ van-role oam_secondary > /root/startup-van-role.out
+ curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
+ fdisk /dev/vdb < /root/fdisk-keystrokes
+ curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
+ chmod 755 /root/os-conf-cinder-vol
+ /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
+
+ params:
+ oam2_mgt_ip: {get_param: [eca_oam_ips, 1] }
+ oam2_hostname: {get_param: [eca_names, 1]}
+ swift_url: {get_param: swift_eca_url}
+ oam_gateway: {get_param: eca_oam_gateway }
+
+ oam2_mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 1]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ oam2_int_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: eca_mgmt_net_name}
+ fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 1]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ oam2_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: oam_volume_size}
+ volume_type: {get_param: ECA_OAM_volume_type}
+
+ oam2_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: oam2_volume}
+ instance_uuid: {get_resource: oam2_instance}
+
+ arb_instance:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: [arb_names, 0]}
+ image: {get_param: oam_image_name}
+ flavor: {get_param: arbiter_flavor}
+ availability_zone: {get_param: availability_zone_0}
+ networks:
+ - port: {get_resource: arb_int_port}
+ - port: {get_resource: arb_mgmt_port}
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ sed -i s/HOSTNAME.*/"HOSTNAME=arb_hostname"/g /etc/sysconfig/network
+ eth1_ip_address='arb_mgt_ip'
+ eth1_gateway='oam_gateway'
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ curl swift_url/etc/puppet/manifests/roles/oam_arbiter.pp > /etc/puppet/manifests/roles/oam_arbiter.pp
+ curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml
+ curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
+ van-role oam_arbiter > /root/startup-van-role.out
+ curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
+ fdisk /dev/vdb < /root/fdisk-keystrokes
+ curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
+ chmod 755 /root/os-conf-cinder-vol
+ /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
+ params:
+ arb_mgt_ip: {get_param: [arb_oam_ips, 0] }
+ arb_hostname: {get_param: [arb_names, 0]}
+ swift_url: {get_param: swift_eca_url}
+ oam_gateway: {get_param: eca_oam_gateway }
+
+ arb_mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [arb_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ arb_int_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: eca_mgmt_net_name}
+ fixed_ips: [{"ip_address": {get_param: [arb_eca_mgmt_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ arb_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: arb_volume_size}
+ volume_type: {get_param: ARB_volume_type}
+ arb_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: arb_volume}
+ instance_uuid: {get_resource: arb_instance}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/sg_eca_mgmt.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/sg_eca_mgmt.env
new file mode 100644
index 0000000000..8012063ac0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/sg_eca_mgmt.env
@@ -0,0 +1,7 @@
+parameters:
+ eca_mgmt_name: int_eca_mgmt_net_1
+ eca_mgmt_cidr: 172.25.137.192/26
+ eca_mgmt_netmask: 255.255.255.192
+ eca_mgmt_start: 172.25.137.195
+ eca_mgmt_end: 172.25.137.254
+ security_group_name: mmsc_security_group_1
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/expectedOutput/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/expectedOutput/GlobalSubstitutionTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..4814d1c086
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/expectedOutput/GlobalSubstitutionTypesServiceTemplate.yaml
@@ -0,0 +1,347 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: GlobalSubstitutionTypes
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.abstract.nodes.heat.eca_oam:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ metadata:
+ type: string
+ description: cmaui metadata
+ oam_flavor:
+ type: string
+ description: OAM flavor name
+ default: lc.xlarge4
+ eca_eca_mgmt_ips:
+ type: list
+ description: internal eca_mgmt network ips for eca VM
+ default:
+ - 172.25.137.242
+ - 172.25.137.243
+ entry_schema:
+ type: string
+ eca_mgmt_net_name:
+ type: string
+ description: the name of the internal network
+ default: int_mms_eca_mgmt_net_1
+ ECA_OAM_volume_type:
+ type: string
+ description: the name of the target volume backend
+ default: Platinum
+ arb_eca_mgmt_ips:
+ type: list
+ description: internal eca_mgmt network ips for arb VM
+ default:
+ - 172.25.137.244
+ entry_schema:
+ type: string
+ networks:
+ type: string
+ description: cmaui network name
+ cmaui_name:
+ type: string
+ description: cmaui name
+ arb_volume_size:
+ type: float
+ description: the size of the ARB volume
+ default: 40
+ vnf_id:
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-ECA_id
+ availability_zone_0:
+ type: string
+ description: availabilityzone name
+ default: nova
+ oam_image_name:
+ type: string
+ description: the OAM image name
+ default: ECABASE
+ oam_volume_size:
+ type: float
+ description: the size of the OAM volume
+ default: 1800
+ swift_eca_url:
+ type: string
+ description: Base URL for eca swift object store
+ default: http://object-store.rdm2.cci.com:8080/v1/AUTH_1bbab536a19b4756926e7d0ec1eb543c/eca
+ oam_net_name:
+ type: string
+ description: the name of the oam network
+ default: oam_protected_net_0
+ ARB_volume_type:
+ type: string
+ description: the name of the target volume backend
+ default: Platinum
+ eca_names:
+ type: list
+ description: the names of the OAM1,OAM2 VM instances
+ default:
+ - ZRDM1MMSC02OAM001
+ - ZRDM1MMSC02OAM002
+ entry_schema:
+ type: string
+ arbiter_flavor:
+ type: string
+ description: arbiter flavor name
+ default: m1.large2
+ eca_oam_ips:
+ type: list
+ description: the ips of oam networks for eca VM
+ default:
+ - 107.250.172.44
+ - 107.250.172.45
+ entry_schema:
+ type: string
+ security_group_name:
+ type: string
+ description: the name of security group
+ default: mmsc_security_group_1
+ user_data:
+ type: string
+ description: cmaui user data
+ cmaui_image:
+ type: string
+ description: cmaui image
+ arb_names:
+ type: list
+ description: the names of the arbiter VM instances
+ default:
+ - ZRDM1MMSC02ARB001
+ entry_schema:
+ type: string
+ cmaui_flavor:
+ type: string
+ description: cmaui flavor name
+ user_data_format:
+ type: string
+ description: cmaui user data
+ eca_oam_gateway:
+ type: string
+ description: the ip of oam gateway
+ default: 107.250.172.1
+ arb_oam_ips:
+ type: list
+ description: oam network ips for eca VM
+ default:
+ - 107.250.172.46
+ entry_schema:
+ type: string
+ requirements:
+ - link_arb_mgmt_port:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_oam2_mgmt_port:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - local_storage_arb_instance:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - local_storage_oam1_instance:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - link_oam1_int_port:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_oam1_mgmt_port:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_arb_int_port:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_oam2_int_port:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - local_storage_oam2_instance:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ capabilities:
+ attachment_oam2_volume:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_oam2_instance:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_oam2_int_port:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_oam1_volume:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_oam1_instance:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_oam2_instance:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_arb_instance:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_oam1_instance:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_arb_instance:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_arb_instance:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_arb_instance:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_oam1_int_port:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_arb_volume:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_oam1_instance:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_oam2_instance:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_oam2_instance:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_oam1_instance:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_oam2_instance:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_arb_instance:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_oam1_mgmt_port:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_arb_int_port:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_arb_mgmt_port:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_oam2_mgmt_port:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_oam1_instance:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/expectedOutput/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/expectedOutput/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..d9f89dfc0e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/expectedOutput/MainServiceTemplate.yaml
@@ -0,0 +1,4193 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.nems_be:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.lb:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.eca_trx:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.cmaui:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.nems_fe:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.mmsc:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ lb_flavor_name:
+ label: Load balancer flavor name
+ hidden: false
+ immutable: false
+ type: string
+ description: the flavor name of MMSC load balancer instance
+ default: m1.xlarge
+ ha_net_local_ip2:
+ label: ha net network local ip2
+ hidden: false
+ immutable: false
+ type: string
+ description: the local ip2 of the ha network
+ default: 172.26.1.4
+ mmsc_dmz_protected_snat_ips:
+ label: mmsc dmz_protected snat ips
+ hidden: false
+ immutable: false
+ type: list
+ description: mmsc dmz_protected snat ips
+ default:
+ - 107.239.14.24
+ - 107.239.14.25
+ - 107.239.14.26
+ - 107.239.14.27
+ entry_schema:
+ type: string
+ ha_net_local_ip1:
+ label: ha net network local ip1
+ hidden: false
+ immutable: false
+ type: string
+ description: the local ip1 of the ha network
+ default: 172.26.1.3
+ mms_traffic_end:
+ label: mmsc traffic end IP
+ hidden: false
+ immutable: false
+ type: string
+ description: mmsc traffic end IP
+ default: 172.26.2.254
+ nems_traffic_end:
+ label: nems traffic end
+ hidden: false
+ immutable: false
+ type: string
+ description: nems traffic end
+ default: 172.26.3.254
+ mmsc_cinder_volume_size:
+ label: MMSC Cinder volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: the size of the MMSC Cinder volume
+ default: 480
+ nems_internal_cidr:
+ label: nems ineternal cidr
+ hidden: false
+ immutable: false
+ type: string
+ description: nems internal cidr
+ default: 172.26.6.0/24
+ eca_mgmt_cidr:
+ label: eca management cidr
+ hidden: false
+ immutable: false
+ type: string
+ description: eca management cidr
+ default: 172.25.137.192/26
+ nems_traffic_start:
+ label: nems traffic start
+ hidden: false
+ immutable: false
+ type: string
+ description: nems traffic start
+ default: 172.26.3.3
+ eca_trx_names:
+ label: ECA_TRX server names
+ hidden: false
+ immutable: false
+ type: list
+ description: ECA_TRX server names
+ default:
+ - ZRDM1MMSC03TRX001
+ - ZRDM1MMSC03TRX002
+ - ZRDM1MMSC03TRX003
+ - ZRDM1MMSC03TRX004
+ - ZRDM1MMSC03TRX005
+ - ZRDM1MMSC03TRX006
+ - ZRDM1MMSC03TRX007
+ - ZRDM1MMSC03TRX008
+ - ZRDM1MMSC03TRX009
+ - ZRDM1MMSC03TRX010
+ - ZRDM1MMSC03TRX011
+ - ZRDM1MMSC03TRX012
+ - ZRDM1MMSC03TRX013
+ - ZRDM1MMSC03TRX014
+ - ZRDM1MMSC03TRX015
+ - ZRDM1MMSC03TRX016
+ - ZRDM1MMSC03TRX017
+ - ZRDM1MMSC03TRX018
+ - ZRDM1MMSC03TRX019
+ - ZRDM1MMSC03TRX020
+ entry_schema:
+ type: string
+ nems_internal_name:
+ label: nems internal network name
+ hidden: false
+ immutable: false
+ type: string
+ description: nems internal network name
+ default: int_mms_nems_internal_net_2
+ nems_traffic_net_local_ip1:
+ label: nems traffic network local ip1
+ hidden: false
+ immutable: false
+ type: string
+ description: the local ip1 of the nems traffic network
+ default: 172.26.3.3
+ nems_traffic_net_local_ip2:
+ label: nems traffic network local ip2
+ hidden: false
+ immutable: false
+ type: string
+ description: the local ip2 of the nems traffic network
+ default: 172.26.3.4
+ nems_fe_names:
+ label: NEMS_FE server names
+ hidden: false
+ immutable: false
+ type: list
+ description: NEMS_FE server names
+ default:
+ - ZRDM1MMSC03NFE001
+ - ZRDM1MMSC03NFE002
+ entry_schema:
+ type: string
+ nems_be_nems_imap_net_ips:
+ label: nems imap_net IPs for NEMS_BE
+ hidden: false
+ immutable: false
+ type: string
+ description: nems imap net IPs for NEMS_BE
+ default: 172.26.7.13
+ nems_be_names:
+ label: NEMS_BE server names
+ hidden: false
+ immutable: false
+ type: string
+ description: NEMS_BE server names
+ default: ZRDM1MMSC03NBE001
+ nems_traffic_netmask:
+ label: NEMS traffic network subnet mask
+ hidden: false
+ immutable: false
+ type: string
+ description: NEMS traffic network subnet mask
+ default: 255.255.255.0
+ nems_fe_nems_imap_net_ips:
+ label: nems_imap_net IPs for NEMS_FE
+ hidden: false
+ immutable: false
+ type: list
+ description: nems_imap_net IPs for NEMS_FE
+ default:
+ - 172.26.7.11
+ - 172.26.7.12
+ entry_schema:
+ type: string
+ nems_fe_nems_user_web_net_ips:
+ label: nems_web_user_net IPs for NEMS_FE
+ hidden: false
+ immutable: false
+ type: list
+ description: nems_web_user_net IPs for NEMS_FE
+ default:
+ - 172.26.4.11
+ - 172.26.4.12
+ entry_schema:
+ type: string
+ nems_user_web_gateway:
+ label: NEMS user web network gateway
+ hidden: false
+ immutable: false
+ type: string
+ description: NEMS user web network gateway
+ default: 172.26.4.1
+ nems_imap_end:
+ label: nems imap end
+ hidden: false
+ immutable: false
+ type: string
+ description: nems imap end
+ default: 172.26.7.254
+ eca_traffic_net_local_ip1:
+ label: eca traffic network local ip1
+ hidden: false
+ immutable: false
+ type: string
+ description: the local ip1 of the eca traffic network
+ default: 172.26.5.3
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ default: cmaui-5.0.2.5_v25
+ eca_traffic_net_local_ip2:
+ label: eca traffic network local ip2
+ hidden: false
+ immutable: false
+ type: string
+ description: the local ip2 of the eca traffic network
+ default: 172.26.5.4
+ nems_volume_size:
+ label: nems fe volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: nems fe volume size
+ default: 50
+ mms_traffic_start:
+ label: mmsc traffic start IP
+ hidden: false
+ immutable: false
+ type: string
+ description: mmsc traffic start IP
+ default: 172.26.2.3
+ ha_net_start:
+ label: ha net start
+ hidden: false
+ immutable: false
+ type: string
+ description: ha net start
+ default: 172.26.1.3
+ nems_imap_gateway:
+ label: nems imap gateway
+ hidden: false
+ immutable: false
+ type: string
+ description: nems imap gateway
+ default: 172.26.7.1
+ mmsc_core_virtual_server_ips:
+ label: mmsc core virtual server ips
+ hidden: false
+ immutable: false
+ type: list
+ description: mmsc core virtual server ips
+ default:
+ - 172.31.10.21
+ - 172.31.10.22
+ entry_schema:
+ type: string
+ cmaui_oam_ips:
+ label: CMAUI oam_net IP addresses
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI oam_net IP addresses
+ default:
+ - 107.250.172.42
+ - 107.250.172.43
+ entry_schema:
+ type: string
+ CMAUI_volume_type:
+ label: CMAUI vm volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the target volume backend
+ default: Platinum
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ default:
+ - ZRDM1MMSC02CMI001
+ - ZRDM1MMSC02CMI002
+ entry_schema:
+ type: string
+ eca_trx_eca_traffic_net_ips:
+ label: eca traffic net IPs for ECA_TRX
+ hidden: false
+ immutable: false
+ type: list
+ description: eca traffic net IPs for ECA_TRX
+ default:
+ - 172.26.5.11
+ - 172.26.5.12
+ - 172.26.5.13
+ - 172.26.5.14
+ - 172.26.5.15
+ - 172.26.5.16
+ - 172.26.5.17
+ - 172.26.5.18
+ - 172.26.5.19
+ - 172.26.5.20
+ - 172.26.5.21
+ - 172.26.5.22
+ - 172.26.5.23
+ - 172.26.5.24
+ - 172.26.5.25
+ - 172.26.5.26
+ - 172.26.5.27
+ - 172.26.5.28
+ - 172.26.5.29
+ - 172.26.5.30
+ entry_schema:
+ type: string
+ eca_trx_image:
+ label: Image for ECA TRX server
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for ECA TRX server
+ default: ECABASE
+ lb_names:
+ label: MMSC load balancer instance names
+ hidden: false
+ immutable: false
+ type: list
+ description: MMSC load balancer instance names
+ default:
+ - ZRDM1MMSC03ALB001
+ - ZRDM1MMSC03ALB002
+ entry_schema:
+ type: string
+ eca_mgmt_end:
+ label: eca management end
+ hidden: false
+ immutable: false
+ type: string
+ description: eca management end
+ default: 172.25.137.254
+ nems_user_web_end:
+ label: nems user web end
+ hidden: false
+ immutable: false
+ type: string
+ description: nems user web end
+ default: 172.26.4.254
+ eca_traffic_cidr:
+ label: eca traffic cidr
+ hidden: false
+ immutable: false
+ type: string
+ description: eca traffic cidr
+ default: 172.26.5.0/24
+ ha_net_cidr:
+ label: ha net cidr
+ hidden: false
+ immutable: false
+ type: string
+ description: ha net cidr
+ default: 172.26.1.0/24
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ default: nova
+ nems_fe_nems_internal_net_ips:
+ label: nems_internal_net IPs for NEMS_FE
+ hidden: false
+ immutable: false
+ type: list
+ description: nems_internal_net IPs for NEMS_FE
+ default:
+ - 172.26.6.11
+ - 172.26.6.12
+ entry_schema:
+ type: string
+ NEMS_FE_volume_type:
+ label: nems fe vm volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the target volume backend
+ default: Platinum
+ security_group_name:
+ label: security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of security group
+ default: mmsc_security_group_1
+ nems_fe_nems_traffic_net_ips:
+ label: nems_traffic_net IPs for NEMS_FE
+ hidden: false
+ immutable: false
+ type: list
+ description: nems_traffic_net IPs for NEMS_FE
+ default:
+ - 172.26.3.11
+ - 172.26.3.12
+ entry_schema:
+ type: string
+ nems_imap_start:
+ label: nems imap start
+ hidden: false
+ immutable: false
+ type: string
+ description: nems imap start
+ default: 172.26.7.3
+ ha_net_name:
+ label: ha_failover network name
+ hidden: false
+ immutable: false
+ type: string
+ description: ha_failover network name
+ default: int_mms_ha_net_2
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ default: m1.large
+ eca_traffic_start:
+ label: eca traffic start
+ hidden: false
+ immutable: false
+ type: string
+ description: eca traffic start
+ default: 172.26.5.3
+ NEMS_BE_volume_type:
+ label: nems be vm volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the target volume backend
+ default: Platinum
+ lb_image_name:
+ label: MMSC load balancer image name
+ hidden: false
+ immutable: false
+ type: string
+ description: MMSC load balancer image name
+ default: BIGIP-11.5.3.0.0.163
+ nems_internal_start:
+ label: nems internal start
+ hidden: false
+ immutable: false
+ type: string
+ description: nems internal start
+ default: 172.26.6.3
+ nems_internal_gateway:
+ label: nems internal gw
+ hidden: false
+ immutable: false
+ type: string
+ description: nems internal gw
+ default: 172.26.6.1
+ dmz_protected_net_name:
+ label: UID of dmz_protected network
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of dmz_protected network
+ default: dmz_protected_net_0
+ nems_be_volume_size:
+ label: nems be volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: nems be volume size
+ default: 610
+ mms_traffic_netmask:
+ label: MMS traffic network subnet mask
+ hidden: false
+ immutable: false
+ type: string
+ description: MMS traffic network subnet mask
+ default: 255.255.255.0
+ nems_be_image:
+ label: Image for NEMS BE server
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for NEMS BE server
+ default: nems-2.1.2_v29
+ nems_user_web_net_local_ip1:
+ label: nems user web network local ip1
+ hidden: false
+ immutable: false
+ type: string
+ description: the local ip1 of the nems user web network
+ default: 172.26.4.3
+ eca_trx_mgmt_ips:
+ label: eca mgmt net IP for ECA_TRX
+ hidden: false
+ immutable: false
+ type: list
+ description: eca mgmt net IP for ECA_TRX
+ default:
+ - 172.25.137.202
+ - 172.25.137.203
+ - 172.25.137.204
+ - 172.25.137.205
+ - 172.25.137.206
+ - 172.25.137.207
+ - 172.25.137.208
+ - 172.25.137.209
+ - 172.25.137.210
+ - 172.25.137.211
+ - 172.25.137.212
+ - 172.25.137.213
+ - 172.25.137.214
+ - 172.25.137.215
+ - 172.25.137.216
+ - 172.25.137.217
+ - 172.25.137.218
+ - 172.25.137.219
+ - 172.25.137.220
+ - 172.25.137.221
+ entry_schema:
+ type: string
+ nems_user_web_cidr:
+ label: nems user web cidr
+ hidden: false
+ immutable: false
+ type: string
+ description: nems user web cidr
+ default: 172.26.4.0/24
+ nems_user_web_net_local_ip2:
+ label: nems user web network local ip2
+ hidden: false
+ immutable: false
+ type: string
+ description: the local ip2 of the nems user web network
+ default: 172.26.4.4
+ nems_traffic_gateway:
+ label: NEMS traffic network gateway
+ hidden: false
+ immutable: false
+ type: string
+ description: NEMS traffic network gateway
+ default: 172.26.3.1
+ nems_imap_name:
+ label: nems imap name
+ hidden: false
+ immutable: false
+ type: string
+ description: nems imap name
+ default: int_mms_nems_imap_net_2
+ mms_traffic_net_floating_ip:
+ label: mmsc traffic floating ip
+ hidden: false
+ immutable: false
+ type: string
+ description: mmsc traffic floating ip
+ default: 172.26.2.5
+ nems_internal_netmask:
+ label: NEMS internal network subnet mask
+ hidden: false
+ immutable: false
+ type: string
+ description: NEMS internal network subnet mask
+ default: 255.255.255.0
+ nems_user_web_netmask:
+ label: NEMS user web network subnet mask
+ hidden: false
+ immutable: false
+ type: string
+ description: NEMS user web network subnet mask
+ default: 255.255.255.0
+ mms_traffic_net_local_ip1:
+ label: mmsc traffic network local ip1
+ hidden: false
+ immutable: false
+ type: string
+ description: the local ip1 of the mmsc traffic network
+ default: 172.26.2.3
+ mms_traffic_net_local_ip2:
+ label: mmsc traffic network local ip2
+ hidden: false
+ immutable: false
+ type: string
+ description: the local ip2 of the mmsc traffic network
+ default: 172.26.2.4
+ oam_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ default: oam_protected_net_0
+ external_ntp:
+ label: ntp server
+ hidden: false
+ immutable: false
+ type: string
+ description: ntp server
+ default: 155.165.194.100
+ mms_traffic_net_cidr:
+ label: MMS traffic network address (CIDR notation)
+ hidden: false
+ immutable: false
+ type: string
+ description: MMS traffic network address (CIDR notation)
+ default: 172.26.2.0/24
+ lb_dmz_protected_ips:
+ label: dmz protected network local ips for lb VM
+ hidden: false
+ immutable: false
+ type: list
+ description: local ips of the dmz protected network for lb VM
+ default:
+ - 107.239.14.19
+ - 107.239.14.20
+ entry_schema:
+ type: string
+ eca_mgmt_start:
+ label: eca management start
+ hidden: false
+ immutable: false
+ type: string
+ description: eca management start
+ default: 172.25.137.195
+ MMSC_volume_type:
+ label: MMSC vm volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the target volume backend
+ default: Platinum
+ nems_fe_flavor:
+ label: Flavor for NEMS FE server
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for NEMS FE server
+ default: m1.large2
+ eca_mgmt_netmask:
+ label: ECA mgmt network subnet mask
+ hidden: false
+ immutable: false
+ type: string
+ description: ECA mgmt network subnet mask
+ default: 255.255.255.192
+ oam_network_netmask:
+ label: oam network netmask
+ hidden: false
+ immutable: false
+ type: string
+ description: oam network gateway
+ default: 255.255.255.192
+ oam_network_route_1:
+ label: oam network route 1
+ hidden: false
+ immutable: false
+ type: string
+ description: oam network route 1
+ default: 155.165.201.250/32,107.250.172.1
+ oam_network_route_2:
+ label: oam network route 2
+ hidden: false
+ immutable: false
+ type: string
+ description: oam network route 2
+ default: 155.165.194.100/32,107.250.172.1
+ mms_traffic_net_name:
+ label: Name of MMS traffic network
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of MMS traffic network
+ default: int_mms_mms_traffic_net_2
+ nems_user_web_name:
+ label: nems user web name
+ hidden: false
+ immutable: false
+ type: string
+ description: nems user web name
+ default: int_mms_nems_web_net_2
+ eca_traffic_net_floating_ip:
+ label: eca traffic floating ip
+ hidden: false
+ immutable: false
+ type: string
+ description: eca traffic floating ip
+ default: 172.26.5.5
+ eca_traffic_end:
+ label: eca traffic end
+ hidden: false
+ immutable: false
+ type: string
+ description: eca traffic end
+ default: 172.26.5.254
+ eca_trx_flavor:
+ label: Flavor for ECA TRX server
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for ECA TRX server
+ default: m1.xlarge
+ lb_oam_ips:
+ label: management network ips for mmsc lb
+ hidden: false
+ immutable: false
+ type: list
+ description: the ips of the management network for mmsc lb
+ default:
+ - 107.250.172.50
+ - 107.250.172.51
+ entry_schema:
+ type: string
+ nems_fe_oam_ips:
+ label: OAM_net IP for NEMS_FE
+ hidden: false
+ immutable: false
+ type: list
+ description: OAM_net IP for NEMS_FE
+ default:
+ - 107.250.172.64
+ - 107.250.172.65
+ entry_schema:
+ type: string
+ nems_be_flavor:
+ label: Flavor for NEMS BE server
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for NEMS BE server
+ default: m1.large2
+ lb_cor_direct_ips:
+ label: cor direct network local ips for lb VM
+ hidden: false
+ immutable: false
+ type: list
+ description: local ips of cor direct network for lb VM
+ default:
+ - 172.31.10.19
+ - 172.31.10.20
+ entry_schema:
+ type: string
+ nems_traffic_name:
+ label: nems traffic name
+ hidden: false
+ immutable: false
+ type: string
+ description: nems traffic name
+ default: int_mms_nems_traffic_net_2
+ timezone:
+ label: timezone
+ hidden: false
+ immutable: false
+ type: string
+ description: timezone
+ default: UTC
+ cmaui_cinder_volume_size:
+ label: CMAUI Cinder volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: the size of the CMAUI Cinder volume
+ default: 55
+ nems_user_web_start:
+ label: nems user web start
+ hidden: false
+ immutable: false
+ type: string
+ description: nems user web end
+ default: 172.26.4.3
+ mmsc_names:
+ label: MMSC server names
+ hidden: false
+ immutable: false
+ type: list
+ description: MMSC server names
+ default:
+ - ZRDM1MMSC03MMS001
+ - ZRDM1MMSC03MMS002
+ - ZRDM1MMSC03MMS003
+ - ZRDM1MMSC03MMS004
+ - ZRDM1MMSC03MMS005
+ entry_schema:
+ type: string
+ eca_mgmt_net_name:
+ label: eca management network ID
+ hidden: false
+ immutable: false
+ type: string
+ description: Network ID for eca management
+ default: int_eca_mgmt_net_1
+ eca_traffic_name:
+ label: eca traffic name
+ hidden: false
+ immutable: false
+ type: string
+ description: eca traffic name
+ default: int_mms_eca_traffic_net_2
+ nems_internal_end:
+ label: nems internal end
+ hidden: false
+ immutable: false
+ type: string
+ description: nems internal end
+ default: 172.26.6.254
+ nems_be_nems_internal_net_ips:
+ label: nems internal net IPs for NEMS_BE
+ hidden: false
+ immutable: false
+ type: string
+ description: nems internal net IPs for NEMS_BE
+ default: 172.26.6.13
+ mmsc_dmz_protected_virtual_server_ips:
+ label: mmsc dmz_protected virtual server ips
+ hidden: false
+ immutable: false
+ type: list
+ description: mmsc dmz_protected virtual server ips
+ default:
+ - 107.239.14.21
+ - 107.239.14.22
+ - 107.239.14.23
+ entry_schema:
+ type: string
+ cor_direct_net_name:
+ label: cor direct net UID
+ hidden: false
+ immutable: false
+ type: string
+ description: cor direct net
+ default: cor_direct_net_0
+ vnf_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-CMAUI_id
+ oam_network_gateway:
+ label: oam network gateway
+ hidden: false
+ immutable: false
+ type: string
+ description: oam network gateway
+ default: 10.20.30.1
+ mmsc_flavor:
+ label: Flavor for MMSC server
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for MMSC server
+ default: lc.4xlarge4
+ ha_net_end:
+ label: ha net end
+ hidden: false
+ immutable: false
+ type: string
+ description: ha net end
+ default: 172.26.1.254
+ nems_imap_netmask:
+ label: nems imap subnet mask
+ hidden: false
+ immutable: false
+ type: string
+ description: nems imap subnet mask
+ default: 255.255.255.0
+ external_dns:
+ label: dns server
+ hidden: false
+ immutable: false
+ type: string
+ description: dns server
+ default: 155.165.201.250
+ eca_traffic_net_gateway:
+ label: eca_traffic network gateway
+ hidden: false
+ immutable: false
+ type: string
+ description: eca_traffic network gateway
+ default: 172.26.5.1
+ nems_be_oam_ips:
+ label: OAM net IPs for NEMS_BE
+ hidden: false
+ immutable: false
+ type: string
+ description: OAM net IPs for NEMS_BE
+ default: 107.250.172.66
+ eca_trx_oam_ips:
+ label: OAM net IP for ECA_TRX
+ hidden: false
+ immutable: false
+ type: list
+ description: OAM net IP for ECA_TRX
+ default:
+ - 107.250.172.70
+ - 107.250.172.71
+ - 107.250.172.72
+ - 107.250.172.73
+ - 107.250.172.74
+ - 107.250.172.75
+ - 107.250.172.76
+ - 107.250.172.77
+ - 107.250.172.78
+ - 107.250.172.79
+ - 107.250.172.80
+ - 107.250.172.81
+ - 107.250.172.82
+ - 107.250.172.83
+ - 107.250.172.84
+ - 107.250.172.85
+ - 107.250.172.86
+ - 107.250.172.87
+ - 107.250.172.88
+ - 107.250.172.89
+ entry_schema:
+ type: string
+ mmsc_image:
+ label: Image for MMSC server
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for MMSC server
+ default: mmsc-6.0.2_v5
+ nems_imap_cidr:
+ label: nems imap cidr
+ hidden: false
+ immutable: false
+ type: string
+ description: nems imap cidr
+ default: 172.26.7.0/24
+ eca_traffic_netmask:
+ label: ECA traffic network subnet mask
+ hidden: false
+ immutable: false
+ type: string
+ description: ECA traffic network subnet mask
+ default: 255.255.255.0
+ nems_fe_node_roles:
+ label: nems fe node roles
+ hidden: false
+ immutable: false
+ type: list
+ description: nems fe node roles
+ default:
+ - FE0
+ - FE1
+ entry_schema:
+ type: string
+ mmsc_mms_traffic_net_ips:
+ label: MMSC mms_traffic_net IP addresses
+ hidden: false
+ immutable: false
+ type: list
+ description: MMSC mms_traffic_net IP addresses
+ default:
+ - 172.26.2.11
+ - 172.26.2.12
+ - 172.26.2.13
+ - 172.26.2.14
+ - 172.26.2.15
+ entry_schema:
+ type: string
+ nems_traffic_net_floating_ip:
+ label: nems traffic floating ip
+ hidden: false
+ immutable: false
+ type: string
+ description: nems traffic floating ip
+ default: 172.26.3.5
+ mms_traffic_net_gateway:
+ label: MMS traffic network gateway address
+ hidden: false
+ immutable: false
+ type: string
+ description: MMS traffic network gateway address
+ default: 172.26.2.1
+ nems_fe_image:
+ label: Image for NEMS FE server
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for NEMS FE server
+ default: nems-2.1.2_v29
+ mmsc_oam_ips:
+ label: MMSC oam_net IP addresses
+ hidden: false
+ immutable: false
+ type: list
+ description: MMSC oam_net IP addresses
+ default:
+ - 107.250.172.54
+ - 107.250.172.55
+ - 107.250.172.56
+ - 107.250.172.57
+ - 107.250.172.58
+ entry_schema:
+ type: string
+ eca_mgmt_name:
+ label: eca management name
+ hidden: false
+ immutable: false
+ type: string
+ description: eca management name
+ default: int_eca_mgmt_net_1
+ nems_traffic_cidr:
+ label: nems traffic cidr
+ hidden: false
+ immutable: false
+ type: string
+ description: nems traffic cidr
+ default: 172.26.3.0/24
+ nems_be_node_roles:
+ label: nems node roles
+ hidden: false
+ immutable: false
+ type: string
+ description: nems node roles
+ default: BE0
+ mmsc_core_snat_ips:
+ label: mmsc core snat ips
+ hidden: false
+ immutable: false
+ type: list
+ description: mmsc core snat ips
+ default:
+ - 172.31.10.23
+ - 172.31.10.24
+ - 172.31.10.25
+ - 172.31.10.26
+ - 172.31.10.27
+ entry_schema:
+ type: string
+ nems_user_web_net_floating_ip:
+ label: nems user web floating ip
+ hidden: false
+ immutable: false
+ type: string
+ description: nems user web floating ip
+ default: 172.26.4.5
+ node_templates:
+ server_eca_trx9:
+ type: org.openecomp.resource.vfc.nodes.heat.eca_trx
+ properties:
+ flavor:
+ get_input: eca_trx_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: eca_trx_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_trx_names
+ - 8
+ server_eca_trx8:
+ type: org.openecomp.resource.vfc.nodes.heat.eca_trx
+ properties:
+ flavor:
+ get_input: eca_trx_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: eca_trx_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_trx_names
+ - 7
+ server_eca_trx7:
+ type: org.openecomp.resource.vfc.nodes.heat.eca_trx
+ properties:
+ flavor:
+ get_input: eca_trx_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: eca_trx_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_trx_names
+ - 6
+ server_eca_trx6:
+ type: org.openecomp.resource.vfc.nodes.heat.eca_trx
+ properties:
+ flavor:
+ get_input: eca_trx_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: eca_trx_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_trx_names
+ - 5
+ server_eca_trx5:
+ type: org.openecomp.resource.vfc.nodes.heat.eca_trx
+ properties:
+ flavor:
+ get_input: eca_trx_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: eca_trx_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_trx_names
+ - 4
+ nems_internal_net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ network_name:
+ get_input: nems_internal_name
+ subnets:
+ nems_internal_network_ip_subnet:
+ name:
+ get_input: nems_internal_name
+ cidr:
+ get_input: nems_internal_cidr
+ allocation_pools:
+ - start:
+ get_input: nems_internal_start
+ end:
+ get_input: nems_internal_end
+ server_eca_trx4:
+ type: org.openecomp.resource.vfc.nodes.heat.eca_trx
+ properties:
+ flavor:
+ get_input: eca_trx_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: eca_trx_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_trx_names
+ - 3
+ server_eca_trx3:
+ type: org.openecomp.resource.vfc.nodes.heat.eca_trx
+ properties:
+ flavor:
+ get_input: eca_trx_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: eca_trx_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_trx_names
+ - 2
+ server_eca_trx2:
+ type: org.openecomp.resource.vfc.nodes.heat.eca_trx
+ properties:
+ flavor:
+ get_input: eca_trx_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: eca_trx_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_trx_names
+ - 1
+ lb1_mgmt_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - lb_oam_ips
+ - 0
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: lb1_instance
+ relationship: tosca.relationships.network.BindsTo
+ lb2_mms_traffic_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: mms_traffic_net_local_ip2
+ allowed_address_pairs:
+ - ip_address:
+ get_input: mms_traffic_net_floating_ip
+ network: mms_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: mms_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: lb2_instance
+ relationship: tosca.relationships.network.BindsTo
+ nems_fe1_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - nems_fe_nems_traffic_net_ips
+ - 0
+ network: nems_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: nems_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_nems_fe1
+ relationship: tosca.relationships.network.BindsTo
+ nems_fe2_port_3:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - nems_fe_nems_internal_net_ips
+ - 1
+ network: nems_internal_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: nems_internal_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_nems_fe2
+ relationship: tosca.relationships.network.BindsTo
+ server_eca_trx1:
+ type: org.openecomp.resource.vfc.nodes.heat.eca_trx
+ properties:
+ flavor:
+ get_input: eca_trx_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: eca_trx_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_trx_names
+ - 0
+ nems_fe1_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - nems_fe_nems_user_web_net_ips
+ - 0
+ network: nems_user_web_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: nems_user_web_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_nems_fe1
+ relationship: tosca.relationships.network.BindsTo
+ nems_fe2_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - nems_fe_nems_user_web_net_ips
+ - 1
+ network: nems_user_web_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: nems_user_web_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_nems_fe2
+ relationship: tosca.relationships.network.BindsTo
+ nems_fe2_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - nems_fe_nems_traffic_net_ips
+ - 1
+ network: nems_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: nems_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_nems_fe2
+ relationship: tosca.relationships.network.BindsTo
+ nems_fe1_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - nems_fe_oam_ips
+ - 0
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_nems_fe1
+ relationship: tosca.relationships.network.BindsTo
+ nems_fe2_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - nems_fe_oam_ips
+ - 1
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_nems_fe2
+ relationship: tosca.relationships.network.BindsTo
+ nems_fe1_port_3:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - nems_fe_nems_internal_net_ips
+ - 0
+ network: nems_internal_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: nems_internal_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_nems_fe1
+ relationship: tosca.relationships.network.BindsTo
+ nems_fe1_port_4:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - nems_fe_nems_imap_net_ips
+ - 0
+ network: nems_imap_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: nems_imap_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_nems_fe1
+ relationship: tosca.relationships.network.BindsTo
+ nems_fe2_port_4:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - nems_fe_nems_imap_net_ips
+ - 1
+ network: nems_imap_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: nems_imap_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_nems_fe2
+ relationship: tosca.relationships.network.BindsTo
+ mms_security_group:
+ type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules
+ properties:
+ name:
+ get_input: security_group_name
+ description: mmsc security group
+ rules:
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ mmsc4_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: MMSC_volume_type
+ size: '(get_input : mmsc_cinder_volume_size) * 1024'
+ lb2_eca_traffic_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: eca_traffic_net_local_ip2
+ allowed_address_pairs:
+ - ip_address:
+ get_input: eca_traffic_net_floating_ip
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: lb2_instance
+ relationship: tosca.relationships.network.BindsTo
+ lb2_ha_net_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: ha_net_local_ip2
+ network: ha_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: ha_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: lb2_instance
+ relationship: tosca.relationships.network.BindsTo
+ nems_user_web_net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ network_name:
+ get_input: nems_user_web_name
+ subnets:
+ nems_user_web_network_ip_subnet:
+ name:
+ get_input: nems_user_web_name
+ cidr:
+ get_input: nems_user_web_cidr
+ allocation_pools:
+ - start:
+ get_input: nems_user_web_start
+ end:
+ get_input: nems_user_web_end
+ lb1_ha_net_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: ha_net_local_ip1
+ network: ha_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: ha_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: lb1_instance
+ relationship: tosca.relationships.network.BindsTo
+ mmsc2_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: MMSC_volume_type
+ size: '(get_input : mmsc_cinder_volume_size) * 1024'
+ cmaui1_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: CMAUI_volume_type
+ size: '(get_input : cmaui_cinder_volume_size) * 1024'
+ nems_traffic_net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ network_name:
+ get_input: nems_traffic_name
+ subnets:
+ nems_traffic_network_ip_subnet:
+ name:
+ get_input: nems_traffic_name
+ cidr:
+ get_input: nems_traffic_cidr
+ allocation_pools:
+ - start:
+ get_input: nems_traffic_start
+ end:
+ get_input: nems_traffic_end
+ eca_trx16_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_oam_ips
+ - 15
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx16
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx19_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_eca_traffic_net_ips
+ - 18
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx19
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx16_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_mgmt_ips
+ - 15
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx16
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx19_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_mgmt_ips
+ - 18
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx19
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx15_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_oam_ips
+ - 14
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx15
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx19_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_oam_ips
+ - 18
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx19
+ relationship: tosca.relationships.network.BindsTo
+ lb1_nems_traffic_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: nems_traffic_net_local_ip1
+ allowed_address_pairs:
+ - ip_address:
+ get_input: nems_traffic_net_floating_ip
+ network: nems_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: nems_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: lb1_instance
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx11_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_mgmt_ips
+ - 10
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx11
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx11_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_eca_traffic_net_ips
+ - 10
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx11
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx12_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_eca_traffic_net_ips
+ - 11
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx12
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx12_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_mgmt_ips
+ - 11
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx12
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx11_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_oam_ips
+ - 10
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx11
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx12_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_oam_ips
+ - 11
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx12
+ relationship: tosca.relationships.network.BindsTo
+ mmsc4_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - mmsc_oam_ips
+ - 3
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_mmsc4
+ relationship: tosca.relationships.network.BindsTo
+ cmaui1_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 1
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui1
+ relationship: tosca.relationships.network.BindsTo
+ mmsc3_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - mmsc_oam_ips
+ - 2
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_mmsc3
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx15_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_eca_traffic_net_ips
+ - 14
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx15
+ relationship: tosca.relationships.network.BindsTo
+ mmsc3_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - mmsc_mms_traffic_net_ips
+ - 2
+ network: mms_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: mms_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_mmsc3
+ relationship: tosca.relationships.network.BindsTo
+ mmsc4_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - mmsc_mms_traffic_net_ips
+ - 3
+ network: mms_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: mms_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_mmsc4
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx15_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_mgmt_ips
+ - 14
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx15
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx16_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_eca_traffic_net_ips
+ - 15
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx16
+ relationship: tosca.relationships.network.BindsTo
+ lb2_mgmt_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - lb_oam_ips
+ - 1
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: lb2_instance
+ relationship: tosca.relationships.network.BindsTo
+ mmsc5_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: MMSC_volume_type
+ size: '(get_input : mmsc_cinder_volume_size) * 1024'
+ eca_trx7_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_eca_traffic_net_ips
+ - 6
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx7
+ relationship: tosca.relationships.network.BindsTo
+ server_cmaui:
+ type: org.openecomp.resource.abstract.nodes.heat.eca_oam
+ directives:
+ - substitutable
+ properties:
+ service_template_filter:
+ substitute_service_template: eca_oamServiceTemplate.yaml
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ cmaui_image:
+ get_input: cmaui_image
+ cmaui_flavor:
+ get_input: cmaui_flavor
+ user_data_format: RAW
+ availability_zone_0:
+ get_input: availability_zone_0
+ user_data:
+ str_replace:
+ template: |
+ cmaui.mgmt.ip=${cmaui.mgmt.ip}
+ cmaui.mgmt.netmask=${cmaui.mgmt.netmask}
+ cmaui.mgmt.gateway=${cmaui.mgmt.gateway}
+ cmaui.external.dns=${cmaui.external.dns}
+ cmaui.external.ntp=${cmaui.external.ntp}
+ cmaui.node=${cmaui.node}
+ cmaui.timezone=${cmaui.timezone}
+ params:
+ ${cmaui.mgmt.netmask}:
+ get_input: oam_network_netmask
+ ${cmaui.node}:
+ get_input:
+ - cmaui_names
+ - 0
+ ${cmaui.mgmt.gateway}:
+ get_input: oam_network_gateway
+ ${cmaui.mgmt.ip}:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ ${cmaui.external.ntp}:
+ get_input: external_ntp
+ ${cmaui.timezone}:
+ get_input: timezone
+ ${cmaui.external.dns}:
+ get_input: external_dns
+ networks:
+ - port: cmaui_port_0
+ cmaui_name:
+ get_input:
+ - cmaui_names
+ - 0
+ eca_trx7_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_oam_ips
+ - 6
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx7
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx7_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_mgmt_ips
+ - 6
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx7
+ relationship: tosca.relationships.network.BindsTo
+ cmaui_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: CMAUI_volume_type
+ size: '(get_input : cmaui_cinder_volume_size) * 1024'
+ eca_trx3_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_mgmt_ips
+ - 2
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx3
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx3_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_oam_ips
+ - 2
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx3
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx3_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_eca_traffic_net_ips
+ - 2
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx3
+ relationship: tosca.relationships.network.BindsTo
+ mmsc1_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: MMSC_volume_type
+ size: '(get_input : mmsc_cinder_volume_size) * 1024'
+ nems_imap_net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ network_name:
+ get_input: nems_imap_name
+ subnets:
+ nems_imap_network_ip_subnet:
+ name:
+ get_input: nems_imap_name
+ cidr:
+ get_input: nems_imap_cidr
+ allocation_pools:
+ - start:
+ get_input: nems_imap_start
+ end:
+ get_input: nems_imap_end
+ server_cmaui1:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ user_data_format: RAW
+ name:
+ get_input:
+ - cmaui_names
+ - 1
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: cmaui1_volume
+ relationship: cmaui1_volume_attachment
+ lb2_dmz_protected_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - lb_dmz_protected_ips
+ - 1
+ allowed_address_pairs:
+ - ip_address:
+ get_input:
+ - mmsc_dmz_protected_virtual_server_ips
+ - 0
+ - ip_address:
+ get_input:
+ - mmsc_dmz_protected_virtual_server_ips
+ - 1
+ - ip_address:
+ get_input:
+ - mmsc_dmz_protected_virtual_server_ips
+ - 2
+ - ip_address:
+ get_input:
+ - mmsc_dmz_protected_snat_ips
+ - 0
+ - ip_address:
+ get_input:
+ - mmsc_dmz_protected_snat_ips
+ - 1
+ - ip_address:
+ get_input:
+ - mmsc_dmz_protected_snat_ips
+ - 2
+ - ip_address:
+ get_input:
+ - mmsc_dmz_protected_snat_ips
+ - 3
+ network:
+ get_input: dmz_protected_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: lb2_instance
+ relationship: tosca.relationships.network.BindsTo
+ lb1_eca_traffic_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: eca_traffic_net_local_ip1
+ allowed_address_pairs:
+ - ip_address:
+ get_input: eca_traffic_net_floating_ip
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: lb1_instance
+ relationship: tosca.relationships.network.BindsTo
+ lb1_dmz_protected_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - lb_dmz_protected_ips
+ - 0
+ allowed_address_pairs:
+ - ip_address:
+ get_input:
+ - mmsc_dmz_protected_virtual_server_ips
+ - 0
+ - ip_address:
+ get_input:
+ - mmsc_dmz_protected_virtual_server_ips
+ - 1
+ - ip_address:
+ get_input:
+ - mmsc_dmz_protected_virtual_server_ips
+ - 2
+ - ip_address:
+ get_input:
+ - mmsc_dmz_protected_snat_ips
+ - 0
+ - ip_address:
+ get_input:
+ - mmsc_dmz_protected_snat_ips
+ - 1
+ - ip_address:
+ get_input:
+ - mmsc_dmz_protected_snat_ips
+ - 2
+ - ip_address:
+ get_input:
+ - mmsc_dmz_protected_snat_ips
+ - 3
+ network:
+ get_input: dmz_protected_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: lb1_instance
+ relationship: tosca.relationships.network.BindsTo
+ lb1_mms_traffic_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: mms_traffic_net_local_ip1
+ allowed_address_pairs:
+ - ip_address:
+ get_input: mms_traffic_net_floating_ip
+ network: mms_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: mms_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: lb1_instance
+ relationship: tosca.relationships.network.BindsTo
+ eca_mgmt_net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ network_name:
+ get_input: eca_mgmt_name
+ subnets:
+ eca_mgmt_network_ip_subnet:
+ name:
+ get_input: eca_mgmt_name
+ cidr:
+ get_input: eca_mgmt_cidr
+ allocation_pools:
+ - start:
+ get_input: eca_mgmt_start
+ end:
+ get_input: eca_mgmt_end
+ eca_trx1_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_eca_traffic_net_ips
+ - 0
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx1
+ relationship: tosca.relationships.network.BindsTo
+ nems2_fe_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: NEMS_FE_volume_type
+ size: '(get_input : nems_volume_size) * 1024'
+ server_nems_be1:
+ type: org.openecomp.resource.vfc.nodes.heat.nems_be
+ properties:
+ flavor:
+ get_input: nems_be_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: nems_be_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ user_data_format: RAW
+ name:
+ get_input: nems_be_names
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: nems_be_volume
+ relationship: nems_volume_attachment
+ server_nems_fe1:
+ type: org.openecomp.resource.vfc.nodes.heat.nems_fe
+ properties:
+ flavor:
+ get_input: nems_fe_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: nems_fe_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ user_data_format: RAW
+ name:
+ get_input:
+ - nems_fe_names
+ - 0
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: nems1_fe_volume
+ relationship: nems1_fe_volume_attachment
+ server_nems_fe2:
+ type: org.openecomp.resource.vfc.nodes.heat.nems_fe
+ properties:
+ flavor:
+ get_input: nems_fe_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: nems_fe_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ user_data_format: RAW
+ name:
+ get_input:
+ - nems_fe_names
+ - 1
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: nems2_fe_volume
+ relationship: nems2_fe_volume_attachment
+ lb2_cor_direct_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - lb_cor_direct_ips
+ - 1
+ allowed_address_pairs:
+ - ip_address:
+ get_input:
+ - mmsc_core_virtual_server_ips
+ - 0
+ - ip_address:
+ get_input:
+ - mmsc_core_virtual_server_ips
+ - 1
+ - ip_address:
+ get_input:
+ - mmsc_core_snat_ips
+ - 0
+ - ip_address:
+ get_input:
+ - mmsc_core_snat_ips
+ - 1
+ - ip_address:
+ get_input:
+ - mmsc_core_snat_ips
+ - 2
+ - ip_address:
+ get_input:
+ - mmsc_core_snat_ips
+ - 3
+ - ip_address:
+ get_input:
+ - mmsc_core_snat_ips
+ - 4
+ network:
+ get_input: cor_direct_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: lb2_instance
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx20_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_oam_ips
+ - 19
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx20
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx20_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_eca_traffic_net_ips
+ - 19
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx20
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx20_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_mgmt_ips
+ - 19
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx20
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx8_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_oam_ips
+ - 7
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx8
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx6_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_oam_ips
+ - 5
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx6
+ relationship: tosca.relationships.network.BindsTo
+ lb2_nems_user_web_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: nems_user_web_net_local_ip2
+ allowed_address_pairs:
+ - ip_address:
+ get_input: nems_user_web_net_floating_ip
+ network: nems_user_web_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: nems_user_web_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: lb2_instance
+ relationship: tosca.relationships.network.BindsTo
+ lb2_instance:
+ type: org.openecomp.resource.vfc.nodes.heat.lb
+ properties:
+ flavor:
+ get_input: lb_flavor_name
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: lb_image_name
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - lb_names
+ - 1
+ eca_trx6_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_eca_traffic_net_ips
+ - 5
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx6
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx8_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_eca_traffic_net_ips
+ - 7
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx8
+ relationship: tosca.relationships.network.BindsTo
+ lb1_nems_user_web_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: nems_user_web_net_local_ip1
+ allowed_address_pairs:
+ - ip_address:
+ get_input: nems_user_web_net_floating_ip
+ network: nems_user_web_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: nems_user_web_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: lb1_instance
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx6_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_mgmt_ips
+ - 5
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx6
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx8_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_mgmt_ips
+ - 7
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx8
+ relationship: tosca.relationships.network.BindsTo
+ ha_net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ network_name:
+ get_input: ha_net_name
+ subnets:
+ ha_net_ip_subnet:
+ name:
+ get_input: ha_net_name
+ cidr:
+ get_input: ha_net_cidr
+ allocation_pools:
+ - start:
+ get_input: ha_net_start
+ end:
+ get_input: ha_net_end
+ server_mmsc1:
+ type: org.openecomp.resource.vfc.nodes.heat.mmsc
+ properties:
+ flavor:
+ get_input: mmsc_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: mmsc_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ user_data_format: RAW
+ name:
+ get_input:
+ - mmsc_names
+ - 0
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: mmsc1_volume
+ relationship: mmsc1_volume_attachment
+ nems_be1_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: nems_be_oam_ips
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_nems_be1
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx2_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_oam_ips
+ - 1
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx2
+ relationship: tosca.relationships.network.BindsTo
+ server_mmsc2:
+ type: org.openecomp.resource.vfc.nodes.heat.mmsc
+ properties:
+ flavor:
+ get_input: mmsc_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: mmsc_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ user_data_format: RAW
+ name:
+ get_input:
+ - mmsc_names
+ - 1
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: mmsc2_volume
+ relationship: mmsc2_volume_attachment
+ nems_be1_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: nems_be_nems_internal_net_ips
+ network: nems_internal_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: nems_internal_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_nems_be1
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx2_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_mgmt_ips
+ - 1
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx2
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx4_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_mgmt_ips
+ - 3
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx4
+ relationship: tosca.relationships.network.BindsTo
+ server_mmsc3:
+ type: org.openecomp.resource.vfc.nodes.heat.mmsc
+ properties:
+ flavor:
+ get_input: mmsc_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: mmsc_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ user_data_format: RAW
+ name:
+ get_input:
+ - mmsc_names
+ - 2
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: mmsc3_volume
+ relationship: mmsc3_volume_attachment
+ nems_be1_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: nems_be_nems_imap_net_ips
+ network: nems_imap_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: nems_imap_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_nems_be1
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx2_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_eca_traffic_net_ips
+ - 1
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx2
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx4_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_eca_traffic_net_ips
+ - 3
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx4
+ relationship: tosca.relationships.network.BindsTo
+ server_eca_trx20:
+ type: org.openecomp.resource.vfc.nodes.heat.eca_trx
+ properties:
+ flavor:
+ get_input: eca_trx_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: eca_trx_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_trx_names
+ - 19
+ eca_trx4_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_oam_ips
+ - 3
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx4
+ relationship: tosca.relationships.network.BindsTo
+ nems_be_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: NEMS_BE_volume_type
+ size: '(get_input : nems_be_volume_size) * 1024'
+ server_mmsc4:
+ type: org.openecomp.resource.vfc.nodes.heat.mmsc
+ properties:
+ flavor:
+ get_input: mmsc_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: mmsc_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ user_data_format: RAW
+ name:
+ get_input:
+ - mmsc_names
+ - 3
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: mmsc4_volume
+ relationship: mmsc4_volume_attachment
+ server_mmsc5:
+ type: org.openecomp.resource.vfc.nodes.heat.mmsc
+ properties:
+ flavor:
+ get_input: mmsc_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: mmsc_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ user_data_format: RAW
+ name:
+ get_input:
+ - mmsc_names
+ - 4
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: mmsc5_volume
+ relationship: mmsc5_volume_attachment
+ eca_trx17_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_oam_ips
+ - 16
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx17
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx18_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_eca_traffic_net_ips
+ - 17
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx18
+ relationship: tosca.relationships.network.BindsTo
+ lb1_cor_direct_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - lb_cor_direct_ips
+ - 0
+ allowed_address_pairs:
+ - ip_address:
+ get_input:
+ - mmsc_core_virtual_server_ips
+ - 0
+ - ip_address:
+ get_input:
+ - mmsc_core_virtual_server_ips
+ - 1
+ - ip_address:
+ get_input:
+ - mmsc_core_snat_ips
+ - 0
+ - ip_address:
+ get_input:
+ - mmsc_core_snat_ips
+ - 1
+ - ip_address:
+ get_input:
+ - mmsc_core_snat_ips
+ - 2
+ - ip_address:
+ get_input:
+ - mmsc_core_snat_ips
+ - 3
+ - ip_address:
+ get_input:
+ - mmsc_core_snat_ips
+ - 4
+ network:
+ get_input: cor_direct_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: lb1_instance
+ relationship: tosca.relationships.network.BindsTo
+ mmsc1_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - mmsc_oam_ips
+ - 0
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_mmsc1
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx17_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_eca_traffic_net_ips
+ - 16
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx17
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx18_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_oam_ips
+ - 17
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx18
+ relationship: tosca.relationships.network.BindsTo
+ mmsc1_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - mmsc_mms_traffic_net_ips
+ - 0
+ network: mms_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: mms_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_mmsc1
+ relationship: tosca.relationships.network.BindsTo
+ mmsc2_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - mmsc_mms_traffic_net_ips
+ - 1
+ network: mms_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: mms_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_mmsc2
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx17_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_mgmt_ips
+ - 16
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx17
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx18_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_mgmt_ips
+ - 17
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx18
+ relationship: tosca.relationships.network.BindsTo
+ mms_traffic_net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ network_name:
+ get_input: mms_traffic_net_name
+ subnets:
+ mms_traffic_ip_subnet:
+ name:
+ get_input: mms_traffic_net_name
+ cidr:
+ get_input: mms_traffic_net_cidr
+ allocation_pools:
+ - start:
+ get_input: mms_traffic_start
+ end:
+ get_input: mms_traffic_end
+ cmaui_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: oam_net_name
+ eca_trx10_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_mgmt_ips
+ - 9
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx10
+ relationship: tosca.relationships.network.BindsTo
+ server_eca_trx13:
+ type: org.openecomp.resource.vfc.nodes.heat.eca_trx
+ properties:
+ flavor:
+ get_input: eca_trx_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: eca_trx_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_trx_names
+ - 12
+ lb1_instance:
+ type: org.openecomp.resource.vfc.nodes.heat.lb
+ properties:
+ flavor:
+ get_input: lb_flavor_name
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: lb_image_name
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - lb_names
+ - 0
+ eca_trx10_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_oam_ips
+ - 9
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx10
+ relationship: tosca.relationships.network.BindsTo
+ server_eca_trx14:
+ type: org.openecomp.resource.vfc.nodes.heat.eca_trx
+ properties:
+ flavor:
+ get_input: eca_trx_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: eca_trx_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_trx_names
+ - 13
+ server_eca_trx15:
+ type: org.openecomp.resource.vfc.nodes.heat.eca_trx
+ properties:
+ flavor:
+ get_input: eca_trx_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: eca_trx_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_trx_names
+ - 14
+ nems1_fe_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: NEMS_FE_volume_type
+ size: '(get_input : nems_volume_size) * 1024'
+ eca_trx10_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_eca_traffic_net_ips
+ - 9
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx10
+ relationship: tosca.relationships.network.BindsTo
+ server_eca_trx16:
+ type: org.openecomp.resource.vfc.nodes.heat.eca_trx
+ properties:
+ flavor:
+ get_input: eca_trx_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: eca_trx_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_trx_names
+ - 15
+ server_eca_trx10:
+ type: org.openecomp.resource.vfc.nodes.heat.eca_trx
+ properties:
+ flavor:
+ get_input: eca_trx_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: eca_trx_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_trx_names
+ - 9
+ server_eca_trx11:
+ type: org.openecomp.resource.vfc.nodes.heat.eca_trx
+ properties:
+ flavor:
+ get_input: eca_trx_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: eca_trx_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_trx_names
+ - 10
+ server_eca_trx12:
+ type: org.openecomp.resource.vfc.nodes.heat.eca_trx
+ properties:
+ flavor:
+ get_input: eca_trx_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: eca_trx_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_trx_names
+ - 11
+ eca_trx14_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_mgmt_ips
+ - 13
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx14
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx13_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_oam_ips
+ - 12
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx13
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx14_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_oam_ips
+ - 13
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx14
+ relationship: tosca.relationships.network.BindsTo
+ mmsc5_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - mmsc_mms_traffic_net_ips
+ - 4
+ network: mms_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: mms_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_mmsc5
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx13_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_mgmt_ips
+ - 12
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx13
+ relationship: tosca.relationships.network.BindsTo
+ mmsc5_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - mmsc_oam_ips
+ - 4
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_mmsc5
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx13_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_eca_traffic_net_ips
+ - 12
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx13
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx14_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_eca_traffic_net_ips
+ - 13
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx14
+ relationship: tosca.relationships.network.BindsTo
+ mmsc2_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - mmsc_oam_ips
+ - 1
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_mmsc2
+ relationship: tosca.relationships.network.BindsTo
+ server_eca_trx17:
+ type: org.openecomp.resource.vfc.nodes.heat.eca_trx
+ properties:
+ flavor:
+ get_input: eca_trx_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: eca_trx_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_trx_names
+ - 16
+ server_eca_trx18:
+ type: org.openecomp.resource.vfc.nodes.heat.eca_trx
+ properties:
+ flavor:
+ get_input: eca_trx_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: eca_trx_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_trx_names
+ - 17
+ server_eca_trx19:
+ type: org.openecomp.resource.vfc.nodes.heat.eca_trx
+ properties:
+ flavor:
+ get_input: eca_trx_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: eca_trx_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_trx_names
+ - 18
+ eca_trx9_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_oam_ips
+ - 8
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx9
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx9_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_mgmt_ips
+ - 8
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx9
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx9_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_eca_traffic_net_ips
+ - 8
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx9
+ relationship: tosca.relationships.network.BindsTo
+ lb2_nems_traffic_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: nems_traffic_net_local_ip2
+ allowed_address_pairs:
+ - ip_address:
+ get_input: nems_traffic_net_floating_ip
+ network: nems_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: nems_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: lb2_instance
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx5_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_eca_traffic_net_ips
+ - 4
+ network: eca_traffic_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: eca_traffic_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx5
+ relationship: tosca.relationships.network.BindsTo
+ eca_traffic_net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ network_name:
+ get_input: eca_traffic_name
+ subnets:
+ eca_traffic_ip_subnet:
+ name:
+ get_input: eca_traffic_name
+ cidr:
+ get_input: eca_traffic_cidr
+ allocation_pools:
+ - start:
+ get_input: eca_traffic_start
+ end:
+ get_input: eca_traffic_end
+ eca_trx1_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_mgmt_ips
+ - 0
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx1
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx5_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_mgmt_ips
+ - 4
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx5
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx1_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_oam_ips
+ - 0
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx1
+ relationship: tosca.relationships.network.BindsTo
+ eca_trx5_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_trx_oam_ips
+ - 4
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_eca_trx5
+ relationship: tosca.relationships.network.BindsTo
+ mmsc3_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: MMSC_volume_type
+ size: '(get_input : mmsc_cinder_volume_size) * 1024'
+ relationship_templates:
+ nems1_fe_volume_attachment:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id: nems1_fe_volume
+ instance_uuid: server_nems_fe1
+ mmsc3_volume_attachment:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id: mmsc3_volume
+ instance_uuid: server_mmsc3
+ mmsc1_volume_attachment:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id: mmsc1_volume
+ instance_uuid: server_mmsc1
+ cmaui1_volume_attachment:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id: cmaui1_volume
+ instance_uuid: server_cmaui1
+ mmsc4_volume_attachment:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id: mmsc4_volume
+ instance_uuid: server_mmsc4
+ nems_volume_attachment:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id: nems_be_volume
+ instance_uuid: server_nems_be1
+ cmaui_volume_attachment:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id: cmaui_volume
+ instance_uuid: server_cmaui
+ nems2_fe_volume_attachment:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id: nems2_fe_volume
+ instance_uuid: server_nems_fe2
+ mmsc5_volume_attachment:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id: mmsc5_volume
+ instance_uuid: server_mmsc5
+ mmsc2_volume_attachment:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id: mmsc2_volume
+ instance_uuid: server_mmsc2
+ groups:
+ MMSC_Capacity_Line:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/MMSC_Capacity_Line.yml
+ description: |
+ HOT template that creates internal networks, load balancers and servers for vMMSC capacity Line 1. #11/23: updated the network definition to meet the juniper best practices way of defining the gateway, DHCP enable for internal networks (L457-L547)
+ members:
+ - server_eca_trx9
+ - server_eca_trx8
+ - server_eca_trx7
+ - server_eca_trx6
+ - server_eca_trx5
+ - nems_internal_net
+ - server_eca_trx4
+ - server_eca_trx3
+ - server_eca_trx2
+ - lb1_mgmt_port
+ - lb2_mms_traffic_port
+ - nems_fe1_port_1
+ - nems_fe2_port_3
+ - server_eca_trx1
+ - nems_fe1_port_2
+ - nems_fe2_port_2
+ - nems_fe2_port_1
+ - nems_fe1_port_0
+ - nems_fe2_port_0
+ - nems_fe1_port_3
+ - nems_fe1_port_4
+ - nems_fe2_port_4
+ - mmsc4_volume
+ - lb2_eca_traffic_port
+ - lb2_ha_net_port
+ - nems_user_web_net
+ - lb1_ha_net_port
+ - mmsc2_volume
+ - nems_traffic_net
+ - eca_trx16_port_0
+ - eca_trx19_port_2
+ - eca_trx16_port_1
+ - eca_trx19_port_1
+ - eca_trx15_port_0
+ - eca_trx19_port_0
+ - lb1_nems_traffic_port
+ - eca_trx11_port_1
+ - eca_trx11_port_2
+ - eca_trx12_port_2
+ - eca_trx12_port_1
+ - eca_trx11_port_0
+ - eca_trx12_port_0
+ - mmsc4_port_0
+ - mmsc3_port_0
+ - eca_trx15_port_2
+ - mmsc3_port_1
+ - mmsc4_port_1
+ - eca_trx15_port_1
+ - eca_trx16_port_2
+ - lb2_mgmt_port
+ - mmsc5_volume
+ - eca_trx7_port_2
+ - eca_trx7_port_0
+ - eca_trx7_port_1
+ - eca_trx3_port_1
+ - eca_trx3_port_0
+ - eca_trx3_port_2
+ - mmsc1_volume
+ - nems_imap_net
+ - lb2_dmz_protected_port
+ - lb1_eca_traffic_port
+ - lb1_dmz_protected_port
+ - lb1_mms_traffic_port
+ - eca_trx1_port_2
+ - nems2_fe_volume
+ - server_nems_be1
+ - server_nems_fe1
+ - server_nems_fe2
+ - lb2_cor_direct_port
+ - eca_trx20_port_0
+ - eca_trx20_port_2
+ - eca_trx20_port_1
+ - eca_trx8_port_0
+ - eca_trx6_port_0
+ - lb2_nems_user_web_port
+ - lb2_instance
+ - eca_trx6_port_2
+ - eca_trx8_port_2
+ - lb1_nems_user_web_port
+ - eca_trx6_port_1
+ - eca_trx8_port_1
+ - ha_net
+ - server_mmsc1
+ - nems_be1_port_0
+ - eca_trx2_port_0
+ - server_mmsc2
+ - nems_be1_port_1
+ - eca_trx2_port_1
+ - eca_trx4_port_1
+ - server_mmsc3
+ - nems_be1_port_2
+ - eca_trx2_port_2
+ - eca_trx4_port_2
+ - server_eca_trx20
+ - eca_trx4_port_0
+ - nems_be_volume
+ - server_mmsc4
+ - server_mmsc5
+ - eca_trx17_port_0
+ - eca_trx18_port_2
+ - lb1_cor_direct_port
+ - mmsc1_port_0
+ - eca_trx17_port_2
+ - eca_trx18_port_0
+ - mmsc1_port_1
+ - mmsc2_port_1
+ - eca_trx17_port_1
+ - eca_trx18_port_1
+ - mms_traffic_net
+ - eca_trx10_port_1
+ - server_eca_trx13
+ - lb1_instance
+ - eca_trx10_port_0
+ - server_eca_trx14
+ - server_eca_trx15
+ - nems1_fe_volume
+ - eca_trx10_port_2
+ - server_eca_trx16
+ - server_eca_trx10
+ - server_eca_trx11
+ - server_eca_trx12
+ - eca_trx14_port_1
+ - eca_trx13_port_0
+ - eca_trx14_port_0
+ - mmsc5_port_1
+ - eca_trx13_port_1
+ - mmsc5_port_0
+ - eca_trx13_port_2
+ - eca_trx14_port_2
+ - mmsc2_port_0
+ - server_eca_trx17
+ - server_eca_trx18
+ - server_eca_trx19
+ - eca_trx9_port_0
+ - eca_trx9_port_1
+ - eca_trx9_port_2
+ - lb2_nems_traffic_port
+ - eca_trx5_port_2
+ - eca_traffic_net
+ - eca_trx1_port_1
+ - eca_trx5_port_1
+ - eca_trx1_port_0
+ - eca_trx5_port_0
+ - mmsc3_volume
+ SG_ECA_MGMT:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/SG_ECA_MGMT.yaml
+ description: |
+ HOT template that creates Security Group and ECA network
+ members:
+ - mms_security_group
+ - eca_mgmt_net
+ cmaui:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/cmaui.yml
+ description: cmaui server template for vMMSC
+ members:
+ - server_cmaui1
+ - server_cmaui
+ - cmaui1_port_0
+ - cmaui_volume
+ - cmaui1_volume
+ - cmaui_port_0 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/expectedOutput/eca_oamServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/expectedOutput/eca_oamServiceTemplate.yaml
new file mode 100644
index 0000000000..90d4df7dab
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/expectedOutput/eca_oamServiceTemplate.yaml
@@ -0,0 +1,569 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: eca_oam
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.eca:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.arb:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ metadata:
+ label: metadata
+ hidden: false
+ immutable: false
+ type: string
+ description: cmaui metadata
+ oam_flavor:
+ label: flavor name
+ hidden: false
+ immutable: false
+ type: string
+ description: OAM flavor name
+ default: lc.xlarge4
+ eca_eca_mgmt_ips:
+ label: eca_mgmt network ips for eca VM
+ hidden: false
+ immutable: false
+ type: list
+ description: internal eca_mgmt network ips for eca VM
+ default:
+ - 172.25.137.242
+ - 172.25.137.243
+ entry_schema:
+ type: string
+ eca_mgmt_net_name:
+ label: internal network name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the internal network
+ default: int_mms_eca_mgmt_net_1
+ ECA_OAM_volume_type:
+ label: eca oam vm volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the target volume backend
+ default: Platinum
+ arb_eca_mgmt_ips:
+ label: eca_mgmt network ips
+ hidden: false
+ immutable: false
+ type: list
+ description: internal eca_mgmt network ips for arb VM
+ default:
+ - 172.25.137.244
+ entry_schema:
+ type: string
+ networks:
+ label: network name
+ hidden: false
+ immutable: false
+ type: string
+ description: cmaui network name
+ cmaui_name:
+ label: cmaui name
+ hidden: false
+ immutable: false
+ type: string
+ description: cmaui name
+ arb_volume_size:
+ label: volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: the size of the ARB volume
+ default: 40
+ vnf_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-ECA_id
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ default: nova
+ oam_image_name:
+ label: image name
+ hidden: false
+ immutable: false
+ type: string
+ description: the OAM image name
+ default: ECABASE
+ oam_volume_size:
+ label: volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: the size of the OAM volume
+ default: 1800
+ swift_eca_url:
+ label: Swift URL
+ hidden: false
+ immutable: false
+ type: string
+ description: Base URL for eca swift object store
+ default: http://object-store.rdm2.cci.com:8080/v1/AUTH_1bbab536a19b4756926e7d0ec1eb543c/eca
+ oam_net_name:
+ label: oam network name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the oam network
+ default: oam_protected_net_0
+ ARB_volume_type:
+ label: arb vm volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the target volume backend
+ default: Platinum
+ eca_names:
+ label: oam servers names
+ hidden: false
+ immutable: false
+ type: list
+ description: the names of the OAM1,OAM2 VM instances
+ default:
+ - ZRDM1MMSC02OAM001
+ - ZRDM1MMSC02OAM002
+ entry_schema:
+ type: string
+ arbiter_flavor:
+ label: flavor name
+ hidden: false
+ immutable: false
+ type: string
+ description: arbiter flavor name
+ default: m1.large2
+ eca_oam_ips:
+ label: oam network ips
+ hidden: false
+ immutable: false
+ type: list
+ description: the ips of oam networks for eca VM
+ default:
+ - 107.250.172.44
+ - 107.250.172.45
+ entry_schema:
+ type: string
+ security_group_name:
+ label: security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of security group
+ default: mmsc_security_group_1
+ user_data:
+ label: user data
+ hidden: false
+ immutable: false
+ type: string
+ description: cmaui user data
+ cmaui_image:
+ label: cmaui image
+ hidden: false
+ immutable: false
+ type: string
+ description: cmaui image
+ arb_names:
+ label: arbiter server names
+ hidden: false
+ immutable: false
+ type: list
+ description: the names of the arbiter VM instances
+ default:
+ - ZRDM1MMSC02ARB001
+ entry_schema:
+ type: string
+ cmaui_flavor:
+ label: flavor name
+ hidden: false
+ immutable: false
+ type: string
+ description: cmaui flavor name
+ user_data_format:
+ label: user data
+ hidden: false
+ immutable: false
+ type: string
+ description: cmaui user data
+ eca_oam_gateway:
+ label: oam1 oam gateway
+ hidden: false
+ immutable: false
+ type: string
+ description: the ip of oam gateway
+ default: 107.250.172.1
+ arb_oam_ips:
+ label: oam network ips for arb VM
+ hidden: false
+ immutable: false
+ type: list
+ description: oam network ips for eca VM
+ default:
+ - 107.250.172.46
+ entry_schema:
+ type: string
+ node_templates:
+ arb_mgmt_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - arb_oam_ips
+ - 0
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: arb_instance
+ relationship: tosca.relationships.network.BindsTo
+ oam2_mgmt_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_oam_ips
+ - 1
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: oam2_instance
+ relationship: tosca.relationships.network.BindsTo
+ arb_instance:
+ type: org.openecomp.resource.vfc.nodes.heat.arb
+ properties:
+ flavor:
+ get_input: arbiter_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: oam_image_name
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - arb_names
+ - 0
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: arb_volume
+ relationship: arb_volume_attachment
+ arb_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: ARB_volume_type
+ size: '(get_input : arb_volume_size) * 1024'
+ oam1_instance:
+ type: org.openecomp.resource.vfc.nodes.heat.eca
+ properties:
+ flavor:
+ get_input: oam_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: oam_image_name
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_names
+ - 0
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: oam1_volume
+ relationship: oam1_volume_attachment
+ oam2_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: ECA_OAM_volume_type
+ size: '(get_input : oam_volume_size) * 1024'
+ oam1_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: ECA_OAM_volume_type
+ size: '(get_input : oam_volume_size) * 1024'
+ oam1_int_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_eca_mgmt_ips
+ - 0
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: oam1_instance
+ relationship: tosca.relationships.network.BindsTo
+ oam1_mgmt_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_oam_ips
+ - 0
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: oam1_instance
+ relationship: tosca.relationships.network.BindsTo
+ arb_int_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - arb_eca_mgmt_ips
+ - 0
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: arb_instance
+ relationship: tosca.relationships.network.BindsTo
+ oam2_int_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - eca_eca_mgmt_ips
+ - 1
+ network:
+ get_input: eca_mgmt_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: oam2_instance
+ relationship: tosca.relationships.network.BindsTo
+ oam2_instance:
+ type: org.openecomp.resource.vfc.nodes.heat.eca
+ properties:
+ flavor:
+ get_input: oam_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: oam_image_name
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ name:
+ get_input:
+ - eca_names
+ - 1
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: oam2_volume
+ relationship: oam2_volume_attachment
+ relationship_templates:
+ oam2_volume_attachment:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id: oam2_volume
+ instance_uuid: oam2_instance
+ oam1_volume_attachment:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id: oam1_volume
+ instance_uuid: oam1_instance
+ arb_volume_attachment:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id: arb_volume
+ instance_uuid: arb_instance
+ groups:
+ eca_oam:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/eca_oam.yaml
+ description: This stack creates two ECA OAM VM and one ARB VM
+ members:
+ - arb_mgmt_port
+ - oam2_mgmt_port
+ - arb_instance
+ - arb_volume
+ - oam1_instance
+ - oam2_volume
+ - oam1_volume
+ - oam1_int_port
+ - oam1_mgmt_port
+ - arb_int_port
+ - oam2_int_port
+ - oam2_instance
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.eca_oam
+ capabilities:
+ attachment_oam2_volume:
+ - oam2_volume
+ - attachment
+ binding_oam2_instance:
+ - oam2_instance
+ - binding
+ attachment_oam2_int_port:
+ - oam2_int_port
+ - attachment
+ attachment_oam1_volume:
+ - oam1_volume
+ - attachment
+ os_oam1_instance:
+ - oam1_instance
+ - os
+ scalable_oam2_instance:
+ - oam2_instance
+ - scalable
+ scalable_arb_instance:
+ - arb_instance
+ - scalable
+ endpoint_oam1_instance:
+ - oam1_instance
+ - endpoint
+ binding_arb_instance:
+ - arb_instance
+ - binding
+ host_arb_instance:
+ - arb_instance
+ - host
+ endpoint_arb_instance:
+ - arb_instance
+ - endpoint
+ attachment_oam1_int_port:
+ - oam1_int_port
+ - attachment
+ attachment_arb_volume:
+ - arb_volume
+ - attachment
+ host_oam1_instance:
+ - oam1_instance
+ - host
+ os_oam2_instance:
+ - oam2_instance
+ - os
+ endpoint_oam2_instance:
+ - oam2_instance
+ - endpoint
+ scalable_oam1_instance:
+ - oam1_instance
+ - scalable
+ host_oam2_instance:
+ - oam2_instance
+ - host
+ os_arb_instance:
+ - arb_instance
+ - os
+ attachment_oam1_mgmt_port:
+ - oam1_mgmt_port
+ - attachment
+ attachment_arb_int_port:
+ - arb_int_port
+ - attachment
+ attachment_arb_mgmt_port:
+ - arb_mgmt_port
+ - attachment
+ attachment_oam2_mgmt_port:
+ - oam2_mgmt_port
+ - attachment
+ binding_oam1_instance:
+ - oam1_instance
+ - binding
+ requirements:
+ link_oam2_mgmt_port:
+ - oam2_mgmt_port
+ - link
+ link_oam1_int_port:
+ - oam1_int_port
+ - link
+ link_oam1_mgmt_port:
+ - oam1_mgmt_port
+ - link
+ local_storage_arb_instance:
+ - arb_instance
+ - local_storage
+ link_arb_mgmt_port:
+ - arb_mgmt_port
+ - link
+ local_storage_oam2_instance:
+ - oam2_instance
+ - local_storage
+ link_arb_int_port:
+ - arb_int_port
+ - link
+ link_oam2_int_port:
+ - oam2_int_port
+ - link
+ local_storage_oam1_instance:
+ - oam1_instance
+ - local_storage \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/MANIFEST.json
new file mode 100644
index 0000000000..167ae4e9d8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/MANIFEST.json
@@ -0,0 +1,37 @@
+{
+ "name": "multiple_not_nested",
+ "description": "multiple heat files in zip, no nesting",
+ "version": "2013-05-23",
+ "data": [{
+ "file": "cmaui.yml",
+ "type": "HEAT",
+ "data": [{
+ "file": "cmaui.env",
+ "type": "HEAT_ENV"
+ }]
+ },
+ {
+ "file": "eca_oam.yaml",
+ "type": "HEAT",
+ "data": [{
+ "file": "eca_oam.env",
+ "type": "HEAT_ENV"
+ }]
+ },
+ {
+ "file": "MMSC_Capacity_Line.yml",
+ "type": "HEAT",
+ "data": [{
+ "file": "MMSC_Capacity_Line_1.env",
+ "type": "HEAT_ENV"
+ }]
+ },
+ {
+ "file": "SG_ECA_MGMT.yaml",
+ "type": "HEAT",
+ "data": [{
+ "file": "sg_eca_mgmt.env",
+ "type": "HEAT_ENV"
+ }]
+ }]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/MMSC_Capacity_Line.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/MMSC_Capacity_Line.yml
new file mode 100644
index 0000000000..9e36eb9cd4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/MMSC_Capacity_Line.yml
@@ -0,0 +1,3219 @@
+heat_template_version: 2013-05-23
+
+description: >
+ HOT template that creates internal networks, load balancers and servers for vMMSC capacity Line 1.
+ #11/23: updated the network definition to meet the juniper best practices way of defining the gateway, DHCP enable for internal networks (L457-L547)
+
+parameters:
+ vnf_id:
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_the_MMSC_id
+ oam_net_name:
+ type: string
+ label: UID of OAM network
+ description: UID of OAM network
+ oam_network_netmask:
+ type: string
+ label: oam network netmask
+ description: oam network gateway
+ oam_network_gateway:
+ type: string
+ label: oam network gateway
+ description: oam network gateway
+ oam_network_route_1:
+ type: string
+ label: oam network route 1
+ description: oam network route 1
+ oam_network_route_2:
+ type: string
+ label: oam network route 2
+ description: oam network route 2
+ external_dns:
+ type: string
+ label: dns server
+ description: dns server for MMSC
+ external_ntp:
+ type: string
+ label: ntp server
+ description: ntp server for MMSC
+ lb_oam_ips:
+ type: comma_delimited_list
+ label: management network ips for mmsc lb
+ description: the ips of the management network for mmsc lb
+ dmz_protected_net_name:
+ type: string
+ label: UID of dmz_protected network
+ description: UID of dmz_protected network
+ lb_dmz_protected_ips:
+ type: comma_delimited_list
+ label: dmz protected network local ips for lb VM
+ description: local ips of the dmz protected network for lb VM
+ cor_direct_net_name:
+ type: string
+ label: cor direct net UID
+ description: cor direct net
+ lb_cor_direct_ips:
+ type: comma_delimited_list
+ label: cor direct network local ips for lb VM
+ description: local ips of cor direct network for lb VM
+ mms_traffic_net_name:
+ type: string
+ label: Name of MMS traffic network
+ description: Name of MMS traffic network
+ mms_traffic_net_cidr:
+ type: string
+ label: MMS traffic network address (CIDR notation)
+ description: MMS traffic network address (CIDR notation)
+ mms_traffic_netmask:
+ type: string
+ label: MMS traffic network subnet mask
+ description: MMS traffic network subnet mask
+ mms_traffic_net_gateway:
+ type: string
+ label: MMS traffic network gateway address
+ description: MMS traffic network gateway address
+ mms_traffic_start:
+ type: string
+ label: mmsc traffic start IP
+ description: mmsc traffic start IP
+ mms_traffic_end:
+ type: string
+ label: mmsc traffic end IP
+ description: mmsc traffic end IP
+ mms_traffic_net_local_ip1:
+ type: string
+ label: mmsc traffic network local ip1
+ description: the local ip1 of the mmsc traffic network
+ mms_traffic_net_local_ip2:
+ type: string
+ label: mmsc traffic network local ip2
+ description: the local ip2 of the mmsc traffic network
+ mms_traffic_net_floating_ip:
+ type: string
+ label: mmsc traffic floating ip
+ description: mmsc traffic floating ip
+ nems_internal_name:
+ type: string
+ label: nems internal network name
+ description: nems internal network name
+ nems_internal_start:
+ type: string
+ label: nems internal start
+ description: nems internal start
+ nems_internal_end:
+ type: string
+ label: nems internal end
+ description: nems internal end
+ nems_internal_cidr:
+ type: string
+ label: nems ineternal cidr
+ description: nems internal cidr
+ nems_internal_netmask:
+ type: string
+ label: NEMS internal network subnet mask
+ description: NEMS internal network subnet mask
+ nems_internal_gateway:
+ type: string
+ label: nems internal gw
+ description: nems internal gw
+ nems_traffic_name:
+ type: string
+ label: nems traffic name
+ description: nems traffic name
+ nems_traffic_start:
+ type: string
+ label: nems traffic start
+ description: nems traffic start
+ nems_traffic_end:
+ type: string
+ label: nems traffic end
+ description: nems traffic end
+ nems_traffic_cidr:
+ type: string
+ label: nems traffic cidr
+ description: nems traffic cidr
+ nems_traffic_netmask:
+ type: string
+ label: NEMS traffic network subnet mask
+ description: NEMS traffic network subnet mask
+ nems_traffic_gateway:
+ type: string
+ label: NEMS traffic network gateway
+ description: NEMS traffic network gateway
+ nems_traffic_net_local_ip1:
+ type: string
+ label: nems traffic network local ip1
+ description: the local ip1 of the nems traffic network
+ nems_traffic_net_local_ip2:
+ type: string
+ label: nems traffic network local ip2
+ description: the local ip2 of the nems traffic network
+ nems_traffic_net_floating_ip:
+ type: string
+ label: nems traffic floating ip
+ description: nems traffic floating ip
+ nems_user_web_name:
+ type: string
+ label: nems user web name
+ description: nems user web name
+ nems_user_web_start:
+ type: string
+ label: nems user web start
+ description: nems user web end
+ nems_user_web_end:
+ type: string
+ label: nems user web end
+ description: nems user web end
+ nems_user_web_cidr:
+ type: string
+ label: nems user web cidr
+ description: nems user web cidr
+ nems_user_web_netmask:
+ type: string
+ label: NEMS user web network subnet mask
+ description: NEMS user web network subnet mask
+ nems_user_web_gateway:
+ type: string
+ label: NEMS user web network gateway
+ description: NEMS user web network gateway
+ nems_user_web_net_local_ip1:
+ type: string
+ label: nems user web network local ip1
+ description: the local ip1 of the nems user web network
+ nems_user_web_net_local_ip2:
+ type: string
+ label: nems user web network local ip2
+ description: the local ip2 of the nems user web network
+ nems_user_web_net_floating_ip:
+ type: string
+ label: nems user web floating ip
+ description: nems user web floating ip
+ nems_imap_name:
+ type: string
+ label: nems imap name
+ description: nems imap name
+ nems_imap_netmask:
+ type: string
+ label: nems imap subnet mask
+ description: nems imap subnet mask
+ nems_imap_start:
+ type: string
+ label: nems imap start
+ description: nems imap start
+ nems_imap_end:
+ type: string
+ label: nems imap end
+ description: nems imap end
+ nems_imap_cidr:
+ type: string
+ label: nems imap cidr
+ description: nems imap cidr
+ nems_imap_gateway:
+ type: string
+ label: nems imap gateway
+ description: nems imap gateway
+ eca_traffic_name:
+ type: string
+ label: eca traffic name
+ description: eca traffic name
+ eca_traffic_start:
+ type: string
+ label: eca traffic start
+ description: eca traffic start
+ eca_traffic_end:
+ type: string
+ label: eca traffic end
+ description: eca traffic end
+ eca_traffic_cidr:
+ type: string
+ label: eca traffic cidr
+ description: eca traffic cidr
+ eca_traffic_netmask:
+ type: string
+ label: ECA traffic network subnet mask
+ description: ECA traffic network subnet mask
+ eca_traffic_net_gateway:
+ type: string
+ label: eca_traffic network gateway
+ description: eca_traffic network gateway
+ eca_traffic_net_local_ip1:
+ type: string
+ label: eca traffic network local ip1
+ description: the local ip1 of the eca traffic network
+ eca_traffic_net_local_ip2:
+ type: string
+ label: eca traffic network local ip2
+ description: the local ip2 of the eca traffic network
+ eca_traffic_net_floating_ip:
+ type: string
+ label: eca traffic floating ip
+ description: eca traffic floating ip
+ ha_net_name:
+ type: string
+ label: ha_failover network name
+ description: ha_failover network name
+ ha_net_start:
+ type: string
+ label: ha net start
+ description: ha net start
+ ha_net_end:
+ type: string
+ label: ha net end
+ description: ha net end
+ ha_net_cidr:
+ type: string
+ label: ha net cidr
+ description: ha net cidr
+ ha_net_local_ip1:
+ type: string
+ label: ha net network local ip1
+ description: the local ip1 of the ha network
+ ha_net_local_ip2:
+ type: string
+ label: ha net network local ip2
+ description: the local ip2 of the ha network
+ lb_names:
+ type: comma_delimited_list
+ label: MMSC load balancer instance names
+ description: MMSC load balancer instance names
+ lb_image_name:
+ type: string
+ label: MMSC load balancer image name
+ description: MMSC load balancer image name
+ lb_flavor_name:
+ type: string
+ label: Load balancer flavor name
+ description: the flavor name of MMSC load balancer instance
+ availability_zone_0:
+ type: string
+ label: MMSC availabilityzone name
+ description: MMSC availabilityzone name
+ security_group_name:
+ type: string
+ label: MMSC security group name
+ description: MMSC security group name
+ mmsc_image:
+ type: string
+ label: Image for MMSC server
+ description: Image for MMSC server
+ mmsc_flavor:
+ type: string
+ label: Flavor for MMSC server
+ description: Flavor for MMSC server
+ mmsc_cinder_volume_size:
+ type: number
+ label: MMSC Cinder volume size
+ description: the size of the MMSC Cinder volume
+ nems_fe_image:
+ type: string
+ label: Image for NEMS FE server
+ description: Image for NEMS FE server
+ nems_fe_flavor:
+ type: string
+ label: Flavor for NEMS FE server
+ description: Flavor for NEMS FE server
+ nems_be_image:
+ type: string
+ label: Image for NEMS BE server
+ description: Image for NEMS BE server
+ nems_be_flavor:
+ type: string
+ label: Flavor for NEMS BE server
+ description: Flavor for NEMS BE server
+ eca_trx_image:
+ type: string
+ label: Image for ECA TRX server
+ description: Image for ECA TRX server
+ eca_trx_flavor:
+ type: string
+ label: Flavor for ECA TRX server
+ description: Flavor for ECA TRX server
+ mmsc_oam_ips:
+ type: comma_delimited_list
+ label: MMSC oam_net IP addresses
+ description: MMSC oam_net IP addresses
+ mmsc_mms_traffic_net_ips:
+ type: comma_delimited_list
+ label: MMSC mms_traffic_net IP addresses
+ description: MMSC mms_traffic_net IP addresses
+ nems_fe_names:
+ type: comma_delimited_list
+ label: NEMS_FE server names
+ description: NEMS_FE server names
+ nems_fe_node_roles:
+ type: comma_delimited_list
+ label: nems fe node roles
+ description: nems fe node roles
+ nems_fe_oam_ips:
+ type: comma_delimited_list
+ label: OAM_net IP for NEMS_FE
+ description: OAM_net IP for NEMS_FE
+ nems_fe_nems_traffic_net_ips:
+ type: comma_delimited_list
+ label: nems_traffic_net IPs for NEMS_FE
+ description: nems_traffic_net IPs for NEMS_FE
+ nems_fe_nems_user_web_net_ips:
+ type: comma_delimited_list
+ label: nems_web_user_net IPs for NEMS_FE
+ description: nems_web_user_net IPs for NEMS_FE
+ nems_fe_nems_internal_net_ips:
+ type: comma_delimited_list
+ label: nems_internal_net IPs for NEMS_FE
+ description: nems_internal_net IPs for NEMS_FE
+ nems_fe_nems_imap_net_ips:
+ type: comma_delimited_list
+ label: nems_imap_net IPs for NEMS_FE
+ description: nems_imap_net IPs for NEMS_FE
+ nems_be_names:
+ type: string
+ label: NEMS_BE server names
+ description: NEMS_BE server names
+ nems_be_node_roles:
+ type: string
+ label: nems node roles
+ description: nems node roles
+ nems_be_oam_ips:
+ type: string
+ label: OAM net IPs for NEMS_BE
+ description: OAM net IPs for NEMS_BE
+ nems_be_nems_internal_net_ips:
+ type: string
+ label: nems internal net IPs for NEMS_BE
+ description: nems internal net IPs for NEMS_BE
+ nems_be_nems_imap_net_ips:
+ type: string
+ label: nems imap_net IPs for NEMS_BE
+ description: nems imap net IPs for NEMS_BE
+ eca_trx_oam_ips:
+ type: comma_delimited_list
+ label: OAM net IP for ECA_TRX
+ description: OAM net IP for ECA_TRX
+ eca_trx_mgmt_ips:
+ type: comma_delimited_list
+ label: eca mgmt net IP for ECA_TRX
+ description: eca mgmt net IP for ECA_TRX
+ timezone:
+ type: string
+ label: timezone
+ description: timezone
+ eca_trx_names:
+ type: comma_delimited_list
+ label: ECA_TRX server names
+ description: ECA_TRX server names
+ eca_trx_eca_traffic_net_ips:
+ type: comma_delimited_list
+ label: eca traffic net IPs for ECA_TRX
+ description: eca traffic net IPs for ECA_TRX
+ mmsc_names:
+ type: comma_delimited_list
+ label: MMSC server names
+ description: MMSC server names
+ nems_volume_size:
+ type: number
+ label: nems fe volume size
+ description: nems fe volume size
+ nems_be_volume_size:
+ type: number
+ label: nems be volume size
+ description: nems be volume size
+ MMSC_volume_type:
+ type: string
+ label: MMSC vm volume type
+ description: the name of the target volume backend
+ NEMS_FE_volume_type:
+ type: string
+ label: nems fe vm volume type
+ description: the name of the target volume backend
+ NEMS_BE_volume_type:
+ type: string
+ label: nems be vm volume type
+ description: the name of the target volume backend
+ mmsc_core_virtual_server_ips:
+ type: comma_delimited_list
+ label: mmsc core virtual server ips
+ description: mmsc core virtual server ips
+ mmsc_core_snat_ips:
+ type: comma_delimited_list
+ label: mmsc core snat ips
+ description: mmsc core snat ips
+ mmsc_dmz_protected_virtual_server_ips:
+ type: comma_delimited_list
+ label: mmsc dmz_protected virtual server ips
+ description: mmsc dmz_protected virtual server ips
+ mmsc_dmz_protected_snat_ips:
+ type: comma_delimited_list
+ label: mmsc dmz_protected snat ips
+ description: mmsc dmz_protected snat ips
+ eca_mgmt_net_name:
+ type: string
+ label: eca management network ID
+ description: Network ID for eca management
+
+resources:
+ mms_traffic_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: mms_traffic_net_name }
+
+ mms_traffic_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: mms_traffic_net_name}
+ network_id: { get_resource: mms_traffic_net }
+ cidr: { get_param: mms_traffic_net_cidr }
+ allocation_pools: [{"start": {get_param: mms_traffic_start}, "end": {get_param: mms_traffic_end}}]
+
+ nems_internal_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: {get_param: nems_internal_name}
+
+ nems_internal_network_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: nems_internal_name}
+ allocation_pools: [{"start": {get_param: nems_internal_start}, "end": {get_param: nems_internal_end}}]
+ cidr: {get_param: nems_internal_cidr}
+ network_id: {get_resource: nems_internal_net}
+
+ nems_traffic_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: {get_param: nems_traffic_name}
+
+ nems_traffic_network_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: nems_traffic_name}
+ allocation_pools: [{"start": {get_param: nems_traffic_start}, "end": {get_param: nems_traffic_end}}]
+ cidr: {get_param: nems_traffic_cidr}
+ network_id: {get_resource: nems_traffic_net}
+
+ nems_user_web_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: {get_param: nems_user_web_name}
+
+ nems_user_web_network_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: nems_user_web_name}
+ allocation_pools: [{"start": {get_param: nems_user_web_start}, "end": {get_param: nems_user_web_end}}]
+ cidr: {get_param: nems_user_web_cidr}
+ network_id: {get_resource: nems_user_web_net}
+
+ nems_imap_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: {get_param: nems_imap_name}
+
+ nems_imap_network_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: nems_imap_name}
+ allocation_pools: [{"start": {get_param: nems_imap_start}, "end": {get_param: nems_imap_end}}]
+ cidr: {get_param: nems_imap_cidr}
+ network_id: {get_resource: nems_imap_net}
+
+ eca_traffic_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: {get_param: eca_traffic_name}
+
+ eca_traffic_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: eca_traffic_name}
+ allocation_pools: [{"start": {get_param: eca_traffic_start}, "end": {get_param: eca_traffic_end}}]
+ cidr: {get_param: eca_traffic_cidr}
+ network_id: {get_resource: eca_traffic_net}
+
+ ha_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: {get_param: ha_net_name}
+
+ ha_net_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: ha_net_name}
+ allocation_pools: [{"start": {get_param: ha_net_start}, "end": {get_param: ha_net_end}}]
+ cidr: {get_param: ha_net_cidr}
+ network_id: {get_resource: ha_net}
+
+ lb1_instance:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: [lb_names, 0]}
+ image: {get_param: lb_image_name}
+ flavor: {get_param: lb_flavor_name}
+ availability_zone: {get_param: availability_zone_0}
+ networks:
+ - port: {get_resource: lb1_mgmt_port}
+ - port: {get_resource: lb1_dmz_protected_port}
+ - port: {get_resource: lb1_cor_direct_port}
+ - port: {get_resource: lb1_mms_traffic_port}
+ - port: {get_resource: lb1_nems_traffic_port}
+ - port: {get_resource: lb1_nems_user_web_port}
+ - port: {get_resource: lb1_eca_traffic_port}
+ - port: {get_resource: lb1_ha_net_port}
+ metadata:
+ vnf_id: { get_param: vnf_id }
+
+ lb1_mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [lb_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb1_mms_traffic_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: mms_traffic_net}
+ fixed_ips: [{"ip_address": {get_param: mms_traffic_net_local_ip1}}]
+ allowed_address_pairs: [{"ip_address": {get_param: mms_traffic_net_floating_ip} }]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb1_dmz_protected_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: dmz_protected_net_name}
+ fixed_ips: [{"ip_address": {get_param: [lb_dmz_protected_ips, 0]}}]
+ allowed_address_pairs: [{"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 0]}}, {"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 1]}}, {"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 2]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 0]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 1]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 2]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 3]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb1_cor_direct_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: cor_direct_net_name}
+ fixed_ips: [{"ip_address": {get_param: [lb_cor_direct_ips, 0]}}]
+ allowed_address_pairs: [{"ip_address": {get_param: [mmsc_core_virtual_server_ips, 0]}}, {"ip_address": {get_param: [mmsc_core_virtual_server_ips, 1]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 0]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 1]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 2]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 3]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 4]}} ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb1_nems_traffic_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: nems_traffic_net}
+ fixed_ips: [{"ip_address": {get_param: nems_traffic_net_local_ip1}}]
+ allowed_address_pairs: [{"ip_address": {get_param: nems_traffic_net_floating_ip} }]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb1_nems_user_web_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: nems_user_web_net}
+ fixed_ips: [{"ip_address": {get_param: nems_user_web_net_local_ip1}}]
+ allowed_address_pairs: [{"ip_address": {get_param: nems_user_web_net_floating_ip} }]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb1_ha_net_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: ha_net}
+ fixed_ips: [{"ip_address": {get_param: ha_net_local_ip1}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb1_eca_traffic_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: eca_traffic_net}
+ fixed_ips: [{"ip_address": {get_param: eca_traffic_net_local_ip1}}]
+ allowed_address_pairs: [{"ip_address": {get_param: eca_traffic_net_floating_ip} }]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb2_instance:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: [lb_names, 1]}
+ image: {get_param: lb_image_name}
+ flavor: {get_param: lb_flavor_name}
+ availability_zone: {get_param: availability_zone_0}
+ networks:
+ - port: {get_resource: lb2_mgmt_port}
+ - port: {get_resource: lb2_dmz_protected_port}
+ - port: {get_resource: lb2_cor_direct_port}
+ - port: {get_resource: lb2_mms_traffic_port}
+ - port: {get_resource: lb2_nems_traffic_port}
+ - port: {get_resource: lb2_nems_user_web_port}
+ - port: {get_resource: lb2_eca_traffic_port}
+ - port: {get_resource: lb2_ha_net_port}
+ metadata:
+ vnf_id: { get_param: vnf_id }
+
+ lb2_mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [lb_oam_ips, 1]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb2_mms_traffic_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: mms_traffic_net}
+ fixed_ips: [{"ip_address": {get_param: mms_traffic_net_local_ip2}}]
+ allowed_address_pairs: [{"ip_address": {get_param: mms_traffic_net_floating_ip}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb2_dmz_protected_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: dmz_protected_net_name}
+ fixed_ips: [{"ip_address": {get_param: [lb_dmz_protected_ips, 1]}}]
+ allowed_address_pairs: [{"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 0]}}, {"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 1]}}, {"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 2]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 0]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 1]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 2]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 3]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb2_cor_direct_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: cor_direct_net_name}
+ fixed_ips: [{"ip_address": {get_param: [lb_cor_direct_ips, 1]}}]
+ allowed_address_pairs: [{"ip_address": {get_param: [mmsc_core_virtual_server_ips, 0]}}, {"ip_address": {get_param: [mmsc_core_virtual_server_ips, 1]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 0]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 1]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 2]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 3]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 4]}} ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb2_nems_traffic_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: nems_traffic_net}
+ fixed_ips: [{"ip_address": {get_param: nems_traffic_net_local_ip2}}]
+ allowed_address_pairs: [{"ip_address": {get_param: nems_traffic_net_floating_ip}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb2_nems_user_web_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: nems_user_web_net}
+ fixed_ips: [{"ip_address": {get_param: nems_user_web_net_local_ip2}}]
+ allowed_address_pairs: [{"ip_address": {get_param: nems_user_web_net_floating_ip}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb2_ha_net_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: ha_net}
+ fixed_ips: [{"ip_address": {get_param: ha_net_local_ip2}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ lb2_eca_traffic_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: eca_traffic_net}
+ fixed_ips: [{"ip_address": {get_param: eca_traffic_net_local_ip2}}]
+ allowed_address_pairs: [{"ip_address": {get_param: eca_traffic_net_floating_ip} }]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_mmsc1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [mmsc_names, 0]}
+ image: { get_param: mmsc_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: mmsc_flavor }
+ networks:
+ - port: { get_resource: mmsc1_port_0 }
+ - port: { get_resource: mmsc1_port_1 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ mmsc.mgmt.ip=${mmsc.mgmt.ip}
+ mmsc.mgmt.netmask=${mmsc.mgmt.netmask}
+ mmsc.mgmt.gateway=${mmsc.mgmt.gateway}
+ mmsc.traffic.ip=${mmsc.traffic.ip}
+ mmsc.traffic.netmask=${mmsc.traffic.netmask}
+ mmsc.traffic.gateway=${mmsc.traffic.gateway}
+ mmsc.mgmt.route.1=${mmsc.mgmt.route.1}
+ mmsc.mgmt.route.2=${mmsc.mgmt.route.2}
+ mmsc.external.dns=${mmsc.external.dns}
+ mmsc.external.ntp=${mmsc.external.ntp}
+ mmsc.hostname=${mmsc.hostname}
+ mmsc.timezone=${mmsc.timezone}
+ params:
+ ${mmsc.mgmt.ip}: {get_param: [mmsc_oam_ips, 0]}
+ ${mmsc.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${mmsc.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${mmsc.traffic.ip}: {get_param: [mmsc_mms_traffic_net_ips, 0]}
+ ${mmsc.traffic.netmask}: {get_param: mms_traffic_netmask}
+ ${mmsc.traffic.gateway}: {get_param: mms_traffic_net_gateway}
+ ${mmsc.mgmt.route.1}: {get_param: oam_network_route_1}
+ ${mmsc.mgmt.route.2}: {get_param: oam_network_route_2}
+ ${mmsc.external.dns}: {get_param: external_dns}
+ ${mmsc.external.ntp}: {get_param: external_ntp}
+ ${mmsc.hostname}: {get_param: [mmsc_names, 0]}
+ ${mmsc.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ mmsc1_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: mmsc_cinder_volume_size}
+ volume_type: {get_param: MMSC_volume_type}
+
+ mmsc1_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: mmsc1_volume}
+ instance_uuid: {get_resource: server_mmsc1}
+
+ mmsc1_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [
+ "ip_address": {get_param: [mmsc_oam_ips, 0]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ mmsc1_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: mms_traffic_net}
+ fixed_ips: [
+ "ip_address": {get_param: [mmsc_mms_traffic_net_ips, 0]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_mmsc2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [mmsc_names, 1]}
+ image: { get_param: mmsc_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: mmsc_flavor }
+ networks:
+ - port: { get_resource: mmsc2_port_0 }
+ - port: { get_resource: mmsc2_port_1 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ mmsc.mgmt.ip=${mmsc.mgmt.ip}
+ mmsc.mgmt.netmask=${mmsc.mgmt.netmask}
+ mmsc.mgmt.gateway=${mmsc.mgmt.gateway}
+ mmsc.traffic.ip=${mmsc.traffic.ip}
+ mmsc.traffic.netmask=${mmsc.traffic.netmask}
+ mmsc.traffic.gateway=${mmsc.traffic.gateway}
+ mmsc.mgmt.route.1=${mmsc.mgmt.route.1}
+ mmsc.mgmt.route.2=${mmsc.mgmt.route.2}
+ mmsc.external.dns=${mmsc.external.dns}
+ mmsc.external.ntp=${mmsc.external.ntp}
+ mmsc.hostname=${mmsc.hostname}
+ mmsc.timezone=${mmsc.timezone}
+ params:
+ ${mmsc.mgmt.ip}: {get_param: [mmsc_oam_ips, 1]}
+ ${mmsc.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${mmsc.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${mmsc.traffic.ip}: {get_param: [mmsc_mms_traffic_net_ips, 1]}
+ ${mmsc.traffic.netmask}: {get_param: mms_traffic_netmask}
+ ${mmsc.traffic.gateway}: {get_param: mms_traffic_net_gateway}
+ ${mmsc.mgmt.route.1}: {get_param: oam_network_route_1}
+ ${mmsc.mgmt.route.2}: {get_param: oam_network_route_2}
+ ${mmsc.external.dns}: {get_param: external_dns}
+ ${mmsc.external.ntp}: {get_param: external_ntp}
+ ${mmsc.hostname}: {get_param: [mmsc_names, 1]}
+ ${mmsc.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ mmsc2_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: mmsc_cinder_volume_size}
+ volume_type: {get_param: MMSC_volume_type}
+
+ mmsc2_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: mmsc2_volume}
+ instance_uuid: {get_resource: server_mmsc2}
+
+ mmsc2_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [
+ "ip_address": {get_param: [mmsc_oam_ips, 1]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ mmsc2_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: mms_traffic_net}
+ fixed_ips: [
+ "ip_address": {get_param: [mmsc_mms_traffic_net_ips, 1]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_mmsc3:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [mmsc_names, 2]}
+ image: { get_param: mmsc_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: mmsc_flavor }
+ networks:
+ - port: { get_resource: mmsc3_port_0 }
+ - port: { get_resource: mmsc3_port_1 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ mmsc.mgmt.ip=${mmsc.mgmt.ip}
+ mmsc.mgmt.netmask=${mmsc.mgmt.netmask}
+ mmsc.mgmt.gateway=${mmsc.mgmt.gateway}
+ mmsc.traffic.ip=${mmsc.traffic.ip}
+ mmsc.traffic.netmask=${mmsc.traffic.netmask}
+ mmsc.traffic.gateway=${mmsc.traffic.gateway}
+ mmsc.mgmt.route.1=${mmsc.mgmt.route.1}
+ mmsc.mgmt.route.2=${mmsc.mgmt.route.2}
+ mmsc.external.dns=${mmsc.external.dns}
+ mmsc.external.ntp=${mmsc.external.ntp}
+ mmsc.hostname=${mmsc.hostname}
+ mmsc.timezone=${mmsc.timezone}
+ params:
+ ${mmsc.mgmt.ip}: {get_param: [mmsc_oam_ips, 2]}
+ ${mmsc.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${mmsc.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${mmsc.traffic.ip}: {get_param: [mmsc_mms_traffic_net_ips, 2]}
+ ${mmsc.traffic.netmask}: {get_param: mms_traffic_netmask}
+ ${mmsc.traffic.gateway}: {get_param: mms_traffic_net_gateway}
+ ${mmsc.mgmt.route.1}: {get_param: oam_network_route_1}
+ ${mmsc.mgmt.route.2}: {get_param: oam_network_route_2}
+ ${mmsc.external.dns}: {get_param: external_dns}
+ ${mmsc.external.ntp}: {get_param: external_ntp}
+ ${mmsc.hostname}: {get_param: [mmsc_names, 2]}
+ ${mmsc.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ mmsc3_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: mmsc_cinder_volume_size}
+ volume_type: {get_param: MMSC_volume_type}
+
+ mmsc3_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: mmsc3_volume}
+ instance_uuid: {get_resource: server_mmsc3}
+
+ mmsc3_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [
+ "ip_address": {get_param: [mmsc_oam_ips, 2]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ mmsc3_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: mms_traffic_net}
+ fixed_ips: [
+ "ip_address": {get_param: [mmsc_mms_traffic_net_ips, 2]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_mmsc4:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [mmsc_names, 3]}
+ image: { get_param: mmsc_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: mmsc_flavor }
+ networks:
+ - port: { get_resource: mmsc4_port_0 }
+ - port: { get_resource: mmsc4_port_1 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ mmsc.mgmt.ip=${mmsc.mgmt.ip}
+ mmsc.mgmt.netmask=${mmsc.mgmt.netmask}
+ mmsc.mgmt.gateway=${mmsc.mgmt.gateway}
+ mmsc.traffic.ip=${mmsc.traffic.ip}
+ mmsc.traffic.netmask=${mmsc.traffic.netmask}
+ mmsc.traffic.gateway=${mmsc.traffic.gateway}
+ mmsc.mgmt.route.1=${mmsc.mgmt.route.1}
+ mmsc.mgmt.route.2=${mmsc.mgmt.route.2}
+ mmsc.external.dns=${mmsc.external.dns}
+ mmsc.external.ntp=${mmsc.external.ntp}
+ mmsc.hostname=${mmsc.hostname}
+ mmsc.timezone=${mmsc.timezone}
+ params:
+ ${mmsc.mgmt.ip}: {get_param: [mmsc_oam_ips, 3]}
+ ${mmsc.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${mmsc.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${mmsc.traffic.ip}: {get_param: [mmsc_mms_traffic_net_ips, 3]}
+ ${mmsc.traffic.netmask}: {get_param: mms_traffic_netmask}
+ ${mmsc.traffic.gateway}: {get_param: mms_traffic_net_gateway}
+ ${mmsc.mgmt.route.1}: {get_param: oam_network_route_1}
+ ${mmsc.mgmt.route.2}: {get_param: oam_network_route_2}
+ ${mmsc.external.dns}: {get_param: external_dns}
+ ${mmsc.external.ntp}: {get_param: external_ntp}
+ ${mmsc.hostname}: {get_param: [mmsc_names, 3]}
+ ${mmsc.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ mmsc4_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: mmsc_cinder_volume_size}
+ volume_type: {get_param: MMSC_volume_type}
+
+ mmsc4_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: mmsc4_volume}
+ instance_uuid: {get_resource: server_mmsc4}
+
+ mmsc4_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [
+ "ip_address": {get_param: [mmsc_oam_ips, 3]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ mmsc4_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: mms_traffic_net}
+ fixed_ips: [
+ "ip_address": {get_param: [mmsc_mms_traffic_net_ips, 3]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_mmsc5:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [mmsc_names, 4]}
+ image: { get_param: mmsc_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: mmsc_flavor }
+ networks:
+ - port: { get_resource: mmsc5_port_0 }
+ - port: { get_resource: mmsc5_port_1 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ mmsc.mgmt.ip=${mmsc.mgmt.ip}
+ mmsc.mgmt.netmask=${mmsc.mgmt.netmask}
+ mmsc.mgmt.gateway=${mmsc.mgmt.gateway}
+ mmsc.traffic.ip=${mmsc.traffic.ip}
+ mmsc.traffic.netmask=${mmsc.traffic.netmask}
+ mmsc.traffic.gateway=${mmsc.traffic.gateway}
+ mmsc.mgmt.route.1=${mmsc.mgmt.route.1}
+ mmsc.mgmt.route.2=${mmsc.mgmt.route.2}
+ mmsc.external.dns=${mmsc.external.dns}
+ mmsc.external.ntp=${mmsc.external.ntp}
+ mmsc.hostname=${mmsc.hostname}
+ mmsc.timezone=${mmsc.timezone}
+ params:
+ ${mmsc.mgmt.ip}: {get_param: [mmsc_oam_ips, 4]}
+ ${mmsc.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${mmsc.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${mmsc.traffic.ip}: {get_param: [mmsc_mms_traffic_net_ips, 4]}
+ ${mmsc.traffic.netmask}: {get_param: mms_traffic_netmask}
+ ${mmsc.traffic.gateway}: {get_param: mms_traffic_net_gateway}
+ ${mmsc.mgmt.route.1}: {get_param: oam_network_route_1}
+ ${mmsc.mgmt.route.2}: {get_param: oam_network_route_2}
+ ${mmsc.external.dns}: {get_param: external_dns}
+ ${mmsc.external.ntp}: {get_param: external_ntp}
+ ${mmsc.hostname}: {get_param: [mmsc_names, 4]}
+ ${mmsc.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ mmsc5_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: mmsc_cinder_volume_size}
+ volume_type: {get_param: MMSC_volume_type}
+
+ mmsc5_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: mmsc5_volume}
+ instance_uuid: {get_resource: server_mmsc5}
+
+ mmsc5_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [
+ "ip_address": {get_param: [mmsc_oam_ips, 4]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ mmsc5_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: {get_resource: mms_traffic_net}
+ fixed_ips: [
+ "ip_address": {get_param: [mmsc_mms_traffic_net_ips, 4]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_nems_fe1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [nems_fe_names, 0] }
+ image: { get_param: nems_fe_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: nems_fe_flavor }
+ networks:
+ - port: { get_resource: nems_fe1_port_0 }
+ - port: { get_resource: nems_fe1_port_1 }
+ - port: { get_resource: nems_fe1_port_2 }
+ - port: { get_resource: nems_fe1_port_3 }
+ - port: { get_resource: nems_fe1_port_4 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ nems.mgmt.ip=${nems.mgmt.ip}
+ nems.mgmt.netmask=${nems.mgmt.netmask}
+ nems.mgmt.gateway=${nems.mgmt.gateway}
+ nems.traffic.ip=${nems.traffic.ip}
+ nems.traffic.netmask=${nems.traffic.netmask}
+ nems.traffic.gateway=${nems.traffic.gateway}
+ nems.fe0.internal.ip=${nems.fe0.internal.ip}
+ nems.fe1.internal.ip=${nems.fe1.internal.ip}
+ nems.internal.netmask=${nems.internal.netmask}
+ nems.userweb.ip=${nems.userweb.ip}
+ nems.userweb.netmask=${nems.userweb.netmask}
+ nems.userweb.gateway=${nems.userweb.gateway}
+ nems.imap.ip=${nems.imap.ip}
+ nems.imap.netmask=${nems.imap.netmask}
+ nems.be.internal.ip=${nems.be.internal.ip}
+ nems.be.imap.ip=${nems.be.imap.ip}
+ nems.mgmt.route.1=${nems.mgmt.route.1}
+ nems.mgmt.route.2=${nems.mgmt.route.2}
+ nems.external.dns=${nems.external.dns}
+ nems.external.ntp=${nems.external.ntp}
+ nems.node=${nems.node}
+ nems.be0.host.name=${nems.be0.host.name}
+ nems.fe0.host.name=${nems.fe0.host.name}
+ nems.fe1.host.name=${nems.fe1.host.name}
+ nems.timezone=${nems.timezone}
+ params:
+ ${nems.mgmt.ip}: {get_param: [nems_fe_oam_ips, 0]}
+ ${nems.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${nems.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${nems.traffic.ip}: {get_param: [nems_fe_nems_traffic_net_ips, 0]}
+ ${nems.traffic.netmask}: {get_param: nems_traffic_netmask}
+ ${nems.traffic.gateway}: {get_param: nems_traffic_gateway}
+ ${nems.fe0.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 0]}
+ ${nems.fe1.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 1]}
+ ${nems.internal.netmask}: {get_param: nems_internal_netmask}
+ ${nems.userweb.ip}: {get_param: [nems_fe_nems_user_web_net_ips, 0]}
+ ${nems.userweb.netmask}: {get_param: nems_user_web_netmask}
+ ${nems.userweb.gateway}: {get_param: nems_user_web_gateway}
+ ${nems.imap.ip}: {get_param: [nems_fe_nems_imap_net_ips, 0]}
+ ${nems.imap.netmask}: {get_param: nems_imap_netmask}
+ ${nems.be.internal.ip}: {get_param: nems_be_nems_internal_net_ips}
+ ${nems.be.imap.ip}: {get_param: nems_be_nems_imap_net_ips}
+ ${nems.mgmt.route.1}: {get_param: oam_network_route_1}
+ ${nems.mgmt.route.2}: {get_param: oam_network_route_2}
+ ${nems.external.dns}: {get_param: external_dns}
+ ${nems.external.ntp}: {get_param: external_ntp}
+ ${nems.node}: {get_param: [nems_fe_node_roles, 0]}
+ ${nems.fe0.host.name}: {get_param: [nems_fe_names, 0]}
+ ${nems.fe1.host.name}: {get_param: [nems_fe_names, 1]}
+ ${nems.be0.host.name}: {get_param: nems_be_names}
+ ${nems.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ nems1_fe_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: nems_volume_size}
+ volume_type: {get_param: NEMS_FE_volume_type}
+
+ nems1_fe_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: nems1_fe_volume}
+ instance_uuid: {get_resource: server_nems_fe1}
+
+ nems_fe1_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [
+ "ip_address": { get_param: [nems_fe_oam_ips, 0] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ nems_fe1_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: nems_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [nems_fe_nems_traffic_net_ips, 0] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ nems_fe1_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: nems_user_web_net }
+ fixed_ips: [
+ "ip_address": { get_param: [nems_fe_nems_user_web_net_ips, 0] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ nems_fe1_port_3:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: nems_internal_net }
+ fixed_ips: [
+ "ip_address": { get_param: [nems_fe_nems_internal_net_ips, 0] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ nems_fe1_port_4:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: nems_imap_net }
+ fixed_ips: [
+ "ip_address": { get_param: [nems_fe_nems_imap_net_ips, 0] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_nems_fe2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [nems_fe_names, 1] }
+ image: { get_param: nems_fe_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: nems_fe_flavor }
+ networks:
+ - port: { get_resource: nems_fe2_port_0 }
+ - port: { get_resource: nems_fe2_port_1 }
+ - port: { get_resource: nems_fe2_port_2 }
+ - port: { get_resource: nems_fe2_port_3 }
+ - port: { get_resource: nems_fe2_port_4 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ nems.mgmt.ip=${nems.mgmt.ip}
+ nems.mgmt.netmask=${nems.mgmt.netmask}
+ nems.mgmt.gateway=${nems.mgmt.gateway}
+ nems.traffic.ip=${nems.traffic.ip}
+ nems.traffic.netmask=${nems.traffic.netmask}
+ nems.traffic.gateway=${nems.traffic.gateway}
+ nems.fe0.internal.ip=${nems.fe0.internal.ip}
+ nems.fe1.internal.ip=${nems.fe1.internal.ip}
+ nems.internal.netmask=${nems.internal.netmask}
+ nems.userweb.ip=${nems.userweb.ip}
+ nems.userweb.netmask=${nems.userweb.netmask}
+ nems.userweb.gateway=${nems.userweb.gateway}
+ nems.imap.ip=${nems.imap.ip}
+ nems.imap.netmask=${nems.imap.netmask}
+ nems.be.internal.ip=${nems.be.internal.ip}
+ nems.be.imap.ip=${nems.be.imap.ip}
+ nems.mgmt.route.1=${nems.mgmt.route.1}
+ nems.mgmt.route.2=${nems.mgmt.route.2}
+ nems.external.dns=${nems.external.dns}
+ nems.external.ntp=${nems.external.ntp}
+ nems.node=${nems.node}
+ nems.be0.host.name=${nems.be0.host.name}
+ nems.fe0.host.name=${nems.fe0.host.name}
+ nems.fe1.host.name=${nems.fe1.host.name}
+ nems.timezone=${nems.timezone}
+ params:
+ ${nems.mgmt.ip}: {get_param: [nems_fe_oam_ips, 1]}
+ ${nems.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${nems.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${nems.traffic.ip}: {get_param: [nems_fe_nems_traffic_net_ips, 1]}
+ ${nems.traffic.netmask}: {get_param: nems_traffic_netmask}
+ ${nems.traffic.gateway}: {get_param: nems_traffic_gateway}
+ ${nems.fe0.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 0]}
+ ${nems.fe1.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 1]}
+ ${nems.internal.netmask}: {get_param: nems_internal_netmask}
+ ${nems.userweb.ip}: {get_param: [nems_fe_nems_user_web_net_ips, 1]}
+ ${nems.userweb.netmask}: {get_param: nems_user_web_netmask}
+ ${nems.userweb.gateway}: {get_param: nems_user_web_gateway}
+ ${nems.imap.ip}: {get_param: [nems_fe_nems_imap_net_ips, 1]}
+ ${nems.imap.netmask}: {get_param: nems_imap_netmask}
+ ${nems.be.internal.ip}: {get_param: nems_be_nems_internal_net_ips}
+ ${nems.be.imap.ip}: {get_param: nems_be_nems_imap_net_ips}
+ ${nems.mgmt.route.1}: {get_param: oam_network_route_1}
+ ${nems.mgmt.route.2}: {get_param: oam_network_route_2}
+ ${nems.external.dns}: {get_param: external_dns}
+ ${nems.external.ntp}: {get_param: external_ntp}
+ ${nems.node}: {get_param: [nems_fe_node_roles, 1]}
+ ${nems.fe0.host.name}: {get_param: [nems_fe_names, 0]}
+ ${nems.fe1.host.name}: {get_param: [nems_fe_names, 1]}
+ ${nems.be0.host.name}: {get_param: nems_be_names}
+ ${nems.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ nems2_fe_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: nems_volume_size}
+ volume_type: {get_param: NEMS_FE_volume_type}
+
+ nems2_fe_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: nems2_fe_volume}
+ instance_uuid: {get_resource: server_nems_fe2}
+
+ nems_fe2_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [
+ "ip_address": {get_param: [nems_fe_oam_ips, 1]}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ nems_fe2_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: nems_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [nems_fe_nems_traffic_net_ips, 1] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ nems_fe2_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: nems_user_web_net }
+ fixed_ips: [
+ "ip_address": { get_param: [nems_fe_nems_user_web_net_ips, 1] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ nems_fe2_port_3:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: nems_internal_net }
+ fixed_ips: [
+ "ip_address": { get_param: [nems_fe_nems_internal_net_ips, 1] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+
+ nems_fe2_port_4:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: nems_imap_net }
+ fixed_ips: [
+ "ip_address": { get_param: [nems_fe_nems_imap_net_ips, 1] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_nems_be1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: nems_be_names }
+ image: { get_param: nems_be_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: nems_be_flavor }
+ networks:
+ - port: { get_resource: nems_be1_port_0 }
+ - port: { get_resource: nems_be1_port_1 }
+ - port: { get_resource: nems_be1_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ nems.be.mgmt.ip=${nems.be.mgmt.ip}
+ nems.mgmt.netmask=${nems.mgmt.netmask}
+ nems.mgmt.gateway=${nems.mgmt.gateway}
+ nems.be.internal.ip=${nems.be.internal.ip}
+ nems.internal.netmask=${nems.internal.netmask}
+ nems.imap.netmask=${nems.imap.netmask}
+ nems.fe0.internal.ip=${nems.fe0.internal.ip}
+ nems.fe1.internal.ip=${nems.fe1.internal.ip}
+ nems.be.imap.ip=${nems.be.imap.ip}
+ nems.mgmt.route.1=${nems.mgmt.route.1}
+ nems.mgmt.route.2=${nems.mgmt.route.2}
+ nems.external.dns=${nems.external.dns}
+ nems.external.ntp=${nems.external.ntp}
+ nems.node=${nems.node}
+ nems.be0.host.name=${nems.be0.host.name}
+ nems.fe0.host.name=${nems.fe0.host.name}
+ nems.fe1.host.name=${nems.fe1.host.name}
+ nems.timezone=${nems.timezone}
+ params:
+ ${nems.be.mgmt.ip}: {get_param: nems_be_oam_ips}
+ ${nems.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${nems.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${nems.fe0.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 0]}
+ ${nems.fe1.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 1]}
+ ${nems.be.internal.ip}: {get_param: nems_be_nems_internal_net_ips}
+ ${nems.internal.netmask}: {get_param: nems_internal_netmask}
+ ${nems.imap.netmask}: {get_param: nems_imap_netmask}
+ ${nems.be.imap.ip}: {get_param: nems_be_nems_imap_net_ips}
+ ${nems.mgmt.route.1}: {get_param: oam_network_route_1}
+ ${nems.mgmt.route.2}: {get_param: oam_network_route_2}
+ ${nems.external.dns}: {get_param: external_dns}
+ ${nems.external.ntp}: {get_param: external_ntp}
+ ${nems.node}: {get_param: nems_be_node_roles}
+ ${nems.be0.host.name}: {get_param: nems_be_names}
+ ${nems.fe0.host.name}: {get_param: [nems_fe_names, 0]}
+ ${nems.fe1.host.name}: {get_param: [nems_fe_names, 1]}
+ ${nems.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ nems_be_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: nems_be_volume_size}
+ volume_type: {get_param: NEMS_BE_volume_type}
+
+ nems_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: nems_be_volume}
+ instance_uuid: {get_resource: server_nems_be1}
+
+
+ nems_be1_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [
+ "ip_address": { get_param: nems_be_oam_ips}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ nems_be1_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: nems_internal_net }
+ fixed_ips: [
+ "ip_address": { get_param: nems_be_nems_internal_net_ips}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ nems_be1_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: nems_imap_net }
+ fixed_ips: [
+ "ip_address": { get_param: nems_be_nems_imap_net_ips}
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 0]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx1_port_0 }
+ - port: { get_resource: eca_trx1_port_1 }
+ - port: { get_resource: eca_trx1_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 0]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 0]}
+
+ eca_trx1_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 0] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx1_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 0] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx1_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 0] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+
+ server_eca_trx2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 1]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx2_port_0 }
+ - port: { get_resource: eca_trx2_port_1 }
+ - port: { get_resource: eca_trx2_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 1]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 1]}
+
+ eca_trx2_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 1] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx2_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 1] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx2_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 1] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx3:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 2]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx3_port_0 }
+ - port: { get_resource: eca_trx3_port_1 }
+ - port: { get_resource: eca_trx3_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 2]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 2]}
+
+ eca_trx3_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 2] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx3_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 2] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx3_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 2] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx4:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 3]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx4_port_0 }
+ - port: { get_resource: eca_trx4_port_1 }
+ - port: { get_resource: eca_trx4_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 3]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 3]}
+
+ eca_trx4_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 3] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx4_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 3] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx4_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 3] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx5:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 4]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx5_port_0 }
+ - port: { get_resource: eca_trx5_port_1 }
+ - port: { get_resource: eca_trx5_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 4]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 4]}
+
+ eca_trx5_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 4] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx5_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 4] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx5_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 4] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx6:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 5]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx6_port_0 }
+ - port: { get_resource: eca_trx6_port_1 }
+ - port: { get_resource: eca_trx6_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 5]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 5]}
+
+ eca_trx6_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 5] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx6_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 5] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx6_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 5] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx7:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 6]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx7_port_0 }
+ - port: { get_resource: eca_trx7_port_1 }
+ - port: { get_resource: eca_trx7_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 6]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 6]}
+
+ eca_trx7_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 6] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx7_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 6] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx7_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 6] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx8:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 7]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx8_port_0 }
+ - port: { get_resource: eca_trx8_port_1 }
+ - port: { get_resource: eca_trx8_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 7]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 7]}
+
+ eca_trx8_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 7] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx8_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 7] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx8_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 7] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx9:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 8]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx9_port_0 }
+ - port: { get_resource: eca_trx9_port_1 }
+ - port: { get_resource: eca_trx9_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 8]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 8]}
+
+ eca_trx9_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 8] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx9_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 8] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx9_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 8] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx10:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 9]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx10_port_0 }
+ - port: { get_resource: eca_trx10_port_1 }
+ - port: { get_resource: eca_trx10_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 9]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 9]}
+
+ eca_trx10_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 9] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx10_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 9] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx10_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 9] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx11:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 10]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx11_port_0 }
+ - port: { get_resource: eca_trx11_port_1 }
+ - port: { get_resource: eca_trx11_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 10]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 10]}
+
+ eca_trx11_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 10] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx11_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 10] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx11_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 10] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+
+ server_eca_trx12:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 11]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx12_port_0 }
+ - port: { get_resource: eca_trx12_port_1 }
+ - port: { get_resource: eca_trx12_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 11]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 11]}
+
+ eca_trx12_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 11] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx12_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 11] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx12_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 11] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx13:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 12]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx13_port_0 }
+ - port: { get_resource: eca_trx13_port_1 }
+ - port: { get_resource: eca_trx13_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 12]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 12]}
+
+ eca_trx13_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 12] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx13_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 12] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx13_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 12] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx14:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 13]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx14_port_0 }
+ - port: { get_resource: eca_trx14_port_1 }
+ - port: { get_resource: eca_trx14_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 13]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 13]}
+
+ eca_trx14_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 13] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx14_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 13] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx14_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 13] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx15:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 14]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx15_port_0 }
+ - port: { get_resource: eca_trx15_port_1 }
+ - port: { get_resource: eca_trx15_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 14]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 14]}
+
+ eca_trx15_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 14] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx15_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 14] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx15_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 14] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx16:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 15]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx16_port_0 }
+ - port: { get_resource: eca_trx16_port_1 }
+ - port: { get_resource: eca_trx16_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 15]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 15]}
+
+ eca_trx16_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 15] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx16_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 15] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx16_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 15] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+
+ server_eca_trx17:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 16]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx17_port_0 }
+ - port: { get_resource: eca_trx17_port_1 }
+ - port: { get_resource: eca_trx17_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 16]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 16]}
+
+ eca_trx17_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 16] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx17_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 16] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx17_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 16] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx18:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 17]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx18_port_0 }
+ - port: { get_resource: eca_trx18_port_1 }
+ - port: { get_resource: eca_trx18_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 17]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 17]}
+
+ eca_trx18_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 17] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx18_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 17] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx18_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 17] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx19:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 18]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx19_port_0 }
+ - port: { get_resource: eca_trx19_port_1 }
+ - port: { get_resource: eca_trx19_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 8]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 18]}
+
+ eca_trx19_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 18] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx19_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 18] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx19_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 18] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_eca_trx20:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [eca_trx_names, 19]}
+ image: { get_param: eca_trx_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: eca_trx_flavor }
+ networks:
+ - port: { get_resource: eca_trx20_port_0 }
+ - port: { get_resource: eca_trx20_port_1 }
+ - port: { get_resource: eca_trx20_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ touch /tmp/user_data.log
+ sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network
+ echo "172.26.8.6 puppet" > /etc/hosts
+ eth0_ip_address='trx_traf_ip_address'
+ eth0_gateway='172.26.5.3'
+ echo "$eth0_ip_address" >>/tmp/user_data.log
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ puppet agent -t > /root/puppet-agent-t.out
+ params:
+ trx_hostname: {get_param: [eca_trx_names, 19]}
+ trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 19]}
+
+ eca_trx20_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_oam_ips, 19] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx20_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: eca_mgmt_net_name }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_mgmt_ips, 19] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ eca_trx20_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: eca_traffic_net }
+ fixed_ips: [
+ "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 19] }
+ ]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/MMSC_Capacity_Line_1.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/MMSC_Capacity_Line_1.env
new file mode 100644
index 0000000000..b346d67d97
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/MMSC_Capacity_Line_1.env
@@ -0,0 +1,111 @@
+parameters:
+ oam_net_name: oam_protected_net_0
+ oam_network_netmask: 255.255.254.0
+ oam_network_gateway: 107.250.172.1
+ oam_network_route_1: 155.165.201.250/32,107.250.172.1
+ oam_network_route_2: 155.165.194.100/32,107.250.172.1
+ external_dns: 155.165.194.100
+ external_ntp: 155.165.201.250
+ lb_oam_ips: 107.250.172.50,107.250.172.51
+ dmz_protected_net_name: dmz_protected_net_0
+ lb_dmz_protected_ips: 107.239.14.19,107.239.14.20
+ cor_direct_net_name: cor_direct_net_0
+ lb_cor_direct_ips: 172.31.10.19,172.31.10.20
+ mms_traffic_net_name: int_mms_mms_traffic_net_2
+ mms_traffic_net_cidr: 172.26.2.0/24
+ mms_traffic_netmask: 255.255.255.0
+ mms_traffic_net_gateway: 172.26.2.1
+ mms_traffic_start: 172.26.2.3
+ mms_traffic_end: 172.26.2.254
+ mms_traffic_net_local_ip1: 172.26.2.3
+ mms_traffic_net_local_ip2: 172.26.2.4
+ mms_traffic_net_floating_ip: 172.26.2.5
+ nems_internal_name: int_mms_nems_internal_net_2
+ nems_internal_start: 172.26.6.3
+ nems_internal_end: 172.26.6.254
+ nems_internal_cidr: 172.26.6.0/24
+ nems_internal_netmask: 255.255.255.0
+ nems_internal_gateway: 172.26.6.1
+ nems_traffic_name: int_mms_nems_traffic_net_2
+ nems_traffic_start: 172.26.3.3
+ nems_traffic_end: 172.26.3.254
+ nems_traffic_cidr: 172.26.3.0/24
+ nems_traffic_netmask: 255.255.255.0
+ nems_traffic_gateway: 172.26.3.1
+ nems_traffic_net_local_ip1: 172.26.3.3
+ nems_traffic_net_local_ip2: 172.26.3.4
+ nems_traffic_net_floating_ip: 172.26.3.5
+ nems_user_web_name: int_mms_nems_web_net_2
+ nems_user_web_start: 172.26.4.3
+ nems_user_web_end: 172.26.4.254
+ nems_user_web_cidr: 172.26.4.0/24
+ nems_user_web_netmask: 255.255.255.0
+ nems_user_web_gateway: 172.26.4.1
+ nems_user_web_net_local_ip1: 172.26.4.3
+ nems_user_web_net_local_ip2: 172.26.4.4
+ nems_user_web_net_floating_ip: 172.26.4.5
+ nems_imap_name: int_mms_nems_imap_net_2
+ nems_imap_start: 172.26.7.3
+ nems_imap_end: 172.26.7.254
+ nems_imap_cidr: 172.26.7.0/24
+ nems_imap_netmask: 255.255.255.0
+ nems_imap_gateway: 172.26.7.1
+ eca_traffic_name: int_mms_eca_traffic_net_2
+ eca_traffic_cidr: 172.26.5.0/24
+ eca_traffic_netmask: 255.255.255.0
+ eca_traffic_net_gateway: 172.26.5.1
+ eca_traffic_start: 172.26.5.3
+ eca_traffic_end: 172.26.5.254
+ eca_traffic_net_local_ip1: 172.26.5.3
+ eca_traffic_net_local_ip2: 172.26.5.4
+ eca_traffic_net_floating_ip: 172.26.5.5
+ ha_net_name: int_mms_ha_net_2
+ ha_net_cidr: 172.26.1.0/24
+ ha_net_start: 172.26.1.3
+ ha_net_end: 172.26.1.254
+ ha_net_local_ip1: 172.26.1.3
+ ha_net_local_ip2: 172.26.1.4
+ lb_names: ZRDM1MMSC03ALB001,ZRDM1MMSC03ALB002
+ lb_image_name: BIGIP-11.5.3.0.0.163
+ lb_flavor_name: m1.xlarge
+ security_group_name: mmsc_security_group_1
+ availability_zone_0: nova
+ mmsc_mms_traffic_net_ips: 172.26.2.11,172.26.2.12,172.26.2.13,172.26.2.14,172.26.2.15
+ mmsc_oam_ips: 107.250.172.54,107.250.172.55,107.250.172.56,107.250.172.57,107.250.172.58
+ mmsc_flavor: lc.4xlarge4
+ mmsc_image: mmsc-6.0.2_v5
+ mmsc_cinder_volume_size: 480
+ nems_fe_flavor: m1.large2
+ nems_fe_image: nems-2.1.2_v29
+ nems_fe_names: ZRDM1MMSC03NFE001,ZRDM1MMSC03NFE002
+ nems_fe_node_roles: FE0,FE1
+ nems_fe_oam_ips: 107.250.172.64,107.250.172.65
+ nems_fe_nems_traffic_net_ips: 172.26.3.11,172.26.3.12
+ nems_fe_nems_user_web_net_ips: 172.26.4.11,172.26.4.12
+ nems_fe_nems_internal_net_ips: 172.26.6.11,172.26.6.12
+ nems_fe_nems_imap_net_ips: 172.26.7.11,172.26.7.12
+ nems_be_names: ZRDM1MMSC03NBE001
+ nems_be_node_roles: BE0
+ nems_be_oam_ips: 107.250.172.66
+ nems_be_nems_internal_net_ips: 172.26.6.13
+ nems_be_nems_imap_net_ips: 172.26.7.13
+ nems_be_flavor: m1.large2
+ nems_be_image: nems-2.1.2_v29
+ eca_trx_oam_ips: 107.250.172.70,107.250.172.71,107.250.172.72,107.250.172.73,107.250.172.74,107.250.172.75,107.250.172.76,107.250.172.77,107.250.172.78,107.250.172.79,107.250.172.80,107.250.172.81,107.250.172.82,107.250.172.83,107.250.172.84,107.250.172.85,107.250.172.86,107.250.172.87,107.250.172.88,107.250.172.89
+ eca_trx_mgmt_ips: 172.25.137.202,172.25.137.203,172.25.137.204,172.25.137.205,172.25.137.206,172.25.137.207,172.25.137.208,172.25.137.209,172.25.137.210,172.25.137.211,172.25.137.212,172.25.137.213,172.25.137.214,172.25.137.215,172.25.137.216,172.25.137.217,172.25.137.218,172.25.137.219,172.25.137.220,172.25.137.221
+ eca_trx_flavor: m1.xlarge
+ eca_trx_image: ECABASE
+ timezone: UTC
+ eca_trx_names: ZRDM1MMSC03TRX001,ZRDM1MMSC03TRX002,ZRDM1MMSC03TRX003,ZRDM1MMSC03TRX004,ZRDM1MMSC03TRX005,ZRDM1MMSC03TRX006,ZRDM1MMSC03TRX007,ZRDM1MMSC03TRX008,ZRDM1MMSC03TRX009,ZRDM1MMSC03TRX010,ZRDM1MMSC03TRX011,ZRDM1MMSC03TRX012,ZRDM1MMSC03TRX013,ZRDM1MMSC03TRX014,ZRDM1MMSC03TRX015,ZRDM1MMSC03TRX016,ZRDM1MMSC03TRX017,ZRDM1MMSC03TRX018,ZRDM1MMSC03TRX019,ZRDM1MMSC03TRX020
+ eca_trx_eca_traffic_net_ips: 172.26.5.11,172.26.5.12,172.26.5.13,172.26.5.14,172.26.5.15,172.26.5.16,172.26.5.17,172.26.5.18,172.26.5.19,172.26.5.20,172.26.5.21,172.26.5.22,172.26.5.23,172.26.5.24,172.26.5.25,172.26.5.26,172.26.5.27,172.26.5.28,172.26.5.29,172.26.5.30
+ mmsc_names: ZRDM1MMSC03MMS001,ZRDM1MMSC03MMS002,ZRDM1MMSC03MMS003,ZRDM1MMSC03MMS004,ZRDM1MMSC03MMS005
+ nems_volume_size: 50
+ nems_be_volume_size: 610
+ MMSC_volume_type: Platinum
+ NEMS_FE_volume_type: Platinum
+ NEMS_BE_volume_type: Platinum
+ mmsc_core_virtual_server_ips: 172.31.10.21,172.31.10.22
+ mmsc_core_snat_ips: 172.31.10.23,172.31.10.24,172.31.10.25,172.31.10.26,172.31.10.27
+ mmsc_dmz_protected_virtual_server_ips: 107.239.14.21,107.239.14.22,107.239.14.23
+ mmsc_dmz_protected_snat_ips: 107.239.14.24,107.239.14.25,107.239.14.26,107.239.14.27
+ eca_mgmt_net_name: int_eca_mgmt_net_1 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/SG_ECA_MGMT.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/SG_ECA_MGMT.yaml
new file mode 100644
index 0000000000..53efc5e36e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/SG_ECA_MGMT.yaml
@@ -0,0 +1,76 @@
+heat_template_version: 2013-05-23
+
+#################################
+#
+# Changes from MSO - 11/5/2015
+# - Parameter changes as below
+# - CDLs for vmNames, IPs
+# - aZone->availability_zone_0
+# - nwName->{nwRole}_net_name
+# - nwID->{nwRole}_net_id
+# - vmName->{vmType}_names
+# - ips ->{vmType}_{nwRole}_ips
+# - fips->{vmType}_{nwRole}_floating_ip
+# - added replacement_policy: AUTO to all ports
+# - added vnf_id for metadata to all servers
+# - externalized security group resource
+# - externalized eca_mgmt network
+#
+#################################
+
+description: >
+ HOT template that creates Security Group and ECA network
+
+parameters:
+ eca_mgmt_name:
+ type: string
+ label: eca management name
+ description: eca management name
+ eca_mgmt_start:
+ type: string
+ label: eca management start
+ description: eca management start
+ eca_mgmt_end:
+ type: string
+ label: eca management end
+ description: eca management end
+ eca_mgmt_cidr:
+ type: string
+ label: eca management cidr
+ description: eca management cidr
+ eca_mgmt_netmask:
+ type: string
+ label: ECA mgmt network subnet mask
+ description: ECA mgmt network subnet mask
+ security_group_name:
+ type: string
+ label: MMSC security group name
+ description: MMSC security group name
+
+resources:
+ mms_security_group:
+ type: OS::Neutron::SecurityGroup
+ properties:
+ description: mmsc security group
+ name: {get_param: security_group_name}
+ rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}
+ ]
+ eca_mgmt_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: {get_param: eca_mgmt_name}
+
+ eca_mgmt_network_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: eca_mgmt_name}
+ allocation_pools: [{"start": {get_param: eca_mgmt_start}, "end": {get_param: eca_mgmt_end}}]
+ cidr: {get_param: eca_mgmt_cidr}
+ #enable_dhcp: false
+ #gateway_ip: null
+ network_id: {get_resource: eca_mgmt_net}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/cmaui.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/cmaui.env
new file mode 100644
index 0000000000..2e0f4c0796
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/cmaui.env
@@ -0,0 +1,15 @@
+parameters:
+ cmaui_names: ZRDM1MMSC02CMI001,ZRDM1MMSC02CMI002
+ cmaui_flavor: m1.large
+ cmaui_image: cmaui-5.0.2.5_v25
+ cmaui_cinder_volume_size: 55
+ oam_net_name: oam_protected_net_0
+ oam_network_netmask: 255.255.255.192
+ oam_network_gateway: 10.20.30.1
+ external_dns: 155.165.201.250
+ external_ntp: 155.165.194.100
+ security_group_name: mmsc_security_group_1
+ availability_zone_0: nova
+ timezone: UTC
+ cmaui_oam_ips: 107.250.172.42,107.250.172.43
+ CMAUI_volume_type: Platinum \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/cmaui.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/cmaui.yml
new file mode 100644
index 0000000000..6d094be26f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/cmaui.yml
@@ -0,0 +1,171 @@
+heat_template_version: 2013-05-23
+
+#################################
+#
+# Changes from MSO 01/26/2016
+# Updated per ECOMP feedback
+#
+#################################
+
+description: cmaui server template for vMMSC
+
+parameters:
+ vnf_id:
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-CMAUI_id
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_cinder_volume_size:
+ type: number
+ label: CMAUI Cinder volume size
+ description: the size of the CMAUI Cinder volume
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ oam_net_name:
+ type: string
+ description: UID of OAM network
+ oam_network_netmask:
+ type: string
+ label: oam network netmask
+ description: oam network gateway
+ oam_network_gateway:
+ type: string
+ label: oam network gateway
+ description: oam network gateway
+ external_dns:
+ type: string
+ label: dns server
+ description: dns server
+ external_ntp:
+ type: string
+ label: ntp server
+ description: ntp server
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ timezone:
+ type: string
+ label: timezone
+ description: timezone
+ cmaui_oam_ips:
+ type: comma_delimited_list
+ label: CMAUI oam_net IP addresses
+ description: CMAUI oam_net IP addresses
+ CMAUI_volume_type:
+ type: string
+ label: CMAUI vm volume type
+ description: the name of the target volume backend
+
+resources:
+ server_cmaui:
+ type: eca_oam.yaml
+ properties:
+ cmaui_name: { get_param: [cmaui_names, 0]}
+ cmaui_image: { get_param: cmaui_image }
+ availability_zone_0: { get_param: availability_zone_0 }
+ cmaui_flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_0 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ cmaui.mgmt.ip=${cmaui.mgmt.ip}
+ cmaui.mgmt.netmask=${cmaui.mgmt.netmask}
+ cmaui.mgmt.gateway=${cmaui.mgmt.gateway}
+ cmaui.external.dns=${cmaui.external.dns}
+ cmaui.external.ntp=${cmaui.external.ntp}
+ cmaui.node=${cmaui.node}
+ cmaui.timezone=${cmaui.timezone}
+ params:
+ ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]}
+ ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${cmaui.external.dns}: {get_param: external_dns}
+ ${cmaui.external.ntp}: {get_param: external_ntp}
+ ${cmaui.node}: {get_param: [cmaui_names, 0]}
+ ${cmaui.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ cmaui_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: cmaui_cinder_volume_size}
+ volume_type: {get_param: CMAUI_volume_type}
+
+ cmaui_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: cmaui_volume}
+ instance_uuid: {get_resource: server_cmaui}
+
+ cmaui_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_cmaui1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 1]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui1_port_0 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ cmaui.mgmt.ip=${cmaui.mgmt.ip}
+ cmaui.mgmt.netmask=${cmaui.mgmt.netmask}
+ cmaui.mgmt.gateway=${cmaui.mgmt.gateway}
+ cmaui.external.dns=${cmaui.external.dns}
+ cmaui.external.ntp=${cmaui.external.ntp}
+ cmaui.node=${cmaui.node}
+ cmaui.timezone=${cmaui.timezone}
+ params:
+ ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 1]}
+ ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${cmaui.external.dns}: {get_param: external_dns}
+ ${cmaui.external.ntp}: {get_param: external_ntp}
+ ${cmaui.node}: {get_param: [cmaui_names, 1]}
+ ${cmaui.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ cmaui1_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: cmaui_cinder_volume_size}
+ volume_type: {get_param: CMAUI_volume_type}
+
+ cmaui1_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: cmaui1_volume}
+ instance_uuid: {get_resource: server_cmaui1}
+
+ cmaui1_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 1]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/eca_oam.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/eca_oam.env
new file mode 100644
index 0000000000..f9991722b3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/eca_oam.env
@@ -0,0 +1,20 @@
+parameters:
+ eca_names: ZRDM1MMSC02OAM001,ZRDM1MMSC02OAM002
+ arb_names: ZRDM1MMSC02ARB001
+ oam_image_name: ECABASE
+ oam_flavor: lc.xlarge4
+ arbiter_flavor: m1.large2
+ availability_zone_0: nova
+ oam_net_name: oam_protected_net_0
+ eca_mgmt_net_name: int_mms_eca_mgmt_net_1
+ eca_oam_ips: 107.250.172.44,107.250.172.45
+ eca_eca_mgmt_ips: 172.25.137.242,172.25.137.243
+ eca_oam_gateway: 107.250.172.1
+ arb_oam_ips: 107.250.172.46
+ arb_eca_mgmt_ips: 172.25.137.244
+ security_group_name: mmsc_security_group_1
+ oam_volume_size: 1800
+ arb_volume_size: 40
+ swift_eca_url: http://object-store.rdm2.cci.com:8080/v1/AUTH_1bbab536a19b4756926e7d0ec1eb543c/eca
+ ECA_OAM_volume_type: Platinum
+ ARB_volume_type: Platinum
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/eca_oam.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/eca_oam.yaml
new file mode 100644
index 0000000000..db5ab5c26b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/eca_oam.yaml
@@ -0,0 +1,407 @@
+heat_template_version: 2013-05-23
+
+##########################################################
+#
+# Changes from MSO
+# - Updated per ECOMP Feedback
+#
+#
+##########################################################
+
+description: This stack creates two ECA OAM VM and one ARB VM
+
+parameters:
+ vnf_id:
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-ECA_id
+ cmaui_name:
+ type: string
+ label: cmaui name
+ description: cmaui name
+ cmaui_image:
+ type: string
+ label: cmaui image
+ description: cmaui image
+ cmaui_flavor:
+ type: string
+ label: flavor name
+ description: cmaui flavor name
+ networks:
+ type: string
+ label: network name
+ description: cmaui network name
+ metadata:
+ type: string
+ label: metadata
+ description: cmaui metadata
+ user_data:
+ type: string
+ label: user data
+ description: cmaui user data
+ user_data_format:
+ type: string
+ label: user data
+ description: cmaui user data
+ eca_names:
+ type: comma_delimited_list
+ label: oam servers names
+ description: the names of the OAM1,OAM2 VM instances
+ arb_names:
+ type: comma_delimited_list
+ label: arbiter server names
+ description: the names of the arbiter VM instances
+ oam_image_name:
+ type: string
+ label: image name
+ description: the OAM image name
+ oam_flavor:
+ type: string
+ label: flavor name
+ description: OAM flavor name
+ arbiter_flavor:
+ type: string
+ label: flavor name
+ description: arbiter flavor name
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ oam_net_name:
+ type: string
+ label: oam network name
+ description: the name of the oam network
+ eca_mgmt_net_name:
+ type: string
+ label: internal network name
+ description: the name of the internal network
+ eca_oam_ips:
+ type: comma_delimited_list
+ label: oam network ips
+ description: the ips of oam networks for eca VM
+ eca_oam_gateway:
+ type: string
+ label: oam1 oam gateway
+ description: the ip of oam gateway
+ eca_eca_mgmt_ips:
+ type: comma_delimited_list
+ label: eca_mgmt network ips for eca VM
+ description: internal eca_mgmt network ips for eca VM
+ arb_oam_ips:
+ type: comma_delimited_list
+ label: oam network ips for arb VM
+ description: oam network ips for eca VM
+ arb_eca_mgmt_ips:
+ type: comma_delimited_list
+ label: eca_mgmt network ips
+ description: internal eca_mgmt network ips for arb VM
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ oam_volume_size:
+ type: number
+ label: volume size
+ description: the size of the OAM volume
+ arb_volume_size:
+ type: number
+ label: volume size
+ description: the size of the ARB volume
+ swift_eca_url:
+ type: string
+ label: Swift URL
+ description: Base URL for eca swift object store
+ ECA_OAM_volume_type:
+ type: string
+ label: eca oam vm volume type
+ description: the name of the target volume backend
+ ARB_volume_type:
+ type: string
+ label: arb vm volume type
+ description: the name of the target volume backend
+
+resources:
+ oam1_instance:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: [eca_names, 0]}
+ image: {get_param: oam_image_name}
+ flavor: {get_param: oam_flavor}
+ availability_zone: {get_param: availability_zone_0}
+ networks:
+ - port: {get_resource: oam1_int_port}
+ - port: {get_resource: oam1_mgmt_port}
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ sed -i s/HOSTNAME.*/"HOSTNAME=oam1_hostname"/g /etc/sysconfig/network
+ eth1_ip_address='oam1_mgt_ip'
+ eth1_gateway='oam_gateway'
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ mkdir /etc/puppet/files/roles/transcoder
+ mkdir /etc/puppet/files/roles/oam_primary
+ curl swift_url/etc/puppet/manifests/roles/oam_primary.pp > /etc/puppet/manifests/roles/oam_primary.pp
+ curl swift_url/etc/puppet/manifests/roles/transcoder.pp > /etc/puppet/manifests/roles/transcoder.pp
+ curl swift_url/etc/puppet/files/roles/oam_primary/config.yaml > /etc/puppet/files/roles/oam_primary/config.yaml
+ curl swift_url/etc/puppet/files/roles/transcoder/config.yaml > /etc/puppet/files/roles/transcoder/config.yaml
+ curl swift_url/etc/puppet/files/roles/transcoder/hpm.conf > /etc/puppet/files/roles/transcoder/hpm.conf
+ curl swift_url/etc/puppet/files/roles/transcoder/trx.conf > /etc/puppet/files/roles/transcoder/trx.conf
+ curl swift_url/etc/puppet/files/roles/transcoder/plugins-mo.conf > /etc/puppet/files/roles/transcoder/plugins-mo.conf
+ curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
+ curl swift_url/etc/puppet/manifests/site.pp > /etc/puppet/manifests/site.pp
+ curl swift_url/scripts/van-init-replicaset > /usr/sbin/van-init-replicaset
+ van-role oam_primary > /root/startup-van-role.out
+ curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
+ fdisk /dev/vdb < /root/fdisk-keystrokes
+ curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
+ chmod 755 /root/os-conf-cinder-vol
+ /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
+ params:
+ oam1_mgt_ip: {get_param: [eca_oam_ips, 0] }
+ oam_gateway: {get_param: eca_oam_gateway }
+ oam1_hostname: {get_param: [eca_names, 0]}
+ swift_url: {get_param: swift_eca_url}
+
+ oam1_mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ oam1_int_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: eca_mgmt_net_name}
+ fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ oam1_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: oam_volume_size}
+ volume_type: {get_param: ECA_OAM_volume_type}
+
+ oam1_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: oam1_volume}
+ instance_uuid: {get_resource: oam1_instance}
+
+ oam2_instance:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: [eca_names, 1]}
+ image: {get_param: oam_image_name}
+ flavor: {get_param: oam_flavor}
+ availability_zone: {get_param: availability_zone_0}
+ networks:
+ - port: {get_resource: oam2_int_port}
+ - port: {get_resource: oam2_mgmt_port}
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ sed -i s/HOSTNAME.*/"HOSTNAME=oam2_hostname"/g /etc/sysconfig/network
+ eth1_ip_address='oam2_mgt_ip'
+ eth1_gateway='oam_gateway'
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ curl swift_url/etc/puppet/manifests/roles/oam_secondary.pp > /etc/puppet/manifests/roles/oam_secondary.pp
+ curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml
+ curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
+ van-role oam_secondary > /root/startup-van-role.out
+ curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
+ fdisk /dev/vdb < /root/fdisk-keystrokes
+ curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
+ chmod 755 /root/os-conf-cinder-vol
+ /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
+
+ params:
+ oam2_mgt_ip: {get_param: [eca_oam_ips, 1] }
+ oam2_hostname: {get_param: [eca_names, 1]}
+ swift_url: {get_param: swift_eca_url}
+ oam_gateway: {get_param: eca_oam_gateway }
+
+ oam2_mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 1]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ oam2_int_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: eca_mgmt_net_name}
+ fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 1]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ oam2_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: oam_volume_size}
+ volume_type: {get_param: ECA_OAM_volume_type}
+
+ oam2_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: oam2_volume}
+ instance_uuid: {get_resource: oam2_instance}
+
+ arb_instance:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: [arb_names, 0]}
+ image: {get_param: oam_image_name}
+ flavor: {get_param: arbiter_flavor}
+ availability_zone: {get_param: availability_zone_0}
+ networks:
+ - port: {get_resource: arb_int_port}
+ - port: {get_resource: arb_mgmt_port}
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ #!/bin/bash
+ sed -i s/HOSTNAME.*/"HOSTNAME=arb_hostname"/g /etc/sysconfig/network
+ eth1_ip_address='arb_mgt_ip'
+ eth1_gateway='oam_gateway'
+ for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
+ if [ "$interface" != "lo" ]; then
+ DEVICE_NAME=$interface
+ interface_ip_var="${DEVICE_NAME}_ip_address"
+ gateway_var="${DEVICE_NAME}_gateway"
+ var_name="$interface_ip_var"
+ var_gateway="$gateway_var"
+ if [ ! -z ${!var_name} ]; then
+ IPADDR=${!var_name}
+ BOOTPROTO="static"
+ GATEWAY=${!var_gateway}
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ else
+ if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
+ echo "Configuring $DEVICE_NAME to use DHCP"
+ IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
+ IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
+ printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
+ fi
+ fi
+ ifdown $DEVICE_NAME
+ ifup $DEVICE_NAME
+ printf "$DEVICE_NAME\n" >> /tmp/network_config
+ fi
+ done
+ curl swift_url/etc/puppet/manifests/roles/oam_arbiter.pp > /etc/puppet/manifests/roles/oam_arbiter.pp
+ curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml
+ curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
+ van-role oam_arbiter > /root/startup-van-role.out
+ curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
+ fdisk /dev/vdb < /root/fdisk-keystrokes
+ curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
+ chmod 755 /root/os-conf-cinder-vol
+ /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
+ params:
+ arb_mgt_ip: {get_param: [arb_oam_ips, 0] }
+ arb_hostname: {get_param: [arb_names, 0]}
+ swift_url: {get_param: swift_eca_url}
+ oam_gateway: {get_param: eca_oam_gateway }
+
+ arb_mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [arb_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ arb_int_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: eca_mgmt_net_name}
+ fixed_ips: [{"ip_address": {get_param: [arb_eca_mgmt_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ arb_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: arb_volume_size}
+ volume_type: {get_param: ARB_volume_type}
+ arb_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: arb_volume}
+ instance_uuid: {get_resource: arb_instance}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/sg_eca_mgmt.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/sg_eca_mgmt.env
new file mode 100644
index 0000000000..8012063ac0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/sg_eca_mgmt.env
@@ -0,0 +1,7 @@
+parameters:
+ eca_mgmt_name: int_eca_mgmt_net_1
+ eca_mgmt_cidr: 172.25.137.192/26
+ eca_mgmt_netmask: 255.255.255.192
+ eca_mgmt_start: 172.25.137.195
+ eca_mgmt_end: 172.25.137.254
+ security_group_name: mmsc_security_group_1
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_MultiPolicy_single_net_translation/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_MultiPolicy_single_net_translation/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..0744579c92
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_MultiPolicy_single_net_translation/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,305 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ left_vn_fqdn:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ Internal1_cidr:
+ hidden: false
+ immutable: false
+ type: string
+ src_port_start:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ Internal1_default_gateway:
+ hidden: false
+ immutable: false
+ type: string
+ Internal1_dhcp:
+ hidden: false
+ immutable: false
+ type: string
+ src_port_end:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ policy_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ dst_port_end:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ simple_action:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ service_instance_fq_name:
+ hidden: false
+ immutable: false
+ type: string
+ Internal2_cidr:
+ hidden: false
+ immutable: false
+ type: string
+ protocol:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ Internal2_dhcp:
+ hidden: false
+ immutable: false
+ type: string
+ dst_port_start:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ network_ipam_refs_data_ipam_subnets_addr_from_start_true:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ Internal2_default_gateway:
+ hidden: false
+ immutable: false
+ type: string
+ right_vn_fqdn:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ left_vn:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ direction:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ node_templates:
+ template_VirtualNetwork_2:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrailV2.VirtualNetwork
+ properties:
+ dhcp_enabled:
+ get_input: Internal1_dhcp
+ network_ipam_refs_data:
+ - network_ipam_refs_data_ipam_subnets:
+ - network_ipam_refs_data_ipam_subnets_subnet:
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len:
+ get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix:
+ get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2
+ network_ipam_refs_data_ipam_subnets_addr_from_start:
+ get_input: network_ipam_refs_data_ipam_subnets_addr_from_start_true
+ network_policy_refs_data:
+ - network_policy_refs_data_sequence:
+ network_policy_refs_data_sequence_major: 0
+ network_policy_refs_data_sequence_minor: 0
+ network_name:
+ get_input: left_vn
+ network_ipam_refs:
+ - UNSUPPORTED_RESOURCE_template_NetworkIpam_2
+ network_policy_refs:
+ - list_join:
+ - ':'
+ - get_attribute:
+ - template_NetworkPolicy_1
+ - fq_name
+ - get_attribute:
+ - template_NetworkPolicy_2
+ - fq_name
+ - template_NetworkPolicy_3
+ subnets:
+ Internal-subnet-1:
+ enable_dhcp:
+ get_input: Internal1_dhcp
+ cidr:
+ get_input: Internal1_cidr
+ gateway_ip:
+ get_input: Internal1_default_gateway
+ Internal-subnet-2:
+ enable_dhcp:
+ get_input: Internal2_dhcp
+ cidr:
+ get_input: Internal2_cidr
+ gateway_ip:
+ get_input: Internal2_default_gateway
+ requirements:
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: template_NetworkPolicy_1
+ relationship: tosca.relationships.DependsOn
+ template_NetworkPolicy_1:
+ type: org.openecomp.resource.vfc.rules.nodes.heat.network.contrailV2.NetworkRules
+ properties:
+ name:
+ get_input: policy_name
+ network_policy_entries:
+ network_policy_entries_policy_rule:
+ - network_policy_entries_policy_rule_dst_addresses:
+ - network_policy_entries_policy_rule_dst_addresses_virtual_network:
+ get_input: right_vn_fqdn
+ network_policy_entries_policy_rule_dst_ports:
+ - network_policy_entries_policy_rule_dst_ports_start_port:
+ get_input: dst_port_start
+ network_policy_entries_policy_rule_dst_ports_end_port:
+ get_input: dst_port_end
+ network_policy_entries_policy_rule_protocol:
+ get_input: protocol
+ network_policy_entries_policy_rule_src_addresses:
+ - network_policy_entries_policy_rule_src_addresses_virtual_network:
+ get_input: left_vn_fqdn
+ network_policy_entries_policy_rule_direction:
+ get_input: direction
+ network_policy_entries_policy_rule_src_ports:
+ - network_policy_entries_policy_rule_src_ports_start_port:
+ get_input: src_port_start
+ network_policy_entries_policy_rule_src_ports_end_port:
+ get_input: src_port_end
+ network_policy_entries_policy_rule_action_list:
+ network_policy_entries_policy_rule_action_list_simple_action:
+ get_input: simple_action
+ network_policy_entries_policy_rule_action_list_apply_service:
+ - get_input: service_instance_fq_name
+ requirements:
+ - network:
+ capability: tosca.capabilities.Attachment
+ node: template_VirtualNetwork_2
+ relationship: org.openecomp.relationships.AttachesTo
+ template_NetworkPolicy_3:
+ type: org.openecomp.resource.vfc.rules.nodes.heat.network.contrailV2.NetworkRules
+ properties:
+ name:
+ get_input: policy_name
+ network_policy_entries:
+ network_policy_entries_policy_rule:
+ - network_policy_entries_policy_rule_dst_addresses:
+ - network_policy_entries_policy_rule_dst_addresses_virtual_network:
+ get_input: right_vn_fqdn
+ network_policy_entries_policy_rule_dst_ports:
+ - network_policy_entries_policy_rule_dst_ports_start_port:
+ get_input: dst_port_start
+ network_policy_entries_policy_rule_dst_ports_end_port:
+ get_input: dst_port_end
+ network_policy_entries_policy_rule_protocol:
+ get_input: protocol
+ network_policy_entries_policy_rule_src_addresses:
+ - network_policy_entries_policy_rule_src_addresses_virtual_network:
+ get_input: left_vn_fqdn
+ network_policy_entries_policy_rule_direction:
+ get_input: direction
+ network_policy_entries_policy_rule_src_ports:
+ - network_policy_entries_policy_rule_src_ports_start_port:
+ get_input: src_port_start
+ network_policy_entries_policy_rule_src_ports_end_port:
+ get_input: src_port_end
+ network_policy_entries_policy_rule_action_list:
+ network_policy_entries_policy_rule_action_list_simple_action:
+ get_input: simple_action
+ network_policy_entries_policy_rule_action_list_apply_service:
+ - get_input: service_instance_fq_name
+ requirements:
+ - network:
+ capability: tosca.capabilities.Attachment
+ node: template_VirtualNetwork_2
+ relationship: org.openecomp.relationships.AttachesTo
+ template_NetworkPolicy_2:
+ type: org.openecomp.resource.vfc.rules.nodes.heat.network.contrailV2.NetworkRules
+ properties:
+ name:
+ get_input: policy_name
+ network_policy_entries:
+ network_policy_entries_policy_rule:
+ - network_policy_entries_policy_rule_dst_addresses:
+ - network_policy_entries_policy_rule_dst_addresses_virtual_network:
+ get_input: right_vn_fqdn
+ network_policy_entries_policy_rule_dst_ports:
+ - network_policy_entries_policy_rule_dst_ports_start_port:
+ get_input: dst_port_start
+ network_policy_entries_policy_rule_dst_ports_end_port:
+ get_input: dst_port_end
+ network_policy_entries_policy_rule_protocol:
+ get_input: protocol
+ network_policy_entries_policy_rule_src_addresses:
+ - network_policy_entries_policy_rule_src_addresses_virtual_network:
+ get_input: left_vn_fqdn
+ network_policy_entries_policy_rule_direction:
+ get_input: direction
+ network_policy_entries_policy_rule_src_ports:
+ - network_policy_entries_policy_rule_src_ports_start_port:
+ get_input: src_port_start
+ network_policy_entries_policy_rule_src_ports_end_port:
+ get_input: src_port_end
+ network_policy_entries_policy_rule_action_list:
+ network_policy_entries_policy_rule_action_list_simple_action:
+ get_input: simple_action
+ network_policy_entries_policy_rule_action_list_apply_service:
+ - get_input: service_instance_fq_name
+ requirements:
+ - network:
+ capability: tosca.capabilities.Attachment
+ node: template_VirtualNetwork_2
+ relationship: org.openecomp.relationships.AttachesTo
+ groups:
+ main:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/main.yml
+ description: cmaui server template for vMMSC
+ members:
+ - template_VirtualNetwork_2
+ - template_NetworkPolicy_1
+ - template_NetworkPolicy_3
+ - template_NetworkPolicy_2 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_MultiPolicy_single_net_translation/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_MultiPolicy_single_net_translation/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..539e26b7ab
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_MultiPolicy_single_net_translation/inputfiles/MANIFEST.json
@@ -0,0 +1,12 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "main.yml",
+ "type": "HEAT",
+ "isBase": "true"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_MultiPolicy_single_net_translation/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_MultiPolicy_single_net_translation/inputfiles/main.yml
new file mode 100644
index 0000000000..3681b1962b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_MultiPolicy_single_net_translation/inputfiles/main.yml
@@ -0,0 +1,223 @@
+description: "cmaui server template for vMMSC"
+heat_template_version: 2013-05-23
+parameters:
+ Internal1_cidr:
+ type: string
+ Internal2_cidr:
+ type: string
+ Internal1_default_gateway:
+ type: string
+ Internal2_default_gateway:
+ type: string
+ Internal1_dhcp:
+ type: string
+ Internal2_dhcp:
+ type: string
+ direction:
+ description: dummy
+ type: string
+ dst_port_end:
+ description: dummy
+ type: string
+ dst_port_start:
+ description: dummy
+ type: string
+ left_vn:
+ description: dummy
+ type: string
+ left_vn_fqdn:
+ description: dummy
+ type: string
+ network_ipam_refs_data_ipam_subnets_addr_from_start_true:
+ description: dummy
+ type: string
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2:
+ description: dummy
+ type: string
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2:
+ description: dummy
+ type: string
+ policy_name:
+ description: dummy
+ type: string
+ protocol:
+ description: dummy
+ type: string
+ right_vn_fqdn:
+ description: dummy
+ type: string
+ simple_action:
+ description: dummy
+ type: string
+ src_port_end:
+ description: dummy
+ type: string
+ src_port_start:
+ description: dummy
+ type: string
+ service_instance_fq_name:
+ type: string
+resources:
+ template_NetworkIpam_2:
+ properties:
+ name:
+ get_param: left_vn
+ type: "OS::ContrailV2::NetworkIpam"
+ template_NetworkPolicy_1:
+ properties:
+ name:
+ get_param: policy_name
+ network_policy_entries:
+ network_policy_entries_policy_rule:
+ -
+ network_policy_entries_policy_rule_action_list:
+ network_policy_entries_policy_rule_action_list_apply_service:
+ -
+ get_param: service_instance_fq_name
+ network_policy_entries_policy_rule_action_list_simple_action:
+ get_param: simple_action
+ network_policy_entries_policy_rule_direction:
+ get_param: direction
+ network_policy_entries_policy_rule_dst_addresses:
+ -
+ network_policy_entries_policy_rule_dst_addresses_virtual_network:
+ get_param: right_vn_fqdn
+ network_policy_entries_policy_rule_dst_ports:
+ -
+ network_policy_entries_policy_rule_dst_ports_end_port:
+ get_param: dst_port_end
+ network_policy_entries_policy_rule_dst_ports_start_port:
+ get_param: dst_port_start
+ network_policy_entries_policy_rule_protocol:
+ get_param: protocol
+ network_policy_entries_policy_rule_src_addresses:
+ -
+ network_policy_entries_policy_rule_src_addresses_virtual_network:
+ get_param: left_vn_fqdn
+ network_policy_entries_policy_rule_src_ports:
+ -
+ network_policy_entries_policy_rule_src_ports_end_port:
+ get_param: src_port_end
+ network_policy_entries_policy_rule_src_ports_start_port:
+ get_param: src_port_start
+ type: "OS::ContrailV2::NetworkPolicy"
+ template_NetworkPolicy_2:
+ properties:
+ name:
+ get_param: policy_name
+ network_policy_entries:
+ network_policy_entries_policy_rule:
+ -
+ network_policy_entries_policy_rule_action_list:
+ network_policy_entries_policy_rule_action_list_apply_service:
+ -
+ get_param: service_instance_fq_name
+ network_policy_entries_policy_rule_action_list_simple_action:
+ get_param: simple_action
+ network_policy_entries_policy_rule_direction:
+ get_param: direction
+ network_policy_entries_policy_rule_dst_addresses:
+ -
+ network_policy_entries_policy_rule_dst_addresses_virtual_network:
+ get_param: right_vn_fqdn
+ network_policy_entries_policy_rule_dst_ports:
+ -
+ network_policy_entries_policy_rule_dst_ports_end_port:
+ get_param: dst_port_end
+ network_policy_entries_policy_rule_dst_ports_start_port:
+ get_param: dst_port_start
+ network_policy_entries_policy_rule_protocol:
+ get_param: protocol
+ network_policy_entries_policy_rule_src_addresses:
+ -
+ network_policy_entries_policy_rule_src_addresses_virtual_network:
+ get_param: left_vn_fqdn
+ network_policy_entries_policy_rule_src_ports:
+ -
+ network_policy_entries_policy_rule_src_ports_end_port:
+ get_param: src_port_end
+ network_policy_entries_policy_rule_src_ports_start_port:
+ get_param: src_port_start
+ type: "OS::ContrailV2::NetworkPolicy"
+ template_NetworkPolicy_3:
+ properties:
+ name:
+ get_param: policy_name
+ network_policy_entries:
+ network_policy_entries_policy_rule:
+ -
+ network_policy_entries_policy_rule_action_list:
+ network_policy_entries_policy_rule_action_list_apply_service:
+ -
+ get_param: service_instance_fq_name
+ network_policy_entries_policy_rule_action_list_simple_action:
+ get_param: simple_action
+ network_policy_entries_policy_rule_direction:
+ get_param: direction
+ network_policy_entries_policy_rule_dst_addresses:
+ -
+ network_policy_entries_policy_rule_dst_addresses_virtual_network:
+ get_param: right_vn_fqdn
+ network_policy_entries_policy_rule_dst_ports:
+ -
+ network_policy_entries_policy_rule_dst_ports_end_port:
+ get_param: dst_port_end
+ network_policy_entries_policy_rule_dst_ports_start_port:
+ get_param: dst_port_start
+ network_policy_entries_policy_rule_protocol:
+ get_param: protocol
+ network_policy_entries_policy_rule_src_addresses:
+ -
+ network_policy_entries_policy_rule_src_addresses_virtual_network:
+ get_param: left_vn_fqdn
+ network_policy_entries_policy_rule_src_ports:
+ -
+ network_policy_entries_policy_rule_src_ports_end_port:
+ get_param: src_port_end
+ network_policy_entries_policy_rule_src_ports_start_port:
+ get_param: src_port_start
+ type: "OS::ContrailV2::NetworkPolicy"
+
+ template_VirtualNetwork_2:
+ depends_on:
+ - template_NetworkIpam_2
+ - template_NetworkPolicy_1
+ properties:
+ name:
+ get_param: left_vn
+ network_ipam_refs:
+ -
+ get_resource: template_NetworkIpam_2
+ network_ipam_refs_data:
+ -
+ network_ipam_refs_data_ipam_subnets:
+ -
+ network_ipam_refs_data_ipam_subnets_addr_from_start:
+ get_param: network_ipam_refs_data_ipam_subnets_addr_from_start_true
+ network_ipam_refs_data_ipam_subnets_subnet:
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix:
+ get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len:
+ get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2
+ network_policy_refs: [ { list_join: [':', { get_attr: [ template_NetworkPolicy_1, fq_name ] } ] }, { get_attr: [ template_NetworkPolicy_2, fq_name ] },{ get_resource: template_NetworkPolicy_3}]
+ network_policy_refs_data:
+ -
+ network_policy_refs_data_sequence:
+ network_policy_refs_data_sequence_major: 0
+ network_policy_refs_data_sequence_minor: 0
+ type: "OS::ContrailV2::VirtualNetwork"
+ Internal-subnet-1:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: template_VirtualNetwork_2 }
+ cidr: { get_param: Internal1_cidr }
+ gateway_ip: { get_param: Internal1_default_gateway }
+ enable_dhcp: { get_param: Internal1_dhcp }
+
+ Internal-subnet-2:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: template_VirtualNetwork_2 }
+ cidr: { get_param: Internal2_cidr }
+ gateway_ip: { get_param: Internal2_default_gateway }
+ enable_dhcp: { get_param: Internal2_dhcp } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_Multi_net_single_policy_translation/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_Multi_net_single_policy_translation/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..f00614b2ad
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_Multi_net_single_policy_translation/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,291 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ left_vn_fqdn:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ Internal1_cidr:
+ hidden: false
+ immutable: false
+ type: string
+ src_port_start:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ Internal1_default_gateway:
+ hidden: false
+ immutable: false
+ type: string
+ Internal1_dhcp:
+ hidden: false
+ immutable: false
+ type: string
+ src_port_end:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ policy_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ dst_port_end:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ simple_action:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ service_instance_fq_name:
+ hidden: false
+ immutable: false
+ type: string
+ Internal2_cidr:
+ hidden: false
+ immutable: false
+ type: string
+ protocol:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ Internal2_dhcp:
+ hidden: false
+ immutable: false
+ type: string
+ dst_port_start:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ network_ipam_refs_data_ipam_subnets_addr_from_start_true:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ Internal2_default_gateway:
+ hidden: false
+ immutable: false
+ type: string
+ right_vn_fqdn:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ left_vn:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ direction:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ node_templates:
+ template_NetworkPolicy:
+ type: org.openecomp.resource.vfc.rules.nodes.heat.network.contrailV2.NetworkRules
+ properties:
+ name:
+ get_input: policy_name
+ network_policy_entries:
+ network_policy_entries_policy_rule:
+ - network_policy_entries_policy_rule_dst_addresses:
+ - network_policy_entries_policy_rule_dst_addresses_virtual_network:
+ get_input: right_vn_fqdn
+ network_policy_entries_policy_rule_dst_ports:
+ - network_policy_entries_policy_rule_dst_ports_start_port:
+ get_input: dst_port_start
+ network_policy_entries_policy_rule_dst_ports_end_port:
+ get_input: dst_port_end
+ network_policy_entries_policy_rule_protocol:
+ get_input: protocol
+ network_policy_entries_policy_rule_src_addresses:
+ - network_policy_entries_policy_rule_src_addresses_virtual_network:
+ get_input: left_vn_fqdn
+ network_policy_entries_policy_rule_direction:
+ get_input: direction
+ network_policy_entries_policy_rule_src_ports:
+ - network_policy_entries_policy_rule_src_ports_start_port:
+ get_input: src_port_start
+ network_policy_entries_policy_rule_src_ports_end_port:
+ get_input: src_port_end
+ network_policy_entries_policy_rule_action_list:
+ network_policy_entries_policy_rule_action_list_simple_action:
+ get_input: simple_action
+ network_policy_entries_policy_rule_action_list_apply_service:
+ - get_input: service_instance_fq_name
+ requirements:
+ - network:
+ capability: tosca.capabilities.Attachment
+ node: template_VirtualNetwork_1
+ relationship: org.openecomp.relationships.AttachesTo
+ - network:
+ capability: tosca.capabilities.Attachment
+ node: template_VirtualNetwork_2
+ relationship: org.openecomp.relationships.AttachesTo
+ - network:
+ capability: tosca.capabilities.Attachment
+ node: template_VirtualNetwork_3
+ relationship: org.openecomp.relationships.AttachesTo
+ template_VirtualNetwork_2:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrailV2.VirtualNetwork
+ properties:
+ dhcp_enabled:
+ get_input: Internal1_dhcp
+ network_ipam_refs_data:
+ - network_ipam_refs_data_ipam_subnets:
+ - network_ipam_refs_data_ipam_subnets_subnet:
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len:
+ get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix:
+ get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2
+ network_ipam_refs_data_ipam_subnets_addr_from_start:
+ get_input: network_ipam_refs_data_ipam_subnets_addr_from_start_true
+ network_policy_refs_data:
+ - network_policy_refs_data_sequence:
+ network_policy_refs_data_sequence_major: 0
+ network_policy_refs_data_sequence_minor: 0
+ network_name:
+ get_input: left_vn
+ network_ipam_refs:
+ - UNSUPPORTED_RESOURCE_template_NetworkIpam_2
+ network_policy_refs:
+ - get_attribute:
+ - template_NetworkPolicy
+ - fq_name
+ subnets:
+ Internal-subnet-1:
+ enable_dhcp:
+ get_input: Internal1_dhcp
+ cidr:
+ get_input: Internal1_cidr
+ gateway_ip:
+ get_input: Internal1_default_gateway
+ Internal-subnet-2:
+ enable_dhcp:
+ get_input: Internal2_dhcp
+ cidr:
+ get_input: Internal2_cidr
+ gateway_ip:
+ get_input: Internal2_default_gateway
+ requirements:
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: template_NetworkPolicy
+ relationship: tosca.relationships.DependsOn
+ template_VirtualNetwork_1:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrailV2.VirtualNetwork
+ properties:
+ network_ipam_refs_data:
+ - network_ipam_refs_data_ipam_subnets:
+ - network_ipam_refs_data_ipam_subnets_subnet:
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len:
+ get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix:
+ get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2
+ network_ipam_refs_data_ipam_subnets_addr_from_start:
+ get_input: network_ipam_refs_data_ipam_subnets_addr_from_start_true
+ network_policy_refs_data:
+ - network_policy_refs_data_sequence:
+ network_policy_refs_data_sequence_major: 0
+ network_policy_refs_data_sequence_minor: 0
+ network_name:
+ get_input: left_vn
+ network_ipam_refs:
+ - UNSUPPORTED_RESOURCE_template_NetworkIpam_2
+ network_policy_refs:
+ - list_join:
+ - ':'
+ - get_attribute:
+ - template_NetworkPolicy
+ - fq_name
+ requirements:
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: template_NetworkPolicy
+ relationship: tosca.relationships.DependsOn
+ template_VirtualNetwork_3:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrailV2.VirtualNetwork
+ properties:
+ network_ipam_refs_data:
+ - network_ipam_refs_data_ipam_subnets:
+ - network_ipam_refs_data_ipam_subnets_subnet:
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len:
+ get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix:
+ get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2
+ network_ipam_refs_data_ipam_subnets_addr_from_start:
+ get_input: network_ipam_refs_data_ipam_subnets_addr_from_start_true
+ network_policy_refs_data:
+ - network_policy_refs_data_sequence:
+ network_policy_refs_data_sequence_major: 0
+ network_policy_refs_data_sequence_minor: 0
+ network_name:
+ get_input: left_vn
+ network_ipam_refs:
+ - UNSUPPORTED_RESOURCE_template_NetworkIpam_2
+ network_policy_refs:
+ - template_NetworkPolicy
+ requirements:
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: template_NetworkPolicy
+ relationship: tosca.relationships.DependsOn
+ groups:
+ main:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/main.yml
+ description: cmaui server template for vMMSC
+ members:
+ - template_NetworkPolicy
+ - template_VirtualNetwork_2
+ - template_VirtualNetwork_1
+ - template_VirtualNetwork_3 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_Multi_net_single_policy_translation/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_Multi_net_single_policy_translation/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..539e26b7ab
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_Multi_net_single_policy_translation/inputfiles/MANIFEST.json
@@ -0,0 +1,12 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "main.yml",
+ "type": "HEAT",
+ "isBase": "true"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_Multi_net_single_policy_translation/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_Multi_net_single_policy_translation/inputfiles/main.yml
new file mode 100644
index 0000000000..ceb55edea2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_Multi_net_single_policy_translation/inputfiles/main.yml
@@ -0,0 +1,203 @@
+description: "cmaui server template for vMMSC"
+heat_template_version: 2013-05-23
+parameters:
+ Internal1_cidr:
+ type: string
+ Internal2_cidr:
+ type: string
+ Internal1_default_gateway:
+ type: string
+ Internal2_default_gateway:
+ type: string
+ Internal1_dhcp:
+ type: string
+ Internal2_dhcp:
+ type: string
+ direction:
+ description: dummy
+ type: string
+ dst_port_end:
+ description: dummy
+ type: string
+ dst_port_start:
+ description: dummy
+ type: string
+ left_vn:
+ description: dummy
+ type: string
+ left_vn_fqdn:
+ description: dummy
+ type: string
+ network_ipam_refs_data_ipam_subnets_addr_from_start_true:
+ description: dummy
+ type: string
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2:
+ description: dummy
+ type: string
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2:
+ description: dummy
+ type: string
+ policy_name:
+ description: dummy
+ type: string
+ protocol:
+ description: dummy
+ type: string
+ right_vn_fqdn:
+ description: dummy
+ type: string
+ simple_action:
+ description: dummy
+ type: string
+ src_port_end:
+ description: dummy
+ type: string
+ src_port_start:
+ description: dummy
+ type: string
+ service_instance_fq_name:
+ type: string
+resources:
+ template_NetworkIpam_2:
+ properties:
+ name:
+ get_param: left_vn
+ type: "OS::ContrailV2::NetworkIpam"
+ template_NetworkPolicy:
+ properties:
+ name:
+ get_param: policy_name
+ network_policy_entries:
+ network_policy_entries_policy_rule:
+ -
+ network_policy_entries_policy_rule_action_list:
+ network_policy_entries_policy_rule_action_list_apply_service:
+ -
+ get_param: service_instance_fq_name
+ network_policy_entries_policy_rule_action_list_simple_action:
+ get_param: simple_action
+ network_policy_entries_policy_rule_direction:
+ get_param: direction
+ network_policy_entries_policy_rule_dst_addresses:
+ -
+ network_policy_entries_policy_rule_dst_addresses_virtual_network:
+ get_param: right_vn_fqdn
+ network_policy_entries_policy_rule_dst_ports:
+ -
+ network_policy_entries_policy_rule_dst_ports_end_port:
+ get_param: dst_port_end
+ network_policy_entries_policy_rule_dst_ports_start_port:
+ get_param: dst_port_start
+ network_policy_entries_policy_rule_protocol:
+ get_param: protocol
+ network_policy_entries_policy_rule_src_addresses:
+ -
+ network_policy_entries_policy_rule_src_addresses_virtual_network:
+ get_param: left_vn_fqdn
+ network_policy_entries_policy_rule_src_ports:
+ -
+ network_policy_entries_policy_rule_src_ports_end_port:
+ get_param: src_port_end
+ network_policy_entries_policy_rule_src_ports_start_port:
+ get_param: src_port_start
+ type: "OS::ContrailV2::NetworkPolicy"
+ template_VirtualNetwork_1:
+ depends_on:
+ - template_NetworkIpam_2
+ - template_NetworkPolicy
+ properties:
+ name:
+ get_param: left_vn
+ network_ipam_refs:
+ -
+ get_resource: template_NetworkIpam_2
+ network_ipam_refs_data:
+ -
+ network_ipam_refs_data_ipam_subnets:
+ -
+ network_ipam_refs_data_ipam_subnets_addr_from_start:
+ get_param: network_ipam_refs_data_ipam_subnets_addr_from_start_true
+ network_ipam_refs_data_ipam_subnets_subnet:
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix:
+ get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len:
+ get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2
+ network_policy_refs: [ { list_join: [':', { get_attr: [ template_NetworkPolicy, fq_name ] } ] } ]
+ network_policy_refs_data:
+ -
+ network_policy_refs_data_sequence:
+ network_policy_refs_data_sequence_major: 0
+ network_policy_refs_data_sequence_minor: 0
+ type: "OS::ContrailV2::VirtualNetwork"
+ template_VirtualNetwork_2:
+ depends_on:
+ - template_NetworkIpam_2
+ - template_NetworkPolicy
+ properties:
+ name:
+ get_param: left_vn
+ network_ipam_refs:
+ -
+ get_resource: template_NetworkIpam_2
+ network_ipam_refs_data:
+ -
+ network_ipam_refs_data_ipam_subnets:
+ -
+ network_ipam_refs_data_ipam_subnets_addr_from_start:
+ get_param: network_ipam_refs_data_ipam_subnets_addr_from_start_true
+ network_ipam_refs_data_ipam_subnets_subnet:
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix:
+ get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len:
+ get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2
+ network_policy_refs: [ { get_attr: [ template_NetworkPolicy, fq_name ] } ]
+ network_policy_refs_data:
+ -
+ network_policy_refs_data_sequence:
+ network_policy_refs_data_sequence_major: 0
+ network_policy_refs_data_sequence_minor: 0
+ type: "OS::ContrailV2::VirtualNetwork"
+ template_VirtualNetwork_3:
+ depends_on:
+ - template_NetworkIpam_2
+ - template_NetworkPolicy
+ properties:
+ name:
+ get_param: left_vn
+ network_ipam_refs:
+ -
+ get_resource: template_NetworkIpam_2
+ network_ipam_refs_data:
+ -
+ network_ipam_refs_data_ipam_subnets:
+ -
+ network_ipam_refs_data_ipam_subnets_addr_from_start:
+ get_param: network_ipam_refs_data_ipam_subnets_addr_from_start_true
+ network_ipam_refs_data_ipam_subnets_subnet:
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix:
+ get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len:
+ get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2
+ network_policy_refs: [ { get_resource: template_NetworkPolicy } ]
+ network_policy_refs_data:
+ -
+ network_policy_refs_data_sequence:
+ network_policy_refs_data_sequence_major: 0
+ network_policy_refs_data_sequence_minor: 0
+ type: "OS::ContrailV2::VirtualNetwork"
+
+ Internal-subnet-1:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: template_VirtualNetwork_2 }
+ cidr: { get_param: Internal1_cidr }
+ gateway_ip: { get_param: Internal1_default_gateway }
+ enable_dhcp: { get_param: Internal1_dhcp }
+
+ Internal-subnet-2:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: template_VirtualNetwork_2 }
+ cidr: { get_param: Internal2_cidr }
+ gateway_ip: { get_param: Internal2_default_gateway }
+ enable_dhcp: { get_param: Internal2_dhcp } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/invalid_policy_resource_type/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/invalid_policy_resource_type/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..31bb9db74a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/invalid_policy_resource_type/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,193 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ left_vn_fqdn:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ Internal1_cidr:
+ hidden: false
+ immutable: false
+ type: string
+ src_port_start:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ Internal1_default_gateway:
+ hidden: false
+ immutable: false
+ type: string
+ Internal1_dhcp:
+ hidden: false
+ immutable: false
+ type: string
+ src_port_end:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ policy_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ dst_port_end:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ simple_action:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ service_instance_fq_name:
+ hidden: false
+ immutable: false
+ type: string
+ Internal2_cidr:
+ hidden: false
+ immutable: false
+ type: string
+ protocol:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ Internal2_dhcp:
+ hidden: false
+ immutable: false
+ type: string
+ dst_port_start:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ network_ipam_refs_data_ipam_subnets_addr_from_start_true:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ Internal2_default_gateway:
+ hidden: false
+ immutable: false
+ type: string
+ right_vn_fqdn:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ left_vn:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ direction:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ node_templates:
+ template_NetworkPolicy:
+ type: org.openecomp.resource.vfc.rules.nodes.heat.network.contrail.NetworkRules
+ properties:
+ name:
+ get_input: policy_name
+ template_VirtualNetwork_2:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrailV2.VirtualNetwork
+ properties:
+ dhcp_enabled:
+ get_input: Internal1_dhcp
+ network_ipam_refs_data:
+ - network_ipam_refs_data_ipam_subnets:
+ - network_ipam_refs_data_ipam_subnets_subnet:
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len:
+ get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix:
+ get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2
+ network_ipam_refs_data_ipam_subnets_addr_from_start:
+ get_input: network_ipam_refs_data_ipam_subnets_addr_from_start_true
+ network_policy_refs_data:
+ - network_policy_refs_data_sequence:
+ network_policy_refs_data_sequence_major: 0
+ network_policy_refs_data_sequence_minor: 0
+ network_name:
+ get_input: left_vn
+ network_ipam_refs:
+ - UNSUPPORTED_RESOURCE_template_NetworkIpam_2
+ network_policy_refs:
+ - list_join:
+ - ':'
+ - get_attribute:
+ - template_NetworkPolicy
+ - fq_name
+ subnets:
+ Internal-subnet-1:
+ enable_dhcp:
+ get_input: Internal1_dhcp
+ cidr:
+ get_input: Internal1_cidr
+ gateway_ip:
+ get_input: Internal1_default_gateway
+ Internal-subnet-2:
+ enable_dhcp:
+ get_input: Internal2_dhcp
+ cidr:
+ get_input: Internal2_cidr
+ gateway_ip:
+ get_input: Internal2_default_gateway
+ requirements:
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: template_NetworkPolicy
+ relationship: tosca.relationships.DependsOn
+ groups:
+ main:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/main.yml
+ description: cmaui server template for vMMSC
+ members:
+ - template_NetworkPolicy
+ - template_VirtualNetwork_2 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/invalid_policy_resource_type/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/invalid_policy_resource_type/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..539e26b7ab
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/invalid_policy_resource_type/inputfiles/MANIFEST.json
@@ -0,0 +1,12 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "main.yml",
+ "type": "HEAT",
+ "isBase": "true"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/invalid_policy_resource_type/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/invalid_policy_resource_type/inputfiles/main.yml
new file mode 100644
index 0000000000..013b62d42c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/invalid_policy_resource_type/inputfiles/main.yml
@@ -0,0 +1,153 @@
+description: "cmaui server template for vMMSC"
+heat_template_version: 2013-05-23
+parameters:
+ Internal1_cidr:
+ type: string
+ Internal2_cidr:
+ type: string
+ Internal1_default_gateway:
+ type: string
+ Internal2_default_gateway:
+ type: string
+ Internal1_dhcp:
+ type: string
+ Internal2_dhcp:
+ type: string
+ direction:
+ description: dummy
+ type: string
+ dst_port_end:
+ description: dummy
+ type: string
+ dst_port_start:
+ description: dummy
+ type: string
+ left_vn:
+ description: dummy
+ type: string
+ left_vn_fqdn:
+ description: dummy
+ type: string
+ network_ipam_refs_data_ipam_subnets_addr_from_start_true:
+ description: dummy
+ type: string
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2:
+ description: dummy
+ type: string
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2:
+ description: dummy
+ type: string
+ policy_name:
+ description: dummy
+ type: string
+ protocol:
+ description: dummy
+ type: string
+ right_vn_fqdn:
+ description: dummy
+ type: string
+ simple_action:
+ description: dummy
+ type: string
+ src_port_end:
+ description: dummy
+ type: string
+ src_port_start:
+ description: dummy
+ type: string
+ service_instance_fq_name:
+ type: string
+resources:
+ template_NetworkIpam_2:
+ properties:
+ name:
+ get_param: left_vn
+ type: "OS::ContrailV2::NetworkIpam"
+ template_NetworkPolicy:
+ properties:
+ name:
+ get_param: policy_name
+ network_policy_entries:
+ network_policy_entries_policy_rule:
+ -
+ network_policy_entries_policy_rule_action_list:
+ network_policy_entries_policy_rule_action_list_apply_service:
+ -
+ get_param: service_instance_fq_name
+ network_policy_entries_policy_rule_action_list_simple_action:
+ get_param: simple_action
+ network_policy_entries_policy_rule_direction:
+ get_param: direction
+ network_policy_entries_policy_rule_dst_addresses:
+ -
+ network_policy_entries_policy_rule_dst_addresses_virtual_network:
+ get_param: right_vn_fqdn
+ network_policy_entries_policy_rule_dst_ports:
+ -
+ network_policy_entries_policy_rule_dst_ports_end_port:
+ get_param: dst_port_end
+ network_policy_entries_policy_rule_dst_ports_start_port:
+ get_param: dst_port_start
+ network_policy_entries_policy_rule_protocol:
+ get_param: protocol
+ network_policy_entries_policy_rule_src_addresses:
+ -
+ network_policy_entries_policy_rule_src_addresses_virtual_network:
+ get_param: left_vn_fqdn
+ network_policy_entries_policy_rule_src_ports:
+ -
+ network_policy_entries_policy_rule_src_ports_end_port:
+ get_param: src_port_end
+ network_policy_entries_policy_rule_src_ports_start_port:
+ get_param: src_port_start
+ type: "OS::Contrail::NetworkPolicy"
+ template_VirtualNetwork_2:
+ depends_on:
+ - template_NetworkIpam_2
+ - template_NetworkPolicy
+ properties:
+ name:
+ get_param: left_vn
+ network_ipam_refs:
+ -
+ get_resource: template_NetworkIpam_2
+ network_ipam_refs_data:
+ -
+ network_ipam_refs_data_ipam_subnets:
+ -
+ network_ipam_refs_data_ipam_subnets_addr_from_start:
+ get_param: network_ipam_refs_data_ipam_subnets_addr_from_start_true
+ network_ipam_refs_data_ipam_subnets_subnet:
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix:
+ get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len:
+ get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2
+ network_policy_refs:
+ -
+ list_join:
+ - ":"
+ -
+ get_attr:
+ - template_NetworkPolicy
+ - fq_name
+ network_policy_refs_data:
+ -
+ network_policy_refs_data_sequence:
+ network_policy_refs_data_sequence_major: 0
+ network_policy_refs_data_sequence_minor: 0
+ type: "OS::ContrailV2::VirtualNetwork"
+ Internal-subnet-1:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: template_VirtualNetwork_2 }
+ cidr: { get_param: Internal1_cidr }
+ gateway_ip: { get_param: Internal1_default_gateway }
+ enable_dhcp: { get_param: Internal1_dhcp }
+
+ Internal-subnet-2:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: template_VirtualNetwork_2 }
+ cidr: { get_param: Internal2_cidr }
+ gateway_ip: { get_param: Internal2_default_gateway }
+ enable_dhcp: { get_param: Internal2_dhcp } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/simple/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/simple/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..3abd06c651
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/simple/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,225 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ left_vn_fqdn:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ Internal1_cidr:
+ hidden: false
+ immutable: false
+ type: string
+ src_port_start:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ Internal1_default_gateway:
+ hidden: false
+ immutable: false
+ type: string
+ Internal1_dhcp:
+ hidden: false
+ immutable: false
+ type: string
+ src_port_end:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ policy_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ dst_port_end:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ simple_action:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ service_instance_fq_name:
+ hidden: false
+ immutable: false
+ type: string
+ Internal2_cidr:
+ hidden: false
+ immutable: false
+ type: string
+ protocol:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ Internal2_dhcp:
+ hidden: false
+ immutable: false
+ type: string
+ dst_port_start:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ network_ipam_refs_data_ipam_subnets_addr_from_start_true:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ Internal2_default_gateway:
+ hidden: false
+ immutable: false
+ type: string
+ right_vn_fqdn:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ left_vn:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ direction:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ node_templates:
+ template_NetworkPolicy:
+ type: org.openecomp.resource.vfc.rules.nodes.heat.network.contrailV2.NetworkRules
+ properties:
+ name:
+ get_input: policy_name
+ network_policy_entries:
+ network_policy_entries_policy_rule:
+ - network_policy_entries_policy_rule_dst_addresses:
+ - network_policy_entries_policy_rule_dst_addresses_virtual_network:
+ get_input: right_vn_fqdn
+ network_policy_entries_policy_rule_dst_ports:
+ - network_policy_entries_policy_rule_dst_ports_start_port:
+ get_input: dst_port_start
+ network_policy_entries_policy_rule_dst_ports_end_port:
+ get_input: dst_port_end
+ network_policy_entries_policy_rule_protocol:
+ get_input: protocol
+ network_policy_entries_policy_rule_src_addresses:
+ - network_policy_entries_policy_rule_src_addresses_virtual_network:
+ get_input: left_vn_fqdn
+ network_policy_entries_policy_rule_direction:
+ get_input: direction
+ network_policy_entries_policy_rule_src_ports:
+ - network_policy_entries_policy_rule_src_ports_start_port:
+ get_input: src_port_start
+ network_policy_entries_policy_rule_src_ports_end_port:
+ get_input: src_port_end
+ network_policy_entries_policy_rule_action_list:
+ network_policy_entries_policy_rule_action_list_simple_action:
+ get_input: simple_action
+ network_policy_entries_policy_rule_action_list_apply_service:
+ - get_input: service_instance_fq_name
+ requirements:
+ - network:
+ capability: tosca.capabilities.Attachment
+ node: template_VirtualNetwork_2
+ relationship: org.openecomp.relationships.AttachesTo
+ template_VirtualNetwork_2:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrailV2.VirtualNetwork
+ properties:
+ dhcp_enabled:
+ get_input: Internal1_dhcp
+ network_ipam_refs_data:
+ - network_ipam_refs_data_ipam_subnets:
+ - network_ipam_refs_data_ipam_subnets_subnet:
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len:
+ get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix:
+ get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2
+ network_ipam_refs_data_ipam_subnets_addr_from_start:
+ get_input: network_ipam_refs_data_ipam_subnets_addr_from_start_true
+ network_policy_refs_data:
+ - network_policy_refs_data_sequence:
+ network_policy_refs_data_sequence_major: 0
+ network_policy_refs_data_sequence_minor: 0
+ network_name:
+ get_input: left_vn
+ network_ipam_refs:
+ - UNSUPPORTED_RESOURCE_template_NetworkIpam_2
+ network_policy_refs:
+ - list_join:
+ - ':'
+ - get_attribute:
+ - template_NetworkPolicy
+ - fq_name
+ subnets:
+ Internal-subnet-1:
+ enable_dhcp:
+ get_input: Internal1_dhcp
+ cidr:
+ get_input: Internal1_cidr
+ gateway_ip:
+ get_input: Internal1_default_gateway
+ Internal-subnet-2:
+ enable_dhcp:
+ get_input: Internal2_dhcp
+ cidr:
+ get_input: Internal2_cidr
+ gateway_ip:
+ get_input: Internal2_default_gateway
+ requirements:
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: template_NetworkPolicy
+ relationship: tosca.relationships.DependsOn
+ groups:
+ main:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/main.yml
+ description: cmaui server template for vMMSC
+ members:
+ - template_NetworkPolicy
+ - template_VirtualNetwork_2 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/simple/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/simple/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..539e26b7ab
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/simple/inputfiles/MANIFEST.json
@@ -0,0 +1,12 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "main.yml",
+ "type": "HEAT",
+ "isBase": "true"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/simple/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/simple/inputfiles/main.yml
new file mode 100644
index 0000000000..b14811e8e0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/simple/inputfiles/main.yml
@@ -0,0 +1,153 @@
+description: "cmaui server template for vMMSC"
+heat_template_version: 2013-05-23
+parameters:
+ Internal1_cidr:
+ type: string
+ Internal2_cidr:
+ type: string
+ Internal1_default_gateway:
+ type: string
+ Internal2_default_gateway:
+ type: string
+ Internal1_dhcp:
+ type: string
+ Internal2_dhcp:
+ type: string
+ direction:
+ description: dummy
+ type: string
+ dst_port_end:
+ description: dummy
+ type: string
+ dst_port_start:
+ description: dummy
+ type: string
+ left_vn:
+ description: dummy
+ type: string
+ left_vn_fqdn:
+ description: dummy
+ type: string
+ network_ipam_refs_data_ipam_subnets_addr_from_start_true:
+ description: dummy
+ type: string
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2:
+ description: dummy
+ type: string
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2:
+ description: dummy
+ type: string
+ policy_name:
+ description: dummy
+ type: string
+ protocol:
+ description: dummy
+ type: string
+ right_vn_fqdn:
+ description: dummy
+ type: string
+ simple_action:
+ description: dummy
+ type: string
+ src_port_end:
+ description: dummy
+ type: string
+ src_port_start:
+ description: dummy
+ type: string
+ service_instance_fq_name:
+ type: string
+resources:
+ template_NetworkIpam_2:
+ properties:
+ name:
+ get_param: left_vn
+ type: "OS::ContrailV2::NetworkIpam"
+ template_NetworkPolicy:
+ properties:
+ name:
+ get_param: policy_name
+ network_policy_entries:
+ network_policy_entries_policy_rule:
+ -
+ network_policy_entries_policy_rule_action_list:
+ network_policy_entries_policy_rule_action_list_apply_service:
+ -
+ get_param: service_instance_fq_name
+ network_policy_entries_policy_rule_action_list_simple_action:
+ get_param: simple_action
+ network_policy_entries_policy_rule_direction:
+ get_param: direction
+ network_policy_entries_policy_rule_dst_addresses:
+ -
+ network_policy_entries_policy_rule_dst_addresses_virtual_network:
+ get_param: right_vn_fqdn
+ network_policy_entries_policy_rule_dst_ports:
+ -
+ network_policy_entries_policy_rule_dst_ports_end_port:
+ get_param: dst_port_end
+ network_policy_entries_policy_rule_dst_ports_start_port:
+ get_param: dst_port_start
+ network_policy_entries_policy_rule_protocol:
+ get_param: protocol
+ network_policy_entries_policy_rule_src_addresses:
+ -
+ network_policy_entries_policy_rule_src_addresses_virtual_network:
+ get_param: left_vn_fqdn
+ network_policy_entries_policy_rule_src_ports:
+ -
+ network_policy_entries_policy_rule_src_ports_end_port:
+ get_param: src_port_end
+ network_policy_entries_policy_rule_src_ports_start_port:
+ get_param: src_port_start
+ type: "OS::ContrailV2::NetworkPolicy"
+ template_VirtualNetwork_2:
+ depends_on:
+ - template_NetworkIpam_2
+ - template_NetworkPolicy
+ properties:
+ name:
+ get_param: left_vn
+ network_ipam_refs:
+ -
+ get_resource: template_NetworkIpam_2
+ network_ipam_refs_data:
+ -
+ network_ipam_refs_data_ipam_subnets:
+ -
+ network_ipam_refs_data_ipam_subnets_addr_from_start:
+ get_param: network_ipam_refs_data_ipam_subnets_addr_from_start_true
+ network_ipam_refs_data_ipam_subnets_subnet:
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix:
+ get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len:
+ get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2
+ network_policy_refs:
+ -
+ list_join:
+ - ":"
+ -
+ get_attr:
+ - template_NetworkPolicy
+ - fq_name
+ network_policy_refs_data:
+ -
+ network_policy_refs_data_sequence:
+ network_policy_refs_data_sequence_major: 0
+ network_policy_refs_data_sequence_minor: 0
+ type: "OS::ContrailV2::VirtualNetwork"
+ Internal-subnet-1:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: template_VirtualNetwork_2 }
+ cidr: { get_param: Internal1_cidr }
+ gateway_ip: { get_param: Internal1_default_gateway }
+ enable_dhcp: { get_param: Internal1_dhcp }
+
+ Internal-subnet-2:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: template_VirtualNetwork_2 }
+ cidr: { get_param: Internal2_cidr }
+ gateway_ip: { get_param: Internal2_default_gateway }
+ enable_dhcp: { get_param: Internal2_dhcp } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/multi/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/multi/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..9b25041540
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/multi/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,190 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cmaui:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p1:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ template_PortTuple_LB1:
+ hidden: false
+ immutable: false
+ type: string
+ oam_sec_group_name:
+ hidden: false
+ immutable: false
+ type: string
+ lb_st_interface_type_oam:
+ hidden: false
+ immutable: false
+ type: string
+ security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ shared_network_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ jsa_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ shared_network_id1:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ hidden: false
+ immutable: false
+ type: string
+ node_templates:
+ template_VMInt_OAM_lb_1:
+ type: org.openecomp.resource.cp.nodes.heat.contrailV2.VirtualMachineInterface
+ properties:
+ security_group_refs:
+ - get_input: oam_sec_group_name
+ virtual_network_refs:
+ - get_input: shared_network_id
+ virtual_machine_interface_properties:
+ virtual_machine_interface_properties_service_interface_type:
+ get_input: lb_st_interface_type_oam
+ port_tuple_refs:
+ - get_input: template_PortTuple_LB1
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ template_VMInt_OAM_lb_2:
+ type: org.openecomp.resource.cp.nodes.heat.contrailV2.VirtualMachineInterface
+ properties:
+ security_group_refs:
+ - get_input: oam_sec_group_name
+ virtual_network_refs:
+ - get_input: shared_network_id
+ - get_input: shared_network_id1
+ virtual_machine_interface_properties:
+ virtual_machine_interface_properties_service_interface_type:
+ get_input: lb_st_interface_type_oam
+ port_tuple_refs:
+ - get_input: template_PortTuple_LB1
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ test_net1:
+ type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
+ properties:
+ shared: true
+ network_name:
+ get_input: jsa_net_name
+ server_cmaui:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ contrail_service_instance_ind: true
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ test_net:
+ type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
+ properties:
+ shared: true
+ network_name:
+ get_input: jsa_net_name
+ groups:
+ addOn:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/addOn.yml
+ description: cmaui server template for vMMSC
+ members:
+ - template_VMInt_OAM_lb_1
+ - template_VMInt_OAM_lb_2
+ - server_cmaui
+ main:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/main.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - test_net1
+ - test_net \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/multi/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/multi/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..1f762d0ccc
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/multi/inputfiles/MANIFEST.json
@@ -0,0 +1,17 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "main.yml",
+ "type": "HEAT",
+ "isBase": "true"
+ },
+ {
+ "file": "addOn.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/multi/inputfiles/addOn.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/multi/inputfiles/addOn.yml
new file mode 100644
index 0000000000..4894cfa44c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/multi/inputfiles/addOn.yml
@@ -0,0 +1,72 @@
+heat_template_version: 2013-05-23
+
+description: cmaui server template for vMMSC
+
+parameters:
+ p1:
+ type: string
+ description: UID of OAM network
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ security_group_name:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ shared_network_id:
+ type: string
+ description: Flavor for CMAUI server
+ shared_network_id1:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_oam_ips:
+ type: string
+ oam_sec_group_name:
+ type: string
+ lb_st_interface_type_oam:
+ type: string
+ template_PortTuple_LB1:
+ type: string
+
+resources:
+ template_VMInt_OAM_lb_1:
+ type: OS::ContrailV2::VirtualMachineInterface
+ properties:
+ virtual_machine_interface_properties:
+ {
+ virtual_machine_interface_properties_service_interface_type: { get_param: lb_st_interface_type_oam },
+ }
+ virtual_network_refs: [{ get_param: shared_network_id }]
+ port_tuple_refs: [{ get_param: template_PortTuple_LB1 }]
+ security_group_refs: [{ get_param: oam_sec_group_name}]
+
+ template_VMInt_OAM_lb_2:
+ type: OS::ContrailV2::VirtualMachineInterface
+ properties:
+ virtual_machine_interface_properties:
+ {
+ virtual_machine_interface_properties_service_interface_type: { get_param: lb_st_interface_type_oam },
+ }
+ virtual_network_refs: [{ get_param: shared_network_id }, { get_param: shared_network_id1 }]
+ port_tuple_refs: [{ get_param: template_PortTuple_LB1 }]
+ security_group_refs: [{ get_param: oam_sec_group_name}]
+
+ server_cmaui:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: template_VMInt_OAM_lb_1 }
+ - port: { get_resource: template_VMInt_OAM_lb_2 } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/multi/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/multi/inputfiles/main.yml
new file mode 100644
index 0000000000..3bd60fc93e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/multi/inputfiles/main.yml
@@ -0,0 +1,28 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ jsa_net_name:
+ type: string
+ description: network name of jsa log network
+
+resources:
+ test_net:
+ type: OS::Neutron::Net
+ properties:
+ name: {get_param: jsa_net_name}
+ shared: True
+
+ test_net1:
+ type: OS::Neutron::Net
+ properties:
+ name: {get_param: jsa_net_name}
+ shared: True
+
+outputs:
+ shared_network_id:
+ value: {get_resource: test_net}
+ shared_network_id1:
+ value: {get_resource: test_net1} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..7b58dd24e0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
@@ -0,0 +1,117 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: GlobalSubstitutionTypes
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.abstract.nodes.heat.nested:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ cmaui_names:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p1:
+ type: string
+ description: UID of OAM network
+ p2:
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ template_PortTuple_LB1:
+ type: string
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ oam_sec_group_name:
+ type: string
+ lb_st_interface_type_oam:
+ type: string
+ security_group_name:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ availability_zone_0:
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ type: string
+ requirements:
+ - link_template_VMInt_OAM_lb_1:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_template_VMInt_OAM_lb_2:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - local_storage_server_cmaui:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ capabilities:
+ host_server_cmaui:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_cmaui:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_cmaui:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_cmaui:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_server_cmaui:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..623325a944
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,81 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ jsa_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ node_templates:
+ test_net1:
+ type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
+ properties:
+ shared: true
+ network_name:
+ get_input: jsa_net_name
+ test_net:
+ type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
+ properties:
+ shared: true
+ network_name:
+ get_input: jsa_net_name
+ test_nested:
+ type: org.openecomp.resource.abstract.nodes.heat.nested
+ directives:
+ - substitutable
+ properties:
+ p1: test_net
+ service_template_filter:
+ substitute_service_template: nestedServiceTemplate.yaml
+ p2: test_net1
+ requirements:
+ - link_template_VMInt_OAM_lb_1:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net
+ relationship: tosca.relationships.network.LinksTo
+ - link_template_VMInt_OAM_lb_2:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net
+ relationship: tosca.relationships.network.LinksTo
+ groups:
+ main:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/main.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - test_net1
+ - test_net
+ - test_nested \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/expectedoutputfiles/nestedServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/expectedoutputfiles/nestedServiceTemplate.yaml
new file mode 100644
index 0000000000..4484578db6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/expectedoutputfiles/nestedServiceTemplate.yaml
@@ -0,0 +1,181 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cmaui:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p1:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ p2:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ template_PortTuple_LB1:
+ hidden: false
+ immutable: false
+ type: string
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ oam_sec_group_name:
+ hidden: false
+ immutable: false
+ type: string
+ lb_st_interface_type_oam:
+ hidden: false
+ immutable: false
+ type: string
+ security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ hidden: false
+ immutable: false
+ type: string
+ node_templates:
+ template_VMInt_OAM_lb_1:
+ type: org.openecomp.resource.cp.nodes.heat.contrailV2.VirtualMachineInterface
+ properties:
+ security_group_refs:
+ - get_input: oam_sec_group_name
+ virtual_network_refs:
+ - get_input: p1
+ virtual_machine_interface_properties:
+ virtual_machine_interface_properties_service_interface_type:
+ get_input: lb_st_interface_type_oam
+ port_tuple_refs:
+ - get_input: template_PortTuple_LB1
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ template_VMInt_OAM_lb_2:
+ type: org.openecomp.resource.cp.nodes.heat.contrailV2.VirtualMachineInterface
+ properties:
+ security_group_refs:
+ - get_input: oam_sec_group_name
+ virtual_network_refs:
+ - get_input: p1
+ - get_input: p2
+ virtual_machine_interface_properties:
+ virtual_machine_interface_properties_service_interface_type:
+ get_input: lb_st_interface_type_oam
+ port_tuple_refs:
+ - get_input: template_PortTuple_LB1
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ server_cmaui:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ contrail_service_instance_ind: true
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ groups:
+ nested:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested.yml
+ description: cmaui server template for vMMSC
+ members:
+ - template_VMInt_OAM_lb_1
+ - template_VMInt_OAM_lb_2
+ - server_cmaui
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested
+ capabilities:
+ host_server_cmaui:
+ - server_cmaui
+ - host
+ os_server_cmaui:
+ - server_cmaui
+ - os
+ endpoint_server_cmaui:
+ - server_cmaui
+ - endpoint
+ binding_server_cmaui:
+ - server_cmaui
+ - binding
+ scalable_server_cmaui:
+ - server_cmaui
+ - scalable
+ requirements:
+ link_template_VMInt_OAM_lb_1:
+ - template_VMInt_OAM_lb_1
+ - link
+ local_storage_server_cmaui:
+ - server_cmaui
+ - local_storage
+ link_template_VMInt_OAM_lb_2:
+ - template_VMInt_OAM_lb_2
+ - link \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..aca75b5055
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/inputfiles/MANIFEST.json
@@ -0,0 +1,17 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "main.yml",
+ "type": "HEAT",
+ "isBase": "true"
+ },
+ {
+ "file": "nested.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/inputfiles/main.yml
new file mode 100644
index 0000000000..e68f16ec29
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/inputfiles/main.yml
@@ -0,0 +1,27 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ jsa_net_name:
+ type: string
+ description: network name of jsa log network
+
+resources:
+ test_net:
+ type: OS::Neutron::Net
+ properties:
+ name: {get_param: jsa_net_name}
+ shared: True
+ test_net1:
+ type: OS::Neutron::Net
+ properties:
+ name: {get_param: jsa_net_name}
+ shared: True
+
+ test_nested:
+ type: nested.yml
+ properties:
+ p1: { get_resource: test_net}
+ p2: { get_resource: test_net1}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/inputfiles/nested.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/inputfiles/nested.yml
new file mode 100644
index 0000000000..c8d8857d08
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/inputfiles/nested.yml
@@ -0,0 +1,68 @@
+heat_template_version: 2013-05-23
+
+description: cmaui server template for vMMSC
+
+parameters:
+ p1:
+ type: string
+ description: UID of OAM network
+ p2:
+ type: string
+ description: UID of OAM network
+ security_group_name:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_oam_ips:
+ type: string
+ oam_sec_group_name:
+ type: string
+ lb_st_interface_type_oam:
+ type: string
+ template_PortTuple_LB1:
+ type: string
+resources:
+ template_VMInt_OAM_lb_1:
+ type: OS::ContrailV2::VirtualMachineInterface
+ properties:
+ virtual_machine_interface_properties:
+ {
+ virtual_machine_interface_properties_service_interface_type: { get_param: lb_st_interface_type_oam },
+ }
+ virtual_network_refs: [{ get_param: p1 }]
+ port_tuple_refs: [{ get_param: template_PortTuple_LB1 }]
+ security_group_refs: [{ get_param: oam_sec_group_name}]
+
+ template_VMInt_OAM_lb_2:
+ type: OS::ContrailV2::VirtualMachineInterface
+ properties:
+ virtual_machine_interface_properties:
+ {
+ virtual_machine_interface_properties_service_interface_type: { get_param: lb_st_interface_type_oam },
+ }
+ virtual_network_refs: [{ get_param: p1 },{ get_param: p2 }]
+ port_tuple_refs: [{ get_param: template_PortTuple_LB1 }]
+ security_group_refs: [{ get_param: oam_sec_group_name}]
+
+ server_cmaui:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: template_VMInt_OAM_lb_1 }
+ - port: { get_resource: template_VMInt_OAM_lb_2 } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..f0124b6d68
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
@@ -0,0 +1,254 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: GlobalSubstitutionTypes
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.abstract.nodes.heat.nested1:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ cmaui_names:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p2:
+ type: string
+ description: UID of OAM network
+ abc_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ template_PortTuple_LB1:
+ type: string
+ oam_sec_group_name:
+ type: string
+ lb_st_interface_type_oam:
+ type: string
+ abc_names:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ security_group_name:
+ description: not impotrtant
+ shared_network_id1:
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ availability_zone_0:
+ type: string
+ description: availabilityzone name
+ abc_oam_ips:
+ type: string
+ cmaui_oam_ips:
+ type: string
+ abc_image:
+ type: string
+ description: Image for CMAUI server
+ requirements:
+ - link_template_VMInt_OAM_lb_1:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_template_VMInt_OAM_lb_2:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_template_VMInt_OAM_lb_3:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - local_storage_server_cmaui:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - local_storage_server_abc:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - link_abc_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ capabilities:
+ scalable_server_abc:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_server_cmaui:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_cmaui:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_abc:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_cmaui:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_abc_port_1:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_cmaui:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_abc:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_server_cmaui:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_server_abc:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_abc:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ org.openecomp.resource.abstract.nodes.heat.nested2:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ cmaui_names:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p1:
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ security_group_name:
+ description: not impotrtant
+ availability_zone_0:
+ type: string
+ description: availabilityzone name
+ abc_oam_ips:
+ type: string
+ cmaui_oam_ips:
+ type: string
+ requirements:
+ - local_storage_server_cmaui:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - link_cmaui_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ capabilities:
+ host_server_cmaui:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_cmaui:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_cmaui:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_cmaui:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_server_cmaui:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_1:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..c5d68ff070
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,152 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ shared_network_id1:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ shared_network_id2:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ jsa_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ node_templates:
+ test_net2:
+ type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
+ properties:
+ shared: true
+ network_name:
+ get_input: jsa_net_name
+ test_nested2:
+ type: org.openecomp.resource.abstract.nodes.heat.nested2
+ directives:
+ - substitutable
+ properties:
+ p1:
+ get_input: shared_network_id1
+ service_template_filter:
+ substitute_service_template: nested2ServiceTemplate.yaml
+ requirements:
+ - link_cmaui_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net1
+ relationship: tosca.relationships.network.LinksTo
+ test_nested3:
+ type: org.openecomp.resource.abstract.nodes.heat.nested1
+ directives:
+ - substitutable
+ properties:
+ service_template_filter:
+ substitute_service_template: nested1ServiceTemplate.yaml
+ shared_network_id1:
+ get_input: shared_network_id1
+ p2:
+ get_input: shared_network_id2
+ requirements:
+ - link_abc_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net2
+ relationship: tosca.relationships.network.LinksTo
+ - link_template_VMInt_OAM_lb_1:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net1
+ relationship: tosca.relationships.network.LinksTo
+ - link_template_VMInt_OAM_lb_2:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net2
+ relationship: tosca.relationships.network.LinksTo
+ - link_template_VMInt_OAM_lb_3:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net2
+ relationship: tosca.relationships.network.LinksTo
+ test_net1:
+ type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
+ properties:
+ shared: true
+ network_name:
+ get_input: jsa_net_name
+ test_nested1:
+ type: org.openecomp.resource.abstract.nodes.heat.nested1
+ directives:
+ - substitutable
+ properties:
+ service_template_filter:
+ substitute_service_template: nested1ServiceTemplate.yaml
+ shared_network_id1:
+ get_input: shared_network_id1
+ p2:
+ get_input: shared_network_id2
+ requirements:
+ - link_abc_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net2
+ relationship: tosca.relationships.network.LinksTo
+ - link_template_VMInt_OAM_lb_1:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net1
+ relationship: tosca.relationships.network.LinksTo
+ - link_template_VMInt_OAM_lb_2:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net2
+ relationship: tosca.relationships.network.LinksTo
+ - link_template_VMInt_OAM_lb_3:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net2
+ relationship: tosca.relationships.network.LinksTo
+ groups:
+ addOn:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/addOn.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - test_nested2
+ - test_nested3
+ - test_nested1
+ main:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/main.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - test_net2
+ - test_net1 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/expectedoutputfiles/nested1ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/expectedoutputfiles/nested1ServiceTemplate.yaml
new file mode 100644
index 0000000000..a10ccc2e1a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/expectedoutputfiles/nested1ServiceTemplate.yaml
@@ -0,0 +1,279 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested1
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.abc:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.cmaui:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p2:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ abc_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ template_PortTuple_LB1:
+ hidden: false
+ immutable: false
+ type: string
+ oam_sec_group_name:
+ hidden: false
+ immutable: false
+ type: string
+ lb_st_interface_type_oam:
+ hidden: false
+ immutable: false
+ type: string
+ abc_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ security_group_name:
+ hidden: false
+ immutable: false
+ description: not impotrtant
+ shared_network_id1:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ abc_oam_ips:
+ hidden: false
+ immutable: false
+ type: string
+ cmaui_oam_ips:
+ hidden: false
+ immutable: false
+ type: string
+ abc_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ node_templates:
+ template_VMInt_OAM_lb_1:
+ type: org.openecomp.resource.cp.nodes.heat.contrailV2.VirtualMachineInterface
+ properties:
+ security_group_refs:
+ - get_input: oam_sec_group_name
+ virtual_network_refs:
+ - get_input: shared_network_id1
+ virtual_machine_interface_properties:
+ virtual_machine_interface_properties_service_interface_type:
+ get_input: lb_st_interface_type_oam
+ port_tuple_refs:
+ - get_input: template_PortTuple_LB1
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ template_VMInt_OAM_lb_2:
+ type: org.openecomp.resource.cp.nodes.heat.contrailV2.VirtualMachineInterface
+ properties:
+ security_group_refs:
+ - get_input: oam_sec_group_name
+ virtual_network_refs:
+ - get_input: p2
+ virtual_machine_interface_properties:
+ virtual_machine_interface_properties_service_interface_type:
+ get_input: lb_st_interface_type_oam
+ port_tuple_refs:
+ - get_input: template_PortTuple_LB1
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ template_VMInt_OAM_lb_3:
+ type: org.openecomp.resource.cp.nodes.heat.contrailV2.VirtualMachineInterface
+ properties:
+ security_group_refs:
+ - get_input: oam_sec_group_name
+ virtual_network_refs:
+ - get_input: p2
+ - get_input: shared_network_id1
+ virtual_machine_interface_properties:
+ virtual_machine_interface_properties_service_interface_type:
+ get_input: lb_st_interface_type_oam
+ port_tuple_refs:
+ - get_input: template_PortTuple_LB1
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ server_cmaui:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ contrail_service_instance_ind: true
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ server_abc:
+ type: org.openecomp.resource.vfc.nodes.heat.abc
+ properties:
+ flavor:
+ get_input: abc_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: abc_image
+ name:
+ get_input:
+ - abc_names
+ - 0
+ abc_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - abc_oam_ips
+ - 0
+ network:
+ get_input: p2
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_abc
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ nested1:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested1.yml
+ description: cmaui server template for vMMSC
+ members:
+ - template_VMInt_OAM_lb_1
+ - template_VMInt_OAM_lb_2
+ - template_VMInt_OAM_lb_3
+ - server_cmaui
+ - server_abc
+ - abc_port_1
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested1
+ capabilities:
+ scalable_server_abc:
+ - server_abc
+ - scalable
+ host_server_cmaui:
+ - server_cmaui
+ - host
+ os_server_cmaui:
+ - server_cmaui
+ - os
+ binding_server_abc:
+ - server_abc
+ - binding
+ endpoint_server_cmaui:
+ - server_cmaui
+ - endpoint
+ attachment_abc_port_1:
+ - abc_port_1
+ - attachment
+ binding_server_cmaui:
+ - server_cmaui
+ - binding
+ endpoint_server_abc:
+ - server_abc
+ - endpoint
+ scalable_server_cmaui:
+ - server_cmaui
+ - scalable
+ host_server_abc:
+ - server_abc
+ - host
+ os_server_abc:
+ - server_abc
+ - os
+ requirements:
+ link_template_VMInt_OAM_lb_1:
+ - template_VMInt_OAM_lb_1
+ - link
+ local_storage_server_cmaui:
+ - server_cmaui
+ - local_storage
+ link_template_VMInt_OAM_lb_3:
+ - template_VMInt_OAM_lb_3
+ - link
+ link_template_VMInt_OAM_lb_2:
+ - template_VMInt_OAM_lb_2
+ - link
+ link_abc_port_1:
+ - abc_port_1
+ - link
+ local_storage_server_abc:
+ - server_abc
+ - local_storage \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/expectedoutputfiles/nested2ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/expectedoutputfiles/nested2ServiceTemplate.yaml
new file mode 100644
index 0000000000..992e1c017c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/expectedoutputfiles/nested2ServiceTemplate.yaml
@@ -0,0 +1,146 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested2
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cmaui:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p1:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ security_group_name:
+ hidden: false
+ immutable: false
+ description: not impotrtant
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ abc_oam_ips:
+ hidden: false
+ immutable: false
+ type: string
+ cmaui_oam_ips:
+ hidden: false
+ immutable: false
+ type: string
+ node_templates:
+ server_cmaui:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ cmaui_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: p1
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ nested2:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested2.yml
+ description: cmaui server template for vMMSC
+ members:
+ - server_cmaui
+ - cmaui_port_1
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested2
+ capabilities:
+ host_server_cmaui:
+ - server_cmaui
+ - host
+ os_server_cmaui:
+ - server_cmaui
+ - os
+ endpoint_server_cmaui:
+ - server_cmaui
+ - endpoint
+ binding_server_cmaui:
+ - server_cmaui
+ - binding
+ scalable_server_cmaui:
+ - server_cmaui
+ - scalable
+ attachment_cmaui_port_1:
+ - cmaui_port_1
+ - attachment
+ requirements:
+ local_storage_server_cmaui:
+ - server_cmaui
+ - local_storage
+ link_cmaui_port_1:
+ - cmaui_port_1
+ - link \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..e593097c44
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles/MANIFEST.json
@@ -0,0 +1,27 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "main.yml",
+ "type": "HEAT",
+ "isBase": "true"
+ },
+ {
+ "file": "nested1.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ },
+ {
+ "file": "nested2.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ },
+ {
+ "file": "addOn.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles/addOn.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles/addOn.yml
new file mode 100644
index 0000000000..507bfcaa08
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles/addOn.yml
@@ -0,0 +1,32 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ shared_network_id1:
+ type: string
+ description: network name of jsa log network
+
+ shared_network_id2:
+ type: string
+ description: network name of jsa log network
+
+resources:
+
+ test_nested1:
+ type: nested1.yml
+ properties:
+ shared_network_id1: { get_param: shared_network_id1}
+ p2: { get_param: shared_network_id2}
+
+ test_nested2:
+ type: nested2.yml
+ properties:
+ p1: { get_param: shared_network_id1}
+
+ test_nested3:
+ type: nested1.yml
+ properties:
+ shared_network_id1: { get_param: shared_network_id1}
+ p2: { get_param: shared_network_id2} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles/main.yml
new file mode 100644
index 0000000000..9601c0f86d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles/main.yml
@@ -0,0 +1,29 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ jsa_net_name:
+ type: string
+ description: network name of jsa log network
+
+resources:
+ test_net1:
+ type: OS::Neutron::Net
+ properties:
+ name: {get_param: jsa_net_name}
+ shared: True
+
+ test_net2:
+ type: OS::Neutron::Net
+ properties:
+ name: {get_param: jsa_net_name}
+ shared: True
+
+outputs:
+ shared_network_id1:
+ value: {get_resource: test_net1}
+
+ shared_network_id2:
+ value: {get_resource: test_net2} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles/nested1.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles/nested1.yml
new file mode 100644
index 0000000000..ab65fc9718
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles/nested1.yml
@@ -0,0 +1,110 @@
+heat_template_version: 2013-05-23
+
+description: cmaui server template for vMMSC
+
+parameters:
+ shared_network_id1:
+ type: string
+ description: UID of OAM network
+ p2:
+ type: string
+ description: UID of OAM network
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ abc_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ security_group_name:
+ type: not_important
+ description: not impotrtant
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ abc_image:
+ type: string
+ description: Image for CMAUI server
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ abc_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_oam_ips:
+ type: string
+ abc_oam_ips:
+ type: string
+ oam_sec_group_name:
+ type: string
+ lb_st_interface_type_oam:
+ type: string
+ template_PortTuple_LB1:
+ type: string
+resources:
+
+ template_VMInt_OAM_lb_1:
+ type: OS::ContrailV2::VirtualMachineInterface
+ properties:
+ virtual_machine_interface_properties:
+ {
+ virtual_machine_interface_properties_service_interface_type: { get_param: lb_st_interface_type_oam },
+ }
+ virtual_network_refs: [{ get_param: shared_network_id1 }]
+ port_tuple_refs: [{ get_param: template_PortTuple_LB1 }]
+ security_group_refs: [{ get_param: oam_sec_group_name}]
+
+ template_VMInt_OAM_lb_2:
+ type: OS::ContrailV2::VirtualMachineInterface
+ properties:
+ virtual_machine_interface_properties:
+ {
+ virtual_machine_interface_properties_service_interface_type: { get_param: lb_st_interface_type_oam },
+ }
+ virtual_network_refs: [{ get_param: p2 }]
+ port_tuple_refs: [{ get_param: template_PortTuple_LB1 }]
+ security_group_refs: [{ get_param: oam_sec_group_name}]
+
+ template_VMInt_OAM_lb_3:
+ type: OS::ContrailV2::VirtualMachineInterface
+ properties:
+ virtual_machine_interface_properties:
+ {
+ virtual_machine_interface_properties_service_interface_type: { get_param: lb_st_interface_type_oam },
+ }
+ virtual_network_refs: [{ get_param: p2 },{ get_param: shared_network_id1 }]
+ port_tuple_refs: [{ get_param: template_PortTuple_LB1 }]
+ security_group_refs: [{ get_param: oam_sec_group_name}]
+
+ abc_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: p2 }
+ fixed_ips: [{"ip_address": {get_param: [abc_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_cmaui:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: template_VMInt_OAM_lb_1 }
+ - port: { get_resource: template_VMInt_OAM_lb_2 }
+ - port: { get_resource: template_VMInt_OAM_lb_3 }
+
+ server_abc:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [abc_names, 0]}
+ image: { get_param: abc_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: abc_flavor }
+ networks:
+ - port: { get_resource: abc_port_1 } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles/nested2.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles/nested2.yml
new file mode 100644
index 0000000000..b09d3aff8e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles/nested2.yml
@@ -0,0 +1,48 @@
+heat_template_version: 2013-05-23
+
+description: cmaui server template for vMMSC
+
+parameters:
+ p1:
+ type: string
+ description: UID of OAM network
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ security_group_name:
+ type: not_important
+ description: not impotrtant
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_oam_ips:
+ type: string
+ abc_oam_ips:
+ type: string
+
+resources:
+
+ cmaui_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: p1 }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_cmaui:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_1 } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/baseResourceTranslation/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/baseResourceTranslation/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..983a71f3b7
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/baseResourceTranslation/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,215 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cmaui:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ cmaui_cinder_volume_size:
+ label: CMAUI Cinder volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: the size of the CMAUI Cinder volume
+ timezone:
+ label: timezone
+ hidden: false
+ immutable: false
+ type: string
+ description: timezone
+ security_group_name:
+ label: security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of security group
+ oam_network_netmask:
+ label: oam network netmask
+ hidden: false
+ immutable: false
+ type: string
+ description: oam network gateway
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ vnf_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-CMAUI_id
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ oam_network_gateway:
+ label: oam network gateway
+ hidden: false
+ immutable: false
+ type: string
+ description: oam network gateway
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ label: CMAUI oam_net IP addresses
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI oam_net IP addresses
+ entry_schema:
+ type: string
+ external_dns:
+ label: dns server
+ hidden: false
+ immutable: false
+ type: string
+ description: dns server
+ oam_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ external_ntp:
+ label: ntp server
+ hidden: false
+ immutable: false
+ type: string
+ description: ntp server
+ CMAUI_volume_type:
+ label: CMAUI vm volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the target volume backend
+ node_templates:
+ server_dependOnString:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ requirements:
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: cmaui_volume
+ relationship: tosca.relationships.DependsOn
+ server_cmaui:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ user_data_format: RAW
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ requirements:
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: cmaui_volume
+ relationship: tosca.relationships.DependsOn
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: cmaui_port_0
+ relationship: tosca.relationships.DependsOn
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: cmaui_volume
+ relationship: cmaui_volume_attachment
+ cmaui_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: CMAUI_volume_type
+ size: '(get_input : cmaui_cinder_volume_size) * 1024'
+ cmaui_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ relationship_templates:
+ cmaui_volume_attachment:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id: cmaui_volume
+ instance_uuid: server_cmaui
+ groups:
+ hot_template:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/hot_template.yml
+ description: cmaui server template for vMMSC
+ members:
+ - server_dependOnString
+ - server_cmaui
+ - cmaui_volume
+ - cmaui_port_0 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/baseResourceTranslation/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/baseResourceTranslation/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..b2916ccf9c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/baseResourceTranslation/inputfiles/MANIFEST.json
@@ -0,0 +1,11 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot_template.yml",
+ "type": "HEAT"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/baseResourceTranslation/inputfiles/hot_template.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/baseResourceTranslation/inputfiles/hot_template.yml
new file mode 100644
index 0000000000..a3e343b033
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/baseResourceTranslation/inputfiles/hot_template.yml
@@ -0,0 +1,131 @@
+heat_template_version: 2013-05-23
+
+#################################
+#
+# Changes from MSO 01/26/2016
+# Updated per ECOMP feedback
+#
+#################################
+
+description: cmaui server template for vMMSC
+
+parameters:
+ vnf_id:
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-CMAUI_id
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_cinder_volume_size:
+ type: number
+ label: CMAUI Cinder volume size
+ description: the size of the CMAUI Cinder volume
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ oam_net_name:
+ type: string
+ description: UID of OAM network
+ oam_network_netmask:
+ type: string
+ label: oam network netmask
+ description: oam network gateway
+ oam_network_gateway:
+ type: string
+ label: oam network gateway
+ description: oam network gateway
+ external_dns:
+ type: string
+ label: dns server
+ description: dns server
+ external_ntp:
+ type: string
+ label: ntp server
+ description: ntp server
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ timezone:
+ type: string
+ label: timezone
+ description: timezone
+ cmaui_oam_ips:
+ type: comma_delimited_list
+ label: CMAUI oam_net IP addresses
+ description: CMAUI oam_net IP addresses
+ CMAUI_volume_type:
+ type: string
+ label: CMAUI vm volume type
+ description: the name of the target volume backend
+
+resources:
+
+ cmaui_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ cmaui_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: cmaui_cinder_volume_size}
+ volume_type: {get_param: CMAUI_volume_type}
+
+ cmaui_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: cmaui_volume}
+ instance_uuid: {get_resource: server_cmaui}
+
+ server_cmaui:
+ type: OS::Nova::Server
+ depends_on: [ cmaui_volume,cmaui_port_0]
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_0 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ cmaui.mgmt.ip=${cmaui.mgmt.ip}
+ cmaui.mgmt.netmask=${cmaui.mgmt.netmask}
+ cmaui.mgmt.gateway=${cmaui.mgmt.gateway}
+ cmaui.external.dns=${cmaui.external.dns}
+ cmaui.external.ntp=${cmaui.external.ntp}
+ cmaui.node=${cmaui.node}
+ cmaui.timezone=${cmaui.timezone}
+ params:
+ ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]}
+ ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${cmaui.external.dns}: {get_param: external_dns}
+ ${cmaui.external.ntp}: {get_param: external_ntp}
+ ${cmaui.node}: {get_param: [cmaui_names, 0]}
+ ${cmaui.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ server_dependOnString:
+ type: OS::Nova::Server
+ depends_on: cmaui_volume
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/cinder_volume_translation/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/cinder_volume_translation/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..fcd6db6103
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/cinder_volume_translation/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,131 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ volume_type:
+ label: volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: volume type Gold
+ FSB1_volume_name:
+ label: FSB1_volume
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_volume_1
+ FSB_1_image:
+ label: MME_FSB1
+ hidden: false
+ immutable: false
+ type: string
+ description: MME_FSB1_15B-CP04-r5a01
+ volume_size:
+ label: volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: my volume size 320GB
+ stam:
+ label: stam
+ hidden: false
+ immutable: false
+ type: float
+ description: stam
+ FSB_2_image:
+ label: MME_FSB2
+ hidden: false
+ immutable: false
+ type: string
+ description: MME_FSB2_15B-CP04-r5a01
+ FSB2_volume_name:
+ label: FSB2_volume
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB2_volume_1
+ node_templates:
+ FSB1_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ image:
+ get_input: FSB_1_image
+ volume_type:
+ get_input: volume_type
+ size: 3*1024
+ read_only:
+ get_input: stam
+ name:
+ get_input: FSB1_volume_name
+ FSB2_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ image:
+ get_input: FSB_2_image
+ volume_type:
+ get_input: volume_type
+ size: '(get_input : volume_size) * 1024'
+ read_only: true
+ name:
+ get_input: FSB2_volume_name
+ FSB3_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ image:
+ get_input: FSB_1_image
+ volume_type:
+ get_input: volume_type
+ size: 3*1024
+ read_only: true
+ name:
+ get_input: FSB1_volume_name
+ FSB4_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ image:
+ get_input: FSB_2_image
+ volume_type:
+ get_input: volume_type
+ size: '(get_input : volume_size) * 1024'
+ read_only: true
+ name:
+ get_input: FSB2_volume_name
+ groups:
+ hot_template:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/hot_template.yml
+ description: server template for vMME
+ members:
+ - FSB1_volume
+ - FSB2_volume
+ - FSB3_volume
+ - FSB4_volume \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/cinder_volume_translation/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/cinder_volume_translation/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..70cdc7d237
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/cinder_volume_translation/inputfiles/MANIFEST.json
@@ -0,0 +1,11 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volumes",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot_template.yml",
+ "type": "HEAT"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/cinder_volume_translation/inputfiles/hot_template.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/cinder_volume_translation/inputfiles/hot_template.yml
new file mode 100644
index 0000000000..c1c6ebdc30
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/cinder_volume_translation/inputfiles/hot_template.yml
@@ -0,0 +1,79 @@
+heat_template_version: 2013-05-23
+
+description: server template for vMME
+
+parameters:
+
+ volume_type:
+ type: string
+ label: volume type
+ description: volume type Gold
+
+ volume_size:
+ type: number
+ label: volume size
+ description: my volume size 320GB
+
+ FSB_1_image:
+ type: string
+ label: MME_FSB1
+ description: MME_FSB1_15B-CP04-r5a01
+
+ FSB_2_image:
+ type: string
+ label: MME_FSB2
+ description: MME_FSB2_15B-CP04-r5a01
+
+ FSB1_volume_name:
+ type: string
+ label: FSB1_volume
+ description: FSB1_volume_1
+
+ FSB2_volume_name:
+ type: string
+ label: FSB2_volume
+ description: FSB2_volume_1
+
+ stam:
+ type: number
+ label: stam
+ description: stam
+
+resources:
+
+ FSB1_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: 3
+ volume_type: {get_param: volume_type}
+ name: {get_param: FSB1_volume_name}
+ image: {get_param: FSB_1_image}
+ read_only: {get_param: stam}
+
+ FSB2_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: volume_size}
+ volume_type: {get_param: volume_type}
+ name: {get_param: FSB2_volume_name}
+ image: {get_param: FSB_2_image}
+ read_only: 1
+
+ FSB3_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: 3
+ volume_type: {get_param: volume_type}
+ name: {get_param: FSB1_volume_name}
+ image: {get_param: FSB_1_image}
+ read_only: t
+
+ FSB4_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: volume_size}
+ volume_type: {get_param: volume_type}
+ name: {get_param: FSB2_volume_name}
+ image: {get_param: FSB_2_image}
+ read_only: true
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..d5a177bddb
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
@@ -0,0 +1,83 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: GlobalSubstitutionTypes
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.compute_service_template_1:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.contrail.Compute
+ org.openecomp.resource.abstract.nodes.heat.service_template_2:
+ derived_from: org.openecomp.resource.abstract.nodes.contrail.AbstractSubstitute
+ requirements:
+ - link_port_0:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ org.openecomp.resource.abstract.nodes.heat.service_template_1:
+ derived_from: org.openecomp.resource.abstract.nodes.contrail.AbstractSubstitute
+ requirements:
+ - link_port_0:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_port_2:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_port_3:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ org.openecomp.resource.vfc.nodes.heat.st:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.contrail.Compute \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..a96c947d9d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,401 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ service_policy_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Policy Name
+ st_static_routes_list:
+ hidden: false
+ immutable: false
+ type: string
+ description: List of static routes enabled-disabled
+ st_type:
+ hidden: false
+ immutable: false
+ type: string
+ description: service type
+ st_service_interface_type_list:
+ hidden: false
+ immutable: false
+ type: string
+ description: List of interface types
+ st_mode:
+ hidden: false
+ immutable: false
+ type: string
+ description: service mode
+ Cricket_OCS_protected_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of Cricket OCS network
+ oam_mgmt_net_0_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of OAM network
+ start_dst_ports:
+ hidden: false
+ immutable: false
+ type: float
+ description: Start of dst port
+ st_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor
+ availability_zone_1:
+ hidden: false
+ immutable: false
+ type: string
+ description: availability zone
+ service_instance_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Service instance name
+ st_scaling:
+ hidden: false
+ immutable: false
+ type: string
+ description: Indicates whether service scaling is enabled
+ max_num_fw_instances:
+ hidden: false
+ immutable: false
+ type: float
+ description: maximum number of firewall instances for scaling
+ start_src_ports:
+ hidden: false
+ immutable: false
+ type: float
+ description: Start of src port
+ service_policy_direction:
+ hidden: false
+ immutable: false
+ type: string
+ description: Direction of Policy
+ st_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of service template
+ count:
+ hidden: false
+ immutable: false
+ HSL_direct_net_gateway:
+ hidden: false
+ immutable: false
+ type: string
+ description: HSL (Logging) network gateway address
+ st_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of the image
+ st_shared_ip_list:
+ hidden: false
+ immutable: false
+ type: string
+ description: List of shared ip enabled-disabled
+ prefix_0:
+ hidden: false
+ immutable: false
+ type: string
+ Cricket_OCS_direct_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of Cricket OCS network
+ oam_mgmt_net_1_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of OAM network
+ prefix_1:
+ hidden: false
+ immutable: false
+ type: string
+ end_src_ports:
+ hidden: false
+ immutable: false
+ type: float
+ description: End of src port
+ prefix_2:
+ hidden: false
+ immutable: false
+ type: string
+ end_dst_ports:
+ hidden: false
+ immutable: false
+ type: float
+ description: End of dst port
+ st_image_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of the image
+ HSL_direct_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of HSL (Logging) network
+ HSL_direct_net_cidr:
+ hidden: false
+ immutable: false
+ type: string
+ description: HSL (Logging) network address (CIDR notation)
+ node_templates:
+ service_instance_1:
+ type: org.openecomp.resource.abstract.nodes.heat.service_template_1
+ directives:
+ - substitutable
+ properties:
+ flavor:
+ get_input: st_flavor
+ availability_zone:
+ get_input: availability_zone_1
+ image_name:
+ get_input: st_image
+ service_template_filter:
+ substitute_service_template: service_instance_1ServiceTemplate.yaml
+ count:
+ get_input: max_num_fw_instances
+ scaling_enabled: false
+ mandatory: false
+ service_type:
+ get_input: st_type
+ static_routes_list:
+ - token:
+ - get_input: st_static_routes_list
+ - ','
+ - 0
+ - token:
+ - get_input: st_static_routes_list
+ - ','
+ - 1
+ - token:
+ - get_input: st_static_routes_list
+ - ','
+ - 2
+ - token:
+ - get_input: st_static_routes_list
+ - ','
+ - 3
+ service_template_name:
+ get_input: st_name
+ service_interface_type_list:
+ - token:
+ - management,left,right,other
+ - ','
+ - 0
+ - token:
+ - management,left,right,other
+ - ','
+ - 1
+ - token:
+ - management,left,right,other
+ - ','
+ - 2
+ - token:
+ - management,left,right,other
+ - ','
+ - 3
+ interface_list:
+ - virtual_network:
+ get_input: oam_mgmt_net_0_id
+ - virtual_network:
+ get_input: Cricket_OCS_direct_net_id
+ - virtual_network: hsl_direct_net
+ - static_routes:
+ - prefix:
+ get_input: prefix_0
+ - prefix:
+ get_input: prefix_1
+ - prefix:
+ get_input: prefix_2
+ virtual_network:
+ get_input: oam_mgmt_net_1_id
+ service_instance_name:
+ get_input: service_instance_name
+ service_mode:
+ get_input: st_mode
+ shared_ip_list:
+ - token:
+ - get_input: st_shared_ip_list
+ - ','
+ - 0
+ - token:
+ - get_input: st_shared_ip_list
+ - ','
+ - 1
+ - token:
+ - get_input: st_shared_ip_list
+ - ','
+ - 2
+ - token:
+ - get_input: st_shared_ip_list
+ - ','
+ - 3
+ requirements:
+ - link_port_2:
+ capability: tosca.capabilities.network.Linkable
+ node: hsl_direct_net
+ relationship: tosca.relationships.network.LinksTo
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: hsl_direct_net
+ relationship: tosca.relationships.DependsOn
+ service_instance_2:
+ type: org.openecomp.resource.abstract.nodes.heat.service_template_2
+ directives:
+ - substitutable
+ properties:
+ flavor:
+ get_input: st_flavor
+ availability_zone:
+ get_input: availability_zone_1
+ image_name:
+ get_input: st_image_name
+ service_template_filter:
+ substitute_service_template: service_instance_2ServiceTemplate.yaml
+ count: 9
+ mandatory: true
+ service_type:
+ get_input: st_type
+ static_routes_list:
+ - token:
+ - get_input: st_static_routes_list
+ - ','
+ - 0
+ - token:
+ - get_input: st_static_routes_list
+ - ','
+ - 1
+ service_template_name:
+ get_input: st_name
+ service_interface_type_list:
+ - token:
+ - get_input: st_service_interface_type_list
+ - ','
+ - 0
+ - token:
+ - get_input: st_service_interface_type_list
+ - ','
+ - 1
+ interface_list:
+ - virtual_network:
+ get_input: oam_mgmt_net_0_id
+ - virtual_network:
+ get_input: Cricket_OCS_direct_net_id
+ service_instance_name:
+ get_input: service_instance_name
+ service_mode:
+ get_input: st_mode
+ shared_ip_list:
+ - token:
+ - get_input: st_shared_ip_list
+ - ','
+ - 0
+ - token:
+ - get_input: st_shared_ip_list
+ - ','
+ - 1
+ requirements:
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: hsl_direct_net
+ relationship: tosca.relationships.DependsOn
+ hsl_direct_net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ network_name:
+ get_input: HSL_direct_net_id
+ subnets:
+ hsl_ip_subnet:
+ cidr:
+ get_input: HSL_direct_net_cidr
+ gateway_ip:
+ get_input: HSL_direct_net_gateway
+ service_policy:
+ type: org.openecomp.resource.vfc.rules.nodes.heat.network.contrail.NetworkRules
+ properties:
+ entries:
+ policy_rule:
+ - src_ports:
+ - start_port:
+ get_input: start_src_ports
+ end_port:
+ get_input: end_src_ports
+ protocol: any
+ metadata:
+ get_attribute:
+ - service_instance_2
+ - service_instance_name
+ action_list:
+ apply_service:
+ - service_instance_1
+ dst_addresses:
+ - virtual_network:
+ get_input: Cricket_OCS_direct_net_id
+ dst_ports:
+ - start_port:
+ get_input: start_dst_ports
+ end_port:
+ get_input: end_dst_ports
+ src_addresses:
+ - virtual_network:
+ get_input: Cricket_OCS_protected_net_id
+ direction:
+ get_input: service_policy_direction
+ name:
+ get_input: service_policy_name
+ requirements:
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: service_instance_1
+ relationship: tosca.relationships.DependsOn
+ groups:
+ OCS-fw:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/OCS-fw.yml
+ description: |
+ Based on the following reference for the HOT-DMZ-FW template: Version 3.5 8-10-2015 (Authors: Art Mishurov,am254u & Johhny Chen, jc3066) - HOT-DMZ-FW template that creates two DMZ networks (direct and protected) with a scaled out firewall service between the two.
+ members:
+ - service_instance_1
+ - service_instance_2
+ - hsl_direct_net
+ - service_policy \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/expectedoutputfiles/service_instance_1ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/expectedoutputfiles/service_instance_1ServiceTemplate.yaml
new file mode 100644
index 0000000000..d84d6c6889
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/expectedoutputfiles/service_instance_1ServiceTemplate.yaml
@@ -0,0 +1,407 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: service_instance_1
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ availability_zone:
+ hidden: false
+ immutable: false
+ type: string
+ description: Availability zone to create servers in
+ required: false
+ status: SUPPORTED
+ static_routes_list:
+ hidden: false
+ immutable: false
+ type: list
+ description: Static routes enabled
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: boolean
+ availability_zone_enable:
+ hidden: false
+ immutable: false
+ type: boolean
+ description: Indicates availability zone is enabled
+ required: false
+ default: false
+ status: SUPPORTED
+ service_template_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Service template name
+ required: false
+ status: SUPPORTED
+ ordered_interfaces:
+ hidden: false
+ immutable: false
+ type: boolean
+ description: Indicates if service interface are ordered
+ required: false
+ default: false
+ status: SUPPORTED
+ flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: flavor
+ required: false
+ status: SUPPORTED
+ image_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image name
+ required: true
+ status: SUPPORTED
+ service_type:
+ hidden: false
+ immutable: false
+ type: string
+ description: Service type
+ required: true
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - firewall
+ - analyzer
+ - source-nat
+ - loadbalancer
+ service_interface_type_list:
+ hidden: false
+ immutable: false
+ type: list
+ description: List of interface types
+ required: true
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ constraints:
+ - valid_values:
+ - management
+ - left
+ - right
+ - other
+ service_instance_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Service instance name
+ required: true
+ status: SUPPORTED
+ interface_list:
+ hidden: false
+ immutable: false
+ type: list
+ description: List of interfaces
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.contrail.InterfaceData
+ service_mode:
+ hidden: false
+ immutable: false
+ type: string
+ description: Service mode
+ required: true
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - transparent
+ - in-network
+ - in-network-nat
+ shared_ip_list:
+ hidden: false
+ immutable: false
+ type: list
+ description: Shared ips enabled
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: boolean
+ node_templates:
+ service_instance_1:
+ type: org.openecomp.resource.vfc.nodes.heat.compute_service_template_1
+ properties:
+ flavor:
+ get_input: flavor
+ image_name:
+ get_input: image_name
+ availability_zone:
+ get_input: availability_zone
+ service_type:
+ get_input: service_type
+ availability_zone_enable:
+ get_input: availability_zone_enable
+ service_template_name:
+ get_input: service_template_name
+ service_instance_name:
+ get_input: service_instance_name
+ service_mode:
+ get_input: service_mode
+ port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port
+ properties:
+ static_routes:
+ get_input:
+ - interface_list
+ - 0
+ - static_routes
+ virtual_network:
+ get_input:
+ - interface_list
+ - 0
+ - virtual_network
+ static_route:
+ get_input:
+ - static_routes_list
+ - 0
+ allowed_address_pairs:
+ get_input:
+ - interface_list
+ - 0
+ - allowed_address_pairs
+ shared_ip:
+ get_input:
+ - shared_ip_list
+ - 0
+ ip_address:
+ get_input:
+ - interface_list
+ - 0
+ - ip_address
+ interface_type:
+ get_input:
+ - service_interface_type_list
+ - 0
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: service_instance_1
+ relationship: tosca.relationships.network.BindsTo
+ port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port
+ properties:
+ static_routes:
+ get_input:
+ - interface_list
+ - 1
+ - static_routes
+ virtual_network:
+ get_input:
+ - interface_list
+ - 1
+ - virtual_network
+ static_route:
+ get_input:
+ - static_routes_list
+ - 1
+ allowed_address_pairs:
+ get_input:
+ - interface_list
+ - 1
+ - allowed_address_pairs
+ shared_ip:
+ get_input:
+ - shared_ip_list
+ - 1
+ ip_address:
+ get_input:
+ - interface_list
+ - 1
+ - ip_address
+ interface_type:
+ get_input:
+ - service_interface_type_list
+ - 1
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: service_instance_1
+ relationship: tosca.relationships.network.BindsTo
+ port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port
+ properties:
+ static_routes:
+ get_input:
+ - interface_list
+ - 2
+ - static_routes
+ virtual_network:
+ get_input:
+ - interface_list
+ - 2
+ - virtual_network
+ static_route:
+ get_input:
+ - static_routes_list
+ - 2
+ allowed_address_pairs:
+ get_input:
+ - interface_list
+ - 2
+ - allowed_address_pairs
+ shared_ip:
+ get_input:
+ - shared_ip_list
+ - 2
+ ip_address:
+ get_input:
+ - interface_list
+ - 2
+ - ip_address
+ interface_type:
+ get_input:
+ - service_interface_type_list
+ - 2
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: service_instance_1
+ relationship: tosca.relationships.network.BindsTo
+ port_3:
+ type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port
+ properties:
+ static_routes:
+ get_input:
+ - interface_list
+ - 3
+ - static_routes
+ virtual_network:
+ get_input:
+ - interface_list
+ - 3
+ - virtual_network
+ static_route:
+ get_input:
+ - static_routes_list
+ - 3
+ allowed_address_pairs:
+ get_input:
+ - interface_list
+ - 3
+ - allowed_address_pairs
+ shared_ip:
+ get_input:
+ - shared_ip_list
+ - 3
+ ip_address:
+ get_input:
+ - interface_list
+ - 3
+ - ip_address
+ interface_type:
+ get_input:
+ - service_interface_type_list
+ - 3
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: service_instance_1
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ service_instance_1:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/OCS-fw.yml
+ members:
+ - service_instance_1
+ - port_0
+ - port_1
+ - port_2
+ - port_3
+ outputs:
+ tenant_id:
+ description: Tenant id of the Service Instance
+ value:
+ get_attribute:
+ - service_instance_1
+ - tenant_id
+ fq_name:
+ description: The FQ name of the service instance
+ value:
+ get_attribute:
+ - service_instance_1
+ - fq_name
+ service_template_name:
+ description: Service Template of the Service Instance
+ value:
+ get_attribute:
+ - service_instance_1
+ - service_template_name
+ show:
+ description: All attributes
+ value:
+ get_attribute:
+ - service_instance_1
+ - show
+ active_vms:
+ description: Number of service VMs active for this Service Instance
+ value:
+ get_attribute:
+ - service_instance_1
+ - active_vms
+ service_instance_name:
+ description: The name of the service instance
+ value:
+ get_attribute:
+ - service_instance_1
+ - service_instance_name
+ virtual_machines:
+ description: Service VMs for the Service Instance
+ value:
+ get_attribute:
+ - service_instance_1
+ - virtual_machines
+ status:
+ description: Status of the service instance
+ value:
+ get_attribute:
+ - service_instance_1
+ - status
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.service_template_1
+ requirements:
+ link_port_0:
+ - port_0
+ - link
+ link_port_1:
+ - port_1
+ - link
+ link_port_2:
+ - port_2
+ - link
+ link_port_3:
+ - port_3
+ - link \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/expectedoutputfiles/service_instance_2ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/expectedoutputfiles/service_instance_2ServiceTemplate.yaml
new file mode 100644
index 0000000000..3a2de0696f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/expectedoutputfiles/service_instance_2ServiceTemplate.yaml
@@ -0,0 +1,319 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: service_instance_2
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ availability_zone:
+ hidden: false
+ immutable: false
+ type: string
+ description: Availability zone to create servers in
+ required: false
+ status: SUPPORTED
+ static_routes_list:
+ hidden: false
+ immutable: false
+ type: list
+ description: Static routes enabled
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: boolean
+ availability_zone_enable:
+ hidden: false
+ immutable: false
+ type: boolean
+ description: Indicates availability zone is enabled
+ required: false
+ default: false
+ status: SUPPORTED
+ service_template_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Service template name
+ required: false
+ status: SUPPORTED
+ ordered_interfaces:
+ hidden: false
+ immutable: false
+ type: boolean
+ description: Indicates if service interface are ordered
+ required: false
+ default: false
+ status: SUPPORTED
+ flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: flavor
+ required: false
+ status: SUPPORTED
+ image_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image name
+ required: true
+ status: SUPPORTED
+ service_type:
+ hidden: false
+ immutable: false
+ type: string
+ description: Service type
+ required: true
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - firewall
+ - analyzer
+ - source-nat
+ - loadbalancer
+ service_interface_type_list:
+ hidden: false
+ immutable: false
+ type: list
+ description: List of interface types
+ required: true
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ constraints:
+ - valid_values:
+ - management
+ - left
+ - right
+ - other
+ service_instance_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Service instance name
+ required: true
+ status: SUPPORTED
+ interface_list:
+ hidden: false
+ immutable: false
+ type: list
+ description: List of interfaces
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.contrail.InterfaceData
+ service_mode:
+ hidden: false
+ immutable: false
+ type: string
+ description: Service mode
+ required: true
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - transparent
+ - in-network
+ - in-network-nat
+ shared_ip_list:
+ hidden: false
+ immutable: false
+ type: list
+ description: Shared ips enabled
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: boolean
+ node_templates:
+ service_instance_2:
+ type: org.openecomp.resource.vfc.nodes.heat.st
+ properties:
+ flavor:
+ get_input: flavor
+ image_name:
+ get_input: image_name
+ availability_zone:
+ get_input: availability_zone
+ service_type:
+ get_input: service_type
+ availability_zone_enable:
+ get_input: availability_zone_enable
+ service_template_name:
+ get_input: service_template_name
+ service_instance_name:
+ get_input: service_instance_name
+ service_mode:
+ get_input: service_mode
+ port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port
+ properties:
+ static_routes:
+ get_input:
+ - interface_list
+ - 0
+ - static_routes
+ virtual_network:
+ get_input:
+ - interface_list
+ - 0
+ - virtual_network
+ static_route:
+ get_input:
+ - static_routes_list
+ - 0
+ allowed_address_pairs:
+ get_input:
+ - interface_list
+ - 0
+ - allowed_address_pairs
+ shared_ip:
+ get_input:
+ - shared_ip_list
+ - 0
+ ip_address:
+ get_input:
+ - interface_list
+ - 0
+ - ip_address
+ interface_type:
+ get_input:
+ - service_interface_type_list
+ - 0
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: service_instance_2
+ relationship: tosca.relationships.network.BindsTo
+ port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port
+ properties:
+ static_routes:
+ get_input:
+ - interface_list
+ - 1
+ - static_routes
+ virtual_network:
+ get_input:
+ - interface_list
+ - 1
+ - virtual_network
+ static_route:
+ get_input:
+ - static_routes_list
+ - 1
+ allowed_address_pairs:
+ get_input:
+ - interface_list
+ - 1
+ - allowed_address_pairs
+ shared_ip:
+ get_input:
+ - shared_ip_list
+ - 1
+ ip_address:
+ get_input:
+ - interface_list
+ - 1
+ - ip_address
+ interface_type:
+ get_input:
+ - service_interface_type_list
+ - 1
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: service_instance_2
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ service_instance_2:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/OCS-fw.yml
+ members:
+ - service_instance_2
+ - port_0
+ - port_1
+ outputs:
+ tenant_id:
+ description: Tenant id of the Service Instance
+ value:
+ get_attribute:
+ - service_instance_2
+ - tenant_id
+ fq_name:
+ description: The FQ name of the service instance
+ value:
+ get_attribute:
+ - service_instance_2
+ - fq_name
+ service_template_name:
+ description: Service Template of the Service Instance
+ value:
+ get_attribute:
+ - service_instance_2
+ - service_template_name
+ show:
+ description: All attributes
+ value:
+ get_attribute:
+ - service_instance_2
+ - show
+ active_vms:
+ description: Number of service VMs active for this Service Instance
+ value:
+ get_attribute:
+ - service_instance_2
+ - active_vms
+ service_instance_name:
+ description: The name of the service instance
+ value:
+ get_attribute:
+ - service_instance_2
+ - service_instance_name
+ virtual_machines:
+ description: Service VMs for the Service Instance
+ value:
+ get_attribute:
+ - service_instance_2
+ - virtual_machines
+ status:
+ description: Status of the service instance
+ value:
+ get_attribute:
+ - service_instance_2
+ - status
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.service_template_2
+ requirements:
+ link_port_0:
+ - port_0
+ - link
+ link_port_1:
+ - port_1
+ - link \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..a26430ba72
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/inputfiles/MANIFEST.json
@@ -0,0 +1,12 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "OCS-fw.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/inputfiles/OCS-fw.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/inputfiles/OCS-fw.yml
new file mode 100644
index 0000000000..725ba49459
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/inputfiles/OCS-fw.yml
@@ -0,0 +1,213 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Based on the following reference for the HOT-DMZ-FW template:
+ Version 3.5 8-10-2015 (Authors: Art Mishurov,am254u & Johhny Chen, jc3066) - HOT-DMZ-FW template that creates two DMZ networks (direct and protected) with a scaled out firewall service between the two.
+
+parameters:
+ HSL_direct_net_id:
+ type: string
+ description: Name of HSL (Logging) network
+ prefix_0:
+ type: string
+ prefix_1:
+ type: string
+ prefix_2:
+ type: string
+ HSL_direct_net_cidr:
+ type: string
+ description: HSL (Logging) network address (CIDR notation)
+ HSL_direct_net_gateway:
+ type: string
+ description: HSL (Logging) network gateway address
+ oam_mgmt_net_0_id:
+ type: string
+ description: Name of OAM network
+ oam_mgmt_net_1_id:
+ type: string
+ description: Name of OAM network
+ Cricket_OCS_direct_net_id:
+ type: string
+ description: Name of Cricket OCS network
+ Cricket_OCS_protected_net_id:
+ type: string
+ description: Name of Cricket OCS network
+ service_instance_name:
+ type: string
+ description: Service instance name
+ service_policy_name:
+ type: string
+ description: Policy Name
+ service_policy_direction:
+ type: string
+ description: Direction of Policy
+ start_src_ports:
+ type: number
+ description: Start of src port
+ end_src_ports:
+ type: number
+ description: End of src port
+ start_dst_ports:
+ type: number
+ description: Start of dst port
+ end_dst_ports:
+ type: number
+ description: End of dst port
+ st_name:
+ type: string
+ description: Name of service template
+ st_mode:
+ type: string
+ description: service mode
+ st_type:
+ type: string
+ description: service type
+ st_image:
+ type: string
+ description: Name of the image
+ st_image_name:
+ type: string
+ description: Name of the image
+ st_flavor:
+ type: string
+ description: Flavor
+ st_service_interface_type_list:
+ type: string
+ description: List of interface types
+ st_shared_ip_list:
+ type: string
+ description: List of shared ip enabled-disabled
+ st_static_routes_list:
+ type: string
+ description: List of static routes enabled-disabled
+ st_scaling:
+ type: string
+ description: Indicates whether service scaling is enabled
+ max_num_fw_instances:
+ type: number
+ description: maximum number of firewall instances for scaling
+ availability_zone_1:
+ type: string
+ description: availability zone
+ count:
+ type: integer
+
+resources:
+
+ hsl_direct_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: HSL_direct_net_id }
+# external: True
+
+ hsl_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: hsl_direct_net }
+ cidr: { get_param: HSL_direct_net_cidr }
+ gateway_ip: { get_param: HSL_direct_net_gateway }
+
+ service_template_1:
+ type: OS::Contrail::ServiceTemplate
+ properties:
+ name: { get_param: st_name }
+ service_mode: { get_param: st_mode }
+ service_type: { get_param: st_type }
+ image_name: { get_param: st_image }
+ flavor: { get_param: st_flavor }
+ service_interface_type_list: { "Fn::Split" : [ ",", "management,left,right,other" ] }
+ shared_ip_list: { "Fn::Split" : [ ",", Ref: st_shared_ip_list ] }
+ static_routes_list: { "Fn::Split" : [ ",", Ref: st_static_routes_list ] }
+ service_scaling: n
+
+ service_instance_1:
+ type: OS::Contrail::ServiceInstance
+ depends_on: [ hsl_ip_subnet]
+ properties:
+ name: { get_param: service_instance_name }
+ availability_zone: { get_param: availability_zone_1 }
+ service_template: { get_resource: service_template_1 }
+ scale_out:
+ max_instances: {get_param: max_num_fw_instances}
+ interface_list: [
+ {
+ virtual_network: { get_param: oam_mgmt_net_0_id }
+ },
+ {
+ virtual_network: { get_param: Cricket_OCS_direct_net_id }
+ },
+ {
+ virtual_network: { get_resource: hsl_direct_net }
+ },
+ {
+ virtual_network: {get_param: oam_mgmt_net_1_id},
+ static_routes: [
+ { "prefix": {get_param: prefix_0} },
+ { "prefix": {get_param: prefix_1} },
+ { "prefix": {get_param: prefix_2} },
+ ],
+ }
+ ]
+
+ service_template_2:
+ type: OS::Contrail::ServiceTemplate
+ properties:
+ name: { get_param: st_name }
+ service_mode: { get_param: st_mode }
+ service_type: { get_param: st_type }
+ image_name: { get_param: st_image_name }
+ flavor: { get_param: st_flavor }
+ service_interface_type_list: { "Fn::Split" : [ ",", Ref: st_service_interface_type_list ] }
+ shared_ip_list: { "Fn::Split" : [ ",", Ref: st_shared_ip_list ] }
+ static_routes_list: { "Fn::Split" : [ ",", Ref: st_static_routes_list ] }
+
+ service_instance_2:
+ type: OS::Contrail::ServiceInstance
+ depends_on: [ hsl_ip_subnet]
+ properties:
+ name: { get_param: service_instance_name }
+ availability_zone: { get_param: availability_zone_1 }
+ service_template: { get_resource: service_template_2 }
+ scale_out:
+ max_instances: 9
+ interface_list: [
+ {
+ virtual_network: { get_param: oam_mgmt_net_0_id }
+ },
+ {
+ virtual_network: { get_param: Cricket_OCS_direct_net_id }
+ }
+ ]
+
+ service_policy:
+ type: OS::Contrail::NetworkPolicy
+ depends_on: [ service_instance_1 ]
+ properties:
+ name: { get_param: service_policy_name }
+ entries:
+ policy_rule: [
+ {
+ "direction": { get_param: service_policy_direction },
+ "protocol": "any",
+ "src_ports": [{"start_port": {get_param: start_src_ports}, "end_port": {get_param: end_src_ports}}],
+ "dst_ports": [{"start_port": {get_param: start_dst_ports}, "end_port": {get_param: end_dst_ports}}],
+ "dst_addresses": [{ "virtual_network": { get_param: Cricket_OCS_direct_net_id }}],
+ "action_list": { "apply_service": [{ get_resource: service_instance_1 }]},
+ "src_addresses": [{ "virtual_network": { get_param: Cricket_OCS_protected_net_id }}],
+ "metadata": {get_attr: [service_instance_2, name]}
+ },
+ ]
+
+ service_policy_attach_direct_net:
+ type: OS::Contrail::AttachPolicy
+ depends_on: [ service_policy ]
+ properties:
+ network: { get_param: Cricket_OCS_direct_net_id }
+ policy: { get_attr: [service_policy, fq_name] }
+
+ service_policy_attach_protected_net:
+ type: OS::Contrail::AttachPolicy
+ depends_on: [ service_policy ]
+ properties:
+ network: { get_param: Cricket_OCS_protected_net_id }
+ policy: { get_attr: [service_policy, fq_name] } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..b00d3d8bc0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
@@ -0,0 +1,64 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: GlobalSubstitutionTypes
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.abstract.nodes.heat.service_template:
+ derived_from: org.openecomp.resource.abstract.nodes.contrail.AbstractSubstitute
+ requirements:
+ - link_port_0:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_port_2:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_port_3:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ org.openecomp.resource.vfc.nodes.heat.compute_service_template:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.contrail.Compute \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..016e4d3f70
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,300 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ protected_net:
+ hidden: false
+ immutable: false
+ type: string
+ service_policy_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Policy Name
+ default: MNS-25180-L-02Shared_policy_direct_fw_protected_oam_1
+ oam_direct_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of private network to be created
+ st_static_routes_list:
+ hidden: false
+ immutable: false
+ type: string
+ description: List of static routes enabled-disabled
+ default: True,True,True,True
+ st_type:
+ hidden: false
+ immutable: false
+ type: string
+ description: service type
+ default: firewall
+ st_service_interface_type_list:
+ hidden: false
+ immutable: false
+ type: string
+ description: List of interface types
+ default: management,left,right,other
+ oam_protected_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of private network to be created
+ st_mode:
+ hidden: false
+ immutable: false
+ type: string
+ description: service mode
+ default: in-network-nat
+ static_prefix_3_1:
+ hidden: false
+ immutable: false
+ type: string
+ description: prefix for static route
+ default: 107.239.80.0/21
+ oam_hsl_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of private network to be created
+ start_dst_ports:
+ hidden: false
+ immutable: false
+ type: float
+ description: Start of dst port
+ default: -1
+ st_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor
+ default: lc.medium
+ st_scaling:
+ hidden: false
+ immutable: false
+ type: string
+ description: Indicates whether service scaling is enabled
+ default: 'True'
+ service_instance_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: service instance name
+ max_num_fw_instances:
+ hidden: false
+ immutable: false
+ type: float
+ description: maximum number of firewall instances for scaling
+ default: 8
+ start_src_ports:
+ hidden: false
+ immutable: false
+ type: float
+ description: Start of src port
+ default: -1
+ availability_zone:
+ hidden: false
+ immutable: false
+ type: string
+ description: availability zone in form of Zone:Host
+ service_policy_direction:
+ hidden: false
+ immutable: false
+ type: string
+ description: Direction of Policy
+ default: <>
+ st_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: service template name or ID
+ default: MNS-25180-L-02Shared_oam_fw_template_1
+ st_availability_zone_enable_flag:
+ hidden: false
+ immutable: false
+ type: string
+ description: service template availablity_zone feature enable flag
+ default: 'True'
+ st_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of the image
+ default: NIMBUS_SRX_151X49-D303
+ st_shared_ip_list:
+ hidden: false
+ immutable: false
+ type: string
+ description: List of shared ip enabled-disabled
+ default: False,True,False,False
+ oam_mgmt_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of private network to be created
+ end_src_ports:
+ hidden: false
+ immutable: false
+ type: float
+ description: End of src port
+ default: -1
+ end_dst_ports:
+ hidden: false
+ immutable: false
+ type: float
+ description: End of dst port
+ default: -1
+ node_templates:
+ service_instance:
+ type: org.openecomp.resource.abstract.nodes.heat.service_template
+ directives:
+ - substitutable
+ properties:
+ availability_zone:
+ get_input: availability_zone
+ static_routes_list:
+ - token:
+ - false;false;false;false
+ - ;
+ - 0
+ - token:
+ - false;false;false;false
+ - ;
+ - 1
+ - token:
+ - false;false;false;false
+ - ;
+ - 2
+ - token:
+ - false;false;false;false
+ - ;
+ - 3
+ availability_zone_enable:
+ get_input: st_availability_zone_enable_flag
+ service_template_name:
+ get_input: st_name
+ ordered_interfaces: true
+ flavor:
+ get_input: st_flavor
+ image_name:
+ get_input: st_image
+ service_template_filter:
+ substitute_service_template: service_instanceServiceTemplate.yaml
+ count: 5
+ scaling_enabled:
+ get_input: st_scaling
+ mandatory: true
+ service_type:
+ get_input: st_type
+ service_interface_type_list:
+ - token:
+ - get_input: st_service_interface_type_list
+ - ','
+ - 0
+ - token:
+ - get_input: st_service_interface_type_list
+ - ','
+ - 1
+ - token:
+ - get_input: st_service_interface_type_list
+ - ','
+ - 2
+ - token:
+ - get_input: st_service_interface_type_list
+ - ','
+ - 3
+ interface_list:
+ - virtual_network:
+ get_input: oam_mgmt_net_id
+ - virtual_network:
+ get_input: oam_protected_net_id
+ - static_routes:
+ - prefix:
+ get_input: static_prefix_3_1
+ virtual_network:
+ get_input: oam_direct_net_id
+ - virtual_network:
+ get_input: oam_hsl_net_id
+ service_instance_name:
+ get_input: service_instance_name
+ service_mode:
+ get_input: st_mode
+ shared_ip_list:
+ - true
+ - true
+ - false
+ - false
+ service_policy:
+ type: org.openecomp.resource.vfc.rules.nodes.heat.network.contrail.NetworkRules
+ properties:
+ entries:
+ policy_rule:
+ - src_ports:
+ - start_port:
+ get_input: start_src_ports
+ end_port:
+ get_input: end_src_ports
+ protocol: any
+ action_list:
+ apply_service:
+ - service_instance
+ dst_addresses:
+ - virtual_network:
+ get_input: oam_direct_net_id
+ dst_ports:
+ - start_port:
+ get_input: start_dst_ports
+ end_port:
+ get_input: end_dst_ports
+ src_addresses:
+ - virtual_network:
+ get_input: protected_net
+ direction:
+ get_input: service_policy_direction
+ name:
+ get_input: service_policy_name
+ requirements:
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: service_instance
+ relationship: tosca.relationships.DependsOn
+ groups:
+ lcp1_mss.oam-fw_si:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/lcp1_mss.oam-fw_si.yaml
+ description: |
+ Version 2.0 10-14-2015 (Authors: Art Mishurov,am254u & Johhny Chen, jc3066) - HOT-OAM-FW-SI template that creates two OAM networks (direct and protected) with a scaled out firewall service between the two.
+ members:
+ - service_instance
+ - service_policy \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/expectedoutputfiles/service_instanceServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/expectedoutputfiles/service_instanceServiceTemplate.yaml
new file mode 100644
index 0000000000..e9f2511604
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/expectedoutputfiles/service_instanceServiceTemplate.yaml
@@ -0,0 +1,411 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: service_instance
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ availability_zone:
+ hidden: false
+ immutable: false
+ type: string
+ description: Availability zone to create servers in
+ required: false
+ status: SUPPORTED
+ static_routes_list:
+ hidden: false
+ immutable: false
+ type: list
+ description: Static routes enabled
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: boolean
+ availability_zone_enable:
+ hidden: false
+ immutable: false
+ type: boolean
+ description: Indicates availability zone is enabled
+ required: false
+ default: false
+ status: SUPPORTED
+ service_template_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Service template name
+ required: false
+ status: SUPPORTED
+ ordered_interfaces:
+ hidden: false
+ immutable: false
+ type: boolean
+ description: Indicates if service interface are ordered
+ required: false
+ default: false
+ status: SUPPORTED
+ flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: flavor
+ required: false
+ status: SUPPORTED
+ image_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image name
+ required: true
+ status: SUPPORTED
+ service_type:
+ hidden: false
+ immutable: false
+ type: string
+ description: Service type
+ required: true
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - firewall
+ - analyzer
+ - source-nat
+ - loadbalancer
+ service_interface_type_list:
+ hidden: false
+ immutable: false
+ type: list
+ description: List of interface types
+ required: true
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ constraints:
+ - valid_values:
+ - management
+ - left
+ - right
+ - other
+ service_instance_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Service instance name
+ required: true
+ status: SUPPORTED
+ interface_list:
+ hidden: false
+ immutable: false
+ type: list
+ description: List of interfaces
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.contrail.InterfaceData
+ service_mode:
+ hidden: false
+ immutable: false
+ type: string
+ description: Service mode
+ required: true
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - transparent
+ - in-network
+ - in-network-nat
+ shared_ip_list:
+ hidden: false
+ immutable: false
+ type: list
+ description: Shared ips enabled
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: boolean
+ node_templates:
+ port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port
+ properties:
+ static_routes:
+ get_input:
+ - interface_list
+ - 0
+ - static_routes
+ virtual_network:
+ get_input:
+ - interface_list
+ - 0
+ - virtual_network
+ static_route:
+ get_input:
+ - static_routes_list
+ - 0
+ allowed_address_pairs:
+ get_input:
+ - interface_list
+ - 0
+ - allowed_address_pairs
+ shared_ip:
+ get_input:
+ - shared_ip_list
+ - 0
+ ip_address:
+ get_input:
+ - interface_list
+ - 0
+ - ip_address
+ interface_type:
+ get_input:
+ - service_interface_type_list
+ - 0
+ order: 0
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: service_instance
+ relationship: tosca.relationships.network.BindsTo
+ port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port
+ properties:
+ static_routes:
+ get_input:
+ - interface_list
+ - 1
+ - static_routes
+ virtual_network:
+ get_input:
+ - interface_list
+ - 1
+ - virtual_network
+ static_route:
+ get_input:
+ - static_routes_list
+ - 1
+ allowed_address_pairs:
+ get_input:
+ - interface_list
+ - 1
+ - allowed_address_pairs
+ shared_ip:
+ get_input:
+ - shared_ip_list
+ - 1
+ ip_address:
+ get_input:
+ - interface_list
+ - 1
+ - ip_address
+ interface_type:
+ get_input:
+ - service_interface_type_list
+ - 1
+ order: 1
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: service_instance
+ relationship: tosca.relationships.network.BindsTo
+ port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port
+ properties:
+ static_routes:
+ get_input:
+ - interface_list
+ - 2
+ - static_routes
+ virtual_network:
+ get_input:
+ - interface_list
+ - 2
+ - virtual_network
+ static_route:
+ get_input:
+ - static_routes_list
+ - 2
+ allowed_address_pairs:
+ get_input:
+ - interface_list
+ - 2
+ - allowed_address_pairs
+ shared_ip:
+ get_input:
+ - shared_ip_list
+ - 2
+ ip_address:
+ get_input:
+ - interface_list
+ - 2
+ - ip_address
+ interface_type:
+ get_input:
+ - service_interface_type_list
+ - 2
+ order: 2
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: service_instance
+ relationship: tosca.relationships.network.BindsTo
+ port_3:
+ type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port
+ properties:
+ static_routes:
+ get_input:
+ - interface_list
+ - 3
+ - static_routes
+ virtual_network:
+ get_input:
+ - interface_list
+ - 3
+ - virtual_network
+ static_route:
+ get_input:
+ - static_routes_list
+ - 3
+ allowed_address_pairs:
+ get_input:
+ - interface_list
+ - 3
+ - allowed_address_pairs
+ shared_ip:
+ get_input:
+ - shared_ip_list
+ - 3
+ ip_address:
+ get_input:
+ - interface_list
+ - 3
+ - ip_address
+ interface_type:
+ get_input:
+ - service_interface_type_list
+ - 3
+ order: 3
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: service_instance
+ relationship: tosca.relationships.network.BindsTo
+ service_instance:
+ type: org.openecomp.resource.vfc.nodes.heat.compute_service_template
+ properties:
+ flavor:
+ get_input: flavor
+ image_name:
+ get_input: image_name
+ availability_zone:
+ get_input: availability_zone
+ service_type:
+ get_input: service_type
+ availability_zone_enable:
+ get_input: availability_zone_enable
+ service_template_name:
+ get_input: service_template_name
+ service_instance_name:
+ get_input: service_instance_name
+ service_mode:
+ get_input: service_mode
+ groups:
+ service_instance:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/lcp1_mss.oam-fw_si.yaml
+ members:
+ - service_instance
+ - port_0
+ - port_1
+ - port_2
+ - port_3
+ outputs:
+ tenant_id:
+ description: Tenant id of the Service Instance
+ value:
+ get_attribute:
+ - service_instance
+ - tenant_id
+ fq_name:
+ description: The FQ name of the service instance
+ value:
+ get_attribute:
+ - service_instance
+ - fq_name
+ service_template_name:
+ description: Service Template of the Service Instance
+ value:
+ get_attribute:
+ - service_instance
+ - service_template_name
+ show:
+ description: All attributes
+ value:
+ get_attribute:
+ - service_instance
+ - show
+ active_vms:
+ description: Number of service VMs active for this Service Instance
+ value:
+ get_attribute:
+ - service_instance
+ - active_vms
+ service_instance_name:
+ description: The name of the service instance
+ value:
+ get_attribute:
+ - service_instance
+ - service_instance_name
+ virtual_machines:
+ description: Service VMs for the Service Instance
+ value:
+ get_attribute:
+ - service_instance
+ - virtual_machines
+ status:
+ description: Status of the service instance
+ value:
+ get_attribute:
+ - service_instance
+ - status
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.service_template
+ requirements:
+ link_port_0:
+ - port_0
+ - link
+ link_port_1:
+ - port_1
+ - link
+ link_port_2:
+ - port_2
+ - link
+ link_port_3:
+ - port_3
+ - link \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..63989f282b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/inputfiles/MANIFEST.json
@@ -0,0 +1,17 @@
+{
+ "name": "vLCP",
+ "description": "",
+ "data": [
+ {
+ "file": "lcp1_mss.oam-fw_si.yaml",
+ "type": "HEAT",
+ "isBase": "false",
+ "data": [
+ {
+ "file": "lcp1_mss.oam-fw_si_with_comments.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/inputfiles/lcp1_mss.oam-fw_si.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/inputfiles/lcp1_mss.oam-fw_si.yaml
new file mode 100644
index 0000000000..33620a9b91
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/inputfiles/lcp1_mss.oam-fw_si.yaml
@@ -0,0 +1,153 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 10-14-2015 (Authors: Art Mishurov,am254u & Johhny Chen, jc3066) - HOT-OAM-FW-SI template that creates two OAM networks (direct and protected) with a scaled out firewall service between the two.
+
+parameters:
+ service_policy_name:
+ type: string
+ description: Policy Name
+ service_policy_direction:
+ type: string
+ description: Direction of Policy
+ start_src_ports:
+ type: number
+ description: Start of src port
+ end_src_ports:
+ type: number
+ description: End of src port
+ start_dst_ports:
+ type: number
+ description: Start of dst port
+ end_dst_ports:
+ type: number
+ description: End of dst port
+ oam_mgmt_net_id:
+ type: string
+ description: Name of private network to be created
+ oam_protected_net_id:
+ type: string
+ description: Name of private network to be created
+ oam_direct_net_id:
+ type: string
+ description: Name of private network to be created
+ oam_hsl_net_id:
+ type: string
+ description: Name of private network to be created
+ st_name:
+ type: string
+ description: service template name or ID
+ st_type:
+ type: string
+ description: service type
+ st_image:
+ type: string
+ description: Name of the image
+ st_flavor:
+ type: string
+ description: Flavor
+ st_service_interface_type_list:
+ type: string
+ description: List of interface types
+ st_shared_ip_list:
+ type: string
+ description: List of shared ip enabled-disabled
+ st_static_routes_list:
+ type: string
+ description: List of static routes enabled-disabled
+ st_scaling:
+ type: string
+ description: Indicates whether service scaling is enabled
+ st_mode:
+ type: string
+ description: service mode
+ st_availability_zone_enable_flag:
+ type: string
+ description: service template availablity_zone feature enable flag
+ max_num_fw_instances:
+ type: number
+ description: maximum number of firewall instances for scaling
+ service_instance_name:
+ type: string
+ description: service instance name
+ availability_zone:
+ type: string
+ description: availability zone in form of Zone:Host
+ static_prefix_3_1:
+ type: string
+ description: prefix for static route
+ protected_net:
+ type: string
+
+resources:
+ service_template:
+ type: OS::Contrail::ServiceTemplate
+ properties:
+ name: { get_param: st_name }
+ service_mode: { get_param: st_mode }
+ service_type: { get_param: st_type }
+ image_name: { get_param: st_image }
+ flavor: { get_param: st_flavor }
+ service_interface_type_list: { "Fn::Split" : [ ",", Ref: st_service_interface_type_list ] }
+ shared_ip_list: [ true, on, no, 0 ]
+ static_routes_list: { "Fn::Split" : [ ";", "n;false;false;false" ] }
+ service_scaling: { get_param: st_scaling }
+ availability_zone_enable: { get_param: st_availability_zone_enable_flag }
+ ordered_interfaces: true
+
+ service_instance:
+ type: OS::Contrail::ServiceInstance
+ properties:
+ name: { get_param: service_instance_name }
+ service_template: { get_resource: service_template }
+ availability_zone: { get_param: availability_zone }
+ scale_out:
+ max_instances: 5
+ interface_list: [
+ {
+ virtual_network: {get_param: oam_mgmt_net_id}
+ },
+ {
+ virtual_network: {get_param: oam_protected_net_id}
+ },
+ {
+ virtual_network: {get_param: oam_direct_net_id},
+ static_routes: [
+ { "prefix": {get_param: static_prefix_3_1} },
+ ],
+ },
+ {
+ virtual_network: {get_param: oam_hsl_net_id}
+ },
+ ]
+
+ service_policy:
+ type: OS::Contrail::NetworkPolicy
+ depends_on: [ service_instance ]
+ properties:
+ name: { get_param: service_policy_name }
+ entries:
+ policy_rule: [
+ {
+ "direction": { get_param: service_policy_direction },
+ "protocol": "any",
+ "src_ports": [{"start_port": {get_param: start_src_ports}, "end_port": {get_param: end_src_ports}}],
+ "dst_ports": [{"start_port": {get_param: start_dst_ports}, "end_port": {get_param: end_dst_ports}}],
+ "dst_addresses": [{ "virtual_network": {get_param: oam_direct_net_id}}],
+ "action_list": {"apply_service": [{get_resource: service_instance}]},
+ "src_addresses": [{ "virtual_network": {get_param: protected_net}}]
+ },
+ ]
+ service_policy_attach_direct_net:
+ type: OS::Contrail::AttachPolicy
+ depends_on: [ service_policy ]
+ properties:
+ network: { get_param: oam_direct_net_id }
+ policy: { get_attr: [service_policy, fq_name] }
+
+ service_policy_attach_protected_net:
+ type: OS::Contrail::AttachPolicy
+ depends_on: [ service_policy ]
+ properties:
+ network: { get_param: oam_protected_net_id }
+ policy: { get_attr: [service_policy, fq_name] }
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/inputfiles/lcp1_mss.oam-fw_si_with_comments.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/inputfiles/lcp1_mss.oam-fw_si_with_comments.env
new file mode 100644
index 0000000000..718c5dba17
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/inputfiles/lcp1_mss.oam-fw_si_with_comments.env
@@ -0,0 +1,26 @@
+parameters:
+ #service_instance_name: ZRDM1FRWL02OAM
+ service_policy_name: MNS-25180-L-02Shared_policy_direct_fw_protected_oam_1
+ service_policy_direction: "<>"
+ start_src_ports: -1
+ end_src_ports: -1
+ start_dst_ports: -1
+ end_dst_ports: -1
+ st_name: MNS-25180-L-02Shared_oam_fw_template_1
+ st_mode: in-network-nat
+ st_type: firewall
+ st_image: NIMBUS_SRX_151X49-D303
+ st_flavor: lc.medium
+ st_service_interface_type_list: management,left,right,other
+ st_shared_ip_list: False,True,False,False
+ st_static_routes_list: True,True,True,True
+ st_scaling: "True"
+ st_availability_zone_enable_flag: "True"
+ #availability_zone: "nova"
+ max_num_fw_instances: 8
+ #oam_mgmt_net_id: 'default-domain:MNS-25180-L-02Shared_oam_mgmt_net_1'
+ #oam_protected_net_id: 'default-domain:MNS-25180-L-02Shared_oam_protected_net_1'
+ #oam_direct_net_id: 'default-domain:MNS-25180-L-02Shared_oam_direct_net_1'
+ #oam_hsl_net_id: 'default-domain:MNS-25180-L-02Shared_oam_hsl_net_1'
+ static_prefix_3_1: 107.239.80.0/21
+ \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..b00d3d8bc0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
@@ -0,0 +1,64 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: GlobalSubstitutionTypes
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.abstract.nodes.heat.service_template:
+ derived_from: org.openecomp.resource.abstract.nodes.contrail.AbstractSubstitute
+ requirements:
+ - link_port_0:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_port_2:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_port_3:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ org.openecomp.resource.vfc.nodes.heat.compute_service_template:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.contrail.Compute \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..942df0b120
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,441 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ service_policy_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Policy Name
+ st_static_routes_list:
+ hidden: false
+ immutable: false
+ type: string
+ description: List of static routes enabled-disabled
+ st_type:
+ hidden: false
+ immutable: false
+ type: string
+ description: service type
+ st_service_interface_type_list:
+ hidden: false
+ immutable: false
+ type: string
+ description: List of interface types
+ st_mode:
+ hidden: false
+ immutable: false
+ type: string
+ description: service mode
+ Cricket_OCS_protected_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of Cricket OCS network
+ oam_mgmt_net_0_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of OAM network
+ start_dst_ports:
+ hidden: false
+ immutable: false
+ type: float
+ description: Start of dst port
+ st_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor
+ availability_zone_1:
+ hidden: false
+ immutable: false
+ type: string
+ description: availability zone
+ service_instance_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Service instance name
+ st_scaling:
+ hidden: false
+ immutable: false
+ type: string
+ description: Indicates whether service scaling is enabled
+ max_num_fw_instances:
+ hidden: false
+ immutable: false
+ type: float
+ description: maximum number of firewall instances for scaling
+ start_src_ports:
+ hidden: false
+ immutable: false
+ type: float
+ description: Start of src port
+ service_policy_direction:
+ hidden: false
+ immutable: false
+ type: string
+ description: Direction of Policy
+ st_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of service template
+ HSL_direct_net_gateway:
+ hidden: false
+ immutable: false
+ type: string
+ description: HSL (Logging) network gateway address
+ st_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of the image
+ st_shared_ip_list:
+ hidden: false
+ immutable: false
+ type: string
+ description: List of shared ip enabled-disabled
+ prefix_0:
+ hidden: false
+ immutable: false
+ type: string
+ Cricket_OCS_direct_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of Cricket OCS network
+ oam_mgmt_net_1_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of OAM network
+ prefix_1:
+ hidden: false
+ immutable: false
+ type: string
+ end_src_ports:
+ hidden: false
+ immutable: false
+ type: float
+ description: End of src port
+ prefix_2:
+ hidden: false
+ immutable: false
+ type: string
+ end_dst_ports:
+ hidden: false
+ immutable: false
+ type: float
+ description: End of dst port
+ st_image_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of the image
+ HSL_direct_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of HSL (Logging) network
+ HSL_direct_net_cidr:
+ hidden: false
+ immutable: false
+ type: string
+ description: HSL (Logging) network address (CIDR notation)
+ node_templates:
+ service_instance_1:
+ type: org.openecomp.resource.abstract.nodes.heat.service_template
+ directives:
+ - substitutable
+ properties:
+ flavor:
+ get_input: st_flavor
+ availability_zone:
+ get_input: availability_zone_1
+ image_name:
+ get_input: st_image
+ service_template_filter:
+ substitute_service_template: service_instance_1ServiceTemplate.yaml
+ count: 1
+ scaling_enabled:
+ get_input: st_scaling
+ mandatory: true
+ service_type:
+ get_input: st_type
+ static_routes_list:
+ - token:
+ - get_input: st_static_routes_list
+ - ','
+ - 0
+ - token:
+ - get_input: st_static_routes_list
+ - ','
+ - 1
+ - token:
+ - get_input: st_static_routes_list
+ - ','
+ - 2
+ - token:
+ - get_input: st_static_routes_list
+ - ','
+ - 3
+ service_template_name:
+ get_input: st_name
+ service_interface_type_list:
+ - token:
+ - management,left,right,other
+ - ','
+ - 0
+ - token:
+ - management,left,right,other
+ - ','
+ - 1
+ - token:
+ - management,left,right,other
+ - ','
+ - 2
+ - token:
+ - management,left,right,other
+ - ','
+ - 3
+ interface_list:
+ - virtual_network:
+ get_input: oam_mgmt_net_0_id
+ - virtual_network:
+ get_input: Cricket_OCS_direct_net_id
+ - virtual_network: hsl_direct_net1
+ - static_routes:
+ - prefix:
+ get_input: prefix_0
+ - prefix:
+ get_input: prefix_1
+ - prefix:
+ get_input: prefix_2
+ virtual_network:
+ get_input: oam_mgmt_net_1_id
+ service_instance_name:
+ get_input: service_instance_name
+ service_mode:
+ get_input: st_mode
+ shared_ip_list:
+ - token:
+ - get_input: st_shared_ip_list
+ - ','
+ - 0
+ - token:
+ - get_input: st_shared_ip_list
+ - ','
+ - 1
+ - token:
+ - get_input: st_shared_ip_list
+ - ','
+ - 2
+ - token:
+ - get_input: st_shared_ip_list
+ - ','
+ - 3
+ requirements:
+ - link_port_2:
+ capability: tosca.capabilities.network.Linkable
+ node: hsl_direct_net1
+ relationship: tosca.relationships.network.LinksTo
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: hsl_direct_net1
+ relationship: tosca.relationships.DependsOn
+ service_instance_2:
+ type: org.openecomp.resource.abstract.nodes.heat.service_template
+ directives:
+ - substitutable
+ properties:
+ flavor:
+ get_input: st_flavor
+ availability_zone:
+ get_input: availability_zone_1
+ image_name:
+ get_input: st_image
+ service_template_filter:
+ substitute_service_template: service_instance_2ServiceTemplate.yaml
+ count:
+ get_input: max_num_fw_instances
+ scaling_enabled:
+ get_input: st_scaling
+ mandatory: false
+ service_type:
+ get_input: st_type
+ static_routes_list:
+ - token:
+ - get_input: st_static_routes_list
+ - ','
+ - 0
+ - token:
+ - get_input: st_static_routes_list
+ - ','
+ - 1
+ - token:
+ - get_input: st_static_routes_list
+ - ','
+ - 2
+ - token:
+ - get_input: st_static_routes_list
+ - ','
+ - 3
+ service_template_name:
+ get_input: st_name
+ service_interface_type_list:
+ - token:
+ - management,left,right,other
+ - ','
+ - 0
+ - token:
+ - management,left,right,other
+ - ','
+ - 1
+ - token:
+ - management,left,right,other
+ - ','
+ - 2
+ - token:
+ - management,left,right,other
+ - ','
+ - 3
+ interface_list:
+ - virtual_network:
+ get_input: oam_mgmt_net_0_id
+ - virtual_network:
+ get_input: Cricket_OCS_direct_net_id
+ - virtual_network: hsl_direct_net2
+ - static_routes:
+ - prefix:
+ get_input: prefix_0
+ - prefix:
+ get_input: prefix_1
+ - prefix:
+ get_input: prefix_2
+ virtual_network:
+ get_input: oam_mgmt_net_1_id
+ service_instance_name:
+ get_input: service_instance_name
+ service_mode:
+ get_input: st_mode
+ shared_ip_list:
+ - token:
+ - get_input: st_shared_ip_list
+ - ','
+ - 0
+ - token:
+ - get_input: st_shared_ip_list
+ - ','
+ - 1
+ - token:
+ - get_input: st_shared_ip_list
+ - ','
+ - 2
+ - token:
+ - get_input: st_shared_ip_list
+ - ','
+ - 3
+ requirements:
+ - link_port_2:
+ capability: tosca.capabilities.network.Linkable
+ node: hsl_direct_net2
+ relationship: tosca.relationships.network.LinksTo
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: hsl_direct_net1
+ relationship: tosca.relationships.DependsOn
+ hsl_direct_net1:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ network_name:
+ get_input: HSL_direct_net_id
+ subnets:
+ hsl_ip_subnet:
+ cidr:
+ get_input: HSL_direct_net_cidr
+ gateway_ip:
+ get_input: HSL_direct_net_gateway
+ hsl_direct_net2:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ network_name:
+ get_input: HSL_direct_net_id
+ service_policy:
+ type: org.openecomp.resource.vfc.rules.nodes.heat.network.contrail.NetworkRules
+ properties:
+ entries:
+ policy_rule:
+ - src_ports:
+ - start_port:
+ get_input: start_src_ports
+ end_port:
+ get_input: end_src_ports
+ protocol: any
+ action_list:
+ apply_service:
+ - service_instance_1
+ dst_addresses:
+ - virtual_network:
+ get_input: Cricket_OCS_direct_net_id
+ dst_ports:
+ - start_port:
+ get_input: start_dst_ports
+ end_port:
+ get_input: end_dst_ports
+ src_addresses:
+ - virtual_network:
+ get_input: Cricket_OCS_protected_net_id
+ direction:
+ get_input: service_policy_direction
+ name:
+ get_input: service_policy_name
+ requirements:
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: service_instance_1
+ relationship: tosca.relationships.DependsOn
+ groups:
+ OCS-fw:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/OCS-fw.yml
+ description: |
+ Based on the following reference for the HOT-DMZ-FW template: Version 3.5 8-10-2015 (Authors: Art Mishurov,am254u & Johhny Chen, jc3066) - HOT-DMZ-FW template that creates two DMZ networks (direct and protected) with a scaled out firewall service between the two.
+ members:
+ - service_instance_1
+ - service_instance_2
+ - hsl_direct_net1
+ - hsl_direct_net2
+ - service_policy \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/expectedoutputfiles/service_instance_1ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/expectedoutputfiles/service_instance_1ServiceTemplate.yaml
new file mode 100644
index 0000000000..4b53e28b6f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/expectedoutputfiles/service_instance_1ServiceTemplate.yaml
@@ -0,0 +1,407 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: service_instance_1
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ availability_zone:
+ hidden: false
+ immutable: false
+ type: string
+ description: Availability zone to create servers in
+ required: false
+ status: SUPPORTED
+ static_routes_list:
+ hidden: false
+ immutable: false
+ type: list
+ description: Static routes enabled
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: boolean
+ availability_zone_enable:
+ hidden: false
+ immutable: false
+ type: boolean
+ description: Indicates availability zone is enabled
+ required: false
+ default: false
+ status: SUPPORTED
+ service_template_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Service template name
+ required: false
+ status: SUPPORTED
+ ordered_interfaces:
+ hidden: false
+ immutable: false
+ type: boolean
+ description: Indicates if service interface are ordered
+ required: false
+ default: false
+ status: SUPPORTED
+ flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: flavor
+ required: false
+ status: SUPPORTED
+ image_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image name
+ required: true
+ status: SUPPORTED
+ service_type:
+ hidden: false
+ immutable: false
+ type: string
+ description: Service type
+ required: true
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - firewall
+ - analyzer
+ - source-nat
+ - loadbalancer
+ service_interface_type_list:
+ hidden: false
+ immutable: false
+ type: list
+ description: List of interface types
+ required: true
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ constraints:
+ - valid_values:
+ - management
+ - left
+ - right
+ - other
+ service_instance_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Service instance name
+ required: true
+ status: SUPPORTED
+ interface_list:
+ hidden: false
+ immutable: false
+ type: list
+ description: List of interfaces
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.contrail.InterfaceData
+ service_mode:
+ hidden: false
+ immutable: false
+ type: string
+ description: Service mode
+ required: true
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - transparent
+ - in-network
+ - in-network-nat
+ shared_ip_list:
+ hidden: false
+ immutable: false
+ type: list
+ description: Shared ips enabled
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: boolean
+ node_templates:
+ service_instance_1:
+ type: org.openecomp.resource.vfc.nodes.heat.compute_service_template
+ properties:
+ flavor:
+ get_input: flavor
+ image_name:
+ get_input: image_name
+ availability_zone:
+ get_input: availability_zone
+ service_type:
+ get_input: service_type
+ availability_zone_enable:
+ get_input: availability_zone_enable
+ service_template_name:
+ get_input: service_template_name
+ service_instance_name:
+ get_input: service_instance_name
+ service_mode:
+ get_input: service_mode
+ port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port
+ properties:
+ static_routes:
+ get_input:
+ - interface_list
+ - 0
+ - static_routes
+ virtual_network:
+ get_input:
+ - interface_list
+ - 0
+ - virtual_network
+ static_route:
+ get_input:
+ - static_routes_list
+ - 0
+ allowed_address_pairs:
+ get_input:
+ - interface_list
+ - 0
+ - allowed_address_pairs
+ shared_ip:
+ get_input:
+ - shared_ip_list
+ - 0
+ ip_address:
+ get_input:
+ - interface_list
+ - 0
+ - ip_address
+ interface_type:
+ get_input:
+ - service_interface_type_list
+ - 0
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: service_instance_1
+ relationship: tosca.relationships.network.BindsTo
+ port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port
+ properties:
+ static_routes:
+ get_input:
+ - interface_list
+ - 1
+ - static_routes
+ virtual_network:
+ get_input:
+ - interface_list
+ - 1
+ - virtual_network
+ static_route:
+ get_input:
+ - static_routes_list
+ - 1
+ allowed_address_pairs:
+ get_input:
+ - interface_list
+ - 1
+ - allowed_address_pairs
+ shared_ip:
+ get_input:
+ - shared_ip_list
+ - 1
+ ip_address:
+ get_input:
+ - interface_list
+ - 1
+ - ip_address
+ interface_type:
+ get_input:
+ - service_interface_type_list
+ - 1
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: service_instance_1
+ relationship: tosca.relationships.network.BindsTo
+ port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port
+ properties:
+ static_routes:
+ get_input:
+ - interface_list
+ - 2
+ - static_routes
+ virtual_network:
+ get_input:
+ - interface_list
+ - 2
+ - virtual_network
+ static_route:
+ get_input:
+ - static_routes_list
+ - 2
+ allowed_address_pairs:
+ get_input:
+ - interface_list
+ - 2
+ - allowed_address_pairs
+ shared_ip:
+ get_input:
+ - shared_ip_list
+ - 2
+ ip_address:
+ get_input:
+ - interface_list
+ - 2
+ - ip_address
+ interface_type:
+ get_input:
+ - service_interface_type_list
+ - 2
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: service_instance_1
+ relationship: tosca.relationships.network.BindsTo
+ port_3:
+ type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port
+ properties:
+ static_routes:
+ get_input:
+ - interface_list
+ - 3
+ - static_routes
+ virtual_network:
+ get_input:
+ - interface_list
+ - 3
+ - virtual_network
+ static_route:
+ get_input:
+ - static_routes_list
+ - 3
+ allowed_address_pairs:
+ get_input:
+ - interface_list
+ - 3
+ - allowed_address_pairs
+ shared_ip:
+ get_input:
+ - shared_ip_list
+ - 3
+ ip_address:
+ get_input:
+ - interface_list
+ - 3
+ - ip_address
+ interface_type:
+ get_input:
+ - service_interface_type_list
+ - 3
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: service_instance_1
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ service_instance_1:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/OCS-fw.yml
+ members:
+ - service_instance_1
+ - port_0
+ - port_1
+ - port_2
+ - port_3
+ outputs:
+ tenant_id:
+ description: Tenant id of the Service Instance
+ value:
+ get_attribute:
+ - service_instance_1
+ - tenant_id
+ fq_name:
+ description: The FQ name of the service instance
+ value:
+ get_attribute:
+ - service_instance_1
+ - fq_name
+ service_template_name:
+ description: Service Template of the Service Instance
+ value:
+ get_attribute:
+ - service_instance_1
+ - service_template_name
+ show:
+ description: All attributes
+ value:
+ get_attribute:
+ - service_instance_1
+ - show
+ active_vms:
+ description: Number of service VMs active for this Service Instance
+ value:
+ get_attribute:
+ - service_instance_1
+ - active_vms
+ service_instance_name:
+ description: The name of the service instance
+ value:
+ get_attribute:
+ - service_instance_1
+ - service_instance_name
+ virtual_machines:
+ description: Service VMs for the Service Instance
+ value:
+ get_attribute:
+ - service_instance_1
+ - virtual_machines
+ status:
+ description: Status of the service instance
+ value:
+ get_attribute:
+ - service_instance_1
+ - status
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.service_template
+ requirements:
+ link_port_0:
+ - port_0
+ - link
+ link_port_1:
+ - port_1
+ - link
+ link_port_2:
+ - port_2
+ - link
+ link_port_3:
+ - port_3
+ - link \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/expectedoutputfiles/service_instance_2ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/expectedoutputfiles/service_instance_2ServiceTemplate.yaml
new file mode 100644
index 0000000000..f0e67ea99c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/expectedoutputfiles/service_instance_2ServiceTemplate.yaml
@@ -0,0 +1,407 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: service_instance_2
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ availability_zone:
+ hidden: false
+ immutable: false
+ type: string
+ description: Availability zone to create servers in
+ required: false
+ status: SUPPORTED
+ static_routes_list:
+ hidden: false
+ immutable: false
+ type: list
+ description: Static routes enabled
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: boolean
+ availability_zone_enable:
+ hidden: false
+ immutable: false
+ type: boolean
+ description: Indicates availability zone is enabled
+ required: false
+ default: false
+ status: SUPPORTED
+ service_template_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Service template name
+ required: false
+ status: SUPPORTED
+ ordered_interfaces:
+ hidden: false
+ immutable: false
+ type: boolean
+ description: Indicates if service interface are ordered
+ required: false
+ default: false
+ status: SUPPORTED
+ flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: flavor
+ required: false
+ status: SUPPORTED
+ image_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image name
+ required: true
+ status: SUPPORTED
+ service_type:
+ hidden: false
+ immutable: false
+ type: string
+ description: Service type
+ required: true
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - firewall
+ - analyzer
+ - source-nat
+ - loadbalancer
+ service_interface_type_list:
+ hidden: false
+ immutable: false
+ type: list
+ description: List of interface types
+ required: true
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ constraints:
+ - valid_values:
+ - management
+ - left
+ - right
+ - other
+ service_instance_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Service instance name
+ required: true
+ status: SUPPORTED
+ interface_list:
+ hidden: false
+ immutable: false
+ type: list
+ description: List of interfaces
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.contrail.InterfaceData
+ service_mode:
+ hidden: false
+ immutable: false
+ type: string
+ description: Service mode
+ required: true
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - transparent
+ - in-network
+ - in-network-nat
+ shared_ip_list:
+ hidden: false
+ immutable: false
+ type: list
+ description: Shared ips enabled
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: boolean
+ node_templates:
+ service_instance_2:
+ type: org.openecomp.resource.vfc.nodes.heat.compute_service_template
+ properties:
+ flavor:
+ get_input: flavor
+ image_name:
+ get_input: image_name
+ availability_zone:
+ get_input: availability_zone
+ service_type:
+ get_input: service_type
+ availability_zone_enable:
+ get_input: availability_zone_enable
+ service_template_name:
+ get_input: service_template_name
+ service_instance_name:
+ get_input: service_instance_name
+ service_mode:
+ get_input: service_mode
+ port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port
+ properties:
+ static_routes:
+ get_input:
+ - interface_list
+ - 0
+ - static_routes
+ virtual_network:
+ get_input:
+ - interface_list
+ - 0
+ - virtual_network
+ static_route:
+ get_input:
+ - static_routes_list
+ - 0
+ allowed_address_pairs:
+ get_input:
+ - interface_list
+ - 0
+ - allowed_address_pairs
+ shared_ip:
+ get_input:
+ - shared_ip_list
+ - 0
+ ip_address:
+ get_input:
+ - interface_list
+ - 0
+ - ip_address
+ interface_type:
+ get_input:
+ - service_interface_type_list
+ - 0
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: service_instance_2
+ relationship: tosca.relationships.network.BindsTo
+ port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port
+ properties:
+ static_routes:
+ get_input:
+ - interface_list
+ - 1
+ - static_routes
+ virtual_network:
+ get_input:
+ - interface_list
+ - 1
+ - virtual_network
+ static_route:
+ get_input:
+ - static_routes_list
+ - 1
+ allowed_address_pairs:
+ get_input:
+ - interface_list
+ - 1
+ - allowed_address_pairs
+ shared_ip:
+ get_input:
+ - shared_ip_list
+ - 1
+ ip_address:
+ get_input:
+ - interface_list
+ - 1
+ - ip_address
+ interface_type:
+ get_input:
+ - service_interface_type_list
+ - 1
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: service_instance_2
+ relationship: tosca.relationships.network.BindsTo
+ port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port
+ properties:
+ static_routes:
+ get_input:
+ - interface_list
+ - 2
+ - static_routes
+ virtual_network:
+ get_input:
+ - interface_list
+ - 2
+ - virtual_network
+ static_route:
+ get_input:
+ - static_routes_list
+ - 2
+ allowed_address_pairs:
+ get_input:
+ - interface_list
+ - 2
+ - allowed_address_pairs
+ shared_ip:
+ get_input:
+ - shared_ip_list
+ - 2
+ ip_address:
+ get_input:
+ - interface_list
+ - 2
+ - ip_address
+ interface_type:
+ get_input:
+ - service_interface_type_list
+ - 2
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: service_instance_2
+ relationship: tosca.relationships.network.BindsTo
+ port_3:
+ type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port
+ properties:
+ static_routes:
+ get_input:
+ - interface_list
+ - 3
+ - static_routes
+ virtual_network:
+ get_input:
+ - interface_list
+ - 3
+ - virtual_network
+ static_route:
+ get_input:
+ - static_routes_list
+ - 3
+ allowed_address_pairs:
+ get_input:
+ - interface_list
+ - 3
+ - allowed_address_pairs
+ shared_ip:
+ get_input:
+ - shared_ip_list
+ - 3
+ ip_address:
+ get_input:
+ - interface_list
+ - 3
+ - ip_address
+ interface_type:
+ get_input:
+ - service_interface_type_list
+ - 3
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: service_instance_2
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ service_instance_2:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/OCS-fw.yml
+ members:
+ - service_instance_2
+ - port_0
+ - port_1
+ - port_2
+ - port_3
+ outputs:
+ tenant_id:
+ description: Tenant id of the Service Instance
+ value:
+ get_attribute:
+ - service_instance_2
+ - tenant_id
+ fq_name:
+ description: The FQ name of the service instance
+ value:
+ get_attribute:
+ - service_instance_2
+ - fq_name
+ service_template_name:
+ description: Service Template of the Service Instance
+ value:
+ get_attribute:
+ - service_instance_2
+ - service_template_name
+ show:
+ description: All attributes
+ value:
+ get_attribute:
+ - service_instance_2
+ - show
+ active_vms:
+ description: Number of service VMs active for this Service Instance
+ value:
+ get_attribute:
+ - service_instance_2
+ - active_vms
+ service_instance_name:
+ description: The name of the service instance
+ value:
+ get_attribute:
+ - service_instance_2
+ - service_instance_name
+ virtual_machines:
+ description: Service VMs for the Service Instance
+ value:
+ get_attribute:
+ - service_instance_2
+ - virtual_machines
+ status:
+ description: Status of the service instance
+ value:
+ get_attribute:
+ - service_instance_2
+ - status
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.service_template
+ requirements:
+ link_port_0:
+ - port_0
+ - link
+ link_port_1:
+ - port_1
+ - link
+ link_port_2:
+ - port_2
+ - link
+ link_port_3:
+ - port_3
+ - link \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..a26430ba72
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/inputfiles/MANIFEST.json
@@ -0,0 +1,12 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "OCS-fw.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/inputfiles/OCS-fw.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/inputfiles/OCS-fw.yml
new file mode 100644
index 0000000000..0082148f77
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/inputfiles/OCS-fw.yml
@@ -0,0 +1,213 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Based on the following reference for the HOT-DMZ-FW template:
+ Version 3.5 8-10-2015 (Authors: Art Mishurov,am254u & Johhny Chen, jc3066) - HOT-DMZ-FW template that creates two DMZ networks (direct and protected) with a scaled out firewall service between the two.
+
+parameters:
+ HSL_direct_net_id:
+ type: string
+ description: Name of HSL (Logging) network
+ prefix_0:
+ type: string
+ prefix_1:
+ type: string
+ prefix_2:
+ type: string
+ HSL_direct_net_cidr:
+ type: string
+ description: HSL (Logging) network address (CIDR notation)
+ HSL_direct_net_gateway:
+ type: string
+ description: HSL (Logging) network gateway address
+ oam_mgmt_net_0_id:
+ type: string
+ description: Name of OAM network
+ oam_mgmt_net_1_id:
+ type: string
+ description: Name of OAM network
+ Cricket_OCS_direct_net_id:
+ type: string
+ description: Name of Cricket OCS network
+ Cricket_OCS_protected_net_id:
+ type: string
+ description: Name of Cricket OCS network
+ service_instance_name:
+ type: string
+ description: Service instance name
+ service_policy_name:
+ type: string
+ description: Policy Name
+ service_policy_direction:
+ type: string
+ description: Direction of Policy
+ start_src_ports:
+ type: number
+ description: Start of src port
+ end_src_ports:
+ type: number
+ description: End of src port
+ start_dst_ports:
+ type: number
+ description: Start of dst port
+ end_dst_ports:
+ type: number
+ description: End of dst port
+ st_name:
+ type: string
+ description: Name of service template
+ st_mode:
+ type: string
+ description: service mode
+ st_type:
+ type: string
+ description: service type
+ st_image:
+ type: string
+ description: Name of the image
+ st_image_name:
+ type: string
+ description: Name of the image
+ st_flavor:
+ type: string
+ description: Flavor
+ st_service_interface_type_list:
+ type: string
+ description: List of interface types
+ st_shared_ip_list:
+ type: string
+ description: List of shared ip enabled-disabled
+ st_static_routes_list:
+ type: string
+ description: List of static routes enabled-disabled
+ st_scaling:
+ type: string
+ description: Indicates whether service scaling is enabled
+ max_num_fw_instances:
+ type: number
+ description: maximum number of firewall instances for scaling
+ availability_zone_1:
+ type: string
+ description: availability zone
+
+resources:
+
+ hsl_direct_net1:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: HSL_direct_net_id }
+# external: True
+
+ hsl_direct_net2:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: HSL_direct_net_id }
+# external: True
+
+ hsl_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: hsl_direct_net1 }
+ cidr: { get_param: HSL_direct_net_cidr }
+ gateway_ip: { get_param: HSL_direct_net_gateway }
+
+ service_template:
+ type: OS::Contrail::ServiceTemplate
+ properties:
+ name: { get_param: st_name }
+ service_mode: { get_param: st_mode }
+ service_type: { get_param: st_type }
+ image_name: { get_param: st_image }
+ flavor: { get_param: st_flavor }
+ service_interface_type_list: { "Fn::Split" : [ ",", "management,left,right,other" ] }
+ shared_ip_list: { "Fn::Split" : [ ",", Ref: st_shared_ip_list ] }
+ static_routes_list: { "Fn::Split" : [ ",", Ref: st_static_routes_list ] }
+ service_scaling: { get_param: st_scaling }
+
+ service_instance_1:
+ type: OS::Contrail::ServiceInstance
+ depends_on: [ hsl_ip_subnet]
+ properties:
+ name: { get_param: service_instance_name }
+ availability_zone: { get_param: availability_zone_1 }
+ service_template: { get_resource: service_template }
+ interface_list: [
+ {
+ virtual_network: { get_param: oam_mgmt_net_0_id }
+ },
+ {
+ virtual_network: { get_param: Cricket_OCS_direct_net_id }
+ },
+ {
+ virtual_network: { get_resource: hsl_direct_net1 }
+ },
+ {
+ virtual_network: {get_param: oam_mgmt_net_1_id},
+ static_routes: [
+ { "prefix": {get_param: prefix_0} },
+ { "prefix": {get_param: prefix_1} },
+ { "prefix": {get_param: prefix_2} },
+ ],
+ }
+ ]
+
+ service_instance_2:
+ type: OS::Contrail::ServiceInstance
+ depends_on: [ hsl_ip_subnet]
+ properties:
+ name: { get_param: service_instance_name }
+ availability_zone: { get_param: availability_zone_1 }
+ service_template: { get_resource: service_template }
+ scale_out:
+ max_instances: {get_param: max_num_fw_instances}
+ interface_list: [
+ {
+ virtual_network: { get_param: oam_mgmt_net_0_id }
+ },
+ {
+ virtual_network: { get_param: Cricket_OCS_direct_net_id }
+ },
+ {
+ virtual_network: { get_resource: hsl_direct_net2 }
+ },
+ {
+ virtual_network: {get_param: oam_mgmt_net_1_id},
+ static_routes: [
+ { "prefix": {get_param: prefix_0} },
+ { "prefix": {get_param: prefix_1} },
+ { "prefix": {get_param: prefix_2} },
+ ],
+ }
+ ]
+
+ service_policy:
+ type: OS::Contrail::NetworkPolicy
+ depends_on: [ service_instance_1 ]
+ properties:
+ name: { get_param: service_policy_name }
+ entries:
+ policy_rule: [
+ {
+ "direction": { get_param: service_policy_direction },
+ "protocol": "any",
+ "src_ports": [{"start_port": {get_param: start_src_ports}, "end_port": {get_param: end_src_ports}}],
+ "dst_ports": [{"start_port": {get_param: start_dst_ports}, "end_port": {get_param: end_dst_ports}}],
+ "dst_addresses": [{ "virtual_network": { get_param: Cricket_OCS_direct_net_id }}],
+ "action_list": { "apply_service": [{ get_resource: service_instance_1 }]},
+ "src_addresses": [{ "virtual_network": { get_param: Cricket_OCS_protected_net_id }}],
+ },
+ ]
+
+ service_policy_attach_direct_net:
+ type: OS::Contrail::AttachPolicy
+ depends_on: [ service_policy ]
+ properties:
+ network: { get_param: Cricket_OCS_direct_net_id }
+ policy: { get_attr: [service_policy, fq_name] }
+
+ service_policy_attach_protected_net:
+ type: OS::Contrail::AttachPolicy
+ depends_on: [ service_policy ]
+ properties:
+ network: { get_param: Cricket_OCS_protected_net_id }
+ policy: { get_attr: [service_policy, fq_name] } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..73abe8ecb0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
@@ -0,0 +1,71 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: GlobalSubstitutionTypes
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.abstract.nodes.heat.service_template:
+ derived_from: org.openecomp.resource.abstract.nodes.contrail.AbstractSubstitute
+ requirements:
+ - link_port_0:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_port_2:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_port_3:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_port_4:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ org.openecomp.resource.vfc.nodes.heat.compute_service_template:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.contrail.Compute \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..c6a6364988
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,407 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ Internal1_shared:
+ hidden: false
+ immutable: false
+ type: string
+ service_policy_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Policy Name
+ st_static_routes_list:
+ hidden: false
+ immutable: false
+ type: string
+ description: List of static routes enabled-disabled
+ st_type:
+ hidden: false
+ immutable: false
+ type: string
+ description: service type
+ Internal2_forwarding_mode:
+ hidden: false
+ immutable: false
+ type: string
+ st_service_interface_type_list:
+ hidden: false
+ immutable: false
+ type: string
+ description: List of interface types
+ st_mode:
+ hidden: false
+ immutable: false
+ type: string
+ description: service mode
+ Cricket_OCS_protected_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of Cricket OCS network
+ oam_mgmt_net_0_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of OAM network
+ start_dst_ports:
+ hidden: false
+ immutable: false
+ type: float
+ description: Start of dst port
+ st_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor
+ availability_zone_1:
+ hidden: false
+ immutable: false
+ type: string
+ description: availability zone
+ Internal2_shared:
+ hidden: false
+ immutable: false
+ type: string
+ service_instance_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Service instance name
+ st_scaling:
+ hidden: false
+ immutable: false
+ type: string
+ description: Indicates whether service scaling is enabled
+ max_num_fw_instances:
+ hidden: false
+ immutable: false
+ type: float
+ description: maximum number of firewall instances for scaling
+ Internal1_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ start_src_ports:
+ hidden: false
+ immutable: false
+ type: float
+ description: Start of src port
+ service_policy_direction:
+ hidden: false
+ immutable: false
+ type: string
+ description: Direction of Policy
+ st_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of service template
+ Internal2_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ hsl_direct_net3:
+ hidden: false
+ immutable: false
+ type: string
+ hsl_direct_net4:
+ hidden: false
+ immutable: false
+ type: string
+ HSL_direct_net_gateway:
+ hidden: false
+ immutable: false
+ type: string
+ description: HSL (Logging) network gateway address
+ hsl_direct_net1:
+ hidden: false
+ immutable: false
+ type: string
+ hsl_direct_net2:
+ hidden: false
+ immutable: false
+ type: string
+ st_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of the image
+ st_shared_ip_list:
+ hidden: false
+ immutable: false
+ type: string
+ description: List of shared ip enabled-disabled
+ Cricket_OCS_direct_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of Cricket OCS network
+ Internal1_forwarding_mode:
+ hidden: false
+ immutable: false
+ type: string
+ end_src_ports:
+ hidden: false
+ immutable: false
+ type: float
+ description: End of src port
+ end_dst_ports:
+ hidden: false
+ immutable: false
+ type: float
+ description: End of dst port
+ HSL_direct_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of HSL (Logging) network
+ HSL_direct_net_cidr:
+ hidden: false
+ immutable: false
+ type: string
+ description: HSL (Logging) network address (CIDR notation)
+ node_templates:
+ Internal2-net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ shared:
+ get_input: Internal1_shared
+ forwarding_mode:
+ get_input: Internal1_forwarding_mode
+ network_name:
+ get_input: Internal2_net_name
+ Internal1-net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ shared:
+ get_input: Internal1_shared
+ forwarding_mode:
+ get_input: Internal1_forwarding_mode
+ network_name:
+ get_input: Internal1_net_name
+ Internal3-net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ shared:
+ get_input: Internal1_shared
+ forwarding_mode:
+ get_input: Internal1_forwarding_mode
+ network_name:
+ get_input: Internal2_net_name
+ hsl_direct_net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ network_name:
+ get_input: HSL_direct_net_id
+ subnets:
+ hsl_ip_subnet:
+ cidr:
+ get_input: HSL_direct_net_cidr
+ gateway_ip:
+ get_input: HSL_direct_net_gateway
+ service_instance:
+ type: org.openecomp.resource.abstract.nodes.heat.service_template
+ directives:
+ - substitutable
+ properties:
+ flavor:
+ get_input: st_flavor
+ availability_zone:
+ get_input: availability_zone_1
+ image_name:
+ get_input: st_image
+ service_template_filter:
+ substitute_service_template: service_instanceServiceTemplate.yaml
+ count:
+ get_input: max_num_fw_instances
+ scaling_enabled:
+ get_input: st_scaling
+ mandatory: false
+ service_type:
+ get_input: st_type
+ static_routes_list:
+ - token:
+ - get_input: st_static_routes_list
+ - ','
+ - 0
+ - token:
+ - get_input: st_static_routes_list
+ - ','
+ - 1
+ - token:
+ - get_input: st_static_routes_list
+ - ','
+ - 2
+ - token:
+ - get_input: st_static_routes_list
+ - ','
+ - 3
+ - token:
+ - get_input: st_static_routes_list
+ - ','
+ - 4
+ service_template_name:
+ get_input: st_name
+ service_interface_type_list:
+ - token:
+ - get_input: st_service_interface_type_list
+ - ','
+ - 0
+ - token:
+ - get_input: st_service_interface_type_list
+ - ','
+ - 1
+ - token:
+ - get_input: st_service_interface_type_list
+ - ','
+ - 2
+ - token:
+ - get_input: st_service_interface_type_list
+ - ','
+ - 3
+ - token:
+ - get_input: st_service_interface_type_list
+ - ','
+ - 4
+ interface_list:
+ - virtual_network:
+ get_input: hsl_direct_net1
+ - virtual_network:
+ get_input: hsl_direct_net2
+ - virtual_network:
+ get_input: hsl_direct_net3
+ - virtual_network:
+ get_input: hsl_direct_net4
+ - virtual_network: hsl_direct_net
+ service_instance_name:
+ get_input: service_instance_name
+ service_mode:
+ get_input: st_mode
+ shared_ip_list:
+ - token:
+ - get_input: st_shared_ip_list
+ - ','
+ - 0
+ - token:
+ - get_input: st_shared_ip_list
+ - ','
+ - 1
+ - token:
+ - get_input: st_shared_ip_list
+ - ','
+ - 2
+ - token:
+ - get_input: st_shared_ip_list
+ - ','
+ - 3
+ - token:
+ - get_input: st_shared_ip_list
+ - ','
+ - 4
+ requirements:
+ - link_port_0:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal1-net
+ relationship: tosca.relationships.network.LinksTo
+ - link_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal2-net
+ relationship: tosca.relationships.network.LinksTo
+ - link_port_2:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal3-net
+ relationship: tosca.relationships.network.LinksTo
+ - link_port_4:
+ capability: tosca.capabilities.network.Linkable
+ node: hsl_direct_net
+ relationship: tosca.relationships.network.LinksTo
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: hsl_direct_net
+ relationship: tosca.relationships.DependsOn
+ service_policy:
+ type: org.openecomp.resource.vfc.rules.nodes.heat.network.contrail.NetworkRules
+ properties:
+ entries:
+ policy_rule:
+ - src_ports:
+ - start_port:
+ get_input: start_src_ports
+ end_port:
+ get_input: end_src_ports
+ protocol: any
+ action_list:
+ apply_service:
+ - service_instance
+ dst_addresses:
+ - virtual_network:
+ get_input: Cricket_OCS_direct_net_id
+ dst_ports:
+ - start_port:
+ get_input: start_dst_ports
+ end_port:
+ get_input: end_dst_ports
+ src_addresses:
+ - virtual_network:
+ get_input: Cricket_OCS_protected_net_id
+ direction:
+ get_input: service_policy_direction
+ name:
+ get_input: service_policy_name
+ requirements:
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: service_instance
+ relationship: tosca.relationships.DependsOn
+ groups:
+ OCS-fw:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/OCS-fw.yml
+ description: |
+ Based on the following reference for the HOT-DMZ-FW template: Version 3.5 8-10-2015 (Authors: Art Mishurov,am254u & Johhny Chen, jc3066) - HOT-DMZ-FW template that creates two DMZ networks (direct and protected) with a scaled out firewall service between the two.
+ members:
+ - hsl_direct_net
+ - service_instance
+ - service_policy
+ network_base:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/network_base.yml
+ description: ASC External Networks Template
+ members:
+ - Internal2-net
+ - Internal1-net
+ - Internal3-net \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/expectedoutputfiles/service_instanceServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/expectedoutputfiles/service_instanceServiceTemplate.yaml
new file mode 100644
index 0000000000..1933f88f6c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/expectedoutputfiles/service_instanceServiceTemplate.yaml
@@ -0,0 +1,451 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: service_instance
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ availability_zone:
+ hidden: false
+ immutable: false
+ type: string
+ description: Availability zone to create servers in
+ required: false
+ status: SUPPORTED
+ static_routes_list:
+ hidden: false
+ immutable: false
+ type: list
+ description: Static routes enabled
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: boolean
+ availability_zone_enable:
+ hidden: false
+ immutable: false
+ type: boolean
+ description: Indicates availability zone is enabled
+ required: false
+ default: false
+ status: SUPPORTED
+ service_template_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Service template name
+ required: false
+ status: SUPPORTED
+ ordered_interfaces:
+ hidden: false
+ immutable: false
+ type: boolean
+ description: Indicates if service interface are ordered
+ required: false
+ default: false
+ status: SUPPORTED
+ flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: flavor
+ required: false
+ status: SUPPORTED
+ image_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image name
+ required: true
+ status: SUPPORTED
+ service_type:
+ hidden: false
+ immutable: false
+ type: string
+ description: Service type
+ required: true
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - firewall
+ - analyzer
+ - source-nat
+ - loadbalancer
+ service_interface_type_list:
+ hidden: false
+ immutable: false
+ type: list
+ description: List of interface types
+ required: true
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ constraints:
+ - valid_values:
+ - management
+ - left
+ - right
+ - other
+ service_instance_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Service instance name
+ required: true
+ status: SUPPORTED
+ interface_list:
+ hidden: false
+ immutable: false
+ type: list
+ description: List of interfaces
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.contrail.InterfaceData
+ service_mode:
+ hidden: false
+ immutable: false
+ type: string
+ description: Service mode
+ required: true
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - transparent
+ - in-network
+ - in-network-nat
+ shared_ip_list:
+ hidden: false
+ immutable: false
+ type: list
+ description: Shared ips enabled
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: boolean
+ node_templates:
+ port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port
+ properties:
+ static_routes:
+ get_input:
+ - interface_list
+ - 0
+ - static_routes
+ virtual_network:
+ get_input:
+ - interface_list
+ - 0
+ - virtual_network
+ static_route:
+ get_input:
+ - static_routes_list
+ - 0
+ allowed_address_pairs:
+ get_input:
+ - interface_list
+ - 0
+ - allowed_address_pairs
+ shared_ip:
+ get_input:
+ - shared_ip_list
+ - 0
+ ip_address:
+ get_input:
+ - interface_list
+ - 0
+ - ip_address
+ interface_type:
+ get_input:
+ - service_interface_type_list
+ - 0
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: service_instance
+ relationship: tosca.relationships.network.BindsTo
+ port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port
+ properties:
+ static_routes:
+ get_input:
+ - interface_list
+ - 1
+ - static_routes
+ virtual_network:
+ get_input:
+ - interface_list
+ - 1
+ - virtual_network
+ static_route:
+ get_input:
+ - static_routes_list
+ - 1
+ allowed_address_pairs:
+ get_input:
+ - interface_list
+ - 1
+ - allowed_address_pairs
+ shared_ip:
+ get_input:
+ - shared_ip_list
+ - 1
+ ip_address:
+ get_input:
+ - interface_list
+ - 1
+ - ip_address
+ interface_type:
+ get_input:
+ - service_interface_type_list
+ - 1
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: service_instance
+ relationship: tosca.relationships.network.BindsTo
+ port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port
+ properties:
+ static_routes:
+ get_input:
+ - interface_list
+ - 2
+ - static_routes
+ virtual_network:
+ get_input:
+ - interface_list
+ - 2
+ - virtual_network
+ static_route:
+ get_input:
+ - static_routes_list
+ - 2
+ allowed_address_pairs:
+ get_input:
+ - interface_list
+ - 2
+ - allowed_address_pairs
+ shared_ip:
+ get_input:
+ - shared_ip_list
+ - 2
+ ip_address:
+ get_input:
+ - interface_list
+ - 2
+ - ip_address
+ interface_type:
+ get_input:
+ - service_interface_type_list
+ - 2
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: service_instance
+ relationship: tosca.relationships.network.BindsTo
+ port_3:
+ type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port
+ properties:
+ static_routes:
+ get_input:
+ - interface_list
+ - 3
+ - static_routes
+ virtual_network:
+ get_input:
+ - interface_list
+ - 3
+ - virtual_network
+ static_route:
+ get_input:
+ - static_routes_list
+ - 3
+ allowed_address_pairs:
+ get_input:
+ - interface_list
+ - 3
+ - allowed_address_pairs
+ shared_ip:
+ get_input:
+ - shared_ip_list
+ - 3
+ ip_address:
+ get_input:
+ - interface_list
+ - 3
+ - ip_address
+ interface_type:
+ get_input:
+ - service_interface_type_list
+ - 3
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: service_instance
+ relationship: tosca.relationships.network.BindsTo
+ port_4:
+ type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port
+ properties:
+ static_routes:
+ get_input:
+ - interface_list
+ - 4
+ - static_routes
+ virtual_network:
+ get_input:
+ - interface_list
+ - 4
+ - virtual_network
+ static_route:
+ get_input:
+ - static_routes_list
+ - 4
+ allowed_address_pairs:
+ get_input:
+ - interface_list
+ - 4
+ - allowed_address_pairs
+ shared_ip:
+ get_input:
+ - shared_ip_list
+ - 4
+ ip_address:
+ get_input:
+ - interface_list
+ - 4
+ - ip_address
+ interface_type:
+ get_input:
+ - service_interface_type_list
+ - 4
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: service_instance
+ relationship: tosca.relationships.network.BindsTo
+ service_instance:
+ type: org.openecomp.resource.vfc.nodes.heat.compute_service_template
+ properties:
+ flavor:
+ get_input: flavor
+ image_name:
+ get_input: image_name
+ availability_zone:
+ get_input: availability_zone
+ service_type:
+ get_input: service_type
+ availability_zone_enable:
+ get_input: availability_zone_enable
+ service_template_name:
+ get_input: service_template_name
+ service_instance_name:
+ get_input: service_instance_name
+ service_mode:
+ get_input: service_mode
+ groups:
+ service_instance:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/OCS-fw.yml
+ members:
+ - service_instance
+ - port_0
+ - port_1
+ - port_2
+ - port_3
+ - port_4
+ outputs:
+ tenant_id:
+ description: Tenant id of the Service Instance
+ value:
+ get_attribute:
+ - service_instance
+ - tenant_id
+ fq_name:
+ description: The FQ name of the service instance
+ value:
+ get_attribute:
+ - service_instance
+ - fq_name
+ service_template_name:
+ description: Service Template of the Service Instance
+ value:
+ get_attribute:
+ - service_instance
+ - service_template_name
+ show:
+ description: All attributes
+ value:
+ get_attribute:
+ - service_instance
+ - show
+ active_vms:
+ description: Number of service VMs active for this Service Instance
+ value:
+ get_attribute:
+ - service_instance
+ - active_vms
+ service_instance_name:
+ description: The name of the service instance
+ value:
+ get_attribute:
+ - service_instance
+ - service_instance_name
+ virtual_machines:
+ description: Service VMs for the Service Instance
+ value:
+ get_attribute:
+ - service_instance
+ - virtual_machines
+ status:
+ description: Status of the service instance
+ value:
+ get_attribute:
+ - service_instance
+ - status
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.service_template
+ requirements:
+ link_port_0:
+ - port_0
+ - link
+ link_port_1:
+ - port_1
+ - link
+ link_port_2:
+ - port_2
+ - link
+ link_port_3:
+ - port_3
+ - link
+ link_port_4:
+ - port_4
+ - link \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..b7969ccd71
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/inputfiles/MANIFEST.json
@@ -0,0 +1,17 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "OCS-fw.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ },
+ {
+ "file": "network_base.yml",
+ "type": "HEAT",
+ "isBase": "true"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/inputfiles/OCS-fw.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/inputfiles/OCS-fw.yml
new file mode 100644
index 0000000000..dd578c2d8b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/inputfiles/OCS-fw.yml
@@ -0,0 +1,173 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Based on the following reference for the HOT-DMZ-FW template:
+ Version 3.5 8-10-2015 (Authors: Art Mishurov,am254u & Johhny Chen, jc3066) - HOT-DMZ-FW template that creates two DMZ networks (direct and protected) with a scaled out firewall service between the two.
+
+parameters:
+ hsl_direct_net1:
+ type: string
+ hsl_direct_net2:
+ type: string
+ hsl_direct_net3:
+ type: string
+ hsl_direct_net4:
+ type: string
+ HSL_direct_net_id:
+ type: string
+ description: Name of HSL (Logging) network
+ HSL_direct_net_cidr:
+ type: string
+ description: HSL (Logging) network address (CIDR notation)
+ HSL_direct_net_gateway:
+ type: string
+ description: HSL (Logging) network gateway address
+ oam_mgmt_net_0_id:
+ type: string
+ description: Name of OAM network
+ Cricket_OCS_direct_net_id:
+ type: string
+ description: Name of Cricket OCS network
+ Cricket_OCS_protected_net_id:
+ type: string
+ description: Name of Cricket OCS network
+ service_instance_name:
+ type: string
+ description: Service instance name
+ service_policy_name:
+ type: string
+ description: Policy Name
+ service_policy_direction:
+ type: string
+ description: Direction of Policy
+ start_src_ports:
+ type: number
+ description: Start of src port
+ end_src_ports:
+ type: number
+ description: End of src port
+ start_dst_ports:
+ type: number
+ description: Start of dst port
+ end_dst_ports:
+ type: number
+ description: End of dst port
+ st_name:
+ type: string
+ description: Name of service template
+ st_mode:
+ type: string
+ description: service mode
+ st_type:
+ type: string
+ description: service type
+ st_image:
+ type: string
+ description: Name of the image
+ st_flavor:
+ type: string
+ description: Flavor
+ st_service_interface_type_list:
+ type: string
+ description: List of interface types
+ st_shared_ip_list:
+ type: string
+ description: List of shared ip enabled-disabled
+ st_static_routes_list:
+ type: string
+ description: List of static routes enabled-disabled
+ st_scaling:
+ type: string
+ description: Indicates whether service scaling is enabled
+ max_num_fw_instances:
+ type: number
+ description: maximum number of firewall instances for scaling
+ availability_zone_1:
+ type: string
+ description: availability zone
+
+resources:
+
+ hsl_direct_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: HSL_direct_net_id }
+
+ hsl_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: hsl_direct_net }
+ cidr: { get_param: HSL_direct_net_cidr }
+ gateway_ip: { get_param: HSL_direct_net_gateway }
+
+ service_template:
+ type: OS::Contrail::ServiceTemplate
+ properties:
+ name: { get_param: st_name }
+ service_mode: { get_param: st_mode }
+ service_type: { get_param: st_type }
+ image_name: { get_param: st_image }
+ flavor: { get_param: st_flavor }
+ service_interface_type_list: { "Fn::Split" : [ ",", Ref: st_service_interface_type_list ] }
+ shared_ip_list: { "Fn::Split" : [ ",", Ref: st_shared_ip_list ] }
+ static_routes_list: { "Fn::Split" : [ ",", Ref: st_static_routes_list ] }
+ service_scaling: { get_param: st_scaling }
+
+ service_instance:
+ type: OS::Contrail::ServiceInstance
+ depends_on: [ hsl_ip_subnet]
+ properties:
+ name: { get_param: service_instance_name }
+ availability_zone: { get_param: availability_zone_1 }
+ service_template: { get_resource: service_template }
+ scale_out:
+ max_instances: {get_param: max_num_fw_instances}
+ interface_list: [
+ {
+ virtual_network: { get_param: hsl_direct_net1 }
+ },
+ {
+ virtual_network: { get_param: hsl_direct_net2 }
+ },
+ {
+ virtual_network: { get_param: hsl_direct_net3 }
+ },
+ {
+ virtual_network: { get_param: hsl_direct_net4 }
+ },
+ {
+ virtual_network: { get_resource: hsl_direct_net }
+ }
+ ]
+
+ service_policy:
+ type: OS::Contrail::NetworkPolicy
+ depends_on: [ service_instance ]
+ properties:
+ name: { get_param: service_policy_name }
+ entries:
+ policy_rule: [
+ {
+ "direction": { get_param: service_policy_direction },
+ "protocol": "any",
+ "src_ports": [{"start_port": {get_param: start_src_ports}, "end_port": {get_param: end_src_ports}}],
+ "dst_ports": [{"start_port": {get_param: start_dst_ports}, "end_port": {get_param: end_dst_ports}}],
+ "dst_addresses": [{ "virtual_network": { get_param: Cricket_OCS_direct_net_id }}],
+ "action_list": { "apply_service": [{ get_resource: service_instance }]},
+ "src_addresses": [{ "virtual_network": { get_param: Cricket_OCS_protected_net_id }}],
+ },
+ ]
+
+ service_policy_attach_direct_net:
+ type: OS::Contrail::AttachPolicy
+ depends_on: [ service_policy ]
+ properties:
+ network: { get_param: Cricket_OCS_direct_net_id }
+ policy: { get_attr: [service_policy, fq_name] }
+
+ service_policy_attach_protected_net:
+ type: OS::Contrail::AttachPolicy
+ depends_on: [ service_policy ]
+ properties:
+ network: { get_param: Cricket_OCS_protected_net_id }
+ policy: { get_attr: [service_policy, fq_name] } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/inputfiles/network_base.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/inputfiles/network_base.yml
new file mode 100644
index 0000000000..21fef30282
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/inputfiles/network_base.yml
@@ -0,0 +1,47 @@
+heat_template_version: 2013-05-23
+
+description: ASC External Networks Template
+
+parameters:
+ Internal1_net_name:
+ type: string
+ Internal2_net_name:
+ type: string
+ Internal1_forwarding_mode:
+ type: string
+ Internal2_forwarding_mode:
+ type: string
+ Internal1_shared:
+ type: string
+ Internal2_shared:
+ type: string
+
+resources:
+ Internal1-net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: Internal1_net_name }
+ forwarding_mode: { get_param: Internal1_forwarding_mode }
+ shared: { get_param: Internal1_shared }
+
+ Internal2-net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: Internal2_net_name }
+ forwarding_mode: { get_param: Internal1_forwarding_mode }
+ shared: { get_param: Internal1_shared }
+
+ Internal3-net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: Internal2_net_name }
+ forwarding_mode: { get_param: Internal1_forwarding_mode }
+ shared: { get_param: Internal1_shared }
+
+outputs:
+ hsl_direct_net1:
+ value: { list_join: [':', { get_attr: [ Internal1-net, fq_name ] } ] }
+ hsl_direct_net2:
+ value: { get_attr: [ Internal2-net, fq_name ] }
+ hsl_direct_net3:
+ value: {get_resource: Internal3-net} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..a11b54226b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
@@ -0,0 +1,154 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: GlobalSubstitutionTypes
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.st_image:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.contrail.Compute
+ org.openecomp.resource.abstract.nodes.heat.service_template:
+ derived_from: org.openecomp.resource.abstract.nodes.contrail.AbstractSubstitute
+ requirements:
+ - link_port_0:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ org.openecomp.resource.abstract.nodes.heat.OCS-fw:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ service_policy_name:
+ type: string
+ description: Policy Name
+ st_static_routes_list:
+ type: string
+ description: List of static routes enabled-disabled
+ st_type:
+ type: string
+ description: service type
+ st_service_interface_type_list:
+ type: string
+ description: List of interface types
+ st_mode:
+ type: string
+ description: service mode
+ Cricket_OCS_protected_net_id:
+ type: string
+ description: Name of Cricket OCS network
+ oam_mgmt_net_0_id:
+ type: string
+ description: Name of OAM network
+ start_dst_ports:
+ type: float
+ description: Start of dst port
+ st_flavor:
+ type: string
+ description: Flavor
+ availability_zone_1:
+ type: string
+ description: availability zone
+ service_instance_name:
+ type: string
+ description: Service instance name
+ st_scaling:
+ type: string
+ description: Indicates whether service scaling is enabled
+ max_num_fw_instances:
+ type: float
+ description: maximum number of firewall instances for scaling
+ start_src_ports:
+ type: float
+ description: Start of src port
+ service_policy_direction:
+ type: string
+ description: Direction of Policy
+ st_name:
+ type: string
+ description: Name of service template
+ hsl_direct_net3:
+ type: string
+ hsl_direct_net4:
+ type: string
+ HSL_direct_net_gateway:
+ type: string
+ description: HSL (Logging) network gateway address
+ hsl_direct_net1:
+ type: string
+ hsl_direct_net2:
+ type: string
+ st_image:
+ type: string
+ description: Name of the image
+ st_shared_ip_list:
+ type: string
+ description: List of shared ip enabled-disabled
+ Cricket_OCS_direct_net_id:
+ type: string
+ description: Name of Cricket OCS network
+ network_param:
+ type: string
+ end_src_ports:
+ type: float
+ description: End of src port
+ end_dst_ports:
+ type: float
+ description: End of dst port
+ HSL_direct_net_id:
+ type: string
+ description: Name of HSL (Logging) network
+ HSL_direct_net_cidr:
+ type: string
+ description: HSL (Logging) network address (CIDR notation)
+ requirements:
+ - link_port_0_service_instance:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - network_service_policy:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.network.Network
+ relationship: org.openecomp.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ capabilities:
+ link_hsl_direct_net:
+ type: tosca.capabilities.network.Linkable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_hsl_direct_net:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..53ecba9888
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,90 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ Internal1_shared:
+ hidden: false
+ immutable: false
+ type: string
+ Internal1_forwarding_mode:
+ hidden: false
+ immutable: false
+ type: string
+ Internal2_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ Internal2_forwarding_mode:
+ hidden: false
+ immutable: false
+ type: string
+ Internal2_shared:
+ hidden: false
+ immutable: false
+ type: string
+ Internal1_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ node_templates:
+ Internal1-net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ shared:
+ get_input: Internal1_shared
+ forwarding_mode:
+ get_input: Internal1_forwarding_mode
+ network_name:
+ get_input: Internal1_net_name
+ test_nested:
+ type: org.openecomp.resource.abstract.nodes.heat.OCS-fw
+ directives:
+ - substitutable
+ properties:
+ service_template_filter:
+ substitute_service_template: OCS-fwServiceTemplate.yaml
+ network_param: Internal1-net
+ requirements:
+ - link_port_0:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal1-net
+ relationship: tosca.relationships.network.LinksTo
+ groups:
+ main:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/main.yml
+ description: ASC External Networks Template
+ members:
+ - Internal1-net
+ - test_nested \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/expectedoutputfiles/OCS-fwServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/expectedoutputfiles/OCS-fwServiceTemplate.yaml
new file mode 100644
index 0000000000..1f504169ab
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/expectedoutputfiles/OCS-fwServiceTemplate.yaml
@@ -0,0 +1,294 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: OCS-fw
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ service_policy_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Policy Name
+ st_static_routes_list:
+ hidden: false
+ immutable: false
+ type: string
+ description: List of static routes enabled-disabled
+ st_type:
+ hidden: false
+ immutable: false
+ type: string
+ description: service type
+ st_service_interface_type_list:
+ hidden: false
+ immutable: false
+ type: string
+ description: List of interface types
+ st_mode:
+ hidden: false
+ immutable: false
+ type: string
+ description: service mode
+ Cricket_OCS_protected_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of Cricket OCS network
+ oam_mgmt_net_0_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of OAM network
+ start_dst_ports:
+ hidden: false
+ immutable: false
+ type: float
+ description: Start of dst port
+ st_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor
+ availability_zone_1:
+ hidden: false
+ immutable: false
+ type: string
+ description: availability zone
+ service_instance_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Service instance name
+ st_scaling:
+ hidden: false
+ immutable: false
+ type: string
+ description: Indicates whether service scaling is enabled
+ max_num_fw_instances:
+ hidden: false
+ immutable: false
+ type: float
+ description: maximum number of firewall instances for scaling
+ start_src_ports:
+ hidden: false
+ immutable: false
+ type: float
+ description: Start of src port
+ service_policy_direction:
+ hidden: false
+ immutable: false
+ type: string
+ description: Direction of Policy
+ st_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of service template
+ hsl_direct_net3:
+ hidden: false
+ immutable: false
+ type: string
+ hsl_direct_net4:
+ hidden: false
+ immutable: false
+ type: string
+ HSL_direct_net_gateway:
+ hidden: false
+ immutable: false
+ type: string
+ description: HSL (Logging) network gateway address
+ hsl_direct_net1:
+ hidden: false
+ immutable: false
+ type: string
+ hsl_direct_net2:
+ hidden: false
+ immutable: false
+ type: string
+ st_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of the image
+ st_shared_ip_list:
+ hidden: false
+ immutable: false
+ type: string
+ description: List of shared ip enabled-disabled
+ Cricket_OCS_direct_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of Cricket OCS network
+ network_param:
+ hidden: false
+ immutable: false
+ type: string
+ end_src_ports:
+ hidden: false
+ immutable: false
+ type: float
+ description: End of src port
+ end_dst_ports:
+ hidden: false
+ immutable: false
+ type: float
+ description: End of dst port
+ HSL_direct_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of HSL (Logging) network
+ HSL_direct_net_cidr:
+ hidden: false
+ immutable: false
+ type: string
+ description: HSL (Logging) network address (CIDR notation)
+ node_templates:
+ hsl_direct_net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ network_name:
+ get_input: HSL_direct_net_id
+ subnets:
+ hsl_ip_subnet:
+ cidr:
+ get_input: HSL_direct_net_cidr
+ gateway_ip:
+ get_input: HSL_direct_net_gateway
+ service_instance:
+ type: org.openecomp.resource.abstract.nodes.heat.service_template
+ directives:
+ - substitutable
+ properties:
+ flavor:
+ get_input: st_flavor
+ availability_zone:
+ get_input: availability_zone_1
+ image_name:
+ get_input: st_image
+ service_template_filter:
+ substitute_service_template: service_instanceServiceTemplate.yaml
+ count:
+ get_input: max_num_fw_instances
+ mandatory: false
+ service_type:
+ get_input: st_type
+ static_routes_list:
+ - token:
+ - get_input: st_static_routes_list
+ - ','
+ - 0
+ service_template_name:
+ get_input: st_name
+ service_interface_type_list:
+ - token:
+ - get_input: st_service_interface_type_list
+ - ','
+ - 0
+ interface_list:
+ - virtual_network:
+ get_input: network_param
+ service_instance_name:
+ get_input: service_instance_name
+ service_mode:
+ get_input: st_mode
+ shared_ip_list:
+ - token:
+ - get_input: st_shared_ip_list
+ - ','
+ - 0
+ requirements:
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: hsl_direct_net
+ relationship: tosca.relationships.DependsOn
+ service_policy:
+ type: org.openecomp.resource.vfc.rules.nodes.heat.network.contrail.NetworkRules
+ properties:
+ entries:
+ policy_rule:
+ - src_ports:
+ - start_port:
+ get_input: start_src_ports
+ end_port:
+ get_input: end_src_ports
+ protocol: any
+ action_list:
+ apply_service:
+ - service_instance
+ dst_addresses:
+ - virtual_network:
+ get_input: Cricket_OCS_direct_net_id
+ dst_ports:
+ - start_port:
+ get_input: start_dst_ports
+ end_port:
+ get_input: end_dst_ports
+ src_addresses:
+ - virtual_network:
+ get_input: Cricket_OCS_protected_net_id
+ direction:
+ get_input: service_policy_direction
+ name:
+ get_input: service_policy_name
+ requirements:
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: service_instance
+ relationship: tosca.relationships.DependsOn
+ groups:
+ OCS-fw:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/OCS-fw.yml
+ description: |
+ Based on the following reference for the HOT-DMZ-FW template: Version 3.5 8-10-2015 (Authors: Art Mishurov,am254u & Johhny Chen, jc3066) - HOT-DMZ-FW template that creates two DMZ networks (direct and protected) with a scaled out firewall service between the two.
+ members:
+ - hsl_direct_net
+ - service_instance
+ - service_policy
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.OCS-fw
+ capabilities:
+ link_hsl_direct_net:
+ - hsl_direct_net
+ - link
+ attachment_hsl_direct_net:
+ - hsl_direct_net
+ - attachment
+ requirements:
+ network_service_policy:
+ - service_policy
+ - network
+ link_port_0_service_instance:
+ - service_instance
+ - link_port_0 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/expectedoutputfiles/service_instanceServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/expectedoutputfiles/service_instanceServiceTemplate.yaml
new file mode 100644
index 0000000000..bbc95728c9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/expectedoutputfiles/service_instanceServiceTemplate.yaml
@@ -0,0 +1,275 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: service_instance
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ availability_zone:
+ hidden: false
+ immutable: false
+ type: string
+ description: Availability zone to create servers in
+ required: false
+ status: SUPPORTED
+ static_routes_list:
+ hidden: false
+ immutable: false
+ type: list
+ description: Static routes enabled
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: boolean
+ availability_zone_enable:
+ hidden: false
+ immutable: false
+ type: boolean
+ description: Indicates availability zone is enabled
+ required: false
+ default: false
+ status: SUPPORTED
+ service_template_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Service template name
+ required: false
+ status: SUPPORTED
+ ordered_interfaces:
+ hidden: false
+ immutable: false
+ type: boolean
+ description: Indicates if service interface are ordered
+ required: false
+ default: false
+ status: SUPPORTED
+ flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: flavor
+ required: false
+ status: SUPPORTED
+ image_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image name
+ required: true
+ status: SUPPORTED
+ service_type:
+ hidden: false
+ immutable: false
+ type: string
+ description: Service type
+ required: true
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - firewall
+ - analyzer
+ - source-nat
+ - loadbalancer
+ service_interface_type_list:
+ hidden: false
+ immutable: false
+ type: list
+ description: List of interface types
+ required: true
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ constraints:
+ - valid_values:
+ - management
+ - left
+ - right
+ - other
+ service_instance_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Service instance name
+ required: true
+ status: SUPPORTED
+ interface_list:
+ hidden: false
+ immutable: false
+ type: list
+ description: List of interfaces
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.contrail.InterfaceData
+ service_mode:
+ hidden: false
+ immutable: false
+ type: string
+ description: Service mode
+ required: true
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - transparent
+ - in-network
+ - in-network-nat
+ shared_ip_list:
+ hidden: false
+ immutable: false
+ type: list
+ description: Shared ips enabled
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: boolean
+ node_templates:
+ port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port
+ properties:
+ static_routes:
+ get_input:
+ - interface_list
+ - 0
+ - static_routes
+ virtual_network:
+ get_input:
+ - interface_list
+ - 0
+ - virtual_network
+ static_route:
+ get_input:
+ - static_routes_list
+ - 0
+ allowed_address_pairs:
+ get_input:
+ - interface_list
+ - 0
+ - allowed_address_pairs
+ shared_ip:
+ get_input:
+ - shared_ip_list
+ - 0
+ ip_address:
+ get_input:
+ - interface_list
+ - 0
+ - ip_address
+ interface_type:
+ get_input:
+ - service_interface_type_list
+ - 0
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: service_instance
+ relationship: tosca.relationships.network.BindsTo
+ service_instance:
+ type: org.openecomp.resource.vfc.nodes.heat.st_image
+ properties:
+ flavor:
+ get_input: flavor
+ image_name:
+ get_input: image_name
+ availability_zone:
+ get_input: availability_zone
+ service_type:
+ get_input: service_type
+ availability_zone_enable:
+ get_input: availability_zone_enable
+ service_template_name:
+ get_input: service_template_name
+ service_instance_name:
+ get_input: service_instance_name
+ service_mode:
+ get_input: service_mode
+ groups:
+ service_instance:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/OCS-fw.yml
+ members:
+ - service_instance
+ - port_0
+ outputs:
+ tenant_id:
+ description: Tenant id of the Service Instance
+ value:
+ get_attribute:
+ - service_instance
+ - tenant_id
+ fq_name:
+ description: The FQ name of the service instance
+ value:
+ get_attribute:
+ - service_instance
+ - fq_name
+ service_template_name:
+ description: Service Template of the Service Instance
+ value:
+ get_attribute:
+ - service_instance
+ - service_template_name
+ show:
+ description: All attributes
+ value:
+ get_attribute:
+ - service_instance
+ - show
+ active_vms:
+ description: Number of service VMs active for this Service Instance
+ value:
+ get_attribute:
+ - service_instance
+ - active_vms
+ service_instance_name:
+ description: The name of the service instance
+ value:
+ get_attribute:
+ - service_instance
+ - service_instance_name
+ virtual_machines:
+ description: Service VMs for the Service Instance
+ value:
+ get_attribute:
+ - service_instance
+ - virtual_machines
+ status:
+ description: Status of the service instance
+ value:
+ get_attribute:
+ - service_instance
+ - status
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.service_template
+ requirements:
+ link_port_0:
+ - port_0
+ - link \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..ba27604c3f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/inputfiles/MANIFEST.json
@@ -0,0 +1,16 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "OCS-fw.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ },
+ {
+ "file": "main.yml",
+ "type": "HEAT"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/inputfiles/OCS-fw.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/inputfiles/OCS-fw.yml
new file mode 100644
index 0000000000..86c3fcadc8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/inputfiles/OCS-fw.yml
@@ -0,0 +1,163 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Based on the following reference for the HOT-DMZ-FW template:
+ Version 3.5 8-10-2015 (Authors: Art Mishurov,am254u & Johhny Chen, jc3066) - HOT-DMZ-FW template that creates two DMZ networks (direct and protected) with a scaled out firewall service between the two.
+
+parameters:
+ hsl_direct_net1:
+ type: string
+ hsl_direct_net2:
+ type: string
+ hsl_direct_net3:
+ type: string
+ hsl_direct_net4:
+ type: string
+ HSL_direct_net_id:
+ type: string
+ description: Name of HSL (Logging) network
+ HSL_direct_net_cidr:
+ type: string
+ description: HSL (Logging) network address (CIDR notation)
+ HSL_direct_net_gateway:
+ type: string
+ description: HSL (Logging) network gateway address
+ oam_mgmt_net_0_id:
+ type: string
+ description: Name of OAM network
+ Cricket_OCS_direct_net_id:
+ type: string
+ description: Name of Cricket OCS network
+ Cricket_OCS_protected_net_id:
+ type: string
+ description: Name of Cricket OCS network
+ service_instance_name:
+ type: string
+ description: Service instance name
+ service_policy_name:
+ type: string
+ description: Policy Name
+ service_policy_direction:
+ type: string
+ description: Direction of Policy
+ start_src_ports:
+ type: number
+ description: Start of src port
+ end_src_ports:
+ type: number
+ description: End of src port
+ start_dst_ports:
+ type: number
+ description: Start of dst port
+ end_dst_ports:
+ type: number
+ description: End of dst port
+ st_name:
+ type: string
+ description: Name of service template
+ st_mode:
+ type: string
+ description: service mode
+ st_type:
+ type: string
+ description: service type
+ st_image:
+ type: string
+ description: Name of the image
+ st_flavor:
+ type: string
+ description: Flavor
+ st_service_interface_type_list:
+ type: string
+ description: List of interface types
+ st_shared_ip_list:
+ type: string
+ description: List of shared ip enabled-disabled
+ st_static_routes_list:
+ type: string
+ description: List of static routes enabled-disabled
+ st_scaling:
+ type: string
+ description: Indicates whether service scaling is enabled
+ max_num_fw_instances:
+ type: number
+ description: maximum number of firewall instances for scaling
+ availability_zone_1:
+ type: string
+ description: availability zone
+ network_param:
+ type: string
+
+resources:
+
+ hsl_direct_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: HSL_direct_net_id }
+
+ hsl_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: hsl_direct_net }
+ cidr: { get_param: HSL_direct_net_cidr }
+ gateway_ip: { get_param: HSL_direct_net_gateway }
+
+ service_template:
+ type: OS::Contrail::ServiceTemplate
+ properties:
+ name: { get_param: st_name }
+ service_mode: { get_param: st_mode }
+ service_type: { get_param: st_type }
+ image_name: { get_param: st_image }
+ flavor: { get_param: st_flavor }
+ service_interface_type_list: { "Fn::Split" : [ ",", Ref: st_service_interface_type_list ] }
+ shared_ip_list: { "Fn::Split" : [ ",", Ref: st_shared_ip_list ] }
+ static_routes_list: { "Fn::Split" : [ ",", Ref: st_static_routes_list ] }
+ service_scaling: { get_param: st_scaling }
+
+ service_instance:
+ type: OS::Contrail::ServiceInstance
+ depends_on: [ hsl_ip_subnet]
+ properties:
+ name: { get_param: service_instance_name }
+ availability_zone: { get_param: availability_zone_1 }
+ service_template: { get_resource: service_template }
+ scale_out:
+ max_instances: {get_param: max_num_fw_instances}
+ interface_list: [
+ {
+ virtual_network: { get_param: network_param }
+ }
+ ]
+
+ service_policy:
+ type: OS::Contrail::NetworkPolicy
+ depends_on: [ service_instance ]
+ properties:
+ name: { get_param: service_policy_name }
+ entries:
+ policy_rule: [
+ {
+ "direction": { get_param: service_policy_direction },
+ "protocol": "any",
+ "src_ports": [{"start_port": {get_param: start_src_ports}, "end_port": {get_param: end_src_ports}}],
+ "dst_ports": [{"start_port": {get_param: start_dst_ports}, "end_port": {get_param: end_dst_ports}}],
+ "dst_addresses": [{ "virtual_network": { get_param: Cricket_OCS_direct_net_id }}],
+ "action_list": { "apply_service": [{ get_resource: service_instance }]},
+ "src_addresses": [{ "virtual_network": { get_param: Cricket_OCS_protected_net_id }}],
+ },
+ ]
+
+ service_policy_attach_direct_net:
+ type: OS::Contrail::AttachPolicy
+ depends_on: [ service_policy ]
+ properties:
+ network: { get_param: Cricket_OCS_direct_net_id }
+ policy: { get_attr: [service_policy, fq_name] }
+
+ service_policy_attach_protected_net:
+ type: OS::Contrail::AttachPolicy
+ depends_on: [ service_policy ]
+ properties:
+ network: { get_param: Cricket_OCS_protected_net_id }
+ policy: { get_attr: [service_policy, fq_name] } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/inputfiles/main.yml
new file mode 100644
index 0000000000..a1f7dc932d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/inputfiles/main.yml
@@ -0,0 +1,30 @@
+heat_template_version: 2013-05-23
+
+description: ASC External Networks Template
+
+parameters:
+ Internal1_net_name:
+ type: string
+ Internal2_net_name:
+ type: string
+ Internal1_forwarding_mode:
+ type: string
+ Internal2_forwarding_mode:
+ type: string
+ Internal1_shared:
+ type: string
+ Internal2_shared:
+ type: string
+
+resources:
+ Internal1-net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: Internal1_net_name }
+ forwarding_mode: { get_param: Internal1_forwarding_mode }
+ shared: { get_param: Internal1_shared }
+
+ test_nested:
+ type: OCS-fw.yml
+ properties:
+ network_param: { get_resource: Internal1-net} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/listNet/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/listNet/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..23c2d851f7
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/listNet/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,265 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ template_PortTuple_LB1:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ lb_st_interface_type_oam:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ oam_sec_group_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ nems_traffic_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ network_ipam_refs_data_ipam_subnets_addr_from_start_true:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ jsa_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ node_templates:
+ jsa_net3:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrailV2.VirtualNetwork
+ properties:
+ network_ipam_refs_data:
+ - network_ipam_refs_data_ipam_subnets:
+ - network_ipam_refs_data_ipam_subnets_subnet:
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len:
+ get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix:
+ get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2
+ network_ipam_refs_data_ipam_subnets_addr_from_start:
+ get_input: network_ipam_refs_data_ipam_subnets_addr_from_start_true
+ network_name: aaa
+ template_VMInt_OAM_lb_5:
+ type: org.openecomp.resource.cp.nodes.heat.contrailV2.VirtualMachineInterface
+ properties:
+ security_group_refs:
+ - get_input: oam_sec_group_name
+ virtual_network_refs: [
+ ]
+ virtual_machine_interface_properties:
+ virtual_machine_interface_properties_service_interface_type:
+ get_input: lb_st_interface_type_oam
+ port_tuple_refs:
+ - get_input: template_PortTuple_LB1
+ jsa_net2:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrailV2.VirtualNetwork
+ properties:
+ network_ipam_refs_data:
+ - network_ipam_refs_data_ipam_subnets:
+ - network_ipam_refs_data_ipam_subnets_subnet:
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len:
+ get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix:
+ get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2
+ network_ipam_refs_data_ipam_subnets_addr_from_start:
+ get_input: network_ipam_refs_data_ipam_subnets_addr_from_start_true
+ network_name: aaa
+ template_VMInt_OAM_lb_6:
+ type: org.openecomp.resource.cp.nodes.heat.contrailV2.VirtualMachineInterface
+ properties:
+ security_group_refs:
+ - get_input: oam_sec_group_name
+ virtual_network_refs:
+ get_attribute:
+ - jsa_net3
+ - fq_name
+ virtual_machine_interface_properties:
+ virtual_machine_interface_properties_service_interface_type:
+ get_input: lb_st_interface_type_oam
+ port_tuple_refs:
+ - get_input: template_PortTuple_LB1
+ template_VMInt_OAM_lb_7:
+ type: org.openecomp.resource.cp.nodes.heat.contrailV2.VirtualMachineInterface
+ properties:
+ security_group_refs:
+ - get_input: oam_sec_group_name
+ virtual_machine_interface_properties:
+ virtual_machine_interface_properties_service_interface_type:
+ get_input: lb_st_interface_type_oam
+ port_tuple_refs:
+ - get_input: template_PortTuple_LB1
+ jsa_net5:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrailV2.VirtualNetwork
+ properties:
+ network_ipam_refs_data:
+ - network_ipam_refs_data_ipam_subnets:
+ - network_ipam_refs_data_ipam_subnets_subnet:
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len:
+ get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix:
+ get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2
+ network_ipam_refs_data_ipam_subnets_addr_from_start:
+ get_input: network_ipam_refs_data_ipam_subnets_addr_from_start_true
+ network_name: aaa
+ jsa_net4:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ network_name:
+ get_input: nems_traffic_name
+ template_VMInt_OAM_lb_1:
+ type: org.openecomp.resource.cp.nodes.heat.contrailV2.VirtualMachineInterface
+ properties:
+ security_group_refs:
+ - get_input: oam_sec_group_name
+ virtual_network_refs:
+ - jsa_net1
+ - jsa_net5
+ virtual_machine_interface_properties:
+ virtual_machine_interface_properties_service_interface_type:
+ get_input: lb_st_interface_type_oam
+ port_tuple_refs:
+ - get_input: template_PortTuple_LB1
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: jsa_net1
+ relationship: tosca.relationships.network.LinksTo
+ template_VMInt_OAM_lb_2:
+ type: org.openecomp.resource.cp.nodes.heat.contrailV2.VirtualMachineInterface
+ properties:
+ security_group_refs:
+ - get_input: oam_sec_group_name
+ virtual_network_refs:
+ - list_join:
+ - ':'
+ - get_attribute:
+ - jsa_net2
+ - fq_name
+ - list_join:
+ - ':'
+ - get_attribute:
+ - jsa_net5
+ - fq_name
+ virtual_machine_interface_properties:
+ virtual_machine_interface_properties_service_interface_type:
+ get_input: lb_st_interface_type_oam
+ port_tuple_refs:
+ - get_input: template_PortTuple_LB1
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: jsa_net2
+ relationship: tosca.relationships.network.LinksTo
+ jsa_net1:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrailV2.VirtualNetwork
+ properties:
+ network_ipam_refs_data:
+ - network_ipam_refs_data_ipam_subnets:
+ - network_ipam_refs_data_ipam_subnets_subnet:
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len:
+ get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix:
+ get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2
+ network_ipam_refs_data_ipam_subnets_addr_from_start:
+ get_input: network_ipam_refs_data_ipam_subnets_addr_from_start_true
+ network_name: aaa
+ template_VMInt_OAM_lb_3:
+ type: org.openecomp.resource.cp.nodes.heat.contrailV2.VirtualMachineInterface
+ properties:
+ security_group_refs:
+ - get_input: oam_sec_group_name
+ virtual_network_refs:
+ - get_attribute:
+ - jsa_net3
+ - fq_name
+ - get_attribute:
+ - jsa_net5
+ - fq_name
+ virtual_machine_interface_properties:
+ virtual_machine_interface_properties_service_interface_type:
+ get_input: lb_st_interface_type_oam
+ port_tuple_refs:
+ - get_input: template_PortTuple_LB1
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: jsa_net3
+ relationship: tosca.relationships.network.LinksTo
+ template_VMInt_OAM_lb_4:
+ type: org.openecomp.resource.cp.nodes.heat.contrailV2.VirtualMachineInterface
+ properties:
+ security_group_refs:
+ - get_input: oam_sec_group_name
+ virtual_network_refs:
+ - get_attribute:
+ - jsa_net4
+ - fq_name
+ virtual_machine_interface_properties:
+ virtual_machine_interface_properties_service_interface_type:
+ get_input: lb_st_interface_type_oam
+ port_tuple_refs:
+ - get_input: template_PortTuple_LB1
+ groups:
+ hot_template:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/hot_template.yml
+ description: cmaui server template for vMMSC
+ members:
+ - jsa_net3
+ - template_VMInt_OAM_lb_5
+ - jsa_net2
+ - template_VMInt_OAM_lb_6
+ - template_VMInt_OAM_lb_7
+ - jsa_net5
+ - jsa_net4
+ - template_VMInt_OAM_lb_1
+ - template_VMInt_OAM_lb_2
+ - jsa_net1
+ - template_VMInt_OAM_lb_3
+ - template_VMInt_OAM_lb_4 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/listNet/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/listNet/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..70cdc7d237
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/listNet/inputfiles/MANIFEST.json
@@ -0,0 +1,11 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volumes",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot_template.yml",
+ "type": "HEAT"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/listNet/inputfiles/hot_template.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/listNet/inputfiles/hot_template.yml
new file mode 100644
index 0000000000..46e80667ab
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/listNet/inputfiles/hot_template.yml
@@ -0,0 +1,177 @@
+heat_template_version: 2013-05-23
+
+description: cmaui server template for vMMSC
+
+parameters:
+ network_ipam_refs_data_ipam_subnets_addr_from_start_true:
+ description: dummy
+ type: string
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2:
+ description: dummy
+ type: string
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2:
+ description: dummy
+ type: string
+ lb_st_interface_type_oam:
+ description: dummy
+ type: string
+ template_PortTuple_LB1:
+ description: dummy
+ type: string
+ oam_sec_group_name:
+ description: dummy
+ type: string
+ jsa_net_name:
+ description: dummy
+ type: string
+ nems_traffic_name:
+ description: dummy
+ type: string
+
+resources:
+ template_VMInt_OAM_lb_1:
+ type: OS::ContrailV2::VirtualMachineInterface
+ properties:
+ virtual_machine_interface_properties:
+ {
+ virtual_machine_interface_properties_service_interface_type: { get_param: lb_st_interface_type_oam },
+ }
+ virtual_network_refs: [{ get_resource: jsa_net1 },{ get_resource: jsa_net5 }]
+ port_tuple_refs: [{ get_param: template_PortTuple_LB1 }]
+ security_group_refs: [{ get_param: oam_sec_group_name}]
+
+ jsa_net1:
+ properties:
+ name: aaa
+ network_ipam_refs_data:
+ -
+ network_ipam_refs_data_ipam_subnets:
+ -
+ network_ipam_refs_data_ipam_subnets_addr_from_start:
+ get_param: network_ipam_refs_data_ipam_subnets_addr_from_start_true
+ network_ipam_refs_data_ipam_subnets_subnet:
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix:
+ get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len:
+ get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2
+ type: "OS::ContrailV2::VirtualNetwork"
+
+ template_VMInt_OAM_lb_2:
+ type: OS::ContrailV2::VirtualMachineInterface
+ properties:
+ virtual_machine_interface_properties:
+ {
+ virtual_machine_interface_properties_service_interface_type: { get_param: lb_st_interface_type_oam },
+ }
+ virtual_network_refs: [ { list_join: [':', { get_attr: [ jsa_net2, fq_name ] } ] },{ list_join: [':', { get_attr: [ jsa_net5, fq_name ] } ] }]
+ port_tuple_refs: [{ get_param: template_PortTuple_LB1 }]
+ security_group_refs: [{ get_param: oam_sec_group_name}]
+
+ jsa_net2:
+ properties:
+ name: aaa
+ network_ipam_refs_data:
+ -
+ network_ipam_refs_data_ipam_subnets:
+ -
+ network_ipam_refs_data_ipam_subnets_addr_from_start:
+ get_param: network_ipam_refs_data_ipam_subnets_addr_from_start_true
+ network_ipam_refs_data_ipam_subnets_subnet:
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix:
+ get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len:
+ get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2
+ type: "OS::ContrailV2::VirtualNetwork"
+
+ template_VMInt_OAM_lb_3:
+ type: OS::ContrailV2::VirtualMachineInterface
+ properties:
+ virtual_machine_interface_properties:
+ {
+ virtual_machine_interface_properties_service_interface_type: { get_param: lb_st_interface_type_oam },
+ }
+ virtual_network_refs: [{ get_attr: [ jsa_net3, fq_name ] } ,{ get_attr: [ jsa_net5, fq_name ] }]
+ port_tuple_refs: [{ get_param: template_PortTuple_LB1 }]
+ security_group_refs: [{ get_param: oam_sec_group_name}]
+
+ jsa_net3:
+ properties:
+ name: aaa
+ network_ipam_refs_data:
+ -
+ network_ipam_refs_data_ipam_subnets:
+ -
+ network_ipam_refs_data_ipam_subnets_addr_from_start:
+ get_param: network_ipam_refs_data_ipam_subnets_addr_from_start_true
+ network_ipam_refs_data_ipam_subnets_subnet:
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix:
+ get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len:
+ get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2
+ type: "OS::ContrailV2::VirtualNetwork"
+
+ template_VMInt_OAM_lb_4:
+ type: OS::ContrailV2::VirtualMachineInterface
+ properties:
+ virtual_machine_interface_properties:
+ {
+ virtual_machine_interface_properties_service_interface_type: { get_param: lb_st_interface_type_oam },
+ }
+ virtual_network_refs: [{ get_attr: [ jsa_net4, fq_name ] } ] # should not connect to contrail network
+ port_tuple_refs: [{ get_param: template_PortTuple_LB1 }]
+ security_group_refs: [{ get_param: oam_sec_group_name}]
+
+ template_VMInt_OAM_lb_5:
+ type: OS::ContrailV2::VirtualMachineInterface
+ properties:
+ virtual_machine_interface_properties:
+ {
+ virtual_machine_interface_properties_service_interface_type: { get_param: lb_st_interface_type_oam },
+ }
+ virtual_network_refs: []
+ port_tuple_refs: [{ get_param: template_PortTuple_LB1 }]
+ security_group_refs: [{ get_param: oam_sec_group_name}]
+
+ template_VMInt_OAM_lb_6:
+ type: OS::ContrailV2::VirtualMachineInterface
+ properties:
+ virtual_machine_interface_properties:
+ {
+ virtual_machine_interface_properties_service_interface_type: { get_param: lb_st_interface_type_oam },
+ }
+ virtual_network_refs: { get_attr: [ jsa_net3, fq_name ] }
+ port_tuple_refs: [{ get_param: template_PortTuple_LB1 }]
+ security_group_refs: [{ get_param: oam_sec_group_name}]
+
+
+
+ template_VMInt_OAM_lb_7:
+ type: OS::ContrailV2::VirtualMachineInterface
+ properties:
+ virtual_machine_interface_properties:
+ {
+ virtual_machine_interface_properties_service_interface_type: { get_param: lb_st_interface_type_oam },
+ }
+ port_tuple_refs: [{ get_param: template_PortTuple_LB1 }]
+ security_group_refs: [{ get_param: oam_sec_group_name}]
+
+ jsa_net4:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: {get_param: nems_traffic_name}
+
+ jsa_net5:
+ properties:
+ name: aaa
+ network_ipam_refs_data:
+ -
+ network_ipam_refs_data_ipam_subnets:
+ -
+ network_ipam_refs_data_ipam_subnets_addr_from_start:
+ get_param: network_ipam_refs_data_ipam_subnets_addr_from_start_true
+ network_ipam_refs_data_ipam_subnets_subnet:
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix:
+ get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len:
+ get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2
+ type: "OS::ContrailV2::VirtualNetwork" \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/oneNet/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/oneNet/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..71dbe1a8c6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/oneNet/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,203 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ template_PortTuple_LB1:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ lb_st_interface_type_oam:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ oam_sec_group_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ nems_traffic_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ network_ipam_refs_data_ipam_subnets_addr_from_start_true:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ jsa_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ node_templates:
+ jsa_net3:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrailV2.VirtualNetwork
+ properties:
+ network_ipam_refs_data:
+ - network_ipam_refs_data_ipam_subnets:
+ - network_ipam_refs_data_ipam_subnets_subnet:
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len:
+ get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix:
+ get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2
+ network_ipam_refs_data_ipam_subnets_addr_from_start:
+ get_input: network_ipam_refs_data_ipam_subnets_addr_from_start_true
+ network_name: aaa
+ jsa_net2:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrailV2.VirtualNetwork
+ properties:
+ network_ipam_refs_data:
+ - network_ipam_refs_data_ipam_subnets:
+ - network_ipam_refs_data_ipam_subnets_subnet:
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len:
+ get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix:
+ get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2
+ network_ipam_refs_data_ipam_subnets_addr_from_start:
+ get_input: network_ipam_refs_data_ipam_subnets_addr_from_start_true
+ network_name: aaa
+ jsa_net4:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ network_name:
+ get_input: nems_traffic_name
+ template_VMInt_OAM_lb_1:
+ type: org.openecomp.resource.cp.nodes.heat.contrailV2.VirtualMachineInterface
+ properties:
+ security_group_refs:
+ - get_input: oam_sec_group_name
+ virtual_network_refs:
+ - jsa_net1
+ virtual_machine_interface_properties:
+ virtual_machine_interface_properties_service_interface_type:
+ get_input: lb_st_interface_type_oam
+ port_tuple_refs:
+ - get_input: template_PortTuple_LB1
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: jsa_net1
+ relationship: tosca.relationships.network.LinksTo
+ template_VMInt_OAM_lb_2:
+ type: org.openecomp.resource.cp.nodes.heat.contrailV2.VirtualMachineInterface
+ properties:
+ security_group_refs:
+ - get_input: oam_sec_group_name
+ virtual_network_refs:
+ - list_join:
+ - ':'
+ - get_attribute:
+ - jsa_net2
+ - fq_name
+ virtual_machine_interface_properties:
+ virtual_machine_interface_properties_service_interface_type:
+ get_input: lb_st_interface_type_oam
+ port_tuple_refs:
+ - get_input: template_PortTuple_LB1
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: jsa_net2
+ relationship: tosca.relationships.network.LinksTo
+ jsa_net1:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrailV2.VirtualNetwork
+ properties:
+ network_ipam_refs_data:
+ - network_ipam_refs_data_ipam_subnets:
+ - network_ipam_refs_data_ipam_subnets_subnet:
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len:
+ get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix:
+ get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2
+ network_ipam_refs_data_ipam_subnets_addr_from_start:
+ get_input: network_ipam_refs_data_ipam_subnets_addr_from_start_true
+ network_name: aaa
+ template_VMInt_OAM_lb_3:
+ type: org.openecomp.resource.cp.nodes.heat.contrailV2.VirtualMachineInterface
+ properties:
+ security_group_refs:
+ - get_input: oam_sec_group_name
+ virtual_network_refs:
+ - get_attribute:
+ - jsa_net3
+ - fq_name
+ virtual_machine_interface_properties:
+ virtual_machine_interface_properties_service_interface_type:
+ get_input: lb_st_interface_type_oam
+ port_tuple_refs:
+ - get_input: template_PortTuple_LB1
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: jsa_net3
+ relationship: tosca.relationships.network.LinksTo
+ template_VMInt_OAM_lb_4:
+ type: org.openecomp.resource.cp.nodes.heat.contrailV2.VirtualMachineInterface
+ properties:
+ security_group_refs:
+ - get_input: oam_sec_group_name
+ virtual_network_refs:
+ - get_attribute:
+ - jsa_net4
+ - fq_name
+ virtual_machine_interface_properties:
+ virtual_machine_interface_properties_service_interface_type:
+ get_input: lb_st_interface_type_oam
+ port_tuple_refs:
+ - get_input: template_PortTuple_LB1
+ groups:
+ hot_template:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/hot_template.yml
+ description: cmaui server template for vMMSC
+ members:
+ - jsa_net3
+ - jsa_net2
+ - jsa_net4
+ - template_VMInt_OAM_lb_1
+ - template_VMInt_OAM_lb_2
+ - jsa_net1
+ - template_VMInt_OAM_lb_3
+ - template_VMInt_OAM_lb_4 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/oneNet/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/oneNet/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..70cdc7d237
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/oneNet/inputfiles/MANIFEST.json
@@ -0,0 +1,11 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volumes",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot_template.yml",
+ "type": "HEAT"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/oneNet/inputfiles/hot_template.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/oneNet/inputfiles/hot_template.yml
new file mode 100644
index 0000000000..b771be1c0a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/oneNet/inputfiles/hot_template.yml
@@ -0,0 +1,128 @@
+heat_template_version: 2013-05-23
+
+description: cmaui server template for vMMSC
+
+parameters:
+ network_ipam_refs_data_ipam_subnets_addr_from_start_true:
+ description: dummy
+ type: string
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2:
+ description: dummy
+ type: string
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2:
+ description: dummy
+ type: string
+ lb_st_interface_type_oam:
+ description: dummy
+ type: string
+ template_PortTuple_LB1:
+ description: dummy
+ type: string
+ oam_sec_group_name:
+ description: dummy
+ type: string
+ jsa_net_name:
+ description: dummy
+ type: string
+ nems_traffic_name:
+ description: dummy
+ type: string
+
+resources:
+ template_VMInt_OAM_lb_1:
+ type: OS::ContrailV2::VirtualMachineInterface
+ properties:
+ virtual_machine_interface_properties:
+ {
+ virtual_machine_interface_properties_service_interface_type: { get_param: lb_st_interface_type_oam },
+ }
+ virtual_network_refs: [{ get_resource: jsa_net1 }]
+ port_tuple_refs: [{ get_param: template_PortTuple_LB1 }]
+ security_group_refs: [{ get_param: oam_sec_group_name}]
+
+ jsa_net1:
+ properties:
+ name: aaa
+ network_ipam_refs_data:
+ -
+ network_ipam_refs_data_ipam_subnets:
+ -
+ network_ipam_refs_data_ipam_subnets_addr_from_start:
+ get_param: network_ipam_refs_data_ipam_subnets_addr_from_start_true
+ network_ipam_refs_data_ipam_subnets_subnet:
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix:
+ get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len:
+ get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2
+ type: "OS::ContrailV2::VirtualNetwork"
+
+ template_VMInt_OAM_lb_2:
+ type: OS::ContrailV2::VirtualMachineInterface
+ properties:
+ virtual_machine_interface_properties:
+ {
+ virtual_machine_interface_properties_service_interface_type: { get_param: lb_st_interface_type_oam },
+ }
+ virtual_network_refs: [ { list_join: [':', { get_attr: [ jsa_net2, fq_name ] } ] }]
+ port_tuple_refs: [{ get_param: template_PortTuple_LB1 }]
+ security_group_refs: [{ get_param: oam_sec_group_name}]
+
+ jsa_net2:
+ properties:
+ name: aaa
+ network_ipam_refs_data:
+ -
+ network_ipam_refs_data_ipam_subnets:
+ -
+ network_ipam_refs_data_ipam_subnets_addr_from_start:
+ get_param: network_ipam_refs_data_ipam_subnets_addr_from_start_true
+ network_ipam_refs_data_ipam_subnets_subnet:
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix:
+ get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len:
+ get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2
+ type: "OS::ContrailV2::VirtualNetwork"
+
+ template_VMInt_OAM_lb_3:
+ type: OS::ContrailV2::VirtualMachineInterface
+ properties:
+ virtual_machine_interface_properties:
+ {
+ virtual_machine_interface_properties_service_interface_type: { get_param: lb_st_interface_type_oam },
+ }
+ virtual_network_refs: [{ get_attr: [ jsa_net3, fq_name ] } ]
+ port_tuple_refs: [{ get_param: template_PortTuple_LB1 }]
+ security_group_refs: [{ get_param: oam_sec_group_name}]
+
+ jsa_net3:
+ properties:
+ name: aaa
+ network_ipam_refs_data:
+ -
+ network_ipam_refs_data_ipam_subnets:
+ -
+ network_ipam_refs_data_ipam_subnets_addr_from_start:
+ get_param: network_ipam_refs_data_ipam_subnets_addr_from_start_true
+ network_ipam_refs_data_ipam_subnets_subnet:
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix:
+ get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len:
+ get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2
+ type: "OS::ContrailV2::VirtualNetwork"
+
+ template_VMInt_OAM_lb_4:
+ type: OS::ContrailV2::VirtualMachineInterface
+ properties:
+ virtual_machine_interface_properties:
+ {
+ virtual_machine_interface_properties_service_interface_type: { get_param: lb_st_interface_type_oam },
+ }
+ virtual_network_refs: [{ get_attr: [ jsa_net4, fq_name ] } ] # should not connect to contrail network
+ port_tuple_refs: [{ get_param: template_PortTuple_LB1 }]
+ security_group_refs: [{ get_param: oam_sec_group_name}]
+
+ jsa_net4:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: {get_param: nems_traffic_name}
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/AbstractSubstituteGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/AbstractSubstituteGlobalTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..f94194186f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/AbstractSubstituteGlobalTypesServiceTemplate.yaml
@@ -0,0 +1,88 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: AbstractSubstituteGlobalTypes
+ template_version: 1.0.0
+description: Abstract Substitute Global Types
+imports:
+ common_definitions:
+ file: CommonGlobalTypesServiceTemplate.yaml
+data_types:
+ org.openecomp.datatypes.heat.substitution.SubstitutionFiltering:
+ derived_from: tosca.datatypes.Root
+ description: Substitution Filter
+ properties:
+ substitute_service_template:
+ type: string
+ description: Substitute Service Template
+ required: true
+ status: SUPPORTED
+ index_value:
+ type: integer
+ description: Index value of the substitution service template runtime instance
+ required: false
+ default: 0
+ status: SUPPORTED
+ constraints:
+ - greater_or_equal: 0
+ count:
+ type: string
+ description: Count
+ required: false
+ default: 1
+ status: SUPPORTED
+ scaling_enabled:
+ type: boolean
+ description: Indicates whether service scaling is enabled
+ required: false
+ default: true
+ status: SUPPORTED
+ mandatory:
+ type: boolean
+ description: Mandatory
+ required: false
+ default: true
+ status: SUPPORTED
+ org.openecomp.datatypes.heat.substitution.SubstitutionFilter:
+ derived_from: tosca.datatypes.Root
+ description: Substitution Filter
+ properties:
+ substitute_service_template:
+ type: string
+ description: Substitute Service Template
+ required: true
+ status: SUPPORTED
+ index_variable:
+ type: string
+ description: Index variable
+ required: false
+ default: '%index%'
+ status: SUPPORTED
+ constraints:
+ - min_length: 3
+ count:
+ type: string
+ description: Count
+ required: false
+ default: 1
+ status: SUPPORTED
+ scaling_enabled:
+ type: boolean
+ description: Indicates whether service scaling is enabled
+ required: false
+ default: true
+ status: SUPPORTED
+ mandatory:
+ type: boolean
+ description: Mandatory
+ required: false
+ default: true
+ status: SUPPORTED
+node_types:
+ org.openecomp.resource.abstract.nodes.AbstractSubstitute:
+ derived_from: tosca.nodes.Root
+ properties:
+ service_template_filter:
+ type: org.openecomp.datatypes.heat.substitution.SubstitutionFiltering
+ description: Substitution Filter
+ required: true
+ status: SUPPORTED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/CinderVolumeGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/CinderVolumeGlobalTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..03add7648e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/CinderVolumeGlobalTypesServiceTemplate.yaml
@@ -0,0 +1,178 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: CinderVolumeGlobalTypes
+ template_version: 1.0.0
+description: Cinder Volume TOSCA Global Types
+relationship_types:
+ org.openecomp.relationships.heat.cinder.VolumeAttachesTo:
+ derived_from: tosca.relationships.AttachesTo
+ description: This type represents an attachment relationship for associating volume
+ properties:
+ volume_id:
+ type: string
+ description: The ID of the volume to be attached
+ required: true
+ status: SUPPORTED
+ location:
+ type: string
+ description: The location where the volume is exposed on the instance, mountpoint
+ required: false
+ status: SUPPORTED
+ instance_uuid:
+ type: string
+ description: The ID of the server to which the volume attaches
+ required: true
+ status: SUPPORTED
+ attributes:
+ show:
+ type: string
+ description: Detailed information about resource
+ status: SUPPORTED
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cinder.Volume:
+ derived_from: tosca.nodes.BlockStorage
+ properties:
+ availability_zone:
+ type: string
+ description: The availability zone in which the volume will be created
+ required: false
+ status: SUPPORTED
+ image:
+ type: string
+ description: If specified, the name or ID of the image to create the volume from
+ required: false
+ status: SUPPORTED
+ metadata:
+ type: map
+ description: Key/value pairs to associate with the volume
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ volume_type:
+ type: string
+ description: If specified, the type of volume to use, mapping to a specific backend
+ required: false
+ status: SUPPORTED
+ description:
+ type: string
+ description: A description of the volume
+ required: false
+ status: SUPPORTED
+ device_type:
+ type: string
+ description: Device type
+ required: false
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - cdrom
+ - disk
+ disk_bus:
+ type: string
+ description: 'Bus of the device: hypervisor driver chooses a suitable default
+ if omitted'
+ required: false
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - ide
+ - lame_bus
+ - scsi
+ - usb
+ - virtio
+ backup_id:
+ type: string
+ description: If specified, the backup to create the volume from
+ required: false
+ status: SUPPORTED
+ source_volid:
+ type: string
+ description: If specified, the volume to use as source
+ required: false
+ status: SUPPORTED
+ boot_index:
+ type: integer
+ description: Integer used for ordering the boot disks
+ required: false
+ status: SUPPORTED
+ size:
+ type: scalar-unit.size
+ description: The requested storage size (default unit is MB)
+ required: false
+ status: SUPPORTED
+ constraints:
+ - greater_or_equal: 1 GB
+ read_only:
+ type: boolean
+ description: Enables or disables read-only access mode of volume
+ required: false
+ status: SUPPORTED
+ name:
+ type: string
+ description: A name used to distinguish the volume
+ required: false
+ status: SUPPORTED
+ scheduler_hints:
+ type: map
+ description: Arbitrary key-value pairs specified by the client to help the Cinder scheduler creating a volume
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ swap_size:
+ type: scalar-unit.size
+ description: The size of the swap, in MB
+ required: false
+ status: SUPPORTED
+ delete_on_termination:
+ type: boolean
+ description: Indicate whether the volume should be deleted when the server is terminated
+ required: false
+ status: SUPPORTED
+ multiattach:
+ type: boolean
+ description: Whether allow the volume to be attached more than once
+ required: false
+ status: SUPPORTED
+ attributes:
+ display_description:
+ type: string
+ description: Description of the volume
+ status: SUPPORTED
+ attachments:
+ type: string
+ description: The list of attachments of the volume
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ encrypted:
+ type: boolean
+ description: Boolean indicating if the volume is encrypted or not
+ status: SUPPORTED
+ show:
+ type: string
+ description: Detailed information about resource
+ status: SUPPORTED
+ created_at:
+ type: timestamp
+ description: The timestamp indicating volume creation
+ status: SUPPORTED
+ display_name:
+ type: string
+ description: Name of the volume
+ status: SUPPORTED
+ metadata_values:
+ type: map
+ description: Key/value pairs associated with the volume in raw dict form
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ bootable:
+ type: boolean
+ description: Boolean indicating if the volume can be booted or not
+ status: SUPPORTED
+ status:
+ type: string
+ description: The current status of the volume
+ status: SUPPORTED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/CommonGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/CommonGlobalTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..4feb78f371
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/CommonGlobalTypesServiceTemplate.yaml
@@ -0,0 +1,354 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: CommonGlobalTypes
+ template_version: 1.0.0
+description: TOSCA Global Types
+imports:
+ NativeTypesServiceTemplate:
+ file: NativeTypesServiceTemplateServiceTemplate.yaml
+data_types:
+ org.openecomp.datatypes.heat.network.AddressPair:
+ derived_from: tosca.datatypes.Root
+ description: MAC/IP address pairs
+ properties:
+ mac_address:
+ type: string
+ description: MAC address
+ required: false
+ status: SUPPORTED
+ ip_address:
+ type: string
+ description: IP address
+ required: false
+ status: SUPPORTED
+ org.openecomp.datatypes.heat.network.AllocationPool:
+ derived_from: tosca.datatypes.Root
+ description: The start and end addresses for the allocation pool
+ properties:
+ start:
+ type: string
+ description: Start address for the allocation pool
+ required: false
+ status: SUPPORTED
+ end:
+ type: string
+ description: End address for the allocation pool
+ required: false
+ status: SUPPORTED
+ org.openecomp.datatypes.heat.network.contrail.AddressPair:
+ derived_from: tosca.datatypes.Root
+ description: Address Pair
+ properties:
+ address_mode:
+ type: string
+ description: Address mode active-active or active-standy
+ required: false
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - active-active
+ - active-standby
+ prefix:
+ type: string
+ description: IP address prefix
+ required: false
+ status: SUPPORTED
+ mac_address:
+ type: string
+ description: Mac address
+ required: false
+ status: SUPPORTED
+ org.openecomp.datatypes.heat.network.subnet.HostRoute:
+ derived_from: tosca.datatypes.Root
+ description: Host route info for the subnet
+ properties:
+ destination:
+ type: string
+ description: The destination for static route
+ required: false
+ status: SUPPORTED
+ nexthop:
+ type: string
+ description: The next hop for the destination
+ required: false
+ status: SUPPORTED
+ org.openecomp.datatypes.heat.network.contrail.port.StaticRoute:
+ derived_from: tosca.datatypes.Root
+ description: static route
+ properties:
+ prefix:
+ type: string
+ description: Route prefix
+ required: false
+ status: SUPPORTED
+ next_hop:
+ type: string
+ description: Next hop
+ required: false
+ status: SUPPORTED
+ next_hop_type:
+ type: string
+ description: Next hop type
+ required: false
+ status: SUPPORTED
+ org.openecomp.datatypes.heat.network.neutron.Subnet:
+ derived_from: tosca.datatypes.Root
+ description: A subnet represents an IP address block that can be used for assigning IP addresses to virtual instances
+ properties:
+ tenant_id:
+ type: string
+ description: The ID of the tenant who owns the network
+ required: false
+ status: SUPPORTED
+ enable_dhcp:
+ type: boolean
+ description: Set to true if DHCP is enabled and false if DHCP is disabled
+ required: false
+ default: true
+ status: SUPPORTED
+ ipv6_address_mode:
+ type: string
+ description: IPv6 address mode
+ required: false
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - dhcpv6-stateful
+ - dhcpv6-stateless
+ - slaac
+ ipv6_ra_mode:
+ type: string
+ description: IPv6 RA (Router Advertisement) mode
+ required: false
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - dhcpv6-stateful
+ - dhcpv6-stateless
+ - slaac
+ value_specs:
+ type: map
+ description: Extra parameters to include in the request
+ required: false
+ default: {
+ }
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ allocation_pools:
+ type: list
+ description: The start and end addresses for the allocation pools
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.AllocationPool
+ subnetpool:
+ type: string
+ description: The name or ID of the subnet pool
+ required: false
+ status: SUPPORTED
+ dns_nameservers:
+ type: list
+ description: A specified set of DNS name servers to be used
+ required: false
+ default: [
+ ]
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ host_routes:
+ type: list
+ description: The gateway IP address
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.subnet.HostRoute
+ ip_version:
+ type: integer
+ description: The gateway IP address
+ required: false
+ default: 4
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - '4'
+ - '6'
+ name:
+ type: string
+ description: The name of the subnet
+ required: false
+ status: SUPPORTED
+ prefixlen:
+ type: integer
+ description: Prefix length for subnet allocation from subnet pool
+ required: false
+ status: SUPPORTED
+ constraints:
+ - greater_or_equal: 0
+ cidr:
+ type: string
+ description: The CIDR
+ required: false
+ status: SUPPORTED
+ gateway_ip:
+ type: string
+ description: The gateway IP address
+ required: false
+ status: SUPPORTED
+capability_types:
+ org.openecomp.capabilities.metric.SnmpTrap:
+ derived_from: org.openecomp.capabilities.Metric
+ description: A node type that includes the Metric capability indicates that it can be monitored using snmp trap.
+ properties:
+ oid:
+ type: string
+ description: Object Id of the metric
+ required: true
+ status: SUPPORTED
+ org.openecomp.capabilities.metric.SnmpPolling:
+ derived_from: org.openecomp.capabilities.Metric
+ description: A node type that includes the Metric capability indicates that it can be monitored using snmp polling.
+ properties:
+ oid:
+ type: string
+ description: Object Id of the metric
+ required: true
+ status: SUPPORTED
+ org.openecomp.capabilities.metric.Ceilometer:
+ derived_from: org.openecomp.capabilities.Metric
+ description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer.
+ properties:
+ name:
+ type: string
+ description: Ceilometer metric type name to monitor. (The name ceilometer is using)
+ required: true
+ status: SUPPORTED
+ org.openecomp.capabilities.Metric:
+ derived_from: tosca.capabilities.nfv.Metric
+ description: A node type that includes the Metric capability indicates that it can be monitored.
+ properties:
+ unit:
+ type: string
+ description: Unit of the metric value
+ required: true
+ status: SUPPORTED
+ description:
+ type: string
+ description: Description of the metric
+ required: false
+ status: SUPPORTED
+ type:
+ type: string
+ description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc.
+ required: true
+ status: SUPPORTED
+ category:
+ type: string
+ description: Category of the metric, for an example, compute, disk, network, storage and etc.
+ required: false
+ status: SUPPORTED
+ attributes:
+ value:
+ type: string
+ description: Runtime monitored value
+ status: SUPPORTED
+relationship_types:
+ org.openecomp.relationships.AttachesTo:
+ derived_from: tosca.relationships.Root
+ description: This type represents an attachment relationship
+group_types:
+ org.openecomp.groups.heat.HeatStack:
+ derived_from: tosca.groups.Root
+ description: Grouped all heat resources which are in the same heat stack
+ properties:
+ heat_file:
+ type: string
+ description: Heat file which associate to this group/heat stack
+ required: true
+ status: SUPPORTED
+ description:
+ type: string
+ description: Heat file description
+ required: false
+ status: SUPPORTED
+policy_types:
+ org.openecomp.policies.placement.valet.Exclusivity:
+ derived_from: tosca.policy.placement
+ description: Valet Exclusivity
+ properties:
+ level:
+ type: string
+ description: exclusivity
+ required: false
+ default: host
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - host
+ - rack
+ org.openecomp.policies.placement.valet.Diversity:
+ derived_from: tosca.policy.placement
+ description: Valet Diversity
+ properties:
+ level:
+ type: string
+ description: diversity
+ required: false
+ default: host
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - host
+ - rack
+ org.openecomp.policies.placement.Colocate:
+ derived_from: tosca.policy.placement
+ description: Keep associated nodes (groups of nodes) based upon affinity value
+ properties:
+ name:
+ type: string
+ description: The name of the policy
+ required: false
+ status: SUPPORTED
+ affinity:
+ type: string
+ description: affinity
+ required: true
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - host
+ - region
+ - compute
+ org.openecomp.policies.placement.valet.Affinity:
+ derived_from: tosca.policy.placement
+ description: Valet Affinity
+ properties:
+ level:
+ type: string
+ description: affinity
+ required: false
+ default: host
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - host
+ - rack
+ org.openecomp.policies.placement.Antilocate:
+ derived_from: tosca.policy.placement
+ description: My placement policy for separation based upon container type value
+ properties:
+ name:
+ type: string
+ description: The name of the policy
+ required: false
+ status: SUPPORTED
+ container_type:
+ type: string
+ description: container type
+ required: false
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - host
+ - region
+ - compute \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..ae5430cf8d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
@@ -0,0 +1,166 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: ContrailAbstractSubstituteGlobalTypes
+ template_version: 1.0.0
+description: Contrail Abstract Substitute Global Types
+imports:
+ common_definitions:
+ file: CommonGlobalTypesServiceTemplate.yaml
+data_types:
+ org.openecomp.datatypes.heat.network.contrail.InterfaceData:
+ derived_from: tosca.datatypes.Root
+ description: Interface Data
+ properties:
+ static_routes:
+ type: list
+ description: An ordered list of static routes to be added to this interface
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.contrail.port.StaticRoute
+ virtual_network:
+ type: string
+ description: Virtual Network for this interface
+ required: true
+ status: SUPPORTED
+ allowed_address_pairs:
+ type: list
+ description: List of allowed address pair for this interface
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.contrail.AddressPair
+ ip_address:
+ type: string
+ description: IP for this interface
+ required: false
+ status: SUPPORTED
+node_types:
+ org.openecomp.resource.abstract.nodes.contrail.AbstractSubstitute:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ availability_zone:
+ type: string
+ description: Availability zone to create servers in
+ required: false
+ status: SUPPORTED
+ static_routes_list:
+ type: list
+ description: Static routes enabled
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: boolean
+ availability_zone_enable:
+ type: boolean
+ description: Indicates availability zone is enabled
+ required: false
+ default: false
+ status: SUPPORTED
+ service_template_name:
+ type: string
+ description: Service template name
+ required: false
+ status: SUPPORTED
+ ordered_interfaces:
+ type: boolean
+ description: Indicates if service interface are ordered
+ required: false
+ default: false
+ status: SUPPORTED
+ flavor:
+ type: string
+ description: flavor
+ required: false
+ status: SUPPORTED
+ image_name:
+ type: string
+ description: Image name
+ required: true
+ status: SUPPORTED
+ service_type:
+ type: string
+ description: Service type
+ required: true
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - firewall
+ - analyzer
+ - source-nat
+ - loadbalancer
+ service_interface_type_list:
+ type: list
+ description: List of interface types
+ required: true
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ constraints:
+ - valid_values:
+ - management
+ - left
+ - right
+ - other
+ service_instance_name:
+ type: string
+ description: Service instance name
+ required: true
+ status: SUPPORTED
+ interface_list:
+ type: list
+ description: List of interfaces
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.contrail.InterfaceData
+ service_mode:
+ type: string
+ description: Service mode
+ required: true
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - transparent
+ - in-network
+ - in-network-nat
+ shared_ip_list:
+ type: list
+ description: Shared ips enabled
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: boolean
+ attributes:
+ tenant_id:
+ type: string
+ description: Tenant id of the Service Instance
+ status: SUPPORTED
+ fq_name:
+ type: string
+ description: The FQ name of the service instance
+ status: SUPPORTED
+ service_template_name:
+ type: string
+ description: Service Template of the Service Instance
+ status: SUPPORTED
+ show:
+ type: string
+ description: All attributes
+ status: SUPPORTED
+ active_vms:
+ type: string
+ description: Number of service VMs active for this Service Instance
+ status: SUPPORTED
+ service_instance_name:
+ type: string
+ description: The name of the service instance
+ status: SUPPORTED
+ virtual_machines:
+ type: string
+ description: Service VMs for the Service Instance
+ status: SUPPORTED
+ status:
+ type: string
+ description: Status of the service instance
+ status: SUPPORTED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailComputeGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailComputeGlobalTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..d6ad4f953c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailComputeGlobalTypesServiceTemplate.yaml
@@ -0,0 +1,89 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: ContrailComputeGlobalTypes
+ template_version: 1.0.0
+description: Contrail Compute TOSCA Global Types
+imports:
+ common_definitions:
+ file: CommonGlobalTypesServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.contrail.Compute:
+ derived_from: tosca.nodes.Compute
+ properties:
+ flavor:
+ type: string
+ description: flavor
+ required: false
+ status: SUPPORTED
+ image_name:
+ type: string
+ description: Image name
+ required: true
+ status: SUPPORTED
+ availability_zone:
+ type: string
+ description: Availability zone to create servers in
+ required: false
+ status: SUPPORTED
+ service_type:
+ type: string
+ description: Service type
+ required: true
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - firewall
+ - analyzer
+ - source-nat
+ - loadbalancer
+ availability_zone_enable:
+ type: boolean
+ description: Indicates availability zone is enabled
+ required: false
+ default: false
+ status: SUPPORTED
+ service_template_name:
+ type: string
+ description: Service template name
+ required: false
+ status: SUPPORTED
+ service_instance_name:
+ type: string
+ description: Service instance name
+ required: true
+ status: SUPPORTED
+ service_mode:
+ type: string
+ description: Service mode
+ required: true
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - transparent
+ - in-network
+ - in-network-nat
+ attributes:
+ tenant_id:
+ type: string
+ description: Tenant id of the VM
+ status: SUPPORTED
+ fq_name:
+ type: string
+ description: fq_name
+ status: SUPPORTED
+ show:
+ type: string
+ description: All attributes
+ status: SUPPORTED
+ active_vms:
+ type: string
+ description: Number of active VMs
+ status: SUPPORTED
+ virtual_machines:
+ type: string
+ description: VMs of this compute
+ status: SUPPORTED
+ status:
+ type: string
+ description: status of the compute
+ status: SUPPORTED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailNetworkRuleGlobalTypeServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
new file mode 100644
index 0000000000..1cbf435c53
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
@@ -0,0 +1,131 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: ContrailNetworkRuleGlobalType
+ template_version: 1.0.0
+description: Contrail Network Rule Global Types
+imports:
+ common_definitions:
+ file: CommonGlobalTypesServiceTemplate.yaml
+data_types:
+ org.openecomp.datatypes.heat.contrail.network.rule.PortPairs:
+ derived_from: tosca.datatypes.Root
+ description: source and destination port pairs
+ properties:
+ start_port:
+ type: string
+ description: Start port
+ required: false
+ status: SUPPORTED
+ end_port:
+ type: string
+ description: End port
+ required: false
+ status: SUPPORTED
+ org.openecomp.datatypes.heat.contrail.network.rule.VirtualNetwork:
+ derived_from: tosca.datatypes.Root
+ description: source and destination addresses
+ properties:
+ virtual_network:
+ type: string
+ description: Virtual network
+ required: false
+ status: SUPPORTED
+ org.openecomp.datatypes.heat.contrail.network.rule.RuleList:
+ derived_from: tosca.datatypes.Root
+ description: list of policy rules
+ properties:
+ policy_rule:
+ type: list
+ description: Contrail network rule
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.contrail.network.rule.Rule
+ org.openecomp.datatypes.heat.contrail.network.rule.Rule:
+ derived_from: tosca.datatypes.Root
+ description: policy rule
+ properties:
+ src_ports:
+ type: list
+ description: Source ports
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.contrail.network.rule.PortPairs
+ protocol:
+ type: string
+ description: Protocol
+ required: false
+ status: SUPPORTED
+ dst_addresses:
+ type: list
+ description: Destination addresses
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.contrail.network.rule.VirtualNetwork
+ apply_service:
+ type: string
+ description: Service to apply
+ required: false
+ status: SUPPORTED
+ dst_ports:
+ type: list
+ description: Destination ports
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.contrail.network.rule.PortPairs
+ src_addresses:
+ type: list
+ description: Source addresses
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.contrail.network.rule.VirtualNetwork
+ direction:
+ type: string
+ description: Direction
+ required: false
+ status: SUPPORTED
+node_types:
+ org.openecomp.resource.vfc.rules.nodes.heat.network.contrail.NetworkRules:
+ derived_from: tosca.nodes.Root
+ properties:
+ entries:
+ type: org.openecomp.datatypes.heat.contrail.network.rule.RuleList
+ description: A symbolic name for this contrail network rule
+ required: false
+ status: SUPPORTED
+ name:
+ type: string
+ description: A symbolic name for this contrail network rule
+ required: false
+ status: SUPPORTED
+ attributes:
+ tenant_id:
+ type: string
+ description: tenant_id
+ status: SUPPORTED
+ fq_name:
+ type: string
+ description: fq_name
+ status: SUPPORTED
+ show:
+ type: string
+ description: All attributes.
+ status: SUPPORTED
+ rules:
+ type: list
+ description: List of rules
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ requirements:
+ - network:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.network.Network
+ relationship: org.openecomp.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailPortGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailPortGlobalTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..429ed9f6a1
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailPortGlobalTypesServiceTemplate.yaml
@@ -0,0 +1,64 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: ContrailPortGlobalTypes
+ template_version: 1.0.0
+description: Contrail Port TOSCA Global Types
+imports:
+ common_definitions:
+ file: CommonGlobalTypesServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.cp.nodes.heat.network.contrail.Port:
+ derived_from: tosca.nodes.network.Port
+ properties:
+ static_routes:
+ type: list
+ description: An ordered list of static routes to be added to this interface
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.contrail.port.StaticRoute
+ virtual_network:
+ type: string
+ description: Virtual Network for this interface
+ required: true
+ status: SUPPORTED
+ static_route:
+ type: boolean
+ description: Static route enabled
+ required: false
+ default: false
+ status: SUPPORTED
+ allowed_address_pairs:
+ type: list
+ description: List of allowed address pair for this interface
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.contrail.AddressPair
+ shared_ip:
+ type: boolean
+ description: Shared ip enabled
+ required: false
+ default: false
+ status: SUPPORTED
+ ip_address:
+ type: string
+ description: IP for this interface
+ required: false
+ status: SUPPORTED
+ interface_type:
+ type: string
+ description: Interface type
+ required: true
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - management
+ - left
+ - right
+ - other
+ attributes:
+ fq_name:
+ type: string
+ description: fq_name
+ status: SUPPORTED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailV2NetworkRuleGlobalTypeServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailV2NetworkRuleGlobalTypeServiceTemplate.yaml
new file mode 100644
index 0000000000..0526291005
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailV2NetworkRuleGlobalTypeServiceTemplate.yaml
@@ -0,0 +1,156 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: ContrailV2NetworkRuleGlobalType
+ template_version: 1.0.0
+description: Contrail V2 Network Rule Global Types
+imports:
+ common_definitions:
+ file: CommonGlobalTypesServiceTemplate.yaml
+data_types:
+ org.openecomp.datatypes.heat.contrailV2.network.rule.DstPortPairs:
+ derived_from: tosca.datatypes.Root
+ description: destination port pairs
+ properties:
+ network_policy_entries_policy_rule_dst_ports_start_port:
+ type: string
+ description: Start port
+ required: false
+ status: SUPPORTED
+ network_policy_entries_policy_rule_dst_ports_end_port:
+ type: string
+ description: End port
+ required: false
+ status: SUPPORTED
+ org.openecomp.datatypes.heat.contrailV2.network.rule.RuleList:
+ derived_from: tosca.datatypes.Root
+ description: list of policy rules
+ properties:
+ network_policy_entries_policy_rule:
+ type: list
+ description: Contrail network rule
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.contrailV2.network.rule.Rule
+ org.openecomp.datatypes.heat.contrailV2.network.rule.SrcPortPairs:
+ derived_from: tosca.datatypes.Root
+ description: source port pairs
+ properties:
+ network_policy_entries_policy_rule_src_ports_start_port:
+ type: string
+ description: Start port
+ required: false
+ status: SUPPORTED
+ network_policy_entries_policy_rule_src_ports_end_port:
+ type: string
+ description: End port
+ required: false
+ status: SUPPORTED
+ org.openecomp.datatypes.heat.contrailV2.network.rule.SrcVirtualNetwork:
+ derived_from: tosca.datatypes.Root
+ description: source addresses
+ properties:
+ network_policy_entries_policy_rule_src_addresses_virtual_network:
+ type: string
+ description: Source addresses Virtual network
+ required: false
+ status: SUPPORTED
+ org.openecomp.datatypes.heat.contrailV2.network.rule.DstVirtualNetwork:
+ derived_from: tosca.datatypes.Root
+ description: destination addresses
+ properties:
+ network_policy_entries_policy_rule_dst_addresses_virtual_network:
+ type: string
+ description: Destination addresses Virtual network
+ required: false
+ status: SUPPORTED
+ org.openecomp.datatypes.heat.contrailV2.network.rule.ActionList:
+ derived_from: tosca.datatypes.Root
+ description: Action List
+ properties:
+ network_policy_entries_policy_rule_action_list_simple_action:
+ type: string
+ description: Simple Action
+ required: false
+ status: SUPPORTED
+ network_policy_entries_policy_rule_action_list_apply_service:
+ type: list
+ description: Apply Service
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ org.openecomp.datatypes.heat.contrailV2.network.rule.Rule:
+ derived_from: tosca.datatypes.Root
+ description: policy rule
+ properties:
+ network_policy_entries_policy_rule_dst_addresses:
+ type: list
+ description: Destination addresses
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.contrailV2.network.rule.DstVirtualNetwork
+ network_policy_entries_policy_rule_dst_ports:
+ type: list
+ description: Destination ports
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.contrailV2.network.rule.DstPortPairs
+ network_policy_entries_policy_rule_protocol:
+ type: string
+ description: Protocol
+ required: false
+ status: SUPPORTED
+ network_policy_entries_policy_rule_src_addresses:
+ type: list
+ description: Source addresses
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.contrailV2.network.rule.SrcVirtualNetwork
+ network_policy_entries_policy_rule_direction:
+ type: string
+ description: Direction
+ required: false
+ status: SUPPORTED
+ network_policy_entries_policy_rule_src_ports:
+ type: list
+ description: Source ports
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.contrailV2.network.rule.SrcPortPairs
+ network_policy_entries_policy_rule_action_list:
+ type: org.openecomp.datatypes.heat.contrailV2.network.rule.ActionList
+ description: Action list
+ required: false
+ status: SUPPORTED
+node_types:
+ org.openecomp.resource.vfc.rules.nodes.heat.network.contrailV2.NetworkRules:
+ derived_from: tosca.nodes.Root
+ properties:
+ name:
+ type: string
+ description: A symbolic name for this contrail v2 network rule
+ required: false
+ status: SUPPORTED
+ network_policy_entries:
+ type: org.openecomp.datatypes.heat.contrailV2.network.rule.RuleList
+ description: A symbolic name for this contrail v2 network rule
+ required: false
+ status: SUPPORTED
+ attributes:
+ fq_name:
+ type: string
+ description: fq_name
+ status: SUPPORTED
+ requirements:
+ - network:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.network.Network
+ relationship: org.openecomp.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
new file mode 100644
index 0000000000..5c4a58fb11
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
@@ -0,0 +1,69 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: ContrailV2VirtualMachineInterfaceGlobalType
+ template_version: 1.0.0
+description: Contrail Virtual Machine Interface TOSCA Global Types
+imports:
+ common_definitions:
+ file: CommonGlobalTypesServiceTemplate.yaml
+data_types:
+ org.openecomp.datatypes.heat.contrailV2.virtual.machine.interface.Properties:
+ derived_from: tosca.datatypes.Root
+ description: Virtual Machine Interface Properties.
+ properties:
+ virtual_machine_interface_properties_service_interface_type:
+ type: string
+ description: Service Interface Type.
+ required: false
+ status: SUPPORTED
+node_types:
+ org.openecomp.resource.cp.nodes.heat.contrailV2.VirtualMachineInterface:
+ derived_from: tosca.nodes.network.Port
+ properties:
+ virtual_machine_intefrace_mac_addresses:
+ type: list
+ description: List of mac addresses.
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ name:
+ type: string
+ description: Virtual Machine Interface name
+ required: false
+ status: SUPPORTED
+ security_group_refs:
+ type: list
+ description: List of security groups.
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ virtual_network_refs:
+ type: list
+ description: List of virtual networks.
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ virtual_machine_interface_properties:
+ type: org.openecomp.datatypes.heat.contrailV2.virtual.machine.interface.Properties
+ description: virtual machine interface properties.
+ required: false
+ status: SUPPORTED
+ port_tuple_refs:
+ type: list
+ description: List of port tuples.
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ attributes:
+ fq_name:
+ type: string
+ description: The FQ name of the Virtual Network.
+ status: SUPPORTED
+ show:
+ type: string
+ description: All attributes.
+ status: SUPPORTED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailV2VirtualNetworkGlobalTypeServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailV2VirtualNetworkGlobalTypeServiceTemplate.yaml
new file mode 100644
index 0000000000..b950edf79f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailV2VirtualNetworkGlobalTypeServiceTemplate.yaml
@@ -0,0 +1,139 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: ContrailV2VirtualNetworkGlobalType
+ template_version: 1.0.0
+description: Contrail V2 Virtual Network Global Types
+imports:
+ common_definitions:
+ file: CommonGlobalTypesServiceTemplate.yaml
+data_types:
+ org.openecomp.datatypes.heat.contrailV2.virtual.network.rule.ref.data.IpamSubnet:
+ derived_from: tosca.datatypes.Root
+ description: Network Ipam Ref Data Subnet
+ properties:
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len:
+ type: string
+ description: Network ipam refs data ipam subnets ip prefix len
+ required: false
+ status: SUPPORTED
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix:
+ type: string
+ description: Network ipam refs data ipam subnets ip prefix
+ required: false
+ status: SUPPORTED
+ org.openecomp.datatypes.heat.contrailV2.virtual.network.rule.RefData:
+ derived_from: tosca.datatypes.Root
+ description: network policy refs data
+ properties:
+ network_policy_refs_data_sequence:
+ type: org.openecomp.datatypes.heat.contrailV2.virtual.network.rule.RefDataSequence
+ description: Network Policy ref data sequence
+ required: false
+ status: SUPPORTED
+ org.openecomp.datatypes.heat.contrailV2.virtual.network.rule.IpamRefData:
+ derived_from: tosca.datatypes.Root
+ description: Network Ipam Ref Data
+ properties:
+ network_ipam_refs_data_ipam_subnets:
+ type: list
+ description: Network ipam refs data ipam subnets
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.contrailV2.virtual.network.rule.ref.data.IpamSubnetList
+ org.openecomp.datatypes.heat.contrailV2.virtual.network.rule.ref.data.IpamSubnetList:
+ derived_from: tosca.datatypes.Root
+ description: Network Ipam Ref Data Subnet List
+ properties:
+ network_ipam_refs_data_ipam_subnets_subnet:
+ type: org.openecomp.datatypes.heat.contrailV2.virtual.network.rule.ref.data.IpamSubnet
+ description: Network ipam refs data ipam subnets
+ required: false
+ status: SUPPORTED
+ network_ipam_refs_data_ipam_subnets_addr_from_start:
+ type: string
+ description: Network ipam refs data ipam subnets addr from start
+ required: false
+ status: SUPPORTED
+ org.openecomp.datatypes.heat.contrailV2.virtual.network.rule.RefDataSequence:
+ derived_from: tosca.datatypes.Root
+ description: network policy refs data sequence
+ properties:
+ network_policy_refs_data_sequence_major:
+ type: integer
+ description: Network Policy ref data sequence Major
+ required: false
+ status: SUPPORTED
+ network_policy_refs_data_sequence_minor:
+ type: integer
+ description: Network Policy ref data sequence Minor
+ required: false
+ status: SUPPORTED
+node_types:
+ org.openecomp.resource.vl.nodes.heat.network.contrailV2.VirtualNetwork:
+ derived_from: tosca.nodes.network.Network
+ properties:
+ network_ipam_refs_data:
+ type: list
+ description: IPAM references Data
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.contrailV2.virtual.network.rule.IpamRefData
+ network_policy_refs_data:
+ type: list
+ description: Policy references data
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.contrailV2.virtual.network.rule.RefData
+ network_ipam_refs:
+ type: list
+ description: IPAM references
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ network_policy_refs:
+ type: list
+ description: Policy references
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ subnets:
+ type: map
+ description: Network related subnets
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.neutron.Subnet
+ attributes:
+ fq_name:
+ type: string
+ description: fq_name
+ status: SUPPORTED
+ subnets_name:
+ type: list
+ description: Subnets name of this network
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ subnets_show:
+ type: map
+ description: Detailed information about each subnet
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ subnets:
+ type: map
+ description: Network related subnets
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.neutron.Subnet
+ capabilities:
+ attachment:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
new file mode 100644
index 0000000000..05ab81741d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
@@ -0,0 +1,84 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: ContrailVirtualNetworkGlobalType
+ template_version: 1.0.0
+description: Contrail Virtual Network Global Types
+imports:
+ common_definitions:
+ file: CommonGlobalTypesServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork:
+ derived_from: tosca.nodes.network.Network
+ properties:
+ shared:
+ type: string
+ description: Is virtual network shared
+ required: false
+ status: SUPPORTED
+ forwarding_mode:
+ type: string
+ description: forwarding mode of the virtual network
+ required: false
+ status: SUPPORTED
+ external:
+ type: string
+ description: Is virtual network external
+ required: false
+ status: SUPPORTED
+ allow_transit:
+ type: string
+ description: Whether this network should be transitive.
+ required: false
+ status: SUPPORTED
+ flood_unknown_unicast:
+ type: string
+ description: flood L2 packets on network
+ required: false
+ status: SUPPORTED
+ route_targets:
+ type: list
+ description: route targets associated with the virtual network
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ subnets:
+ type: map
+ description: Network related subnets
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.neutron.Subnet
+ attributes:
+ fq_name:
+ type: string
+ description: fq_name
+ status: SUPPORTED
+ show:
+ type: string
+ description: All attributes.
+ status: SUPPORTED
+ subnets_name:
+ type: list
+ description: Subnets name of this network
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ subnets_show:
+ type: map
+ description: Detailed information about each subnet
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ subnets:
+ type: map
+ description: Network related subnets
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.neutron.Subnet
+ capabilities:
+ attachment:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..251525391b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,196 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cmaui:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ cmaui_cinder_volume_size:
+ label: CMAUI Cinder volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: the size of the CMAUI Cinder volume
+ timezone:
+ label: timezone
+ hidden: false
+ immutable: false
+ type: string
+ description: timezone
+ security_group_name:
+ label: security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of security group
+ oam_network_netmask:
+ label: oam network netmask
+ hidden: false
+ immutable: false
+ type: string
+ description: oam network gateway
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ vnf_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-CMAUI_id
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ oam_network_gateway:
+ label: oam network gateway
+ hidden: false
+ immutable: false
+ type: string
+ description: oam network gateway
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ label: CMAUI oam_net IP addresses
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI oam_net IP addresses
+ entry_schema:
+ type: string
+ external_dns:
+ label: dns server
+ hidden: false
+ immutable: false
+ type: string
+ description: dns server
+ oam_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ external_ntp:
+ label: ntp server
+ hidden: false
+ immutable: false
+ type: string
+ description: ntp server
+ CMAUI_volume_type:
+ label: CMAUI vm volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the target volume backend
+ node_templates:
+ server_cmaui:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ user_data_format: RAW
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ requirements:
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: cmaui_volume
+ relationship: tosca.relationships.DependsOn
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: cmaui_port_0
+ relationship: tosca.relationships.DependsOn
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: cmaui_volume
+ relationship: cmaui_volume_attachment
+ cmaui_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: CMAUI_volume_type
+ size: '(get_input : cmaui_cinder_volume_size) * 1024'
+ cmaui_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ relationship_templates:
+ cmaui_volume_attachment:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id: cmaui_volume
+ instance_uuid: server_cmaui
+ groups:
+ hot_template:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/hot_template.yml
+ description: cmaui server template for vMMSC
+ members:
+ - server_cmaui
+ - cmaui_volume
+ - cmaui_port_0 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/NativeTypesServiceTemplateServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/NativeTypesServiceTemplateServiceTemplate.yaml
new file mode 100644
index 0000000000..27c64039f1
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/NativeTypesServiceTemplateServiceTemplate.yaml
@@ -0,0 +1,205 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: NativeTypesServiceTemplate
+ template_version: 1.0.0
+description: TOSCA Native Node Types
+node_types:
+ tosca.nodes.Compute:
+ derived_from: tosca.nodes.Root
+ attributes:
+ private_address:
+ type: string
+ description: private address
+ status: SUPPORTED
+ public_address:
+ type: string
+ description: public_address
+ status: SUPPORTED
+ networks:
+ type: map
+ description: networks
+ status: SUPPORTED
+ entry_schema:
+ type: tosca.datatypes.network.NetworkInfo
+ ports:
+ type: map
+ description: ports
+ status: SUPPORTED
+ entry_schema:
+ type: tosca.datatypes.network.PortInfo
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ capabilities:
+ scalable:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ tosca.nodes.network.Port:
+ derived_from: tosca.nodes.Root
+ properties:
+ ip_range_end:
+ type: string
+ required: false
+ status: SUPPORTED
+ ip_range_start:
+ type: string
+ required: false
+ status: SUPPORTED
+ ip_address:
+ type: string
+ required: false
+ status: SUPPORTED
+ is_default:
+ type: boolean
+ required: false
+ default: false
+ status: SUPPORTED
+ order:
+ type: integer
+ required: true
+ default: 0
+ status: SUPPORTED
+ constraints:
+ - greater_or_equal: 0
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.BindsTo
+ occurrences:
+ - 1
+ - 1
+ tosca.nodes.Root:
+ attributes:
+ tosca_name:
+ type: string
+ description: tosca name
+ status: SUPPORTED
+ state:
+ type: string
+ description: state
+ status: SUPPORTED
+ tosca_id:
+ type: string
+ description: tosca id
+ status: SUPPORTED
+ interfaces: {
+ }
+ tosca.nodes.network.Network:
+ derived_from: tosca.nodes.Root
+ properties:
+ physical_network:
+ type: string
+ required: false
+ status: SUPPORTED
+ dhcp_enabled:
+ type: boolean
+ required: false
+ default: true
+ status: SUPPORTED
+ segmentation_id:
+ type: string
+ required: false
+ status: SUPPORTED
+ network_id:
+ type: string
+ required: false
+ status: SUPPORTED
+ ip_version:
+ type: integer
+ required: false
+ default: 4
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - 4
+ - 6
+ start_ip:
+ type: string
+ required: false
+ status: SUPPORTED
+ network_name:
+ type: string
+ required: false
+ status: SUPPORTED
+ cidr:
+ type: string
+ required: false
+ status: SUPPORTED
+ gateway_ip:
+ type: string
+ required: false
+ status: SUPPORTED
+ network_type:
+ type: string
+ required: false
+ status: SUPPORTED
+ end_ip:
+ type: string
+ required: false
+ status: SUPPORTED
+ capabilities:
+ link:
+ type: tosca.capabilities.network.Linkable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ tosca.nodes.BlockStorage:
+ derived_from: tosca.nodes.Root
+ properties:
+ size:
+ type: scalar-unit.size
+ required: false
+ status: SUPPORTED
+ constraints:
+ - greater_or_equal: 1 MB
+ volume_id:
+ type: string
+ required: false
+ status: SUPPORTED
+ snapshot_id:
+ type: string
+ required: false
+ status: SUPPORTED
+ capabilities:
+ attachment:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/NeutronNetGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/NeutronNetGlobalTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..e80e2727c7
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/NeutronNetGlobalTypesServiceTemplate.yaml
@@ -0,0 +1,97 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: NeutronNetGlobalTypes
+ template_version: 1.0.0
+description: Neutron Network TOSCA Global Types
+imports:
+ common_definitions:
+ file: CommonGlobalTypesServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vl.nodes.heat.network.neutron.Net:
+ derived_from: tosca.nodes.network.Network
+ properties:
+ dhcp_agent_ids:
+ type: list
+ description: The IDs of the DHCP agent to schedule the network
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ tenant_id:
+ type: string
+ description: The ID of the tenant which will own the network
+ required: false
+ status: SUPPORTED
+ port_security_enabled:
+ type: boolean
+ description: Flag to enable/disable port security on the network
+ required: false
+ status: SUPPORTED
+ shared:
+ type: boolean
+ description: Whether this network should be shared across all tenants
+ required: false
+ default: false
+ status: SUPPORTED
+ admin_state_up:
+ type: boolean
+ description: A boolean value specifying the administrative status of the network
+ required: false
+ default: true
+ status: SUPPORTED
+ qos_policy:
+ type: string
+ description: The name or ID of QoS policy to attach to this network
+ required: false
+ status: SUPPORTED
+ subnets:
+ type: map
+ description: Network related subnets
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.neutron.Subnet
+ value_specs:
+ type: map
+ description: Extra parameters to include in the request
+ required: false
+ default: {
+ }
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ attributes:
+ qos_policy_id:
+ type: string
+ description: The QoS policy ID attached to this network
+ status: SUPPORTED
+ show:
+ type: string
+ description: Detailed information about resource
+ status: SUPPORTED
+ subnets_name:
+ type: list
+ description: Subnets name of this network
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ subnets:
+ type: map
+ description: Network related subnets
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.neutron.Subnet
+ mtu:
+ type: scalar-unit.size
+ description: The maximum transmission unit size(in bytes) for the network
+ status: SUPPORTED
+ status:
+ type: string
+ description: The status of the network
+ status: SUPPORTED
+ capabilities:
+ attachment:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/NeutronPortGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/NeutronPortGlobalTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..a337d6ed18
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/NeutronPortGlobalTypesServiceTemplate.yaml
@@ -0,0 +1,151 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: NeutronPortGlobalTypes
+ template_version: 1.0.0
+description: Neutron Port TOSCA Global Types
+imports:
+ common_definitions:
+ file: CommonGlobalTypesServiceTemplate.yaml
+data_types:
+ org.openecomp.datatypes.heat.neutron.port.FixedIps:
+ derived_from: tosca.datatypes.Root
+ description: subnet/ip_address
+ properties:
+ subnet:
+ type: string
+ description: Subnet in which to allocate the IP address for this port
+ required: false
+ status: SUPPORTED
+ ip_address:
+ type: string
+ description: IP address desired in the subnet for this port
+ required: false
+ status: SUPPORTED
+node_types:
+ org.openecomp.resource.cp.nodes.heat.network.neutron.Port:
+ derived_from: tosca.nodes.network.Port
+ properties:
+ port_security_enabled:
+ type: boolean
+ description: Flag to enable/disable port security on the network
+ required: false
+ status: SUPPORTED
+ device_id:
+ type: string
+ description: Device ID of this port
+ required: false
+ status: SUPPORTED
+ qos_policy:
+ type: string
+ description: The name or ID of QoS policy to attach to this network
+ required: false
+ status: SUPPORTED
+ allowed_address_pairs:
+ type: list
+ description: Additional MAC/IP address pairs allowed to pass through the port
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.AddressPair
+ binding:vnic_type:
+ type: string
+ description: The vnic type to be bound on the neutron port
+ required: false
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - macvtap
+ - direct
+ - normal
+ value_specs:
+ type: map
+ description: Extra parameters to include in the request
+ required: false
+ default: {
+ }
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ device_owner:
+ type: string
+ description: Name of the network owning the port
+ required: false
+ status: SUPPORTED
+ network:
+ type: string
+ description: Network this port belongs to
+ required: false
+ status: SUPPORTED
+ replacement_policy:
+ type: string
+ description: Policy on how to respond to a stack-update for this resource
+ required: false
+ default: AUTO
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - REPLACE_ALWAYS
+ - AUTO
+ security_groups:
+ type: list
+ description: List of security group names or IDs
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ fixed_ips:
+ type: list
+ description: Desired IPs for this port
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.neutron.port.FixedIps
+ mac_address:
+ type: string
+ description: MAC address to give to this port
+ required: false
+ status: SUPPORTED
+ admin_state_up:
+ type: boolean
+ description: A boolean value specifying the administrative status of the network
+ required: false
+ default: true
+ status: SUPPORTED
+ name:
+ type: string
+ description: A symbolic name for this port
+ required: false
+ status: SUPPORTED
+ attributes:
+ tenant_id:
+ type: string
+ description: Tenant owning the port
+ status: SUPPORTED
+ network_id:
+ type: string
+ description: Unique identifier for the network owning the port
+ status: SUPPORTED
+ qos_policy_id:
+ type: string
+ description: The QoS policy ID attached to this network
+ status: SUPPORTED
+ show:
+ type: string
+ description: Detailed information about resource
+ status: SUPPORTED
+ subnets:
+ type: list
+ description: Subnets of this network
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ status:
+ type: string
+ description: The status of the network
+ status: SUPPORTED
+ capabilities:
+ attachment:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/NeutronSecurityRulesGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..1cbef86d8d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
@@ -0,0 +1,116 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: NeutronSecurityRulesGlobalTypes
+ template_version: 1.0.0
+description: Neutron Security Rules TOSCA Global Types
+imports:
+ common_definitions:
+ file: CommonGlobalTypesServiceTemplate.yaml
+data_types:
+ org.openecomp.datatypes.heat.network.neutron.SecurityRules.Rule:
+ derived_from: tosca.datatypes.Root
+ description: Rules Pairs
+ properties:
+ remote_group_id:
+ type: string
+ description: The remote group ID to be associated with this security group rule
+ required: false
+ status: SUPPORTED
+ protocol:
+ type: string
+ description: The protocol that is matched by the security group rule
+ required: false
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - tcp
+ - udp
+ - icmp
+ ethertype:
+ type: string
+ description: Ethertype of the traffic
+ required: false
+ default: IPv4
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - IPv4
+ - IPv6
+ port_range_max:
+ type: integer
+ description: 'The maximum port number in the range that is matched by the
+ security group rule. '
+ required: false
+ status: SUPPORTED
+ constraints:
+ - in_range:
+ - 0
+ - 65535
+ remote_ip_prefix:
+ type: string
+ description: The remote IP prefix (CIDR) to be associated with this security group rule
+ required: false
+ status: SUPPORTED
+ remote_mode:
+ type: string
+ description: Whether to specify a remote group or a remote IP prefix
+ required: false
+ default: remote_ip_prefix
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - remote_ip_prefix
+ - remote_group_id
+ direction:
+ type: string
+ description: The direction in which the security group rule is applied
+ required: false
+ default: ingress
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - egress
+ - ingress
+ port_range_min:
+ type: integer
+ description: The minimum port number in the range that is matched by the security group rule.
+ required: false
+ status: SUPPORTED
+ constraints:
+ - in_range:
+ - 0
+ - 65535
+node_types:
+ org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules:
+ derived_from: tosca.nodes.Root
+ properties:
+ name:
+ type: string
+ description: A symbolic name for this security group, which is not required to be unique.
+ required: false
+ status: SUPPORTED
+ description:
+ type: string
+ description: Description of the security group
+ required: false
+ status: SUPPORTED
+ rules:
+ type: list
+ description: List of security group rules
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.neutron.SecurityRules.Rule
+ attributes:
+ show:
+ type: string
+ description: Detailed information about resource
+ status: SUPPORTED
+ requirements:
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ relationship: org.openecomp.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/NovaServerGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/NovaServerGlobalTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..0ec79f5229
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/NovaServerGlobalTypesServiceTemplate.yaml
@@ -0,0 +1,249 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: NovaServerGlobalTypes
+ template_version: 1.0.0
+description: Nova Server TOSCA Global Types
+imports:
+ common_definitions:
+ file: CommonGlobalTypesServiceTemplate.yaml
+data_types:
+ org.openecomp.datatypes.heat.novaServer.network.PortExtraProperties:
+ derived_from: tosca.datatypes.Root
+ description: Nova server network expand properties for port
+ properties:
+ port_security_enabled:
+ type: boolean
+ description: Flag to enable/disable port security on the port
+ required: false
+ status: SUPPORTED
+ mac_address:
+ type: string
+ description: MAC address to give to this port
+ required: false
+ status: SUPPORTED
+ admin_state_up:
+ type: boolean
+ description: The administrative state of this port
+ required: false
+ default: true
+ status: SUPPORTED
+ qos_policy:
+ type: string
+ description: The name or ID of QoS policy to attach to this port
+ required: false
+ status: SUPPORTED
+ allowed_address_pairs:
+ type: list
+ description: Additional MAC/IP address pairs allowed to pass through the port
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.AddressPair
+ binding:vnic_type:
+ type: string
+ description: The vnic type to be bound on the neutron port
+ required: false
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - macvtap
+ - direct
+ - normal
+ value_specs:
+ type: map
+ description: Extra parameters to include in the request
+ required: false
+ default: {
+ }
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ org.openecomp.datatypes.heat.novaServer.network.AddressInfo:
+ derived_from: tosca.datatypes.network.NetworkInfo
+ description: Network addresses with corresponding port id
+ properties:
+ port_id:
+ type: string
+ description: Port id
+ required: false
+ status: SUPPORTED
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.nova.Server:
+ derived_from: tosca.nodes.Compute
+ properties:
+ admin_pass:
+ type: string
+ description: The administrator password for the server
+ required: false
+ status: SUPPORTED
+ availability_zone:
+ type: string
+ description: Availability zone to create servers in
+ required: false
+ status: SUPPORTED
+ image:
+ type: string
+ description: The ID or name of the image to boot with
+ required: false
+ status: SUPPORTED
+ image_update_policy:
+ type: string
+ description: Policy on how to apply an image-id update
+ required: false
+ default: REBUILD
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - REBUILD_PRESERVE_EPHEMERAL
+ - REPLACE
+ - REBUILD
+ metadata:
+ type: json
+ description: Arbitrary JSON metadata to store for this server
+ required: false
+ status: SUPPORTED
+ contrail_service_instance_ind:
+ type: boolean
+ description: Nova server related to service instance indicator
+ required: false
+ default: false
+ status: SUPPORTED
+ user_data_update_policy:
+ type: string
+ description: Policy on how to apply a user_data update
+ required: false
+ default: REPLACE
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - REPLACE
+ - IGNORE
+ flavor_update_policy:
+ type: string
+ description: Policy on how to apply a flavor update
+ required: false
+ default: RESIZE
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - RESIZE
+ - REPLACE
+ user_data:
+ type: string
+ description: User data script to be executed by cloud-init
+ required: false
+ default: ''
+ status: SUPPORTED
+ flavor:
+ type: string
+ description: The ID or name of the flavor to boot onto
+ required: true
+ status: SUPPORTED
+ key_name:
+ type: string
+ description: Name of keypair to inject into the server
+ required: false
+ status: SUPPORTED
+ reservation_id:
+ type: string
+ description: A UUID for the set of servers being requested
+ required: false
+ status: SUPPORTED
+ security_groups:
+ type: list
+ description: List of security group names or IDs
+ required: false
+ default: [
+ ]
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ config_drive:
+ type: boolean
+ description: enable config drive on the server
+ required: false
+ status: SUPPORTED
+ personality:
+ type: map
+ description: A map of files to create/overwrite on the server upon boot
+ required: false
+ default: {
+ }
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ software_config_transport:
+ type: string
+ description: How the server should receive the metadata required for software configuration
+ required: false
+ default: POLL_SERVER_CFN
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - POLL_SERVER_CFN
+ - POLL_SERVER_HEAT
+ - POLL_TEMP_URL
+ - ZAQAR_MESSAGE
+ user_data_format:
+ type: string
+ description: How the user_data should be formatted for the server
+ required: false
+ default: HEAT_CFNTOOLS
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - SOFTWARE_CONFIG
+ - RAW
+ - HEAT_CFNTOOLS
+ diskConfig:
+ type: string
+ description: Control how the disk is partitioned when the server is created
+ required: false
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - AUTO
+ - MANUAL
+ name:
+ type: string
+ description: Server name
+ required: false
+ status: SUPPORTED
+ scheduler_hints:
+ type: map
+ description: Arbitrary key-value pairs specified by the client to help boot a server
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ attributes:
+ accessIPv4:
+ type: string
+ description: The manually assigned alternative public IPv4 address of the server
+ status: SUPPORTED
+ addresses:
+ type: map
+ description: A dict of all network addresses with corresponding port_id
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.novaServer.network.AddressInfo
+ accessIPv6:
+ type: string
+ description: The manually assigned alternative public IPv6 address of the server
+ status: SUPPORTED
+ instance_name:
+ type: string
+ description: AWS compatible instance name
+ status: SUPPORTED
+ name:
+ type: string
+ description: Name of the server
+ status: SUPPORTED
+ show:
+ type: string
+ description: Detailed information about resource
+ status: SUPPORTED
+ console_urls:
+ type: string
+ description: URLs of servers consoles
+ status: SUPPORTED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..b2916ccf9c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/inputfiles/MANIFEST.json
@@ -0,0 +1,11 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot_template.yml",
+ "type": "HEAT"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/inputfiles/hot_template.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/inputfiles/hot_template.yml
new file mode 100644
index 0000000000..574c0ac118
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/inputfiles/hot_template.yml
@@ -0,0 +1,122 @@
+heat_template_version: 2013-05-23
+
+#################################
+#
+# Changes from MSO 01/26/2016
+# Updated per ECOMP feedback
+#
+#################################
+
+description: cmaui server template for vMMSC
+
+parameters:
+ vnf_id:
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-CMAUI_id
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_cinder_volume_size:
+ type: number
+ label: CMAUI Cinder volume size
+ description: the size of the CMAUI Cinder volume
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ oam_net_name:
+ type: string
+ description: UID of OAM network
+ oam_network_netmask:
+ type: string
+ label: oam network netmask
+ description: oam network gateway
+ oam_network_gateway:
+ type: string
+ label: oam network gateway
+ description: oam network gateway
+ external_dns:
+ type: string
+ label: dns server
+ description: dns server
+ external_ntp:
+ type: string
+ label: ntp server
+ description: ntp server
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ timezone:
+ type: string
+ label: timezone
+ description: timezone
+ cmaui_oam_ips:
+ type: comma_delimited_list
+ label: CMAUI oam_net IP addresses
+ description: CMAUI oam_net IP addresses
+ CMAUI_volume_type:
+ type: string
+ label: CMAUI vm volume type
+ description: the name of the target volume backend
+
+resources:
+
+ cmaui_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ cmaui_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: cmaui_cinder_volume_size}
+ volume_type: {get_param: CMAUI_volume_type}
+
+ cmaui_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: cmaui_volume}
+ instance_uuid: {get_resource: server_cmaui}
+
+ server_cmaui:
+ type: OS::Nova::Server
+ depends_on: [ cmaui_volume,cmaui_port_0]
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_0 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ cmaui.mgmt.ip=${cmaui.mgmt.ip}
+ cmaui.mgmt.netmask=${cmaui.mgmt.netmask}
+ cmaui.mgmt.gateway=${cmaui.mgmt.gateway}
+ cmaui.external.dns=${cmaui.external.dns}
+ cmaui.external.ntp=${cmaui.external.ntp}
+ cmaui.node=${cmaui.node}
+ cmaui.timezone=${cmaui.timezone}
+ params:
+ ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]}
+ ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${cmaui.external.dns}: {get_param: external_dns}
+ ${cmaui.external.ntp}: {get_param: external_ntp}
+ ${cmaui.node}: {get_param: [cmaui_names, 0]}
+ ${cmaui.timezone}: {get_param: timezone}
+ user_data_format: RAW \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-mog-0108-bs1271/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-mog-0108-bs1271/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..c60020d80c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-mog-0108-bs1271/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,1459 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.pd_server:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.ps_server:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.sm_server:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.cm_server:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.oam_server:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ pd_flavor_name:
+ label: PD flavor name
+ hidden: false
+ immutable: false
+ type: string
+ description: flavor name of PD instance
+ default: m3.xlarge
+ availabilityzone_name:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ default: nova
+ repl_net_ips:
+ label: repl network ips
+ hidden: false
+ immutable: false
+ type: list
+ description: ips of repl network
+ default:
+ - 107.239.33.57
+ - 107.239.33.58
+ entry_schema:
+ type: string
+ sl_net_name:
+ label: silver lining network name
+ hidden: false
+ immutable: false
+ type: string
+ description: id of the sl network
+ default: exn_protected_net_0
+ pd_image_name:
+ label: image name
+ hidden: false
+ immutable: false
+ type: string
+ description: PD image name
+ default: MOG_BASE_8.0
+ mog_script_name:
+ label: mog Config script name
+ hidden: false
+ immutable: false
+ type: string
+ description: Config script name
+ default: http://10.147.38.210:8080/v1/AUTH_8e501b8121f34a6eaaf526d3305985cc/mogtestcontainer/mog-cloudinit.sh
+ pd_server_names:
+ label: PD server names
+ hidden: false
+ immutable: false
+ type: list
+ description: name of the PD instance
+ default:
+ - ZRDM1MOGX01MPD001
+ - ZRDM1MOGX01MPD002
+ entry_schema:
+ type: string
+ sm_server_names:
+ label: SM server names
+ hidden: false
+ immutable: false
+ type: list
+ description: name of the SM instance
+ default:
+ - ZRDM1MOGX01MSM001
+ - ZRDM1MOGX01MSM002
+ entry_schema:
+ type: string
+ dummy_net_netmask_1:
+ hidden: false
+ immutable: false
+ type: string
+ description: CSB internal network subnet mask
+ default: 255.255.255.0
+ dummy_net_netmask_0:
+ hidden: false
+ immutable: false
+ type: string
+ description: CSB internal network subnet mask
+ default: 255.255.255.0
+ ran_net_floating_ip:
+ label: mog ran net virtual ip
+ hidden: false
+ immutable: false
+ type: string
+ description: mog ran net virtual ip
+ default: 107.239.36.5
+ ran_net_ips:
+ label: RAN network ips
+ hidden: false
+ immutable: false
+ type: list
+ description: RAN network ip
+ default:
+ - 107.239.36.3
+ - 107.239.36.4
+ entry_schema:
+ type: string
+ dummy_net_end_0:
+ label: csb internal end
+ hidden: false
+ immutable: false
+ type: string
+ description: csb internal end
+ default: 169.254.1.254
+ oam_image_name:
+ label: image name
+ hidden: false
+ immutable: false
+ type: string
+ description: OAM image name
+ default: MOG_BASE_8.0
+ dummy_net_end_1:
+ label: csb internal end
+ hidden: false
+ immutable: false
+ type: string
+ description: csb internal end
+ default: 169.254.2.254
+ oam_net_name:
+ label: oam network name
+ hidden: false
+ immutable: false
+ type: string
+ description: name of the oam network
+ default: oam_protected_net_0
+ oam_net_ips:
+ label: internet network ips
+ hidden: false
+ immutable: false
+ type: list
+ description: ip of the OAM network
+ default:
+ - 107.250.172.213
+ - 107.250.172.214
+ - 107.250.172.215
+ - 107.250.172.216
+ - 107.250.172.217
+ entry_schema:
+ type: string
+ ran_net_name:
+ label: RAN network name
+ hidden: false
+ immutable: false
+ type: string
+ description: RAN network name
+ default: gn_direct_net_0
+ cluster-manager-vol-1:
+ label: mog-cm-vol-1
+ hidden: false
+ immutable: false
+ type: string
+ description: Cluster Manager volume 1
+ default: 43ccf5ba-2d50-427b-a38f-e8c7d8670eee
+ cluster-manager-vol-2:
+ label: mog-cm-vol-2
+ hidden: false
+ immutable: false
+ type: string
+ description: Cluster Manager volume 2 with ISO image
+ default: 6f92e211-2d61-487d-8f84-d2d00cea3698
+ csb_net_netmask:
+ hidden: false
+ immutable: false
+ type: string
+ description: CSB internal network subnet mask
+ default: 255.255.255.0
+ oam_flavor_name:
+ label: OAM flavor name
+ hidden: false
+ immutable: false
+ type: string
+ description: flavor name of OAM instance
+ default: m3.xlarge
+ dummy_net_start_0:
+ label: csb internal start
+ hidden: false
+ immutable: false
+ type: string
+ description: csb internal start
+ default: 169.254.1.4
+ dummy_net_start_1:
+ label: csb internal start
+ hidden: false
+ immutable: false
+ type: string
+ description: csb internal start
+ default: 169.254.2.4
+ cm_flavor_name:
+ label: CM flavor name
+ hidden: false
+ immutable: false
+ type: string
+ description: flavor name of CM instance
+ default: m3.xlarge
+ sm_image_name:
+ label: image name
+ hidden: false
+ immutable: false
+ type: string
+ description: SM image name
+ default: MOG_BASE_8.0
+ mog_parameter_name:
+ label: mog script parameter name
+ hidden: false
+ immutable: false
+ type: string
+ description: Config script parameter csv file name
+ default: http://10.147.38.210:8080/v1/AUTH_8e501b8121f34a6eaaf526d3305985cc/mogtestcontainer
+ ps_server_names:
+ label: PS server names
+ hidden: false
+ immutable: false
+ type: list
+ description: name of the PS instance
+ default:
+ - ZRDM1MOGX01MPS001
+ - ZRDM1MOGX01MPS002
+ - ZRDM1MOGX01MPS003
+ - ZRDM1MOGX01MPS004
+ entry_schema:
+ type: string
+ csb_net_ips:
+ hidden: false
+ immutable: false
+ type: list
+ description: mog_csb_net IP addresses
+ default:
+ - 172.26.0.10
+ - 172.26.0.11
+ - 172.26.0.12
+ - 172.26.0.13
+ - 172.26.0.14
+ - 172.26.0.15
+ - 172.26.0.16
+ - 172.26.0.17
+ - 172.26.0.18
+ - 172.26.0.19
+ - 172.26.0.20
+ entry_schema:
+ type: string
+ ps_flavor_name:
+ label: PS flavor name
+ hidden: false
+ immutable: false
+ type: string
+ description: flavor name of PS instance
+ default: m3.xlarge
+ rx_net_ips:
+ label: Rx network ips
+ hidden: false
+ immutable: false
+ type: list
+ description: Rx network ips
+ default:
+ - 107.239.34.3
+ - 107.239.34.4
+ entry_schema:
+ type: string
+ dummy_net_name_1:
+ label: csb internal network name
+ hidden: false
+ immutable: false
+ type: string
+ description: csb internal network name
+ default: mog_dummy_1
+ dummy_net_cidr_1:
+ label: csb ineternal cidr
+ hidden: false
+ immutable: false
+ type: string
+ description: csb internal cidr
+ default: 169.254.2.0/24
+ dummy_net_name_0:
+ label: csb internal network name
+ hidden: false
+ immutable: false
+ type: string
+ description: csb internal network name
+ default: mog_dummy_0
+ dummy_net_cidr_0:
+ label: csb ineternal cidr
+ hidden: false
+ immutable: false
+ type: string
+ description: csb internal cidr
+ default: 169.254.1.0/24
+ mog_swift_container:
+ label: mog Config URL
+ hidden: false
+ immutable: false
+ type: string
+ description: Config URL
+ default: http://10.147.38.210:8080/v1/AUTH_8e501b8121f34a6eaaf526d3305985cc/mogtestcontainer
+ oam-vol-2:
+ label: mog-oam-vol-2
+ hidden: false
+ immutable: false
+ type: string
+ description: OAM volume 2
+ default: 6d169cb6-6ddc-41dc-920c-2839898a2924
+ sl_net_floating_ip:
+ label: mog sl net virtual ip
+ hidden: false
+ immutable: false
+ type: string
+ description: mog sl net virtual ip
+ default: 107.239.45.6
+ session-manager-vol-1:
+ label: mog-sm-vol-1
+ hidden: false
+ immutable: false
+ type: string
+ description: Session Manager volume 1
+ default: 49201898-333d-4c88-b58d-cf573b091633
+ rx_net_floating_ip:
+ label: mog rx net virtual ip
+ hidden: false
+ immutable: false
+ type: string
+ description: mog rx net virtual ip
+ default: 107.239.34.5
+ session-manager-vol-2:
+ label: mog-sm-vol-2
+ hidden: false
+ immutable: false
+ type: string
+ description: Session Manager volume 2
+ default: 4c35b5f1-ce99-4220-a6e2-cda6e2d713a0
+ oam-vol-1:
+ label: mog-oam-vol-1
+ hidden: false
+ immutable: false
+ type: string
+ description: OAM volume 1
+ default: 0a7fcd9e-2624-401d-ac21-b0191f85ec77
+ csb_net_start:
+ label: csb internal start
+ hidden: false
+ immutable: false
+ type: string
+ description: csb internal start
+ default: 172.26.0.1
+ cm_image_name:
+ label: image name
+ hidden: false
+ immutable: false
+ type: string
+ description: CM image name
+ default: MOG_BASE_8.0
+ sm_flavor_name:
+ label: SM flavor name
+ hidden: false
+ immutable: false
+ type: string
+ description: flavor name of SM instance
+ default: m2.xlarge4
+ ps_image_name:
+ label: PS image name
+ hidden: false
+ immutable: false
+ type: string
+ description: PS image name
+ default: MOG_BASE_8.0
+ oam_server_names:
+ label: OAM server names
+ hidden: false
+ immutable: false
+ type: list
+ description: name of the OAM instance
+ default:
+ - ZRDM1MOGX01OAM001
+ - ZRDM1MOGX01OAM002
+ entry_schema:
+ type: string
+ csb_net_cidr:
+ label: csb ineternal cidr
+ hidden: false
+ immutable: false
+ type: string
+ description: csb internal cidr
+ default: 172.26.0.0/24
+ cm_server_names:
+ label: CM server names
+ hidden: false
+ immutable: false
+ type: list
+ description: name of the CM instance
+ default:
+ - ZRDM1MOGX01MCM001
+ entry_schema:
+ type: string
+ sl_net_ips:
+ label: silver lining network ips
+ hidden: false
+ immutable: false
+ type: list
+ description: ips of the sl network
+ default:
+ - 107.239.45.4
+ - 107.239.45.5
+ entry_schema:
+ type: string
+ rx_net_name:
+ label: Rx network name
+ hidden: false
+ immutable: false
+ type: string
+ description: Rx network name
+ default: cor_direct_net_1
+ repl_net_name:
+ label: Replication network name
+ hidden: false
+ immutable: false
+ type: string
+ description: name of the replication network
+ default: cor_direct_net_0
+ security_group_name:
+ label: security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of security group
+ default: mog_security_group
+ csb_net_end:
+ label: csb internal end
+ hidden: false
+ immutable: false
+ type: string
+ description: csb internal end
+ default: 172.26.0.254
+ csb_net_name:
+ label: csb internal network name
+ hidden: false
+ immutable: false
+ type: string
+ description: csb internal network name
+ default: int_mog_csb_net
+ mog_script_dir:
+ label: mog Config script directory
+ hidden: false
+ immutable: false
+ type: string
+ description: Config script directory
+ default: /root
+ node_templates:
+ cm01_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - mog_security_group
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - oam_net_ips
+ - 4
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cm01
+ relationship: tosca.relationships.network.BindsTo
+ cm01_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - mog_security_group
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - csb_net_ips
+ - 10
+ network: csb_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: csb_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cm01
+ relationship: tosca.relationships.network.BindsTo
+ sm02_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - mog_security_group
+ network: csb_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: csb_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_sm02
+ relationship: tosca.relationships.network.BindsTo
+ server_ps04:
+ type: org.openecomp.resource.vfc.nodes.heat.ps_server
+ properties:
+ flavor:
+ get_input: ps_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: ps_image_name
+ user_data_format: RAW
+ name:
+ get_input:
+ - ps_server_names
+ - 3
+ scheduler_hints:
+ group: servergroup_mog03
+ server_ps03:
+ type: org.openecomp.resource.vfc.nodes.heat.ps_server
+ properties:
+ flavor:
+ get_input: ps_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: ps_image_name
+ user_data_format: RAW
+ name:
+ get_input:
+ - ps_server_names
+ - 2
+ scheduler_hints:
+ group: servergroup_mog03
+ sm01_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - mog_security_group
+ network: csb_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: csb_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_sm01
+ relationship: tosca.relationships.network.BindsTo
+ sm02_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - mog_security_group
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - repl_net_ips
+ - 1
+ network:
+ get_input: repl_net_name
+ server_ps02:
+ type: org.openecomp.resource.vfc.nodes.heat.ps_server
+ properties:
+ flavor:
+ get_input: ps_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: ps_image_name
+ user_data_format: RAW
+ name:
+ get_input:
+ - ps_server_names
+ - 1
+ scheduler_hints:
+ group: servergroup_mog03
+ sm01_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - mog_security_group
+ network: dummy_net_0
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: dummy_net_0
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_sm01
+ relationship: tosca.relationships.network.BindsTo
+ sm02_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - mog_security_group
+ network: dummy_net_0
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: dummy_net_0
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_sm02
+ relationship: tosca.relationships.network.BindsTo
+ server_ps01:
+ type: org.openecomp.resource.vfc.nodes.heat.ps_server
+ properties:
+ flavor:
+ get_input: ps_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: ps_image_name
+ user_data_format: RAW
+ name:
+ get_input:
+ - ps_server_names
+ - 0
+ scheduler_hints:
+ group: servergroup_mog03
+ csb_net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ dhcp_enabled: true
+ network_name:
+ get_input: csb_net_name
+ subnets:
+ csb_ip_subnet:
+ enable_dhcp: true
+ name:
+ get_input: csb_net_name
+ cidr:
+ get_input: csb_net_cidr
+ allocation_pools:
+ - start:
+ get_input: csb_net_start
+ end:
+ get_input: csb_net_end
+ sm01_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - mog_security_group
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - repl_net_ips
+ - 0
+ network:
+ get_input: repl_net_name
+ pd01_port_5:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - mog_security_group
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - ran_net_ips
+ - 0
+ allowed_address_pairs:
+ - ip_address:
+ get_input: ran_net_floating_ip
+ network:
+ get_input: ran_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_pd_01
+ relationship: tosca.relationships.network.BindsTo
+ pd01_port_4:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - mog_security_group
+ network: dummy_net_1
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: dummy_net_1
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_pd_01
+ relationship: tosca.relationships.network.BindsTo
+ pd02_port_5:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - mog_security_group
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - ran_net_ips
+ - 1
+ allowed_address_pairs:
+ - ip_address:
+ get_input: ran_net_floating_ip
+ network:
+ get_input: ran_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_pd_02
+ relationship: tosca.relationships.network.BindsTo
+ pd01_port_6:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - mog_security_group
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - sl_net_ips
+ - 0
+ allowed_address_pairs:
+ - ip_address:
+ get_input: sl_net_floating_ip
+ network:
+ get_input: sl_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_pd_01
+ relationship: tosca.relationships.network.BindsTo
+ pd02_port_6:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - mog_security_group
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - sl_net_ips
+ - 1
+ allowed_address_pairs:
+ - ip_address:
+ get_input: sl_net_floating_ip
+ network:
+ get_input: sl_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_pd_02
+ relationship: tosca.relationships.network.BindsTo
+ server_sm02:
+ type: org.openecomp.resource.vfc.nodes.heat.sm_server
+ properties:
+ flavor:
+ get_input: sm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: sm_image_name
+ user_data_format: RAW
+ name:
+ get_input:
+ - sm_server_names
+ - 1
+ scheduler_hints:
+ group: servergroup_mog02
+ ps02_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - mog_security_group
+ network: csb_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: csb_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_ps02
+ relationship: tosca.relationships.network.BindsTo
+ ps04_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - mog_security_group
+ network: csb_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: csb_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_ps04
+ relationship: tosca.relationships.network.BindsTo
+ ps03_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - mog_security_group
+ network: csb_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: csb_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_ps03
+ relationship: tosca.relationships.network.BindsTo
+ ps01_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - mog_security_group
+ network: csb_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: csb_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_ps01
+ relationship: tosca.relationships.network.BindsTo
+ server_sm01:
+ type: org.openecomp.resource.vfc.nodes.heat.sm_server
+ properties:
+ flavor:
+ get_input: sm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: sm_image_name
+ user_data_format: RAW
+ name:
+ get_input:
+ - sm_server_names
+ - 0
+ scheduler_hints:
+ group: servergroup_mog02
+ dummy_net_0:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ dhcp_enabled: true
+ network_name:
+ get_input: dummy_net_name_0
+ subnets:
+ dummy_ip_subnet_0:
+ enable_dhcp: true
+ name:
+ get_input: dummy_net_name_0
+ cidr:
+ get_input: dummy_net_cidr_0
+ allocation_pools:
+ - start:
+ get_input: dummy_net_start_0
+ end:
+ get_input: dummy_net_end_0
+ server_cm01:
+ type: org.openecomp.resource.vfc.nodes.heat.cm_server
+ properties:
+ flavor:
+ get_input: cm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: cm_image_name
+ user_data_format: RAW
+ name:
+ get_input:
+ - cm_server_names
+ - 0
+ scheduler_hints:
+ group: servergroup_mog03
+ server_pd_02:
+ type: org.openecomp.resource.vfc.nodes.heat.pd_server
+ properties:
+ flavor:
+ get_input: pd_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pd_image_name
+ user_data_format: RAW
+ name:
+ get_input:
+ - pd_server_names
+ - 1
+ scheduler_hints:
+ group: servergroup_mog01
+ server_pd_01:
+ type: org.openecomp.resource.vfc.nodes.heat.pd_server
+ properties:
+ flavor:
+ get_input: pd_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pd_image_name
+ user_data_format: RAW
+ name:
+ get_input:
+ - pd_server_names
+ - 0
+ scheduler_hints:
+ group: servergroup_mog01
+ server_oam01:
+ type: org.openecomp.resource.vfc.nodes.heat.oam_server
+ properties:
+ flavor:
+ get_input: oam_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: oam_image_name
+ user_data_format: RAW
+ name:
+ get_input:
+ - oam_server_names
+ - 0
+ scheduler_hints:
+ group: servergroup_mog02
+ server_oam02:
+ type: org.openecomp.resource.vfc.nodes.heat.oam_server
+ properties:
+ flavor:
+ get_input: oam_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: oam_image_name
+ user_data_format: RAW
+ name:
+ get_input:
+ - oam_server_names
+ - 1
+ scheduler_hints:
+ group: servergroup_mog02
+ dummy_net_1:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ dhcp_enabled: true
+ network_name:
+ get_input: dummy_net_name_1
+ subnets:
+ dummy_ip_subnet_1:
+ enable_dhcp: true
+ name:
+ get_input: dummy_net_name_1
+ cidr:
+ get_input: dummy_net_cidr_1
+ allocation_pools:
+ - start:
+ get_input: dummy_net_start_1
+ end:
+ get_input: dummy_net_end_1
+ mog_security_group:
+ type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules
+ properties:
+ name:
+ get_input: security_group_name
+ description: mog security group
+ rules:
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ requirements:
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: pd01_port_0
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: pd01_port_1
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: pd01_port_2
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: pd01_port_3
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: pd01_port_4
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: pd01_port_5
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: pd01_port_6
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: pd02_port_0
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: pd02_port_1
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: pd02_port_2
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: pd02_port_3
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: pd02_port_4
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: pd02_port_5
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: pd02_port_6
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: oam01_port_0
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: oam01_port_1
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: oam02_port_0
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: oam02_port_1
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: sm01_port_0
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: sm01_port_1
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: sm01_port_2
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: sm02_port_0
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: sm02_port_1
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: sm02_port_2
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: ps01_port_0
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: ps02_port_0
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: ps03_port_0
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: ps04_port_0
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: cm01_port_0
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: cm01_port_1
+ relationship: org.openecomp.relationships.AttachesTo
+ pd01_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - mog_security_group
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - oam_net_ips
+ - 0
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_pd_01
+ relationship: tosca.relationships.network.BindsTo
+ pd02_port_3:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - mog_security_group
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - rx_net_ips
+ - 1
+ allowed_address_pairs:
+ - ip_address:
+ get_input: rx_net_floating_ip
+ network:
+ get_input: rx_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_pd_02
+ relationship: tosca.relationships.network.BindsTo
+ pd01_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - mog_security_group
+ network: csb_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: csb_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_pd_01
+ relationship: tosca.relationships.network.BindsTo
+ pd02_port_4:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - mog_security_group
+ network: dummy_net_1
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: dummy_net_1
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_pd_02
+ relationship: tosca.relationships.network.BindsTo
+ pd01_port_3:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - mog_security_group
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - rx_net_ips
+ - 0
+ allowed_address_pairs:
+ - ip_address:
+ get_input: rx_net_floating_ip
+ network:
+ get_input: rx_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_pd_01
+ relationship: tosca.relationships.network.BindsTo
+ pd02_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - mog_security_group
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - oam_net_ips
+ - 1
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_pd_02
+ relationship: tosca.relationships.network.BindsTo
+ pd01_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - mog_security_group
+ network: dummy_net_0
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: dummy_net_0
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_pd_01
+ relationship: tosca.relationships.network.BindsTo
+ pd02_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - mog_security_group
+ network: dummy_net_0
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: dummy_net_0
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_pd_02
+ relationship: tosca.relationships.network.BindsTo
+ oam01_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - mog_security_group
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - oam_net_ips
+ - 2
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_oam01
+ relationship: tosca.relationships.network.BindsTo
+ pd02_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - mog_security_group
+ network: csb_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: csb_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_pd_02
+ relationship: tosca.relationships.network.BindsTo
+ oam02_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - mog_security_group
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - oam_net_ips
+ - 3
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_oam02
+ relationship: tosca.relationships.network.BindsTo
+ oam01_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - mog_security_group
+ network: csb_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: csb_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_oam01
+ relationship: tosca.relationships.network.BindsTo
+ oam02_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - mog_security_group
+ network: csb_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: csb_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_oam02
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ servergroup_mog01:
+ type: tosca.groups.Root
+ members:
+ - server_pd_01
+ - server_pd_02
+ servergroup_mog02:
+ type: tosca.groups.Root
+ members:
+ - server_oam01
+ - server_oam02
+ - server_sm01
+ - server_sm02
+ servergroup_mog03:
+ type: tosca.groups.Root
+ members:
+ - server_ps01
+ - server_ps02
+ - server_ps03
+ - server_ps04
+ - server_cm01
+ hot-mog-0108-bs1271:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/hot-mog-0108-bs1271.yml
+ description: heat template that creates MOG stack
+ members:
+ - cm01_port_1
+ - cm01_port_0
+ - sm02_port_0
+ - server_ps04
+ - server_ps03
+ - sm01_port_0
+ - sm02_port_2
+ - server_ps02
+ - sm01_port_1
+ - sm02_port_1
+ - server_ps01
+ - csb_net
+ - sm01_port_2
+ - pd01_port_5
+ - pd01_port_4
+ - pd02_port_5
+ - pd01_port_6
+ - pd02_port_6
+ - server_sm02
+ - ps02_port_0
+ - ps04_port_0
+ - ps03_port_0
+ - ps01_port_0
+ - server_sm01
+ - dummy_net_0
+ - server_cm01
+ - server_pd_02
+ - server_pd_01
+ - server_oam01
+ - server_oam02
+ - dummy_net_1
+ - mog_security_group
+ - pd01_port_1
+ - pd02_port_3
+ - pd01_port_0
+ - pd02_port_4
+ - pd01_port_3
+ - pd02_port_1
+ - pd01_port_2
+ - pd02_port_2
+ - oam01_port_1
+ - pd02_port_0
+ - oam02_port_1
+ - oam01_port_0
+ - oam02_port_0
+ policies:
+ servergroup_mog01:
+ type: org.openecomp.policies.placement.Antilocate
+ properties:
+ container_type: host
+ targets:
+ - servergroup_mog01
+ servergroup_mog02:
+ type: org.openecomp.policies.placement.Antilocate
+ properties:
+ container_type: host
+ targets:
+ - servergroup_mog02
+ servergroup_mog03:
+ type: org.openecomp.policies.placement.Antilocate
+ properties:
+ container_type: host
+ targets:
+ - servergroup_mog03 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-mog-0108-bs1271/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-mog-0108-bs1271/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..40c2b4c296
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-mog-0108-bs1271/inputfiles/MANIFEST.json
@@ -0,0 +1,17 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-mog-0108-bs1271.yml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-mog-0108-bs1271.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-mog-0108-bs1271/inputfiles/hot-mog-0108-bs1271.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-mog-0108-bs1271/inputfiles/hot-mog-0108-bs1271.env
new file mode 100644
index 0000000000..407bc8db30
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-mog-0108-bs1271/inputfiles/hot-mog-0108-bs1271.env
@@ -0,0 +1,60 @@
+parameters:
+ pd_server_names: ZRDM1MOGX01MPD001,ZRDM1MOGX01MPD002
+ pd_image_name: MOG_BASE_8.0
+ pd_flavor_name: m3.xlarge
+ oam_server_names: ZRDM1MOGX01OAM001,ZRDM1MOGX01OAM002
+ oam_image_name: MOG_BASE_8.0
+ oam_flavor_name: m3.xlarge
+ sm_server_names: ZRDM1MOGX01MSM001,ZRDM1MOGX01MSM002
+ sm_image_name: MOG_BASE_8.0
+ sm_flavor_name: m2.xlarge4
+ ps_server_names: ZRDM1MOGX01MPS001,ZRDM1MOGX01MPS002,ZRDM1MOGX01MPS003,ZRDM1MOGX01MPS004
+ ps_image_name: MOG_BASE_8.0
+ ps_flavor_name: m3.xlarge
+ cm_server_names: ZRDM1MOGX01MCM001
+ cm_image_name: MOG_BASE_8.0
+ cm_flavor_name: m3.xlarge
+ availabilityzone_name: nova
+ oam_net_name: oam_protected_net_0
+ oam_net_ips: 107.250.172.213,107.250.172.214,107.250.172.215,107.250.172.216,107.250.172.217
+ #internet_net_name: dmz_protected_net_0
+ #internet_net_ips: 107.239.53.4,107.239.53.5
+ # internet_net_floating_ip: 107.239.53.6
+ sl_net_name: exn_protected_net_0
+ sl_net_ips: 107.239.45.4,107.239.45.5
+ sl_net_floating_ip: 107.239.45.6
+ repl_net_name: cor_direct_net_0
+ repl_net_ips: 107.239.33.57,107.239.33.58
+ rx_net_name: cor_direct_net_1
+ rx_net_ips: 107.239.34.3,107.239.34.4
+ rx_net_floating_ip: 107.239.34.5
+ ran_net_name: gn_direct_net_0
+ ran_net_ips: 107.239.36.3,107.239.36.4
+ ran_net_floating_ip: 107.239.36.5
+ dummy_net_name_0: mog_dummy_0
+ dummy_net_start_0: 169.254.1.4
+ dummy_net_end_0: 169.254.1.254
+ dummy_net_cidr_0: 169.254.1.0/24
+ dummy_net_netmask_0: 255.255.255.0
+ dummy_net_name_1: mog_dummy_1
+ dummy_net_start_1: 169.254.2.4
+ dummy_net_end_1: 169.254.2.254
+ dummy_net_cidr_1: 169.254.2.0/24
+ dummy_net_netmask_1: 255.255.255.0
+ csb_net_name: int_mog_csb_net
+ csb_net_ips: 172.26.0.10,172.26.0.11,172.26.0.12,172.26.0.13,172.26.0.14,172.26.0.15,172.26.0.16,172.26.0.17,172.26.0.18,172.26.0.19,172.26.0.20
+ csb_net_start: 172.26.0.1
+ csb_net_end: 172.26.0.254
+ csb_net_cidr: 172.26.0.0/24
+ csb_net_netmask: 255.255.255.0
+ security_group_name: mog_security_group
+ mog_swift_container: http://10.147.38.210:8080/v1/AUTH_8e501b8121f34a6eaaf526d3305985cc/mogtestcontainer
+ mog_script_dir: /root
+ mog_script_name: http://10.147.38.210:8080/v1/AUTH_8e501b8121f34a6eaaf526d3305985cc/mogtestcontainer/mog-cloudinit.sh
+ mog_parameter_name: http://10.147.38.210:8080/v1/AUTH_8e501b8121f34a6eaaf526d3305985cc/mogtestcontainer
+ cluster-manager-vol-1: 43ccf5ba-2d50-427b-a38f-e8c7d8670eee
+ session-manager-vol-1: 49201898-333d-4c88-b58d-cf573b091633
+ session-manager-vol-2: 4c35b5f1-ce99-4220-a6e2-cda6e2d713a0
+ oam-vol-1: 0a7fcd9e-2624-401d-ac21-b0191f85ec77
+ oam-vol-2: 6d169cb6-6ddc-41dc-920c-2839898a2924
+ cluster-manager-vol-2: 6f92e211-2d61-487d-8f84-d2d00cea3698
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-mog-0108-bs1271/inputfiles/hot-mog-0108-bs1271.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-mog-0108-bs1271/inputfiles/hot-mog-0108-bs1271.yml
new file mode 100644
index 0000000000..85ca654ce1
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-mog-0108-bs1271/inputfiles/hot-mog-0108-bs1271.yml
@@ -0,0 +1,733 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates MOG stack
+
+parameters:
+ pd_server_names:
+ type: comma_delimited_list
+ label: PD server names
+ description: name of the PD instance
+ pd_image_name:
+ type: string
+ label: image name
+ description: PD image name
+ pd_flavor_name:
+ type: string
+ label: PD flavor name
+ description: flavor name of PD instance
+ oam_server_names:
+ type: comma_delimited_list
+ label: OAM server names
+ description: name of the OAM instance
+ oam_image_name:
+ type: string
+ label: image name
+ description: OAM image name
+ oam_flavor_name:
+ type: string
+ label: OAM flavor name
+ description: flavor name of OAM instance
+ sm_server_names:
+ type: comma_delimited_list
+ label: SM server names
+ description: name of the SM instance
+ sm_image_name:
+ type: string
+ label: image name
+ description: SM image name
+ sm_flavor_name:
+ type: string
+ label: SM flavor name
+ description: flavor name of SM instance
+ ps_server_names:
+ type: comma_delimited_list
+ label: PS server names
+ description: name of the PS instance
+ ps_image_name:
+ type: string
+ label: PS image name
+ description: PS image name
+ ps_flavor_name:
+ type: string
+ label: PS flavor name
+ description: flavor name of PS instance
+ cm_server_names:
+ type: comma_delimited_list
+ label: CM server names
+ description: name of the CM instance
+ cm_image_name:
+ type: string
+ label: image name
+ description: CM image name
+ cm_flavor_name:
+ type: string
+ label: CM flavor name
+ description: flavor name of CM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ oam_net_name:
+ type: string
+ label: oam network name
+ description: name of the oam network
+ oam_net_ips:
+ type: comma_delimited_list
+ label: internet network ips
+ description: ip of the OAM network
+ # internet_net_name:
+ # type: string
+ # label: internet network name
+ # description: id of the internet network
+ # internet_net_ips:
+ # type: comma_delimited_list
+ # label: internet network ips
+ # description: ip of the internet network
+ # internet_net_floating_ip:
+ # type: string
+ # label: mog internet virtual ip
+ # description: mog internet virtual ip
+ sl_net_name:
+ type: string
+ label: silver lining network name
+ description: id of the sl network
+ sl_net_ips:
+ type: comma_delimited_list
+ label: silver lining network ips
+ description: ips of the sl network
+ sl_net_floating_ip:
+ type: string
+ label: mog sl net virtual ip
+ description: mog sl net virtual ip
+ repl_net_name:
+ type: string
+ label: Replication network name
+ description: name of the replication network
+ repl_net_ips:
+ type: comma_delimited_list
+ label: repl network ips
+ description: ips of repl network
+ rx_net_name:
+ type: string
+ label: Rx network name
+ description: Rx network name
+ rx_net_ips:
+ type: comma_delimited_list
+ label: Rx network ips
+ description: Rx network ips
+ rx_net_floating_ip:
+ type: string
+ label: mog rx net virtual ip
+ description: mog rx net virtual ip
+ ran_net_name:
+ type: string
+ label: RAN network name
+ description: RAN network name
+ ran_net_ips:
+ type: comma_delimited_list
+ label: RAN network ips
+ description: RAN network ip
+ ran_net_floating_ip:
+ type: string
+ label: mog ran net virtual ip
+ description: mog ran net virtual ip
+ csb_net_name:
+ type: string
+ label: csb internal network name
+ description: csb internal network name
+ csb_net_start:
+ type: string
+ label: csb internal start
+ description: csb internal start
+ csb_net_end:
+ type: string
+ label: csb internal end
+ description: csb internal end
+ csb_net_cidr:
+ type: string
+ label: csb ineternal cidr
+ description: csb internal cidr
+ csb_net_netmask:
+ type: string
+ description: CSB internal network subnet mask
+ csb_net_ips:
+ type: comma_delimited_list
+ description: mog_csb_net IP addresses
+ dummy_net_name_0:
+ type: string
+ label: csb internal network name
+ description: csb internal network name
+ dummy_net_start_0:
+ type: string
+ label: csb internal start
+ description: csb internal start
+ dummy_net_end_0:
+ type: string
+ label: csb internal end
+ description: csb internal end
+ dummy_net_cidr_0:
+ type: string
+ label: csb ineternal cidr
+ description: csb internal cidr
+ dummy_net_netmask_0:
+ type: string
+ description: CSB internal network subnet mask
+ dummy_net_name_1:
+ type: string
+ label: csb internal network name
+ description: csb internal network name
+ dummy_net_start_1:
+ type: string
+ label: csb internal start
+ description: csb internal start
+ dummy_net_end_1:
+ type: string
+ label: csb internal end
+ description: csb internal end
+ dummy_net_cidr_1:
+ type: string
+ label: csb ineternal cidr
+ description: csb internal cidr
+ dummy_net_netmask_1:
+ type: string
+ description: CSB internal network subnet mask
+
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ cluster-manager-vol-1:
+ type: string
+ label: mog-cm-vol-1
+ description: Cluster Manager volume 1
+ session-manager-vol-1:
+ type: string
+ label: mog-sm-vol-1
+ description: Session Manager volume 1
+ session-manager-vol-2:
+ type: string
+ label: mog-sm-vol-2
+ description: Session Manager volume 2
+ oam-vol-1:
+ type: string
+ label: mog-oam-vol-1
+ description: OAM volume 1
+ oam-vol-2:
+ type: string
+ label: mog-oam-vol-2
+ description: OAM volume 2
+ mog_swift_container:
+ type: string
+ label: mog Config URL
+ description: Config URL
+ mog_script_dir:
+ type: string
+ label: mog Config script directory
+ description: Config script directory
+ mog_script_name:
+ type: string
+ label: mog Config script name
+ description: Config script name
+ mog_parameter_name:
+ type: string
+ label: mog script parameter name
+ description: Config script parameter csv file name
+ cluster-manager-vol-2:
+ type: string
+ label: mog-cm-vol-2
+ description: Cluster Manager volume 2 with ISO image
+
+resources:
+ mog_security_group:
+ type: OS::Neutron::SecurityGroup
+ properties:
+ description: mog security group
+ name: {get_param: security_group_name}
+ rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}
+ ]
+
+ csb_net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: csb_net_name}
+
+ csb_ip_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: csb_net_name}
+ network_id: { get_resource: csb_net }
+ cidr: { get_param: csb_net_cidr }
+ allocation_pools: [{"start": {get_param: csb_net_start}, "end": {get_param: csb_net_end}}]
+ enable_dhcp: true
+
+ dummy_net_0:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: dummy_net_name_0}
+
+ dummy_ip_subnet_0:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: dummy_net_name_0}
+ network_id: { get_resource: dummy_net_0 }
+ cidr: { get_param: dummy_net_cidr_0 }
+ allocation_pools: [{"start": {get_param: dummy_net_start_0}, "end": {get_param: dummy_net_end_0}}]
+ enable_dhcp: true
+
+ dummy_net_1:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: dummy_net_name_1}
+
+ dummy_ip_subnet_1:
+ type: OS::Neutron::Subnet
+ properties:
+ name: {get_param: dummy_net_name_1}
+ network_id: { get_resource: dummy_net_1 }
+ cidr: { get_param: dummy_net_cidr_1 }
+ allocation_pools: [{"start": {get_param: dummy_net_start_1}, "end": {get_param: dummy_net_end_1}}]
+ enable_dhcp: true
+
+
+ mogconfig:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ template: |
+ #!/bin/bash
+ wget -P script_dir swift_container/script_name
+ wget -P script_dir swift_container/parameter_name
+ chmod 755 script_dir/script_name
+ script_dir/script_name
+ params:
+ swift_container: {get_param: mog_swift_container}
+ script_dir: {get_param: mog_script_dir}
+ script_name: {get_param: mog_script_name}
+ #parameter_name: {get_param: mog_parameter_name}
+
+
+ servergroup_mog01:
+ type: OS::Nova::ServerGroup
+ properties:
+ policies:
+ - anti-affinity
+ server_pd_01:
+ type: OS::Nova::Server
+ properties:
+# config_drive: "True"
+ name: {get_param: [pd_server_names, 0]}
+ image: {get_param: pd_image_name}
+ flavor: {get_param: pd_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+ networks:
+ - port: {get_resource: pd01_port_0}
+ - port: {get_resource: pd01_port_1}
+ - port: {get_resource: pd01_port_2}
+ - port: {get_resource: pd01_port_3}
+ - port: {get_resource: pd01_port_4}
+ - port: {get_resource: pd01_port_5}
+ - port: {get_resource: pd01_port_6}
+ # - port: {get_resource: pd01_port_7}
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog01}}
+ user_data_format: RAW
+
+
+ pd01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ security_groups: [{get_resource: mog_security_group}]
+ pd01_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [oam_net_ips, 0]}}]
+ security_groups: [{get_resource: mog_security_group}]
+ pd01_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: dummy_net_0}
+ security_groups: [{get_resource: mog_security_group}]
+ pd01_port_3:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: rx_net_name}
+ fixed_ips: [{"ip_address": {get_param: [rx_net_ips, 0]}}]
+ allowed_address_pairs: [{"ip_address": {get_param: rx_net_floating_ip} }]
+ security_groups: [{get_resource: mog_security_group}]
+ pd01_port_4:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: dummy_net_1}
+ security_groups: [{get_resource: mog_security_group}]
+ pd01_port_5:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: ran_net_name}
+ fixed_ips: [{"ip_address": {get_param: [ran_net_ips, 0]}}]
+ allowed_address_pairs: [{"ip_address": {get_param: ran_net_floating_ip} }]
+ security_groups: [{get_resource: mog_security_group}]
+
+ pd01_port_6:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: sl_net_name}
+ fixed_ips: [{"ip_address": {get_param: [sl_net_ips, 0]}}]
+ allowed_address_pairs: [{"ip_address": {get_param: sl_net_floating_ip}}]
+ security_groups: [{get_resource: mog_security_group}]
+
+ # pd01_port_7:
+ #j type: OS::Neutron::Port
+ # properties:
+ # network: {get_param: internet_net_name}
+ # fixed_ips: [{"ip_address": {get_param: [internet_net_ips, 0]}}]
+ # allowed_address_pairs: [{"ip_address": {get_param: internet_net_floating_ip} }]
+ # security_groups: [{get_resource: mog_security_group}]
+
+ server_pd_02:
+ type: OS::Nova::Server
+ properties:
+# config_drive: "True"
+ name: {get_param: [pd_server_names, 1]}
+ image: {get_param: pd_image_name}
+ flavor: {get_param: pd_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+ networks:
+ - port: {get_resource: pd02_port_0}
+ - port: {get_resource: pd02_port_1}
+ - port: {get_resource: pd02_port_2}
+ - port: {get_resource: pd02_port_3}
+ - port: {get_resource: pd02_port_4}
+ - port: {get_resource: pd02_port_5}
+ - port: {get_resource: pd02_port_6}
+ # - port: {get_resource: pd02_port_7}
+
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog01}}
+ user_data_format: RAW
+
+ pd02_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ security_groups: [{get_resource: mog_security_group}]
+
+ pd02_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [oam_net_ips, 1]}}]
+ security_groups: [{get_resource: mog_security_group}]
+
+ pd02_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: dummy_net_0}
+ security_groups: [{get_resource: mog_security_group}]
+
+ pd02_port_3:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: rx_net_name}
+ fixed_ips: [{"ip_address": {get_param: [rx_net_ips, 1]}}]
+ allowed_address_pairs: [{"ip_address": {get_param: rx_net_floating_ip} }]
+ security_groups: [{get_resource: mog_security_group}]
+
+ pd02_port_4:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: dummy_net_1}
+ security_groups: [{get_resource: mog_security_group}]
+
+ pd02_port_5:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: ran_net_name}
+ fixed_ips: [{"ip_address": {get_param: [ran_net_ips, 1]}}]
+ allowed_address_pairs: [{"ip_address": {get_param: ran_net_floating_ip} }]
+ security_groups: [{get_resource: mog_security_group}]
+
+ pd02_port_6:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: sl_net_name}
+ fixed_ips: [{"ip_address": {get_param: [sl_net_ips, 1]}}]
+ allowed_address_pairs: [{"ip_address": {get_param: sl_net_floating_ip}}]
+ security_groups: [{get_resource: mog_security_group}]
+
+ # pd02_port_7:
+ # type: OS::Neutron::Port
+ # properties:
+ # network: {get_param: internet_net_name}
+ # fixed_ips: [{"ip_address": {get_param: [internet_net_ips, 1]}}]
+ # allowed_address_pairs: [{"ip_address": {get_param: internet_net_floating_ip} }]
+ # security_groups: [{get_resource: mog_security_group}]
+
+ servergroup_mog02:
+ type: OS::Nova::ServerGroup
+ properties:
+ policies:
+ - anti-affinity
+ server_oam01:
+ type: OS::Nova::Server
+ properties:
+# config_drive: "True"
+ name: {get_param: [oam_server_names, 0]}
+ image: {get_param: oam_image_name}
+ flavor: {get_param: oam_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+ networks:
+ - port: {get_resource: oam01_port_0}
+ - port: {get_resource: oam01_port_1}
+# block_device_mapping:
+# - device_name: vdd
+# volume_id: { get_param: oam-vol-1 }
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog02}}
+ user_data_format: RAW
+
+ oam01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ security_groups: [{get_resource: mog_security_group}]
+
+ oam01_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [oam_net_ips, 2]}}]
+ security_groups: [{get_resource: mog_security_group}]
+
+
+ server_oam02:
+ type: OS::Nova::Server
+ properties:
+# config_drive: "True"
+ name: {get_param: [oam_server_names, 1]}
+ image: {get_param: oam_image_name}
+ flavor: {get_param: oam_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+ networks:
+ - port: {get_resource: oam02_port_0}
+ - port: {get_resource: oam02_port_1}
+# block_device_mapping:
+# - device_name: vdd
+# volume_id: { get_param: oam-vol-2 }
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog02}}
+ user_data_format: RAW
+
+ oam02_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ security_groups: [{get_resource: mog_security_group}]
+
+ oam02_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [oam_net_ips, 3]}}]
+ security_groups: [{get_resource: mog_security_group}]
+
+
+ server_sm01:
+ type: OS::Nova::Server
+ properties:
+# config_drive: "True"
+ name: {get_param: [sm_server_names, 0]}
+ image: {get_param: sm_image_name}
+ flavor: {get_param: sm_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+ networks:
+ - port: {get_resource: sm01_port_0}
+ - port: {get_resource: sm01_port_1}
+# block_device_mapping:
+# - device_name: vdd
+# volume_id: { get_param: session-manager-vol-1 }
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog02}}
+ user_data_format: RAW
+
+ sm01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ security_groups: [{get_resource: mog_security_group}]
+
+ sm01_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: dummy_net_0}
+ security_groups: [{get_resource: mog_security_group}]
+
+ sm01_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: repl_net_name}
+ fixed_ips: [{"ip_address": {get_param: [repl_net_ips, 0]}}]
+ security_groups: [{get_resource: mog_security_group}]
+
+ server_sm02:
+ type: OS::Nova::Server
+ properties:
+# config_drive: "True"
+ name: {get_param: [sm_server_names, 1]}
+ image: {get_param: sm_image_name}
+ flavor: {get_param: sm_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+# block_device_mapping:
+# - device_name: vdd
+# volume_id: { get_param: session-manager-vol-2 }
+ networks:
+ - port: {get_resource: sm02_port_0}
+ - port: {get_resource: sm02_port_1}
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog02}}
+ user_data_format: RAW
+
+ sm02_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ security_groups: [{get_resource: mog_security_group}]
+
+ sm02_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: dummy_net_0}
+ security_groups: [{get_resource: mog_security_group}]
+
+ sm02_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: repl_net_name}
+ fixed_ips: [{"ip_address": {get_param: [repl_net_ips, 1]}}]
+ security_groups: [{get_resource: mog_security_group}]
+
+ servergroup_mog03:
+ type: OS::Nova::ServerGroup
+ properties:
+ policies:
+ - anti-affinity
+ server_ps01:
+ type: OS::Nova::Server
+ properties:
+# config_drive: "True"
+ name: {get_param: [ps_server_names, 0]}
+ image: {get_param: ps_image_name}
+ flavor: {get_param: ps_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+ networks:
+ - port: {get_resource: ps01_port_0}
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog03}}
+ user_data_format: RAW
+
+ ps01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ security_groups: [{get_resource: mog_security_group}]
+
+ server_ps02:
+ type: OS::Nova::Server
+ properties:
+# config_drive: "True"
+ name: {get_param: [ps_server_names, 1]}
+ image: {get_param: ps_image_name}
+ flavor: {get_param: ps_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+ networks:
+ - port: {get_resource: ps02_port_0}
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog03}}
+ user_data_format: RAW
+
+ ps02_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ security_groups: [{get_resource: mog_security_group}]
+
+ server_ps03:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: [ps_server_names, 2]}
+ image: {get_param: ps_image_name}
+ flavor: {get_param: ps_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+ networks:
+ - port: {get_resource: ps03_port_0}
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog03}}
+ user_data_format: RAW
+
+ ps03_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ security_groups: [{get_resource: mog_security_group}]
+
+ server_ps04:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: [ps_server_names, 3]}
+ image: {get_param: ps_image_name}
+ flavor: {get_param: ps_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+ networks:
+ - port: {get_resource: ps04_port_0}
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog03}}
+ user_data_format: RAW
+
+ ps04_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ security_groups: [{get_resource: mog_security_group}]
+
+ server_cm01:
+ type: OS::Nova::Server
+ properties:
+# config_drive: "True"
+ name: {get_param: [cm_server_names, 0]}
+ image: {get_param: cm_image_name}
+ flavor: {get_param: cm_flavor_name}
+ availability_zone: {get_param: availabilityzone_name}
+ networks:
+ - port: {get_resource: cm01_port_0}
+ - port: {get_resource: cm01_port_1}
+# block_device_mapping:
+# - device_name: vdd
+# volume_id: { get_param: cluster-manager-vol-2 }
+# - device_name: vde
+# volume_id: { get_param: cluster-manager-vol-1 }
+ user_data:
+ scheduler_hints: {group: {get_resource: servergroup_mog03}}
+ user_data_format: RAW
+
+ cm01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_resource: csb_net}
+ fixed_ips: [{"ip_address": {get_param: [csb_net_ips, 10]}}]
+ security_groups: [{get_resource: mog_security_group}]
+
+ cm01_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ fixed_ips: [{"ip_address": {get_param: [oam_net_ips, 4]}}]
+ security_groups: [{get_resource: mog_security_group}]
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..14c9a99cf7
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/MANIFEST.json
@@ -0,0 +1,99 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-oam_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-oam_v1.0.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "hot-nimbus-oam-volumes_v1.0.yaml",
+ "type": "HEAT_VOL",
+ "data": [{
+ "file": "hot-nimbus-oam-volumes_v1.0.env",
+ "type": "HEAT_ENV"
+ }]
+ }
+ ]
+ },
+ {
+ "file": "hot-nimbus-pcm_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-pcm_v1.0.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "hot-nimbus-pcm-volumes_v1.0.yaml",
+ "type": "HEAT_VOL",
+ "data": [{
+ "file": "hot-nimbus-pcm-volumes_v1.0.env",
+ "type": "HEAT_ENV"
+ }]
+ }
+ ]
+ },
+ {
+ "file": "hot-nimbus-ppd_v1.0.yaml",
+ "type": "HEAT",
+ "data": [{
+ "file": "hot-nimbus-ppd_v1.1.env",
+ "type": "HEAT_ENV"
+ }]
+ },
+ {
+ "file": "hot-nimbus-pps_v1.0.yaml",
+ "type": "HEAT",
+ "data": [{
+ "file": "hot-nimbus-pps_v1.0.env",
+ "type": "HEAT_ENV"
+ }]
+ },
+ {
+ "file": "hot-nimbus-psm_v1.0.yaml",
+ "type": "HEAT",
+ "data": [{
+ "file": "hot-nimbus-psm_v1.0.env",
+ "type": "HEAT_ENV"
+ }]
+ },
+ {
+ "file": "nested-oam_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "nested-pcm_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "nested-ppd_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "nested-pps_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "nested-psm_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "cloud-nimbus.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "nimbus-ethernet",
+ "type": "OTHER"
+ },
+ {
+ "file": "nimbus-ethernet-gw",
+ "type": "OTHER"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/cloud-nimbus.sh b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/cloud-nimbus.sh
new file mode 100644
index 0000000000..8e5a486289
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/cloud-nimbus.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+echo "Running first-boot script"
+FLAG="first-boot.sh"
+echo "First boot run" > ${FLAG}
+echo "$vm_name" >> ${FLAG}
+touch /var/lib/cloud/instance/payload/launch-params
+chmod 644 /var/lib/cloud/instance/payload/launch-params
+#for i in $(ls /sys/class/net); do
+# echo "Restart $i" >> ${FLAG}
+# ifdown ${i}
+# ifup ${i}
+#done
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-oam-volumes_v1.0.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-oam-volumes_v1.0.env
new file mode 100644
index 0000000000..b494d8c270
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-oam-volumes_v1.0.env
@@ -0,0 +1,6 @@
+parameters:
+ pcrf_oam_vol_size: 500
+ pcrf_oam_volume_silver-1: Silver
+ pcrf_oam_volume_silver-2: Silver
+ pcrf_oam_vol_name_1: sde1-pcrfx01-oam001-vol-1
+ pcrf_oam_vol_name_2: sde1-pcrfx01-oam001-vol-2 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-oam-volumes_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-oam-volumes_v1.0.yaml
new file mode 100644
index 0000000000..3b05f6fc8b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-oam-volumes_v1.0.yaml
@@ -0,0 +1,45 @@
+heat_template_version: 2013-05-23
+
+parameters:
+ pcrf_oam_vol_size:
+ type: number
+ label: Cinder volume size
+ description: the size of the Cinder volume
+ pcrf_oam_vol_name_1:
+ type: string
+ label: OAM volume name 1
+ description: Assigning name to volume
+ pcrf_oam_vol_name_2:
+ type: string
+ label: OAM volume name 2
+ description: Assigning name to volume
+ pcrf_oam_volume_silver-1:
+ type: string
+ label: vm volume type
+ description: the name of the target volume backend for OAM1
+ pcrf_oam_volume_silver-2:
+ type: string
+ label: vm volume type
+ description: the name of the target volume backend for OAM2
+
+resources:
+ pcrf_oam_volume_id_11:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: pcrf_oam_vol_size}
+ volume_type: {get_param: pcrf_oam_volume_silver-1}
+ name: {get_param: pcrf_oam_vol_name_1}
+
+ pcrf_oam_volume_id_22:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: pcrf_oam_vol_size}
+ volume_type: {get_param: pcrf_oam_volume_silver-2}
+ name: {get_param: pcrf_oam_vol_name_2}
+outputs:
+ pcrf_oam_volume_id_1:
+ description: the oam 001 volume id
+ value: { get_resource: pcrf_oam_volume_id_11 }
+ pcrf_oam_volume_id_2:
+ description: the oam 002 volume id
+ value: { get_resource: pcrf_oam_volume_id_22 } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-oam_v1.0.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-oam_v1.0.env
new file mode 100644
index 0000000000..138feb5822
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-oam_v1.0.env
@@ -0,0 +1,18 @@
+parameters:
+ pcrf_oam_server_names: ZRDM1PCRF01OAM001,ZRDM1PCRF01OAM002
+ pcrf_oam_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_oam_flavor_name: lc.4xlarge4
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.111,172.26.16.112
+ pcrf_arbiter_vip: 172.26.16.115
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_oam_net_name: MNS-25180-L-01_oam_protected_net_0
+ pcrf_oam_net_ips: 107.239.64.117,107.239.64.118
+ pcrf_oam_net_gw: 107.239.64.1
+ pcrf_oam_net_mask: 255.255.248.0
+ pcrf_oam_volume_id_1: a4aa05fb-fcdc-457b-8077-6845fdfc3257
+ pcrf_oam_volume_id_2: 93d8fc1f-f1c3-4933-86b2-039881ee910f
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-oam_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-oam_v1.0.yaml
new file mode 100644
index 0000000000..2aa1235de2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-oam_v1.0.yaml
@@ -0,0 +1,109 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates multiple PCRF OAM nodes stack
+
+parameters:
+ pcrf_oam_server_names:
+ type: comma_delimited_list
+ label: PCRF OAM server names
+ description: name of the PCRF OAM instance
+ pcrf_oam_image_name:
+ type: string
+ label: PCRF OAM image name
+ description: PCRF OAM image name
+ pcrf_oam_flavor_name:
+ type: string
+ label: PCRF OAM flavor name
+ description: flavor name of PCRF OAM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_arbiter_vip:
+ type: string
+ label: OAM Arbiter LB VIP
+ description: OAM Arbiter LB VIP
+ pcrf_oam_net_name:
+ type: string
+ label: OAM network name
+ description: OAM network name
+ pcrf_oam_net_ips:
+ type: comma_delimited_list
+ label: OAM network ips
+ description: OAM network ips
+ pcrf_oam_net_gw:
+ type: string
+ label: CPS network gateway
+ description: CPS network gateway
+ pcrf_oam_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_oam_volume_id_1:
+ type: string
+ label: CPS OAM 001 Cinder Volume
+ description: CPS OAM 001 Cinder Volumes
+ pcrf_oam_volume_id_2:
+ type: string
+ label: CPS OAM 002 Cinder Volume
+ description: CPS OAM 002 Cinder Volumes
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_oam_001:
+ type: nested-oam_v1.0.yaml
+ properties:
+ pcrf_oam_server_name: { get_param: [pcrf_oam_server_names, 0] }
+ pcrf_oam_image_name: { get_param: pcrf_oam_image_name }
+ pcrf_oam_flavor_name: { get_param: pcrf_oam_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_oam_volume_id: { get_param: pcrf_oam_volume_id_1 }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_oam_net_name: { get_param: pcrf_oam_net_name }
+ pcrf_oam_net_ip: { get_param: [pcrf_oam_net_ips, 0] }
+ pcrf_oam_net_mask: { get_param: pcrf_oam_net_mask }
+ pcrf_oam_net_gw: { get_param: pcrf_oam_net_gw }
+ pcrf_arbiter_vip: { get_param: pcrf_arbiter_vip }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_oam_002:
+ type: nested-oam_v1.0.yaml
+ depends_on: [server_pcrf_oam_001]
+ properties:
+ pcrf_oam_server_name: { get_param: [pcrf_oam_server_names, 1] }
+ pcrf_oam_image_name: { get_param: pcrf_oam_image_name }
+ pcrf_oam_flavor_name: { get_param: pcrf_oam_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_oam_volume_id: { get_param: pcrf_oam_volume_id_2 }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_oam_net_name: { get_param: pcrf_oam_net_name }
+ pcrf_oam_net_ip: { get_param: [pcrf_oam_net_ips, 1] }
+ pcrf_oam_net_mask: { get_param: pcrf_oam_net_mask }
+ pcrf_oam_net_gw: { get_param: pcrf_oam_net_gw }
+ pcrf_arbiter_vip: { get_param: pcrf_arbiter_vip }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pcm-volumes_v1.0.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pcm-volumes_v1.0.env
new file mode 100644
index 0000000000..788365dcd3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pcm-volumes_v1.0.env
@@ -0,0 +1,4 @@
+parameters:
+ pcrf_pcm_vol_size: 50
+ pcrf_pcm_volume_silver: Silver
+ pcrf_pcm_vol_name_1: sde1-pcrfx01-pcm001-vol-1
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pcm-volumes_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pcm-volumes_v1.0.yaml
new file mode 100644
index 0000000000..11a491164d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pcm-volumes_v1.0.yaml
@@ -0,0 +1,28 @@
+heat_template_version: 2013-05-23
+
+parameters:
+ pcrf_pcm_vol_size:
+ type: number
+ label: Cinder volume size
+ description: the size of the Cinder volume
+ pcrf_pcm_vol_name_1:
+ type: string
+ label: PCM volume name
+ description: Assigning name to volume
+ pcrf_pcm_volume_silver:
+ type: string
+ label: vm volume type
+ description: the name of the target volume backend for PCM
+
+resources:
+ pcrf_pcm_volume_id_1:
+ type: OS::Cinder::Volume
+ properties:
+ size: { get_param: pcrf_pcm_vol_size }
+ volume_type: { get_param: pcrf_pcm_volume_silver }
+ name: { get_param: pcrf_pcm_vol_name_1 }
+
+outputs:
+ pcrf_pcm_volume_id_1:
+ description: the pcrf_pcm_volume_id
+ value: { get_resource: pcrf_pcm_volume_id_1 } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pcm_v1.0.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pcm_v1.0.env
new file mode 100644
index 0000000000..82fb510291
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pcm_v1.0.env
@@ -0,0 +1,16 @@
+parameters:
+ pcrf_pcm_server_names: ZRDM1PCRF01PCM001
+ pcrf_pcm_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_pcm_flavor_name: lc.2xlarge4
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.113
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_oam_net_name: MNS-25180-L-01_oam_protected_net_0
+ pcrf_oam_net_ips: 107.239.64.121
+ pcrf_oam_net_gw: 107.239.64.1
+ pcrf_oam_net_mask: 255.255.248.0
+ pcrf_pcm_volume_id_1: 3438a3fe-1241-4390-80f2-d0b86238c40e
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pcm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pcm_v1.0.yaml
new file mode 100644
index 0000000000..2dd7480bfc
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pcm_v1.0.yaml
@@ -0,0 +1,80 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Cluman stack
+
+parameters:
+ pcrf_pcm_server_names:
+ type: comma_delimited_list
+ label: PCRF CM server names
+ description: name of the PCRF CM instance
+ pcrf_pcm_image_name:
+ type: string
+ label: PCRF CM image name
+ description: PCRF CM image name
+ pcrf_pcm_flavor_name:
+ type: string
+ label: PCRF CM flavor name
+ description: flavor name of PCRF CM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_oam_net_name:
+ type: string
+ label: OAM network name
+ description: OAM network name
+ pcrf_oam_net_ips:
+ type: comma_delimited_list
+ label: OAM network ips
+ description: OAM network ips
+ pcrf_oam_net_gw:
+ type: string
+ label: CPS network gateway
+ description: CPS network gateway
+ pcrf_oam_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_pcm_volume_id_1:
+ type: string
+ label: CPS Cluman Cinder Volume
+ description: CPS Cluman Cinder Volume
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_pcm_001:
+ type: nested-pcm_v1.0.yaml
+ properties:
+ pcrf_pcm_server_name: { get_param: [pcrf_pcm_server_names, 0] }
+ pcrf_pcm_image_name: { get_param: pcrf_pcm_image_name }
+ pcrf_pcm_flavor_name: { get_param: pcrf_pcm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_pcm_volume_id: { get_param: pcrf_pcm_volume_id_1 }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_oam_net_name: { get_param: pcrf_oam_net_name }
+ pcrf_oam_net_ip: { get_param: [pcrf_oam_net_ips, 0] }
+ pcrf_oam_net_mask: { get_param: pcrf_oam_net_mask }
+ pcrf_oam_net_gw: { get_param: pcrf_oam_net_gw }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-ppd_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-ppd_v1.0.yaml
new file mode 100644
index 0000000000..2fffa0df8c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-ppd_v1.0.yaml
@@ -0,0 +1,286 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Director stack
+
+parameters:
+ pcrf_ppd_server_names:
+ type: comma_delimited_list
+ label: PCRF PD server names
+ description: name of the PCRF PD instance
+ pcrf_ppd_image_name:
+ type: string
+ label: PCRF PD image name
+ description: PCRF PD image name
+ pcrf_ppd_flavor_name:
+ type: string
+ label: PCRF PD flavor name
+ description: flavor name of PCRF PD instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_lb_internal_vip:
+ type: string
+ label: CPS Internal LB VIP
+ description: CPS Internal LB VIP
+ pcrf_oam_net_name:
+ type: string
+ label: OAM network name
+ description: OAM network name
+ pcrf_oam_net_ips:
+ type: comma_delimited_list
+ label: OAM network ips
+ description: OAM network ips
+ pcrf_oam_net_gw:
+ type: string
+ label: CPS network gateway
+ description: CPS network gateway
+ pcrf_oam_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_lb_management_vip:
+ type: string
+ label: CPS OAM LB VIP
+ description: CPS OAM LB VIP
+ pcrf_gx_net_name:
+ type: string
+ label: Gx network name
+ description: Gx network name
+ pcrf_gx_net_ips:
+ type: comma_delimited_list
+ label: Gx network ips
+ description: Gx network ips
+ pcrf_gx_net_mask:
+ type: string
+ label: Gx network mask
+ description: Gx network mask
+ pcrf_sp_net_name:
+ type: string
+ label: Sp network name
+ description: Sp network name
+ pcrf_sp_net_ips:
+ type: comma_delimited_list
+ label: Sp network ips
+ description: Sp network ips
+ pcrf_sp_net_mask:
+ type: string
+ label: Sp network mask
+ description: Sp network mask
+ pcrf_sy_net_name:
+ type: string
+ label: Sy network name
+ description: Sy network name
+ pcrf_sy_net_ips:
+ type: comma_delimited_list
+ label: Sy network ips
+ description: Sy network ips
+ pcrf_sy_net_mask:
+ type: string
+ label: Sy network mask
+ description: Sy network mask
+ pcrf_rx_net_name:
+ type: string
+ label: Rx network name
+ description: Rx network name
+ pcrf_rx_net_ips:
+ type: comma_delimited_list
+ label: Rx network ips
+ description: Rx network ips
+ pcrf_rx_net_mask:
+ type: string
+ label: Rx network mask
+ description: Rx network mask
+ pcrf_sd_net_name:
+ type: string
+ label: Sd network name
+ description: Sd network name
+ pcrf_sd_net_ips:
+ type: comma_delimited_list
+ label: Sd network ips
+ description: Sd network ips
+ pcrf_sd_net_mask:
+ type: string
+ label: Sd network mask
+ description: Sd network mask
+ pcrf_sgi_sy_net_name:
+ type: string
+ label: Sgi Sy network name
+ description: Sgi Sy network name
+ pcrf_sgi_sy_net_ips:
+ type: comma_delimited_list
+ label: Sgi Sy network ips
+ description: Sgi Sy network ips
+ pcrf_sgi_sy_net_mask:
+ type: string
+ label: Sgi Sy network mask
+ description: Sgi Sy network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_ppd_001:
+ type: nested-ppd_v1.0.yaml
+ properties:
+ pcrf_ppd_server_name: { get_param: [pcrf_ppd_server_names, 0] }
+ pcrf_ppd_image_name: { get_param: pcrf_ppd_image_name }
+ pcrf_ppd_flavor_name: { get_param: pcrf_ppd_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_lb_internal_vip: { get_param: pcrf_lb_internal_vip }
+ pcrf_oam_net_name: { get_param: pcrf_oam_net_name }
+ pcrf_oam_net_ip: { get_param: [pcrf_oam_net_ips, 0] }
+ pcrf_oam_net_mask: { get_param: pcrf_oam_net_mask }
+ pcrf_oam_net_gw: { get_param: pcrf_oam_net_gw }
+ pcrf_lb_management_vip: { get_param: pcrf_lb_management_vip }
+ pcrf_gx_net_name: { get_param: pcrf_gx_net_name }
+ pcrf_gx_net_ip: { get_param: [pcrf_gx_net_ips, 0] }
+ pcrf_gx_net_mask: { get_param: pcrf_gx_net_mask }
+ pcrf_sp_net_name: { get_param: pcrf_sp_net_name }
+ pcrf_sp_net_ip: { get_param: [pcrf_sp_net_ips, 0] }
+ pcrf_sp_net_mask: { get_param: pcrf_sp_net_mask }
+ pcrf_sy_net_name: { get_param: pcrf_sy_net_name }
+ pcrf_sy_net_ip: { get_param: [pcrf_sy_net_ips, 0] }
+ pcrf_sy_net_mask: { get_param: pcrf_sy_net_mask }
+ pcrf_rx_net_name: { get_param: pcrf_rx_net_name }
+ pcrf_rx_net_ip: { get_param: [pcrf_rx_net_ips, 0] }
+ pcrf_rx_net_mask: { get_param: pcrf_rx_net_mask }
+ pcrf_sd_net_name: { get_param: pcrf_sd_net_name }
+ pcrf_sd_net_ip: { get_param: [pcrf_sd_net_ips, 0] }
+ pcrf_sd_net_mask: { get_param: pcrf_sd_net_mask }
+ pcrf_sgi_sy_net_name: { get_param: pcrf_sgi_sy_net_name }
+ pcrf_sgi_sy_net_ip: { get_param: [pcrf_sgi_sy_net_ips, 0] }
+ pcrf_sgi_sy_net_mask: { get_param: pcrf_sgi_sy_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_ppd_002:
+ type: nested-ppd_v1.0.yaml
+ properties:
+ pcrf_ppd_server_name: { get_param: [pcrf_ppd_server_names, 1] }
+ pcrf_ppd_image_name: { get_param: pcrf_ppd_image_name }
+ pcrf_ppd_flavor_name: { get_param: pcrf_ppd_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_lb_internal_vip: { get_param: pcrf_lb_internal_vip }
+ pcrf_oam_net_name: { get_param: pcrf_oam_net_name }
+ pcrf_oam_net_ip: { get_param: [pcrf_oam_net_ips, 1] }
+ pcrf_oam_net_mask: { get_param: pcrf_oam_net_mask }
+ pcrf_oam_net_gw: { get_param: pcrf_oam_net_gw }
+ pcrf_lb_management_vip: { get_param: pcrf_lb_management_vip }
+ pcrf_gx_net_name: { get_param: pcrf_gx_net_name }
+ pcrf_gx_net_ip: { get_param: [pcrf_gx_net_ips, 1] }
+ pcrf_gx_net_mask: { get_param: pcrf_gx_net_mask }
+ pcrf_sp_net_name: { get_param: pcrf_sp_net_name }
+ pcrf_sp_net_ip: { get_param: [pcrf_sp_net_ips, 1] }
+ pcrf_sp_net_mask: { get_param: pcrf_sp_net_mask }
+ pcrf_sy_net_name: { get_param: pcrf_sy_net_name }
+ pcrf_sy_net_ip: { get_param: [pcrf_sy_net_ips, 1] }
+ pcrf_sy_net_mask: { get_param: pcrf_sy_net_mask }
+ pcrf_rx_net_name: { get_param: pcrf_rx_net_name }
+ pcrf_rx_net_ip: { get_param: [pcrf_rx_net_ips, 1] }
+ pcrf_rx_net_mask: { get_param: pcrf_rx_net_mask }
+ pcrf_sd_net_name: { get_param: pcrf_sd_net_name }
+ pcrf_sd_net_ip: { get_param: [pcrf_sd_net_ips, 1] }
+ pcrf_sd_net_mask: { get_param: pcrf_sd_net_mask }
+ pcrf_sgi_sy_net_name: { get_param: pcrf_sgi_sy_net_name }
+ pcrf_sgi_sy_net_ip: { get_param: [pcrf_sgi_sy_net_ips, 1] }
+ pcrf_sgi_sy_net_mask: { get_param: pcrf_sgi_sy_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_ppd_003:
+ type: nested-ppd_v1.0.yaml
+ properties:
+ pcrf_ppd_server_name: { get_param: [pcrf_ppd_server_names, 2] }
+ pcrf_ppd_image_name: { get_param: pcrf_ppd_image_name }
+ pcrf_ppd_flavor_name: { get_param: pcrf_ppd_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_lb_internal_vip: { get_param: pcrf_lb_internal_vip }
+ pcrf_oam_net_name: { get_param: pcrf_oam_net_name }
+ pcrf_oam_net_ip: { get_param: [pcrf_oam_net_ips, 2] }
+ pcrf_oam_net_mask: { get_param: pcrf_oam_net_mask }
+ pcrf_oam_net_gw: { get_param: pcrf_oam_net_gw }
+ pcrf_lb_management_vip: { get_param: pcrf_lb_management_vip }
+ pcrf_gx_net_name: { get_param: pcrf_gx_net_name }
+ pcrf_gx_net_ip: { get_param: [pcrf_gx_net_ips, 2] }
+ pcrf_gx_net_mask: { get_param: pcrf_gx_net_mask }
+ pcrf_sp_net_name: { get_param: pcrf_sp_net_name }
+ pcrf_sp_net_ip: { get_param: [pcrf_sp_net_ips, 2] }
+ pcrf_sp_net_mask: { get_param: pcrf_sp_net_mask }
+ pcrf_sy_net_name: { get_param: pcrf_sy_net_name }
+ pcrf_sy_net_ip: { get_param: [pcrf_sy_net_ips, 2] }
+ pcrf_sy_net_mask: { get_param: pcrf_sy_net_mask }
+ pcrf_rx_net_name: { get_param: pcrf_rx_net_name }
+ pcrf_rx_net_ip: { get_param: [pcrf_rx_net_ips, 2] }
+ pcrf_rx_net_mask: { get_param: pcrf_rx_net_mask }
+ pcrf_sd_net_name: { get_param: pcrf_sd_net_name }
+ pcrf_sd_net_ip: { get_param: [pcrf_sd_net_ips, 2] }
+ pcrf_sd_net_mask: { get_param: pcrf_sd_net_mask }
+ pcrf_sgi_sy_net_name: { get_param: pcrf_sgi_sy_net_name }
+ pcrf_sgi_sy_net_ip: { get_param: [pcrf_sgi_sy_net_ips, 2] }
+ pcrf_sgi_sy_net_mask: { get_param: pcrf_sgi_sy_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_ppd_004:
+ type: nested-ppd_v1.0.yaml
+ properties:
+ pcrf_ppd_server_name: { get_param: [pcrf_ppd_server_names, 3] }
+ pcrf_ppd_image_name: { get_param: pcrf_ppd_image_name }
+ pcrf_ppd_flavor_name: { get_param: pcrf_ppd_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_lb_internal_vip: { get_param: pcrf_lb_internal_vip }
+ pcrf_oam_net_name: { get_param: pcrf_oam_net_name }
+ pcrf_oam_net_ip: { get_param: [pcrf_oam_net_ips, 3] }
+ pcrf_oam_net_mask: { get_param: pcrf_oam_net_mask }
+ pcrf_oam_net_gw: { get_param: pcrf_oam_net_gw }
+ pcrf_lb_management_vip: { get_param: pcrf_lb_management_vip }
+ pcrf_gx_net_name: { get_param: pcrf_gx_net_name }
+ pcrf_gx_net_ip: { get_param: [pcrf_gx_net_ips, 3] }
+ pcrf_gx_net_mask: { get_param: pcrf_gx_net_mask }
+ pcrf_sp_net_name: { get_param: pcrf_sp_net_name }
+ pcrf_sp_net_ip: { get_param: [pcrf_sp_net_ips, 3] }
+ pcrf_sp_net_mask: { get_param: pcrf_sp_net_mask }
+ pcrf_sy_net_name: { get_param: pcrf_sy_net_name }
+ pcrf_sy_net_ip: { get_param: [pcrf_sy_net_ips, 3] }
+ pcrf_sy_net_mask: { get_param: pcrf_sy_net_mask }
+ pcrf_rx_net_name: { get_param: pcrf_rx_net_name }
+ pcrf_rx_net_ip: { get_param: [pcrf_rx_net_ips, 3] }
+ pcrf_rx_net_mask: { get_param: pcrf_rx_net_mask }
+ pcrf_sd_net_name: { get_param: pcrf_sd_net_name }
+ pcrf_sd_net_ip: { get_param: [pcrf_sd_net_ips, 3] }
+ pcrf_sd_net_mask: { get_param: pcrf_sd_net_mask }
+ pcrf_sgi_sy_net_name: { get_param: pcrf_sgi_sy_net_name }
+ pcrf_sgi_sy_net_ip: { get_param: [pcrf_sgi_sy_net_ips, 3] }
+ pcrf_sgi_sy_net_mask: { get_param: pcrf_sgi_sy_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-ppd_v1.1.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-ppd_v1.1.env
new file mode 100644
index 0000000000..bb6dfe468c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-ppd_v1.1.env
@@ -0,0 +1,35 @@
+parameters:
+ pcrf_ppd_server_names: ZRDM1PCRF01PPD001,ZRDM1PCRF01PPD002,ZRDM1PCRF01PPD003,ZRDM1PCRF01PPD004
+ pcrf_ppd_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_ppd_flavor_name: lc.4xlarge4
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.3,172.26.16.4,172.26.16.5,172.26.16.6
+ pcrf_lb_internal_vip: 172.26.16.114
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_oam_net_name: MNS-25180-L-01_oam_protected_net_0
+ pcrf_oam_net_ips: 107.239.64.113,107.239.64.114,107.239.64.115,107.239.64.116
+ pcrf_lb_management_vip: 107.239.64.123
+ pcrf_oam_net_gw: 107.239.64.1
+ pcrf_oam_net_mask: 255.255.248.0
+ pcrf_gx_net_name: Mobisupport-25193-I-INT1_cor_pcrf_gx_net_0
+ pcrf_gx_net_ips: 107.239.24.67,107.239.24.68,107.239.24.69,107.239.24.70
+ pcrf_gx_net_mask: 255.255.255.248
+ pcrf_sp_net_name: Mobisupport-25193-I-INT1_cor_pcrf_sp_net_0
+ pcrf_sp_net_ips: 107.239.24.75,107.239.24.76,107.239.24.77,107.239.24.78
+ pcrf_sp_net_mask: 255.255.255.248
+ pcrf_sy_net_name: Mobisupport-25193-I-INT1_cor_pcrf_sy_net_0
+ pcrf_sy_net_ips: 107.239.24.83,107.239.24.84,107.239.24.85,107.239.24.86
+ pcrf_sy_net_mask: 255.255.255.248
+ pcrf_rx_net_name: Mobisupport-25193-I-INT1_cor_pcrf_rx_net_0
+ pcrf_rx_net_ips: 107.239.24.91,107.239.24.92,107.239.24.93,107.239.24.94
+ pcrf_rx_net_mask: 255.255.255.248
+ pcrf_sd_net_name: Mobisupport-25193-I-INT1_cor_pcrf_sd_net_0
+ pcrf_sd_net_ips: 107.239.24.99,107.239.24.100,107.239.24.101,107.239.24.102
+ pcrf_sd_net_mask: 255.255.255.248
+ pcrf_sgi_sy_net_name: Mobisupport-25193-I-INT1_sgi_pcrf_sy_net_0
+ pcrf_sgi_sy_net_ips: 107.239.26.131,107.239.26.132,107.239.26.133,107.239.26.134
+ pcrf_sgi_sy_net_mask: 255.255.255.248
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pps_v1.0.env
new file mode 100644
index 0000000000..340be2b815
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pps_v1.0.env
@@ -0,0 +1,11 @@
+parameters:
+ pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006
+ pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_pps_flavor_name: lc.3xlarge
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pps_v1.0.yaml
new file mode 100644
index 0000000000..05bd6c9318
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pps_v1.0.yaml
@@ -0,0 +1,121 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_names:
+ type: comma_delimited_list
+ label: PCRF PS server names
+ description: PCRF PS server names
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_pps_001:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_002:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 1] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_003:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 2] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_004:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 3] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_005:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 4] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_006:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-psm_v1.0.env
new file mode 100644
index 0000000000..f24e4763c6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-psm_v1.0.env
@@ -0,0 +1,10 @@
+parameters:
+ pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012
+ pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_psm_flavor_name: lc.4xlarge4
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-psm_v1.0.yaml
new file mode 100644
index 0000000000..c2d7b05ead
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-psm_v1.0.yaml
@@ -0,0 +1,199 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_names:
+ type: comma_delimited_list
+ label: PCRF SM server names
+ description: name of the PCRF SM instance
+ pcrf_psm_image_name:
+ type: string
+ label: PCRF SM image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_psm_001:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_002:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_003:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_004:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_005:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_006:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_007:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_008:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_009:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_010:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_011:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_012:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nested-oam_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nested-oam_v1.0.yaml
new file mode 100644
index 0000000000..a832498a6c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nested-oam_v1.0.yaml
@@ -0,0 +1,156 @@
+heat_template_version: 2013-05-23
+
+description: nested heat template that creates a PCRF OAM node stack
+
+parameters:
+ pcrf_oam_server_name:
+ type: string
+ label: PCRF OAM server name
+ description: PCRF OAM server name
+ pcrf_oam_image_name:
+ type: string
+ label: image name
+ description: PCRF OAM image name
+ pcrf_oam_flavor_name:
+ type: string
+ label: PCRF OAM flavor name
+ description: flavor name of PCRF OAM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_arbiter_vip:
+ type: string
+ label: OAM Arbiter LB VIP
+ description: OAM Arbiter LB VIP
+ pcrf_oam_net_name:
+ type: string
+ label: OAM network name
+ description: OAM network name
+ pcrf_oam_net_ip:
+ type: string
+ label: OAM network ip
+ description: OAM network ip
+ pcrf_oam_net_gw:
+ type: string
+ label: CPS network gateway
+ description: CPS network gateway
+ pcrf_oam_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_oam_volume_id:
+ type: string
+ label: CPS OAM Cinder Volume
+ description: CPS OAM Cinder Volume
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: "file:///nimbus-ethernet" }
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth1
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet-gw }
+ params:
+ $dev: eth1
+ $ip: { get_param: pcrf_oam_net_ip }
+ $netmask: { get_param: pcrf_oam_net_mask }
+ $gateway: { get_param: pcrf_oam_net_gw }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+ - ifdown eth1 && ifup eth1
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ template: { get_file: cloud-nimbus.sh }
+ params:
+ $vm_name: { get_param: pcrf_oam_server_name }
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_oam:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_oam_server_name }
+ image: { get_param: pcrf_oam_image_name }
+ flavor: { get_param: pcrf_oam_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: pcrf_oam_port_0}
+ - port: { get_resource: pcrf_oam_port_1}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+
+ pcrf_oam_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ allowed_address_pairs:
+ - ip_address: { get_param: pcrf_arbiter_vip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
+
+ pcrf_oam_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_oam_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_oam_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
+
+ pcrf_oam_vol_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: { get_param: pcrf_oam_volume_id }
+ mountpoint: /dev/vdd
+ instance_uuid: { get_resource: pcrf_server_oam }
+
+outputs:
+ pcrf_oam_vol_attachment_id:
+ description: the pcrf_oam_vol_attachment_id id
+ value: { get_resource: pcrf_oam_vol_attachment }
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nested-pcm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nested-pcm_v1.0.yaml
new file mode 100644
index 0000000000..820d09b3dc
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nested-pcm_v1.0.yaml
@@ -0,0 +1,150 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Cluman stack
+
+parameters:
+ pcrf_pcm_server_name:
+ type: string
+ label: PCRF CM server name
+ description: PCRF CM server name
+ pcrf_pcm_image_name:
+ type: string
+ label: image name
+ description: PCRF CM image name
+ pcrf_pcm_flavor_name:
+ type: string
+ label: PCRF CM flavor name
+ description: flavor name of PCRF CM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_oam_net_name:
+ type: string
+ label: OAM network name
+ description: OAM network name
+ pcrf_oam_net_ip:
+ type: string
+ label: OAM network ip
+ description: OAM network ip
+ pcrf_oam_net_gw:
+ type: string
+ label: CPS network gateway
+ description: CPS network gateway
+ pcrf_oam_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_pcm_volume_id:
+ type: string
+ label: CPS Cluman Cinder Volume
+ description: CPS Cluman Cinder Volume
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet }
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth1
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet-gw }
+ params:
+ $dev: eth1
+ $ip: { get_param: pcrf_oam_net_ip }
+ $netmask: { get_param: pcrf_oam_net_mask }
+ $gateway: { get_param: pcrf_oam_net_gw }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+ - ifdown eth1 && ifup eth1
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ template: { get_file: cloud-nimbus.sh }
+ params:
+ $vm_name: { get_param: pcrf_pcm_server_name }
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_pcm:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_pcm_server_name }
+ image: { get_param: pcrf_pcm_image_name }
+ flavor: { get_param: pcrf_pcm_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: pcrf_pcm_port_0}
+ - port: { get_resource: pcrf_pcm_port_1}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+
+ pcrf_pcm_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
+
+ pcrf_pcm_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_oam_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_oam_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
+
+ volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: { get_param: pcrf_pcm_volume_id }
+ mountpoint: /dev/vdd
+ instance_uuid: { get_resource: pcrf_server_pcm }
+
+outputs:
+ pcrf_server_pcm_id:
+ description: the pcm server id
+ value: { get_resource: pcrf_server_pcm } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nested-ppd_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nested-ppd_v1.0.yaml
new file mode 100644
index 0000000000..397e85c252
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nested-ppd_v1.0.yaml
@@ -0,0 +1,333 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Director stack
+
+parameters:
+ pcrf_ppd_server_name:
+ type: string
+ label: PCRF PD server name
+ description: PCRF PD server name
+ pcrf_ppd_image_name:
+ type: string
+ label: image name
+ description: PCRF PD image name
+ pcrf_ppd_flavor_name:
+ type: string
+ label: PCRF PD flavor name
+ description: flavor name of PCRF PD instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_lb_internal_vip:
+ type: string
+ label: CPS Internal LB VIP
+ description: CPS Internal LB VIP
+ pcrf_oam_net_name:
+ type: string
+ label: OAM network name
+ description: OAM network name
+ pcrf_oam_net_ip:
+ type: string
+ label: OAM network ip
+ description: OAM network ip
+ pcrf_oam_net_gw:
+ type: string
+ label: CPS network gateway
+ description: CPS network gateway
+ pcrf_oam_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_lb_management_vip:
+ type: string
+ label: CPS OAM LB VIP
+ description: CPS OAM LB VIP
+ pcrf_gx_net_name:
+ type: string
+ label: Gx network name
+ description: Gx network name
+ pcrf_gx_net_ip:
+ type: string
+ label: Gx network ip
+ description: Gx network ip
+ pcrf_gx_net_mask:
+ type: string
+ label: Gx network mask
+ description: Gx network mask
+ pcrf_sp_net_name:
+ type: string
+ label: Sp network name
+ description: Sp network name
+ pcrf_sp_net_ip:
+ type: string
+ label: Sp network ip
+ description: Sp network ip
+ pcrf_sp_net_mask:
+ type: string
+ label: Sp network mask
+ description: Sp network mask
+ pcrf_sy_net_name:
+ type: string
+ label: Sy network name
+ description: Sy network name
+ pcrf_sy_net_ip:
+ type: string
+ label: Sy network ip
+ description: Sy network ip
+ pcrf_sy_net_mask:
+ type: string
+ label: Sy network mask
+ description: Sy network mask
+ pcrf_rx_net_name:
+ type: string
+ label: Rx network name
+ description: Rx network name
+ pcrf_rx_net_ip:
+ type: string
+ label: Rx network ip
+ description: Rx network ip
+ pcrf_rx_net_mask:
+ type: string
+ label: Rx network mask
+ description: Rx network mask
+ pcrf_sd_net_name:
+ type: string
+ label: Sd network name
+ description: Sd network name
+ pcrf_sd_net_ip:
+ type: string
+ label: Sd network ip
+ description: Sd network ip
+ pcrf_sd_net_mask:
+ type: string
+ label: Sd network mask
+ description: Sd network mask
+ pcrf_sgi_sy_net_name:
+ type: string
+ label: Sgi Sy network name
+ description: Sgi Sy network name
+ pcrf_sgi_sy_net_ip:
+ type: string
+ label: Sgi Sy network ip
+ description: Sgi Sy network ip
+ pcrf_sgi_sy_net_mask:
+ type: string
+ label: Sgi Sy network mask
+ description: Sgi Sy network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet }
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth1
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet-gw }
+ params:
+ $dev: eth1
+ $ip: { get_param: pcrf_oam_net_ip }
+ $netmask: { get_param: pcrf_oam_net_mask }
+ $gateway: { get_param: pcrf_oam_net_gw }
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth2
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet }
+ params:
+ $dev: eth2
+ $ip: { get_param: pcrf_gx_net_ip }
+ $netmask: { get_param: pcrf_gx_net_mask }
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth3
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet }
+ params:
+ $dev: eth3
+ $ip: { get_param: pcrf_sp_net_ip }
+ $netmask: { get_param: pcrf_sp_net_mask }
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth4
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet }
+ params:
+ $dev: eth4
+ $ip: { get_param: pcrf_sy_net_ip }
+ $netmask: { get_param: pcrf_sy_net_mask }
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth5
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet }
+ params:
+ $dev: eth5
+ $ip: { get_param: pcrf_rx_net_ip }
+ $netmask: { get_param: pcrf_rx_net_mask }
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth6
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet }
+ params:
+ $dev: eth6
+ $ip: { get_param: pcrf_sd_net_ip }
+ $netmask: { get_param: pcrf_sd_net_mask }
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth7
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet }
+ params:
+ $dev: eth7
+ $ip: { get_param: pcrf_sgi_sy_net_ip }
+ $netmask: { get_param: pcrf_sgi_sy_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+ - ifdown eth1 && ifup eth1
+ - ifdown eth2 && ifup eth2
+ - ifdown eth3 && ifup eth3
+ - ifdown eth4 && ifup eth4
+ - ifdown eth5 && ifup eth5
+ - ifdown eth6 && ifup eth6
+ - ifdown eth7 && ifup eth7
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ template: { get_file: cloud-nimbus.sh }
+ params:
+ $vm_name: { get_param: pcrf_ppd_server_name }
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_ppd:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_ppd_server_name }
+ image: { get_param: pcrf_ppd_image_name }
+ flavor: { get_param: pcrf_ppd_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: pcrf_ppd_port_0}
+ - port: { get_resource: pcrf_ppd_port_1}
+ - port: { get_resource: pcrf_ppd_port_2}
+ - port: { get_resource: pcrf_ppd_port_3}
+ - port: { get_resource: pcrf_ppd_port_4}
+ - port: { get_resource: pcrf_ppd_port_5}
+ - port: { get_resource: pcrf_ppd_port_6}
+ - port: { get_resource: pcrf_ppd_port_7}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+
+ pcrf_ppd_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
+ allowed_address_pairs:
+ - ip_address: { get_param: pcrf_lb_internal_vip }
+
+ pcrf_ppd_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_oam_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_oam_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
+ allowed_address_pairs:
+ - ip_address: { get_param: pcrf_lb_management_vip }
+
+ pcrf_ppd_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_gx_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_gx_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
+
+ pcrf_ppd_port_3:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_sp_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_sp_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
+
+ pcrf_ppd_port_4:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_sy_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_sy_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
+
+ pcrf_ppd_port_5:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_rx_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_rx_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
+
+ pcrf_ppd_port_6:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_sd_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_sd_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
+
+ pcrf_ppd_port_7:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_sgi_sy_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_sgi_sy_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nested-pps_v1.0.yaml
new file mode 100644
index 0000000000..fc5b6f74c3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nested-pps_v1.0.yaml
@@ -0,0 +1,99 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_name:
+ type: string
+ label: PCRF PS server name
+ description: PCRF PS server name
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ template: { get_file: cloud-nimbus.sh }
+ params:
+ $vm_name: { get_param: pcrf_pps_server_name }
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet }
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_pps:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_pps_server_name }
+ image: { get_param: pcrf_pps_image_name }
+ flavor: { get_param: pcrf_pps_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: pcrf_pps_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+
+ pcrf_pps_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nested-psm_v1.0.yaml
new file mode 100644
index 0000000000..c86aa34713
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nested-psm_v1.0.yaml
@@ -0,0 +1,99 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_name:
+ type: string
+ label: PCRF SM server name
+ description: PCRF SM server name
+ pcrf_psm_image_name:
+ type: string
+ label: image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet }
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ template: { get_file: cloud-nimbus.sh }
+ params:
+ $vm_name: { get_param: pcrf_psm_server_name }
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_psm:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_psm_server_name }
+ image: { get_param: pcrf_psm_image_name }
+ flavor: { get_param: pcrf_psm_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: psm01_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+ #scheduler_hints: {group: { get_resource: servergroup_nimbus }}
+
+ psm01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nimbus-ethernet b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nimbus-ethernet
new file mode 100644
index 0000000000..51250a7b82
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nimbus-ethernet
@@ -0,0 +1,5 @@
+DEVICE=$dev
+BOOTPROTO=none
+NM_CONTROLLED=no
+IPADDR=$ip
+NETMASK=$netmask
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nimbus-ethernet-gw b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nimbus-ethernet-gw
new file mode 100644
index 0000000000..3e08d643bb
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nimbus-ethernet-gw
@@ -0,0 +1,6 @@
+DEVICE=$dev
+BOOTPROTO=none
+NM_CONTROLLED=no
+IPADDR=$ip
+NETMASK=$netmask
+GATEWAY=$gateway
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/GlobalSubstitutionTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..e04c27f8fc
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/GlobalSubstitutionTypesServiceTemplate.yaml
@@ -0,0 +1,642 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: GlobalSubstitutionTypes
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.abstract.nodes.heat.nested-pps_v1.0:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ pcrf_cps_net_ip:
+ type: string
+ description: CPS network ip
+ availabilityzone_name:
+ type: string
+ description: availabilityzone name
+ pcrf_vnf_id:
+ type: string
+ description: PCRF VNF Id
+ pcrf_cps_net_name:
+ type: string
+ description: CPS network name
+ pcrf_cps_net_mask:
+ type: string
+ description: CPS network mask
+ pcrf_pps_image_name:
+ type: string
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ description: flavor name of PCRF PS instance
+ pcrf_pps_server_name:
+ type: string
+ description: PCRF PS server name
+ pcrf_security_group_name:
+ type: string
+ description: the name of security group
+ requirements:
+ - link_pcrf_pps_port_0:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - local_storage_pcrf_server_pps:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ capabilities:
+ binding_pcrf_server_pps:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_pcrf_pps_port_0:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_pcrf_server_pps:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_pcrf_server_pps:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_pcrf_server_pps:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_pcrf_server_pps:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ org.openecomp.resource.abstract.nodes.heat.nested-ppd_v1.0:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ pcrf_ppd_image_name:
+ type: string
+ description: PCRF PD image name
+ availabilityzone_name:
+ type: string
+ description: availabilityzone name
+ pcrf_sp_net_ip:
+ type: string
+ description: Sp network ip
+ pcrf_ppd_server_name:
+ type: string
+ description: PCRF PD server name
+ pcrf_gx_net_ip:
+ type: string
+ description: Gx network ip
+ pcrf_sy_net_name:
+ type: string
+ description: Sy network name
+ pcrf_sp_net_mask:
+ type: string
+ description: Sp network mask
+ pcrf_sd_net_ip:
+ type: string
+ description: Sd network ip
+ pcrf_vnf_id:
+ type: string
+ description: PCRF VNF Id
+ pcrf_oam_net_name:
+ type: string
+ description: OAM network name
+ pcrf_oam_net_ip:
+ type: string
+ description: OAM network ip
+ pcrf_cps_net_mask:
+ type: string
+ description: CPS network mask
+ pcrf_gx_net_mask:
+ type: string
+ description: Gx network mask
+ pcrf_sgi_sy_net_name:
+ type: string
+ description: Sgi Sy network name
+ pcrf_sd_net_name:
+ type: string
+ description: Sd network name
+ pcrf_oam_net_gw:
+ type: string
+ description: CPS network gateway
+ pcrf_rx_net_name:
+ type: string
+ description: Rx network name
+ pcrf_rx_net_ip:
+ type: string
+ description: Rx network ip
+ pcrf_sy_net_ip:
+ type: string
+ description: Sy network ip
+ pcrf_sgi_sy_net_ip:
+ type: string
+ description: Sgi Sy network ip
+ pcrf_ppd_flavor_name:
+ type: string
+ description: flavor name of PCRF PD instance
+ pcrf_cps_net_ip:
+ type: string
+ description: CPS network ip
+ pcrf_sy_net_mask:
+ type: string
+ description: Sy network mask
+ pcrf_cps_net_name:
+ type: string
+ description: CPS network name
+ pcrf_oam_net_mask:
+ type: string
+ description: CPS network mask
+ pcrf_lb_management_vip:
+ type: string
+ description: CPS OAM LB VIP
+ pcrf_sgi_sy_net_mask:
+ type: string
+ description: Sgi Sy network mask
+ pcrf_lb_internal_vip:
+ type: string
+ description: CPS Internal LB VIP
+ pcrf_sd_net_mask:
+ type: string
+ description: Sd network mask
+ pcrf_gx_net_name:
+ type: string
+ description: Gx network name
+ pcrf_sp_net_name:
+ type: string
+ description: Sp network name
+ pcrf_rx_net_mask:
+ type: string
+ description: Rx network mask
+ pcrf_security_group_name:
+ type: string
+ description: the name of security group
+ requirements:
+ - link_pcrf_ppd_port_5:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_pcrf_ppd_port_6:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_pcrf_ppd_port_3:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - local_storage_pcrf_server_ppd:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - link_pcrf_ppd_port_4:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_pcrf_ppd_port_7:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_pcrf_ppd_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_pcrf_ppd_port_2:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_pcrf_ppd_port_0:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ capabilities:
+ attachment_pcrf_ppd_port_1:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_pcrf_ppd_port_2:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_pcrf_server_ppd:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_pcrf_ppd_port_0:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_pcrf_ppd_port_5:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_pcrf_ppd_port_6:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_pcrf_ppd_port_3:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_pcrf_server_ppd:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_pcrf_ppd_port_4:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_pcrf_server_ppd:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_pcrf_server_ppd:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_pcrf_ppd_port_7:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_pcrf_server_ppd:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ org.openecomp.resource.abstract.nodes.heat.nested-pcm_v1.0:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ pcrf_pcm_flavor_name:
+ type: string
+ description: flavor name of PCRF CM instance
+ availabilityzone_name:
+ type: string
+ description: availabilityzone name
+ pcrf_cps_net_ip:
+ type: string
+ description: CPS network ip
+ pcrf_pcm_image_name:
+ type: string
+ description: PCRF CM image name
+ pcrf_vnf_id:
+ type: string
+ description: PCRF VNF Id
+ pcrf_oam_net_name:
+ type: string
+ description: OAM network name
+ pcrf_cps_net_name:
+ type: string
+ description: CPS network name
+ pcrf_oam_net_ip:
+ type: string
+ description: OAM network ip
+ pcrf_oam_net_mask:
+ type: string
+ description: CPS network mask
+ pcrf_cps_net_mask:
+ type: string
+ description: CPS network mask
+ pcrf_pcm_server_name:
+ type: string
+ description: PCRF CM server name
+ pcrf_oam_net_gw:
+ type: string
+ description: CPS network gateway
+ pcrf_pcm_volume_id:
+ type: string
+ description: CPS Cluman Cinder Volume
+ pcrf_security_group_name:
+ type: string
+ description: the name of security group
+ attributes:
+ pcrf_server_pcm_id:
+ type: string
+ description: the pcm server id
+ requirements:
+ - link_pcrf_pcm_port_0:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - local_storage_pcrf_server_pcm:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - link_pcrf_pcm_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ capabilities:
+ endpoint_pcrf_server_pcm:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_pcrf_pcm_port_0:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_pcrf_server_pcm:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_pcrf_server_pcm:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_pcrf_server_pcm:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_pcrf_server_pcm:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_pcrf_pcm_port_1:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ org.openecomp.resource.abstract.nodes.heat.nested-oam_v1.0:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ availabilityzone_name:
+ type: string
+ description: availabilityzone name
+ pcrf_oam_flavor_name:
+ type: string
+ description: flavor name of PCRF OAM instance
+ pcrf_oam_server_name:
+ type: string
+ description: PCRF OAM server name
+ pcrf_cps_net_ip:
+ type: string
+ description: CPS network ip
+ pcrf_vnf_id:
+ type: string
+ description: PCRF VNF Id
+ pcrf_oam_net_name:
+ type: string
+ description: OAM network name
+ pcrf_cps_net_name:
+ type: string
+ description: CPS network name
+ pcrf_arbiter_vip:
+ type: string
+ description: OAM Arbiter LB VIP
+ pcrf_oam_net_ip:
+ type: string
+ description: OAM network ip
+ pcrf_oam_net_mask:
+ type: string
+ description: CPS network mask
+ pcrf_cps_net_mask:
+ type: string
+ description: CPS network mask
+ pcrf_oam_volume_id:
+ type: string
+ description: CPS OAM Cinder Volume
+ pcrf_oam_net_gw:
+ type: string
+ description: CPS network gateway
+ pcrf_oam_image_name:
+ type: string
+ description: PCRF OAM image name
+ pcrf_security_group_name:
+ type: string
+ description: the name of security group
+ attributes:
+ pcrf_oam_vol_attachment_id:
+ type: string
+ description: the pcrf_oam_vol_attachment_id id
+ requirements:
+ - local_storage_pcrf_server_oam:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - link_pcrf_oam_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_pcrf_oam_port_0:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ capabilities:
+ endpoint_pcrf_server_oam:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_pcrf_server_oam:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_pcrf_server_oam:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_pcrf_oam_port_1:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_pcrf_oam_port_0:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_pcrf_server_oam:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_pcrf_server_oam:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ org.openecomp.resource.abstract.nodes.heat.nested-psm_v1.0:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ pcrf_cps_net_ip:
+ type: string
+ description: CPS network ip
+ pcrf_psm_flavor_name:
+ type: string
+ description: flavor name of PCRF SM instance
+ pcrf_psm_image_name:
+ type: string
+ description: PCRF SM image name
+ availabilityzone_name:
+ type: string
+ description: availabilityzone name
+ pcrf_vnf_id:
+ type: string
+ description: PCRF VNF Id
+ pcrf_cps_net_name:
+ type: string
+ description: CPS network name
+ pcrf_cps_net_mask:
+ type: string
+ description: CPS network mask
+ pcrf_psm_server_name:
+ type: string
+ description: PCRF SM server name
+ pcrf_security_group_name:
+ type: string
+ description: the name of security group
+ requirements:
+ - local_storage_pcrf_server_psm:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - link_psm01_port_0:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ capabilities:
+ endpoint_pcrf_server_psm:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_pcrf_server_psm:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_pcrf_server_psm:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_psm01_port_0:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_pcrf_server_psm:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_pcrf_server_psm:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..d6c309eb24
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/MainServiceTemplate.yaml
@@ -0,0 +1,1646 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ availabilityzone_name:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ default: nova
+ pcrf_sgi_sy_net_ips:
+ label: Sgi Sy network ips
+ hidden: false
+ immutable: false
+ type: list
+ description: Sgi Sy network ips
+ default:
+ - 107.239.26.131
+ - 107.239.26.132
+ - 107.239.26.133
+ - 107.239.26.134
+ entry_schema:
+ type: string
+ pcrf_ppd_server_names:
+ label: PCRF PD server names
+ hidden: false
+ immutable: false
+ type: list
+ description: name of the PCRF PD instance
+ default:
+ - ZRDM1PCRF01PPD001
+ - ZRDM1PCRF01PPD002
+ - ZRDM1PCRF01PPD003
+ - ZRDM1PCRF01PPD004
+ entry_schema:
+ type: string
+ pcrf_oam_vol_size:
+ label: Cinder volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: the size of the Cinder volume
+ default: 500
+ pcrf_oam_vol_name_2:
+ label: OAM volume name 2
+ hidden: false
+ immutable: false
+ type: string
+ description: Assigning name to volume
+ default: sde1-pcrfx01-oam001-vol-2
+ pcrf_pps_flavor_name:
+ label: PCRF PS flavor name
+ hidden: false
+ immutable: false
+ type: string
+ description: flavor name of PCRF PS instance
+ default: lc.3xlarge
+ pcrf_psm_server_names:
+ label: PCRF SM server names
+ hidden: false
+ immutable: false
+ type: list
+ description: name of the PCRF SM instance
+ default:
+ - ZRDM1PCRF01PSM001
+ - ZRDM1PCRF01PSM002
+ - ZRDM1PCRF01PSM003
+ - ZRDM1PCRF01PSM004
+ - ZRDM1PCRF01PSM005
+ - ZRDM1PCRF01PSM006
+ - ZRDM1PCRF01PSM007
+ - ZRDM1PCRF01PSM008
+ - ZRDM1PCRF01PSM009
+ - ZRDM1PCRF01PSM010
+ - ZRDM1PCRF01PSM011
+ - ZRDM1PCRF01PSM012
+ entry_schema:
+ type: string
+ pcrf_oam_vol_name_1:
+ label: OAM volume name 1
+ hidden: false
+ immutable: false
+ type: string
+ description: Assigning name to volume
+ default: sde1-pcrfx01-oam001-vol-1
+ pcrf_sy_net_name:
+ label: Sy network name
+ hidden: false
+ immutable: false
+ type: string
+ description: Sy network name
+ default: Mobisupport-25193-I-INT1_cor_pcrf_sy_net_0
+ pcrf_pcm_vol_size:
+ label: Cinder volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: the size of the Cinder volume
+ default: 50
+ pcrf_vnf_id:
+ label: PCRF VNF Id
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF VNF Id
+ default: 730797234b4a40aa99335157b02871cd
+ pcrf_pcm_image_name:
+ label: PCRF CM image name
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF CM image name
+ default: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_oam_net_name:
+ label: OAM network name
+ hidden: false
+ immutable: false
+ type: string
+ description: OAM network name
+ default: MNS-25180-L-01_oam_protected_net_0
+ pcrf_sd_net_ips:
+ label: Sd network ips
+ hidden: false
+ immutable: false
+ type: list
+ description: Sd network ips
+ default:
+ - 107.239.24.99
+ - 107.239.24.100
+ - 107.239.24.101
+ - 107.239.24.102
+ entry_schema:
+ type: string
+ pcrf_sp_net_ips:
+ label: Sp network ips
+ hidden: false
+ immutable: false
+ type: list
+ description: Sp network ips
+ default:
+ - 107.239.24.75
+ - 107.239.24.76
+ - 107.239.24.77
+ - 107.239.24.78
+ entry_schema:
+ type: string
+ pcrf_cps_net_mask:
+ label: CPS network mask
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network mask
+ default: 255.255.255.0
+ pcrf_pcm_volume_silver:
+ label: vm volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the target volume backend for PCM
+ default: Silver
+ pcrf_rx_net_ips:
+ label: Rx network ips
+ hidden: false
+ immutable: false
+ type: list
+ description: Rx network ips
+ default:
+ - 107.239.24.91
+ - 107.239.24.92
+ - 107.239.24.93
+ - 107.239.24.94
+ entry_schema:
+ type: string
+ pcrf_sgi_sy_net_name:
+ label: Sgi Sy network name
+ hidden: false
+ immutable: false
+ type: string
+ description: Sgi Sy network name
+ default: Mobisupport-25193-I-INT1_sgi_pcrf_sy_net_0
+ pcrf_sd_net_name:
+ label: Sd network name
+ hidden: false
+ immutable: false
+ type: string
+ description: Sd network name
+ default: Mobisupport-25193-I-INT1_cor_pcrf_sd_net_0
+ pcrf_pcm_volume_id_1:
+ label: CPS Cluman Cinder Volume
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS Cluman Cinder Volume
+ default: 3438a3fe-1241-4390-80f2-d0b86238c40e
+ pcrf_oam_volume_silver-2:
+ label: vm volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the target volume backend for OAM2
+ default: Silver
+ pcrf_oam_volume_silver-1:
+ label: vm volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the target volume backend for OAM1
+ default: Silver
+ pcrf_oam_flavor_name:
+ label: PCRF OAM flavor name
+ hidden: false
+ immutable: false
+ type: string
+ description: flavor name of PCRF OAM instance
+ default: lc.4xlarge4
+ pcrf_pcm_server_names:
+ label: PCRF CM server names
+ hidden: false
+ immutable: false
+ type: list
+ description: name of the PCRF CM instance
+ default:
+ - ZRDM1PCRF01PCM001
+ entry_schema:
+ type: string
+ pcrf_cps_net_name:
+ label: CPS network name
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network name
+ default: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_oam_net_mask:
+ label: CPS network mask
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network mask
+ default: 255.255.248.0
+ pcrf_sgi_sy_net_mask:
+ label: Sgi Sy network mask
+ hidden: false
+ immutable: false
+ type: string
+ description: Sgi Sy network mask
+ default: 255.255.255.248
+ pcrf_pps_image_name:
+ label: PCRF PS image name
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF PS image name
+ default: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_lb_internal_vip:
+ label: CPS Internal LB VIP
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS Internal LB VIP
+ default: 172.26.16.114
+ pcrf_pcm_flavor_name:
+ label: PCRF CM flavor name
+ hidden: false
+ immutable: false
+ type: string
+ description: flavor name of PCRF CM instance
+ default: lc.2xlarge4
+ pcrf_ppd_image_name:
+ label: PCRF PD image name
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF PD image name
+ default: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_pcm_vol_name_1:
+ label: PCM volume name
+ hidden: false
+ immutable: false
+ type: string
+ description: Assigning name to volume
+ default: sde1-pcrfx01-pcm001-vol-1
+ pcrf_sp_net_mask:
+ label: Sp network mask
+ hidden: false
+ immutable: false
+ type: string
+ description: Sp network mask
+ default: 255.255.255.248
+ pcrf_psm_flavor_name:
+ label: PCRF SM flavor name
+ hidden: false
+ immutable: false
+ type: string
+ description: flavor name of PCRF SM instance
+ default: lc.4xlarge4
+ pcrf_psm_image_name:
+ label: PCRF SM image name
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF SM image name
+ default: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_oam_net_ips:
+ label: OAM network ips
+ hidden: false
+ immutable: false
+ type: list
+ description: OAM network ips
+ default:
+ - 107.239.64.121
+ entry_schema:
+ type: string
+ pcrf_gx_net_mask:
+ label: Gx network mask
+ hidden: false
+ immutable: false
+ type: string
+ description: Gx network mask
+ default: 255.255.255.248
+ pcrf_oam_net_gw:
+ label: CPS network gateway
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network gateway
+ default: 107.239.64.1
+ pcrf_gx_net_ips:
+ label: Gx network ips
+ hidden: false
+ immutable: false
+ type: list
+ description: Gx network ips
+ default:
+ - 107.239.24.67
+ - 107.239.24.68
+ - 107.239.24.69
+ - 107.239.24.70
+ entry_schema:
+ type: string
+ pcrf_rx_net_name:
+ label: Rx network name
+ hidden: false
+ immutable: false
+ type: string
+ description: Rx network name
+ default: Mobisupport-25193-I-INT1_cor_pcrf_rx_net_0
+ pcrf_oam_image_name:
+ label: PCRF OAM image name
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF OAM image name
+ default: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_cps_net_ips:
+ label: CPS network ips
+ hidden: false
+ immutable: false
+ type: list
+ description: CPS network ips
+ default:
+ - 172.26.16.113
+ entry_schema:
+ type: string
+ pcrf_oam_volume_id_1:
+ label: CPS OAM 001 Cinder Volume
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS OAM 001 Cinder Volumes
+ default: a4aa05fb-fcdc-457b-8077-6845fdfc3257
+ pcrf_oam_volume_id_2:
+ label: CPS OAM 002 Cinder Volume
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS OAM 002 Cinder Volumes
+ default: 93d8fc1f-f1c3-4933-86b2-039881ee910f
+ pcrf_pps_server_names:
+ label: PCRF PS server names
+ hidden: false
+ immutable: false
+ type: list
+ description: PCRF PS server names
+ default:
+ - ZRDM1PCRF01PPS001
+ - ZRDM1PCRF01PPS002
+ - ZRDM1PCRF01PPS003
+ - ZRDM1PCRF01PPS004
+ - ZRDM1PCRF01PPS005
+ - ZRDM1PCRF01PPS006
+ entry_schema:
+ type: string
+ pcrf_ppd_flavor_name:
+ label: PCRF PD flavor name
+ hidden: false
+ immutable: false
+ type: string
+ description: flavor name of PCRF PD instance
+ default: lc.4xlarge4
+ pcrf_sy_net_mask:
+ label: Sy network mask
+ hidden: false
+ immutable: false
+ type: string
+ description: Sy network mask
+ default: 255.255.255.248
+ pcrf_arbiter_vip:
+ label: OAM Arbiter LB VIP
+ hidden: false
+ immutable: false
+ type: string
+ description: OAM Arbiter LB VIP
+ default: 172.26.16.115
+ pcrf_lb_management_vip:
+ label: CPS OAM LB VIP
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS OAM LB VIP
+ default: 107.239.64.123
+ pcrf_sy_net_ips:
+ label: Sy network ips
+ hidden: false
+ immutable: false
+ type: list
+ description: Sy network ips
+ default:
+ - 107.239.24.83
+ - 107.239.24.84
+ - 107.239.24.85
+ - 107.239.24.86
+ entry_schema:
+ type: string
+ pcrf_sd_net_mask:
+ label: Sd network mask
+ hidden: false
+ immutable: false
+ type: string
+ description: Sd network mask
+ default: 255.255.255.248
+ pcrf_gx_net_name:
+ label: Gx network name
+ hidden: false
+ immutable: false
+ type: string
+ description: Gx network name
+ default: Mobisupport-25193-I-INT1_cor_pcrf_gx_net_0
+ pcrf_sp_net_name:
+ label: Sp network name
+ hidden: false
+ immutable: false
+ type: string
+ description: Sp network name
+ default: Mobisupport-25193-I-INT1_cor_pcrf_sp_net_0
+ pcrf_oam_server_names:
+ label: PCRF OAM server names
+ hidden: false
+ immutable: false
+ type: list
+ description: name of the PCRF OAM instance
+ default:
+ - ZRDM1PCRF01OAM001
+ - ZRDM1PCRF01OAM002
+ entry_schema:
+ type: string
+ pcrf_security_group_name:
+ label: security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of security group
+ default: nimbus_security_group
+ pcrf_rx_net_mask:
+ label: Rx network mask
+ hidden: false
+ immutable: false
+ type: string
+ description: Rx network mask
+ default: 255.255.255.248
+ node_templates:
+ server_pcrf_psm_012:
+ type: org.openecomp.resource.abstract.nodes.heat.nested-psm_v1.0
+ directives:
+ - substitutable
+ properties:
+ pcrf_cps_net_ip:
+ get_input:
+ - pcrf_cps_net_ips
+ - 11
+ service_template_filter:
+ substitute_service_template: nested-psm_v1.0ServiceTemplate.yaml
+ pcrf_psm_flavor_name:
+ get_input: pcrf_psm_flavor_name
+ pcrf_psm_image_name:
+ get_input: pcrf_psm_image_name
+ availabilityzone_name:
+ get_input: availabilityzone_name
+ pcrf_vnf_id:
+ get_input: pcrf_vnf_id
+ pcrf_cps_net_name:
+ get_input: pcrf_cps_net_name
+ pcrf_cps_net_mask:
+ get_input: pcrf_cps_net_mask
+ pcrf_psm_server_name:
+ get_input:
+ - pcrf_psm_server_names
+ - 11
+ pcrf_security_group_name:
+ get_input: pcrf_security_group_name
+ server_pcrf_pcm_001:
+ type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v1.0
+ directives:
+ - substitutable
+ properties:
+ pcrf_pcm_flavor_name:
+ get_input: pcrf_pcm_flavor_name
+ availabilityzone_name:
+ get_input: availabilityzone_name
+ pcrf_cps_net_ip:
+ get_input:
+ - pcrf_cps_net_ips
+ - 0
+ service_template_filter:
+ substitute_service_template: nested-pcm_v1.0ServiceTemplate.yaml
+ pcrf_pcm_image_name:
+ get_input: pcrf_pcm_image_name
+ pcrf_vnf_id:
+ get_input: pcrf_vnf_id
+ pcrf_oam_net_name:
+ get_input: pcrf_oam_net_name
+ pcrf_cps_net_name:
+ get_input: pcrf_cps_net_name
+ pcrf_oam_net_ip:
+ get_input:
+ - pcrf_oam_net_ips
+ - 0
+ pcrf_oam_net_mask:
+ get_input: pcrf_oam_net_mask
+ pcrf_cps_net_mask:
+ get_input: pcrf_cps_net_mask
+ pcrf_pcm_server_name:
+ get_input:
+ - pcrf_pcm_server_names
+ - 0
+ pcrf_pcm_volume_id:
+ get_input: pcrf_pcm_volume_id_1
+ pcrf_oam_net_gw:
+ get_input: pcrf_oam_net_gw
+ pcrf_security_group_name:
+ get_input: pcrf_security_group_name
+ requirements:
+ - local_storage_pcrf_server_pcm:
+ capability: tosca.capabilities.Attachment
+ node: pcrf_pcm_volume_id_1
+ relationship: tosca.relationships.AttachesTo
+ pcrf_oam_volume_id_11:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: pcrf_oam_volume_silver-1
+ size: '(get_input : pcrf_oam_vol_size) * 1024'
+ name:
+ get_input: pcrf_oam_vol_name_1
+ server_pcrf_oam_001:
+ type: org.openecomp.resource.abstract.nodes.heat.nested-oam_v1.0
+ directives:
+ - substitutable
+ properties:
+ availabilityzone_name:
+ get_input: availabilityzone_name
+ pcrf_oam_flavor_name:
+ get_input: pcrf_oam_flavor_name
+ pcrf_oam_server_name:
+ get_input:
+ - pcrf_oam_server_names
+ - 0
+ pcrf_cps_net_ip:
+ get_input:
+ - pcrf_cps_net_ips
+ - 0
+ service_template_filter:
+ substitute_service_template: nested-oam_v1.0ServiceTemplate.yaml
+ pcrf_vnf_id:
+ get_input: pcrf_vnf_id
+ pcrf_oam_net_name:
+ get_input: pcrf_oam_net_name
+ pcrf_cps_net_name:
+ get_input: pcrf_cps_net_name
+ pcrf_oam_net_ip:
+ get_input:
+ - pcrf_oam_net_ips
+ - 0
+ pcrf_oam_net_mask:
+ get_input: pcrf_oam_net_mask
+ pcrf_arbiter_vip:
+ get_input: pcrf_arbiter_vip
+ pcrf_cps_net_mask:
+ get_input: pcrf_cps_net_mask
+ pcrf_oam_volume_id:
+ get_input: pcrf_oam_volume_id_1
+ pcrf_oam_net_gw:
+ get_input: pcrf_oam_net_gw
+ pcrf_oam_image_name:
+ get_input: pcrf_oam_image_name
+ pcrf_security_group_name:
+ get_input: pcrf_security_group_name
+ requirements:
+ - local_storage_pcrf_server_oam:
+ capability: tosca.capabilities.Attachment
+ node: pcrf_oam_volume_id_11
+ relationship: tosca.relationships.AttachesTo
+ server_pcrf_oam_002:
+ type: org.openecomp.resource.abstract.nodes.heat.nested-oam_v1.0
+ directives:
+ - substitutable
+ properties:
+ availabilityzone_name:
+ get_input: availabilityzone_name
+ pcrf_oam_flavor_name:
+ get_input: pcrf_oam_flavor_name
+ pcrf_oam_server_name:
+ get_input:
+ - pcrf_oam_server_names
+ - 1
+ pcrf_cps_net_ip:
+ get_input:
+ - pcrf_cps_net_ips
+ - 1
+ service_template_filter:
+ substitute_service_template: nested-oam_v1.0ServiceTemplate.yaml
+ pcrf_vnf_id:
+ get_input: pcrf_vnf_id
+ pcrf_oam_net_name:
+ get_input: pcrf_oam_net_name
+ pcrf_cps_net_name:
+ get_input: pcrf_cps_net_name
+ pcrf_oam_net_ip:
+ get_input:
+ - pcrf_oam_net_ips
+ - 1
+ pcrf_oam_net_mask:
+ get_input: pcrf_oam_net_mask
+ pcrf_arbiter_vip:
+ get_input: pcrf_arbiter_vip
+ pcrf_cps_net_mask:
+ get_input: pcrf_cps_net_mask
+ pcrf_oam_volume_id:
+ get_input: pcrf_oam_volume_id_2
+ pcrf_oam_net_gw:
+ get_input: pcrf_oam_net_gw
+ pcrf_oam_image_name:
+ get_input: pcrf_oam_image_name
+ pcrf_security_group_name:
+ get_input: pcrf_security_group_name
+ requirements:
+ - local_storage_pcrf_server_oam:
+ capability: tosca.capabilities.Attachment
+ node: pcrf_oam_volume_id_22
+ relationship: tosca.relationships.AttachesTo
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: server_pcrf_oam_001
+ relationship: tosca.relationships.DependsOn
+ server_pcrf_ppd_003:
+ type: org.openecomp.resource.abstract.nodes.heat.nested-ppd_v1.0
+ directives:
+ - substitutable
+ properties:
+ pcrf_ppd_image_name:
+ get_input: pcrf_ppd_image_name
+ availabilityzone_name:
+ get_input: availabilityzone_name
+ pcrf_sp_net_ip:
+ get_input:
+ - pcrf_sp_net_ips
+ - 2
+ pcrf_ppd_server_name:
+ get_input:
+ - pcrf_ppd_server_names
+ - 2
+ pcrf_gx_net_ip:
+ get_input:
+ - pcrf_gx_net_ips
+ - 2
+ pcrf_sy_net_name:
+ get_input: pcrf_sy_net_name
+ pcrf_sp_net_mask:
+ get_input: pcrf_sp_net_mask
+ service_template_filter:
+ substitute_service_template: nested-ppd_v1.0ServiceTemplate.yaml
+ pcrf_sd_net_ip:
+ get_input:
+ - pcrf_sd_net_ips
+ - 2
+ pcrf_vnf_id:
+ get_input: pcrf_vnf_id
+ pcrf_oam_net_name:
+ get_input: pcrf_oam_net_name
+ pcrf_oam_net_ip:
+ get_input:
+ - pcrf_oam_net_ips
+ - 2
+ pcrf_cps_net_mask:
+ get_input: pcrf_cps_net_mask
+ pcrf_gx_net_mask:
+ get_input: pcrf_gx_net_mask
+ pcrf_sgi_sy_net_name:
+ get_input: pcrf_sgi_sy_net_name
+ pcrf_sd_net_name:
+ get_input: pcrf_sd_net_name
+ pcrf_oam_net_gw:
+ get_input: pcrf_oam_net_gw
+ pcrf_rx_net_name:
+ get_input: pcrf_rx_net_name
+ pcrf_rx_net_ip:
+ get_input:
+ - pcrf_rx_net_ips
+ - 2
+ pcrf_sy_net_ip:
+ get_input:
+ - pcrf_sy_net_ips
+ - 2
+ pcrf_sgi_sy_net_ip:
+ get_input:
+ - pcrf_sgi_sy_net_ips
+ - 2
+ pcrf_ppd_flavor_name:
+ get_input: pcrf_ppd_flavor_name
+ pcrf_cps_net_ip:
+ get_input:
+ - pcrf_cps_net_ips
+ - 2
+ pcrf_sy_net_mask:
+ get_input: pcrf_sy_net_mask
+ pcrf_cps_net_name:
+ get_input: pcrf_cps_net_name
+ pcrf_oam_net_mask:
+ get_input: pcrf_oam_net_mask
+ pcrf_lb_management_vip:
+ get_input: pcrf_lb_management_vip
+ pcrf_sgi_sy_net_mask:
+ get_input: pcrf_sgi_sy_net_mask
+ pcrf_lb_internal_vip:
+ get_input: pcrf_lb_internal_vip
+ pcrf_sd_net_mask:
+ get_input: pcrf_sd_net_mask
+ pcrf_gx_net_name:
+ get_input: pcrf_gx_net_name
+ pcrf_sp_net_name:
+ get_input: pcrf_sp_net_name
+ pcrf_security_group_name:
+ get_input: pcrf_security_group_name
+ pcrf_rx_net_mask:
+ get_input: pcrf_rx_net_mask
+ server_pcrf_ppd_004:
+ type: org.openecomp.resource.abstract.nodes.heat.nested-ppd_v1.0
+ directives:
+ - substitutable
+ properties:
+ pcrf_ppd_image_name:
+ get_input: pcrf_ppd_image_name
+ availabilityzone_name:
+ get_input: availabilityzone_name
+ pcrf_sp_net_ip:
+ get_input:
+ - pcrf_sp_net_ips
+ - 3
+ pcrf_ppd_server_name:
+ get_input:
+ - pcrf_ppd_server_names
+ - 3
+ pcrf_gx_net_ip:
+ get_input:
+ - pcrf_gx_net_ips
+ - 3
+ pcrf_sy_net_name:
+ get_input: pcrf_sy_net_name
+ pcrf_sp_net_mask:
+ get_input: pcrf_sp_net_mask
+ service_template_filter:
+ substitute_service_template: nested-ppd_v1.0ServiceTemplate.yaml
+ pcrf_sd_net_ip:
+ get_input:
+ - pcrf_sd_net_ips
+ - 3
+ pcrf_vnf_id:
+ get_input: pcrf_vnf_id
+ pcrf_oam_net_name:
+ get_input: pcrf_oam_net_name
+ pcrf_oam_net_ip:
+ get_input:
+ - pcrf_oam_net_ips
+ - 3
+ pcrf_cps_net_mask:
+ get_input: pcrf_cps_net_mask
+ pcrf_gx_net_mask:
+ get_input: pcrf_gx_net_mask
+ pcrf_sgi_sy_net_name:
+ get_input: pcrf_sgi_sy_net_name
+ pcrf_sd_net_name:
+ get_input: pcrf_sd_net_name
+ pcrf_oam_net_gw:
+ get_input: pcrf_oam_net_gw
+ pcrf_rx_net_name:
+ get_input: pcrf_rx_net_name
+ pcrf_rx_net_ip:
+ get_input:
+ - pcrf_rx_net_ips
+ - 3
+ pcrf_sy_net_ip:
+ get_input:
+ - pcrf_sy_net_ips
+ - 3
+ pcrf_sgi_sy_net_ip:
+ get_input:
+ - pcrf_sgi_sy_net_ips
+ - 3
+ pcrf_ppd_flavor_name:
+ get_input: pcrf_ppd_flavor_name
+ pcrf_cps_net_ip:
+ get_input:
+ - pcrf_cps_net_ips
+ - 3
+ pcrf_sy_net_mask:
+ get_input: pcrf_sy_net_mask
+ pcrf_cps_net_name:
+ get_input: pcrf_cps_net_name
+ pcrf_oam_net_mask:
+ get_input: pcrf_oam_net_mask
+ pcrf_lb_management_vip:
+ get_input: pcrf_lb_management_vip
+ pcrf_sgi_sy_net_mask:
+ get_input: pcrf_sgi_sy_net_mask
+ pcrf_lb_internal_vip:
+ get_input: pcrf_lb_internal_vip
+ pcrf_sd_net_mask:
+ get_input: pcrf_sd_net_mask
+ pcrf_gx_net_name:
+ get_input: pcrf_gx_net_name
+ pcrf_sp_net_name:
+ get_input: pcrf_sp_net_name
+ pcrf_security_group_name:
+ get_input: pcrf_security_group_name
+ pcrf_rx_net_mask:
+ get_input: pcrf_rx_net_mask
+ pcrf_pcm_volume_id_1:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: pcrf_pcm_volume_silver
+ size: '(get_input : pcrf_pcm_vol_size) * 1024'
+ name:
+ get_input: pcrf_pcm_vol_name_1
+ server_pcrf_ppd_001:
+ type: org.openecomp.resource.abstract.nodes.heat.nested-ppd_v1.0
+ directives:
+ - substitutable
+ properties:
+ pcrf_ppd_image_name:
+ get_input: pcrf_ppd_image_name
+ availabilityzone_name:
+ get_input: availabilityzone_name
+ pcrf_sp_net_ip:
+ get_input:
+ - pcrf_sp_net_ips
+ - 0
+ pcrf_ppd_server_name:
+ get_input:
+ - pcrf_ppd_server_names
+ - 0
+ pcrf_gx_net_ip:
+ get_input:
+ - pcrf_gx_net_ips
+ - 0
+ pcrf_sy_net_name:
+ get_input: pcrf_sy_net_name
+ pcrf_sp_net_mask:
+ get_input: pcrf_sp_net_mask
+ service_template_filter:
+ substitute_service_template: nested-ppd_v1.0ServiceTemplate.yaml
+ pcrf_sd_net_ip:
+ get_input:
+ - pcrf_sd_net_ips
+ - 0
+ pcrf_vnf_id:
+ get_input: pcrf_vnf_id
+ pcrf_oam_net_name:
+ get_input: pcrf_oam_net_name
+ pcrf_oam_net_ip:
+ get_input:
+ - pcrf_oam_net_ips
+ - 0
+ pcrf_cps_net_mask:
+ get_input: pcrf_cps_net_mask
+ pcrf_gx_net_mask:
+ get_input: pcrf_gx_net_mask
+ pcrf_sgi_sy_net_name:
+ get_input: pcrf_sgi_sy_net_name
+ pcrf_sd_net_name:
+ get_input: pcrf_sd_net_name
+ pcrf_oam_net_gw:
+ get_input: pcrf_oam_net_gw
+ pcrf_rx_net_name:
+ get_input: pcrf_rx_net_name
+ pcrf_rx_net_ip:
+ get_input:
+ - pcrf_rx_net_ips
+ - 0
+ pcrf_sy_net_ip:
+ get_input:
+ - pcrf_sy_net_ips
+ - 0
+ pcrf_sgi_sy_net_ip:
+ get_input:
+ - pcrf_sgi_sy_net_ips
+ - 0
+ pcrf_ppd_flavor_name:
+ get_input: pcrf_ppd_flavor_name
+ pcrf_cps_net_ip:
+ get_input:
+ - pcrf_cps_net_ips
+ - 0
+ pcrf_sy_net_mask:
+ get_input: pcrf_sy_net_mask
+ pcrf_cps_net_name:
+ get_input: pcrf_cps_net_name
+ pcrf_oam_net_mask:
+ get_input: pcrf_oam_net_mask
+ pcrf_lb_management_vip:
+ get_input: pcrf_lb_management_vip
+ pcrf_sgi_sy_net_mask:
+ get_input: pcrf_sgi_sy_net_mask
+ pcrf_lb_internal_vip:
+ get_input: pcrf_lb_internal_vip
+ pcrf_sd_net_mask:
+ get_input: pcrf_sd_net_mask
+ pcrf_gx_net_name:
+ get_input: pcrf_gx_net_name
+ pcrf_sp_net_name:
+ get_input: pcrf_sp_net_name
+ pcrf_security_group_name:
+ get_input: pcrf_security_group_name
+ pcrf_rx_net_mask:
+ get_input: pcrf_rx_net_mask
+ server_pcrf_ppd_002:
+ type: org.openecomp.resource.abstract.nodes.heat.nested-ppd_v1.0
+ directives:
+ - substitutable
+ properties:
+ pcrf_ppd_image_name:
+ get_input: pcrf_ppd_image_name
+ availabilityzone_name:
+ get_input: availabilityzone_name
+ pcrf_sp_net_ip:
+ get_input:
+ - pcrf_sp_net_ips
+ - 1
+ pcrf_ppd_server_name:
+ get_input:
+ - pcrf_ppd_server_names
+ - 1
+ pcrf_gx_net_ip:
+ get_input:
+ - pcrf_gx_net_ips
+ - 1
+ pcrf_sy_net_name:
+ get_input: pcrf_sy_net_name
+ pcrf_sp_net_mask:
+ get_input: pcrf_sp_net_mask
+ service_template_filter:
+ substitute_service_template: nested-ppd_v1.0ServiceTemplate.yaml
+ pcrf_sd_net_ip:
+ get_input:
+ - pcrf_sd_net_ips
+ - 1
+ pcrf_vnf_id:
+ get_input: pcrf_vnf_id
+ pcrf_oam_net_name:
+ get_input: pcrf_oam_net_name
+ pcrf_oam_net_ip:
+ get_input:
+ - pcrf_oam_net_ips
+ - 1
+ pcrf_cps_net_mask:
+ get_input: pcrf_cps_net_mask
+ pcrf_gx_net_mask:
+ get_input: pcrf_gx_net_mask
+ pcrf_sgi_sy_net_name:
+ get_input: pcrf_sgi_sy_net_name
+ pcrf_sd_net_name:
+ get_input: pcrf_sd_net_name
+ pcrf_oam_net_gw:
+ get_input: pcrf_oam_net_gw
+ pcrf_rx_net_name:
+ get_input: pcrf_rx_net_name
+ pcrf_rx_net_ip:
+ get_input:
+ - pcrf_rx_net_ips
+ - 1
+ pcrf_sy_net_ip:
+ get_input:
+ - pcrf_sy_net_ips
+ - 1
+ pcrf_sgi_sy_net_ip:
+ get_input:
+ - pcrf_sgi_sy_net_ips
+ - 1
+ pcrf_ppd_flavor_name:
+ get_input: pcrf_ppd_flavor_name
+ pcrf_cps_net_ip:
+ get_input:
+ - pcrf_cps_net_ips
+ - 1
+ pcrf_sy_net_mask:
+ get_input: pcrf_sy_net_mask
+ pcrf_cps_net_name:
+ get_input: pcrf_cps_net_name
+ pcrf_oam_net_mask:
+ get_input: pcrf_oam_net_mask
+ pcrf_lb_management_vip:
+ get_input: pcrf_lb_management_vip
+ pcrf_sgi_sy_net_mask:
+ get_input: pcrf_sgi_sy_net_mask
+ pcrf_lb_internal_vip:
+ get_input: pcrf_lb_internal_vip
+ pcrf_sd_net_mask:
+ get_input: pcrf_sd_net_mask
+ pcrf_gx_net_name:
+ get_input: pcrf_gx_net_name
+ pcrf_sp_net_name:
+ get_input: pcrf_sp_net_name
+ pcrf_security_group_name:
+ get_input: pcrf_security_group_name
+ pcrf_rx_net_mask:
+ get_input: pcrf_rx_net_mask
+ server_pcrf_psm_003:
+ type: org.openecomp.resource.abstract.nodes.heat.nested-psm_v1.0
+ directives:
+ - substitutable
+ properties:
+ pcrf_cps_net_ip:
+ get_input:
+ - pcrf_cps_net_ips
+ - 2
+ service_template_filter:
+ substitute_service_template: nested-psm_v1.0ServiceTemplate.yaml
+ pcrf_psm_flavor_name:
+ get_input: pcrf_psm_flavor_name
+ pcrf_psm_image_name:
+ get_input: pcrf_psm_image_name
+ availabilityzone_name:
+ get_input: availabilityzone_name
+ pcrf_vnf_id:
+ get_input: pcrf_vnf_id
+ pcrf_cps_net_name:
+ get_input: pcrf_cps_net_name
+ pcrf_cps_net_mask:
+ get_input: pcrf_cps_net_mask
+ pcrf_psm_server_name:
+ get_input:
+ - pcrf_psm_server_names
+ - 2
+ pcrf_security_group_name:
+ get_input: pcrf_security_group_name
+ server_pcrf_psm_004:
+ type: org.openecomp.resource.abstract.nodes.heat.nested-psm_v1.0
+ directives:
+ - substitutable
+ properties:
+ pcrf_cps_net_ip:
+ get_input:
+ - pcrf_cps_net_ips
+ - 3
+ service_template_filter:
+ substitute_service_template: nested-psm_v1.0ServiceTemplate.yaml
+ pcrf_psm_flavor_name:
+ get_input: pcrf_psm_flavor_name
+ pcrf_psm_image_name:
+ get_input: pcrf_psm_image_name
+ availabilityzone_name:
+ get_input: availabilityzone_name
+ pcrf_vnf_id:
+ get_input: pcrf_vnf_id
+ pcrf_cps_net_name:
+ get_input: pcrf_cps_net_name
+ pcrf_cps_net_mask:
+ get_input: pcrf_cps_net_mask
+ pcrf_psm_server_name:
+ get_input:
+ - pcrf_psm_server_names
+ - 3
+ pcrf_security_group_name:
+ get_input: pcrf_security_group_name
+ server_pcrf_psm_001:
+ type: org.openecomp.resource.abstract.nodes.heat.nested-psm_v1.0
+ directives:
+ - substitutable
+ properties:
+ pcrf_cps_net_ip:
+ get_input:
+ - pcrf_cps_net_ips
+ - 0
+ service_template_filter:
+ substitute_service_template: nested-psm_v1.0ServiceTemplate.yaml
+ pcrf_psm_flavor_name:
+ get_input: pcrf_psm_flavor_name
+ pcrf_psm_image_name:
+ get_input: pcrf_psm_image_name
+ availabilityzone_name:
+ get_input: availabilityzone_name
+ pcrf_vnf_id:
+ get_input: pcrf_vnf_id
+ pcrf_cps_net_name:
+ get_input: pcrf_cps_net_name
+ pcrf_cps_net_mask:
+ get_input: pcrf_cps_net_mask
+ pcrf_psm_server_name:
+ get_input:
+ - pcrf_psm_server_names
+ - 0
+ pcrf_security_group_name:
+ get_input: pcrf_security_group_name
+ server_pcrf_psm_002:
+ type: org.openecomp.resource.abstract.nodes.heat.nested-psm_v1.0
+ directives:
+ - substitutable
+ properties:
+ pcrf_cps_net_ip:
+ get_input:
+ - pcrf_cps_net_ips
+ - 1
+ service_template_filter:
+ substitute_service_template: nested-psm_v1.0ServiceTemplate.yaml
+ pcrf_psm_flavor_name:
+ get_input: pcrf_psm_flavor_name
+ pcrf_psm_image_name:
+ get_input: pcrf_psm_image_name
+ availabilityzone_name:
+ get_input: availabilityzone_name
+ pcrf_vnf_id:
+ get_input: pcrf_vnf_id
+ pcrf_cps_net_name:
+ get_input: pcrf_cps_net_name
+ pcrf_cps_net_mask:
+ get_input: pcrf_cps_net_mask
+ pcrf_psm_server_name:
+ get_input:
+ - pcrf_psm_server_names
+ - 1
+ pcrf_security_group_name:
+ get_input: pcrf_security_group_name
+ server_pcrf_psm_007:
+ type: org.openecomp.resource.abstract.nodes.heat.nested-psm_v1.0
+ directives:
+ - substitutable
+ properties:
+ pcrf_cps_net_ip:
+ get_input:
+ - pcrf_cps_net_ips
+ - 6
+ service_template_filter:
+ substitute_service_template: nested-psm_v1.0ServiceTemplate.yaml
+ pcrf_psm_flavor_name:
+ get_input: pcrf_psm_flavor_name
+ pcrf_psm_image_name:
+ get_input: pcrf_psm_image_name
+ availabilityzone_name:
+ get_input: availabilityzone_name
+ pcrf_vnf_id:
+ get_input: pcrf_vnf_id
+ pcrf_cps_net_name:
+ get_input: pcrf_cps_net_name
+ pcrf_cps_net_mask:
+ get_input: pcrf_cps_net_mask
+ pcrf_psm_server_name:
+ get_input:
+ - pcrf_psm_server_names
+ - 6
+ pcrf_security_group_name:
+ get_input: pcrf_security_group_name
+ server_pcrf_psm_008:
+ type: org.openecomp.resource.abstract.nodes.heat.nested-psm_v1.0
+ directives:
+ - substitutable
+ properties:
+ pcrf_cps_net_ip:
+ get_input:
+ - pcrf_cps_net_ips
+ - 7
+ service_template_filter:
+ substitute_service_template: nested-psm_v1.0ServiceTemplate.yaml
+ pcrf_psm_flavor_name:
+ get_input: pcrf_psm_flavor_name
+ pcrf_psm_image_name:
+ get_input: pcrf_psm_image_name
+ availabilityzone_name:
+ get_input: availabilityzone_name
+ pcrf_vnf_id:
+ get_input: pcrf_vnf_id
+ pcrf_cps_net_name:
+ get_input: pcrf_cps_net_name
+ pcrf_cps_net_mask:
+ get_input: pcrf_cps_net_mask
+ pcrf_psm_server_name:
+ get_input:
+ - pcrf_psm_server_names
+ - 7
+ pcrf_security_group_name:
+ get_input: pcrf_security_group_name
+ server_pcrf_psm_005:
+ type: org.openecomp.resource.abstract.nodes.heat.nested-psm_v1.0
+ directives:
+ - substitutable
+ properties:
+ pcrf_cps_net_ip:
+ get_input:
+ - pcrf_cps_net_ips
+ - 4
+ service_template_filter:
+ substitute_service_template: nested-psm_v1.0ServiceTemplate.yaml
+ pcrf_psm_flavor_name:
+ get_input: pcrf_psm_flavor_name
+ pcrf_psm_image_name:
+ get_input: pcrf_psm_image_name
+ availabilityzone_name:
+ get_input: availabilityzone_name
+ pcrf_vnf_id:
+ get_input: pcrf_vnf_id
+ pcrf_cps_net_name:
+ get_input: pcrf_cps_net_name
+ pcrf_cps_net_mask:
+ get_input: pcrf_cps_net_mask
+ pcrf_psm_server_name:
+ get_input:
+ - pcrf_psm_server_names
+ - 4
+ pcrf_security_group_name:
+ get_input: pcrf_security_group_name
+ server_pcrf_psm_006:
+ type: org.openecomp.resource.abstract.nodes.heat.nested-psm_v1.0
+ directives:
+ - substitutable
+ properties:
+ pcrf_cps_net_ip:
+ get_input:
+ - pcrf_cps_net_ips
+ - 5
+ service_template_filter:
+ substitute_service_template: nested-psm_v1.0ServiceTemplate.yaml
+ pcrf_psm_flavor_name:
+ get_input: pcrf_psm_flavor_name
+ pcrf_psm_image_name:
+ get_input: pcrf_psm_image_name
+ availabilityzone_name:
+ get_input: availabilityzone_name
+ pcrf_vnf_id:
+ get_input: pcrf_vnf_id
+ pcrf_cps_net_name:
+ get_input: pcrf_cps_net_name
+ pcrf_cps_net_mask:
+ get_input: pcrf_cps_net_mask
+ pcrf_psm_server_name:
+ get_input:
+ - pcrf_psm_server_names
+ - 5
+ pcrf_security_group_name:
+ get_input: pcrf_security_group_name
+ pcrf_oam_volume_id_22:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: pcrf_oam_volume_silver-2
+ size: '(get_input : pcrf_oam_vol_size) * 1024'
+ name:
+ get_input: pcrf_oam_vol_name_2
+ server_pcrf_psm_009:
+ type: org.openecomp.resource.abstract.nodes.heat.nested-psm_v1.0
+ directives:
+ - substitutable
+ properties:
+ pcrf_cps_net_ip:
+ get_input:
+ - pcrf_cps_net_ips
+ - 8
+ service_template_filter:
+ substitute_service_template: nested-psm_v1.0ServiceTemplate.yaml
+ pcrf_psm_flavor_name:
+ get_input: pcrf_psm_flavor_name
+ pcrf_psm_image_name:
+ get_input: pcrf_psm_image_name
+ availabilityzone_name:
+ get_input: availabilityzone_name
+ pcrf_vnf_id:
+ get_input: pcrf_vnf_id
+ pcrf_cps_net_name:
+ get_input: pcrf_cps_net_name
+ pcrf_cps_net_mask:
+ get_input: pcrf_cps_net_mask
+ pcrf_psm_server_name:
+ get_input:
+ - pcrf_psm_server_names
+ - 8
+ pcrf_security_group_name:
+ get_input: pcrf_security_group_name
+ server_pcrf_pps_001:
+ type: org.openecomp.resource.abstract.nodes.heat.nested-pps_v1.0
+ directives:
+ - substitutable
+ properties:
+ pcrf_cps_net_ip:
+ get_input:
+ - pcrf_cps_net_ips
+ - 0
+ service_template_filter:
+ substitute_service_template: nested-pps_v1.0ServiceTemplate.yaml
+ availabilityzone_name:
+ get_input: availabilityzone_name
+ pcrf_vnf_id:
+ get_input: pcrf_vnf_id
+ pcrf_cps_net_name:
+ get_input: pcrf_cps_net_name
+ pcrf_cps_net_mask:
+ get_input: pcrf_cps_net_mask
+ pcrf_pps_image_name:
+ get_input: pcrf_pps_image_name
+ pcrf_pps_flavor_name:
+ get_input: pcrf_pps_flavor_name
+ pcrf_pps_server_name:
+ get_input:
+ - pcrf_pps_server_names
+ - 0
+ pcrf_security_group_name:
+ get_input: pcrf_security_group_name
+ server_pcrf_pps_002:
+ type: org.openecomp.resource.abstract.nodes.heat.nested-pps_v1.0
+ directives:
+ - substitutable
+ properties:
+ pcrf_cps_net_ip:
+ get_input:
+ - pcrf_cps_net_ips
+ - 1
+ service_template_filter:
+ substitute_service_template: nested-pps_v1.0ServiceTemplate.yaml
+ availabilityzone_name:
+ get_input: availabilityzone_name
+ pcrf_vnf_id:
+ get_input: pcrf_vnf_id
+ pcrf_cps_net_name:
+ get_input: pcrf_cps_net_name
+ pcrf_cps_net_mask:
+ get_input: pcrf_cps_net_mask
+ pcrf_pps_image_name:
+ get_input: pcrf_pps_image_name
+ pcrf_pps_flavor_name:
+ get_input: pcrf_pps_flavor_name
+ pcrf_pps_server_name:
+ get_input:
+ - pcrf_pps_server_names
+ - 1
+ pcrf_security_group_name:
+ get_input: pcrf_security_group_name
+ server_pcrf_pps_003:
+ type: org.openecomp.resource.abstract.nodes.heat.nested-pps_v1.0
+ directives:
+ - substitutable
+ properties:
+ pcrf_cps_net_ip:
+ get_input:
+ - pcrf_cps_net_ips
+ - 2
+ service_template_filter:
+ substitute_service_template: nested-pps_v1.0ServiceTemplate.yaml
+ availabilityzone_name:
+ get_input: availabilityzone_name
+ pcrf_vnf_id:
+ get_input: pcrf_vnf_id
+ pcrf_cps_net_name:
+ get_input: pcrf_cps_net_name
+ pcrf_cps_net_mask:
+ get_input: pcrf_cps_net_mask
+ pcrf_pps_image_name:
+ get_input: pcrf_pps_image_name
+ pcrf_pps_flavor_name:
+ get_input: pcrf_pps_flavor_name
+ pcrf_pps_server_name:
+ get_input:
+ - pcrf_pps_server_names
+ - 2
+ pcrf_security_group_name:
+ get_input: pcrf_security_group_name
+ server_pcrf_pps_004:
+ type: org.openecomp.resource.abstract.nodes.heat.nested-pps_v1.0
+ directives:
+ - substitutable
+ properties:
+ pcrf_cps_net_ip:
+ get_input:
+ - pcrf_cps_net_ips
+ - 3
+ service_template_filter:
+ substitute_service_template: nested-pps_v1.0ServiceTemplate.yaml
+ availabilityzone_name:
+ get_input: availabilityzone_name
+ pcrf_vnf_id:
+ get_input: pcrf_vnf_id
+ pcrf_cps_net_name:
+ get_input: pcrf_cps_net_name
+ pcrf_cps_net_mask:
+ get_input: pcrf_cps_net_mask
+ pcrf_pps_image_name:
+ get_input: pcrf_pps_image_name
+ pcrf_pps_flavor_name:
+ get_input: pcrf_pps_flavor_name
+ pcrf_pps_server_name:
+ get_input:
+ - pcrf_pps_server_names
+ - 3
+ pcrf_security_group_name:
+ get_input: pcrf_security_group_name
+ server_pcrf_pps_005:
+ type: org.openecomp.resource.abstract.nodes.heat.nested-pps_v1.0
+ directives:
+ - substitutable
+ properties:
+ pcrf_cps_net_ip:
+ get_input:
+ - pcrf_cps_net_ips
+ - 4
+ service_template_filter:
+ substitute_service_template: nested-pps_v1.0ServiceTemplate.yaml
+ availabilityzone_name:
+ get_input: availabilityzone_name
+ pcrf_vnf_id:
+ get_input: pcrf_vnf_id
+ pcrf_cps_net_name:
+ get_input: pcrf_cps_net_name
+ pcrf_cps_net_mask:
+ get_input: pcrf_cps_net_mask
+ pcrf_pps_image_name:
+ get_input: pcrf_pps_image_name
+ pcrf_pps_flavor_name:
+ get_input: pcrf_pps_flavor_name
+ pcrf_pps_server_name:
+ get_input:
+ - pcrf_pps_server_names
+ - 4
+ pcrf_security_group_name:
+ get_input: pcrf_security_group_name
+ server_pcrf_pps_006:
+ type: org.openecomp.resource.abstract.nodes.heat.nested-pps_v1.0
+ directives:
+ - substitutable
+ properties:
+ pcrf_cps_net_ip:
+ get_input:
+ - pcrf_cps_net_ips
+ - 5
+ service_template_filter:
+ substitute_service_template: nested-pps_v1.0ServiceTemplate.yaml
+ availabilityzone_name:
+ get_input: availabilityzone_name
+ pcrf_vnf_id:
+ get_input: pcrf_vnf_id
+ pcrf_cps_net_name:
+ get_input: pcrf_cps_net_name
+ pcrf_cps_net_mask:
+ get_input: pcrf_cps_net_mask
+ pcrf_pps_image_name:
+ get_input: pcrf_pps_image_name
+ pcrf_pps_flavor_name:
+ get_input: pcrf_pps_flavor_name
+ pcrf_pps_server_name:
+ get_input:
+ - pcrf_pps_server_names
+ - 5
+ pcrf_security_group_name:
+ get_input: pcrf_security_group_name
+ server_pcrf_psm_010:
+ type: org.openecomp.resource.abstract.nodes.heat.nested-psm_v1.0
+ directives:
+ - substitutable
+ properties:
+ pcrf_cps_net_ip:
+ get_input:
+ - pcrf_cps_net_ips
+ - 9
+ service_template_filter:
+ substitute_service_template: nested-psm_v1.0ServiceTemplate.yaml
+ pcrf_psm_flavor_name:
+ get_input: pcrf_psm_flavor_name
+ pcrf_psm_image_name:
+ get_input: pcrf_psm_image_name
+ availabilityzone_name:
+ get_input: availabilityzone_name
+ pcrf_vnf_id:
+ get_input: pcrf_vnf_id
+ pcrf_cps_net_name:
+ get_input: pcrf_cps_net_name
+ pcrf_cps_net_mask:
+ get_input: pcrf_cps_net_mask
+ pcrf_psm_server_name:
+ get_input:
+ - pcrf_psm_server_names
+ - 9
+ pcrf_security_group_name:
+ get_input: pcrf_security_group_name
+ server_pcrf_psm_011:
+ type: org.openecomp.resource.abstract.nodes.heat.nested-psm_v1.0
+ directives:
+ - substitutable
+ properties:
+ pcrf_cps_net_ip:
+ get_input:
+ - pcrf_cps_net_ips
+ - 10
+ service_template_filter:
+ substitute_service_template: nested-psm_v1.0ServiceTemplate.yaml
+ pcrf_psm_flavor_name:
+ get_input: pcrf_psm_flavor_name
+ pcrf_psm_image_name:
+ get_input: pcrf_psm_image_name
+ availabilityzone_name:
+ get_input: availabilityzone_name
+ pcrf_vnf_id:
+ get_input: pcrf_vnf_id
+ pcrf_cps_net_name:
+ get_input: pcrf_cps_net_name
+ pcrf_cps_net_mask:
+ get_input: pcrf_cps_net_mask
+ pcrf_psm_server_name:
+ get_input:
+ - pcrf_psm_server_names
+ - 10
+ pcrf_security_group_name:
+ get_input: pcrf_security_group_name
+ groups:
+ hot-nimbus-ppd_v1.0:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/hot-nimbus-ppd_v1.0.yaml
+ description: heat template that creates PCRF Policy Director stack
+ members:
+ - server_pcrf_ppd_003
+ - server_pcrf_ppd_004
+ - server_pcrf_ppd_001
+ - server_pcrf_ppd_002
+ hot-nimbus-pcm_v1.0:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/hot-nimbus-pcm_v1.0.yaml
+ description: heat template that creates PCRF Cluman stack
+ members:
+ - server_pcrf_pcm_001
+ hot-nimbus-oam_v1.0:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/hot-nimbus-oam_v1.0.yaml
+ description: heat template that creates multiple PCRF OAM nodes stack
+ members:
+ - server_pcrf_oam_001
+ - server_pcrf_oam_002
+ hot-nimbus-oam-volumes_v1.0:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/hot-nimbus-oam-volumes_v1.0.yaml
+ members:
+ - pcrf_oam_volume_id_11
+ - pcrf_oam_volume_id_22
+ hot-nimbus-psm_v1.0:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/hot-nimbus-psm_v1.0.yaml
+ description: heat template that creates PCRF Session Manager stack
+ members:
+ - server_pcrf_psm_003
+ - server_pcrf_psm_004
+ - server_pcrf_psm_001
+ - server_pcrf_psm_012
+ - server_pcrf_psm_002
+ - server_pcrf_psm_007
+ - server_pcrf_psm_008
+ - server_pcrf_psm_005
+ - server_pcrf_psm_006
+ - server_pcrf_psm_009
+ - server_pcrf_psm_010
+ - server_pcrf_psm_011
+ hot-nimbus-pcm-volumes_v1.0:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/hot-nimbus-pcm-volumes_v1.0.yaml
+ members:
+ - pcrf_pcm_volume_id_1
+ hot-nimbus-pps_v1.0:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/hot-nimbus-pps_v1.0.yaml
+ description: heat template that creates PCRF Policy Server stack
+ members:
+ - server_pcrf_pps_001
+ - server_pcrf_pps_002
+ - server_pcrf_pps_003
+ - server_pcrf_pps_004
+ - server_pcrf_pps_005
+ - server_pcrf_pps_006
+ outputs:
+ pcrf_oam_volume_id_1:
+ description: the oam 001 volume id
+ value: pcrf_oam_volume_id_11
+ pcrf_oam_volume_id_2:
+ description: the oam 002 volume id
+ value: pcrf_oam_volume_id_22
+ pcrf_pcm_volume_id_1:
+ description: the pcrf_pcm_volume_id
+ value: pcrf_pcm_volume_id_1 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/nested-oam_v1.0ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/nested-oam_v1.0ServiceTemplate.yaml
new file mode 100644
index 0000000000..59b9cde00c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/nested-oam_v1.0ServiceTemplate.yaml
@@ -0,0 +1,225 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested-oam_v1.0
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.pcrf_oam_server:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ availabilityzone_name:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ pcrf_oam_flavor_name:
+ label: PCRF OAM flavor name
+ hidden: false
+ immutable: false
+ type: string
+ description: flavor name of PCRF OAM instance
+ pcrf_oam_server_name:
+ label: PCRF OAM server name
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF OAM server name
+ pcrf_cps_net_ip:
+ label: CPS network ip
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network ip
+ pcrf_vnf_id:
+ label: PCRF VNF Id
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF VNF Id
+ pcrf_oam_net_name:
+ label: OAM network name
+ hidden: false
+ immutable: false
+ type: string
+ description: OAM network name
+ pcrf_cps_net_name:
+ label: CPS network name
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network name
+ pcrf_arbiter_vip:
+ label: OAM Arbiter LB VIP
+ hidden: false
+ immutable: false
+ type: string
+ description: OAM Arbiter LB VIP
+ pcrf_oam_net_ip:
+ label: OAM network ip
+ hidden: false
+ immutable: false
+ type: string
+ description: OAM network ip
+ pcrf_oam_net_mask:
+ label: CPS network mask
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network mask
+ pcrf_cps_net_mask:
+ label: CPS network mask
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network mask
+ pcrf_oam_volume_id:
+ label: CPS OAM Cinder Volume
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS OAM Cinder Volume
+ pcrf_oam_net_gw:
+ label: CPS network gateway
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network gateway
+ pcrf_oam_image_name:
+ label: image name
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF OAM image name
+ pcrf_security_group_name:
+ label: security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of security group
+ node_templates:
+ pcrf_server_oam:
+ type: org.openecomp.resource.vfc.nodes.heat.pcrf_oam_server
+ properties:
+ flavor:
+ get_input: pcrf_oam_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcrf_oam_image_name
+ config_drive: 'True'
+ metadata:
+ vnf_id:
+ get_input: pcrf_vnf_id
+ user_data_format: RAW
+ name:
+ get_input: pcrf_oam_server_name
+ pcrf_oam_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: pcrf_security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: pcrf_oam_net_ip
+ network:
+ get_input: pcrf_oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: pcrf_server_oam
+ relationship: tosca.relationships.network.BindsTo
+ pcrf_oam_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: pcrf_security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: pcrf_cps_net_ip
+ allowed_address_pairs:
+ - ip_address:
+ get_input: pcrf_arbiter_vip
+ network:
+ get_input: pcrf_cps_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: pcrf_server_oam
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ nested-oam_v1.0:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested-oam_v1.0.yaml
+ description: nested heat template that creates a PCRF OAM node stack
+ members:
+ - pcrf_server_oam
+ - pcrf_oam_port_1
+ - pcrf_oam_port_0
+ outputs:
+ pcrf_oam_vol_attachment_id:
+ description: the pcrf_oam_vol_attachment_id id
+ value: pcrf_oam_vol_attachment
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested-oam_v1.0
+ capabilities:
+ endpoint_pcrf_server_oam:
+ - pcrf_server_oam
+ - endpoint
+ host_pcrf_server_oam:
+ - pcrf_server_oam
+ - host
+ binding_pcrf_server_oam:
+ - pcrf_server_oam
+ - binding
+ attachment_pcrf_oam_port_1:
+ - pcrf_oam_port_1
+ - attachment
+ attachment_pcrf_oam_port_0:
+ - pcrf_oam_port_0
+ - attachment
+ scalable_pcrf_server_oam:
+ - pcrf_server_oam
+ - scalable
+ os_pcrf_server_oam:
+ - pcrf_server_oam
+ - os
+ requirements:
+ local_storage_pcrf_server_oam:
+ - pcrf_server_oam
+ - local_storage
+ link_pcrf_oam_port_1:
+ - pcrf_oam_port_1
+ - link
+ link_pcrf_oam_port_0:
+ - pcrf_oam_port_0
+ - link \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/nested-pcm_v1.0ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/nested-pcm_v1.0ServiceTemplate.yaml
new file mode 100644
index 0000000000..86a37e4e55
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/nested-pcm_v1.0ServiceTemplate.yaml
@@ -0,0 +1,216 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested-pcm_v1.0
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.pcrf_pcm_server:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ pcrf_pcm_flavor_name:
+ label: PCRF CM flavor name
+ hidden: false
+ immutable: false
+ type: string
+ description: flavor name of PCRF CM instance
+ availabilityzone_name:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ pcrf_cps_net_ip:
+ label: CPS network ip
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network ip
+ pcrf_pcm_image_name:
+ label: image name
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF CM image name
+ pcrf_vnf_id:
+ label: PCRF VNF Id
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF VNF Id
+ pcrf_oam_net_name:
+ label: OAM network name
+ hidden: false
+ immutable: false
+ type: string
+ description: OAM network name
+ pcrf_cps_net_name:
+ label: CPS network name
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network name
+ pcrf_oam_net_ip:
+ label: OAM network ip
+ hidden: false
+ immutable: false
+ type: string
+ description: OAM network ip
+ pcrf_oam_net_mask:
+ label: CPS network mask
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network mask
+ pcrf_cps_net_mask:
+ label: CPS network mask
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network mask
+ pcrf_pcm_server_name:
+ label: PCRF CM server name
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF CM server name
+ pcrf_oam_net_gw:
+ label: CPS network gateway
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network gateway
+ pcrf_pcm_volume_id:
+ label: CPS Cluman Cinder Volume
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS Cluman Cinder Volume
+ pcrf_security_group_name:
+ label: security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of security group
+ node_templates:
+ pcrf_pcm_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: pcrf_security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: pcrf_cps_net_ip
+ network:
+ get_input: pcrf_cps_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: pcrf_server_pcm
+ relationship: tosca.relationships.network.BindsTo
+ pcrf_server_pcm:
+ type: org.openecomp.resource.vfc.nodes.heat.pcrf_pcm_server
+ properties:
+ flavor:
+ get_input: pcrf_pcm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcrf_pcm_image_name
+ config_drive: 'True'
+ metadata:
+ vnf_id:
+ get_input: pcrf_vnf_id
+ user_data_format: RAW
+ name:
+ get_input: pcrf_pcm_server_name
+ pcrf_pcm_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: pcrf_security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: pcrf_oam_net_ip
+ network:
+ get_input: pcrf_oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: pcrf_server_pcm
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ nested-pcm_v1.0:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested-pcm_v1.0.yaml
+ description: heat template that creates PCRF Cluman stack
+ members:
+ - pcrf_pcm_port_0
+ - pcrf_server_pcm
+ - pcrf_pcm_port_1
+ outputs:
+ pcrf_server_pcm_id:
+ description: the pcm server id
+ value: pcrf_server_pcm
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v1.0
+ capabilities:
+ endpoint_pcrf_server_pcm:
+ - pcrf_server_pcm
+ - endpoint
+ attachment_pcrf_pcm_port_0:
+ - pcrf_pcm_port_0
+ - attachment
+ binding_pcrf_server_pcm:
+ - pcrf_server_pcm
+ - binding
+ os_pcrf_server_pcm:
+ - pcrf_server_pcm
+ - os
+ host_pcrf_server_pcm:
+ - pcrf_server_pcm
+ - host
+ scalable_pcrf_server_pcm:
+ - pcrf_server_pcm
+ - scalable
+ attachment_pcrf_pcm_port_1:
+ - pcrf_pcm_port_1
+ - attachment
+ requirements:
+ local_storage_pcrf_server_pcm:
+ - pcrf_server_pcm
+ - local_storage
+ link_pcrf_pcm_port_0:
+ - pcrf_pcm_port_0
+ - link
+ link_pcrf_pcm_port_1:
+ - pcrf_pcm_port_1
+ - link \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/nested-ppd_v1.0ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/nested-ppd_v1.0ServiceTemplate.yaml
new file mode 100644
index 0000000000..976cbebf83
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/nested-ppd_v1.0ServiceTemplate.yaml
@@ -0,0 +1,464 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested-ppd_v1.0
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.pcrf_ppd_server:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ pcrf_ppd_image_name:
+ label: image name
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF PD image name
+ availabilityzone_name:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ pcrf_sp_net_ip:
+ label: Sp network ip
+ hidden: false
+ immutable: false
+ type: string
+ description: Sp network ip
+ pcrf_ppd_server_name:
+ label: PCRF PD server name
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF PD server name
+ pcrf_gx_net_ip:
+ label: Gx network ip
+ hidden: false
+ immutable: false
+ type: string
+ description: Gx network ip
+ pcrf_sy_net_name:
+ label: Sy network name
+ hidden: false
+ immutable: false
+ type: string
+ description: Sy network name
+ pcrf_sp_net_mask:
+ label: Sp network mask
+ hidden: false
+ immutable: false
+ type: string
+ description: Sp network mask
+ pcrf_sd_net_ip:
+ label: Sd network ip
+ hidden: false
+ immutable: false
+ type: string
+ description: Sd network ip
+ pcrf_vnf_id:
+ label: PCRF VNF Id
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF VNF Id
+ pcrf_oam_net_name:
+ label: OAM network name
+ hidden: false
+ immutable: false
+ type: string
+ description: OAM network name
+ pcrf_oam_net_ip:
+ label: OAM network ip
+ hidden: false
+ immutable: false
+ type: string
+ description: OAM network ip
+ pcrf_cps_net_mask:
+ label: CPS network mask
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network mask
+ pcrf_gx_net_mask:
+ label: Gx network mask
+ hidden: false
+ immutable: false
+ type: string
+ description: Gx network mask
+ pcrf_sgi_sy_net_name:
+ label: Sgi Sy network name
+ hidden: false
+ immutable: false
+ type: string
+ description: Sgi Sy network name
+ pcrf_sd_net_name:
+ label: Sd network name
+ hidden: false
+ immutable: false
+ type: string
+ description: Sd network name
+ pcrf_oam_net_gw:
+ label: CPS network gateway
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network gateway
+ pcrf_rx_net_name:
+ label: Rx network name
+ hidden: false
+ immutable: false
+ type: string
+ description: Rx network name
+ pcrf_rx_net_ip:
+ label: Rx network ip
+ hidden: false
+ immutable: false
+ type: string
+ description: Rx network ip
+ pcrf_sy_net_ip:
+ label: Sy network ip
+ hidden: false
+ immutable: false
+ type: string
+ description: Sy network ip
+ pcrf_sgi_sy_net_ip:
+ label: Sgi Sy network ip
+ hidden: false
+ immutable: false
+ type: string
+ description: Sgi Sy network ip
+ pcrf_ppd_flavor_name:
+ label: PCRF PD flavor name
+ hidden: false
+ immutable: false
+ type: string
+ description: flavor name of PCRF PD instance
+ pcrf_cps_net_ip:
+ label: CPS network ip
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network ip
+ pcrf_sy_net_mask:
+ label: Sy network mask
+ hidden: false
+ immutable: false
+ type: string
+ description: Sy network mask
+ pcrf_cps_net_name:
+ label: CPS network name
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network name
+ pcrf_oam_net_mask:
+ label: CPS network mask
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network mask
+ pcrf_lb_management_vip:
+ label: CPS OAM LB VIP
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS OAM LB VIP
+ pcrf_sgi_sy_net_mask:
+ label: Sgi Sy network mask
+ hidden: false
+ immutable: false
+ type: string
+ description: Sgi Sy network mask
+ pcrf_lb_internal_vip:
+ label: CPS Internal LB VIP
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS Internal LB VIP
+ pcrf_sd_net_mask:
+ label: Sd network mask
+ hidden: false
+ immutable: false
+ type: string
+ description: Sd network mask
+ pcrf_gx_net_name:
+ label: Gx network name
+ hidden: false
+ immutable: false
+ type: string
+ description: Gx network name
+ pcrf_sp_net_name:
+ label: Sp network name
+ hidden: false
+ immutable: false
+ type: string
+ description: Sp network name
+ pcrf_rx_net_mask:
+ label: Rx network mask
+ hidden: false
+ immutable: false
+ type: string
+ description: Rx network mask
+ pcrf_security_group_name:
+ label: security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of security group
+ node_templates:
+ pcrf_ppd_port_5:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: pcrf_security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: pcrf_rx_net_ip
+ network:
+ get_input: pcrf_rx_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: pcrf_server_ppd
+ relationship: tosca.relationships.network.BindsTo
+ pcrf_ppd_port_6:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: pcrf_security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: pcrf_sd_net_ip
+ network:
+ get_input: pcrf_sd_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: pcrf_server_ppd
+ relationship: tosca.relationships.network.BindsTo
+ pcrf_ppd_port_3:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: pcrf_security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: pcrf_sp_net_ip
+ network:
+ get_input: pcrf_sp_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: pcrf_server_ppd
+ relationship: tosca.relationships.network.BindsTo
+ pcrf_server_ppd:
+ type: org.openecomp.resource.vfc.nodes.heat.pcrf_ppd_server
+ properties:
+ flavor:
+ get_input: pcrf_ppd_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcrf_ppd_image_name
+ config_drive: 'True'
+ metadata:
+ vnf_id:
+ get_input: pcrf_vnf_id
+ user_data_format: RAW
+ name:
+ get_input: pcrf_ppd_server_name
+ pcrf_ppd_port_4:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: pcrf_security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: pcrf_sy_net_ip
+ network:
+ get_input: pcrf_sy_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: pcrf_server_ppd
+ relationship: tosca.relationships.network.BindsTo
+ pcrf_ppd_port_7:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: pcrf_security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: pcrf_sgi_sy_net_ip
+ network:
+ get_input: pcrf_sgi_sy_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: pcrf_server_ppd
+ relationship: tosca.relationships.network.BindsTo
+ pcrf_ppd_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: pcrf_security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: pcrf_oam_net_ip
+ allowed_address_pairs:
+ - ip_address:
+ get_input: pcrf_lb_management_vip
+ network:
+ get_input: pcrf_oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: pcrf_server_ppd
+ relationship: tosca.relationships.network.BindsTo
+ pcrf_ppd_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: pcrf_security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: pcrf_gx_net_ip
+ network:
+ get_input: pcrf_gx_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: pcrf_server_ppd
+ relationship: tosca.relationships.network.BindsTo
+ pcrf_ppd_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: pcrf_security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: pcrf_cps_net_ip
+ allowed_address_pairs:
+ - ip_address:
+ get_input: pcrf_lb_internal_vip
+ network:
+ get_input: pcrf_cps_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: pcrf_server_ppd
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ nested-ppd_v1.0:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested-ppd_v1.0.yaml
+ description: heat template that creates PCRF Policy Director stack
+ members:
+ - pcrf_ppd_port_5
+ - pcrf_ppd_port_6
+ - pcrf_ppd_port_3
+ - pcrf_server_ppd
+ - pcrf_ppd_port_4
+ - pcrf_ppd_port_7
+ - pcrf_ppd_port_1
+ - pcrf_ppd_port_2
+ - pcrf_ppd_port_0
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested-ppd_v1.0
+ capabilities:
+ attachment_pcrf_ppd_port_1:
+ - pcrf_ppd_port_1
+ - attachment
+ attachment_pcrf_ppd_port_2:
+ - pcrf_ppd_port_2
+ - attachment
+ binding_pcrf_server_ppd:
+ - pcrf_server_ppd
+ - binding
+ attachment_pcrf_ppd_port_0:
+ - pcrf_ppd_port_0
+ - attachment
+ attachment_pcrf_ppd_port_5:
+ - pcrf_ppd_port_5
+ - attachment
+ attachment_pcrf_ppd_port_6:
+ - pcrf_ppd_port_6
+ - attachment
+ attachment_pcrf_ppd_port_3:
+ - pcrf_ppd_port_3
+ - attachment
+ os_pcrf_server_ppd:
+ - pcrf_server_ppd
+ - os
+ attachment_pcrf_ppd_port_4:
+ - pcrf_ppd_port_4
+ - attachment
+ endpoint_pcrf_server_ppd:
+ - pcrf_server_ppd
+ - endpoint
+ scalable_pcrf_server_ppd:
+ - pcrf_server_ppd
+ - scalable
+ attachment_pcrf_ppd_port_7:
+ - pcrf_ppd_port_7
+ - attachment
+ host_pcrf_server_ppd:
+ - pcrf_server_ppd
+ - host
+ requirements:
+ link_pcrf_ppd_port_3:
+ - pcrf_ppd_port_3
+ - link
+ link_pcrf_ppd_port_2:
+ - pcrf_ppd_port_2
+ - link
+ local_storage_pcrf_server_ppd:
+ - pcrf_server_ppd
+ - local_storage
+ link_pcrf_ppd_port_1:
+ - pcrf_ppd_port_1
+ - link
+ link_pcrf_ppd_port_0:
+ - pcrf_ppd_port_0
+ - link
+ link_pcrf_ppd_port_7:
+ - pcrf_ppd_port_7
+ - link
+ link_pcrf_ppd_port_6:
+ - pcrf_ppd_port_6
+ - link
+ link_pcrf_ppd_port_5:
+ - pcrf_ppd_port_5
+ - link
+ link_pcrf_ppd_port_4:
+ - pcrf_ppd_port_4
+ - link \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/nested-pps_v1.0ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/nested-pps_v1.0ServiceTemplate.yaml
new file mode 100644
index 0000000000..692a2f0d4b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/nested-pps_v1.0ServiceTemplate.yaml
@@ -0,0 +1,160 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested-pps_v1.0
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.pcrf_pps_server:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ pcrf_cps_net_ip:
+ label: CPS network ip
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network ip
+ availabilityzone_name:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ pcrf_vnf_id:
+ label: PCRF VNF Id
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF VNF Id
+ pcrf_cps_net_name:
+ label: CPS network name
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network name
+ pcrf_cps_net_mask:
+ label: CPS network mask
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network mask
+ pcrf_pps_image_name:
+ label: PCRF PS image name
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ label: PCRF PS flavor name
+ hidden: false
+ immutable: false
+ type: string
+ description: flavor name of PCRF PS instance
+ pcrf_pps_server_name:
+ label: PCRF PS server name
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF PS server name
+ pcrf_security_group_name:
+ label: security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of security group
+ node_templates:
+ pcrf_pps_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: pcrf_security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: pcrf_cps_net_ip
+ network:
+ get_input: pcrf_cps_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: pcrf_server_pps
+ relationship: tosca.relationships.network.BindsTo
+ pcrf_server_pps:
+ type: org.openecomp.resource.vfc.nodes.heat.pcrf_pps_server
+ properties:
+ flavor:
+ get_input: pcrf_pps_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcrf_pps_image_name
+ config_drive: 'True'
+ metadata:
+ vnf_id:
+ get_input: pcrf_vnf_id
+ user_data_format: RAW
+ name:
+ get_input: pcrf_pps_server_name
+ groups:
+ nested-pps_v1.0:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested-pps_v1.0.yaml
+ description: heat template that creates PCRF Policy Server stack
+ members:
+ - pcrf_pps_port_0
+ - pcrf_server_pps
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested-pps_v1.0
+ capabilities:
+ binding_pcrf_server_pps:
+ - pcrf_server_pps
+ - binding
+ attachment_pcrf_pps_port_0:
+ - pcrf_pps_port_0
+ - attachment
+ scalable_pcrf_server_pps:
+ - pcrf_server_pps
+ - scalable
+ os_pcrf_server_pps:
+ - pcrf_server_pps
+ - os
+ endpoint_pcrf_server_pps:
+ - pcrf_server_pps
+ - endpoint
+ host_pcrf_server_pps:
+ - pcrf_server_pps
+ - host
+ requirements:
+ link_pcrf_pps_port_0:
+ - pcrf_pps_port_0
+ - link
+ local_storage_pcrf_server_pps:
+ - pcrf_server_pps
+ - local_storage \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/nested-psm_v1.0ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/nested-psm_v1.0ServiceTemplate.yaml
new file mode 100644
index 0000000000..770e1dceb8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/nested-psm_v1.0ServiceTemplate.yaml
@@ -0,0 +1,160 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested-psm_v1.0
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.pcrf_psm_server:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ pcrf_cps_net_ip:
+ label: CPS network ip
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network ip
+ pcrf_psm_flavor_name:
+ label: PCRF SM flavor name
+ hidden: false
+ immutable: false
+ type: string
+ description: flavor name of PCRF SM instance
+ pcrf_psm_image_name:
+ label: image name
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF SM image name
+ availabilityzone_name:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ pcrf_vnf_id:
+ label: PCRF VNF Id
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF VNF Id
+ pcrf_cps_net_name:
+ label: CPS network name
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network name
+ pcrf_cps_net_mask:
+ label: CPS network mask
+ hidden: false
+ immutable: false
+ type: string
+ description: CPS network mask
+ pcrf_psm_server_name:
+ label: PCRF SM server name
+ hidden: false
+ immutable: false
+ type: string
+ description: PCRF SM server name
+ pcrf_security_group_name:
+ label: security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of security group
+ node_templates:
+ pcrf_server_psm:
+ type: org.openecomp.resource.vfc.nodes.heat.pcrf_psm_server
+ properties:
+ flavor:
+ get_input: pcrf_psm_flavor_name
+ availability_zone:
+ get_input: availabilityzone_name
+ image:
+ get_input: pcrf_psm_image_name
+ config_drive: 'True'
+ metadata:
+ vnf_id:
+ get_input: pcrf_vnf_id
+ user_data_format: RAW
+ name:
+ get_input: pcrf_psm_server_name
+ psm01_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - get_input: pcrf_security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input: pcrf_cps_net_ip
+ network:
+ get_input: pcrf_cps_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: pcrf_server_psm
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ nested-psm_v1.0:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested-psm_v1.0.yaml
+ description: heat template that creates PCRF Session Manager stack
+ members:
+ - pcrf_server_psm
+ - psm01_port_0
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested-psm_v1.0
+ capabilities:
+ endpoint_pcrf_server_psm:
+ - pcrf_server_psm
+ - endpoint
+ binding_pcrf_server_psm:
+ - pcrf_server_psm
+ - binding
+ os_pcrf_server_psm:
+ - pcrf_server_psm
+ - os
+ attachment_psm01_port_0:
+ - psm01_port_0
+ - attachment
+ host_pcrf_server_psm:
+ - pcrf_server_psm
+ - host
+ scalable_pcrf_server_psm:
+ - pcrf_server_psm
+ - scalable
+ requirements:
+ local_storage_pcrf_server_psm:
+ - pcrf_server_psm
+ - local_storage
+ link_psm01_port_0:
+ - psm01_port_0
+ - link \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_port_translation/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_port_translation/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..8f3b23b959
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_port_translation/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,115 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ node_templates:
+ jsa_net:
+ type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
+ properties:
+ shared: true
+ network_name:
+ get_input: jsa_net_name
+ jsa_net1:
+ type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
+ properties:
+ shared: true
+ network_name:
+ get_input: jsa_net_name
+ cmaui1_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 1
+ network:
+ get_input: oam_net_name
+ cmaui1_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - subnet: subnetNameVal
+ ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 1
+ - subnet: subnetNameVal2
+ ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 1
+ network: jsa_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: jsa_net
+ relationship: tosca.relationships.network.LinksTo
+ cmaui1_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - subnet: subnetNameVal
+ ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 1
+ - subnet: subnetNameVal2
+ ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 1
+ network: jsa_net1
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: jsa_net1
+ relationship: tosca.relationships.network.LinksTo
+ groups:
+ hot_template:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/hot_template.yml
+ description: cmaui server template for vMMSC
+ members:
+ - jsa_net
+ - jsa_net1
+ - cmaui1_port_0
+ - cmaui1_port_1
+ - cmaui1_port_2 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_port_translation/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_port_translation/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..70cdc7d237
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_port_translation/inputfiles/MANIFEST.json
@@ -0,0 +1,11 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volumes",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot_template.yml",
+ "type": "HEAT"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_port_translation/inputfiles/hot_template.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_port_translation/inputfiles/hot_template.yml
new file mode 100644
index 0000000000..47ba8fcb2a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_port_translation/inputfiles/hot_template.yml
@@ -0,0 +1,49 @@
+heat_template_version: 2013-05-23
+
+#################################
+#
+# Changes from MSO 01/26/2016
+# Updated per ECOMP feedback
+#
+#################################
+
+description: cmaui server template for vMMSC
+
+resources:
+ cmaui1_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 1]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ cmaui1_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: jsa_net }
+ fixed_ips: [{"subnet": subnetNameVal, "ip_address": {get_param: [cmaui_oam_ips, 1]}}, {"subnet": subnetNameVal2, "ip_address": {get_param: [cmaui_oam_ips, 1]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ jsa_net:
+ type: OS::Neutron::Net
+ properties:
+ name: {get_param: jsa_net_name}
+ shared: True
+
+ cmaui1_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: jsa_net1 }
+ fixed_ips: [{"subnet": subnetNameVal, "ip_address": {get_param: [cmaui_oam_ips, 1]}}, {"subnet": subnetNameVal2, "ip_address": {get_param: [cmaui_oam_ips, 1]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ jsa_net1:
+ type: OS::Neutron::Net
+ properties:
+ name: {get_param: jsa_net_name}
+ shared: True
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_security_group_translation/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_security_group_translation/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..f6a55b2d14
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_security_group_translation/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,169 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.MASTER:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ MASTER_image_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: JSA MASTER instance image name
+ MASTER_names:
+ hidden: false
+ immutable: false
+ type: string
+ description: JSA MASTER instance name
+ security_group_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: security group name of JSA
+ MASTER_flavor_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: the flavor name of JSA MASTER instance
+ oam_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of OAM network
+ node_templates:
+ jsa_security_group:
+ type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules
+ properties:
+ name:
+ get_input: security_group_name
+ description: ems security group
+ rules:
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ - protocol: tcp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: egress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: egress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv6
+ remote_ip_prefix: ::/0
+ direction: egress
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ - protocol: tcp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv6
+ remote_ip_prefix: ::/0
+ direction: ingress
+ requirements:
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: MASTER_mgmt_port
+ relationship: org.openecomp.relationships.AttachesTo
+ MASTER_mgmt_port:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ security_groups:
+ - jsa_security_group
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: MASTER_instance
+ relationship: tosca.relationships.network.BindsTo
+ MASTER_instance:
+ type: org.openecomp.resource.vfc.nodes.heat.MASTER
+ properties:
+ flavor:
+ get_input: MASTER_flavor_name
+ image:
+ get_input: MASTER_image_name
+ name:
+ get_input: MASTER_names
+ groups:
+ hot_template:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/hot_template.yml
+ description: |
+ Version 2.0 02-11-2016 (Authors: John Doe, user PROD)
+ members:
+ - jsa_security_group
+ - MASTER_mgmt_port
+ - MASTER_instance \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_security_group_translation/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_security_group_translation/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..70cdc7d237
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_security_group_translation/inputfiles/MANIFEST.json
@@ -0,0 +1,11 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volumes",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot_template.yml",
+ "type": "HEAT"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_security_group_translation/inputfiles/hot_template.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_security_group_translation/inputfiles/hot_template.yml
new file mode 100644
index 0000000000..6c6f52a681
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_security_group_translation/inputfiles/hot_template.yml
@@ -0,0 +1,57 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-11-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ oam_net_name:
+ type: string
+ description: network name of OAM network
+ security_group_name:
+ type: string
+ description: security group name of JSA
+ MASTER_names:
+ type: string
+ description: JSA MASTER instance name
+ MASTER_image_name:
+ type: string
+ description: JSA MASTER instance image name
+ MASTER_flavor_name:
+ type: string
+ description: the flavor name of JSA MASTER instance
+
+resources:
+ jsa_security_group:
+ type: OS::Neutron::SecurityGroup
+ properties:
+ description: ems security group
+ name: {get_param: security_group_name}
+ rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"},
+ {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"},
+ {"direction": egress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"}
+ ]
+
+
+ MASTER_instance:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: MASTER_names}
+ image: {get_param: MASTER_image_name}
+ flavor: {get_param: MASTER_flavor_name}
+ networks:
+ - port: {get_resource: MASTER_mgmt_port}
+
+ MASTER_mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: oam_net_name}
+ security_groups: [{get_resource: jsa_security_group}]
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novaservergroups/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novaservergroups/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..94f731985b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novaservergroups/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,603 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.smp:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ hostid_fe1:
+ hidden: false
+ immutable: false
+ type: string
+ description: FE1 Hostid (from Ulticom license)
+ ip_address_stp2:
+ hidden: false
+ immutable: false
+ type: string
+ description: STP2 IP address
+ Mobility_OAM_protected_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Network name for OAM
+ hostid_fe2:
+ hidden: false
+ immutable: false
+ type: string
+ description: FE2 Hostid (from Ulticom license)
+ flavor_scp_fe_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: SCP FE Flavor
+ default: a1.Small
+ ip_address_stp1:
+ hidden: false
+ immutable: false
+ type: string
+ description: STP1 IP address
+ int_vscp_ce_network_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Inter-CE Network
+ int_vscp_ce_network_cidr:
+ hidden: false
+ immutable: false
+ type: string
+ description: Private Network Address (CIDR notation)
+ cluster_type:
+ hidden: false
+ immutable: false
+ type: string
+ constraints:
+ - valid_values:
+ - Test
+ - Prod
+ be_Mobility_OAM_protected_ip_1:
+ label: be_1 OAM ip address
+ hidden: false
+ immutable: false
+ type: string
+ description: be_1 OAM ip address
+ be_Mobility_OAM_protected_ip_2:
+ label: be_2 OAM ip address
+ hidden: false
+ immutable: false
+ type: string
+ description: be_2 OAM ip address
+ be_Mobility_OAM_protected_ip_0:
+ label: be_0 OAM ip address
+ hidden: false
+ immutable: false
+ type: string
+ description: be_0 OAM ip address
+ ip_address_dra:
+ hidden: false
+ immutable: false
+ type: string
+ description: DRA VIP address
+ image_smp_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: SCP SMP image
+ default: asc_base_image_smp
+ fe_connectivity:
+ hidden: false
+ immutable: false
+ type: string
+ constraints:
+ - valid_values:
+ - NEE
+ - STP
+ lab_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Lab name
+ smp_Mobility_OAM_protected_ip_1:
+ label: smp_1 OAM ip address
+ hidden: false
+ immutable: false
+ type: string
+ description: smp_1 OAM ip address
+ fe_SIGNET_vrf_B1_direct_ip_0:
+ label: fe1 SIGTRAN ip address
+ hidden: false
+ immutable: false
+ type: string
+ description: fe1 SIGTRAN ip address
+ smp_Mobility_OAM_protected_ip_0:
+ label: smp_0 OAM ip address
+ hidden: false
+ immutable: false
+ type: string
+ description: smp_0 OAM ip address
+ int_vscp_cluster_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: LAN3 Cluster
+ be_Mobility_OAM_protected_ip_3:
+ label: be_3 OAM ip address
+ hidden: false
+ immutable: false
+ type: string
+ description: be_3 OAM ip address
+ be_Mobility_OAM_protected_ip_4:
+ label: be_4 OAM ip address
+ hidden: false
+ immutable: false
+ type: string
+ description: be_4 OAM ip address
+ hostname_nee1:
+ hidden: false
+ immutable: false
+ type: string
+ description: NEE1 Hostname (from Ulticom license)
+ int_vscp_fe_cluster_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: LAN2 FE Cluster/KA
+ SIGNET_vrf_A1_direct_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Network name for SIGTRAN_A
+ key_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: keypair to enable SSH access to the instance.
+ default: vSCP-keypair
+ int_vscp_fe_cluster_cidr:
+ hidden: false
+ immutable: false
+ type: string
+ description: Private Network2 Address (CIDR notation)
+ fe_name_1:
+ hidden: false
+ immutable: false
+ type: string
+ description: name of VM
+ default: vSCP_FE2
+ fe_name_0:
+ hidden: false
+ immutable: false
+ type: string
+ description: name of VM
+ default: vSCP_FE1
+ be_name_0:
+ hidden: false
+ immutable: false
+ type: string
+ description: name of VM
+ default: vSCP_BE1
+ int_vscp_cluster_cidr:
+ hidden: false
+ immutable: false
+ type: string
+ description: Private Network3 Address (CIDR notation)
+ be_name_1:
+ hidden: false
+ immutable: false
+ type: string
+ description: name of VM
+ default: vSCP_BE2
+ be_name_2:
+ hidden: false
+ immutable: false
+ type: string
+ description: name of VM
+ default: vSCP_BE3
+ point_code_stp:
+ hidden: false
+ immutable: false
+ type: string
+ description: STP virtual point code (in "zone-cluster-member" format)
+ be_name_3:
+ hidden: false
+ immutable: false
+ type: string
+ description: name of VM
+ default: vSCP_BE4
+ be_name_4:
+ hidden: false
+ immutable: false
+ type: string
+ description: name of VM
+ default: vSCP_BE5
+ global_title_scp:
+ hidden: false
+ immutable: false
+ type: string
+ description: vSCP Global Title address
+ vnf_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique name for this VNF instance
+ default: This_is_the_SCP_name
+ be_Cricket_OCS_protected_ip_2:
+ label: be3 Cricket_OCS ip address
+ hidden: false
+ immutable: false
+ type: string
+ description: be3 Cricket_OCS ip address
+ fe_Mobility_OAM_protected_ip_0:
+ label: fe_0 OAM ip address
+ hidden: false
+ immutable: false
+ type: string
+ description: fe_0 OAM ip address
+ hostname_fe1:
+ hidden: false
+ immutable: false
+ type: string
+ description: FE1 Hostname (from Ulticom license)
+ be_Cricket_OCS_protected_ip_1:
+ label: be2 Cricket_OCS ip address
+ hidden: false
+ immutable: false
+ type: string
+ description: be2 Cricket_OCS ip address
+ hostname_fe2:
+ hidden: false
+ immutable: false
+ type: string
+ description: FE2 Hostname (from Ulticom license)
+ be_Cricket_OCS_protected_ip_4:
+ label: be5 Cricket_OCS ip address
+ hidden: false
+ immutable: false
+ type: string
+ description: be5 Cricket_OCS ip address
+ be_Cricket_OCS_protected_ip_3:
+ label: be4 Cricket_OCS ip address
+ hidden: false
+ immutable: false
+ type: string
+ description: be4 Cricket_OCS ip address
+ fe_Mobility_OAM_protected_ip_1:
+ label: fe_1 OAM ip address
+ hidden: false
+ immutable: false
+ type: string
+ description: fe_1 OAM ip address
+ be_Cricket_OCS_protected_ip_0:
+ label: be1 Cricket_OCS ip address
+ hidden: false
+ immutable: false
+ type: string
+ description: be1 Cricket_OCS ip address
+ route_table_fe1:
+ hidden: false
+ immutable: false
+ type: string
+ description: Additional route table for FE1
+ Cricket_OCS_protected_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Network name for CRICKET_OCS
+ smp_name_2:
+ hidden: false
+ immutable: false
+ type: string
+ description: name of VM
+ default: vSMP2
+ vnf_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_SCP_id
+ smp_name_1:
+ hidden: false
+ immutable: false
+ type: string
+ description: name of VM
+ default: vSMP2
+ flavor_smp_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: SCP SMP Flavor
+ default: a1.Small
+ image_scp_be_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: SCP BE image
+ default: asc_base_image_be
+ smp_name_0:
+ hidden: false
+ immutable: false
+ type: string
+ description: name of VM
+ default: vSMP1
+ route_table_fe2:
+ hidden: false
+ immutable: false
+ type: string
+ description: Additional route table for FE2
+ hostid_nee1:
+ hidden: false
+ immutable: false
+ type: string
+ description: NEE1 Hostid (from Ulticom license)
+ SIGNET_vrf_B1_direct_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Network name for SIGTRAN_B
+ fe_SIGNET_vrf_A1_direct_ip_0:
+ label: fe2 SIGTRAN ip address
+ hidden: false
+ immutable: false
+ type: string
+ description: fe2 SIGTRAN ip address
+ availability_zone_0:
+ hidden: false
+ immutable: false
+ type: string
+ nee_name_0:
+ hidden: false
+ immutable: false
+ type: string
+ description: name of VM
+ default: vNEE
+ ip_port_stp1:
+ hidden: false
+ immutable: false
+ type: string
+ description: STP1 IP port
+ ip_port_stp2:
+ hidden: false
+ immutable: false
+ type: string
+ description: STP2 IP port
+ image_scp_fe_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: SCP FE image
+ default: asc_base_image_fe
+ flavor_scp_be_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: SCP BE Flavor
+ default: a1.Small
+ security_group_name:
+ label: vSCP security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: vSCP security group name
+ ip_port_fe2:
+ hidden: false
+ immutable: false
+ type: string
+ description: FE2 IP port in SIGTRAN network
+ route_table_be:
+ hidden: false
+ immutable: false
+ type: string
+ description: Additional route table for BEs
+ ip_port_fe1:
+ hidden: false
+ immutable: false
+ type: string
+ description: FE1 IP port in SIGTRAN network
+ port_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: port name
+ default: port_name
+ point_code_scp:
+ hidden: false
+ immutable: false
+ type: string
+ description: vSCP point code (in "zone-cluster-member" format)
+ global_title_stp:
+ hidden: false
+ immutable: false
+ type: string
+ description: STP Global Title address
+ point_code_stp1:
+ hidden: false
+ immutable: false
+ type: string
+ description: STP1 point code (in "zone-cluster-member" format)
+ point_code_stp2:
+ hidden: false
+ immutable: false
+ type: string
+ description: STP2 point code (in "zone-cluster-member" format)
+ node_templates:
+ server_smp2:
+ type: org.openecomp.resource.vfc.nodes.heat.smp
+ properties:
+ flavor:
+ get_input: flavor_smp_name
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: image_smp_name
+ metadata:
+ jx_vm_role: smp2
+ vnf_id:
+ get_input: vnf_id
+ jx_lab_name:
+ get_input: lab_name
+ user_data_format: RAW
+ name:
+ get_input: smp_name_2
+ scheduler_hints:
+ group: FE_SMP_Affinity
+ server_smp3:
+ type: org.openecomp.resource.vfc.nodes.heat.smp
+ properties:
+ flavor:
+ get_input: flavor_smp_name
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: image_smp_name
+ metadata:
+ jx_vm_role: smp2
+ vnf_id:
+ get_input: vnf_id
+ jx_lab_name:
+ get_input: lab_name
+ user_data_format: RAW
+ name:
+ get_input: smp_name_2
+ scheduler_hints:
+ group2: Multi_Anti_Affinity
+ group1: FE_SMP_Affinity
+ port3:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ network:
+ get_input: port_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_smp3
+ relationship: tosca.relationships.network.BindsTo
+ port4:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ network:
+ get_input: port_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_smp3
+ relationship: tosca.relationships.network.BindsTo
+ port1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ network:
+ get_input: port_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_smp1
+ relationship: tosca.relationships.network.BindsTo
+ server_smp1:
+ type: org.openecomp.resource.vfc.nodes.heat.smp
+ properties:
+ flavor:
+ get_input: flavor_smp_name
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: image_smp_name
+ metadata:
+ jx_vm_role: smp2
+ vnf_id:
+ get_input: vnf_id
+ jx_lab_name:
+ get_input: lab_name
+ user_data_format: RAW
+ name:
+ get_input: smp_name_1
+ scheduler_hints:
+ group: BE_Affinity
+ port2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ network:
+ get_input: port_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_smp2
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ FE_SMP_Affinity:
+ type: tosca.groups.Root
+ members:
+ - server_smp2
+ - server_smp3
+ Multi_Anti_Affinity:
+ type: tosca.groups.Root
+ members:
+ - server_smp3
+ hot_template:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/hot_template.yml
+ description: ASC Template
+ members:
+ - server_smp2
+ - server_smp3
+ - port3
+ - port4
+ - port1
+ - server_smp1
+ - port2
+ BE_Affinity:
+ type: tosca.groups.Root
+ members:
+ - server_smp1
+ policies:
+ FE_SMP_Affinity:
+ type: org.openecomp.policies.placement.Colocate
+ properties:
+ name: abc
+ affinity: host
+ targets:
+ - FE_SMP_Affinity
+ Multi_Anti_Affinity:
+ type: org.openecomp.policies.placement.Antilocate
+ properties:
+ name: def
+ container_type: host
+ targets:
+ - Multi_Anti_Affinity
+ BE_Affinity:
+ type: org.openecomp.policies.placement.Colocate
+ properties:
+ name: def
+ affinity: host
+ targets:
+ - BE_Affinity \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novaservergroups/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novaservergroups/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..b2916ccf9c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novaservergroups/inputfiles/MANIFEST.json
@@ -0,0 +1,11 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot_template.yml",
+ "type": "HEAT"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novaservergroups/inputfiles/hot_template.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novaservergroups/inputfiles/hot_template.yml
new file mode 100644
index 0000000000..8dcbe20043
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novaservergroups/inputfiles/hot_template.yml
@@ -0,0 +1,383 @@
+heat_template_version: 2013-05-23
+
+description: ASC Template
+
+parameters:
+ cluster_type:
+ type: string
+ constraints:
+ - allowed_values: [ Test, Prod ]
+ fe_connectivity:
+ type: string
+ constraints:
+ - allowed_values: [ NEE, STP ]
+ key_name:
+ type: string
+ description: keypair to enable SSH access to the instance.
+ default: vSCP-keypair
+
+# Availability Zone information may need to be updated and the specifications under Nova server capabilities uncommented
+ availability_zone_0:
+ type: string
+
+ vnf_name:
+ type: string
+ description: Unique name for this VNF instance
+ default: This_is_the_SCP_name
+ vnf_id:
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_SCP_id
+
+ port_name:
+ type: string
+ description: port name
+ default: port_name
+
+ flavor_scp_be_name:
+ type: string
+ description: SCP BE Flavor
+ default: a1.Small
+ flavor_scp_fe_name:
+ type: string
+ description: SCP FE Flavor
+ default: a1.Small
+ flavor_smp_name:
+ type: string
+ description: SCP SMP Flavor
+ default: a1.Small
+ image_scp_be_name:
+ type: string
+ description: SCP BE image
+ default: asc_base_image_be
+ image_scp_fe_name:
+ type: string
+ description: SCP FE image
+ default: asc_base_image_fe
+ image_smp_name:
+ type: string
+ description: SCP SMP image
+ default: asc_base_image_smp
+ int_vscp_fe_cluster_net_id:
+ type: string
+ description: LAN2 FE Cluster/KA
+ int_vscp_fe_cluster_cidr:
+ type: string
+ description: Private Network2 Address (CIDR notation)
+ int_vscp_cluster_net_id:
+ type: string
+ description: LAN3 Cluster
+ int_vscp_cluster_cidr:
+ type: string
+ description: Private Network3 Address (CIDR notation)
+ int_vscp_ce_network_net_id:
+ type: string
+ description: Inter-CE Network
+ int_vscp_ce_network_cidr:
+ type: string
+ description: Private Network Address (CIDR notation)
+ SIGNET_vrf_A1_direct_net_id:
+ type: string
+ description: Network name for SIGTRAN_A
+ SIGNET_vrf_B1_direct_net_id:
+ type: string
+ description: Network name for SIGTRAN_B
+ Cricket_OCS_protected_net_id:
+ type: string
+ description: Network name for CRICKET_OCS
+ Mobility_OAM_protected_net_id:
+ type: string
+ description: Network name for OAM
+ be_Cricket_OCS_protected_ip_0:
+ type: string
+ label: be1 Cricket_OCS ip address
+ description: be1 Cricket_OCS ip address
+ be_Cricket_OCS_protected_ip_1:
+ type: string
+ label: be2 Cricket_OCS ip address
+ description: be2 Cricket_OCS ip address
+ be_Cricket_OCS_protected_ip_2:
+ type: string
+ label: be3 Cricket_OCS ip address
+ description: be3 Cricket_OCS ip address
+ be_Cricket_OCS_protected_ip_3:
+ type: string
+ label: be4 Cricket_OCS ip address
+ description: be4 Cricket_OCS ip address
+ be_Cricket_OCS_protected_ip_4:
+ type: string
+ label: be5 Cricket_OCS ip address
+ description: be5 Cricket_OCS ip address
+ fe_SIGNET_vrf_B1_direct_ip_0:
+ type: string
+ label: fe1 SIGTRAN ip address
+ description: fe1 SIGTRAN ip address
+ fe_SIGNET_vrf_A1_direct_ip_0:
+ type: string
+ label: fe2 SIGTRAN ip address
+ description: fe2 SIGTRAN ip address
+ be_Mobility_OAM_protected_ip_0:
+ type: string
+ label: be_0 OAM ip address
+ description: be_0 OAM ip address
+ be_Mobility_OAM_protected_ip_1:
+ type: string
+ label: be_1 OAM ip address
+ description: be_1 OAM ip address
+ be_Mobility_OAM_protected_ip_2:
+ type: string
+ label: be_2 OAM ip address
+ description: be_2 OAM ip address
+ be_Mobility_OAM_protected_ip_3:
+ type: string
+ label: be_3 OAM ip address
+ description: be_3 OAM ip address
+ be_Mobility_OAM_protected_ip_4:
+ type: string
+ label: be_4 OAM ip address
+ description: be_4 OAM ip address
+ fe_Mobility_OAM_protected_ip_0:
+ type: string
+ label: fe_0 OAM ip address
+ description: fe_0 OAM ip address
+ fe_Mobility_OAM_protected_ip_1:
+ type: string
+ label: fe_1 OAM ip address
+ description: fe_1 OAM ip address
+ smp_Mobility_OAM_protected_ip_0:
+ type: string
+ label: smp_0 OAM ip address
+ description: smp_0 OAM ip address
+ smp_Mobility_OAM_protected_ip_1:
+ type: string
+ label: smp_1 OAM ip address
+ description: smp_1 OAM ip address
+ be_name_0:
+ type: string
+ default: vSCP_BE1
+ description: name of VM
+ be_name_1:
+ type: string
+ default: vSCP_BE2
+ description: name of VM
+ be_name_2:
+ type: string
+ default: vSCP_BE3
+ description: name of VM
+ be_name_3:
+ type: string
+ default: vSCP_BE4
+ description: name of VM
+ be_name_4:
+ type: string
+ default: vSCP_BE5
+ description: name of VM
+ fe_name_0:
+ type: string
+ default: vSCP_FE1
+ description: name of VM
+ fe_name_1:
+ type: string
+ default: vSCP_FE2
+ description: name of VM
+ smp_name_0:
+ type: string
+ default: vSMP1
+ description: name of VM
+ smp_name_1:
+ type: string
+ default: vSMP2
+ description: name of VM
+ smp_name_2:
+ type: string
+ default: vSMP2
+ description: name of VM
+ ##smp_name_2:
+ ##type: string
+ ##default: vSMP2
+ ##description: name of VM
+ nee_name_0:
+ type: string
+ default: vNEE
+ description: name of VM
+
+ hostname_fe1:
+ type: string
+ description: FE1 Hostname (from Ulticom license)
+ hostid_fe1:
+ type: string
+ description: FE1 Hostid (from Ulticom license)
+
+ hostname_fe2:
+ type: string
+ description: FE2 Hostname (from Ulticom license)
+ hostid_fe2:
+ type: string
+ description: FE2 Hostid (from Ulticom license)
+
+ hostname_nee1:
+ type: string
+ description: NEE1 Hostname (from Ulticom license)
+ hostid_nee1:
+ type: string
+ description: NEE1 Hostid (from Ulticom license)
+
+ point_code_scp:
+ type: string
+ description: vSCP point code (in "zone-cluster-member" format)
+ point_code_stp:
+ type: string
+ description: STP virtual point code (in "zone-cluster-member" format)
+ point_code_stp1:
+ type: string
+ description: STP1 point code (in "zone-cluster-member" format)
+ point_code_stp2:
+ type: string
+ description: STP2 point code (in "zone-cluster-member" format)
+ ip_address_stp1:
+ type: string
+ description: STP1 IP address
+ ip_port_stp1:
+ type: string
+ description: STP1 IP port
+ ip_address_stp2:
+ type: string
+ description: STP2 IP address
+ ip_port_stp2:
+ type: string
+ description: STP2 IP port
+ ip_port_fe1:
+ type: string
+ description: FE1 IP port in SIGTRAN network
+ ip_port_fe2:
+ type: string
+ description: FE2 IP port in SIGTRAN network
+
+ global_title_scp:
+ type: string
+ description: vSCP Global Title address
+ global_title_stp:
+ type: string
+ description: STP Global Title address
+
+ security_group_name:
+ type: string
+ label: vSCP security group name
+ description: vSCP security group name
+
+ route_table_be:
+ type: string
+ description: Additional route table for BEs
+
+ route_table_fe1:
+ type: string
+ description: Additional route table for FE1
+
+ route_table_fe2:
+ type: string
+ description: Additional route table for FE2
+
+ ip_address_dra:
+ type: string
+ description: DRA VIP address
+
+ lab_name:
+ type: string
+ description: Lab name
+
+resources:
+
+ server_smp1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: smp_name_1 }
+ image: { get_param: image_smp_name }
+ # key_name: { get_param: key_name }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: flavor_smp_name }
+ scheduler_hints: { group: { get_resource: BE_Affinity } }
+ networks:
+ - port: { get_resource: port1 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ jx_lab_name: {get_param: lab_name}
+ jx_vm_role: smp2
+ user_data_format: RAW
+ server_smp2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: smp_name_2 }
+ image: { get_param: image_smp_name }
+ # key_name: { get_param: key_name }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: flavor_smp_name }
+ scheduler_hints: { group: { get_resource: FE_SMP_Affinity } }
+ networks:
+ - port: { get_resource: port2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ jx_lab_name: {get_param: lab_name}
+ jx_vm_role: smp2
+ user_data_format: RAW
+
+ server_smp3:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: smp_name_2 }
+ image: { get_param: image_smp_name }
+ # key_name: { get_param: key_name }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: flavor_smp_name }
+ scheduler_hints: { group1: { get_resource: FE_SMP_Affinity }, group2: { get_resource: Multi_Anti_Affinity } }
+ networks:
+ - port: { get_resource: port3 }
+ - port: { get_resource: port4 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ jx_lab_name: {get_param: lab_name}
+ jx_vm_role: smp2
+ user_data_format: RAW
+
+ port1:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: port_name}
+ replacement_policy: AUTO
+
+ port2:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: port_name}
+ replacement_policy: AUTO
+
+ port3:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: port_name}
+ replacement_policy: AUTO
+
+ port4:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: port_name}
+ replacement_policy: AUTO
+
+ FE_SMP_Affinity:
+ type: OS::Nova::ServerGroup
+ properties:
+ policies: ["affinity"]
+ name: abc
+ BE_Affinity:
+ type: OS::Nova::ServerGroup
+ properties:
+ policies: ["affinity"]
+ name: def
+ Multi_Anti_Affinity:
+ type: OS::Nova::ServerGroup
+ properties:
+ policies: ["anti-affinity"]
+ name: def
+
+
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..e77677efb7
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
@@ -0,0 +1,187 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: GlobalSubstitutionTypes
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.abstract.nodes.heat.nested:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ cmaui_names:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ cmaui_cinder_volume_size:
+ type: float
+ description: the size of the CMAUI Cinder volume
+ timezone:
+ type: string
+ description: timezone
+ security_group_name:
+ type: string
+ description: the name of security group
+ cmaui_volume:
+ type: string
+ description: Volume for CMAUI server
+ oam_network_netmask:
+ type: string
+ description: oam network gateway
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ vnf_id:
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-CMAUI_id
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ oam_network_gateway:
+ type: string
+ description: oam network gateway
+ availability_zone_0:
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ type: list
+ description: CMAUI oam_net IP addresses
+ entry_schema:
+ type: string
+ inner_cmaui_volume_a1:
+ type: string
+ description: the name of the target volume backend
+ inner_cmaui_volume_b2:
+ type: string
+ description: the name of the target volume backend
+ external_dns:
+ type: string
+ description: dns server
+ oam_net_name:
+ type: string
+ description: UID of OAM network
+ external_ntp:
+ type: string
+ description: ntp server
+ CMAUI_volume_type:
+ type: string
+ description: the name of the target volume backend
+ requirements:
+ - link_cmaui_port_2:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - local_storage_server_cmaui2:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - local_storage_server_cmaui1:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - link_cmaui_port_0:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ capabilities:
+ scalable_server_cmaui1:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_cmaui1:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_cmaui1:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_server_cmaui2:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_cmaui2:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_2:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_server_cmaui1:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_cmaui2:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_cmaui2:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_0:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_server_cmaui2:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_cmaui1:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..4507d8f8b2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,194 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ cmaui_cinder_volume_size:
+ label: CMAUI Cinder volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: the size of the CMAUI Cinder volume
+ timezone:
+ label: timezone
+ hidden: false
+ immutable: false
+ type: string
+ description: timezone
+ security_group_name:
+ label: security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of security group
+ oam_network_netmask:
+ label: oam network netmask
+ hidden: false
+ immutable: false
+ type: string
+ description: oam network gateway
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ vnf_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-CMAUI_id
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ oam_network_gateway:
+ label: oam network gateway
+ hidden: false
+ immutable: false
+ type: string
+ description: oam network gateway
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ inner_cmaui_volume_a2:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-CMAUI_id
+ inner_cmaui_volume_a1:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-CMAUI_id
+ cmaui_oam_ips:
+ label: CMAUI oam_net IP addresses
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI oam_net IP addresses
+ entry_schema:
+ type: string
+ external_dns:
+ label: dns server
+ hidden: false
+ immutable: false
+ type: string
+ description: dns server
+ oam_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ external_ntp:
+ label: ntp server
+ hidden: false
+ immutable: false
+ type: string
+ description: ntp server
+ CMAUI_volume_type:
+ label: CMAUI vm volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the target volume backend
+ node_templates:
+ stam_nested:
+ type: org.openecomp.resource.abstract.nodes.heat.nested
+ directives:
+ - substitutable
+ properties:
+ service_template_filter:
+ substitute_service_template: nestedServiceTemplate.yaml
+ inner_cmaui_volume_a1:
+ get_input: inner_cmaui_volume_a1
+ inner_cmaui_volume_b2:
+ get_input: inner_cmaui_volume_a2
+ requirements:
+ - local_storage_server_cmaui2:
+ capability: tosca.capabilities.Attachment
+ node: cmaui_volume2
+ relationship: tosca.relationships.AttachesTo
+ - local_storage_server_cmaui1:
+ capability: tosca.capabilities.Attachment
+ node: inner_cmaui_volume_a1
+ relationship: tosca.relationships.AttachesTo
+ - local_storage_server_cmaui1:
+ capability: tosca.capabilities.Attachment
+ node: cmaui_volume2
+ relationship: tosca.relationships.AttachesTo
+ inner_cmaui_volume_a1:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: CMAUI_volume_type
+ size: '(get_input : cmaui_cinder_volume_size) * 1024'
+ cmaui_volume2:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: CMAUI_volume_type
+ size: '(get_input : cmaui_cinder_volume_size) * 1024'
+ groups:
+ a_vol:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/a_vol.yml
+ description: volume
+ members:
+ - inner_cmaui_volume_a1
+ - cmaui_volume2
+ main:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/main.yml
+ description: cmaui server template for vMMSC
+ members:
+ - stam_nested
+ outputs:
+ inner_cmaui_volume_a2:
+ value: cmaui_volume2
+ inner_cmaui_volume_a1:
+ value: inner_cmaui_volume_a1 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/expectedoutputfiles/nestedServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/expectedoutputfiles/nestedServiceTemplate.yaml
new file mode 100644
index 0000000000..a9ec66bf29
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/expectedoutputfiles/nestedServiceTemplate.yaml
@@ -0,0 +1,279 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cmaui:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ cmaui_cinder_volume_size:
+ label: CMAUI Cinder volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: the size of the CMAUI Cinder volume
+ timezone:
+ label: timezone
+ hidden: false
+ immutable: false
+ type: string
+ description: timezone
+ security_group_name:
+ label: security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of security group
+ cmaui_volume:
+ label: CMAUI volume size
+ hidden: false
+ immutable: false
+ type: string
+ description: Volume for CMAUI server
+ oam_network_netmask:
+ label: oam network netmask
+ hidden: false
+ immutable: false
+ type: string
+ description: oam network gateway
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ vnf_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-CMAUI_id
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ oam_network_gateway:
+ label: oam network gateway
+ hidden: false
+ immutable: false
+ type: string
+ description: oam network gateway
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ label: CMAUI oam_net IP addresses
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI oam_net IP addresses
+ entry_schema:
+ type: string
+ inner_cmaui_volume_a1:
+ label: CMAUI vm volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the target volume backend
+ inner_cmaui_volume_b2:
+ label: CMAUI vm volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the target volume backend
+ external_dns:
+ label: dns server
+ hidden: false
+ immutable: false
+ type: string
+ description: dns server
+ oam_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ external_ntp:
+ label: ntp server
+ hidden: false
+ immutable: false
+ type: string
+ description: ntp server
+ CMAUI_volume_type:
+ label: CMAUI vm volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the target volume backend
+ node_templates:
+ cmaui_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui2
+ relationship: tosca.relationships.network.BindsTo
+ server_cmaui2:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ user_data_format: RAW
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ server_cmaui1:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ user_data_format: RAW
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ cmaui_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui1
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ nested:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested.yml
+ description: cmaui server template for vMMSC
+ members:
+ - cmaui_port_2
+ - server_cmaui2
+ - server_cmaui1
+ - cmaui_port_0
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested
+ capabilities:
+ scalable_server_cmaui1:
+ - server_cmaui1
+ - scalable
+ endpoint_server_cmaui1:
+ - server_cmaui1
+ - endpoint
+ os_server_cmaui1:
+ - server_cmaui1
+ - os
+ scalable_server_cmaui2:
+ - server_cmaui2
+ - scalable
+ endpoint_server_cmaui2:
+ - server_cmaui2
+ - endpoint
+ attachment_cmaui_port_2:
+ - cmaui_port_2
+ - attachment
+ host_server_cmaui1:
+ - server_cmaui1
+ - host
+ os_server_cmaui2:
+ - server_cmaui2
+ - os
+ binding_server_cmaui2:
+ - server_cmaui2
+ - binding
+ attachment_cmaui_port_0:
+ - cmaui_port_0
+ - attachment
+ host_server_cmaui2:
+ - server_cmaui2
+ - host
+ binding_server_cmaui1:
+ - server_cmaui1
+ - binding
+ requirements:
+ link_cmaui_port_0:
+ - cmaui_port_0
+ - link
+ link_cmaui_port_2:
+ - cmaui_port_2
+ - link
+ local_storage_server_cmaui2:
+ - server_cmaui2
+ - local_storage
+ local_storage_server_cmaui1:
+ - server_cmaui1
+ - local_storage \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..0aa103e5b8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/inputfiles/MANIFEST.json
@@ -0,0 +1,24 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "nested.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ },
+ {
+ "file": "main.yml",
+ "type": "HEAT",
+ "isBase": "false",
+ "data":[
+ {
+ "file": "a_vol.yml",
+ "type": "HEAT_VOL",
+ "isBase": "false"
+ }
+ ]
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/inputfiles/a_vol.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/inputfiles/a_vol.yml
new file mode 100644
index 0000000000..df5be20848
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/inputfiles/a_vol.yml
@@ -0,0 +1,32 @@
+heat_template_version: 2013-05-23
+
+description: volume
+
+parameters:
+ cmaui_cinder_volume_size:
+ type: number
+ label: CMAUI Cinder volume size
+ description: the size of the CMAUI Cinder volume
+ CMAUI_volume_type:
+ type: string
+ label: CMAUI vm volume type
+ description: the name of the target volume backend
+
+resources:
+ inner_cmaui_volume_a1:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: cmaui_cinder_volume_size}
+ volume_type: {get_param: CMAUI_volume_type}
+
+ cmaui_volume2:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: cmaui_cinder_volume_size}
+ volume_type: {get_param: CMAUI_volume_type}
+
+outputs:
+ inner_cmaui_volume_a1:
+ value: {get_resource: inner_cmaui_volume_a1}
+ inner_cmaui_volume_a2:
+ value: {get_resource: cmaui_volume2} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/inputfiles/main.yml
new file mode 100644
index 0000000000..7994b332df
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/inputfiles/main.yml
@@ -0,0 +1,77 @@
+heat_template_version: 2013-05-23
+
+description: cmaui server template for vMMSC
+
+parameters:
+ vnf_id:
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-CMAUI_id
+ inner_cmaui_volume_a1:
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-CMAUI_id
+ inner_cmaui_volume_a2:
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-CMAUI_id
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_cinder_volume_size:
+ type: number
+ label: CMAUI Cinder volume size
+ description: the size of the CMAUI Cinder volume
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ oam_net_name:
+ type: string
+ description: UID of OAM network
+ oam_network_netmask:
+ type: string
+ label: oam network netmask
+ description: oam network gateway
+ oam_network_gateway:
+ type: string
+ label: oam network gateway
+ description: oam network gateway
+ external_dns:
+ type: string
+ label: dns server
+ description: dns server
+ external_ntp:
+ type: string
+ label: ntp server
+ description: ntp server
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ timezone:
+ type: string
+ label: timezone
+ description: timezone
+ cmaui_oam_ips:
+ type: comma_delimited_list
+ label: CMAUI oam_net IP addresses
+ description: CMAUI oam_net IP addresses
+ CMAUI_volume_type:
+ type: string
+ label: CMAUI vm volume type
+ description: the name of the target volume backend
+
+resources:
+
+ stam_nested:
+ type: nested.yml
+ properties:
+ inner_cmaui_volume_a1: { get_param: inner_cmaui_volume_a1}
+ inner_cmaui_volume_b2: { get_param: inner_cmaui_volume_a2} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/inputfiles/nested.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/inputfiles/nested.yml
new file mode 100644
index 0000000000..078b228d29
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/inputfiles/nested.yml
@@ -0,0 +1,170 @@
+heat_template_version: 2013-05-23
+
+description: cmaui server template for vMMSC
+
+parameters:
+ vnf_id:
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-CMAUI_id
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_volume:
+ type: string
+ label: CMAUI volume size
+ description: Volume for CMAUI server
+ cmaui_cinder_volume_size:
+ type: number
+ label: CMAUI Cinder volume size
+ description: the size of the CMAUI Cinder volume
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ oam_net_name:
+ type: string
+ description: UID of OAM network
+ oam_network_netmask:
+ type: string
+ label: oam network netmask
+ description: oam network gateway
+ oam_network_gateway:
+ type: string
+ label: oam network gateway
+ description: oam network gateway
+ external_dns:
+ type: string
+ label: dns server
+ description: dns server
+ external_ntp:
+ type: string
+ label: ntp server
+ description: ntp server
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ timezone:
+ type: string
+ label: timezone
+ description: timezone
+ cmaui_oam_ips:
+ type: comma_delimited_list
+ label: CMAUI oam_net IP addresses
+ description: CMAUI oam_net IP addresses
+ CMAUI_volume_type:
+ type: string
+ label: CMAUI vm volume type
+ description: the name of the target volume backend
+ inner_cmaui_volume_a1:
+ type: string
+ label: CMAUI vm volume type
+ description: the name of the target volume backend
+ inner_cmaui_volume_b2:
+ type: string
+ label: CMAUI vm volume type
+ description: the name of the target volume backend
+
+resources:
+
+ cmaui_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+ cmaui_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ cmaui_volume_attachment1:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_param: inner_cmaui_volume_a1}
+ instance_uuid: {get_resource: server_cmaui1}
+
+ cmaui_volume_attachment2:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_param: inner_cmaui_volume_b2}
+ instance_uuid: {get_resource: server_cmaui1}
+
+ cmaui_volume_attachment3:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_param: inner_cmaui_volume_b2}
+ instance_uuid: {get_resource: server_cmaui2}
+
+ server_cmaui1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_0 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ cmaui.mgmt.ip=${cmaui.mgmt.ip}
+ cmaui.mgmt.netmask=${cmaui.mgmt.netmask}
+ cmaui.mgmt.gateway=${cmaui.mgmt.gateway}
+ cmaui.external.dns=${cmaui.external.dns}
+ cmaui.external.ntp=${cmaui.external.ntp}
+ cmaui.node=${cmaui.node}
+ cmaui.timezone=${cmaui.timezone}
+ params:
+ ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]}
+ ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${cmaui.external.dns}: {get_param: external_dns}
+ ${cmaui.external.ntp}: {get_param: external_ntp}
+ ${cmaui.node}: {get_param: [cmaui_names, 0]}
+ ${cmaui.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ server_cmaui2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ cmaui.mgmt.ip=${cmaui.mgmt.ip}
+ cmaui.mgmt.netmask=${cmaui.mgmt.netmask}
+ cmaui.mgmt.gateway=${cmaui.mgmt.gateway}
+ cmaui.external.dns=${cmaui.external.dns}
+ cmaui.external.ntp=${cmaui.external.ntp}
+ cmaui.node=${cmaui.node}
+ cmaui.timezone=${cmaui.timezone}
+ params:
+ ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]}
+ ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${cmaui.external.dns}: {get_param: external_dns}
+ ${cmaui.external.ntp}: {get_param: external_ntp}
+ ${cmaui.node}: {get_param: [cmaui_names, 0]}
+ ${cmaui.timezone}: {get_param: timezone}
+ user_data_format: RAW \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multiconnection/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multiconnection/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..dc3e231da4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multiconnection/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,276 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cmaui:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ cmaui_cinder_volume_size:
+ label: CMAUI Cinder volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: the size of the CMAUI Cinder volume
+ timezone:
+ label: timezone
+ hidden: false
+ immutable: false
+ type: string
+ description: timezone
+ security_group_name:
+ label: security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of security group
+ cmaui_volume:
+ label: CMAUI vm volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the target volume backend
+ oam_network_netmask:
+ label: oam network netmask
+ hidden: false
+ immutable: false
+ type: string
+ description: oam network gateway
+ cmaui_volume_param1:
+ hidden: false
+ immutable: false
+ type: string
+ description: nova server id
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ vnf_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-CMAUI_id
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ oam_network_gateway:
+ label: oam network gateway
+ hidden: false
+ immutable: false
+ type: string
+ description: oam network gateway
+ cmaui_volume_param2:
+ hidden: false
+ immutable: false
+ type: string
+ description: nova server id
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ label: CMAUI oam_net IP addresses
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI oam_net IP addresses
+ entry_schema:
+ type: string
+ external_dns:
+ label: dns server
+ hidden: false
+ immutable: false
+ type: string
+ description: dns server
+ oam_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ CMAUI_volume_type:
+ label: CMAUI vm volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the target volume backend
+ external_ntp:
+ label: ntp server
+ hidden: false
+ immutable: false
+ type: string
+ description: ntp server
+ node_templates:
+ cmaui_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui2
+ relationship: tosca.relationships.network.BindsTo
+ server_cmaui2:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ user_data_format: RAW
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: cmaui_volume2
+ relationship: cmaui_volume_attachment3
+ server_cmaui1:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ user_data_format: RAW
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: cmaui_volume1
+ relationship: cmaui_volume_attachment1
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: cmaui_volume2
+ relationship: cmaui_volume_attachment2
+ cmaui_volume1:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: CMAUI_volume_type
+ size: '(get_input : cmaui_cinder_volume_size) * 1024'
+ cmaui_volume2:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: CMAUI_volume_type
+ size: '(get_input : cmaui_cinder_volume_size) * 1024'
+ cmaui_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui1
+ relationship: tosca.relationships.network.BindsTo
+ relationship_templates:
+ cmaui_volume_attachment2:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id:
+ get_input: cmaui_volume_param2
+ instance_uuid: server_cmaui1
+ cmaui_volume_attachment3:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id:
+ get_input: cmaui_volume_param2
+ instance_uuid: server_cmaui2
+ cmaui_volume_attachment1:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id:
+ get_input: cmaui_volume_param1
+ instance_uuid: server_cmaui1
+ groups:
+ addOn:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/addOn.yml
+ description: cmaui server template for vMMSC
+ members:
+ - cmaui_port_2
+ - server_cmaui2
+ - server_cmaui1
+ - cmaui_port_1
+ main:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/main.yml
+ description: volume
+ members:
+ - cmaui_volume1
+ - cmaui_volume2 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multiconnection/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multiconnection/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..1f762d0ccc
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multiconnection/inputfiles/MANIFEST.json
@@ -0,0 +1,17 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "main.yml",
+ "type": "HEAT",
+ "isBase": "true"
+ },
+ {
+ "file": "addOn.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multiconnection/inputfiles/addOn.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multiconnection/inputfiles/addOn.yml
new file mode 100644
index 0000000000..1083268acf
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multiconnection/inputfiles/addOn.yml
@@ -0,0 +1,168 @@
+heat_template_version: 2013-05-23
+
+description: cmaui server template for vMMSC
+
+parameters:
+ cmaui_volume_param1:
+ type: string
+ description: nova server id
+ cmaui_volume_param2:
+ type: string
+ description: nova server id
+ vnf_id:
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-CMAUI_id
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_cinder_volume_size:
+ type: number
+ label: CMAUI Cinder volume size
+ description: the size of the CMAUI Cinder volume
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ oam_net_name:
+ type: string
+ description: UID of OAM network
+ oam_network_netmask:
+ type: string
+ label: oam network netmask
+ description: oam network gateway
+ oam_network_gateway:
+ type: string
+ label: oam network gateway
+ description: oam network gateway
+ external_dns:
+ type: string
+ label: dns server
+ description: dns server
+ external_ntp:
+ type: string
+ label: ntp server
+ description: ntp server
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ timezone:
+ type: string
+ label: timezone
+ description: timezone
+ cmaui_oam_ips:
+ type: comma_delimited_list
+ label: CMAUI oam_net IP addresses
+ description: CMAUI oam_net IP addresses
+ CMAUI_volume_type:
+ type: string
+ label: CMAUI vm volume type
+ description: the name of the target volume backend
+ cmaui_volume:
+ type: string
+ label: CMAUI vm volume type
+ description: the name of the target volume backend
+
+resources:
+
+ cmaui_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+ cmaui_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ cmaui_volume_attachment1:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_param: cmaui_volume_param1}
+ instance_uuid: {get_resource: server_cmaui1}
+
+ cmaui_volume_attachment2:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_param: cmaui_volume_param2}
+ instance_uuid: {get_resource: server_cmaui1}
+
+ cmaui_volume_attachment3:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_param: cmaui_volume_param2}
+ instance_uuid: {get_resource: server_cmaui2}
+
+ server_cmaui1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_1 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ cmaui.mgmt.ip=${cmaui.mgmt.ip}
+ cmaui.mgmt.netmask=${cmaui.mgmt.netmask}
+ cmaui.mgmt.gateway=${cmaui.mgmt.gateway}
+ cmaui.external.dns=${cmaui.external.dns}
+ cmaui.external.ntp=${cmaui.external.ntp}
+ cmaui.node=${cmaui.node}
+ cmaui.timezone=${cmaui.timezone}
+ params:
+ ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]}
+ ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${cmaui.external.dns}: {get_param: external_dns}
+ ${cmaui.external.ntp}: {get_param: external_ntp}
+ ${cmaui.node}: {get_param: [cmaui_names, 0]}
+ ${cmaui.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ server_cmaui2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ cmaui.mgmt.ip=${cmaui.mgmt.ip}
+ cmaui.mgmt.netmask=${cmaui.mgmt.netmask}
+ cmaui.mgmt.gateway=${cmaui.mgmt.gateway}
+ cmaui.external.dns=${cmaui.external.dns}
+ cmaui.external.ntp=${cmaui.external.ntp}
+ cmaui.node=${cmaui.node}
+ cmaui.timezone=${cmaui.timezone}
+ params:
+ ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]}
+ ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${cmaui.external.dns}: {get_param: external_dns}
+ ${cmaui.external.ntp}: {get_param: external_ntp}
+ ${cmaui.node}: {get_param: [cmaui_names, 0]}
+ ${cmaui.timezone}: {get_param: timezone}
+ user_data_format: RAW \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multiconnection/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multiconnection/inputfiles/main.yml
new file mode 100644
index 0000000000..89734ad14b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multiconnection/inputfiles/main.yml
@@ -0,0 +1,31 @@
+heat_template_version: 2013-05-23
+
+description: volume
+
+parameters:
+ cmaui_cinder_volume_size:
+ type: number
+ label: CMAUI Cinder volume size
+ description: the size of the CMAUI Cinder volume
+ CMAUI_volume_type:
+ type: string
+ label: CMAUI vm volume type
+ description: the name of the target volume backend
+
+resources:
+ cmaui_volume1:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: cmaui_cinder_volume_size}
+ volume_type: {get_param: CMAUI_volume_type}
+ cmaui_volume2:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: cmaui_cinder_volume_size}
+ volume_type: {get_param: CMAUI_volume_type}
+
+outputs:
+ cmaui_volume_param1:
+ value: {get_resource: cmaui_volume1}
+ cmaui_volume_param2:
+ value: {get_resource: cmaui_volume2} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multinotconnected/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multinotconnected/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..0d723c6e6f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multinotconnected/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,314 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cmaui:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ availability_zone_10:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ cmaui_cinder_volume_size:
+ label: CMAUI Cinder volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: the size of the CMAUI Cinder volume
+ timezone:
+ label: timezone
+ hidden: false
+ immutable: false
+ type: string
+ description: timezone
+ security_group_name:
+ label: security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of security group
+ cmaui_volume:
+ label: CMAUI vm volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the target volume backend
+ oam_network_netmask:
+ label: oam network netmask
+ hidden: false
+ immutable: false
+ type: string
+ description: oam network gateway
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ cmaui_volume_param1:
+ hidden: false
+ immutable: false
+ type: string
+ description: nova server id
+ vnf_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-CMAUI_id
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ oam_network_gateway:
+ label: oam network gateway
+ hidden: false
+ immutable: false
+ type: string
+ description: oam network gateway
+ cmaui_volume_param2:
+ hidden: false
+ immutable: false
+ type: string
+ description: nova server id
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ label: CMAUI oam_net IP addresses
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI oam_net IP addresses
+ entry_schema:
+ type: string
+ external_dns:
+ label: dns server
+ hidden: false
+ immutable: false
+ type: string
+ description: dns server
+ server_cmaui21:
+ hidden: false
+ immutable: false
+ type: string
+ description: nova server id
+ oam_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ CMAUI_volume_type:
+ label: CMAUI vm volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the target volume backend
+ external_ntp:
+ label: ntp server
+ hidden: false
+ immutable: false
+ type: string
+ description: ntp server
+ node_templates:
+ cmaui_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui2
+ relationship: tosca.relationships.network.BindsTo
+ cmaui_port_11:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui21
+ relationship: tosca.relationships.network.BindsTo
+ server_cmaui2:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ user_data_format: RAW
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: cmaui_volume2
+ relationship: cmaui_volume_attachment3
+ server_cmaui1:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ user_data_format: RAW
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: cmaui_volume2
+ relationship: cmaui_volume_attachment2
+ cmaui_volume1:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: CMAUI_volume_type
+ size: '(get_input : cmaui_cinder_volume_size) * 1024'
+ server_cmaui21:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_10
+ image:
+ get_input: cmaui_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ user_data_format: RAW
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ cmaui_volume2:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: CMAUI_volume_type
+ size: '(get_input : cmaui_cinder_volume_size) * 1024'
+ cmaui_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui1
+ relationship: tosca.relationships.network.BindsTo
+ relationship_templates:
+ cmaui_volume_attachment2:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id:
+ get_input: cmaui_volume_param2
+ instance_uuid: server_cmaui1
+ cmaui_volume_attachment3:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id:
+ get_input: cmaui_volume_param2
+ instance_uuid: server_cmaui2
+ groups:
+ addOn:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/addOn.yml
+ description: cmaui server template for vMMSC
+ members:
+ - cmaui_port_2
+ - server_cmaui2
+ - server_cmaui1
+ - cmaui_port_1
+ main:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/main.yml
+ description: volume
+ members:
+ - cmaui_port_11
+ - cmaui_volume1
+ - server_cmaui21
+ - cmaui_volume2 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multinotconnected/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multinotconnected/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..1f762d0ccc
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multinotconnected/inputfiles/MANIFEST.json
@@ -0,0 +1,17 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "main.yml",
+ "type": "HEAT",
+ "isBase": "true"
+ },
+ {
+ "file": "addOn.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multinotconnected/inputfiles/addOn.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multinotconnected/inputfiles/addOn.yml
new file mode 100644
index 0000000000..9716dc2f20
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multinotconnected/inputfiles/addOn.yml
@@ -0,0 +1,171 @@
+heat_template_version: 2013-05-23
+
+description: cmaui server template for vMMSC
+
+parameters:
+ cmaui_volume_param1:
+ type: string
+ description: nova server id
+ server_cmaui21:
+ type: string
+ description: nova server id
+ cmaui_volume_param2:
+ type: string
+ description: nova server id
+ vnf_id:
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-CMAUI_id
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_cinder_volume_size:
+ type: number
+ label: CMAUI Cinder volume size
+ description: the size of the CMAUI Cinder volume
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ oam_net_name:
+ type: string
+ description: UID of OAM network
+ oam_network_netmask:
+ type: string
+ label: oam network netmask
+ description: oam network gateway
+ oam_network_gateway:
+ type: string
+ label: oam network gateway
+ description: oam network gateway
+ external_dns:
+ type: string
+ label: dns server
+ description: dns server
+ external_ntp:
+ type: string
+ label: ntp server
+ description: ntp server
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ timezone:
+ type: string
+ label: timezone
+ description: timezone
+ cmaui_oam_ips:
+ type: comma_delimited_list
+ label: CMAUI oam_net IP addresses
+ description: CMAUI oam_net IP addresses
+ CMAUI_volume_type:
+ type: string
+ label: CMAUI vm volume type
+ description: the name of the target volume backend
+ cmaui_volume:
+ type: string
+ label: CMAUI vm volume type
+ description: the name of the target volume backend
+
+resources:
+
+ cmaui_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+ cmaui_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ cmaui_volume_attachment1:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_param: server_cmaui21}
+ instance_uuid: {get_resource: server_cmaui1}
+
+ cmaui_volume_attachment2:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_param: cmaui_volume_param2}
+ instance_uuid: {get_resource: server_cmaui1}
+
+ cmaui_volume_attachment3:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_param: cmaui_volume_param2}
+ instance_uuid: {get_resource: server_cmaui2}
+
+ server_cmaui1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_1 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ cmaui.mgmt.ip=${cmaui.mgmt.ip}
+ cmaui.mgmt.netmask=${cmaui.mgmt.netmask}
+ cmaui.mgmt.gateway=${cmaui.mgmt.gateway}
+ cmaui.external.dns=${cmaui.external.dns}
+ cmaui.external.ntp=${cmaui.external.ntp}
+ cmaui.node=${cmaui.node}
+ cmaui.timezone=${cmaui.timezone}
+ params:
+ ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]}
+ ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${cmaui.external.dns}: {get_param: external_dns}
+ ${cmaui.external.ntp}: {get_param: external_ntp}
+ ${cmaui.node}: {get_param: [cmaui_names, 0]}
+ ${cmaui.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ server_cmaui2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ cmaui.mgmt.ip=${cmaui.mgmt.ip}
+ cmaui.mgmt.netmask=${cmaui.mgmt.netmask}
+ cmaui.mgmt.gateway=${cmaui.mgmt.gateway}
+ cmaui.external.dns=${cmaui.external.dns}
+ cmaui.external.ntp=${cmaui.external.ntp}
+ cmaui.node=${cmaui.node}
+ cmaui.timezone=${cmaui.timezone}
+ params:
+ ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]}
+ ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${cmaui.external.dns}: {get_param: external_dns}
+ ${cmaui.external.ntp}: {get_param: external_ntp}
+ ${cmaui.node}: {get_param: [cmaui_names, 0]}
+ ${cmaui.timezone}: {get_param: timezone}
+ user_data_format: RAW \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multinotconnected/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multinotconnected/inputfiles/main.yml
new file mode 100644
index 0000000000..d81d9d8aed
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multinotconnected/inputfiles/main.yml
@@ -0,0 +1,128 @@
+heat_template_version: 2013-05-23
+
+description: volume
+
+parameters:
+ availability_zone_10:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cmaui_cinder_volume_size:
+ type: number
+ label: CMAUI Cinder volume size
+ description: the size of the CMAUI Cinder volume
+ CMAUI_volume_type:
+ type: string
+ label: CMAUI vm volume type
+ description: the name of the target volume backend
+ vnf_id:
+ type: string
+ label: CMAUI vm volume type
+ description: the name of the target volume backend
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ oam_net_name:
+ type: string
+ description: UID of OAM network
+ oam_network_netmask:
+ type: string
+ label: oam network netmask
+ description: oam network gateway
+ oam_network_gateway:
+ type: string
+ label: oam network gateway
+ description: oam network gateway
+ external_dns:
+ type: string
+ label: dns server
+ description: dns server
+ external_ntp:
+ type: string
+ label: ntp server
+ description: ntp server
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ timezone:
+ type: string
+ label: timezone
+ description: timezone
+ cmaui_oam_ips:
+ type: comma_delimited_list
+ label: CMAUI oam_net IP addresses
+ description: CMAUI oam_net IP addresses
+ cmaui_volume:
+ type: string
+ label: CMAUI vm volume type
+ description: the name of the target volume backend
+
+resources:
+ cmaui_volume1:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: cmaui_cinder_volume_size}
+ volume_type: {get_param: CMAUI_volume_type}
+ cmaui_volume2:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: cmaui_cinder_volume_size}
+ volume_type: {get_param: CMAUI_volume_type}
+
+ server_cmaui21:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_10 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_11 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ cmaui.mgmt.ip=${cmaui.mgmt.ip}
+ cmaui.mgmt.netmask=${cmaui.mgmt.netmask}
+ cmaui.mgmt.gateway=${cmaui.mgmt.gateway}
+ cmaui.external.dns=${cmaui.external.dns}
+ cmaui.external.ntp=${cmaui.external.ntp}
+ cmaui.node=${cmaui.node}
+ cmaui.timezone=${cmaui.timezone}
+ params:
+ ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]}
+ ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${cmaui.external.dns}: {get_param: external_dns}
+ ${cmaui.external.ntp}: {get_param: external_ntp}
+ ${cmaui.node}: {get_param: [cmaui_names, 0]}
+ ${cmaui.timezone}: {get_param: timezone}
+ user_data_format: RAW
+
+ cmaui_port_11:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+outputs:
+ cmaui_volume_param1:
+ value: {get_resource: cmaui_volume1}
+ cmaui_volume_param2:
+ value: {get_resource: cmaui_volume2}
+ cmaui_volume_param3:
+ value: {get_resource: server_cmaui21} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..889961bd45
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
@@ -0,0 +1,109 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: GlobalSubstitutionTypes
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.abstract.nodes.heat.nested:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ cmaui_names:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p1:
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_volume_param:
+ type: string
+ description: nova server id
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ security_group_name:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ availability_zone_0:
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ type: string
+ requirements:
+ - local_storage_server_cmaui:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - link_cmaui_port_0:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ capabilities:
+ host_server_cmaui:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_cmaui:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_cmaui:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_cmaui:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_server_cmaui:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_0:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..2b09784a72
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,76 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ cmaui_cinder_volume_size:
+ label: CMAUI Cinder volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: the size of the CMAUI Cinder volume
+ CMAUI_volume_type:
+ label: CMAUI vm volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the target volume backend
+ node_templates:
+ test_vol:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: CMAUI_volume_type
+ size: '(get_input : cmaui_cinder_volume_size) * 1024'
+ test_nested:
+ type: org.openecomp.resource.abstract.nodes.heat.nested
+ directives:
+ - substitutable
+ properties:
+ service_template_filter:
+ substitute_service_template: nestedServiceTemplate.yaml
+ cmaui_volume_param: test_vol
+ requirements:
+ - local_storage_server_cmaui:
+ capability: tosca.capabilities.Attachment
+ node: test_vol
+ relationship: tosca.relationships.AttachesTo
+ groups:
+ main:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/main.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - test_vol
+ - test_nested \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/expectedoutputfiles/nestedServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/expectedoutputfiles/nestedServiceTemplate.yaml
new file mode 100644
index 0000000000..485e7031b4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/expectedoutputfiles/nestedServiceTemplate.yaml
@@ -0,0 +1,150 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cmaui:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p1:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ cmaui_volume_param:
+ hidden: false
+ immutable: false
+ type: string
+ description: nova server id
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ hidden: false
+ immutable: false
+ type: string
+ node_templates:
+ server_cmaui:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ cmaui_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: p1
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ nested:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested.yml
+ description: cmaui server template for vMMSC
+ members:
+ - server_cmaui
+ - cmaui_port_0
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested
+ capabilities:
+ host_server_cmaui:
+ - server_cmaui
+ - host
+ os_server_cmaui:
+ - server_cmaui
+ - os
+ endpoint_server_cmaui:
+ - server_cmaui
+ - endpoint
+ binding_server_cmaui:
+ - server_cmaui
+ - binding
+ scalable_server_cmaui:
+ - server_cmaui
+ - scalable
+ attachment_cmaui_port_0:
+ - cmaui_port_0
+ - attachment
+ requirements:
+ local_storage_server_cmaui:
+ - server_cmaui
+ - local_storage
+ link_cmaui_port_0:
+ - cmaui_port_0
+ - link \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..aca75b5055
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/inputfiles/MANIFEST.json
@@ -0,0 +1,17 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "main.yml",
+ "type": "HEAT",
+ "isBase": "true"
+ },
+ {
+ "file": "nested.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/inputfiles/main.yml
new file mode 100644
index 0000000000..b016f53d5b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/inputfiles/main.yml
@@ -0,0 +1,26 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ cmaui_cinder_volume_size:
+ type: number
+ label: CMAUI Cinder volume size
+ description: the size of the CMAUI Cinder volume
+ CMAUI_volume_type:
+ type: string
+ label: CMAUI vm volume type
+ description: the name of the target volume backend
+
+resources:
+ test_vol:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: cmaui_cinder_volume_size}
+ volume_type: {get_param: CMAUI_volume_type}
+
+ test_nested:
+ type: nested.yml
+ properties:
+ cmaui_volume_param: { get_resource: test_vol}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/inputfiles/nested.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/inputfiles/nested.yml
new file mode 100644
index 0000000000..922c4d1613
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/inputfiles/nested.yml
@@ -0,0 +1,55 @@
+heat_template_version: 2013-05-23
+
+description: cmaui server template for vMMSC
+
+parameters:
+ cmaui_volume_param:
+ type: string
+ description: nova server id
+ p1:
+ type: string
+ description: UID of OAM network
+ security_group_name:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_oam_ips:
+ type: string
+
+resources:
+
+ cmaui_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: p1 }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_cmaui:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_0 }
+
+ cmaui_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_param: cmaui_volume_param}
+ instance_uuid: {get_resource: server_cmaui} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..889961bd45
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
@@ -0,0 +1,109 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: GlobalSubstitutionTypes
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.abstract.nodes.heat.nested:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ cmaui_names:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p1:
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_volume_param:
+ type: string
+ description: nova server id
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ security_group_name:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ availability_zone_0:
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ type: string
+ requirements:
+ - local_storage_server_cmaui:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - link_cmaui_port_0:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ capabilities:
+ host_server_cmaui:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_cmaui:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_cmaui:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_cmaui:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_server_cmaui:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_0:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..9722ae1b16
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,146 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cmaui:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p1:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_cinder_volume_size:
+ label: CMAUI Cinder volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: the size of the CMAUI Cinder volume
+ security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ hidden: false
+ immutable: false
+ type: string
+ CMAUI_volume_type:
+ label: CMAUI vm volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the target volume backend
+ node_templates:
+ server_cmaui1:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ test_vol:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: CMAUI_volume_type
+ size: '(get_input : cmaui_cinder_volume_size) * 1024'
+ cmaui_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: p1
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui1
+ relationship: tosca.relationships.network.BindsTo
+ test_nested:
+ type: org.openecomp.resource.abstract.nodes.heat.nested
+ directives:
+ - substitutable
+ properties:
+ service_template_filter:
+ substitute_service_template: nestedServiceTemplate.yaml
+ cmaui_volume_param: server_cmaui1
+ groups:
+ main:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/main.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - server_cmaui1
+ - test_vol
+ - cmaui_port_1
+ - test_nested \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/expectedoutputfiles/nestedServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/expectedoutputfiles/nestedServiceTemplate.yaml
new file mode 100644
index 0000000000..485e7031b4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/expectedoutputfiles/nestedServiceTemplate.yaml
@@ -0,0 +1,150 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cmaui:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p1:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ cmaui_volume_param:
+ hidden: false
+ immutable: false
+ type: string
+ description: nova server id
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ hidden: false
+ immutable: false
+ type: string
+ node_templates:
+ server_cmaui:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ cmaui_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: p1
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ nested:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested.yml
+ description: cmaui server template for vMMSC
+ members:
+ - server_cmaui
+ - cmaui_port_0
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested
+ capabilities:
+ host_server_cmaui:
+ - server_cmaui
+ - host
+ os_server_cmaui:
+ - server_cmaui
+ - os
+ endpoint_server_cmaui:
+ - server_cmaui
+ - endpoint
+ binding_server_cmaui:
+ - server_cmaui
+ - binding
+ scalable_server_cmaui:
+ - server_cmaui
+ - scalable
+ attachment_cmaui_port_0:
+ - cmaui_port_0
+ - attachment
+ requirements:
+ local_storage_server_cmaui:
+ - server_cmaui
+ - local_storage
+ link_cmaui_port_0:
+ - cmaui_port_0
+ - link \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..aca75b5055
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/inputfiles/MANIFEST.json
@@ -0,0 +1,17 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "main.yml",
+ "type": "HEAT",
+ "isBase": "true"
+ },
+ {
+ "file": "nested.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/inputfiles/main.yml
new file mode 100644
index 0000000000..46c2d64d8e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/inputfiles/main.yml
@@ -0,0 +1,64 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ cmaui_cinder_volume_size:
+ type: number
+ label: CMAUI Cinder volume size
+ description: the size of the CMAUI Cinder volume
+ CMAUI_volume_type:
+ type: string
+ label: CMAUI vm volume type
+ description: the name of the target volume backend
+ security_group_name:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_oam_ips:
+ type: string
+ p1:
+ type: string
+ description: UID of OAM network
+
+resources:
+ test_vol:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: cmaui_cinder_volume_size}
+ volume_type: {get_param: CMAUI_volume_type}
+ cmaui_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: p1 }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_cmaui1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_1 }
+
+ test_nested:
+ type: nested.yml
+ properties:
+ cmaui_volume_param: { get_resource: server_cmaui1}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/inputfiles/nested.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/inputfiles/nested.yml
new file mode 100644
index 0000000000..922c4d1613
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/inputfiles/nested.yml
@@ -0,0 +1,55 @@
+heat_template_version: 2013-05-23
+
+description: cmaui server template for vMMSC
+
+parameters:
+ cmaui_volume_param:
+ type: string
+ description: nova server id
+ p1:
+ type: string
+ description: UID of OAM network
+ security_group_name:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_oam_ips:
+ type: string
+
+resources:
+
+ cmaui_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: p1 }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_cmaui:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_0 }
+
+ cmaui_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_param: cmaui_volume_param}
+ instance_uuid: {get_resource: server_cmaui} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..fd5eae6858
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
@@ -0,0 +1,158 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: GlobalSubstitutionTypes
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.abstract.nodes.heat.nested:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ cmaui_names:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p1:
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_volume_param2:
+ type: string
+ description: nova server id
+ security_group_name:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ availability_zone_0:
+ type: string
+ description: availabilityzone name
+ shared_vol1:
+ type: string
+ description: nova server id
+ cmaui_oam_ips:
+ type: string
+ requirements:
+ - link_cmaui_port_2:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - local_storage_server_cmaui2:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - local_storage_server_cmaui1:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - link_cmaui_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ capabilities:
+ scalable_server_cmaui1:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_cmaui1:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_cmaui1:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_server_cmaui2:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_cmaui2:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_2:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_server_cmaui1:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_cmaui2:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_cmaui2:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_server_cmaui2:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_cmaui1:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_1:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..383ef54a4e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,114 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ cmaui_cinder_volume_size:
+ label: CMAUI Cinder volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: the size of the CMAUI Cinder volume
+ shared_vol1:
+ hidden: false
+ immutable: false
+ type: string
+ description: volume name
+ shared_vol2:
+ hidden: false
+ immutable: false
+ type: string
+ description: volume name
+ CMAUI_volume_type:
+ label: CMAUI vm volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the target volume backend
+ node_templates:
+ test_vol1:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: CMAUI_volume_type
+ size: '(get_input : cmaui_cinder_volume_size) * 1024'
+ test_vol2:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: CMAUI_volume_type
+ size: '(get_input : cmaui_cinder_volume_size) * 1024'
+ test_nested:
+ type: org.openecomp.resource.abstract.nodes.heat.nested
+ directives:
+ - substitutable
+ properties:
+ service_template_filter:
+ substitute_service_template: nestedServiceTemplate.yaml
+ cmaui_volume_param2:
+ get_input: shared_vol2
+ shared_vol1:
+ get_input: shared_vol1
+ requirements:
+ - local_storage_server_cmaui2:
+ capability: tosca.capabilities.Attachment
+ node: test_vol1
+ relationship: tosca.relationships.AttachesTo
+ - local_storage_server_cmaui1:
+ capability: tosca.capabilities.Attachment
+ node: test_vol1
+ relationship: tosca.relationships.AttachesTo
+ - local_storage_server_cmaui1:
+ capability: tosca.capabilities.Attachment
+ node: test_vol2
+ relationship: tosca.relationships.AttachesTo
+ groups:
+ addOn:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/addOn.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - test_nested
+ main:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/main.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - test_vol1
+ - test_vol2
+ outputs:
+ out1_not_shared:
+ value: test_nested \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/expectedoutputfiles/nestedServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/expectedoutputfiles/nestedServiceTemplate.yaml
new file mode 100644
index 0000000000..68a602e14a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/expectedoutputfiles/nestedServiceTemplate.yaml
@@ -0,0 +1,212 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cmaui:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p1:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_volume_param2:
+ hidden: false
+ immutable: false
+ type: string
+ description: nova server id
+ security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ shared_vol1:
+ hidden: false
+ immutable: false
+ type: string
+ description: nova server id
+ cmaui_oam_ips:
+ hidden: false
+ immutable: false
+ type: string
+ node_templates:
+ cmaui_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: p1
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui2
+ relationship: tosca.relationships.network.BindsTo
+ server_cmaui2:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ server_cmaui1:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ cmaui_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: p1
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui1
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ nested:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested.yml
+ description: cmaui server template for vMMSC
+ members:
+ - cmaui_port_2
+ - server_cmaui2
+ - server_cmaui1
+ - cmaui_port_1
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested
+ capabilities:
+ scalable_server_cmaui1:
+ - server_cmaui1
+ - scalable
+ endpoint_server_cmaui1:
+ - server_cmaui1
+ - endpoint
+ os_server_cmaui1:
+ - server_cmaui1
+ - os
+ scalable_server_cmaui2:
+ - server_cmaui2
+ - scalable
+ endpoint_server_cmaui2:
+ - server_cmaui2
+ - endpoint
+ attachment_cmaui_port_2:
+ - cmaui_port_2
+ - attachment
+ host_server_cmaui1:
+ - server_cmaui1
+ - host
+ os_server_cmaui2:
+ - server_cmaui2
+ - os
+ binding_server_cmaui2:
+ - server_cmaui2
+ - binding
+ host_server_cmaui2:
+ - server_cmaui2
+ - host
+ binding_server_cmaui1:
+ - server_cmaui1
+ - binding
+ attachment_cmaui_port_1:
+ - cmaui_port_1
+ - attachment
+ requirements:
+ link_cmaui_port_2:
+ - cmaui_port_2
+ - link
+ link_cmaui_port_1:
+ - cmaui_port_1
+ - link
+ local_storage_server_cmaui2:
+ - server_cmaui2
+ - local_storage
+ local_storage_server_cmaui1:
+ - server_cmaui1
+ - local_storage \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..8ba5fc48f4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/inputfiles/MANIFEST.json
@@ -0,0 +1,22 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "main.yml",
+ "type": "HEAT",
+ "isBase": "true"
+ },
+ {
+ "file": "nested.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ },
+ {
+ "file": "addOn.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/inputfiles/addOn.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/inputfiles/addOn.yml
new file mode 100644
index 0000000000..20fb8c92d8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/inputfiles/addOn.yml
@@ -0,0 +1,30 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ shared_vol1:
+ type: string
+ description: volume name
+ shared_vol2:
+ type: string
+ description: volume name
+ cmaui_cinder_volume_size:
+ type: number
+ label: CMAUI Cinder volume size
+ description: the size of the CMAUI Cinder volume
+ CMAUI_volume_type:
+ type: string
+ label: CMAUI vm volume type
+ description: the name of the target volume backend
+
+resources:
+ test_nested:
+ type: nested.yml
+ properties:
+ shared_vol1: { get_param: shared_vol1}
+ cmaui_volume_param2: { get_param: shared_vol2}
+outputs:
+ out1_not_shared:
+ value: {get_resource: test_nested} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/inputfiles/main.yml
new file mode 100644
index 0000000000..e32c24e200
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/inputfiles/main.yml
@@ -0,0 +1,32 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ cmaui_cinder_volume_size:
+ type: number
+ label: CMAUI Cinder volume size
+ description: the size of the CMAUI Cinder volume
+ CMAUI_volume_type:
+ type: string
+ label: CMAUI vm volume type
+ description: the name of the target volume backend
+
+resources:
+ test_vol1:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: cmaui_cinder_volume_size}
+ volume_type: {get_param: CMAUI_volume_type}
+ test_vol2:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: cmaui_cinder_volume_size}
+ volume_type: {get_param: CMAUI_volume_type}
+
+outputs:
+ shared_vol1:
+ value: {get_resource: test_vol1}
+ shared_vol2:
+ value: {get_resource: test_vol2}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/inputfiles/nested.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/inputfiles/nested.yml
new file mode 100644
index 0000000000..b5c913c48d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/inputfiles/nested.yml
@@ -0,0 +1,87 @@
+heat_template_version: 2013-05-23
+
+description: cmaui server template for vMMSC
+
+parameters:
+ shared_vol1:
+ type: string
+ description: nova server id
+ cmaui_volume_param2:
+ type: string
+ description: nova server id
+ p1:
+ type: string
+ description: UID of OAM network
+ security_group_name:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_oam_ips:
+ type: string
+resources:
+
+ cmaui_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: p1 }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ cmaui_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: p1 }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_cmaui1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_1 }
+
+ server_cmaui2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_2 }
+
+ cmaui_volume_attachment1:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_param: shared_vol1}
+ instance_uuid: {get_resource: server_cmaui1}
+
+ cmaui_volume_attachment2:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_param: cmaui_volume_param2}
+ instance_uuid: {get_resource: server_cmaui1}
+
+ cmaui_volume_attachment3:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_param: shared_vol1}
+ instance_uuid: {get_resource: server_cmaui2} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..fd5eae6858
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
@@ -0,0 +1,158 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: GlobalSubstitutionTypes
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.abstract.nodes.heat.nested:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ cmaui_names:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p1:
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_volume_param2:
+ type: string
+ description: nova server id
+ security_group_name:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ availability_zone_0:
+ type: string
+ description: availabilityzone name
+ shared_vol1:
+ type: string
+ description: nova server id
+ cmaui_oam_ips:
+ type: string
+ requirements:
+ - link_cmaui_port_2:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - local_storage_server_cmaui2:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - local_storage_server_cmaui1:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - link_cmaui_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ capabilities:
+ scalable_server_cmaui1:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_cmaui1:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_cmaui1:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_server_cmaui2:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_cmaui2:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_2:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_server_cmaui1:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_cmaui2:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_cmaui2:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_server_cmaui2:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_cmaui1:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_1:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..f279e7f83d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,181 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cmaui:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p1:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_cinder_volume_size:
+ label: CMAUI Cinder volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: the size of the CMAUI Cinder volume
+ security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ shared_vol1:
+ hidden: false
+ immutable: false
+ type: string
+ description: volume name
+ cmaui_oam_ips:
+ hidden: false
+ immutable: false
+ type: string
+ shared_vol2:
+ hidden: false
+ immutable: false
+ type: string
+ description: volume name
+ CMAUI_volume_type:
+ label: CMAUI vm volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the target volume backend
+ node_templates:
+ test_vol1:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: CMAUI_volume_type
+ size: '(get_input : cmaui_cinder_volume_size) * 1024'
+ test_vol2:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: CMAUI_volume_type
+ size: '(get_input : cmaui_cinder_volume_size) * 1024'
+ server_cmaui:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ cmaui_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: p1
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ test_nested:
+ type: org.openecomp.resource.abstract.nodes.heat.nested
+ directives:
+ - substitutable
+ properties:
+ service_template_filter:
+ substitute_service_template: nestedServiceTemplate.yaml
+ cmaui_volume_param2:
+ get_input: shared_vol2
+ shared_vol1:
+ get_input: shared_vol1
+ requirements:
+ - local_storage_server_cmaui1:
+ capability: tosca.capabilities.Attachment
+ node: test_vol2
+ relationship: tosca.relationships.AttachesTo
+ groups:
+ addOn:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/addOn.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - test_nested
+ main:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/main.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - test_vol1
+ - test_vol2
+ - server_cmaui
+ - cmaui_port_0
+ outputs:
+ out1_not_shared:
+ value: test_nested \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/expectedoutputfiles/nestedServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/expectedoutputfiles/nestedServiceTemplate.yaml
new file mode 100644
index 0000000000..68a602e14a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/expectedoutputfiles/nestedServiceTemplate.yaml
@@ -0,0 +1,212 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cmaui:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p1:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_volume_param2:
+ hidden: false
+ immutable: false
+ type: string
+ description: nova server id
+ security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ shared_vol1:
+ hidden: false
+ immutable: false
+ type: string
+ description: nova server id
+ cmaui_oam_ips:
+ hidden: false
+ immutable: false
+ type: string
+ node_templates:
+ cmaui_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: p1
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui2
+ relationship: tosca.relationships.network.BindsTo
+ server_cmaui2:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ server_cmaui1:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ cmaui_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: p1
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui1
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ nested:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested.yml
+ description: cmaui server template for vMMSC
+ members:
+ - cmaui_port_2
+ - server_cmaui2
+ - server_cmaui1
+ - cmaui_port_1
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested
+ capabilities:
+ scalable_server_cmaui1:
+ - server_cmaui1
+ - scalable
+ endpoint_server_cmaui1:
+ - server_cmaui1
+ - endpoint
+ os_server_cmaui1:
+ - server_cmaui1
+ - os
+ scalable_server_cmaui2:
+ - server_cmaui2
+ - scalable
+ endpoint_server_cmaui2:
+ - server_cmaui2
+ - endpoint
+ attachment_cmaui_port_2:
+ - cmaui_port_2
+ - attachment
+ host_server_cmaui1:
+ - server_cmaui1
+ - host
+ os_server_cmaui2:
+ - server_cmaui2
+ - os
+ binding_server_cmaui2:
+ - server_cmaui2
+ - binding
+ host_server_cmaui2:
+ - server_cmaui2
+ - host
+ binding_server_cmaui1:
+ - server_cmaui1
+ - binding
+ attachment_cmaui_port_1:
+ - cmaui_port_1
+ - attachment
+ requirements:
+ link_cmaui_port_2:
+ - cmaui_port_2
+ - link
+ link_cmaui_port_1:
+ - cmaui_port_1
+ - link
+ local_storage_server_cmaui2:
+ - server_cmaui2
+ - local_storage
+ local_storage_server_cmaui1:
+ - server_cmaui1
+ - local_storage \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..8ba5fc48f4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/inputfiles/MANIFEST.json
@@ -0,0 +1,22 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "main.yml",
+ "type": "HEAT",
+ "isBase": "true"
+ },
+ {
+ "file": "nested.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ },
+ {
+ "file": "addOn.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/inputfiles/addOn.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/inputfiles/addOn.yml
new file mode 100644
index 0000000000..20fb8c92d8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/inputfiles/addOn.yml
@@ -0,0 +1,30 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ shared_vol1:
+ type: string
+ description: volume name
+ shared_vol2:
+ type: string
+ description: volume name
+ cmaui_cinder_volume_size:
+ type: number
+ label: CMAUI Cinder volume size
+ description: the size of the CMAUI Cinder volume
+ CMAUI_volume_type:
+ type: string
+ label: CMAUI vm volume type
+ description: the name of the target volume backend
+
+resources:
+ test_nested:
+ type: nested.yml
+ properties:
+ shared_vol1: { get_param: shared_vol1}
+ cmaui_volume_param2: { get_param: shared_vol2}
+outputs:
+ out1_not_shared:
+ value: {get_resource: test_nested} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/inputfiles/main.yml
new file mode 100644
index 0000000000..2e272bf42f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/inputfiles/main.yml
@@ -0,0 +1,70 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ cmaui_cinder_volume_size:
+ type: number
+ label: CMAUI Cinder volume size
+ description: the size of the CMAUI Cinder volume
+ CMAUI_volume_type:
+ type: string
+ label: CMAUI vm volume type
+ description: the name of the target volume backend
+ p1:
+ type: string
+ description: UID of OAM network
+ security_group_name:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_oam_ips:
+ type: string
+
+resources:
+ test_vol1:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: cmaui_cinder_volume_size}
+ volume_type: {get_param: CMAUI_volume_type}
+ test_vol2:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: cmaui_cinder_volume_size}
+ volume_type: {get_param: CMAUI_volume_type}
+ cmaui_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: p1 }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_cmaui:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_0 }
+
+outputs:
+ shared_vol1:
+ value: {get_resource: server_cmaui}
+ shared_vol2:
+ value: {get_resource: test_vol2}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/inputfiles/nested.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/inputfiles/nested.yml
new file mode 100644
index 0000000000..b5c913c48d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/inputfiles/nested.yml
@@ -0,0 +1,87 @@
+heat_template_version: 2013-05-23
+
+description: cmaui server template for vMMSC
+
+parameters:
+ shared_vol1:
+ type: string
+ description: nova server id
+ cmaui_volume_param2:
+ type: string
+ description: nova server id
+ p1:
+ type: string
+ description: UID of OAM network
+ security_group_name:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_oam_ips:
+ type: string
+resources:
+
+ cmaui_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: p1 }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ cmaui_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: p1 }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_cmaui1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_1 }
+
+ server_cmaui2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_2 }
+
+ cmaui_volume_attachment1:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_param: shared_vol1}
+ instance_uuid: {get_resource: server_cmaui1}
+
+ cmaui_volume_attachment2:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_param: cmaui_volume_param2}
+ instance_uuid: {get_resource: server_cmaui1}
+
+ cmaui_volume_attachment3:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_param: shared_vol1}
+ instance_uuid: {get_resource: server_cmaui2} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumemulticonnection/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumemulticonnection/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..8a24ebce83
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumemulticonnection/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,326 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cmaui_image:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: String
+ cmaui_cinder_volume_size:
+ label: CMAUI Cinder volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: the size of the CMAUI Cinder volume
+ timezone:
+ label: timezone
+ hidden: false
+ immutable: false
+ type: string
+ description: timezone
+ security_group_name:
+ label: security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of security group
+ cmaui_volume:
+ label: CMAUI vm volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the target volume backend
+ oam_network_netmask:
+ label: oam network netmask
+ hidden: false
+ immutable: false
+ type: string
+ description: oam network gateway
+ cmaui_volume_param1:
+ hidden: false
+ immutable: false
+ type: string
+ description: nova server id
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ vnf_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-CMAUI_id
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ oam_network_gateway:
+ label: oam network gateway
+ hidden: false
+ immutable: false
+ type: string
+ description: oam network gateway
+ cmaui_volume_param2:
+ hidden: false
+ immutable: false
+ type: string
+ description: nova server id
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ label: CMAUI oam_net IP addresses
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI oam_net IP addresses
+ entry_schema:
+ type: String
+ external_dns:
+ label: dns server
+ hidden: false
+ immutable: false
+ type: string
+ description: dns server
+ oam_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ CMAUI_volume_type:
+ label: CMAUI vm volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the target volume backend
+ external_ntp:
+ label: ntp server
+ hidden: false
+ immutable: false
+ type: string
+ description: ntp server
+ node_templates:
+ cmaui_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui2
+ relationship: tosca.relationships.network.BindsTo
+ server_cmaui2:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui_image
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ user_data_format: RAW
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ user_data:
+ str_replace:
+ template: |
+ cmaui.mgmt.ip=${cmaui.mgmt.ip}
+ cmaui.mgmt.netmask=${cmaui.mgmt.netmask}
+ cmaui.mgmt.gateway=${cmaui.mgmt.gateway}
+ cmaui.external.dns=${cmaui.external.dns}
+ cmaui.external.ntp=${cmaui.external.ntp}
+ cmaui.node=${cmaui.node}
+ cmaui.timezone=${cmaui.timezone}
+ params:
+ ${cmaui.mgmt.netmask}:
+ get_input: oam_network_netmask
+ ${cmaui.node}:
+ get_input:
+ - cmaui_names
+ - 0
+ ${cmaui.mgmt.gateway}:
+ get_input: oam_network_gateway
+ ${cmaui.mgmt.ip}:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ ${cmaui.external.ntp}:
+ get_input: external_ntp
+ ${cmaui.timezone}:
+ get_input: timezone
+ ${cmaui.external.dns}:
+ get_input: external_dns
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: cmaui_volume2
+ relationship: cmaui_volume_attachment3
+ server_cmaui1:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui_image
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ user_data_format: RAW
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ user_data:
+ str_replace:
+ template: |
+ cmaui.mgmt.ip=${cmaui.mgmt.ip}
+ cmaui.mgmt.netmask=${cmaui.mgmt.netmask}
+ cmaui.mgmt.gateway=${cmaui.mgmt.gateway}
+ cmaui.external.dns=${cmaui.external.dns}
+ cmaui.external.ntp=${cmaui.external.ntp}
+ cmaui.node=${cmaui.node}
+ cmaui.timezone=${cmaui.timezone}
+ params:
+ ${cmaui.mgmt.netmask}:
+ get_input: oam_network_netmask
+ ${cmaui.node}:
+ get_input:
+ - cmaui_names
+ - 0
+ ${cmaui.mgmt.gateway}:
+ get_input: oam_network_gateway
+ ${cmaui.mgmt.ip}:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ ${cmaui.external.ntp}:
+ get_input: external_ntp
+ ${cmaui.timezone}:
+ get_input: timezone
+ ${cmaui.external.dns}:
+ get_input: external_dns
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: cmaui_volume1
+ relationship: cmaui_volume_attachment1
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: cmaui_volume2
+ relationship: cmaui_volume_attachment2
+ cmaui_volume1:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: CMAUI_volume_type
+ size: '(get_input : cmaui_cinder_volume_size) * 1024'
+ cmaui_volume2:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: CMAUI_volume_type
+ size: '(get_input : cmaui_cinder_volume_size) * 1024'
+ cmaui_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui1
+ relationship: tosca.relationships.network.BindsTo
+ relationship_templates:
+ cmaui_volume_attachment2:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id:
+ get_input: cmaui_volume_param2
+ instance_uuid: server_cmaui1
+ cmaui_volume_attachment3:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id:
+ get_input: cmaui_volume_param2
+ instance_uuid: server_cmaui2
+ cmaui_volume_attachment1:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id:
+ get_input: cmaui_volume_param1
+ instance_uuid: server_cmaui1
+ groups:
+ addOn:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/addOn.yml
+ description: cmaui server template for vMMSC
+ members:
+ - cmaui_port_2
+ - server_cmaui2
+ - server_cmaui1
+ - cmaui_port_1
+ main:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/main.yml
+ description: volume
+ members:
+ - cmaui_volume1
+ - cmaui_volume2 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumesharednestedconnection/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumesharednestedconnection/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..5e78625e01
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumesharednestedconnection/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,104 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+topology_template:
+ inputs:
+ cmaui_cinder_volume_size:
+ label: CMAUI Cinder volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: the size of the CMAUI Cinder volume
+ shared_vol1:
+ hidden: false
+ immutable: false
+ type: string
+ description: volume name
+ shared_vol2:
+ hidden: false
+ immutable: false
+ type: string
+ description: volume name
+ CMAUI_volume_type:
+ label: CMAUI vm volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the target volume backend
+ node_templates:
+ test_vol1:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: CMAUI_volume_type
+ size: '(get_input : cmaui_cinder_volume_size) * 1024'
+ test_vol2:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: CMAUI_volume_type
+ size: '(get_input : cmaui_cinder_volume_size) * 1024'
+ test_nested:
+ type: org.openecomp.resource.abstract.nodes.heat.nested
+ directives:
+ - substitutable
+ properties:
+ service_template_filter:
+ substitute_service_template: nestedServiceTemplate.yaml
+ cmaui_volume_param1:
+ get_input: shared_vol1
+ cmaui_volume_param2:
+ get_input: shared_vol2
+ requirements:
+ - local_storage_server_cmaui2:
+ capability: tosca.capabilities.Attachment
+ node: test_vol1
+ relationship: tosca.relationships.AttachesTo
+ - local_storage_server_cmaui1:
+ capability: tosca.capabilities.Attachment
+ node: test_vol1
+ relationship: tosca.relationships.AttachesTo
+ - local_storage_server_cmaui1:
+ capability: tosca.capabilities.Attachment
+ node: test_vol2
+ relationship: tosca.relationships.AttachesTo
+ groups:
+ addOn:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/addOn.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - test_nested
+ main:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/main.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - test_vol1
+ - test_vol2
+ outputs:
+ out1_not_shared:
+ value: test_nested \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumesharednestedconnection/inputfiles/addOn.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumesharednestedconnection/inputfiles/addOn.yml
new file mode 100644
index 0000000000..3114081d2b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumesharednestedconnection/inputfiles/addOn.yml
@@ -0,0 +1,30 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ shared_vol1:
+ type: string
+ description: volume name
+ shared_vol2:
+ type: string
+ description: volume name
+ cmaui_cinder_volume_size:
+ type: number
+ label: CMAUI Cinder volume size
+ description: the size of the CMAUI Cinder volume
+ CMAUI_volume_type:
+ type: string
+ label: CMAUI vm volume type
+ description: the name of the target volume backend
+
+resources:
+ test_nested:
+ type: nested.yml
+ properties:
+ cmaui_volume_param1: { get_param: shared_vol1}
+ cmaui_volume_param2: { get_param: shared_vol2}
+outputs:
+ out1_not_shared:
+ value: {get_resource: test_nested} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/multi/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/multi/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..641b84337f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/multi/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,143 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cmaui:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p1:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ hidden: false
+ immutable: false
+ type: string
+ shared_network_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ jsa_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ node_templates:
+ server_cmaui:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ test_net:
+ type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
+ properties:
+ shared: true
+ network_name:
+ get_input: jsa_net_name
+ cmaui_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: shared_network_id
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ addOn:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/addOn.yml
+ description: cmaui server template for vMMSC
+ members:
+ - server_cmaui
+ - cmaui_port_0
+ main:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/main.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - test_net \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/multi/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/multi/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..1f762d0ccc
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/multi/inputfiles/MANIFEST.json
@@ -0,0 +1,17 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "main.yml",
+ "type": "HEAT",
+ "isBase": "true"
+ },
+ {
+ "file": "addOn.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/multi/inputfiles/addOn.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/multi/inputfiles/addOn.yml
new file mode 100644
index 0000000000..e6c5954fb0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/multi/inputfiles/addOn.yml
@@ -0,0 +1,48 @@
+heat_template_version: 2013-05-23
+
+description: cmaui server template for vMMSC
+
+parameters:
+ p1:
+ type: string
+ description: UID of OAM network
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ security_group_name:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ shared_network_id:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_oam_ips:
+ type: string
+resources:
+
+ cmaui_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: shared_network_id }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_cmaui:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_0 } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/multi/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/multi/inputfiles/main.yml
new file mode 100644
index 0000000000..73a2e3b45c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/multi/inputfiles/main.yml
@@ -0,0 +1,20 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ jsa_net_name:
+ type: string
+ description: network name of jsa log network
+
+resources:
+ test_net:
+ type: OS::Neutron::Net
+ properties:
+ name: {get_param: jsa_net_name}
+ shared: True
+
+outputs:
+ shared_network_id:
+ value: {get_resource: test_net} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..44aca0ee4d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
@@ -0,0 +1,106 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: GlobalSubstitutionTypes
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.abstract.nodes.heat.nested:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ cmaui_names:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p1:
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ security_group_name:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ availability_zone_0:
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ type: string
+ requirements:
+ - local_storage_server_cmaui:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - link_cmaui_port_0:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ capabilities:
+ host_server_cmaui:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_cmaui:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_cmaui:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_cmaui:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_server_cmaui:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_0:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..052286f8a9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,225 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ left_vn_fqdn:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ Internal1_cidr:
+ hidden: false
+ immutable: false
+ type: string
+ src_port_start:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ Internal1_default_gateway:
+ hidden: false
+ immutable: false
+ type: string
+ Internal1_dhcp:
+ hidden: false
+ immutable: false
+ type: string
+ src_port_end:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ policy_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ dst_port_end:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ simple_action:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ service_instance_fq_name:
+ hidden: false
+ immutable: false
+ type: string
+ Internal2_cidr:
+ hidden: false
+ immutable: false
+ type: string
+ protocol:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ Internal2_dhcp:
+ hidden: false
+ immutable: false
+ type: string
+ dst_port_start:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ network_ipam_refs_data_ipam_subnets_addr_from_start_true:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ Internal2_default_gateway:
+ hidden: false
+ immutable: false
+ type: string
+ right_vn_fqdn:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ left_vn:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ direction:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ node_templates:
+ template_NetworkPolicy:
+ type: org.openecomp.resource.vfc.rules.nodes.heat.network.contrailV2.NetworkRules
+ properties:
+ name:
+ get_input: policy_name
+ network_policy_entries:
+ network_policy_entries_policy_rule:
+ - network_policy_entries_policy_rule_dst_addresses:
+ - network_policy_entries_policy_rule_dst_addresses_virtual_network:
+ get_input: right_vn_fqdn
+ network_policy_entries_policy_rule_dst_ports:
+ - network_policy_entries_policy_rule_dst_ports_start_port:
+ get_input: dst_port_start
+ network_policy_entries_policy_rule_dst_ports_end_port:
+ get_input: dst_port_end
+ network_policy_entries_policy_rule_protocol:
+ get_input: protocol
+ network_policy_entries_policy_rule_src_addresses:
+ - network_policy_entries_policy_rule_src_addresses_virtual_network:
+ get_input: left_vn_fqdn
+ network_policy_entries_policy_rule_direction:
+ get_input: direction
+ network_policy_entries_policy_rule_src_ports:
+ - network_policy_entries_policy_rule_src_ports_start_port:
+ get_input: src_port_start
+ network_policy_entries_policy_rule_src_ports_end_port:
+ get_input: src_port_end
+ network_policy_entries_policy_rule_action_list:
+ network_policy_entries_policy_rule_action_list_simple_action:
+ get_input: simple_action
+ network_policy_entries_policy_rule_action_list_apply_service:
+ - get_input: service_instance_fq_name
+ requirements:
+ - network:
+ capability: tosca.capabilities.Attachment
+ node: test_net
+ relationship: org.openecomp.relationships.AttachesTo
+ test_net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrailV2.VirtualNetwork
+ properties:
+ network_ipam_refs_data:
+ - network_ipam_refs_data_ipam_subnets:
+ - network_ipam_refs_data_ipam_subnets_subnet:
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len:
+ get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix:
+ get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2
+ network_ipam_refs_data_ipam_subnets_addr_from_start:
+ get_input: network_ipam_refs_data_ipam_subnets_addr_from_start_true
+ network_policy_refs_data:
+ - network_policy_refs_data_sequence:
+ network_policy_refs_data_sequence_major: 0
+ network_policy_refs_data_sequence_minor: 0
+ network_name:
+ get_input: left_vn
+ network_ipam_refs:
+ - UNSUPPORTED_RESOURCE_template_NetworkIpam_2
+ network_policy_refs:
+ - list_join:
+ - ':'
+ - get_attribute:
+ - template_NetworkPolicy
+ - fq_name
+ requirements:
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: template_NetworkPolicy
+ relationship: tosca.relationships.DependsOn
+ test_nested:
+ type: org.openecomp.resource.abstract.nodes.heat.nested
+ directives:
+ - substitutable
+ properties:
+ p1: test_net
+ service_template_filter:
+ substitute_service_template: nestedServiceTemplate.yaml
+ requirements:
+ - link_cmaui_port_0:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net
+ relationship: tosca.relationships.network.LinksTo
+ groups:
+ main:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/main.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - template_NetworkPolicy
+ - test_net
+ - test_nested \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/expectedoutputfiles/nestedServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/expectedoutputfiles/nestedServiceTemplate.yaml
new file mode 100644
index 0000000000..cfe7f567c5
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/expectedoutputfiles/nestedServiceTemplate.yaml
@@ -0,0 +1,145 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cmaui:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p1:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ hidden: false
+ immutable: false
+ type: string
+ node_templates:
+ server_cmaui:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ cmaui_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: p1
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ nested:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested.yml
+ description: cmaui server template for vMMSC
+ members:
+ - server_cmaui
+ - cmaui_port_0
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested
+ capabilities:
+ host_server_cmaui:
+ - server_cmaui
+ - host
+ os_server_cmaui:
+ - server_cmaui
+ - os
+ endpoint_server_cmaui:
+ - server_cmaui
+ - endpoint
+ binding_server_cmaui:
+ - server_cmaui
+ - binding
+ scalable_server_cmaui:
+ - server_cmaui
+ - scalable
+ attachment_cmaui_port_0:
+ - cmaui_port_0
+ - attachment
+ requirements:
+ local_storage_server_cmaui:
+ - server_cmaui
+ - local_storage
+ link_cmaui_port_0:
+ - cmaui_port_0
+ - link \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..aca75b5055
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/inputfiles/MANIFEST.json
@@ -0,0 +1,17 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "main.yml",
+ "type": "HEAT",
+ "isBase": "true"
+ },
+ {
+ "file": "nested.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/inputfiles/main.yml
new file mode 100644
index 0000000000..30e107dec7
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/inputfiles/main.yml
@@ -0,0 +1,140 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ Internal1_cidr:
+ type: string
+ Internal2_cidr:
+ type: string
+ Internal1_default_gateway:
+ type: string
+ Internal2_default_gateway:
+ type: string
+ Internal1_dhcp:
+ type: string
+ Internal2_dhcp:
+ type: string
+ direction:
+ description: dummy
+ type: string
+ dst_port_end:
+ description: dummy
+ type: string
+ dst_port_start:
+ description: dummy
+ type: string
+ left_vn:
+ description: dummy
+ type: string
+ left_vn_fqdn:
+ description: dummy
+ type: string
+ network_ipam_refs_data_ipam_subnets_addr_from_start_true:
+ description: dummy
+ type: string
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2:
+ description: dummy
+ type: string
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2:
+ description: dummy
+ type: string
+ policy_name:
+ description: dummy
+ type: string
+ protocol:
+ description: dummy
+ type: string
+ right_vn_fqdn:
+ description: dummy
+ type: string
+ simple_action:
+ description: dummy
+ type: string
+ src_port_end:
+ description: dummy
+ type: string
+ src_port_start:
+ description: dummy
+ type: string
+ service_instance_fq_name:
+ type: string
+
+resources:
+ template_NetworkIpam_2:
+ properties:
+ name:
+ get_param: left_vn
+ type: "OS::ContrailV2::NetworkIpam"
+ template_NetworkPolicy:
+ properties:
+ name:
+ get_param: policy_name
+ network_policy_entries:
+ network_policy_entries_policy_rule:
+ -
+ network_policy_entries_policy_rule_action_list:
+ network_policy_entries_policy_rule_action_list_apply_service:
+ -
+ get_param: service_instance_fq_name
+ network_policy_entries_policy_rule_action_list_simple_action:
+ get_param: simple_action
+ network_policy_entries_policy_rule_direction:
+ get_param: direction
+ network_policy_entries_policy_rule_dst_addresses:
+ -
+ network_policy_entries_policy_rule_dst_addresses_virtual_network:
+ get_param: right_vn_fqdn
+ network_policy_entries_policy_rule_dst_ports:
+ -
+ network_policy_entries_policy_rule_dst_ports_end_port:
+ get_param: dst_port_end
+ network_policy_entries_policy_rule_dst_ports_start_port:
+ get_param: dst_port_start
+ network_policy_entries_policy_rule_protocol:
+ get_param: protocol
+ network_policy_entries_policy_rule_src_addresses:
+ -
+ network_policy_entries_policy_rule_src_addresses_virtual_network:
+ get_param: left_vn_fqdn
+ network_policy_entries_policy_rule_src_ports:
+ -
+ network_policy_entries_policy_rule_src_ports_end_port:
+ get_param: src_port_end
+ network_policy_entries_policy_rule_src_ports_start_port:
+ get_param: src_port_start
+ type: "OS::ContrailV2::NetworkPolicy"
+ test_net:
+ depends_on:
+ - template_NetworkIpam_2
+ - template_NetworkPolicy
+ properties:
+ name:
+ get_param: left_vn
+ network_ipam_refs:
+ -
+ get_resource: template_NetworkIpam_2
+ network_ipam_refs_data:
+ -
+ network_ipam_refs_data_ipam_subnets:
+ -
+ network_ipam_refs_data_ipam_subnets_addr_from_start:
+ get_param: network_ipam_refs_data_ipam_subnets_addr_from_start_true
+ network_ipam_refs_data_ipam_subnets_subnet:
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix:
+ get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len:
+ get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2
+ network_policy_refs: [ { list_join: [':', { get_attr: [ template_NetworkPolicy, fq_name ] } ] } ]
+ network_policy_refs_data:
+ -
+ network_policy_refs_data_sequence:
+ network_policy_refs_data_sequence_major: 0
+ network_policy_refs_data_sequence_minor: 0
+ type: "OS::ContrailV2::VirtualNetwork"
+
+ test_nested:
+ type: nested.yml
+ properties:
+ p1: { get_resource: test_net}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/inputfiles/nested.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/inputfiles/nested.yml
new file mode 100644
index 0000000000..56a099500b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/inputfiles/nested.yml
@@ -0,0 +1,45 @@
+heat_template_version: 2013-05-23
+
+description: cmaui server template for vMMSC
+
+parameters:
+ p1:
+ type: string
+ description: UID of OAM network
+ security_group_name:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_oam_ips:
+ type: string
+resources:
+
+ cmaui_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: p1 }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_cmaui:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_0 } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..351b12fd58
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
@@ -0,0 +1,251 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: GlobalSubstitutionTypes
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.abstract.nodes.heat.nested1:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ cmaui_names:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p1:
+ type: string
+ description: UID of OAM network
+ p2:
+ type: string
+ description: UID of OAM network
+ abc_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ abc_names:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ security_group_name:
+ description: not impotrtant
+ availability_zone_0:
+ type: string
+ description: availabilityzone name
+ abc_oam_ips:
+ type: string
+ cmaui_oam_ips:
+ type: string
+ abc_image:
+ type: string
+ description: Image for CMAUI server
+ requirements:
+ - link_cmaui_port_2:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - local_storage_server_cmaui:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - local_storage_server_abc:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - link_abc_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_cmaui_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ capabilities:
+ scalable_server_abc:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_cmaui:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_abc_port_1:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_server_cmaui:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_server_abc:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_abc:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_server_cmaui:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_abc:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_cmaui:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_cmaui:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_abc:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_2:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_1:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ org.openecomp.resource.abstract.nodes.heat.nested2:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ cmaui_names:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p1:
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ security_group_name:
+ description: not impotrtant
+ availability_zone_0:
+ type: string
+ description: availabilityzone name
+ abc_oam_ips:
+ type: string
+ cmaui_oam_ips:
+ type: string
+ requirements:
+ - local_storage_server_cmaui:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - link_cmaui_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ capabilities:
+ host_server_cmaui:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_cmaui:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_cmaui:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_cmaui:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_server_cmaui:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_1:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..427e7be436
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,334 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ left_vn_fqdn:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ Internal1_cidr:
+ hidden: false
+ immutable: false
+ type: string
+ src_port_start:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ Internal1_default_gateway:
+ hidden: false
+ immutable: false
+ type: string
+ Internal1_dhcp:
+ hidden: false
+ immutable: false
+ type: string
+ src_port_end:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ policy_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ dst_port_end:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ simple_action:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ service_instance_fq_name:
+ hidden: false
+ immutable: false
+ type: string
+ jsa_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ Internal2_cidr:
+ hidden: false
+ immutable: false
+ type: string
+ protocol:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ shared_network_id1:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ Internal2_dhcp:
+ hidden: false
+ immutable: false
+ type: string
+ shared_network_id2:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ dst_port_start:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ network_ipam_refs_data_ipam_subnets_addr_from_start_true:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ Internal2_default_gateway:
+ hidden: false
+ immutable: false
+ type: string
+ right_vn_fqdn:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ left_vn:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ direction:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2:
+ hidden: false
+ immutable: false
+ type: string
+ description: dummy
+ node_templates:
+ template_NetworkPolicy:
+ type: org.openecomp.resource.vfc.rules.nodes.heat.network.contrailV2.NetworkRules
+ properties:
+ name:
+ get_input: policy_name
+ network_policy_entries:
+ network_policy_entries_policy_rule:
+ - network_policy_entries_policy_rule_dst_addresses:
+ - network_policy_entries_policy_rule_dst_addresses_virtual_network:
+ get_input: right_vn_fqdn
+ network_policy_entries_policy_rule_dst_ports:
+ - network_policy_entries_policy_rule_dst_ports_start_port:
+ get_input: dst_port_start
+ network_policy_entries_policy_rule_dst_ports_end_port:
+ get_input: dst_port_end
+ network_policy_entries_policy_rule_protocol:
+ get_input: protocol
+ network_policy_entries_policy_rule_src_addresses:
+ - network_policy_entries_policy_rule_src_addresses_virtual_network:
+ get_input: left_vn_fqdn
+ network_policy_entries_policy_rule_direction:
+ get_input: direction
+ network_policy_entries_policy_rule_src_ports:
+ - network_policy_entries_policy_rule_src_ports_start_port:
+ get_input: src_port_start
+ network_policy_entries_policy_rule_src_ports_end_port:
+ get_input: src_port_end
+ network_policy_entries_policy_rule_action_list:
+ network_policy_entries_policy_rule_action_list_simple_action:
+ get_input: simple_action
+ network_policy_entries_policy_rule_action_list_apply_service:
+ - get_input: service_instance_fq_name
+ requirements:
+ - network:
+ capability: tosca.capabilities.Attachment
+ node: test_net1
+ relationship: org.openecomp.relationships.AttachesTo
+ - network:
+ capability: tosca.capabilities.Attachment
+ node: test_net2
+ relationship: org.openecomp.relationships.AttachesTo
+ test_net2:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrailV2.VirtualNetwork
+ properties:
+ network_ipam_refs_data:
+ - network_ipam_refs_data_ipam_subnets:
+ - network_ipam_refs_data_ipam_subnets_subnet:
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len:
+ get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix:
+ get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2
+ network_ipam_refs_data_ipam_subnets_addr_from_start:
+ get_input: network_ipam_refs_data_ipam_subnets_addr_from_start_true
+ network_policy_refs_data:
+ - network_policy_refs_data_sequence:
+ network_policy_refs_data_sequence_major: 0
+ network_policy_refs_data_sequence_minor: 0
+ network_name:
+ get_input: left_vn
+ network_ipam_refs:
+ - UNSUPPORTED_RESOURCE_template_NetworkIpam_2
+ network_policy_refs:
+ - list_join:
+ - ':'
+ - get_attribute:
+ - template_NetworkPolicy
+ - fq_name
+ requirements:
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: template_NetworkPolicy
+ relationship: tosca.relationships.DependsOn
+ test_nested2:
+ type: org.openecomp.resource.abstract.nodes.heat.nested2
+ directives:
+ - substitutable
+ properties:
+ p1:
+ get_input: shared_network_id1
+ service_template_filter:
+ substitute_service_template: nested2ServiceTemplate.yaml
+ requirements:
+ - link_cmaui_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net1
+ relationship: tosca.relationships.network.LinksTo
+ test_nested3:
+ type: org.openecomp.resource.abstract.nodes.heat.nested1
+ directives:
+ - substitutable
+ properties:
+ p1:
+ get_input: shared_network_id1
+ service_template_filter:
+ substitute_service_template: nested1ServiceTemplate.yaml
+ p2:
+ get_input: shared_network_id2
+ requirements:
+ - link_cmaui_port_2:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net2
+ relationship: tosca.relationships.network.LinksTo
+ - link_abc_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net2
+ relationship: tosca.relationships.network.LinksTo
+ - link_cmaui_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net1
+ relationship: tosca.relationships.network.LinksTo
+ test_net1:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrailV2.VirtualNetwork
+ properties:
+ network_ipam_refs_data:
+ - network_ipam_refs_data_ipam_subnets:
+ - network_ipam_refs_data_ipam_subnets_subnet:
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len:
+ get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix:
+ get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2
+ network_ipam_refs_data_ipam_subnets_addr_from_start:
+ get_input: network_ipam_refs_data_ipam_subnets_addr_from_start_true
+ network_policy_refs_data:
+ - network_policy_refs_data_sequence:
+ network_policy_refs_data_sequence_major: 0
+ network_policy_refs_data_sequence_minor: 0
+ network_name:
+ get_input: left_vn
+ network_ipam_refs:
+ - UNSUPPORTED_RESOURCE_template_NetworkIpam_2
+ network_policy_refs:
+ - list_join:
+ - ':'
+ - get_attribute:
+ - template_NetworkPolicy
+ - fq_name
+ requirements:
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: template_NetworkPolicy
+ relationship: tosca.relationships.DependsOn
+ test_nested1:
+ type: org.openecomp.resource.abstract.nodes.heat.nested1
+ directives:
+ - substitutable
+ properties:
+ p1:
+ get_input: shared_network_id1
+ service_template_filter:
+ substitute_service_template: nested1ServiceTemplate.yaml
+ p2:
+ get_input: shared_network_id2
+ requirements:
+ - link_cmaui_port_2:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net2
+ relationship: tosca.relationships.network.LinksTo
+ - link_abc_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net2
+ relationship: tosca.relationships.network.LinksTo
+ - link_cmaui_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net1
+ relationship: tosca.relationships.network.LinksTo
+ groups:
+ addOn:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/addOn.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - test_nested2
+ - test_nested3
+ - test_nested1
+ main:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/main.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - template_NetworkPolicy
+ - test_net2
+ - test_net1 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/expectedoutputfiles/nested1ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/expectedoutputfiles/nested1ServiceTemplate.yaml
new file mode 100644
index 0000000000..cd5b767492
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/expectedoutputfiles/nested1ServiceTemplate.yaml
@@ -0,0 +1,252 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested1
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.abc:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.cmaui:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p1:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ p2:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ abc_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ abc_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ security_group_name:
+ hidden: false
+ immutable: false
+ description: not impotrtant
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ abc_oam_ips:
+ hidden: false
+ immutable: false
+ type: string
+ cmaui_oam_ips:
+ hidden: false
+ immutable: false
+ type: string
+ abc_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ node_templates:
+ cmaui_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: p2
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ server_cmaui:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ server_abc:
+ type: org.openecomp.resource.vfc.nodes.heat.abc
+ properties:
+ flavor:
+ get_input: abc_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: abc_image
+ name:
+ get_input:
+ - abc_names
+ - 0
+ abc_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - abc_oam_ips
+ - 0
+ network:
+ get_input: p2
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_abc
+ relationship: tosca.relationships.network.BindsTo
+ cmaui_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: p1
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ nested1:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested1.yml
+ description: cmaui server template for vMMSC
+ members:
+ - cmaui_port_2
+ - server_cmaui
+ - server_abc
+ - abc_port_1
+ - cmaui_port_1
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested1
+ capabilities:
+ scalable_server_abc:
+ - server_abc
+ - scalable
+ os_server_cmaui:
+ - server_cmaui
+ - os
+ attachment_abc_port_1:
+ - abc_port_1
+ - attachment
+ scalable_server_cmaui:
+ - server_cmaui
+ - scalable
+ host_server_abc:
+ - server_abc
+ - host
+ os_server_abc:
+ - server_abc
+ - os
+ host_server_cmaui:
+ - server_cmaui
+ - host
+ binding_server_abc:
+ - server_abc
+ - binding
+ endpoint_server_cmaui:
+ - server_cmaui
+ - endpoint
+ binding_server_cmaui:
+ - server_cmaui
+ - binding
+ endpoint_server_abc:
+ - server_abc
+ - endpoint
+ attachment_cmaui_port_2:
+ - cmaui_port_2
+ - attachment
+ attachment_cmaui_port_1:
+ - cmaui_port_1
+ - attachment
+ requirements:
+ local_storage_server_cmaui:
+ - server_cmaui
+ - local_storage
+ link_abc_port_1:
+ - abc_port_1
+ - link
+ link_cmaui_port_2:
+ - cmaui_port_2
+ - link
+ link_cmaui_port_1:
+ - cmaui_port_1
+ - link
+ local_storage_server_abc:
+ - server_abc
+ - local_storage \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/expectedoutputfiles/nested2ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/expectedoutputfiles/nested2ServiceTemplate.yaml
new file mode 100644
index 0000000000..992e1c017c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/expectedoutputfiles/nested2ServiceTemplate.yaml
@@ -0,0 +1,146 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested2
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cmaui:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p1:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ security_group_name:
+ hidden: false
+ immutable: false
+ description: not impotrtant
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ abc_oam_ips:
+ hidden: false
+ immutable: false
+ type: string
+ cmaui_oam_ips:
+ hidden: false
+ immutable: false
+ type: string
+ node_templates:
+ server_cmaui:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ cmaui_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: p1
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ nested2:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested2.yml
+ description: cmaui server template for vMMSC
+ members:
+ - server_cmaui
+ - cmaui_port_1
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested2
+ capabilities:
+ host_server_cmaui:
+ - server_cmaui
+ - host
+ os_server_cmaui:
+ - server_cmaui
+ - os
+ endpoint_server_cmaui:
+ - server_cmaui
+ - endpoint
+ binding_server_cmaui:
+ - server_cmaui
+ - binding
+ scalable_server_cmaui:
+ - server_cmaui
+ - scalable
+ attachment_cmaui_port_1:
+ - cmaui_port_1
+ - attachment
+ requirements:
+ local_storage_server_cmaui:
+ - server_cmaui
+ - local_storage
+ link_cmaui_port_1:
+ - cmaui_port_1
+ - link \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..e593097c44
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles/MANIFEST.json
@@ -0,0 +1,27 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "main.yml",
+ "type": "HEAT",
+ "isBase": "true"
+ },
+ {
+ "file": "nested1.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ },
+ {
+ "file": "nested2.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ },
+ {
+ "file": "addOn.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles/addOn.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles/addOn.yml
new file mode 100644
index 0000000000..d956043627
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles/addOn.yml
@@ -0,0 +1,32 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ shared_network_id1:
+ type: string
+ description: network name of jsa log network
+
+ shared_network_id2:
+ type: string
+ description: network name of jsa log network
+
+resources:
+
+ test_nested1:
+ type: nested1.yml
+ properties:
+ p1: { get_param: shared_network_id1}
+ p2: { get_param: shared_network_id2}
+
+ test_nested2:
+ type: nested2.yml
+ properties:
+ p1: { get_param: shared_network_id1}
+
+ test_nested3:
+ type: nested1.yml
+ properties:
+ p1: { get_param: shared_network_id1}
+ p2: { get_param: shared_network_id2} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles/main.yml
new file mode 100644
index 0000000000..65d1a21a47
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles/main.yml
@@ -0,0 +1,174 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ jsa_net_name:
+ type: string
+ description: network name of jsa log network
+ Internal1_cidr:
+ type: string
+ Internal2_cidr:
+ type: string
+ Internal1_default_gateway:
+ type: string
+ Internal2_default_gateway:
+ type: string
+ Internal1_dhcp:
+ type: string
+ Internal2_dhcp:
+ type: string
+ direction:
+ description: dummy
+ type: string
+ dst_port_end:
+ description: dummy
+ type: string
+ dst_port_start:
+ description: dummy
+ type: string
+ left_vn:
+ description: dummy
+ type: string
+ left_vn_fqdn:
+ description: dummy
+ type: string
+ network_ipam_refs_data_ipam_subnets_addr_from_start_true:
+ description: dummy
+ type: string
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2:
+ description: dummy
+ type: string
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2:
+ description: dummy
+ type: string
+ policy_name:
+ description: dummy
+ type: string
+ protocol:
+ description: dummy
+ type: string
+ right_vn_fqdn:
+ description: dummy
+ type: string
+ simple_action:
+ description: dummy
+ type: string
+ src_port_end:
+ description: dummy
+ type: string
+ src_port_start:
+ description: dummy
+ type: string
+ service_instance_fq_name:
+ type: string
+
+resources:
+ template_NetworkIpam_2:
+ properties:
+ name:
+ get_param: left_vn
+ type: "OS::ContrailV2::NetworkIpam"
+ template_NetworkPolicy:
+ properties:
+ name:
+ get_param: policy_name
+ network_policy_entries:
+ network_policy_entries_policy_rule:
+ -
+ network_policy_entries_policy_rule_action_list:
+ network_policy_entries_policy_rule_action_list_apply_service:
+ -
+ get_param: service_instance_fq_name
+ network_policy_entries_policy_rule_action_list_simple_action:
+ get_param: simple_action
+ network_policy_entries_policy_rule_direction:
+ get_param: direction
+ network_policy_entries_policy_rule_dst_addresses:
+ -
+ network_policy_entries_policy_rule_dst_addresses_virtual_network:
+ get_param: right_vn_fqdn
+ network_policy_entries_policy_rule_dst_ports:
+ -
+ network_policy_entries_policy_rule_dst_ports_end_port:
+ get_param: dst_port_end
+ network_policy_entries_policy_rule_dst_ports_start_port:
+ get_param: dst_port_start
+ network_policy_entries_policy_rule_protocol:
+ get_param: protocol
+ network_policy_entries_policy_rule_src_addresses:
+ -
+ network_policy_entries_policy_rule_src_addresses_virtual_network:
+ get_param: left_vn_fqdn
+ network_policy_entries_policy_rule_src_ports:
+ -
+ network_policy_entries_policy_rule_src_ports_end_port:
+ get_param: src_port_end
+ network_policy_entries_policy_rule_src_ports_start_port:
+ get_param: src_port_start
+ type: "OS::ContrailV2::NetworkPolicy"
+ test_net1:
+ depends_on:
+ - template_NetworkIpam_2
+ - template_NetworkPolicy
+ properties:
+ name:
+ get_param: left_vn
+ network_ipam_refs:
+ -
+ get_resource: template_NetworkIpam_2
+ network_ipam_refs_data:
+ -
+ network_ipam_refs_data_ipam_subnets:
+ -
+ network_ipam_refs_data_ipam_subnets_addr_from_start:
+ get_param: network_ipam_refs_data_ipam_subnets_addr_from_start_true
+ network_ipam_refs_data_ipam_subnets_subnet:
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix:
+ get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len:
+ get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2
+ network_policy_refs: [ { list_join: [':', { get_attr: [ template_NetworkPolicy, fq_name ] } ] } ]
+ network_policy_refs_data:
+ -
+ network_policy_refs_data_sequence:
+ network_policy_refs_data_sequence_major: 0
+ network_policy_refs_data_sequence_minor: 0
+ type: "OS::ContrailV2::VirtualNetwork"
+
+ test_net2:
+ depends_on:
+ - template_NetworkIpam_2
+ - template_NetworkPolicy
+ properties:
+ name:
+ get_param: left_vn
+ network_ipam_refs:
+ -
+ get_resource: template_NetworkIpam_2
+ network_ipam_refs_data:
+ -
+ network_ipam_refs_data_ipam_subnets:
+ -
+ network_ipam_refs_data_ipam_subnets_addr_from_start:
+ get_param: network_ipam_refs_data_ipam_subnets_addr_from_start_true
+ network_ipam_refs_data_ipam_subnets_subnet:
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix:
+ get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2
+ network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len:
+ get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2
+ network_policy_refs: [ { list_join: [':', { get_attr: [ template_NetworkPolicy, fq_name ] } ] } ]
+ network_policy_refs_data:
+ -
+ network_policy_refs_data_sequence:
+ network_policy_refs_data_sequence_major: 0
+ network_policy_refs_data_sequence_minor: 0
+ type: "OS::ContrailV2::VirtualNetwork"
+
+outputs:
+ shared_network_id1:
+ value: {get_resource: test_net1}
+
+ shared_network_id2:
+ value: {get_resource: test_net2} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles/nested1.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles/nested1.yml
new file mode 100644
index 0000000000..66a15d0440
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles/nested1.yml
@@ -0,0 +1,86 @@
+heat_template_version: 2013-05-23
+
+description: cmaui server template for vMMSC
+
+parameters:
+ p1:
+ type: string
+ description: UID of OAM network
+ p2:
+ type: string
+ description: UID of OAM network
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ abc_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ security_group_name:
+ type: not_important
+ description: not impotrtant
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ abc_image:
+ type: string
+ description: Image for CMAUI server
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ abc_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_oam_ips:
+ type: string
+ abc_oam_ips:
+ type: string
+resources:
+
+ cmaui_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: p1 }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ cmaui_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: p2 }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ abc_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: p2 }
+ fixed_ips: [{"ip_address": {get_param: [abc_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_cmaui:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_1 }
+ - port: { get_resource: cmaui_port_2 }
+
+ server_abc:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [abc_names, 0]}
+ image: { get_param: abc_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: abc_flavor }
+ networks:
+ - port: { get_resource: abc_port_1 } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles/nested2.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles/nested2.yml
new file mode 100644
index 0000000000..b09d3aff8e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles/nested2.yml
@@ -0,0 +1,48 @@
+heat_template_version: 2013-05-23
+
+description: cmaui server template for vMMSC
+
+parameters:
+ p1:
+ type: string
+ description: UID of OAM network
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ security_group_name:
+ type: not_important
+ description: not impotrtant
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_oam_ips:
+ type: string
+ abc_oam_ips:
+ type: string
+
+resources:
+
+ cmaui_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: p1 }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_cmaui:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_1 } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/multi/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/multi/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..641b84337f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/multi/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,143 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cmaui:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p1:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ hidden: false
+ immutable: false
+ type: string
+ shared_network_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ jsa_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ node_templates:
+ server_cmaui:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ test_net:
+ type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
+ properties:
+ shared: true
+ network_name:
+ get_input: jsa_net_name
+ cmaui_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: shared_network_id
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ addOn:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/addOn.yml
+ description: cmaui server template for vMMSC
+ members:
+ - server_cmaui
+ - cmaui_port_0
+ main:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/main.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - test_net \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/multi/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/multi/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..1f762d0ccc
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/multi/inputfiles/MANIFEST.json
@@ -0,0 +1,17 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "main.yml",
+ "type": "HEAT",
+ "isBase": "true"
+ },
+ {
+ "file": "addOn.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/multi/inputfiles/addOn.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/multi/inputfiles/addOn.yml
new file mode 100644
index 0000000000..e6c5954fb0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/multi/inputfiles/addOn.yml
@@ -0,0 +1,48 @@
+heat_template_version: 2013-05-23
+
+description: cmaui server template for vMMSC
+
+parameters:
+ p1:
+ type: string
+ description: UID of OAM network
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ security_group_name:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ shared_network_id:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_oam_ips:
+ type: string
+resources:
+
+ cmaui_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: shared_network_id }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_cmaui:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_0 } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/multi/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/multi/inputfiles/main.yml
new file mode 100644
index 0000000000..73a2e3b45c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/multi/inputfiles/main.yml
@@ -0,0 +1,20 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ jsa_net_name:
+ type: string
+ description: network name of jsa log network
+
+resources:
+ test_net:
+ type: OS::Neutron::Net
+ properties:
+ name: {get_param: jsa_net_name}
+ shared: True
+
+outputs:
+ shared_network_id:
+ value: {get_resource: test_net} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..8db67317a4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
@@ -0,0 +1,134 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: GlobalSubstitutionTypes
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.abstract.nodes.heat.nested:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ cmaui_names:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p1:
+ type: string
+ description: UID of OAM network
+ p2:
+ type: string
+ p3:
+ type: string
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ security_group_name:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ availability_zone_0:
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ type: string
+ requirements:
+ - link_cmaui_port_2:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - local_storage_server_cmaui:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - link_cmaui_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_cmaui_port_0:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ capabilities:
+ host_server_cmaui:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_cmaui:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_cmaui:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_cmaui:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_2:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_server_cmaui:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_0:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_1:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..db605c9de0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,110 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.jsa:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ contrail_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ jsa_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ jsa_name:
+ hidden: false
+ immutable: false
+ type: string
+ node_templates:
+ test_nestedInvalidConnectionToNetwork:
+ type: org.openecomp.resource.abstract.nodes.heat.nested
+ directives:
+ - substitutable
+ properties:
+ p1: test_nova
+ service_template_filter:
+ substitute_service_template: nestedServiceTemplate.yaml
+ test_contrailV2_net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrailV2.VirtualNetwork
+ properties:
+ network_name:
+ get_input: contrail_net_name
+ test_net:
+ type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
+ properties:
+ shared: true
+ network_name:
+ get_input: jsa_net_name
+ test_nova:
+ type: org.openecomp.resource.vfc.nodes.heat.jsa
+ properties:
+ image: image
+ name:
+ get_input: jsa_name
+ test_nested:
+ type: org.openecomp.resource.abstract.nodes.heat.nested
+ directives:
+ - substitutable
+ properties:
+ p1: test_net
+ service_template_filter:
+ substitute_service_template: nestedServiceTemplate.yaml
+ p2:
+ get_attribute:
+ - test_contrailV2_net
+ - fq_name
+ requirements:
+ - link_cmaui_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: test_contrailV2_net
+ relationship: tosca.relationships.network.LinksTo
+ - link_cmaui_port_0:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net
+ relationship: tosca.relationships.network.LinksTo
+ groups:
+ main:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/main.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - test_nestedInvalidConnectionToNetwork
+ - test_contrailV2_net
+ - test_net
+ - test_nova
+ - test_nested \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/expectedoutputfiles/nestedServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/expectedoutputfiles/nestedServiceTemplate.yaml
new file mode 100644
index 0000000000..12cfaca893
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/expectedoutputfiles/nestedServiceTemplate.yaml
@@ -0,0 +1,203 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cmaui:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p1:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ p2:
+ hidden: false
+ immutable: false
+ type: string
+ p3:
+ hidden: false
+ immutable: false
+ type: string
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ hidden: false
+ immutable: false
+ type: string
+ node_templates:
+ cmaui_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: p3
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ server_cmaui:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ cmaui_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: p2
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ cmaui_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: p1
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ nested:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested.yml
+ description: cmaui server template for vMMSC
+ members:
+ - cmaui_port_2
+ - server_cmaui
+ - cmaui_port_1
+ - cmaui_port_0
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested
+ capabilities:
+ host_server_cmaui:
+ - server_cmaui
+ - host
+ os_server_cmaui:
+ - server_cmaui
+ - os
+ endpoint_server_cmaui:
+ - server_cmaui
+ - endpoint
+ binding_server_cmaui:
+ - server_cmaui
+ - binding
+ attachment_cmaui_port_2:
+ - cmaui_port_2
+ - attachment
+ scalable_server_cmaui:
+ - server_cmaui
+ - scalable
+ attachment_cmaui_port_0:
+ - cmaui_port_0
+ - attachment
+ attachment_cmaui_port_1:
+ - cmaui_port_1
+ - attachment
+ requirements:
+ local_storage_server_cmaui:
+ - server_cmaui
+ - local_storage
+ link_cmaui_port_0:
+ - cmaui_port_0
+ - link
+ link_cmaui_port_2:
+ - cmaui_port_2
+ - link
+ link_cmaui_port_1:
+ - cmaui_port_1
+ - link \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..aca75b5055
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/inputfiles/MANIFEST.json
@@ -0,0 +1,17 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "main.yml",
+ "type": "HEAT",
+ "isBase": "true"
+ },
+ {
+ "file": "nested.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/inputfiles/main.yml
new file mode 100644
index 0000000000..3d23ff660a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/inputfiles/main.yml
@@ -0,0 +1,42 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ jsa_net_name:
+ type: string
+ description: network name of jsa log network
+ contrail_net_name:
+ type: string
+ jsa_name:
+ type: string
+
+resources:
+ test_nova:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: jsa_name}
+ image: image
+
+ test_net:
+ type: OS::Neutron::Net
+ properties:
+ name: {get_param: jsa_net_name}
+ shared: True
+
+ test_contrailV2_net:
+ type: OS::ContrailV2::VirtualNetwork
+ properties:
+ name: { get_param: contrail_net_name }
+
+ test_nested:
+ type: nested.yml
+ properties:
+ p1: { get_resource: test_net}
+ p2: { get_attr: [ test_contrailV2_net, fq_name ] }
+
+ test_nestedInvalidConnectionToNetwork:
+ type: nested.yml
+ properties:
+ p1: { get_resource: test_nova} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/inputfiles/nested.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/inputfiles/nested.yml
new file mode 100644
index 0000000000..fb2c8e12e5
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/inputfiles/nested.yml
@@ -0,0 +1,67 @@
+heat_template_version: 2013-05-23
+
+description: cmaui server template for vMMSC
+
+parameters:
+ p1:
+ type: string
+ description: UID of OAM network
+ p2:
+ type: string
+ p3:
+ type: string
+ security_group_name:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_oam_ips:
+ type: string
+resources:
+
+ cmaui_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: p1 }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ cmaui_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: p2 }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ cmaui_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: p3 }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_cmaui:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_0 }
+ - port: { get_resource: cmaui_port_1 }
+ - port: { get_resource: cmaui_port_2 } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..edb1307945
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
@@ -0,0 +1,251 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: GlobalSubstitutionTypes
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.abstract.nodes.heat.nested1:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ cmaui_names:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ shared_network_id1:
+ type: string
+ description: UID of OAM network
+ p2:
+ type: string
+ description: UID of OAM network
+ abc_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ abc_names:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ security_group_name:
+ description: not impotrtant
+ availability_zone_0:
+ type: string
+ description: availabilityzone name
+ abc_oam_ips:
+ type: string
+ cmaui_oam_ips:
+ type: string
+ abc_image:
+ type: string
+ description: Image for CMAUI server
+ requirements:
+ - link_cmaui_port_2:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - local_storage_server_cmaui:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - local_storage_server_abc:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - link_abc_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_cmaui_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ capabilities:
+ scalable_server_abc:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_cmaui:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_abc_port_1:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_server_cmaui:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_server_abc:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_abc:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_server_cmaui:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_abc:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_cmaui:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_cmaui:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_abc:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_2:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_1:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ org.openecomp.resource.abstract.nodes.heat.nested2:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ cmaui_names:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p1:
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ security_group_name:
+ description: not impotrtant
+ availability_zone_0:
+ type: string
+ description: availabilityzone name
+ abc_oam_ips:
+ type: string
+ cmaui_oam_ips:
+ type: string
+ requirements:
+ - local_storage_server_cmaui:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - link_cmaui_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ capabilities:
+ host_server_cmaui:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_cmaui:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_cmaui:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_cmaui:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_server_cmaui:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_1:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..a762422392
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,172 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.jsa:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ shared_test_nova:
+ hidden: false
+ immutable: false
+ type: string
+ shared_network_id1:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ shared_network_id2:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ jsa_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ jsa_name:
+ hidden: false
+ immutable: false
+ type: string
+ node_templates:
+ test_nestedInvalidConnectionToNetwork:
+ type: org.openecomp.resource.abstract.nodes.heat.nested1
+ directives:
+ - substitutable
+ properties:
+ service_template_filter:
+ substitute_service_template: nested1ServiceTemplate.yaml
+ shared_network_id1:
+ get_input: shared_test_nova
+ test_net2:
+ type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
+ properties:
+ shared: true
+ network_name:
+ get_input: jsa_net_name
+ test_nested2:
+ type: org.openecomp.resource.abstract.nodes.heat.nested2
+ directives:
+ - substitutable
+ properties:
+ p1:
+ get_input: shared_network_id1
+ service_template_filter:
+ substitute_service_template: nested2ServiceTemplate.yaml
+ requirements:
+ - link_cmaui_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net1
+ relationship: tosca.relationships.network.LinksTo
+ test_nested3:
+ type: org.openecomp.resource.abstract.nodes.heat.nested1
+ directives:
+ - substitutable
+ properties:
+ service_template_filter:
+ substitute_service_template: nested1ServiceTemplate.yaml
+ shared_network_id1:
+ get_input: shared_network_id1
+ p2:
+ get_input: shared_network_id2
+ requirements:
+ - link_cmaui_port_2:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net2
+ relationship: tosca.relationships.network.LinksTo
+ - link_abc_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net2
+ relationship: tosca.relationships.network.LinksTo
+ - link_cmaui_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net1
+ relationship: tosca.relationships.network.LinksTo
+ test_net1:
+ type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
+ properties:
+ shared: true
+ network_name:
+ get_input: jsa_net_name
+ test_nested1:
+ type: org.openecomp.resource.abstract.nodes.heat.nested1
+ directives:
+ - substitutable
+ properties:
+ service_template_filter:
+ substitute_service_template: nested1ServiceTemplate.yaml
+ shared_network_id1:
+ get_input: shared_network_id1
+ p2:
+ get_input: shared_network_id2
+ requirements:
+ - link_cmaui_port_2:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net2
+ relationship: tosca.relationships.network.LinksTo
+ - link_abc_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net2
+ relationship: tosca.relationships.network.LinksTo
+ - link_cmaui_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net1
+ relationship: tosca.relationships.network.LinksTo
+ test_nova:
+ type: org.openecomp.resource.vfc.nodes.heat.jsa
+ properties:
+ image: image
+ name:
+ get_input: jsa_name
+ groups:
+ addOn:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/addOn.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - test_nestedInvalidConnectionToNetwork
+ - test_nested2
+ - test_nested3
+ - test_nested1
+ main:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/main.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - test_net2
+ - test_net1
+ - test_nova \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/expectedoutputfiles/nested1ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/expectedoutputfiles/nested1ServiceTemplate.yaml
new file mode 100644
index 0000000000..2096251177
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/expectedoutputfiles/nested1ServiceTemplate.yaml
@@ -0,0 +1,252 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested1
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.abc:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.cmaui:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ shared_network_id1:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ p2:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ abc_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ abc_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ security_group_name:
+ hidden: false
+ immutable: false
+ description: not impotrtant
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ abc_oam_ips:
+ hidden: false
+ immutable: false
+ type: string
+ cmaui_oam_ips:
+ hidden: false
+ immutable: false
+ type: string
+ abc_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ node_templates:
+ cmaui_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: p2
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ server_cmaui:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ server_abc:
+ type: org.openecomp.resource.vfc.nodes.heat.abc
+ properties:
+ flavor:
+ get_input: abc_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: abc_image
+ name:
+ get_input:
+ - abc_names
+ - 0
+ abc_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - abc_oam_ips
+ - 0
+ network:
+ get_input: p2
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_abc
+ relationship: tosca.relationships.network.BindsTo
+ cmaui_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: shared_network_id1
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ nested1:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested1.yml
+ description: cmaui server template for vMMSC
+ members:
+ - cmaui_port_2
+ - server_cmaui
+ - server_abc
+ - abc_port_1
+ - cmaui_port_1
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested1
+ capabilities:
+ scalable_server_abc:
+ - server_abc
+ - scalable
+ os_server_cmaui:
+ - server_cmaui
+ - os
+ attachment_abc_port_1:
+ - abc_port_1
+ - attachment
+ scalable_server_cmaui:
+ - server_cmaui
+ - scalable
+ host_server_abc:
+ - server_abc
+ - host
+ os_server_abc:
+ - server_abc
+ - os
+ host_server_cmaui:
+ - server_cmaui
+ - host
+ binding_server_abc:
+ - server_abc
+ - binding
+ endpoint_server_cmaui:
+ - server_cmaui
+ - endpoint
+ binding_server_cmaui:
+ - server_cmaui
+ - binding
+ endpoint_server_abc:
+ - server_abc
+ - endpoint
+ attachment_cmaui_port_2:
+ - cmaui_port_2
+ - attachment
+ attachment_cmaui_port_1:
+ - cmaui_port_1
+ - attachment
+ requirements:
+ local_storage_server_cmaui:
+ - server_cmaui
+ - local_storage
+ link_abc_port_1:
+ - abc_port_1
+ - link
+ link_cmaui_port_2:
+ - cmaui_port_2
+ - link
+ link_cmaui_port_1:
+ - cmaui_port_1
+ - link
+ local_storage_server_abc:
+ - server_abc
+ - local_storage \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/expectedoutputfiles/nested2ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/expectedoutputfiles/nested2ServiceTemplate.yaml
new file mode 100644
index 0000000000..992e1c017c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/expectedoutputfiles/nested2ServiceTemplate.yaml
@@ -0,0 +1,146 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested2
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cmaui:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p1:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ security_group_name:
+ hidden: false
+ immutable: false
+ description: not impotrtant
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ abc_oam_ips:
+ hidden: false
+ immutable: false
+ type: string
+ cmaui_oam_ips:
+ hidden: false
+ immutable: false
+ type: string
+ node_templates:
+ server_cmaui:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ cmaui_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: p1
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ nested2:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested2.yml
+ description: cmaui server template for vMMSC
+ members:
+ - server_cmaui
+ - cmaui_port_1
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested2
+ capabilities:
+ host_server_cmaui:
+ - server_cmaui
+ - host
+ os_server_cmaui:
+ - server_cmaui
+ - os
+ endpoint_server_cmaui:
+ - server_cmaui
+ - endpoint
+ binding_server_cmaui:
+ - server_cmaui
+ - binding
+ scalable_server_cmaui:
+ - server_cmaui
+ - scalable
+ attachment_cmaui_port_1:
+ - cmaui_port_1
+ - attachment
+ requirements:
+ local_storage_server_cmaui:
+ - server_cmaui
+ - local_storage
+ link_cmaui_port_1:
+ - cmaui_port_1
+ - link \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..e593097c44
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/inputfiles/MANIFEST.json
@@ -0,0 +1,27 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "main.yml",
+ "type": "HEAT",
+ "isBase": "true"
+ },
+ {
+ "file": "nested1.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ },
+ {
+ "file": "nested2.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ },
+ {
+ "file": "addOn.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/inputfiles/addOn.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/inputfiles/addOn.yml
new file mode 100644
index 0000000000..ca1cf7d31d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/inputfiles/addOn.yml
@@ -0,0 +1,38 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ shared_network_id1:
+ type: string
+ description: network name of jsa log network
+
+ shared_network_id2:
+ type: string
+ description: network name of jsa log network
+ shared_test_nova:
+ type: string
+resources:
+
+ test_nested1:
+ type: nested1.yml
+ properties:
+ shared_network_id1: { get_param: shared_network_id1}
+ p2: { get_param: shared_network_id2}
+
+ test_nested2:
+ type: nested2.yml
+ properties:
+ p1: { get_param: shared_network_id1}
+
+ test_nested3:
+ type: nested1.yml
+ properties:
+ shared_network_id1: { get_param: shared_network_id1}
+ p2: { get_param: shared_network_id2}
+
+ test_nestedInvalidConnectionToNetwork:
+ type: nested1.yml
+ properties:
+ shared_network_id1: { get_param: shared_test_nova} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/inputfiles/main.yml
new file mode 100644
index 0000000000..3c015747ff
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/inputfiles/main.yml
@@ -0,0 +1,39 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ jsa_net_name:
+ type: string
+ description: network name of jsa log network
+
+ jsa_name:
+ type: string
+
+resources:
+ test_net1:
+ type: OS::Neutron::Net
+ properties:
+ name: {get_param: jsa_net_name}
+ shared: True
+
+ test_net2:
+ type: OS::Neutron::Net
+ properties:
+ name: {get_param: jsa_net_name}
+ shared: True
+
+ test_nova:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: jsa_name}
+ image: image
+
+outputs:
+ shared_network_id1:
+ value: {get_resource: test_net1}
+ shared_network_id2:
+ value: {get_resource: test_net2}
+ shared_test_nova:
+ value: {get_resource: test_nova} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/inputfiles/nested1.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/inputfiles/nested1.yml
new file mode 100644
index 0000000000..9ad6c61f17
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/inputfiles/nested1.yml
@@ -0,0 +1,86 @@
+heat_template_version: 2013-05-23
+
+description: cmaui server template for vMMSC
+
+parameters:
+ shared_network_id1:
+ type: string
+ description: UID of OAM network
+ p2:
+ type: string
+ description: UID of OAM network
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ abc_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ security_group_name:
+ type: not_important
+ description: not impotrtant
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ abc_image:
+ type: string
+ description: Image for CMAUI server
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ abc_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_oam_ips:
+ type: string
+ abc_oam_ips:
+ type: string
+resources:
+
+ cmaui_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: shared_network_id1 }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ cmaui_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: p2 }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ abc_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: p2 }
+ fixed_ips: [{"ip_address": {get_param: [abc_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_cmaui:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_1 }
+ - port: { get_resource: cmaui_port_2 }
+
+ server_abc:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [abc_names, 0]}
+ image: { get_param: abc_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: abc_flavor }
+ networks:
+ - port: { get_resource: abc_port_1 } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/inputfiles/nested2.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/inputfiles/nested2.yml
new file mode 100644
index 0000000000..b09d3aff8e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/inputfiles/nested2.yml
@@ -0,0 +1,48 @@
+heat_template_version: 2013-05-23
+
+description: cmaui server template for vMMSC
+
+parameters:
+ p1:
+ type: string
+ description: UID of OAM network
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ security_group_name:
+ type: not_important
+ description: not impotrtant
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_oam_ips:
+ type: string
+ abc_oam_ips:
+ type: string
+
+resources:
+
+ cmaui_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: p1 }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_cmaui:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_1 } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..44aca0ee4d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
@@ -0,0 +1,106 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: GlobalSubstitutionTypes
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.abstract.nodes.heat.nested:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ cmaui_names:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p1:
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ security_group_name:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ availability_zone_0:
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ type: string
+ requirements:
+ - local_storage_server_cmaui:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - link_cmaui_port_0:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ capabilities:
+ host_server_cmaui:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_cmaui:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_cmaui:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_cmaui:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_server_cmaui:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_0:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..c364c62d6d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,85 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ jsa_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ node_templates:
+ mvs_modules:
+ type: org.openecomp.resource.abstract.nodes.heat.nested
+ directives:
+ - substitutable
+ properties:
+ p1: test_net
+ service_template_filter:
+ substitute_service_template: nestedServiceTemplate.yaml
+ count: 3
+ mandatory: true
+ requirements:
+ - link_cmaui_port_0:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net
+ relationship: tosca.relationships.network.LinksTo
+ test_net:
+ type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
+ properties:
+ shared: true
+ network_name:
+ get_input: jsa_net_name
+ test_nested:
+ type: org.openecomp.resource.abstract.nodes.heat.nested
+ directives:
+ - substitutable
+ properties:
+ p1: test_net
+ service_template_filter:
+ substitute_service_template: nestedServiceTemplate.yaml
+ requirements:
+ - link_cmaui_port_0:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net
+ relationship: tosca.relationships.network.LinksTo
+ groups:
+ main:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/main.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - mvs_modules
+ - test_net
+ - test_nested \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/expectedoutputfiles/nestedServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/expectedoutputfiles/nestedServiceTemplate.yaml
new file mode 100644
index 0000000000..cfe7f567c5
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/expectedoutputfiles/nestedServiceTemplate.yaml
@@ -0,0 +1,145 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cmaui:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p1:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ security_group_name:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ hidden: false
+ immutable: false
+ type: string
+ node_templates:
+ server_cmaui:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ cmaui_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: p1
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ nested:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested.yml
+ description: cmaui server template for vMMSC
+ members:
+ - server_cmaui
+ - cmaui_port_0
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested
+ capabilities:
+ host_server_cmaui:
+ - server_cmaui
+ - host
+ os_server_cmaui:
+ - server_cmaui
+ - os
+ endpoint_server_cmaui:
+ - server_cmaui
+ - endpoint
+ binding_server_cmaui:
+ - server_cmaui
+ - binding
+ scalable_server_cmaui:
+ - server_cmaui
+ - scalable
+ attachment_cmaui_port_0:
+ - cmaui_port_0
+ - attachment
+ requirements:
+ local_storage_server_cmaui:
+ - server_cmaui
+ - local_storage
+ link_cmaui_port_0:
+ - cmaui_port_0
+ - link \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..aca75b5055
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/inputfiles/MANIFEST.json
@@ -0,0 +1,17 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "main.yml",
+ "type": "HEAT",
+ "isBase": "true"
+ },
+ {
+ "file": "nested.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/inputfiles/main.yml
new file mode 100644
index 0000000000..eaedecd792
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/inputfiles/main.yml
@@ -0,0 +1,31 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ jsa_net_name:
+ type: string
+ description: network name of jsa log network
+
+resources:
+ test_net:
+ type: OS::Neutron::Net
+ properties:
+ name: {get_param: jsa_net_name}
+ shared: True
+
+ test_nested:
+ type: nested.yml
+ properties:
+ p1: { get_resource: test_net}
+
+ mvs_modules:
+ type: OS::Heat::ResourceGroup
+ properties:
+ count: 3
+ index_var: "%index%"
+ resource_def:
+ type: nested.yml
+ properties:
+ p1: { get_resource: test_net} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/inputfiles/nested.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/inputfiles/nested.yml
new file mode 100644
index 0000000000..56a099500b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/inputfiles/nested.yml
@@ -0,0 +1,45 @@
+heat_template_version: 2013-05-23
+
+description: cmaui server template for vMMSC
+
+parameters:
+ p1:
+ type: string
+ description: UID of OAM network
+ security_group_name:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_oam_ips:
+ type: string
+resources:
+
+ cmaui_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: p1 }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_cmaui:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_0 } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..8744a29bc3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
@@ -0,0 +1,177 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: GlobalSubstitutionTypes
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.abstract.nodes.heat.nested1:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ cmaui_names:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p1:
+ type: string
+ description: UID of OAM network
+ p2:
+ type: string
+ description: UID of OAM network
+ abc_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ abc_names:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ security_group_name:
+ description: not impotrtant
+ availability_zone_0:
+ type: string
+ description: availabilityzone name
+ abc_oam_ips:
+ type: string
+ cmaui_oam_ips:
+ type: string
+ abc_image:
+ type: string
+ description: Image for CMAUI server
+ requirements:
+ - link_cmaui_port_2:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - local_storage_server_cmaui:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - local_storage_server_abc:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - link_abc_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - link_cmaui_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ capabilities:
+ scalable_server_abc:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_cmaui:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_abc_port_1:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_server_cmaui:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_server_abc:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_abc:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host_server_cmaui:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_abc:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_cmaui:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_cmaui:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_abc:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_2:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_1:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..5a6dfd9376
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,131 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ shared_network_id1:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ shared_network_id2:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ jsa_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ node_templates:
+ mvs_modules:
+ type: org.openecomp.resource.abstract.nodes.heat.nested1
+ directives:
+ - substitutable
+ properties:
+ p1:
+ get_input: shared_network_id1
+ service_template_filter:
+ substitute_service_template: nested1ServiceTemplate.yaml
+ count: 3
+ mandatory: true
+ p2:
+ get_input: shared_network_id2
+ requirements:
+ - link_cmaui_port_2:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net2
+ relationship: tosca.relationships.network.LinksTo
+ - link_abc_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net2
+ relationship: tosca.relationships.network.LinksTo
+ - link_cmaui_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net1
+ relationship: tosca.relationships.network.LinksTo
+ test_net2:
+ type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
+ properties:
+ shared: true
+ network_name:
+ get_input: jsa_net_name
+ test_net1:
+ type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
+ properties:
+ shared: true
+ network_name:
+ get_input: jsa_net_name
+ test_nested1:
+ type: org.openecomp.resource.abstract.nodes.heat.nested1
+ directives:
+ - substitutable
+ properties:
+ p1:
+ get_input: shared_network_id1
+ service_template_filter:
+ substitute_service_template: nested1ServiceTemplate.yaml
+ p2:
+ get_input: shared_network_id2
+ requirements:
+ - link_cmaui_port_2:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net2
+ relationship: tosca.relationships.network.LinksTo
+ - link_abc_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net2
+ relationship: tosca.relationships.network.LinksTo
+ - link_cmaui_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net1
+ relationship: tosca.relationships.network.LinksTo
+ groups:
+ addOn:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/addOn.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - mvs_modules
+ - test_nested1
+ main:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/main.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - test_net2
+ - test_net1 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/expectedoutputfiles/nested1ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/expectedoutputfiles/nested1ServiceTemplate.yaml
new file mode 100644
index 0000000000..cd5b767492
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/expectedoutputfiles/nested1ServiceTemplate.yaml
@@ -0,0 +1,252 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested1
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.abc:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.cmaui:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p1:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ p2:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ abc_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ abc_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ security_group_name:
+ hidden: false
+ immutable: false
+ description: not impotrtant
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ abc_oam_ips:
+ hidden: false
+ immutable: false
+ type: string
+ cmaui_oam_ips:
+ hidden: false
+ immutable: false
+ type: string
+ abc_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ node_templates:
+ cmaui_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: p2
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ server_cmaui:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ server_abc:
+ type: org.openecomp.resource.vfc.nodes.heat.abc
+ properties:
+ flavor:
+ get_input: abc_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: abc_image
+ name:
+ get_input:
+ - abc_names
+ - 0
+ abc_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - abc_oam_ips
+ - 0
+ network:
+ get_input: p2
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_abc
+ relationship: tosca.relationships.network.BindsTo
+ cmaui_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: p1
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ nested1:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested1.yml
+ description: cmaui server template for vMMSC
+ members:
+ - cmaui_port_2
+ - server_cmaui
+ - server_abc
+ - abc_port_1
+ - cmaui_port_1
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested1
+ capabilities:
+ scalable_server_abc:
+ - server_abc
+ - scalable
+ os_server_cmaui:
+ - server_cmaui
+ - os
+ attachment_abc_port_1:
+ - abc_port_1
+ - attachment
+ scalable_server_cmaui:
+ - server_cmaui
+ - scalable
+ host_server_abc:
+ - server_abc
+ - host
+ os_server_abc:
+ - server_abc
+ - os
+ host_server_cmaui:
+ - server_cmaui
+ - host
+ binding_server_abc:
+ - server_abc
+ - binding
+ endpoint_server_cmaui:
+ - server_cmaui
+ - endpoint
+ binding_server_cmaui:
+ - server_cmaui
+ - binding
+ endpoint_server_abc:
+ - server_abc
+ - endpoint
+ attachment_cmaui_port_2:
+ - cmaui_port_2
+ - attachment
+ attachment_cmaui_port_1:
+ - cmaui_port_1
+ - attachment
+ requirements:
+ local_storage_server_cmaui:
+ - server_cmaui
+ - local_storage
+ link_abc_port_1:
+ - abc_port_1
+ - link
+ link_cmaui_port_2:
+ - cmaui_port_2
+ - link
+ link_cmaui_port_1:
+ - cmaui_port_1
+ - link
+ local_storage_server_abc:
+ - server_abc
+ - local_storage \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..4f3d9058b2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/inputfiles/MANIFEST.json
@@ -0,0 +1,22 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "main.yml",
+ "type": "HEAT",
+ "isBase": "true"
+ },
+ {
+ "file": "nested1.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ },
+ {
+ "file": "addOn.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/inputfiles/addOn.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/inputfiles/addOn.yml
new file mode 100644
index 0000000000..10e477919f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/inputfiles/addOn.yml
@@ -0,0 +1,32 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ shared_network_id1:
+ type: string
+ description: network name of jsa log network
+
+ shared_network_id2:
+ type: string
+ description: network name of jsa log network
+
+resources:
+
+ test_nested1:
+ type: nested1.yml
+ properties:
+ p1: { get_param: shared_network_id1}
+ p2: { get_param: shared_network_id2}
+
+ mvs_modules:
+ type: OS::Heat::ResourceGroup
+ properties:
+ count: 3
+ index_var: "%index%"
+ resource_def:
+ type: nested1.yml
+ properties:
+ p1: { get_param: shared_network_id1}
+ p2: { get_param: shared_network_id2} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/inputfiles/main.yml
new file mode 100644
index 0000000000..9601c0f86d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/inputfiles/main.yml
@@ -0,0 +1,29 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ jsa_net_name:
+ type: string
+ description: network name of jsa log network
+
+resources:
+ test_net1:
+ type: OS::Neutron::Net
+ properties:
+ name: {get_param: jsa_net_name}
+ shared: True
+
+ test_net2:
+ type: OS::Neutron::Net
+ properties:
+ name: {get_param: jsa_net_name}
+ shared: True
+
+outputs:
+ shared_network_id1:
+ value: {get_resource: test_net1}
+
+ shared_network_id2:
+ value: {get_resource: test_net2} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/inputfiles/nested1.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/inputfiles/nested1.yml
new file mode 100644
index 0000000000..f46cf21121
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/inputfiles/nested1.yml
@@ -0,0 +1,86 @@
+heat_template_version: 2013-05-23
+
+description: cmaui server template for vMMSC
+
+parameters:
+ p1:
+ type: string
+ description: UID of OAM network
+ p2:
+ type: string
+ description: UID of OAM network
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ abc_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ security_group_name:
+ type: not_important
+ description: not impotrtant
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ abc_image:
+ type: string
+ description: Image for CMAUI server
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ abc_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_oam_ips:
+ type: string
+ abc_oam_ips:
+ type: string
+resources:
+
+ cmaui_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: p1 }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ cmaui_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: p2 }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ abc_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: p2 }
+ fixed_ips: [{"ip_address": {get_param: [abc_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ server_cmaui:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_1 }
+ - port: { get_resource: cmaui_port_2 }
+
+ server_abc:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [abc_names, 0]}
+ image: { get_param: abc_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: abc_flavor }
+ networks:
+ - port: { get_resource: abc_port_1 } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..c253158ad4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,634 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.smp:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ hostid_fe1:
+ hidden: false
+ immutable: false
+ type: string
+ description: FE1 Hostid (from Ulticom license)
+ ip_address_stp2:
+ hidden: false
+ immutable: false
+ type: string
+ description: STP2 IP address
+ Mobility_OAM_protected_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Network name for OAM
+ hostid_fe2:
+ hidden: false
+ immutable: false
+ type: string
+ description: FE2 Hostid (from Ulticom license)
+ flavor_scp_fe_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: SCP FE Flavor
+ default: a1.Small
+ ip_address_stp1:
+ hidden: false
+ immutable: false
+ type: string
+ description: STP1 IP address
+ int_vscp_ce_network_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Inter-CE Network
+ int_vscp_ce_network_cidr:
+ hidden: false
+ immutable: false
+ type: string
+ description: Private Network Address (CIDR notation)
+ cluster_type:
+ hidden: false
+ immutable: false
+ type: string
+ constraints:
+ - valid_values:
+ - Test
+ - Prod
+ be_Mobility_OAM_protected_ip_1:
+ label: be_1 OAM ip address
+ hidden: false
+ immutable: false
+ type: string
+ description: be_1 OAM ip address
+ be_Mobility_OAM_protected_ip_2:
+ label: be_2 OAM ip address
+ hidden: false
+ immutable: false
+ type: string
+ description: be_2 OAM ip address
+ be_Mobility_OAM_protected_ip_0:
+ label: be_0 OAM ip address
+ hidden: false
+ immutable: false
+ type: string
+ description: be_0 OAM ip address
+ ip_address_dra:
+ hidden: false
+ immutable: false
+ type: string
+ description: DRA VIP address
+ image_smp_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: SCP SMP image
+ default: asc_base_image_smp
+ fe_connectivity:
+ hidden: false
+ immutable: false
+ type: string
+ constraints:
+ - valid_values:
+ - NEE
+ - STP
+ lab_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Lab name
+ smp_Mobility_OAM_protected_ip_1:
+ label: smp_1 OAM ip address
+ hidden: false
+ immutable: false
+ type: string
+ description: smp_1 OAM ip address
+ fe_SIGNET_vrf_B1_direct_ip_0:
+ label: fe1 SIGTRAN ip address
+ hidden: false
+ immutable: false
+ type: string
+ description: fe1 SIGTRAN ip address
+ smp_Mobility_OAM_protected_ip_0:
+ label: smp_0 OAM ip address
+ hidden: false
+ immutable: false
+ type: string
+ description: smp_0 OAM ip address
+ int_vscp_cluster_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: LAN3 Cluster
+ be_Mobility_OAM_protected_ip_3:
+ label: be_3 OAM ip address
+ hidden: false
+ immutable: false
+ type: string
+ description: be_3 OAM ip address
+ be_Mobility_OAM_protected_ip_4:
+ label: be_4 OAM ip address
+ hidden: false
+ immutable: false
+ type: string
+ description: be_4 OAM ip address
+ hostname_nee1:
+ hidden: false
+ immutable: false
+ type: string
+ description: NEE1 Hostname (from Ulticom license)
+ int_vscp_fe_cluster_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: LAN2 FE Cluster/KA
+ SIGNET_vrf_A1_direct_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Network name for SIGTRAN_A
+ key_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: keypair to enable SSH access to the instance.
+ default: vSCP-keypair
+ int_vscp_fe_cluster_cidr:
+ hidden: false
+ immutable: false
+ type: string
+ description: Private Network2 Address (CIDR notation)
+ fe_name_1:
+ hidden: false
+ immutable: false
+ type: string
+ description: name of VM
+ default: vSCP_FE2
+ fe_name_0:
+ hidden: false
+ immutable: false
+ type: string
+ description: name of VM
+ default: vSCP_FE1
+ be_name_0:
+ hidden: false
+ immutable: false
+ type: string
+ description: name of VM
+ default: vSCP_BE1
+ int_vscp_cluster_cidr:
+ hidden: false
+ immutable: false
+ type: string
+ description: Private Network3 Address (CIDR notation)
+ be_name_1:
+ hidden: false
+ immutable: false
+ type: string
+ description: name of VM
+ default: vSCP_BE2
+ be_name_2:
+ hidden: false
+ immutable: false
+ type: string
+ description: name of VM
+ default: vSCP_BE3
+ point_code_stp:
+ hidden: false
+ immutable: false
+ type: string
+ description: STP virtual point code (in "zone-cluster-member" format)
+ be_name_3:
+ hidden: false
+ immutable: false
+ type: string
+ description: name of VM
+ default: vSCP_BE4
+ be_name_4:
+ hidden: false
+ immutable: false
+ type: string
+ description: name of VM
+ default: vSCP_BE5
+ global_title_scp:
+ hidden: false
+ immutable: false
+ type: string
+ description: vSCP Global Title address
+ vnf_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique name for this VNF instance
+ default: This_is_the_SCP_name
+ be_Cricket_OCS_protected_ip_2:
+ label: be3 Cricket_OCS ip address
+ hidden: false
+ immutable: false
+ type: string
+ description: be3 Cricket_OCS ip address
+ fe_Mobility_OAM_protected_ip_0:
+ label: fe_0 OAM ip address
+ hidden: false
+ immutable: false
+ type: string
+ description: fe_0 OAM ip address
+ hostname_fe1:
+ hidden: false
+ immutable: false
+ type: string
+ description: FE1 Hostname (from Ulticom license)
+ be_Cricket_OCS_protected_ip_1:
+ label: be2 Cricket_OCS ip address
+ hidden: false
+ immutable: false
+ type: string
+ description: be2 Cricket_OCS ip address
+ hostname_fe2:
+ hidden: false
+ immutable: false
+ type: string
+ description: FE2 Hostname (from Ulticom license)
+ be_Cricket_OCS_protected_ip_4:
+ label: be5 Cricket_OCS ip address
+ hidden: false
+ immutable: false
+ type: string
+ description: be5 Cricket_OCS ip address
+ be_Cricket_OCS_protected_ip_3:
+ label: be4 Cricket_OCS ip address
+ hidden: false
+ immutable: false
+ type: string
+ description: be4 Cricket_OCS ip address
+ fe_Mobility_OAM_protected_ip_1:
+ label: fe_1 OAM ip address
+ hidden: false
+ immutable: false
+ type: string
+ description: fe_1 OAM ip address
+ be_Cricket_OCS_protected_ip_0:
+ label: be1 Cricket_OCS ip address
+ hidden: false
+ immutable: false
+ type: string
+ description: be1 Cricket_OCS ip address
+ route_table_fe1:
+ hidden: false
+ immutable: false
+ type: string
+ description: Additional route table for FE1
+ Cricket_OCS_protected_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Network name for CRICKET_OCS
+ smp_name_2:
+ hidden: false
+ immutable: false
+ type: string
+ description: name of VM
+ default: vSMP2
+ vnf_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_SCP_id
+ smp_name_1:
+ hidden: false
+ immutable: false
+ type: string
+ description: name of VM
+ default: vSMP2
+ flavor_smp_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: SCP SMP Flavor
+ default: a1.Small
+ image_scp_be_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: SCP BE image
+ default: asc_base_image_be
+ smp_name_0:
+ hidden: false
+ immutable: false
+ type: string
+ description: name of VM
+ default: vSMP1
+ route_table_fe2:
+ hidden: false
+ immutable: false
+ type: string
+ description: Additional route table for FE2
+ hostid_nee1:
+ hidden: false
+ immutable: false
+ type: string
+ description: NEE1 Hostid (from Ulticom license)
+ SIGNET_vrf_B1_direct_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Network name for SIGTRAN_B
+ fe_SIGNET_vrf_A1_direct_ip_0:
+ label: fe2 SIGTRAN ip address
+ hidden: false
+ immutable: false
+ type: string
+ description: fe2 SIGTRAN ip address
+ availability_zone_0:
+ hidden: false
+ immutable: false
+ type: string
+ nee_name_0:
+ hidden: false
+ immutable: false
+ type: string
+ description: name of VM
+ default: vNEE
+ fe_smp_affinity_param:
+ hidden: false
+ immutable: false
+ type: string
+ description: be affinity param
+ ip_port_stp1:
+ hidden: false
+ immutable: false
+ type: string
+ description: STP1 IP port
+ ip_port_stp2:
+ hidden: false
+ immutable: false
+ type: string
+ description: STP2 IP port
+ image_scp_fe_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: SCP FE image
+ default: asc_base_image_fe
+ flavor_scp_be_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: SCP BE Flavor
+ default: a1.Small
+ security_group_name:
+ label: vSCP security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: vSCP security group name
+ ip_port_fe2:
+ hidden: false
+ immutable: false
+ type: string
+ description: FE2 IP port in SIGTRAN network
+ route_table_be:
+ hidden: false
+ immutable: false
+ type: string
+ description: Additional route table for BEs
+ ip_port_fe1:
+ hidden: false
+ immutable: false
+ type: string
+ description: FE1 IP port in SIGTRAN network
+ port_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: port name
+ default: port_name
+ be_affinity_param:
+ hidden: false
+ immutable: false
+ type: string
+ description: be affinity param
+ point_code_scp:
+ hidden: false
+ immutable: false
+ type: string
+ description: vSCP point code (in "zone-cluster-member" format)
+ global_title_stp:
+ hidden: false
+ immutable: false
+ type: string
+ description: STP Global Title address
+ point_code_stp1:
+ hidden: false
+ immutable: false
+ type: string
+ description: STP1 point code (in "zone-cluster-member" format)
+ point_code_stp2:
+ hidden: false
+ immutable: false
+ type: string
+ description: STP2 point code (in "zone-cluster-member" format)
+ multi_anti_affinity_param:
+ hidden: false
+ immutable: false
+ type: string
+ description: be affinity param
+ node_templates:
+ server_smp2:
+ type: org.openecomp.resource.vfc.nodes.heat.smp
+ properties:
+ flavor:
+ get_input: flavor_smp_name
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: image_smp_name
+ metadata:
+ jx_vm_role: smp2
+ vnf_id:
+ get_input: vnf_id
+ jx_lab_name:
+ get_input: lab_name
+ user_data_format: RAW
+ name:
+ get_input: smp_name_2
+ scheduler_hints:
+ group:
+ get_input: fe_smp_affinity_param
+ server_smp3:
+ type: org.openecomp.resource.vfc.nodes.heat.smp
+ properties:
+ flavor:
+ get_input: flavor_smp_name
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: image_smp_name
+ metadata:
+ jx_vm_role: smp2
+ vnf_id:
+ get_input: vnf_id
+ jx_lab_name:
+ get_input: lab_name
+ user_data_format: RAW
+ name:
+ get_input: smp_name_2
+ scheduler_hints:
+ group2:
+ get_input: multi_anti_affinity_param
+ group1:
+ get_input: fe_smp_affinity_param
+ port3:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ network:
+ get_input: port_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_smp3
+ relationship: tosca.relationships.network.BindsTo
+ port4:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ network:
+ get_input: port_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_smp3
+ relationship: tosca.relationships.network.BindsTo
+ port1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ network:
+ get_input: port_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_smp1
+ relationship: tosca.relationships.network.BindsTo
+ port2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ network:
+ get_input: port_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_smp2
+ relationship: tosca.relationships.network.BindsTo
+ server_smp1:
+ type: org.openecomp.resource.vfc.nodes.heat.smp
+ properties:
+ flavor:
+ get_input: flavor_smp_name
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: image_smp_name
+ metadata:
+ jx_vm_role: smp2
+ vnf_id:
+ get_input: vnf_id
+ jx_lab_name:
+ get_input: lab_name
+ user_data_format: RAW
+ name:
+ get_input: smp_name_1
+ scheduler_hints:
+ group:
+ get_input: be_affinity_param
+ groups:
+ FE_SMP_Affinity:
+ type: tosca.groups.Root
+ members:
+ - server_smp2
+ - server_smp3
+ Multi_Anti_Affinity:
+ type: tosca.groups.Root
+ members:
+ - server_smp3
+ addOn1:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/addOn1.yml
+ description: ASC Template
+ members:
+ - port1
+ - server_smp1
+ addOn3:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/addOn3.yml
+ description: ASC Template
+ members:
+ - server_smp3
+ - port3
+ - port4
+ addOn2:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/addOn2.yml
+ description: ASC Template
+ members:
+ - server_smp2
+ - port2
+ BE_Affinity:
+ type: tosca.groups.Root
+ members:
+ - server_smp1
+ policies:
+ FE_SMP_Affinity:
+ type: org.openecomp.policies.placement.Colocate
+ properties:
+ name: abc
+ affinity: host
+ targets:
+ - FE_SMP_Affinity
+ Multi_Anti_Affinity:
+ type: org.openecomp.policies.placement.Antilocate
+ properties:
+ name: def
+ container_type: host
+ targets:
+ - Multi_Anti_Affinity
+ BE_Affinity:
+ type: org.openecomp.policies.placement.Colocate
+ properties:
+ name: def
+ affinity: host
+ targets:
+ - BE_Affinity \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..bcc4ef51b1
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles/MANIFEST.json
@@ -0,0 +1,27 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "main.yml",
+ "type": "HEAT",
+ "isBase": "true"
+ },
+ {
+ "file": "addOn1.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ },
+ {
+ "file": "addOn2.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ },
+ {
+ "file": "addOn3.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles/addOn1.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles/addOn1.yml
new file mode 100644
index 0000000000..79306fe04e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles/addOn1.yml
@@ -0,0 +1,57 @@
+heat_template_version: 2013-05-23
+
+description: ASC Template
+
+parameters:
+ be_affinity_param:
+ type: string
+ description: be affinity param
+ availability_zone_0:
+ type: string
+ vnf_id:
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_SCP_id
+ port_name:
+ type: string
+ description: port name
+ default: port_name
+ flavor_smp_name:
+ type: string
+ description: SCP SMP Flavor
+ default: a1.Small
+ image_smp_name:
+ type: string
+ description: SCP SMP image
+ default: asc_base_image_smp
+ smp_name_1:
+ type: string
+ default: vSMP2
+ description: name of VM
+ lab_name:
+ type: string
+ description: Lab name
+
+resources:
+
+ server_smp1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: smp_name_1 }
+ image: { get_param: image_smp_name }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: flavor_smp_name }
+ scheduler_hints: { group: { get_param: be_affinity_param} }
+ networks:
+ - port: { get_resource: port1 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ jx_lab_name: {get_param: lab_name}
+ jx_vm_role: smp2
+ user_data_format: RAW
+
+ port1:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: port_name}
+ replacement_policy: AUTO
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles/addOn2.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles/addOn2.yml
new file mode 100644
index 0000000000..9918c0bfda
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles/addOn2.yml
@@ -0,0 +1,57 @@
+heat_template_version: 2013-05-23
+
+description: ASC Template
+
+parameters:
+ fe_smp_affinity_param:
+ type: string
+ description: be affinity param
+ availability_zone_0:
+ type: string
+ vnf_id:
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_SCP_id
+ port_name:
+ type: string
+ description: port name
+ default: port_name
+ flavor_smp_name:
+ type: string
+ description: SCP SMP Flavor
+ default: a1.Small
+ image_smp_name:
+ type: string
+ description: SCP SMP image
+ default: asc_base_image_smp
+ smp_name_2:
+ type: string
+ default: vSMP2
+ description: name of VM
+ lab_name:
+ type: string
+ description: Lab name
+
+resources:
+ server_smp2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: smp_name_2 }
+ image: { get_param: image_smp_name }
+ # key_name: { get_param: key_name }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: flavor_smp_name }
+ scheduler_hints: { group: { get_param: fe_smp_affinity_param } }
+ networks:
+ - port: { get_resource: port2 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ jx_lab_name: {get_param: lab_name}
+ jx_vm_role: smp2
+ user_data_format: RAW
+
+ port2:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: port_name}
+ replacement_policy: AUTO
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles/addOn3.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles/addOn3.yml
new file mode 100644
index 0000000000..95382efb69
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles/addOn3.yml
@@ -0,0 +1,67 @@
+heat_template_version: 2013-05-23
+
+description: ASC Template
+
+parameters:
+ fe_smp_affinity_param:
+ type: string
+ description: be affinity param
+ multi_anti_affinity_param:
+ type: string
+ description: be affinity param
+ availability_zone_0:
+ type: string
+ vnf_id:
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_SCP_id
+ port_name:
+ type: string
+ description: port name
+ default: port_name
+ flavor_smp_name:
+ type: string
+ description: SCP SMP Flavor
+ default: a1.Small
+ image_smp_name:
+ type: string
+ description: SCP SMP image
+ default: asc_base_image_smp
+ smp_name_2:
+ type: string
+ default: vSMP2
+ description: name of VM
+ lab_name:
+ type: string
+ description: Lab name
+
+resources:
+ server_smp3:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: smp_name_2 }
+ image: { get_param: image_smp_name }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: flavor_smp_name }
+ scheduler_hints: { group1: { get_param: fe_smp_affinity_param }, group2: { get_param: multi_anti_affinity_param } }
+ networks:
+ - port: { get_resource: port3 }
+ - port: { get_resource: port4 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ jx_lab_name: {get_param: lab_name}
+ jx_vm_role: smp2
+ user_data_format: RAW
+
+ port3:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: port_name}
+ replacement_policy: AUTO
+
+ port4:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: port_name}
+ replacement_policy: AUTO
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles/main.yml
new file mode 100644
index 0000000000..cc814efbd9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles/main.yml
@@ -0,0 +1,311 @@
+heat_template_version: 2013-05-23
+
+description: ASC Template
+
+parameters:
+ cluster_type:
+ type: string
+ constraints:
+ - allowed_values: [ Test, Prod ]
+ fe_connectivity:
+ type: string
+ constraints:
+ - allowed_values: [ NEE, STP ]
+ key_name:
+ type: string
+ description: keypair to enable SSH access to the instance.
+ default: vSCP-keypair
+
+# Availability Zone information may need to be updated and the specifications under Nova server capabilities uncommented
+ availability_zone_0:
+ type: string
+
+ vnf_name:
+ type: string
+ description: Unique name for this VNF instance
+ default: This_is_the_SCP_name
+ vnf_id:
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_SCP_id
+
+ port_name:
+ type: string
+ description: port name
+ default: port_name
+
+ flavor_scp_be_name:
+ type: string
+ description: SCP BE Flavor
+ default: a1.Small
+ flavor_scp_fe_name:
+ type: string
+ description: SCP FE Flavor
+ default: a1.Small
+ flavor_smp_name:
+ type: string
+ description: SCP SMP Flavor
+ default: a1.Small
+ image_scp_be_name:
+ type: string
+ description: SCP BE image
+ default: asc_base_image_be
+ image_scp_fe_name:
+ type: string
+ description: SCP FE image
+ default: asc_base_image_fe
+ image_smp_name:
+ type: string
+ description: SCP SMP image
+ default: asc_base_image_smp
+ int_vscp_fe_cluster_net_id:
+ type: string
+ description: LAN2 FE Cluster/KA
+ int_vscp_fe_cluster_cidr:
+ type: string
+ description: Private Network2 Address (CIDR notation)
+ int_vscp_cluster_net_id:
+ type: string
+ description: LAN3 Cluster
+ int_vscp_cluster_cidr:
+ type: string
+ description: Private Network3 Address (CIDR notation)
+ int_vscp_ce_network_net_id:
+ type: string
+ description: Inter-CE Network
+ int_vscp_ce_network_cidr:
+ type: string
+ description: Private Network Address (CIDR notation)
+ SIGNET_vrf_A1_direct_net_id:
+ type: string
+ description: Network name for SIGTRAN_A
+ SIGNET_vrf_B1_direct_net_id:
+ type: string
+ description: Network name for SIGTRAN_B
+ Cricket_OCS_protected_net_id:
+ type: string
+ description: Network name for CRICKET_OCS
+ Mobility_OAM_protected_net_id:
+ type: string
+ description: Network name for OAM
+ be_Cricket_OCS_protected_ip_0:
+ type: string
+ label: be1 Cricket_OCS ip address
+ description: be1 Cricket_OCS ip address
+ be_Cricket_OCS_protected_ip_1:
+ type: string
+ label: be2 Cricket_OCS ip address
+ description: be2 Cricket_OCS ip address
+ be_Cricket_OCS_protected_ip_2:
+ type: string
+ label: be3 Cricket_OCS ip address
+ description: be3 Cricket_OCS ip address
+ be_Cricket_OCS_protected_ip_3:
+ type: string
+ label: be4 Cricket_OCS ip address
+ description: be4 Cricket_OCS ip address
+ be_Cricket_OCS_protected_ip_4:
+ type: string
+ label: be5 Cricket_OCS ip address
+ description: be5 Cricket_OCS ip address
+ fe_SIGNET_vrf_B1_direct_ip_0:
+ type: string
+ label: fe1 SIGTRAN ip address
+ description: fe1 SIGTRAN ip address
+ fe_SIGNET_vrf_A1_direct_ip_0:
+ type: string
+ label: fe2 SIGTRAN ip address
+ description: fe2 SIGTRAN ip address
+ be_Mobility_OAM_protected_ip_0:
+ type: string
+ label: be_0 OAM ip address
+ description: be_0 OAM ip address
+ be_Mobility_OAM_protected_ip_1:
+ type: string
+ label: be_1 OAM ip address
+ description: be_1 OAM ip address
+ be_Mobility_OAM_protected_ip_2:
+ type: string
+ label: be_2 OAM ip address
+ description: be_2 OAM ip address
+ be_Mobility_OAM_protected_ip_3:
+ type: string
+ label: be_3 OAM ip address
+ description: be_3 OAM ip address
+ be_Mobility_OAM_protected_ip_4:
+ type: string
+ label: be_4 OAM ip address
+ description: be_4 OAM ip address
+ fe_Mobility_OAM_protected_ip_0:
+ type: string
+ label: fe_0 OAM ip address
+ description: fe_0 OAM ip address
+ fe_Mobility_OAM_protected_ip_1:
+ type: string
+ label: fe_1 OAM ip address
+ description: fe_1 OAM ip address
+ smp_Mobility_OAM_protected_ip_0:
+ type: string
+ label: smp_0 OAM ip address
+ description: smp_0 OAM ip address
+ smp_Mobility_OAM_protected_ip_1:
+ type: string
+ label: smp_1 OAM ip address
+ description: smp_1 OAM ip address
+ be_name_0:
+ type: string
+ default: vSCP_BE1
+ description: name of VM
+ be_name_1:
+ type: string
+ default: vSCP_BE2
+ description: name of VM
+ be_name_2:
+ type: string
+ default: vSCP_BE3
+ description: name of VM
+ be_name_3:
+ type: string
+ default: vSCP_BE4
+ description: name of VM
+ be_name_4:
+ type: string
+ default: vSCP_BE5
+ description: name of VM
+ fe_name_0:
+ type: string
+ default: vSCP_FE1
+ description: name of VM
+ fe_name_1:
+ type: string
+ default: vSCP_FE2
+ description: name of VM
+ smp_name_0:
+ type: string
+ default: vSMP1
+ description: name of VM
+ smp_name_1:
+ type: string
+ default: vSMP2
+ description: name of VM
+ smp_name_2:
+ type: string
+ default: vSMP2
+ description: name of VM
+ ##smp_name_2:
+ ##type: string
+ ##default: vSMP2
+ ##description: name of VM
+ nee_name_0:
+ type: string
+ default: vNEE
+ description: name of VM
+
+ hostname_fe1:
+ type: string
+ description: FE1 Hostname (from Ulticom license)
+ hostid_fe1:
+ type: string
+ description: FE1 Hostid (from Ulticom license)
+
+ hostname_fe2:
+ type: string
+ description: FE2 Hostname (from Ulticom license)
+ hostid_fe2:
+ type: string
+ description: FE2 Hostid (from Ulticom license)
+
+ hostname_nee1:
+ type: string
+ description: NEE1 Hostname (from Ulticom license)
+ hostid_nee1:
+ type: string
+ description: NEE1 Hostid (from Ulticom license)
+
+ point_code_scp:
+ type: string
+ description: vSCP point code (in "zone-cluster-member" format)
+ point_code_stp:
+ type: string
+ description: STP virtual point code (in "zone-cluster-member" format)
+ point_code_stp1:
+ type: string
+ description: STP1 point code (in "zone-cluster-member" format)
+ point_code_stp2:
+ type: string
+ description: STP2 point code (in "zone-cluster-member" format)
+ ip_address_stp1:
+ type: string
+ description: STP1 IP address
+ ip_port_stp1:
+ type: string
+ description: STP1 IP port
+ ip_address_stp2:
+ type: string
+ description: STP2 IP address
+ ip_port_stp2:
+ type: string
+ description: STP2 IP port
+ ip_port_fe1:
+ type: string
+ description: FE1 IP port in SIGTRAN network
+ ip_port_fe2:
+ type: string
+ description: FE2 IP port in SIGTRAN network
+
+ global_title_scp:
+ type: string
+ description: vSCP Global Title address
+ global_title_stp:
+ type: string
+ description: STP Global Title address
+
+ security_group_name:
+ type: string
+ label: vSCP security group name
+ description: vSCP security group name
+
+ route_table_be:
+ type: string
+ description: Additional route table for BEs
+
+ route_table_fe1:
+ type: string
+ description: Additional route table for FE1
+
+ route_table_fe2:
+ type: string
+ description: Additional route table for FE2
+
+ ip_address_dra:
+ type: string
+ description: DRA VIP address
+
+ lab_name:
+ type: string
+ description: Lab name
+
+resources:
+ FE_SMP_Affinity:
+ type: OS::Nova::ServerGroup
+ properties:
+ policies: ["affinity"]
+ name: abc
+ BE_Affinity:
+ type: OS::Nova::ServerGroup
+ properties:
+ policies: ["affinity"]
+ name: def
+ Multi_Anti_Affinity:
+ type: OS::Nova::ServerGroup
+ properties:
+ policies: ["anti-affinity"]
+ name: def
+
+outputs:
+ fe_smp_affinity_param:
+ value: {get_resource: FE_SMP_Affinity}
+ be_affinity_param:
+ value: {get_resource: BE_Affinity}
+ multi_anti_affinity_param:
+ value: {get_resource: Multi_Anti_Affinity} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..eb63b32fdf
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,1077 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ vprobe_volume_type_0:
+ hidden: false
+ immutable: false
+ type: string
+ description: The type of the volume mapping to a backend
+ default: volumes_ceph
+ vprobe_volume_type_1:
+ hidden: false
+ immutable: false
+ type: string
+ description: The type of the volume mapping to a backend
+ default: volumes_ceph
+ vprobe_volume_type_2:
+ hidden: false
+ immutable: false
+ type: string
+ description: The type of the volume mapping to a backend
+ default: volumes_ceph
+ oam_private_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: A string specifying a symbolic name for the network
+ vProbe_cluster_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: The component cluster name
+ default: vProbe_cluster
+ qrouter_flavor_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: The ID or name of the flavor to boot onto
+ default: m1.large
+ version_number:
+ hidden: false
+ immutable: false
+ type: string
+ description: The version number of the component
+ default: 11.1.5
+ vLB_version_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: The version name of the component.
+ default: vProbe.r.11.1.e._08_16-12_53
+ vprobe_flavor_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: The name of the flavor to boot onto
+ default: m1.large
+ domain_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: The servers domain
+ ntp_timezone:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of NTP Time zone to be used
+ default: UTC
+ packet_mirror_network_subnet_cidr:
+ hidden: false
+ immutable: false
+ type: string
+ description: The Classless Inter-Domain Routing
+ default: 20.20.5.0/24
+ vLBAgent_cluster_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: The component cluster name
+ default: vLBAgent_cluster
+ vLB_type:
+ hidden: false
+ immutable: false
+ type: string
+ description: The type of VLB. MME or SGW.
+ default: mme
+ qrouter_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: VM Names for QRouter VMs
+ entry_schema:
+ type: string
+ win_domain_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Windows servers' domain
+ tenant_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of tenant to be used
+ vLB_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: VM Names for vLB VMs
+ entry_schema:
+ type: string
+ vprobe_volume_size_2:
+ hidden: false
+ immutable: false
+ type: float
+ description: The size of the volume in GB
+ default: 1
+ vLBAgent_flavor_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: The ID or name of the flavor to boot onto
+ default: m1.large
+ vprobe_volume_name_0:
+ hidden: false
+ immutable: false
+ type: string
+ description: The name of the volume
+ default: data
+ vprobe_volume_size_0:
+ hidden: false
+ immutable: false
+ type: float
+ description: The size of the volume in GB
+ default: 100
+ vprobe_volume_name_1:
+ hidden: false
+ immutable: false
+ type: string
+ description: The name of the volume
+ default: log
+ vprobe_volume_size_1:
+ hidden: false
+ immutable: false
+ type: float
+ description: The size of the volume in GB
+ default: 5
+ vprobe_volume_name_2:
+ hidden: false
+ immutable: false
+ type: string
+ description: The name of the volume
+ default: config
+ packet_mirror_network_subnet_alloc_start:
+ hidden: false
+ immutable: false
+ type: string
+ description: Start address for the allocation pool
+ default: 20.20.5.2
+ vLBAgent_version_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: The version name of the component
+ default: vProbe.r.11.1.e._08_16-12_53
+ vLB_volume_name_2:
+ hidden: false
+ immutable: false
+ type: string
+ description: The name of the volume
+ default: config
+ cdr_network:
+ hidden: false
+ immutable: false
+ type: string
+ description: A string specifying a symbolic name for the network
+ vLBAgent_type:
+ hidden: false
+ immutable: false
+ type: string
+ description: vLBAgent Type. mme or sgw
+ default: mme
+ vProbe_node_count:
+ hidden: false
+ immutable: false
+ type: float
+ description: The number of nodes to create
+ default: 1
+ packet_internal_network_subnet_alloc_end:
+ hidden: false
+ immutable: false
+ type: string
+ description: End address for the allocation pool
+ default: 192.0.6.250
+ vLBAgent_volume_type_0:
+ hidden: false
+ immutable: false
+ type: string
+ description: The type of the volume mapping to a backend
+ default: volumes_ceph
+ vLBAgent_volume_type_1:
+ hidden: false
+ immutable: false
+ type: string
+ description: The type of the volume mapping to a backend
+ default: volumes_ceph
+ vLBAgent_volume_size_1:
+ hidden: false
+ immutable: false
+ type: float
+ description: The size of the volume in GB
+ default: 1
+ vLBAgent_volume_type_2:
+ hidden: false
+ immutable: false
+ type: string
+ description: The Cinder volume type. Used to specify the backend.
+ default: volumes_ceph
+ vLB_volume_name_0:
+ hidden: false
+ immutable: false
+ type: string
+ description: The name of the volume
+ default: data
+ vLB_volume_type_1:
+ hidden: false
+ immutable: false
+ type: string
+ description: The type of the volume mapping to a backend
+ default: volumes_ceph
+ vLBAgent_volume_size_2:
+ hidden: false
+ immutable: false
+ type: float
+ description: The size of the volume in Gigabytes.
+ default: 1
+ vLB_volume_name_1:
+ hidden: false
+ immutable: false
+ type: string
+ description: The name of the volume
+ default: log
+ vLB_volume_type_2:
+ hidden: false
+ immutable: false
+ type: string
+ description: The type of the volume mapping to a backend
+ default: volumes_ceph
+ vLBAgent_volume_size_0:
+ hidden: false
+ immutable: false
+ type: float
+ description: The size of the volume in GB
+ default: 15
+ vLB_volume_type_0:
+ hidden: false
+ immutable: false
+ type: string
+ description: The type of the volume mapping to a backend
+ default: volumes_ceph
+ vLBAgent_volume_name_2:
+ hidden: false
+ immutable: false
+ type: string
+ description: The name of the volume
+ default: config
+ vLBAgent_volume_name_1:
+ hidden: false
+ immutable: false
+ type: string
+ description: The name of the volume
+ default: log
+ vLBAgent_volume_name_0:
+ hidden: false
+ immutable: false
+ type: string
+ description: The name of the volume
+ default: data
+ vLB_volume_size_1:
+ hidden: false
+ immutable: false
+ type: float
+ description: The size of the volume in GB.
+ default: 1
+ vLB_volume_size_0:
+ hidden: false
+ immutable: false
+ type: float
+ description: The size of the volume in GB.
+ default: 10
+ packet_mirror_network_subnet_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: The name of the subnet
+ default: rprb_26071_mme_int_pktmirror_net_1_subnet
+ vLB_volume_size_2:
+ hidden: false
+ immutable: false
+ type: float
+ description: The size of the volume in GB.
+ default: 1
+ vf_module_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: The VF MODULE ID of the RADCOM System.
+ qrouter_cluster_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: The component cluster name
+ default: qrouter_cluster
+ vprobe_type:
+ hidden: false
+ immutable: false
+ type: string
+ description: The type of vProbe. MME or SGW.
+ default: mme
+ base_image_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: The base ID or name of the image to boot with
+ default: rprb_centos_6_7_05_24_2016
+ vf_module_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: The VNF module name for vProbe elements.
+ vLB_node_count:
+ hidden: false
+ immutable: false
+ type: float
+ description: The number of nodes to create.
+ default: 1
+ packet_mirror_network_subnet_alloc_end:
+ hidden: false
+ immutable: false
+ type: string
+ description: End address for the allocation pool
+ default: 20.20.5.250
+ packet_internal_network_subnet_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: The name of the subnet
+ default: rprb_26071_mme_int_pktinternal_net_1_subnet
+ vProbe_version_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: The version name of the component
+ default: vProbe.r.11.1.e._08_16-12_53
+ vnf_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: The VNF ID of the RADCOM System.
+ availability_zone_0:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of the availability zone for server placement
+ region_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of region to be used
+ availability_zone_1:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of the availability zone for server placement
+ qtrace_name_0:
+ hidden: false
+ immutable: false
+ type: string
+ description: VM Name for QRouter VMs
+ availability_zone_2:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of the availability zone for server placement.
+ vprobe_AppDependenciesMachineType:
+ hidden: false
+ immutable: false
+ type: string
+ description: The application dependencies
+ default: DatabaseUpgrade
+ manager_name_0:
+ hidden: false
+ immutable: false
+ type: string
+ description: VM Name for Manager VM 0
+ availability_zone_3:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of the availability zone for server placement
+ vLB_cluster_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: The component cluster name.
+ default: vLB_cluster
+ packet_internal_network_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: A string specifying a symbolic name for the network
+ default: rprb_26071_mme_int_pktinternal_net_1
+ packet_mirror_network_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: A string specifying a symbolic name for the network
+ default: rprb_26071_mme_int_pktmirror_net_1
+ packet_internal_network_subnet_alloc_start:
+ hidden: false
+ immutable: false
+ type: string
+ description: Start address for the allocation pool
+ default: 192.0.6.2
+ qrouter_volume_type_1:
+ hidden: false
+ immutable: false
+ type: string
+ description: The type of the volume mapping to a backend
+ default: volumes_ceph
+ vLBAgent_node_count:
+ hidden: false
+ immutable: false
+ type: float
+ description: The number of nodes to create
+ default: 1
+ qrouter_volume_type_2:
+ hidden: false
+ immutable: false
+ type: string
+ description: The type of the volume mapping to a backend
+ default: volumes_ceph
+ vprobe_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: VM Names for vProbe VMs
+ entry_schema:
+ type: string
+ qrouter_node_count:
+ hidden: false
+ immutable: false
+ type: float
+ description: The number of nodes to create
+ default: 1
+ qrouter_volume_name_2:
+ hidden: false
+ immutable: false
+ type: string
+ description: The name of the volume
+ default: config
+ vLBAgent_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: VM Names for vLBAgent VMs
+ entry_schema:
+ type: string
+ vLB_flavor_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: The name of the flavor to boot onto.
+ default: m1.large
+ qrouter_volume_name_1:
+ hidden: false
+ immutable: false
+ type: string
+ description: The name of the volume
+ default: log
+ qrouter_volume_name_0:
+ hidden: false
+ immutable: false
+ type: string
+ description: The name of the volume
+ default: data
+ qrouter_volume_type_0:
+ hidden: false
+ immutable: false
+ type: string
+ description: The type of the volume mapping to a backend
+ default: volumes_ceph
+ qrouter_volume_size_0:
+ hidden: false
+ immutable: false
+ type: float
+ description: The size of the volume in GB
+ default: 1
+ qrouter_volume_size_1:
+ hidden: false
+ immutable: false
+ type: float
+ description: The size of the volume in GB
+ default: 1
+ packet_internal_network_subnet_cidr:
+ hidden: false
+ immutable: false
+ type: string
+ description: The Classless Inter-Domain Routing
+ default: 192.0.6.0/24
+ manager_oam_direct_ip_0:
+ hidden: false
+ immutable: false
+ type: string
+ description: The public ip address of the manager
+ qrouter_volume_size_2:
+ hidden: false
+ immutable: false
+ type: float
+ description: The size of the volume in GB
+ default: 1
+ rpmrepository_ip_0:
+ hidden: false
+ immutable: false
+ type: string
+ description: The public ip address of the repository
+ node_templates:
+ vLBAgent:
+ type: org.openecomp.resource.abstract.nodes.heat.FEAdd_On_Module_vLBAgentTemplate
+ directives:
+ - substitutable
+ properties:
+ vf_module_id:
+ get_input: vf_module_id
+ packet_mirror_network: packet_mirror_network
+ oam_private_net_name:
+ get_input: oam_private_net_name
+ vProbe_cluster_name:
+ get_input: vProbe_cluster_name
+ vlb_agent_image_name:
+ get_input: base_image_name
+ vf_module_name:
+ get_input: vf_module_name
+ vLB_node_count:
+ get_input: vLB_node_count
+ service_template_filter:
+ substitute_service_template: FEAdd_On_Module_vLBAgentTemplateServiceTemplate.yaml
+ domain_name:
+ get_input: domain_name
+ ntp_timezone:
+ get_input: ntp_timezone
+ packet_internal_network: packet_internal_network
+ vnf_id:
+ get_input: vnf_id
+ vLBAgent_cluster_name:
+ get_input: vLBAgent_cluster_name
+ availability_zone_0:
+ get_input: availability_zone_2
+ region_name:
+ get_input: region_name
+ manager_name_0:
+ get_input: manager_name_0
+ vLB_cluster_name:
+ get_input: vLB_cluster_name
+ tenant_name:
+ get_input: tenant_name
+ vLBAgent_flavor_name:
+ get_input: vLBAgent_flavor_name
+ security_group: security_group
+ vLBAgent_version_name:
+ get_input: vLBAgent_version_name
+ vLBAgent_type:
+ get_input: vLBAgent_type
+ vLBAgent_node_count:
+ get_input: vLBAgent_node_count
+ vLBAgent_volume_type_0:
+ get_input: vLBAgent_volume_type_0
+ vLBAgent_volume_type_1:
+ get_input: vLBAgent_volume_type_1
+ vLBAgent_volume_size_1:
+ get_input: vLBAgent_volume_size_1
+ vLBAgent_volume_type_2:
+ get_input: vLBAgent_volume_type_2
+ vLBAgent_names:
+ get_input: vLBAgent_names
+ vLBAgent_volume_size_2:
+ get_input: vLBAgent_volume_size_2
+ vLBAgent_volume_size_0:
+ get_input: vLBAgent_volume_size_0
+ vLBAgent_volume_name_2:
+ get_input: vLBAgent_volume_name_2
+ vLBAgent_volume_name_1:
+ get_input: vLBAgent_volume_name_1
+ vLBAgent_volume_name_0:
+ get_input: vLBAgent_volume_name_0
+ manager_oam_direct_ip_0:
+ get_input: manager_oam_direct_ip_0
+ rpmrepository_ip_0:
+ get_input: rpmrepository_ip_0
+ requirements:
+ - link_packet_mirror_network_port:
+ capability: tosca.capabilities.network.Linkable
+ node: packet_mirror_network
+ relationship: tosca.relationships.network.LinksTo
+ - link_packet_internal_network_port:
+ capability: tosca.capabilities.network.Linkable
+ node: packet_internal_network
+ relationship: tosca.relationships.network.LinksTo
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: security_group
+ relationship: tosca.relationships.DependsOn
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: packet_mirror_network
+ relationship: tosca.relationships.DependsOn
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: packet_mirror_network
+ relationship: tosca.relationships.DependsOn
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: packet_internal_network
+ relationship: tosca.relationships.DependsOn
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: packet_internal_network
+ relationship: tosca.relationships.DependsOn
+ vProbe:
+ type: org.openecomp.resource.abstract.nodes.heat.FEAdd_On_Module_vProbeTemplate
+ directives:
+ - substitutable
+ properties:
+ vf_module_id:
+ get_input: vf_module_id
+ vprobe_volume_type_0:
+ get_input: vprobe_volume_type_0
+ vprobe_volume_type_1:
+ get_input: vprobe_volume_type_1
+ qrouter_cluster_name:
+ get_input: qrouter_cluster_name
+ vprobe_volume_type_2:
+ get_input: vprobe_volume_type_2
+ oam_private_net_name:
+ get_input: oam_private_net_name
+ vProbe_cluster_name:
+ get_input: vProbe_cluster_name
+ vprobe_type:
+ get_input: vprobe_type
+ vprobe_image_name:
+ get_input: base_image_name
+ vprobe_flavor_name:
+ get_input: vprobe_flavor_name
+ vf_module_name:
+ get_input: vf_module_name
+ vLB_node_count:
+ get_input: vLB_node_count
+ service_template_filter:
+ substitute_service_template: FEAdd_On_Module_vProbeTemplateServiceTemplate.yaml
+ domain_name:
+ get_input: domain_name
+ ntp_timezone:
+ get_input: ntp_timezone
+ packet_internal_network: packet_internal_network
+ vProbe_version_name:
+ get_input: vProbe_version_name
+ vnf_id:
+ get_input: vnf_id
+ availability_zone_0:
+ get_input: availability_zone_3
+ region_name:
+ get_input: region_name
+ qtrace_name_0:
+ get_input: qtrace_name_0
+ vprobe_AppDependenciesMachineType:
+ get_input: vprobe_AppDependenciesMachineType
+ manager_name_0:
+ get_input: manager_name_0
+ win_domain_name:
+ get_input: win_domain_name
+ tenant_name:
+ get_input: tenant_name
+ vprobe_volume_size_2:
+ get_input: vprobe_volume_size_2
+ vprobe_volume_name_0:
+ get_input: vprobe_volume_name_0
+ vprobe_volume_size_0:
+ get_input: vprobe_volume_size_0
+ vprobe_volume_name_1:
+ get_input: vprobe_volume_name_1
+ vprobe_volume_size_1:
+ get_input: vprobe_volume_size_1
+ vprobe_volume_name_2:
+ get_input: vprobe_volume_name_2
+ security_group: security_group
+ cdr_network:
+ get_input: cdr_network
+ vProbe_node_count:
+ get_input: vProbe_node_count
+ vprobe_names:
+ get_input: vprobe_names
+ manager_oam_direct_ip_0:
+ get_input: manager_oam_direct_ip_0
+ rpmrepository_ip_0:
+ get_input: rpmrepository_ip_0
+ requirements:
+ - link_packet_internal_network_port:
+ capability: tosca.capabilities.network.Linkable
+ node: packet_internal_network
+ relationship: tosca.relationships.network.LinksTo
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: security_group
+ relationship: tosca.relationships.DependsOn
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: packet_mirror_network
+ relationship: tosca.relationships.DependsOn
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: packet_mirror_network
+ relationship: tosca.relationships.DependsOn
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: packet_internal_network
+ relationship: tosca.relationships.DependsOn
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: packet_internal_network
+ relationship: tosca.relationships.DependsOn
+ QRouter:
+ type: org.openecomp.resource.abstract.nodes.heat.FEAdd_On_Module_QRouterTemplate
+ directives:
+ - substitutable
+ properties:
+ vf_module_id:
+ get_input: vf_module_id
+ qrouter_cluster_name:
+ get_input: qrouter_cluster_name
+ oam_private_net_name:
+ get_input: oam_private_net_name
+ qrouter_flavor_name:
+ get_input: qrouter_flavor_name
+ version_number:
+ get_input: version_number
+ vf_module_name:
+ get_input: vf_module_name
+ service_template_filter:
+ substitute_service_template: FEAdd_On_Module_QRouterTemplateServiceTemplate.yaml
+ domain_name:
+ get_input: domain_name
+ ntp_timezone:
+ get_input: ntp_timezone
+ vnf_id:
+ get_input: vnf_id
+ availability_zone_0:
+ get_input: availability_zone_0
+ region_name:
+ get_input: region_name
+ manager_name_0:
+ get_input: manager_name_0
+ qrouter_names:
+ get_input: qrouter_names
+ tenant_name:
+ get_input: tenant_name
+ security_group: security_group
+ cdr_network:
+ get_input: cdr_network
+ qrouter_image_name:
+ get_input: base_image_name
+ qrouter_volume_type_1:
+ get_input: qrouter_volume_type_1
+ qrouter_volume_type_2:
+ get_input: qrouter_volume_type_2
+ qrouter_node_count:
+ get_input: qrouter_node_count
+ qrouter_volume_name_2:
+ get_input: qrouter_volume_name_2
+ qrouter_volume_name_1:
+ get_input: qrouter_volume_name_1
+ qrouter_volume_name_0:
+ get_input: qrouter_volume_name_0
+ qrouter_volume_type_0:
+ get_input: qrouter_volume_type_0
+ qrouter_volume_size_0:
+ get_input: qrouter_volume_size_0
+ qrouter_volume_size_1:
+ get_input: qrouter_volume_size_1
+ manager_oam_direct_ip_0:
+ get_input: manager_oam_direct_ip_0
+ qrouter_volume_size_2:
+ get_input: qrouter_volume_size_2
+ rpmrepository_ip_0:
+ get_input: rpmrepository_ip_0
+ requirements:
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: security_group
+ relationship: tosca.relationships.DependsOn
+ packet_mirror_network:
+ type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
+ properties:
+ dhcp_enabled: true
+ network_name:
+ get_input: packet_mirror_network_name
+ subnets:
+ packet_mirror_network_subnet:
+ enable_dhcp: true
+ name:
+ get_input: packet_mirror_network_subnet_name
+ cidr:
+ get_input: packet_mirror_network_subnet_cidr
+ allocation_pools:
+ - start:
+ get_input: packet_mirror_network_subnet_alloc_start
+ end:
+ get_input: packet_mirror_network_subnet_alloc_end
+ packet_internal_network:
+ type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
+ properties:
+ dhcp_enabled: true
+ network_name:
+ get_input: packet_internal_network_name
+ subnets:
+ packet_internal_network_subnet:
+ enable_dhcp: true
+ name:
+ get_input: packet_internal_network_subnet_name
+ cidr:
+ get_input: packet_internal_network_subnet_cidr
+ allocation_pools:
+ - start:
+ get_input: packet_internal_network_subnet_alloc_start
+ end:
+ get_input: packet_internal_network_subnet_alloc_end
+ security_group:
+ type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules
+ properties:
+ name: FE_radcom_security_group
+ rules:
+ - protocol: tcp
+ port_range_max: 23
+ port_range_min: 23
+ - protocol: tcp
+ port_range_max: 123
+ port_range_min: 123
+ - protocol: tcp
+ port_range_max: 3389
+ port_range_min: 3389
+ - protocol: udp
+ port_range_max: 5434
+ port_range_min: 5434
+ - protocol: tcp
+ port_range_max: 5443
+ port_range_min: 5435
+ - protocol: tcp
+ port_range_max: 8000
+ port_range_min: 8000
+ - protocol: tcp
+ port_range_max: 9900
+ port_range_min: 9900
+ - protocol: tcp
+ port_range_max: 12050
+ port_range_min: 12000
+ - protocol: tcp
+ port_range_max: 161
+ port_range_min: 161
+ - protocol: udp
+ port_range_max: 8000
+ port_range_min: 8000
+ - protocol: icmp
+ - protocol: 47
+ - protocol: tcp
+ port_range_max: 22
+ port_range_min: 22
+ - protocol: tcp
+ port_range_max: 3050
+ port_range_min: 3000
+ - protocol: tcp
+ port_range_max: 8081
+ port_range_min: 8080
+ - protocol: tcp
+ port_range_max: 8084
+ port_range_min: 8084
+ - protocol: tcp
+ port_range_max: 4000
+ port_range_min: 4000
+ - protocol: tcp
+ port_range_max: 33000
+ port_range_min: 33000
+ - protocol: tcp
+ port_range_max: 8082
+ port_range_min: 8082
+ requirements:
+ - port:
+ capability: attachment_oam_private_net_network_port
+ node: QRouter
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: attachment_cdr_network_port
+ node: QRouter
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: attachment_oam_private_net_network_port
+ node: vLB
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: attachment_packet_mirror_network_port
+ node: vLB
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: attachment_packet_internal_network_port
+ node: vLB
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: attachment_oam_private_net_network_port
+ node: vLBAgent
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: attachment_packet_mirror_network_port
+ node: vLBAgent
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: attachment_packet_internal_network_port
+ node: vLBAgent
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: attachment_oam_private_net_network_port
+ node: vProbe
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: attachment_cdr_network_port
+ node: vProbe
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: attachment_packet_internal_network_port
+ node: vProbe
+ relationship: org.openecomp.relationships.AttachesTo
+ vLB:
+ type: org.openecomp.resource.abstract.nodes.heat.FEAdd_On_Module_vLBTemplate
+ directives:
+ - substitutable
+ properties:
+ vf_module_id:
+ get_input: vf_module_id
+ packet_mirror_network: packet_mirror_network
+ oam_private_net_name:
+ get_input: oam_private_net_name
+ vProbe_cluster_name:
+ get_input: vProbe_cluster_name
+ vLB_version_name:
+ get_input: vLB_version_name
+ vf_module_name:
+ get_input: vf_module_name
+ vLB_node_count:
+ get_input: vLB_node_count
+ service_template_filter:
+ substitute_service_template: FEAdd_On_Module_vLBTemplateServiceTemplate.yaml
+ domain_name:
+ get_input: domain_name
+ ntp_timezone:
+ get_input: ntp_timezone
+ packet_internal_network: packet_internal_network
+ vnf_id:
+ get_input: vnf_id
+ vLB_type:
+ get_input: vLB_type
+ availability_zone_0:
+ get_input: availability_zone_1
+ region_name:
+ get_input: region_name
+ manager_name_0:
+ get_input: manager_name_0
+ vLB_cluster_name:
+ get_input: vLB_cluster_name
+ tenant_name:
+ get_input: tenant_name
+ vLB_names:
+ get_input: vLB_names
+ security_group: security_group
+ vLB_volume_name_2:
+ get_input: vLB_volume_name_2
+ vLB_volume_name_0:
+ get_input: vLB_volume_name_0
+ vLB_volume_type_1:
+ get_input: vLB_volume_type_1
+ vLB_flavor_name:
+ get_input: vLB_flavor_name
+ vLB_volume_name_1:
+ get_input: vLB_volume_name_1
+ vLB_volume_type_2:
+ get_input: vLB_volume_type_2
+ vLB_volume_type_0:
+ get_input: vLB_volume_type_0
+ vLB_volume_size_1:
+ get_input: vLB_volume_size_1
+ vlb_image_name:
+ get_input: base_image_name
+ vLB_volume_size_0:
+ get_input: vLB_volume_size_0
+ manager_oam_direct_ip_0:
+ get_input: manager_oam_direct_ip_0
+ rpmrepository_ip_0:
+ get_input: rpmrepository_ip_0
+ vLB_volume_size_2:
+ get_input: vLB_volume_size_2
+ requirements:
+ - link_packet_mirror_network_port:
+ capability: tosca.capabilities.network.Linkable
+ node: packet_mirror_network
+ relationship: tosca.relationships.network.LinksTo
+ - link_packet_internal_network_port:
+ capability: tosca.capabilities.network.Linkable
+ node: packet_internal_network
+ relationship: tosca.relationships.network.LinksTo
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: security_group
+ relationship: tosca.relationships.DependsOn
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: packet_mirror_network
+ relationship: tosca.relationships.DependsOn
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: packet_mirror_network
+ relationship: tosca.relationships.DependsOn
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: packet_internal_network
+ relationship: tosca.relationships.DependsOn
+ - dependency:
+ capability: tosca.capabilities.Node
+ node: packet_internal_network
+ relationship: tosca.relationships.DependsOn
+ groups:
+ FEBase_Module:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/FEBase_Module.yaml
+ members:
+ - vLBAgent
+ - vProbe
+ - QRouter
+ - packet_mirror_network
+ - packet_internal_network
+ - security_group
+ - vLB \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_QRouterCloudConfig b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_QRouterCloudConfig
new file mode 100644
index 0000000000..51c7176ee6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_QRouterCloudConfig
@@ -0,0 +1,39 @@
+#cloud-config
+ manage_etc_hosts: true
+ yum_repos:
+ Base_Repo:
+ baseurl: "https://%rpm_repo_ip_0%/repo/base"
+ enabled: true
+ gpgcheck: false
+ name: "Base Repo"
+ sslverify: 0
+ sslclientcert: /var/lib/yum/yum.cert
+ sslclientkey: /var/lib/yum/yum.key
+ Radcom:
+ baseurl: "https://%rpm_repo_ip_0%/repo/radcom"
+ enabled: true
+ gpgcheck: false
+ name: "Radcom Repo"
+ sslverify: 0
+ sslclientcert: /var/lib/yum/yum.cert
+ sslclientkey: /var/lib/yum/yum.key
+ package_upgrade: false
+ ssh_authorized_keys:
+ - "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAnuJOkl2iGaFB+BCeRak67Chy+cATmvsqLPDYQ6GMRrGg0kBMcIRExshmTJQFGC+m2xiXeo41pSLaR1vt5fDB+3ewUSBcNtZrr5VxzBWzOab1VO+sCx4f8gOkSJ7plRJ/8xZqyhV+jTkb02peWbqtW+WqERTIyGul/eMNCDnwDNxznb8jMI3KWUd3ujWgFnk8EJ9c41y2unvk42XDOUlnuvR1/FW/qPRSNwPQGLEDlDje29xB3yaMQuJRL4Z86GWb1ZVeVh/+mIO1R4Ayj0HYspDruvFa9mECR4K1QhCN9mRE5sGBMiEOK0O/pf8Y3K2J9LQ6UYAt2yHzL7fAMAKOOw=="
+ runcmd:
+ - "sed -i \"s/GSSAPIAuthentication yes/GSSAPIAuthentication no/g\" /etc/ssh/sshd_config"
+ - "sed -i \"s/#UseDNS yes/UseDNS no/g\" /etc/ssh/sshd_config"
+ - "passwd -d deployment"
+ - "mkdir -pv /mnt/config"
+ - "mount /dev/disk/by-label/config-2 /mnt/config"
+ - "a=($(cat /mnt/config/openstack/latest/meta_data.json | /usr/local/bin/python2.7 -c 'import json,sys;obj=json.load(sys.stdin); print json.dumps(obj[\"files\"]);'));paths=0; values=0;counter=0;function remove_json_chars() { input=$1; echo $1 | sed 's/\\}//g' | sed 's/,//g' | sed 's/]//g' | sed 's/\"//g'; };for data in ${a[@]} ; do index=$(( $counter % 4 )); if [[ \"$index\" == 1 ]];then b[$paths]=$(remove_json_chars $data); paths=$(( $paths + 1 )) ; fi; if [[ \"$index\" == 3 ]];then c[$values]=$(remove_json_chars $data); values=$(( $values + 1 )) ; fi; counter=$(( $counter + 1 )) ; done; path_counter=0; for file in ${c[@]} ; do cp /mnt/config/openstack${file} ${b[$path_counter]}; path_counter=$(( ${path_counter} + 1 )) ; done"
+ - "cat /mnt/config/openstack/latest/meta_data.json | /usr/local/bin/python2.7 -c 'import json,sys;obj=json.load(sys.stdin); print json.dumps(obj[\"meta\"]);' > /meta.js"
+ - "sed -i 's|_colon_|:|g' /meta.js"
+ - "sed -i 's|_slash_|/|g' /meta.js"
+ - "/usr/local/bin/python2.7 /tmp/wait_for_resources.py -m %manager_oam_direct_ip_0%"
+ - "chmod 0754 /root/call_home.py /root/RegisterStatus/register_status.py /root/CheckAvailability/check_availability.py"
+ - "sed -i 's/QROUTER_CLUSTER_NAME/%qrouter_cluster_name%/g' /root/dependencies.json"
+ - "sed -i 's/QROUTER_NODE_COUNT/%qrouter_node_count%/g' /root/dependencies.json"
+ - "sed -i 's/MANAGER_INSTANCE_NAME/%manager_hostname%.%domain_name%/g' /root/dependencies.json"
+ - "/usr/local/bin/python2.7 /root/CheckAvailability/check_availability.py %manager_oam_direct_ip_0%"
+ - "/usr/local/bin/python2.7 /root/call_home.py %manager_oam_direct_ip_0%"
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_QRouterTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_QRouterTemplate.yaml
new file mode 100644
index 0000000000..aae1455919
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_QRouterTemplate.yaml
@@ -0,0 +1,216 @@
+heat_template_version: 2014-10-16
+
+parameters:
+ cdr_network:
+ type: string
+ domain_name:
+ type: string
+ qrouter_image_name:
+ type: string
+ manager_name_0:
+ type: string
+ manager_oam_direct_ip_0:
+ type: string
+ ntp_timezone:
+ type: string
+ oam_private_net_name:
+ type: string
+ availability_zone_0:
+ type: string
+ qrouter_cluster_name:
+ type: string
+ qrouter_flavor_name:
+ type: string
+ qrouter_index:
+ type: number
+ qrouter_names:
+ type: comma_delimited_list
+ qrouter_node_count:
+ type: number
+ qrouter_volume_name_0:
+ type: string
+ qrouter_volume_name_1:
+ type: string
+ qrouter_volume_name_2:
+ type: string
+ qrouter_volume_size_0:
+ type: number
+ qrouter_volume_size_1:
+ type: number
+ qrouter_volume_size_2:
+ type: number
+ qrouter_volume_type_0:
+ type: string
+ qrouter_volume_type_1:
+ type: string
+ qrouter_volume_type_2:
+ type: string
+ region_name:
+ type: string
+ rpmrepository_ip_0:
+ type: string
+ security_group:
+ type: string
+ tenant_name:
+ type: string
+ version_number:
+ type: string
+ vf_module_id:
+ type: string
+ vf_module_name:
+ type: string
+ vnf_id:
+ type: string
+resources:
+ QRouter:
+ properties:
+ availability_zone:
+ get_param: availability_zone_0
+ config_drive: true
+ flavor:
+ get_param: qrouter_flavor_name
+ image:
+ get_param: qrouter_image_name
+ metadata:
+ cdr_network_ip_0:
+ get_attr:
+ - cdr_network_port
+ - fixed_ip_0s
+ - 0
+ - ip_address
+ cluster_name:
+ get_param: qrouter_cluster_name
+ machine_name:
+ get_param:
+ - qrouter_names
+ - get_param: qrouter_index
+ machine_type: qrouter
+ mount_colon__slash_config:
+ get_resource: qrouter_volume_2
+ mount_colon__slash_data:
+ get_resource: qrouter_volume_0
+ mount_colon__slash_log:
+ get_resource: qrouter_volume_1
+ ntp_timezone:
+ get_param: ntp_timezone
+ oam_private_network_ip_0:
+ get_attr:
+ - oam_private_net_network_port
+ - fixed_ip_0s
+ - 0
+ - ip_address
+ region:
+ get_param: region_name
+ repo_ip_0:
+ get_param: rpmrepository_ip_0
+ tenant:
+ get_param: tenant_name
+ version_number:
+ get_param: version_number
+ vf_module_id:
+ get_param: vf_module_id
+ vf_module_name:
+ get_param: vf_module_name
+ vnf_id:
+ get_param: vnf_id
+ name:
+ get_param:
+ - qrouter_names
+ - get_param: qrouter_index
+ networks:
+ - port:
+ get_resource: oam_private_net_network_port
+ - port:
+ get_resource: cdr_network_port
+ personality:
+ /root/CheckAvailability/check_availability.py:
+ get_file: check_availability.py
+ /root/RegisterStatus/register_status.py:
+ get_file: register_status.py
+ /root/call_home.py:
+ get_file: call_home.py
+ /root/dependencies.json:
+ get_file: qrouterdependencies.json
+ /tmp/wait_for_resources.py:
+ get_file: wait_for_resources.py
+ user_data:
+ str_replace:
+ params:
+ '%domain_name%':
+ get_param: domain_name
+ '%manager_hostname%':
+ get_param: manager_name_0
+ '%manager_oam_direct_ip_0%':
+ get_param: manager_oam_direct_ip_0
+ '%qrouter_cluster_name%':
+ get_param: qrouter_cluster_name
+ '%qrouter_node_count%':
+ get_param: qrouter_node_count
+ '%rpm_repo_ip_0%':
+ get_param: rpmrepository_ip_0
+ template:
+ get_file: FEAdd_On_Module_QRouterCloudConfig
+ user_data_format: RAW
+ type: OS::Nova::Server
+ cdr_network_port:
+ properties:
+ network:
+ get_param: cdr_network
+ security_groups:
+ - get_param: security_group
+ type: OS::Neutron::Port
+ oam_private_net_network_port:
+ properties:
+ network:
+ get_param: oam_private_net_name
+ security_groups:
+ - get_param: security_group
+ type: OS::Neutron::Port
+ qrouter_volume_0:
+ properties:
+ description:
+ get_param: qrouter_volume_name_0
+ size:
+ get_param: qrouter_volume_size_0
+ volume_type:
+ get_param: qrouter_volume_type_0
+ type: OS::Cinder::Volume
+ qrouter_volume_0_att:
+ properties:
+ instance_uuid:
+ get_resource: QRouter
+ volume_id:
+ get_resource: qrouter_volume_0
+ type: OS::Cinder::VolumeAttachment
+ qrouter_volume_1:
+ properties:
+ description:
+ get_param: qrouter_volume_name_1
+ size:
+ get_param: qrouter_volume_size_1
+ volume_type:
+ get_param: qrouter_volume_type_1
+ type: OS::Cinder::Volume
+ qrouter_volume_1_att:
+ properties:
+ instance_uuid:
+ get_resource: QRouter
+ volume_id:
+ get_resource: qrouter_volume_1
+ type: OS::Cinder::VolumeAttachment
+ qrouter_volume_2:
+ properties:
+ description:
+ get_param: qrouter_volume_name_2
+ size:
+ get_param: qrouter_volume_size_2
+ volume_type:
+ get_param: qrouter_volume_type_2
+ type: OS::Cinder::Volume
+ qrouter_volume_2_att:
+ properties:
+ instance_uuid:
+ get_resource: QRouter
+ volume_id:
+ get_resource: qrouter_volume_2
+ type: OS::Cinder::VolumeAttachment \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vLBAgentCloudConfig b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vLBAgentCloudConfig
new file mode 100644
index 0000000000..83f57aceb8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vLBAgentCloudConfig
@@ -0,0 +1,53 @@
+#cloud-config
+ manage_etc_hosts: false
+ yum_repos:
+ Base_Repo:
+ baseurl: "https://%rpm_repo_ip_0%/repo/base"
+ enabled: true
+ gpgcheck: false
+ name: "Base Repo"
+ sslverify: 0
+ sslclientcert: /var/lib/yum/yum.cert
+ sslclientkey: /var/lib/yum/yum.key
+ Radcom:
+ baseurl: "https://%rpm_repo_ip_0%/repo/radcom"
+ enabled: true
+ gpgcheck: false
+ name: "Radcom Repo"
+ sslverify: 0
+ sslclientcert: /var/lib/yum/yum.cert
+ sslclientkey: /var/lib/yum/yum.key
+ package_upgrade: false
+ ssh_authorized_keys:
+ - "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAnuJOkl2iGaFB+BCeRak67Chy+cATmvsqLPDYQ6GMRrGg0kBMcIRExshmTJQFGC+m2xiXeo41pSLaR1vt5fDB+3ewUSBcNtZrr5VxzBWzOab1VO+sCx4f8gOkSJ7plRJ/8xZqyhV+jTkb02peWbqtW+WqERTIyGul/eMNCDnwDNxznb8jMI3KWUd3ujWgFnk8EJ9c41y2unvk42XDOUlnuvR1/FW/qPRSNwPQGLEDlDje29xB3yaMQuJRL4Z86GWb1ZVeVh/+mIO1R4Ayj0HYspDruvFa9mECR4K1QhCN9mRE5sGBMiEOK0O/pf8Y3K2J9LQ6UYAt2yHzL7fAMAKOOw=="
+ runcmd:
+ - "sed -i \"s/GSSAPIAuthentication yes/GSSAPIAuthentication no/g\" /etc/ssh/sshd_config"
+ - "sed -i \"s/#UseDNS yes/UseDNS no/g\" /etc/ssh/sshd_config"
+ - "passwd -d deployment"
+ - "mkdir -pv /mnt/config"
+ - "mount /dev/disk/by-label/config-2 /mnt/config"
+ - "a=($(cat /mnt/config/openstack/latest/meta_data.json | /usr/local/bin/python2.7 -c 'import json,sys;obj=json.load(sys.stdin); print json.dumps(obj[\"files\"]);'));paths=0; values=0;counter=0;function remove_json_chars() { input=$1; echo $1 | sed 's/\\}//g' | sed 's/,//g' | sed 's/]//g' | sed 's/\"//g'; };for data in ${a[@]} ; do index=$(( $counter % 4 )); if [[ \"$index\" == 1 ]];then b[$paths]=$(remove_json_chars $data); paths=$(( $paths + 1 )) ; fi; if [[ \"$index\" == 3 ]];then c[$values]=$(remove_json_chars $data); values=$(( $values + 1 )) ; fi; counter=$(( $counter + 1 )) ; done; path_counter=0; for file in ${c[@]} ; do cp /mnt/config/openstack${file} ${b[$path_counter]}; path_counter=$(( ${path_counter} + 1 )) ; done"
+ - "cat /mnt/config/openstack/latest/meta_data.json | /usr/local/bin/python2.7 -c 'import json,sys;obj=json.load(sys.stdin); print json.dumps(obj[\"meta\"]);' > /meta.js"
+ - "sed -i 's|_colon_|:|g' /meta.js"
+ - "sed -i 's|_slash_|/|g' /meta.js"
+ - "/usr/local/bin/python2.7 /tmp/wait_for_resources.py -m %manager_oam_direct_ip_0%"
+ - "chmod 0754 /root/call_home.py /root/RegisterStatus/register_status.py /root/CheckAvailability/check_availability.py"
+ - "/usr/local/bin/python2.7 /root/CheckAvailability/check_availability.py %manager_oam_direct_ip_0%"
+ - "echo MH vLBAgent_id_number %vLBAgent_id_number%"
+ - "echo MH probe_data %probe_data%"
+ - "echo MH probe_log %probe_log%"
+ - "echo MH probe_config %probe_config%"
+ - "echo MH vLBAgent_id_number %vLBAgent_id_number%"
+ - "probe_id=`echo %vLBAgent_id_number%`"
+ - "vLB_n_count=`echo %vLB_node_count%`"
+ - "echo vLB_n_count=$vLB_n_count"
+ - "if [[ \"$vLB_n_count\" == 0 ]];then cp -p /root/dependencies_without_vLB.json /root/dependencies.json; fi;"
+ - "if [[ \"$vLB_n_count\" > 0 ]];then cp -p /root/dependencies_with_vLB.json /root/dependencies.json; fi;"
+ - "sed -i 's/VLBAGENT_CLUSTER_NAME/%vLBAgent_cluster_name%/g' /root/dependencies.json"
+ - "sed -i 's/VPROBE_CLUSTER_NAME/%vProbe_cluster_name%/g' /root/dependencies.json"
+ - "sed -i 's/VLB_CLUSTER_NAME/%vLB_cluster_name%/g' /root/dependencies.json"
+ - "sed -i 's/VLBAGENT_NODE_COUNT/%vLBAgent_node_count%/g' /root/dependencies.json"
+ - "sed -i 's/MANAGER_INSTANCE_NAME/%manager_hostname%.%domain_name%/g' /root/dependencies.json"
+ - "echo \"${probe_id}\" > /etc/hostname"
+ - "mkdir -pv /radcom/software"
+ - "/usr/local/bin/python2.7 /root/call_home.py %manager_oam_direct_ip_0%"
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vLBAgentTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vLBAgentTemplate.yaml
new file mode 100644
index 0000000000..80a65d17fc
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vLBAgentTemplate.yaml
@@ -0,0 +1,303 @@
+heat_template_version: 2014-10-16
+
+parameters:
+ domain_name:
+ type: string
+ vlb_agent_image_name:
+ type: string
+ manager_name_0:
+ type: string
+ manager_oam_direct_ip_0:
+ type: string
+ ntp_timezone:
+ type: string
+ oam_private_net_name:
+ type: string
+ packet_internal_network:
+ type: string
+ packet_mirror_network:
+ type: string
+ region_name:
+ type: string
+ rpmrepository_ip_0:
+ type: string
+ security_group:
+ type: string
+ tenant_name:
+ type: string
+ availability_zone_0:
+ type: string
+ vLBAgent_cluster_name:
+ type: string
+ vLBAgent_flavor_name:
+ type: string
+ vLBAgent_index:
+ type: number
+ vLBAgent_names:
+ type: comma_delimited_list
+ vLBAgent_node_count:
+ type: number
+ vLBAgent_type:
+ type: string
+ vLBAgent_version_name:
+ type: string
+ vLBAgent_volume_name_0:
+ type: string
+ vLBAgent_volume_name_1:
+ type: string
+ vLBAgent_volume_name_2:
+ type: string
+ vLBAgent_volume_size_0:
+ type: number
+ vLBAgent_volume_size_1:
+ type: number
+ vLBAgent_volume_size_2:
+ type: number
+ vLBAgent_volume_type_0:
+ type: string
+ vLBAgent_volume_type_1:
+ type: string
+ vLBAgent_volume_type_2:
+ type: string
+ vLB_cluster_name:
+ type: string
+ vLB_node_count:
+ type: number
+ vProbe_cluster_name:
+ type: string
+ vf_module_id:
+ type: string
+ vf_module_name:
+ type: string
+ vnf_id:
+ type: string
+resources:
+ oam_private_net_network_port:
+ properties:
+ network:
+ get_param: oam_private_net_name
+ security_groups:
+ - get_param: security_group
+ type: OS::Neutron::Port
+ packet_internal_network_port:
+ properties:
+ network:
+ get_param: packet_internal_network
+ security_groups:
+ - get_param: security_group
+ type: OS::Neutron::Port
+ packet_mirror_network_port:
+ properties:
+ network:
+ get_param: packet_mirror_network
+ security_groups:
+ - get_param: security_group
+ type: OS::Neutron::Port
+ vLBAgentInstance:
+ properties:
+ availability_zone:
+ get_param: availability_zone_0
+ config_drive: true
+ flavor:
+ get_param: vLBAgent_flavor_name
+ image:
+ get_param: vlb_agent_image_name
+ metadata:
+ DPDK: DPDK_IP
+ cluster_name:
+ get_param: vLBAgent_cluster_name
+ machine_name:
+ get_param:
+ - vLBAgent_names
+ - get_param: vLBAgent_index
+ machine_type: vLBAgent
+ manager_oam_direct_ip_0:
+ get_param: manager_oam_direct_ip_0
+ mount_colon__slash_config:
+ get_resource: vLBAgent_volume_2
+ mount_colon__slash_data:
+ get_resource: vLBAgent_volume_0
+ mount_colon__slash_log:
+ get_resource: vLBAgent_volume_1
+ ntp_timezone:
+ get_param: ntp_timezone
+ oam_private_network_cidr:
+ get_attr:
+ - oam_private_net_network_port
+ - subnets
+ - 0
+ - cidr
+ oam_private_network_ip_0:
+ get_attr:
+ - oam_private_net_network_port
+ - fixed_ip_0s
+ - 0
+ - ip_address
+ packet_internal_network_cidr:
+ get_attr:
+ - packet_internal_network_port
+ - subnets
+ - 0
+ - cidr
+ packet_internal_network_ip_0:
+ get_attr:
+ - packet_internal_network_port
+ - fixed_ip_0s
+ - 0
+ - ip_address
+ packet_mirror_network_cidr:
+ get_attr:
+ - packet_mirror_network_port
+ - subnets
+ - 0
+ - cidr
+ packet_mirror_network_ip_0:
+ get_attr:
+ - packet_mirror_network_port
+ - fixed_ip_0s
+ - 0
+ - ip_address
+ region:
+ get_param: region_name
+ repo_ip_0:
+ get_param: rpmrepository_ip_0
+ tenant:
+ get_param: tenant_name
+ vLBAgentInstance:
+ get_param: vLBAgent_index
+ vLBAgent_id:
+ get_attr:
+ - vLBAgent_id
+ - value
+ vLBAgent_name:
+ get_param:
+ - vLBAgent_names
+ - get_param: vLBAgent_index
+ vLBAgent_type:
+ get_param: vLBAgent_type
+ vLBAgent_version_name:
+ get_param: vLBAgent_version_name
+ vLB_node_count:
+ get_param: vLB_node_count
+ version_number:
+ get_param: vLBAgent_version_name
+ vf_module_id:
+ get_param: vf_module_id
+ vf_module_name:
+ get_param: vf_module_name
+ vnf_id:
+ get_param: vnf_id
+ name:
+ get_param:
+ - vLBAgent_names
+ - get_param: vLBAgent_index
+ networks:
+ - port:
+ get_resource: oam_private_net_network_port
+ - port:
+ get_resource: packet_mirror_network_port
+ - port:
+ get_resource: packet_internal_network_port
+ personality:
+ /root/CheckAvailability/check_availability.py:
+ get_file: check_availability.py
+ /root/RegisterStatus/register_status.py:
+ get_file: register_status.py
+ /root/call_home.py:
+ get_file: call_home.py
+ /root/dependencies_with_vLB.json:
+ get_file: vlbagentdependencies_with_vLB.json
+ /root/dependencies_without_vLB.json:
+ get_file: vlbagentdependencies_without_vLB.json
+ /tmp/wait_for_resources.py:
+ get_file: wait_for_resources.py
+ user_data:
+ str_replace:
+ params:
+ '%domain_name%':
+ get_param: domain_name
+ '%manager_hostname%':
+ get_param: manager_name_0
+ '%manager_oam_direct_ip_0%':
+ get_param: manager_oam_direct_ip_0
+ '%rpm_repo_ip_0%':
+ get_param: rpmrepository_ip_0
+ '%vLBAgent_cluster_name%':
+ get_param: vLBAgent_cluster_name
+ '%vLBAgent_config%':
+ get_resource: vLBAgent_volume_2
+ '%vLBAgent_data%':
+ get_resource: vLBAgent_volume_0
+ '%vLBAgent_id_number%':
+ get_attr:
+ - vLBAgent_id
+ - value
+ '%vLBAgent_log%':
+ get_resource: vLBAgent_volume_1
+ '%vLBAgent_node_count%':
+ get_param: vLBAgent_node_count
+ '%vLBAgent_version_name%':
+ get_param: vLBAgent_version_name
+ '%vLB_cluster_name%':
+ get_param: vLB_cluster_name
+ '%vLB_node_count%':
+ get_param: vLB_node_count
+ '%vProbe_cluster_name%':
+ get_param: vProbe_cluster_name
+ template:
+ get_file: FEAdd_On_Module_vLBAgentCloudConfig
+ user_data_format: RAW
+ type: OS::Nova::Server
+ vLBAgent_id:
+ properties:
+ length: 4
+ sequence: digits
+ type: OS::Heat::RandomString
+ vLBAgent_volume_0:
+ properties:
+ description:
+ get_param: vLBAgent_volume_name_0
+ size:
+ get_param: vLBAgent_volume_size_0
+ volume_type:
+ get_param: vLBAgent_volume_type_0
+ type: OS::Cinder::Volume
+ vLBAgent_volume_0_att:
+ properties:
+ instance_uuid:
+ get_resource: vLBAgentInstance
+ volume_id:
+ get_resource: vLBAgent_volume_0
+ type: OS::Cinder::VolumeAttachment
+ vLBAgent_volume_1:
+ properties:
+ description:
+ get_param: vLBAgent_volume_name_1
+ size:
+ get_param: vLBAgent_volume_size_1
+ volume_type:
+ get_param: vLBAgent_volume_type_1
+ type: OS::Cinder::Volume
+ vLBAgent_volume_1_att:
+ properties:
+ instance_uuid:
+ get_resource: vLBAgentInstance
+ volume_id:
+ get_resource: vLBAgent_volume_1
+ type: OS::Cinder::VolumeAttachment
+ vLBAgent_volume_2:
+ properties:
+ description:
+ get_param: vLBAgent_volume_name_2
+ size:
+ get_param: vLBAgent_volume_size_2
+ volume_type:
+ get_param: vLBAgent_volume_type_2
+ type: OS::Cinder::Volume
+ vLBAgent_volume_2_att:
+ properties:
+ instance_uuid:
+ get_resource: vLBAgentInstance
+ volume_id:
+ get_resource: vLBAgent_volume_2
+ type: OS::Cinder::VolumeAttachment
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vLBCloudConfig b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vLBCloudConfig
new file mode 100644
index 0000000000..78b6c652ce
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vLBCloudConfig
@@ -0,0 +1,41 @@
+#cloud-config
+ manage_etc_hosts: false
+ yum_repos:
+ Base_Repo:
+ baseurl: "https://%rpm_repo_ip_0%/repo/base"
+ enabled: true
+ gpgcheck: false
+ name: "Base Repo"
+ sslverify: 0
+ sslclientcert: /var/lib/yum/yum.cert
+ sslclientkey: /var/lib/yum/yum.key
+ ssh_authorized_keys:
+ - "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAnuJOkl2iGaFB+BCeRak67Chy+cATmvsqLPDYQ6GMRrGg0kBMcIRExshmTJQFGC+m2xiXeo41pSLaR1vt5fDB+3ewUSBcNtZrr5VxzBWzOab1VO+sCx4f8gOkSJ7plRJ/8xZqyhV+jTkb02peWbqtW+WqERTIyGul/eMNCDnwDNxznb8jMI3KWUd3ujWgFnk8EJ9c41y2unvk42XDOUlnuvR1/FW/qPRSNwPQGLEDlDje29xB3yaMQuJRL4Z86GWb1ZVeVh/+mIO1R4Ayj0HYspDruvFa9mECR4K1QhCN9mRE5sGBMiEOK0O/pf8Y3K2J9LQ6UYAt2yHzL7fAMAKOOw=="
+ runcmd:
+ - "sed -i \"s/GSSAPIAuthentication yes/GSSAPIAuthentication no/g\" /etc/ssh/sshd_config"
+ - "sed -i \"s/#UseDNS yes/UseDNS no/g\" /etc/ssh/sshd_config"
+ - "passwd -d deployment"
+ - "mkdir -pv /mnt/config"
+ - "mount /dev/disk/by-label/config-2 /mnt/config"
+ - "a=($(cat /mnt/config/openstack/latest/meta_data.json | /usr/local/bin/python2.7 -c 'import json,sys;obj=json.load(sys.stdin); print json.dumps(obj[\"files\"]);'));paths=0; values=0;counter=0;function remove_json_chars() { input=$1; echo $1 | sed 's/\\}//g' | sed 's/,//g' | sed 's/]//g' | sed 's/\"//g'; };for data in ${a[@]} ; do index=$(( $counter % 4 )); if [[ \"$index\" == 1 ]];then b[$paths]=$(remove_json_chars $data); paths=$(( $paths + 1 )) ; fi; if [[ \"$index\" == 3 ]];then c[$values]=$(remove_json_chars $data); values=$(( $values + 1 )) ; fi; counter=$(( $counter + 1 )) ; done; path_counter=0; for file in ${c[@]} ; do cp /mnt/config/openstack${file} ${b[$path_counter]}; path_counter=$(( ${path_counter} + 1 )) ; done"
+ - "cat /mnt/config/openstack/latest/meta_data.json | /usr/local/bin/python2.7 -c 'import json,sys;obj=json.load(sys.stdin); print json.dumps(obj[\"meta\"]);' > /meta.js"
+ - "sed -i 's|_colon_|:|g' /meta.js"
+ - "sed -i 's|_slash_|/|g' /meta.js"
+ - "/usr/local/bin/python2.7 /tmp/wait_for_resources.py -m %manager_oam_direct_ip_0%"
+ - "chmod 0754 /root/call_home.py /root/RegisterStatus/register_status.py /root/CheckAvailability/check_availability.py"
+ - "/usr/local/bin/python2.7 /root/CheckAvailability/check_availability.py %manager_oam_direct_ip_0%"
+ - "echo MH vLB_id_number %vLB_id_number%"
+ - "echo MH probe_data %vLB_id_number%"
+ - "echo MH probe_log %vLB_log%"
+ - "echo MH probe_config %vLB_config%"
+ - "probe_id=`echo %vLB_id_number%`"
+ - "echo vLB_cluster_name %vLB_cluster_name%"
+ - "echo vLB_node_count %vLB_node_count%"
+ - "sed -i 's/VLB_CLUSTER_NAME/%vLB_cluster_name%/g' /root/dependencies.json"
+ - "sed -i 's/VPROBE_CLUSTER_NAME/%vProbe_cluster_name%/g' /root/dependencies.json"
+ - "sed -i 's/VLB_NODE_COUNT/%vLB_node_count%/g' /root/dependencies.json"
+ - "sed -i 's/MANAGER_INSTANCE_NAME/%manager_hostname%.%domain_name%/g' /root/dependencies.json"
+ - "sed -i 's/VLB_INSTANCE/%vLBInstance%/g' /root/dependencies.json"
+ - "echo \"${probe_id}\" > /etc/hostname"
+ - "mkdir -pv /radcom/software"
+ - "/usr/local/bin/python2.7 /root/call_home.py %manager_oam_direct_ip_0%"
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vLBTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vLBTemplate.yaml
new file mode 100644
index 0000000000..afc435adaf
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vLBTemplate.yaml
@@ -0,0 +1,287 @@
+heat_template_version: 2014-10-16
+
+parameters:
+ domain_name:
+ type: string
+ vlb_image_name:
+ type: string
+ manager_name_0:
+ type: string
+ manager_oam_direct_ip_0:
+ type: string
+ ntp_timezone:
+ type: string
+ oam_private_net_name:
+ type: string
+ packet_internal_network:
+ type: string
+ packet_mirror_network:
+ type: string
+ region_name:
+ type: string
+ rpmrepository_ip_0:
+ type: string
+ security_group:
+ type: string
+ tenant_name:
+ type: string
+ availability_zone_0:
+ type: string
+ vLB_cluster_name:
+ type: string
+ vLB_flavor_name:
+ type: string
+ vLB_index:
+ type: number
+ vLB_names:
+ type: comma_delimited_list
+ vLB_node_count:
+ type: number
+ vLB_type:
+ type: string
+ vLB_version_name:
+ type: string
+ vLB_volume_name_0:
+ type: string
+ vLB_volume_name_1:
+ type: string
+ vLB_volume_name_2:
+ type: string
+ vLB_volume_size_0:
+ type: number
+ vLB_volume_size_1:
+ type: number
+ vLB_volume_size_2:
+ type: number
+ vLB_volume_type_0:
+ type: string
+ vLB_volume_type_1:
+ type: string
+ vLB_volume_type_2:
+ type: string
+ vProbe_cluster_name:
+ type: string
+ vf_module_id:
+ type: string
+ vf_module_name:
+ type: string
+ vnf_id:
+ type: string
+resources:
+ oam_private_net_network_port:
+ properties:
+ network:
+ get_param: oam_private_net_name
+ security_groups:
+ - get_param: security_group
+ type: OS::Neutron::Port
+ packet_internal_network_port:
+ properties:
+ network:
+ get_param: packet_internal_network
+ security_groups:
+ - get_param: security_group
+ type: OS::Neutron::Port
+ packet_mirror_network_port:
+ properties:
+ network:
+ get_param: packet_mirror_network
+ security_groups:
+ - get_param: security_group
+ type: OS::Neutron::Port
+ vLBInstance:
+ properties:
+ availability_zone:
+ get_param: availability_zone_0
+ config_drive: true
+ flavor:
+ get_param: vLB_flavor_name
+ image:
+ get_param: vlb_image_name
+ metadata:
+ DPDK: DPDK_IP
+ cluster_name:
+ get_param: vLB_cluster_name
+ machine_name:
+ get_param:
+ - vLB_names
+ - get_param: vLB_index
+ machine_type: vLB
+ manager_oam_direct_ip_0:
+ get_param: manager_oam_direct_ip_0
+ mount_colon__slash_config:
+ get_resource: vLB_volume_2
+ mount_colon__slash_data:
+ get_resource: vLB_volume_0
+ mount_colon__slash_log:
+ get_resource: vLB_volume_1
+ ntp_timezone:
+ get_param: ntp_timezone
+ oam_private_network_cidr:
+ get_attr:
+ - oam_private_net_network_port
+ - subnets
+ - 0
+ - cidr
+ oam_private_network_ip_0:
+ get_attr:
+ - oam_private_net_network_port
+ - fixed_ip_0s
+ - 0
+ - ip_address
+ packet_internal_network_cidr:
+ get_attr:
+ - packet_internal_network_port
+ - subnets
+ - 0
+ - cidr
+ packet_internal_network_ip_0:
+ get_attr:
+ - packet_internal_network_port
+ - fixed_ip_0s
+ - 0
+ - ip_address
+ packet_mirror_network_cidr:
+ get_attr:
+ - packet_mirror_network_port
+ - subnets
+ - 0
+ - cidr
+ packet_mirror_network_ip_0:
+ get_attr:
+ - packet_mirror_network_port
+ - fixed_ip_0s
+ - 0
+ - ip_address
+ region:
+ get_param: region_name
+ repo_ip_0:
+ get_param: rpmrepository_ip_0
+ tenant:
+ get_param: tenant_name
+ vLBAgentInstance:
+ get_param: vLB_index
+ vLBAgent_id:
+ get_attr:
+ - vLB_id
+ - value
+ vLBAgent_name:
+ get_param:
+ - vLB_names
+ - get_param: vLB_index
+ vLBAgent_type:
+ get_param: vLB_type
+ vLBAgent_version_name:
+ get_param: vLB_version_name
+ version_number:
+ get_param: vLB_version_name
+ vf_module_id:
+ get_param: vf_module_id
+ vf_module_name:
+ get_param: vf_module_name
+ vnf_id:
+ get_param: vnf_id
+ name:
+ get_param:
+ - vLB_names
+ - get_param: vLB_index
+ networks:
+ - port:
+ get_resource: oam_private_net_network_port
+ - port:
+ get_resource: packet_mirror_network_port
+ - port:
+ get_resource: packet_internal_network_port
+ personality:
+ /root/CheckAvailability/check_availability.py:
+ get_file: check_availability.py
+ /root/RegisterStatus/register_status.py:
+ get_file: register_status.py
+ /root/call_home.py:
+ get_file: call_home.py
+ /root/dependencies.json:
+ get_file: vlbdependencies.json
+ /tmp/wait_for_resources.py:
+ get_file: wait_for_resources.py
+ user_data:
+ str_replace:
+ params:
+ '%domain_name%':
+ get_param: domain_name
+ '%manager_hostname%':
+ get_param: manager_name_0
+ '%manager_oam_direct_ip_0%':
+ get_param: manager_oam_direct_ip_0
+ '%rpm_repo_ip_0%':
+ get_param: rpmrepository_ip_0
+ '%vLBInstance%':
+ get_param: vLB_index
+ '%vLB_cluster_name%':
+ get_param: vLB_cluster_name
+ '%vLB_config%':
+ get_resource: vLB_volume_2
+ '%vLB_data%':
+ get_resource: vLB_volume_0
+ '%vLB_id_number%':
+ get_attr:
+ - vLB_id
+ - value
+ '%vLB_log%':
+ get_resource: vLB_volume_1
+ '%vLB_node_count%':
+ get_param: vLB_node_count
+ '%vLB_version_name%':
+ get_param: vLB_version_name
+ '%vProbe_cluster_name%':
+ get_param: vProbe_cluster_name
+ template:
+ get_file: FEAdd_On_Module_vLBCloudConfig
+ user_data_format: RAW
+ type: OS::Nova::Server
+ vLB_id:
+ properties:
+ length: 4
+ sequence: digits
+ type: OS::Heat::RandomString
+ vLB_volume_0:
+ properties:
+ size:
+ get_param: vLB_volume_size_0
+ volume_type:
+ get_param: vLB_volume_type_0
+ type: OS::Cinder::Volume
+ vLB_volume_0_att:
+ properties:
+ instance_uuid:
+ get_resource: vLBInstance
+ volume_id:
+ get_resource: vLB_volume_0
+ type: OS::Cinder::VolumeAttachment
+ vLB_volume_1:
+ properties:
+ size:
+ get_param: vLB_volume_size_1
+ volume_type:
+ get_param: vLB_volume_type_1
+ type: OS::Cinder::Volume
+ vLB_volume_1_att:
+ properties:
+ instance_uuid:
+ get_resource: vLBInstance
+ volume_id:
+ get_resource: vLB_volume_1
+ type: OS::Cinder::VolumeAttachment
+ vLB_volume_2:
+ properties:
+ size:
+ get_param: vLB_volume_size_2
+ volume_type:
+ get_param: vLB_volume_type_2
+ type: OS::Cinder::Volume
+ vLB_volume_2_att:
+ properties:
+ instance_uuid:
+ get_resource: vLBInstance
+ volume_id:
+ get_resource: vLB_volume_2
+ type: OS::Cinder::VolumeAttachment
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vProbeCloudConfig b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vProbeCloudConfig
new file mode 100644
index 0000000000..f31b3dde85
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vProbeCloudConfig
@@ -0,0 +1,50 @@
+#cloud-config
+ manage_etc_hosts: true
+ yum_repos:
+ Base_Repo:
+ baseurl: "https://%rpm_repo_ip_0%/repo/base"
+ enabled: true
+ gpgcheck: false
+ name: "Base Repo"
+ sslverify: 0
+ sslclientcert: /var/lib/yum/yum.cert
+ sslclientkey: /var/lib/yum/yum.key
+ Radcom:
+ baseurl: "https://%rpm_repo_ip_0%/repo/radcom"
+ enabled: true
+ gpgcheck: false
+ name: "Radcom Repo"
+ sslverify: 0
+ sslclientcert: /var/lib/yum/yum.cert
+ sslclientkey: /var/lib/yum/yum.key
+ package_upgrade: false
+ ssh_authorized_keys:
+ - "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAnuJOkl2iGaFB+BCeRak67Chy+cATmvsqLPDYQ6GMRrGg0kBMcIRExshmTJQFGC+m2xiXeo41pSLaR1vt5fDB+3ewUSBcNtZrr5VxzBWzOab1VO+sCx4f8gOkSJ7plRJ/8xZqyhV+jTkb02peWbqtW+WqERTIyGul/eMNCDnwDNxznb8jMI3KWUd3ujWgFnk8EJ9c41y2unvk42XDOUlnuvR1/FW/qPRSNwPQGLEDlDje29xB3yaMQuJRL4Z86GWb1ZVeVh/+mIO1R4Ayj0HYspDruvFa9mECR4K1QhCN9mRE5sGBMiEOK0O/pf8Y3K2J9LQ6UYAt2yHzL7fAMAKOOw=="
+ runcmd:
+ - "sed -i \"s/GSSAPIAuthentication yes/GSSAPIAuthentication no/g\" /etc/ssh/sshd_config"
+ - "sed -i \"s/#UseDNS yes/UseDNS no/g\" /etc/ssh/sshd_config"
+ - "passwd -d deployment"
+ - "mkdir -pv /mnt/config"
+ - "mount /dev/disk/by-label/config-2 /mnt/config"
+ - "a=($(cat /mnt/config/openstack/latest/meta_data.json | /usr/local/bin/python2.7 -c 'import json,sys;obj=json.load(sys.stdin); print json.dumps(obj[\"files\"]);'));paths=0; values=0;counter=0;function remove_json_chars() { input=$1; echo $1 | sed 's/\\}//g' | sed 's/,//g' | sed 's/]//g' | sed 's/\"//g'; };for data in ${a[@]} ; do index=$(( $counter % 4 )); if [[ \"$index\" == 1 ]];then b[$paths]=$(remove_json_chars $data); paths=$(( $paths + 1 )) ; fi; if [[ \"$index\" == 3 ]];then c[$values]=$(remove_json_chars $data); values=$(( $values + 1 )) ; fi; counter=$(( $counter + 1 )) ; done; path_counter=0; for file in ${c[@]} ; do cp /mnt/config/openstack${file} ${b[$path_counter]}; path_counter=$(( ${path_counter} + 1 )) ; done"
+ - "cat /mnt/config/openstack/latest/meta_data.json | /usr/local/bin/python2.7 -c 'import json,sys;obj=json.load(sys.stdin); print json.dumps(obj[\"meta\"]);' > /meta.js"
+ - "sed -i 's|_colon_|:|g' /meta.js"
+ - "sed -i 's|_slash_|/|g' /meta.js"
+ - "/usr/local/bin/python2.7 /tmp/wait_for_resources.py -m %manager_oam_direct_ip_0%"
+ - "chmod 0754 /root/call_home.py /root/RegisterStatus/register_status.py /root/CheckAvailability/check_availability.py"
+ - "/usr/local/bin/python2.7 /root/CheckAvailability/check_availability.py %manager_oam_direct_ip_0%"
+ - "echo MH probe_data %probe_data%"
+ - "echo MH probe_log %probe_log%"
+ - "echo MH probe_config %probe_config%"
+ - "sed -i 's/QROUTER_CLUSTER_NAME/%qrouter_cluster_name%/g' /root/dependencies.json"
+ - "sed -i 's/VPROBE_CLUSTER_NAME/%vProbe_cluster_name%/g' /root/dependencies.json"
+ - "sed -i 's/VPROBE_NODE_COUNT/%vProbe_node_count%/g' /root/dependencies.json"
+ - "sed -i 's/MANAGER_INSTANCE_NAME/%manager_hostname%.%domain_name%/g' /root/dependencies.json"
+ - "sed -i 's/QTRACE_HOST_NAME/%qtrace_hostname%.%win_domain_name%/g' /root/dependencies.json"
+ - "sed -i 's/PROBE_INSTANCE/%ProbeInstance%/g' /root/dependencies.json"
+ - "probe_id=$(($RANDOM%8999+1000))"
+ - "echo $probe_id > /etc/hostname"
+ - "sed -i 's/P_ID/'$probe_id'/g' /meta.js"
+ - "echo MH probe_id=$probe_id"
+ - "mkdir -pv /radcom/software"
+ - "/usr/local/bin/python2.7 /root/call_home.py %manager_oam_direct_ip_0%"
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vProbeTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vProbeTemplate.yaml
new file mode 100644
index 0000000000..d343ee5595
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vProbeTemplate.yaml
@@ -0,0 +1,308 @@
+heat_template_version: 2014-10-16
+
+parameters:
+ cdr_network:
+ type: string
+ domain_name:
+ type: string
+ vprobe_image_name:
+ type: string
+ manager_name_0:
+ type: string
+ manager_oam_direct_ip_0:
+ type: string
+ ntp_timezone:
+ type: string
+ oam_private_net_name:
+ type: string
+ packet_internal_network:
+ type: string
+ qrouter_cluster_name:
+ type: string
+ qtrace_name_0:
+ type: string
+ region_name:
+ type: string
+ rpmrepository_ip_0:
+ type: string
+ security_group:
+ type: string
+ tenant_name:
+ type: string
+ vLB_node_count:
+ type: number
+ vProbe_cluster_name:
+ type: string
+ vProbe_node_count:
+ type: number
+ vProbe_version_name:
+ type: string
+ vf_module_id:
+ type: string
+ vf_module_name:
+ type: string
+ vnf_id:
+ type: string
+ vprobe_AppDependenciesMachineType:
+ type: string
+ availability_zone_0:
+ type: string
+ vprobe_flavor_name:
+ type: string
+ vprobe_index:
+ type: number
+ vprobe_names:
+ type: comma_delimited_list
+ vprobe_type:
+ type: string
+ vprobe_volume_name_0:
+ type: string
+ vprobe_volume_name_1:
+ type: string
+ vprobe_volume_name_2:
+ type: string
+ vprobe_volume_size_0:
+ type: number
+ vprobe_volume_size_1:
+ type: number
+ vprobe_volume_size_2:
+ type: number
+ vprobe_volume_type_0:
+ type: string
+ vprobe_volume_type_1:
+ type: string
+ vprobe_volume_type_2:
+ type: string
+ win_domain_name:
+ type: string
+resources:
+ ProbeInstance:
+ properties:
+ availability_zone:
+ get_param: availability_zone_0
+ config_drive: true
+ flavor:
+ get_param: vprobe_flavor_name
+ image:
+ get_param: vprobe_image_name
+ metadata:
+ AppDependencies:
+ get_param: vprobe_AppDependenciesMachineType
+ DPDK: DPDK_IP
+ ProbeInstance:
+ get_param: vprobe_index
+ cdr_network_cidr:
+ get_attr:
+ - cdr_network_port
+ - subnets
+ - 0
+ - cidr
+ cdr_network_ip_0:
+ get_attr:
+ - cdr_network_port
+ - fixed_ip_0s
+ - 0
+ - ip_address
+ cluster_name:
+ get_param: vProbe_cluster_name
+ machine_name:
+ get_param:
+ - vprobe_names
+ - get_param: vprobe_index
+ machine_type: vProbe
+ manager_oam_direct_ip_0:
+ get_param: manager_oam_direct_ip_0
+ mount_colon__slash_config:
+ get_resource: vprobe_volume_2
+ mount_colon__slash_data:
+ get_resource: vprobe_volume_0
+ mount_colon__slash_log:
+ get_resource: vprobe_volume_1
+ ntp_timezone:
+ get_param: ntp_timezone
+ oam_private_network_cidr:
+ get_attr:
+ - oam_private_net_network_port
+ - subnets
+ - 0
+ - cidr
+ oam_private_network_ip_0:
+ get_attr:
+ - oam_private_net_network_port
+ - fixed_ip_0s
+ - 0
+ - ip_address
+ packet_internal_network_cidr:
+ get_attr:
+ - packet_internal_network_port
+ - subnets
+ - 0
+ - cidr
+ packet_internal_network_ip_0:
+ get_attr:
+ - packet_internal_network_port
+ - fixed_ip_0s
+ - 0
+ - ip_address
+ probe_id: P_ID
+ probe_name:
+ get_param:
+ - vprobe_names
+ - get_param: vprobe_index
+ region:
+ get_param: region_name
+ repo_ip_0:
+ get_param: rpmrepository_ip_0
+ tenant:
+ get_param: tenant_name
+ vLB_node_count:
+ get_param: vLB_node_count
+ vProbe_node_count:
+ get_param: vProbe_node_count
+ vProbe_version_name:
+ get_param: vProbe_version_name
+ version_number:
+ get_param: vProbe_version_name
+ vf_module_id:
+ get_param: vf_module_id
+ vf_module_name:
+ get_param: vf_module_name
+ vnf_id:
+ get_param: vnf_id
+ vprobe_type:
+ get_param: vprobe_type
+ name:
+ get_param:
+ - vprobe_names
+ - get_param: vprobe_index
+ networks:
+ - port:
+ get_resource: oam_private_net_network_port
+ - port:
+ get_resource: cdr_network_port
+ - port:
+ get_resource: packet_internal_network_port
+ personality:
+ /root/CheckAvailability/check_availability.py:
+ get_file: check_availability.py
+ /root/RegisterStatus/register_status.py:
+ get_file: register_status.py
+ /root/call_home.py:
+ get_file: call_home.py
+ /root/dependencies.json:
+ get_file: vprobedependencies.json
+ /tmp/wait_for_resources.py:
+ get_file: wait_for_resources.py
+ user_data:
+ str_replace:
+ params:
+ '%ProbeInstance%':
+ get_param: vprobe_index
+ '%domain_name%':
+ get_param: domain_name
+ '%manager_hostname%':
+ get_param: manager_name_0
+ '%manager_oam_direct_ip_0%':
+ get_param: manager_oam_direct_ip_0
+ '%probe_config%':
+ get_resource: vprobe_volume_2
+ '%probe_data%':
+ get_resource: vprobe_volume_0
+ '%probe_id_number%':
+ get_attr:
+ - vprobe_id
+ - value
+ '%probe_log%':
+ get_resource: vprobe_volume_1
+ '%qrouter_cluster_name%':
+ get_param: qrouter_cluster_name
+ '%qtrace_hostname%':
+ get_param: qtrace_name_0
+ '%rpm_repo_ip_0%':
+ get_param: rpmrepository_ip_0
+ '%vProbe_cluster_name%':
+ get_param: vProbe_cluster_name
+ '%vProbe_node_count%':
+ get_param: vProbe_node_count
+ '%vProbe_version_name%':
+ get_param: vProbe_version_name
+ '%win_domain_name%':
+ get_param: win_domain_name
+ template:
+ get_file: FEAdd_On_Module_vProbeCloudConfig
+ user_data_format: RAW
+ type: OS::Nova::Server
+ cdr_network_port:
+ properties:
+ network:
+ get_param: cdr_network
+ security_groups:
+ - get_param: security_group
+ type: OS::Neutron::Port
+ oam_private_net_network_port:
+ properties:
+ network:
+ get_param: oam_private_net_name
+ security_groups:
+ - get_param: security_group
+ type: OS::Neutron::Port
+ packet_internal_network_port:
+ properties:
+ network:
+ get_param: packet_internal_network
+ security_groups:
+ - get_param: security_group
+ type: OS::Neutron::Port
+ vprobe_id:
+ properties:
+ length: 4
+ sequence: digits
+ type: OS::Heat::RandomString
+ vprobe_volume_0:
+ properties:
+ description:
+ get_param: vprobe_volume_name_0
+ size:
+ get_param: vprobe_volume_size_0
+ volume_type:
+ get_param: vprobe_volume_type_0
+ type: OS::Cinder::Volume
+ vprobe_volume_0_att:
+ properties:
+ instance_uuid:
+ get_resource: ProbeInstance
+ volume_id:
+ get_resource: vprobe_volume_0
+ type: OS::Cinder::VolumeAttachment
+ vprobe_volume_1:
+ properties:
+ description:
+ get_param: vprobe_volume_name_1
+ size:
+ get_param: vprobe_volume_size_1
+ volume_type:
+ get_param: vprobe_volume_type_1
+ type: OS::Cinder::Volume
+ vprobe_volume_1_att:
+ properties:
+ instance_uuid:
+ get_resource: ProbeInstance
+ volume_id:
+ get_resource: vprobe_volume_1
+ type: OS::Cinder::VolumeAttachment
+ vprobe_volume_2:
+ properties:
+ description:
+ get_param: vprobe_volume_name_2
+ size:
+ get_param: vprobe_volume_size_2
+ volume_type:
+ get_param: vprobe_volume_type_2
+ type: OS::Cinder::Volume
+ vprobe_volume_2_att:
+ properties:
+ instance_uuid:
+ get_resource: ProbeInstance
+ volume_id:
+ get_resource: vprobe_volume_2
+ type: OS::Cinder::VolumeAttachment \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEBase_Module.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEBase_Module.env
new file mode 100644
index 0000000000..76907855eb
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEBase_Module.env
@@ -0,0 +1,91 @@
+parameters:
+ base_image_name: rprb_centos_6_7_05_24_2016
+ #domain_name: novalocal
+ #manager_name_0: zrsrv01qmn001
+ #manager_oam_direct_ip_0: null
+ ntp_timezone: UTC
+ packet_internal_network_name: rprb_26071_mme_int_pktinternal_net_1
+ packet_internal_network_subnet_alloc_end: 192.0.6.250
+ packet_internal_network_subnet_alloc_start: 192.0.6.2
+ packet_internal_network_subnet_cidr: 192.0.6.0/24
+ packet_internal_network_subnet_name: rprb_26071_mme_int_pktinternal_net_1_subnet
+ packet_mirror_network_name: rprb_26071_mme_int_pktmirror_net_1
+ packet_mirror_network_subnet_alloc_end: 20.20.5.250
+ packet_mirror_network_subnet_alloc_start: 20.20.5.2
+ packet_mirror_network_subnet_cidr: 20.20.5.0/24
+ packet_mirror_network_subnet_name: rprb_26071_mme_int_pktmirror_net_1_subnet
+# availability_zone_0: nova
+ qrouter_cluster_name: qrouter_cluster
+ qrouter_flavor_name: m1.large
+# qrouter_names: zrsrv01xlb000,zrsrv01xlb001,zrsrv01xlb002,zrsrv01xlb003,zrsrv01xlb004
+ qrouter_node_count: 1
+ #qrouter_vnf_module_name: QRouter
+ qrouter_volume_name_0: data
+ qrouter_volume_name_1: log
+ qrouter_volume_name_2: config
+ qrouter_volume_size_0: 1
+ qrouter_volume_size_1: 1
+ qrouter_volume_size_2: 1
+ qrouter_volume_type_0: volumes_ceph
+ qrouter_volume_type_1: volumes_ceph
+ qrouter_volume_type_2: volumes_ceph
+ #qtrace_name_0: zrsrv01qtr001
+ #region_name: Tel Aviv
+ rpmrepository_ip_0: null
+ #tenant_name: RADCOM
+# availability_zone_1: nova
+ vLBAgent_cluster_name: vLBAgent_cluster
+ vLBAgent_flavor_name: m1.large
+# vLBAgent_names: zrvlb01mme000,zrvlb01mme001,zrvlb01mme002,zrvlb01mme003,zrvlb01mme004
+ vLBAgent_node_count: 1
+ vLBAgent_type: mme
+ vLBAgent_version_name: vProbe.r.11.1.e._08_16-12_53
+ vLBAgent_volume_name_0: data
+ vLBAgent_volume_name_1: log
+ vLBAgent_volume_name_2: config
+ vLBAgent_volume_size_0: 15
+ vLBAgent_volume_size_1: 1
+ vLBAgent_volume_size_2: 1
+ vLBAgent_volume_type_0: volumes_ceph
+ vLBAgent_volume_type_1: volumes_ceph
+ vLBAgent_volume_type_2: volumes_ceph
+# availability_zone_2: nova
+ vLB_cluster_name: vLB_cluster
+ vLB_flavor_name: m1.large
+# vLB_names: zrvlb01gtp000,zrvlb01gtp001,zrvlb01gtp002,zrvlb01gtp003,zrvlb01gtp004
+ vLB_node_count: 1
+ vLB_type: mme
+ vLB_version_name: vProbe.r.11.1.e._08_16-12_53
+ vLB_volume_name_0: data
+ vLB_volume_name_1: log
+ vLB_volume_name_2: config
+ vLB_volume_size_0: 10
+ vLB_volume_size_1: 1
+ vLB_volume_size_2: 1
+ vLB_volume_type_0: volumes_ceph
+ vLB_volume_type_1: volumes_ceph
+ vLB_volume_type_2: volumes_ceph
+ vProbe_cluster_name: vProbe_cluster
+ vProbe_node_count: 1
+ vProbe_version_name: vProbe.r.11.1.e._08_16-12_53
+ version_number: 11.1.5
+ #vf_module_id: 0bb8ee04-c9aa-4b51-8aa6-763343d25692
+ #vlb_vnf_module_name: vLB
+ #vlbagent_vnf_module_name: vLBAgent
+ #vnf_id: df9ad862-763e-463b-a761-eba2077f9930
+ vprobe_AppDependenciesMachineType: DatabaseUpgrade
+# availability_zone_3: nova
+ vprobe_flavor_name: m1.large
+# vprobe_names: zrprb01mme000,zrprb01mme001,zrprb01mme002,zrprb01mme003,zrprb01mme004
+ vprobe_type: mme
+ #vf_module_name: vProbe
+ vprobe_volume_name_0: data
+ vprobe_volume_name_1: log
+ vprobe_volume_name_2: config
+ vprobe_volume_size_0: 100
+ vprobe_volume_size_1: 5
+ vprobe_volume_size_2: 1
+ vprobe_volume_type_0: volumes_ceph
+ vprobe_volume_type_1: volumes_ceph
+ vprobe_volume_type_2: volumes_ceph
+ #win_domain_name: openstacklocal
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEBase_Module.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEBase_Module.yaml
new file mode 100644
index 0000000000..5d0a5457ca
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEBase_Module.yaml
@@ -0,0 +1,670 @@
+heat_template_version: '2014-10-16'
+
+parameters:
+ base_image_name:
+ description: The base ID or name of the image to boot with
+ type: string
+ cdr_network:
+ description: A string specifying a symbolic name for the network
+ type: string
+ domain_name:
+ description: The servers domain
+ type: string
+ manager_name_0:
+ description: VM Name for Manager VM 0
+ type: string
+ manager_oam_direct_ip_0:
+ description: The public ip address of the manager
+ type: string
+ ntp_timezone:
+ description: Name of NTP Time zone to be used
+ type: string
+ oam_private_net_name:
+ description: A string specifying a symbolic name for the network
+ type: string
+ packet_internal_network_name:
+ description: A string specifying a symbolic name for the network
+ type: string
+ packet_internal_network_subnet_alloc_end:
+ description: End address for the allocation pool
+ type: string
+ packet_internal_network_subnet_alloc_start:
+ description: Start address for the allocation pool
+ type: string
+ packet_internal_network_subnet_cidr:
+ description: The Classless Inter-Domain Routing
+ type: string
+ packet_internal_network_subnet_name:
+ description: The name of the subnet
+ type: string
+ packet_mirror_network_name:
+ description: A string specifying a symbolic name for the network
+ type: string
+ packet_mirror_network_subnet_alloc_end:
+ description: End address for the allocation pool
+ type: string
+ packet_mirror_network_subnet_alloc_start:
+ description: Start address for the allocation pool
+ type: string
+ packet_mirror_network_subnet_cidr:
+ description: The Classless Inter-Domain Routing
+ type: string
+ packet_mirror_network_subnet_name:
+ description: The name of the subnet
+ type: string
+ availability_zone_0:
+ description: Name of the availability zone for server placement
+ type: string
+ qrouter_cluster_name:
+ description: The component cluster name
+ type: string
+ qrouter_flavor_name:
+ description: The ID or name of the flavor to boot onto
+ type: string
+ qrouter_names:
+ description: VM Names for QRouter VMs
+ type: comma_delimited_list
+ qrouter_node_count:
+ description: The number of nodes to create
+ type: number
+ qrouter_volume_name_0:
+ description: The name of the volume
+ type: string
+ qrouter_volume_name_1:
+ description: The name of the volume
+ type: string
+ qrouter_volume_name_2:
+ description: The name of the volume
+ type: string
+ qrouter_volume_size_0:
+ description: The size of the volume in GB
+ type: number
+ qrouter_volume_size_1:
+ description: The size of the volume in GB
+ type: number
+ qrouter_volume_size_2:
+ description: The size of the volume in GB
+ type: number
+ qrouter_volume_type_0:
+ description: The type of the volume mapping to a backend
+ type: string
+ qrouter_volume_type_1:
+ description: The type of the volume mapping to a backend
+ type: string
+ qrouter_volume_type_2:
+ description: The type of the volume mapping to a backend
+ type: string
+ qtrace_name_0:
+ description: VM Name for QRouter VMs
+ type: string
+ region_name:
+ description: Name of region to be used
+ type: string
+ rpmrepository_ip_0:
+ description: The public ip address of the repository
+ type: string
+ tenant_name:
+ description: Name of tenant to be used
+ type: string
+ availability_zone_1:
+ description: Name of the availability zone for server placement
+ type: string
+ vLBAgent_cluster_name:
+ description: The component cluster name
+ type: string
+ vLBAgent_flavor_name:
+ description: The ID or name of the flavor to boot onto
+ type: string
+ vLBAgent_names:
+ description: VM Names for vLBAgent VMs
+ type: comma_delimited_list
+ vLBAgent_node_count:
+ description: The number of nodes to create
+ type: number
+ vLBAgent_type:
+ description: vLBAgent Type. mme or sgw
+ type: string
+ vLBAgent_version_name:
+ description: The version name of the component
+ type: string
+ vLBAgent_volume_name_0:
+ description: The name of the volume
+ type: string
+ vLBAgent_volume_name_1:
+ description: The name of the volume
+ type: string
+ vLBAgent_volume_name_2:
+ description: The name of the volume
+ type: string
+ vLBAgent_volume_size_0:
+ description: The size of the volume in GB
+ type: number
+ vLBAgent_volume_size_1:
+ description: The size of the volume in GB
+ type: number
+ vLBAgent_volume_size_2:
+ description: The size of the volume in Gigabytes.
+ type: number
+ vLBAgent_volume_type_0:
+ description: The type of the volume mapping to a backend
+ type: string
+ vLBAgent_volume_type_1:
+ description: The type of the volume mapping to a backend
+ type: string
+ vLBAgent_volume_type_2:
+ description: The Cinder volume type. Used to specify the backend.
+ type: string
+ availability_zone_2:
+ description: Name of the availability zone for server placement.
+ type: string
+ vLB_cluster_name:
+ description: The component cluster name.
+ type: string
+ vLB_flavor_name:
+ description: The name of the flavor to boot onto.
+ type: string
+ vLB_names:
+ description: VM Names for vLB VMs
+ type: comma_delimited_list
+ vLB_node_count:
+ description: The number of nodes to create.
+ type: number
+ vLB_type:
+ description: The type of VLB. MME or SGW.
+ type: string
+ vLB_version_name:
+ description: The version name of the component.
+ type: string
+ vLB_volume_name_0:
+ description: The name of the volume
+ type: string
+ vLB_volume_name_1:
+ description: The name of the volume
+ type: string
+ vLB_volume_name_2:
+ description: The name of the volume
+ type: string
+ vLB_volume_size_0:
+ description: The size of the volume in GB.
+ type: number
+ vLB_volume_size_1:
+ description: The size of the volume in GB.
+ type: number
+ vLB_volume_size_2:
+ description: The size of the volume in GB.
+ type: number
+ vLB_volume_type_0:
+ description: The type of the volume mapping to a backend
+ type: string
+ vLB_volume_type_1:
+ description: The type of the volume mapping to a backend
+ type: string
+ vLB_volume_type_2:
+ description: The type of the volume mapping to a backend
+ type: string
+ vProbe_cluster_name:
+ description: The component cluster name
+ type: string
+ vProbe_node_count:
+ description: The number of nodes to create
+ type: number
+ vProbe_version_name:
+ description: The version name of the component
+ type: string
+ version_number:
+ description: The version number of the component
+ type: string
+ vf_module_id:
+ description: The VF MODULE ID of the RADCOM System.
+ type: string
+ vnf_id:
+ description: The VNF ID of the RADCOM System.
+ type: string
+ vprobe_AppDependenciesMachineType:
+ description: The application dependencies
+ type: string
+ availability_zone_3:
+ description: Name of the availability zone for server placement
+ type: string
+ vprobe_flavor_name:
+ description: The name of the flavor to boot onto
+ type: string
+ vprobe_names:
+ description: VM Names for vProbe VMs
+ type: comma_delimited_list
+ vprobe_type:
+ description: The type of vProbe. MME or SGW.
+ type: string
+ vf_module_name:
+ description: The VNF module name for vProbe elements.
+ type: string
+ vprobe_volume_name_0:
+ description: The name of the volume
+ type: string
+ vprobe_volume_name_1:
+ description: The name of the volume
+ type: string
+ vprobe_volume_name_2:
+ description: The name of the volume
+ type: string
+ vprobe_volume_size_0:
+ description: The size of the volume in GB
+ type: number
+ vprobe_volume_size_1:
+ description: The size of the volume in GB
+ type: number
+ vprobe_volume_size_2:
+ description: The size of the volume in GB
+ type: number
+ vprobe_volume_type_0:
+ description: The type of the volume mapping to a backend
+ type: string
+ vprobe_volume_type_1:
+ description: The type of the volume mapping to a backend
+ type: string
+ vprobe_volume_type_2:
+ description: The type of the volume mapping to a backend
+ type: string
+ win_domain_name:
+ description: Windows servers' domain
+ type: string
+resources:
+ QRouter:
+ depends_on:
+ - security_group
+ - packet_mirror_network
+ - packet_mirror_network_subnet
+ - packet_internal_network
+ - packet_internal_network_subnet
+ properties:
+ cdr_network:
+ get_param: cdr_network
+ domain_name:
+ get_param: domain_name
+ qrouter_image_name:
+ get_param: base_image_name
+ manager_name_0:
+ get_param: manager_name_0
+ manager_oam_direct_ip_0:
+ get_param: manager_oam_direct_ip_0
+ ntp_timezone:
+ get_param: ntp_timezone
+ oam_private_net_name:
+ get_param: oam_private_net_name
+ availability_zone_0:
+ get_param: availability_zone_0
+ qrouter_cluster_name:
+ get_param: qrouter_cluster_name
+ qrouter_flavor_name:
+ get_param: qrouter_flavor_name
+ qrouter_names:
+ get_param: qrouter_names
+ qrouter_node_count:
+ get_param: qrouter_node_count
+ qrouter_volume_name_0:
+ get_param: qrouter_volume_name_0
+ qrouter_volume_name_1:
+ get_param: qrouter_volume_name_1
+ qrouter_volume_name_2:
+ get_param: qrouter_volume_name_2
+ qrouter_volume_size_0:
+ get_param: qrouter_volume_size_0
+ qrouter_volume_size_1:
+ get_param: qrouter_volume_size_1
+ qrouter_volume_size_2:
+ get_param: qrouter_volume_size_2
+ qrouter_volume_type_0:
+ get_param: qrouter_volume_type_0
+ qrouter_volume_type_1:
+ get_param: qrouter_volume_type_1
+ qrouter_volume_type_2:
+ get_param: qrouter_volume_type_2
+ region_name:
+ get_param: region_name
+ rpmrepository_ip_0:
+ get_param: rpmrepository_ip_0
+ security_group:
+ get_resource: security_group
+ tenant_name:
+ get_param: tenant_name
+ version_number:
+ get_param: version_number
+ vf_module_id:
+ get_param: vf_module_id
+ vf_module_name:
+ get_param: vf_module_name
+ vnf_id:
+ get_param: vnf_id
+ type: FEAdd_On_Module_QRouterTemplate.yaml
+ packet_internal_network:
+ properties:
+ name:
+ get_param: packet_internal_network_name
+ type: OS::Neutron::Net
+ packet_internal_network_subnet:
+ properties:
+ allocation_pools:
+ - end:
+ get_param: packet_internal_network_subnet_alloc_end
+ start:
+ get_param: packet_internal_network_subnet_alloc_start
+ cidr:
+ get_param: packet_internal_network_subnet_cidr
+ enable_dhcp: true
+ gateway_ip_0: null
+ name:
+ get_param: packet_internal_network_subnet_name
+ network_id:
+ get_resource: packet_internal_network
+ type: OS::Neutron::Subnet
+ packet_mirror_network:
+ properties:
+ name:
+ get_param: packet_mirror_network_name
+ type: OS::Neutron::Net
+ packet_mirror_network_subnet:
+ properties:
+ allocation_pools:
+ - end:
+ get_param: packet_mirror_network_subnet_alloc_end
+ start:
+ get_param: packet_mirror_network_subnet_alloc_start
+ cidr:
+ get_param: packet_mirror_network_subnet_cidr
+ enable_dhcp: true
+ gateway_ip_0: null
+ name:
+ get_param: packet_mirror_network_subnet_name
+ network_id:
+ get_resource: packet_mirror_network
+ type: OS::Neutron::Subnet
+ security_group:
+ properties:
+ name: FE_radcom_security_group
+ rules:
+ - port_range_max: 23
+ port_range_min: 23
+ protocol: tcp
+ - port_range_max: 123
+ port_range_min: 123
+ protocol: tcp
+ - port_range_max: 3389
+ port_range_min: 3389
+ protocol: tcp
+ - port_range_max: 5434
+ port_range_min: 5434
+ protocol: udp
+ - port_range_max: 5443
+ port_range_min: 5435
+ protocol: tcp
+ - port_range_max: 8000
+ port_range_min: 8000
+ protocol: tcp
+ - port_range_max: 9900
+ port_range_min: 9900
+ protocol: tcp
+ - port_range_max: 12050
+ port_range_min: 12000
+ protocol: tcp
+ - port_range_max: 161
+ port_range_min: 161
+ protocol: tcp
+ - port_range_max: 8000
+ port_range_min: 8000
+ protocol: udp
+ - protocol: icmp
+ - protocol: 47
+ - port_range_max: 22
+ port_range_min: 22
+ protocol: tcp
+ - port_range_max: 3050
+ port_range_min: 3000
+ protocol: tcp
+ - port_range_max: 8081
+ port_range_min: 8080
+ protocol: tcp
+ - port_range_max: 8084
+ port_range_min: 8084
+ protocol: tcp
+ - port_range_max: 4000
+ port_range_min: 4000
+ protocol: tcp
+ - port_range_max: 33000
+ port_range_min: 33000
+ protocol: tcp
+ - port_range_max: 8082
+ port_range_min: 8082
+ protocol: tcp
+ type: OS::Neutron::SecurityGroup
+ vLB:
+ depends_on:
+ - security_group
+ - packet_mirror_network
+ - packet_mirror_network_subnet
+ - packet_internal_network
+ - packet_internal_network_subnet
+ properties:
+ domain_name:
+ get_param: domain_name
+ vlb_image_name:
+ get_param: base_image_name
+ manager_name_0:
+ get_param: manager_name_0
+ manager_oam_direct_ip_0:
+ get_param: manager_oam_direct_ip_0
+ ntp_timezone:
+ get_param: ntp_timezone
+ oam_private_net_name:
+ get_param: oam_private_net_name
+ packet_internal_network:
+ get_resource: packet_internal_network
+ packet_mirror_network:
+ get_resource: packet_mirror_network
+ region_name:
+ get_param: region_name
+ rpmrepository_ip_0:
+ get_param: rpmrepository_ip_0
+ security_group:
+ get_resource: security_group
+ tenant_name:
+ get_param: tenant_name
+ availability_zone_0:
+ get_param: availability_zone_1
+ vLB_cluster_name:
+ get_param: vLB_cluster_name
+ vLB_flavor_name:
+ get_param: vLB_flavor_name
+ vLB_names:
+ get_param: vLB_names
+ vLB_node_count:
+ get_param: vLB_node_count
+ vLB_type:
+ get_param: vLB_type
+ vLB_version_name:
+ get_param: vLB_version_name
+ vLB_volume_name_0:
+ get_param: vLB_volume_name_0
+ vLB_volume_name_1:
+ get_param: vLB_volume_name_1
+ vLB_volume_name_2:
+ get_param: vLB_volume_name_2
+ vLB_volume_size_0:
+ get_param: vLB_volume_size_0
+ vLB_volume_size_1:
+ get_param: vLB_volume_size_1
+ vLB_volume_size_2:
+ get_param: vLB_volume_size_2
+ vLB_volume_type_0:
+ get_param: vLB_volume_type_0
+ vLB_volume_type_1:
+ get_param: vLB_volume_type_1
+ vLB_volume_type_2:
+ get_param: vLB_volume_type_2
+ vProbe_cluster_name:
+ get_param: vProbe_cluster_name
+ vf_module_id:
+ get_param: vf_module_id
+ vf_module_name:
+ get_param: vf_module_name
+ vnf_id:
+ get_param: vnf_id
+ type: FEAdd_On_Module_vLBTemplate.yaml
+ vLBAgent:
+ depends_on:
+ - security_group
+ - packet_mirror_network
+ - packet_mirror_network_subnet
+ - packet_internal_network
+ - packet_internal_network_subnet
+ properties:
+ domain_name:
+ get_param: domain_name
+ vlb_agent_image_name:
+ get_param: base_image_name
+ manager_name_0:
+ get_param: manager_name_0
+ manager_oam_direct_ip_0:
+ get_param: manager_oam_direct_ip_0
+ ntp_timezone:
+ get_param: ntp_timezone
+ oam_private_net_name:
+ get_param: oam_private_net_name
+ packet_internal_network:
+ get_resource: packet_internal_network
+ packet_mirror_network:
+ get_resource: packet_mirror_network
+ region_name:
+ get_param: region_name
+ rpmrepository_ip_0:
+ get_param: rpmrepository_ip_0
+ security_group:
+ get_resource: security_group
+ tenant_name:
+ get_param: tenant_name
+ availability_zone_0:
+ get_param: availability_zone_2
+ vLBAgent_cluster_name:
+ get_param: vLBAgent_cluster_name
+ vLBAgent_flavor_name:
+ get_param: vLBAgent_flavor_name
+ vLBAgent_names:
+ get_param: vLBAgent_names
+ vLBAgent_node_count:
+ get_param: vLBAgent_node_count
+ vLBAgent_type:
+ get_param: vLBAgent_type
+ vLBAgent_version_name:
+ get_param: vLBAgent_version_name
+ vLBAgent_volume_name_0:
+ get_param: vLBAgent_volume_name_0
+ vLBAgent_volume_name_1:
+ get_param: vLBAgent_volume_name_1
+ vLBAgent_volume_name_2:
+ get_param: vLBAgent_volume_name_2
+ vLBAgent_volume_size_0:
+ get_param: vLBAgent_volume_size_0
+ vLBAgent_volume_size_1:
+ get_param: vLBAgent_volume_size_1
+ vLBAgent_volume_size_2:
+ get_param: vLBAgent_volume_size_2
+ vLBAgent_volume_type_0:
+ get_param: vLBAgent_volume_type_0
+ vLBAgent_volume_type_1:
+ get_param: vLBAgent_volume_type_1
+ vLBAgent_volume_type_2:
+ get_param: vLBAgent_volume_type_2
+ vLB_cluster_name:
+ get_param: vLB_cluster_name
+ vLB_node_count:
+ get_param: vLB_node_count
+ vProbe_cluster_name:
+ get_param: vProbe_cluster_name
+ vf_module_id:
+ get_param: vf_module_id
+ vf_module_name:
+ get_param: vf_module_name
+ vnf_id:
+ get_param: vnf_id
+ type: FEAdd_On_Module_vLBAgentTemplate.yaml
+ vProbe:
+ depends_on:
+ - security_group
+ - packet_mirror_network
+ - packet_mirror_network_subnet
+ - packet_internal_network
+ - packet_internal_network_subnet
+ properties:
+ cdr_network:
+ get_param: cdr_network
+ domain_name:
+ get_param: domain_name
+ vprobe_image_name:
+ get_param: base_image_name
+ manager_name_0:
+ get_param: manager_name_0
+ manager_oam_direct_ip_0:
+ get_param: manager_oam_direct_ip_0
+ ntp_timezone:
+ get_param: ntp_timezone
+ oam_private_net_name:
+ get_param: oam_private_net_name
+ packet_internal_network:
+ get_resource: packet_internal_network
+ qrouter_cluster_name:
+ get_param: qrouter_cluster_name
+ qtrace_name_0:
+ get_param: qtrace_name_0
+ region_name:
+ get_param: region_name
+ rpmrepository_ip_0:
+ get_param: rpmrepository_ip_0
+ security_group:
+ get_resource: security_group
+ tenant_name:
+ get_param: tenant_name
+ vLB_node_count:
+ get_param: vLB_node_count
+ vProbe_cluster_name:
+ get_param: vProbe_cluster_name
+ vProbe_node_count:
+ get_param: vProbe_node_count
+ vProbe_version_name:
+ get_param: vProbe_version_name
+ vf_module_id:
+ get_param: vf_module_id
+ vf_module_name:
+ get_param: vf_module_name
+ vnf_id:
+ get_param: vnf_id
+ vprobe_AppDependenciesMachineType:
+ get_param: vprobe_AppDependenciesMachineType
+ availability_zone_0:
+ get_param: availability_zone_3
+ vprobe_flavor_name:
+ get_param: vprobe_flavor_name
+ vprobe_names:
+ get_param: vprobe_names
+ vprobe_type:
+ get_param: vprobe_type
+ vprobe_volume_name_0:
+ get_param: vprobe_volume_name_0
+ vprobe_volume_name_1:
+ get_param: vprobe_volume_name_1
+ vprobe_volume_name_2:
+ get_param: vprobe_volume_name_2
+ vprobe_volume_size_0:
+ get_param: vprobe_volume_size_0
+ vprobe_volume_size_1:
+ get_param: vprobe_volume_size_1
+ vprobe_volume_size_2:
+ get_param: vprobe_volume_size_2
+ vprobe_volume_type_0:
+ get_param: vprobe_volume_type_0
+ vprobe_volume_type_1:
+ get_param: vprobe_volume_type_1
+ vprobe_volume_type_2:
+ get_param: vprobe_volume_type_2
+ win_domain_name:
+ get_param: win_domain_name
+ type: FEAdd_On_Module_vProbeTemplate.yaml
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..1daa39bfdc
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/MANIFEST.json
@@ -0,0 +1,89 @@
+{
+ "name": "",
+ "description": "",
+ "data": [
+ {
+ "file": "FEAdd_On_Module_vLBTemplate.yaml",
+ "type": "HEAT",
+ "isBase": "false"
+ },
+ {
+ "file": "FEAdd_On_Module_QRouterTemplate.yaml",
+ "type": "HEAT",
+ "isBase": "false"
+ },
+ {
+ "file": "FEBase_Module.yaml",
+ "type": "HEAT",
+ "isBase": "true",
+ "data": [
+ {
+ "file": "FEBase_Module.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "FEAdd_On_Module_vLBAgentTemplate.yaml",
+ "type": "HEAT",
+ "isBase": "false"
+ },
+ {
+ "file": "FEAdd_On_Module_vProbeTemplate.yaml",
+ "type": "HEAT",
+ "isBase": "false"
+ },
+ {
+ "file": "qrouterdependencies.json",
+ "type": "OTHER"
+ },
+ {
+ "file": "vlbagentdependencies_with_vLB.json",
+ "type": "OTHER"
+ },
+ {
+ "file": "wait_for_resources.py",
+ "type": "OTHER"
+ },
+ {
+ "file": "vprobedependencies.json",
+ "type": "OTHER"
+ },
+ {
+ "file": "FEAdd_On_Module_vProbeCloudConfig",
+ "type": "OTHER"
+ },
+ {
+ "file": "call_home.py",
+ "type": "OTHER"
+ },
+ {
+ "file": "check_availability.py",
+ "type": "OTHER"
+ },
+ {
+ "file": "vlbdependencies.json",
+ "type": "OTHER"
+ },
+ {
+ "file": "FEAdd_On_Module_QRouterCloudConfig",
+ "type": "OTHER"
+ },
+ {
+ "file": "vlbagentdependencies_without_vLB.json",
+ "type": "OTHER"
+ },
+ {
+ "file": "FEAdd_On_Module_vLBAgentCloudConfig",
+ "type": "OTHER"
+ },
+ {
+ "file": "register_status.py",
+ "type": "OTHER"
+ },
+ {
+ "file": "FEAdd_On_Module_vLBCloudConfig",
+ "type": "OTHER"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/call_home.py b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/call_home.py
new file mode 100644
index 0000000000..54f2a69c09
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/call_home.py
@@ -0,0 +1,97 @@
+import argparse
+import json
+import re
+import requests
+from socket import getfqdn
+from sys import platform
+from time import sleep
+
+
+PARSER = argparse.ArgumentParser()
+PARSER.add_argument("manager_ip", help="The IPv4 Address where one can read the MaveriQConductor.")
+PARSER.add_argument("--mockupfile", type=str, help="The path of the json mockupfile to use.")
+ARGS = PARSER.parse_args()
+
+URL = "http://{0}:8084/MaveriQConductor/machine/create".format(ARGS.manager_ip)
+URL_AVAIL = "http://{0}:8084/MaveriQConductor/isReady".format(ARGS.manager_ip)
+HEADERS = {
+ 'Accept': 'text/plain',
+ 'Content-type': 'application/json',
+ 'Connection': 'close'
+}
+
+NETWORK_MAP = {
+ "$$OAM_NET_IP$$": "oam_private_network_ip",
+ "$$BACKEND_NET_IP$$": "backend_interconnect_network_ip",
+ "$$PACKET_MIRROR_NET_IP$$": "packet_mirror_network_ip",
+ "$$CDR_NET_IP$$": "cdr_network_ip",
+ "$$VERTICA_NET_IP$$": "vertica_private_network_ip",
+ "$$PACKET_INTERNAL_NET_IP$$": "packet_internal_network_ip",
+ "$$OAM_PROTECTED_NET_IP$$": "oam_protected_network_ip"
+}
+
+
+def map_ips_to_networks(p_meta_data):
+ network_to_ip = {}
+ for network_name in NETWORK_MAP.keys():
+ if NETWORK_MAP[network_name] in p_meta_data:
+ network_to_ip[network_name] = str(p_meta_data[NETWORK_MAP[network_name]])
+ return network_to_ip
+
+
+def check_availability():
+ is_connected = False
+ while is_connected is False:
+ try:
+ if requests.get(URL_AVAIL, headers={'Connection': 'close'}).status_code is 200:
+ is_connected = True
+ sleep(2)
+ except requests.exceptions.ConnectionError:
+ sleep(2)
+
+
+def post_request(p_json_data, p_headers):
+ req = requests.post(url=URL, data=p_json_data, headers=p_headers)
+ return req.status_code
+
+
+def multiple_replace(regex_dictionary, text):
+ regex = re.compile("(%s)" % "|".join(map(re.escape, regex_dictionary.keys())))
+ return regex.sub(
+ lambda x: regex_dictionary[x.string[x.start():x.end()]], text
+ )
+
+
+def main():
+ # Depending on platform, load the dependencies and meta.js files.
+ if ARGS.mockupfile:
+ with open(ARGS.mockupfile, 'r') as mockup_file:
+ mockup_file_data = mockup_file.read()
+ return post_request(mockup_file_data, HEADERS)
+ else:
+ if platform.startswith('linux'):
+ with open(r'/root/dependencies.json', 'r') as json_file:
+ json_data = json_file.read()
+ with open(r'/meta.js', 'r') as json_file:
+ meta_data = json.load(json_file)
+
+ elif platform == 'cygwin' or platform == 'win32':
+ with open(r'c:\\dependencies.json', 'r') as json_file:
+ json_data = json_file.read()
+ with open(r'c:\\meta.js', 'r') as json_file:
+ meta_data = json.load(json_file)
+ else:
+ json_data = {}
+ meta_data = {}
+ raise Exception('Unsupported platform')
+ # Build dictionary mapping each IP to network.
+ regex_dict = map_ips_to_networks(meta_data)
+ regex_dict['$$HOSTNAME$$'] = getfqdn()
+
+ # Perform any replacement needed.
+ json_data = multiple_replace(regex_dict, json_data)
+ print json_data
+ check_availability()
+ return post_request(p_json_data=json_data, p_headers=HEADERS)
+
+print main()
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/check_availability.py b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/check_availability.py
new file mode 100644
index 0000000000..e93b372f15
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/check_availability.py
@@ -0,0 +1,34 @@
+#!/usr/local/bin/python2.7
+import argparse
+import requests
+import sys
+from time import sleep
+
+conductor_url = "http://{0}:8084/MaveriQConductor/isReady"
+check_api = "http://{0}:8084/MaveriQManager/api/Inventory/isReady"
+check_user = "omniq"
+check_password = "radcom"
+
+
+PARSER = argparse.ArgumentParser()
+PARSER.add_argument("ScribeIP", type=str,
+ help="The Stage the application is currently in")
+ARGS = PARSER.parse_args()
+
+print "Begining check availability check!"
+isConnected = False
+while isConnected is False:
+ try:
+ sys.stdout.write('.')
+ sleep(2)
+ if requests.get(conductor_url.format(ARGS.ScribeIP),
+ headers={'Connection': 'close'}).status_code is 200 and requests.get(
+ check_api.format(ARGS.ScribeIP,
+ headers={'Connection': 'close'}),
+ auth=requests.auth.HTTPBasicAuth(check_user,
+ check_password)).status_code is 200:
+ isConnected = True
+ except requests.exceptions.ConnectionError as e:
+ sleep(2)
+
+print 'Conductor and Scribe are ready!'
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/qrouterdependencies.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/qrouterdependencies.json
new file mode 100644
index 0000000000..0a570b612b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/qrouterdependencies.json
@@ -0,0 +1,35 @@
+{
+ "name": "$$HOSTNAME$$",
+ "type": "qrouter",
+ "cluster": "QROUTER_CLUSTER_NAME",
+ "node_count": "QROUTER_NODE_COUNT",
+ "attributes": [
+ {
+ "name": "ip-eth0",
+ "value": "$$OAM_NET_IP$$"
+ },
+ {
+ "name": "rprb_26071_oam_direct_net_1",
+ "value": "$$OAM_NET_IP$$"
+ },
+ {
+ "name": "rprb_26071_cdr_direct_net_1",
+ "value": "$$CDR_NET_IP$$"
+ }
+ ],
+ "dependencies": [
+ {
+ "resource_name": "ProcessingCluster",
+ "resource_type": "cluster",
+ "attribute": "rprb_26071_cdr_direct_net_1",
+ "role": "processing_ip",
+ "format": "all"
+ },
+ {
+ "resource_name": "MANAGER_INSTANCE_NAME",
+ "resource_type": "machine",
+ "attribute": "rprb_26071_oam_direct_net_1",
+ "role": "manager_oam_direct_ip"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/register_status.py b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/register_status.py
new file mode 100644
index 0000000000..98adafaf2f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/register_status.py
@@ -0,0 +1,126 @@
+#!/usr/local/bin/python2.7
+"""
+This script is a combination of the AddComponentScript and the OnBoardingStatus
+scripts. Depending on the arguments given, it will either post an
+"addMachineCommand" or an "logOnBoardingInfo" request.
+"""
+import argparse
+import json
+import netifaces
+import requests
+from socket import getfqdn
+import sys
+from time import time
+
+
+parser = argparse.ArgumentParser()
+parser.add_argument("scribe_ip", type=str,
+ help="The IP where the Scribe can be reached.")
+parser.add_argument("--component-type", type=str,
+ help="The component type.", required=False)
+parser.add_argument("--component-version", type=str,
+ help="The component version.", required=False)
+parser.add_argument("--stage", type=str, required=False)
+parser.add_argument("--status", required=False,
+ choices=["WARNING", "INFO", "ERROR", "OK", "FAILURE"])
+parser.add_argument("--description", type=str, required=False)
+args = parser.parse_args()
+
+add_machine_ip = "http://{0}:8084/MaveriQManager/api/Inventory/addComponent".format(args.scribe_ip)
+log_onboarding_info_ip = "http://{0}:8084/MaveriQManager/api/Inventory/logOnBoardingInfo".format(args.scribe_ip)
+user = 'omniq'
+password = 'radcom'
+
+REGION = ""
+TENANT = ""
+CLUSTER_NAME = ""
+VERSION_NUMBER = ""
+PROBE_ID = ""
+OAM_DIRECT_IP = ""
+MACHINE_TYPE = args.component_type
+MACHINE_NAME = getfqdn()
+HEALTH_STATUS = {}
+ADD_COMPONENT_BODY = {}
+
+
+def read_metadata():
+ """Read the instance metadata"""
+ global REGION
+ global TENANT
+ global CLUSTER_NAME
+ global VERSION_NUMBER
+ global PROBE_ID
+ global OAM_DIRECT_IP
+ with open('/meta.js', 'r') as json_file:
+ json_data = json.loads(json_file.read())
+ TENANT = json_data["tenant"]
+ REGION = json_data["region"]
+ CLUSTER_NAME = json_data["cluster_name"]
+ VERSION_NUMBER = json_data["version_number"]
+ OAM_DIRECT_IP = json_data["oam_private_network_ip"]
+ if MACHINE_TYPE == 'vProbe':
+ PROBE_ID = json_data["probe_id"]
+
+
+def build_health_json():
+ """Builds the actual health status"""
+ HEALTH_STATUS["Region"] = REGION
+ HEALTH_STATUS["Tenant"] = TENANT
+ HEALTH_STATUS["MachineType"] = args.component_type
+ HEALTH_STATUS["MachineName"] = getfqdn()
+ HEALTH_STATUS["MachineIP"] = OAM_DIRECT_IP
+ HEALTH_STATUS["Time"] = long(time())
+ HEALTH_STATUS["Description"] = args.description
+ HEALTH_STATUS["Status"] = args.status
+ HEALTH_STATUS["Stage"] = args.stage
+ return HEALTH_STATUS
+
+
+def build_add_json():
+ """Builds the actual health status"""
+ ADD_COMPONENT_BODY["region"] = REGION
+ ADD_COMPONENT_BODY["tenant"] = TENANT
+ ADD_COMPONENT_BODY["componentType"] = args.component_type
+ ADD_COMPONENT_BODY["clusterName"] = CLUSTER_NAME
+ ADD_COMPONENT_BODY["componentVersionNumber"] = VERSION_NUMBER
+ ADD_COMPONENT_BODY["machineName"] = MACHINE_NAME
+ ADD_COMPONENT_BODY["machineNetworkInterfaces"] = []
+ ADD_COMPONENT_BODY["OAM_IP"] = OAM_DIRECT_IP
+
+ for interface in netifaces.interfaces():
+ ADD_COMPONENT_BODY["machineNetworkInterfaces"].append({"name": interface, "value": netifaces.ifaddresses(interface)[2][0]['addr']})
+
+ if PROBE_ID is not "":
+ ADD_COMPONENT_BODY["machineID"] = REGION + '_' + TENANT + '_' +\
+ CLUSTER_NAME + '_' + MACHINE_NAME + '_' + PROBE_ID
+ else:
+ ADD_COMPONENT_BODY["machineID"] = REGION + '_' + TENANT + '_' +\
+ CLUSTER_NAME + '_' + MACHINE_NAME
+ return ADD_COMPONENT_BODY
+
+
+def send_postage(p_url, p_url_user, p_url_password, p_json_data):
+ json_header = {'Content-type': 'application/json'}
+ request = requests.post(p_url, json.dumps(p_json_data), json_header, auth=requests.auth.HTTPBasicAuth(p_url_user, p_url_password))
+ print request.status_code
+ if (request.status_code != 200):
+ sys.exit(1)
+ return request.status_code
+
+
+def post_health():
+ read_metadata()
+ return send_postage(log_onboarding_info_ip, user, password,
+ build_health_json())
+
+
+def post_add_machine():
+ read_metadata()
+ return send_postage(add_machine_ip, user, password, build_add_json())
+
+if args.stage is None and args.status is None and args.description is None:
+ print "adding machine"
+ print post_add_machine()
+else:
+ print "logging health"
+ print post_health()
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/vlbagentdependencies_with_vLB.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/vlbagentdependencies_with_vLB.json
new file mode 100644
index 0000000000..0304a18f0e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/vlbagentdependencies_with_vLB.json
@@ -0,0 +1,46 @@
+{
+ "name": "$$HOSTNAME$$",
+ "type": "vLBAgent",
+ "cluster": "VLBAGENT_CLUSTER_NAME",
+ "node_count": "VLBAGENT_NODE_COUNT",
+ "attributes": [
+ {
+ "name": "ip-eth0",
+ "value": "$$OAM_NET_IP$$"
+ },
+ {
+ "name": "rprb_26071_oam_direct_net_1",
+ "value": "$$OAM_NET_IP$$"
+ },
+ {
+ "name": "rprb_26071_mme_int_pktmirror_net_1",
+ "value": "$$PACKET_MIRROR_NET_IP$$"
+ },
+ {
+ "name": "rprb_26071_mme_int_pktinternal_net_1",
+ "value": "$$PACKET_INTERNAL_NET_IP$$"
+ }
+ ],
+ "dependencies": [
+ {
+ "resource_name": "VPROBE_CLUSTER_NAME",
+ "resource_type": "cluster",
+ "attribute": "eth0-eth2-and-ProbeInstance",
+ "role": "vProbe_cluster",
+ "format": "all"
+ },
+ {
+ "resource_name": "VLB_CLUSTER_NAME",
+ "resource_type": "cluster",
+ "attribute": "eth1-eth2-and-vLBInstance",
+ "role": "vLB_cluster",
+ "format": "all"
+ },
+ {
+ "resource_name": "MANAGER_INSTANCE_NAME",
+ "resource_type": "machine",
+ "attribute": "rprb_26071_oam_direct_net_1",
+ "role": "manager_oam_direct_ip"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/vlbagentdependencies_without_vLB.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/vlbagentdependencies_without_vLB.json
new file mode 100644
index 0000000000..1af6af96c5
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/vlbagentdependencies_without_vLB.json
@@ -0,0 +1,39 @@
+{
+ "name": "$$HOSTNAME$$",
+ "type": "vLBAgent",
+ "cluster": "VLBAGENT_CLUSTER_NAME",
+ "node_count": "VLBAGENT_NODE_COUNT",
+ "attributes": [
+ {
+ "name": "ip-eth0",
+ "value": "$$OAM_NET_IP$$"
+ },
+ {
+ "name": "rprb_26071_oam_direct_net_1",
+ "value": "$$OAM_NET_IP$$"
+ },
+ {
+ "name": "rprb_26071_mme_int_pktmirror_net_1",
+ "value": "$$PACKET_MIRROR_NET_IP$$"
+ },
+ {
+ "name": "rprb_26071_mme_int_pktinternal_net_1",
+ "value": "$$PACKET_INTERNAL_NET_IP$$"
+ }
+ ],
+ "dependencies": [
+ {
+ "resource_name": "VPROBE_CLUSTER_NAME",
+ "resource_type": "cluster",
+ "attribute": "eth0-eth2-and-ProbeInstance",
+ "role": "vProbe_cluster",
+ "format": "all"
+ },
+ {
+ "resource_name": "MANAGER_INSTANCE_NAME",
+ "resource_type": "machine",
+ "attribute": "rprb_26071_oam_direct_net_1",
+ "role": "manager_oam_direct_ip"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/vlbdependencies.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/vlbdependencies.json
new file mode 100644
index 0000000000..b0a0da7b52
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/vlbdependencies.json
@@ -0,0 +1,43 @@
+{
+ "name": "$$HOSTNAME$$",
+ "type": "vLB",
+ "cluster": "VLB_CLUSTER_NAME",
+ "node_count": "VLB_NODE_COUNT",
+ "attributes": [
+ {
+ "name": "ip-eth0",
+ "value": "$$OAM_NET_IP$$"
+ },
+ {
+ "name": "rprb_26071_oam_direct_net_1",
+ "value": "$$OAM_NET_IP$$"
+ },
+ {
+ "name": "rprb_26071_mme_int_pktmirror_net_1",
+ "value": "$$PACKET_MIRROR_NET_IP$$"
+ },
+ {
+ "name": "rprb_26071_mme_int_pktinternal_net_1",
+ "value": "$$PACKET_INTERNAL_NET_IP$$"
+ },
+ {
+ "name": "eth1-eth2-and-vLBInstance",
+ "value": "$$OAM_NET_IP$$@$$PACKET_INTERNAL_NET_IP$$@VLB_INSTANCE"
+ }
+ ],
+ "dependencies": [
+ {
+ "resource_name": "VPROBE_CLUSTER_NAME",
+ "resource_type": "cluster",
+ "attribute": "eth0-eth2-and-ProbeInstance",
+ "role": "vProbe_cluster",
+ "format": "all"
+ },
+ {
+ "resource_name": "MANAGER_INSTANCE_NAME",
+ "resource_type": "machine",
+ "attribute": "rprb_26071_oam_direct_net_1",
+ "role": "manager_oam_direct_ip"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/vprobedependencies.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/vprobedependencies.json
new file mode 100644
index 0000000000..78768cf545
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/vprobedependencies.json
@@ -0,0 +1,49 @@
+{
+ "name": "$$HOSTNAME$$",
+ "type": "vprobe",
+ "cluster": "VPROBE_CLUSTER_NAME",
+ "node_count": "VPROBE_NODE_COUNT",
+ "attributes": [
+ {
+ "name": "ip-eth0",
+ "value": "$$OAM_NET_IP$$"
+ },
+ {
+ "name": "rprb_26071_oam_direct_net_1",
+ "value": "$$OAM_NET_IP$$"
+ },
+ {
+ "name": "rprb_26071_cdr_direct_net_1",
+ "value": "$$CDR_NET_IP$$"
+ },
+ {
+ "name": "rprb_26071_mme_int_pktinternal_net_1",
+ "value": "$$PACKET_INTERNAL_NET_IP$$"
+ },
+ {
+ "name": "eth0-eth2-and-ProbeInstance",
+ "value": "$$OAM_NET_IP$$@$$PACKET_INTERNAL_NET_IP$$@PROBE_INSTANCE"
+ }
+ ],
+ "dependencies": [
+ {
+ "resource_name": "QROUTER_CLUSTER_NAME",
+ "resource_type": "cluster",
+ "attribute": "rprb_26071_cdr_direct_net_1",
+ "role": "qrouter_cluster",
+ "format": "all"
+ },
+ {
+ "resource_name": "QTRACE_HOST_NAME",
+ "resource_type": "machine",
+ "attribute": "rprb_26071_oam_direct_net_1",
+ "role": "qtrace_public_ip"
+ },
+ {
+ "resource_name": "MANAGER_INSTANCE_NAME",
+ "resource_type": "machine",
+ "attribute": "rprb_26071_oam_direct_net_1",
+ "role": "manager_oam_direct_ip"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/wait_for_resources.py b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/wait_for_resources.py
new file mode 100644
index 0000000000..5d960d659e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/wait_for_resources.py
@@ -0,0 +1,84 @@
+import argparse
+import json
+import netifaces
+import os
+import sys
+import time
+
+TIME_INTERVAL = 10
+
+
+def parse_json_file(json_path):
+ with open(json_path, 'r') as json_file:
+ data = json.load(json_file)
+ return data
+
+
+def check_network_interfaces():
+ for interface in netifaces.interfaces():
+ if(sys.platform != 'win32' or netifaces.ifaddresses(interface)[-1000][0]['addr'] != '00:00:00:00:00:00:00:e0'):
+ while 2 not in netifaces.ifaddresses(interface).keys() and 23 not in netifaces.ifaddresses(interface).keys():
+ print "Still waiting for interface:", interface
+ time.sleep(TIME_INTERVAL)
+
+
+def check_connectivity():
+ if sys.platform.startswith('linux'):
+ ping_str = "ping -c 1 "
+ elif sys.platform == 'cygwin' or sys.platform == 'win32':
+ ping_str = "ping -n 1 "
+
+ while os.system(ping_str + component_ip) != 0:
+ print "No connectivity to", component_ip, "waiting", TIME_INTERVAL, "seconds"
+ time.sleep(TIME_INTERVAL)
+
+
+def check_cinder_mounts():
+ if sys.platform.startswith('linux'):
+ meta_data = parse_json_file('/meta.js')
+ elif sys.platform == 'cygwin' or sys.platform == 'win32':
+ meta_data = parse_json_file('c:\\meta.js')
+
+ cinder_count = 0
+
+ for info in meta_data:
+ if info.startswith('mount'):
+ cinder_count += 1
+
+ if sys.platform.startswith('linux'):
+ cinder_attached = os.popen('ls /dev/disk/by-id/virtio* | wc -l').read()
+ elif sys.platform == 'cygwin' or sys.platform == 'win32':
+ cinder_attached = os.popen("wmic diskdrive get DeviceID | find /i \"PHYSICALDRIVE\" | find /V \"0\" /C").read()
+
+ while (int(cinder_attached) < cinder_count) and (cinder_count != 0):
+ print "Missing a cinder mount, waiting", TIME_INTERVAL, "seconds"
+ time.sleep(TIME_INTERVAL)
+
+ if sys.platform.startswith('linux'):
+ cinder_attached = os.popen('ls /dev/disk/by-id/virtio* | wc -l').read()
+
+ elif sys.platform == 'cygwin' or sys.platform == 'win32':
+ cinder_attached = os.popen(
+ "wmic diskdrive get DeviceID | find /i \"PHYSICALDRIVE\" | find /V \"0\" /C").read()
+
+ if int(cinder_attached) == cinder_count:
+ print "All cinder are attached and ready to be formatted and mounted"
+
+
+def main():
+ check_network_interfaces()
+ check_cinder_mounts()
+
+ if component_ip is not None:
+ check_connectivity()
+
+ print "All resources are ready"
+
+
+if __name__ == "__main__":
+ parser = argparse.ArgumentParser(description='This script is waiting for network and volume resources to come up')
+ parser.add_argument('-m', '--component_ip', metavar='component_ip', type=str, help='The component ip', required=False)
+ args = parser.parse_args()
+ component_ip = args.component_ip
+ globals().update(args.__dict__)
+ main()
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectionmulti/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectionmulti/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..72905b3b21
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectionmulti/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,340 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cmaui:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ security_group_id1:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ security_group_name:
+ label: security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of security group
+ security_group_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ hidden: false
+ immutable: false
+ type: string
+ description: cmaui_oam_ips
+ shared_network_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ jsa_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ security_group_id3:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ security_group_id2:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ node_templates:
+ cmaui_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_id
+ - get_input: security_group_id3
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: shared_network_id
+ server_cmaui:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ jsa_security_group1:
+ type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules
+ properties:
+ name:
+ get_input: security_group_name
+ description: ems security group
+ rules:
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ - protocol: tcp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: egress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: egress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv6
+ remote_ip_prefix: ::/0
+ direction: egress
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ - protocol: tcp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv6
+ remote_ip_prefix: ::/0
+ direction: ingress
+ requirements:
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: cmaui_port_0
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: cmaui_port_1
+ relationship: org.openecomp.relationships.AttachesTo
+ jsa_security_group2:
+ type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules
+ properties:
+ name:
+ get_input: security_group_name
+ description: ems security group
+ rules:
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ - protocol: tcp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: egress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: egress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv6
+ remote_ip_prefix: ::/0
+ direction: egress
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ - protocol: tcp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv6
+ remote_ip_prefix: ::/0
+ direction: ingress
+ requirements:
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: cmaui_port_1
+ relationship: org.openecomp.relationships.AttachesTo
+ cmaui_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_id1
+ - get_input: security_group_id2
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: shared_network_id
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ cmaui_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_id1
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: shared_network_id
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ addOn:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/addOn.yml
+ description: cmaui server template for vMMSC
+ members:
+ - cmaui_port_2
+ - server_cmaui
+ - cmaui_port_1
+ - cmaui_port_0
+ main:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/main.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - jsa_security_group1
+ - jsa_security_group2 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectionmulti/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectionmulti/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..1f762d0ccc
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectionmulti/inputfiles/MANIFEST.json
@@ -0,0 +1,17 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "main.yml",
+ "type": "HEAT",
+ "isBase": "true"
+ },
+ {
+ "file": "addOn.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectionmulti/inputfiles/addOn.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectionmulti/inputfiles/addOn.yml
new file mode 100644
index 0000000000..24dc9d7678
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectionmulti/inputfiles/addOn.yml
@@ -0,0 +1,72 @@
+heat_template_version: 2013-05-23
+
+description: cmaui server template for vMMSC
+
+parameters:
+ security_group_id1:
+ type: string
+ description: UID of OAM network
+ security_group_id2:
+ type: string
+ description: UID of OAM network
+ security_group_id:
+ type: string
+ description: UID of OAM network
+ security_group_id3:
+ type: string
+ description: UID of OAM network
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ shared_network_id:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_oam_ips:
+ type: string
+ description: cmaui_oam_ips
+resources:
+
+ cmaui_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: shared_network_id }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_id1}]
+ replacement_policy: AUTO
+
+ cmaui_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: shared_network_id }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_id1},{get_param: security_group_id2}]
+ replacement_policy: AUTO
+
+ cmaui_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: shared_network_id }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_id},{get_param: security_group_id3}]
+ replacement_policy: AUTO
+
+ server_cmaui:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_0 }
+ - port: { get_resource: cmaui_port_1 } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectionmulti/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectionmulti/inputfiles/main.yml
new file mode 100644
index 0000000000..8a6e72c1ba
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectionmulti/inputfiles/main.yml
@@ -0,0 +1,58 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ jsa_net_name:
+ type: string
+ description: network name of jsa log network
+
+resources:
+ jsa_security_group1:
+ type: OS::Neutron::SecurityGroup
+ properties:
+ description: ems security group
+ name: {get_param: security_group_name}
+ rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"},
+ {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"},
+ {"direction": egress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"}
+ ]
+
+ jsa_security_group2:
+ type: OS::Neutron::SecurityGroup
+ properties:
+ description: ems security group
+ name: {get_param: security_group_name}
+ rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"},
+ {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"},
+ {"direction": egress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"}
+ ]
+
+outputs:
+ security_group_id1:
+ value: {get_resource: jsa_security_group1}
+ security_group_id2:
+ value: {get_resource: jsa_security_group2} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..21e8ec8cdb
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,222 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ security_group_name:
+ label: security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of security group
+ jsa_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ node_templates:
+ jsa_security_group1:
+ type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules
+ properties:
+ name:
+ get_input: security_group_name
+ description: ems security group
+ rules:
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ - protocol: tcp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: egress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: egress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv6
+ remote_ip_prefix: ::/0
+ direction: egress
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ - protocol: tcp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv6
+ remote_ip_prefix: ::/0
+ direction: ingress
+ requirements:
+ - port:
+ capability: attachment_cmaui_port_0
+ node: test_nested
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: attachment_cmaui_port_1
+ node: test_nested
+ relationship: org.openecomp.relationships.AttachesTo
+ jsa_security_group2:
+ type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules
+ properties:
+ name:
+ get_input: security_group_name
+ description: ems security group
+ rules:
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ - protocol: tcp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: egress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: egress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv6
+ remote_ip_prefix: ::/0
+ direction: egress
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ - protocol: tcp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv6
+ remote_ip_prefix: ::/0
+ direction: ingress
+ requirements:
+ - port:
+ capability: attachment_cmaui_port_0
+ node: test_nested
+ relationship: org.openecomp.relationships.AttachesTo
+ test_nested:
+ type: org.openecomp.resource.abstract.nodes.heat.nested
+ directives:
+ - substitutable
+ properties:
+ p1: jsa_security_group1
+ service_template_filter:
+ substitute_service_template: nestedServiceTemplate.yaml
+ p2: jsa_security_group2
+ groups:
+ main:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/main.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - jsa_security_group1
+ - jsa_security_group2
+ - test_nested \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/expectedoutputfiles/nestedServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/expectedoutputfiles/nestedServiceTemplate.yaml
new file mode 100644
index 0000000000..c41ad87568
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/expectedoutputfiles/nestedServiceTemplate.yaml
@@ -0,0 +1,175 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cmaui:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p1:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ p2:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ hidden: false
+ immutable: false
+ type: string
+ description: cmaui_oam_ips
+ net:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ node_templates:
+ server_cmaui:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ cmaui_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: p1
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: net
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ cmaui_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: p1
+ - get_input: p2
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: net
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ nested:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested.yml
+ description: cmaui server template for vMMSC
+ members:
+ - server_cmaui
+ - cmaui_port_1
+ - cmaui_port_0
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested
+ capabilities:
+ host_server_cmaui:
+ - server_cmaui
+ - host
+ os_server_cmaui:
+ - server_cmaui
+ - os
+ endpoint_server_cmaui:
+ - server_cmaui
+ - endpoint
+ binding_server_cmaui:
+ - server_cmaui
+ - binding
+ scalable_server_cmaui:
+ - server_cmaui
+ - scalable
+ attachment_cmaui_port_0:
+ - cmaui_port_0
+ - attachment
+ attachment_cmaui_port_1:
+ - cmaui_port_1
+ - attachment
+ requirements:
+ local_storage_server_cmaui:
+ - server_cmaui
+ - local_storage
+ link_cmaui_port_0:
+ - cmaui_port_0
+ - link
+ link_cmaui_port_1:
+ - cmaui_port_1
+ - link \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..aca75b5055
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/inputfiles/MANIFEST.json
@@ -0,0 +1,17 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "main.yml",
+ "type": "HEAT",
+ "isBase": "true"
+ },
+ {
+ "file": "nested.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/inputfiles/main.yml
new file mode 100644
index 0000000000..bcd542b66d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/inputfiles/main.yml
@@ -0,0 +1,58 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ jsa_net_name:
+ type: string
+ description: network name of jsa log network
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+
+resources:
+ jsa_security_group1:
+ type: OS::Neutron::SecurityGroup
+ properties:
+ description: ems security group
+ name: {get_param: security_group_name}
+ rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"},
+ {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"},
+ {"direction": egress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"}
+ ]
+
+ jsa_security_group2:
+ type: OS::Neutron::SecurityGroup
+ properties:
+ description: ems security group
+ name: {get_param: security_group_name}
+ rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"},
+ {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"},
+ {"direction": egress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"}
+ ]
+
+ test_nested:
+ type: nested.yml
+ properties:
+ p1: { get_resource: jsa_security_group1}
+ p2: { get_resource: jsa_security_group2}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/inputfiles/nested.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/inputfiles/nested.yml
new file mode 100644
index 0000000000..7708565ef1
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/inputfiles/nested.yml
@@ -0,0 +1,58 @@
+heat_template_version: 2013-05-23
+
+description: cmaui server template for vMMSC
+
+parameters:
+ p1:
+ type: string
+ description: UID of OAM network
+ p2:
+ type: string
+ description: UID of OAM network
+ net:
+ type: string
+ description: UID of OAM network
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_oam_ips:
+ type: string
+ description: cmaui_oam_ips
+resources:
+
+ cmaui_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: net }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: p1},{get_param: p2}]
+ replacement_policy: AUTO
+
+ cmaui_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: net }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: p1}]
+ replacement_policy: AUTO
+
+ server_cmaui:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_0 }
+ - port: { get_resource: cmaui_port_1 } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..dc4eb45cda
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,241 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ security_group_name:
+ label: security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of security group
+ shared_security_group_id2:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ jsa_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ shared_security_group_id1:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ node_templates:
+ jsa_security_group1:
+ type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules
+ properties:
+ name:
+ get_input: security_group_name
+ description: ems security group
+ rules:
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ - protocol: tcp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: egress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: egress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv6
+ remote_ip_prefix: ::/0
+ direction: egress
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ - protocol: tcp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv6
+ remote_ip_prefix: ::/0
+ direction: ingress
+ requirements:
+ - port:
+ capability: attachment_cmaui_port_2
+ node: test_nested
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: attachment_cmaui_port_1
+ node: test_nested
+ relationship: org.openecomp.relationships.AttachesTo
+ jsa_security_group2:
+ type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules
+ properties:
+ name:
+ get_input: security_group_name
+ description: ems security group
+ rules:
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ - protocol: tcp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: egress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: egress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv6
+ remote_ip_prefix: ::/0
+ direction: egress
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ - protocol: tcp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv6
+ remote_ip_prefix: ::/0
+ direction: ingress
+ requirements:
+ - port:
+ capability: attachment_cmaui_port_1
+ node: test_nested
+ relationship: org.openecomp.relationships.AttachesTo
+ test_nested:
+ type: org.openecomp.resource.abstract.nodes.heat.nested
+ directives:
+ - substitutable
+ properties:
+ service_template_filter:
+ substitute_service_template: nestedServiceTemplate.yaml
+ p2:
+ get_input: shared_security_group_id2
+ shared_security_group_id1:
+ get_input: shared_security_group_id1
+ groups:
+ addOn:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/addOn.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - test_nested
+ main:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/main.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - jsa_security_group1
+ - jsa_security_group2 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/expectedoutputfiles/nestedServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/expectedoutputfiles/nestedServiceTemplate.yaml
new file mode 100644
index 0000000000..491e691e80
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/expectedoutputfiles/nestedServiceTemplate.yaml
@@ -0,0 +1,175 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cmaui:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p2:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ hidden: false
+ immutable: false
+ type: string
+ description: cmaui_port_1
+ net:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ shared_security_group_id1:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ node_templates:
+ cmaui_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: shared_security_group_id1
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: net
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ server_cmaui:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ cmaui_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: shared_security_group_id1
+ - get_input: p2
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: net
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ nested:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested.yml
+ description: cmaui server template for vMMSC
+ members:
+ - cmaui_port_2
+ - server_cmaui
+ - cmaui_port_1
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested
+ capabilities:
+ host_server_cmaui:
+ - server_cmaui
+ - host
+ os_server_cmaui:
+ - server_cmaui
+ - os
+ endpoint_server_cmaui:
+ - server_cmaui
+ - endpoint
+ binding_server_cmaui:
+ - server_cmaui
+ - binding
+ attachment_cmaui_port_2:
+ - cmaui_port_2
+ - attachment
+ scalable_server_cmaui:
+ - server_cmaui
+ - scalable
+ attachment_cmaui_port_1:
+ - cmaui_port_1
+ - attachment
+ requirements:
+ local_storage_server_cmaui:
+ - server_cmaui
+ - local_storage
+ link_cmaui_port_2:
+ - cmaui_port_2
+ - link
+ link_cmaui_port_1:
+ - cmaui_port_1
+ - link \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..8ba5fc48f4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/inputfiles/MANIFEST.json
@@ -0,0 +1,22 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "main.yml",
+ "type": "HEAT",
+ "isBase": "true"
+ },
+ {
+ "file": "nested.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ },
+ {
+ "file": "addOn.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/inputfiles/addOn.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/inputfiles/addOn.yml
new file mode 100644
index 0000000000..0e7619a478
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/inputfiles/addOn.yml
@@ -0,0 +1,26 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ shared_security_group_id1:
+ type: string
+ description: network name of jsa log network
+ shared_security_group_id2:
+ type: string
+ description: network name of jsa log network
+ jsa_net_name:
+ type: string
+ description: network name of jsa log network
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+
+resources:
+ test_nested:
+ type: nested.yml
+ properties:
+ shared_security_group_id1: { get_param: shared_security_group_id1}
+ p2: { get_param: shared_security_group_id2}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/inputfiles/main.yml
new file mode 100644
index 0000000000..9167ffbafd
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/inputfiles/main.yml
@@ -0,0 +1,58 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ jsa_net_name:
+ type: string
+ description: network name of jsa log network
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+
+resources:
+ jsa_security_group1:
+ type: OS::Neutron::SecurityGroup
+ properties:
+ description: ems security group
+ name: {get_param: security_group_name}
+ rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"},
+ {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"},
+ {"direction": egress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"}
+ ]
+
+ jsa_security_group2:
+ type: OS::Neutron::SecurityGroup
+ properties:
+ description: ems security group
+ name: {get_param: security_group_name}
+ rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"},
+ {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"},
+ {"direction": egress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"}
+ ]
+outputs:
+ shared_security_group_id1:
+ value: {get_resource: jsa_security_group1}
+
+ shared_security_group_id2:
+ value: {get_resource: jsa_security_group2}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/inputfiles/nested.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/inputfiles/nested.yml
new file mode 100644
index 0000000000..a5a74e9d2e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/inputfiles/nested.yml
@@ -0,0 +1,59 @@
+heat_template_version: 2013-05-23
+
+description: cmaui server template for vMMSC
+
+parameters:
+ shared_security_group_id1:
+ type: string
+ description: UID of OAM network
+ p2:
+ type: string
+ description: UID of OAM network
+ net:
+ type: string
+ description: UID of OAM network
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_oam_ips:
+ type: string
+ description: cmaui_port_1
+
+resources:
+
+ cmaui_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: net }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: shared_security_group_id1}, {get_param: p2}]
+ replacement_policy: AUTO
+
+ cmaui_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: net }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: shared_security_group_id1}]
+ replacement_policy: AUTO
+
+ server_cmaui:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_1 }
+ - port: { get_resource: cmaui_port_2 } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnectionmulti/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnectionmulti/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..1696e6ea39
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnectionmulti/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,332 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cmaui_image:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ security_group_id1:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: String
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ security_group_name:
+ label: security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of security group
+ security_group_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ hidden: false
+ immutable: false
+ type: string
+ description: cmaui_oam_ips
+ shared_network_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ jsa_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ security_group_id3:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ security_group_id2:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ node_templates:
+ cmaui_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_id
+ - get_input: security_group_id3
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: shared_network_id
+ server_cmaui:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui_image
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ jsa_security_group1:
+ type: org.openecomp.resource.nodes.heat.network.neutron.SecurityRules
+ properties:
+ name:
+ get_input: security_group_name
+ description: ems security group
+ rules:
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ - protocol: tcp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: egress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: egress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv6
+ remote_ip_prefix: ::/0
+ direction: egress
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ - protocol: tcp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv6
+ remote_ip_prefix: ::/0
+ direction: ingress
+ requirements:
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: cmaui_port_0
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: cmaui_port_1
+ relationship: org.openecomp.relationships.AttachesTo
+ jsa_security_group2:
+ type: org.openecomp.resource.nodes.heat.network.neutron.SecurityRules
+ properties:
+ name:
+ get_input: security_group_name
+ description: ems security group
+ rules:
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ - protocol: tcp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: egress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: egress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv6
+ remote_ip_prefix: ::/0
+ direction: egress
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ - protocol: tcp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv6
+ remote_ip_prefix: ::/0
+ direction: ingress
+ requirements:
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: cmaui_port_1
+ relationship: org.openecomp.relationships.AttachesTo
+ cmaui_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_id1
+ - get_input: security_group_id2
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: shared_network_id
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ cmaui_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_id1
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: shared_network_id
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ addOn:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/addOn.yml
+ description: cmaui server template for vMMSC
+ members:
+ - cmaui_port_2
+ - server_cmaui
+ - cmaui_port_1
+ - cmaui_port_0
+ main:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/main.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - jsa_security_group1
+ - jsa_security_group2 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportlinking/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportlinking/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..5ed12af4ae
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportlinking/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,231 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+topology_template:
+ inputs:
+ security_group_name:
+ label: security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of security group
+ shared_security_group_id2:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ jsa_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ shared_security_group_id1:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ node_templates:
+ jsa_security_group1:
+ type: org.openecomp.resource.nodes.heat.network.neutron.SecurityRules
+ properties:
+ name:
+ get_input: security_group_name
+ description: ems security group
+ rules:
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ - protocol: tcp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: egress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: egress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv6
+ remote_ip_prefix: ::/0
+ direction: egress
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ - protocol: tcp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv6
+ remote_ip_prefix: ::/0
+ direction: ingress
+ requirements:
+ - port:
+ capability: attachment_cmaui_port_2
+ node: test_nested
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: attachment_cmaui_port_1
+ node: test_nested
+ relationship: org.openecomp.relationships.AttachesTo
+ jsa_security_group2:
+ type: org.openecomp.resource.nodes.heat.network.neutron.SecurityRules
+ properties:
+ name:
+ get_input: security_group_name
+ description: ems security group
+ rules:
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ - protocol: tcp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: egress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: egress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv6
+ remote_ip_prefix: ::/0
+ direction: egress
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ - protocol: tcp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv6
+ remote_ip_prefix: ::/0
+ direction: ingress
+ requirements:
+ - port:
+ capability: attachment_cmaui_port_1
+ node: test_nested
+ relationship: org.openecomp.relationships.AttachesTo
+ test_nested:
+ type: org.openecomp.resource.abstract.nodes.heat.nested
+ directives:
+ - substitutable
+ properties:
+ service_template_filter:
+ substitute_service_template: nestedServiceTemplate.yaml
+ p2:
+ get_input: shared_security_group_id2
+ shared_security_group_id1:
+ get_input: shared_security_group_id1
+ groups:
+ addOn:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/addOn.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - test_nested
+ main:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/main.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - jsa_security_group1
+ - jsa_security_group2 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportlinking/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportlinking/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..8ba5fc48f4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportlinking/inputfiles/MANIFEST.json
@@ -0,0 +1,22 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "main.yml",
+ "type": "HEAT",
+ "isBase": "true"
+ },
+ {
+ "file": "nested.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ },
+ {
+ "file": "addOn.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..267fa61cd4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml
@@ -0,0 +1,119 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: GlobalSubstitutionTypes
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.abstract.nodes.heat.nested:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ cmaui_names:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p1:
+ type: string
+ description: UID of OAM network
+ p2:
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ availability_zone_0:
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ type: string
+ net:
+ type: string
+ description: UID of OAM network
+ requirements:
+ - link_cmaui_port_2:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ - local_storage_server_cmaui:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - link_cmaui_port_1:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ capabilities:
+ host_server_cmaui:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_cmaui:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_cmaui:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_cmaui:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_2:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_server_cmaui:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_1:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..9466ebff85
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,243 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ security_group_name:
+ label: security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of security group
+ shared_security_group_id2:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ jsa_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ shared_security_group_id1:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ node_templates:
+ mvs_modules:
+ type: org.openecomp.resource.abstract.nodes.heat.nested
+ directives:
+ - substitutable
+ properties:
+ p1:
+ get_input: shared_security_group_id1
+ service_template_filter:
+ substitute_service_template: nestedServiceTemplate.yaml
+ count: 3
+ mandatory: true
+ p2:
+ get_input: shared_security_group_id2
+ jsa_security_group1:
+ type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules
+ properties:
+ name:
+ get_input: security_group_name
+ description: ems security group
+ rules:
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ - protocol: tcp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: egress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: egress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv6
+ remote_ip_prefix: ::/0
+ direction: egress
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ - protocol: tcp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv6
+ remote_ip_prefix: ::/0
+ direction: ingress
+ requirements:
+ - port:
+ capability: attachment_cmaui_port_2
+ node: mvs_modules
+ relationship: org.openecomp.relationships.AttachesTo
+ - port:
+ capability: attachment_cmaui_port_1
+ node: mvs_modules
+ relationship: org.openecomp.relationships.AttachesTo
+ jsa_security_group2:
+ type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules
+ properties:
+ name:
+ get_input: security_group_name
+ description: ems security group
+ rules:
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: egress
+ - protocol: tcp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: egress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: egress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv6
+ remote_ip_prefix: ::/0
+ direction: egress
+ - protocol: tcp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv4
+ port_range_max: 65535
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ direction: ingress
+ - protocol: tcp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: udp
+ ethertype: IPv6
+ port_range_max: 65535
+ remote_ip_prefix: ::/0
+ direction: ingress
+ port_range_min: 1
+ - protocol: icmp
+ ethertype: IPv6
+ remote_ip_prefix: ::/0
+ direction: ingress
+ requirements:
+ - port:
+ capability: attachment_cmaui_port_1
+ node: mvs_modules
+ relationship: org.openecomp.relationships.AttachesTo
+ groups:
+ addOn:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/addOn.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - mvs_modules
+ main:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/main.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - jsa_security_group1
+ - jsa_security_group2 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/expectedoutputfiles/nestedServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/expectedoutputfiles/nestedServiceTemplate.yaml
new file mode 100644
index 0000000000..729e969c0c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/expectedoutputfiles/nestedServiceTemplate.yaml
@@ -0,0 +1,174 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cmaui:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ p1:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ p2:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ hidden: false
+ immutable: false
+ type: string
+ net:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ node_templates:
+ cmaui_port_2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: p1
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: net
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ server_cmaui:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ cmaui_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: p1
+ - get_input: p2
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: net
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ nested:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested.yml
+ description: cmaui server template for vMMSC
+ members:
+ - cmaui_port_2
+ - server_cmaui
+ - cmaui_port_1
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested
+ capabilities:
+ host_server_cmaui:
+ - server_cmaui
+ - host
+ os_server_cmaui:
+ - server_cmaui
+ - os
+ endpoint_server_cmaui:
+ - server_cmaui
+ - endpoint
+ binding_server_cmaui:
+ - server_cmaui
+ - binding
+ attachment_cmaui_port_2:
+ - cmaui_port_2
+ - attachment
+ scalable_server_cmaui:
+ - server_cmaui
+ - scalable
+ attachment_cmaui_port_1:
+ - cmaui_port_1
+ - attachment
+ requirements:
+ local_storage_server_cmaui:
+ - server_cmaui
+ - local_storage
+ link_cmaui_port_2:
+ - cmaui_port_2
+ - link
+ link_cmaui_port_1:
+ - cmaui_port_1
+ - link \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..8ba5fc48f4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/inputfiles/MANIFEST.json
@@ -0,0 +1,22 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "main.yml",
+ "type": "HEAT",
+ "isBase": "true"
+ },
+ {
+ "file": "nested.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ },
+ {
+ "file": "addOn.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/inputfiles/addOn.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/inputfiles/addOn.yml
new file mode 100644
index 0000000000..39c34742a4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/inputfiles/addOn.yml
@@ -0,0 +1,31 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ shared_security_group_id1:
+ type: string
+ description: network name of jsa log network
+ shared_security_group_id2:
+ type: string
+ description: network name of jsa log network
+ jsa_net_name:
+ type: string
+ description: network name of jsa log network
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+
+resources:
+ mvs_modules:
+ type: OS::Heat::ResourceGroup
+ properties:
+ count: 3
+ index_var: "%index%"
+ resource_def:
+ type: nested.yml
+ properties:
+ p1: { get_param: shared_security_group_id1}
+ p2: { get_param: shared_security_group_id2}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/inputfiles/main.yml
new file mode 100644
index 0000000000..9167ffbafd
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/inputfiles/main.yml
@@ -0,0 +1,58 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ jsa_net_name:
+ type: string
+ description: network name of jsa log network
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+
+resources:
+ jsa_security_group1:
+ type: OS::Neutron::SecurityGroup
+ properties:
+ description: ems security group
+ name: {get_param: security_group_name}
+ rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"},
+ {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"},
+ {"direction": egress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"}
+ ]
+
+ jsa_security_group2:
+ type: OS::Neutron::SecurityGroup
+ properties:
+ description: ems security group
+ name: {get_param: security_group_name}
+ rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"},
+ {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"},
+ {"direction": egress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
+ {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"},
+ {"direction": ingress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"}
+ ]
+outputs:
+ shared_security_group_id1:
+ value: {get_resource: jsa_security_group1}
+
+ shared_security_group_id2:
+ value: {get_resource: jsa_security_group2}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/inputfiles/nested.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/inputfiles/nested.yml
new file mode 100644
index 0000000000..597ca0219c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/inputfiles/nested.yml
@@ -0,0 +1,58 @@
+heat_template_version: 2013-05-23
+
+description: cmaui server template for vMMSC
+
+parameters:
+ p1:
+ type: string
+ description: UID of OAM network
+ p2:
+ type: string
+ description: UID of OAM network
+ net:
+ type: string
+ description: UID of OAM network
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_oam_ips:
+ type: string
+
+resources:
+
+ cmaui_port_1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: net }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: p1}, {get_param: p2}]
+ replacement_policy: AUTO
+
+ cmaui_port_2:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: net }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: p1}]
+ replacement_policy: AUTO
+
+ server_cmaui:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_1 }
+ - port: { get_resource: cmaui_port_2 } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..9885c31b1c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,1267 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.NCB1:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.GPB2:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.NCB2:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.GPB1:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.FSB2:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.VLC1:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.FSB1:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+ org.openecomp.resource.vfc.nodes.heat.VLC2:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ Internal2_name:
+ hidden: false
+ immutable: false
+ type: string
+ default: Internal2-subnet
+ vlc2-Internal2-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to vlc2-Internal2
+ default: 00:81:37:0E:02:12
+ epc-sctp-a-net-rt:
+ hidden: false
+ immutable: false
+ type: string
+ description: epc-sctp-a route target
+ default: 13979:105717
+ epc-sctp-b-net-rt:
+ hidden: false
+ immutable: false
+ type: string
+ description: epc-sctp-b route target
+ default: 13979:105719
+ gpb-flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor to use for servers gpb
+ default: m4.xlarge4
+ Internal1_cidr:
+ hidden: false
+ immutable: false
+ type: string
+ default: 169.253.0.0/17
+ epc-sctp-a-pool-start:
+ hidden: false
+ immutable: false
+ type: string
+ description: epc-sctp-a-net network ip pool start IP address
+ default: 107.243.37.3
+ Internal2_subnet_name:
+ hidden: false
+ immutable: false
+ type: string
+ default: vmme_int_int_sub_2
+ Internal1_subnet_name:
+ hidden: false
+ immutable: false
+ type: string
+ default: vmme_int_int_sub_1
+ gpb1-Internal1-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to gpb1-Internal1
+ default: 00:80:37:0E:01:22
+ gpb1-Internal1-ip:
+ hidden: false
+ immutable: false
+ type: string
+ default: 169.254.0.101
+ FSB_1_image:
+ label: MME_FSB1
+ hidden: false
+ immutable: false
+ type: string
+ description: MME_FSB1_15B-CP04-r5a01
+ default: MME_FSB1_15B-CP04-r5a01
+ fsb1-Internal2-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to fsb1-Internal2
+ default: 00:81:37:0E:0B:12
+ ncb_zone:
+ hidden: false
+ immutable: false
+ type: string
+ description: cluster for spawnning ncb instances
+ default: nova
+ Internal2_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ default: vmme_int_int_2
+ epc-sctp-a-pool-end:
+ hidden: false
+ immutable: false
+ type: string
+ description: epc-sctp-a-net network ip pool end IP address
+ default: 107.243.37.30
+ Internal1_name:
+ hidden: false
+ immutable: false
+ type: string
+ default: Internal1-subnet
+ gpb2-name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of gpb2
+ default: ZRDM1MMEX33GPB002
+ fsb2-Internal1-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to fsb2-Internal1
+ default: 00:80:37:0E:0D:12
+ fsb2-name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of fsb1
+ default: ZRDM1MMEX33FSB002
+ static_prefix_sctp_b_1:
+ hidden: false
+ immutable: false
+ type: string
+ description: Static Prefix
+ default: 107.239.40.64/30
+ fsb2-oam-ip:
+ hidden: false
+ immutable: false
+ type: string
+ default: 107.250.172.222
+ fsb2-flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor to use for servers fsb2
+ default: m4.xlarge4
+ fsb2-Internal2-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to fsb2-Internal2
+ default: 00:81:37:0E:0D:12
+ ncb2-Internal1-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to ncb2-Internal1
+ default: 00:80:37:0E:0F:12
+ ncb2-name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of ncb2
+ default: ZRDM1MMEX33NCB002
+ epc-sctp-b-pool-end:
+ hidden: false
+ immutable: false
+ type: string
+ description: epc-sctp-b-net network ip pool end IP address
+ default: 107.243.37.62
+ vlc1-gtp-ip:
+ hidden: false
+ immutable: false
+ type: string
+ default: 107.243.37.67
+ epc-sctp-b-pool-start:
+ hidden: false
+ immutable: false
+ type: string
+ description: epc-sctp-b-net network ip pool start IP address
+ default: 107.243.37.35
+ Internal2_shared:
+ hidden: false
+ immutable: false
+ type: string
+ default: 'False'
+ Internal1_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ default: vmme_int_int_1
+ vlc2-name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of vlc2
+ default: ZRDM1MMEX33VLC002
+ Internal2_ipam_name:
+ hidden: false
+ immutable: false
+ type: string
+ default: vmme_ipam_int2
+ vlc1-sctp-b-ip:
+ hidden: false
+ immutable: false
+ type: string
+ default: 107.243.37.35
+ Internal1_net_pool_end:
+ hidden: false
+ immutable: false
+ type: string
+ default: 169.253.0.254
+ Internal1_default_gateway:
+ hidden: false
+ immutable: false
+ type: string
+ default: 169.253.0.3
+ ncb1-Internal1-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to ncb1-Internal1
+ default: 00:80:37:0E:09:12
+ epc-gtp-net-name:
+ hidden: false
+ immutable: false
+ type: string
+ description: gtp net name
+ default: EPC-GTP
+ vlc1-Internal1-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to vlc1-Internal1
+ default: 00:80:37:0E:01:12
+ gpb2-Internal1-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to gpb2-Internal1
+ default: 00:80:37:0E:02:22
+ epc-gtp-net-cidr:
+ hidden: false
+ immutable: false
+ type: string
+ description: gtp stubnet
+ default: 107.243.37.64/27
+ oam_net_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: uuid of oam network
+ default: 47bf4cca-0961-422f-bcd6-d5a4fbb1a351
+ vlc_zone:
+ hidden: false
+ immutable: false
+ type: string
+ description: cluster for spawnning vlc instances
+ default: nova
+ vlc2-Internal1-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to vlc2-Internal1
+ default: 00:80:37:0E:02:12
+ epc-sctp-a-net-cidr:
+ hidden: false
+ immutable: false
+ type: string
+ description: epc-sctp-a subnet
+ default: 107.243.37.0/27
+ Internal1_forwarding_mode:
+ hidden: false
+ immutable: false
+ type: string
+ default: l2
+ Internal2_dhcp:
+ hidden: false
+ immutable: false
+ type: boolean
+ default: false
+ fsb1-oam-ip:
+ hidden: false
+ immutable: false
+ type: string
+ default: 107.250.172.221
+ FSB_2_image:
+ label: MME_FSB2
+ hidden: false
+ immutable: false
+ type: string
+ description: MME_FSB2_15B-CP04-r5a01
+ default: MME_FSB2_15B-CP04-r5a01
+ vlc1-oam-ip:
+ hidden: false
+ immutable: false
+ type: string
+ default: 107.250.172.227
+ epc-sctp-a-net-name:
+ hidden: false
+ immutable: false
+ type: string
+ description: epc-sctp-a net name
+ default: EPC-SCTP-A
+ vlc2-oam-ip:
+ hidden: false
+ immutable: false
+ type: string
+ default: 107.250.172.228
+ Internal2_net_pool_start:
+ hidden: false
+ immutable: false
+ type: string
+ default: 169.255.0.100
+ FSB1_volume_name:
+ label: FSB1_volume
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB1_volume_1
+ default: vFSB1_1_Vol_1
+ vlc1-sctp-a-ip:
+ hidden: false
+ immutable: false
+ type: string
+ default: 107.243.37.3
+ Internal1_ipam_name:
+ hidden: false
+ immutable: false
+ type: string
+ default: vmme_ipam_int1
+ Internal1_dhcp:
+ hidden: false
+ immutable: false
+ type: boolean
+ default: false
+ Internal2_external:
+ hidden: false
+ immutable: false
+ type: string
+ default: 'False'
+ Internal2_forwarding_mode:
+ hidden: false
+ immutable: false
+ type: string
+ default: l2
+ vlc1-name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of vlc1
+ default: ZRDM1MMEX33VLC002
+ vlc-flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor to use for servers vlc
+ default: m4.xlarge4
+ epc-gtp-net-rt:
+ hidden: false
+ immutable: false
+ type: string
+ description: gtp route target
+ default: 13979:105715
+ gpb_zone:
+ hidden: false
+ immutable: false
+ type: string
+ description: cluster for spawnning gpb instances
+ default: nova
+ gpb1-Internal2-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to gpb1-Internal2
+ default: 00:81:37:0E:01:22
+ fsb1-Internal1-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to fsb1-Internal1
+ default: 00:80:37:0E:0B:12
+ FSB2_volume_name:
+ label: FSB2_volume
+ hidden: false
+ immutable: false
+ type: string
+ description: FSB2_volume_1
+ default: vFSB2_1_Vol_1
+ VMME_FSB2_boot_volume:
+ hidden: false
+ immutable: false
+ type: string
+ default: 089a0d11-4b15-4370-8343-3f90907b1221
+ fsb_zone:
+ hidden: false
+ immutable: false
+ type: string
+ description: cluster for spawnning fsb instances
+ default: nova
+ VMME_FSB1_boot_volume:
+ hidden: false
+ immutable: false
+ type: string
+ default: 8248e794-6173-4b49-b9c3-8219b0b56f4e
+ Internal2_default_gateway:
+ hidden: false
+ immutable: false
+ type: string
+ default: 169.255.0.3
+ Internal1_external:
+ hidden: false
+ immutable: false
+ type: string
+ default: 'False'
+ vlc2-sctp-a-ip:
+ hidden: false
+ immutable: false
+ type: string
+ default: 107.243.37.4
+ ncb-flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor to use for servers ncb
+ default: m4.xlarge4
+ Internal1_shared:
+ hidden: false
+ immutable: false
+ type: string
+ default: 'False'
+ fsb1-name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of fsb1
+ default: ZRDM1MMEX33FSB001
+ static_prefix_gtp_1:
+ hidden: false
+ immutable: false
+ type: string
+ description: Static Prefix
+ default: 107.239.40.96/30
+ epc-sctp-b-net-gateway:
+ hidden: false
+ immutable: false
+ type: string
+ description: epc-sctp-b-net network gateway
+ default: 107.243.37.33
+ epc-sctp-b-net-cidr:
+ hidden: false
+ immutable: false
+ type: string
+ description: epc-sctp-b subnet
+ default: 107.243.37.32/24
+ epc-gtp-pool-end:
+ hidden: false
+ immutable: false
+ type: string
+ description: gtp network ip pool end IP address
+ default: 107.243.37.94
+ epc-sctp-a-net-gateway:
+ hidden: false
+ immutable: false
+ type: string
+ description: epc-sctp-a-net network gateway
+ default: 107.243.37.1
+ vlc2-gtp-ip:
+ hidden: false
+ immutable: false
+ type: string
+ default: 107.243.37.68
+ vlc2-sctp-b-ip:
+ hidden: false
+ immutable: false
+ type: string
+ default: 107.243.37.36
+ Internal1_net_pool_start:
+ hidden: false
+ immutable: false
+ type: string
+ default: 169.253.0.100
+ volume_size:
+ label: volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: my volume size 320GB
+ default: 320
+ fsb2-image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of image to use for server fsb2
+ default: MME_FSB2_15B-CP04-r5a01
+ ncb2-Internal2-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to ncb2-Internal2
+ default: 00:81:37:0E:0F:12
+ ncb1-name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of ncb1
+ default: ZRDM1MMEX33NCB001
+ fsb1-image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of image to use for server fsb1
+ default: MME_FSB1_15B-CP04-r5a01
+ fsb1-flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor to use for servers fsb1
+ default: m4.xlarge4
+ volume_type:
+ label: volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: volume type Gold
+ default: Gold
+ Internal2_net_pool_end:
+ hidden: false
+ immutable: false
+ type: string
+ default: 169.255.0.254
+ epc-sctp-b-net-name:
+ hidden: false
+ immutable: false
+ type: string
+ description: epc-sctp-b net name
+ default: EPC-SCTP-B
+ Internal2_cidr:
+ hidden: false
+ immutable: false
+ type: string
+ default: 169.255.0.0/17
+ epc-gtp-net-gateway:
+ hidden: false
+ immutable: false
+ type: string
+ description: gtp network gateway
+ default: 107.243.37.65
+ gpb2-Internal2-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to gpb2-Internal2
+ default: 00:81:37:0E:02:22
+ ncb1-Internal2-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to ncb1-Internal2
+ default: 00:81:37:0E:09:12
+ epc-gtp-pool-start:
+ hidden: false
+ immutable: false
+ type: string
+ description: gtp network ip pool start IP address
+ default: 107.243.37.67
+ static_prefix_sctp_a_1:
+ hidden: false
+ immutable: false
+ type: string
+ description: Static Prefix
+ default: 107.239.40.32/30
+ gpb1-name:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of gpb1
+ default: ZRDM1MMEX33GPB001
+ pxe-image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Name of image to use for server ncb
+ default: MME_PXE-BOOT_cxp9025898_2r5a01.qcow2
+ vlc1-Internal2-mac:
+ hidden: false
+ immutable: false
+ type: string
+ description: static mac address assigned to vlc1-Internal2
+ default: 00:81:37:0E:01:12
+ node_templates:
+ NCB1:
+ type: org.openecomp.resource.vfc.nodes.heat.NCB1
+ properties:
+ flavor:
+ get_input: ncb-flavor
+ availability_zone:
+ get_input: ncb_zone
+ image:
+ get_input: pxe-image
+ name:
+ get_input: ncb1-name
+ NCB2:
+ type: org.openecomp.resource.vfc.nodes.heat.NCB2
+ properties:
+ flavor:
+ get_input: ncb-flavor
+ availability_zone:
+ get_input: ncb_zone
+ image:
+ get_input: pxe-image
+ name:
+ get_input: ncb2-name
+ VLC2_OAM:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ fixed_ips:
+ - ip_address:
+ get_input: vlc2-oam-ip
+ network:
+ get_input: oam_net_id
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: VLC2
+ relationship: tosca.relationships.network.BindsTo
+ epc-gtp-net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ route_targets:
+ - get_input: epc-gtp-net-rt
+ network_name:
+ get_input: epc-gtp-net-name
+ subnets:
+ epc-gtp-subnet:
+ cidr:
+ get_input: epc-gtp-net-cidr
+ gateway_ip:
+ get_input: epc-gtp-net-gateway
+ allocation_pools:
+ - start:
+ get_input: epc-gtp-pool-start
+ end:
+ get_input: epc-gtp-pool-end
+ NCB1_Internal1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ mac_address:
+ get_input: ncb1-Internal1-mac
+ network: Internal1-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal1-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: NCB1
+ relationship: tosca.relationships.network.BindsTo
+ VLC2_Internal2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ mac_address:
+ get_input: vlc2-Internal2-mac
+ network: Internal2-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal2-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: VLC2
+ relationship: tosca.relationships.network.BindsTo
+ NCB1_Internal2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ mac_address:
+ get_input: ncb1-Internal2-mac
+ network: Internal2-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal2-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: NCB1
+ relationship: tosca.relationships.network.BindsTo
+ VLC2_Internal1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ mac_address:
+ get_input: vlc2-Internal1-mac
+ network: Internal1-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal1-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: VLC2
+ relationship: tosca.relationships.network.BindsTo
+ VLC2_GTP:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ fixed_ips:
+ - ip_address:
+ get_input: vlc2-gtp-ip
+ network: epc-gtp-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: epc-gtp-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: VLC2
+ relationship: tosca.relationships.network.BindsTo
+ FSB1_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ image:
+ get_input: FSB_1_image
+ volume_type:
+ get_input: volume_type
+ size: '(get_input : volume_size) * 1024'
+ name:
+ get_input: FSB1_volume_name
+ FSB1_OAM:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ fixed_ips:
+ - ip_address:
+ get_input: fsb1-oam-ip
+ network:
+ get_input: oam_net_id
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: FSB1
+ relationship: tosca.relationships.network.BindsTo
+ FSB2_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ image:
+ get_input: FSB_2_image
+ volume_type:
+ get_input: volume_type
+ size: '(get_input : volume_size) * 1024'
+ name:
+ get_input: FSB2_volume_name
+ Internal1-net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ dhcp_enabled:
+ get_input: Internal1_dhcp
+ shared:
+ get_input: Internal1_shared
+ forwarding_mode:
+ get_input: Internal1_forwarding_mode
+ external:
+ get_input: Internal1_external
+ network_name:
+ get_input: Internal1_net_name
+ subnets:
+ Internal1-subnet:
+ enable_dhcp:
+ get_input: Internal1_dhcp
+ cidr:
+ get_input: Internal1_cidr
+ gateway_ip:
+ get_input: Internal1_default_gateway
+ GPB2_Internal1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ mac_address:
+ get_input: gpb2-Internal1-mac
+ network: Internal1-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal1-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: GPB2
+ relationship: tosca.relationships.network.BindsTo
+ GPB2_Internal2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ mac_address:
+ get_input: gpb2-Internal2-mac
+ network: Internal2-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal2-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: GPB2
+ relationship: tosca.relationships.network.BindsTo
+ NCB2_Internal2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ mac_address:
+ get_input: ncb2-Internal2-mac
+ network: Internal2-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal2-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: NCB2
+ relationship: tosca.relationships.network.BindsTo
+ NCB2_Internal1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ mac_address:
+ get_input: ncb2-Internal1-mac
+ network: Internal1-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal1-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: NCB2
+ relationship: tosca.relationships.network.BindsTo
+ FSB2:
+ type: org.openecomp.resource.vfc.nodes.heat.FSB2
+ properties:
+ flavor:
+ get_input: fsb2-flavor
+ availability_zone:
+ get_input: fsb_zone
+ name:
+ get_input: fsb2-name
+ FSB1:
+ type: org.openecomp.resource.vfc.nodes.heat.FSB1
+ properties:
+ flavor:
+ get_input: fsb1-flavor
+ availability_zone:
+ get_input: fsb_zone
+ name:
+ get_input: fsb1-name
+ Internal2-net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ dhcp_enabled:
+ get_input: Internal2_dhcp
+ shared:
+ get_input: Internal2_shared
+ forwarding_mode:
+ get_input: Internal2_forwarding_mode
+ external:
+ get_input: Internal2_external
+ network_name:
+ get_input: Internal2_name
+ subnets:
+ Internal2-subnet:
+ enable_dhcp:
+ get_input: Internal2_dhcp
+ cidr:
+ get_input: Internal2_cidr
+ gateway_ip:
+ get_input: Internal2_default_gateway
+ VLC1_Internal1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ mac_address:
+ get_input: vlc1-Internal1-mac
+ network: Internal1-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal1-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: VLC1
+ relationship: tosca.relationships.network.BindsTo
+ epc-sctp-a-net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ route_targets:
+ - get_input: epc-sctp-a-net-rt
+ network_name:
+ get_input: epc-sctp-a-net-name
+ subnets:
+ epc-sctp-a-subnet:
+ cidr:
+ get_input: epc-sctp-a-net-cidr
+ gateway_ip:
+ get_input: epc-sctp-a-net-gateway
+ allocation_pools:
+ - start:
+ get_input: epc-sctp-a-pool-start
+ end:
+ get_input: epc-sctp-a-pool-end
+ VLC1_Internal2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ mac_address:
+ get_input: vlc1-Internal2-mac
+ network: Internal2-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal2-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: VLC1
+ relationship: tosca.relationships.network.BindsTo
+ VLC1_SCTP_B:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ fixed_ips:
+ - ip_address:
+ get_input: vlc1-sctp-b-ip
+ network: epc-sctp-b-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: epc-sctp-b-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: VLC1
+ relationship: tosca.relationships.network.BindsTo
+ VLC2_SCTP_B:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ fixed_ips:
+ - ip_address:
+ get_input: vlc2-sctp-b-ip
+ network: epc-sctp-b-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: epc-sctp-b-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: VLC2
+ relationship: tosca.relationships.network.BindsTo
+ VLC1_SCTP_A:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ fixed_ips:
+ - ip_address:
+ get_input: vlc1-sctp-a-ip
+ network: epc-sctp-a-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: epc-sctp-a-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: VLC1
+ relationship: tosca.relationships.network.BindsTo
+ VLC2_SCTP_A:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ fixed_ips:
+ - ip_address:
+ get_input: vlc2-sctp-a-ip
+ network: epc-sctp-a-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: epc-sctp-a-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: VLC2
+ relationship: tosca.relationships.network.BindsTo
+ VLC1:
+ type: org.openecomp.resource.vfc.nodes.heat.VLC1
+ properties:
+ flavor:
+ get_input: vlc-flavor
+ availability_zone:
+ get_input: vlc_zone
+ image:
+ get_input: pxe-image
+ name:
+ get_input: vlc1-name
+ FSB1_Internal2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ mac_address:
+ get_input: fsb1-Internal2-mac
+ network: Internal2-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal2-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: FSB1
+ relationship: tosca.relationships.network.BindsTo
+ VLC2:
+ type: org.openecomp.resource.vfc.nodes.heat.VLC2
+ properties:
+ flavor:
+ get_input: vlc-flavor
+ availability_zone:
+ get_input: vlc_zone
+ image:
+ get_input: pxe-image
+ name:
+ get_input: vlc2-name
+ FSB1_Internal1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ mac_address:
+ get_input: fsb1-Internal1-mac
+ network: Internal1-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal1-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: FSB1
+ relationship: tosca.relationships.network.BindsTo
+ FSB2_Internal2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ mac_address:
+ get_input: fsb2-Internal2-mac
+ network: Internal2-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal2-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: FSB2
+ relationship: tosca.relationships.network.BindsTo
+ FSB2_Internal1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ mac_address:
+ get_input: fsb2-Internal1-mac
+ network: Internal1-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal1-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: FSB2
+ relationship: tosca.relationships.network.BindsTo
+ VLC1_OAM:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ fixed_ips:
+ - ip_address:
+ get_input: vlc1-oam-ip
+ network:
+ get_input: oam_net_id
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: VLC1
+ relationship: tosca.relationships.network.BindsTo
+ epc-sctp-b-net:
+ type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
+ properties:
+ route_targets:
+ - get_input: epc-sctp-b-net-rt
+ network_name:
+ get_input: epc-sctp-b-net-name
+ subnets:
+ epc-sctp-b-subnet:
+ cidr:
+ get_input: epc-sctp-b-net-cidr
+ gateway_ip:
+ get_input: epc-sctp-b-net-gateway
+ allocation_pools:
+ - start:
+ get_input: epc-sctp-b-pool-start
+ end:
+ get_input: epc-sctp-b-pool-end
+ GPB2:
+ type: org.openecomp.resource.vfc.nodes.heat.GPB2
+ properties:
+ flavor:
+ get_input: gpb-flavor
+ availability_zone:
+ get_input: gpb_zone
+ image:
+ get_input: pxe-image
+ name:
+ get_input: gpb2-name
+ GPB1:
+ type: org.openecomp.resource.vfc.nodes.heat.GPB1
+ properties:
+ flavor:
+ get_input: gpb-flavor
+ availability_zone:
+ get_input: gpb_zone
+ image:
+ get_input: pxe-image
+ name:
+ get_input: gpb1-name
+ VLC1_GTP:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ fixed_ips:
+ - ip_address:
+ get_input: vlc1-gtp-ip
+ network: epc-gtp-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: epc-gtp-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: VLC1
+ relationship: tosca.relationships.network.BindsTo
+ FSB2_OAM:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ fixed_ips:
+ - ip_address:
+ get_input: fsb2-oam-ip
+ network:
+ get_input: oam_net_id
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: FSB2
+ relationship: tosca.relationships.network.BindsTo
+ GPB1_Internal2:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ mac_address:
+ get_input: gpb1-Internal2-mac
+ network: Internal2-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal2-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: GPB1
+ relationship: tosca.relationships.network.BindsTo
+ GPB1_Internal1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ mac_address:
+ get_input: gpb1-Internal1-mac
+ network: Internal1-net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: Internal1-net
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: GPB1
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ vmme_small:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/vmme_small.yml
+ description: HOT template to create vmme 2 fsb 2 ncb 2 gbp 2 vlc
+ members:
+ - NCB1
+ - NCB2
+ - VLC2_OAM
+ - epc-gtp-net
+ - NCB1_Internal1
+ - VLC2_Internal2
+ - NCB1_Internal2
+ - VLC2_Internal1
+ - VLC2_GTP
+ - FSB1_OAM
+ - Internal1-net
+ - GPB2_Internal1
+ - GPB2_Internal2
+ - NCB2_Internal2
+ - NCB2_Internal1
+ - FSB2
+ - FSB1
+ - Internal2-net
+ - VLC1_Internal1
+ - epc-sctp-a-net
+ - VLC1_Internal2
+ - VLC1_SCTP_B
+ - VLC2_SCTP_B
+ - VLC1_SCTP_A
+ - VLC2_SCTP_A
+ - VLC1
+ - FSB1_Internal2
+ - VLC2
+ - FSB1_Internal1
+ - FSB2_Internal2
+ - FSB2_Internal1
+ - VLC1_OAM
+ - epc-sctp-b-net
+ - GPB2
+ - GPB1
+ - VLC1_GTP
+ - FSB2_OAM
+ - GPB1_Internal2
+ - GPB1_Internal1
+ vmme_small_create_fsb:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/vmme_small_create_fsb.yml
+ description: server template for vMME
+ members:
+ - FSB1_volume
+ - FSB2_volume \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..71259e1116
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/inputfiles/MANIFEST.json
@@ -0,0 +1,27 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "vmme_small.yml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "vmme_small.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "vmme_small_create_fsb.yml",
+ "type": "HEAT_VOL",
+ "data": [
+ {
+ "file": "vmme_small_create_fsb.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/inputfiles/vmme_small.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/inputfiles/vmme_small.env
new file mode 100644
index 0000000000..e46cfd2a2d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/inputfiles/vmme_small.env
@@ -0,0 +1,97 @@
+parameters:
+ oam_net_id: 47bf4cca-0961-422f-bcd6-d5a4fbb1a351
+ fsb1-name: ZRDM1MMEX33FSB001
+ fsb2-name: ZRDM1MMEX33FSB002
+ ncb1-name: ZRDM1MMEX33NCB001
+ ncb2-name: ZRDM1MMEX33NCB002
+ vlc1-name: ZRDM1MMEX33VLC002
+ vlc2-name: ZRDM1MMEX33VLC002
+ gpb1-name: ZRDM1MMEX33GPB001
+ gpb2-name: ZRDM1MMEX33GPB002
+ epc-sctp-a-net-name: EPC-SCTP-A
+ epc-sctp-a-net-rt: 13979:105717
+ epc-sctp-a-net-cidr: 107.243.37.0/27
+ epc-sctp-a-net-gateway: 107.243.37.1
+ epc-sctp-a-pool-start: 107.243.37.3
+ epc-sctp-a-pool-end: 107.243.37.30
+ epc-sctp-b-net-name: EPC-SCTP-B
+ epc-sctp-b-net-rt: 13979:105719
+ epc-sctp-b-net-cidr: 107.243.37.32/24
+ epc-sctp-b-net-gateway: 107.243.37.33
+ epc-sctp-b-pool-start: 107.243.37.35
+ epc-sctp-b-pool-end: 107.243.37.62
+ epc-gtp-net-name: EPC-GTP
+ epc-gtp-net-rt: 13979:105715
+ epc-gtp-net-cidr: 107.243.37.64/27
+ epc-gtp-net-gateway: 107.243.37.65
+ epc-gtp-pool-start: 107.243.37.67
+ epc-gtp-pool-end: 107.243.37.94
+ fsb1-image: MME_FSB1_15B-CP04-r5a01
+ fsb2-image: MME_FSB2_15B-CP04-r5a01
+ fsb1-flavor: m4.xlarge4
+ fsb2-flavor: m4.xlarge4
+ fsb_zone: nova
+ fsb1-Internal1-mac: 00:80:37:0E:0B:12
+ fsb1-Internal2-mac: 00:81:37:0E:0B:12
+ fsb1-oam-ip: 107.250.172.221
+ fsb2-Internal1-mac: 00:80:37:0E:0D:12
+ fsb2-Internal2-mac: 00:81:37:0E:0D:12
+ fsb2-oam-ip: 107.250.172.222
+ pxe-image: MME_PXE-BOOT_cxp9025898_2r5a01.qcow2
+ ncb-flavor: m4.xlarge4
+ ncb_zone: nova
+ ncb1-Internal1-mac: 00:80:37:0E:09:12
+ ncb1-Internal2-mac: 00:81:37:0E:09:12
+ ncb2-Internal1-mac: 00:80:37:0E:0F:12
+ ncb2-Internal2-mac: 00:81:37:0E:0F:12
+ gpb-flavor: m4.xlarge4
+ gpb_zone: nova
+ gpb1-Internal1-mac: 00:80:37:0E:01:22
+ gpb1-Internal1-ip: 169.254.0.101
+ gpb1-Internal2-mac: 00:81:37:0E:01:22
+ gpb2-Internal1-mac: 00:80:37:0E:02:22
+ gpb2-Internal2-mac: 00:81:37:0E:02:22
+ vlc-flavor: m4.xlarge4
+ vlc_zone: nova
+ vlc1-sctp-a-ip: 107.243.37.3
+ vlc1-sctp-b-ip: 107.243.37.35
+ vlc1-gtp-ip: 107.243.37.67
+ vlc1-oam-ip: 107.250.172.227
+ vlc2-sctp-a-ip: 107.243.37.4
+ vlc2-sctp-b-ip: 107.243.37.36
+ vlc2-gtp-ip: 107.243.37.68
+ vlc2-oam-ip: 107.250.172.228
+ vlc1-Internal1-mac: 00:80:37:0E:01:12
+ vlc1-Internal2-mac: 00:81:37:0E:01:12
+ vlc2-Internal1-mac: 00:80:37:0E:02:12
+ vlc2-Internal2-mac: 00:81:37:0E:02:12
+ Internal1_net_name: vmme_int_int_1
+ Internal1_subnet_name: vmme_int_int_sub_1
+ Internal1_ipam_name: vmme_ipam_int1
+ Internal1_cidr: 169.253.0.0/17
+ Internal1_forwarding_mode: "l2"
+ Internal1_dhcp: "False"
+ Internal1_shared: "False"
+ Internal1_external: "False"
+ Internal1_name: "Internal1-subnet"
+ Internal1_default_gateway: 169.253.0.3
+ Internal1_net_pool_start: 169.253.0.100
+ Internal1_net_pool_end: 169.253.0.254
+ Internal2_net_name: vmme_int_int_2
+ Internal2_subnet_name: vmme_int_int_sub_2
+ Internal2_ipam_name: vmme_ipam_int2
+ Internal2_cidr: 169.255.0.0/17
+ Internal2_shared: "False"
+ Internal2_external: "False"
+ Internal2_forwarding_mode: "l2"
+ Internal2_dhcp: "False"
+ Internal2_name: "Internal2-subnet"
+ Internal2_default_gateway: 169.255.0.3
+ Internal2_net_pool_start: 169.255.0.100
+ Internal2_net_pool_end: 169.255.0.254
+ static_prefix_sctp_a_1: 107.239.40.32/30
+ static_prefix_gtp_1: 107.239.40.96/30
+ static_prefix_sctp_b_1: 107.239.40.64/30
+ VMME_FSB1_boot_volume: 8248e794-6173-4b49-b9c3-8219b0b56f4e
+ VMME_FSB2_boot_volume: 089a0d11-4b15-4370-8343-3f90907b1221
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/inputfiles/vmme_small.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/inputfiles/vmme_small.yml
new file mode 100644
index 0000000000..d7ad9a84d0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/inputfiles/vmme_small.yml
@@ -0,0 +1,644 @@
+heat_template_version: 2013-05-23
+
+description: HOT template to create vmme 2 fsb 2 ncb 2 gbp 2 vlc
+
+parameters:
+ fsb1-oam-ip:
+ type: string
+ fsb2-oam-ip:
+ type: string
+ vlc1-oam-ip:
+ type: string
+ vlc2-oam-ip:
+ type: string
+ Internal1_net_pool_start:
+ type: string
+ Internal1_net_pool_end:
+ type: string
+ Internal2_net_pool_start:
+ type: string
+ Internal2_net_pool_end:
+ type: string
+ Internal1_default_gateway:
+ type: string
+ Internal2_default_gateway:
+ type: string
+ Internal1_shared:
+ type: string
+ Internal1_external:
+ type: string
+ Internal1_net_name:
+ type: string
+ Internal1_subnet_name:
+ type: string
+ Internal1_ipam_name:
+ type: string
+ Internal1_cidr:
+ type: string
+ Internal1_forwarding_mode:
+ type: string
+ Internal1_dhcp:
+ type: string
+ Internal1_name:
+ type: string
+ Internal2_net_name:
+ type: string
+ Internal2_subnet_name:
+ type: string
+ Internal2_ipam_name:
+ type: string
+ Internal2_cidr:
+ type: string
+ Internal2_forwarding_mode:
+ type: string
+ Internal2_dhcp:
+ type: string
+ Internal2_name:
+ type: string
+ Internal2_shared:
+ type: string
+ Internal2_external:
+ type: string
+ vlc1-sctp-a-ip:
+ type: string
+ vlc1-sctp-b-ip:
+ type: string
+ vlc1-gtp-ip:
+ type: string
+ vlc2-sctp-a-ip:
+ type: string
+ vlc2-sctp-b-ip:
+ type: string
+ vlc2-gtp-ip:
+ type: string
+ fsb1-name:
+ type: string
+ description: Name of fsb1
+ fsb2-name:
+ type: string
+ description: Name of fsb1
+ ncb1-name:
+ type: string
+ description: Name of ncb1
+ ncb2-name:
+ type: string
+ description: Name of ncb2
+ vlc1-name:
+ type: string
+ description: Name of vlc1
+ vlc2-name:
+ type: string
+ description: Name of vlc2
+ gpb1-name:
+ type: string
+ description: Name of gpb1
+ gpb2-name:
+ type: string
+ description: Name of gpb2
+ fsb_zone:
+ type: string
+ description: cluster for spawnning fsb instances
+ fsb1-image:
+ type: string
+ description: Name of image to use for server fsb1
+ fsb1-flavor:
+ type: string
+ description: Flavor to use for servers fsb1
+ oam_net_id:
+ type: string
+ description: uuid of oam network
+ fsb1-Internal1-mac:
+ type: string
+ description: static mac address assigned to fsb1-Internal1
+ fsb1-Internal2-mac:
+ type: string
+ description: static mac address assigned to fsb1-Internal2
+ fsb2-image:
+ type: string
+ description: Name of image to use for server fsb2
+ fsb2-flavor:
+ type: string
+ description: Flavor to use for servers fsb2
+ fsb2-Internal1-mac:
+ type: string
+ description: static mac address assigned to fsb2-Internal1
+ fsb2-Internal2-mac:
+ type: string
+ description: static mac address assigned to fsb2-Internal2
+ pxe-image:
+ type: string
+ description: Name of image to use for server ncb
+ ncb-flavor:
+ type: string
+ description: Flavor to use for servers ncb
+ ncb_zone:
+ type: string
+ description: cluster for spawnning ncb instances
+ ncb1-Internal1-mac:
+ type: string
+ description: static mac address assigned to ncb1-Internal1
+ ncb1-Internal2-mac:
+ type: string
+ description: static mac address assigned to ncb1-Internal2
+ ncb2-Internal1-mac:
+ type: string
+ description: static mac address assigned to ncb2-Internal1
+ ncb2-Internal2-mac:
+ type: string
+ description: static mac address assigned to ncb2-Internal2
+ gpb-flavor:
+ type: string
+ description: Flavor to use for servers gpb
+ gpb_zone:
+ type: string
+ description: cluster for spawnning gpb instances
+ gpb1-Internal1-ip:
+ type: string
+ gpb1-Internal1-mac:
+ type: string
+ description: static mac address assigned to gpb1-Internal1
+ gpb1-Internal2-mac:
+ type: string
+ description: static mac address assigned to gpb1-Internal2
+ gpb2-Internal1-mac:
+ type: string
+ description: static mac address assigned to gpb2-Internal1
+ gpb2-Internal2-mac:
+ type: string
+ description: static mac address assigned to gpb2-Internal2
+ vlc-flavor:
+ type: string
+ description: Flavor to use for servers vlc
+ vlc_zone:
+ type: string
+ description: cluster for spawnning vlc instances
+ vlc1-Internal1-mac:
+ type: string
+ description: static mac address assigned to vlc1-Internal1
+ vlc1-Internal2-mac:
+ type: string
+ description: static mac address assigned to vlc1-Internal2
+ vlc2-Internal1-mac:
+ type: string
+ description: static mac address assigned to vlc2-Internal1
+ vlc2-Internal2-mac:
+ type: string
+ description: static mac address assigned to vlc2-Internal2
+ epc-sctp-a-net-name:
+ type: string
+ description: epc-sctp-a net name
+ epc-sctp-a-net-rt:
+ type: string
+ description: epc-sctp-a route target
+ epc-sctp-a-net-cidr:
+ type: string
+ description: epc-sctp-a subnet
+ epc-sctp-a-net-gateway:
+ type: string
+ description: epc-sctp-a-net network gateway
+ epc-sctp-a-pool-start:
+ type: string
+ description: epc-sctp-a-net network ip pool start IP address
+ epc-sctp-a-pool-end:
+ type: string
+ description: epc-sctp-a-net network ip pool end IP address
+ epc-sctp-b-net-name:
+ type: string
+ description: epc-sctp-b net name
+ epc-sctp-b-net-rt:
+ type: string
+ description: epc-sctp-b route target
+ epc-sctp-b-net-cidr:
+ type: string
+ description: epc-sctp-b subnet
+ epc-sctp-b-net-gateway:
+ type: string
+ description: epc-sctp-b-net network gateway
+ epc-sctp-b-pool-start:
+ type: string
+ description: epc-sctp-b-net network ip pool start IP address
+ epc-sctp-b-pool-end:
+ type: string
+ description: epc-sctp-b-net network ip pool end IP address
+ epc-gtp-net-name:
+ type: string
+ description: gtp net name
+ epc-gtp-net-rt:
+ type: string
+ description: gtp route target
+ epc-gtp-net-cidr:
+ type: string
+ description: gtp stubnet
+ epc-gtp-net-gateway:
+ type: string
+ description: gtp network gateway
+ epc-gtp-pool-start:
+ type: string
+ description: gtp network ip pool start IP address
+ epc-gtp-pool-end:
+ type: string
+ description: gtp network ip pool end IP address
+ static_prefix_sctp_a_1:
+ type: string
+ description: Static Prefix
+ static_prefix_sctp_b_1:
+ type: string
+ description: Static Prefix
+ static_prefix_gtp_1:
+ type: string
+ description: Static Prefix
+ VMME_FSB1_boot_volume:
+ type: string
+ VMME_FSB2_boot_volume:
+ type: string
+
+resources:
+
+ Internal1_ipam:
+ type: OS::Contrail::NetworkIpam
+ properties:
+ name: { get_param: Internal1_ipam_name }
+
+ Internal2_ipam:
+ type: OS::Contrail::NetworkIpam
+ properties:
+ name: { get_param: Internal2_ipam_name }
+
+ Internal1-net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: Internal1_net_name }
+ forwarding_mode: { get_param: Internal1_forwarding_mode }
+ shared: { get_param: Internal1_shared }
+ external: { get_param: Internal1_external }
+# route_targets: { "Fn::Split" : [ ",", Ref: route_targets ] }
+
+ Internal1-subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: Internal1-net }
+ cidr: { get_param: Internal1_cidr }
+ gateway_ip: { get_param: Internal1_default_gateway }
+ enable_dhcp: { get_param: Internal1_dhcp }
+
+
+# Internal1-subnet:
+# type: OS::Contrail::VnSubnet
+# properties:
+# name: { get_param: Internal1_subnet_name }
+# network: { get_resource: Internal1-net }
+# ip_prefix: { get_param: Internal1_cidr }
+ # ipam: { get_resource: Internal1_ipam }
+ # enable_dhcp: { get_param: Internal1_dhcp }
+ # default_gateway: { get_param: Internal1_default_gateway }
+ # allocation_pools:
+ # - start: { get_param: Internal1_net_pool_start }
+ # end: { get_param: Internal1_net_pool_end }
+
+
+
+ Internal2-net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: Internal2_name }
+ forwarding_mode: { get_param: Internal2_forwarding_mode }
+ shared: { get_param: Internal2_shared }
+ external: { get_param: Internal2_external }
+# route_targets: { "Fn::Split" : [ ",", Ref: route_targets ] }
+
+# Internal2-subnet:
+# type: OS::Contrail::VnSubnet
+# properties:
+# name: { get_param: Internal2_subnet_name }
+# network: { get_resource: Internal2-net }
+# ip_prefix: { get_param: Internal2_cidr }
+# ipam: { get_resource: Internal2_ipam }
+# enable_dhcp: { get_param: Internal2_dhcp }
+# default_gateway: { get_param: Internal2_default_gateway }
+# allocation_pools:
+# - start: { get_param: Internal2_net_pool_start }
+# end: { get_param: Internal2_net_pool_end }
+
+ Internal2-subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: Internal2-net }
+ cidr: { get_param: Internal2_cidr }
+ gateway_ip: { get_param: Internal2_default_gateway }
+ enable_dhcp: { get_param: Internal2_dhcp }
+
+ epc-sctp-a-net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: epc-sctp-a-net-name }
+ route_targets: [ get_param: epc-sctp-a-net-rt ]
+
+
+ epc-sctp-a-subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: epc-sctp-a-net }
+ cidr: { get_param: epc-sctp-a-net-cidr }
+ gateway_ip: { get_param: epc-sctp-a-net-gateway }
+ allocation_pools:
+ - start: { get_param: epc-sctp-a-pool-start }
+ end: { get_param: epc-sctp-a-pool-end }
+
+ epc-sctp-b-net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: epc-sctp-b-net-name }
+ route_targets: [ get_param: epc-sctp-b-net-rt ]
+
+ epc-sctp-b-subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: epc-sctp-b-net }
+ cidr: { get_param: epc-sctp-b-net-cidr }
+ gateway_ip: { get_param: epc-sctp-b-net-gateway }
+ allocation_pools:
+ - start: { get_param: epc-sctp-b-pool-start }
+ end: { get_param: epc-sctp-b-pool-end }
+
+ epc-gtp-net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: epc-gtp-net-name }
+ route_targets: [ get_param: epc-gtp-net-rt ]
+
+ epc-gtp-subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: epc-gtp-net }
+ cidr: { get_param: epc-gtp-net-cidr }
+ gateway_ip: { get_param: epc-gtp-net-gateway }
+ allocation_pools:
+ - start: { get_param: epc-gtp-pool-start }
+ end: { get_param: epc-gtp-pool-end }
+
+ FSB1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: fsb1-name }
+ block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB1_boot_volume }, delete_on_termination: "false" }]
+ flavor: { get_param: fsb1-flavor }
+ availability_zone: { get_param: fsb_zone }
+ networks:
+ - port: { get_resource: FSB1_Internal1 }
+ - port: { get_resource: FSB1_Internal2 }
+ - port: { get_resource: FSB1_OAM }
+
+ FSB1_Internal1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: Internal1-net }
+ mac_address: { get_param: fsb1-Internal1-mac }
+
+ FSB1_Internal2:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: Internal2-net }
+ mac_address: { get_param: fsb1-Internal2-mac }
+
+ FSB1_OAM:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_id }
+ fixed_ips:
+ - ip_address: { get_param: fsb1-oam-ip }
+
+ FSB2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: fsb2-name }
+ block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }]
+ flavor: { get_param: fsb2-flavor }
+ availability_zone: { get_param: fsb_zone }
+ networks:
+ - port: { get_resource: FSB2_Internal1 }
+ - port: { get_resource: FSB2_Internal2 }
+ - port: { get_resource: FSB2_OAM }
+
+ FSB2_Internal1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: Internal1-net }
+ mac_address: { get_param: fsb2-Internal1-mac }
+
+
+ FSB2_Internal2:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: Internal2-net }
+ mac_address: { get_param: fsb2-Internal2-mac }
+
+ FSB2_OAM:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_id }
+ fixed_ips:
+ - ip_address: { get_param: fsb2-oam-ip }
+
+ NCB1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: ncb1-name }
+ image: { get_param: pxe-image }
+ flavor: { get_param: ncb-flavor }
+ availability_zone: { get_param: ncb_zone }
+ networks:
+ - port: { get_resource: NCB1_Internal1 }
+ - port: { get_resource: NCB1_Internal2 }
+
+ NCB1_Internal1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: Internal1-net }
+ mac_address: { get_param: ncb1-Internal1-mac }
+
+ NCB1_Internal2:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: Internal2-net }
+ mac_address: { get_param: ncb1-Internal2-mac }
+
+ NCB2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: ncb2-name }
+ image: { get_param: pxe-image }
+ flavor: { get_param: ncb-flavor }
+ availability_zone: { get_param: ncb_zone }
+ networks:
+ - port: { get_resource: NCB2_Internal1 }
+ - port: { get_resource: NCB2_Internal2 }
+
+ NCB2_Internal1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: Internal1-net }
+ mac_address: { get_param: ncb2-Internal1-mac }
+
+ NCB2_Internal2:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: Internal2-net }
+ mac_address: { get_param: ncb2-Internal2-mac }
+
+ GPB1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: gpb1-name }
+ image: { get_param: pxe-image }
+ flavor: { get_param: gpb-flavor }
+ availability_zone: { get_param: gpb_zone }
+ networks:
+ - port: { get_resource: GPB1_Internal1 }
+ - port: { get_resource: GPB1_Internal2 }
+
+ GPB1_Internal1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: Internal1-net }
+ mac_address: { get_param: gpb1-Internal1-mac }
+
+ GPB1_Internal2:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: Internal2-net }
+ mac_address: { get_param: gpb1-Internal2-mac }
+
+ GPB2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: gpb2-name }
+ image: { get_param: pxe-image }
+ flavor: { get_param: gpb-flavor }
+ availability_zone: { get_param: gpb_zone }
+ networks:
+ - port: { get_resource: GPB2_Internal1 }
+ - port: { get_resource: GPB2_Internal2 }
+
+ GPB2_Internal1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: Internal1-net }
+ mac_address: { get_param: gpb2-Internal1-mac }
+
+ GPB2_Internal2:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: Internal2-net }
+ mac_address: { get_param: gpb2-Internal2-mac }
+
+ VLC1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: vlc1-name }
+ image: { get_param: pxe-image }
+ flavor: { get_param: vlc-flavor }
+ availability_zone: { get_param: vlc_zone }
+ networks:
+ - port: { get_resource: VLC1_Internal1 }
+ - port: { get_resource: VLC1_Internal2 }
+ - port: { get_resource: VLC1_OAM }
+ - port: { get_resource: VLC1_SCTP_A }
+ - port: { get_resource: VLC1_SCTP_B }
+ - port: { get_resource: VLC1_GTP }
+
+ VLC1_Internal1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: Internal1-net }
+ mac_address: { get_param: vlc1-Internal1-mac }
+
+ VLC1_Internal2:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: Internal2-net }
+ mac_address: { get_param: vlc1-Internal2-mac }
+
+ VLC1_OAM:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_id }
+ fixed_ips:
+ - ip_address: { get_param: vlc1-oam-ip }
+
+ VLC1_SCTP_A:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: epc-sctp-a-net }
+ fixed_ips:
+ - ip_address: { get_param: vlc1-sctp-a-ip }
+
+ VLC1_SCTP_B:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: epc-sctp-b-net }
+ fixed_ips:
+ - ip_address: { get_param: vlc1-sctp-b-ip }
+
+ VLC1_GTP:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: epc-gtp-net }
+ fixed_ips:
+ - ip_address: { get_param: vlc1-gtp-ip }
+
+ VLC2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: vlc2-name }
+ image: { get_param: pxe-image }
+ flavor: { get_param: vlc-flavor }
+ availability_zone: { get_param: vlc_zone }
+ networks:
+ - port: { get_resource: VLC2_Internal1 }
+ - port: { get_resource: VLC2_Internal2 }
+ - port: { get_resource: VLC2_OAM }
+ - port: { get_resource: VLC2_SCTP_A }
+ - port: { get_resource: VLC2_SCTP_B }
+ - port: { get_resource: VLC2_GTP }
+
+
+ VLC2_Internal1:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: Internal1-net }
+ mac_address: { get_param: vlc2-Internal1-mac }
+
+ VLC2_OAM:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_id }
+ fixed_ips:
+ - ip_address: { get_param: vlc2-oam-ip }
+
+ VLC2_Internal2:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: Internal2-net }
+ mac_address: { get_param: vlc2-Internal2-mac }
+
+ VLC2_SCTP_A:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: epc-sctp-a-net }
+ fixed_ips:
+ - ip_address: { get_param: vlc2-sctp-a-ip }
+
+ VLC2_SCTP_B:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: epc-sctp-b-net }
+ fixed_ips:
+ - ip_address: { get_param: vlc2-sctp-b-ip }
+
+ VLC2_GTP:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: epc-gtp-net }
+ fixed_ips:
+ - ip_address: { get_param: vlc2-gtp-ip }
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/inputfiles/vmme_small_create_fsb.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/inputfiles/vmme_small_create_fsb.env
new file mode 100644
index 0000000000..750bb2dd44
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/inputfiles/vmme_small_create_fsb.env
@@ -0,0 +1,8 @@
+parameters:
+ volume_type: Gold
+ volume_size: 320
+ FSB_1_image: MME_FSB1_15B-CP04-r5a01
+ FSB_2_image: MME_FSB2_15B-CP04-r5a01
+ FSB1_volume_name: vFSB1_1_Vol_1
+ FSB2_volume_name: vFSB2_1_Vol_1
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/inputfiles/vmme_small_create_fsb.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/inputfiles/vmme_small_create_fsb.yml
new file mode 100644
index 0000000000..2d695a50c1
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/inputfiles/vmme_small_create_fsb.yml
@@ -0,0 +1,54 @@
+heat_template_version: 2013-05-23
+
+description: server template for vMME
+
+parameters:
+
+ volume_type:
+ type: string
+ label: volume type
+ description: volume type Gold
+
+ volume_size:
+ type: number
+ label: volume size
+ description: my volume size 320GB
+
+ FSB_1_image:
+ type: string
+ label: MME_FSB1
+ description: MME_FSB1_15B-CP04-r5a01
+
+ FSB_2_image:
+ type: string
+ label: MME_FSB2
+ description: MME_FSB2_15B-CP04-r5a01
+
+ FSB1_volume_name:
+ type: string
+ label: FSB1_volume
+ description: FSB1_volume_1
+
+ FSB2_volume_name:
+ type: string
+ label: FSB2_volume
+ description: FSB2_volume_1
+
+resources:
+
+ FSB1_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: volume_size}
+ volume_type: {get_param: volume_type}
+ name: {get_param: FSB1_volume_name}
+ image: {get_param: FSB_1_image}
+
+ FSB2_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: volume_size}
+ volume_type: {get_param: volume_type}
+ name: {get_param: FSB2_volume_name}
+ image: {get_param: FSB_2_image}
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..a44e7921f8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/inputfiles/MANIFEST.json
@@ -0,0 +1,24 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "nested.yml",
+ "type": "HEAT",
+ "isBase": "false",
+ "data":[
+ {
+ "file": "a_vol.yml",
+ "type": "HEAT_VOL",
+ "isBase": "false"
+ }
+ ]
+ },
+ {
+ "file": "main.yml",
+ "type": "HEAT",
+ "isBase": "false"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/inputfiles/a_vol.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/inputfiles/a_vol.yml
new file mode 100644
index 0000000000..a9f72bcecf
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/inputfiles/a_vol.yml
@@ -0,0 +1,24 @@
+heat_template_version: 2013-05-23
+
+description: volume
+
+parameters:
+ cmaui_cinder_volume_size:
+ type: number
+ label: CMAUI Cinder volume size
+ description: the size of the CMAUI Cinder volume
+ CMAUI_volume_type:
+ type: string
+ label: CMAUI vm volume type
+ description: the name of the target volume backend
+
+resources:
+ cmaui_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: cmaui_cinder_volume_size}
+ volume_type: {get_param: CMAUI_volume_type}
+
+outputs:
+ out_cmaui_volume:
+ value: {get_resource: cmaui_volume} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/inputfiles/main.yml
new file mode 100644
index 0000000000..b97dd4b535
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/inputfiles/main.yml
@@ -0,0 +1,71 @@
+heat_template_version: 2013-05-23
+
+description: cmaui server template for vMMSC
+
+parameters:
+ vnf_id:
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-CMAUI_id
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_cinder_volume_size:
+ type: number
+ label: CMAUI Cinder volume size
+ description: the size of the CMAUI Cinder volume
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ oam_net_name:
+ type: string
+ description: UID of OAM network
+ oam_network_netmask:
+ type: string
+ label: oam network netmask
+ description: oam network gateway
+ oam_network_gateway:
+ type: string
+ label: oam network gateway
+ description: oam network gateway
+ external_dns:
+ type: string
+ label: dns server
+ description: dns server
+ external_ntp:
+ type: string
+ label: ntp server
+ description: ntp server
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ timezone:
+ type: string
+ label: timezone
+ description: timezone
+ cmaui_oam_ips:
+ type: comma_delimited_list
+ label: CMAUI oam_net IP addresses
+ description: CMAUI oam_net IP addresses
+ CMAUI_volume_type:
+ type: string
+ label: CMAUI vm volume type
+ description: the name of the target volume backend
+
+resources:
+
+ server_cmaui:
+ type: nested.yml
+ properties:
+ cmaui_names: { get_param: [cmaui_names, 0]}
+ cmaui_image: { get_param: cmaui_image }
+ availability_zone_0: { get_param: availability_zone_0 }
+ cmaui_flavor: { get_param: cmaui_flavor } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/inputfiles/nested.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/inputfiles/nested.yml
new file mode 100644
index 0000000000..cdaf251b85
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/inputfiles/nested.yml
@@ -0,0 +1,116 @@
+heat_template_version: 2013-05-23
+
+description: cmaui server template for vMMSC
+
+parameters:
+ vnf_id:
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-CMAUI_id
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_volume:
+ type: string
+ label: CMAUI volume size
+ description: Volume for CMAUI server
+ cmaui_cinder_volume_size:
+ type: number
+ label: CMAUI Cinder volume size
+ description: the size of the CMAUI Cinder volume
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ oam_net_name:
+ type: string
+ description: UID of OAM network
+ oam_network_netmask:
+ type: string
+ label: oam network netmask
+ description: oam network gateway
+ oam_network_gateway:
+ type: string
+ label: oam network gateway
+ description: oam network gateway
+ external_dns:
+ type: string
+ label: dns server
+ description: dns server
+ external_ntp:
+ type: string
+ label: ntp server
+ description: ntp server
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ timezone:
+ type: string
+ label: timezone
+ description: timezone
+ cmaui_oam_ips:
+ type: comma_delimited_list
+ label: CMAUI oam_net IP addresses
+ description: CMAUI oam_net IP addresses
+ CMAUI_volume_type:
+ type: string
+ label: CMAUI vm volume type
+ description: the name of the target volume backend
+ out_cmaui_volume:
+ type: string
+ label: CMAUI vm volume type
+ description: the name of the target volume backend
+
+resources:
+
+ cmaui_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ cmaui_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_param: out_cmaui_volume}
+ instance_uuid: {get_resource: server_cmaui}
+
+ server_cmaui:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_0 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ cmaui.mgmt.ip=${cmaui.mgmt.ip}
+ cmaui.mgmt.netmask=${cmaui.mgmt.netmask}
+ cmaui.mgmt.gateway=${cmaui.mgmt.gateway}
+ cmaui.external.dns=${cmaui.external.dns}
+ cmaui.external.ntp=${cmaui.external.ntp}
+ cmaui.node=${cmaui.node}
+ cmaui.timezone=${cmaui.timezone}
+ params:
+ ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]}
+ ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${cmaui.external.dns}: {get_param: external_dns}
+ ${cmaui.external.ntp}: {get_param: external_ntp}
+ ${cmaui.node}: {get_param: [cmaui_names, 0]}
+ ${cmaui.timezone}: {get_param: timezone}
+ user_data_format: RAW \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/out/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/out/GlobalSubstitutionTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..0a5e36edaf
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/out/GlobalSubstitutionTypesServiceTemplate.yaml
@@ -0,0 +1,146 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: GlobalSubstitutionTypes
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.abstract.nodes.heat.nested:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ cmaui_names:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ cmaui_cinder_volume_size:
+ type: float
+ description: the size of the CMAUI Cinder volume
+ timezone:
+ type: string
+ description: timezone
+ security_group_name:
+ type: string
+ description: the name of security group
+ cmaui_volume:
+ type: string
+ description: Volume for CMAUI server
+ oam_network_netmask:
+ type: string
+ description: oam network gateway
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ vnf_id:
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-CMAUI_id
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ oam_network_gateway:
+ type: string
+ description: oam network gateway
+ out_cmaui_volume:
+ type: string
+ description: the name of the target volume backend
+ availability_zone_0:
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ type: list
+ description: CMAUI oam_net IP addresses
+ entry_schema:
+ type: string
+ external_dns:
+ type: string
+ description: dns server
+ oam_net_name:
+ type: string
+ description: UID of OAM network
+ external_ntp:
+ type: string
+ description: ntp server
+ CMAUI_volume_type:
+ type: string
+ description: the name of the target volume backend
+ attributes:
+ out_cmaui_volume:
+ type: string
+ requirements:
+ - local_storage_server_cmaui:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - link_cmaui_port_0:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ capabilities:
+ host_server_cmaui:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_cmaui:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_cmaui:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_cmaui:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_server_cmaui:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_volume:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_0:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/out/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/out/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..72b2c18882
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/out/MainServiceTemplate.yaml
@@ -0,0 +1,150 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ cmaui_cinder_volume_size:
+ label: CMAUI Cinder volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: the size of the CMAUI Cinder volume
+ timezone:
+ label: timezone
+ hidden: false
+ immutable: false
+ type: string
+ description: timezone
+ security_group_name:
+ label: security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of security group
+ oam_network_netmask:
+ label: oam network netmask
+ hidden: false
+ immutable: false
+ type: string
+ description: oam network gateway
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ vnf_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-CMAUI_id
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ oam_network_gateway:
+ label: oam network gateway
+ hidden: false
+ immutable: false
+ type: string
+ description: oam network gateway
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ label: CMAUI oam_net IP addresses
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI oam_net IP addresses
+ entry_schema:
+ type: string
+ external_dns:
+ label: dns server
+ hidden: false
+ immutable: false
+ type: string
+ description: dns server
+ oam_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ external_ntp:
+ label: ntp server
+ hidden: false
+ immutable: false
+ type: string
+ description: ntp server
+ CMAUI_volume_type:
+ label: CMAUI vm volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the target volume backend
+ node_templates:
+ server_cmaui:
+ type: org.openecomp.resource.abstract.nodes.heat.nested
+ directives:
+ - substitutable
+ properties:
+ cmaui_names:
+ get_input:
+ - cmaui_names
+ - 0
+ service_template_filter:
+ substitute_service_template: nestedServiceTemplate.yaml
+ cmaui_image:
+ get_input: cmaui_image
+ cmaui_flavor:
+ get_input: cmaui_flavor
+ availability_zone_0:
+ get_input: availability_zone_0
+ groups:
+ main:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/main.yml
+ description: cmaui server template for vMMSC
+ members:
+ - server_cmaui \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/out/nestedServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/out/nestedServiceTemplate.yaml
new file mode 100644
index 0000000000..242feead83
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/out/nestedServiceTemplate.yaml
@@ -0,0 +1,242 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ GlobalSubstitutionTypes:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cmaui:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ cmaui_cinder_volume_size:
+ label: CMAUI Cinder volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: the size of the CMAUI Cinder volume
+ timezone:
+ label: timezone
+ hidden: false
+ immutable: false
+ type: string
+ description: timezone
+ security_group_name:
+ label: security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of security group
+ cmaui_volume:
+ label: CMAUI volume size
+ hidden: false
+ immutable: false
+ type: string
+ description: Volume for CMAUI server
+ oam_network_netmask:
+ label: oam network netmask
+ hidden: false
+ immutable: false
+ type: string
+ description: oam network gateway
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ vnf_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-CMAUI_id
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ oam_network_gateway:
+ label: oam network gateway
+ hidden: false
+ immutable: false
+ type: string
+ description: oam network gateway
+ out_cmaui_volume:
+ label: CMAUI vm volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the target volume backend
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ label: CMAUI oam_net IP addresses
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI oam_net IP addresses
+ entry_schema:
+ type: string
+ external_dns:
+ label: dns server
+ hidden: false
+ immutable: false
+ type: string
+ description: dns server
+ oam_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ external_ntp:
+ label: ntp server
+ hidden: false
+ immutable: false
+ type: string
+ description: ntp server
+ CMAUI_volume_type:
+ label: CMAUI vm volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the target volume backend
+ node_templates:
+ server_cmaui:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ user_data_format: RAW
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: cmaui_volume
+ relationship: cmaui_volume_attachment
+ cmaui_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: CMAUI_volume_type
+ size: '(get_input : cmaui_cinder_volume_size) * 1024'
+ cmaui_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ relationship_templates:
+ cmaui_volume_attachment:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id: cmaui_volume
+ instance_uuid: server_cmaui
+ groups:
+ a_vol:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/a_vol.yml
+ description: volume
+ members:
+ - cmaui_volume
+ nested:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested.yml
+ description: cmaui server template for vMMSC
+ members:
+ - server_cmaui
+ - cmaui_port_0
+ outputs:
+ out_cmaui_volume:
+ value: cmaui_volume
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested
+ capabilities:
+ host_server_cmaui:
+ - server_cmaui
+ - host
+ os_server_cmaui:
+ - server_cmaui
+ - os
+ endpoint_server_cmaui:
+ - server_cmaui
+ - endpoint
+ binding_server_cmaui:
+ - server_cmaui
+ - binding
+ scalable_server_cmaui:
+ - server_cmaui
+ - scalable
+ attachment_cmaui_volume:
+ - cmaui_volume
+ - attachment
+ attachment_cmaui_port_0:
+ - cmaui_port_0
+ - attachment
+ requirements:
+ local_storage_server_cmaui:
+ - server_cmaui
+ - local_storage
+ link_cmaui_port_0:
+ - cmaui_port_0
+ - link \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_and_attach_one_file/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_and_attach_one_file/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..25cae6bdeb
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_and_attach_one_file/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,194 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cmaui:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ cmaui_cinder_volume_size:
+ label: CMAUI Cinder volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: the size of the CMAUI Cinder volume
+ timezone:
+ label: timezone
+ hidden: false
+ immutable: false
+ type: string
+ description: timezone
+ security_group_name:
+ label: security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of security group
+ server_cmaui:
+ label: CMAUI server name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the cmaui server
+ oam_network_netmask:
+ label: oam network netmask
+ hidden: false
+ immutable: false
+ type: string
+ description: oam network gateway
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ vnf_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-CMAUI_id
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ oam_network_gateway:
+ label: oam network gateway
+ hidden: false
+ immutable: false
+ type: string
+ description: oam network gateway
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ label: CMAUI oam_net IP addresses
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI oam_net IP addresses
+ entry_schema:
+ type: string
+ external_dns:
+ label: dns server
+ hidden: false
+ immutable: false
+ type: string
+ description: dns server
+ oam_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ external_ntp:
+ label: ntp server
+ hidden: false
+ immutable: false
+ type: string
+ description: ntp server
+ CMAUI_volume_type:
+ label: CMAUI vm volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the target volume backend
+ node_templates:
+ server_cmaui:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ user_data_format: RAW
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: cmaui_volume
+ relationship: cmaui_volume_attachment
+ cmaui_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: CMAUI_volume_type
+ size: '(get_input : cmaui_cinder_volume_size) * 1024'
+ cmaui_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ relationship_templates:
+ cmaui_volume_attachment:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id: cmaui_volume
+ instance_uuid: server_cmaui
+ groups:
+ hot_template:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/hot_template.yml
+ description: cmaui server template for vMMSC
+ members:
+ - server_cmaui
+ - cmaui_volume
+ - cmaui_port_0 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_and_attach_one_file/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_and_attach_one_file/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..b2916ccf9c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_and_attach_one_file/inputfiles/MANIFEST.json
@@ -0,0 +1,11 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot_template.yml",
+ "type": "HEAT"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_and_attach_one_file/inputfiles/hot_template.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_and_attach_one_file/inputfiles/hot_template.yml
new file mode 100644
index 0000000000..a0f9b45478
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_and_attach_one_file/inputfiles/hot_template.yml
@@ -0,0 +1,131 @@
+heat_template_version: 2013-05-23
+
+#################################
+#
+# Changes from MSO 01/26/2016
+# Updated per ECOMP feedback
+#
+#################################
+
+description: cmaui server template for vMMSC
+
+parameters:
+ vnf_id:
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-CMAUI_id
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_cinder_volume_size:
+ type: number
+ label: CMAUI Cinder volume size
+ description: the size of the CMAUI Cinder volume
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ oam_net_name:
+ type: string
+ description: UID of OAM network
+ oam_network_netmask:
+ type: string
+ label: oam network netmask
+ description: oam network gateway
+ oam_network_gateway:
+ type: string
+ label: oam network gateway
+ description: oam network gateway
+ external_dns:
+ type: string
+ label: dns server
+ description: dns server
+ external_ntp:
+ type: string
+ label: ntp server
+ description: ntp server
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ timezone:
+ type: string
+ label: timezone
+ description: timezone
+ cmaui_oam_ips:
+ type: comma_delimited_list
+ label: CMAUI oam_net IP addresses
+ description: CMAUI oam_net IP addresses
+ CMAUI_volume_type:
+ type: string
+ label: CMAUI vm volume type
+ description: the name of the target volume backend
+ server_cmaui:
+ type: string
+ label: CMAUI server name
+ description: the name of the cmaui server
+
+resources:
+
+ cmaui_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ cmaui_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: cmaui_cinder_volume_size}
+ volume_type: {get_param: CMAUI_volume_type}
+
+ cmaui_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: cmaui_volume}
+ instance_uuid: {get_resource: server_cmaui}
+
+ cmaui_volume_attachment_empty_nova:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_resource: cmaui_volume}
+ instance_uuid: {get_param: server_cmaui}
+
+ server_cmaui:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_0 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ cmaui.mgmt.ip=${cmaui.mgmt.ip}
+ cmaui.mgmt.netmask=${cmaui.mgmt.netmask}
+ cmaui.mgmt.gateway=${cmaui.mgmt.gateway}
+ cmaui.external.dns=${cmaui.external.dns}
+ cmaui.external.ntp=${cmaui.external.ntp}
+ cmaui.node=${cmaui.node}
+ cmaui.timezone=${cmaui.timezone}
+ params:
+ ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]}
+ ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${cmaui.external.dns}: {get_param: external_dns}
+ ${cmaui.external.ntp}: {get_param: external_ntp}
+ ${cmaui.node}: {get_param: [cmaui_names, 0]}
+ ${cmaui.timezone}: {get_param: timezone}
+ user_data_format: RAW \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_nested_in_main_file_in_manifest/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_nested_in_main_file_in_manifest/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..0291368d24
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_nested_in_main_file_in_manifest/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,203 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cmaui:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ exposed_cmaui_volume:
+ label: CMAUI volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: the size of the CMAUI volume
+ cmaui_cinder_volume_size:
+ label: CMAUI Cinder volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: the size of the CMAUI Cinder volume
+ timezone:
+ label: timezone
+ hidden: false
+ immutable: false
+ type: string
+ description: timezone
+ security_group_name:
+ label: security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of security group
+ oam_network_netmask:
+ label: oam network netmask
+ hidden: false
+ immutable: false
+ type: string
+ description: oam network gateway
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ vnf_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-CMAUI_id
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ oam_network_gateway:
+ label: oam network gateway
+ hidden: false
+ immutable: false
+ type: string
+ description: oam network gateway
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ label: CMAUI oam_net IP addresses
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI oam_net IP addresses
+ entry_schema:
+ type: string
+ external_dns:
+ label: dns server
+ hidden: false
+ immutable: false
+ type: string
+ description: dns server
+ oam_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ external_ntp:
+ label: ntp server
+ hidden: false
+ immutable: false
+ type: string
+ description: ntp server
+ CMAUI_volume_type:
+ label: CMAUI vm volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the target volume backend
+ node_templates:
+ server_cmaui:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ user_data_format: RAW
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: cmaui_volume
+ relationship: cmaui_volume_attachment
+ cmaui_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: CMAUI_volume_type
+ size: '(get_input : cmaui_cinder_volume_size) * 1024'
+ cmaui_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ relationship_templates:
+ cmaui_volume_attachment:
+ type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo
+ properties:
+ volume_id: cmaui_volume
+ instance_uuid: server_cmaui
+ groups:
+ a_vol:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/a_vol.yml
+ description: volume
+ members:
+ - cmaui_volume
+ hot_template:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/hot_template.yml
+ description: cmaui server template for vMMSC
+ members:
+ - server_cmaui
+ - cmaui_port_0
+ outputs:
+ exposed_cmaui_volume:
+ value: cmaui_volume \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_nested_in_main_file_in_manifest/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_nested_in_main_file_in_manifest/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..5804dbdf5e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_nested_in_main_file_in_manifest/inputfiles/MANIFEST.json
@@ -0,0 +1,19 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot_template.yml",
+ "type": "HEAT",
+ "isBase": "false",
+ "data":[
+ {
+ "file": "a_vol.yml",
+ "type": "HEAT_VOL",
+ "isBase": "false"
+ }
+ ]
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_nested_in_main_file_in_manifest/inputfiles/a_vol.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_nested_in_main_file_in_manifest/inputfiles/a_vol.yml
new file mode 100644
index 0000000000..78c2ee12c4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_nested_in_main_file_in_manifest/inputfiles/a_vol.yml
@@ -0,0 +1,24 @@
+heat_template_version: 2013-05-23
+
+description: volume
+
+parameters:
+ cmaui_cinder_volume_size:
+ type: number
+ label: CMAUI Cinder volume size
+ description: the size of the CMAUI Cinder volume
+ CMAUI_volume_type:
+ type: string
+ label: CMAUI vm volume type
+ description: the name of the target volume backend
+
+resources:
+ cmaui_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: cmaui_cinder_volume_size}
+ volume_type: {get_param: CMAUI_volume_type}
+
+outputs:
+ exposed_cmaui_volume:
+ value: {get_resource: cmaui_volume} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_nested_in_main_file_in_manifest/inputfiles/hot_template.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_nested_in_main_file_in_manifest/inputfiles/hot_template.yml
new file mode 100644
index 0000000000..ead437747d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_nested_in_main_file_in_manifest/inputfiles/hot_template.yml
@@ -0,0 +1,112 @@
+heat_template_version: 2013-05-23
+
+description: cmaui server template for vMMSC
+
+parameters:
+ vnf_id:
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-CMAUI_id
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ exposed_cmaui_volume:
+ type: number
+ label: CMAUI volume size
+ description: the size of the CMAUI volume
+ cmaui_cinder_volume_size:
+ type: number
+ label: CMAUI Cinder volume size
+ description: the size of the CMAUI Cinder volume
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ oam_net_name:
+ type: string
+ description: UID of OAM network
+ oam_network_netmask:
+ type: string
+ label: oam network netmask
+ description: oam network gateway
+ oam_network_gateway:
+ type: string
+ label: oam network gateway
+ description: oam network gateway
+ external_dns:
+ type: string
+ label: dns server
+ description: dns server
+ external_ntp:
+ type: string
+ label: ntp server
+ description: ntp server
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ timezone:
+ type: string
+ label: timezone
+ description: timezone
+ cmaui_oam_ips:
+ type: comma_delimited_list
+ label: CMAUI oam_net IP addresses
+ description: CMAUI oam_net IP addresses
+ CMAUI_volume_type:
+ type: string
+ label: CMAUI vm volume type
+ description: the name of the target volume backend
+
+resources:
+
+ cmaui_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ cmaui_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_param: exposed_cmaui_volume}
+ instance_uuid: {get_resource: server_cmaui}
+
+ server_cmaui:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_0 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ cmaui.mgmt.ip=${cmaui.mgmt.ip}
+ cmaui.mgmt.netmask=${cmaui.mgmt.netmask}
+ cmaui.mgmt.gateway=${cmaui.mgmt.gateway}
+ cmaui.external.dns=${cmaui.external.dns}
+ cmaui.external.ntp=${cmaui.external.ntp}
+ cmaui.node=${cmaui.node}
+ cmaui.timezone=${cmaui.timezone}
+ params:
+ ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]}
+ ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${cmaui.external.dns}: {get_param: external_dns}
+ ${cmaui.external.ntp}: {get_param: external_ntp}
+ ${cmaui.node}: {get_param: [cmaui_names, 0]}
+ ${cmaui.timezone}: {get_param: timezone}
+ user_data_format: RAW \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_parallel_to_main_file/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_parallel_to_main_file/expectedoutputfiles/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..09919379e0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_parallel_to_main_file/expectedoutputfiles/MainServiceTemplate.yaml
@@ -0,0 +1,189 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ ContrailComputeGlobalTypes:
+ file: ContrailComputeGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailPortGlobalTypes:
+ file: ContrailPortGlobalTypesServiceTemplate.yaml
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ ContrailAbstractSubstituteGlobalTypes:
+ file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailV2VirtualMachineInterfaceGlobalType:
+ file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cmaui:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: string
+ cmaui_cinder_volume_size:
+ label: CMAUI Cinder volume size
+ hidden: false
+ immutable: false
+ type: float
+ description: the size of the CMAUI Cinder volume
+ timezone:
+ label: timezone
+ hidden: false
+ immutable: false
+ type: string
+ description: timezone
+ security_group_name:
+ label: security group name
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of security group
+ cmaui_volume:
+ label: CMAUI vm volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the target volume backend
+ oam_network_netmask:
+ label: oam network netmask
+ hidden: false
+ immutable: false
+ type: string
+ description: oam network gateway
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ vnf_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-CMAUI_id
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ oam_network_gateway:
+ label: oam network gateway
+ hidden: false
+ immutable: false
+ type: string
+ description: oam network gateway
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ cmaui_oam_ips:
+ label: CMAUI oam_net IP addresses
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI oam_net IP addresses
+ entry_schema:
+ type: string
+ external_dns:
+ label: dns server
+ hidden: false
+ immutable: false
+ type: string
+ description: dns server
+ oam_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ external_ntp:
+ label: ntp server
+ hidden: false
+ immutable: false
+ type: string
+ description: ntp server
+ CMAUI_volume_type:
+ label: CMAUI vm volume type
+ hidden: false
+ immutable: false
+ type: string
+ description: the name of the target volume backend
+ node_templates:
+ server_cmaui:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ metadata:
+ vnf_id:
+ get_input: vnf_id
+ user_data_format: RAW
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ cmaui_volume:
+ type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
+ properties:
+ volume_type:
+ get_input: CMAUI_volume_type
+ size: '(get_input : cmaui_cinder_volume_size) * 1024'
+ cmaui_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: oam_net_name
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ a_vol:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/a_vol.yml
+ description: volume
+ members:
+ - cmaui_volume
+ hot_template:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/hot_template.yml
+ description: cmaui server template for vMMSC
+ members:
+ - server_cmaui
+ - cmaui_port_0 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_parallel_to_main_file/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_parallel_to_main_file/inputfiles/MANIFEST.json
new file mode 100644
index 0000000000..e35976356f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_parallel_to_main_file/inputfiles/MANIFEST.json
@@ -0,0 +1,16 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create 2 cinder volume attachment",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot_template.yml",
+ "isBase": true,
+ "type": "HEAT"
+ },
+ {
+ "file": "a_vol.yml",
+ "type": "HEAT_VOL"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_parallel_to_main_file/inputfiles/a_vol.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_parallel_to_main_file/inputfiles/a_vol.yml
new file mode 100644
index 0000000000..c32b9461eb
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_parallel_to_main_file/inputfiles/a_vol.yml
@@ -0,0 +1,20 @@
+heat_template_version: 2013-05-23
+
+description: volume
+
+parameters:
+ cmaui_cinder_volume_size:
+ type: number
+ label: CMAUI Cinder volume size
+ description: the size of the CMAUI Cinder volume
+ CMAUI_volume_type:
+ type: string
+ label: CMAUI vm volume type
+ description: the name of the target volume backend
+
+resources:
+ cmaui_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: cmaui_cinder_volume_size}
+ volume_type: {get_param: CMAUI_volume_type}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_parallel_to_main_file/inputfiles/hot_template.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_parallel_to_main_file/inputfiles/hot_template.yml
new file mode 100644
index 0000000000..2d0ed3c426
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_parallel_to_main_file/inputfiles/hot_template.yml
@@ -0,0 +1,112 @@
+heat_template_version: 2013-05-23
+
+description: cmaui server template for vMMSC
+
+parameters:
+ vnf_id:
+ type: string
+ description: Unique ID for this VNF instance
+ default: This_is_ths_MMSC-CMAUI_id
+ cmaui_names:
+ type: comma_delimited_list
+ description: CMAUI1, CMAUI2 server names
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ cmaui_cinder_volume_size:
+ type: number
+ label: CMAUI Cinder volume size
+ description: the size of the CMAUI Cinder volume
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ oam_net_name:
+ type: string
+ description: UID of OAM network
+ oam_network_netmask:
+ type: string
+ label: oam network netmask
+ description: oam network gateway
+ oam_network_gateway:
+ type: string
+ label: oam network gateway
+ description: oam network gateway
+ external_dns:
+ type: string
+ label: dns server
+ description: dns server
+ external_ntp:
+ type: string
+ label: ntp server
+ description: ntp server
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ timezone:
+ type: string
+ label: timezone
+ description: timezone
+ cmaui_oam_ips:
+ type: comma_delimited_list
+ label: CMAUI oam_net IP addresses
+ description: CMAUI oam_net IP addresses
+ CMAUI_volume_type:
+ type: string
+ label: CMAUI vm volume type
+ description: the name of the target volume backend
+ cmaui_volume:
+ type: string
+ label: CMAUI vm volume type
+ description: the name of the target volume backend
+
+resources:
+
+ cmaui_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: oam_net_name }
+ fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}]
+ security_groups: [{get_param: security_group_name}]
+ replacement_policy: AUTO
+
+ cmaui_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: {get_param: cmaui_volume}
+ instance_uuid: {get_resource: server_cmaui}
+
+ server_cmaui:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [cmaui_names, 0]}
+ image: { get_param: cmaui_image }
+ availability_zone: { get_param: availability_zone_0 }
+ flavor: { get_param: cmaui_flavor }
+ networks:
+ - port: { get_resource: cmaui_port_0 }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+ user_data:
+ str_replace:
+ template: |
+ cmaui.mgmt.ip=${cmaui.mgmt.ip}
+ cmaui.mgmt.netmask=${cmaui.mgmt.netmask}
+ cmaui.mgmt.gateway=${cmaui.mgmt.gateway}
+ cmaui.external.dns=${cmaui.external.dns}
+ cmaui.external.ntp=${cmaui.external.ntp}
+ cmaui.node=${cmaui.node}
+ cmaui.timezone=${cmaui.timezone}
+ params:
+ ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]}
+ ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask}
+ ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway}
+ ${cmaui.external.dns}: {get_param: external_dns}
+ ${cmaui.external.ntp}: {get_param: external_ntp}
+ ${cmaui.node}: {get_param: [cmaui_names, 0]}
+ ${cmaui.timezone}: {get_param: timezone}
+ user_data_format: RAW \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/testManifestFormat.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/testManifestFormat.json
new file mode 100644
index 0000000000..38073c6742
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/testManifestFormat.json
@@ -0,0 +1,59 @@
+{
+ "name": "vSRX",
+ "description": "juniper firewall",
+ "version": "0.1",
+ "data": [
+ {
+ "file": "vSRX.yml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "bella.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "im_network_heat.yml",
+ "type": "HEAT_NET"
+ },
+ {
+ "file": "im_volume_heat.yml",
+ "type": "HEAT_VOL"
+ }
+ ]
+ },
+ {
+ "file": "im_nested_heat.yml",
+ "type": "HEAT",
+ "data": [{
+ "file": "alpha.env",
+ "type": "HEAT_ENV"
+ }]
+ },
+ {
+ "file": "vSRX_VM.yml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "bella_vm.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "im_network_heat.yml",
+ "type": "HEAT_NET",
+ "data": [{
+ "file": "mika.env",
+ "type": "HEAT_ENV"
+ }]
+ },
+ {
+ "file": "im_volume_heat.yml",
+ "type": "HEAT_VOL"
+ }
+ ]
+ },
+ {
+ "file": "im_artifact.yml",
+ "type": "CHEF"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/MANIFEST.json
new file mode 100644
index 0000000000..02733a6e3f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/MANIFEST.json
@@ -0,0 +1,29 @@
+{
+ "name": "vMME_Small",
+ "description": "HOT template to create vmme 2 fsb 2 ncb 2 gbp 2 vlc",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "vmme_small.yml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "vmme_small.env",
+ "type": "HEAT_ENV"
+ },{
+ "file": "vmme_small_create_fsb.yml",
+ "type": "HEAT_NET",
+ "data":[
+ {
+ "file": "vmme_small_create_fsb.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ }
+ ]
+ },{
+ "file": "create_stack.sh",
+ "type": "SHELL"
+ }
+ ]
+}
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/create_stack.sh b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/create_stack.sh
new file mode 100644
index 0000000000..186d1c34fb
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/create_stack.sh
@@ -0,0 +1 @@
+heat stack-create vMME -e vmme_small.env -f vmme_small.yml
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/vmme_small.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/vmme_small.env
new file mode 100644
index 0000000000..e46cfd2a2d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/vmme_small.env
@@ -0,0 +1,97 @@
+parameters:
+ oam_net_id: 47bf4cca-0961-422f-bcd6-d5a4fbb1a351
+ fsb1-name: ZRDM1MMEX33FSB001
+ fsb2-name: ZRDM1MMEX33FSB002
+ ncb1-name: ZRDM1MMEX33NCB001
+ ncb2-name: ZRDM1MMEX33NCB002
+ vlc1-name: ZRDM1MMEX33VLC002
+ vlc2-name: ZRDM1MMEX33VLC002
+ gpb1-name: ZRDM1MMEX33GPB001
+ gpb2-name: ZRDM1MMEX33GPB002
+ epc-sctp-a-net-name: EPC-SCTP-A
+ epc-sctp-a-net-rt: 13979:105717
+ epc-sctp-a-net-cidr: 107.243.37.0/27
+ epc-sctp-a-net-gateway: 107.243.37.1
+ epc-sctp-a-pool-start: 107.243.37.3
+ epc-sctp-a-pool-end: 107.243.37.30
+ epc-sctp-b-net-name: EPC-SCTP-B
+ epc-sctp-b-net-rt: 13979:105719
+ epc-sctp-b-net-cidr: 107.243.37.32/24
+ epc-sctp-b-net-gateway: 107.243.37.33
+ epc-sctp-b-pool-start: 107.243.37.35
+ epc-sctp-b-pool-end: 107.243.37.62
+ epc-gtp-net-name: EPC-GTP
+ epc-gtp-net-rt: 13979:105715
+ epc-gtp-net-cidr: 107.243.37.64/27
+ epc-gtp-net-gateway: 107.243.37.65
+ epc-gtp-pool-start: 107.243.37.67
+ epc-gtp-pool-end: 107.243.37.94
+ fsb1-image: MME_FSB1_15B-CP04-r5a01
+ fsb2-image: MME_FSB2_15B-CP04-r5a01
+ fsb1-flavor: m4.xlarge4
+ fsb2-flavor: m4.xlarge4
+ fsb_zone: nova
+ fsb1-Internal1-mac: 00:80:37:0E:0B:12
+ fsb1-Internal2-mac: 00:81:37:0E:0B:12
+ fsb1-oam-ip: 107.250.172.221
+ fsb2-Internal1-mac: 00:80:37:0E:0D:12
+ fsb2-Internal2-mac: 00:81:37:0E:0D:12
+ fsb2-oam-ip: 107.250.172.222
+ pxe-image: MME_PXE-BOOT_cxp9025898_2r5a01.qcow2
+ ncb-flavor: m4.xlarge4
+ ncb_zone: nova
+ ncb1-Internal1-mac: 00:80:37:0E:09:12
+ ncb1-Internal2-mac: 00:81:37:0E:09:12
+ ncb2-Internal1-mac: 00:80:37:0E:0F:12
+ ncb2-Internal2-mac: 00:81:37:0E:0F:12
+ gpb-flavor: m4.xlarge4
+ gpb_zone: nova
+ gpb1-Internal1-mac: 00:80:37:0E:01:22
+ gpb1-Internal1-ip: 169.254.0.101
+ gpb1-Internal2-mac: 00:81:37:0E:01:22
+ gpb2-Internal1-mac: 00:80:37:0E:02:22
+ gpb2-Internal2-mac: 00:81:37:0E:02:22
+ vlc-flavor: m4.xlarge4
+ vlc_zone: nova
+ vlc1-sctp-a-ip: 107.243.37.3
+ vlc1-sctp-b-ip: 107.243.37.35
+ vlc1-gtp-ip: 107.243.37.67
+ vlc1-oam-ip: 107.250.172.227
+ vlc2-sctp-a-ip: 107.243.37.4
+ vlc2-sctp-b-ip: 107.243.37.36
+ vlc2-gtp-ip: 107.243.37.68
+ vlc2-oam-ip: 107.250.172.228
+ vlc1-Internal1-mac: 00:80:37:0E:01:12
+ vlc1-Internal2-mac: 00:81:37:0E:01:12
+ vlc2-Internal1-mac: 00:80:37:0E:02:12
+ vlc2-Internal2-mac: 00:81:37:0E:02:12
+ Internal1_net_name: vmme_int_int_1
+ Internal1_subnet_name: vmme_int_int_sub_1
+ Internal1_ipam_name: vmme_ipam_int1
+ Internal1_cidr: 169.253.0.0/17
+ Internal1_forwarding_mode: "l2"
+ Internal1_dhcp: "False"
+ Internal1_shared: "False"
+ Internal1_external: "False"
+ Internal1_name: "Internal1-subnet"
+ Internal1_default_gateway: 169.253.0.3
+ Internal1_net_pool_start: 169.253.0.100
+ Internal1_net_pool_end: 169.253.0.254
+ Internal2_net_name: vmme_int_int_2
+ Internal2_subnet_name: vmme_int_int_sub_2
+ Internal2_ipam_name: vmme_ipam_int2
+ Internal2_cidr: 169.255.0.0/17
+ Internal2_shared: "False"
+ Internal2_external: "False"
+ Internal2_forwarding_mode: "l2"
+ Internal2_dhcp: "False"
+ Internal2_name: "Internal2-subnet"
+ Internal2_default_gateway: 169.255.0.3
+ Internal2_net_pool_start: 169.255.0.100
+ Internal2_net_pool_end: 169.255.0.254
+ static_prefix_sctp_a_1: 107.239.40.32/30
+ static_prefix_gtp_1: 107.239.40.96/30
+ static_prefix_sctp_b_1: 107.239.40.64/30
+ VMME_FSB1_boot_volume: 8248e794-6173-4b49-b9c3-8219b0b56f4e
+ VMME_FSB2_boot_volume: 089a0d11-4b15-4370-8343-3f90907b1221
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/vmme_small.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/vmme_small.yml
new file mode 100644
index 0000000000..1050166050
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/vmme_small.yml
@@ -0,0 +1,676 @@
+heat_template_version: 2013-05-23
+
+description: >
+ HOT template to create vmme 2 fsb 2 ncb 2 gbp 2 vlc
+
+parameters:
+ fsb1-oam-ip:
+ type: string
+ fsb2-oam-ip:
+ type: string
+ vlc1-oam-ip:
+ type: string
+ vlc2-oam-ip:
+ type: string
+ Internal1_net_pool_start:
+ type: string
+ Internal1_net_pool_end:
+ type: string
+ Internal2_net_pool_start:
+ type: string
+ Internal2_net_pool_end:
+ type: string
+ Internal1_default_gateway:
+ type: string
+ Internal2_default_gateway:
+ type: string
+ Internal1_shared:
+ type: string
+ Internal1_external:
+ type: string
+ Internal1_net_name:
+ type: string
+ Internal1_subnet_name:
+ type: string
+ Internal1_ipam_name:
+ type: string
+ Internal1_cidr:
+ type: string
+ Internal1_forwarding_mode:
+ type: string
+ Internal1_dhcp:
+ type: string
+ Internal1_name:
+ type: string
+ Internal2_net_name:
+ type: string
+ Internal2_subnet_name:
+ type: string
+ Internal2_ipam_name:
+ type: string
+ Internal2_cidr:
+ type: string
+ Internal2_forwarding_mode:
+ type: string
+ Internal2_dhcp:
+ type: string
+ Internal2_name:
+ type: string
+ Internal2_shared:
+ type: string
+ Internal2_external:
+ type: string
+ vlc1-sctp-a-ip:
+ type: string
+ vlc1-sctp-b-ip:
+ type: string
+ vlc1-gtp-ip:
+ type: string
+ vlc2-sctp-a-ip:
+ type: string
+ vlc2-sctp-b-ip:
+ type: string
+ vlc2-gtp-ip:
+ type: string
+ fsb1-name:
+ type: string
+ description: Name of fsb1
+ fsb2-name:
+ type: string
+ description: Name of fsb1
+ ncb1-name:
+ type: string
+ description: Name of ncb1
+ ncb2-name:
+ type: string
+ description: Name of ncb2
+ vlc1-name:
+ type: string
+ description: Name of vlc1
+ vlc2-name:
+ type: string
+ description: Name of vlc2
+ gpb1-name:
+ type: string
+ description: Name of gpb1
+ gpb2-name:
+ type: string
+ description: Name of gpb2
+ fsb_zone:
+ type: string
+ description: cluster for spawnning fsb instances
+ fsb1-image:
+ type: string
+ description: Name of image to use for server fsb1
+ fsb1-flavor:
+ type: string
+ description: Flavor to use for servers fsb1
+ oam_net_id:
+ type: string
+ description: uuid of oam network
+ fsb1-Internal1-mac:
+ type: string
+ description: static mac address assigned to fsb1-Internal1
+ fsb1-Internal2-mac:
+ type: string
+ description: static mac address assigned to fsb1-Internal2
+ fsb2-image:
+ type: string
+ description: Name of image to use for server fsb2
+ fsb2-flavor:
+ type: string
+ description: Flavor to use for servers fsb2
+ fsb2-Internal1-mac:
+ type: string
+ description: static mac address assigned to fsb2-Internal1
+ fsb2-Internal2-mac:
+ type: string
+ description: static mac address assigned to fsb2-Internal2
+ pxe-image:
+ type: string
+ description: Name of image to use for server ncb
+ ncb-flavor:
+ type: string
+ description: Flavor to use for servers ncb
+ ncb_zone:
+ type: string
+ description: cluster for spawnning ncb instances
+ ncb1-Internal1-mac:
+ type: string
+ description: static mac address assigned to ncb1-Internal1
+ ncb1-Internal2-mac:
+ type: string
+ description: static mac address assigned to ncb1-Internal2
+ ncb2-Internal1-mac:
+ type: string
+ description: static mac address assigned to ncb2-Internal1
+ ncb2-Internal2-mac:
+ type: string
+ description: static mac address assigned to ncb2-Internal2
+ gpb-flavor:
+ type: string
+ description: Flavor to use for servers gpb
+ gpb_zone:
+ type: string
+ description: cluster for spawnning gpb instances
+ gpb1-Internal1-ip:
+ type: string
+ gpb1-Internal1-mac:
+ type: string
+ description: static mac address assigned to gpb1-Internal1
+ gpb1-Internal2-mac:
+ type: string
+ description: static mac address assigned to gpb1-Internal2
+ gpb2-Internal1-mac:
+ type: string
+ description: static mac address assigned to gpb2-Internal1
+ gpb2-Internal2-mac:
+ type: string
+ description: static mac address assigned to gpb2-Internal2
+ vlc-flavor:
+ type: string
+ description: Flavor to use for servers vlc
+ vlc_zone:
+ type: string
+ description: cluster for spawnning vlc instances
+ vlc1-Internal1-mac:
+ type: string
+ description: static mac address assigned to vlc1-Internal1
+ vlc1-Internal2-mac:
+ type: string
+ description: static mac address assigned to vlc1-Internal2
+ vlc2-Internal1-mac:
+ type: string
+ description: static mac address assigned to vlc2-Internal1
+ vlc2-Internal2-mac:
+ type: string
+ description: static mac address assigned to vlc2-Internal2
+ epc-sctp-a-net-name:
+ type: string
+ description: epc-sctp-a net name
+ epc-sctp-a-net-rt:
+ type: string
+ description: epc-sctp-a route target
+ epc-sctp-a-net-cidr:
+ type: string
+ description: epc-sctp-a subnet
+ epc-sctp-a-net-gateway:
+ type: string
+ description: epc-sctp-a-net network gateway
+ epc-sctp-a-pool-start:
+ type: string
+ description: epc-sctp-a-net network ip pool start IP address
+ epc-sctp-a-pool-end:
+ type: string
+ description: epc-sctp-a-net network ip pool end IP address
+ epc-sctp-b-net-name:
+ type: string
+ description: epc-sctp-b net name
+ epc-sctp-b-net-rt:
+ type: string
+ description: epc-sctp-b route target
+ epc-sctp-b-net-cidr:
+ type: string
+ description: epc-sctp-b subnet
+ epc-sctp-b-net-gateway:
+ type: string
+ description: epc-sctp-b-net network gateway
+ epc-sctp-b-pool-start:
+ type: string
+ description: epc-sctp-b-net network ip pool start IP address
+ epc-sctp-b-pool-end:
+ type: string
+ description: epc-sctp-b-net network ip pool end IP address
+ epc-gtp-net-name:
+ type: string
+ description: gtp net name
+ epc-gtp-net-rt:
+ type: string
+ description: gtp route target
+ epc-gtp-net-cidr:
+ type: string
+ description: gtp stubnet
+ epc-gtp-net-gateway:
+ type: string
+ description: gtp network gateway
+ epc-gtp-pool-start:
+ type: string
+ description: gtp network ip pool start IP address
+ epc-gtp-pool-end:
+ type: string
+ description: gtp network ip pool end IP address
+ static_prefix_sctp_a_1:
+ type: string
+ description: Static Prefix
+ static_prefix_sctp_b_1:
+ type: string
+ description: Static Prefix
+ static_prefix_gtp_1:
+ type: string
+ description: Static Prefix
+ VMME_FSB1_boot_volume:
+ type: string
+ VMME_FSB2_boot_volume:
+ type: string
+
+resources:
+ FSB1_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: 3
+ volume_type: {get_param: volume_type}
+ name: {get_param: FSB1_volume_name}
+ image: {get_param: FSB_1_image}
+
+ FSB2_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: volume_size}
+ volume_type: {get_param: volume_type}
+ name: {get_param: FSB2_volume_name}
+ image: {get_param: FSB_2_image}
+
+ Internal1_ipam:
+ type: OS::Contrail::NetworkIpam
+ properties:
+ name: { get_param: Internal1_ipam_name }
+
+ Internal2_ipam:
+ type: OS::Contrail::NetworkIpam
+ properties:
+ name: { get_param: Internal2_ipam_name }
+
+ Internal1-net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: Internal1_net_name }
+ forwarding_mode: { get_param: Internal1_forwarding_mode }
+ shared: { get_param: Internal1_shared }
+ external: true
+# route_targets: { "Fn::Split" : [ ",", Ref: route_targets ] }
+ testConvertGetParamFunctions:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: Internal1_net_name }
+ forwarding_mode: { get_param: Internal1_forwarding_mode }
+ shared: { get_param: Internal1_shared }
+ external: { get_param: [my_instance, networks, private, 0] }
+# route_targets: { "Fn::Split" : [ ",", Ref: route_targets ] }
+ testConvertGetAttributeFunctions:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: Internal1_net_name }
+ forwarding_mode: { get_param: Internal1_forwarding_mode }
+ shared: { get_param: Internal1_shared }
+ external: { get_param: Internal1_external }
+# route_targets: { "Fn::Split" : [ ",", Ref: route_targets ] }
+
+ Internal1-subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: Internal1-net }
+ cidr: { get_param: Internal1_cidr }
+ gateway_ip: { get_param: Internal1_default_gateway }
+ enable_dhcp: { get_param: Internal1_dhcp }
+
+
+# Internal1-subnet:
+# type: OS::Contrail::VnSubnet
+# properties:
+# name: { get_param: Internal1_subnet_name }
+# network: { get_resource: Internal1-net }
+# ip_prefix: { get_param: Internal1_cidr }
+ # ipam: { get_resource: Internal1_ipam }
+ # enable_dhcp: { get_param: Internal1_dhcp }
+ # default_gateway: { get_param: Internal1_default_gateway }
+ # allocation_pools:
+ # - start: { get_param: Internal1_net_pool_start }
+ # end: { get_param: Internal1_net_pool_end }
+
+
+
+ Internal2-net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: Internal2_name }
+ forwarding_mode: { get_param: Internal2_forwarding_mode }
+ shared: { get_param: Internal2_shared }
+ external: { get_param: Internal2_external }
+# route_targets: { "Fn::Split" : [ ",", Ref: route_targets ] }
+
+# Internal2-subnet:
+# type: OS::Contrail::VnSubnet
+# properties:
+# name: { get_param: Internal2_subnet_name }
+# network: { get_resource: Internal2-net }
+# ip_prefix: { get_param: Internal2_cidr }
+# ipam: { get_resource: Internal2_ipam }
+# enable_dhcp: { get_param: Internal2_dhcp }
+# default_gateway: { get_param: Internal2_default_gateway }
+# allocation_pools:
+# - start: { get_param: Internal2_net_pool_start }
+# end: { get_param: Internal2_net_pool_end }
+
+ Internal2-subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: Internal2-net }
+ cidr: { get_param: Internal2_cidr }
+ gateway_ip: { get_param: Internal2_default_gateway }
+ enable_dhcp: { get_param: Internal2_dhcp }
+
+ epc-sctp-a-net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: epc-sctp-a-net-name }
+ route_targets: [ get_param: epc-sctp-a-net-rt ]
+
+
+ epc-sctp-a-subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: epc-sctp-a-net }
+ cidr: { get_param: epc-sctp-a-net-cidr }
+ gateway_ip: { get_param: epc-sctp-a-net-gateway }
+ allocation_pools:
+ - start: { get_param: epc-sctp-a-pool-start }
+ end: { get_param: epc-sctp-a-pool-end }
+
+ epc-sctp-b-net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: epc-sctp-b-net-name }
+ route_targets: [ get_param: epc-sctp-b-net-rt ]
+
+ epc-sctp-b-subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: epc-sctp-b-net }
+ cidr: { get_param: epc-sctp-b-net-cidr }
+ gateway_ip: { get_param: epc-sctp-b-net-gateway }
+ allocation_pools:
+ - start: { get_param: epc-sctp-b-pool-start }
+ end: { get_param: epc-sctp-b-pool-end }
+
+ epc-gtp-net:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ name: { get_param: epc-gtp-net-name }
+ route_targets: [ get_param: epc-gtp-net-rt ]
+
+ epc-gtp-subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: epc-gtp-net }
+ cidr: { get_param: epc-gtp-net-cidr }
+ gateway_ip: { get_param: epc-gtp-net-gateway }
+ allocation_pools:
+ - start: { get_param: epc-gtp-pool-start }
+ end: { get_param: epc-gtp-pool-end }
+
+ FSB1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: fsb1-name }
+ block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB1_boot_volume }, delete_on_termination: "false" }]
+ flavor: { get_param: fsb1-flavor }
+ availability_zone: { get_param: fsb_zone }
+ networks:
+ - port: { get_resource: FSB1_Internal1 }
+ - port: { get_resource: FSB1_Internal2 }
+ - port: { get_resource: FSB1_OAM }
+
+ FSB1_Internal1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: Internal1-net }
+ mac_address: { get_param: fsb1-Internal1-mac }
+
+ FSB1_Internal2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: Internal2-net }
+ mac_address: { get_param: fsb1-Internal2-mac }
+
+ FSB1_OAM:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_param: oam_net_id }
+ fixed_ips:
+ - ip_address: { get_param: fsb1-oam-ip }
+
+ FSB2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: fsb2-name }
+ block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }]
+ flavor: { get_param: fsb2-flavor }
+ availability_zone: { get_param: fsb_zone }
+ networks:
+ - port: { get_resource: FSB2_Internal1 }
+ - port: { get_resource: FSB2_Internal2 }
+ - port: { get_resource: FSB2_OAM }
+
+ FSB2_Internal1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: Internal1-net }
+ mac_address: { get_param: fsb2-Internal1-mac }
+
+
+ FSB2_Internal2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: Internal2-net }
+ mac_address: { get_param: fsb2-Internal2-mac }
+
+ FSB2_OAM:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_param: oam_net_id }
+ fixed_ips:
+ - ip_address: { get_param: fsb2-oam-ip }
+
+ NCB1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: ncb1-name }
+ image: { get_param: pxe-image }
+ flavor: { get_param: ncb-flavor }
+ availability_zone: { get_param: ncb_zone }
+ networks:
+ - port: { get_resource: NCB1_Internal1 }
+ - port: { get_resource: NCB1_Internal2 }
+
+ NCB1_Internal1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: Internal1-net }
+ mac_address: { get_param: ncb1-Internal1-mac }
+
+ NCB1_Internal2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: Internal2-net }
+ mac_address: { get_param: ncb1-Internal2-mac }
+
+ NCB2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: ncb2-name }
+ image: { get_param: pxe-image }
+ flavor: { get_param: ncb-flavor }
+ availability_zone: { get_param: ncb_zone }
+ networks:
+ - port: { get_resource: NCB2_Internal1 }
+ - port: { get_resource: NCB2_Internal2 }
+
+ NCB2_Internal1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: Internal1-net }
+ mac_address: { get_param: ncb2-Internal1-mac }
+
+ NCB2_Internal2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: Internal2-net }
+ mac_address: { get_param: ncb2-Internal2-mac }
+
+ GPB1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: gpb1-name }
+ image: gpb_image
+ flavor: { get_param: gpb-flavor }
+ availability_zone: { get_param: gpb_zone }
+ networks:
+ - port: { get_resource: GPB1_Internal1 }
+ - port: { get_resource: GPB1_Internal2 }
+
+ GPB1_Internal1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: Internal1-net }
+ mac_address: { get_param: gpb1-Internal1-mac }
+
+ GPB1_Internal2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: Internal2-net }
+ mac_address: { get_param: gpb1-Internal2-mac }
+
+ GPB2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: gpb2-name }
+ image: { get_param: pxe-image }
+ flavor: { get_param: gpb-flavor }
+ availability_zone: { get_param: gpb_zone }
+ networks:
+ - port: { get_resource: GPB2_Internal1 }
+ - port: { get_resource: GPB2_Internal2 }
+
+ GPB2_Internal1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: Internal1-net }
+ mac_address: { get_param: gpb2-Internal1-mac }
+
+ GPB2_Internal2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: Internal2-net }
+ mac_address: { get_param: gpb2-Internal2-mac }
+
+ VLC1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: vlc1-name }
+ image: { get_param: pxe-image }
+ flavor: { get_param: vlc-flavor }
+ availability_zone: { get_param: vlc_zone }
+ networks:
+ - port: { get_resource: VLC1_Internal1 }
+ - port: { get_resource: VLC1_Internal2 }
+ - port: { get_resource: VLC1_OAM }
+ - port: { get_resource: VLC1_SCTP_A }
+ - port: { get_resource: VLC1_SCTP_B }
+ - port: { get_resource: VLC1_GTP }
+
+ VLC1_Internal1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: Internal1-net }
+ mac_address: { get_param: vlc1-Internal1-mac }
+
+ VLC1_Internal2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: Internal2-net }
+ mac_address: { get_param: vlc1-Internal2-mac }
+
+ VLC1_OAM:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_param: oam_net_id }
+ fixed_ips:
+ - ip_address: { get_param: vlc1-oam-ip }
+
+ VLC1_SCTP_A:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: epc-sctp-a-net }
+ fixed_ips:
+ - ip_address: { get_param: vlc1-sctp-a-ip }
+
+ VLC1_SCTP_B:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: epc-sctp-b-net }
+ fixed_ips:
+ - ip_address: { get_param: vlc1-sctp-b-ip }
+
+ VLC1_GTP:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: epc-gtp-net }
+ fixed_ips:
+ - ip_address: { get_param: vlc1-gtp-ip }
+
+ VLC2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: vlc2-name }
+ image: { get_param: pxe-image }
+ flavor: { get_param: vlc-flavor }
+ availability_zone: { get_param: vlc_zone }
+ networks:
+ - port: { get_resource: VLC2_Internal1 }
+ - port: { get_resource: VLC2_Internal2 }
+ - port: { get_resource: VLC2_OAM }
+ - port: { get_resource: VLC2_SCTP_A }
+ - port: { get_resource: VLC2_SCTP_B }
+ - port: { get_resource: VLC2_GTP }
+
+
+ VLC2_Internal1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: Internal1-net }
+ mac_address: { get_param: vlc2-Internal1-mac }
+
+ VLC2_OAM:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_param: oam_net_id }
+ fixed_ips:
+ - ip_address: { get_param: vlc2-oam-ip }
+
+ VLC2_Internal2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: Internal2-net }
+ mac_address: { get_param: vlc2-Internal2-mac }
+
+ VLC2_SCTP_A:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: epc-sctp-a-net }
+ fixed_ips:
+ - ip_address: { get_param: vlc2-sctp-a-ip }
+
+ VLC2_SCTP_B:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: epc-sctp-b-net }
+ fixed_ips:
+ - ip_address: { get_param: vlc2-sctp-b-ip }
+
+ VLC2_GTP:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: epc-gtp-net }
+ fixed_ips:
+ - ip_address: { get_param: vlc2-gtp-ip }
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/vmme_small_create_fsb.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/vmme_small_create_fsb.env
new file mode 100644
index 0000000000..750bb2dd44
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/vmme_small_create_fsb.env
@@ -0,0 +1,8 @@
+parameters:
+ volume_type: Gold
+ volume_size: 320
+ FSB_1_image: MME_FSB1_15B-CP04-r5a01
+ FSB_2_image: MME_FSB2_15B-CP04-r5a01
+ FSB1_volume_name: vFSB1_1_Vol_1
+ FSB2_volume_name: vFSB2_1_Vol_1
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/vmme_small_create_fsb.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/vmme_small_create_fsb.yml
new file mode 100644
index 0000000000..2d695a50c1
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/vmme_small_create_fsb.yml
@@ -0,0 +1,54 @@
+heat_template_version: 2013-05-23
+
+description: server template for vMME
+
+parameters:
+
+ volume_type:
+ type: string
+ label: volume type
+ description: volume type Gold
+
+ volume_size:
+ type: number
+ label: volume size
+ description: my volume size 320GB
+
+ FSB_1_image:
+ type: string
+ label: MME_FSB1
+ description: MME_FSB1_15B-CP04-r5a01
+
+ FSB_2_image:
+ type: string
+ label: MME_FSB2
+ description: MME_FSB2_15B-CP04-r5a01
+
+ FSB1_volume_name:
+ type: string
+ label: FSB1_volume
+ description: FSB1_volume_1
+
+ FSB2_volume_name:
+ type: string
+ label: FSB2_volume
+ description: FSB2_volume_1
+
+resources:
+
+ FSB1_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: volume_size}
+ volume_type: {get_param: volume_type}
+ name: {get_param: FSB1_volume_name}
+ image: {get_param: FSB_1_image}
+
+ FSB2_volume:
+ type: OS::Cinder::Volume
+ properties:
+ size: {get_param: volume_size}
+ volume_type: {get_param: volume_type}
+ name: {get_param: FSB2_volume_name}
+ image: {get_param: FSB_2_image}
+
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/pom.xml b/openecomp-be/lib/openecomp-sdc-translator-lib/pom.xml
new file mode 100644
index 0000000000..6fec777238
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/pom.xml
@@ -0,0 +1,37 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <packaging>pom</packaging>
+ <parent>
+ <artifactId>openecomp-sdc-lib</artifactId>
+ <groupId>org.openecomp.sdc</groupId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <name>openecomp-sdc-translator-lib</name>
+ <artifactId>openecomp-sdc-translator-lib</artifactId>
+
+ <modules>
+ <module>openecomp-sdc-translator-api</module>
+ <module>openecomp-sdc-translator-core</module>
+ </modules>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-translator-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-translator-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <!--dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-common-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency-->
+ </dependencies>
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/pom.xml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/pom.xml
new file mode 100644
index 0000000000..4f92b644c4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/pom.xml
@@ -0,0 +1,38 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-lib</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../..</relativePath>
+ </parent>
+
+ <name>openecomp-sdc-validation-api</name>
+ <artifactId>openecomp-sdc-validation-api</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-facade-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>io.swagger</groupId>
+ <artifactId>swagger-annotations</artifactId>
+ <version>1.5.3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-datatypes-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <version>1.1.2</version>
+ </dependency>
+ </dependencies>
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/api/ValidationManager.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/api/ValidationManager.java
new file mode 100644
index 0000000000..d18af3a27b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/api/ValidationManager.java
@@ -0,0 +1,35 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.validation.api;
+
+
+import org.openecomp.sdc.datatypes.error.ErrorMessage;
+
+import java.util.List;
+import java.util.Map;
+
+public interface ValidationManager {
+
+ Map<String, List<ErrorMessage>> validate();
+
+ void addFile(String fileName, byte[] validationContent);
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/errors/ErrorMessagesFormatBuilder.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/errors/ErrorMessagesFormatBuilder.java
new file mode 100644
index 0000000000..210ce76c41
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/errors/ErrorMessagesFormatBuilder.java
@@ -0,0 +1,30 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.validation.errors;
+
+public class ErrorMessagesFormatBuilder {
+
+ public static String getErrorWithParameters(String error, String... params) {
+ return String.format(error, params);
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/errors/Messages.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/errors/Messages.java
new file mode 100644
index 0000000000..bca4e820a9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/errors/Messages.java
@@ -0,0 +1,117 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.validation.errors;
+
+public enum Messages {
+ INVALID_ZIP_FILE("Invalid zip file"),
+ /* upload errors */
+
+ //NO_ZIP_UPLOADED("No zip file was uploaded or zip file doesn't exist"),
+ ZIP_SHOULD_NOT_CONTAIN_FOLDERS("Zip file should not contain folders"),
+ MANIFEST_NOT_EXIST("Manifest doesn't exist"),
+ NO_ZIP_FILE_WAS_UPLOADED_OR_ZIP_NOT_EXIST("no zip file was uploaded or zip file doesn't exist"),
+
+
+ /* manifest errors*/
+ MISSING_FILE_IN_ZIP("Missing file in zip"),
+ MISSING_FILE_IN_MANIFEST("Missing file in manifest"),
+ MISSING_FILE_NAME_IN_MANIFEST("Missing file name in manifest - %s"),
+ MISSING_NESTED_FILE("Missing nested file - %s"),
+ MISSING_ARTIFACT("Missing artifact - %s"),
+ WRONG_HEAT_FILE_EXTENSION("Wrong HEAT file extension - %s"),
+ WRONG_ENV_FILE_EXTENSION("Wrong ENV file extension - %s"),
+ INVALID_MANIFEST_FILE("invalid manifest file"),
+ INVALID_FILE_TYPE("Missing or Unknown file type in Manifest"),
+ ENV_NOT_ASSOCIATED_TO_HEAT("ENV file must be associated to a HEAT file"),
+
+ /* content errors*/
+ INVALID_YAML_FORMAT("Invalid YAML format - %s"),
+ INVALID_YAML_FORMAT_REASON("Invalid YAML format Problem - [%s]"),
+ EMPTY_YAML_FILE("empty yaml"),
+ GENERAL_YAML_PARSER_ERROR("general parser error"),
+ GENERAL_HEAT_PARSER_ERROR("general parser error"),
+ INVALID_HEAT_FORMAT_REASON("Invalid HEAT format problem - [%s]"),
+ MISSING_RESOURCE_IN_DEPENDS_ON("a Missing resource in depend On Missing Resource ID [%s]"),
+ REFERENCED_PARAMETER_NOT_FOUND("Referenced parameter - %s - not found, used in resource - %s"),
+ GET_ATTR_NOT_FOUND("get_attr attribute not found - %s in resource %s"),
+ MISSING_PARAMETER_IN_NESTED(
+ "Referenced parameter not found in nested file - %s, resource name - %s, "
+ + "parameter name - %s"),
+ NESTED_LOOP("Nested files loop - %s"),
+ MORE_THAN_ONE_BIND_FROM_NOVA_TO_PORT("Resource Port %s exceed allowed relations from NovaServer"),
+ SERVER_NOT_DEFINED_FROM_NOVA("Missing server group definition - %s, %s"),
+ WRONG_POLICY_IN_SERVER_GROUP("Wrong policy in server group - %s"),
+ MISSING_IMAGE_AND_FLAVOR("Missing both Image and Flavor in NOVA Server - %s"),
+ ENV_INCLUDES_PARAMETER_NOT_IN_HEAT("Env file %s includes a parameter not in HEAT - %s"),
+ PARAMETER_ENV_VALUE_NOT_ALIGN_WITH_TYPE("Parameter env value %s not align with type"),
+ PARAMETER_DEFAULT_VALUE_NOT_ALIGN_WITH_TYPE(
+ "Parameter - %s default value not align with type %s"),
+ INVALID_RESOURCE_TYPE("A resource has an invalid or unsupported type - %s, Resource ID [%s]"),
+ ARTIFACT_FILE_NOT_REFERENCED("Artifact file is not referenced."),
+ SERVER_OR_SECURITY_GROUP_NOT_IN_USE("%s not in use, Resource Id [%s]"),
+ PORT_NO_BIND_TO_ANY_NOVA_SERVER("Port not bind to any NOVA Server, Resource Id [%s]"),
+ INVALID_GET_RESOURCE_SYNTAX(
+ "invalid get_resource syntax is in use - %s , get_resource function should"
+ + " get the resource id of the referenced resource"),
+ INVALID_RESOURCE_GROUP_TYPE(
+ "OS::Heat::ResourceGroup resource with resource_def which is not "
+ + "pointing to nested heat file is not supported,"
+ + " Resource ID [%s], resource_def type [%s]"),
+
+ /* warnings */
+ REFERENCED_RESOURCE_NOT_FOUND("Referenced resource - %s not found"),
+ MISSING_GET_PARAM("Missing get_param in %s, Resource Id [%s]"),
+
+ /*Ecomp Guide lines*/
+ MISSING_NOVA_SERVER_METADATA("Missing Nova Server Metadata property Resource id [%s]"),
+ MISSING_NOVA_SERVER_VNF_ID("Missing VNF_ID Resource id [%s]"),
+ MISSING_NOVA_SERVER_VF_MODULE_ID("Missing VF_MODULE_ID, Resource id [%s]"),
+ NETWORK_PARAM_NOT_ALIGNED_WITH_GUIDE_LINE(
+ "Network Parameter Name not aligned with Guidelines Parameter Name [%s] Resource ID [%s]"),
+ MISSIN_BASE_HEAT_FILE(
+ "Missing Base HEAT. Pay attention that without Base HEAT, there will be no shared resources"),
+ MULTI_BASE_HEAT_FILE("Multi Base HEAT. Expected only one. Files %s."),
+ RESOURCE_NOT_DEFINED_IN_OUTPUT(
+ "Resource is not defined as output and thus cannot be Shared. resource id - %s"),
+ RESOURCE_CONNECTED_TO_TWO_EXTERNAL_NETWORKS_WITH_SAME_ROLE(
+ "A resource is connected twice to the same network role Resource ID [%s] Network Role [%s]."),
+ VOLUME_HEAT_NOT_EXPOSED("Volume is not defined as output and thus cannot be attached %s"),
+ FLOATING_IP_NOT_IN_USE("OS::Neutron::FloatingIP is in use, Resource ID [%s]"),
+ FIXED_IPS_NOT_ALIGNED_WITH_GUIDE_LINES("Fixed_IPS not aligned with Guidelines, Resource ID [%s]"),
+ NOVA_SERVER_NAME_NOT_ALIGNED_WITH_GUIDE_LINES(
+ "Server Name not aligned with Guidelines, Resource ID [%s]"),
+ AVAILABILITY_ZONE_NOT_ALIGNED_WITH_GUIDE_LINES(
+ "Server Availability Zone not aligned with Guidelines, Resource ID [%s]"),
+ WRONG_IMAGE_OR_FLAVOR_NAME_NOVA_SERVER("Wrong %s name format in NOVA Server, Resource ID [%s]");
+
+
+ private String errorMessage;
+
+ Messages(String errorMessage) {
+ this.errorMessage = errorMessage;
+ }
+
+ public String getErrorMessage() {
+ return errorMessage;
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/factory/ValidationManagerFactory.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/factory/ValidationManagerFactory.java
new file mode 100644
index 0000000000..6031bc14f7
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/factory/ValidationManagerFactory.java
@@ -0,0 +1,32 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.validation.factory;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+import org.openecomp.core.validation.api.ValidationManager;
+
+public abstract class ValidationManagerFactory extends AbstractComponentFactory<ValidationManager> {
+
+ public static ValidationManagerFactory getInstance() {
+ return AbstractFactory.getInstance(ValidationManagerFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/interfaces/Validator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/interfaces/Validator.java
new file mode 100644
index 0000000000..e32dfd72b9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/interfaces/Validator.java
@@ -0,0 +1,36 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.validation.interfaces;
+
+import org.openecomp.core.validation.types.GlobalValidationContext;
+
+public interface Validator {
+
+ //public void validate(String fileName, GlobalValidationContext globalContext);
+ void validate(GlobalValidationContext globalContext);
+ //Object convert(FileValidationContext
+ // fileValidationContext);
+
+ /*default boolean filter(FileValidationContext filecontext,
+ GlobalValidationContext globalValidationContext){
+ return true;
+ }*/
+}
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/types/FileValidationContext.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/types/FileValidationContext.java
new file mode 100644
index 0000000000..81e8931dab
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/types/FileValidationContext.java
@@ -0,0 +1,53 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.validation.types;
+
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+
+public class FileValidationContext {
+ private String fileName;
+ private MessageContainer messageContainer = new MessageContainer();
+ private byte[] content;
+
+ public FileValidationContext(String fileName, byte[] fileContent) {
+ this.fileName = fileName;
+ this.content = fileContent;
+ }
+
+
+ MessageContainer getMessageContainer() {
+ return this.messageContainer;
+ }
+
+ public InputStream getContent() {
+ return new ByteArrayInputStream(content);
+ }
+
+ public String getFileName() {
+ return this.fileName;
+ }
+
+ public boolean isEmpty() {
+ return content == null || content.length == 0;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/types/GlobalValidationContext.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/types/GlobalValidationContext.java
new file mode 100644
index 0000000000..e6917e84f6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/types/GlobalValidationContext.java
@@ -0,0 +1,142 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.validation.types;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.openecomp.core.utilities.CommonMethods;
+import org.openecomp.core.validation.interfaces.Validator;
+import org.openecomp.sdc.common.utils.AsdcCommon;
+import org.openecomp.sdc.datatypes.error.ErrorLevel;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.InputStream;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.function.BiPredicate;
+import java.util.stream.Collectors;
+
+public class GlobalValidationContext {
+
+ private static Logger logger = LoggerFactory.getLogger(Validator.class);
+ private Map<String, FileValidationContext> fileContextMap = new HashMap<>();
+ private Map<String, MessageContainer> messageContainerMap = new HashMap<>();
+
+ /**
+ * Add message.
+ *
+ * @param fileName the file name
+ * @param level the level
+ * @param message the message
+ */
+ public void addMessage(String fileName, ErrorLevel level, String message) {
+
+ printLog(fileName, message, level);
+
+ if (fileContextMap.containsKey(fileName)) {
+ fileContextMap.get(fileName).getMessageContainer().getMessageBuilder().setMessage(message)
+ .setLevel(level).create();
+ } else {
+ if (CommonMethods.isEmpty(fileName)) {
+ fileName = AsdcCommon.UPLOAD_FILE;
+ }
+ MessageContainer messageContainer;
+ synchronized (this) {
+ messageContainer = messageContainerMap.get(fileName);
+ if (messageContainer == null) {
+ messageContainer = new MessageContainer();
+ messageContainerMap.put(fileName, messageContainer);
+ }
+ }
+ messageContainer.getMessageBuilder().setMessage(message).setLevel(level).create();
+ }
+ }
+
+ /**
+ * Gets file content.
+ *
+ * @param fileName the file name
+ * @return the file content
+ */
+ public InputStream getFileContent(String fileName) {
+ FileValidationContext fileContext = fileContextMap.get(fileName);
+ if (fileContext == null || fileContext.isEmpty()) {
+ return null;
+ }
+ return fileContext.getContent();
+ }
+
+ public void addFileContext(String fileName, byte[] fileContent) {
+ fileContextMap.put(fileName, new FileValidationContext(fileName, fileContent));
+ }
+
+ /**
+ * Gets context message containers.
+ *
+ * @return the context message containers
+ */
+ public Map<String, MessageContainer> getContextMessageContainers() {
+
+ Map<String, MessageContainer> contextMessageContainer = new HashMap<>();
+ fileContextMap.entrySet().stream().filter(entry -> CollectionUtils
+ .isNotEmpty(entry.getValue().getMessageContainer().getErrorMessageList())).forEach(
+ entry -> contextMessageContainer.put(
+ entry.getKey(), entry.getValue().getMessageContainer()));
+ messageContainerMap.entrySet().stream()
+ .filter(entry -> CollectionUtils.isNotEmpty(entry.getValue().getErrorMessageList()))
+ .forEach(entry -> contextMessageContainer.put(entry.getKey(), entry.getValue()));
+ return contextMessageContainer;
+ }
+
+ public Map<String, FileValidationContext> getFileContextMap() {
+ return fileContextMap;
+ }
+
+ private void printLog(String fileName, String message, ErrorLevel level) {
+
+ String messageToPrint = message + " in file[" + fileName + "]";
+
+ switch (level) {
+ case ERROR:
+ logger.error(messageToPrint);
+ break;
+ case WARNING:
+ logger.warn(messageToPrint);
+ break;
+ case INFO:
+ logger.info(messageToPrint);
+ break;
+ default:
+ break;
+ }
+ }
+
+ public Collection<String> files(BiPredicate<String, GlobalValidationContext> func) {
+ return fileContextMap.keySet().stream().filter(t -> func.test(t, this))
+ .collect(Collectors.toList());
+ }
+
+ public Collection<String> getFiles() {
+ return this.getFileContextMap().keySet();
+ }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/types/MessageContainer.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/types/MessageContainer.java
new file mode 100644
index 0000000000..9d37bade67
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/types/MessageContainer.java
@@ -0,0 +1,82 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.validation.types;
+
+import org.openecomp.sdc.datatypes.error.ErrorLevel;
+import org.openecomp.sdc.datatypes.error.ErrorMessage;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.function.Predicate;
+
+public class MessageContainer {
+
+ private List<ErrorMessage> errorMessageList = new ArrayList<>();
+
+ public List<ErrorMessage> getErrorMessageList() {
+ return errorMessageList;
+ }
+
+ public MessageBuilder getMessageBuilder() {
+ return new MessageBuilder();
+ }
+
+ /**
+ * Gets error message list by level.
+ *
+ * @param level the level
+ * @return the error message list by level
+ */
+ public List<ErrorMessage> getErrorMessageListByLevel(ErrorLevel level) {
+
+ List<ErrorMessage> errors = new ArrayList<>();
+ errorMessageList.stream().filter(new Predicate<ErrorMessage>() {
+ @Override
+ public boolean test(ErrorMessage errorMessage) {
+ return errorMessage.getLevel().equals(level);
+ }
+ }).forEach(errorMessage -> errors.add(errorMessage));
+ return errors;
+ }
+
+ public class MessageBuilder {
+
+ String message;
+ ErrorLevel level;
+
+ MessageBuilder setMessage(String message) {
+ this.message = message;
+ return this;
+ }
+
+ MessageBuilder setLevel(ErrorLevel level) {
+ this.level = level;
+ return this;
+ }
+
+ void create() {
+ ErrorMessage errorMessage = new ErrorMessage(level, message);
+ if (!errorMessageList.contains(errorMessage)) {
+ errorMessageList.add(errorMessage);
+ }
+ }
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/types/MessageContainerUtil.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/types/MessageContainerUtil.java
new file mode 100644
index 0000000000..c678bb5014
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/types/MessageContainerUtil.java
@@ -0,0 +1,64 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.core.validation.types;
+
+import org.openecomp.sdc.datatypes.error.ErrorLevel;
+import org.openecomp.sdc.datatypes.error.ErrorMessage;
+
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class MessageContainerUtil {
+
+ /**
+ * Gets message by level.
+ *
+ * @param level the level
+ * @param messages the messages
+ * @return the message by level
+ */
+ public static Map<String,
+ List<ErrorMessage>> getMessageByLevel(
+ ErrorLevel level,Map<String,List<ErrorMessage>> messages) {
+ if (messages == null) {
+ return null;
+ }
+ Map<String, List<ErrorMessage>> filteredMessages = new HashMap<>();
+ messages.entrySet().stream().forEach(
+ entry -> entry.getValue().stream().filter(message -> message.getLevel().equals(level))
+ .forEach(message -> addMessage(entry.getKey(), message, filteredMessages
+ )));
+ return filteredMessages;
+ }
+
+ private static void addMessage(String fileName, ErrorMessage message,
+ Map<String, List<ErrorMessage>> messages) {
+ List<ErrorMessage> messageList = messages.get(fileName);
+ if (messageList == null) {
+ messageList = new ArrayList<>();
+ messages.put(fileName, messageList);
+ }
+ messageList.add(message);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/resources/factoryConfiguration.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/resources/factoryConfiguration.json
new file mode 100644
index 0000000000..42a5583bdf
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/resources/factoryConfiguration.json
@@ -0,0 +1,3 @@
+{
+ "org.openecomp.core.validation.factory.ValidationManagerFactory":"org.openecomp.sdc.validation.impl.ValidationManagerFactoryImpl"
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/resources/validationConfiguration.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/resources/validationConfiguration.json
new file mode 100644
index 0000000000..971f4274d9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/resources/validationConfiguration.json
@@ -0,0 +1,24 @@
+{
+ "validatorConfigurationList": [
+ {
+ "name": "yamlValidator",
+ "enableInd": true,
+ "implementationClass": "org.openecomp.sdc.validation.impl.validators.YamlValidator"
+ },
+ {
+ "name": "heatValidator",
+ "enableInd": true,
+ "implementationClass": "org.openecomp.sdc.validation.impl.validators.HeatValidator"
+ },
+ {
+ "name": "manifestValidator",
+ "enableInd": true,
+ "implementationClass": "org.openecomp.sdc.validation.impl.validators.ManifestValidator"
+ },
+ {
+ "name": "ecompGuideLineValidator",
+ "enableInd": true,
+ "implementationClass": "org.openecomp.sdc.validation.impl.validators.EcompGuideLineValidator"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/pom.xml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/pom.xml
new file mode 100644
index 0000000000..9a68e2e11e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/pom.xml
@@ -0,0 +1,93 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-lib</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../..</relativePath>
+ </parent>
+
+ <name>openecomp-sdc-validation-core</name>
+ <artifactId>openecomp-sdc-validation-core</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <version>2.3.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.yaml</groupId>
+ <artifactId>snakeyaml</artifactId>
+ <version>1.14</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.7.10</version>
+
+ </dependency>
+
+
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <version>1.1.2</version>
+
+ </dependency>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <scope>test</scope>
+ <version>6.8.5</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>snakeyaml</artifactId>
+ <groupId>org.yaml</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>RELEASE</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-utilities-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-validation-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-validation-impl</artifactId>
+ <version>${project.version}</version>
+ <!--scope>runtime</scope-->
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-datatypes-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <scope>test</scope>
+ <version>1.10.19</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <version>19.0</version>
+ </dependency>
+ </dependencies>
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/impl/ValidationManagerFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/impl/ValidationManagerFactoryImpl.java
new file mode 100644
index 0000000000..87d4dd8118
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/impl/ValidationManagerFactoryImpl.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.validation.impl;
+
+
+import org.openecomp.core.validation.api.ValidationManager;
+import org.openecomp.core.validation.factory.ValidationManagerFactory;
+
+
+public class ValidationManagerFactoryImpl extends ValidationManagerFactory {
+
+ @Override
+ public ValidationManager createInterface() {
+ return new ValidationManagerImpl();
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/impl/ValidationManagerImpl.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/impl/ValidationManagerImpl.java
new file mode 100644
index 0000000000..64c409b463
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/impl/ValidationManagerImpl.java
@@ -0,0 +1,69 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.validation.impl;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.openecomp.core.validation.api.ValidationManager;
+import org.openecomp.core.validation.interfaces.Validator;
+import org.openecomp.core.validation.types.GlobalValidationContext;
+import org.openecomp.core.validation.types.MessageContainer;
+import org.openecomp.sdc.datatypes.error.ErrorMessage;
+import org.openecomp.sdc.validation.utils.ValidationConfigurationManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class ValidationManagerImpl implements ValidationManager {
+
+ private static Logger logger = LoggerFactory.getLogger(ValidationManagerImpl.class);
+ private GlobalValidationContext globalContext;
+ private List<Validator> validators;
+
+ public ValidationManagerImpl() {
+ globalContext = new GlobalValidationContext();
+ validators = ValidationConfigurationManager.initValidators();
+ }
+
+ @Override
+ public void addFile(String fileName, byte[] fileContent) {
+ globalContext.addFileContext(fileName, fileContent);
+ }
+
+ @Override
+ public Map<String, List<ErrorMessage>> validate() {
+ for (Validator validator : validators) {
+ validator.validate(globalContext);
+ }
+ return convertMessageContainsToErrorMessage(globalContext.getContextMessageContainers());
+ }
+
+ private Map<String, List<ErrorMessage>> convertMessageContainsToErrorMessage(
+ Map<String, MessageContainer> contextMessageContainers) {
+ Map<String, List<ErrorMessage>> errors = new HashMap<>();
+ contextMessageContainers.entrySet().stream()
+ .filter(entry -> CollectionUtils.isNotEmpty(entry.getValue().getErrorMessageList()))
+ .forEach(entry -> errors.put(entry.getKey(), entry.getValue().getErrorMessageList()));
+ return errors;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/utils/ValidationConfiguration.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/utils/ValidationConfiguration.java
new file mode 100644
index 0000000000..1a74e1cc34
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/utils/ValidationConfiguration.java
@@ -0,0 +1,37 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.validation.utils;
+
+import java.util.Collections;
+import java.util.List;
+
+public class ValidationConfiguration {
+ private List<ValidatorConfiguration> validatorConfigurationList;
+
+ public List<ValidatorConfiguration> getValidatorConfigurationList() {
+ return Collections.unmodifiableList(validatorConfigurationList);
+ }
+
+ public void setValidatorConfigurationList(
+ List<ValidatorConfiguration> validatorConfigurationList) {
+ this.validatorConfigurationList = validatorConfigurationList;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/utils/ValidationConfigurationManager.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/utils/ValidationConfigurationManager.java
new file mode 100644
index 0000000000..cc921ce985
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/utils/ValidationConfigurationManager.java
@@ -0,0 +1,74 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.validation.utils;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.openecomp.core.utilities.CommonMethods;
+import org.openecomp.core.utilities.file.FileUtils;
+import org.openecomp.core.utilities.json.JsonUtil;
+import org.openecomp.core.validation.interfaces.Validator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+public class ValidationConfigurationManager {
+
+ private static final String VALIDATION_CONFIGURATION = "validationConfiguration.json";
+ private static final List<Validator> validators = new ArrayList<>();
+ private static Logger logger = LoggerFactory.getLogger(ValidationConfigurationManager.class);
+
+ /**
+ * Init validators list.
+ *
+ * @return the list
+ */
+ public static List<Validator> initValidators() {
+ synchronized (validators) {
+ if (CollectionUtils.isEmpty(validators)) {
+ InputStream validationConfigurationJson =
+ FileUtils.getFileInputStream(VALIDATION_CONFIGURATION);
+ ValidationConfiguration validationConfiguration =
+ JsonUtil.json2Object(validationConfigurationJson, ValidationConfiguration.class);
+ List<ValidatorConfiguration> conf = validationConfiguration.getValidatorConfigurationList();
+ conf.stream().filter(ValidatorConfiguration::isEnableInd).forEachOrdered(
+ validatorConfiguration -> validators.add(validatorInit(validatorConfiguration)));
+ }
+ }
+ return validators;
+ }
+
+ private static Validator validatorInit(ValidatorConfiguration validatorConf) {
+ Validator validator = null;
+ try {
+ validator =
+ CommonMethods.newInstance(validatorConf.getImplementationClass(), Validator.class);
+ } catch (IllegalArgumentException iae) {
+ logger.error("Validator:" + validatorConf.getName() + " Class:"
+ + validatorConf.getImplementationClass() + " failed in initialization. error:"
+ + iae.toString() + " trace:" + Arrays.toString(iae.getStackTrace()));
+ }
+ return validator;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/utils/ValidationManagerUtil.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/utils/ValidationManagerUtil.java
new file mode 100644
index 0000000000..960bdc2165
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/utils/ValidationManagerUtil.java
@@ -0,0 +1,65 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.validation.utils;
+
+import org.openecomp.core.utilities.file.FileContentHandler;
+import org.openecomp.core.utilities.file.FileUtils;
+import org.openecomp.core.validation.api.ValidationManager;
+import org.openecomp.core.validation.errors.Messages;
+import org.openecomp.core.validation.factory.ValidationManagerFactory;
+import org.openecomp.sdc.common.utils.AsdcCommon;
+import org.openecomp.sdc.datatypes.error.ErrorLevel;
+import org.openecomp.sdc.datatypes.error.ErrorMessage;
+
+import java.io.InputStream;
+import java.util.List;
+import java.util.Map;
+
+public class ValidationManagerUtil {
+
+ /**
+ * Handle missing manifest.
+ *
+ * @param fileContentMap the file content map
+ * @param errors the errors
+ */
+ public static void handleMissingManifest(FileContentHandler fileContentMap,
+ Map<String, List<ErrorMessage>> errors) {
+ InputStream manifest = fileContentMap.getFileContent(AsdcCommon.MANIFEST_NAME);
+ if (manifest == null) {
+ ErrorMessage.ErrorMessageUtil.addMessage(AsdcCommon.MANIFEST_NAME, errors)
+ .add(new ErrorMessage(ErrorLevel.ERROR, Messages.MANIFEST_NOT_EXIST.getErrorMessage()));
+ }
+ }
+
+ /**
+ * Init validation manager validation manager.
+ *
+ * @param fileContentMap the file content map
+ * @return the validation manager
+ */
+ public static ValidationManager initValidationManager(FileContentHandler fileContentMap) {
+ ValidationManager validationManager = ValidationManagerFactory.getInstance().createInterface();
+ fileContentMap.getFileList().stream().forEach(fileName -> validationManager
+ .addFile(fileName, FileUtils.toByteArray(fileContentMap.getFileContent(fileName))));
+ return validationManager;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/utils/ValidatorConfiguration.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/utils/ValidatorConfiguration.java
new file mode 100644
index 0000000000..12feb641ae
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/utils/ValidatorConfiguration.java
@@ -0,0 +1,51 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.validation.utils;
+
+public class ValidatorConfiguration {
+ private String name;
+ private boolean enableInd = true;
+ private String implementationClass;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public boolean isEnableInd() {
+ return enableInd;
+ }
+
+ public void setEnableInd(boolean enableInd) {
+ this.enableInd = enableInd;
+ }
+
+ public String getImplementationClass() {
+ return implementationClass;
+ }
+
+ public void setImplementationClass(String implementationClass) {
+ this.implementationClass = implementationClass;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/java/org/openecomp/sdc/heat/services/tree/HeatTreeManagerTest.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/java/org/openecomp/sdc/heat/services/tree/HeatTreeManagerTest.java
new file mode 100644
index 0000000000..6a9f8df12d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/java/org/openecomp/sdc/heat/services/tree/HeatTreeManagerTest.java
@@ -0,0 +1,51 @@
+package org.openecomp.sdc.heat.services.tree;
+
+import org.openecomp.sdc.heat.datatypes.structure.HeatStructureTree;
+import org.openecomp.core.utilities.file.FileContentHandler;
+import org.openecomp.core.utilities.file.FileUtils;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.net.URL;
+
+public class HeatTreeManagerTest {
+
+ @Test
+ public void testHeatTreeCreation() {
+
+ FileContentHandler fileContentMap = new FileContentHandler();
+ URL url = this.getClass().getResource("/heatTreeValidationOutput");
+
+ File templateDir = new File(url.getFile());
+ File[] files = templateDir.listFiles();
+
+ if (files == null || files.length == 0) {
+ return;
+ }
+
+ for (File file : files) {
+ fileContentMap.addFile(file.getName(), getFileContent(file));
+ }
+
+ HeatTreeManager heatTreeManager = HeatTreeManagerUtil.initHeatTreeManager(fileContentMap);
+ heatTreeManager.createTree();
+ HeatStructureTree tree = heatTreeManager.getTree();
+ Assert.assertNotNull(tree);
+ Assert.assertEquals(tree.getHEAT().size(), 2);
+ }
+
+ private byte[] getFileContent(File file) {
+ try {
+ return FileUtils.toByteArray(new FileInputStream(file));
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ return new byte[0];
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/MANIFEST.json
new file mode 100644
index 0000000000..f1553f5c74
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/MANIFEST.json
@@ -0,0 +1,35 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "hot-nimbus-psm_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-psm_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "hot-nimbus-psm_volume.yaml",
+ "type": "HEAT_VOL"
+ },
+ {
+ "file": "nested-pps_v1.0.yaml",
+ "type": "HEAT"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/hot-nimbus-pps_v1.0.env
new file mode 100644
index 0000000000..809835d2b8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/hot-nimbus-pps_v1.0.env
@@ -0,0 +1,12 @@
+parameters:
+ pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006
+ pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_pps_flavor_name: lc.3xlarge
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+ mock_param: abskdjska
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/hot-nimbus-pps_v1.0.yaml
new file mode 100644
index 0000000000..d3318ee0ca
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/hot-nimbus-pps_v1.0.yaml
@@ -0,0 +1,94 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_names:
+ type: comma_delimited_list
+ label: PCRF PS server names
+ description: PCRF PS server names
+ pcrf_pps_image_name:
+ type: string
+ default: True
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+ availability_zone_1:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+
+resources:
+ server_pcrf_pps_001:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+
+ availability_zone_legal_name_1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [pcrf_pps_server_names, 0] }
+ availability_zone: {get_param: availability_zone_1}
+ metadata:
+ vnf_id: { get_param: pcrf_vnf_id }
+ vf_module_id: { get_param: pcrf_vnf_module_id }
+
+ availability_zone_illegal_name_1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [pcrf_pps_server_names, 0] }
+ availability_zone: {get_param: availability_zone_name}
+ metadata:
+ vnf_id: { get_param: pcrf_vnf_id }
+ vf_module_id: { get_param: pcrf_vnf_module_id }
+
+ availability_zone_illegal_name_2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [pcrf_pps_server_names, 0] }
+ availability_zone: {get_param: availability_zone}
+ metadata:
+ vnf_id: { get_param: pcrf_vnf_id }
+ vf_module_id: { get_param: pcrf_vnf_module_id }
+
+ SecurityGroup_expose:
+ type: OS::Neutron::SecurityGroup
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/hot-nimbus-psm_v1.0.env
new file mode 100644
index 0000000000..809835d2b8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/hot-nimbus-psm_v1.0.env
@@ -0,0 +1,12 @@
+parameters:
+ pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006
+ pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_pps_flavor_name: lc.3xlarge
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+ mock_param: abskdjska
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/hot-nimbus-psm_v1.0.yaml
new file mode 100644
index 0000000000..072a8ba934
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/hot-nimbus-psm_v1.0.yaml
@@ -0,0 +1,109 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_names:
+ type: comma_delimited_list
+ label: PCRF PS server names
+ description: PCRF PS server names
+ pcrf_pps_image_name:
+ type: string
+ default: True
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+ availability_zone_1:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+ pcrf_images:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+ pcrf_network_v0_ips:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+ network_net_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+
+resources:
+ server_pcrf_pps_001:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+
+ resource_illegal_image:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [pcrf_pps_server_names, 0] }
+ image: {get_param: pcrf_images}
+ flavor: {get_param: pcrf_flavor_11}
+ metadata:
+ vnf_id: { get_param: pcrf_vnf_id }
+ vf_module_id: { get_param: pcrf_vnf_module_id }
+
+ resource_illegal_network_1:
+ type: OS::Neutron::Port
+ properties:
+ name: { get_param: [pcrf_pps_server_names, 0] }
+ network: {get_param: network_net_id}
+
+ resource_illegal_network_2:
+ type: OS::Neutron::Port
+ properties:
+ name: { get_param: [pcrf_pps_server_names, 0] }
+ network: {get_param: network_net_id}
+ fixed_ips:
+ - ip_address: {get_param: pcrf_network_v0_ips}
+
+ availability_zone_illegal_name_2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [pcrf_pps_server_names, 0] }
+ availability_zone: {get_param: availability_zone}
+ metadata:
+ vnf_id: { get_param: pcrf_vnf_id }
+ vf_module_id: { get_param: pcrf_vnf_module_id }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/hot-nimbus-psm_volume.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/hot-nimbus-psm_volume.yaml
new file mode 100644
index 0000000000..288607cf55
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/hot-nimbus-psm_volume.yaml
@@ -0,0 +1,21 @@
+
+heat_template_version: 2013-05-23
+
+parameters:
+ not_null:
+ type: number
+ label: not_number
+
+
+resources:
+ volume_not_expose:
+ type: OS::Cinder::Volume
+ properties:
+ not_null: {get_param: not_null}
+
+
+outputs:
+ not_expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: volume_expose }
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/nested-pps_v1.0.yaml
new file mode 100644
index 0000000000..cb23fb8e8c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/nested-pps_v1.0.yaml
@@ -0,0 +1,98 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_name:
+ type: string
+ default: True
+ label: PCRF PS server name
+ description: PCRF PS server name
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availability_zone_0:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ params:
+ $vm_name: { get_param: pcrf_pps_server_name }
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_pps:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_pps_server_name }
+ image: { get_param: pcrf_pps_image_name }
+ flavor: { get_param: pcrf_pps_flavor_name }
+ availability_zone: { get_param: availability_zone_0 }
+ networks:
+ - port: { get_resource: pcrf_pps_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+
+ pcrf_pps_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/pom.xml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/pom.xml
new file mode 100644
index 0000000000..bacd79a97a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/pom.xml
@@ -0,0 +1,100 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-lib</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../..</relativePath>
+ </parent>
+
+ <name>openecomp-sdc-validation-impl</name>
+ <artifactId>openecomp-sdc-validation-impl</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.yaml</groupId>
+ <artifactId>snakeyaml</artifactId>
+ <version>1.17</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <version>2.3.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.7.10</version>
+
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <version>1.1.2</version>
+
+ </dependency>
+
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <scope>test</scope>
+ <version>6.8.5</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>snakeyaml</artifactId>
+ <groupId>org.yaml</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>RELEASE</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-utilities-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-validation-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-common-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <scope>test</scope>
+ <version>1.10.19</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <version>19.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-heat-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.yaml</groupId>
+ <artifactId>snakeyaml</artifactId>
+ </dependency>
+
+
+ </dependencies>
+
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/util/HeatValidationService.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/util/HeatValidationService.java
new file mode 100644
index 0000000000..920724ed3b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/util/HeatValidationService.java
@@ -0,0 +1,323 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.validation.impl.util;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.MapUtils;
+import org.openecomp.core.utilities.yaml.YamlUtil;
+import org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder;
+import org.openecomp.core.validation.errors.Messages;
+import org.openecomp.core.validation.types.GlobalValidationContext;
+import org.openecomp.sdc.datatypes.error.ErrorLevel;
+import org.openecomp.sdc.heat.datatypes.model.Environment;
+import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate;
+import org.openecomp.sdc.heat.datatypes.model.Output;
+import org.openecomp.sdc.heat.datatypes.model.Resource;
+import org.openecomp.sdc.heat.datatypes.model.ResourceReferenceFunctions;
+import org.openecomp.sdc.heat.services.HeatStructureUtil;
+import org.openecomp.sdc.validation.impl.validators.HeatValidator;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+
+public class HeatValidationService {
+
+ private static final Logger logger = LoggerFactory.getLogger(HeatValidator.class);
+
+ /**
+ * Check artifacts existence.
+ *
+ * @param fileName the file name
+ * @param artifactsNames the artifacts names
+ * @param globalContext the global context
+ */
+ public static void checkArtifactsExistence(String fileName, Set<String> artifactsNames,
+ GlobalValidationContext globalContext) {
+ artifactsNames
+ .stream()
+ .filter(artifactName -> !globalContext.getFileContextMap().containsKey(artifactName))
+ .forEach(artifactName -> {
+ globalContext
+ .addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.MISSING_ARTIFACT.getErrorMessage(),
+ artifactName));
+ });
+ }
+
+
+ /**
+ * Check resource existence from resources map.
+ *
+ * @param fileName the file name
+ * @param resourcesNames the resources names
+ * @param valuesToSearchIn the values to search in
+ * @param globalContext the global context
+ */
+ public static void checkResourceExistenceFromResourcesMap(String fileName,
+ Set<String> resourcesNames,
+ Collection<?> valuesToSearchIn,
+ GlobalValidationContext globalContext) {
+ if (CollectionUtils.isNotEmpty(valuesToSearchIn)) {
+ for (Object value : valuesToSearchIn) {
+ if (value instanceof Resource) {
+ Resource resource = (Resource) value;
+ //checkResourceDependsOn(fileName,resource,resourcesNames,globalContext);
+
+ Collection<Object> resourcePropertiesValues =
+ resource.getProperties() == null ? null : resource.getProperties().values();
+ if (CollectionUtils.isNotEmpty(resourcePropertiesValues)) {
+ for (Object propertyValue : resourcePropertiesValues) {
+ handleReferencedResources(fileName, propertyValue, resourcesNames, globalContext);
+ }
+ }
+ } else if (value instanceof Output) {
+ Output output = (Output) value;
+ Object outputsValue = output.getValue();
+ handleReferencedResources(fileName, outputsValue, resourcesNames, globalContext);
+ }
+ }
+ }
+ }
+
+
+ private static void handleReferencedResources(String fileName, Object valueToSearchReferencesIn,
+ Set<String> resourcesNames,
+ GlobalValidationContext globalContext) {
+ Set<String> referencedResourcesNames = HeatStructureUtil
+ .getReferencedValuesByFunctionName(fileName,
+ ResourceReferenceFunctions.GET_RESOURCE.getFunction(), valueToSearchReferencesIn,
+ globalContext);
+ if (CollectionUtils.isNotEmpty(referencedResourcesNames)) {
+ HeatValidationService
+ .checkIfResourceReferenceExist(fileName, resourcesNames, referencedResourcesNames,
+ globalContext);
+ }
+ }
+
+
+ private static void checkIfResourceReferenceExist(String fileName,
+ Set<String> referencedResourcesNames,
+ Set<String> referencedResources,
+ GlobalValidationContext globalContext) {
+ referencedResources.stream()
+ .filter(referencedResource -> !referencedResourcesNames.contains(referencedResource))
+ .forEach(referencedResource -> {
+ globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.REFERENCED_RESOURCE_NOT_FOUND.getErrorMessage(),
+ referencedResource));
+ });
+ }
+
+ /**
+ * Draw files loop string.
+ *
+ * @param filesInPath the files in path
+ * @return the string
+ */
+ public static String drawFilesLoop(List<String> filesInPath) {
+ StringBuilder stringBuilder = new StringBuilder();
+ stringBuilder.append("[");
+ int pathSize = filesInPath.size();
+
+ for (int i = 0; i < pathSize; i++) {
+ stringBuilder.append(filesInPath.get(i));
+ if (i != pathSize - 1) {
+ stringBuilder.append(" -- ");
+ }
+ }
+ if (!filesInPath.get(0).equals(filesInPath.get(pathSize - 1))) {
+ stringBuilder.append(" -- ");
+ stringBuilder.append(filesInPath.get(0));
+ }
+ stringBuilder.append("]");
+
+ return stringBuilder.toString();
+ }
+
+
+ /**
+ * Check nested parameters.
+ *
+ * @param callingNestedFileName the calling nested file name
+ * @param nestedFileName the nested file name
+ * @param resourceName the resource name
+ * @param globalContext the global context
+ * @param resourceFileProperties the resource file properties
+ */
+ public static void checkNestedParameters(String callingNestedFileName, String nestedFileName,
+ String resourceName,
+ GlobalValidationContext globalContext,
+ Set<String> resourceFileProperties) {
+ HeatOrchestrationTemplate heatOrchestrationTemplate;
+ try {
+ heatOrchestrationTemplate = new YamlUtil()
+ .yamlToObject(globalContext.getFileContent(nestedFileName),
+ HeatOrchestrationTemplate.class);
+ } catch (Exception e0) {
+ return;
+ }
+ Set<String> nestedParametersNames = heatOrchestrationTemplate.getParameters() == null ? null
+ : heatOrchestrationTemplate.getParameters().keySet();
+
+ if (CollectionUtils.isNotEmpty(nestedParametersNames)) {
+ resourceFileProperties
+ .stream()
+ .filter(propertyName -> !nestedParametersNames.contains(propertyName))
+ .forEach(propertyName -> globalContext
+ .addMessage(callingNestedFileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.MISSING_PARAMETER_IN_NESTED.getErrorMessage(),
+ nestedFileName, resourceName, propertyName)));
+ }
+ }
+
+
+ /**
+ * Is nested loop exist in file boolean.
+ *
+ * @param callingFileName the calling file name
+ * @param nestedFileName the nested file name
+ * @param filesInLoop the files in loop
+ * @param globalContext the global context
+ * @return the boolean
+ */
+ public static boolean isNestedLoopExistInFile(String callingFileName, String nestedFileName,
+ List<String> filesInLoop,
+ GlobalValidationContext globalContext) {
+ HeatOrchestrationTemplate nestedHeatOrchestrationTemplate;
+ try {
+ nestedHeatOrchestrationTemplate = new YamlUtil()
+ .yamlToObject(globalContext.getFileContent(nestedFileName),
+ HeatOrchestrationTemplate.class);
+ } catch (Exception e0) {
+ logger.warn("HEAT Validator will not be executed on file " + nestedFileName
+ + " due to illegal HEAT format");
+ return false;
+ }
+ filesInLoop.add(nestedFileName);
+ Collection<Resource> nestedResources =
+ nestedHeatOrchestrationTemplate.getResources() == null ? null
+ : nestedHeatOrchestrationTemplate.getResources().values();
+ if (CollectionUtils.isNotEmpty(nestedResources)) {
+ for (Resource resource : nestedResources) {
+ String resourceType = resource.getType();
+
+ if (Objects.nonNull(resourceType) && isNestedResource(resourceType)) {
+ return resourceType.equals(callingFileName) || !filesInLoop.contains(resourceType)
+ && isNestedLoopExistInFile(callingFileName, resourceType, filesInLoop, globalContext);
+ }
+ }
+ }
+ return false;
+ }
+
+
+ /**
+ * Loop over output map and validate get attr from nested.
+ *
+ * @param fileName the file name
+ * @param outputMap the output map
+ * @param heatOrchestrationTemplate the heat orchestration template
+ * @param globalContext the global context
+ */
+ @SuppressWarnings("unchecked")
+ public static void loopOverOutputMapAndValidateGetAttrFromNested(String fileName,
+ Map<String, Output> outputMap,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ GlobalValidationContext globalContext) {
+ for (Output output : outputMap.values()) {
+ Object outputValue = output.getValue();
+ if (outputValue != null && outputValue instanceof Map) {
+ Map<String, Object> outputValueMap = (Map<String, Object>) outputValue;
+ List<String> getAttrValue =
+ (List<String>) outputValueMap.get(ResourceReferenceFunctions.GET_ATTR.getFunction());
+ if (!CollectionUtils.isEmpty(getAttrValue)) {
+ String resourceName = getAttrValue.get(0);
+ String propertyName = getAttrValue.get(1);
+ String resourceType =
+ getResourceTypeFromResourcesMap(resourceName, heatOrchestrationTemplate);
+
+ if (Objects.nonNull(resourceType)
+ && HeatValidationService.isNestedResource(resourceType)) {
+ Map<String, Output> nestedOutputMap;
+ HeatOrchestrationTemplate nestedHeatOrchestrationTemplate;
+ try {
+ nestedHeatOrchestrationTemplate = new YamlUtil()
+ .yamlToObject(globalContext.getFileContent(resourceType),
+ HeatOrchestrationTemplate.class);
+ } catch (Exception e0) {
+ return;
+ }
+ nestedOutputMap = nestedHeatOrchestrationTemplate.getOutputs();
+
+ if (MapUtils.isEmpty(nestedOutputMap) || !nestedOutputMap.containsKey(propertyName)) {
+ globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.GET_ATTR_NOT_FOUND.getErrorMessage(),
+ propertyName, resourceName));
+ }
+ }
+ }
+ }
+ }
+ }
+
+
+ public static boolean isNestedResource(String resourceType) {
+ return resourceType.contains(".yaml") || resourceType.contains(".yml");
+ }
+
+
+ private static String getResourceTypeFromResourcesMap(String resourceName,
+ HeatOrchestrationTemplate heatOrchestrationTemplate) {
+ return heatOrchestrationTemplate.getResources().get(resourceName).getType();
+ }
+
+ /**
+ * Validate env content environment.
+ *
+ * @param fileName the file name
+ * @param envFileName the env file name
+ * @param globalContext the global context
+ * @return the environment
+ */
+ public static Environment validateEnvContent(String fileName, String envFileName,
+ GlobalValidationContext globalContext) {
+ Environment envContent = null;
+ try {
+ envContent =
+ new YamlUtil().yamlToObject(globalContext.getFileContent(envFileName), Environment.class);
+ } catch (Exception e0) {
+ return null;
+ }
+ return envContent;
+ }
+
+
+ public static String getResourceGroupResourceName(String resourceCallingToResourceGroup) {
+ return "OS::Heat::ResourceGroup in " + resourceCallingToResourceGroup;
+ }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/util/ResourceValidationHeatValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/util/ResourceValidationHeatValidator.java
new file mode 100644
index 0000000000..3457bed1e9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/util/ResourceValidationHeatValidator.java
@@ -0,0 +1,617 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.validation.impl.util;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.MapUtils;
+import org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder;
+import org.openecomp.core.validation.errors.Messages;
+import org.openecomp.core.validation.types.GlobalValidationContext;
+import org.openecomp.sdc.datatypes.error.ErrorLevel;
+import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate;
+import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes;
+import org.openecomp.sdc.heat.datatypes.model.Output;
+import org.openecomp.sdc.heat.datatypes.model.PolicyTypes;
+import org.openecomp.sdc.heat.datatypes.model.PropertiesMapKeyTypes;
+import org.openecomp.sdc.heat.datatypes.model.Resource;
+import org.openecomp.sdc.heat.datatypes.model.ResourceReferenceFunctions;
+import org.openecomp.sdc.heat.datatypes.model.ResourceTypeToMessageString;
+import org.openecomp.sdc.heat.services.HeatStructureUtil;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+
+
+public class ResourceValidationHeatValidator {
+
+ /**
+ * Validate resource type.
+ *
+ * @param fileName the file name
+ * @param baseFileName the base file name
+ * @param securityGroupsNamesFromBaseFileOutputs the security groups names from base file outputs
+ * @param heatOrchestrationTemplate the heat orchestration template
+ * @param globalContext the global context
+ */
+ public static void validateResourceType(String fileName, String baseFileName,
+ Set<String> securityGroupsNamesFromBaseFileOutputs,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ GlobalValidationContext globalContext) {
+ Map<String, Resource> resourceMap =
+ heatOrchestrationTemplate.getResources() == null ? new HashMap<>()
+ : heatOrchestrationTemplate.getResources();
+ Map<String, Integer> numberOfVisitsInPort = new HashMap<>();
+ Set<String> resourcesNames = resourceMap.keySet();
+ Set<String> sharedResourcesFromOutputMap =
+ getSharedResourcesNamesFromOutputs(fileName, heatOrchestrationTemplate.getOutputs(),
+ globalContext);
+ boolean isBaseFile = baseFileName != null && fileName.equals(baseFileName);
+
+ Map<HeatResourcesTypes, List<String>> resourceTypeToNamesListMap = HeatResourcesTypes
+ .getListForResourceType(HeatResourcesTypes.NOVA_SERVER_GROUP_RESOURCE_TYPE,
+ HeatResourcesTypes.NEUTRON_SECURITY_GROUP_RESOURCE_TYPE,
+ HeatResourcesTypes.CONTRAIL_NETWORK_RULE_RESOURCE_TYPE);
+
+ initResourceTypeListWithItsResourcesNames(fileName, resourceTypeToNamesListMap, resourceMap,
+ sharedResourcesFromOutputMap, globalContext);
+ initVisitedPortsMap(fileName, resourceMap, numberOfVisitsInPort, globalContext);
+
+
+ for (Map.Entry<String, Resource> resourceEntry : resourceMap.entrySet()) {
+ String resourceType = resourceEntry.getValue().getType();
+ validateSecurityGroupsFromBaseOutput(fileName, resourceEntry, isBaseFile,
+ securityGroupsNamesFromBaseFileOutputs, globalContext);
+ checkResourceDependsOn(fileName, resourceEntry.getValue(), resourcesNames, globalContext);
+
+ if (Objects.isNull(resourceType)) {
+ globalContext.addMessage(fileName, ErrorLevel.WARNING, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.INVALID_RESOURCE_TYPE.getErrorMessage(), "null",
+ resourceEntry.getKey()));
+ } else {
+ HeatResourcesTypes heatResourceType = HeatResourcesTypes.findByHeatResource(resourceType);
+
+ if (heatResourceType != null) {
+ switch (heatResourceType) {
+ case NOVA_SERVER_RESOURCE_TYPE:
+ validateNovaServerResourceType(fileName, resourceEntry, numberOfVisitsInPort,
+ resourceTypeToNamesListMap
+ .get(HeatResourcesTypes.NOVA_SERVER_GROUP_RESOURCE_TYPE),
+ heatOrchestrationTemplate, globalContext);
+ break;
+
+ case NOVA_SERVER_GROUP_RESOURCE_TYPE:
+ validateNovaServerGroupPolicy(fileName, resourceEntry, globalContext);
+ break;
+
+ case RESOURCE_GROUP_RESOURCE_TYPE:
+ validateResourceGroupType(fileName, resourceEntry, globalContext);
+ break;
+
+ case NEUTRON_PORT_RESOURCE_TYPE:
+ validateNeutronPortType(fileName, resourceEntry, resourceTypeToNamesListMap
+ .get(HeatResourcesTypes.NEUTRON_SECURITY_GROUP_RESOURCE_TYPE), globalContext);
+ break;
+
+ case CONTRAIL_NETWORK_ATTACH_RULE_RESOURCE_TYPE:
+ validateContrailAttachPolicyType(resourceEntry, resourceTypeToNamesListMap
+ .get(HeatResourcesTypes.CONTRAIL_NETWORK_RULE_RESOURCE_TYPE));
+ break;
+ default:
+ }
+ } else {
+ if (HeatValidationService.isNestedResource(resourceType)) {
+ handleNestedResourceType(fileName, resourceEntry.getKey(), resourceEntry.getValue(),
+ globalContext);
+ }
+ }
+ }
+ }
+
+ checkForEmptyResourceNamesInMap(fileName,
+ CollectionUtils.isEmpty(securityGroupsNamesFromBaseFileOutputs), resourceTypeToNamesListMap,
+ globalContext);
+ handleOrphanPorts(fileName, numberOfVisitsInPort, globalContext);
+ }
+
+
+ private static void validateNovaServerResourceType(String fileName,
+ Map.Entry<String, Resource> resourceEntry,
+ Map<String, Integer> numberOfVisitsInPort,
+ List<String> serverGroupResourcesNames,
+ HeatOrchestrationTemplate
+ heatOrchestrationTemplate,
+ GlobalValidationContext globalContext) {
+ validateAssignedValueForImageOrFlavorFromNova(fileName, resourceEntry, globalContext);
+ validateNovaServerPortBinding(fileName, resourceEntry.getValue(), numberOfVisitsInPort,
+ globalContext);
+ validateAllServerGroupsPointedByServerExistAndDefined(fileName, resourceEntry,
+ serverGroupResourcesNames, heatOrchestrationTemplate, globalContext);
+
+ }
+
+
+ private static void handleNestedResourceType(String fileName, String resourceName,
+ Resource resource,
+ GlobalValidationContext globalContext) {
+ validateAllPropertiesMatchNestedParameters(fileName, resourceName, resource, globalContext);
+ validateLoopsOfNestingFromFile(fileName, resource.getType(), globalContext);
+ }
+
+
+ private static void validateResourceGroupType(String fileName,
+ Map.Entry<String, Resource> resourceEntry,
+ GlobalValidationContext globalContext) {
+ Resource resourceDef = HeatStructureUtil
+ .getResourceDef(fileName, resourceEntry.getKey(), resourceEntry.getValue(), globalContext);
+ // validateResourceGroupTypeIsSupported(fileName, resourceEntry.getKey(),resourceDef.getType(),
+ // globalContext);
+ if (resourceDef != null) {
+ if (Objects.nonNull(resourceDef.getType())
+ && HeatValidationService.isNestedResource(resourceDef.getType())) {
+ handleNestedResourceType(fileName, resourceDef.getType(), resourceDef, globalContext);
+ }
+ }
+ }
+
+
+ private static void validateAllPropertiesMatchNestedParameters(String fileName,
+ String resourceName,
+ Resource resource,
+ GlobalValidationContext
+ globalContext) {
+
+ String resourceType = resource.getType();
+ if (globalContext.getFileContextMap().containsKey(resourceType)) {
+ Set<String> propertiesNames =
+ resource.getProperties() == null ? null : resource.getProperties().keySet();
+ if (CollectionUtils.isNotEmpty(propertiesNames)) {
+ HeatValidationService
+ .checkNestedParameters(fileName, resourceType, resourceName, globalContext,
+ propertiesNames);
+ }
+ } else {
+ globalContext.addMessage(resourceType, ErrorLevel.ERROR, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.MISSING_NESTED_FILE.getErrorMessage(), resourceType));
+ }
+ }
+
+
+ private static void validateAssignedValueForImageOrFlavorFromNova(String fileName,
+ Map.Entry<String, Resource>
+ resourceEntry,
+ GlobalValidationContext
+ globalContext) {
+
+ Resource resource = resourceEntry.getValue();
+ Map<String, Object> propertiesMap = resource.getProperties();
+ if (propertiesMap.get(PropertiesMapKeyTypes.IMAGE.getKeyMap()) == null
+ && propertiesMap.get(PropertiesMapKeyTypes.FLAVOR.getKeyMap()) == null) {
+ globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.MISSING_IMAGE_AND_FLAVOR.getErrorMessage(),
+ resourceEntry.getKey()));
+ }
+ }
+
+
+ private static void validateLoopsOfNestingFromFile(String fileName, String resourceType,
+ GlobalValidationContext globalContext) {
+ List<String> filesInLoop = new ArrayList<>(Collections.singletonList(fileName));
+ if (HeatValidationService
+ .isNestedLoopExistInFile(fileName, resourceType, filesInLoop, globalContext)) {
+ globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.NESTED_LOOP.getErrorMessage(),
+ HeatValidationService.drawFilesLoop(filesInLoop)));
+ }
+ }
+
+
+ /* validation 22*/
+ @SuppressWarnings("unchecked")
+ private static void validateNovaServerPortBinding(String fileName, Resource resource,
+ Map<String, Integer> numberOfVisitsInPort,
+ GlobalValidationContext globalContext) {
+
+ Map<String, Object> propertiesMap = resource.getProperties();
+ List<Object> networksList =
+ (List<Object>) propertiesMap.get(PropertiesMapKeyTypes.NETWORKS.getKeyMap());
+
+ if (CollectionUtils.isNotEmpty(networksList)) {
+ networksList
+ .stream()
+ .filter(networkObject -> networkObject instanceof Map)
+ .forEach(networkObject -> {
+ Map<String, Object> portValueMap =
+ (Map<String, Object>) ((Map) networkObject).get("port");
+ if (MapUtils.isNotEmpty(portValueMap)) {
+ checkPortBindingFromMap(fileName, portValueMap, numberOfVisitsInPort, globalContext);
+ }
+ });
+ }
+ }
+
+ /* validation 23*/
+ @SuppressWarnings("unchecked")
+ private static void validateAllServerGroupsPointedByServerExistAndDefined(String fileName,
+ Map.Entry<String, Resource> resourceEntry,
+ List<String> serverGroupNamesList,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ GlobalValidationContext globalContext) {
+ Map<String, Resource> resourcesMap = heatOrchestrationTemplate.getResources();
+
+ Map<String, Object> resourceProperties = resourceEntry.getValue().getProperties();
+ Map<String, Object> schedulerHintsMap = resourceProperties == null ? null
+ : (Map<String, Object>) resourceProperties
+ .get(ResourceReferenceFunctions.SCHEDULER_HINTS.getFunction());
+
+ if (MapUtils.isNotEmpty(schedulerHintsMap)) {
+ for (Object serverGroupMap : schedulerHintsMap.values()) {
+ Map<String, Object> currentServerMap = (Map<String, Object>) serverGroupMap;
+ String serverResourceName = currentServerMap == null ? null
+ : (String) currentServerMap.get(ResourceReferenceFunctions.GET_RESOURCE.getFunction());
+ Resource serverResource = serverResourceName == null || resourcesMap == null ? null
+ : resourcesMap.get(serverResourceName);
+ if (serverResource != null && !serverResource.getType()
+ .equals(HeatResourcesTypes.NOVA_SERVER_GROUP_RESOURCE_TYPE.getHeatResource())) {
+ globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.SERVER_NOT_DEFINED_FROM_NOVA.getErrorMessage(),
+ serverResourceName, resourceEntry.getKey()));
+ } else {
+ serverGroupNamesList.remove(serverResourceName);
+ }
+ }
+ }
+ }
+
+
+ /* validation 24*/
+ @SuppressWarnings("unchecked")
+ private static void validateNovaServerGroupPolicy(String fileName,
+ Map.Entry<String, Resource> resourceEntry,
+ GlobalValidationContext globalContext) {
+
+ Resource resource = resourceEntry.getValue();
+ List<String> policiesList = resource.getProperties() == null ? null
+ : (List<String>) resource.getProperties().get("policies");
+
+ if (CollectionUtils.isNotEmpty(policiesList)) {
+ if (policiesList.size() == 1) {
+ String policy = policiesList.get(0);
+ if (!PolicyTypes.isGivenPolicyValid(policy)) {
+ globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.WRONG_POLICY_IN_SERVER_GROUP.getErrorMessage(),
+ resourceEntry.getKey()));
+ }
+ } else {
+ globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.WRONG_POLICY_IN_SERVER_GROUP.getErrorMessage(),
+ resourceEntry.getKey()));
+ }
+ }
+ }
+
+
+ private static void validateNeutronPortType(String filename,
+ Map.Entry<String, Resource> resourceEntry,
+ List<String> securityGroupResourceNameList,
+ GlobalValidationContext globalContext) {
+ validateAllSecurityGroupsAreUsed(filename, resourceEntry, securityGroupResourceNameList,
+ globalContext);
+
+ }
+
+
+ @SuppressWarnings("unchecked")
+ private static void validateAllSecurityGroupsAreUsed(String filename,
+ Map.Entry<String, Resource> resourceEntry,
+ List<String> securityGroupResourceNameList,
+ GlobalValidationContext globalContext) {
+ Map<String, Object> propertiesMap = resourceEntry.getValue().getProperties();
+
+ if (MapUtils.isEmpty(propertiesMap)) {
+ return;
+ }
+
+ Object securityGroupsValue = propertiesMap.get("security_groups");
+
+ if (Objects.isNull(securityGroupsValue)) {
+ return;
+ }
+
+ if (securityGroupsValue instanceof List) {
+ List<Object> securityGroupsListFromCurrResource =
+ (List<Object>) propertiesMap.get("security_groups");
+ for (Object securityGroup : securityGroupsListFromCurrResource) {
+ removeSecurityGroupNamesFromListByGivenFunction(filename,
+ ResourceReferenceFunctions.GET_RESOURCE.getFunction(), securityGroup,
+ securityGroupResourceNameList, globalContext);
+ }
+ }
+ }
+
+
+ private static void validateSecurityGroupsFromBaseOutput(String filename,
+ Map.Entry<String, Resource> resourceEntry,
+ boolean isBaseFile,
+ Set<String> securityGroupNamesFromBaseOutput,
+ GlobalValidationContext globalContext) {
+ if (!isBaseFile && CollectionUtils.isNotEmpty(securityGroupNamesFromBaseOutput)) {
+ Map<String, Object> propertiesMap = resourceEntry.getValue().getProperties();
+
+ if (MapUtils.isEmpty(propertiesMap)) {
+ return;
+ }
+
+ for (Map.Entry<String, Object> propertyEntry : propertiesMap.entrySet()) {
+ removeSecurityGroupNamesFromListByGivenFunction(filename,
+ ResourceReferenceFunctions.GET_PARAM.getFunction(), propertyEntry.getValue(),
+ securityGroupNamesFromBaseOutput, globalContext);
+ }
+ }
+ }
+
+
+ private static void removeSecurityGroupNamesFromListByGivenFunction(String filename,
+ String functionName,
+ Object securityGroup,
+ Collection<String> securityGroupResourceNameList,
+ GlobalValidationContext globalContext) {
+ Set<String> securityGroupsNamesFromFunction = HeatStructureUtil
+ .getReferencedValuesByFunctionName(filename, functionName, securityGroup, globalContext);
+ securityGroupsNamesFromFunction.forEach(securityGroupResourceNameList::remove);
+ }
+
+
+ @SuppressWarnings("unchecked")
+ private static void validateContrailAttachPolicyType(Map.Entry<String, Resource> resourceEntry,
+ List<String> networkPolicyResourceNames) {
+ Map<String, Object> propertiesMap = resourceEntry.getValue().getProperties();
+
+ if (MapUtils.isNotEmpty(propertiesMap)) {
+ Map<String, Object> policyMap = (Map<String, Object>) propertiesMap.get("policy");
+ if (MapUtils.isNotEmpty(policyMap)) {
+ List<Object> securityGroupList =
+ (List<Object>) policyMap.get(ResourceReferenceFunctions.GET_ATTR.getFunction());
+ //noinspection SuspiciousMethodCalls
+ if (CollectionUtils.isNotEmpty(securityGroupList)) {
+ //noinspection SuspiciousMethodCalls
+ networkPolicyResourceNames.remove(securityGroupList.get(0));
+ }
+ }
+ }
+ }
+
+
+ private static void getResourceNamesListFromSpecificResource(String filename,
+ List<String> resourcesNames,
+ HeatResourcesTypes heatResourcesType,
+ Map<String, Resource> resourcesMap,
+ Set<String> sharedResourcesFromOutputMap,
+ GlobalValidationContext globalContext) {
+
+ for (Map.Entry<String, Resource> resourceEntry : resourcesMap.entrySet()) {
+ String resourceType = resourceEntry.getValue().getType();
+ if (Objects.isNull(resourceType)) {
+ globalContext.addMessage(filename, ErrorLevel.WARNING, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.INVALID_RESOURCE_TYPE.getErrorMessage(), null,
+ resourceEntry.getKey()));
+ } else {
+ if (resourceType.equals(heatResourcesType.getHeatResource())
+ && !isSharedResource(resourceEntry.getKey(), sharedResourcesFromOutputMap)) {
+ resourcesNames.add(resourceEntry.getKey());
+ }
+ }
+ }
+ }
+
+
+ private static boolean isSharedResource(String resourceName,
+ Set<String> sharedResourcesFromOutputMap) {
+ return !CollectionUtils.isEmpty(sharedResourcesFromOutputMap)
+ && sharedResourcesFromOutputMap.contains(resourceName);
+ }
+
+ /**
+ * Handle not empty resource names list.
+ *
+ * @param fileName the file name
+ * @param resourcesNameList the resources name list
+ * @param securityOrServerGroup the security or server group
+ * @param globalContext the global context
+ */
+ public static void handleNotEmptyResourceNamesList(String fileName,
+ Collection<String> resourcesNameList,
+ String securityOrServerGroup,
+ GlobalValidationContext globalContext) {
+ if (CollectionUtils.isNotEmpty(resourcesNameList)) {
+ resourcesNameList.forEach(name ->
+ globalContext
+ .addMessage(
+ fileName,
+ ErrorLevel.WARNING,
+ ErrorMessagesFormatBuilder
+ .getErrorWithParameters(
+ Messages.SERVER_OR_SECURITY_GROUP_NOT_IN_USE.getErrorMessage(),
+ securityOrServerGroup, name)));
+ }
+ }
+
+
+ private static void initVisitedPortsMap(String filename, Map<String, Resource> resourceMap,
+ Map<String, Integer> numberOfVisitsInPort,
+ GlobalValidationContext globalContext) {
+ for (Map.Entry<String, Resource> resourceEntry : resourceMap.entrySet()) {
+ String resourceType = resourceEntry.getValue().getType();
+
+ if (Objects.isNull(resourceType)) {
+ globalContext.addMessage(filename, ErrorLevel.WARNING, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.INVALID_RESOURCE_TYPE.getErrorMessage(), "null",
+ resourceEntry.getKey()));
+ } else {
+ if (resourceType.equals(HeatResourcesTypes.NEUTRON_PORT_RESOURCE_TYPE.getHeatResource())) {
+ numberOfVisitsInPort.put(resourceEntry.getKey(), 0);
+ }
+ }
+ }
+ }
+
+ private static boolean checkIfPortWasVisited(String resourcePortName,
+ Map<String, Integer> numberOfVisitsInPort) {
+ return numberOfVisitsInPort.containsKey(resourcePortName)
+ && numberOfVisitsInPort.get(resourcePortName) == 1;
+ }
+
+
+ private static void incrementNumberOfVisitsInPort(String resourcePortName,
+ Map<String, Integer> numberOfVisitsInPort) {
+ if (numberOfVisitsInPort.containsKey(resourcePortName)) {
+ numberOfVisitsInPort.put(resourcePortName, numberOfVisitsInPort.get(resourcePortName) + 1);
+ }
+ }
+
+
+ private static void handleOrphanPorts(String fileName, Map<String, Integer> numberOfVisitsInPort,
+ GlobalValidationContext globalContext) {
+ numberOfVisitsInPort
+ .entrySet()
+ .stream()
+ .filter(entry -> entry.getValue() == 0)
+ .forEach(entry ->
+ globalContext
+ .addMessage(
+ fileName,
+ ErrorLevel.WARNING,
+ ErrorMessagesFormatBuilder
+ .getErrorWithParameters(
+ Messages.PORT_NO_BIND_TO_ANY_NOVA_SERVER.getErrorMessage(),
+ entry.getKey())));
+ }
+
+ @SuppressWarnings("unchecked")
+ private static void checkResourceDependsOn(String fileName, Resource resource,
+ Set<String> resourcesNames,
+ GlobalValidationContext globalContext) {
+ Object dependencies = resource.getDepends_on();
+ if (dependencies instanceof Collection) {
+ ((Collection<String>) dependencies)
+ .stream()
+ .filter(resource_id -> !resourcesNames.contains(resource_id))
+ .forEach(resource_id -> globalContext.addMessage(fileName, ErrorLevel.ERROR,
+ ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.MISSING_RESOURCE_IN_DEPENDS_ON.getErrorMessage(),
+ (String) resource_id)));
+ } else if (dependencies instanceof String) {
+ if (!resourcesNames.contains(dependencies)) {
+ globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.MISSING_RESOURCE_IN_DEPENDS_ON.getErrorMessage(),
+ (String) dependencies));
+ }
+ }
+ }
+
+
+ private static void checkPortBindingFromMap(String fileName, Map<String, Object> portValueMap,
+ Map<String, Integer> numberOfVisitsInPort,
+ GlobalValidationContext globalContext) {
+ String resourcePortName =
+ (String) portValueMap.get(ResourceReferenceFunctions.GET_RESOURCE.getFunction());
+ if (checkIfPortWasVisited(resourcePortName, numberOfVisitsInPort)) {
+ globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.MORE_THAN_ONE_BIND_FROM_NOVA_TO_PORT.getErrorMessage(),
+ (String) portValueMap.get(ResourceReferenceFunctions.GET_RESOURCE.getFunction())));
+ } else {
+ incrementNumberOfVisitsInPort(resourcePortName, numberOfVisitsInPort);
+ }
+ }
+
+
+ private static void initResourceTypeListWithItsResourcesNames(String filename,
+ Map<HeatResourcesTypes, List<String>> resourcesTypesListMap,
+ Map<String, Resource> resourcesMap,
+ Set<String> sharedResourcesFromOutputsMap,
+ GlobalValidationContext globalContext) {
+ for (Map.Entry<HeatResourcesTypes, List<String>> resourcesTypesToListEntry
+ : resourcesTypesListMap.entrySet()) {
+ HeatResourcesTypes currentType = resourcesTypesToListEntry.getKey();
+ List<String> currNamesList = new ArrayList<>();
+ getResourceNamesListFromSpecificResource(filename, currNamesList, currentType, resourcesMap,
+ sharedResourcesFromOutputsMap, globalContext);
+ resourcesTypesListMap.put(currentType, currNamesList);
+ }
+ }
+
+
+ private static void checkForEmptyResourceNamesInMap(String fileName,
+ boolean isBaseFileContainPorts,
+ Map<HeatResourcesTypes, List<String>> resourcesTypesListMap,
+ GlobalValidationContext globalContext) {
+ if (isBaseFileContainPorts) {
+ for (Map.Entry<HeatResourcesTypes, List<String>> resourcesTypesListEntry
+ : resourcesTypesListMap.entrySet()) {
+ handleNotEmptyResourceNamesList(fileName, resourcesTypesListEntry.getValue(),
+ ResourceTypeToMessageString
+ .getTypeForMessageFromResourceType(resourcesTypesListEntry.getKey()),
+ globalContext);
+ }
+ }
+ }
+
+
+ private static Set<String> getSharedResourcesNamesFromOutputs(String filename,
+ Map<String, Output> outputsMap,
+ GlobalValidationContext globalContext) {
+ Set<String> sharedResources = new HashSet<>();
+
+ if (MapUtils.isEmpty(outputsMap)) {
+ return null;
+ }
+
+ for (Map.Entry<String, Output> outputEntry : outputsMap.entrySet()) {
+ Output output = outputEntry.getValue();
+ Object valueObject = output.getValue();
+ if (valueObject instanceof Map) {
+ Map<String, Object> outputValueMap = (Map<String, Object>) valueObject;
+ Object getResourceValue =
+ outputValueMap.get(ResourceReferenceFunctions.GET_RESOURCE.getFunction());
+ if (Objects.nonNull(getResourceValue)) {
+ if (getResourceValue instanceof String) {
+ String resourceName =
+ (String) outputValueMap.get(ResourceReferenceFunctions.GET_RESOURCE.getFunction());
+ sharedResources.add(resourceName);
+ } else {
+ globalContext.addMessage(filename, ErrorLevel.ERROR, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.INVALID_GET_RESOURCE_SYNTAX.getErrorMessage(),
+ getResourceValue.toString()));
+ }
+ }
+
+ }
+ }
+
+ return sharedResources;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/EcompGuideLineValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/EcompGuideLineValidator.java
new file mode 100644
index 0000000000..5be56e4b38
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/EcompGuideLineValidator.java
@@ -0,0 +1,784 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.validation.impl.validators;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.MapUtils;
+import org.openecomp.core.utilities.CommonMethods;
+import org.openecomp.core.utilities.yaml.YamlUtil;
+import org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder;
+import org.openecomp.core.validation.errors.Messages;
+import org.openecomp.core.validation.interfaces.Validator;
+import org.openecomp.core.validation.types.GlobalValidationContext;
+import org.openecomp.sdc.common.utils.AsdcCommon;
+import org.openecomp.sdc.datatypes.error.ErrorLevel;
+import org.openecomp.sdc.datatypes.model.heat.ForbiddenHeatResourceTypes;
+import org.openecomp.sdc.heat.datatypes.DefinedHeatParameterTypes;
+import org.openecomp.sdc.heat.datatypes.manifest.FileData;
+import org.openecomp.sdc.heat.datatypes.manifest.ManifestContent;
+import org.openecomp.sdc.heat.datatypes.model.Environment;
+import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate;
+import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes;
+import org.openecomp.sdc.heat.datatypes.model.Resource;
+import org.openecomp.sdc.heat.datatypes.model.ResourceReferenceFunctions;
+import org.openecomp.sdc.heat.services.HeatStructureUtil;
+import org.openecomp.sdc.heat.services.manifest.ManifestUtil;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.regex.Pattern;
+
+public class EcompGuideLineValidator extends HeatValidator implements Validator {
+ @Override
+ public void validate(GlobalValidationContext globalContext) {
+
+ ManifestContent manifestContent;
+ try {
+ manifestContent = checkValidationPreCondition(globalContext);
+ } catch (Exception exception) {
+ return;
+ }
+
+ //global validations
+ Set<String> baseFiles = validateManifest(manifestContent, globalContext);
+
+ Map<String, FileData.Type> fileTypeMap = ManifestUtil.getFileTypeMap(manifestContent);
+ Map<String, FileData> fileEnvMap = ManifestUtil.getFileAndItsEnv(manifestContent);
+ globalContext
+ .getFiles()
+ .stream()
+ .filter(fileName -> FileData
+ .isHeatFile(fileTypeMap.get(fileName)))
+ .forEach(fileName -> validate(fileName,
+ fileEnvMap.get(fileName) != null ? fileEnvMap.get(fileName).getFile() : null,
+ fileTypeMap, baseFiles, globalContext));
+ }
+
+ private void validate(String fileName, String envFileName, Map<String, FileData.Type> fileTypeMap,
+ Set<String> baseFiles, GlobalValidationContext globalContext) {
+ HeatOrchestrationTemplate heatOrchestrationTemplate =
+ checkHeatOrchestrationPreCondition(fileName, globalContext);
+ if (heatOrchestrationTemplate == null) {
+ return;
+ }
+
+ validateBaseFile(fileName, baseFiles, heatOrchestrationTemplate, globalContext);
+ validateHeatVolumeFile(fileName, fileTypeMap, heatOrchestrationTemplate, globalContext);
+ validateHeatNamingConvention(fileName, heatOrchestrationTemplate, globalContext);
+ validateHeatNovaResource(fileName, envFileName, heatOrchestrationTemplate, globalContext);
+ validateResourceTypeIsForbidden(fileName, heatOrchestrationTemplate, globalContext);
+ validateFixedIpsNamingConvention(fileName, heatOrchestrationTemplate, globalContext);
+ }
+
+ private void validateHeatNovaResource(String fileName, String envFileName,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ GlobalValidationContext globalContext) {
+ Map<String, String> uniqueResourcePortNetworkRole = new HashMap<>();
+ //if no resources exist return
+ if (heatOrchestrationTemplate.getResources() == null
+ || heatOrchestrationTemplate.getResources().size() == 0) {
+ return;
+ }
+
+ heatOrchestrationTemplate
+ .getResources()
+ .entrySet()
+ .stream()
+ .filter(entry -> entry.getValue().getType()
+ .equals(HeatResourcesTypes.NOVA_SERVER_RESOURCE_TYPE.getHeatResource()))
+ .forEach(entry -> validateNovaServerResourceType(entry.getKey(), fileName, envFileName,
+ entry, uniqueResourcePortNetworkRole, heatOrchestrationTemplate, globalContext));
+ }
+
+ private void validateNovaServerResourceType(String resourceId, String fileName,
+ String envFileName,
+ Map.Entry<String, Resource> resourceEntry,
+ Map<String, String> uniqueResourcePortNetworkRole,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ GlobalValidationContext globalValidationContext) {
+ validateNovaServerResourceMetaData(fileName, resourceId,
+ heatOrchestrationTemplate.getResources().get(resourceId), globalValidationContext);
+ validateNovaServerResourceNetworkUniqueRole(fileName, resourceId, heatOrchestrationTemplate,
+ globalValidationContext);
+ validateNovaServerNamingConvention(fileName, envFileName, resourceEntry,
+ globalValidationContext);
+ validateNovaServerAvailabilityZoneName(fileName, resourceEntry, globalValidationContext);
+ validateImageAndFlavorFromNovaServer(fileName, resourceEntry, globalValidationContext);
+ }
+
+ @SuppressWarnings("unchecked")
+ private void validateNovaServerResourceMetaData(String fileName, String resourceId,
+ Resource resource,
+ GlobalValidationContext globalValidationContext) {
+ Map<String, Object> novaServerProp = resource.getProperties();
+ Object novaServerPropMetadata;
+ if (MapUtils.isNotEmpty(novaServerProp)) {
+ novaServerPropMetadata = novaServerProp.get("metadata");
+ if (novaServerPropMetadata == null) {
+ globalValidationContext.addMessage(
+ fileName,
+ ErrorLevel.WARNING,
+ ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.MISSING_NOVA_SERVER_METADATA.getErrorMessage(),
+ resourceId));
+ } else if (novaServerPropMetadata instanceof Map) {
+ TreeMap<String, Object> propertyMap = new TreeMap(new Comparator<String>() {
+
+ @Override
+ public int compare(String o1, String o2) {
+ return o1.compareToIgnoreCase(o2);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ return false;
+ }
+ });
+ propertyMap.putAll((Map) novaServerPropMetadata);
+ if (!propertyMap.containsKey("vf_module_id")) {
+ globalValidationContext.addMessage(fileName, ErrorLevel.WARNING,
+ ErrorMessagesFormatBuilder.getErrorWithParameters(
+ Messages.MISSING_NOVA_SERVER_VF_MODULE_ID.getErrorMessage(), resourceId));
+ }
+ if (!propertyMap.containsKey("vnf_id")) {
+ globalValidationContext.addMessage(fileName, ErrorLevel.WARNING,
+ ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.MISSING_NOVA_SERVER_VNF_ID.getErrorMessage(),
+ resourceId));
+ }
+ }
+ }
+ }
+
+ private void validateNovaServerResourceNetworkUniqueRole(String fileName, String resourceId,
+ HeatOrchestrationTemplate
+ heatOrchestrationTemplate,
+ GlobalValidationContext
+ globalValidationContext) {
+
+ String network;
+ String role;
+ Map<String, String> uniqueResourcePortNetworkRole = new HashMap<>();
+
+ Object propertyNetworkValue =
+ heatOrchestrationTemplate.getResources().get(resourceId).getProperties().get("networks");
+ if (propertyNetworkValue != null && propertyNetworkValue instanceof List) {
+ List<String> portResourceIdList =
+ getNovaNetworkPortResourceList(fileName, (List) propertyNetworkValue,
+ globalValidationContext);
+ for (String portResourceId : portResourceIdList) {
+ Resource portResource = heatOrchestrationTemplate.getResources().get(portResourceId);
+ if (portResource != null && portResource.getType()
+ .equals(HeatResourcesTypes.NEUTRON_PORT_RESOURCE_TYPE.getHeatResource())) {
+ Map portNetwork =
+ getPortNetwork(fileName, resourceId, portResource, globalValidationContext);
+ if (Objects.nonNull(portNetwork)) {
+ network = (String) portNetwork.get("get_param");
+ if (Objects.nonNull(network)) {
+ role = getNetworkRole(network);
+ if (role != null && uniqueResourcePortNetworkRole.containsKey(role)) {
+ globalValidationContext.addMessage(fileName, ErrorLevel.WARNING,
+ ErrorMessagesFormatBuilder.getErrorWithParameters(
+ Messages.RESOURCE_CONNECTED_TO_TWO_EXTERNAL_NETWORKS_WITH_SAME_ROLE
+ .getErrorMessage(), resourceId, role));
+ } else {
+ uniqueResourcePortNetworkRole.put(role, portResourceId);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+
+ private Map getPortNetwork(String fileName, String resourceId, Resource portResource,
+ GlobalValidationContext globalValidationContext) {
+ Object portNetwork = portResource.getProperties().get("network_id");
+ if (portNetwork == null) {
+ portNetwork = portResource.getProperties().get("network");
+ }
+ if (!(portNetwork instanceof Map)) {
+ globalValidationContext.addMessage(fileName, ErrorLevel.WARNING, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.MISSING_GET_PARAM.getErrorMessage(),
+ "network or network_id", resourceId));
+ return null;
+ }
+ return (Map) portNetwork;
+ }
+
+ private List<String> getNovaNetworkPortResourceList(String filename, List propertyNetworkValue,
+ GlobalValidationContext globalContext) {
+ List<String> portResourceIdList = new ArrayList<>();
+ for (Object propValue : propertyNetworkValue) {
+ Object portPropValue = ((Map) propValue).get("port");
+ Collection<String> portResourceIds = HeatStructureUtil
+ .getReferencedValuesByFunctionName(filename, "get_resource", portPropValue,
+ globalContext);
+ if (portResourceIds != null) {
+ portResourceIdList.addAll(portResourceIds);
+ }
+ }
+
+ return portResourceIdList;
+ }
+
+ private String getNetworkRole(String network) {
+ if (network == null) {
+ return null;
+ }
+ if (network.contains("_net_id")) {
+ return network.substring(0, network.indexOf("_net_id"));
+ } else if (network.contains("net_name")) {
+ return network.substring(0, network.indexOf("_net_name"));
+ } else if (network.contains("net_fqdn")) {
+ return network.substring(0, network.indexOf("_net_fqdn"));
+ }
+ return null;
+ }
+
+ private void validateHeatNamingConvention(String fileName,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ GlobalValidationContext globalContext) {
+ validatePortNetworkNamingConvention(fileName, heatOrchestrationTemplate, globalContext);
+ }
+
+ private void validatePortNetworkNamingConvention(String fileName,
+ HeatOrchestrationTemplate
+ heatOrchestrationTemplate,
+ GlobalValidationContext globalContext) {
+ if (MapUtils.isEmpty(heatOrchestrationTemplate.getResources())) {
+ return;
+ }
+ String[] regexList = new String[]{".*_net_id", ".*_net_name", ".*_net_fqdn"};
+
+ heatOrchestrationTemplate
+ .getResources()
+ .entrySet()
+ .stream()
+ .filter(entry -> entry.getValue().getType() != null && entry.getValue().getType()
+ .equals(HeatResourcesTypes.NEUTRON_PORT_RESOURCE_TYPE.getHeatResource()))
+ .forEach(entry -> entry.getValue()
+ .getProperties()
+ .entrySet()
+ .stream()
+ .filter(propertyEntry -> propertyEntry != null
+ && (propertyEntry.getKey().toLowerCase().equals("network".toLowerCase())
+ ||
+ propertyEntry.getKey().equals("network_id")))
+ .forEach(propertyEntry -> validateParamNamingConvention(fileName, entry.getKey(),
+ propertyEntry.getValue(), regexList,
+ Messages.NETWORK_PARAM_NOT_ALIGNED_WITH_GUIDE_LINE, globalContext)));
+ }
+
+ private void validateParamNamingConvention(String fileName, String resourceId,
+ Object propertyValue, String[] regexList,
+ Messages message,
+ GlobalValidationContext globalContext) {
+ Object paramName;
+ if (propertyValue instanceof Map) {
+ paramName = ((Map) propertyValue).get("get_param");
+ if (paramName instanceof String) {
+ if (!evalPattern((String) paramName, regexList)) {
+ globalContext.addMessage(fileName, ErrorLevel.WARNING, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(message.getErrorMessage(), (String) paramName, resourceId));
+ }
+ }
+ } else {
+ globalContext.addMessage(fileName, ErrorLevel.WARNING, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.MISSING_GET_PARAM.getErrorMessage(),
+ "network or network_id", resourceId));
+ }
+ }
+
+ private boolean evalPattern(Object paramVal, String[] regexList) {
+ String value = "";
+ if (paramVal instanceof String) {
+ value = ((String) paramVal);
+ }
+ if (paramVal instanceof Integer) {
+ value = paramVal.toString();
+ }
+ return evalPattern(value, regexList);
+ }
+
+ private boolean evalPattern(String paramVal, String[] regexList) {
+
+ for (String regex : regexList) {
+ if (Pattern.matches(regex, paramVal)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+
+ private void validateHeatVolumeFile(String fileName, Map<String, FileData.Type> fileTypeMap,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ GlobalValidationContext globalContext) {
+ //if not heat volume return
+ if (!fileTypeMap.get(fileName).equals(FileData.Type.HEAT_VOL)) {
+ return;
+ }
+
+ //if no resources exist return
+ if (heatOrchestrationTemplate.getResources() == null
+ || heatOrchestrationTemplate.getResources().size() == 0) {
+ return;
+ }
+
+ Set<String> expectedExposedResources = new HashSet<>();
+ Set<String> actualExposedResources = new HashSet<>();
+ heatOrchestrationTemplate.getResources()
+ .entrySet()
+ .stream()
+ .filter(entry -> entry.getValue().getType()
+ .equals(HeatResourcesTypes.CINDER_VOLUME_RESOURCE_TYPE.getHeatResource()))
+ .forEach(entry -> expectedExposedResources.add(entry.getKey()));
+
+ if (heatOrchestrationTemplate.getOutputs() != null) {
+
+ heatOrchestrationTemplate.getOutputs().entrySet()
+ .stream()
+ .filter(entry -> isPropertyValueGetResource(fileName, entry.getValue().getValue(),
+ globalContext))
+ .forEach(entry -> actualExposedResources.add(
+ getResourceIdFromPropertyValue(fileName, entry.getValue().getValue(),
+ globalContext)));
+ }
+
+ actualExposedResources.stream().forEach(expectedExposedResources::remove);
+
+ if (expectedExposedResources.size() > 0) {
+ expectedExposedResources
+ .stream()
+ .forEach(name -> globalContext.addMessage(fileName, ErrorLevel.WARNING,
+ ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.VOLUME_HEAT_NOT_EXPOSED.getErrorMessage(),
+ name)));
+ }
+ }
+
+ private void validateBaseFile(String fileName, Set<String> baseFiles,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ GlobalValidationContext globalContext) {
+
+ //if not base return
+ if (baseFiles == null || !baseFiles.contains(fileName)) {
+ return;
+ }
+
+ //if no resources exist return
+ if (heatOrchestrationTemplate.getResources() == null
+ || heatOrchestrationTemplate.getResources().size() == 0) {
+ return;
+ }
+
+ Set<String> expectedExposedResources = new HashSet<>();
+ Set<String> actualExposedResources = new HashSet<>();
+ heatOrchestrationTemplate.getResources()
+ .entrySet()
+ .stream()
+ .filter(entry -> isExpectedToBeExposed(entry.getValue().getType()))
+ .forEach(entry -> expectedExposedResources.add(entry.getKey()));
+
+ if (heatOrchestrationTemplate.getOutputs() != null) {
+
+ heatOrchestrationTemplate.getOutputs().entrySet()
+ .stream()
+ .filter(entry -> isPropertyValueGetResource(fileName, entry.getValue().getValue(),
+ globalContext))
+ .forEach(entry -> actualExposedResources.add(
+ getResourceIdFromPropertyValue(fileName, entry.getValue().getValue(),
+ globalContext)));
+ }
+ actualExposedResources.stream().forEach(expectedExposedResources::remove);
+
+ if (expectedExposedResources.size() > 0) {
+ expectedExposedResources
+ .stream()
+ .forEach(name -> globalContext.addMessage(fileName, ErrorLevel.WARNING,
+ ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.RESOURCE_NOT_DEFINED_IN_OUTPUT.getErrorMessage(),
+ name)));
+ }
+ }
+
+ private void validateResourceTypeIsForbidden(String fileName,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ GlobalValidationContext globalContext) {
+ if (MapUtils.isEmpty(heatOrchestrationTemplate.getResources())) {
+ return;
+ }
+
+ heatOrchestrationTemplate.getResources()
+ .entrySet()
+ .stream()
+ .filter(entry ->
+ ForbiddenHeatResourceTypes.findByForbiddenHeatResource(entry.getValue().getType())
+ != null)
+ .filter(entry -> ForbiddenHeatResourceTypes
+ .findByForbiddenHeatResource(entry.getValue().getType())
+ .equals(ForbiddenHeatResourceTypes.HEAT_FLOATING_IP_TYPE))
+ .forEach(entry -> globalContext.addMessage(fileName, ErrorLevel.WARNING,
+ ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.FLOATING_IP_NOT_IN_USE.getErrorMessage(),
+ entry.getKey())));
+ }
+
+
+ private void validateFixedIpsNamingConvention(String fileName,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ GlobalValidationContext globalContext) {
+ if (MapUtils.isEmpty(heatOrchestrationTemplate.getResources())) {
+ return;
+ }
+
+ heatOrchestrationTemplate.getResources()
+ .entrySet()
+ .stream()
+ .filter(entry -> HeatResourcesTypes.findByHeatResource(entry.getValue().getType()) != null)
+ .filter(entry -> HeatResourcesTypes.findByHeatResource(entry.getValue().getType())
+ .equals(HeatResourcesTypes.NEUTRON_PORT_RESOURCE_TYPE))
+ .forEach(entry -> checkNeutronPortFixedIpsName(fileName, entry, globalContext));
+ }
+
+ private void validateImageAndFlavorFromNovaServer(String fileName,
+ Map.Entry<String, Resource> resourceEntry,
+ GlobalValidationContext globalContext) {
+ if (MapUtils.isEmpty(resourceEntry.getValue().getProperties())) {
+ return;
+ }
+
+ String[] imageOrFlavorAsParameters = new String[]{"image", "flavor"};
+ Map<String, Object> propertiesMap = resourceEntry.getValue().getProperties();
+
+ for (String imageOrFlavor : imageOrFlavorAsParameters) {
+ checkImageAndFlavorNames(fileName, imageOrFlavor, resourceEntry.getKey(), propertiesMap,
+ globalContext);
+ }
+ }
+
+ private void checkImageAndFlavorNames(String fileName, String imageOrFlavor, String resourceId,
+ Map<String, Object> propertiesMap,
+ GlobalValidationContext globalContext) {
+ Object nameValue =
+ propertiesMap.get(imageOrFlavor) == null ? null : propertiesMap.get(imageOrFlavor);
+ String[] regexList = new String[]{".*_" + imageOrFlavor + "_name"};
+
+ if (Objects.nonNull(nameValue)) {
+ if (nameValue instanceof Map) {
+ String imageOrFlavorName = getWantedNameFromPropertyValueGetParam(nameValue);
+ if (Objects.nonNull(imageOrFlavorName)) {
+ if (!evalPattern(imageOrFlavorName, regexList)) {
+ globalContext.addMessage(fileName, ErrorLevel.WARNING, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(
+ Messages.WRONG_IMAGE_OR_FLAVOR_NAME_NOVA_SERVER.getErrorMessage(),
+ imageOrFlavor, resourceId));
+ }
+ }
+ } else {
+ globalContext.addMessage(fileName, ErrorLevel.WARNING, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.MISSING_GET_PARAM.getErrorMessage(), imageOrFlavor,
+ resourceId));
+ }
+ }
+ }
+
+
+ @SuppressWarnings("unchecked")
+ private void checkNeutronPortFixedIpsName(String fileName,
+ Map.Entry<String, Resource> resourceEntry,
+ GlobalValidationContext globalContext) {
+ String[] regexList =
+ new String[]{"[^_]+_[^_]+_ips", "[^_]+_[^_]+_v6_ips", "[^_]+_[^_]+_ip_(\\d+)",
+ "[^_]+_[^_]+_v6_ip_(\\d+)"};
+
+ if (MapUtils.isEmpty(resourceEntry.getValue().getProperties())) {
+ return;
+ }
+
+ Map<String, Object> propertiesMap = resourceEntry.getValue().getProperties();
+ Object fixedIps = propertiesMap.get("fixed_ips");
+ if (Objects.nonNull(fixedIps) && fixedIps instanceof List) {
+ List<Object> fixedIpsList = (List<Object>) fixedIps;
+ for (Object fixedIpsObject : fixedIpsList) {
+ Map.Entry<String, Object> fixedIpsEntry =
+ ((Map<String, Object>) fixedIpsObject).entrySet().iterator().next();
+ if (Objects.nonNull(fixedIpsEntry)) {
+ if (fixedIpsEntry.getValue() instanceof Map) {
+ String fixedIpsName = getWantedNameFromPropertyValueGetParam(fixedIpsEntry.getValue());
+ if (Objects.nonNull(fixedIpsName)) {
+ if (!evalPattern(fixedIpsName, regexList)) {
+ globalContext.addMessage(fileName, ErrorLevel.WARNING, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(
+ Messages.FIXED_IPS_NOT_ALIGNED_WITH_GUIDE_LINES.getErrorMessage(),
+ resourceEntry.getKey()));
+ }
+ }
+ } else {
+ globalContext.addMessage(fileName, ErrorLevel.WARNING, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.MISSING_GET_PARAM.getErrorMessage(), "fixed_ips",
+ resourceEntry.getKey()));
+ }
+ }
+ }
+ }
+ }
+
+
+ private void validateNovaServerNamingConvention(String fileName, String envFileName,
+ Map.Entry<String, Resource> resourceEntry,
+ GlobalValidationContext globalContext) {
+ if (MapUtils.isEmpty(resourceEntry.getValue().getProperties())) {
+ return;
+ }
+
+ checkIfNovaNameByGuidelines(fileName, envFileName, resourceEntry, globalContext);
+ }
+
+ private void checkIfNovaNameByGuidelines(String fileName, String envFileName,
+ Map.Entry<String, Resource> resourceEntry,
+ GlobalValidationContext globalContext) {
+ if (MapUtils.isEmpty(resourceEntry.getValue().getProperties())) {
+ return;
+ }
+
+ Object novaServerName = resourceEntry.getValue().getProperties().get("name");
+ Map novaNameMap;
+ String novaName;
+ if (Objects.nonNull(novaServerName)) {
+ if (novaServerName instanceof Map) {
+ novaNameMap = (Map) novaServerName;
+ Object novaNameGetParam =
+ novaNameMap.get(ResourceReferenceFunctions.GET_PARAM.getFunction()) == null ? null
+ : novaNameMap.get(ResourceReferenceFunctions.GET_PARAM.getFunction());
+ if (Objects.nonNull(novaNameGetParam)) {
+ checkNovaNameGetParamValueMap(fileName, novaNameGetParam, resourceEntry, globalContext);
+ novaName = novaNameGetParam instanceof List ? (String) ((List) novaNameGetParam).get(0)
+ : (String) novaNameGetParam;
+ checkIfNovaNameParameterInEnvIsStringOrList(fileName, envFileName, resourceEntry,
+ novaName, globalContext);
+ }
+ } else {
+ globalContext.addMessage(fileName, ErrorLevel.WARNING, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.MISSING_GET_PARAM.getErrorMessage(),
+ "nova server name", resourceEntry.getKey()));
+ }
+ }
+
+ }
+
+ private void checkIfNovaNameParameterInEnvIsStringOrList(String fileName, String envFileName,
+ Map.Entry<String, Resource>
+ resourceEntry,
+ String novaServerName,
+ GlobalValidationContext globalContext) {
+ if (Objects.nonNull(envFileName)) {
+ Environment environment = validateEnvContent(envFileName, globalContext);
+
+ if (environment != null && MapUtils.isNotEmpty(environment.getParameters())) {
+ Object novaServerNameEnvValue =
+ environment.getParameters().containsKey(novaServerName) ? environment.getParameters()
+ .get(novaServerName) : null;
+ if (Objects.nonNull(novaServerNameEnvValue)) {
+ if (!DefinedHeatParameterTypes
+ .isNovaServerEnvValueIsFromRightType(novaServerNameEnvValue)) {
+ globalContext.addMessage(fileName, ErrorLevel.WARNING, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(
+ Messages.NOVA_SERVER_NAME_NOT_ALIGNED_WITH_GUIDE_LINES.getErrorMessage(),
+ resourceEntry.getKey()));
+ }
+ }
+ }
+ }
+ }
+
+
+ private void validateNovaServerAvailabilityZoneName(String fileName,
+ Map.Entry<String, Resource> resourceEntry,
+ GlobalValidationContext globalContext) {
+ String[] regexList = new String[]{"availability_zone_(\\d+)"};
+
+ if (MapUtils.isEmpty(resourceEntry.getValue().getProperties())) {
+ return;
+ }
+
+ Object availabilityZoneMap =
+ resourceEntry.getValue().getProperties().containsKey("availability_zone") ? resourceEntry
+ .getValue().getProperties().get("availability_zone") : null;
+
+ if (Objects.nonNull(availabilityZoneMap)) {
+ if (availabilityZoneMap instanceof Map) {
+ String availabilityZoneName = getWantedNameFromPropertyValueGetParam(availabilityZoneMap);
+
+ if (availabilityZoneName != null) {
+ if (!evalPattern(availabilityZoneName, regexList)) {
+ globalContext.addMessage(fileName, ErrorLevel.WARNING, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(
+ Messages.AVAILABILITY_ZONE_NOT_ALIGNED_WITH_GUIDE_LINES.getErrorMessage(),
+ resourceEntry.getKey()));
+ }
+ }
+ } else {
+ globalContext.addMessage(fileName, ErrorLevel.WARNING, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.MISSING_GET_PARAM.getErrorMessage(),
+ "availability_zone", resourceEntry.getKey()));
+ }
+ }
+
+ }
+
+ @SuppressWarnings("unchecked")
+ private void checkNovaNameGetParamValueMap(String fileName, Object getParamValue,
+ Map.Entry<String, Resource> resourceEntry,
+ GlobalValidationContext globalContext) {
+ if (getParamValue instanceof List) {
+ List<Object> getParamNameList = (List) getParamValue;
+ String[] regexName = new String[]{".*_names"};
+ isNovaNameAsListLegal(fileName, getParamNameList, regexName, resourceEntry, globalContext);
+ } else if (getParamValue instanceof String) {
+ String[] regexName = new String[]{".*_name_(\\d+)"};
+ isNovaNameAsStringLegal(fileName, (String) getParamValue, regexName, resourceEntry,
+ globalContext);
+ }
+
+ }
+
+
+ private void isNovaNameAsListLegal(String fileName, List<Object> getParamNameList,
+ String[] regexName, Map.Entry<String, Resource> resourceEntry,
+ GlobalValidationContext globalContext) {
+
+ if (getParamNameList.size() != 2 || !evalPattern(getParamNameList.get(0), regexName)) {
+ globalContext.addMessage(fileName, ErrorLevel.WARNING, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(
+ Messages.NOVA_SERVER_NAME_NOT_ALIGNED_WITH_GUIDE_LINES.getErrorMessage(),
+ resourceEntry.getKey()));
+ }
+ }
+
+ private boolean isNovaNameAsStringLegal(String fileName, String novaName, String[] regexName,
+ Map.Entry<String, Resource> resourceEntry,
+ GlobalValidationContext globalContext) {
+ if (!evalPattern(novaName, regexName)) {
+ globalContext.addMessage(fileName, ErrorLevel.WARNING, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(
+ Messages.NOVA_SERVER_NAME_NOT_ALIGNED_WITH_GUIDE_LINES.getErrorMessage(),
+ resourceEntry.getKey()));
+ return false;
+ }
+ return true;
+ }
+
+ private String getWantedNameFromPropertyValueGetParam(Object value) {
+ Set<String> paramName = HeatStructureUtil
+ .getReferencedValuesByFunctionName(null, ResourceReferenceFunctions.GET_PARAM.getFunction(),
+ value, null);
+ if (paramName != null && CollectionUtils.isNotEmpty(paramName)) {
+ return (String) paramName.toArray()[0];
+ }
+ return null;
+ }
+
+ private String getResourceIdFromPropertyValue(String filename, Object value,
+ GlobalValidationContext globalContext) {
+ Set<String> referenceValues = HeatStructureUtil.getReferencedValuesByFunctionName(filename,
+ ResourceReferenceFunctions.GET_RESOURCE.getFunction(), value, globalContext);
+ if (referenceValues != null && CollectionUtils.isNotEmpty(referenceValues)) {
+ return (String) referenceValues.toArray()[0];
+ }
+ return null;
+ }
+
+ private boolean isPropertyValueGetResource(String filename, Object value,
+ GlobalValidationContext globalContext) {
+ Set<String> referenceValues = HeatStructureUtil.getReferencedValuesByFunctionName(filename,
+ ResourceReferenceFunctions.GET_RESOURCE.getFunction(), value, globalContext);
+ return referenceValues != null && (referenceValues.size() > 0);
+ }
+
+ private boolean isExpectedToBeExposed(String type) {
+ return HeatResourcesTypes.isResourceExpectedToBeExposed(type);
+ }
+
+ private Set<String> validateManifest(ManifestContent manifestContent,
+ GlobalValidationContext globalContext) {
+ Set<String> baseFiles = ManifestUtil.getBaseFiles(manifestContent);
+ if (baseFiles == null || baseFiles.size() == 0) {
+ globalContext.addMessage(
+ AsdcCommon.MANIFEST_NAME,
+ ErrorLevel.WARNING,
+ ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.MISSIN_BASE_HEAT_FILE.getErrorMessage()));
+ } else if (baseFiles.size() > 1) {
+ String baseFileList = getElementListAsString(baseFiles);
+ globalContext.addMessage(
+ AsdcCommon.MANIFEST_NAME,
+ ErrorLevel.WARNING,
+ ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.MULTI_BASE_HEAT_FILE.getErrorMessage(),
+ baseFileList));
+ }
+ return baseFiles;
+ }
+
+ private String getElementListAsString(Set<String> elementCollection) {
+
+ return "[" + CommonMethods.collectionToCommaSeparatedString(elementCollection) + "]";
+ }
+
+
+ private Environment validateEnvContent(String envFileName,
+ GlobalValidationContext globalContext) {
+ Environment envContent;
+ try {
+ envContent =
+ new YamlUtil().yamlToObject(globalContext.getFileContent(envFileName), Environment.class);
+ } catch (Exception exception) {
+ return null;
+ }
+ return envContent;
+ }
+
+ private HeatOrchestrationTemplate checkHeatOrchestrationPreCondition(String fileName,
+ GlobalValidationContext
+ globalContext) {
+ HeatOrchestrationTemplate heatOrchestrationTemplate;
+ try {
+ heatOrchestrationTemplate = new YamlUtil()
+ .yamlToObject(globalContext.getFileContent(fileName), HeatOrchestrationTemplate.class);
+
+ } catch (Exception exception) {
+ return null;
+ }
+ return heatOrchestrationTemplate;
+ }
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/HeatValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/HeatValidator.java
new file mode 100644
index 0000000000..c287394a54
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/HeatValidator.java
@@ -0,0 +1,469 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.validation.impl.validators;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.MapUtils;
+import org.openecomp.core.utilities.json.JsonUtil;
+import org.openecomp.core.utilities.yaml.YamlUtil;
+import org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder;
+import org.openecomp.core.validation.errors.Messages;
+import org.openecomp.core.validation.interfaces.Validator;
+import org.openecomp.core.validation.types.GlobalValidationContext;
+import org.openecomp.sdc.common.utils.AsdcCommon;
+import org.openecomp.sdc.datatypes.error.ErrorLevel;
+import org.openecomp.sdc.heat.datatypes.DefinedHeatParameterTypes;
+import org.openecomp.sdc.heat.datatypes.manifest.FileData;
+import org.openecomp.sdc.heat.datatypes.manifest.ManifestContent;
+import org.openecomp.sdc.heat.datatypes.model.Environment;
+import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate;
+import org.openecomp.sdc.heat.datatypes.model.HeatPseudoParameters;
+import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes;
+import org.openecomp.sdc.heat.datatypes.model.Output;
+import org.openecomp.sdc.heat.datatypes.model.Parameter;
+import org.openecomp.sdc.heat.datatypes.model.Resource;
+import org.openecomp.sdc.heat.datatypes.model.ResourceReferenceFunctions;
+import org.openecomp.sdc.heat.services.HeatStructureUtil;
+import org.openecomp.sdc.heat.services.manifest.ManifestUtil;
+import org.openecomp.sdc.validation.impl.util.HeatValidationService;
+import org.openecomp.sdc.validation.impl.util.ResourceValidationHeatValidator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.InputStream;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+
+public class HeatValidator implements Validator {
+
+ protected static Logger logger = LoggerFactory.getLogger(HeatValidator.class);
+
+ /* validation 9*/
+ private static void validateAllRequiredArtifactsExist(String fileName,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ Set<String> artifacts,
+ GlobalValidationContext globalContext) {
+ Collection<Resource> resourcesValues = heatOrchestrationTemplate.getResources() == null ? null
+ : heatOrchestrationTemplate.getResources().values();
+
+ if (CollectionUtils.isNotEmpty(resourcesValues)) {
+ for (Resource resource : resourcesValues) {
+ Collection<Object> properties =
+ resource.getProperties() == null ? null : resource.getProperties().values();
+ if (CollectionUtils.isNotEmpty(properties)) {
+ for (Object property : properties) {
+ if (property instanceof Map) {
+ Set<String> artifactNames = HeatStructureUtil
+ .getReferencedValuesByFunctionName(fileName,
+ ResourceReferenceFunctions.GET_FILE.getFunction(), property, globalContext);
+ artifacts.addAll(artifactNames);
+ HeatValidationService.checkArtifactsExistence(fileName, artifactNames, globalContext);
+ }
+ }
+ }
+ }
+ }
+
+
+ }
+
+ /* validation 14 */
+ private static void validateAllResourceReferencesExist(String fileName,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ GlobalValidationContext globalContext) {
+
+ Set<String> resourcesNames = heatOrchestrationTemplate.getResources() == null ? null
+ : heatOrchestrationTemplate.getResources().keySet();
+ Collection<Resource> resourcesValues = heatOrchestrationTemplate.getResources() == null ? null
+ : heatOrchestrationTemplate.getResources().values();
+ Collection<Output> outputsValues = heatOrchestrationTemplate.getOutputs() == null ? null
+ : heatOrchestrationTemplate.getOutputs().values();
+
+ HeatValidationService
+ .checkResourceExistenceFromResourcesMap(fileName, resourcesNames, resourcesValues,
+ globalContext);
+ HeatValidationService
+ .checkResourceExistenceFromResourcesMap(fileName, resourcesNames, outputsValues,
+ globalContext);
+
+ }
+
+ /* validation 16 */
+ private static void validateGetParamPointToParameter(String fileName,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ GlobalValidationContext globalContext) {
+ Set<String> parametersNames = heatOrchestrationTemplate.getParameters() == null ? null
+ : heatOrchestrationTemplate.getParameters().keySet();
+ Map<String, Resource> resourcesMap = heatOrchestrationTemplate.getResources();
+
+ if (CollectionUtils.isNotEmpty(parametersNames) && MapUtils.isNotEmpty(resourcesMap)) {
+ for (Map.Entry<String, Resource> resourceEntry : resourcesMap.entrySet()) {
+ Resource resource = resourceEntry.getValue();
+ Map<String, Object> properties = resource.getProperties();
+ if (MapUtils.isNotEmpty(properties)) {
+ Collection<Object> propertiesValues = properties.values();
+ if (CollectionUtils.isNotEmpty(propertiesValues)) {
+ for (Object propertyObject : propertiesValues) {
+ //Set<String> referencedParameterNames = HeatValidationService
+ // .getParameterNameFromGetParamMap(propertyObject);
+ Set<String> referencedParameterNames = HeatStructureUtil
+ .getReferencedValuesByFunctionName(fileName, "get_param", propertyObject,
+ globalContext);
+
+ validateReferenceParams(fileName, resourceEntry.getKey(), parametersNames,
+ referencedParameterNames, globalContext);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private static void validateReferenceParams(String fileName, String resourceName,
+ Set<String> parametersNamesFromFile,
+ Set<String> referencedParametersNames,
+ GlobalValidationContext globalContext) {
+
+ for (String parameterName : referencedParametersNames) {
+ if (!isHeatPseudoParameter(parameterName)
+ && !parametersNamesFromFile.contains(parameterName)) {
+ globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.REFERENCED_PARAMETER_NOT_FOUND.getErrorMessage(),
+ parameterName, resourceName));
+ }
+ }
+ }
+
+ private static boolean isHeatPseudoParameter(String parameterName) {
+ return HeatPseudoParameters.getPseudoParameterNames().contains(parameterName);
+ }
+
+ /* validation 18*/
+ private static void validateGetAttr(String fileName,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ GlobalValidationContext globalContext) {
+ Map<String, Output> outputMap;
+ outputMap = heatOrchestrationTemplate.getOutputs();
+
+ if (MapUtils.isNotEmpty(outputMap)) {
+ HeatValidationService.loopOverOutputMapAndValidateGetAttrFromNested(fileName, outputMap,
+ heatOrchestrationTemplate, globalContext);
+ }
+ }
+
+ /* validation 17 + */
+ private static void validateEnvFile(String fileName, String envFileName,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ GlobalValidationContext globalContext) {
+
+ Environment envContent;
+
+ if (!envFileName.contains(".env")) {
+ globalContext.addMessage(envFileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.WRONG_ENV_FILE_EXTENSION.getErrorMessage(),
+ envFileName));
+ }
+
+ envContent = HeatValidationService.validateEnvContent(fileName, envFileName, globalContext);
+ if (envContent != null) {
+ validateEnvContentIsSubSetOfHeatParameters(envFileName, envContent, globalContext,
+ heatOrchestrationTemplate);
+ validateEnvParametersMatchDefinedHeatParameterTypes(envFileName, envContent, globalContext,
+ heatOrchestrationTemplate);
+ }
+
+ }
+
+ private static void validateEnvContentIsSubSetOfHeatParameters(String envFile,
+ Environment envContent,
+ GlobalValidationContext globalContext,
+ HeatOrchestrationTemplate heatOrchestrationTemplate) {
+ Set<String> parametersNames = heatOrchestrationTemplate.getParameters() == null ? null
+ : heatOrchestrationTemplate.getParameters().keySet();
+
+ if (MapUtils.isNotEmpty(envContent.getParameters())) {
+ if (CollectionUtils.isNotEmpty(parametersNames)) {
+ for (Map.Entry<String, Object> envEntry : envContent.getParameters().entrySet()) {
+ String envParameter = envEntry.getKey();
+ if (!parametersNames.contains(envParameter)) {
+ globalContext.addMessage(envFile, ErrorLevel.ERROR, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(
+ Messages.ENV_INCLUDES_PARAMETER_NOT_IN_HEAT.getErrorMessage(), envFile,
+ envParameter));
+ }
+ }
+ } else {
+ for (Map.Entry<String, Object> envEntry : envContent.getParameters().entrySet()) {
+ globalContext.addMessage(envFile, ErrorLevel.ERROR, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.ENV_INCLUDES_PARAMETER_NOT_IN_HEAT.getErrorMessage(),
+ envFile, envEntry.getKey()));
+ }
+ }
+ }
+ }
+
+ private static void validateParameterDefaultTypeAlignWithType(String fileName,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ GlobalValidationContext globalContext) {
+ Map<String, Parameter> parametersMap = heatOrchestrationTemplate.getParameters() == null ? null
+ : heatOrchestrationTemplate.getParameters();
+
+ if (MapUtils.isNotEmpty(parametersMap)) {
+ for (Map.Entry<String, Parameter> parameterEntry : parametersMap.entrySet()) {
+ Parameter parameter = parameterEntry.getValue();
+ String parameterType = parameter.getType();
+ Object parameterDefault = parameter.get_default();
+ if (parameterDefault != null && parameterType != null) {
+ boolean isValueMatchDefault =
+ DefinedHeatParameterTypes.isValueIsFromGivenType(parameterDefault, parameterType);
+ if (!isValueMatchDefault) {
+ globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(
+ Messages.PARAMETER_DEFAULT_VALUE_NOT_ALIGN_WITH_TYPE.getErrorMessage(),
+ parameterEntry.getKey(), parameterType));
+ }
+ }
+ }
+ }
+ }
+
+ private static void validateEnvParametersMatchDefinedHeatParameterTypes(String envFile,
+ Environment envContent,
+ GlobalValidationContext globalContext,
+ HeatOrchestrationTemplate heatOrchestrationTemplate) {
+ Map<String, Parameter> heatParameters = heatOrchestrationTemplate.getParameters();
+
+ if (MapUtils.isNotEmpty(heatParameters) && MapUtils.isNotEmpty(envContent.getParameters())) {
+ for (Map.Entry<String, Object> envEntry : envContent.getParameters().entrySet()) {
+ String parameterName = envEntry.getKey();
+ Object parameterEnvValue = envEntry.getValue();
+ Parameter parameterFromHeatFile = heatParameters.get(parameterName);
+ if (parameterFromHeatFile != null) {
+ String parameterType = parameterFromHeatFile.getType();
+ if (!DefinedHeatParameterTypes.isEmptyValueInEnv(parameterEnvValue)
+ && !DefinedHeatParameterTypes.isValueIsFromGivenType(parameterEnvValue,
+ parameterType)) {
+ globalContext.addMessage(envFile, ErrorLevel.ERROR, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(
+ Messages.PARAMETER_ENV_VALUE_NOT_ALIGN_WITH_TYPE.getErrorMessage(),
+ parameterName));
+ }
+ }
+ }
+ }
+ }
+
+ @Override
+ public void validate(GlobalValidationContext globalContext) {
+
+ ManifestContent manifestContent;
+ try {
+ manifestContent = checkValidationPreCondition(globalContext);
+ } catch (Exception e0) {
+ return;
+ }
+ String baseFileName;
+ Map<String, FileData.Type> fileTypeMap = ManifestUtil.getFileTypeMap(manifestContent);
+ Map<String, FileData> fileEnvMap = ManifestUtil.getFileAndItsEnv(manifestContent);
+ Set<String> baseFiles = ManifestUtil.getBaseFiles(manifestContent);
+ Set<String> securityGroupsNamesFromBaseFileOutputs;
+ Set<String> artifacts = new HashSet<>();
+
+
+ baseFileName = CollectionUtils.isEmpty(baseFiles) ? null : baseFiles.iterator().next();
+ securityGroupsNamesFromBaseFileOutputs = baseFileName == null ? null
+ : checkForBaseFilePortsExistenceAndReturnSecurityGroupNamesFromOutputsIfNot(baseFileName,
+ globalContext);
+
+
+ globalContext.getFiles().stream()
+ .filter(fileName -> FileData.isHeatFile(fileTypeMap.get(fileName))).forEach(
+ fileName -> validate(fileName,
+ fileEnvMap.get(fileName) == null ? null : fileEnvMap.get(fileName).getFile(),
+ baseFileName == null ? null : baseFileName, artifacts,
+ securityGroupsNamesFromBaseFileOutputs, globalContext));
+
+
+ Set<String> manifestArtifacts = ManifestUtil.getArtifacts(manifestContent);
+
+ globalContext.getFiles().stream()
+ .filter(fileName -> manifestArtifacts.contains(fileName) && !artifacts.contains(fileName))
+ .forEach(fileName -> globalContext.addMessage(fileName, ErrorLevel.WARNING,
+ Messages.ARTIFACT_FILE_NOT_REFERENCED.getErrorMessage()));
+
+ ResourceValidationHeatValidator
+ .handleNotEmptyResourceNamesList(baseFileName, securityGroupsNamesFromBaseFileOutputs,
+ "SecurityGroup", globalContext);
+
+ }
+
+ private void validate(String fileName, String envFileName, String baseFileName,
+ Set<String> artifacts, Set<String> securityGroupsNamesFromBaseFileOutputs,
+ GlobalValidationContext globalContext) {
+ HeatOrchestrationTemplate heatOrchestrationTemplate =
+ checkHeatOrchestrationPreCondition(fileName, globalContext);
+
+
+ if (heatOrchestrationTemplate != null) {
+ if (!(fileName.contains(".yaml") || fileName.contains(".yml"))) {
+ globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.WRONG_HEAT_FILE_EXTENSION.getErrorMessage(),
+ fileName));
+ }
+
+ validateHeatBaseStructure(fileName, heatOrchestrationTemplate, globalContext);
+
+ ResourceValidationHeatValidator
+ .validateResourceType(fileName, baseFileName, securityGroupsNamesFromBaseFileOutputs,
+ heatOrchestrationTemplate, globalContext);
+ validateParameterDefaultTypeAlignWithType(fileName, heatOrchestrationTemplate, globalContext);
+ validateAllResourceReferencesExist(fileName, heatOrchestrationTemplate, globalContext);
+ validateGetParamPointToParameter(fileName, heatOrchestrationTemplate, globalContext);
+ validateGetAttr(fileName, heatOrchestrationTemplate, globalContext);
+ validateAllRequiredArtifactsExist(fileName, heatOrchestrationTemplate, artifacts,
+ globalContext);
+
+ if (envFileName != null) {
+ validateEnvFile(fileName, envFileName, heatOrchestrationTemplate, globalContext);
+ }
+ }
+ }
+
+ private void validateHeatBaseStructure(String fileName,
+ HeatOrchestrationTemplate heatOrchestrationTemplate,
+ GlobalValidationContext globalContext) {
+ if (heatOrchestrationTemplate.getHeat_template_version() == null) {
+ globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.INVALID_HEAT_FORMAT_REASON.getErrorMessage(),
+ "missing template version"));
+ }
+ if (heatOrchestrationTemplate.getResources() == null
+ || heatOrchestrationTemplate.getResources().size() == 0) {
+ globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.INVALID_HEAT_FORMAT_REASON.getErrorMessage(),
+ "heat file must have minimum one resource"));
+ }
+ }
+
+ protected ManifestContent checkValidationPreCondition(GlobalValidationContext globalContext) {
+ InputStream manifest = globalContext.getFileContent(AsdcCommon.MANIFEST_NAME);
+ if (manifest == null) {
+ throw new RuntimeException("Can't load manifest file for Heat Validator");
+ }
+ ManifestContent manifestContent;
+ try {
+ manifestContent = JsonUtil.json2Object(manifest, ManifestContent.class);
+ } catch (Exception e0) {
+ throw new RuntimeException("Can't load manifest file for Heat Validator");
+ }
+
+ return manifestContent;
+ }
+
+
+ private HeatOrchestrationTemplate checkHeatOrchestrationPreCondition(String fileName,
+ GlobalValidationContext globalContext) {
+ HeatOrchestrationTemplate heatOrchestrationTemplate;
+ try {
+ heatOrchestrationTemplate = new YamlUtil()
+ .yamlToObject(globalContext.getFileContent(fileName), HeatOrchestrationTemplate.class);
+ } catch (Exception e0) {
+ globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.INVALID_HEAT_FORMAT_REASON.getErrorMessage(),
+ getParserExceptionReason(e0)));
+ return null;
+ }
+
+ return heatOrchestrationTemplate;
+ }
+
+
+ private Set<String> checkForBaseFilePortsExistenceAndReturnSecurityGroupNamesFromOutputsIfNot(
+ String baseFileName, GlobalValidationContext globalContext) {
+ Set<String> securityGroupsNamesFromOutputsMap = new HashSet<>();
+ HeatOrchestrationTemplate heatOrchestrationTemplate =
+ checkHeatOrchestrationPreCondition(baseFileName, globalContext);
+
+ if (heatOrchestrationTemplate != null) {
+ Map<String, Resource> resourceMap = heatOrchestrationTemplate.getResources();
+ if (!isPortResourceExistInBaseFile(resourceMap)) {
+ getSecurityGroupsReferencedResourcesFromOutputs(securityGroupsNamesFromOutputsMap,
+ heatOrchestrationTemplate.getOutputs(), resourceMap);
+ }
+ }
+
+ return securityGroupsNamesFromOutputsMap;
+ }
+
+
+ @SuppressWarnings("unchecked")
+ private void getSecurityGroupsReferencedResourcesFromOutputs(
+ Set<String> securityGroupsNamesFromOutputsMap, Map<String, Output> outputMap,
+ Map<String, Resource> resourceMap) {
+ if (MapUtils.isNotEmpty(outputMap)) {
+ for (Map.Entry<String, Output> outputEntry : outputMap.entrySet()) {
+ Object outputValue = outputEntry.getValue().getValue();
+ if (Objects.nonNull(outputValue) && outputValue instanceof Map) {
+ String resourceName = (String) ((Map) outputValue)
+ .get(ResourceReferenceFunctions.GET_RESOURCE.getFunction());
+ if (Objects.nonNull(resourceName)) {
+ Resource resource = resourceMap.get(resourceName);
+ if (Objects.nonNull(resource) && resource.getType().equals(
+ HeatResourcesTypes.NEUTRON_SECURITY_GROUP_RESOURCE_TYPE.getHeatResource())) {
+ securityGroupsNamesFromOutputsMap.add(outputEntry.getKey());
+ }
+ }
+ }
+ }
+ }
+ }
+
+
+ private boolean isPortResourceExistInBaseFile(Map<String, Resource> resourceMap) {
+ for (Map.Entry<String, Resource> resourceEntry : resourceMap.entrySet()) {
+ if (resourceEntry.getValue().getType()
+ .equals(HeatResourcesTypes.NEUTRON_PORT_RESOURCE_TYPE.getHeatResource())) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+
+ private String getParserExceptionReason(Exception e0) {
+ String reason;
+
+ if (e0.getCause() != null && e0.getCause().getCause() != null) {
+ reason = e0.getCause().getCause().getMessage();
+ } else if (e0.getCause() != null) {
+ reason = e0.getCause().getMessage();
+ } else {
+ reason = Messages.GENERAL_HEAT_PARSER_ERROR.getErrorMessage();
+ }
+ return reason;
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ManifestValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ManifestValidator.java
new file mode 100644
index 0000000000..4ce40f0007
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ManifestValidator.java
@@ -0,0 +1,153 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.validation.impl.validators;
+
+import org.openecomp.core.utilities.json.JsonUtil;
+import org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder;
+import org.openecomp.core.validation.errors.Messages;
+import org.openecomp.core.validation.interfaces.Validator;
+import org.openecomp.core.validation.types.GlobalValidationContext;
+import org.openecomp.sdc.common.utils.AsdcCommon;
+import org.openecomp.sdc.datatypes.error.ErrorLevel;
+import org.openecomp.sdc.heat.datatypes.manifest.FileData;
+import org.openecomp.sdc.heat.datatypes.manifest.ManifestContent;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+public class ManifestValidator implements Validator {
+
+ private static Logger logger = LoggerFactory.getLogger(YamlValidator.class);
+
+
+ @Override
+ public void validate(GlobalValidationContext globalContext) {
+
+
+ InputStream content = globalContext.getFileContent(AsdcCommon.MANIFEST_NAME);
+ ManifestContent manifestContent;
+
+ try {
+ manifestContent = JsonUtil.json2Object(content, ManifestContent.class);
+ } catch (RuntimeException re) {
+ globalContext.addMessage(AsdcCommon.MANIFEST_NAME, ErrorLevel.ERROR,
+ Messages.INVALID_MANIFEST_FILE.getErrorMessage());
+ return;
+ }
+
+ List<String> manifestFiles = getManifestFileList(manifestContent, globalContext);
+ manifestFiles.stream().filter(name ->
+ !globalContext.getFileContextMap().containsKey(name)
+ ).forEach(name -> globalContext
+ .addMessage(name, ErrorLevel.ERROR, Messages.MISSING_FILE_IN_ZIP.getErrorMessage()));
+
+ globalContext.getFileContextMap().keySet().stream().filter(name ->
+ !manifestFiles.contains(name) && !AsdcCommon.MANIFEST_NAME.equals(name)
+ ).forEach(name ->
+ globalContext.addMessage(name, ErrorLevel.WARNING,
+ Messages.MISSING_FILE_IN_MANIFEST.getErrorMessage())
+ );
+
+ }
+
+ private List<String> getManifestFileList(ManifestContent manifestContent,
+ GlobalValidationContext context) {
+ ManifestScanner manifestScanner = new ManifestScanner();
+ manifestScanner.init(context);
+ manifestScanner.scan(null, manifestContent.getData(), context);
+ return manifestScanner.getFileList();
+ }
+
+
+ private class ManifestScanner {
+ private GlobalValidationContext globalValidationContext;
+ private List<String> fileList;
+
+ public void init(GlobalValidationContext globalValidationContext) {
+ this.globalValidationContext = globalValidationContext;
+ this.fileList = new ArrayList<>();
+ }
+
+
+ public void scan(FileData fileData, List<FileData> data,
+ GlobalValidationContext globalContext) {
+ if (fileData == null) {
+ for (FileData childFileData : data) {
+ if (childFileData.getType() != null
+ && childFileData.getType().equals(FileData.Type.HEAT_ENV)) {
+ globalContext.addMessage(childFileData.getFile(), ErrorLevel.ERROR,
+ ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.ENV_NOT_ASSOCIATED_TO_HEAT.getErrorMessage()));
+ }
+ }
+ }
+ if (fileData != null) {
+ fileList.add(fileData.getFile());
+ validateFileTypeVsFileName(fileData);
+ }
+ if (data == null) {
+ return;
+ }
+ data.stream().forEach(chileFileData -> {
+ scan(chileFileData, chileFileData.getData(), globalContext);
+ });
+ }
+
+
+ public List<String> getFileList() {
+ return this.fileList;
+ }
+
+ private void validateFileTypeVsFileName(FileData fileData) {
+ String fileName = fileData.getFile();
+ if (fileName == null) {
+ this.globalValidationContext.addMessage(AsdcCommon.MANIFEST_NAME, ErrorLevel.ERROR,
+ Messages.MISSING_FILE_NAME_IN_MANIFEST.getErrorMessage());
+
+ }
+ FileData.Type type = fileData.getType();
+ if (type == null) {
+ this.globalValidationContext
+ .addMessage(fileName, ErrorLevel.ERROR, Messages.INVALID_FILE_TYPE.getErrorMessage());
+ } else if (type.equals(FileData.Type.HEAT_NET) || type.equals(FileData.Type.HEAT_VOL)
+ || type.equals(FileData.Type.HEAT)) {
+ if (fileName != null && !fileName.endsWith(".yml") && !fileName.endsWith(".yaml")) {
+ this.globalValidationContext.addMessage(fileName, ErrorLevel.ERROR,
+ ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.WRONG_HEAT_FILE_EXTENSION.getErrorMessage(),
+ fileName));
+ }
+ } else if (type.equals(FileData.Type.HEAT_ENV)) {
+ if (fileName != null && !fileName.endsWith(".env")) {
+ this.globalValidationContext.addMessage(fileName, ErrorLevel.ERROR,
+ ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.WRONG_ENV_FILE_EXTENSION.getErrorMessage(),
+ fileName));
+ }
+ }
+ }
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/YamlValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/YamlValidator.java
new file mode 100644
index 0000000000..4d05b2b066
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/YamlValidator.java
@@ -0,0 +1,97 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.validation.impl.validators;
+
+import org.openecomp.core.utilities.yaml.YamlUtil;
+import org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder;
+import org.openecomp.core.validation.errors.Messages;
+import org.openecomp.core.validation.interfaces.Validator;
+import org.openecomp.core.validation.types.GlobalValidationContext;
+import org.openecomp.sdc.datatypes.error.ErrorLevel;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.yaml.snakeyaml.error.MarkedYAMLException;
+import org.yaml.snakeyaml.parser.ParserException;
+
+import java.io.InputStream;
+import java.util.Collection;
+import java.util.Map;
+
+public class YamlValidator implements Validator {
+
+ private static final Logger logger = LoggerFactory.getLogger(YamlValidator.class);
+
+ @Override
+ public void validate(GlobalValidationContext globalContext) {
+
+ Collection<String> files = globalContext.files(
+ (fileName, globalValidationContext) -> (fileName.endsWith(".yaml")
+ || fileName.endsWith(".yml") || fileName.endsWith(".env")));
+
+ files.stream().forEach(fileName -> validate(fileName, globalContext));
+ }
+
+ private void validate(String fileName, GlobalValidationContext globalContext) {
+ InputStream rowContent = globalContext.getFileContent(fileName);
+ if (rowContent == null) {
+ globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.INVALID_YAML_FORMAT_REASON.getErrorMessage(),
+ Messages.EMPTY_YAML_FILE.getErrorMessage()));
+ return; /* no need to continue validation */
+ }
+
+ try {
+ convert(rowContent, Map.class);
+ } catch (Exception exception) {
+
+ globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.INVALID_YAML_FORMAT_REASON.getErrorMessage(),
+ getParserExceptionReason(exception)));
+ logger.error("Exception in yaml parser. message:" + exception.getMessage());
+ }
+ }
+
+ private String getParserExceptionReason(Exception exception) {
+ String reason = null;
+
+ if (exception.getCause() instanceof MarkedYAMLException) {
+ if (exception.getCause() != null) {
+ if (exception.getCause().getCause() instanceof ParserException) {
+ reason = exception.getCause().getCause().getMessage();
+ } else {
+ reason = exception.getCause().getMessage();
+ }
+ }
+ } else if (exception instanceof MarkedYAMLException) {
+
+ reason = exception.getMessage();
+
+ } else {
+ reason = Messages.GENERAL_YAML_PARSER_ERROR.getErrorMessage();
+ }
+ return reason;
+ }
+
+
+ private <T> T convert(InputStream content, Class<T> type) {
+ return new YamlUtil().yamlToObject(content, type);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/ErrorMessagesTest.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/ErrorMessagesTest.java
new file mode 100644
index 0000000000..d762689049
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/ErrorMessagesTest.java
@@ -0,0 +1,25 @@
+package org.openecomp.sdc.validation.impl.validators;
+
+import org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder;
+import org.openecomp.core.validation.errors.Messages;
+import org.junit.Test;
+import org.testng.Assert;
+
+public class ErrorMessagesTest {
+
+ @Test
+ public void testErrorFormatWithOneParam() {
+ String error1 = ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.MISSING_FILE_NAME_IN_MANIFEST.getErrorMessage(),
+ "file.yaml");
+ Assert.assertNotNull(error1);
+ }
+
+ @Test
+ public void testErrorFormatWithTwoParams() {
+ String error1 = ErrorMessagesFormatBuilder
+ .getErrorWithParameters(Messages.REFERENCED_PARAMETER_NOT_FOUND.getErrorMessage(), "param",
+ "res");
+ Assert.assertNotNull(error1);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/ValidatorBaseTest.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/ValidatorBaseTest.java
new file mode 100644
index 0000000000..f9c5bf423b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/ValidatorBaseTest.java
@@ -0,0 +1,84 @@
+package org.openecomp.sdc.validation.impl.validators;
+
+import org.openecomp.core.utilities.file.FileUtils;
+import org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder;
+import org.openecomp.core.validation.interfaces.Validator;
+import org.openecomp.core.validation.types.GlobalValidationContext;
+import org.openecomp.core.validation.types.MessageContainer;
+import org.testng.Assert;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+public abstract class ValidatorBaseTest {
+
+ private static GlobalValidationContext createGlobalContextFromPath(String path) {
+ GlobalValidationContext globalValidationContext = new GlobalValidationContext();
+ Map<String, byte[]> contentMap = getContentMapByPath(path);
+ if (contentMap == null) {
+ return null;
+ }
+ contentMap.entrySet().stream()
+ .forEach(entry -> globalValidationContext.addFileContext(entry.getKey(), entry.getValue()));
+
+ return globalValidationContext;
+ }
+
+
+ // New test base implementation
+
+ private static Map<String, byte[]> getContentMapByPath(String path) {
+ Map<String, byte[]> contentMap = new HashMap<>();
+ byte[] fileContent;
+ FileInputStream fis;
+ URL url = ValidatorBaseTest.class.getResource(path);
+ File pathFile = new File(url.getFile());
+ File[] files;
+ if (pathFile.isDirectory()) {
+ files = pathFile.listFiles();
+ } else {
+ files = new File[]{pathFile};
+ }
+
+ if (files == null || files.length == 0) {
+ return null;
+ }
+
+ for (File file : files) {
+ try {
+ fis = new FileInputStream(file);
+ fileContent = FileUtils.toByteArray(fis);
+ contentMap.put(file.getName(), fileContent);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ return contentMap;
+ }
+
+ public abstract Map<String, MessageContainer> runValidation(String path);
+
+ protected Map<String, MessageContainer> testValidator(Validator validator, String path) {
+
+ GlobalValidationContext globalValidationContext = createGlobalContextFromPath(path);
+ validator.validate(globalValidationContext);
+
+ assert globalValidationContext != null;
+ return globalValidationContext.getContextMessageContainers();
+
+
+ }
+
+ protected void validateErrorMessage(String actualMessage, String expected, String... params) {
+ Assert.assertEquals(actualMessage.replace("\n", "").replace("\r", ""),
+ ErrorMessagesFormatBuilder.getErrorWithParameters(expected, params).replace("\n", "")
+ .replace("\r", ""));
+
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/validators/EcompGuideLineValidatorTest.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/validators/EcompGuideLineValidatorTest.java
new file mode 100644
index 0000000000..44e9a3a580
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/validators/EcompGuideLineValidatorTest.java
@@ -0,0 +1,281 @@
+package org.openecomp.sdc.validation.impl.validators.validators;
+
+import org.openecomp.sdc.validation.impl.validators.EcompGuideLineValidator;
+
+import org.openecomp.sdc.validation.impl.validators.ValidatorBaseTest;
+import org.openecomp.core.validation.types.MessageContainer;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+import java.util.Map;
+
+public class EcompGuideLineValidatorTest extends ValidatorBaseTest {
+
+ @Test
+ public void testMissingBaseHeat() {
+ Map<String, MessageContainer> messages =
+ runValidation("/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+ Assert.assertEquals(messages.get("MANIFEST.json").getErrorMessageList().size(), 1);
+ Assert.assertEquals(messages.get("MANIFEST.json").getErrorMessageList().get(0).getMessage(),
+ "Missing Base HEAT. Pay attention that without Base HEAT, there will be no shared resources");
+ }
+
+ @Test
+ public void testMultiBaseHeat() {
+ Map<String, MessageContainer> messages =
+ runValidation("/openecomp/org/validation/validators/ecompGuideLineValidator/multiBaseHeat/");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+ Assert.assertEquals(messages.get("MANIFEST.json").getErrorMessageList().size(), 1);
+ Assert.assertEquals(messages.get("MANIFEST.json").getErrorMessageList().get(0).getMessage(),
+ "Multi Base HEAT. Expected only one. Files [second.yaml,first.yaml].");
+ }
+
+ @Test
+ public void testBaseHeatExposeVolume() {
+ Map<String, MessageContainer> messages = runValidation(
+ "/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 0);
+
+ messages = runValidation(
+ "/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+ Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().size(), 1);
+ Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(0).getMessage(),
+ "Resource is not defined as output and thus cannot be Shared. resource id - volume_expose");
+ }
+
+ @Test
+ public void testBaseHeatExposeServerGroup() {
+ Map<String, MessageContainer> messages = runValidation(
+ "/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 0);
+
+ messages = runValidation(
+ "/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+ Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().size(), 1);
+ Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(0).getMessage(),
+ "Resource is not defined as output and thus cannot be Shared. resource id - ServerGroup_expose");
+ }
+
+ @Test
+ public void testBaseHeatExposeSecurityGroup() {
+ Map<String, MessageContainer> messages = runValidation(
+ "/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 0);
+
+ messages = runValidation(
+ "/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+ Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().size(), 1);
+ Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(0).getMessage(),
+ "Resource is not defined as output and thus cannot be Shared. resource id - SecurityGroup_expose");
+ }
+
+
+ @Test
+ public void testBaseHeatExposeNetwork() {
+ Map<String, MessageContainer> messages = runValidation(
+ "/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 0);
+
+ messages = runValidation(
+ "/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+ Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().size(), 1);
+ Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(0).getMessage(),
+ "Resource is not defined as output and thus cannot be Shared. resource id - SecurityGroup_expose");
+ }
+
+ @Test
+ public void testBaseHeatExposeNetworkAndVolume() {
+ Map<String, MessageContainer> messages = runValidation(
+ "/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 0);
+
+ messages = runValidation(
+ "/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+ Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().size(), 2);
+ Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(0).getMessage(),
+ "Resource is not defined as output and thus cannot be Shared. resource id - volume_expose");
+ Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(1).getMessage(),
+ "Resource is not defined as output and thus cannot be Shared. resource id - net_expose");
+ }
+
+ @Test
+ public void testNovaResourceNetworkUniqueRole() {
+ Map<String, MessageContainer> messages = runValidation(
+ "/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 0);
+
+ messages = runValidation(
+ "/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+ Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().size(), 1);
+ Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(0).getMessage(),
+ "A resource is connected twice to the same network role Resource ID [FSB2] Network Role [Internal1].");
+ }
+
+ @Test
+ public void testHeatVolumeExpose() {
+ Map<String, MessageContainer> messages = runValidation(
+ "/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 0);
+
+ messages = runValidation(
+ "/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+ Assert.assertEquals(messages.get("firstVol.yaml").getErrorMessageList().size(), 1);
+ Assert.assertEquals(messages.get("firstVol.yaml").getErrorMessageList().get(0).getMessage(),
+ "Volume is not defined as output and thus cannot be attached volume_expose");
+
+ }
+
+ @Test
+ public void testHeatPortNetworkNamingConvention() {
+ Map<String, MessageContainer> messages = runValidation(
+ "/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 0);
+
+ messages = runValidation(
+ "/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+ Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().size(), 3);
+ Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(0).getMessage(),
+ "Network Parameter Name not aligned with Guidelines Parameter Name [not_valid_network_name] Resource ID [port_resource]");
+ }
+
+ @Test
+ public void testHeatNovaServerMetaDataValidation() {
+ Map<String, MessageContainer> messages = runValidation(
+ "/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 0);
+
+ messages = runValidation(
+ "/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+ Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().size(), 1);
+ Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(0).getMessage(),
+ "Missing VNF_ID Resource id [FSB2]");
+ }
+
+ @Test
+ public void testNeutronFixedIpName() {
+ Map<String, MessageContainer> messages = runValidation(
+ "/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 0);
+
+ messages = runValidation(
+ "/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+ Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().size(), 3);
+ Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(0).getMessage(),
+ "Fixed_IPS not aligned with Guidelines, Resource ID [port_resource_0]");
+ Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(1).getMessage(),
+ "Fixed_IPS not aligned with Guidelines, Resource ID [port_resource_1]");
+ Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(2).getMessage(),
+ "Fixed_IPS not aligned with Guidelines, Resource ID [port_resource_2]");
+ }
+
+
+ @Test
+ public void testNovaServerName() {
+ Map<String, MessageContainer> messages = runValidation(
+ "/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 0);
+
+ messages = runValidation(
+ "/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+ Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().size(), 2);
+ Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(0).getMessage(),
+ "Server Name not aligned with Guidelines, Resource ID [FSB2]");
+ }
+
+ @Test
+ public void testAvailabilityZoneName() {
+ Map<String, MessageContainer> messages = runValidation(
+ "/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 0);
+
+ messages = runValidation(
+ "/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+ Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().size(), 3);
+ Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(0).getMessage(),
+ "Server Availability Zone not aligned with Guidelines, Resource ID [FSB2]");
+ Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(1).getMessage(),
+ "Server Availability Zone not aligned with Guidelines, Resource ID [FSB3]");
+ }
+
+ @Test
+ public void testFloatingIpResourceType() {
+ Map<String, MessageContainer> messages = runValidation(
+ "/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 0);
+
+
+ messages = runValidation(
+ "/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+ Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().size(), 1);
+ Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(0).getMessage(),
+ "OS::Neutron::FloatingIP is in use, Resource ID [FSB2]");
+ }
+
+ @Test
+ public void testImageAndFlavorNames() {
+ Map<String, MessageContainer> messages = runValidation(
+ "/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 0);
+
+ messages = runValidation(
+ "/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+ Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().size(), 2);
+ Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(0).getMessage(),
+ "Wrong flavor name format in NOVA Server, Resource ID [FSB2]");
+ Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(1).getMessage(),
+ "Wrong image name format in NOVA Server, Resource ID [FSB3]");
+ }
+
+
+ @Override
+ public Map<String, MessageContainer> runValidation(String path) {
+ EcompGuideLineValidator validator = new EcompGuideLineValidator();
+ return testValidator(validator, path);
+ }
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/validators/EcompNamingConventionTest.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/validators/EcompNamingConventionTest.java
new file mode 100644
index 0000000000..e4203945aa
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/validators/EcompNamingConventionTest.java
@@ -0,0 +1,104 @@
+package org.openecomp.sdc.validation.impl.validators.validators;
+
+import org.openecomp.sdc.validation.impl.validators.EcompGuideLineValidator;
+import org.openecomp.sdc.validation.impl.validators.ValidatorBaseTest;
+import org.openecomp.core.validation.types.MessageContainer;
+
+import java.io.IOException;
+import java.util.Map;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+public class EcompNamingConventionTest extends ValidatorBaseTest {
+
+ @Test
+ public void testNeutronFixedIpName() throws IOException {
+ Map<String, MessageContainer> messages = runValidation(
+ "/openecomp/org/validation/validators/ecomp_naming_convention/neutron_port_fixed_ip_name/input");
+
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 2);
+
+ Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().size(), 3);
+ Assert.assertEquals(
+ messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(),
+ "Fixed_IPS not aligned with Guidelines, Resource ID [fixed_ip_illegal_name_1]");
+ Assert.assertEquals(
+ messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(1).getMessage(),
+ "Fixed_IPS not aligned with Guidelines, Resource ID [fixed_ip_illegal_name_2]");
+ Assert.assertEquals(
+ messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(2).getMessage(),
+ "Fixed_IPS not aligned with Guidelines, Resource ID [fixed_ip_illegal_name_3]");
+ }
+
+
+ @Test
+ public void testNovaServerName() throws IOException {
+ Map<String, MessageContainer> messages = runValidation(
+ "/openecomp/org/validation/validators/ecomp_naming_convention/nova_server_name/input");
+
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 2);
+
+ Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().size(), 6);
+ Assert.assertEquals(
+ messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(),
+ "Server Name not aligned with Guidelines, Resource ID [nova_server_ilegal_name_1]");
+ Assert.assertEquals(
+ messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(1).getMessage(),
+ "Server Name not aligned with Guidelines, Resource ID [nova_server_ilegal_name_2]");
+ Assert.assertEquals(
+ messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(2).getMessage(),
+ "Server Name not aligned with Guidelines, Resource ID [nova_server_ilegal_name_3]");
+ Assert.assertEquals(
+ messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(3).getMessage(),
+ "Server Name not aligned with Guidelines, Resource ID [nova_server_ilegal_name_4]");
+ Assert.assertEquals(
+ messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(4).getMessage(),
+ "Server Name not aligned with Guidelines, Resource ID [nova_server_ilegal_name_5]");
+ Assert.assertEquals(
+ messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(5).getMessage(),
+ "Missing get_param in nova server name, Resource Id [nova_server_ilegal_name_6]");
+ }
+
+
+ @Test
+ public void testAvailabilityZoneName() throws IOException {
+ Map<String, MessageContainer> messages = runValidation(
+ "/openecomp/org/validation/validators/ecomp_naming_convention/availability_zone_name/input");
+
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 2);
+
+ Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().size(), 2);
+ Assert.assertEquals(
+ messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(),
+ "Server Availability Zone not aligned with Guidelines, Resource ID [availability_zone_illegal_name_1]");
+ Assert.assertEquals(
+ messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(1).getMessage(),
+ "Server Availability Zone not aligned with Guidelines, Resource ID [availability_zone_illegal_name_2]");
+ }
+
+
+ @Test
+ public void testFloatingIpResourceType() throws IOException {
+ Map<String, MessageContainer> messages = runValidation(
+ "/openecomp/org/validation/validators/ecomp_naming_convention/floating_ip_resource_type/input");
+
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 2);
+
+ Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().size(), 1);
+ Assert.assertEquals(
+ messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(),
+ "OS::Neutron::FloatingIP is in use, Resource ID [floating_ip_type]");
+ }
+
+
+ @Override
+ public Map<String, MessageContainer> runValidation(String path) {
+ EcompGuideLineValidator ecompGuideLineValidator = new EcompGuideLineValidator();
+ return testValidator(ecompGuideLineValidator, path);
+ }
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/validators/HeatValidatorTest.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/validators/HeatValidatorTest.java
new file mode 100644
index 0000000000..9ff375c1a3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/validators/HeatValidatorTest.java
@@ -0,0 +1,356 @@
+package org.openecomp.sdc.validation.impl.validators.validators;
+
+import org.openecomp.sdc.validation.impl.validators.HeatValidator;
+import org.openecomp.sdc.validation.impl.validators.ValidatorBaseTest;
+import org.openecomp.core.validation.types.MessageContainer;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+import java.io.IOException;
+import java.util.Map;
+
+public class HeatValidatorTest extends ValidatorBaseTest {
+
+
+ @Test
+ public void testInvalidHeatFormat(){
+ Map<String, MessageContainer> messages = runValidation("/openecomp/org/validation/validators/heat_validator/invalid_heat_format/negative_test/input");
+
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+
+ Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().size(), 1);
+ Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "Invalid HEAT format problem - [Cannot create property=kuku for JavaBean=Resource{type='null', properties=null, metadata=null, depends_on=null, update_policy='null', deletion_policy='null'}\n" +
+ " in 'reader', line 25, column 5:\n" +
+ " kuku: kuku\n" +
+ " ^\n" +
+ "Unable to find property 'kuku' on class: org.openecomp.sdc.heat.datatypes.model.Resource\n" +
+ " in 'reader', line 25, column 11:\n" +
+ " kuku: kuku\n" +
+ " ^\n" +
+ "]");
+ }
+
+
+ @Test
+ public void testResourcesReferencesExistInHeat() throws IOException {
+ Map<String, MessageContainer> messages = runValidation("/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/negative_test/input");
+
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+
+ Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().size(), 2);
+ Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "Referenced resource - not_existing_resource not found");
+ Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(1).getMessage(), "invalid get_resource syntax is in use - null , get_resource function should get the resource id of the referenced resource");
+ }
+
+
+ @Test
+ public void testGetResourceValueIsValid(){
+ Map<String, MessageContainer> messages = runValidation("/openecomp/org/validation/validators/heat_validator/get_resource_value_valid/negative_test/input");
+
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+
+ Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().size(), 3);
+ Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "invalid get_resource syntax is in use - [param_1, param_2] , get_resource function should get the resource id of the referenced resource");
+ Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(1).getMessage(), "invalid get_resource syntax is in use - {get_param=param_1} , get_resource function should get the resource id of the referenced resource");
+ Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(2).getMessage(), "invalid get_resource syntax is in use - null , get_resource function should get the resource id of the referenced resource");
+ }
+
+ @Test
+ public void testTwoResourcesDoesNotHoldSameId() throws IOException {
+ Map<String, MessageContainer> messages = runValidation("/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/positive_test/input");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 0);
+ }
+
+ @Test
+ public void negativeTestGetParamPointToExistingParameter() throws IOException {
+ Map<String, MessageContainer> messages = runValidation("/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/negative_test/input");
+
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+
+ Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().size(), 1);
+ Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "Referenced parameter - not_existing_param_1 - not found, used in resource - server_pcrf_psm_001");
+ }
+
+ @Test
+ public void testGetAttrFromNested() throws IOException {
+ Map<String, MessageContainer> messages = runValidation("/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/negative_test/input");
+
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+
+ Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().size(), 1);
+ Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "get_attr attribute not found - nested_output in resource server_pcrf_psm_001");
+ }
+
+ @Test
+ public void testPropertiesMatchNestedParameters() throws IOException {
+ Map<String, MessageContainer> messages = runValidation("/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/negative_test/input");
+
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+
+ Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().size(), 1);
+ Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "Referenced parameter not found in nested file - nested-pps_v1.0.yaml, resource name - server_pcrf_pps_001, parameter name - parameter_not_existing_in_nested");
+ }
+
+ @Test
+ public void testNovaPropertiesHasAssignedValue() throws IOException {
+ Map<String, MessageContainer> messages = runValidation("/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/negative_test/input");
+
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+
+ Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().size(), 1);
+ Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "Missing both Image and Flavor in NOVA Server - nova_server_resource_missing_both");
+ }
+
+ @Test
+ public void testNoLoopsNesting() throws IOException {
+ Map<String, MessageContainer> messages = runValidation("/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input");
+
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 4);
+
+ Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().size(), 2);
+ Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "A resource has an invalid or unsupported type - null, Resource ID [server_pcrf_psm_002]");
+ Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(1).getMessage(), "Nested files loop - [hot-nimbus-psm_v1.0.yaml -- nested-psm_v1.0.yaml -- nested-points-to-hot-nimbus-psm.yaml -- hot-nimbus-psm_v1.0.yaml]");
+
+ Assert.assertEquals(messages.get("nested-points-to-hot-nimbus-psm.yaml").getErrorMessageList().size(), 2);
+ Assert.assertEquals(messages.get("nested-points-to-hot-nimbus-psm.yaml").getErrorMessageList().get(0).getMessage(), "Nested files loop - [nested-points-to-hot-nimbus-psm.yaml -- hot-nimbus-psm_v1.0.yaml -- nested-psm_v1.0.yaml -- nested-points-to-hot-nimbus-psm.yaml]");
+ Assert.assertEquals(messages.get("nested-points-to-hot-nimbus-psm.yaml").getErrorMessageList().get(1).getMessage(), "Nested files loop - [nested-points-to-hot-nimbus-psm.yaml -- nested-psm_v1.0.yaml -- nested-points-to-hot-nimbus-psm.yaml]");
+
+ Assert.assertEquals(messages.get("yaml-point-to-itself.yaml").getErrorMessageList().size(), 1);
+ Assert.assertEquals(messages.get("yaml-point-to-itself.yaml").getErrorMessageList().get(0).getMessage(), "Nested files loop - [yaml-point-to-itself.yaml -- yaml-point-to-itself.yaml]");
+
+ Assert.assertEquals(messages.get("nested-psm_v1.0.yaml").getErrorMessageList().size(), 1);
+ Assert.assertEquals(messages.get("nested-psm_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "Nested files loop - [nested-psm_v1.0.yaml -- nested-points-to-hot-nimbus-psm.yaml -- hot-nimbus-psm_v1.0.yaml -- nested-psm_v1.0.yaml]");
+ }
+
+ @Test
+ public void testOnlyOneNovaPointsToOnePort() throws IOException {
+ Map<String, MessageContainer> messages = runValidation("/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/negative_test/input");
+
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+
+ Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().size(), 1);
+ Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "Resource Port oam1_int_port exceed allowed relations from NovaServer");
+ }
+
+ @Test
+ public void testServerGroupsPointedByServersDefinedCorrectly() throws IOException {
+ Map<String, MessageContainer> messages = runValidation("/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/negative_test/input");
+
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+
+ Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().size(), 3);
+ Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "Missing server group definition - BE_Affinity_2, nova_server_1");
+ Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(1).getMessage(), "Missing server group definition - BE_Affinity_2, nova_server_2");
+ Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(2).getMessage(), "Referenced resource - BE_Affinity_1 not found");
+ }
+
+
+ @Test
+ public void testPolicyIsAffinityOrAntiAffinity() throws IOException {
+ Map<String, MessageContainer> messages = runValidation("/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/negative_test/input");
+
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+
+ Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().size(), 1);
+ Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "Wrong policy in server group - pcrf_server_policies_1");
+ }
+
+
+ @Test
+ public void testEnvContentIsSubSetOfHeatParameters() throws IOException {
+ Map<String, MessageContainer> messages = runValidation("/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/negative_test/input");
+
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+
+ Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.env").getErrorMessageList().size(), 1);
+ Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.env").getErrorMessageList().get(0).getMessage(), "Env file hot-nimbus-pps_v1.0.env includes a parameter not in HEAT - mock_param");
+ }
+
+ @Test
+ public void testDefaultValueAlignWithType() throws IOException {
+ Map<String, MessageContainer> messages = runValidation("/openecomp/org/validation/validators/heat_validator/default_value_align_with_type/negative_test/input");
+
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+
+ Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().size(), 1);
+ Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "Parameter - pcrf_pps_image_name_1 default value not align with type number");
+ }
+
+
+ @Test
+ public void testEnvParametersMatchDefinedHeatParameterTypes() throws IOException {
+ Map<String, MessageContainer> messages = runValidation("/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/negative_test/input");
+
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+
+ Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.env").getErrorMessageList().size(), 1);
+ Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.env").getErrorMessageList().get(0).getMessage(), "Parameter env value pcrf_pps_flavor_name not align with type");
+
+ }
+
+ @Test
+ public void testReferencedArtifactsExist() throws IOException {
+ Map<String, MessageContainer> messages = runValidation("/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/negative_test/input");
+
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+
+ Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().size(), 1);
+ Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "Missing artifact - nimbus-ethernet");
+
+ }
+
+
+ @Test
+ public void testResourcesGroupWithNested() throws IOException {
+ Map<String, MessageContainer> messages = runValidation("/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input");
+
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 3);
+
+ Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().size(), 2);
+ Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "Referenced parameter not found in nested file - nested-from-resources-group.yaml, resource name - nested-from-resources-group.yaml, parameter name - property_not_in_nested");
+ Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(1).getMessage(), "OS::Heat::ResourceGroup resource with resource_def which is not pointing to nested heat file is not supported, Resource ID [resource_without_resources_group], resource_def type [OS::Nova::Server]");
+
+ Assert.assertEquals(messages.get("nested-pps_v1.0.yaml").getErrorMessageList().size(), 1);
+ Assert.assertEquals(messages.get("nested-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "Nested files loop - [nested-pps_v1.0.yaml -- nested-from-resources-group.yaml -- hot-nimbus-pps_v1.0.yaml -- nested-pps_v1.0.yaml]");
+
+ Assert.assertEquals(messages.get("nested-not-exist.yaml").getErrorMessageList().size(), 1);
+ Assert.assertEquals(messages.get("nested-not-exist.yaml").getErrorMessageList().get(0).getMessage(), "Missing nested file - nested-not-exist.yaml");
+ }
+
+
+ @Test
+ public void testResourceGroupWithInvalidType(){
+ Map<String, MessageContainer> messages = runValidation("/openecomp/org/validation/validators/heat_validator/resource_group_invalid_type/negative_test/input");
+
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+
+ Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().size(), 3);
+ Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "OS::Heat::ResourceGroup resource with resource_def which is not pointing to nested heat file is not supported, Resource ID [resource_with_resources_group_1], resource_def type [{get_param=pcrf_vnf_id}]");
+ Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(1).getMessage(), "OS::Heat::ResourceGroup resource with resource_def which is not pointing to nested heat file is not supported, Resource ID [resource_with_resources_group_2], resource_def type [OS::Nova::Server]");
+ Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(2).getMessage(), "A resource has an invalid or unsupported type - null, Resource ID [resource_with_resources_group_3]");
+ }
+
+
+ @Test
+ public void testNetworkPolicyAssociatedWithAttachPolicy() throws IOException {
+ Map<String, MessageContainer> messages = runValidation("/openecomp/org/validation/validators/heat_validator/network_policy_associated_with_attach_policy/input");
+
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+
+ Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().size(), 1);
+ Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "NetworkPolicy not in use, Resource Id [not_used_server_pcrf_policy]");
+ }
+
+
+ @Test
+ public void testSecurityGroupsCalledByPort() throws IOException {
+ Map<String, MessageContainer> messages = runValidation("/openecomp/org/validation/validators/heat_validator/security_group_called_by_port/input");
+
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+
+ Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().size(), 2);
+ Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "SecurityGroup not in use, Resource Id [not_used_security_group]");
+ Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(1).getMessage(), "Port not bind to any NOVA Server, Resource Id [attach_policy_resource]");
+ }
+
+
+ @Test
+ public void testServerGroupCalledByServer() throws IOException {
+ Map<String, MessageContainer> messages = runValidation("/openecomp/org/validation/validators/heat_validator/server_group_called_by_nova_server/input");
+
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+
+ Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().size(), 1);
+ Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "ServerGroup not in use, Resource Id [not_used_server_group]");
+
+ }
+
+
+ @Test
+ public void testSecurityGroupBaseFileNoPorts() throws IOException {
+ Map<String, MessageContainer> messages = runValidation("/openecomp/org/validation/validators/heat_validator/security_group_base_file_no_ports/input");
+
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+
+ Assert.assertEquals(messages.get("baseFile.yaml").getErrorMessageList().size(), 1);
+ Assert.assertEquals(messages.get("baseFile.yaml").getErrorMessageList().get(0).getMessage(), "SecurityGroup not in use, Resource Id [shared_security_group_id3]");
+ }
+
+
+ @Test
+ public void testDependsOn(){
+ Map<String, MessageContainer> messages = runValidation("/openecomp/org/validation/validators/heat_validator/depends_on_points_to_existing_resource/input");
+
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+
+ Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().size(), 2);
+ Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "a Missing resource in depend On Missing Resource ID [resource_not_exist]");
+ Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(1).getMessage(), "a Missing resource in depend On Missing Resource ID [resource_3]");
+ }
+
+
+ @Test
+ public void testSharedResourcesValidation(){
+ Map<String, MessageContainer> messages = runValidation("/openecomp/org/validation/validators/heat_validator/shared_resources/input");
+
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+
+ Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().size(), 2);
+ Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "SecurityGroup not in use, Resource Id [not_used_security_group]");
+ Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(1).getMessage(), "Port not bind to any NOVA Server, Resource Id [attach_policy_resource]");
+ }
+
+
+ @Test
+ public void testNoErrorWhenEmptyValueForParameterInEnv(){
+ Map<String, MessageContainer> messages = runValidation("/openecomp/org/validation/validators/heat_validator/env_empty_value/input");
+
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+
+ MessageContainer envMessages = messages.get("env_empty_value.env");
+ Assert.assertNull(envMessages);
+ }
+
+
+ @Test
+ public void testGetParamPseudoParameters(){
+ Map<String, MessageContainer> messages = runValidation("/openecomp/org/validation/validators/heat_validator/pseudo_parameters/input");
+
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 0);
+
+ }
+
+
+ @Override
+ public Map<String, MessageContainer> runValidation(String path) {
+ HeatValidator heatValidator = new HeatValidator();
+ return testValidator(heatValidator, path);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/validators/ManifestValidatorTest.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/validators/ManifestValidatorTest.java
new file mode 100644
index 0000000000..479a1fb83b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/validators/ManifestValidatorTest.java
@@ -0,0 +1,125 @@
+package org.openecomp.sdc.validation.impl.validators.validators;
+
+
+import org.openecomp.sdc.common.utils.AsdcCommon;
+import org.openecomp.sdc.validation.impl.validators.ManifestValidator;
+import org.openecomp.sdc.validation.impl.validators.ValidatorBaseTest;
+import org.openecomp.core.validation.errors.Messages;
+import org.openecomp.core.validation.types.MessageContainer;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+import java.util.Map;
+
+public class ManifestValidatorTest extends ValidatorBaseTest {
+
+
+ @Test
+ public void testValidManifest() {
+ Map<String, MessageContainer> messages =
+ runValidation("/openecomp/org/validation/validators/manifestValidator/validFiles");
+ Assert.assertNotNull(messages);
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 0);
+ }
+
+ @Test
+ public void testManifestMissingFileInZip() {
+ Map<String, MessageContainer> messages =
+ runValidation("/openecomp/org/validation/validators/manifestValidator/missingFileInZip");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+ Assert.assertTrue(messages.containsKey("singleVol.yaml"));
+ validateErrorMessage(messages.get("singleVol.yaml").getErrorMessageList().get(0).getMessage(),
+ Messages.MISSING_FILE_IN_ZIP.getErrorMessage());
+ }
+
+ @Test
+ public void testInvalidManifest() {
+ Map<String, MessageContainer> messages =
+ runValidation("/openecomp/org/validation/validators/manifestValidator/invalidManifest");
+ Assert.assertNotNull(messages);
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+ Assert.assertTrue(messages.containsKey(AsdcCommon.MANIFEST_NAME));
+ validateErrorMessage(
+ messages.get(AsdcCommon.MANIFEST_NAME).getErrorMessageList().get(0).getMessage(),
+ Messages.INVALID_MANIFEST_FILE.getErrorMessage(), AsdcCommon.MANIFEST_NAME);
+
+ }
+
+ @Test
+ public void testMissingFileInManifest() {
+ Map<String, MessageContainer> messages =
+ runValidation("/openecomp/org/validation/validators/manifestValidator/missingFileInManifest");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+ Assert.assertTrue(messages.containsKey("extraFile.env"));
+ validateErrorMessage(messages.get("extraFile.env").getErrorMessageList().get(0).getMessage(),
+ Messages.MISSING_FILE_IN_MANIFEST.getErrorMessage());
+
+ }
+
+ @Test
+ public void testInvalidFileTypeInManifest() {
+ Map<String, MessageContainer> messages = runValidation(
+ "/openecomp/org/validation/validators/manifestValidator/invalidFileTypeInManifest");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 4);
+ Assert.assertTrue(messages.containsKey("single.env.illegalSuffix"));
+ Assert.assertTrue(messages.containsKey("illegalTypeFile.yaml"));
+ Assert.assertTrue(messages.containsKey("single.yaml.illegalSuffix"));
+ Assert.assertTrue(messages.containsKey("singleVol.yaml.illegalSuffix"));
+ validateErrorMessage(
+ messages.get("single.env.illegalSuffix").getErrorMessageList().get(0).getMessage(),
+ Messages.WRONG_ENV_FILE_EXTENSION.getErrorMessage(), "single.env.illegalSuffix");
+ validateErrorMessage(
+ messages.get("illegalTypeFile.yaml").getErrorMessageList().get(0).getMessage(),
+ Messages.INVALID_FILE_TYPE.getErrorMessage(), "illegalTypeFile.yaml");
+ validateErrorMessage(
+ messages.get("single.yaml.illegalSuffix").getErrorMessageList().get(0).getMessage(),
+ Messages.WRONG_HEAT_FILE_EXTENSION.getErrorMessage(), "single.yaml.illegalSuffix");
+ validateErrorMessage(
+ messages.get("singleVol.yaml.illegalSuffix").getErrorMessageList().get(0).getMessage(),
+ Messages.WRONG_HEAT_FILE_EXTENSION.getErrorMessage(), "singleVol.yaml.illegalSuffix");
+
+ }
+
+
+ @Test
+ public void testMissingFileInManifestAndInZip() {
+
+ Map<String, MessageContainer> messages = runValidation(
+ "/openecomp/org/validation/validators/manifestValidator/missingFileInManifestAndInZip");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 2);
+ Assert.assertTrue(messages.containsKey("extraFile.env"));
+ Assert.assertTrue(messages.containsKey("singleVol.yaml"));
+ validateErrorMessage(messages.get("extraFile.env").getErrorMessageList().get(0).getMessage(),
+ Messages.MISSING_FILE_IN_MANIFEST.getErrorMessage());
+ validateErrorMessage(messages.get("singleVol.yaml").getErrorMessageList().get(0).getMessage(),
+ Messages.MISSING_FILE_IN_ZIP.getErrorMessage());
+
+ }
+
+
+ @Test
+ public void testEnvInRoot() {
+ Map<String, MessageContainer> messages =
+ runValidation("/openecomp/org/validation/validators/manifestValidator/envInRoot");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+ Assert.assertTrue(messages.containsKey("second.env"));
+ validateErrorMessage(messages.get("second.env").getErrorMessageList().get(0).getMessage(),
+ "ENV file must be associated to a HEAT file");
+ }
+
+ public Map<String, MessageContainer> runValidation(String path) {
+ ManifestValidator manifestValidator = new ManifestValidator();
+ return testValidator(manifestValidator, path);
+
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/validators/YamlValidatorTest.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/validators/YamlValidatorTest.java
new file mode 100644
index 0000000000..abce8ec88c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/validators/YamlValidatorTest.java
@@ -0,0 +1,89 @@
+package org.openecomp.sdc.validation.impl.validators.validators;
+
+
+import org.openecomp.sdc.validation.impl.validators.ValidatorBaseTest;
+import org.openecomp.sdc.validation.impl.validators.YamlValidator;
+import org.openecomp.core.validation.errors.Messages;
+import org.openecomp.core.validation.types.MessageContainer;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+import java.util.Map;
+
+public class YamlValidatorTest extends ValidatorBaseTest {
+
+
+ public Map<String, MessageContainer> runValidation(String path) {
+ YamlValidator validator = new YamlValidator();
+ return testValidator(validator, path);
+
+ }
+
+ @Test
+ public void testValidYaml() {
+
+ Map<String, MessageContainer> messages = runValidation(
+ "/openecomp/org/validation/validators/yaml_validator/valid_yaml/input/validHeat.yaml");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 0);
+ }
+
+// @Test
+ public void testInvalidTabYaml() {
+
+ Map<String, MessageContainer> messages = runValidation(
+ "/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalidYamlTab.yaml");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+ validateErrorMessage(
+ messages.get("invalidYamlTab.yaml").getErrorMessageList().get(0).getMessage(),
+ Messages.INVALID_YAML_FORMAT_REASON.getErrorMessage(),
+ "while scanning for the next tokenfound character '\\t(TAB)' that cannot start any token. (Do not use \\t(TAB) for indentation) in 'reader', line 14, column 5: \tadmin_state_up: true ^");
+
+ }
+
+
+ @Test
+ public void testDuplicateKeyInYaml() {
+
+ Map<String, MessageContainer> messages =
+ runValidation("/openecomp/org/validation/validators/yaml_validator/duplicateKey.yaml");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+ Assert.assertTrue(messages.containsKey("duplicateKey.yaml"));
+ validateErrorMessage(
+ messages.get("duplicateKey.yaml").getErrorMessageList().get(0).getMessage(),
+ Messages.INVALID_YAML_FORMAT_REASON.getErrorMessage(),
+ "while parsing MappingNode in 'reader', line 6, column 3: Key_1_unique: ^duplicate key: Key_2_not_unique in 'reader', line 31, column 1: ^");
+ }
+
+
+ @Test
+ public void testInvalidYamlStructure() {
+
+ Map<String, MessageContainer> messages =
+ runValidation("/openecomp/org/validation/validators/yaml_validator/invalidYamlStructure.yaml");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+ Assert.assertTrue(messages.containsKey("invalidYamlStructure.yaml"));
+ validateErrorMessage(
+ messages.get("invalidYamlStructure.yaml").getErrorMessageList().get(0).getMessage(),
+ Messages.INVALID_YAML_FORMAT_REASON.getErrorMessage(),
+ "while parsing a block mapping in 'reader', line 8, column 7: admin_state_up: true ^expected <block end>, but found BlockEntry in 'reader', line 10, column 7: - shared: true ^");
+ }
+
+ @Test
+ public void testEmptyYaml() {
+
+ Map<String, MessageContainer> messages =
+ runValidation("/openecomp/org/validation/validators/yaml_validator/emptyYaml.yaml");
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+ Assert.assertTrue(messages.containsKey("emptyYaml.yaml"));
+ validateErrorMessage(messages.get("emptyYaml.yaml").getErrorMessageList().get(0).getMessage(),
+ Messages.INVALID_YAML_FORMAT_REASON.getErrorMessage(),
+ Messages.EMPTY_YAML_FILE.getErrorMessage());
+ }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/MANIFEST.json
new file mode 100644
index 0000000000..76ce6de6e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/MANIFEST.json
@@ -0,0 +1,27 @@
+{
+ "name": "validTest",
+ "description": "Valid Test",
+ "version": "1610",
+ "data": [
+ {
+ "file": "first.yaml",
+ "type": "HEAT",
+ "isBase": true,
+ "data": [
+ {
+ "file": "first.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "firstVol.yaml",
+ "type": "HEAT_VOL"
+ }
+ ]
+ },
+ {
+ "file": "second.yaml",
+ "type": "HEAT",
+ "isBase": false
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/first.env
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/first.env
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/first.yaml
new file mode 100644
index 0000000000..368834e847
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/first.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat expose volume resource
+
+resources:
+ SecurityGroup_expose:
+ type: OS::Neutron::Net
+
+outputs:
+ not_expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_param: ServerGroup_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/firstVol.yaml
new file mode 100644
index 0000000000..9e26dfeeb6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/firstVol.yaml
@@ -0,0 +1 @@
+{} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/second.yaml
new file mode 100644
index 0000000000..bb06b9d60a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/second.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat second
+
+resources:
+ network_expose:
+ type: OS::Neutron::Net
+
+outputs:
+ expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: network_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/MANIFEST.json
new file mode 100644
index 0000000000..76ce6de6e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/MANIFEST.json
@@ -0,0 +1,27 @@
+{
+ "name": "validTest",
+ "description": "Valid Test",
+ "version": "1610",
+ "data": [
+ {
+ "file": "first.yaml",
+ "type": "HEAT",
+ "isBase": true,
+ "data": [
+ {
+ "file": "first.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "firstVol.yaml",
+ "type": "HEAT_VOL"
+ }
+ ]
+ },
+ {
+ "file": "second.yaml",
+ "type": "HEAT",
+ "isBase": false
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/first.env
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/first.env
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/first.yaml
new file mode 100644
index 0000000000..08955562d4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/first.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat expose volume resource
+
+resources:
+ net_expose:
+ type: OS::Neutron::Net
+
+outputs:
+ expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: net_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/firstVol.yaml
new file mode 100644
index 0000000000..9e26dfeeb6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/firstVol.yaml
@@ -0,0 +1 @@
+{} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/second.yaml
new file mode 100644
index 0000000000..bb06b9d60a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/second.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat second
+
+resources:
+ network_expose:
+ type: OS::Neutron::Net
+
+outputs:
+ expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: network_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/MANIFEST.json
new file mode 100644
index 0000000000..76ce6de6e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/MANIFEST.json
@@ -0,0 +1,27 @@
+{
+ "name": "validTest",
+ "description": "Valid Test",
+ "version": "1610",
+ "data": [
+ {
+ "file": "first.yaml",
+ "type": "HEAT",
+ "isBase": true,
+ "data": [
+ {
+ "file": "first.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "firstVol.yaml",
+ "type": "HEAT_VOL"
+ }
+ ]
+ },
+ {
+ "file": "second.yaml",
+ "type": "HEAT",
+ "isBase": false
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/first.env
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/first.env
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/first.yaml
new file mode 100644
index 0000000000..f5c6b598cc
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/first.yaml
@@ -0,0 +1,18 @@
+heat_template_version: 2013-05-23
+
+description: heat expose volume resource
+
+resources:
+ net_expose:
+ type: OS::Neutron::Net
+ volume_expose:
+ type: OS::Cinder::Volume
+
+
+
+outputs:
+ not_expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_param: ServerGroup_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/firstVol.yaml
new file mode 100644
index 0000000000..9e26dfeeb6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/firstVol.yaml
@@ -0,0 +1 @@
+{} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/second.yaml
new file mode 100644
index 0000000000..bb06b9d60a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/second.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat second
+
+resources:
+ network_expose:
+ type: OS::Neutron::Net
+
+outputs:
+ expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: network_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/MANIFEST.json
new file mode 100644
index 0000000000..76ce6de6e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/MANIFEST.json
@@ -0,0 +1,27 @@
+{
+ "name": "validTest",
+ "description": "Valid Test",
+ "version": "1610",
+ "data": [
+ {
+ "file": "first.yaml",
+ "type": "HEAT",
+ "isBase": true,
+ "data": [
+ {
+ "file": "first.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "firstVol.yaml",
+ "type": "HEAT_VOL"
+ }
+ ]
+ },
+ {
+ "file": "second.yaml",
+ "type": "HEAT",
+ "isBase": false
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/first.env
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/first.env
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/first.yaml
new file mode 100644
index 0000000000..0c7abd6d49
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/first.yaml
@@ -0,0 +1,21 @@
+heat_template_version: 2013-05-23
+
+description: heat expose volume resource
+
+resources:
+ net_expose:
+ type: OS::Neutron::Net
+ volume_expose:
+ type: OS::Cinder::Volume
+
+
+
+outputs:
+ expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: net_expose }
+ expose_resource_volume_output:
+ description: the pcrf_server
+ value: { get_resource: volume_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/firstVol.yaml
new file mode 100644
index 0000000000..9e26dfeeb6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/firstVol.yaml
@@ -0,0 +1 @@
+{} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/second.yaml
new file mode 100644
index 0000000000..bb06b9d60a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/second.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat second
+
+resources:
+ network_expose:
+ type: OS::Neutron::Net
+
+outputs:
+ expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: network_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/MANIFEST.json
new file mode 100644
index 0000000000..76ce6de6e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/MANIFEST.json
@@ -0,0 +1,27 @@
+{
+ "name": "validTest",
+ "description": "Valid Test",
+ "version": "1610",
+ "data": [
+ {
+ "file": "first.yaml",
+ "type": "HEAT",
+ "isBase": true,
+ "data": [
+ {
+ "file": "first.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "firstVol.yaml",
+ "type": "HEAT_VOL"
+ }
+ ]
+ },
+ {
+ "file": "second.yaml",
+ "type": "HEAT",
+ "isBase": false
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/first.env
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/first.env
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/first.yaml
new file mode 100644
index 0000000000..fe5effbc24
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/first.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat expose volume resource
+
+resources:
+ SecurityGroup_expose:
+ type: OS::Neutron::SecurityGroup
+
+outputs:
+ not_expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_param: ServerGroup_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/firstVol.yaml
new file mode 100644
index 0000000000..9e26dfeeb6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/firstVol.yaml
@@ -0,0 +1 @@
+{} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/second.yaml
new file mode 100644
index 0000000000..bb06b9d60a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/second.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat second
+
+resources:
+ network_expose:
+ type: OS::Neutron::Net
+
+outputs:
+ expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: network_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/MANIFEST.json
new file mode 100644
index 0000000000..76ce6de6e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/MANIFEST.json
@@ -0,0 +1,27 @@
+{
+ "name": "validTest",
+ "description": "Valid Test",
+ "version": "1610",
+ "data": [
+ {
+ "file": "first.yaml",
+ "type": "HEAT",
+ "isBase": true,
+ "data": [
+ {
+ "file": "first.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "firstVol.yaml",
+ "type": "HEAT_VOL"
+ }
+ ]
+ },
+ {
+ "file": "second.yaml",
+ "type": "HEAT",
+ "isBase": false
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/first.env
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/first.env
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/first.yaml
new file mode 100644
index 0000000000..781bcba716
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/first.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat expose volume resource
+
+resources:
+ SecurityGroup_expose:
+ type: OS::Neutron::SecurityGroup
+
+outputs:
+ expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: SecurityGroup_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/firstVol.yaml
new file mode 100644
index 0000000000..9e26dfeeb6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/firstVol.yaml
@@ -0,0 +1 @@
+{} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/second.yaml
new file mode 100644
index 0000000000..bb06b9d60a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/second.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat second
+
+resources:
+ network_expose:
+ type: OS::Neutron::Net
+
+outputs:
+ expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: network_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/MANIFEST.json
new file mode 100644
index 0000000000..76ce6de6e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/MANIFEST.json
@@ -0,0 +1,27 @@
+{
+ "name": "validTest",
+ "description": "Valid Test",
+ "version": "1610",
+ "data": [
+ {
+ "file": "first.yaml",
+ "type": "HEAT",
+ "isBase": true,
+ "data": [
+ {
+ "file": "first.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "firstVol.yaml",
+ "type": "HEAT_VOL"
+ }
+ ]
+ },
+ {
+ "file": "second.yaml",
+ "type": "HEAT",
+ "isBase": false
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/first.env
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/first.env
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/first.yaml
new file mode 100644
index 0000000000..5660cc003b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/first.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat expose volume resource
+
+resources:
+ ServerGroup_expose:
+ type: OS::Nova::ServerGroup
+
+outputs:
+ not_expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_param: ServerGroup_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/firstVol.yaml
new file mode 100644
index 0000000000..9e26dfeeb6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/firstVol.yaml
@@ -0,0 +1 @@
+{} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/second.yaml
new file mode 100644
index 0000000000..bb06b9d60a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/second.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat second
+
+resources:
+ network_expose:
+ type: OS::Neutron::Net
+
+outputs:
+ expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: network_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/MANIFEST.json
new file mode 100644
index 0000000000..76ce6de6e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/MANIFEST.json
@@ -0,0 +1,27 @@
+{
+ "name": "validTest",
+ "description": "Valid Test",
+ "version": "1610",
+ "data": [
+ {
+ "file": "first.yaml",
+ "type": "HEAT",
+ "isBase": true,
+ "data": [
+ {
+ "file": "first.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "firstVol.yaml",
+ "type": "HEAT_VOL"
+ }
+ ]
+ },
+ {
+ "file": "second.yaml",
+ "type": "HEAT",
+ "isBase": false
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/first.env
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/first.env
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/first.yaml
new file mode 100644
index 0000000000..89fafb9d3a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/first.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat expose volume resource
+
+resources:
+ serverGroup_expose:
+ type: OS::Nova::ServerGroup
+
+outputs:
+ expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: serverGroup_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/firstVol.yaml
new file mode 100644
index 0000000000..9e26dfeeb6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/firstVol.yaml
@@ -0,0 +1 @@
+{} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/second.yaml
new file mode 100644
index 0000000000..bb06b9d60a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/second.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat second
+
+resources:
+ network_expose:
+ type: OS::Neutron::Net
+
+outputs:
+ expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: network_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/MANIFEST.json
new file mode 100644
index 0000000000..76ce6de6e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/MANIFEST.json
@@ -0,0 +1,27 @@
+{
+ "name": "validTest",
+ "description": "Valid Test",
+ "version": "1610",
+ "data": [
+ {
+ "file": "first.yaml",
+ "type": "HEAT",
+ "isBase": true,
+ "data": [
+ {
+ "file": "first.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "firstVol.yaml",
+ "type": "HEAT_VOL"
+ }
+ ]
+ },
+ {
+ "file": "second.yaml",
+ "type": "HEAT",
+ "isBase": false
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/first.env
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/first.env
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/first.yaml
new file mode 100644
index 0000000000..e2a4301249
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/first.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat expose volume resource
+
+resources:
+ volume_expose:
+ type: OS::Cinder::Volume
+
+outputs:
+ not_expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_param: volume_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/firstVol.yaml
new file mode 100644
index 0000000000..9e26dfeeb6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/firstVol.yaml
@@ -0,0 +1 @@
+{} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/second.yaml
new file mode 100644
index 0000000000..bb06b9d60a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/second.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat second
+
+resources:
+ network_expose:
+ type: OS::Neutron::Net
+
+outputs:
+ expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: network_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/MANIFEST.json
new file mode 100644
index 0000000000..76ce6de6e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/MANIFEST.json
@@ -0,0 +1,27 @@
+{
+ "name": "validTest",
+ "description": "Valid Test",
+ "version": "1610",
+ "data": [
+ {
+ "file": "first.yaml",
+ "type": "HEAT",
+ "isBase": true,
+ "data": [
+ {
+ "file": "first.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "firstVol.yaml",
+ "type": "HEAT_VOL"
+ }
+ ]
+ },
+ {
+ "file": "second.yaml",
+ "type": "HEAT",
+ "isBase": false
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/first.env
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/first.env
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/first.yaml
new file mode 100644
index 0000000000..63b576edb8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/first.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat expose volume resource
+
+resources:
+ volume_expose:
+ type: OS::Cinder::Volume
+
+outputs:
+ expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: volume_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/firstVol.yaml
new file mode 100644
index 0000000000..9e26dfeeb6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/firstVol.yaml
@@ -0,0 +1 @@
+{} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/second.yaml
new file mode 100644
index 0000000000..bb06b9d60a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/second.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat second
+
+resources:
+ network_expose:
+ type: OS::Neutron::Net
+
+outputs:
+ expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: network_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative/MANIFEST.json
new file mode 100644
index 0000000000..76ce6de6e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative/MANIFEST.json
@@ -0,0 +1,27 @@
+{
+ "name": "validTest",
+ "description": "Valid Test",
+ "version": "1610",
+ "data": [
+ {
+ "file": "first.yaml",
+ "type": "HEAT",
+ "isBase": true,
+ "data": [
+ {
+ "file": "first.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "firstVol.yaml",
+ "type": "HEAT_VOL"
+ }
+ ]
+ },
+ {
+ "file": "second.yaml",
+ "type": "HEAT",
+ "isBase": false
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative/first.env
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative/first.env
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative/first.yaml
new file mode 100644
index 0000000000..3d3a1949b1
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative/first.yaml
@@ -0,0 +1,25 @@
+heat_template_version: 2013-05-23
+
+description: heat expose volume resource
+
+resources:
+ FSB2:
+ type: OS::Neutron::FloatingIP
+ properties:
+ name: { get_param: fsb_name_2 }
+ block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }]
+ flavor: { get_param: fsb2-flavor }
+ availability_zone: { get_param: availability_zone_0 }
+ metadata:
+ VNF_id: { get_param: vnfvfVF_id }
+ vf_module_id: { get_param: vf_module_id }
+ networks:
+ - port: { get_resource: FSB2_Internal1 }
+ - port: { get_resource: FSB2_Internal2 }
+ - port: { get_resource: FSB2_OAM }
+outputs:
+ expose_resource_nove_output:
+ description: the pcrf_server
+ value: { get_resource: FSB2 }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative/firstVol.yaml
new file mode 100644
index 0000000000..7e82b2a7e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative/firstVol.yaml
@@ -0,0 +1,19 @@
+
+heat_template_version: 2013-05-23
+
+parameters:
+ not_null:
+ type: number
+ label: not_number
+
+
+resources:
+ volume_expose:
+ type: OS::Cinder::Volume
+ properties:
+ not_null: not_null
+outputs:
+ not_expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: volume_expose }
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative/second.yaml
new file mode 100644
index 0000000000..bb06b9d60a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative/second.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat second
+
+resources:
+ network_expose:
+ type: OS::Neutron::Net
+
+outputs:
+ expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: network_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive/MANIFEST.json
new file mode 100644
index 0000000000..76ce6de6e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive/MANIFEST.json
@@ -0,0 +1,27 @@
+{
+ "name": "validTest",
+ "description": "Valid Test",
+ "version": "1610",
+ "data": [
+ {
+ "file": "first.yaml",
+ "type": "HEAT",
+ "isBase": true,
+ "data": [
+ {
+ "file": "first.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "firstVol.yaml",
+ "type": "HEAT_VOL"
+ }
+ ]
+ },
+ {
+ "file": "second.yaml",
+ "type": "HEAT",
+ "isBase": false
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive/first.env
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive/first.env
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive/first.yaml
new file mode 100644
index 0000000000..2fc2a932fe
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive/first.yaml
@@ -0,0 +1,37 @@
+heat_template_version: 2013-05-23
+
+description: heat expose volume resource
+
+resources:
+ FSB2_Internal1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_param: Internal1_net_id }
+ FSB2_Internal2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_param: Internal2_net_name }
+ FSB2_OAM:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_param: Internal3_net_id }
+ FSB2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: fsb_name_2 }
+ block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }]
+ flavor: { get_param: fsb2_flavor_name }
+ availability_zone: { get_param: availability_zone_0 }
+ metadata:
+ VNF_id: { get_param: vnfvfVF_id }
+ vf_module_id: { get_param: vf_module_id }
+ networks:
+ - port: { get_resource: FSB2_Internal1 }
+ - port: { get_resource: FSB2_Internal2 }
+ - port: { get_resource: FSB2_OAM }
+outputs:
+ expose_resource_nove_output:
+ description: the pcrf_server
+ value: { get_resource: FSB2 }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive/firstVol.yaml
new file mode 100644
index 0000000000..7e82b2a7e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive/firstVol.yaml
@@ -0,0 +1,19 @@
+
+heat_template_version: 2013-05-23
+
+parameters:
+ not_null:
+ type: number
+ label: not_number
+
+
+resources:
+ volume_expose:
+ type: OS::Cinder::Volume
+ properties:
+ not_null: not_null
+outputs:
+ not_expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: volume_expose }
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive/second.yaml
new file mode 100644
index 0000000000..bb06b9d60a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive/second.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat second
+
+resources:
+ network_expose:
+ type: OS::Neutron::Net
+
+outputs:
+ expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: network_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/MANIFEST.json
new file mode 100644
index 0000000000..76ce6de6e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/MANIFEST.json
@@ -0,0 +1,27 @@
+{
+ "name": "validTest",
+ "description": "Valid Test",
+ "version": "1610",
+ "data": [
+ {
+ "file": "first.yaml",
+ "type": "HEAT",
+ "isBase": true,
+ "data": [
+ {
+ "file": "first.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "firstVol.yaml",
+ "type": "HEAT_VOL"
+ }
+ ]
+ },
+ {
+ "file": "second.yaml",
+ "type": "HEAT",
+ "isBase": false
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/first.env
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/first.env
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/first.yaml
new file mode 100644
index 0000000000..5d6cea4d84
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/first.yaml
@@ -0,0 +1,37 @@
+heat_template_version: 2013-05-23
+
+description: heat expose volume resource
+
+resources:
+ FSB2_Internal1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_param: Internal1_net_id }
+ FSB2_Internal2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_param: Internal2_net_id }
+ FSB2_OAM:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_param: Internal1_net_name }
+ FSB2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: fsb_name_2 }
+ block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }]
+ flavor: { get_param: fsb2_flavor_name }
+ availability_zone: { get_param: availability_zone_0 }
+ metadata:
+ VNF_id: { get_param: vnfvfVF_id }
+ vf_module_id: { get_param: vf_module_id }
+ networks:
+ - port: { get_resource: FSB2_Internal1 }
+ - port: { get_resource: FSB2_Internal2 }
+ - port: { get_resource: FSB2_OAM }
+outputs:
+ expose_resource_nove_output:
+ description: the pcrf_server
+ value: { get_resource: FSB2 }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/firstVol.yaml
new file mode 100644
index 0000000000..7e82b2a7e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/firstVol.yaml
@@ -0,0 +1,19 @@
+
+heat_template_version: 2013-05-23
+
+parameters:
+ not_null:
+ type: number
+ label: not_number
+
+
+resources:
+ volume_expose:
+ type: OS::Cinder::Volume
+ properties:
+ not_null: not_null
+outputs:
+ not_expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: volume_expose }
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/second.yaml
new file mode 100644
index 0000000000..bb06b9d60a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/second.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat second
+
+resources:
+ network_expose:
+ type: OS::Neutron::Net
+
+outputs:
+ expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: network_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/MANIFEST.json
new file mode 100644
index 0000000000..76ce6de6e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/MANIFEST.json
@@ -0,0 +1,27 @@
+{
+ "name": "validTest",
+ "description": "Valid Test",
+ "version": "1610",
+ "data": [
+ {
+ "file": "first.yaml",
+ "type": "HEAT",
+ "isBase": true,
+ "data": [
+ {
+ "file": "first.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "firstVol.yaml",
+ "type": "HEAT_VOL"
+ }
+ ]
+ },
+ {
+ "file": "second.yaml",
+ "type": "HEAT",
+ "isBase": false
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/first.env
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/first.env
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/first.yaml
new file mode 100644
index 0000000000..2c9fd08fb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/first.yaml
@@ -0,0 +1,52 @@
+heat_template_version: 2013-05-23
+
+description: heat expose volume resource
+
+resources:
+ FSB2_Internal1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_param: Internal1_net_id }
+ FSB2_Internal2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_param: Internal2_net_name }
+ FSB2_OAM:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_param: Internal3_net_id }
+ FSB2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: fsb_name_2 }
+ block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }]
+ flavor: { get_param: fsb2_flavor_name }
+ availability_zone: { get_param: availability_zone_0 }
+ metadata:
+ VNF_id: { get_param: vnfvfVF_id }
+ vf_module_id: { get_param: vf_module_id }
+ networks:
+ - port: { get_resource: FSB2_Internal1 }
+ - port: { get_resource: FSB2_Internal2 }
+ - port: { get_resource: FSB2_OAM }
+
+ FSB3:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: fsb_name_2 }
+ block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }]
+ flavor: { get_param: fsb2_flavor_name }
+ availability_zone: { get_param: availability_zone_0 }
+ metadata:
+ VNF_id: { get_param: vnfvfVF_id }
+ vf_module_id: { get_param: vf_module_id }
+ networks:
+ - port: { get_resource: FSB2_Internal1 }
+ - port: { get_resource: FSB2_Internal2 }
+ - port: { get_resource: FSB2_OAM }
+outputs:
+ expose_resource_nove_output:
+ description: the pcrf_server
+ value: { get_resource: FSB2 }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/firstVol.yaml
new file mode 100644
index 0000000000..7e82b2a7e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/firstVol.yaml
@@ -0,0 +1,19 @@
+
+heat_template_version: 2013-05-23
+
+parameters:
+ not_null:
+ type: number
+ label: not_number
+
+
+resources:
+ volume_expose:
+ type: OS::Cinder::Volume
+ properties:
+ not_null: not_null
+outputs:
+ not_expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: volume_expose }
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/second.yaml
new file mode 100644
index 0000000000..bb06b9d60a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/second.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat second
+
+resources:
+ network_expose:
+ type: OS::Neutron::Net
+
+outputs:
+ expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: network_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative/MANIFEST.json
new file mode 100644
index 0000000000..76ce6de6e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative/MANIFEST.json
@@ -0,0 +1,27 @@
+{
+ "name": "validTest",
+ "description": "Valid Test",
+ "version": "1610",
+ "data": [
+ {
+ "file": "first.yaml",
+ "type": "HEAT",
+ "isBase": true,
+ "data": [
+ {
+ "file": "first.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "firstVol.yaml",
+ "type": "HEAT_VOL"
+ }
+ ]
+ },
+ {
+ "file": "second.yaml",
+ "type": "HEAT",
+ "isBase": false
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative/first.env
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative/first.env
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative/first.yaml
new file mode 100644
index 0000000000..60f8c45630
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative/first.yaml
@@ -0,0 +1,58 @@
+heat_template_version: 2013-05-23
+
+description: heat expose volume resource
+
+resources:
+ FSB2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: pcrf_pps_server_name_4 }
+ block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }]
+ flavor: { get_param: fsb2_flavor_name }
+ availability_zone: { get_param: availability_zone_a }
+ metadata:
+ VnF_id: { get_param: vnfvfVF_id }
+ vf_module_id: { get_param: vf_module_id }
+ networks:
+ - port: { get_resource: FSB2_Internal1 }
+ - port: { get_resource: FSB2_Internal2 }
+ - port: { get_resource: FSB2_OAM }
+
+ FSB3:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [pcrf_pps_server_names, 0] }
+ block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }]
+ flavor: { get_param: fsb2_flavor_name }
+ availability_zone: { get_param: availability_zone}
+ metadata:
+ VnF_id: { get_param: vnfvfVF_id }
+ vf_module_id: { get_param: vf_module_id }
+ networks:
+ - port: { get_resource: FSB2_Internal1 }
+ - port: { get_resource: FSB2_Internal2 }
+ - port: { get_resource: FSB2_OAM }
+
+ FSB4:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [pcrf_pps_server_names, 0] }
+ block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }]
+ flavor: { get_param: fsb2_flavor_name }
+ availability_zone: { get_param: availability_zone_blabla}
+ metadata:
+ VnF_id: { get_param: vnfvfVF_id }
+ vf_module_id: { get_param: vf_module_id }
+ networks:
+ - port: { get_resource: FSB2_Internal1 }
+ - port: { get_resource: FSB2_Internal2 }
+ - port: { get_resource: FSB2_OAM }
+outputs:
+ expose_resource_nove_output2:
+ description: the pcrf_server
+ value: { get_resource: FSB2 }
+ expose_resource_nove_output3:
+ description: the pcrf_server
+ value: { get_resource: FSB3 }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative/firstVol.yaml
new file mode 100644
index 0000000000..7e82b2a7e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative/firstVol.yaml
@@ -0,0 +1,19 @@
+
+heat_template_version: 2013-05-23
+
+parameters:
+ not_null:
+ type: number
+ label: not_number
+
+
+resources:
+ volume_expose:
+ type: OS::Cinder::Volume
+ properties:
+ not_null: not_null
+outputs:
+ not_expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: volume_expose }
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative/second.yaml
new file mode 100644
index 0000000000..bb06b9d60a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative/second.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat second
+
+resources:
+ network_expose:
+ type: OS::Neutron::Net
+
+outputs:
+ expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: network_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive/MANIFEST.json
new file mode 100644
index 0000000000..76ce6de6e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive/MANIFEST.json
@@ -0,0 +1,27 @@
+{
+ "name": "validTest",
+ "description": "Valid Test",
+ "version": "1610",
+ "data": [
+ {
+ "file": "first.yaml",
+ "type": "HEAT",
+ "isBase": true,
+ "data": [
+ {
+ "file": "first.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "firstVol.yaml",
+ "type": "HEAT_VOL"
+ }
+ ]
+ },
+ {
+ "file": "second.yaml",
+ "type": "HEAT",
+ "isBase": false
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive/first.env
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive/first.env
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive/first.yaml
new file mode 100644
index 0000000000..372761514f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive/first.yaml
@@ -0,0 +1,43 @@
+heat_template_version: 2013-05-23
+
+description: heat expose volume resource
+
+resources:
+
+ FSB2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: pcrf_pps_server_name_4 }
+ block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }]
+ flavor: { get_param: fsb2_flavor_name }
+ availability_zone: { get_param: availability_zone_0 }
+ metadata:
+ VnF_id: { get_param: vnfvfVF_id }
+ vf_module_id: { get_param: vf_module_id }
+ networks:
+ - port: { get_resource: FSB2_Internal1 }
+ - port: { get_resource: FSB2_Internal2 }
+ - port: { get_resource: FSB2_OAM }
+ FSB3:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [pcrf_pps_server_names, 0] }
+ block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }]
+ flavor: { get_param: fsb2_flavor_name }
+ availability_zone: { get_param: availability_zone_0 }
+ metadata:
+ VnF_id: { get_param: vnfvfVF_id }
+ vf_module_id: { get_param: vf_module_id }
+ networks:
+ - port: { get_resource: FSB2_Internal1 }
+ - port: { get_resource: FSB2_Internal2 }
+ - port: { get_resource: FSB2_OAM }
+outputs:
+ expose_resource_nove_output2:
+ description: the pcrf_server
+ value: { get_resource: FSB2 }
+ expose_resource_nove_output3:
+ description: the pcrf_server
+ value: { get_resource: FSB3 }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive/firstVol.yaml
new file mode 100644
index 0000000000..7e82b2a7e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive/firstVol.yaml
@@ -0,0 +1,19 @@
+
+heat_template_version: 2013-05-23
+
+parameters:
+ not_null:
+ type: number
+ label: not_number
+
+
+resources:
+ volume_expose:
+ type: OS::Cinder::Volume
+ properties:
+ not_null: not_null
+outputs:
+ not_expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: volume_expose }
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive/second.yaml
new file mode 100644
index 0000000000..bb06b9d60a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive/second.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat second
+
+resources:
+ network_expose:
+ type: OS::Neutron::Net
+
+outputs:
+ expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: network_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative/MANIFEST.json
new file mode 100644
index 0000000000..76ce6de6e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative/MANIFEST.json
@@ -0,0 +1,27 @@
+{
+ "name": "validTest",
+ "description": "Valid Test",
+ "version": "1610",
+ "data": [
+ {
+ "file": "first.yaml",
+ "type": "HEAT",
+ "isBase": true,
+ "data": [
+ {
+ "file": "first.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "firstVol.yaml",
+ "type": "HEAT_VOL"
+ }
+ ]
+ },
+ {
+ "file": "second.yaml",
+ "type": "HEAT",
+ "isBase": false
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative/first.env
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative/first.env
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative/first.yaml
new file mode 100644
index 0000000000..58e645e168
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative/first.yaml
@@ -0,0 +1,41 @@
+heat_template_version: 2013-05-23
+
+description: heat expose volume resource
+
+resources:
+ FSB2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: fsb_name_2 }
+ block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }]
+ flavor: { get_param: fsb2-flavor }
+ availability_zone: { get_param: availability_zone_0 }
+ metadata:
+ VNF_id: { get_param: vnfvfVF_id }
+ vf_module_id: { get_param: vf_module_id }
+ networks:
+ - port: { get_resource: FSB2_Internal1 }
+ - port: { get_resource: FSB2_Internal2 }
+ - port: { get_resource: FSB2_OAM }
+
+ FSB3:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: fsb_name_2 }
+ block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }]
+ image: { get_param: fsb2-image }
+ availability_zone: { get_param: availability_zone_0 }
+ metadata:
+ VNF_id: { get_param: vnfvfVF_id }
+ vf_module_id: { get_param: vf_module_id }
+ networks:
+ - port: { get_resource: FSB2_Internal1 }
+ - port: { get_resource: FSB2_Internal2 }
+ - port: { get_resource: FSB2_OAM }
+
+outputs:
+ expose_resource_nove_output:
+ description: the pcrf_server
+ value: { get_resource: FSB2 }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative/firstVol.yaml
new file mode 100644
index 0000000000..7e82b2a7e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative/firstVol.yaml
@@ -0,0 +1,19 @@
+
+heat_template_version: 2013-05-23
+
+parameters:
+ not_null:
+ type: number
+ label: not_number
+
+
+resources:
+ volume_expose:
+ type: OS::Cinder::Volume
+ properties:
+ not_null: not_null
+outputs:
+ not_expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: volume_expose }
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative/second.yaml
new file mode 100644
index 0000000000..bb06b9d60a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative/second.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat second
+
+resources:
+ network_expose:
+ type: OS::Neutron::Net
+
+outputs:
+ expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: network_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive/MANIFEST.json
new file mode 100644
index 0000000000..76ce6de6e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive/MANIFEST.json
@@ -0,0 +1,27 @@
+{
+ "name": "validTest",
+ "description": "Valid Test",
+ "version": "1610",
+ "data": [
+ {
+ "file": "first.yaml",
+ "type": "HEAT",
+ "isBase": true,
+ "data": [
+ {
+ "file": "first.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "firstVol.yaml",
+ "type": "HEAT_VOL"
+ }
+ ]
+ },
+ {
+ "file": "second.yaml",
+ "type": "HEAT",
+ "isBase": false
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive/first.env
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive/first.env
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive/first.yaml
new file mode 100644
index 0000000000..2fc2a932fe
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive/first.yaml
@@ -0,0 +1,37 @@
+heat_template_version: 2013-05-23
+
+description: heat expose volume resource
+
+resources:
+ FSB2_Internal1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_param: Internal1_net_id }
+ FSB2_Internal2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_param: Internal2_net_name }
+ FSB2_OAM:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_param: Internal3_net_id }
+ FSB2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: fsb_name_2 }
+ block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }]
+ flavor: { get_param: fsb2_flavor_name }
+ availability_zone: { get_param: availability_zone_0 }
+ metadata:
+ VNF_id: { get_param: vnfvfVF_id }
+ vf_module_id: { get_param: vf_module_id }
+ networks:
+ - port: { get_resource: FSB2_Internal1 }
+ - port: { get_resource: FSB2_Internal2 }
+ - port: { get_resource: FSB2_OAM }
+outputs:
+ expose_resource_nove_output:
+ description: the pcrf_server
+ value: { get_resource: FSB2 }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive/firstVol.yaml
new file mode 100644
index 0000000000..7e82b2a7e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive/firstVol.yaml
@@ -0,0 +1,19 @@
+
+heat_template_version: 2013-05-23
+
+parameters:
+ not_null:
+ type: number
+ label: not_number
+
+
+resources:
+ volume_expose:
+ type: OS::Cinder::Volume
+ properties:
+ not_null: not_null
+outputs:
+ not_expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: volume_expose }
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive/second.yaml
new file mode 100644
index 0000000000..bb06b9d60a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive/second.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat second
+
+resources:
+ network_expose:
+ type: OS::Neutron::Net
+
+outputs:
+ expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: network_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/MANIFEST.json
new file mode 100644
index 0000000000..76ce6de6e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/MANIFEST.json
@@ -0,0 +1,27 @@
+{
+ "name": "validTest",
+ "description": "Valid Test",
+ "version": "1610",
+ "data": [
+ {
+ "file": "first.yaml",
+ "type": "HEAT",
+ "isBase": true,
+ "data": [
+ {
+ "file": "first.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "firstVol.yaml",
+ "type": "HEAT_VOL"
+ }
+ ]
+ },
+ {
+ "file": "second.yaml",
+ "type": "HEAT",
+ "isBase": false
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/first.env
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/first.env
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/first.yaml
new file mode 100644
index 0000000000..d82e1ee2d3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/first.yaml
@@ -0,0 +1,27 @@
+heat_template_version: 2013-05-23
+
+description: heat expose volume resource
+
+resources:
+
+ FSB2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: fsb_name_2 }
+ block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }]
+ flavor: { get_param: fsb2_flavor_name }
+ availability_zone: { get_param: availability_zone_0 }
+ metadata:
+ not_VF_id: { get_param: vnfvfVF_id }
+ vf_module_id: { get_param: vf_module_id }
+ networks:
+ - port: { get_resource: FSB2_Internal1 }
+ - port: { get_resource: FSB2_Internal2 }
+ - port: { get_resource: FSB2_OAM }
+outputs:
+ expose_resource_nove_output_1:
+ description: the pcrf_server
+ value: { get_resource: FSB2 }
+
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/firstVol.yaml
new file mode 100644
index 0000000000..7e82b2a7e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/firstVol.yaml
@@ -0,0 +1,19 @@
+
+heat_template_version: 2013-05-23
+
+parameters:
+ not_null:
+ type: number
+ label: not_number
+
+
+resources:
+ volume_expose:
+ type: OS::Cinder::Volume
+ properties:
+ not_null: not_null
+outputs:
+ not_expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: volume_expose }
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/second.yaml
new file mode 100644
index 0000000000..bb06b9d60a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/second.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat second
+
+resources:
+ network_expose:
+ type: OS::Neutron::Net
+
+outputs:
+ expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: network_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/MANIFEST.json
new file mode 100644
index 0000000000..76ce6de6e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/MANIFEST.json
@@ -0,0 +1,27 @@
+{
+ "name": "validTest",
+ "description": "Valid Test",
+ "version": "1610",
+ "data": [
+ {
+ "file": "first.yaml",
+ "type": "HEAT",
+ "isBase": true,
+ "data": [
+ {
+ "file": "first.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "firstVol.yaml",
+ "type": "HEAT_VOL"
+ }
+ ]
+ },
+ {
+ "file": "second.yaml",
+ "type": "HEAT",
+ "isBase": false
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/first.env
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/first.env
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/first.yaml
new file mode 100644
index 0000000000..85bb15837b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/first.yaml
@@ -0,0 +1,26 @@
+heat_template_version: 2013-05-23
+
+description: heat expose volume resource
+
+resources:
+
+ FSB2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: fsb_name_2 }
+ block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }]
+ flavor: { get_param: fsb2_flavor_name }
+ availability_zone: { get_param: availability_zone_0 }
+ metadata:
+ VnF_id: { get_param: vnfvfVF_id }
+ vf_module_id: { get_param: vf_module_id }
+ networks:
+ - port: { get_resource: FSB2_Internal1 }
+ - port: { get_resource: FSB2_Internal2 }
+ - port: { get_resource: FSB2_OAM }
+outputs:
+ expose_resource_nove_output:
+ description: the pcrf_server
+ value: { get_resource: FSB2 }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/firstVol.yaml
new file mode 100644
index 0000000000..7e82b2a7e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/firstVol.yaml
@@ -0,0 +1,19 @@
+
+heat_template_version: 2013-05-23
+
+parameters:
+ not_null:
+ type: number
+ label: not_number
+
+
+resources:
+ volume_expose:
+ type: OS::Cinder::Volume
+ properties:
+ not_null: not_null
+outputs:
+ not_expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: volume_expose }
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/second.yaml
new file mode 100644
index 0000000000..bb06b9d60a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/second.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat second
+
+resources:
+ network_expose:
+ type: OS::Neutron::Net
+
+outputs:
+ expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: network_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/MANIFEST.json
new file mode 100644
index 0000000000..76ce6de6e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/MANIFEST.json
@@ -0,0 +1,27 @@
+{
+ "name": "validTest",
+ "description": "Valid Test",
+ "version": "1610",
+ "data": [
+ {
+ "file": "first.yaml",
+ "type": "HEAT",
+ "isBase": true,
+ "data": [
+ {
+ "file": "first.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "firstVol.yaml",
+ "type": "HEAT_VOL"
+ }
+ ]
+ },
+ {
+ "file": "second.yaml",
+ "type": "HEAT",
+ "isBase": false
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/first.env
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/first.env
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/first.yaml
new file mode 100644
index 0000000000..3a8e71939f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/first.yaml
@@ -0,0 +1,43 @@
+heat_template_version: 2013-05-23
+
+description: heat expose volume resource
+
+resources:
+
+ FSB2:
+ type: OS::Nova::Server
+ properties:
+ name: {get_param: pcrf_pps_server_4}
+ block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }]
+ flavor: { get_param: fsb2_flavor_name }
+ availability_zone: { get_param: availability_zone_0 }
+ metadata:
+ VnF_id: { get_param: vnfvfVF_id }
+ vf_module_id: { get_param: vf_module_id }
+ networks:
+ - port: { get_resource: FSB2_Internal1 }
+ - port: { get_resource: FSB2_Internal2 }
+ - port: { get_resource: FSB2_OAM }
+ FSB3:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [pcrf_pps_server, 0] }
+ block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }]
+ flavor: { get_param: fsb2_flavor_name }
+ availability_zone: { get_param: availability_zone_0 }
+ metadata:
+ VnF_id: { get_param: vnfvfVF_id }
+ vf_module_id: { get_param: vf_module_id }
+ networks:
+ - port: { get_resource: FSB2_Internal1 }
+ - port: { get_resource: FSB2_Internal2 }
+ - port: { get_resource: FSB2_OAM }
+outputs:
+ expose_resource_nove_output2:
+ description: the pcrf_server
+ value: { get_resource: FSB2 }
+ expose_resource_nove_output3:
+ description: the pcrf_server
+ value: { get_resource: FSB3 }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/firstVol.yaml
new file mode 100644
index 0000000000..7e82b2a7e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/firstVol.yaml
@@ -0,0 +1,19 @@
+
+heat_template_version: 2013-05-23
+
+parameters:
+ not_null:
+ type: number
+ label: not_number
+
+
+resources:
+ volume_expose:
+ type: OS::Cinder::Volume
+ properties:
+ not_null: not_null
+outputs:
+ not_expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: volume_expose }
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/second.yaml
new file mode 100644
index 0000000000..bb06b9d60a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/second.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat second
+
+resources:
+ network_expose:
+ type: OS::Neutron::Net
+
+outputs:
+ expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: network_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive/MANIFEST.json
new file mode 100644
index 0000000000..76ce6de6e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive/MANIFEST.json
@@ -0,0 +1,27 @@
+{
+ "name": "validTest",
+ "description": "Valid Test",
+ "version": "1610",
+ "data": [
+ {
+ "file": "first.yaml",
+ "type": "HEAT",
+ "isBase": true,
+ "data": [
+ {
+ "file": "first.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "firstVol.yaml",
+ "type": "HEAT_VOL"
+ }
+ ]
+ },
+ {
+ "file": "second.yaml",
+ "type": "HEAT",
+ "isBase": false
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive/first.env
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive/first.env
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive/first.yaml
new file mode 100644
index 0000000000..13fc942865
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive/first.yaml
@@ -0,0 +1,57 @@
+heat_template_version: 2013-05-23
+
+description: heat expose volume resource
+
+resources:
+
+ FSB2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: pcrf_pps_server_name_4 }
+ block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }]
+ flavor: { get_param: fsb2_flavor_name }
+ availability_zone: { get_param: availability_zone_0 }
+ metadata:
+ VnF_id: { get_param: vnfvfVF_id }
+ vf_module_id: { get_param: vf_module_id }
+ networks:
+ - port: { get_resource: FSB2_Internal1 }
+ - port: { get_resource: FSB2_Internal2 }
+ - port: { get_resource: FSB2_OAM }
+ FSB3:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [pcrf_pps_server_names, 0] }
+ block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }]
+ flavor: { get_param: fsb2_flavor_name }
+ availability_zone: { get_param: availability_zone_0 }
+ metadata:
+ VnF_id: { get_param: vnfvfVF_id }
+ vf_module_id: { get_param: vf_module_id }
+ networks:
+ - port: { get_resource: FSB2_Internal1 }
+ - port: { get_resource: FSB2_Internal2 }
+ - port: { get_resource: FSB2_OAM }
+ FSB4:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [pcrf_pps_server_names, {get_param: index_num}] }
+ block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }]
+ flavor: { get_param: fsb2_flavor_name }
+ availability_zone: { get_param: availability_zone_0 }
+ metadata:
+ VnF_id: { get_param: vnfvfVF_id }
+ vf_module_id: { get_param: vf_module_id }
+ networks:
+ - port: { get_resource: FSB2_Internal1 }
+ - port: { get_resource: FSB2_Internal2 }
+ - port: { get_resource: FSB2_OAM }
+outputs:
+ expose_resource_nove_output2:
+ description: the pcrf_server
+ value: { get_resource: FSB2 }
+ expose_resource_nove_output3:
+ description: the pcrf_server
+ value: { get_resource: FSB3 }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive/firstVol.yaml
new file mode 100644
index 0000000000..7e82b2a7e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive/firstVol.yaml
@@ -0,0 +1,19 @@
+
+heat_template_version: 2013-05-23
+
+parameters:
+ not_null:
+ type: number
+ label: not_number
+
+
+resources:
+ volume_expose:
+ type: OS::Cinder::Volume
+ properties:
+ not_null: not_null
+outputs:
+ not_expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: volume_expose }
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive/second.yaml
new file mode 100644
index 0000000000..bb06b9d60a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive/second.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat second
+
+resources:
+ network_expose:
+ type: OS::Neutron::Net
+
+outputs:
+ expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: network_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/MANIFEST.json
new file mode 100644
index 0000000000..76ce6de6e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/MANIFEST.json
@@ -0,0 +1,27 @@
+{
+ "name": "validTest",
+ "description": "Valid Test",
+ "version": "1610",
+ "data": [
+ {
+ "file": "first.yaml",
+ "type": "HEAT",
+ "isBase": true,
+ "data": [
+ {
+ "file": "first.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "firstVol.yaml",
+ "type": "HEAT_VOL"
+ }
+ ]
+ },
+ {
+ "file": "second.yaml",
+ "type": "HEAT",
+ "isBase": false
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/first.env
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/first.env
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/first.yaml
new file mode 100644
index 0000000000..85a4c58334
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/first.yaml
@@ -0,0 +1,40 @@
+heat_template_version: 2013-05-23
+
+description: heat expose volume resource
+
+resources:
+ port_resource_0:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_param: Internal1_net_id }
+ fixed_ips:
+ - ip_address: {get_param: pcrf_net_ips}
+ - ip_address: {get_param: pcrf_net_v6_ip_a}
+ port_resource_1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_param: Internal1_net_name }
+ fixed_ips:
+ - ip_address: {get_param: pcrf_net_v6_ips}
+ - ip_address: { "Fn::Select" : [ { get_param: indx }, { get_param: [{ get_param: mvs_mgmt_ip_0 }] } ] }
+ port_resource_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_param: Internal1_net_fqdn }
+ fixed_ips:
+ - ip_address: {get_param: pcrf_net_ipz}
+ - ip_address: {get_param: pcrf_net_v6_ip_4}
+ - ip_address": {get_param: pcrf_net_v0_ip_3}
+
+outputs:
+ expose_resource_port_output_0:
+ description: the pcrf_server
+ value: { get_resource: port_resource_0 }
+ expose_resource_port_output_1:
+ description: the pcrf_server
+ value: { get_resource: port_resource_1 }
+ expose_resource_port_output_2:
+ description: the pcrf_server
+ value: { get_resource: port_resource_2 }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/firstVol.yaml
new file mode 100644
index 0000000000..7e82b2a7e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/firstVol.yaml
@@ -0,0 +1,19 @@
+
+heat_template_version: 2013-05-23
+
+parameters:
+ not_null:
+ type: number
+ label: not_number
+
+
+resources:
+ volume_expose:
+ type: OS::Cinder::Volume
+ properties:
+ not_null: not_null
+outputs:
+ not_expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: volume_expose }
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/second.yaml
new file mode 100644
index 0000000000..bb06b9d60a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/second.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat second
+
+resources:
+ network_expose:
+ type: OS::Neutron::Net
+
+outputs:
+ expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: network_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive/MANIFEST.json
new file mode 100644
index 0000000000..76ce6de6e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive/MANIFEST.json
@@ -0,0 +1,27 @@
+{
+ "name": "validTest",
+ "description": "Valid Test",
+ "version": "1610",
+ "data": [
+ {
+ "file": "first.yaml",
+ "type": "HEAT",
+ "isBase": true,
+ "data": [
+ {
+ "file": "first.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "firstVol.yaml",
+ "type": "HEAT_VOL"
+ }
+ ]
+ },
+ {
+ "file": "second.yaml",
+ "type": "HEAT",
+ "isBase": false
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive/first.env
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive/first.env
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive/first.yaml
new file mode 100644
index 0000000000..7e0aaa373d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive/first.yaml
@@ -0,0 +1,39 @@
+heat_template_version: 2013-05-23
+
+description: heat expose volume resource
+
+resources:
+ port_resource_0:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_param: Internal1_net_id }
+ fixed_ips:
+ - ip_address: {get_param: pcrf_net_ips}
+
+ port_resource_1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_param: Internal1_net_name }
+ fixed_ips:
+ - ip_address: {get_param: pcrf_net_v6_ips}
+
+ port_resource_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_param: Internal1_net_fqdn }
+ fixed_ips:
+ - ip_address: {get_param: pcrf_net_ip_4}
+ - ip_address: {get_param: pcrf_net_v6_ip_4}
+
+outputs:
+ expose_resource_port_output_0:
+ description: the pcrf_server
+ value: { get_resource: port_resource_0 }
+ expose_resource_port_output_1:
+ description: the pcrf_server
+ value: { get_resource: port_resource_1 }
+ expose_resource_port_output_2:
+ description: the pcrf_server
+ value: { get_resource: port_resource_2 }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive/firstVol.yaml
new file mode 100644
index 0000000000..7e82b2a7e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive/firstVol.yaml
@@ -0,0 +1,19 @@
+
+heat_template_version: 2013-05-23
+
+parameters:
+ not_null:
+ type: number
+ label: not_number
+
+
+resources:
+ volume_expose:
+ type: OS::Cinder::Volume
+ properties:
+ not_null: not_null
+outputs:
+ not_expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: volume_expose }
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive/second.yaml
new file mode 100644
index 0000000000..bb06b9d60a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive/second.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat second
+
+resources:
+ network_expose:
+ type: OS::Neutron::Net
+
+outputs:
+ expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: network_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/MANIFEST.json
new file mode 100644
index 0000000000..76ce6de6e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/MANIFEST.json
@@ -0,0 +1,27 @@
+{
+ "name": "validTest",
+ "description": "Valid Test",
+ "version": "1610",
+ "data": [
+ {
+ "file": "first.yaml",
+ "type": "HEAT",
+ "isBase": true,
+ "data": [
+ {
+ "file": "first.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "firstVol.yaml",
+ "type": "HEAT_VOL"
+ }
+ ]
+ },
+ {
+ "file": "second.yaml",
+ "type": "HEAT",
+ "isBase": false
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/first.env
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/first.env
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/first.yaml
new file mode 100644
index 0000000000..abbf650c8d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/first.yaml
@@ -0,0 +1,28 @@
+heat_template_version: 2013-05-23
+
+description: heat expose volume resource
+
+resources:
+ port_resource:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_param: not_valid_network_name }
+ port_resource_1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_param: not_valid_net }
+ port_resource_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_param: not_valid_net_id_error }
+ port_resource_3:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_param: }
+
+outputs:
+ expose_resource_port_output:
+ description: the pcrf_server
+ value: { get_resource: port_resource }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/firstVol.yaml
new file mode 100644
index 0000000000..7e82b2a7e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/firstVol.yaml
@@ -0,0 +1,19 @@
+
+heat_template_version: 2013-05-23
+
+parameters:
+ not_null:
+ type: number
+ label: not_number
+
+
+resources:
+ volume_expose:
+ type: OS::Cinder::Volume
+ properties:
+ not_null: not_null
+outputs:
+ not_expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: volume_expose }
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/second.yaml
new file mode 100644
index 0000000000..bb06b9d60a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/second.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat second
+
+resources:
+ network_expose:
+ type: OS::Neutron::Net
+
+outputs:
+ expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: network_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/MANIFEST.json
new file mode 100644
index 0000000000..76ce6de6e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/MANIFEST.json
@@ -0,0 +1,27 @@
+{
+ "name": "validTest",
+ "description": "Valid Test",
+ "version": "1610",
+ "data": [
+ {
+ "file": "first.yaml",
+ "type": "HEAT",
+ "isBase": true,
+ "data": [
+ {
+ "file": "first.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "firstVol.yaml",
+ "type": "HEAT_VOL"
+ }
+ ]
+ },
+ {
+ "file": "second.yaml",
+ "type": "HEAT",
+ "isBase": false
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/first.env
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/first.env
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/first.yaml
new file mode 100644
index 0000000000..c6128e9470
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/first.yaml
@@ -0,0 +1,33 @@
+heat_template_version: 2013-05-23
+
+description: heat expose volume resource
+
+resources:
+ port_resource_0:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_param: Internal1_net_id }
+resources:
+ port_resource_1:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_param: Internal1_net_name }
+resources:
+ port_resource_2:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_param: Internal1_net_fqdn }
+
+
+outputs:
+ expose_resource_port_output_0:
+ description: the pcrf_server
+ value: { get_resource: port_resource_0 }
+expose_resource_port_output_1:
+ description: the pcrf_server
+ value: { get_resource: port_resource_1 }
+expose_resource_port_output_2:
+ description: the pcrf_server
+ value: { get_resource: port_resource_2 }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/firstVol.yaml
new file mode 100644
index 0000000000..7e82b2a7e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/firstVol.yaml
@@ -0,0 +1,19 @@
+
+heat_template_version: 2013-05-23
+
+parameters:
+ not_null:
+ type: number
+ label: not_number
+
+
+resources:
+ volume_expose:
+ type: OS::Cinder::Volume
+ properties:
+ not_null: not_null
+outputs:
+ not_expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: volume_expose }
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/second.yaml
new file mode 100644
index 0000000000..bb06b9d60a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/second.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat second
+
+resources:
+ network_expose:
+ type: OS::Neutron::Net
+
+outputs:
+ expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: network_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/MANIFEST.json
new file mode 100644
index 0000000000..76ce6de6e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/MANIFEST.json
@@ -0,0 +1,27 @@
+{
+ "name": "validTest",
+ "description": "Valid Test",
+ "version": "1610",
+ "data": [
+ {
+ "file": "first.yaml",
+ "type": "HEAT",
+ "isBase": true,
+ "data": [
+ {
+ "file": "first.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "firstVol.yaml",
+ "type": "HEAT_VOL"
+ }
+ ]
+ },
+ {
+ "file": "second.yaml",
+ "type": "HEAT",
+ "isBase": false
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/first.env
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/first.env
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/first.yaml
new file mode 100644
index 0000000000..3173885d7e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/first.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat expose volume resource
+
+resources:
+ volume_expose:
+ type: OS::Cinder::Volume
+
+outputs:
+ not_expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: volume_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/firstVol.yaml
new file mode 100644
index 0000000000..4f0d65a735
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/firstVol.yaml
@@ -0,0 +1,19 @@
+
+heat_template_version: 2013-05-23
+
+parameters:
+ not_null:
+ type: number
+ label: not_number
+
+
+resources:
+ volume_expose:
+ type: OS::Cinder::Volume
+ properties:
+ not_null: not_null
+outputs:
+ not_expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_param: volume_expose }
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/second.yaml
new file mode 100644
index 0000000000..bb06b9d60a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/second.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat second
+
+resources:
+ network_expose:
+ type: OS::Neutron::Net
+
+outputs:
+ expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: network_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/MANIFEST.json
new file mode 100644
index 0000000000..76ce6de6e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/MANIFEST.json
@@ -0,0 +1,27 @@
+{
+ "name": "validTest",
+ "description": "Valid Test",
+ "version": "1610",
+ "data": [
+ {
+ "file": "first.yaml",
+ "type": "HEAT",
+ "isBase": true,
+ "data": [
+ {
+ "file": "first.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "firstVol.yaml",
+ "type": "HEAT_VOL"
+ }
+ ]
+ },
+ {
+ "file": "second.yaml",
+ "type": "HEAT",
+ "isBase": false
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/first.env
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/first.env
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/first.yaml
new file mode 100644
index 0000000000..63b576edb8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/first.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat expose volume resource
+
+resources:
+ volume_expose:
+ type: OS::Cinder::Volume
+
+outputs:
+ expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: volume_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/firstVol.yaml
new file mode 100644
index 0000000000..7e82b2a7e6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/firstVol.yaml
@@ -0,0 +1,19 @@
+
+heat_template_version: 2013-05-23
+
+parameters:
+ not_null:
+ type: number
+ label: not_number
+
+
+resources:
+ volume_expose:
+ type: OS::Cinder::Volume
+ properties:
+ not_null: not_null
+outputs:
+ not_expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: volume_expose }
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/second.yaml
new file mode 100644
index 0000000000..bb06b9d60a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/second.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat second
+
+resources:
+ network_expose:
+ type: OS::Neutron::Net
+
+outputs:
+ expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: network_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/MANIFEST.json
new file mode 100644
index 0000000000..a189124e6c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/MANIFEST.json
@@ -0,0 +1,27 @@
+{
+ "name": "validTest",
+ "description": "Valid Test",
+ "version": "1610",
+ "data": [
+ {
+ "file": "first.yaml",
+ "type": "HEAT",
+ "isBase": false,
+ "data": [
+ {
+ "file": "first.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "firstVol.yaml",
+ "type": "HEAT_VOL"
+ }
+ ]
+ },
+ {
+ "file": "second.yaml",
+ "type": "HEAT",
+ "isBase": false
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/first.env
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/first.env
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/first.yaml
new file mode 100644
index 0000000000..bb06b9d60a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/first.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat second
+
+resources:
+ network_expose:
+ type: OS::Neutron::Net
+
+outputs:
+ expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: network_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/firstVol.yaml
new file mode 100644
index 0000000000..9e26dfeeb6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/firstVol.yaml
@@ -0,0 +1 @@
+{} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/second.yaml
new file mode 100644
index 0000000000..bb06b9d60a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/second.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat second
+
+resources:
+ network_expose:
+ type: OS::Neutron::Net
+
+outputs:
+ expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_resource: network_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/multiBaseHeat/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/multiBaseHeat/MANIFEST.json
new file mode 100644
index 0000000000..3de70a21df
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/multiBaseHeat/MANIFEST.json
@@ -0,0 +1,27 @@
+{
+ "name": "validTest",
+ "description": "Valid Test",
+ "version": "1610",
+ "data": [
+ {
+ "file": "first.yaml",
+ "type": "HEAT",
+ "isBase": true,
+ "data": [
+ {
+ "file": "first.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "firstVol.yaml",
+ "type": "HEAT_VOL"
+ }
+ ]
+ },
+ {
+ "file": "second.yaml",
+ "type": "HEAT",
+ "isBase": true
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/multiBaseHeat/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/multiBaseHeat/first.env
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/multiBaseHeat/first.env
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/multiBaseHeat/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/multiBaseHeat/first.yaml
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/multiBaseHeat/first.yaml
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/multiBaseHeat/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/multiBaseHeat/firstVol.yaml
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/multiBaseHeat/firstVol.yaml
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/multiBaseHeat/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/multiBaseHeat/second.yaml
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/multiBaseHeat/second.yaml
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/availability_zone_name/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/availability_zone_name/expected_output/expected_output.json
new file mode 100644
index 0000000000..e9106a850c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/availability_zone_name/expected_output/expected_output.json
@@ -0,0 +1,38 @@
+{
+ "hot-nimbus-pps_v1.0.yaml": {
+ "errorMessageList": [
+ {
+ "level": "WARNING",
+ "message": "Server Availability Zone not aligned with Guidelines, Resource ID [availability_zone_illegal_name_1]"
+ },
+ {
+ "level": "WARNING",
+ "message": "Server Availability Zone not aligned with Guidelines, Resource ID [availability_zone_illegal_name_2]"
+ }
+ ]
+ },
+ "nested-pps_v1.0.yaml": {
+ "errorMessageList": [
+ {
+ "level": "WARNING",
+ "message": "Missing VF_MODULE_ID resource id [pcrf_server_pps]"
+ },
+ {
+ "level": "WARNING",
+ "message": "Server Name not aligned with Guidelines, Resource ID [pcrf_server_pps]"
+ },
+ {
+ "level": "WARNING",
+ "message": "Fixed_IPS not aligned with Guidelines, Resource ID [pcrf_pps_port_0]"
+ }
+ ]
+ },
+ "MANIFEST.json": {
+ "errorMessageList": [
+ {
+ "level": "WARNING",
+ "message": "Missing Base HEAT. Pay attention that without Base HEAT, there will be no shared resources"
+ }
+ ]
+ }
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/availability_zone_name/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/availability_zone_name/input/MANIFEST.json
new file mode 100644
index 0000000000..1e719efb31
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/availability_zone_name/input/MANIFEST.json
@@ -0,0 +1,17 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/availability_zone_name/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/availability_zone_name/input/hot-nimbus-pps_v1.0.env
new file mode 100644
index 0000000000..809835d2b8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/availability_zone_name/input/hot-nimbus-pps_v1.0.env
@@ -0,0 +1,12 @@
+parameters:
+ pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006
+ pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_pps_flavor_name: lc.3xlarge
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+ mock_param: abskdjska
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/availability_zone_name/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/availability_zone_name/input/hot-nimbus-pps_v1.0.yaml
new file mode 100644
index 0000000000..1b865e75d5
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/availability_zone_name/input/hot-nimbus-pps_v1.0.yaml
@@ -0,0 +1,92 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_names:
+ type: comma_delimited_list
+ label: PCRF PS server names
+ description: PCRF PS server names
+ pcrf_pps_image_name:
+ type: string
+ default: True
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+ availability_zone_1:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+
+resources:
+
+
+ availability_zone_legal_name_1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [pcrf_pps_server_names, 0] }
+ availability_zone: {get_param: availability_zone_1}
+ flavor: { get_param: pcrf_flavor_name }
+ metadata:
+ vnf_id: { get_param: pcrf_vnf_id }
+ vf_module_id: { get_param: pcrf_vnf_module_id }
+
+ availability_zone_legal_name_2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [pcrf_pps_server_names, 0] }
+ availability_zone: {get_resource: availability_zone_1}
+ flavor: { get_param: pcrf_flavor_name }
+ metadata:
+ vnf_id: { get_param: pcrf_vnf_id }
+ vf_module_id: { get_param: pcrf_vnf_module_id }
+
+ availability_zone_illegal_name_1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [pcrf_pps_server_names, 0] }
+ availability_zone: {get_param: availability_zone_name}
+ flavor: { get_param: pcrf_flavor_name }
+ metadata:
+ vnf_id: { get_param: pcrf_vnf_id }
+ vf_module_id: { get_param: pcrf_vnf_module_id }
+
+ availability_zone_illegal_name_2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [pcrf_pps_server_names, 0] }
+ availability_zone: {get_param: availability_zone}
+ flavor: { get_param: pcrf_flavor_name }
+ metadata:
+ vnf_id: { get_param: pcrf_vnf_id }
+ vf_module_id: { get_param: pcrf_vnf_module_id }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/floating_ip_resource_type/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/floating_ip_resource_type/expected_output/expected_output.json
new file mode 100644
index 0000000000..f0dc0d21a1
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/floating_ip_resource_type/expected_output/expected_output.json
@@ -0,0 +1,34 @@
+{
+ "hot-nimbus-pps_v1.0.yaml": {
+ "errorMessageList": [
+ {
+ "level": "WARNING",
+ "message": "OS::Neutron::FloatingIP is in use, Resource ID [floating_ip_type]"
+ }
+ ]
+ },
+ "nested-pps_v1.0.yaml": {
+ "errorMessageList": [
+ {
+ "level": "WARNING",
+ "message": "Missing VF_MODULE_ID resource id [pcrf_server_pps]"
+ },
+ {
+ "level": "WARNING",
+ "message": "Server Name not aligned with Guidelines, Resource ID [pcrf_server_pps]"
+ },
+ {
+ "level": "WARNING",
+ "message": "Fixed_IPS not aligned with Guidelines, Resource ID [pcrf_pps_port_0]"
+ }
+ ]
+ },
+ "MANIFEST.json": {
+ "errorMessageList": [
+ {
+ "level": "WARNING",
+ "message": "Missing Base HEAT. Pay attention that without Base HEAT, there will be no shared resources"
+ }
+ ]
+ }
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/floating_ip_resource_type/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/floating_ip_resource_type/input/MANIFEST.json
new file mode 100644
index 0000000000..1e719efb31
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/floating_ip_resource_type/input/MANIFEST.json
@@ -0,0 +1,17 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/floating_ip_resource_type/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/floating_ip_resource_type/input/hot-nimbus-pps_v1.0.env
new file mode 100644
index 0000000000..809835d2b8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/floating_ip_resource_type/input/hot-nimbus-pps_v1.0.env
@@ -0,0 +1,12 @@
+parameters:
+ pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006
+ pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_pps_flavor_name: lc.3xlarge
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+ mock_param: abskdjska
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/floating_ip_resource_type/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/floating_ip_resource_type/input/hot-nimbus-pps_v1.0.yaml
new file mode 100644
index 0000000000..05724cf55b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/floating_ip_resource_type/input/hot-nimbus-pps_v1.0.yaml
@@ -0,0 +1,71 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_names:
+ type: comma_delimited_list
+ label: PCRF PS server names
+ description: PCRF PS server names
+ pcrf_pps_image_name:
+ type: string
+ default: True
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+ availability_zone_1:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+
+resources:
+ legal_resource_type1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [pcrf_pps_server_names, 0] }
+ availability_zone: {get_param: availability_zone_1}
+ flavor: {get_param: pcrf_flavor_name}
+ metadata:
+ vnf_id: { get_param: pcrf_vnf_id }
+ vf_module_id: { get_param: pcrf_vnf_module_id }
+
+ floating_ip_type:
+ type: OS::Neutron::FloatingIP
+ properties:
+ name: { get_param: [pcrf_pps_server_names, 0] }
+ availability_zone: {get_param: availability_zone_name}
+ metadata:
+ vnf_id: { get_param: pcrf_vnf_id }
+ vf_module_id: { get_param: pcrf_vnf_module_id }
+
+
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/neutron_port_fixed_ip_name/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/neutron_port_fixed_ip_name/expected_output/expected_output.json
new file mode 100644
index 0000000000..7eefd3d36e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/neutron_port_fixed_ip_name/expected_output/expected_output.json
@@ -0,0 +1,42 @@
+{
+ "hot-nimbus-pps_v1.0.yaml": {
+ "errorMessageList": [
+ {
+ "level": "WARNING",
+ "message": "Fixed_IPS not aligned with Guidelines, Resource ID [fixed_ip_illegal_name_1]"
+ },
+ {
+ "level": "WARNING",
+ "message": "Fixed_IPS not aligned with Guidelines, Resource ID [fixed_ip_illegal_name_2]"
+ },
+ {
+ "level": "WARNING",
+ "message": "Fixed_IPS not aligned with Guidelines, Resource ID [fixed_ip_illegal_name_3]"
+ }
+ ]
+ },
+ "nested-pps_v1.0.yaml": {
+ "errorMessageList": [
+ {
+ "level": "WARNING",
+ "message": "Missing VF_MODULE_ID resource id [pcrf_server_pps]"
+ },
+ {
+ "level": "WARNING",
+ "message": "Server Name not aligned with Guidelines, Resource ID [pcrf_server_pps]"
+ },
+ {
+ "level": "WARNING",
+ "message": "Fixed_IPS not aligned with Guidelines, Resource ID [pcrf_pps_port_0]"
+ }
+ ]
+ },
+ "MANIFEST.json": {
+ "errorMessageList": [
+ {
+ "level": "WARNING",
+ "message": "Missing Base HEAT. Pay attention that without Base HEAT, there will be no shared resources"
+ }
+ ]
+ }
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/neutron_port_fixed_ip_name/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/neutron_port_fixed_ip_name/input/MANIFEST.json
new file mode 100644
index 0000000000..1e719efb31
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/neutron_port_fixed_ip_name/input/MANIFEST.json
@@ -0,0 +1,17 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/neutron_port_fixed_ip_name/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/neutron_port_fixed_ip_name/input/hot-nimbus-pps_v1.0.env
new file mode 100644
index 0000000000..809835d2b8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/neutron_port_fixed_ip_name/input/hot-nimbus-pps_v1.0.env
@@ -0,0 +1,12 @@
+parameters:
+ pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006
+ pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_pps_flavor_name: lc.3xlarge
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+ mock_param: abskdjska
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/neutron_port_fixed_ip_name/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/neutron_port_fixed_ip_name/input/hot-nimbus-pps_v1.0.yaml
new file mode 100644
index 0000000000..749b7144b6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/neutron_port_fixed_ip_name/input/hot-nimbus-pps_v1.0.yaml
@@ -0,0 +1,128 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_names:
+ type: comma_delimited_list
+ label: PCRF PS server names
+ description: PCRF PS server names
+ pcrf_pps_image_name:
+ type: string
+ default: True
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+ pcrf_net_ips:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+ pcrf_net_v6_ips:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+ pcrf_net_ip_4:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+ pcrf_net_v6_ip_4:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+ pcrf_net_ipz:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+ pcrf_net_v0_ip_3:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+ pcrf_net_v6_ip_a:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+
+ fixed_ip_legal_name_1:
+ type: OS::Neutron::Port
+ properties:
+ name: {get_param: pcrf_pps_image_name}
+ fixed_ips:
+ - ip_address: {get_param: pcrf_net_ips}
+
+ fixed_ip_legal_name_2:
+ type: OS::Neutron::Port
+ properties:
+ name: {get_param: pcrf_pps_image_name}
+ fixed_ips:
+ - ip_address: {get_param: pcrf_net_v6_ips}
+
+ fixed_ip_legal_name_3:
+ type: OS::Neutron::Port
+ properties:
+ name: {get_param: pcrf_pps_image_name}
+ fixed_ips:
+ - ip_address: {get_param: pcrf_net_ip_4}
+
+ fixed_ip_legal_name_4:
+ type: OS::Neutron::Port
+ properties:
+ name: {get_param: pcrf_pps_image_name}
+ fixed_ips:
+ - ip_address: {get_param: pcrf_net_v6_ip_4}
+
+ fixed_ip_legal_name_5:
+ type: OS::Neutron::Port
+ properties:
+ name: {get_param: pcrf_pps_image_name}
+ fixed_ips:
+ - ip_address: {get_resource: pcrf_net_v6_ip_4}
+
+ fixed_ip_illegal_name_1:
+ type: OS::Neutron::Port
+ properties:
+ name: {get_param: pcrf_pps_image_name}
+ fixed_ips:
+ - ip_address: {get_param: pcrf_net_ipz}
+
+ fixed_ip_illegal_name_2:
+ type: OS::Neutron::Port
+ properties:
+ name: {get_param: pcrf_pps_image_name}
+ fixed_ips:
+ - ip_address": {get_param: pcrf_net_v0_ip_3}
+
+ fixed_ip_illegal_name_3:
+ type: OS::Neutron::Port
+ properties:
+ name: {get_param: pcrf_pps_image_name}
+ fixed_ips:
+ - ip_address: {get_param: pcrf_net_v6_ip_a}
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/nova_server_name/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/nova_server_name/expected_output/expected_output.json
new file mode 100644
index 0000000000..ca1f58c1f8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/nova_server_name/expected_output/expected_output.json
@@ -0,0 +1,50 @@
+{
+ "hot-nimbus-pps_v1.0.yaml": {
+ "errorMessageList": [
+ {
+ "level": "WARNING",
+ "message": "Server Name not aligned with Guidelines, Resource ID [nova_server_ilegal_name_1]"
+ },
+ {
+ "level": "WARNING",
+ "message": "Server Name not aligned with Guidelines, Resource ID [nova_server_ilegal_name_2]"
+ },
+ {
+ "level": "WARNING",
+ "message": "Server Name not aligned with Guidelines, Resource ID [nova_server_ilegal_name_3]"
+ },
+ {
+ "level": "WARNING",
+ "message": "Server Name not aligned with Guidelines, Resource ID [nova_server_ilegal_name_4]"
+ },
+ {
+ "level": "WARNING",
+ "message": "Server Name not aligned with Guidelines, Resource ID [nova_server_ilegal_name_5]"
+ }
+ ]
+ },
+ "nested-pps_v1.0.yaml": {
+ "errorMessageList": [
+ {
+ "level": "WARNING",
+ "message": "Missing VF_MODULE_ID resource id [pcrf_server_pps]"
+ },
+ {
+ "level": "WARNING",
+ "message": "Server Name not aligned with Guidelines, Resource ID [pcrf_server_pps]"
+ },
+ {
+ "level": "WARNING",
+ "message": "Fixed_IPS not aligned with Guidelines, Resource ID [pcrf_pps_port_0]"
+ }
+ ]
+ },
+ "MANIFEST.json": {
+ "errorMessageList": [
+ {
+ "level": "WARNING",
+ "message": "Missing Base HEAT. Pay attention that without Base HEAT, there will be no shared resources"
+ }
+ ]
+ }
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/nova_server_name/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/nova_server_name/input/MANIFEST.json
new file mode 100644
index 0000000000..1e719efb31
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/nova_server_name/input/MANIFEST.json
@@ -0,0 +1,17 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/nova_server_name/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/nova_server_name/input/hot-nimbus-pps_v1.0.env
new file mode 100644
index 0000000000..809835d2b8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/nova_server_name/input/hot-nimbus-pps_v1.0.env
@@ -0,0 +1,12 @@
+parameters:
+ pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006
+ pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_pps_flavor_name: lc.3xlarge
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+ mock_param: abskdjska
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/nova_server_name/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/nova_server_name/input/hot-nimbus-pps_v1.0.yaml
new file mode 100644
index 0000000000..766cbf150f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/nova_server_name/input/hot-nimbus-pps_v1.0.yaml
@@ -0,0 +1,138 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_names:
+ type: comma_delimited_list
+ label: PCRF PS server names
+ description: PCRF PS server names
+ pcrf_pps_image_name:
+ type: string
+ default: True
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+ pcrf_vnf_module_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+ pcrf_flavor:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+ pcrf_pps_server_name_4:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+
+resources:
+ nova_server_legal_name_1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: [pcrf_pps_server_names, 0] }
+ flavor: { get_param: pcrf_flavor_name }
+ metadata:
+ vnf_id: { get_param: pcrf_vnf_id }
+ vf_module_id: { get_param: pcrf_vnf_module_id }
+
+
+ nova_server_legal_name_2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: pcrf_pps_server_name_4 }
+ flavor: { get_param: pcrf_flavor_name }
+ metadata:
+ vnf_id: { get_param: pcrf_vnf_id }
+ vf_module_id: { get_param: pcrf_vnf_module_id }
+
+ nova_server_legal_name_3:
+ type: OS::Nova::Server
+ properties:
+ name: { get_resource: pcrf_pps_server_name_4 }
+ flavor: { get_param: pcrf_flavor_name }
+ metadata:
+ vnf_id: { get_param: pcrf_vnf_id }
+ vf_module_id: { get_param: pcrf_vnf_module_id }
+
+ nova_server_ilegal_name_1:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: pcrf_pps_server_name_a }
+ flavor: { get_param: pcrf_flavor_name }
+ metadata:
+ vnf_id: { get_param: pcrf_vnf_id }
+ vf_module_id: { get_param: pcrf_vnf_module_id }
+
+ nova_server_ilegal_name_2:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: pcrf_pps_server_nameds_a }
+ flavor: { get_param: pcrf_flavor_name }
+ metadata:
+ vnf_id: { get_param: pcrf_vnf_id }
+ vf_module_id: { get_param: pcrf_vnf_module_id }
+
+ nova_server_ilegal_name_3:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: pcrf_pps_server_name_a }
+ flavor: { get_param: pcrf_pps_flavor_name }
+ metadata:
+ vnf_id: { get_param: pcrf_vnf_id }
+ vf_module_id: { get_param: pcrf_vnf_module_id }
+
+ nova_server_ilegal_name_4:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: pcrf_pps_server_name_a }
+ flavor: { get_param: pcrf_pps_flavor_name }
+ metadata:
+ vnf_id: { get_param: pcrf_vnf_id }
+ vf_module_id: { get_param: pcrf_vnf_module_id }
+
+ nova_server_ilegal_name_5:
+ type: OS::Nova::Server
+ properties:
+ name: { get_param: pcrf_pps_server_name_a }
+ flavor: { get_param: pcrf_pps_flavor_name }
+ metadata:
+ vnf_id: { get_param: pcrf_vnf_id }
+ vf_module_id: { get_param: pcrf_vnf_module_id }
+
+ nova_server_ilegal_name_6:
+ type: OS::Nova::Server
+ properties:
+ name: pcrf_pps_server_name_a
+ flavor: { get_param: pcrf_pps_flavor_name }
+ metadata:
+ vnf_id: { get_param: pcrf_vnf_id }
+ vf_module_id: { get_param: pcrf_vnf_module_id }
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/default_value_align_with_type/negative_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/default_value_align_with_type/negative_test/input/MANIFEST.json
new file mode 100644
index 0000000000..1e719efb31
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/default_value_align_with_type/negative_test/input/MANIFEST.json
@@ -0,0 +1,17 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/default_value_align_with_type/negative_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/default_value_align_with_type/negative_test/input/hot-nimbus-pps_v1.0.env
new file mode 100644
index 0000000000..8ae6fc021a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/default_value_align_with_type/negative_test/input/hot-nimbus-pps_v1.0.env
@@ -0,0 +1,11 @@
+parameters:
+ pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006
+ pcrf_pps_image_name_1: 14
+ pcrf_pps_flavor_name: lc.3xlarge
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/default_value_align_with_type/negative_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/default_value_align_with_type/negative_test/input/hot-nimbus-pps_v1.0.yaml
new file mode 100644
index 0000000000..555f6ae852
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/default_value_align_with_type/negative_test/input/hot-nimbus-pps_v1.0.yaml
@@ -0,0 +1,60 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_names:
+ type: comma_delimited_list
+ label: PCRF PS server names
+ description: PCRF PS server names
+ pcrf_pps_image_name_1:
+ type: number
+ default: True
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_image_name_2:
+ type:
+ default: True
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_image_name_3:
+ type: number
+ default:
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_pps_001:
+ type: OS::Heat::CloudConfig
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/depends_on_points_to_existing_resource/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/depends_on_points_to_existing_resource/input/MANIFEST.json
new file mode 100644
index 0000000000..a1ec6bc0f7
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/depends_on_points_to_existing_resource/input/MANIFEST.json
@@ -0,0 +1,11 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.yaml",
+ "type": "HEAT"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/depends_on_points_to_existing_resource/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/depends_on_points_to_existing_resource/input/hot-nimbus-pps_v1.0.yaml
new file mode 100644
index 0000000000..35a0efb28d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/depends_on_points_to_existing_resource/input/hot-nimbus-pps_v1.0.yaml
@@ -0,0 +1,43 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_names:
+ type: comma_delimited_list
+ label: PCRF PS server names
+ description: PCRF PS server names
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+
+resources:
+ resource_depends_on_legal_1:
+ type: OS::Heat::CloudConfig
+ depends_on: [resource_1, resource_2]
+
+ resource_depends_on_legal_2:
+ type: OS::Heat::CloudConfig
+ depends_on: resource_1
+
+ resource_depends_on_illegal_1:
+ type: OS::Heat::CloudConfig
+ depends_on: resource_not_exist
+
+ resource_depends_on_illegal_2:
+ type: OS::Heat::CloudConfig
+ depends_on: [resource_1, resource_3]
+
+ resource_depends_on_illegal_3:
+ type: OS::Heat::CloudConfig
+ depends_on:
+
+ resource_1:
+ type: OS::Heat::CloudConfig
+
+ resource_2:
+ type: OS::Heat::CloudConfig
+
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/negative_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/negative_test/input/MANIFEST.json
new file mode 100644
index 0000000000..1e719efb31
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/negative_test/input/MANIFEST.json
@@ -0,0 +1,17 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/negative_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/negative_test/input/hot-nimbus-pps_v1.0.env
new file mode 100644
index 0000000000..809835d2b8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/negative_test/input/hot-nimbus-pps_v1.0.env
@@ -0,0 +1,12 @@
+parameters:
+ pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006
+ pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_pps_flavor_name: lc.3xlarge
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+ mock_param: abskdjska
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/negative_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/negative_test/input/hot-nimbus-pps_v1.0.yaml
new file mode 100644
index 0000000000..4605195eaf
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/negative_test/input/hot-nimbus-pps_v1.0.yaml
@@ -0,0 +1,54 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_names:
+ type: comma_delimited_list
+ label: PCRF PS server names
+ description: PCRF PS server names
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+ pcrf_psm_server_name:
+ type: string
+
+resources:
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ params:
+ $vm_name: { get_param: pcrf_psm_server_name }
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/expected_output/expected_output.json
new file mode 100644
index 0000000000..9e26dfeeb6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/expected_output/expected_output.json
@@ -0,0 +1 @@
+{} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/MANIFEST.json
new file mode 100644
index 0000000000..fe7d8bdf5a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/MANIFEST.json
@@ -0,0 +1,51 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "hot-nimbus-psm_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-psm_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "nested-pps_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "nested-psm_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "mount_iso_script.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "cloud-nimbus.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "nimbus-ethernet",
+ "type": "OTHER"
+ },
+ {
+ "file": "nimbus-ethernet-gw",
+ "type": "OTHER"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/hot-nimbus-pps_v1.0.env
new file mode 100644
index 0000000000..340be2b815
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/hot-nimbus-pps_v1.0.env
@@ -0,0 +1,11 @@
+parameters:
+ pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006
+ pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_pps_flavor_name: lc.3xlarge
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/hot-nimbus-pps_v1.0.yaml
new file mode 100644
index 0000000000..05bd6c9318
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/hot-nimbus-pps_v1.0.yaml
@@ -0,0 +1,121 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_names:
+ type: comma_delimited_list
+ label: PCRF PS server names
+ description: PCRF PS server names
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_pps_001:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_002:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 1] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_003:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 2] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_004:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 3] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_005:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 4] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_006:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/hot-nimbus-psm_v1.0.env
new file mode 100644
index 0000000000..f24e4763c6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/hot-nimbus-psm_v1.0.env
@@ -0,0 +1,10 @@
+parameters:
+ pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012
+ pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_psm_flavor_name: lc.4xlarge4
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/hot-nimbus-psm_v1.0.yaml
new file mode 100644
index 0000000000..c2d7b05ead
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/hot-nimbus-psm_v1.0.yaml
@@ -0,0 +1,199 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_names:
+ type: comma_delimited_list
+ label: PCRF SM server names
+ description: name of the PCRF SM instance
+ pcrf_psm_image_name:
+ type: string
+ label: PCRF SM image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_psm_001:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_002:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_003:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_004:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_005:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_006:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_007:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_008:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_009:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_010:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_011:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_012:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/nested-pps_v1.0.yaml
new file mode 100644
index 0000000000..b7291d69d3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/nested-pps_v1.0.yaml
@@ -0,0 +1,97 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_name:
+ type: string
+ label: PCRF PS server name
+ description: PCRF PS server name
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ params:
+ $vm_name: { get_param: pcrf_pps_server_name }
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_pps:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_pps_server_name }
+ image: { get_param: pcrf_pps_image_name }
+ flavor: { get_param: pcrf_pps_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: pcrf_pps_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+
+ pcrf_pps_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/nested-psm_v1.0.yaml
new file mode 100644
index 0000000000..6868728b73
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/nested-psm_v1.0.yaml
@@ -0,0 +1,97 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_name:
+ type: string
+ label: PCRF SM server name
+ description: PCRF SM server name
+ pcrf_psm_image_name:
+ type: string
+ label: image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ params:
+ $vm_name: { get_param: pcrf_psm_server_name }
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_psm:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_psm_server_name }
+ image: { get_param: pcrf_psm_image_name }
+ flavor: { get_param: pcrf_psm_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: psm01_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+ #scheduler_hints: {group: { get_resource: servergroup_nimbus }}
+
+ psm01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_empty_value/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_empty_value/input/MANIFEST.json
new file mode 100644
index 0000000000..d383ab6c95
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_empty_value/input/MANIFEST.json
@@ -0,0 +1,17 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "env_empty_value.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "env_empty_value.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_empty_value/input/env_empty_value.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_empty_value/input/env_empty_value.env
new file mode 100644
index 0000000000..20f9eed60d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_empty_value/input/env_empty_value.env
@@ -0,0 +1,3 @@
+parameters:
+ oam_mgmt_network_id: e1724ea7-553b-470d-a9eb-ed274528a0a1
+ cluster_size:
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_empty_value/input/env_empty_value.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_empty_value/input/env_empty_value.yaml
new file mode 100644
index 0000000000..9d01d63908
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_empty_value/input/env_empty_value.yaml
@@ -0,0 +1,122 @@
+heat_template_version: 2014-10-16
+
+description: create BIG-IP VE instance
+
+parameters:
+
+ # 06-01-2015 added anti-affinity policy
+ lb_server_group:
+ type: string
+ description: Anti-affinity group for lb
+ server_name:
+ type: comma_delimited_list
+ label: BIG-IP instance name
+ description: BIG-IP instance name
+ image_name:
+ type: string
+ label: image name
+ description: the MVM BIG-IP image name
+ flavor_name:
+ type: string
+ label: bigip flavor name
+ description: the flavor name of bigip instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: the availabilityzone name
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ oam_mgmt_network_id:
+ type: string
+ label: oam network name
+ description: mgmt eth0 local mgmt network
+ oam_mgmt_network_ip:
+ type: comma_delimited_list
+ label: oam network ip
+ description: the local ip of mgmt network
+ oam_network_id:
+ type: string
+ label: bigip oam network id
+ description: oam TMM 1.1 network
+ oam_network_ip:
+ type: comma_delimited_list
+ label: oam network ip
+ description: the local ip of oam network
+ oam_network_vip_ip:
+ type: string
+ label: oam network virtual server ip
+ description: oam network virtual server ip
+ dmz_network_id:
+ type: string
+ label: bigip dmz network id
+ description: dmz TMM 1.2 network
+ dmz_network_ip:
+ type: comma_delimited_list
+ label: dmz network ip
+ description: BIGIP dmz network ip
+ dmz_network_vip_ip:
+ type: string
+ label: dmz network virtual server ip
+ description: dmz network virtual server ip
+ core_network_id:
+ type: string
+ label: core network id
+ description: core TMM 1.3 network
+ core_network_ip:
+ type: comma_delimited_list
+ label: core network ip
+ description: core network ip
+ core_network_vip_ip:
+ type: string
+ label: core network virtual server ip
+ description: core network virtual server ip
+ ha_network_f5_id:
+ type: string
+ label: HA network id
+ description: HA TMM 1.4 network
+ ha_local_ip:
+ type: comma_delimited_list
+ label: HA local ip
+ description: HA failover local ip
+ vnf_id:
+ type: string
+ description: Unique ID for this VF instance
+ vf_module_id:
+ type: string
+ description: Unique ID for this VF_MODULE instance
+ cluster_size:
+ type: number
+ description: number of instance of the VF_module
+
+resources:
+ f5_modules:
+ type: OS::Heat::ResourceGroup
+ properties:
+ count: { get_param: cluster_size }
+ resource_def:
+ type: vvm_f5_5nic.nested.heat.yaml
+ properties:
+ lb_system_name: { get_param: lb_server_group }
+ server_name: { get_param: server_name }
+ image_name: { get_param: image_name }
+ flavor_name: { get_param: flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ security_group_name: { get_param: security_group_name }
+ oam_mgmt_network_id: { get_param: oam_mgmt_network_id }
+ oam_mgmt_network_ip: { get_param: oam_mgmt_network_ip }
+ oam_network_id: { get_param: oam_network_id }
+ oam_network_ip: { get_param: oam_network_ip }
+ oam_network_vip_ip: { get_param: oam_network_vip_ip }
+ dmz_network_id: { get_param: dmz_network_id }
+ dmz_network_ip: { get_param: dmz_network_ip }
+ dmz_network_vip_ip: { get_param: dmz_network_vip_ip }
+ core_network_id: { get_param: core_network_id }
+ core_network_ip: { get_param: core_network_ip }
+ core_network_vip_ip: { get_param: core_network_vip_ip }
+ ha_network_id: { get_param: ha_network_f5_id }
+ ha_local_ip: { get_param: ha_local_ip }
+ vnf_id: { get_param: vnf_id }
+ vf_module_id: { get_param: vf_module_id }
+ indx: "%index%"
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/negative_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/negative_test/input/MANIFEST.json
new file mode 100644
index 0000000000..06df1e696d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/negative_test/input/MANIFEST.json
@@ -0,0 +1,35 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "hot-nimbus-psm_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-psm_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "nested-pps_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "nested-psm_v1.0.yaml",
+ "type": "HEAT"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/negative_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/negative_test/input/hot-nimbus-pps_v1.0.env
new file mode 100644
index 0000000000..089284d177
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/negative_test/input/hot-nimbus-pps_v1.0.env
@@ -0,0 +1,11 @@
+parameters:
+ pcrf_pps_server_names: 1
+ pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_pps_flavor_name: lc.3xlarge
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/negative_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/negative_test/input/hot-nimbus-pps_v1.0.yaml
new file mode 100644
index 0000000000..4944424af8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/negative_test/input/hot-nimbus-pps_v1.0.yaml
@@ -0,0 +1,50 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_names:
+ type: comma_delimited_list
+ label: PCRF PS server names
+ description: PCRF PS server names
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: number
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_pps_001:
+ type: OS::Heat::CloudConfig
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/expected_output/expected_output.json
new file mode 100644
index 0000000000..9e26dfeeb6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/expected_output/expected_output.json
@@ -0,0 +1 @@
+{} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/MANIFEST.json
new file mode 100644
index 0000000000..fe7d8bdf5a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/MANIFEST.json
@@ -0,0 +1,51 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "hot-nimbus-psm_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-psm_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "nested-pps_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "nested-psm_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "mount_iso_script.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "cloud-nimbus.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "nimbus-ethernet",
+ "type": "OTHER"
+ },
+ {
+ "file": "nimbus-ethernet-gw",
+ "type": "OTHER"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/hot-nimbus-pps_v1.0.env
new file mode 100644
index 0000000000..340be2b815
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/hot-nimbus-pps_v1.0.env
@@ -0,0 +1,11 @@
+parameters:
+ pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006
+ pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_pps_flavor_name: lc.3xlarge
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/hot-nimbus-pps_v1.0.yaml
new file mode 100644
index 0000000000..05bd6c9318
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/hot-nimbus-pps_v1.0.yaml
@@ -0,0 +1,121 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_names:
+ type: comma_delimited_list
+ label: PCRF PS server names
+ description: PCRF PS server names
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_pps_001:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_002:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 1] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_003:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 2] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_004:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 3] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_005:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 4] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_006:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/hot-nimbus-psm_v1.0.env
new file mode 100644
index 0000000000..f24e4763c6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/hot-nimbus-psm_v1.0.env
@@ -0,0 +1,10 @@
+parameters:
+ pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012
+ pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_psm_flavor_name: lc.4xlarge4
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/hot-nimbus-psm_v1.0.yaml
new file mode 100644
index 0000000000..c2d7b05ead
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/hot-nimbus-psm_v1.0.yaml
@@ -0,0 +1,199 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_names:
+ type: comma_delimited_list
+ label: PCRF SM server names
+ description: name of the PCRF SM instance
+ pcrf_psm_image_name:
+ type: string
+ label: PCRF SM image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_psm_001:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_002:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_003:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_004:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_005:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_006:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_007:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_008:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_009:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_010:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_011:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_012:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/nested-pps_v1.0.yaml
new file mode 100644
index 0000000000..b7291d69d3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/nested-pps_v1.0.yaml
@@ -0,0 +1,97 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_name:
+ type: string
+ label: PCRF PS server name
+ description: PCRF PS server name
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ params:
+ $vm_name: { get_param: pcrf_pps_server_name }
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_pps:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_pps_server_name }
+ image: { get_param: pcrf_pps_image_name }
+ flavor: { get_param: pcrf_pps_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: pcrf_pps_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+
+ pcrf_pps_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/nested-psm_v1.0.yaml
new file mode 100644
index 0000000000..6868728b73
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/nested-psm_v1.0.yaml
@@ -0,0 +1,97 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_name:
+ type: string
+ label: PCRF SM server name
+ description: PCRF SM server name
+ pcrf_psm_image_name:
+ type: string
+ label: image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ params:
+ $vm_name: { get_param: pcrf_psm_server_name }
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_psm:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_psm_server_name }
+ image: { get_param: pcrf_psm_image_name }
+ flavor: { get_param: pcrf_psm_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: psm01_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+ #scheduler_hints: {group: { get_resource: servergroup_nimbus }}
+
+ psm01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/negative_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/negative_test/input/MANIFEST.json
new file mode 100644
index 0000000000..c27fba2205
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/negative_test/input/MANIFEST.json
@@ -0,0 +1,21 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-psm_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-psm_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "nested-psm_v1.0.yaml",
+ "type": "HEAT"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/negative_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/negative_test/input/hot-nimbus-psm_v1.0.env
new file mode 100644
index 0000000000..f24e4763c6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/negative_test/input/hot-nimbus-psm_v1.0.env
@@ -0,0 +1,10 @@
+parameters:
+ pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012
+ pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_psm_flavor_name: lc.4xlarge4
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/negative_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/negative_test/input/hot-nimbus-psm_v1.0.yaml
new file mode 100644
index 0000000000..4a66bf5bf6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/negative_test/input/hot-nimbus-psm_v1.0.yaml
@@ -0,0 +1,72 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_names:
+ type: comma_delimited_list
+ label: PCRF SM server names
+ description: name of the PCRF SM instance
+ pcrf_psm_image_name:
+ type: string
+ label: PCRF SM image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_psm_001:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+
+
+outputs:
+ server_pcrf_psm_001_output:
+ description: the pcrf_server
+ value: { get_attr: [ server_pcrf_psm_001, nested_output ] }
+
+
+ server_pcrf_psm_002_output:
+ description: the pcrf_server
+ value: { get_attr: }
+
+ server_pcrf_psm_003_output:
+ description: the pcrf_server
+ value: { get_attr: []}
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/negative_test/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/negative_test/input/nested-psm_v1.0.yaml
new file mode 100644
index 0000000000..c26a0dd3a8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/negative_test/input/nested-psm_v1.0.yaml
@@ -0,0 +1,103 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_name:
+ type: string
+ label: PCRF SM server name
+ description: PCRF SM server name
+ pcrf_psm_image_name:
+ type: string
+ label: image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ params:
+ $vm_name: { get_param: pcrf_psm_server_name }
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_psm:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_psm_server_name }
+ image: { get_param: pcrf_psm_image_name }
+ flavor: { get_param: pcrf_psm_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: psm01_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+ #scheduler_hints: {group: { get_resource: servergroup_nimbus }}
+
+ psm01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
+
+
+outputs:
+ not_in_resource:
+ description: the pcrf_swift_container_1 url
+ value: { get_param: pcrf_psm_server_name } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/expected_output/expected_output.json
new file mode 100644
index 0000000000..9e26dfeeb6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/expected_output/expected_output.json
@@ -0,0 +1 @@
+{} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/MANIFEST.json
new file mode 100644
index 0000000000..fe7d8bdf5a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/MANIFEST.json
@@ -0,0 +1,51 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "hot-nimbus-psm_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-psm_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "nested-pps_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "nested-psm_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "mount_iso_script.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "cloud-nimbus.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "nimbus-ethernet",
+ "type": "OTHER"
+ },
+ {
+ "file": "nimbus-ethernet-gw",
+ "type": "OTHER"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/hot-nimbus-pps_v1.0.env
new file mode 100644
index 0000000000..340be2b815
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/hot-nimbus-pps_v1.0.env
@@ -0,0 +1,11 @@
+parameters:
+ pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006
+ pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_pps_flavor_name: lc.3xlarge
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/hot-nimbus-pps_v1.0.yaml
new file mode 100644
index 0000000000..05bd6c9318
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/hot-nimbus-pps_v1.0.yaml
@@ -0,0 +1,121 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_names:
+ type: comma_delimited_list
+ label: PCRF PS server names
+ description: PCRF PS server names
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_pps_001:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_002:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 1] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_003:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 2] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_004:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 3] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_005:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 4] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_006:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/hot-nimbus-psm_v1.0.env
new file mode 100644
index 0000000000..f24e4763c6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/hot-nimbus-psm_v1.0.env
@@ -0,0 +1,10 @@
+parameters:
+ pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012
+ pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_psm_flavor_name: lc.4xlarge4
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/hot-nimbus-psm_v1.0.yaml
new file mode 100644
index 0000000000..4ab762d34b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/hot-nimbus-psm_v1.0.yaml
@@ -0,0 +1,204 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_names:
+ type: comma_delimited_list
+ label: PCRF SM server names
+ description: name of the PCRF SM instance
+ pcrf_psm_image_name:
+ type: string
+ label: PCRF SM image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_psm_001:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_002:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_003:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_004:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_005:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_006:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_007:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_008:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_009:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_010:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_011:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_012:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+outputs:
+ server_pcrf_psm_001_output:
+ description: the pcrf_server
+ value: { get_attr: [ server_pcrf_psm_001, nested_output ] }
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/nested-pps_v1.0.yaml
new file mode 100644
index 0000000000..b7291d69d3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/nested-pps_v1.0.yaml
@@ -0,0 +1,97 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_name:
+ type: string
+ label: PCRF PS server name
+ description: PCRF PS server name
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ params:
+ $vm_name: { get_param: pcrf_pps_server_name }
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_pps:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_pps_server_name }
+ image: { get_param: pcrf_pps_image_name }
+ flavor: { get_param: pcrf_pps_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: pcrf_pps_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+
+ pcrf_pps_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/nested-psm_v1.0.yaml
new file mode 100644
index 0000000000..4b7aac8f44
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/nested-psm_v1.0.yaml
@@ -0,0 +1,103 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_name:
+ type: string
+ label: PCRF SM server name
+ description: PCRF SM server name
+ pcrf_psm_image_name:
+ type: string
+ label: image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ params:
+ $vm_name: { get_param: pcrf_psm_server_name }
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_psm:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_psm_server_name }
+ image: { get_param: pcrf_psm_image_name }
+ flavor: { get_param: pcrf_psm_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: psm01_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+ #scheduler_hints: {group: { get_resource: servergroup_nimbus }}
+
+ psm01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
+
+
+outputs:
+ nested_output:
+ description: the pcrf_swift_container_1 url
+ value: { get_param: pcrf_psm_server_name } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/negative_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/negative_test/input/MANIFEST.json
new file mode 100644
index 0000000000..c27fba2205
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/negative_test/input/MANIFEST.json
@@ -0,0 +1,21 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-psm_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-psm_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "nested-psm_v1.0.yaml",
+ "type": "HEAT"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/negative_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/negative_test/input/hot-nimbus-psm_v1.0.env
new file mode 100644
index 0000000000..f24e4763c6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/negative_test/input/hot-nimbus-psm_v1.0.env
@@ -0,0 +1,10 @@
+parameters:
+ pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012
+ pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_psm_flavor_name: lc.4xlarge4
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/negative_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/negative_test/input/hot-nimbus-psm_v1.0.yaml
new file mode 100644
index 0000000000..6eb260e380
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/negative_test/input/hot-nimbus-psm_v1.0.yaml
@@ -0,0 +1,55 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_names:
+ type: comma_delimited_list
+ label: PCRF SM server names
+ description: name of the PCRF SM instance
+ pcrf_psm_image_name:
+ type: string
+ label: PCRF SM image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+
+
+ server_pcrf_psm_001:
+ type: OS::Contrail::NetworkIpam
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] }
+ pcrf_cps_net_mask: { get_param: }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+ property_pointing_to_not_existing_param: {get_param: not_existing_param_1}
+
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/expected_output/expected_output.json
new file mode 100644
index 0000000000..9e26dfeeb6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/expected_output/expected_output.json
@@ -0,0 +1 @@
+{} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/MANIFEST.json
new file mode 100644
index 0000000000..fe7d8bdf5a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/MANIFEST.json
@@ -0,0 +1,51 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "hot-nimbus-psm_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-psm_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "nested-pps_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "nested-psm_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "mount_iso_script.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "cloud-nimbus.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "nimbus-ethernet",
+ "type": "OTHER"
+ },
+ {
+ "file": "nimbus-ethernet-gw",
+ "type": "OTHER"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/hot-nimbus-pps_v1.0.env
new file mode 100644
index 0000000000..340be2b815
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/hot-nimbus-pps_v1.0.env
@@ -0,0 +1,11 @@
+parameters:
+ pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006
+ pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_pps_flavor_name: lc.3xlarge
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/hot-nimbus-pps_v1.0.yaml
new file mode 100644
index 0000000000..05bd6c9318
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/hot-nimbus-pps_v1.0.yaml
@@ -0,0 +1,121 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_names:
+ type: comma_delimited_list
+ label: PCRF PS server names
+ description: PCRF PS server names
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_pps_001:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_002:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 1] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_003:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 2] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_004:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 3] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_005:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 4] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_006:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/hot-nimbus-psm_v1.0.env
new file mode 100644
index 0000000000..f24e4763c6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/hot-nimbus-psm_v1.0.env
@@ -0,0 +1,10 @@
+parameters:
+ pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012
+ pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_psm_flavor_name: lc.4xlarge4
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/hot-nimbus-psm_v1.0.yaml
new file mode 100644
index 0000000000..c2d7b05ead
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/hot-nimbus-psm_v1.0.yaml
@@ -0,0 +1,199 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_names:
+ type: comma_delimited_list
+ label: PCRF SM server names
+ description: name of the PCRF SM instance
+ pcrf_psm_image_name:
+ type: string
+ label: PCRF SM image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_psm_001:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_002:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_003:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_004:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_005:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_006:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_007:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_008:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_009:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_010:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_011:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_012:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/nested-pps_v1.0.yaml
new file mode 100644
index 0000000000..b7291d69d3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/nested-pps_v1.0.yaml
@@ -0,0 +1,97 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_name:
+ type: string
+ label: PCRF PS server name
+ description: PCRF PS server name
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ params:
+ $vm_name: { get_param: pcrf_pps_server_name }
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_pps:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_pps_server_name }
+ image: { get_param: pcrf_pps_image_name }
+ flavor: { get_param: pcrf_pps_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: pcrf_pps_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+
+ pcrf_pps_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/nested-psm_v1.0.yaml
new file mode 100644
index 0000000000..6868728b73
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/nested-psm_v1.0.yaml
@@ -0,0 +1,97 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_name:
+ type: string
+ label: PCRF SM server name
+ description: PCRF SM server name
+ pcrf_psm_image_name:
+ type: string
+ label: image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ params:
+ $vm_name: { get_param: pcrf_psm_server_name }
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_psm:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_psm_server_name }
+ image: { get_param: pcrf_psm_image_name }
+ flavor: { get_param: pcrf_psm_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: psm01_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+ #scheduler_hints: {group: { get_resource: servergroup_nimbus }}
+
+ psm01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_resource_value_valid/negative_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_resource_value_valid/negative_test/input/MANIFEST.json
new file mode 100644
index 0000000000..a1ec6bc0f7
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_resource_value_valid/negative_test/input/MANIFEST.json
@@ -0,0 +1,11 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.yaml",
+ "type": "HEAT"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_resource_value_valid/negative_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_resource_value_valid/negative_test/input/hot-nimbus-pps_v1.0.yaml
new file mode 100644
index 0000000000..9a8e58ffe2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_resource_value_valid/negative_test/input/hot-nimbus-pps_v1.0.yaml
@@ -0,0 +1,31 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ param_1:
+ type: number
+
+ param_2:
+ type: number
+
+
+resources:
+ server_pcrf_pps_006:
+ type: OS::Contrail::NetworkIpam
+ properties:
+ pcrf_pps_server_name: { get_resource: [param_1, param_2] }
+
+
+ server_pcrf_pps_007:
+ type: OS::Contrail::NetworkIpam
+ properties:
+ pcrf_pps_server_name: { get_resource: {get_param: param_1} }
+
+
+ server_pcrf_pps_008:
+ type: OS::Contrail::NetworkIpam
+ properties:
+ pcrf_pps_server_name: { get_resource: }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/invalid_heat_format/negative_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/invalid_heat_format/negative_test/input/MANIFEST.json
new file mode 100644
index 0000000000..5513de2ba2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/invalid_heat_format/negative_test/input/MANIFEST.json
@@ -0,0 +1,11 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-psm_v1.0.yaml",
+ "type": "HEAT"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/invalid_heat_format/negative_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/invalid_heat_format/negative_test/input/hot-nimbus-psm_v1.0.yaml
new file mode 100644
index 0000000000..a5ee917b2c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/invalid_heat_format/negative_test/input/hot-nimbus-psm_v1.0.yaml
@@ -0,0 +1,52 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ num_instances:
+ type: comma_delimited_list
+ label: PCRF SM server names
+ description: name of the PCRF SM instance
+ pcrf_psm_server_names:
+ type: comma_delimited_list
+ label: PCRF SM server names
+ description: name of the PCRF SM instance
+ pcrf_psm_image_name:
+ type: string
+
+ pcrf_pps_image_name:
+ type: string
+ pcrf_pps_flavor_name:
+ type: string
+ availability_zone_0:
+ type: string
+resources:
+ resource_with_resources_group_1:
+ kuku: kuku
+ type: OS::Heat::ResourceGroup
+ properties:
+ count: { get_param: num_instances }
+ resource_def:
+ type: {get_param: pcrf_vnf_id}
+ properties:
+ pcrf_psm_server_name: { get_param: pcrf_pps_server_names }
+ pcrf_psm_image_name: { get_param: pcrf_pps_image_name }
+
+
+
+
+ resource_with_resources_group_2:
+ blabla: blabla
+ type: OS::Heat::ResourceGroup
+ properties:
+ count: { get_param: num_instances }
+ resource_def:
+ type: OS::Nova::Server
+ properties:
+ cloud_zone_id: { get_param: pcrf_pps_server_names }
+ vf_name: { get_param: pcrf_pps_image_name }
+
+
+
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/network_policy_associated_with_attach_policy/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/network_policy_associated_with_attach_policy/input/MANIFEST.json
new file mode 100644
index 0000000000..1e719efb31
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/network_policy_associated_with_attach_policy/input/MANIFEST.json
@@ -0,0 +1,17 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/network_policy_associated_with_attach_policy/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/network_policy_associated_with_attach_policy/input/hot-nimbus-pps_v1.0.env
new file mode 100644
index 0000000000..340be2b815
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/network_policy_associated_with_attach_policy/input/hot-nimbus-pps_v1.0.env
@@ -0,0 +1,11 @@
+parameters:
+ pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006
+ pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_pps_flavor_name: lc.3xlarge
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/network_policy_associated_with_attach_policy/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/network_policy_associated_with_attach_policy/input/hot-nimbus-pps_v1.0.yaml
new file mode 100644
index 0000000000..b2b91ec36d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/network_policy_associated_with_attach_policy/input/hot-nimbus-pps_v1.0.yaml
@@ -0,0 +1,69 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_names:
+ type: comma_delimited_list
+ label: PCRF PS server names
+ description: PCRF PS server names
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ used_server_pcrf_policy:
+ type: OS::Contrail::NetworkPolicy
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+
+ not_used_server_pcrf_policy:
+ type: OS::Contrail::NetworkPolicy
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+
+ server_pcrf_network:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+
+ attach_policy_resource:
+ type: OS::Contrail::AttachPolicy
+ properties:
+ network: { get_resource: server_pcrf_network }
+ policy: { get_attr: [used_server_pcrf_policy, fq_name] }
+
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/MANIFEST.json
new file mode 100644
index 0000000000..e789fd7b1d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/MANIFEST.json
@@ -0,0 +1,45 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-psm_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-psm_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "nested-psm_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "nested-points-to-hot-nimbus-psm.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "yaml-point-to-itself.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "mount_iso_script.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "cloud-nimbus.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "nimbus-ethernet",
+ "type": "OTHER"
+ },
+ {
+ "file": "nimbus-ethernet-gw",
+ "type": "OTHER"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/hot-nimbus-psm_v1.0.env
new file mode 100644
index 0000000000..f24e4763c6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/hot-nimbus-psm_v1.0.env
@@ -0,0 +1,10 @@
+parameters:
+ pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012
+ pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_psm_flavor_name: lc.4xlarge4
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/hot-nimbus-psm_v1.0.yaml
new file mode 100644
index 0000000000..49e03e0a16
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/hot-nimbus-psm_v1.0.yaml
@@ -0,0 +1,56 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_names:
+ type: comma_delimited_list
+ label: PCRF SM server names
+ description: name of the PCRF SM instance
+ pcrf_psm_image_name:
+ type: string
+ label: PCRF SM image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_psm_001:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+
+ server_pcrf_psm_002:
+ type:
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/nested-points-to-hot-nimbus-psm.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/nested-points-to-hot-nimbus-psm.yaml
new file mode 100644
index 0000000000..981c08c011
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/nested-points-to-hot-nimbus-psm.yaml
@@ -0,0 +1,60 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_name:
+ type: string
+ label: PCRF SM server name
+ description: PCRF SM server name
+ pcrf_psm_image_name:
+ type: string
+ label: image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+ network:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_psm_001:
+ type: hot-nimbus-psm_v1.0.yaml
+ properties:
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+
+ server_pcrf_psm_002:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/nested-psm_v1.0.yaml
new file mode 100644
index 0000000000..bfc412d715
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/nested-psm_v1.0.yaml
@@ -0,0 +1,47 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_name:
+ type: string
+ label: PCRF SM server name
+ description: PCRF SM server name
+ pcrf_psm_image_name:
+ type: string
+ label: image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ psm01_port_0:
+ type: nested-points-to-hot-nimbus-psm.yaml
+ properties:
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/yaml-point-to-itself.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/yaml-point-to-itself.yaml
new file mode 100644
index 0000000000..ec2a02a5d2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/yaml-point-to-itself.yaml
@@ -0,0 +1,21 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_name:
+ type: string
+ label: PCRF SM server name
+ description: PCRF SM server name
+ pcrf_psm_image_name:
+ type: string
+ label: image name
+ description: PCRF SM image name
+
+resources:
+
+ resource_points_to_itself:
+ type: yaml-point-to-itself.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_name, 0] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/expected_output/expected_output.json
new file mode 100644
index 0000000000..9e26dfeeb6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/expected_output/expected_output.json
@@ -0,0 +1 @@
+{} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/MANIFEST.json
new file mode 100644
index 0000000000..fe7d8bdf5a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/MANIFEST.json
@@ -0,0 +1,51 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "hot-nimbus-psm_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-psm_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "nested-pps_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "nested-psm_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "mount_iso_script.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "cloud-nimbus.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "nimbus-ethernet",
+ "type": "OTHER"
+ },
+ {
+ "file": "nimbus-ethernet-gw",
+ "type": "OTHER"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/hot-nimbus-pps_v1.0.env
new file mode 100644
index 0000000000..340be2b815
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/hot-nimbus-pps_v1.0.env
@@ -0,0 +1,11 @@
+parameters:
+ pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006
+ pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_pps_flavor_name: lc.3xlarge
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/hot-nimbus-pps_v1.0.yaml
new file mode 100644
index 0000000000..05bd6c9318
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/hot-nimbus-pps_v1.0.yaml
@@ -0,0 +1,121 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_names:
+ type: comma_delimited_list
+ label: PCRF PS server names
+ description: PCRF PS server names
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_pps_001:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_002:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 1] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_003:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 2] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_004:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 3] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_005:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 4] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_006:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/hot-nimbus-psm_v1.0.env
new file mode 100644
index 0000000000..f24e4763c6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/hot-nimbus-psm_v1.0.env
@@ -0,0 +1,10 @@
+parameters:
+ pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012
+ pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_psm_flavor_name: lc.4xlarge4
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/hot-nimbus-psm_v1.0.yaml
new file mode 100644
index 0000000000..c2d7b05ead
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/hot-nimbus-psm_v1.0.yaml
@@ -0,0 +1,199 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_names:
+ type: comma_delimited_list
+ label: PCRF SM server names
+ description: name of the PCRF SM instance
+ pcrf_psm_image_name:
+ type: string
+ label: PCRF SM image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_psm_001:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_002:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_003:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_004:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_005:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_006:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_007:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_008:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_009:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_010:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_011:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_012:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/nested-pps_v1.0.yaml
new file mode 100644
index 0000000000..b7291d69d3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/nested-pps_v1.0.yaml
@@ -0,0 +1,97 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_name:
+ type: string
+ label: PCRF PS server name
+ description: PCRF PS server name
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ params:
+ $vm_name: { get_param: pcrf_pps_server_name }
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_pps:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_pps_server_name }
+ image: { get_param: pcrf_pps_image_name }
+ flavor: { get_param: pcrf_pps_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: pcrf_pps_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+
+ pcrf_pps_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/nested-psm_v1.0.yaml
new file mode 100644
index 0000000000..6868728b73
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/nested-psm_v1.0.yaml
@@ -0,0 +1,97 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_name:
+ type: string
+ label: PCRF SM server name
+ description: PCRF SM server name
+ pcrf_psm_image_name:
+ type: string
+ label: image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ params:
+ $vm_name: { get_param: pcrf_psm_server_name }
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_psm:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_psm_server_name }
+ image: { get_param: pcrf_psm_image_name }
+ flavor: { get_param: pcrf_psm_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: psm01_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+ #scheduler_hints: {group: { get_resource: servergroup_nimbus }}
+
+ psm01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/negative_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/negative_test/input/MANIFEST.json
new file mode 100644
index 0000000000..dd26e5ac45
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/negative_test/input/MANIFEST.json
@@ -0,0 +1,17 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-psm_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-psm_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/negative_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/negative_test/input/hot-nimbus-psm_v1.0.env
new file mode 100644
index 0000000000..f24e4763c6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/negative_test/input/hot-nimbus-psm_v1.0.env
@@ -0,0 +1,10 @@
+parameters:
+ pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012
+ pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_psm_flavor_name: lc.4xlarge4
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/negative_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/negative_test/input/hot-nimbus-psm_v1.0.yaml
new file mode 100644
index 0000000000..8ef73ded21
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/negative_test/input/hot-nimbus-psm_v1.0.yaml
@@ -0,0 +1,92 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_names:
+ type: comma_delimited_list
+ label: PCRF SM server names
+ description: name of the PCRF SM instance
+ pcrf_psm_image_name:
+ type: string
+ label: PCRF SM image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ nova_server_resource_missing_both:
+ type: OS::Nova::Server
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ nova_server_resource_only_image:
+ type: OS::Nova::Server
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] }
+ image: { get_param: pcrf_psm_image_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ nova_server_resource_only_flavor:
+ type: OS::Nova::Server
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] }
+ flavor: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+
+ nova_server_resource_both_without_get_param:
+ type: OS::Nova::Server
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] }
+ flavor: { get_param: }
+ image: { get_param: }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/expected_output/expected_output.json
new file mode 100644
index 0000000000..9e26dfeeb6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/expected_output/expected_output.json
@@ -0,0 +1 @@
+{} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/MANIFEST.json
new file mode 100644
index 0000000000..fe7d8bdf5a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/MANIFEST.json
@@ -0,0 +1,51 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "hot-nimbus-psm_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-psm_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "nested-pps_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "nested-psm_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "mount_iso_script.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "cloud-nimbus.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "nimbus-ethernet",
+ "type": "OTHER"
+ },
+ {
+ "file": "nimbus-ethernet-gw",
+ "type": "OTHER"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/hot-nimbus-pps_v1.0.env
new file mode 100644
index 0000000000..340be2b815
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/hot-nimbus-pps_v1.0.env
@@ -0,0 +1,11 @@
+parameters:
+ pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006
+ pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_pps_flavor_name: lc.3xlarge
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/hot-nimbus-pps_v1.0.yaml
new file mode 100644
index 0000000000..05bd6c9318
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/hot-nimbus-pps_v1.0.yaml
@@ -0,0 +1,121 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_names:
+ type: comma_delimited_list
+ label: PCRF PS server names
+ description: PCRF PS server names
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_pps_001:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_002:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 1] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_003:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 2] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_004:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 3] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_005:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 4] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_006:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/hot-nimbus-psm_v1.0.env
new file mode 100644
index 0000000000..f24e4763c6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/hot-nimbus-psm_v1.0.env
@@ -0,0 +1,10 @@
+parameters:
+ pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012
+ pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_psm_flavor_name: lc.4xlarge4
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/hot-nimbus-psm_v1.0.yaml
new file mode 100644
index 0000000000..25a4545311
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/hot-nimbus-psm_v1.0.yaml
@@ -0,0 +1,236 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_names:
+ type: comma_delimited_list
+ label: PCRF SM server names
+ description: name of the PCRF SM instance
+ pcrf_psm_image_name:
+ type: string
+ label: PCRF SM image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_psm_001:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_002:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_003:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_004:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_005:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_006:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_007:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_008:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_009:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_010:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_011:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_012:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ nova_server_resource:
+ type: OS::Nova::Server
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] }
+ image: { get_param: pcrf_psm_image_name }
+ flavor: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ nova_server_resource_only_image:
+ type: OS::Nova::Server
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] }
+ image: { get_param: pcrf_psm_image_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ nova_server_resource_only_flavor:
+ type: OS::Nova::Server
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] }
+ flavor: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/nested-pps_v1.0.yaml
new file mode 100644
index 0000000000..b7291d69d3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/nested-pps_v1.0.yaml
@@ -0,0 +1,97 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_name:
+ type: string
+ label: PCRF PS server name
+ description: PCRF PS server name
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ params:
+ $vm_name: { get_param: pcrf_pps_server_name }
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_pps:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_pps_server_name }
+ image: { get_param: pcrf_pps_image_name }
+ flavor: { get_param: pcrf_pps_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: pcrf_pps_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+
+ pcrf_pps_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/nested-psm_v1.0.yaml
new file mode 100644
index 0000000000..6868728b73
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/nested-psm_v1.0.yaml
@@ -0,0 +1,97 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_name:
+ type: string
+ label: PCRF SM server name
+ description: PCRF SM server name
+ pcrf_psm_image_name:
+ type: string
+ label: image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ params:
+ $vm_name: { get_param: pcrf_psm_server_name }
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_psm:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_psm_server_name }
+ image: { get_param: pcrf_psm_image_name }
+ flavor: { get_param: pcrf_psm_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: psm01_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+ #scheduler_hints: {group: { get_resource: servergroup_nimbus }}
+
+ psm01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/negative_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/negative_test/input/MANIFEST.json
new file mode 100644
index 0000000000..dd26e5ac45
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/negative_test/input/MANIFEST.json
@@ -0,0 +1,17 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-psm_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-psm_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/negative_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/negative_test/input/hot-nimbus-psm_v1.0.env
new file mode 100644
index 0000000000..f24e4763c6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/negative_test/input/hot-nimbus-psm_v1.0.env
@@ -0,0 +1,10 @@
+parameters:
+ pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012
+ pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_psm_flavor_name: lc.4xlarge4
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/negative_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/negative_test/input/hot-nimbus-psm_v1.0.yaml
new file mode 100644
index 0000000000..f7678ed6b7
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/negative_test/input/hot-nimbus-psm_v1.0.yaml
@@ -0,0 +1,95 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_names:
+ type: comma_delimited_list
+ label: PCRF SM server names
+ description: name of the PCRF SM instance
+ pcrf_psm_image_name:
+ type: string
+ label: PCRF SM image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+ vnf_id:
+ type: string
+
+resources:
+ nova_server_2:
+ type: OS::Nova::Server
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] }
+ image: { get_param: pcrf_psm_image_name }
+ flavor: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: oam1_int_port }
+ fixed_ip: 10.0.0.0
+ floating_ip: 10.0.0.1
+ network: 100_1000_0011
+ port_extra_properties: {admin_state_up: true , allowed_address_pairs: 10}
+ subnet: 10.0.0.2
+ - port: { get_resource: oam1_mgmt_port }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+
+ nova_server_3:
+ type: OS::Nova::Server
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] }
+ image: { get_param: pcrf_psm_image_name }
+ flavor: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: oam1_int_port }
+ fixed_ip: 10.0.0.0
+ floating_ip: 10.0.0.1
+ network: 100_1000_0011
+ port_extra_properties: {admin_state_up: true , allowed_address_pairs: 10}
+ subnet: 10.0.0.2
+ metadata:
+ vnf_id: { get_param: vnf_id }
+
+ oam1_int_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: pcrf_psm_server_names}
+ fixed_ips: [{"ip_address": {get_param: [pcrf_psm_image_name, 0]}}]
+ security_groups: [{get_param: pcrf_psm_image_name}]
+ replacement_policy: AUTO
+
+ oam1_mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: pcrf_psm_server_names}
+ fixed_ips: [{"ip_address": {get_param: [pcrf_psm_image_name, 0]}}]
+ security_groups: [{get_param: pcrf_psm_image_name}]
+ replacement_policy: AUTO \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/expected_output/expected_output.json
new file mode 100644
index 0000000000..9e26dfeeb6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/expected_output/expected_output.json
@@ -0,0 +1 @@
+{} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/MANIFEST.json
new file mode 100644
index 0000000000..fe7d8bdf5a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/MANIFEST.json
@@ -0,0 +1,51 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "hot-nimbus-psm_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-psm_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "nested-pps_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "nested-psm_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "mount_iso_script.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "cloud-nimbus.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "nimbus-ethernet",
+ "type": "OTHER"
+ },
+ {
+ "file": "nimbus-ethernet-gw",
+ "type": "OTHER"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/hot-nimbus-pps_v1.0.env
new file mode 100644
index 0000000000..340be2b815
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/hot-nimbus-pps_v1.0.env
@@ -0,0 +1,11 @@
+parameters:
+ pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006
+ pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_pps_flavor_name: lc.3xlarge
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/hot-nimbus-pps_v1.0.yaml
new file mode 100644
index 0000000000..05bd6c9318
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/hot-nimbus-pps_v1.0.yaml
@@ -0,0 +1,121 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_names:
+ type: comma_delimited_list
+ label: PCRF PS server names
+ description: PCRF PS server names
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_pps_001:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_002:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 1] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_003:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 2] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_004:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 3] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_005:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 4] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_006:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/hot-nimbus-psm_v1.0.env
new file mode 100644
index 0000000000..f24e4763c6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/hot-nimbus-psm_v1.0.env
@@ -0,0 +1,10 @@
+parameters:
+ pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012
+ pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_psm_flavor_name: lc.4xlarge4
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/hot-nimbus-psm_v1.0.yaml
new file mode 100644
index 0000000000..c173fce968
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/hot-nimbus-psm_v1.0.yaml
@@ -0,0 +1,233 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_names:
+ type: comma_delimited_list
+ label: PCRF SM server names
+ description: name of the PCRF SM instance
+ pcrf_psm_image_name:
+ type: string
+ label: PCRF SM image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ nova_server_1:
+ type: OS::Nova::Server
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] }
+ image: { get_param: pcrf_psm_image_name }
+ flavor: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: oam1_int_port }
+ fixed_ip: 10.0.0.0
+ floating_ip: 10.0.0.1
+ network: 100_1000_0011
+ port_extra_properties: {admin_state_up: true , allowed_address_pairs: 10}
+ subnet: 10.0.0.2
+ - port: { get_resource: oam1_mgmt_port }
+ metadata:
+ vnf_id: { get_param: vnf_id }
+
+ oam1_int_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: pcrf_psm_server_names}
+ fixed_ips: [{"ip_address": {get_param: [pcrf_psm_image_name, 0]}}]
+ security_groups: [{get_param: pcrf_psm_image_name}]
+ replacement_policy: AUTO
+
+ oam1_mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: pcrf_psm_server_names}
+ fixed_ips: [{"ip_address": {get_param: [pcrf_psm_image_name, 0]}}]
+ security_groups: [{get_param: pcrf_psm_image_name}]
+ replacement_policy: AUTO
+
+ server_pcrf_psm_001:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_002:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_003:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_004:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_005:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_006:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_007:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_008:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_009:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_010:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_011:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_012:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/nested-pps_v1.0.yaml
new file mode 100644
index 0000000000..b7291d69d3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/nested-pps_v1.0.yaml
@@ -0,0 +1,97 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_name:
+ type: string
+ label: PCRF PS server name
+ description: PCRF PS server name
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ params:
+ $vm_name: { get_param: pcrf_pps_server_name }
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_pps:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_pps_server_name }
+ image: { get_param: pcrf_pps_image_name }
+ flavor: { get_param: pcrf_pps_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: pcrf_pps_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+
+ pcrf_pps_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/nested-psm_v1.0.yaml
new file mode 100644
index 0000000000..6868728b73
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/nested-psm_v1.0.yaml
@@ -0,0 +1,97 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_name:
+ type: string
+ label: PCRF SM server name
+ description: PCRF SM server name
+ pcrf_psm_image_name:
+ type: string
+ label: image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ params:
+ $vm_name: { get_param: pcrf_psm_server_name }
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_psm:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_psm_server_name }
+ image: { get_param: pcrf_psm_image_name }
+ flavor: { get_param: pcrf_psm_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: psm01_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+ #scheduler_hints: {group: { get_resource: servergroup_nimbus }}
+
+ psm01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/MANIFEST.json
new file mode 100644
index 0000000000..fe7d8bdf5a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/MANIFEST.json
@@ -0,0 +1,51 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "hot-nimbus-psm_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-psm_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "nested-pps_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "nested-psm_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "mount_iso_script.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "cloud-nimbus.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "nimbus-ethernet",
+ "type": "OTHER"
+ },
+ {
+ "file": "nimbus-ethernet-gw",
+ "type": "OTHER"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/hot-nimbus-pps_v1.0.env
new file mode 100644
index 0000000000..340be2b815
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/hot-nimbus-pps_v1.0.env
@@ -0,0 +1,11 @@
+parameters:
+ pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006
+ pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_pps_flavor_name: lc.3xlarge
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/hot-nimbus-pps_v1.0.yaml
new file mode 100644
index 0000000000..05bd6c9318
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/hot-nimbus-pps_v1.0.yaml
@@ -0,0 +1,121 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_names:
+ type: comma_delimited_list
+ label: PCRF PS server names
+ description: PCRF PS server names
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_pps_001:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_002:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 1] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_003:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 2] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_004:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 3] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_005:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 4] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_006:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/hot-nimbus-psm_v1.0.env
new file mode 100644
index 0000000000..f24e4763c6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/hot-nimbus-psm_v1.0.env
@@ -0,0 +1,10 @@
+parameters:
+ pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012
+ pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_psm_flavor_name: lc.4xlarge4
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/hot-nimbus-psm_v1.0.yaml
new file mode 100644
index 0000000000..c2d7b05ead
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/hot-nimbus-psm_v1.0.yaml
@@ -0,0 +1,199 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_names:
+ type: comma_delimited_list
+ label: PCRF SM server names
+ description: name of the PCRF SM instance
+ pcrf_psm_image_name:
+ type: string
+ label: PCRF SM image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_psm_001:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_002:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_003:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_004:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_005:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_006:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_007:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_008:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_009:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_010:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_011:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_012:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/nested-pps_v1.0.yaml
new file mode 100644
index 0000000000..b7291d69d3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/nested-pps_v1.0.yaml
@@ -0,0 +1,97 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_name:
+ type: string
+ label: PCRF PS server name
+ description: PCRF PS server name
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ params:
+ $vm_name: { get_param: pcrf_pps_server_name }
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_pps:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_pps_server_name }
+ image: { get_param: pcrf_pps_image_name }
+ flavor: { get_param: pcrf_pps_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: pcrf_pps_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+
+ pcrf_pps_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/nested-psm_v1.0.yaml
new file mode 100644
index 0000000000..6868728b73
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/nested-psm_v1.0.yaml
@@ -0,0 +1,97 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_name:
+ type: string
+ label: PCRF SM server name
+ description: PCRF SM server name
+ pcrf_psm_image_name:
+ type: string
+ label: image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ params:
+ $vm_name: { get_param: pcrf_psm_server_name }
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_psm:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_psm_server_name }
+ image: { get_param: pcrf_psm_image_name }
+ flavor: { get_param: pcrf_psm_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: psm01_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+ #scheduler_hints: {group: { get_resource: servergroup_nimbus }}
+
+ psm01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/expected_output/expected_output.json
new file mode 100644
index 0000000000..ce04d8c601
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/expected_output/expected_output.json
@@ -0,0 +1,42 @@
+{
+ "name": "multiple_not_nested",
+ "description": "multiple heat files in zip, no nesting",
+ "version": "2013-05-23",
+ "data": [{
+ "file": "cmaui.yml",
+ "type": "HEAT",
+ "data": [{
+ "file": "cmaui.env",
+ "type": "HEAT_ENV"
+ }]
+ },
+ {
+ "file": "eca_oam.yaml",
+ "type": "HEAT",
+ "data": [{
+ "file": "eca_oam.env",
+ "type": "HEAT_ENV"
+ }]
+ },
+ {
+ "file": "eca_oam_nested.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "MMSC_Capacity_Line.yml",
+ "type": "HEAT",
+ "data": [{
+ "file": "MMSC_Capacity_Line_1.env",
+ "type": "HEAT_ENV"
+ }]
+ },
+ {
+ "file": "SG_ECA_MGMT.yaml",
+ "type": "HEAT",
+ "data": [{
+ "file": "sg_eca_mgmt.env",
+ "type": "HEAT_ENV"
+ }]
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/MANIFEST.json
new file mode 100644
index 0000000000..fe7d8bdf5a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/MANIFEST.json
@@ -0,0 +1,51 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "hot-nimbus-psm_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-psm_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "nested-pps_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "nested-psm_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "mount_iso_script.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "cloud-nimbus.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "nimbus-ethernet",
+ "type": "OTHER"
+ },
+ {
+ "file": "nimbus-ethernet-gw",
+ "type": "OTHER"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/hot-nimbus-pps_v1.0.env
new file mode 100644
index 0000000000..340be2b815
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/hot-nimbus-pps_v1.0.env
@@ -0,0 +1,11 @@
+parameters:
+ pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006
+ pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_pps_flavor_name: lc.3xlarge
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/hot-nimbus-pps_v1.0.yaml
new file mode 100644
index 0000000000..05bd6c9318
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/hot-nimbus-pps_v1.0.yaml
@@ -0,0 +1,121 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_names:
+ type: comma_delimited_list
+ label: PCRF PS server names
+ description: PCRF PS server names
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_pps_001:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_002:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 1] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_003:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 2] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_004:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 3] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_005:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 4] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_006:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/hot-nimbus-psm_v1.0.env
new file mode 100644
index 0000000000..f24e4763c6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/hot-nimbus-psm_v1.0.env
@@ -0,0 +1,10 @@
+parameters:
+ pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012
+ pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_psm_flavor_name: lc.4xlarge4
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/hot-nimbus-psm_v1.0.yaml
new file mode 100644
index 0000000000..c2d7b05ead
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/hot-nimbus-psm_v1.0.yaml
@@ -0,0 +1,199 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_names:
+ type: comma_delimited_list
+ label: PCRF SM server names
+ description: name of the PCRF SM instance
+ pcrf_psm_image_name:
+ type: string
+ label: PCRF SM image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_psm_001:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_002:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_003:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_004:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_005:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_006:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_007:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_008:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_009:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_010:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_011:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_012:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/nested-pps_v1.0.yaml
new file mode 100644
index 0000000000..fc5b6f74c3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/nested-pps_v1.0.yaml
@@ -0,0 +1,99 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_name:
+ type: string
+ label: PCRF PS server name
+ description: PCRF PS server name
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ template: { get_file: cloud-nimbus.sh }
+ params:
+ $vm_name: { get_param: pcrf_pps_server_name }
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet }
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_pps:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_pps_server_name }
+ image: { get_param: pcrf_pps_image_name }
+ flavor: { get_param: pcrf_pps_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: pcrf_pps_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+
+ pcrf_pps_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/nested-psm_v1.0.yaml
new file mode 100644
index 0000000000..c86aa34713
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/nested-psm_v1.0.yaml
@@ -0,0 +1,99 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_name:
+ type: string
+ label: PCRF SM server name
+ description: PCRF SM server name
+ pcrf_psm_image_name:
+ type: string
+ label: image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet }
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ template: { get_file: cloud-nimbus.sh }
+ params:
+ $vm_name: { get_param: pcrf_psm_server_name }
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_psm:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_psm_server_name }
+ image: { get_param: pcrf_psm_image_name }
+ flavor: { get_param: pcrf_psm_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: psm01_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+ #scheduler_hints: {group: { get_resource: servergroup_nimbus }}
+
+ psm01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/negative_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/negative_test/input/MANIFEST.json
new file mode 100644
index 0000000000..dd26e5ac45
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/negative_test/input/MANIFEST.json
@@ -0,0 +1,17 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-psm_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-psm_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/negative_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/negative_test/input/hot-nimbus-psm_v1.0.env
new file mode 100644
index 0000000000..f613758633
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/negative_test/input/hot-nimbus-psm_v1.0.env
@@ -0,0 +1,8 @@
+parameters:
+ pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_psm_flavor_name: lc.4xlarge4
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/negative_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/negative_test/input/hot-nimbus-psm_v1.0.yaml
new file mode 100644
index 0000000000..82edacf101
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/negative_test/input/hot-nimbus-psm_v1.0.yaml
@@ -0,0 +1,116 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_name:
+ type: string
+ label: PCRF SM server name
+ description: PCRF SM server name
+ pcrf_psm_image_name:
+ type: string
+ label: image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ params:
+ $vm_name: { get_param: pcrf_psm_server_name }
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_psm:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_psm_server_name }
+ image: { get_param: pcrf_psm_image_name }
+ flavor: { get_param: pcrf_psm_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: psm01_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+ scheduler_hints: {group_1: { get_resource: pcrf_server_policies_1 }, group_2: { get_resource: pcrf_server_policies_2 }, group_3: { get_resource: pcrf_server_policies_3 }}
+
+ pcrf_server_policies_1:
+ type: OS::Nova::ServerGroup
+ properties:
+ config_drive: "True"
+ policies: [affinity, anti-affinity]
+
+ pcrf_server_policies_2:
+ type: OS::Nova::ServerGroup
+ properties:
+ config_drive: "True"
+ policies:
+
+ pcrf_server_policies_3:
+ type: OS::Nova::ServerGroup
+ properties:
+ config_drive: "True"
+ policies: [affinity, ]
+
+ psm01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/expected_output/expected_output.json
new file mode 100644
index 0000000000..9e26dfeeb6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/expected_output/expected_output.json
@@ -0,0 +1 @@
+{} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/MANIFEST.json
new file mode 100644
index 0000000000..fe7d8bdf5a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/MANIFEST.json
@@ -0,0 +1,51 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "hot-nimbus-psm_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-psm_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "nested-pps_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "nested-psm_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "mount_iso_script.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "cloud-nimbus.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "nimbus-ethernet",
+ "type": "OTHER"
+ },
+ {
+ "file": "nimbus-ethernet-gw",
+ "type": "OTHER"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/hot-nimbus-pps_v1.0.env
new file mode 100644
index 0000000000..340be2b815
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/hot-nimbus-pps_v1.0.env
@@ -0,0 +1,11 @@
+parameters:
+ pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006
+ pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_pps_flavor_name: lc.3xlarge
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/hot-nimbus-pps_v1.0.yaml
new file mode 100644
index 0000000000..05bd6c9318
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/hot-nimbus-pps_v1.0.yaml
@@ -0,0 +1,121 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_names:
+ type: comma_delimited_list
+ label: PCRF PS server names
+ description: PCRF PS server names
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_pps_001:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_002:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 1] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_003:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 2] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_004:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 3] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_005:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 4] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_006:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/hot-nimbus-psm_v1.0.env
new file mode 100644
index 0000000000..f24e4763c6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/hot-nimbus-psm_v1.0.env
@@ -0,0 +1,10 @@
+parameters:
+ pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012
+ pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_psm_flavor_name: lc.4xlarge4
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/hot-nimbus-psm_v1.0.yaml
new file mode 100644
index 0000000000..c2d7b05ead
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/hot-nimbus-psm_v1.0.yaml
@@ -0,0 +1,199 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_names:
+ type: comma_delimited_list
+ label: PCRF SM server names
+ description: name of the PCRF SM instance
+ pcrf_psm_image_name:
+ type: string
+ label: PCRF SM image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_psm_001:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_002:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_003:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_004:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_005:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_006:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_007:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_008:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_009:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_010:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_011:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_012:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/nested-pps_v1.0.yaml
new file mode 100644
index 0000000000..a7966d6d47
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/nested-pps_v1.0.yaml
@@ -0,0 +1,114 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_name:
+ type: string
+ label: PCRF PS server name
+ description: PCRF PS server name
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ params:
+ $vm_name: { get_param: pcrf_pps_server_name }
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_pps:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_pps_server_name }
+ image: { get_param: pcrf_pps_image_name }
+ flavor: { get_param: pcrf_pps_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: pcrf_pps_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+
+ pcrf_server_policies:
+ type: OS::Nova::ServerGroup
+ properties:
+ config_drive: "True"
+ policies: [affinity]
+ name: { get_param: pcrf_pps_server_name }
+ image: { get_param: pcrf_pps_image_name }
+ flavor: { get_param: pcrf_pps_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: pcrf_pps_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+
+ pcrf_pps_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/nested-psm_v1.0.yaml
new file mode 100644
index 0000000000..681117d275
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/nested-psm_v1.0.yaml
@@ -0,0 +1,112 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_name:
+ type: string
+ label: PCRF SM server name
+ description: PCRF SM server name
+ pcrf_psm_image_name:
+ type: string
+ label: image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ params:
+ $vm_name: { get_param: pcrf_psm_server_name }
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_psm:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_psm_server_name }
+ image: { get_param: pcrf_psm_image_name }
+ flavor: { get_param: pcrf_psm_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: psm01_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+ #scheduler_hints: {group: { get_resource: servergroup_nimbus }}
+
+ psm01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
+
+ pcrf_server_policies:
+ type: OS::Nova::ServerGroup
+ properties:
+ config_drive: "True"
+ policies: [anti-affinity]
+ name: { get_param: pcrf_psm_server_name }
+ image: { get_param: pcrf_psm_image_name }
+ flavor: { get_param: pcrf_psm_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/MANIFEST.json
new file mode 100644
index 0000000000..fe7d8bdf5a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/MANIFEST.json
@@ -0,0 +1,51 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "hot-nimbus-psm_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-psm_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "nested-pps_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "nested-psm_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "mount_iso_script.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "cloud-nimbus.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "nimbus-ethernet",
+ "type": "OTHER"
+ },
+ {
+ "file": "nimbus-ethernet-gw",
+ "type": "OTHER"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/hot-nimbus-pps_v1.0.env
new file mode 100644
index 0000000000..340be2b815
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/hot-nimbus-pps_v1.0.env
@@ -0,0 +1,11 @@
+parameters:
+ pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006
+ pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_pps_flavor_name: lc.3xlarge
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/hot-nimbus-pps_v1.0.yaml
new file mode 100644
index 0000000000..05bd6c9318
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/hot-nimbus-pps_v1.0.yaml
@@ -0,0 +1,121 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_names:
+ type: comma_delimited_list
+ label: PCRF PS server names
+ description: PCRF PS server names
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_pps_001:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_002:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 1] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_003:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 2] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_004:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 3] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_005:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 4] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_006:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/hot-nimbus-psm_v1.0.env
new file mode 100644
index 0000000000..f24e4763c6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/hot-nimbus-psm_v1.0.env
@@ -0,0 +1,10 @@
+parameters:
+ pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012
+ pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_psm_flavor_name: lc.4xlarge4
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/hot-nimbus-psm_v1.0.yaml
new file mode 100644
index 0000000000..c2d7b05ead
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/hot-nimbus-psm_v1.0.yaml
@@ -0,0 +1,199 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_names:
+ type: comma_delimited_list
+ label: PCRF SM server names
+ description: name of the PCRF SM instance
+ pcrf_psm_image_name:
+ type: string
+ label: PCRF SM image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_psm_001:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_002:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_003:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_004:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_005:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_006:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_007:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_008:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_009:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_010:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_011:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_012:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/nested-pps_v1.0.yaml
new file mode 100644
index 0000000000..fc5b6f74c3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/nested-pps_v1.0.yaml
@@ -0,0 +1,99 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_name:
+ type: string
+ label: PCRF PS server name
+ description: PCRF PS server name
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ template: { get_file: cloud-nimbus.sh }
+ params:
+ $vm_name: { get_param: pcrf_pps_server_name }
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet }
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_pps:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_pps_server_name }
+ image: { get_param: pcrf_pps_image_name }
+ flavor: { get_param: pcrf_pps_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: pcrf_pps_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+
+ pcrf_pps_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/nested-psm_v1.0.yaml
new file mode 100644
index 0000000000..c86aa34713
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/nested-psm_v1.0.yaml
@@ -0,0 +1,99 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_name:
+ type: string
+ label: PCRF SM server name
+ description: PCRF SM server name
+ pcrf_psm_image_name:
+ type: string
+ label: image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet }
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ template: { get_file: cloud-nimbus.sh }
+ params:
+ $vm_name: { get_param: pcrf_psm_server_name }
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_psm:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_psm_server_name }
+ image: { get_param: pcrf_psm_image_name }
+ flavor: { get_param: pcrf_psm_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: psm01_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+ #scheduler_hints: {group: { get_resource: servergroup_nimbus }}
+
+ psm01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/expected_output/expected_output.json
new file mode 100644
index 0000000000..9e26dfeeb6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/expected_output/expected_output.json
@@ -0,0 +1 @@
+{} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/MANIFEST.json
new file mode 100644
index 0000000000..fe7d8bdf5a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/MANIFEST.json
@@ -0,0 +1,51 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "hot-nimbus-psm_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-psm_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "nested-pps_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "nested-psm_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "mount_iso_script.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "cloud-nimbus.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "nimbus-ethernet",
+ "type": "OTHER"
+ },
+ {
+ "file": "nimbus-ethernet-gw",
+ "type": "OTHER"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/hot-nimbus-pps_v1.0.env
new file mode 100644
index 0000000000..340be2b815
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/hot-nimbus-pps_v1.0.env
@@ -0,0 +1,11 @@
+parameters:
+ pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006
+ pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_pps_flavor_name: lc.3xlarge
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/hot-nimbus-pps_v1.0.yaml
new file mode 100644
index 0000000000..05bd6c9318
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/hot-nimbus-pps_v1.0.yaml
@@ -0,0 +1,121 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_names:
+ type: comma_delimited_list
+ label: PCRF PS server names
+ description: PCRF PS server names
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_pps_001:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_002:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 1] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_003:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 2] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_004:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 3] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_005:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 4] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_006:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/hot-nimbus-psm_v1.0.env
new file mode 100644
index 0000000000..f24e4763c6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/hot-nimbus-psm_v1.0.env
@@ -0,0 +1,10 @@
+parameters:
+ pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012
+ pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_psm_flavor_name: lc.4xlarge4
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/hot-nimbus-psm_v1.0.yaml
new file mode 100644
index 0000000000..c2d7b05ead
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/hot-nimbus-psm_v1.0.yaml
@@ -0,0 +1,199 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_names:
+ type: comma_delimited_list
+ label: PCRF SM server names
+ description: name of the PCRF SM instance
+ pcrf_psm_image_name:
+ type: string
+ label: PCRF SM image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_psm_001:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_002:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_003:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_004:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_005:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_006:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_007:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_008:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_009:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_010:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_011:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_012:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/nested-pps_v1.0.yaml
new file mode 100644
index 0000000000..fc5b6f74c3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/nested-pps_v1.0.yaml
@@ -0,0 +1,99 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_name:
+ type: string
+ label: PCRF PS server name
+ description: PCRF PS server name
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ template: { get_file: cloud-nimbus.sh }
+ params:
+ $vm_name: { get_param: pcrf_pps_server_name }
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet }
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_pps:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_pps_server_name }
+ image: { get_param: pcrf_pps_image_name }
+ flavor: { get_param: pcrf_pps_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: pcrf_pps_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+
+ pcrf_pps_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/nested-psm_v1.0.yaml
new file mode 100644
index 0000000000..c86aa34713
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/nested-psm_v1.0.yaml
@@ -0,0 +1,99 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_name:
+ type: string
+ label: PCRF SM server name
+ description: PCRF SM server name
+ pcrf_psm_image_name:
+ type: string
+ label: image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet }
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ template: { get_file: cloud-nimbus.sh }
+ params:
+ $vm_name: { get_param: pcrf_psm_server_name }
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_psm:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_psm_server_name }
+ image: { get_param: pcrf_psm_image_name }
+ flavor: { get_param: pcrf_psm_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: psm01_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+ #scheduler_hints: {group: { get_resource: servergroup_nimbus }}
+
+ psm01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/negative_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/negative_test/input/MANIFEST.json
new file mode 100644
index 0000000000..02118a7b23
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/negative_test/input/MANIFEST.json
@@ -0,0 +1,21 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "nested-pps_v1.0.yaml",
+ "type": "HEAT"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/negative_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/negative_test/input/hot-nimbus-pps_v1.0.env
new file mode 100644
index 0000000000..340be2b815
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/negative_test/input/hot-nimbus-pps_v1.0.env
@@ -0,0 +1,11 @@
+parameters:
+ pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006
+ pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_pps_flavor_name: lc.3xlarge
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/negative_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/negative_test/input/hot-nimbus-pps_v1.0.yaml
new file mode 100644
index 0000000000..5d93b2f4f7
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/negative_test/input/hot-nimbus-pps_v1.0.yaml
@@ -0,0 +1,49 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_names:
+ type: comma_delimited_list
+ label: PCRF PS server names
+ description: PCRF PS server names
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_pps_001:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ parameter_not_existing_in_nested: {get_param: pcrf_vnf_id}
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/negative_test/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/negative_test/input/nested-pps_v1.0.yaml
new file mode 100644
index 0000000000..0ed9043fc2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/negative_test/input/nested-pps_v1.0.yaml
@@ -0,0 +1,74 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_name:
+ type: string
+ label: PCRF PS server name
+ description: PCRF PS server name
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ params:
+ $vm_name: { get_param: pcrf_pps_server_name }
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/expected_output/expected_output.json
new file mode 100644
index 0000000000..9e26dfeeb6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/expected_output/expected_output.json
@@ -0,0 +1 @@
+{} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/MANIFEST.json
new file mode 100644
index 0000000000..fe7d8bdf5a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/MANIFEST.json
@@ -0,0 +1,51 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "hot-nimbus-psm_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-psm_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "nested-pps_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "nested-psm_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "mount_iso_script.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "cloud-nimbus.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "nimbus-ethernet",
+ "type": "OTHER"
+ },
+ {
+ "file": "nimbus-ethernet-gw",
+ "type": "OTHER"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/hot-nimbus-pps_v1.0.env
new file mode 100644
index 0000000000..340be2b815
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/hot-nimbus-pps_v1.0.env
@@ -0,0 +1,11 @@
+parameters:
+ pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006
+ pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_pps_flavor_name: lc.3xlarge
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/hot-nimbus-pps_v1.0.yaml
new file mode 100644
index 0000000000..05bd6c9318
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/hot-nimbus-pps_v1.0.yaml
@@ -0,0 +1,121 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_names:
+ type: comma_delimited_list
+ label: PCRF PS server names
+ description: PCRF PS server names
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_pps_001:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_002:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 1] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_003:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 2] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_004:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 3] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_005:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 4] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_006:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/hot-nimbus-psm_v1.0.env
new file mode 100644
index 0000000000..f24e4763c6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/hot-nimbus-psm_v1.0.env
@@ -0,0 +1,10 @@
+parameters:
+ pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012
+ pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_psm_flavor_name: lc.4xlarge4
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/hot-nimbus-psm_v1.0.yaml
new file mode 100644
index 0000000000..c2d7b05ead
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/hot-nimbus-psm_v1.0.yaml
@@ -0,0 +1,199 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_names:
+ type: comma_delimited_list
+ label: PCRF SM server names
+ description: name of the PCRF SM instance
+ pcrf_psm_image_name:
+ type: string
+ label: PCRF SM image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_psm_001:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_002:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_003:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_004:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_005:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_006:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_007:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_008:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_009:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_010:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_011:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_012:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/nested-pps_v1.0.yaml
new file mode 100644
index 0000000000..b7291d69d3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/nested-pps_v1.0.yaml
@@ -0,0 +1,97 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_name:
+ type: string
+ label: PCRF PS server name
+ description: PCRF PS server name
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ params:
+ $vm_name: { get_param: pcrf_pps_server_name }
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_pps:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_pps_server_name }
+ image: { get_param: pcrf_pps_image_name }
+ flavor: { get_param: pcrf_pps_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: pcrf_pps_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+
+ pcrf_pps_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/nested-psm_v1.0.yaml
new file mode 100644
index 0000000000..6868728b73
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/nested-psm_v1.0.yaml
@@ -0,0 +1,97 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_name:
+ type: string
+ label: PCRF SM server name
+ description: PCRF SM server name
+ pcrf_psm_image_name:
+ type: string
+ label: image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ params:
+ $vm_name: { get_param: pcrf_psm_server_name }
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_psm:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_psm_server_name }
+ image: { get_param: pcrf_psm_image_name }
+ flavor: { get_param: pcrf_psm_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: psm01_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+ #scheduler_hints: {group: { get_resource: servergroup_nimbus }}
+
+ psm01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/pseudo_parameters/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/pseudo_parameters/input/MANIFEST.json
new file mode 100644
index 0000000000..d038fb2a7e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/pseudo_parameters/input/MANIFEST.json
@@ -0,0 +1,11 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "pseudo_parameters.yml",
+ "type": "HEAT"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/pseudo_parameters/input/pseudo_parameters.yml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/pseudo_parameters/input/pseudo_parameters.yml
new file mode 100644
index 0000000000..8dd378ccbd
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/pseudo_parameters/input/pseudo_parameters.yml
@@ -0,0 +1,61 @@
+heat_template_version: 2013-05-23
+
+description: HOT template for vMME Cinder Volumes
+
+
+parameters:
+
+ volume_type:
+ type: string
+ label: volume type
+ description: volume type SolidFire
+
+ volume_size:
+ type: number
+ label: volume size
+ description: my volume size 320GB
+
+ FSB_1_image:
+ type: string
+ label: MME_FSB1
+ description: MME_FSB1_16ACP03_GA
+
+ FSB_2_image:
+ type: string
+ label: MME_FSB2
+ description: MME_FSB2_16ACP03_GA
+
+resources:
+
+ FSB1_volume:
+ type: OS::Cinder::Volume
+ properties:
+ name:
+ list_join: ['_', [{get_param: 'OS::stack_name'}, 'FSB1_Vol_1']]
+
+ FSB2_volume:
+ type: OS::Cinder::Volume
+ properties:
+ name:
+ list_join: ['_', [{get_param: 'OS::stack_id'}, 'FSB1_Vol_2']]
+
+ FSB3_volume:
+ type: OS::Cinder::Volume
+ properties:
+ name:
+ list_join: ['_', [{get_param: 'OS::project_id'}, 'FSB1_Vol_3']]
+
+
+outputs:
+ FSB1_volume_id:
+ description: ID of Cinder Volume for FSB1
+ value: {get_resource: FSB1_volume}
+
+ FSB2_volume_id:
+ description: ID of Cinder Volume for FSB2
+ value: {get_resource: FSB2_volume}
+
+ FSB3_volume_id:
+ description: ID of Cinder Volume for FSB3
+ value: {get_resource: FSB3_volume}
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/negative_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/negative_test/input/MANIFEST.json
new file mode 100644
index 0000000000..a1ec6bc0f7
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/negative_test/input/MANIFEST.json
@@ -0,0 +1,11 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.yaml",
+ "type": "HEAT"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/negative_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/negative_test/input/hot-nimbus-pps_v1.0.yaml
new file mode 100644
index 0000000000..c4680ab619
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/negative_test/input/hot-nimbus-pps_v1.0.yaml
@@ -0,0 +1,99 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_name:
+ type: string
+ label: PCRF PS server name
+ description: PCRF PS server name
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ template: { get_file: }
+ params:
+ $vm_name: { get_param: pcrf_pps_server_name }
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet }
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_pps:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_pps_server_name }
+ image: { get_param: pcrf_pps_image_name }
+ flavor: { get_param: pcrf_pps_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: pcrf_pps_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+
+ pcrf_pps_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/expected_output/expected_output.json
new file mode 100644
index 0000000000..9e26dfeeb6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/expected_output/expected_output.json
@@ -0,0 +1 @@
+{} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/MANIFEST.json
new file mode 100644
index 0000000000..ea7f326c76
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/MANIFEST.json
@@ -0,0 +1,51 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "hot-nimbus-psm_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-psm_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "nested-pps_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "nested-psm_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "mount_iso_script.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "cloud-nimbus.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "nimbus-ethernet",
+ "type": "OTHER"
+ },
+ {
+ "file": "artifact.sh",
+ "type": "OTHER"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/artifact.sh b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/artifact.sh
new file mode 100644
index 0000000000..fc5b6f74c3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/artifact.sh
@@ -0,0 +1,99 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_name:
+ type: string
+ label: PCRF PS server name
+ description: PCRF PS server name
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ template: { get_file: cloud-nimbus.sh }
+ params:
+ $vm_name: { get_param: pcrf_pps_server_name }
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet }
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_pps:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_pps_server_name }
+ image: { get_param: pcrf_pps_image_name }
+ flavor: { get_param: pcrf_pps_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: pcrf_pps_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+
+ pcrf_pps_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/cloud-nimbus.sh b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/cloud-nimbus.sh
new file mode 100644
index 0000000000..fc5b6f74c3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/cloud-nimbus.sh
@@ -0,0 +1,99 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_name:
+ type: string
+ label: PCRF PS server name
+ description: PCRF PS server name
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ template: { get_file: cloud-nimbus.sh }
+ params:
+ $vm_name: { get_param: pcrf_pps_server_name }
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet }
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_pps:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_pps_server_name }
+ image: { get_param: pcrf_pps_image_name }
+ flavor: { get_param: pcrf_pps_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: pcrf_pps_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+
+ pcrf_pps_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/hot-nimbus-pps_v1.0.env
new file mode 100644
index 0000000000..340be2b815
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/hot-nimbus-pps_v1.0.env
@@ -0,0 +1,11 @@
+parameters:
+ pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006
+ pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_pps_flavor_name: lc.3xlarge
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/hot-nimbus-pps_v1.0.yaml
new file mode 100644
index 0000000000..05bd6c9318
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/hot-nimbus-pps_v1.0.yaml
@@ -0,0 +1,121 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_names:
+ type: comma_delimited_list
+ label: PCRF PS server names
+ description: PCRF PS server names
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_pps_001:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_002:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 1] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_003:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 2] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_004:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 3] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_005:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 4] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_006:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/hot-nimbus-psm_v1.0.env
new file mode 100644
index 0000000000..f24e4763c6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/hot-nimbus-psm_v1.0.env
@@ -0,0 +1,10 @@
+parameters:
+ pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012
+ pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_psm_flavor_name: lc.4xlarge4
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/hot-nimbus-psm_v1.0.yaml
new file mode 100644
index 0000000000..a591692753
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/hot-nimbus-psm_v1.0.yaml
@@ -0,0 +1,212 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_names:
+ type: comma_delimited_list
+ label: PCRF SM server names
+ description: name of the PCRF SM instance
+ pcrf_psm_image_name:
+ type: string
+ label: PCRF SM image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ artifact_resource:
+ type: OS::Nova::Server
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] }
+ image: { get_param: pcrf_psm_image_name }
+ flavor: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ artifact: { get_file: artifact.sh }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_001:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_002:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_003:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_004:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_005:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_006:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_007:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_008:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_009:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_010:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_011:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_012:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/nested-pps_v1.0.yaml
new file mode 100644
index 0000000000..fc5b6f74c3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/nested-pps_v1.0.yaml
@@ -0,0 +1,99 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_name:
+ type: string
+ label: PCRF PS server name
+ description: PCRF PS server name
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ template: { get_file: cloud-nimbus.sh }
+ params:
+ $vm_name: { get_param: pcrf_pps_server_name }
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet }
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_pps:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_pps_server_name }
+ image: { get_param: pcrf_pps_image_name }
+ flavor: { get_param: pcrf_pps_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: pcrf_pps_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+
+ pcrf_pps_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/nested-psm_v1.0.yaml
new file mode 100644
index 0000000000..c86aa34713
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/nested-psm_v1.0.yaml
@@ -0,0 +1,99 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_name:
+ type: string
+ label: PCRF SM server name
+ description: PCRF SM server name
+ pcrf_psm_image_name:
+ type: string
+ label: image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet }
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ template: { get_file: cloud-nimbus.sh }
+ params:
+ $vm_name: { get_param: pcrf_psm_server_name }
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_psm:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_psm_server_name }
+ image: { get_param: pcrf_psm_image_name }
+ flavor: { get_param: pcrf_psm_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: psm01_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+ #scheduler_hints: {group: { get_resource: servergroup_nimbus }}
+
+ psm01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/nimbus-ethernet b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/nimbus-ethernet
new file mode 100644
index 0000000000..fc5b6f74c3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/nimbus-ethernet
@@ -0,0 +1,99 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_name:
+ type: string
+ label: PCRF PS server name
+ description: PCRF PS server name
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ template: { get_file: cloud-nimbus.sh }
+ params:
+ $vm_name: { get_param: pcrf_pps_server_name }
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet }
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_pps:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_pps_server_name }
+ image: { get_param: pcrf_pps_image_name }
+ flavor: { get_param: pcrf_pps_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: pcrf_pps_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+
+ pcrf_pps_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_group_invalid_type/negative_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_group_invalid_type/negative_test/input/MANIFEST.json
new file mode 100644
index 0000000000..5513de2ba2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_group_invalid_type/negative_test/input/MANIFEST.json
@@ -0,0 +1,11 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-psm_v1.0.yaml",
+ "type": "HEAT"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_group_invalid_type/negative_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_group_invalid_type/negative_test/input/hot-nimbus-psm_v1.0.yaml
new file mode 100644
index 0000000000..14ee7b10d2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_group_invalid_type/negative_test/input/hot-nimbus-psm_v1.0.yaml
@@ -0,0 +1,102 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ num_instances:
+ type: comma_delimited_list
+ label: PCRF SM server names
+ description: name of the PCRF SM instance
+ pcrf_psm_server_names:
+ type: comma_delimited_list
+ label: PCRF SM server names
+ description: name of the PCRF SM instance
+ pcrf_psm_image_name:
+ type: string
+ label: PCRF SM image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+ pcrf_pps_server_names:
+ type: string
+
+ pcrf_pps_image_name:
+ type: string
+ pcrf_pps_flavor_name:
+ type: string
+ availability_zone_0:
+ type: string
+resources:
+ resource_with_resources_group_1:
+ type: OS::Heat::ResourceGroup
+ properties:
+ count: { get_param: num_instances }
+ resource_def:
+ type: {get_param: pcrf_vnf_id}
+ properties:
+ pcrf_psm_server_name: { get_param: pcrf_pps_server_names }
+ pcrf_psm_image_name: { get_param: pcrf_pps_image_name }
+
+
+
+
+ resource_with_resources_group_2:
+ type: OS::Heat::ResourceGroup
+ properties:
+ count: { get_param: num_instances }
+ resource_def:
+ type: OS::Nova::Server
+ properties:
+ cloud_zone_id: { get_param: pcrf_pps_server_names }
+ vf_name: { get_param: pcrf_pps_image_name }
+
+
+
+ resource_with_resources_group_3:
+ type: OS::Heat::ResourceGroup
+ properties:
+ count: { get_param: num_instances }
+ resource_def:
+ type:
+ properties:
+ cloud_zone_id: { get_param: pcrf_pps_server_names }
+ vf_name: { get_param: pcrf_pps_image_name }
+
+
+ resource_with_resources_group_4:
+ type: OS::Heat::ResourceGroup
+ properties:
+ count: { get_param: num_instances }
+ resource_def:
+ type: yamlFile.yaml
+
+
+
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_group_invalid_type/negative_test/input/yamlFile.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_group_invalid_type/negative_test/input/yamlFile.yaml
new file mode 100644
index 0000000000..12a838bcf5
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_group_invalid_type/negative_test/input/yamlFile.yaml
@@ -0,0 +1,47 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ num_instances:
+ type: comma_delimited_list
+ label: PCRF SM server names
+ description: name of the PCRF SM instance
+ pcrf_psm_server_names:
+ type: comma_delimited_list
+ label: PCRF SM server names
+ description: name of the PCRF SM instance
+ pcrf_psm_image_name:
+ type: string
+ label: PCRF SM image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+ pcrf_pps_server_names:
+ type: string \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/negative_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/negative_test/input/MANIFEST.json
new file mode 100644
index 0000000000..3a4d09caa9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/negative_test/input/MANIFEST.json
@@ -0,0 +1,15 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "nested-pps_v1.0.yaml",
+ "type": "HEAT"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/negative_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/negative_test/input/hot-nimbus-pps_v1.0.yaml
new file mode 100644
index 0000000000..1154c06f4d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/negative_test/input/hot-nimbus-pps_v1.0.yaml
@@ -0,0 +1,16 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+resources:
+ server_pcrf_pps_007:
+ type: OS::Contrail::NetworkIpam
+ properties:
+ pcrf_pps_server_name: { get_resource: not_existing_resource }
+
+ server_pcrf_pps_008:
+ type: OS::Contrail::NetworkIpam
+ properties:
+ pcrf_pps_server_name: { get_resource: }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/expected_output/expected_output.json
new file mode 100644
index 0000000000..9e26dfeeb6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/expected_output/expected_output.json
@@ -0,0 +1 @@
+{} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/MANIFEST.json
new file mode 100644
index 0000000000..fe7d8bdf5a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/MANIFEST.json
@@ -0,0 +1,51 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "hot-nimbus-psm_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-psm_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "nested-pps_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "nested-psm_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "mount_iso_script.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "cloud-nimbus.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "nimbus-ethernet",
+ "type": "OTHER"
+ },
+ {
+ "file": "nimbus-ethernet-gw",
+ "type": "OTHER"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/hot-nimbus-pps_v1.0.env
new file mode 100644
index 0000000000..340be2b815
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/hot-nimbus-pps_v1.0.env
@@ -0,0 +1,11 @@
+parameters:
+ pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006
+ pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_pps_flavor_name: lc.3xlarge
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/hot-nimbus-pps_v1.0.yaml
new file mode 100644
index 0000000000..05bd6c9318
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/hot-nimbus-pps_v1.0.yaml
@@ -0,0 +1,121 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_names:
+ type: comma_delimited_list
+ label: PCRF PS server names
+ description: PCRF PS server names
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_pps_001:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_002:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 1] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_003:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 2] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_004:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 3] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_005:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 4] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_006:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/hot-nimbus-psm_v1.0.env
new file mode 100644
index 0000000000..f24e4763c6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/hot-nimbus-psm_v1.0.env
@@ -0,0 +1,10 @@
+parameters:
+ pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012
+ pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_psm_flavor_name: lc.4xlarge4
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/hot-nimbus-psm_v1.0.yaml
new file mode 100644
index 0000000000..c2d7b05ead
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/hot-nimbus-psm_v1.0.yaml
@@ -0,0 +1,199 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_names:
+ type: comma_delimited_list
+ label: PCRF SM server names
+ description: name of the PCRF SM instance
+ pcrf_psm_image_name:
+ type: string
+ label: PCRF SM image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_psm_001:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_002:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_003:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_004:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_005:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_006:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_007:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_008:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_009:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_010:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_011:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_012:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/nested-pps_v1.0.yaml
new file mode 100644
index 0000000000..b7291d69d3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/nested-pps_v1.0.yaml
@@ -0,0 +1,97 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_name:
+ type: string
+ label: PCRF PS server name
+ description: PCRF PS server name
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ params:
+ $vm_name: { get_param: pcrf_pps_server_name }
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_pps:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_pps_server_name }
+ image: { get_param: pcrf_pps_image_name }
+ flavor: { get_param: pcrf_pps_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: pcrf_pps_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+
+ pcrf_pps_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/nested-psm_v1.0.yaml
new file mode 100644
index 0000000000..6868728b73
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/nested-psm_v1.0.yaml
@@ -0,0 +1,97 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_name:
+ type: string
+ label: PCRF SM server name
+ description: PCRF SM server name
+ pcrf_psm_image_name:
+ type: string
+ label: image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ params:
+ $vm_name: { get_param: pcrf_psm_server_name }
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_psm:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_psm_server_name }
+ image: { get_param: pcrf_psm_image_name }
+ flavor: { get_param: pcrf_psm_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: psm01_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+ #scheduler_hints: {group: { get_resource: servergroup_nimbus }}
+
+ psm01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input/MANIFEST.json
new file mode 100644
index 0000000000..0c8e740434
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input/MANIFEST.json
@@ -0,0 +1,19 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "hot-nimbus-psm_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "nested-pps_v1.0.yaml",
+ "type": "HEAT"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input/hot-nimbus-pps_v1.0.yaml
new file mode 100644
index 0000000000..e3779ed99d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input/hot-nimbus-pps_v1.0.yaml
@@ -0,0 +1,59 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_names:
+ type: comma_delimited_list
+ label: PCRF PS server names
+ description: PCRF PS server names
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ num_instances:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_pps_001:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] }
+
+
+ resource_with_resources_group:
+ type: OS::Heat::ResourceGroup
+ properties:
+ count: { get_param: num_instances }
+ resource_def:
+ type: nested-not-exist.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: pcrf_pps_server_names }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input/hot-nimbus-psm_v1.0.yaml
new file mode 100644
index 0000000000..dc78b37ca2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input/hot-nimbus-psm_v1.0.yaml
@@ -0,0 +1,98 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ num_instances:
+ type: comma_delimited_list
+ label: PCRF SM server names
+ description: name of the PCRF SM instance
+ pcrf_psm_server_names:
+ type: comma_delimited_list
+ label: PCRF SM server names
+ description: name of the PCRF SM instance
+ pcrf_psm_image_name:
+ type: string
+ label: PCRF SM image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+ pcrf_pps_server_names:
+ type: string
+
+ pcrf_pps_image_name:
+ type: string
+ pcrf_pps_flavor_name:
+ type: string
+ availability_zone_0:
+ type: string
+resources:
+ resource_with_resources_group:
+ type: OS::Heat::ResourceGroup
+ properties:
+ count: { get_param: num_instances }
+ resource_def:
+ type: nested-from-resources-group.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: pcrf_pps_server_names }
+ pcrf_psm_image_name: { get_param: pcrf_pps_image_name }
+ property_not_in_nested: { get_param: availabilityzone_name }
+ pcrf_cps_net_name: { get_param: availabilityzone_name }
+ pcrf_cps_net_ip: { get_param: pcrf_vnf_id }
+ pcrf_cps_net_mask: { get_param: pcrf_vnf_id }
+ pcrf_security_group_name: { get_param: pcrf_pps_image_name }
+ pcrf_vnf_id: { get_param: pcrf_pps_flavor_name }
+
+ availabilityzone_name: { get_param: availability_zone_0 }
+
+
+
+ resource_without_resources_group:
+ type: OS::Heat::ResourceGroup
+ properties:
+ count: { get_param: num_instances }
+ resource_def:
+ type: OS::Nova::Server
+ properties:
+ cloud_zone_id: { get_param: pcrf_pps_server_names }
+ vf_name: { get_param: pcrf_pps_image_name }
+ vf_instance_num: { get_param: pcrf_pps_image_name }
+ vf_component: { get_param: availabilityzone_name }
+ vm_instance_num: { get_param: availabilityzone_name }
+ vnf_id: { get_param: pcrf_vnf_id }
+ vf_module_id: { get_param: pcrf_vnf_id }
+ bootimage: { get_param: pcrf_pps_image_name }
+ flavor: { get_param: pcrf_pps_flavor_name }
+ key_name: { get_param: pcrf_cps_net_mask }
+
+ availability_zone_0: { get_param: availability_zone_0 }
+
+
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input/nested-from-resources-group.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input/nested-from-resources-group.yaml
new file mode 100644
index 0000000000..836ab5c1f8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input/nested-from-resources-group.yaml
@@ -0,0 +1,105 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_name:
+ type: string
+ label: PCRF SM server name
+ description: PCRF SM server name
+ pcrf_psm_image_name:
+ type: string
+ label: image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ params:
+ $vm_name: { get_param: pcrf_psm_server_name }
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_psm:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_psm_server_name }
+ image: { get_param: pcrf_psm_image_name }
+ flavor: { get_param: pcrf_psm_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: psm01_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+ #scheduler_hints: {group: { get_resource: servergroup_nimbus }}
+
+ psm01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
+
+ psm01_port_1:
+ type: hot-nimbus-pps_v1.0.yaml
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input/nested-pps_v1.0.yaml
new file mode 100644
index 0000000000..bdf957c59e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input/nested-pps_v1.0.yaml
@@ -0,0 +1,52 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_name:
+ type: string
+ label: PCRF PS server name
+ description: PCRF PS server name
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ num_instances:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+ pcrf_pps_server_names:
+ type: string
+resources:
+ resource_with_resources_group:
+ type: OS::Heat::ResourceGroup
+ properties:
+ count: { get_param: num_instances }
+ resource_def:
+ type: nested-from-resources-group.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: pcrf_pps_server_names } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/expected_output/expected_output.json
new file mode 100644
index 0000000000..9e26dfeeb6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/expected_output/expected_output.json
@@ -0,0 +1 @@
+{} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/MANIFEST.json
new file mode 100644
index 0000000000..fe7d8bdf5a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/MANIFEST.json
@@ -0,0 +1,51 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "hot-nimbus-psm_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-psm_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "nested-pps_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "nested-psm_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "mount_iso_script.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "cloud-nimbus.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "nimbus-ethernet",
+ "type": "OTHER"
+ },
+ {
+ "file": "nimbus-ethernet-gw",
+ "type": "OTHER"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/hot-nimbus-pps_v1.0.env
new file mode 100644
index 0000000000..a1ea053e07
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/hot-nimbus-pps_v1.0.env
@@ -0,0 +1,11 @@
+parameters:
+ pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006
+ pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_pps_flavor_name: lc.3xlarge
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/hot-nimbus-pps_v1.0.yaml
new file mode 100644
index 0000000000..b12de0def4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/hot-nimbus-pps_v1.0.yaml
@@ -0,0 +1,144 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_names:
+ type: comma_delimited_list
+ label: PCRF PS server names
+ description: PCRF PS server names
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_pps_001:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_002:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 1] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_003:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 2] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_004:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 3] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_005:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 4] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_006:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ nova_server:
+ type: OS::Nova::Server
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] }
+ image: { get_param: pcrf_pps_image_name }
+ flavor: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+ scheduler_hints: { group_1: { get_resource: BE_Affinity_1 }, group_2: { get_resource: BE_Affinity_2 } }
+
+ BE_Affinity_1:
+ type: OS::Nova::ServerGroup
+ properties:
+ network: { get_param: pcrf_pps_server_names }
+
+ BE_Affinity_2:
+ type: OS::Nova::ServerGroup
+ properties:
+ network: { get_param: pcrf_pps_server_names } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/hot-nimbus-psm_v1.0.env
new file mode 100644
index 0000000000..f24e4763c6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/hot-nimbus-psm_v1.0.env
@@ -0,0 +1,10 @@
+parameters:
+ pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012
+ pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_psm_flavor_name: lc.4xlarge4
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/hot-nimbus-psm_v1.0.yaml
new file mode 100644
index 0000000000..3f91e94d74
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/hot-nimbus-psm_v1.0.yaml
@@ -0,0 +1,288 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ num_instances:
+ type: comma_delimited_list
+ label: PCRF SM server names
+ description: name of the PCRF SM instance
+ pcrf_psm_server_names:
+ type: comma_delimited_list
+ label: PCRF SM server names
+ description: name of the PCRF SM instance
+ pcrf_psm_image_name:
+ type: string
+ label: PCRF SM image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_psm_001:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_002:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_003:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_004:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_005:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_006:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_007:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_008:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_009:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_010:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_011:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_012:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ resource_with_resources_group:
+ type: OS::Heat::ResourceGroup
+ properties:
+ count: { get_param: num_instances }
+ resource_def:
+ type: nested-from-resources-group.yaml
+ properties:
+ cloud_zone_id: { get_param: cloud_zone_id }
+ vf_name: { get_param: vf_name }
+ vf_instance_num: { get_param: vf_instance_num }
+ vf_component: { get_param: vf_component }
+ vm_instance_num: { get_param: vm_instance_num }
+ vnf_id: { get_param: vnf_id }
+ vf_module_id: { get_param: vf_module_id }
+ bootimage: { get_param: bootimage }
+ flavor: { get_param: flavor }
+ key_name: { get_param: key_name }
+
+ availability_zone_0: { get_param: availability_zone_0 }
+
+ sec_groups: { get_param: sec_groups }
+ data_volume_size: { get_param: data_volume_size }
+ mgmt_net_id: { get_param: mgmt_net_id }
+
+ sas_mgmt_ip_0: { get_param: sas_mgmt_ip_0 }
+
+ indx: "%index%"
+
+
+ resource_without_resources_group:
+ type: OS::Heat::ResourceGroup
+ properties:
+ count: { get_param: num_instances }
+ resource_def:
+ type: OS::Nova::Server
+ properties:
+ cloud_zone_id: { get_param: cloud_zone_id }
+ vf_name: { get_param: vf_name }
+ vf_instance_num: { get_param: vf_instance_num }
+ vf_component: { get_param: vf_component }
+ vm_instance_num: { get_param: vm_instance_num }
+ vnf_id: { get_param: vnf_id }
+ vf_module_id: { get_param: vf_module_id }
+ bootimage: { get_param: bootimage }
+ flavor: { get_param: flavor }
+ key_name: { get_param: key_name }
+
+ availability_zone_0: { get_param: availability_zone_0 }
+
+ sec_groups: { get_param: sec_groups }
+ data_volume_size: { get_param: data_volume_size }
+ mgmt_net_id: { get_param: mgmt_net_id }
+
+ sas_mgmt_ip_0: { get_param: sas_mgmt_ip_0 }
+
+ indx: "%index%"
+
+ resource_with_not_existing_resources_group:
+ type: OS::Heat::ResourceGroup
+ properties:
+ count: { get_param: num_instances }
+ resource_def:
+ type: nested-from-resources-group.yaml
+ properties:
+ cloud_zone_id: { get_param: cloud_zone_id }
+ vf_name: { get_param: vf_name }
+ vf_instance_num: { get_param: vf_instance_num }
+ vf_component: { get_param: vf_component }
+ vm_instance_num: { get_param: vm_instance_num }
+ vnf_id: { get_param: vnf_id }
+ vf_module_id: { get_param: vf_module_id }
+ bootimage: { get_param: bootimage }
+ flavor: { get_param: flavor }
+ key_name: { get_param: key_name }
+
+ availability_zone_0: { get_param: availability_zone_0 }
+
+ sec_groups: { get_param: sec_groups }
+ data_volume_size: { get_param: data_volume_size }
+ mgmt_net_id: { get_param: mgmt_net_id }
+
+ sas_mgmt_ip_0: { get_param: sas_mgmt_ip_0 }
+
+ indx: "%index%"
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/nested-from-resources-group.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/nested-from-resources-group.yaml
new file mode 100644
index 0000000000..6868728b73
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/nested-from-resources-group.yaml
@@ -0,0 +1,97 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_name:
+ type: string
+ label: PCRF SM server name
+ description: PCRF SM server name
+ pcrf_psm_image_name:
+ type: string
+ label: image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ params:
+ $vm_name: { get_param: pcrf_psm_server_name }
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_psm:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_psm_server_name }
+ image: { get_param: pcrf_psm_image_name }
+ flavor: { get_param: pcrf_psm_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: psm01_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+ #scheduler_hints: {group: { get_resource: servergroup_nimbus }}
+
+ psm01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/nested-pps_v1.0.yaml
new file mode 100644
index 0000000000..b7291d69d3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/nested-pps_v1.0.yaml
@@ -0,0 +1,97 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_name:
+ type: string
+ label: PCRF PS server name
+ description: PCRF PS server name
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ params:
+ $vm_name: { get_param: pcrf_pps_server_name }
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_pps:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_pps_server_name }
+ image: { get_param: pcrf_pps_image_name }
+ flavor: { get_param: pcrf_pps_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: pcrf_pps_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+
+ pcrf_pps_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/nested-psm_v1.0.yaml
new file mode 100644
index 0000000000..6868728b73
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/nested-psm_v1.0.yaml
@@ -0,0 +1,97 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_name:
+ type: string
+ label: PCRF SM server name
+ description: PCRF SM server name
+ pcrf_psm_image_name:
+ type: string
+ label: image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ params:
+ $vm_name: { get_param: pcrf_psm_server_name }
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_psm:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_psm_server_name }
+ image: { get_param: pcrf_psm_image_name }
+ flavor: { get_param: pcrf_psm_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: psm01_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+ #scheduler_hints: {group: { get_resource: servergroup_nimbus }}
+
+ psm01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_base_file_no_ports/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_base_file_no_ports/input/MANIFEST.json
new file mode 100644
index 0000000000..f487bae31f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_base_file_no_ports/input/MANIFEST.json
@@ -0,0 +1,17 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "baseFile.yaml",
+ "type": "HEAT",
+ "isBase": true
+ },
+ {
+ "file": "notBaseFile.yaml",
+ "type": "HEAT",
+ "isBase": false
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_base_file_no_ports/input/baseFile.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_base_file_no_ports/input/baseFile.yaml
new file mode 100644
index 0000000000..9446d6fde0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_base_file_no_ports/input/baseFile.yaml
@@ -0,0 +1,43 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ jsa_net_name:
+ type: string
+ description: network name of jsa log network
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+
+resources:
+ jsa_security_group1:
+ type: OS::Neutron::SecurityGroup
+ properties:
+ description: ems security group
+ name: {get_param: security_group_name}
+
+
+ jsa_security_group2:
+ type: OS::Neutron::SecurityGroup
+ properties:
+ description: ems security group
+ name: {get_param: security_group_name}
+
+ jsa_security_group3:
+ type: OS::Neutron::SecurityGroup
+ properties:
+ description: ems security group
+ name: {get_param: security_group_name}
+
+outputs:
+ shared_security_group_id1:
+ value: {get_resource: jsa_security_group1}
+
+ shared_security_group_id2:
+ value: {get_resource: jsa_security_group2}
+
+ shared_security_group_id3:
+ value: {get_resource: jsa_security_group3} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_base_file_no_ports/input/notBaseFile.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_base_file_no_ports/input/notBaseFile.yaml
new file mode 100644
index 0000000000..7ac05194ac
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_base_file_no_ports/input/notBaseFile.yaml
@@ -0,0 +1,26 @@
+heat_template_version: 2013-05-23
+
+description: >
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+
+parameters:
+ shared_security_group_id1:
+ type: string
+ description: network name of jsa log network
+ shared_security_group_id2:
+ type: string
+ description: network name of jsa log network
+ jsa_net_name:
+ type: string
+ description: network name of jsa log network
+ security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+
+resources:
+ test_nested:
+ type: OS::Contrail::NetworkIpam
+ properties:
+ p1: { get_param: shared_security_group_id1}
+ p2: { get_param: shared_security_group_id2}
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_called_by_port/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_called_by_port/input/MANIFEST.json
new file mode 100644
index 0000000000..1e719efb31
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_called_by_port/input/MANIFEST.json
@@ -0,0 +1,17 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_called_by_port/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_called_by_port/input/hot-nimbus-pps_v1.0.env
new file mode 100644
index 0000000000..340be2b815
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_called_by_port/input/hot-nimbus-pps_v1.0.env
@@ -0,0 +1,11 @@
+parameters:
+ pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006
+ pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_pps_flavor_name: lc.3xlarge
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_called_by_port/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_called_by_port/input/hot-nimbus-pps_v1.0.yaml
new file mode 100644
index 0000000000..51b9481bfa
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_called_by_port/input/hot-nimbus-pps_v1.0.yaml
@@ -0,0 +1,68 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_names:
+ type: comma_delimited_list
+ label: PCRF PS server names
+ description: PCRF PS server names
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ used_security_group:
+ type: OS::Neutron::SecurityGroup
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+
+ not_used_security_group:
+ type: OS::Neutron::SecurityGroup
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+
+ server_pcrf_network:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+
+ attach_policy_resource:
+ type: OS::Neutron::Port
+ properties:
+ security_groups: [{ get_resource: used_security_group }]
+
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_group_called_by_nova_server/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_group_called_by_nova_server/input/MANIFEST.json
new file mode 100644
index 0000000000..1e719efb31
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_group_called_by_nova_server/input/MANIFEST.json
@@ -0,0 +1,17 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_group_called_by_nova_server/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_group_called_by_nova_server/input/hot-nimbus-pps_v1.0.env
new file mode 100644
index 0000000000..340be2b815
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_group_called_by_nova_server/input/hot-nimbus-pps_v1.0.env
@@ -0,0 +1,11 @@
+parameters:
+ pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006
+ pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_pps_flavor_name: lc.3xlarge
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_group_called_by_nova_server/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_group_called_by_nova_server/input/hot-nimbus-pps_v1.0.yaml
new file mode 100644
index 0000000000..63eea76e2e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_group_called_by_nova_server/input/hot-nimbus-pps_v1.0.yaml
@@ -0,0 +1,67 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_names:
+ type: comma_delimited_list
+ label: PCRF PS server names
+ description: PCRF PS server names
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+ image_name:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ used_server_group:
+ type: OS::Nova::ServerGroup
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+
+ not_used_server_group:
+ type: OS::Nova::ServerGroup
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+
+ nova_server:
+ type: OS::Nova::Server
+ properties:
+ scheduler_hints: { group: { get_resource: used_server_group } }
+ image: {get_param: image_name}
+
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/negative_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/negative_test/input/MANIFEST.json
new file mode 100644
index 0000000000..1e719efb31
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/negative_test/input/MANIFEST.json
@@ -0,0 +1,17 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/negative_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/negative_test/input/hot-nimbus-pps_v1.0.env
new file mode 100644
index 0000000000..340be2b815
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/negative_test/input/hot-nimbus-pps_v1.0.env
@@ -0,0 +1,11 @@
+parameters:
+ pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006
+ pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_pps_flavor_name: lc.3xlarge
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/negative_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/negative_test/input/hot-nimbus-pps_v1.0.yaml
new file mode 100644
index 0000000000..1955922940
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/negative_test/input/hot-nimbus-pps_v1.0.yaml
@@ -0,0 +1,70 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_names:
+ type: comma_delimited_list
+ label: PCRF PS server names
+ description: PCRF PS server names
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ nova_server_1:
+ type: OS::Nova::Server
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] }
+ image: { get_param: pcrf_pps_image_name }
+ flavor: { get_param: pcrf_pps_flavor_name }
+ scheduler_hints: { group_1: { get_resource: BE_Affinity_1 }, group_2: { get_resource: BE_Affinity_2 } }
+ networks:
+ - port: {get_resource: BE_Affinity_2}
+
+
+ nova_server_2:
+ type: OS::Nova::Server
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] }
+ image: { get_param: pcrf_pps_image_name }
+ flavor: { get_param: pcrf_pps_flavor_name }
+ scheduler_hints: { group_1: , group_2: { get_resource: BE_Affinity_2 } }
+
+ BE_Affinity_2:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_pps_server_names }
+
+
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/expected_output/expected_output.json
new file mode 100644
index 0000000000..9e26dfeeb6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/expected_output/expected_output.json
@@ -0,0 +1 @@
+{} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/MANIFEST.json
new file mode 100644
index 0000000000..fe7d8bdf5a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/MANIFEST.json
@@ -0,0 +1,51 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "hot-nimbus-psm_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-psm_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "nested-pps_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "nested-psm_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "mount_iso_script.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "cloud-nimbus.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "nimbus-ethernet",
+ "type": "OTHER"
+ },
+ {
+ "file": "nimbus-ethernet-gw",
+ "type": "OTHER"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/hot-nimbus-pps_v1.0.env
new file mode 100644
index 0000000000..a1ea053e07
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/hot-nimbus-pps_v1.0.env
@@ -0,0 +1,11 @@
+parameters:
+ pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006
+ pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_pps_flavor_name: lc.3xlarge
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/hot-nimbus-pps_v1.0.yaml
new file mode 100644
index 0000000000..b12de0def4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/hot-nimbus-pps_v1.0.yaml
@@ -0,0 +1,144 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_names:
+ type: comma_delimited_list
+ label: PCRF PS server names
+ description: PCRF PS server names
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_pps_001:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_002:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 1] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_003:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 2] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_004:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 3] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_005:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 4] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_006:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ nova_server:
+ type: OS::Nova::Server
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] }
+ image: { get_param: pcrf_pps_image_name }
+ flavor: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+ scheduler_hints: { group_1: { get_resource: BE_Affinity_1 }, group_2: { get_resource: BE_Affinity_2 } }
+
+ BE_Affinity_1:
+ type: OS::Nova::ServerGroup
+ properties:
+ network: { get_param: pcrf_pps_server_names }
+
+ BE_Affinity_2:
+ type: OS::Nova::ServerGroup
+ properties:
+ network: { get_param: pcrf_pps_server_names } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/hot-nimbus-psm_v1.0.env
new file mode 100644
index 0000000000..f24e4763c6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/hot-nimbus-psm_v1.0.env
@@ -0,0 +1,10 @@
+parameters:
+ pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012
+ pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_psm_flavor_name: lc.4xlarge4
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/hot-nimbus-psm_v1.0.yaml
new file mode 100644
index 0000000000..c2d7b05ead
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/hot-nimbus-psm_v1.0.yaml
@@ -0,0 +1,199 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_names:
+ type: comma_delimited_list
+ label: PCRF SM server names
+ description: name of the PCRF SM instance
+ pcrf_psm_image_name:
+ type: string
+ label: PCRF SM image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_psm_001:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_002:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_003:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_004:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_005:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_006:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_007:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_008:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_009:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_010:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_011:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_012:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/nested-pps_v1.0.yaml
new file mode 100644
index 0000000000..b7291d69d3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/nested-pps_v1.0.yaml
@@ -0,0 +1,97 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_name:
+ type: string
+ label: PCRF PS server name
+ description: PCRF PS server name
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ params:
+ $vm_name: { get_param: pcrf_pps_server_name }
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_pps:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_pps_server_name }
+ image: { get_param: pcrf_pps_image_name }
+ flavor: { get_param: pcrf_pps_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: pcrf_pps_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+
+ pcrf_pps_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/nested-psm_v1.0.yaml
new file mode 100644
index 0000000000..6868728b73
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/nested-psm_v1.0.yaml
@@ -0,0 +1,97 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_name:
+ type: string
+ label: PCRF SM server name
+ description: PCRF SM server name
+ pcrf_psm_image_name:
+ type: string
+ label: image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ params:
+ $vm_name: { get_param: pcrf_psm_server_name }
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_psm:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_psm_server_name }
+ image: { get_param: pcrf_psm_image_name }
+ flavor: { get_param: pcrf_psm_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: psm01_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+ #scheduler_hints: {group: { get_resource: servergroup_nimbus }}
+
+ psm01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/shared_resources/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/shared_resources/input/MANIFEST.json
new file mode 100644
index 0000000000..1e719efb31
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/shared_resources/input/MANIFEST.json
@@ -0,0 +1,17 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/shared_resources/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/shared_resources/input/hot-nimbus-pps_v1.0.env
new file mode 100644
index 0000000000..340be2b815
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/shared_resources/input/hot-nimbus-pps_v1.0.env
@@ -0,0 +1,11 @@
+parameters:
+ pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006
+ pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_pps_flavor_name: lc.3xlarge
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/shared_resources/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/shared_resources/input/hot-nimbus-pps_v1.0.yaml
new file mode 100644
index 0000000000..1114734097
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/shared_resources/input/hot-nimbus-pps_v1.0.yaml
@@ -0,0 +1,90 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_names:
+ type: comma_delimited_list
+ label: PCRF PS server names
+ description: PCRF PS server names
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ used_security_group:
+ type: OS::Neutron::SecurityGroup
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+
+ not_used_security_group:
+ type: OS::Neutron::SecurityGroup
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+
+ shared_security_group:
+ type: OS::Neutron::SecurityGroup
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+
+ shared_server_group:
+ type: OS::Nova::ServerGroup
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+
+ server_pcrf_network:
+ type: OS::Contrail::VirtualNetwork
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+
+ attach_policy_resource:
+ type: OS::Neutron::Port
+ properties:
+ security_groups: [{ get_resource: used_security_group }]
+
+
+outputs:
+ output_shrared_resource_1:
+ description: uuid of the security group
+ value: {get_resource: shared_security_group }
+
+ output_shrared_resource_2:
+ description: uuid of the security group
+ value: {get_resource: shared_server_group }
+
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/MANIFEST.json
new file mode 100644
index 0000000000..06df1e696d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/MANIFEST.json
@@ -0,0 +1,35 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "hot-nimbus-psm_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-psm_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "nested-pps_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "nested-psm_v1.0.yaml",
+ "type": "HEAT"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/hot-nimbus-pps_v1.0.env
new file mode 100644
index 0000000000..340be2b815
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/hot-nimbus-pps_v1.0.env
@@ -0,0 +1,11 @@
+parameters:
+ pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006
+ pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_pps_flavor_name: lc.3xlarge
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/hot-nimbus-pps_v1.0.yaml
new file mode 100644
index 0000000000..717b915c68
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/hot-nimbus-pps_v1.0.yaml
@@ -0,0 +1,125 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_names:
+ type: comma_delimited_list
+ label: PCRF PS server names
+ description: PCRF PS server names
+ pcrf_pps_server_names:
+ type: comma_delimited_list
+ label: PCRF PS server names
+ description: PCRF PS server names
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_pps_001:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_002:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 1] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_003:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 2] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_004:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 3] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_005:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 4] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_pps_006:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/hot-nimbus-psm_v1.0.env
new file mode 100644
index 0000000000..f24e4763c6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/hot-nimbus-psm_v1.0.env
@@ -0,0 +1,10 @@
+parameters:
+ pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012
+ pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_psm_flavor_name: lc.4xlarge4
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/hot-nimbus-psm_v1.0.yaml
new file mode 100644
index 0000000000..de8d6b7658
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/hot-nimbus-psm_v1.0.yaml
@@ -0,0 +1,207 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_names:
+ type: comma_delimited_list
+ label: PCRF SM server names
+ description: name of the PCRF SM instance
+ pcrf_psm_image_name:
+ type: string
+ label: PCRF SM image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+ pcrf_vnf_id:
+ type: number
+ label: PCRF id number
+ description: PCRF id number
+
+resources:
+ server_pcrf_psm_001:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_002:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_003:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_004:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_005:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_006:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_007:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_008:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_009:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_010:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_011:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_012:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/nested-pps_v1.0.yaml
new file mode 100644
index 0000000000..153820b2c2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/nested-pps_v1.0.yaml
@@ -0,0 +1,103 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_name:
+ type: string
+ label: PCRF PS server name
+ description: PCRF PS server name
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ template: { get_file: cloud-nimbus.sh }
+ params:
+ $vm_name: { get_param: pcrf_pps_server_name }
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet }
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_pps:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_pps_server_name }
+ image: { get_param: pcrf_pps_image_name }
+ flavor: { get_param: pcrf_pps_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: pcrf_pps_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+
+ pcrf_pps_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/nested-psm_v1.0.yaml
new file mode 100644
index 0000000000..f982cc9195
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/nested-psm_v1.0.yaml
@@ -0,0 +1,103 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_name:
+ type: string
+ label: PCRF SM server name
+ description: PCRF SM server name
+ pcrf_psm_server_name:
+ type: string
+ label: PCRF SM server name
+ description: PCRF SM server name
+ pcrf_psm_image_name:
+ type: string
+ label: image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet }
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ template: { get_file: cloud-nimbus.sh }
+ params:
+ $vm_name: { get_param: pcrf_psm_server_name }
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_psm:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_psm_server_name }
+ image: { get_param: pcrf_psm_image_name }
+ flavor: { get_param: pcrf_psm_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: psm01_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+ #scheduler_hints: {group: { get_resource: servergroup_nimbus }}
+
+ psm01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/positive_test/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/positive_test/expected_output/expected_output.json
new file mode 100644
index 0000000000..9e26dfeeb6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/positive_test/expected_output/expected_output.json
@@ -0,0 +1 @@
+{} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/positive_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/positive_test/input/MANIFEST.json
new file mode 100644
index 0000000000..dd26e5ac45
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/positive_test/input/MANIFEST.json
@@ -0,0 +1,17 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-psm_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-psm_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/positive_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/positive_test/input/hot-nimbus-psm_v1.0.env
new file mode 100644
index 0000000000..f24e4763c6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/positive_test/input/hot-nimbus-psm_v1.0.env
@@ -0,0 +1,10 @@
+parameters:
+ pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012
+ pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_psm_flavor_name: lc.4xlarge4
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/positive_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/positive_test/input/hot-nimbus-psm_v1.0.yaml
new file mode 100644
index 0000000000..5e940bdd49
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/positive_test/input/hot-nimbus-psm_v1.0.yaml
@@ -0,0 +1,50 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_names:
+ type: comma_delimited_list
+ label: PCRF SM server names
+ description: name of the PCRF SM instance
+ pcrf_psm_image_name:
+ type: string
+ label: PCRF SM image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_psm_001:
+ type: OS::Contrail::NetworkIpam
+
+ server_pcrf_psm_002:
+ type: OS::Contrail::NetworkIpam
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/envInRoot/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/envInRoot/MANIFEST.json
new file mode 100644
index 0000000000..5524f47fa8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/envInRoot/MANIFEST.json
@@ -0,0 +1,22 @@
+{
+ "name": "validTest",
+ "description": "Valid Test",
+ "version": "1610",
+ "data": [
+ {
+ "file": "first.yaml",
+ "type": "HEAT",
+ "isBase": true,
+ "data": [
+ {
+ "file": "first.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "second.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/envInRoot/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/envInRoot/first.env
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/envInRoot/first.env
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/envInRoot/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/envInRoot/first.yaml
new file mode 100644
index 0000000000..368834e847
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/envInRoot/first.yaml
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat expose volume resource
+
+resources:
+ SecurityGroup_expose:
+ type: OS::Neutron::Net
+
+outputs:
+ not_expose_resource_network_output:
+ description: the pcrf_server
+ value: { get_param: ServerGroup_expose }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/envInRoot/second.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/envInRoot/second.env
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/envInRoot/second.env
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidFileTypeInManifest/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidFileTypeInManifest/MANIFEST.json
new file mode 100644
index 0000000000..de35dfc0db
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidFileTypeInManifest/MANIFEST.json
@@ -0,0 +1,24 @@
+{
+ "name": "validTest",
+ "description": "Valid Test",
+ "version": "1610",
+ "data": [
+ {
+ "file": "single.yaml.illegalSuffix",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "single.env.illegalSuffix",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "singleVol.yaml.illegalSuffix",
+ "type": "HEAT_VOL"
+ }
+ ]
+ },{
+ "file": "illegalTypeFile.yaml",
+ "type": "ILLEGAL_TYPE"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidFileTypeInManifest/illegalTypeFile.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidFileTypeInManifest/illegalTypeFile.yaml
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidFileTypeInManifest/illegalTypeFile.yaml
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidFileTypeInManifest/single.env.illegalSuffix b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidFileTypeInManifest/single.env.illegalSuffix
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidFileTypeInManifest/single.env.illegalSuffix
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidFileTypeInManifest/single.yaml.illegalSuffix b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidFileTypeInManifest/single.yaml.illegalSuffix
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidFileTypeInManifest/single.yaml.illegalSuffix
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidFileTypeInManifest/singleVol.yaml.illegalSuffix b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidFileTypeInManifest/singleVol.yaml.illegalSuffix
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidFileTypeInManifest/singleVol.yaml.illegalSuffix
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidManifest/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidManifest/MANIFEST.json
new file mode 100644
index 0000000000..7b3dd77ed7
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidManifest/MANIFEST.json
@@ -0,0 +1,21 @@
+{
+ "name": "inValidTest",
+ "description": "inValid Test",
+ "version": [{"v": "1.0"}],
+ "data": [
+ {
+ "file": "single.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "single.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "singleVol.yaml",
+ "type": "HEAT_VOL"
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidManifest/single.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidManifest/single.env
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidManifest/single.env
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidManifest/single.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidManifest/single.yaml
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidManifest/single.yaml
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidManifest/singleVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidManifest/singleVol.yaml
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidManifest/singleVol.yaml
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifest/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifest/MANIFEST.json
new file mode 100644
index 0000000000..fd2b2c3f6d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifest/MANIFEST.json
@@ -0,0 +1,22 @@
+{
+ "name": "validTest",
+ "description": "Valid Test",
+ "version": "1610",
+ "invalidField":"value",
+ "data": [
+ {
+ "file": "single.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "single.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "singleVol.yaml",
+ "type": "HEAT_VOL"
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifest/extraFile.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifest/extraFile.env
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifest/extraFile.env
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifest/single.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifest/single.env
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifest/single.env
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifest/single.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifest/single.yaml
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifest/single.yaml
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifest/singleVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifest/singleVol.yaml
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifest/singleVol.yaml
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifestAndInZip/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifestAndInZip/MANIFEST.json
new file mode 100644
index 0000000000..60a8efe769
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifestAndInZip/MANIFEST.json
@@ -0,0 +1,21 @@
+{
+ "name": "validTest",
+ "description": "Valid Test",
+ "version": "1610",
+ "data": [
+ {
+ "file": "single.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "single.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "singleVol.yaml",
+ "type": "HEAT_VOL"
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifestAndInZip/extraFile.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifestAndInZip/extraFile.env
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifestAndInZip/extraFile.env
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifestAndInZip/single.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifestAndInZip/single.env
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifestAndInZip/single.env
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifestAndInZip/single.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifestAndInZip/single.yaml
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifestAndInZip/single.yaml
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInZip/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInZip/MANIFEST.json
new file mode 100644
index 0000000000..60a8efe769
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInZip/MANIFEST.json
@@ -0,0 +1,21 @@
+{
+ "name": "validTest",
+ "description": "Valid Test",
+ "version": "1610",
+ "data": [
+ {
+ "file": "single.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "single.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "singleVol.yaml",
+ "type": "HEAT_VOL"
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInZip/single.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInZip/single.env
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInZip/single.env
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInZip/single.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInZip/single.yaml
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInZip/single.yaml
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/validFiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/validFiles/MANIFEST.json
new file mode 100644
index 0000000000..60a8efe769
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/validFiles/MANIFEST.json
@@ -0,0 +1,21 @@
+{
+ "name": "validTest",
+ "description": "Valid Test",
+ "version": "1610",
+ "data": [
+ {
+ "file": "single.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "single.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "singleVol.yaml",
+ "type": "HEAT_VOL"
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/validFiles/single.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/validFiles/single.env
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/validFiles/single.env
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/validFiles/single.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/validFiles/single.yaml
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/validFiles/single.yaml
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/validFiles/singleVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/validFiles/singleVol.yaml
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/validFiles/singleVol.yaml
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/duplicateKey.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/duplicateKey.yaml
new file mode 100644
index 0000000000..418cc59c71
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/duplicateKey.yaml
@@ -0,0 +1,30 @@
+### Heat Template ###
+description: Generated template
+heat_template_version: 2013-05-23
+parameters: {}
+resources:
+ Key_1_unique:
+ properties:
+ admin_state_up: true
+ name: name_notReleventForTest
+ shared: true
+ type: type_notReleventForTest
+ Key_2_not_unique:
+ properties:
+ admin_state_up: true
+ name: name_notReleventForTest
+ shared: true
+ type: type_notReleventForTest
+ Key_2_not_unique:
+ properties:
+ admin_state_up: true
+ name: name_notReleventForTest
+ shared: true
+ type: type_notReleventForTest
+ Key_3_unique:
+ properties:
+ admin_state_up: true
+ name: name_notReleventForTest
+ shared: true
+ type: type_notReleventForTest
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/emptyYaml.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/emptyYaml.yaml
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/emptyYaml.yaml
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalidTabYamlStructure.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalidTabYamlStructure.yaml
new file mode 100644
index 0000000000..9cc18cef35
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalidTabYamlStructure.yaml
@@ -0,0 +1,24 @@
+### Heat Template ###
+description: Generated template
+heat_template_version: 2013-05-23
+parameters: {}
+resources:
+ Key_1_unique:
+ properties:
+ admin_state_up: true
+ name: name_notReleventForTest
+ shared: true
+ type: type_notReleventForTest
+ Key_2_unique:
+ properties:
+ admin_state_up: true
+ name: name_notReleventForTest
+ shared: true
+ type: type_notReleventForTest
+ Key_3_unique:
+ properties:
+ admin_state_up: true
+ name: name_notReleventForTest
+ shared: true
+ type: type_notReleventForTest
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalidYamlStructure.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalidYamlStructure.yaml
new file mode 100644
index 0000000000..65205e01f9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalidYamlStructure.yaml
@@ -0,0 +1,30 @@
+### Heat Template ###
+description: Generated template
+heat_template_version: 2013-05-23
+parameters: {}
+resources:
+ Key_1_unique:
+ properties:
+ admin_state_up: true
+ name: name_notReleventForTest
+ - shared: true
+ type: type_notReleventForTest
+ Key_2_not_unique:
+ properties:
+ admin_state_up: true
+ name: name_notReleventForTest
+ shared: true
+ type: type_notReleventForTest
+ Key_2_not_unique:
+ properties:
+ admin_state_up: true
+ name: name_notReleventForTest
+ shared: true
+ type: type_notReleventForTest
+ Key_3_unique:
+ properties:
+ admin_state_up: true
+ name: name_notReleventForTest
+ shared: true
+ type: type_notReleventForTest
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_duplicate_key/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_duplicate_key/input/MANIFEST.json
new file mode 100644
index 0000000000..a4065d0b68
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_duplicate_key/input/MANIFEST.json
@@ -0,0 +1,39 @@
+{
+ "data": [
+ {
+ "file": "validHeat.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-oam_v1.0.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "hot-nimbus-oam-volumes_v1.0",
+ "type": "HEAT_VOL",
+ "data": [{
+ "file": "hot-nimbus-oam-volumes_v1.0.env",
+ "type": "HEAT_ENV"
+ }]
+ }
+ ]
+ },
+ {
+ "file": "mainValid.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-oam-networks_v1.0",
+ "type": "HEAT_NET"
+ }
+ ]
+ },
+ {
+ "file": "missingHeatFromZip.yaml.yaml",
+ "type": "HEAT"
+ }
+ ],
+ "description": "RXAEmleoRDWLeWVvmXUJxDKCItgjkMEXuKJcUWyVUZrCUiMzZSyHPzhqLcJSIUNBzohsIGXLBIwstuVDEuFtxuLIwWgCCdjprtvzruHIUKdVnCyifJQUJjqSCoKKKyVaWFTFKzHNhTZNlZTYaMKGEpIMXOpIxSyTZZCgVsGkItQelBbFVrmCltTgkuppYMrEfvwqNBLVRSGCucNwliWFZUuXloXBiZaqtodZjyFpqBNqhlpcrARmMpvLiz",
+ "name": "FCTRQGcMevNngRDvECQYfiEXCYbGeAWRHdaGggLUgyOnssHAiU",
+ "version": "2013-05-23"
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_duplicate_key/input/heat_missing_from_manifast.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_duplicate_key/input/heat_missing_from_manifast.yaml
new file mode 100644
index 0000000000..d5608abfb4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_duplicate_key/input/heat_missing_from_manifast.yaml
@@ -0,0 +1,250 @@
+### Heat Template ###
+description: Generated template
+heat_template_version: 2013-05-23
+parameters: {}
+resources:
+ network_0:
+ properties:
+ admin_state_up: true
+ name: NET_167
+ shared: true
+ type: OS::Neutron::Net
+ network_1:
+ properties:
+ admin_state_up: true
+ name: NET_169
+ shared: true
+ type: OS::Neutron::Net
+ network_2:
+ properties:
+ admin_state_up: true
+ name: NET_166
+ shared: true
+ type: OS::Neutron::Net
+ network_3:
+ properties:
+ admin_state_up: true
+ name: NET_168
+ shared: true
+ type: OS::Neutron::Net
+ network_4:
+ properties:
+ admin_state_up: true
+ name: NET_169
+ shared: true
+ type: OS::Neutron::Net
+ network_5:
+ properties:
+ admin_state_up: true
+ name: NET_170
+ shared: true
+ type: OS::Neutron::Net
+ network_6:
+ properties:
+ admin_state_up: true
+ name: NET_168
+ shared: true
+ type: OS::Neutron::Net
+ network_7:
+ properties:
+ admin_state_up: true
+ name: NET_170
+ shared: true
+ type: OS::Neutron::Net
+ network_8:
+ properties:
+ admin_state_up: true
+ name: NET_166
+ shared: true
+ type: OS::Neutron::Net
+ network_9:
+ properties:
+ admin_state_up: true
+ name: NET_167
+ shared: true
+ type: OS::Neutron::Net
+ security_group_0:
+ properties:
+ description: Default security group
+ name: _default
+ rules:
+ - direction: ingress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ - direction: egress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ type: OS::Neutron::SecurityGroup
+ security_group_1:
+ properties:
+ description: Default security group
+ name: _default
+ rules:
+ - direction: egress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ - direction: ingress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ type: OS::Neutron::SecurityGroup
+ subnet_0:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.254
+ start: 10.147.32.130
+ cidr: 10.147.32.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_167
+ network_id:
+ get_resource: network_9
+ type: OS::Neutron::Subnet
+ subnet_1:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.254
+ start: 10.147.32.130
+ cidr: 10.147.32.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_167
+ network_id:
+ get_resource: network_0
+ type: OS::Neutron::Subnet
+ subnet_2:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.126
+ start: 10.147.32.2
+ cidr: 10.147.32.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_166
+ network_id:
+ get_resource: network_8
+ type: OS::Neutron::Subnet
+ subnet_3:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.126
+ start: 10.147.32.2
+ cidr: 10.147.32.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_166
+ network_id:
+ get_resource: network_2
+ type: OS::Neutron::Subnet
+ subnet_4:
+ properties:
+ allocation_pools:
+ - end: 10.147.34.126
+ start: 10.147.34.2
+ cidr: 10.147.34.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_170
+ network_id:
+ get_resource: network_5
+ type: OS::Neutron::Subnet
+ subnet_5:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.126
+ start: 10.147.33.2
+ cidr: 10.147.33.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_168
+ network_id:
+ get_resource: network_6
+ type: OS::Neutron::Subnet
+ subnet_6:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.126
+ start: 10.147.33.2
+ cidr: 10.147.33.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_168
+ network_id:
+ get_resource: network_3
+ type: OS::Neutron::Subnet
+ subnet_7:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.254
+ start: 10.147.33.130
+ cidr: 10.147.33.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_169
+ network_id:
+ get_resource: network_1
+ type: OS::Neutron::Subnet
+ subnet_8:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.254
+ start: 10.147.33.130
+ cidr: 10.147.33.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_169
+ network_id:
+ get_resource: network_4
+ type: OS::Neutron::Subnet
+ subnet_9:
+ properties:
+ allocation_pools:
+ - end: 10.147.34.126
+ start: 10.147.34.2
+ cidr: 10.147.34.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_170
+ network_id:
+ get_resource: network_7
+ type: OS::Neutron::Subnet
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_duplicate_key/input/mainValid.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_duplicate_key/input/mainValid.yaml
new file mode 100644
index 0000000000..318c8f1283
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_duplicate_key/input/mainValid.yaml
@@ -0,0 +1,250 @@
+### Heat Template ###
+description: Generated template
+heat_template_version: 2013-05-23
+parameters: {}
+resources:
+ network_0:
+ properties:
+ admin_state_up: true
+ name: NET_167
+ shared: true
+ type: OS::Neutron::Net
+ network_1:
+ properties:
+ admin_state_up: true
+ name: NET_169
+ shared: true
+ type: OS::Neutron::Net
+ network_2:
+ properties:
+ admin_state_up: true
+ name: NET_166
+ shared: true
+ type: OS::Neutron::Net
+ network_3:
+ properties:
+ admin_state_up: true
+ name: NET_168
+ shared: true
+ type: missingNested.yaml
+ network_4:
+ properties:
+ admin_state_up: true
+ name: { get_file: missing-artifact }
+ shared: true
+ type: OS::Neutron::Net
+ network_5:
+ properties:
+ admin_state_up: true
+ name: NET_170
+ shared: true
+ type: OS::Neutron::Net
+ network_6:
+ properties:
+ admin_state_up: true
+ name: NET_168
+ shared: true
+ type: OS::Neutron::Net
+ network_7:
+ properties:
+ admin_state_up: true
+ name: NET_170
+ shared: true
+ type: OS::Neutron::Net
+ network_8:
+ properties:
+ admin_state_up: true
+ name: NET_166
+ shared: true
+ type: OS::Neutron::Net
+ network_9:
+ properties:
+ admin_state_up: true
+ name: NET_167
+ shared: true
+ type: OS::Neutron::Net
+ security_group_0:
+ properties:
+ description: Default security group
+ name: _default
+ rules:
+ - direction: ingress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ - direction: egress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ type: OS::Neutron::SecurityGroup
+ security_group_1:
+ properties:
+ description: Default security group
+ name: _default
+ rules:
+ - direction: egress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ - direction: ingress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ type: OS::Neutron::SecurityGroup
+ subnet_0:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.254
+ start: 10.147.32.130
+ cidr: 10.147.32.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_167
+ network_id:
+ get_resource: network_9
+ type: OS::Neutron::Subnet
+ subnet_1:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.254
+ start: 10.147.32.130
+ cidr: 10.147.32.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_167
+ network_id:
+ get_resource: network_0
+ type: OS::Neutron::Subnet
+ subnet_2:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.126
+ start: 10.147.32.2
+ cidr: 10.147.32.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_166
+ network_id:
+ get_resource: network_8
+ type: OS::Neutron::Subnet
+ subnet_3:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.126
+ start: 10.147.32.2
+ cidr: 10.147.32.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_166
+ network_id:
+ get_resource: network_2
+ type: OS::Neutron::Subnet
+ subnet_4:
+ properties:
+ allocation_pools:
+ - end: 10.147.34.126
+ start: 10.147.34.2
+ cidr: 10.147.34.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_170
+ network_id:
+ get_resource: network_5
+ type: OS::Neutron::Subnet
+ subnet_5:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.126
+ start: 10.147.33.2
+ cidr: 10.147.33.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_168
+ network_id:
+ get_resource: network_6
+ type: OS::Neutron::Subnet
+ subnet_6:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.126
+ start: 10.147.33.2
+ cidr: 10.147.33.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_168
+ network_id:
+ get_resource: network_3
+ type: OS::Neutron::Subnet
+ subnet_7:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.254
+ start: 10.147.33.130
+ cidr: 10.147.33.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_169
+ network_id:
+ get_resource: network_1
+ type: OS::Neutron::Subnet
+ subnet_8:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.254
+ start: 10.147.33.130
+ cidr: 10.147.33.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_169
+ network_id:
+ get_resource: network_4
+ type: OS::Neutron::Subnet
+ subnet_9:
+ properties:
+ allocation_pools:
+ - end: 10.147.34.126
+ start: 10.147.34.2
+ cidr: 10.147.34.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_170
+ network_id:
+ get_resource: network_7
+ type: OS::Neutron::Subnet
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_duplicate_key/input/validHeat.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_duplicate_key/input/validHeat.yaml
new file mode 100644
index 0000000000..d5608abfb4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_duplicate_key/input/validHeat.yaml
@@ -0,0 +1,250 @@
+### Heat Template ###
+description: Generated template
+heat_template_version: 2013-05-23
+parameters: {}
+resources:
+ network_0:
+ properties:
+ admin_state_up: true
+ name: NET_167
+ shared: true
+ type: OS::Neutron::Net
+ network_1:
+ properties:
+ admin_state_up: true
+ name: NET_169
+ shared: true
+ type: OS::Neutron::Net
+ network_2:
+ properties:
+ admin_state_up: true
+ name: NET_166
+ shared: true
+ type: OS::Neutron::Net
+ network_3:
+ properties:
+ admin_state_up: true
+ name: NET_168
+ shared: true
+ type: OS::Neutron::Net
+ network_4:
+ properties:
+ admin_state_up: true
+ name: NET_169
+ shared: true
+ type: OS::Neutron::Net
+ network_5:
+ properties:
+ admin_state_up: true
+ name: NET_170
+ shared: true
+ type: OS::Neutron::Net
+ network_6:
+ properties:
+ admin_state_up: true
+ name: NET_168
+ shared: true
+ type: OS::Neutron::Net
+ network_7:
+ properties:
+ admin_state_up: true
+ name: NET_170
+ shared: true
+ type: OS::Neutron::Net
+ network_8:
+ properties:
+ admin_state_up: true
+ name: NET_166
+ shared: true
+ type: OS::Neutron::Net
+ network_9:
+ properties:
+ admin_state_up: true
+ name: NET_167
+ shared: true
+ type: OS::Neutron::Net
+ security_group_0:
+ properties:
+ description: Default security group
+ name: _default
+ rules:
+ - direction: ingress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ - direction: egress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ type: OS::Neutron::SecurityGroup
+ security_group_1:
+ properties:
+ description: Default security group
+ name: _default
+ rules:
+ - direction: egress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ - direction: ingress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ type: OS::Neutron::SecurityGroup
+ subnet_0:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.254
+ start: 10.147.32.130
+ cidr: 10.147.32.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_167
+ network_id:
+ get_resource: network_9
+ type: OS::Neutron::Subnet
+ subnet_1:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.254
+ start: 10.147.32.130
+ cidr: 10.147.32.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_167
+ network_id:
+ get_resource: network_0
+ type: OS::Neutron::Subnet
+ subnet_2:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.126
+ start: 10.147.32.2
+ cidr: 10.147.32.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_166
+ network_id:
+ get_resource: network_8
+ type: OS::Neutron::Subnet
+ subnet_3:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.126
+ start: 10.147.32.2
+ cidr: 10.147.32.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_166
+ network_id:
+ get_resource: network_2
+ type: OS::Neutron::Subnet
+ subnet_4:
+ properties:
+ allocation_pools:
+ - end: 10.147.34.126
+ start: 10.147.34.2
+ cidr: 10.147.34.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_170
+ network_id:
+ get_resource: network_5
+ type: OS::Neutron::Subnet
+ subnet_5:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.126
+ start: 10.147.33.2
+ cidr: 10.147.33.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_168
+ network_id:
+ get_resource: network_6
+ type: OS::Neutron::Subnet
+ subnet_6:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.126
+ start: 10.147.33.2
+ cidr: 10.147.33.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_168
+ network_id:
+ get_resource: network_3
+ type: OS::Neutron::Subnet
+ subnet_7:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.254
+ start: 10.147.33.130
+ cidr: 10.147.33.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_169
+ network_id:
+ get_resource: network_1
+ type: OS::Neutron::Subnet
+ subnet_8:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.254
+ start: 10.147.33.130
+ cidr: 10.147.33.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_169
+ network_id:
+ get_resource: network_4
+ type: OS::Neutron::Subnet
+ subnet_9:
+ properties:
+ allocation_pools:
+ - end: 10.147.34.126
+ start: 10.147.34.2
+ cidr: 10.147.34.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_170
+ network_id:
+ get_resource: network_7
+ type: OS::Neutron::Subnet
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/expected_output/expected_output.json
new file mode 100644
index 0000000000..dedbeaf5db
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/expected_output/expected_output.json
@@ -0,0 +1,46 @@
+{
+ "invalid_duplicateKey.yaml": {
+ "errorMessageList": [
+ {
+ "level": "ERROR",
+ "message": "Can\u0027t construct a java object for tag:yaml.org,2002:java.util.Map; exception\u003dwhile parsing MappingNode\n in \u0027string\u0027, line 6, column 3:\n network_0:\n ^\nduplicate key: network_0\n in \u0027string\u0027, line 26, column 1:\n \n ^\n\n in \u0027string\u0027, line 2, column 1:\n description: Generated template\n ^\n"
+ }
+ ]
+ },
+ "invalid_empty.yml": {
+ "errorMessageList": [
+ {
+ "level": "ERROR",
+ "message": "File:invalid_empty.yml is empty."
+ }
+ ]
+ },
+ "MANIFEST.json": {
+ "errorMessageList": []
+ },
+ "invalid_yamlInXMLFormat.yaml": {
+ "errorMessageList": [
+ {
+ "level": "ERROR",
+ "message": "Can\u0027t construct a java object for tag:yaml.org,2002:java.util.Map; exception\u003dNo single argument constructor found for interface java.util.Map\n in \u0027string\u0027, line 1, column 1:\n \u003cstart\u003e\n ^\n"
+ }
+ ]
+ },
+ "expected_output.json": {
+ "errorMessageList": []
+ },
+ "invalid_additionalSpaceBeforeProperty.yaml": {
+ "errorMessageList": [
+ {
+ "level": "ERROR",
+ "message": "while parsing a block mapping\n in \u0027string\u0027, line 7, column 5:\n properties:\n ^\nexpected \u003cblock end\u003e, but found BlockMappingStart\n in \u0027string\u0027, line 9, column 7:\n name: NET_167\n ^\n"
+ }
+ ]
+ },
+ "validHeat.yaml": {
+ "errorMessageList": []
+ },
+ "heat_missing_from_manifast.yaml": {
+ "errorMessageList": []
+ }
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/MANIFEST.json
new file mode 100644
index 0000000000..a4065d0b68
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/MANIFEST.json
@@ -0,0 +1,39 @@
+{
+ "data": [
+ {
+ "file": "validHeat.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-oam_v1.0.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "hot-nimbus-oam-volumes_v1.0",
+ "type": "HEAT_VOL",
+ "data": [{
+ "file": "hot-nimbus-oam-volumes_v1.0.env",
+ "type": "HEAT_ENV"
+ }]
+ }
+ ]
+ },
+ {
+ "file": "mainValid.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-oam-networks_v1.0",
+ "type": "HEAT_NET"
+ }
+ ]
+ },
+ {
+ "file": "missingHeatFromZip.yaml.yaml",
+ "type": "HEAT"
+ }
+ ],
+ "description": "RXAEmleoRDWLeWVvmXUJxDKCItgjkMEXuKJcUWyVUZrCUiMzZSyHPzhqLcJSIUNBzohsIGXLBIwstuVDEuFtxuLIwWgCCdjprtvzruHIUKdVnCyifJQUJjqSCoKKKyVaWFTFKzHNhTZNlZTYaMKGEpIMXOpIxSyTZZCgVsGkItQelBbFVrmCltTgkuppYMrEfvwqNBLVRSGCucNwliWFZUuXloXBiZaqtodZjyFpqBNqhlpcrARmMpvLiz",
+ "name": "FCTRQGcMevNngRDvECQYfiEXCYbGeAWRHdaGggLUgyOnssHAiU",
+ "version": "2013-05-23"
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/heat_missing_from_manifast.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/heat_missing_from_manifast.yaml
new file mode 100644
index 0000000000..d5608abfb4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/heat_missing_from_manifast.yaml
@@ -0,0 +1,250 @@
+### Heat Template ###
+description: Generated template
+heat_template_version: 2013-05-23
+parameters: {}
+resources:
+ network_0:
+ properties:
+ admin_state_up: true
+ name: NET_167
+ shared: true
+ type: OS::Neutron::Net
+ network_1:
+ properties:
+ admin_state_up: true
+ name: NET_169
+ shared: true
+ type: OS::Neutron::Net
+ network_2:
+ properties:
+ admin_state_up: true
+ name: NET_166
+ shared: true
+ type: OS::Neutron::Net
+ network_3:
+ properties:
+ admin_state_up: true
+ name: NET_168
+ shared: true
+ type: OS::Neutron::Net
+ network_4:
+ properties:
+ admin_state_up: true
+ name: NET_169
+ shared: true
+ type: OS::Neutron::Net
+ network_5:
+ properties:
+ admin_state_up: true
+ name: NET_170
+ shared: true
+ type: OS::Neutron::Net
+ network_6:
+ properties:
+ admin_state_up: true
+ name: NET_168
+ shared: true
+ type: OS::Neutron::Net
+ network_7:
+ properties:
+ admin_state_up: true
+ name: NET_170
+ shared: true
+ type: OS::Neutron::Net
+ network_8:
+ properties:
+ admin_state_up: true
+ name: NET_166
+ shared: true
+ type: OS::Neutron::Net
+ network_9:
+ properties:
+ admin_state_up: true
+ name: NET_167
+ shared: true
+ type: OS::Neutron::Net
+ security_group_0:
+ properties:
+ description: Default security group
+ name: _default
+ rules:
+ - direction: ingress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ - direction: egress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ type: OS::Neutron::SecurityGroup
+ security_group_1:
+ properties:
+ description: Default security group
+ name: _default
+ rules:
+ - direction: egress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ - direction: ingress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ type: OS::Neutron::SecurityGroup
+ subnet_0:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.254
+ start: 10.147.32.130
+ cidr: 10.147.32.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_167
+ network_id:
+ get_resource: network_9
+ type: OS::Neutron::Subnet
+ subnet_1:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.254
+ start: 10.147.32.130
+ cidr: 10.147.32.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_167
+ network_id:
+ get_resource: network_0
+ type: OS::Neutron::Subnet
+ subnet_2:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.126
+ start: 10.147.32.2
+ cidr: 10.147.32.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_166
+ network_id:
+ get_resource: network_8
+ type: OS::Neutron::Subnet
+ subnet_3:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.126
+ start: 10.147.32.2
+ cidr: 10.147.32.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_166
+ network_id:
+ get_resource: network_2
+ type: OS::Neutron::Subnet
+ subnet_4:
+ properties:
+ allocation_pools:
+ - end: 10.147.34.126
+ start: 10.147.34.2
+ cidr: 10.147.34.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_170
+ network_id:
+ get_resource: network_5
+ type: OS::Neutron::Subnet
+ subnet_5:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.126
+ start: 10.147.33.2
+ cidr: 10.147.33.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_168
+ network_id:
+ get_resource: network_6
+ type: OS::Neutron::Subnet
+ subnet_6:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.126
+ start: 10.147.33.2
+ cidr: 10.147.33.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_168
+ network_id:
+ get_resource: network_3
+ type: OS::Neutron::Subnet
+ subnet_7:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.254
+ start: 10.147.33.130
+ cidr: 10.147.33.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_169
+ network_id:
+ get_resource: network_1
+ type: OS::Neutron::Subnet
+ subnet_8:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.254
+ start: 10.147.33.130
+ cidr: 10.147.33.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_169
+ network_id:
+ get_resource: network_4
+ type: OS::Neutron::Subnet
+ subnet_9:
+ properties:
+ allocation_pools:
+ - end: 10.147.34.126
+ start: 10.147.34.2
+ cidr: 10.147.34.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_170
+ network_id:
+ get_resource: network_7
+ type: OS::Neutron::Subnet
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalidYamlTab.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalidYamlTab.yaml
new file mode 100644
index 0000000000..042f301507
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalidYamlTab.yaml
@@ -0,0 +1,250 @@
+### Heat Template ###
+description: Generated template
+heat_template_version: 2013-05-23
+parameters: {}
+resources:
+ network_0:
+ properties:
+ admin_state_up: true
+ name: NET_167
+ shared: true
+ type: OS::Neutron::Net
+ network_1:
+ properties:
+ admin_state_up: true
+ name: NET_169
+ shared: true
+ type: OS::Neutron::Net
+ network_2:
+ properties:
+ admin_state_up: true
+ name: NET_166
+ shared: true
+ type: OS::Neutron::Net
+ network_3:
+ properties:
+ admin_state_up: true
+ name: NET_168
+ shared: true
+ type: OS::Neutron::Net
+ network_4:
+ properties:
+ admin_state_up: true
+ name: NET_169
+ shared: true
+ type: OS::Neutron::Net
+ network_5:
+ properties:
+ admin_state_up: true
+ name: NET_170
+ shared: true
+ type: OS::Neutron::Net
+ network_6:
+ properties:
+ admin_state_up: true
+ name: NET_168
+ shared: true
+ type: OS::Neutron::Net
+ network_7:
+ properties:
+ admin_state_up: true
+ name: NET_170
+ shared: true
+ type: OS::Neutron::Net
+ network_8:
+ properties:
+ admin_state_up: true
+ name: NET_166
+ shared: true
+ type: OS::Neutron::Net
+ network_9:
+ properties:
+ admin_state_up: true
+ name: NET_167
+ shared: true
+ type: OS::Neutron::Net
+ security_group_0:
+ properties:
+ description: Default security group
+ name: _default
+ rules:
+ - direction: ingress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ - direction: egress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ type: OS::Neutron::SecurityGroup
+ security_group_1:
+ properties:
+ description: Default security group
+ name: _default
+ rules:
+ - direction: egress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ - direction: ingress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ type: OS::Neutron::SecurityGroup
+ subnet_0:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.254
+ start: 10.147.32.130
+ cidr: 10.147.32.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_167
+ network_id:
+ get_resource: network_9
+ type: OS::Neutron::Subnet
+ subnet_1:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.254
+ start: 10.147.32.130
+ cidr: 10.147.32.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_167
+ network_id:
+ get_resource: network_0
+ type: OS::Neutron::Subnet
+ subnet_2:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.126
+ start: 10.147.32.2
+ cidr: 10.147.32.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_166
+ network_id:
+ get_resource: network_8
+ type: OS::Neutron::Subnet
+ subnet_3:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.126
+ start: 10.147.32.2
+ cidr: 10.147.32.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_166
+ network_id:
+ get_resource: network_2
+ type: OS::Neutron::Subnet
+ subnet_4:
+ properties:
+ allocation_pools:
+ - end: 10.147.34.126
+ start: 10.147.34.2
+ cidr: 10.147.34.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_170
+ network_id:
+ get_resource: network_5
+ type: OS::Neutron::Subnet
+ subnet_5:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.126
+ start: 10.147.33.2
+ cidr: 10.147.33.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_168
+ network_id:
+ get_resource: network_6
+ type: OS::Neutron::Subnet
+ subnet_6:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.126
+ start: 10.147.33.2
+ cidr: 10.147.33.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_168
+ network_id:
+ get_resource: network_3
+ type: OS::Neutron::Subnet
+ subnet_7:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.254
+ start: 10.147.33.130
+ cidr: 10.147.33.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_169
+ network_id:
+ get_resource: network_1
+ type: OS::Neutron::Subnet
+ subnet_8:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.254
+ start: 10.147.33.130
+ cidr: 10.147.33.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_169
+ network_id:
+ get_resource: network_4
+ type: OS::Neutron::Subnet
+ subnet_9:
+ properties:
+ allocation_pools:
+ - end: 10.147.34.126
+ start: 10.147.34.2
+ cidr: 10.147.34.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_170
+ network_id:
+ get_resource: network_7
+ type: OS::Neutron::Subnet
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalid_additionalSpaceBeforeProperty.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalid_additionalSpaceBeforeProperty.yaml
new file mode 100644
index 0000000000..b47d7d32f4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalid_additionalSpaceBeforeProperty.yaml
@@ -0,0 +1,250 @@
+### Heat Template ###
+description: Generated template
+heat_template_version: 2013-05-23
+parameters: {}
+resources:
+ network_0:
+ properties:
+ admin_state_up: true
+ name: NET_167
+ shared: true
+ type: OS::Neutron::Net
+ network_1:
+ properties:
+ admin_state_up: true
+ name: NET_169
+ shared: true
+ type: OS::Neutron::Net
+ network_2:
+ properties:
+ admin_state_up: true
+ name: NET_166
+ shared: true
+ type: OS::Neutron::Net
+ network_3:
+ properties:
+ admin_state_up: true
+ name: NET_168
+ shared: true
+ type: missingNested.yaml
+ network_4:
+ properties:
+ admin_state_up: true
+ name: { get_file: missing-artifact }
+ shared: true
+ type: OS::Neutron::Net
+ network_5:
+ properties:
+ admin_state_up: true
+ name: NET_170
+ shared: true
+ type: OS::Neutron::Net
+ network_6:
+ properties:
+ admin_state_up: true
+ name: NET_168
+ shared: true
+ type: OS::Neutron::Net
+ network_7:
+ properties:
+ admin_state_up: true
+ name: NET_170
+ shared: true
+ type: OS::Neutron::Net
+ network_8:
+ properties:
+ admin_state_up: true
+ name: NET_166
+ shared: true
+ type: OS::Neutron::Net
+ network_9:
+ properties:
+ admin_state_up: true
+ name: NET_167
+ shared: true
+ type: OS::Neutron::Net
+ security_group_0:
+ properties:
+ description: Default security group
+ name: _default
+ rules:
+ - direction: ingress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ - direction: egress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ type: OS::Neutron::SecurityGroup
+ security_group_1:
+ properties:
+ description: Default security group
+ name: _default
+ rules:
+ - direction: egress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ - direction: ingress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ type: OS::Neutron::SecurityGroup
+ subnet_0:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.254
+ start: 10.147.32.130
+ cidr: 10.147.32.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_167
+ network_id:
+ get_resource: network_9
+ type: OS::Neutron::Subnet
+ subnet_1:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.254
+ start: 10.147.32.130
+ cidr: 10.147.32.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_167
+ network_id:
+ get_resource: network_0
+ type: OS::Neutron::Subnet
+ subnet_2:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.126
+ start: 10.147.32.2
+ cidr: 10.147.32.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_166
+ network_id:
+ get_resource: network_8
+ type: OS::Neutron::Subnet
+ subnet_3:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.126
+ start: 10.147.32.2
+ cidr: 10.147.32.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_166
+ network_id:
+ get_resource: network_2
+ type: OS::Neutron::Subnet
+ subnet_4:
+ properties:
+ allocation_pools:
+ - end: 10.147.34.126
+ start: 10.147.34.2
+ cidr: 10.147.34.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_170
+ network_id:
+ get_resource: network_5
+ type: OS::Neutron::Subnet
+ subnet_5:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.126
+ start: 10.147.33.2
+ cidr: 10.147.33.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_168
+ network_id:
+ get_resource: network_6
+ type: OS::Neutron::Subnet
+ subnet_6:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.126
+ start: 10.147.33.2
+ cidr: 10.147.33.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_168
+ network_id:
+ get_resource: network_3
+ type: OS::Neutron::Subnet
+ subnet_7:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.254
+ start: 10.147.33.130
+ cidr: 10.147.33.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_169
+ network_id:
+ get_resource: network_1
+ type: OS::Neutron::Subnet
+ subnet_8:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.254
+ start: 10.147.33.130
+ cidr: 10.147.33.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_169
+ network_id:
+ get_resource: network_4
+ type: OS::Neutron::Subnet
+ subnet_9:
+ properties:
+ allocation_pools:
+ - end: 10.147.34.126
+ start: 10.147.34.2
+ cidr: 10.147.34.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_170
+ network_id:
+ get_resource: network_7
+ type: OS::Neutron::Subnet
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalid_duplicateKey.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalid_duplicateKey.yaml
new file mode 100644
index 0000000000..2dc0c63941
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalid_duplicateKey.yaml
@@ -0,0 +1,25 @@
+### Heat Template ###
+description: Generated template
+heat_template_version: 2013-05-23
+parameters: {}
+resources:
+ network_0:
+ properties:
+ admin_state_up: true
+ name: NET_167
+ shared: true
+ type: OS::Neutron::Net
+ network_0:
+ properties:
+ admin_state_up: true
+ name: NET_167
+ shared: true
+ type: OS::Neutron::Net
+ network_1:
+ properties:
+ admin_state_up: true
+ name: NET_169
+ shared: true
+ type: OS::Neutron::Net
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalid_empty.yml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalid_empty.yml
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalid_empty.yml
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalid_yamlInXMLFormat.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalid_yamlInXMLFormat.yaml
new file mode 100644
index 0000000000..54626a9d62
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalid_yamlInXMLFormat.yaml
@@ -0,0 +1,4 @@
+<start>
+ <additional>dfdf
+ </additional>
+</start> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/validHeat.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/validHeat.yaml
new file mode 100644
index 0000000000..d5608abfb4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/validHeat.yaml
@@ -0,0 +1,250 @@
+### Heat Template ###
+description: Generated template
+heat_template_version: 2013-05-23
+parameters: {}
+resources:
+ network_0:
+ properties:
+ admin_state_up: true
+ name: NET_167
+ shared: true
+ type: OS::Neutron::Net
+ network_1:
+ properties:
+ admin_state_up: true
+ name: NET_169
+ shared: true
+ type: OS::Neutron::Net
+ network_2:
+ properties:
+ admin_state_up: true
+ name: NET_166
+ shared: true
+ type: OS::Neutron::Net
+ network_3:
+ properties:
+ admin_state_up: true
+ name: NET_168
+ shared: true
+ type: OS::Neutron::Net
+ network_4:
+ properties:
+ admin_state_up: true
+ name: NET_169
+ shared: true
+ type: OS::Neutron::Net
+ network_5:
+ properties:
+ admin_state_up: true
+ name: NET_170
+ shared: true
+ type: OS::Neutron::Net
+ network_6:
+ properties:
+ admin_state_up: true
+ name: NET_168
+ shared: true
+ type: OS::Neutron::Net
+ network_7:
+ properties:
+ admin_state_up: true
+ name: NET_170
+ shared: true
+ type: OS::Neutron::Net
+ network_8:
+ properties:
+ admin_state_up: true
+ name: NET_166
+ shared: true
+ type: OS::Neutron::Net
+ network_9:
+ properties:
+ admin_state_up: true
+ name: NET_167
+ shared: true
+ type: OS::Neutron::Net
+ security_group_0:
+ properties:
+ description: Default security group
+ name: _default
+ rules:
+ - direction: ingress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ - direction: egress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ type: OS::Neutron::SecurityGroup
+ security_group_1:
+ properties:
+ description: Default security group
+ name: _default
+ rules:
+ - direction: egress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ - direction: ingress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ type: OS::Neutron::SecurityGroup
+ subnet_0:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.254
+ start: 10.147.32.130
+ cidr: 10.147.32.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_167
+ network_id:
+ get_resource: network_9
+ type: OS::Neutron::Subnet
+ subnet_1:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.254
+ start: 10.147.32.130
+ cidr: 10.147.32.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_167
+ network_id:
+ get_resource: network_0
+ type: OS::Neutron::Subnet
+ subnet_2:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.126
+ start: 10.147.32.2
+ cidr: 10.147.32.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_166
+ network_id:
+ get_resource: network_8
+ type: OS::Neutron::Subnet
+ subnet_3:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.126
+ start: 10.147.32.2
+ cidr: 10.147.32.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_166
+ network_id:
+ get_resource: network_2
+ type: OS::Neutron::Subnet
+ subnet_4:
+ properties:
+ allocation_pools:
+ - end: 10.147.34.126
+ start: 10.147.34.2
+ cidr: 10.147.34.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_170
+ network_id:
+ get_resource: network_5
+ type: OS::Neutron::Subnet
+ subnet_5:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.126
+ start: 10.147.33.2
+ cidr: 10.147.33.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_168
+ network_id:
+ get_resource: network_6
+ type: OS::Neutron::Subnet
+ subnet_6:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.126
+ start: 10.147.33.2
+ cidr: 10.147.33.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_168
+ network_id:
+ get_resource: network_3
+ type: OS::Neutron::Subnet
+ subnet_7:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.254
+ start: 10.147.33.130
+ cidr: 10.147.33.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_169
+ network_id:
+ get_resource: network_1
+ type: OS::Neutron::Subnet
+ subnet_8:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.254
+ start: 10.147.33.130
+ cidr: 10.147.33.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_169
+ network_id:
+ get_resource: network_4
+ type: OS::Neutron::Subnet
+ subnet_9:
+ properties:
+ allocation_pools:
+ - end: 10.147.34.126
+ start: 10.147.34.2
+ cidr: 10.147.34.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_170
+ network_id:
+ get_resource: network_7
+ type: OS::Neutron::Subnet
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/valid_yaml/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/valid_yaml/input/MANIFEST.json
new file mode 100644
index 0000000000..a4065d0b68
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/valid_yaml/input/MANIFEST.json
@@ -0,0 +1,39 @@
+{
+ "data": [
+ {
+ "file": "validHeat.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-oam_v1.0.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "hot-nimbus-oam-volumes_v1.0",
+ "type": "HEAT_VOL",
+ "data": [{
+ "file": "hot-nimbus-oam-volumes_v1.0.env",
+ "type": "HEAT_ENV"
+ }]
+ }
+ ]
+ },
+ {
+ "file": "mainValid.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-oam-networks_v1.0",
+ "type": "HEAT_NET"
+ }
+ ]
+ },
+ {
+ "file": "missingHeatFromZip.yaml.yaml",
+ "type": "HEAT"
+ }
+ ],
+ "description": "RXAEmleoRDWLeWVvmXUJxDKCItgjkMEXuKJcUWyVUZrCUiMzZSyHPzhqLcJSIUNBzohsIGXLBIwstuVDEuFtxuLIwWgCCdjprtvzruHIUKdVnCyifJQUJjqSCoKKKyVaWFTFKzHNhTZNlZTYaMKGEpIMXOpIxSyTZZCgVsGkItQelBbFVrmCltTgkuppYMrEfvwqNBLVRSGCucNwliWFZUuXloXBiZaqtodZjyFpqBNqhlpcrARmMpvLiz",
+ "name": "FCTRQGcMevNngRDvECQYfiEXCYbGeAWRHdaGggLUgyOnssHAiU",
+ "version": "2013-05-23"
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/valid_yaml/input/heat_missing_from_manifast.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/valid_yaml/input/heat_missing_from_manifast.yaml
new file mode 100644
index 0000000000..d5608abfb4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/valid_yaml/input/heat_missing_from_manifast.yaml
@@ -0,0 +1,250 @@
+### Heat Template ###
+description: Generated template
+heat_template_version: 2013-05-23
+parameters: {}
+resources:
+ network_0:
+ properties:
+ admin_state_up: true
+ name: NET_167
+ shared: true
+ type: OS::Neutron::Net
+ network_1:
+ properties:
+ admin_state_up: true
+ name: NET_169
+ shared: true
+ type: OS::Neutron::Net
+ network_2:
+ properties:
+ admin_state_up: true
+ name: NET_166
+ shared: true
+ type: OS::Neutron::Net
+ network_3:
+ properties:
+ admin_state_up: true
+ name: NET_168
+ shared: true
+ type: OS::Neutron::Net
+ network_4:
+ properties:
+ admin_state_up: true
+ name: NET_169
+ shared: true
+ type: OS::Neutron::Net
+ network_5:
+ properties:
+ admin_state_up: true
+ name: NET_170
+ shared: true
+ type: OS::Neutron::Net
+ network_6:
+ properties:
+ admin_state_up: true
+ name: NET_168
+ shared: true
+ type: OS::Neutron::Net
+ network_7:
+ properties:
+ admin_state_up: true
+ name: NET_170
+ shared: true
+ type: OS::Neutron::Net
+ network_8:
+ properties:
+ admin_state_up: true
+ name: NET_166
+ shared: true
+ type: OS::Neutron::Net
+ network_9:
+ properties:
+ admin_state_up: true
+ name: NET_167
+ shared: true
+ type: OS::Neutron::Net
+ security_group_0:
+ properties:
+ description: Default security group
+ name: _default
+ rules:
+ - direction: ingress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ - direction: egress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ type: OS::Neutron::SecurityGroup
+ security_group_1:
+ properties:
+ description: Default security group
+ name: _default
+ rules:
+ - direction: egress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ - direction: ingress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ type: OS::Neutron::SecurityGroup
+ subnet_0:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.254
+ start: 10.147.32.130
+ cidr: 10.147.32.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_167
+ network_id:
+ get_resource: network_9
+ type: OS::Neutron::Subnet
+ subnet_1:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.254
+ start: 10.147.32.130
+ cidr: 10.147.32.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_167
+ network_id:
+ get_resource: network_0
+ type: OS::Neutron::Subnet
+ subnet_2:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.126
+ start: 10.147.32.2
+ cidr: 10.147.32.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_166
+ network_id:
+ get_resource: network_8
+ type: OS::Neutron::Subnet
+ subnet_3:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.126
+ start: 10.147.32.2
+ cidr: 10.147.32.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_166
+ network_id:
+ get_resource: network_2
+ type: OS::Neutron::Subnet
+ subnet_4:
+ properties:
+ allocation_pools:
+ - end: 10.147.34.126
+ start: 10.147.34.2
+ cidr: 10.147.34.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_170
+ network_id:
+ get_resource: network_5
+ type: OS::Neutron::Subnet
+ subnet_5:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.126
+ start: 10.147.33.2
+ cidr: 10.147.33.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_168
+ network_id:
+ get_resource: network_6
+ type: OS::Neutron::Subnet
+ subnet_6:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.126
+ start: 10.147.33.2
+ cidr: 10.147.33.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_168
+ network_id:
+ get_resource: network_3
+ type: OS::Neutron::Subnet
+ subnet_7:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.254
+ start: 10.147.33.130
+ cidr: 10.147.33.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_169
+ network_id:
+ get_resource: network_1
+ type: OS::Neutron::Subnet
+ subnet_8:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.254
+ start: 10.147.33.130
+ cidr: 10.147.33.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_169
+ network_id:
+ get_resource: network_4
+ type: OS::Neutron::Subnet
+ subnet_9:
+ properties:
+ allocation_pools:
+ - end: 10.147.34.126
+ start: 10.147.34.2
+ cidr: 10.147.34.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_170
+ network_id:
+ get_resource: network_7
+ type: OS::Neutron::Subnet
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/valid_yaml/input/mainValid.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/valid_yaml/input/mainValid.yaml
new file mode 100644
index 0000000000..318c8f1283
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/valid_yaml/input/mainValid.yaml
@@ -0,0 +1,250 @@
+### Heat Template ###
+description: Generated template
+heat_template_version: 2013-05-23
+parameters: {}
+resources:
+ network_0:
+ properties:
+ admin_state_up: true
+ name: NET_167
+ shared: true
+ type: OS::Neutron::Net
+ network_1:
+ properties:
+ admin_state_up: true
+ name: NET_169
+ shared: true
+ type: OS::Neutron::Net
+ network_2:
+ properties:
+ admin_state_up: true
+ name: NET_166
+ shared: true
+ type: OS::Neutron::Net
+ network_3:
+ properties:
+ admin_state_up: true
+ name: NET_168
+ shared: true
+ type: missingNested.yaml
+ network_4:
+ properties:
+ admin_state_up: true
+ name: { get_file: missing-artifact }
+ shared: true
+ type: OS::Neutron::Net
+ network_5:
+ properties:
+ admin_state_up: true
+ name: NET_170
+ shared: true
+ type: OS::Neutron::Net
+ network_6:
+ properties:
+ admin_state_up: true
+ name: NET_168
+ shared: true
+ type: OS::Neutron::Net
+ network_7:
+ properties:
+ admin_state_up: true
+ name: NET_170
+ shared: true
+ type: OS::Neutron::Net
+ network_8:
+ properties:
+ admin_state_up: true
+ name: NET_166
+ shared: true
+ type: OS::Neutron::Net
+ network_9:
+ properties:
+ admin_state_up: true
+ name: NET_167
+ shared: true
+ type: OS::Neutron::Net
+ security_group_0:
+ properties:
+ description: Default security group
+ name: _default
+ rules:
+ - direction: ingress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ - direction: egress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ type: OS::Neutron::SecurityGroup
+ security_group_1:
+ properties:
+ description: Default security group
+ name: _default
+ rules:
+ - direction: egress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ - direction: ingress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ type: OS::Neutron::SecurityGroup
+ subnet_0:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.254
+ start: 10.147.32.130
+ cidr: 10.147.32.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_167
+ network_id:
+ get_resource: network_9
+ type: OS::Neutron::Subnet
+ subnet_1:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.254
+ start: 10.147.32.130
+ cidr: 10.147.32.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_167
+ network_id:
+ get_resource: network_0
+ type: OS::Neutron::Subnet
+ subnet_2:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.126
+ start: 10.147.32.2
+ cidr: 10.147.32.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_166
+ network_id:
+ get_resource: network_8
+ type: OS::Neutron::Subnet
+ subnet_3:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.126
+ start: 10.147.32.2
+ cidr: 10.147.32.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_166
+ network_id:
+ get_resource: network_2
+ type: OS::Neutron::Subnet
+ subnet_4:
+ properties:
+ allocation_pools:
+ - end: 10.147.34.126
+ start: 10.147.34.2
+ cidr: 10.147.34.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_170
+ network_id:
+ get_resource: network_5
+ type: OS::Neutron::Subnet
+ subnet_5:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.126
+ start: 10.147.33.2
+ cidr: 10.147.33.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_168
+ network_id:
+ get_resource: network_6
+ type: OS::Neutron::Subnet
+ subnet_6:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.126
+ start: 10.147.33.2
+ cidr: 10.147.33.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_168
+ network_id:
+ get_resource: network_3
+ type: OS::Neutron::Subnet
+ subnet_7:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.254
+ start: 10.147.33.130
+ cidr: 10.147.33.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_169
+ network_id:
+ get_resource: network_1
+ type: OS::Neutron::Subnet
+ subnet_8:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.254
+ start: 10.147.33.130
+ cidr: 10.147.33.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_169
+ network_id:
+ get_resource: network_4
+ type: OS::Neutron::Subnet
+ subnet_9:
+ properties:
+ allocation_pools:
+ - end: 10.147.34.126
+ start: 10.147.34.2
+ cidr: 10.147.34.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_170
+ network_id:
+ get_resource: network_7
+ type: OS::Neutron::Subnet
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/valid_yaml/input/validHeat.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/valid_yaml/input/validHeat.yaml
new file mode 100644
index 0000000000..d5608abfb4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/valid_yaml/input/validHeat.yaml
@@ -0,0 +1,250 @@
+### Heat Template ###
+description: Generated template
+heat_template_version: 2013-05-23
+parameters: {}
+resources:
+ network_0:
+ properties:
+ admin_state_up: true
+ name: NET_167
+ shared: true
+ type: OS::Neutron::Net
+ network_1:
+ properties:
+ admin_state_up: true
+ name: NET_169
+ shared: true
+ type: OS::Neutron::Net
+ network_2:
+ properties:
+ admin_state_up: true
+ name: NET_166
+ shared: true
+ type: OS::Neutron::Net
+ network_3:
+ properties:
+ admin_state_up: true
+ name: NET_168
+ shared: true
+ type: OS::Neutron::Net
+ network_4:
+ properties:
+ admin_state_up: true
+ name: NET_169
+ shared: true
+ type: OS::Neutron::Net
+ network_5:
+ properties:
+ admin_state_up: true
+ name: NET_170
+ shared: true
+ type: OS::Neutron::Net
+ network_6:
+ properties:
+ admin_state_up: true
+ name: NET_168
+ shared: true
+ type: OS::Neutron::Net
+ network_7:
+ properties:
+ admin_state_up: true
+ name: NET_170
+ shared: true
+ type: OS::Neutron::Net
+ network_8:
+ properties:
+ admin_state_up: true
+ name: NET_166
+ shared: true
+ type: OS::Neutron::Net
+ network_9:
+ properties:
+ admin_state_up: true
+ name: NET_167
+ shared: true
+ type: OS::Neutron::Net
+ security_group_0:
+ properties:
+ description: Default security group
+ name: _default
+ rules:
+ - direction: ingress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ - direction: egress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ type: OS::Neutron::SecurityGroup
+ security_group_1:
+ properties:
+ description: Default security group
+ name: _default
+ rules:
+ - direction: egress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ - direction: ingress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ type: OS::Neutron::SecurityGroup
+ subnet_0:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.254
+ start: 10.147.32.130
+ cidr: 10.147.32.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_167
+ network_id:
+ get_resource: network_9
+ type: OS::Neutron::Subnet
+ subnet_1:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.254
+ start: 10.147.32.130
+ cidr: 10.147.32.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_167
+ network_id:
+ get_resource: network_0
+ type: OS::Neutron::Subnet
+ subnet_2:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.126
+ start: 10.147.32.2
+ cidr: 10.147.32.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_166
+ network_id:
+ get_resource: network_8
+ type: OS::Neutron::Subnet
+ subnet_3:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.126
+ start: 10.147.32.2
+ cidr: 10.147.32.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_166
+ network_id:
+ get_resource: network_2
+ type: OS::Neutron::Subnet
+ subnet_4:
+ properties:
+ allocation_pools:
+ - end: 10.147.34.126
+ start: 10.147.34.2
+ cidr: 10.147.34.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_170
+ network_id:
+ get_resource: network_5
+ type: OS::Neutron::Subnet
+ subnet_5:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.126
+ start: 10.147.33.2
+ cidr: 10.147.33.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_168
+ network_id:
+ get_resource: network_6
+ type: OS::Neutron::Subnet
+ subnet_6:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.126
+ start: 10.147.33.2
+ cidr: 10.147.33.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_168
+ network_id:
+ get_resource: network_3
+ type: OS::Neutron::Subnet
+ subnet_7:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.254
+ start: 10.147.33.130
+ cidr: 10.147.33.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_169
+ network_id:
+ get_resource: network_1
+ type: OS::Neutron::Subnet
+ subnet_8:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.254
+ start: 10.147.33.130
+ cidr: 10.147.33.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_169
+ network_id:
+ get_resource: network_4
+ type: OS::Neutron::Subnet
+ subnet_9:
+ properties:
+ allocation_pools:
+ - end: 10.147.34.126
+ start: 10.147.34.2
+ cidr: 10.147.34.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_170
+ network_id:
+ get_resource: network_7
+ type: OS::Neutron::Subnet
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/yaml_validator/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/yaml_validator/input/MANIFEST.json
new file mode 100644
index 0000000000..a4065d0b68
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/yaml_validator/input/MANIFEST.json
@@ -0,0 +1,39 @@
+{
+ "data": [
+ {
+ "file": "validHeat.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-oam_v1.0.env",
+ "type": "HEAT_ENV"
+ },
+ {
+ "file": "hot-nimbus-oam-volumes_v1.0",
+ "type": "HEAT_VOL",
+ "data": [{
+ "file": "hot-nimbus-oam-volumes_v1.0.env",
+ "type": "HEAT_ENV"
+ }]
+ }
+ ]
+ },
+ {
+ "file": "mainValid.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-oam-networks_v1.0",
+ "type": "HEAT_NET"
+ }
+ ]
+ },
+ {
+ "file": "missingHeatFromZip.yaml.yaml",
+ "type": "HEAT"
+ }
+ ],
+ "description": "RXAEmleoRDWLeWVvmXUJxDKCItgjkMEXuKJcUWyVUZrCUiMzZSyHPzhqLcJSIUNBzohsIGXLBIwstuVDEuFtxuLIwWgCCdjprtvzruHIUKdVnCyifJQUJjqSCoKKKyVaWFTFKzHNhTZNlZTYaMKGEpIMXOpIxSyTZZCgVsGkItQelBbFVrmCltTgkuppYMrEfvwqNBLVRSGCucNwliWFZUuXloXBiZaqtodZjyFpqBNqhlpcrARmMpvLiz",
+ "name": "FCTRQGcMevNngRDvECQYfiEXCYbGeAWRHdaGggLUgyOnssHAiU",
+ "version": "2013-05-23"
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/yaml_validator/input/heat_missing_from_manifast.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/yaml_validator/input/heat_missing_from_manifast.yaml
new file mode 100644
index 0000000000..d5608abfb4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/yaml_validator/input/heat_missing_from_manifast.yaml
@@ -0,0 +1,250 @@
+### Heat Template ###
+description: Generated template
+heat_template_version: 2013-05-23
+parameters: {}
+resources:
+ network_0:
+ properties:
+ admin_state_up: true
+ name: NET_167
+ shared: true
+ type: OS::Neutron::Net
+ network_1:
+ properties:
+ admin_state_up: true
+ name: NET_169
+ shared: true
+ type: OS::Neutron::Net
+ network_2:
+ properties:
+ admin_state_up: true
+ name: NET_166
+ shared: true
+ type: OS::Neutron::Net
+ network_3:
+ properties:
+ admin_state_up: true
+ name: NET_168
+ shared: true
+ type: OS::Neutron::Net
+ network_4:
+ properties:
+ admin_state_up: true
+ name: NET_169
+ shared: true
+ type: OS::Neutron::Net
+ network_5:
+ properties:
+ admin_state_up: true
+ name: NET_170
+ shared: true
+ type: OS::Neutron::Net
+ network_6:
+ properties:
+ admin_state_up: true
+ name: NET_168
+ shared: true
+ type: OS::Neutron::Net
+ network_7:
+ properties:
+ admin_state_up: true
+ name: NET_170
+ shared: true
+ type: OS::Neutron::Net
+ network_8:
+ properties:
+ admin_state_up: true
+ name: NET_166
+ shared: true
+ type: OS::Neutron::Net
+ network_9:
+ properties:
+ admin_state_up: true
+ name: NET_167
+ shared: true
+ type: OS::Neutron::Net
+ security_group_0:
+ properties:
+ description: Default security group
+ name: _default
+ rules:
+ - direction: ingress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ - direction: egress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ type: OS::Neutron::SecurityGroup
+ security_group_1:
+ properties:
+ description: Default security group
+ name: _default
+ rules:
+ - direction: egress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ - direction: ingress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ type: OS::Neutron::SecurityGroup
+ subnet_0:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.254
+ start: 10.147.32.130
+ cidr: 10.147.32.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_167
+ network_id:
+ get_resource: network_9
+ type: OS::Neutron::Subnet
+ subnet_1:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.254
+ start: 10.147.32.130
+ cidr: 10.147.32.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_167
+ network_id:
+ get_resource: network_0
+ type: OS::Neutron::Subnet
+ subnet_2:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.126
+ start: 10.147.32.2
+ cidr: 10.147.32.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_166
+ network_id:
+ get_resource: network_8
+ type: OS::Neutron::Subnet
+ subnet_3:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.126
+ start: 10.147.32.2
+ cidr: 10.147.32.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_166
+ network_id:
+ get_resource: network_2
+ type: OS::Neutron::Subnet
+ subnet_4:
+ properties:
+ allocation_pools:
+ - end: 10.147.34.126
+ start: 10.147.34.2
+ cidr: 10.147.34.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_170
+ network_id:
+ get_resource: network_5
+ type: OS::Neutron::Subnet
+ subnet_5:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.126
+ start: 10.147.33.2
+ cidr: 10.147.33.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_168
+ network_id:
+ get_resource: network_6
+ type: OS::Neutron::Subnet
+ subnet_6:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.126
+ start: 10.147.33.2
+ cidr: 10.147.33.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_168
+ network_id:
+ get_resource: network_3
+ type: OS::Neutron::Subnet
+ subnet_7:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.254
+ start: 10.147.33.130
+ cidr: 10.147.33.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_169
+ network_id:
+ get_resource: network_1
+ type: OS::Neutron::Subnet
+ subnet_8:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.254
+ start: 10.147.33.130
+ cidr: 10.147.33.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_169
+ network_id:
+ get_resource: network_4
+ type: OS::Neutron::Subnet
+ subnet_9:
+ properties:
+ allocation_pools:
+ - end: 10.147.34.126
+ start: 10.147.34.2
+ cidr: 10.147.34.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_170
+ network_id:
+ get_resource: network_7
+ type: OS::Neutron::Subnet
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/yaml_validator/input/mainValid.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/yaml_validator/input/mainValid.yaml
new file mode 100644
index 0000000000..318c8f1283
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/yaml_validator/input/mainValid.yaml
@@ -0,0 +1,250 @@
+### Heat Template ###
+description: Generated template
+heat_template_version: 2013-05-23
+parameters: {}
+resources:
+ network_0:
+ properties:
+ admin_state_up: true
+ name: NET_167
+ shared: true
+ type: OS::Neutron::Net
+ network_1:
+ properties:
+ admin_state_up: true
+ name: NET_169
+ shared: true
+ type: OS::Neutron::Net
+ network_2:
+ properties:
+ admin_state_up: true
+ name: NET_166
+ shared: true
+ type: OS::Neutron::Net
+ network_3:
+ properties:
+ admin_state_up: true
+ name: NET_168
+ shared: true
+ type: missingNested.yaml
+ network_4:
+ properties:
+ admin_state_up: true
+ name: { get_file: missing-artifact }
+ shared: true
+ type: OS::Neutron::Net
+ network_5:
+ properties:
+ admin_state_up: true
+ name: NET_170
+ shared: true
+ type: OS::Neutron::Net
+ network_6:
+ properties:
+ admin_state_up: true
+ name: NET_168
+ shared: true
+ type: OS::Neutron::Net
+ network_7:
+ properties:
+ admin_state_up: true
+ name: NET_170
+ shared: true
+ type: OS::Neutron::Net
+ network_8:
+ properties:
+ admin_state_up: true
+ name: NET_166
+ shared: true
+ type: OS::Neutron::Net
+ network_9:
+ properties:
+ admin_state_up: true
+ name: NET_167
+ shared: true
+ type: OS::Neutron::Net
+ security_group_0:
+ properties:
+ description: Default security group
+ name: _default
+ rules:
+ - direction: ingress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ - direction: egress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ type: OS::Neutron::SecurityGroup
+ security_group_1:
+ properties:
+ description: Default security group
+ name: _default
+ rules:
+ - direction: egress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ - direction: ingress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ type: OS::Neutron::SecurityGroup
+ subnet_0:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.254
+ start: 10.147.32.130
+ cidr: 10.147.32.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_167
+ network_id:
+ get_resource: network_9
+ type: OS::Neutron::Subnet
+ subnet_1:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.254
+ start: 10.147.32.130
+ cidr: 10.147.32.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_167
+ network_id:
+ get_resource: network_0
+ type: OS::Neutron::Subnet
+ subnet_2:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.126
+ start: 10.147.32.2
+ cidr: 10.147.32.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_166
+ network_id:
+ get_resource: network_8
+ type: OS::Neutron::Subnet
+ subnet_3:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.126
+ start: 10.147.32.2
+ cidr: 10.147.32.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_166
+ network_id:
+ get_resource: network_2
+ type: OS::Neutron::Subnet
+ subnet_4:
+ properties:
+ allocation_pools:
+ - end: 10.147.34.126
+ start: 10.147.34.2
+ cidr: 10.147.34.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_170
+ network_id:
+ get_resource: network_5
+ type: OS::Neutron::Subnet
+ subnet_5:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.126
+ start: 10.147.33.2
+ cidr: 10.147.33.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_168
+ network_id:
+ get_resource: network_6
+ type: OS::Neutron::Subnet
+ subnet_6:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.126
+ start: 10.147.33.2
+ cidr: 10.147.33.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_168
+ network_id:
+ get_resource: network_3
+ type: OS::Neutron::Subnet
+ subnet_7:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.254
+ start: 10.147.33.130
+ cidr: 10.147.33.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_169
+ network_id:
+ get_resource: network_1
+ type: OS::Neutron::Subnet
+ subnet_8:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.254
+ start: 10.147.33.130
+ cidr: 10.147.33.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_169
+ network_id:
+ get_resource: network_4
+ type: OS::Neutron::Subnet
+ subnet_9:
+ properties:
+ allocation_pools:
+ - end: 10.147.34.126
+ start: 10.147.34.2
+ cidr: 10.147.34.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_170
+ network_id:
+ get_resource: network_7
+ type: OS::Neutron::Subnet
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/yaml_validator/input/validHeat.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/yaml_validator/input/validHeat.yaml
new file mode 100644
index 0000000000..d5608abfb4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/yaml_validator/input/validHeat.yaml
@@ -0,0 +1,250 @@
+### Heat Template ###
+description: Generated template
+heat_template_version: 2013-05-23
+parameters: {}
+resources:
+ network_0:
+ properties:
+ admin_state_up: true
+ name: NET_167
+ shared: true
+ type: OS::Neutron::Net
+ network_1:
+ properties:
+ admin_state_up: true
+ name: NET_169
+ shared: true
+ type: OS::Neutron::Net
+ network_2:
+ properties:
+ admin_state_up: true
+ name: NET_166
+ shared: true
+ type: OS::Neutron::Net
+ network_3:
+ properties:
+ admin_state_up: true
+ name: NET_168
+ shared: true
+ type: OS::Neutron::Net
+ network_4:
+ properties:
+ admin_state_up: true
+ name: NET_169
+ shared: true
+ type: OS::Neutron::Net
+ network_5:
+ properties:
+ admin_state_up: true
+ name: NET_170
+ shared: true
+ type: OS::Neutron::Net
+ network_6:
+ properties:
+ admin_state_up: true
+ name: NET_168
+ shared: true
+ type: OS::Neutron::Net
+ network_7:
+ properties:
+ admin_state_up: true
+ name: NET_170
+ shared: true
+ type: OS::Neutron::Net
+ network_8:
+ properties:
+ admin_state_up: true
+ name: NET_166
+ shared: true
+ type: OS::Neutron::Net
+ network_9:
+ properties:
+ admin_state_up: true
+ name: NET_167
+ shared: true
+ type: OS::Neutron::Net
+ security_group_0:
+ properties:
+ description: Default security group
+ name: _default
+ rules:
+ - direction: ingress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ - direction: egress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ type: OS::Neutron::SecurityGroup
+ security_group_1:
+ properties:
+ description: Default security group
+ name: _default
+ rules:
+ - direction: egress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ - direction: ingress
+ ethertype: IPv4
+ remote_ip_prefix: 0.0.0.0/0
+ type: OS::Neutron::SecurityGroup
+ subnet_0:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.254
+ start: 10.147.32.130
+ cidr: 10.147.32.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_167
+ network_id:
+ get_resource: network_9
+ type: OS::Neutron::Subnet
+ subnet_1:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.254
+ start: 10.147.32.130
+ cidr: 10.147.32.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_167
+ network_id:
+ get_resource: network_0
+ type: OS::Neutron::Subnet
+ subnet_2:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.126
+ start: 10.147.32.2
+ cidr: 10.147.32.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_166
+ network_id:
+ get_resource: network_8
+ type: OS::Neutron::Subnet
+ subnet_3:
+ properties:
+ allocation_pools:
+ - end: 10.147.32.126
+ start: 10.147.32.2
+ cidr: 10.147.32.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_166
+ network_id:
+ get_resource: network_2
+ type: OS::Neutron::Subnet
+ subnet_4:
+ properties:
+ allocation_pools:
+ - end: 10.147.34.126
+ start: 10.147.34.2
+ cidr: 10.147.34.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_170
+ network_id:
+ get_resource: network_5
+ type: OS::Neutron::Subnet
+ subnet_5:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.126
+ start: 10.147.33.2
+ cidr: 10.147.33.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_168
+ network_id:
+ get_resource: network_6
+ type: OS::Neutron::Subnet
+ subnet_6:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.126
+ start: 10.147.33.2
+ cidr: 10.147.33.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_168
+ network_id:
+ get_resource: network_3
+ type: OS::Neutron::Subnet
+ subnet_7:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.254
+ start: 10.147.33.130
+ cidr: 10.147.33.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_169
+ network_id:
+ get_resource: network_1
+ type: OS::Neutron::Subnet
+ subnet_8:
+ properties:
+ allocation_pools:
+ - end: 10.147.33.254
+ start: 10.147.33.130
+ cidr: 10.147.33.128/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_169
+ network_id:
+ get_resource: network_4
+ type: OS::Neutron::Subnet
+ subnet_9:
+ properties:
+ allocation_pools:
+ - end: 10.147.34.126
+ start: 10.147.34.2
+ cidr: 10.147.34.0/25
+ dns_nameservers:
+ - 10.147.4.18
+ - 10.247.5.11
+ enable_dhcp: true
+ host_routes: []
+ ip_version: 4
+ name: NET_170
+ network_id:
+ get_resource: network_7
+ type: OS::Neutron::Subnet
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/pom.xml b/openecomp-be/lib/openecomp-sdc-validation-lib/pom.xml
new file mode 100644
index 0000000000..a132a618a8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/pom.xml
@@ -0,0 +1,38 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <artifactId>openecomp-sdc-lib</artifactId>
+ <groupId>org.openecomp.sdc</groupId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <name>openecomp-sdc-validation-lib</name>
+ <artifactId>openecomp-sdc-validation-lib</artifactId>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>openecomp-sdc-validation-api</module>
+ <module>openecomp-sdc-validation-core</module>
+ <module>openecomp-sdc-validation-impl</module>
+ </modules>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-validation-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-validation-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <!--dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-validation-impl</artifactId>
+ <version>${project.version}</version>
+ </dependency-->
+ </dependencies>
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/pom.xml b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/pom.xml
new file mode 100644
index 0000000000..1cb542eba5
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/pom.xml
@@ -0,0 +1,57 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-lib</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../..</relativePath>
+ </parent>
+
+ <name>openecomp-sdc-vendor-license-api</name>
+ <artifactId>openecomp-sdc-vendor-license-api</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-facade-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-versioning-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-nosqldb-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>javax.el-api</artifactId>
+ <version>${javax.el-api.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.web</groupId>
+ <artifactId>javax.el</artifactId>
+ <version>2.2.4</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-annotations</artifactId>
+ <version>2.7.4</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.dataformat</groupId>
+ <artifactId>jackson-dataformat-xml</artifactId>
+ <version>2.7.4</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.woodstox</groupId>
+ <artifactId>woodstox-core-asl</artifactId>
+ <version>4.4.1</version>
+ </dependency>
+ </dependencies>
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/HealingServiceFactory.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/HealingServiceFactory.java
new file mode 100644
index 0000000000..19d664247b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/HealingServiceFactory.java
@@ -0,0 +1,32 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+import org.openecomp.sdc.vendorlicense.healing.HealingService;
+
+public abstract class HealingServiceFactory extends AbstractComponentFactory<HealingService> {
+
+ public static HealingServiceFactory getInstance() {
+ return AbstractFactory.getInstance(HealingServiceFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/VendorLicenseArtifactServiceFactory.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/VendorLicenseArtifactServiceFactory.java
new file mode 100644
index 0000000000..0ce7484aa7
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/VendorLicenseArtifactServiceFactory.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+import org.openecomp.sdc.vendorlicense.licenseartifacts.VendorLicenseArtifactsService;
+
+public abstract class VendorLicenseArtifactServiceFactory
+ extends AbstractComponentFactory<VendorLicenseArtifactsService> {
+
+ public static VendorLicenseArtifactServiceFactory getInstance() {
+ return AbstractFactory.getInstance(VendorLicenseArtifactServiceFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/VendorLicenseConstants.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/VendorLicenseConstants.java
new file mode 100644
index 0000000000..2a1930d626
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/VendorLicenseConstants.java
@@ -0,0 +1,43 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense;
+
+import java.io.File;
+
+public final class VendorLicenseConstants {
+ public static final String VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE = "VendorLicenseModel";
+
+ public static final String EXTERNAL_ARTIFACTS_DIR = "Artifacts";
+ //todo change when separating external from internal artifacts
+ public static final String VNF_ARTIFACT_NAME_WITH_PATH =
+ EXTERNAL_ARTIFACTS_DIR + File.separator + "vf-license-model.xml";
+ public static final String VENDOR_LICENSE_MODEL_ARTIFACT_NAME_WITH_PATH =
+ EXTERNAL_ARTIFACTS_DIR + File.separator + "vendor-license-model.xml";
+ public static final String VENDOR_LICENSE_MODEL_ARTIFACT_REGEX_REMOVE = " xmlns=\"\"";
+
+ public final class UniqueValues {
+ public static final String VENDOR_NAME = "Vendor name";
+ public static final String LICENSE_AGREEMENT_NAME = "License Agreement name";
+ public static final String FEATURE_GROUP_NAME = "Feature Group name";
+ public static final String ENTITLEMENT_POOL_NAME = "Entitlement Pool name";
+ public static final String LICENSE_KEY_GROUP_NAME = "License Key Group name";
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/EntitlementPoolDao.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/EntitlementPoolDao.java
new file mode 100644
index 0000000000..c507e6946a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/EntitlementPoolDao.java
@@ -0,0 +1,38 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao;
+
+import org.openecomp.core.dao.BaseDao;
+import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity;
+import org.openecomp.sdc.versioning.dao.VersionableDao;
+
+public interface EntitlementPoolDao extends VersionableDao, BaseDao<EntitlementPoolEntity> {
+
+ long count(EntitlementPoolEntity entitlementPool);
+
+ void deleteAll(EntitlementPoolEntity entitlementPool);
+
+ void addReferencingFeatureGroup(EntitlementPoolEntity entitlementPool,
+ String referencingFeatureGroupId);
+
+ void removeReferencingFeatureGroup(EntitlementPoolEntity entitlementPool,
+ String referencingFeatureGroupId);
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/EntitlementPoolDaoFactory.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/EntitlementPoolDaoFactory.java
new file mode 100644
index 0000000000..e5bfcfa1cb
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/EntitlementPoolDaoFactory.java
@@ -0,0 +1,31 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+public abstract class EntitlementPoolDaoFactory
+ extends AbstractComponentFactory<EntitlementPoolDao> {
+ public static EntitlementPoolDaoFactory getInstance() {
+ return AbstractFactory.getInstance(EntitlementPoolDaoFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/FeatureGroupDao.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/FeatureGroupDao.java
new file mode 100644
index 0000000000..a5db802861
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/FeatureGroupDao.java
@@ -0,0 +1,47 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao;
+
+import org.openecomp.core.dao.BaseDao;
+import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity;
+import org.openecomp.sdc.versioning.dao.VersionableDao;
+
+import java.util.Set;
+
+public interface FeatureGroupDao extends VersionableDao, BaseDao<FeatureGroupEntity> {
+
+ long count(FeatureGroupEntity featureGroup);
+
+ void deleteAll(FeatureGroupEntity featureGroup);
+
+ void updateFeatureGroup(FeatureGroupEntity entity, Set<String> addedEntitlementPools,
+ Set<String> removedEntitlementPools, Set<String> addedLicenseKeyGroups,
+ Set<String> removedLicenseKeyGroups);
+
+ void addReferencingLicenseAgreement(FeatureGroupEntity featureGroup, String licenseAgreementId);
+
+ void removeReferencingLicenseAgreement(FeatureGroupEntity featureGroup,
+ String licenseAgreementId);
+
+ void removeEntitlementPool(FeatureGroupEntity featureGroup, String entitlementPoolId);
+
+ void removeLicenseKeyGroup(FeatureGroupEntity featureGroup, String licenseKeyGroupId);
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/FeatureGroupDaoFactory.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/FeatureGroupDaoFactory.java
new file mode 100644
index 0000000000..58832e12ae
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/FeatureGroupDaoFactory.java
@@ -0,0 +1,31 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+
+public abstract class FeatureGroupDaoFactory extends AbstractComponentFactory<FeatureGroupDao> {
+ public static FeatureGroupDaoFactory getInstance() {
+ return AbstractFactory.getInstance(FeatureGroupDaoFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/LicenseAgreementDao.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/LicenseAgreementDao.java
new file mode 100644
index 0000000000..df5e972422
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/LicenseAgreementDao.java
@@ -0,0 +1,40 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao;
+
+import org.openecomp.core.dao.BaseDao;
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity;
+import org.openecomp.sdc.versioning.dao.VersionableDao;
+
+import java.util.Set;
+
+public interface LicenseAgreementDao extends VersionableDao, BaseDao<LicenseAgreementEntity> {
+
+ long count(LicenseAgreementEntity entity);
+
+ void deleteAll(LicenseAgreementEntity entity);
+
+ void removeFeatureGroup(LicenseAgreementEntity licenseAgreement, String featureGroupId);
+
+ void updateColumnsAndDeltaFeatureGroupIds(LicenseAgreementEntity licenseAgreement,
+ Set<String> addedFeatureGroupIds,
+ Set<String> removedFeatureGroupIds);
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/LicenseAgreementDaoFactory.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/LicenseAgreementDaoFactory.java
new file mode 100644
index 0000000000..54c7b7bfea
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/LicenseAgreementDaoFactory.java
@@ -0,0 +1,31 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+public abstract class LicenseAgreementDaoFactory
+ extends AbstractComponentFactory<LicenseAgreementDao> {
+ public static LicenseAgreementDaoFactory getInstance() {
+ return AbstractFactory.getInstance(LicenseAgreementDaoFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/LicenseKeyGroupDao.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/LicenseKeyGroupDao.java
new file mode 100644
index 0000000000..43e380d9b9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/LicenseKeyGroupDao.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao;
+
+import org.openecomp.core.dao.BaseDao;
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity;
+import org.openecomp.sdc.versioning.dao.VersionableDao;
+
+public interface LicenseKeyGroupDao extends VersionableDao, BaseDao<LicenseKeyGroupEntity> {
+
+ void deleteAll(LicenseKeyGroupEntity licenseKeyGroup);
+
+ void addReferencingFeatureGroup(LicenseKeyGroupEntity licenseKeyGroup, String featureGroupId);
+
+ void removeReferencingFeatureGroup(LicenseKeyGroupEntity licenseKeyGroup, String featureGroupId);
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/LicenseKeyGroupDaoFactory.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/LicenseKeyGroupDaoFactory.java
new file mode 100644
index 0000000000..1f887390db
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/LicenseKeyGroupDaoFactory.java
@@ -0,0 +1,32 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+public abstract class LicenseKeyGroupDaoFactory
+ extends AbstractComponentFactory<LicenseKeyGroupDao> {
+
+ public static LicenseKeyGroupDaoFactory getInstance() {
+ return AbstractFactory.getInstance(LicenseKeyGroupDaoFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/VendorLicenseModelDao.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/VendorLicenseModelDao.java
new file mode 100644
index 0000000000..b8e39bc496
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/VendorLicenseModelDao.java
@@ -0,0 +1,29 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao;
+
+import org.openecomp.core.dao.BaseDao;
+import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity;
+import org.openecomp.sdc.versioning.dao.VersionableDao;
+
+public interface VendorLicenseModelDao extends VersionableDao, BaseDao<VendorLicenseModelEntity> {
+// void updateLastModificationTime(VendorLicenseModelEntity vendorLicenseModel);
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/VendorLicenseModelDaoFactory.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/VendorLicenseModelDaoFactory.java
new file mode 100644
index 0000000000..b6d13a9027
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/VendorLicenseModelDaoFactory.java
@@ -0,0 +1,32 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+public abstract class VendorLicenseModelDaoFactory
+ extends AbstractComponentFactory<VendorLicenseModelDao> {
+
+ public static VendorLicenseModelDaoFactory getInstance() {
+ return AbstractFactory.getInstance(VendorLicenseModelDaoFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/AggregationFunction.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/AggregationFunction.java
new file mode 100644
index 0000000000..9a5af213c4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/AggregationFunction.java
@@ -0,0 +1,27 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao.types;
+
+public enum AggregationFunction {
+ Peak,
+ Average,
+ Other
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/ChoiceOrOther.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/ChoiceOrOther.java
new file mode 100644
index 0000000000..ca7a09b0df
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/ChoiceOrOther.java
@@ -0,0 +1,154 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao.types;
+
+import com.datastax.driver.mapping.annotations.Transient;
+import com.datastax.driver.mapping.annotations.UDT;
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+
+@UDT(keyspace = "dox", name = "choice_or_other")
+public class ChoiceOrOther<E extends Enum<E>> {
+
+ public static final String CHOICE_OR_OTHER_INVALID_ENUM_ERR_ID =
+ "MULTI_CHOICE_OR_OTHER_INVALID_ENUM_ERR_ID";
+ public static final String CHOICE_OR_OTHER_INVALID_ENUM_MSG =
+ "Enum used as part of ChoiceOrOther type must contain the value 'Other'";
+ public static final String OTHER_ENUM_VALUE = "Other";
+
+ @Transient
+ private E choice;
+
+ @Transient
+ private String other;
+
+ private String result;
+
+ public ChoiceOrOther() {
+ }
+
+ /**
+ * Instantiates a new Choice or other.
+ *
+ * @param choice the choice
+ * @param other the other
+ */
+ public ChoiceOrOther(E choice, String other) {
+ this.choice = choice;
+ this.other = other;
+ result = resolveResult();
+ }
+
+ public E getChoice() {
+ return choice;
+ }
+
+ public void setChoice(E choice) {
+
+ this.choice = choice;
+ }
+
+ public String getOther() {
+ return other;
+ }
+
+ public void setOther(String other) {
+ this.other = other;
+ }
+
+ public String getResult() {
+ return result;
+ }
+
+ /**
+ * Sets result.
+ *
+ * @param result the result
+ */
+ public void setResult(String result) {
+ if (choice != null) {
+ if (result == null) {
+ this.result = resolveResult();
+ }
+ } else {
+ this.result = result;
+ }
+ }
+
+ private String resolveResult() {
+ return OTHER_ENUM_VALUE.equals(choice.name()) ? other : choice.name();
+ }
+
+ /**
+ * Resolve enum.
+ *
+ * @param enumClass the enum class
+ */
+ public void resolveEnum(Class<E> enumClass) {
+ if (choice != null || result == null) {
+ return;
+ }
+
+ try {
+ choice = E.valueOf(enumClass, result);
+ } catch (IllegalArgumentException e0) {
+ try {
+ choice = E.valueOf(enumClass, OTHER_ENUM_VALUE);
+ } catch (IllegalArgumentException ex) {
+ throw new CoreException(new ErrorCode.ErrorCodeBuilder()
+ .withId(CHOICE_OR_OTHER_INVALID_ENUM_ERR_ID)
+ .withMessage(CHOICE_OR_OTHER_INVALID_ENUM_MSG)
+ .withCategory(ErrorCategory.APPLICATION).build());
+ }
+ other = result;
+ }
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null || getClass() != obj.getClass()) {
+ return false;
+ }
+
+ ChoiceOrOther<?> that = (ChoiceOrOther<?>) obj;
+
+ if (choice != null ? !choice.equals(that.choice) : that.choice != null) {
+ return false;
+ }
+ if (other != null ? !other.equals(that.other) : that.other != null) {
+ return false;
+ }
+ return result != null ? result.equals(that.result) : that.result == null;
+
+ }
+
+ @Override
+ public int hashCode() {
+ int result1 = choice != null ? choice.hashCode() : 0;
+ result1 = 31 * result1 + (other != null ? other.hashCode() : 0);
+ result1 = 31 * result1 + (result != null ? result.hashCode() : 0);
+ return result1;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementMetric.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementMetric.java
new file mode 100644
index 0000000000..42cc231273
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementMetric.java
@@ -0,0 +1,37 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao.types;
+
+public enum EntitlementMetric {
+ Software_Instances_Count,
+ Core,
+ CPU,
+ Trunks,
+ User,
+ Subscribers,
+ Tenants,
+ Tokens,
+ Seats,
+ Units_TB,
+ Units_MB,
+ Units_GB,
+ Other
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolEntity.java
new file mode 100644
index 0000000000..8964458181
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolEntity.java
@@ -0,0 +1,370 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao.types;
+
+import com.datastax.driver.mapping.annotations.ClusteringColumn;
+import com.datastax.driver.mapping.annotations.Column;
+import com.datastax.driver.mapping.annotations.Enumerated;
+import com.datastax.driver.mapping.annotations.Frozen;
+import com.datastax.driver.mapping.annotations.PartitionKey;
+import com.datastax.driver.mapping.annotations.Table;
+import org.openecomp.sdc.vendorlicense.dao.types.xml.AggregationFunctionForXml;
+import org.openecomp.sdc.vendorlicense.dao.types.xml.EntitlementMetricForXml;
+import org.openecomp.sdc.vendorlicense.dao.types.xml.EntitlementTimeForXml;
+import org.openecomp.sdc.vendorlicense.dao.types.xml.ThresholdForXml;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.dao.types.VersionableEntity;
+
+import java.util.HashSet;
+import java.util.Objects;
+import java.util.Set;
+
+@Table(keyspace = "dox", name = "entitlement_pool")
+public class EntitlementPoolEntity implements VersionableEntity {
+ private static final String ENTITY_TYPE = "Entitlement Pool";
+
+ @PartitionKey
+ @Column(name = "vlm_id")
+ private String vendorLicenseModelId;
+
+ @PartitionKey(value = 1)
+ @Frozen
+ private Version version;
+
+ @ClusteringColumn
+ @Column(name = "ep_id")
+ private String id;
+ private String name;
+ private String description;
+
+
+ @Column(name = "threshold")
+ private int thresholdValue;
+
+ @Column(name = "threshold_unit")
+ @Enumerated
+ private ThresholdUnit thresholdUnit;
+
+ @Column(name = "entitlement_metric")
+ @Frozen
+ private ChoiceOrOther<EntitlementMetric> entitlementMetric;
+ private String increments;
+
+ @Column(name = "aggregation_func")
+ @Frozen
+ private ChoiceOrOther<AggregationFunction> aggregationFunction;
+
+ @Column(name = "operational_scope")
+ @Frozen
+ private MultiChoiceOrOther<OperationalScope> operationalScope;
+
+ @Frozen
+ private ChoiceOrOther<EntitlementTime> time;
+
+ @Column(name = "manufacturer_ref_num")
+ private String manufacturerReferenceNumber;
+
+ @Column(name = "ref_fg_ids")
+ private Set<String> referencingFeatureGroups = new HashSet<>();
+
+ @Column(name = "version_uuid")
+ private String versionUuId;
+
+ public EntitlementPoolEntity() {
+ }
+
+ /**
+ * Instantiates a new Entitlement pool entity.
+ *
+ * @param vlmId the vlm id
+ * @param version the version
+ * @param id the id
+ */
+ public EntitlementPoolEntity(String vlmId, Version version, String id) {
+ this.vendorLicenseModelId = vlmId;
+ this.version = version;
+ this.id = id;
+ }
+
+ @Override
+ public String getEntityType() {
+ return ENTITY_TYPE;
+ }
+
+ @Override
+ public String getFirstClassCitizenId() {
+ return getVendorLicenseModelId();
+ }
+
+ public String getVendorLicenseModelId() {
+ return vendorLicenseModelId;
+ }
+
+ public void setVendorLicenseModelId(String vendorLicenseModelId) {
+ this.vendorLicenseModelId = vendorLicenseModelId;
+ }
+
+ @Override
+ public String getId() {
+ return id;
+ }
+
+ @Override
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ @Override
+ public Version getVersion() {
+ return version;
+ }
+
+ @Override
+ public void setVersion(Version version) {
+ this.version = version;
+ }
+
+ public Set<String> getReferencingFeatureGroups() {
+ return referencingFeatureGroups;
+ }
+
+ public void setReferencingFeatureGroups(Set<String> referencingFeatureGroups) {
+ this.referencingFeatureGroups = referencingFeatureGroups;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public int getThresholdValue() {
+ return thresholdValue;
+ }
+
+ public void setThresholdValue(int thresholdValue) {
+ this.thresholdValue = thresholdValue;
+ }
+
+ public ThresholdUnit getThresholdUnit() {
+ return thresholdUnit;
+ }
+
+ public void setThresholdUnit(ThresholdUnit thresholdUnits) {
+ this.thresholdUnit = thresholdUnits;
+ }
+
+ public ChoiceOrOther<EntitlementMetric> getEntitlementMetric() {
+ return entitlementMetric;
+ }
+
+ public void setEntitlementMetric(ChoiceOrOther<EntitlementMetric> entitlementMetric) {
+ entitlementMetric.resolveEnum(EntitlementMetric.class);
+ this.entitlementMetric = entitlementMetric;
+ }
+
+ public String getIncrements() {
+ return increments;
+ }
+
+ public void setIncrements(String increments) {
+ this.increments = increments;
+ }
+
+ public ChoiceOrOther<AggregationFunction> getAggregationFunction() {
+ return aggregationFunction;
+ }
+
+ public void setAggregationFunction(ChoiceOrOther<AggregationFunction> aggregationFunction) {
+ aggregationFunction.resolveEnum(AggregationFunction.class);
+ this.aggregationFunction = aggregationFunction;
+ }
+
+ public MultiChoiceOrOther<OperationalScope> getOperationalScope() {
+ return operationalScope;
+ }
+
+ public void setOperationalScope(MultiChoiceOrOther<OperationalScope> operationalScope) {
+ operationalScope.resolveEnum(OperationalScope.class);
+ this.operationalScope = operationalScope;
+ }
+
+ public ChoiceOrOther<EntitlementTime> getTime() {
+ return time;
+ }
+
+ public void setTime(ChoiceOrOther<EntitlementTime> time) {
+ time.resolveEnum(EntitlementTime.class);
+ this.time = time;
+ }
+
+ public String getManufacturerReferenceNumber() {
+ return manufacturerReferenceNumber;
+ }
+
+ public void setManufacturerReferenceNumber(String manufacturerReferenceNumber) {
+ this.manufacturerReferenceNumber = manufacturerReferenceNumber;
+ }
+
+
+ /**
+ * Gets threshold for artifact.
+ *
+ * @return the threshold for artifact
+ */
+ //util methods for XML
+ public ThresholdForXml getThresholdForArtifact() {
+ ThresholdForXml threshold = new ThresholdForXml();
+ threshold.setUnit(getThresholdUnit() == null ? null : getThresholdUnit().name());
+ threshold.setValue(getThresholdValue());
+ return threshold;
+ }
+
+ /**
+ * Gets entitlement metric for artifact.
+ *
+ * @return the entitlement metric for artifact
+ */
+ public EntitlementMetricForXml getEntitlementMetricForArtifact() {
+ EntitlementMetricForXml metric = new EntitlementMetricForXml();
+ if (entitlementMetric != null) {
+ metric.setValue(entitlementMetric.getResult());
+ } else {
+ metric.setValue(null);
+ }
+ return metric;
+ }
+
+ /**
+ * Gets time for artifact.
+ *
+ * @return the time for artifact
+ */
+ public EntitlementTimeForXml getTimeForArtifact() {
+ EntitlementTimeForXml timeForXml = new EntitlementTimeForXml();
+ if (time != null) {
+ timeForXml.setValue(time.getResult());
+ }
+
+ return timeForXml;
+ }
+
+
+ @Override
+ public String toString() {
+ return "EntitlementPoolEntity{"
+ + "vendorLicenseModelId='" + vendorLicenseModelId + '\''
+ + ", version=" + version
+ + ", id='" + id + '\''
+ + ", name='" + name + '\''
+ + ", description='" + description + '\''
+ + ", thresholdValue=" + thresholdValue
+ + ", thresholdUnit='" + thresholdUnit + '\''
+ + ", entitlementMetric=" + entitlementMetric
+ + ", increments='" + increments + '\''
+ + ", aggregationFunction=" + aggregationFunction
+ + ", operationalScope=" + operationalScope
+ + ", time=" + time
+ + ", manufacturerReferenceNumber='" + manufacturerReferenceNumber + '\''
+ + ", referencingFeatureGroups=" + referencingFeatureGroups
+ + ", version_uuid=" + versionUuId
+ + '}';
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null || getClass() != obj.getClass()) {
+ return false;
+ }
+ EntitlementPoolEntity that = (EntitlementPoolEntity) obj;
+ return Float.compare(that.thresholdValue, thresholdValue) == 0
+ && Objects.equals(vendorLicenseModelId, that.vendorLicenseModelId)
+ && Objects.equals(version, that.version)
+ && Objects.equals(id, that.id)
+ && Objects.equals(name, that.name)
+ && Objects.equals(description, that.description)
+ && Objects.equals(thresholdUnit, that.thresholdUnit)
+ && Objects.equals(entitlementMetric, that.entitlementMetric)
+ && Objects.equals(increments, that.increments)
+ && Objects.equals(aggregationFunction, that.aggregationFunction)
+ && Objects.equals(operationalScope, that.operationalScope)
+ && Objects.equals(time, that.time)
+ && Objects.equals(manufacturerReferenceNumber, that.manufacturerReferenceNumber)
+ && Objects.equals(referencingFeatureGroups, that.referencingFeatureGroups);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects
+ .hash(vendorLicenseModelId, version, id, name, description, thresholdValue, thresholdUnit,
+ entitlementMetric, increments, aggregationFunction, operationalScope, time,
+ manufacturerReferenceNumber, referencingFeatureGroups);
+ }
+
+ /**
+ * Gets aggregation function for artifact.
+ *
+ * @return the aggregation function for artifact
+ */
+ public AggregationFunctionForXml getAggregationFunctionForArtifact() {
+ AggregationFunctionForXml aggregationFunctionForXml = new AggregationFunctionForXml();
+ if (entitlementMetric != null) {
+ aggregationFunctionForXml.setValue(aggregationFunction.getResult());
+ } else {
+ aggregationFunctionForXml.setValue(null);
+ }
+ return aggregationFunctionForXml;
+ }
+
+ /**
+ * Gets operational scope for artifact.
+ *
+ * @return the operational scope for artifact
+ */
+ public Set<String> getOperationalScopeForArtifact() {
+ if (operationalScope != null) {
+ return operationalScope.getResults();
+ } else {
+ return null;
+ }
+ }
+
+ public String getVersionUuId() {
+ return versionUuId;
+ }
+
+ public void setVersionUuId(String uuId) {
+ versionUuId = uuId;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementTime.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementTime.java
new file mode 100644
index 0000000000..5005075122
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementTime.java
@@ -0,0 +1,30 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao.types;
+
+public enum EntitlementTime { //TODO MetricTime ? ask Segev...
+ Hour,
+ Day,
+ Month,
+ Quarter,
+ Year,
+ Other
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/FeatureGroupEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/FeatureGroupEntity.java
new file mode 100644
index 0000000000..de5bd2e1c5
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/FeatureGroupEntity.java
@@ -0,0 +1,203 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao.types;
+
+import com.datastax.driver.mapping.annotations.ClusteringColumn;
+import com.datastax.driver.mapping.annotations.Column;
+import com.datastax.driver.mapping.annotations.Frozen;
+import com.datastax.driver.mapping.annotations.PartitionKey;
+import com.datastax.driver.mapping.annotations.Table;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.dao.types.VersionableEntity;
+
+
+import java.util.HashSet;
+import java.util.Objects;
+import java.util.Set;
+
+@Table(name = "feature_group", keyspace = "dox")
+public class FeatureGroupEntity implements VersionableEntity {
+ private static final String ENTITY_TYPE = "Feature Group";
+
+ @PartitionKey
+ @Column(name = "vlm_id")
+ private String vendorLicenseModelId;
+ @PartitionKey(value = 1)
+ @Frozen
+ private Version version;
+ @ClusteringColumn
+ @Column(name = "fg_id")
+ private String id;
+ private String name;
+ private String description;
+ @Column(name = "part_num")
+ private String partNumber;
+ @Column(name = "lkg_ids")
+ private Set<String> licenseKeyGroupIds = new HashSet<>();
+ @Column(name = "ep_ids")
+ private Set<String> entitlementPoolIds = new HashSet<>();
+ @Column(name = "ref_la_ids")
+ private Set<String> referencingLicenseAgreements = new HashSet<>();
+
+ public FeatureGroupEntity() {
+ }
+
+ /**
+ * Instantiates a new Feature group entity.
+ *
+ * @param vendorLicenseModelId the vendor license model id
+ * @param version the version
+ * @param id the id
+ */
+ public FeatureGroupEntity(String vendorLicenseModelId, Version version, String id) {
+ this.vendorLicenseModelId = vendorLicenseModelId;
+ this.version = version;
+ this.id = id;
+ }
+
+ @Override
+ public String getEntityType() {
+ return ENTITY_TYPE;
+ }
+
+ @Override
+ public String getFirstClassCitizenId() {
+ return getVendorLicenseModelId();
+ }
+
+ public String getVendorLicenseModelId() {
+ return vendorLicenseModelId;
+ }
+
+ public void setVendorLicenseModelId(String vendorLicenseModelId) {
+ this.vendorLicenseModelId = vendorLicenseModelId;
+ }
+
+ @Override
+ public Version getVersion() {
+ return version;
+ }
+
+ @Override
+ public void setVersion(Version version) {
+ this.version = version;
+ }
+
+ @Override
+ public String getId() {
+ return id;
+ }
+
+ @Override
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getPartNumber() {
+ return partNumber;
+ }
+
+ public void setPartNumber(String partNumber) {
+ this.partNumber = partNumber;
+ }
+
+ public Set<String> getLicenseKeyGroupIds() {
+ return licenseKeyGroupIds;
+ }
+
+ public void setLicenseKeyGroupIds(Set<String> licenseKeyGroupIds) {
+ this.licenseKeyGroupIds = licenseKeyGroupIds;
+ }
+
+ public Set<String> getEntitlementPoolIds() {
+ return entitlementPoolIds;
+ }
+
+ public void setEntitlementPoolIds(Set<String> entitlementPoolIds) {
+ this.entitlementPoolIds = entitlementPoolIds;
+ }
+
+ public Set<String> getReferencingLicenseAgreements() {
+ return referencingLicenseAgreements;
+ }
+
+ public void setReferencingLicenseAgreements(Set<String> referencingLicenseAgreements) {
+ this.referencingLicenseAgreements = referencingLicenseAgreements;
+ }
+
+ @Override
+ public String toString() {
+ return "FeatureGroupEntity{"
+ + "vendorLicenseModelId='" + vendorLicenseModelId + '\''
+ + ", version=" + version
+ + ", id='" + id + '\''
+ + ", name='" + name + '\''
+ + ", description='" + description + '\''
+ + ", partNumber='" + partNumber + '\''
+ + ", licenseKeyGroupIds=" + licenseKeyGroupIds
+ + ", entitlementPoolIds=" + entitlementPoolIds
+ + ", referencingLicenseAgreements=" + referencingLicenseAgreements
+ + '}';
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null || getClass() != obj.getClass()) {
+ return false;
+ }
+ FeatureGroupEntity that = (FeatureGroupEntity) obj;
+ return Objects.equals(vendorLicenseModelId, that.vendorLicenseModelId)
+ && Objects.equals(version, that.version)
+ && Objects.equals(id, that.id)
+ && Objects.equals(name, that.name)
+ && Objects.equals(description, that.description)
+ && Objects.equals(partNumber, that.partNumber)
+ && Objects.equals(licenseKeyGroupIds, that.licenseKeyGroupIds)
+ && Objects.equals(entitlementPoolIds, that.entitlementPoolIds)
+ && Objects.equals(referencingLicenseAgreements, that.referencingLicenseAgreements);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects
+ .hash(vendorLicenseModelId, version, id, name, description, partNumber, licenseKeyGroupIds,
+ entitlementPoolIds, referencingLicenseAgreements);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/FeatureGroupModel.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/FeatureGroupModel.java
new file mode 100644
index 0000000000..78e081760c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/FeatureGroupModel.java
@@ -0,0 +1,75 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao.types;
+
+import java.util.HashSet;
+import java.util.Set;
+
+public class FeatureGroupModel {
+ private FeatureGroupEntity featureGroup;
+ private Set<EntitlementPoolEntity> entitlementPools = new HashSet<>();
+
+ private Set<LicenseKeyGroupEntity> licenseKeyGroups = new HashSet<>();
+
+ public FeatureGroupEntity getFeatureGroup() {
+ return featureGroup;
+ }
+
+ public void setFeatureGroup(FeatureGroupEntity featureGroup) {
+ this.featureGroup = featureGroup;
+ }
+
+ public Set<EntitlementPoolEntity> getEntitlementPools() {
+ return entitlementPools;
+ }
+
+ public Set<LicenseKeyGroupEntity> getLicenseKeyGroups() {
+ return licenseKeyGroups;
+ }
+
+ public void setEntitlementPools(Set<EntitlementPoolEntity> entitlementPools) {
+ this.entitlementPools = entitlementPools;
+ }
+
+ public void setLicenseKeyGroups(Set<LicenseKeyGroupEntity> licenseKeyGroups) {
+ this.licenseKeyGroups = licenseKeyGroups;
+ }
+
+ //for XML Artifact
+ public String getEntityName() {
+ return featureGroup.getName();
+ }
+
+ public String getEntityDesc() {
+ return featureGroup.getDescription();
+ }
+
+ public String getEntityId() {
+ return featureGroup.getId();
+ }
+
+ public String getEntityPartNumber() {
+ return featureGroup.getPartNumber();
+ }
+
+
+}
+
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseAgreementEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseAgreementEntity.java
new file mode 100644
index 0000000000..a6e46bf44c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseAgreementEntity.java
@@ -0,0 +1,182 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao.types;
+
+import com.datastax.driver.mapping.annotations.ClusteringColumn;
+import com.datastax.driver.mapping.annotations.Column;
+import com.datastax.driver.mapping.annotations.Frozen;
+import com.datastax.driver.mapping.annotations.PartitionKey;
+import com.datastax.driver.mapping.annotations.Table;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.dao.types.VersionableEntity;
+
+import java.util.HashSet;
+import java.util.Objects;
+import java.util.Set;
+
+@Table(keyspace = "dox", name = "license_agreement")
+public class LicenseAgreementEntity implements VersionableEntity {
+ public static final String ENTITY_TYPE = "License Agreement";
+
+ @PartitionKey(value = 0)
+ @Column(name = "vlm_id")
+ private String vendorLicenseModelId;
+
+ @PartitionKey(value = 1)
+ @Frozen
+ private Version version;
+
+ @ClusteringColumn
+ @Column(name = "la_id")
+ private String id;
+ private String name;
+ private String description;
+
+ @Column(name = "lic_term")
+ @Frozen
+ private ChoiceOrOther<LicenseTerm> licenseTerm;
+
+ @Column(name = "req_const")
+ private String requirementsAndConstrains;
+
+ @Column(name = "fg_ids")
+ private Set<String> featureGroupIds = new HashSet<>();
+
+ public LicenseAgreementEntity() {
+ }
+
+ /**
+ * Instantiates a new License agreement entity.
+ *
+ * @param vlmId the vlm id
+ * @param version the version
+ * @param id the id
+ */
+ public LicenseAgreementEntity(String vlmId, Version version, String id) {
+ this.vendorLicenseModelId = vlmId;
+ this.id = id;
+ this.version = version;
+ }
+
+ @Override
+ public String getEntityType() {
+ return ENTITY_TYPE;
+ }
+
+ @Override
+ public String getFirstClassCitizenId() {
+ return getVendorLicenseModelId();
+ }
+
+ public String getVendorLicenseModelId() {
+ return vendorLicenseModelId;
+ }
+
+ public void setVendorLicenseModelId(String vendorLicenseModelId) {
+ this.vendorLicenseModelId = vendorLicenseModelId;
+ }
+
+ @Override
+ public Version getVersion() {
+ return version;
+ }
+
+ @Override
+ public void setVersion(Version version) {
+ this.version = version;
+ }
+
+ @Override
+ public String getId() {
+ return id;
+ }
+
+ @Override
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public ChoiceOrOther<LicenseTerm> getLicenseTerm() {
+ return licenseTerm;
+ }
+
+ public void setLicenseTerm(ChoiceOrOther<LicenseTerm> licenseTerm) {
+ licenseTerm.resolveEnum(LicenseTerm.class);
+ this.licenseTerm = licenseTerm;
+ }
+
+ public String getRequirementsAndConstrains() {
+ return requirementsAndConstrains;
+ }
+
+ public void setRequirementsAndConstrains(String requirementsAndConstrains) {
+ this.requirementsAndConstrains = requirementsAndConstrains;
+ }
+
+ public Set<String> getFeatureGroupIds() {
+ return featureGroupIds;
+ }
+
+ public void setFeatureGroupIds(Set<String> featureGroupIds) {
+ this.featureGroupIds = featureGroupIds;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null || getClass() != obj.getClass()) {
+ return false;
+ }
+ LicenseAgreementEntity that = (LicenseAgreementEntity) obj;
+ return Objects.equals(vendorLicenseModelId, that.vendorLicenseModelId)
+ && Objects.equals(version, that.version)
+ && Objects.equals(id, that.id)
+ && Objects.equals(name, that.name)
+ && Objects.equals(description, that.description)
+ && Objects.equals(licenseTerm, that.licenseTerm)
+ && Objects.equals(requirementsAndConstrains, that.requirementsAndConstrains)
+ && Objects.equals(featureGroupIds, that.featureGroupIds);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(vendorLicenseModelId, version, id, name, description, licenseTerm,
+ requirementsAndConstrains, featureGroupIds);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseAgreementModel.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseAgreementModel.java
new file mode 100644
index 0000000000..1e65f70cc0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseAgreementModel.java
@@ -0,0 +1,45 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao.types;
+
+import java.util.HashSet;
+import java.util.Set;
+
+public class LicenseAgreementModel {
+ private LicenseAgreementEntity licenseAgreement;
+ private Set<FeatureGroupEntity> featureGroups = new HashSet<>();
+
+ public LicenseAgreementEntity getLicenseAgreement() {
+ return licenseAgreement;
+ }
+
+ public void setLicenseAgreement(LicenseAgreementEntity licenseAgreement) {
+ this.licenseAgreement = licenseAgreement;
+ }
+
+ public Set<FeatureGroupEntity> getFeatureGroups() {
+ return featureGroups;
+ }
+
+ public void setFeatureGroups(Set<FeatureGroupEntity> featureGroups) {
+ this.featureGroups = featureGroups;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseKeyGroupEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseKeyGroupEntity.java
new file mode 100644
index 0000000000..2a7e936cb3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseKeyGroupEntity.java
@@ -0,0 +1,231 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao.types;
+
+import com.datastax.driver.mapping.annotations.ClusteringColumn;
+import com.datastax.driver.mapping.annotations.Column;
+import com.datastax.driver.mapping.annotations.Enumerated;
+import com.datastax.driver.mapping.annotations.Frozen;
+import com.datastax.driver.mapping.annotations.PartitionKey;
+import com.datastax.driver.mapping.annotations.Table;
+import org.openecomp.sdc.vendorlicense.dao.types.xml.LicenseKeyTypeForXml;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.dao.types.VersionableEntity;
+
+
+import java.util.HashSet;
+import java.util.Objects;
+import java.util.Set;
+
+@Table(keyspace = "dox", name = "license_key_group")
+public class LicenseKeyGroupEntity implements VersionableEntity {
+ private static final String ENTITY_TYPE = "License Key Group";
+
+ @PartitionKey
+ @Column(name = "vlm_id")
+ private String vendorLicenseModelId;
+ @PartitionKey(value = 1)
+ @Frozen
+ private Version version;
+ @ClusteringColumn
+ @Column(name = "lkg_id")
+ private String id;
+ private String name;
+ private String description;
+ @Enumerated
+ private LicenseKeyType type;
+ @Column(name = "operational_scope")
+ @Frozen
+ private MultiChoiceOrOther<OperationalScope> operationalScope;
+ @Column(name = "ref_fg_ids")
+ private Set<String> referencingFeatureGroups = new HashSet<>();
+ @Column(name = "version_uuid")
+ private String versionUuId;
+
+
+ public LicenseKeyGroupEntity() {
+ }
+
+ /**
+ * Instantiates a new License key group entity.
+ *
+ * @param vendorLicenseModelId the vendor license model id
+ * @param version the version
+ * @param id the id
+ */
+ public LicenseKeyGroupEntity(String vendorLicenseModelId, Version version, String id) {
+ this.vendorLicenseModelId = vendorLicenseModelId;
+ this.version = version;
+ this.id = id;
+ }
+
+ @Override
+ public String getEntityType() {
+ return ENTITY_TYPE;
+ }
+
+ @Override
+ public String getFirstClassCitizenId() {
+ return getVendorLicenseModelId();
+ }
+
+ public String getVendorLicenseModelId() {
+ return vendorLicenseModelId;
+ }
+
+ public void setVendorLicenseModelId(String vendorLicenseModelId) {
+ this.vendorLicenseModelId = vendorLicenseModelId;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public Version getVersion() {
+ return version;
+ }
+
+ public void setVersion(Version version) {
+ this.version = version;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public LicenseKeyType getType() {
+ return type;
+ }
+
+ public void setType(LicenseKeyType type) {
+ this.type = type;
+ }
+
+ public MultiChoiceOrOther<OperationalScope> getOperationalScope() {
+ return operationalScope;
+ }
+
+ public void setOperationalScope(MultiChoiceOrOther<OperationalScope> operationalScope) {
+ operationalScope.resolveEnum(OperationalScope.class);
+ this.operationalScope = operationalScope;
+ }
+
+ public Set<String> getReferencingFeatureGroups() {
+ return referencingFeatureGroups;
+ }
+
+ public void setReferencingFeatureGroups(Set<String> referencingFeatureGroups) {
+ this.referencingFeatureGroups = referencingFeatureGroups;
+ }
+
+ @Override
+ public String toString() {
+ return "LicenseKeyGroupEntity{" + "vendorLicenseModelId='" + vendorLicenseModelId + '\''
+ + ", version=" + version
+ + ", id='" + id + '\''
+ + ", name='" + name + '\''
+ + ", description='" + description + '\''
+ + ", type=" + type
+ + ", operationalScope=" + operationalScope
+ + ", referencingFeatureGroups=" + referencingFeatureGroups
+ + ", versionUuId='" + versionUuId + '\''
+ + '}';
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null || getClass() != obj.getClass()) {
+ return false;
+ }
+ LicenseKeyGroupEntity that = (LicenseKeyGroupEntity) obj;
+ return Objects.equals(vendorLicenseModelId, that.vendorLicenseModelId)
+ && Objects.equals(version, that.version)
+ && Objects.equals(id, that.id)
+ && Objects.equals(name, that.name)
+ && Objects.equals(description, that.description)
+ && type == that.type
+ && Objects.equals(operationalScope, that.operationalScope)
+ && Objects.equals(referencingFeatureGroups, that.referencingFeatureGroups);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects
+ .hash(vendorLicenseModelId, version, id, name, description, type, operationalScope,
+ referencingFeatureGroups);
+ }
+
+ /**
+ * Gets operational scope for artifact.
+ *
+ * @return the operational scope for artifact
+ */
+ public Set<String> getOperationalScopeForArtifact() {
+ if (operationalScope != null) {
+ return operationalScope.getResults();
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Gets type for artifact.
+ *
+ * @return the type for artifact
+ */
+ public LicenseKeyTypeForXml getTypeForArtifact() {
+ LicenseKeyTypeForXml typeXml = new LicenseKeyTypeForXml();
+ if (type != null) {
+ typeXml.setValue(type.toString());
+ } else {
+ typeXml.setValue(null);
+ }
+ return typeXml;
+ }
+
+
+ public String getVersionUuId() {
+ return versionUuId;
+ }
+
+ public void setVersionUuId(String uuId) {
+ versionUuId = uuId;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseKeyType.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseKeyType.java
new file mode 100644
index 0000000000..3ba913de31
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseKeyType.java
@@ -0,0 +1,27 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao.types;
+
+public enum LicenseKeyType {
+ Universal,
+ Unique,
+ One_Time
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseTerm.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseTerm.java
new file mode 100644
index 0000000000..729a985473
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseTerm.java
@@ -0,0 +1,28 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao.types;
+
+public enum LicenseTerm {
+ Fixed_Term,
+ Perpetual,
+ Unlimited,
+ Other
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/MultiChoiceOrOther.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/MultiChoiceOrOther.java
new file mode 100644
index 0000000000..df9d6887ce
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/MultiChoiceOrOther.java
@@ -0,0 +1,172 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao.types;
+
+import com.datastax.driver.mapping.annotations.Transient;
+import com.datastax.driver.mapping.annotations.UDT;
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+
+import java.util.HashSet;
+import java.util.Set;
+
+@UDT(keyspace = "dox", name = "multi_choice_or_other")
+public class MultiChoiceOrOther<E extends Enum<E>> {
+ public static final String MULTI_CHOICE_OR_OTHER_INVALID_ENUM_ERR_ID =
+ "MULTI_CHOICE_OR_OTHER_INVALID_ENUM_ERR_ID";
+ public static final String MULTI_CHOICE_OR_OTHER_INVALID_ENUM_MSG =
+ "Enum used as part of MultiChoiceOrOther type must contain the value 'Other'";
+ public static final String OTHER_ENUM_VALUE = "Other";
+
+ @Transient
+ private Set<E> choices;
+ @Transient
+ private String other;
+
+
+ private Set<String> results;
+
+ public MultiChoiceOrOther() {
+ }
+
+ /**
+ * Instantiates a new Multi choice or other.
+ *
+ * @param choices the choices
+ * @param other the other
+ */
+ public MultiChoiceOrOther(Set<E> choices, String other) {
+ this.choices = choices;
+ this.other = other;
+ results = resolveResult();
+ }
+
+ public Set<E> getChoices() {
+ return choices;
+ }
+
+ public void setChoices(Set<E> choices) {
+ this.choices = choices;
+ }
+
+ public String getOther() {
+ return other;
+ }
+
+ public void setOther(String other) {
+ this.other = other;
+ }
+
+ public Set<String> getResults() {
+ return results;
+ }
+
+ /**
+ * Sets results.
+ *
+ * @param results the results
+ */
+ public void setResults(Set<String> results) {
+ if (choices != null) {
+ if (results == null) {
+ this.results = resolveResult();
+ }
+ } else {
+ this.results = results;
+ }
+ }
+
+ private Set<String> resolveResult() {
+ results = new HashSet<>();
+ if (choices.size() == 1 && OTHER_ENUM_VALUE.equals(choices.iterator().next().name())) {
+ results.add(other);
+ } else {
+ for (E choice : choices) {
+ results.add(choice.name());
+ }
+ }
+
+ return results;
+ }
+
+ /**
+ * Resolve enum.
+ *
+ * @param enumClass the enum class
+ */
+ public void resolveEnum(Class<E> enumClass) {
+ if (choices != null || results == null || results.size() == 0) {
+ return;
+ }
+
+ choices = new HashSet<>();
+ if (results.size() > 1) {
+ for (String result : results) {
+ choices.add(E.valueOf(enumClass, result));
+ }
+ } else {
+ String result = results.iterator().next();
+ try {
+ choices.add(E.valueOf(enumClass, result));
+ } catch (IllegalArgumentException illegalArgumentException) {
+ try {
+ choices.add(E.valueOf(enumClass, OTHER_ENUM_VALUE));
+ } catch (IllegalArgumentException ex) {
+ throw new CoreException(new ErrorCode.ErrorCodeBuilder()
+ .withId(MULTI_CHOICE_OR_OTHER_INVALID_ENUM_ERR_ID)
+ .withMessage(MULTI_CHOICE_OR_OTHER_INVALID_ENUM_MSG)
+ .withCategory(ErrorCategory.APPLICATION).build());
+ }
+ other = result;
+ }
+ }
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null || getClass() != obj.getClass()) {
+ return false;
+ }
+
+ MultiChoiceOrOther<?> that = (MultiChoiceOrOther<?>) obj;
+
+ if (choices != null ? !choices.equals(that.choices) : that.choices != null) {
+ return false;
+ }
+ if (other != null ? !other.equals(that.other) : that.other != null) {
+ return false;
+ }
+ return results != null ? results.equals(that.results) : that.results == null;
+
+ }
+
+ @Override
+ public int hashCode() {
+ int result = choices != null ? choices.hashCode() : 0;
+ result = 31 * result + (other != null ? other.hashCode() : 0);
+ result = 31 * result + (results != null ? results.hashCode() : 0);
+ return result;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/OperationalScope.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/OperationalScope.java
new file mode 100644
index 0000000000..ed9497d30b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/OperationalScope.java
@@ -0,0 +1,32 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao.types;
+
+public enum OperationalScope {
+ Network_Wide,
+ Availability_Zone,
+ Data_Center,
+ Tenant,
+ VM,
+ CPU,
+ Core,
+ Other
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/ThresholdUnit.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/ThresholdUnit.java
new file mode 100644
index 0000000000..bd0fa41073
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/ThresholdUnit.java
@@ -0,0 +1,26 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao.types;
+
+public enum ThresholdUnit {
+ Absolute,
+ Percentage
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/VendorLicenseModelEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/VendorLicenseModelEntity.java
new file mode 100644
index 0000000000..ea93b1ab4f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/VendorLicenseModelEntity.java
@@ -0,0 +1,153 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao.types;
+
+import com.datastax.driver.mapping.annotations.Column;
+import com.datastax.driver.mapping.annotations.Computed;
+import com.datastax.driver.mapping.annotations.Frozen;
+import com.datastax.driver.mapping.annotations.PartitionKey;
+import com.datastax.driver.mapping.annotations.Table;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.dao.types.VersionableEntity;
+
+import java.util.Objects;
+
+@Table(keyspace = "dox", name = "vendor_license_model")
+public class VendorLicenseModelEntity implements VersionableEntity {
+ public static final String ENTITY_TYPE = "Vendor License Model";
+
+ @PartitionKey
+ @Column(name = "vlm_id")
+ private String id;
+
+ @PartitionKey(value = 1)
+ @Frozen
+ private Version version;
+
+ // @Column(name = "last_modification_time")
+ // private Date lastModificationTime;
+
+ @Column(name = "vendor_name")
+ private String vendorName;
+ private String description;
+ @Column(name = "icon")
+ private String iconRef;
+
+ @Computed("writetime(vendor_name)")
+ private Long writetimeMicroSeconds;
+
+ public VendorLicenseModelEntity() {
+ }
+
+ public VendorLicenseModelEntity(String id, Version version) {
+ this.id = id;
+ this.version = version;
+ }
+
+ @Override
+ public String getEntityType() {
+ return ENTITY_TYPE;
+ }
+
+ @Override
+ public String getFirstClassCitizenId() {
+ return getId();
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ @Override
+ public Version getVersion() {
+ return version;
+ }
+
+ @Override
+ public void setVersion(Version version) {
+ this.version = version;
+ }
+
+ public String getVendorName() {
+ return vendorName;
+ }
+
+ public void setVendorName(String vendorName) {
+ this.vendorName = vendorName;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getIconRef() {
+ return iconRef;
+ }
+
+ public void setIconRef(String iconRef) {
+ this.iconRef = iconRef;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null || getClass() != obj.getClass()) {
+ return false;
+ }
+ VendorLicenseModelEntity that = (VendorLicenseModelEntity) obj;
+ return Objects.equals(id, that.id)
+ && Objects.equals(version, that.version)
+ && Objects.equals(vendorName, that.vendorName)
+ && Objects.equals(description, that.description)
+ && Objects.equals(iconRef, that.iconRef);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(id, version, vendorName, description, iconRef);
+ }
+
+ // public Date getLastModificationTime() {
+ // return lastModificationTime;
+ // }
+ //
+ // public void setLastModificationTime(Date lastModificationTime) {
+ // this.lastModificationTime = lastModificationTime;
+ // }
+
+ public Long getWritetimeMicroSeconds() {
+ return writetimeMicroSeconds;
+ }
+
+ public void setWritetimeMicroSeconds(Long writetimeMicroSeconds) {
+ this.writetimeMicroSeconds = writetimeMicroSeconds;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/xml/AggregationFunctionForXml.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/xml/AggregationFunctionForXml.java
new file mode 100644
index 0000000000..e2a6be6b9e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/xml/AggregationFunctionForXml.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao.types.xml;
+
+public class AggregationFunctionForXml {
+ private String value;
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/xml/EntitlementMetricForXml.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/xml/EntitlementMetricForXml.java
new file mode 100644
index 0000000000..8a449446ec
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/xml/EntitlementMetricForXml.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao.types.xml;
+
+public class EntitlementMetricForXml {
+ private String value;
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/xml/EntitlementTimeForXml.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/xml/EntitlementTimeForXml.java
new file mode 100644
index 0000000000..c78a2d6d91
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/xml/EntitlementTimeForXml.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao.types.xml;
+
+public class EntitlementTimeForXml {
+ private String value;
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/xml/LicenseKeyTypeForXml.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/xml/LicenseKeyTypeForXml.java
new file mode 100644
index 0000000000..c8c0d3067e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/xml/LicenseKeyTypeForXml.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao.types.xml;
+
+public class LicenseKeyTypeForXml {
+ private String value;
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/xml/ThresholdForXml.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/xml/ThresholdForXml.java
new file mode 100644
index 0000000000..11627160ad
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/xml/ThresholdForXml.java
@@ -0,0 +1,42 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao.types.xml;
+
+public class ThresholdForXml {
+ String unit;
+ int value;
+
+ public String getUnit() {
+ return unit;
+ }
+
+ public void setUnit(String unit) {
+ this.unit = unit;
+ }
+
+ public int getValue() {
+ return value;
+ }
+
+ public void setValue(int value) {
+ this.value = value;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/JsonErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/JsonErrorBuilder.java
new file mode 100644
index 0000000000..a11092bbe3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/JsonErrorBuilder.java
@@ -0,0 +1,51 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.errors;
+
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+
+public class JsonErrorBuilder {
+
+ private static final String JSON_ERROR_OCCURED_DURING_ARTIFACT_GENERATION_ERR_ID =
+ "JSON_ERROR_OCCURED_DURING_ARTIFACT_GENERATION_ERR_ID";
+ private static final String JSON_ERROR_OCCURED_DURING_ARTIFACT_GENERATION_ERR_ID_MSG =
+ "Json error occured during artifact generation:%s.";
+
+ private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
+
+ /**
+ * Instantiates a new Json error builder.
+ *
+ * @param exceptionMessage the exception message
+ */
+ public JsonErrorBuilder(String exceptionMessage) {
+ builder.withId(JSON_ERROR_OCCURED_DURING_ARTIFACT_GENERATION_ERR_ID);
+ builder.withCategory(ErrorCategory.APPLICATION);
+ builder.withMessage(
+ String.format(JSON_ERROR_OCCURED_DURING_ARTIFACT_GENERATION_ERR_ID_MSG, exceptionMessage));
+ }
+
+ public ErrorCode build() {
+ return builder.build();
+ }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/LicensingDataInvalidErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/LicensingDataInvalidErrorBuilder.java
new file mode 100644
index 0000000000..dfc9a93751
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/LicensingDataInvalidErrorBuilder.java
@@ -0,0 +1,49 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.errors;
+
+import org.openecomp.core.utilities.CommonMethods;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+
+import java.util.List;
+
+public class LicensingDataInvalidErrorBuilder {
+ private static final String LICENSING_DATA_INVALID_MSG = "Invalid licensing data: %s";
+ private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
+
+ /**
+ * Instantiates a new Licensing data invalid error builder.
+ *
+ * @param licensingDataErrors the licensing data errors
+ */
+ public LicensingDataInvalidErrorBuilder(List<String> licensingDataErrors) {
+ builder.withId(VendorLicenseErrorCodes.LICENSING_DATA_INVALID);
+ builder.withCategory(ErrorCategory.APPLICATION);
+ builder.withMessage(String.format(LICENSING_DATA_INVALID_MSG,
+ CommonMethods.listToSeparatedString(licensingDataErrors, ',')));
+ }
+
+ public ErrorCode build() {
+ return builder.build();
+ }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/SubmitUncompletedLicenseModelErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/SubmitUncompletedLicenseModelErrorBuilder.java
new file mode 100644
index 0000000000..0a00cff8ea
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/SubmitUncompletedLicenseModelErrorBuilder.java
@@ -0,0 +1,50 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.errors;
+
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+
+public class SubmitUncompletedLicenseModelErrorBuilder {
+
+ private static final String SUBMIT_UNCOMPLETED_LICENSE_MODEL_MSG =
+ "Uncompleted vendor license model %s cannot be submitted. "
+ + "It must contain license_agreement(s) that all feature groups "
+ + "contain at least one entitlement pool.";
+ private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
+
+ /**
+ * Instantiates a new Submit uncompleted license model error builder.
+ *
+ * @param vlmId the vlm id
+ */
+ public SubmitUncompletedLicenseModelErrorBuilder(String vlmId) {
+ builder.withId(VendorLicenseErrorCodes.SUBMIT_UNCOMPLETED_LICENSE_MODEL);
+ builder.withCategory(ErrorCategory.APPLICATION);
+ builder.withMessage(String.format(SUBMIT_UNCOMPLETED_LICENSE_MODEL_MSG, vlmId));
+ }
+
+ public ErrorCode build() {
+ return builder.build();
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/VendorLicenseErrorCodes.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/VendorLicenseErrorCodes.java
new file mode 100644
index 0000000000..4cd7a5bc1b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/VendorLicenseErrorCodes.java
@@ -0,0 +1,28 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.errors;
+
+public class VendorLicenseErrorCodes {
+
+ public static final String VENDOR_LICENSE_MODEL_NOT_FOUND = "VENDOR_LICENSE_MODEL_NOT_FOUND";
+ public static final String SUBMIT_UNCOMPLETED_LICENSE_MODEL = "SUBMIT_UNCOMPLETED_LICENSE_MODEL";
+ public static final String LICENSING_DATA_INVALID = "LICENSING_DATA_INVALID";
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/VendorLicenseModelNotFoundErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/VendorLicenseModelNotFoundErrorBuilder.java
new file mode 100644
index 0000000000..d2dc1d6f00
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/VendorLicenseModelNotFoundErrorBuilder.java
@@ -0,0 +1,48 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.errors;
+
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+
+public class VendorLicenseModelNotFoundErrorBuilder {
+
+ private static final String VENDOR_LICENSE_MODEL_NOT_FOUND_MSG =
+ "Vendor license model with id %s not found.";
+ private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
+
+ /**
+ * Instantiates a new Vendor license model not found error builder.
+ *
+ * @param vendorLicenseModelId the vendor license model id
+ */
+ public VendorLicenseModelNotFoundErrorBuilder(String vendorLicenseModelId) {
+ builder.withId(VendorLicenseErrorCodes.VENDOR_LICENSE_MODEL_NOT_FOUND);
+ builder.withCategory(ErrorCategory.APPLICATION);
+ builder.withMessage(String.format(VENDOR_LICENSE_MODEL_NOT_FOUND_MSG, vendorLicenseModelId));
+ }
+
+ public ErrorCode build() {
+ return builder.build();
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/facade/VendorLicenseFacade.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/facade/VendorLicenseFacade.java
new file mode 100644
index 0000000000..e36852d25f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/facade/VendorLicenseFacade.java
@@ -0,0 +1,89 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.facade;
+
+import org.openecomp.sdc.common.errors.ErrorCode;
+import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupModel;
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementModel;
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity;
+import org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.types.VersionInfo;
+import org.openecomp.sdc.versioning.types.VersionableEntityAction;
+
+import java.util.Collection;
+
+public interface VendorLicenseFacade {
+
+ void checkin(String vendorLicenseModelId, String user);
+
+ void submit(String vendorLicenseModelId, String user);
+
+ FeatureGroupEntity getFeatureGroup(FeatureGroupEntity featureGroup, String user);
+
+ FeatureGroupModel getFeatureGroupModel(FeatureGroupEntity featureGroup, String user);
+
+ LicenseAgreementEntity getLicenseAgreement(String vlmId, Version version,
+ String licenseAgreementId, String user);
+
+ LicenseAgreementModel getLicenseAgreementModel(String vlmId, Version version,
+ String licenseAgreementId, String user);
+
+ EntitlementPoolEntity createEntitlementPool(EntitlementPoolEntity entitlementPool, String user);
+
+ LicenseKeyGroupEntity createLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup, String user);
+
+ void updateEntitlementPool(EntitlementPoolEntity entitlementPool, String user);
+
+ Collection<LicenseKeyGroupEntity> listLicenseKeyGroups(String vlmId, Version version,
+ String user);
+
+ Collection<EntitlementPoolEntity> listEntitlementPools(String vlmId, Version version,
+ String user);
+
+ void updateLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup, String user);
+
+
+ VersionedVendorLicenseModel getVendorLicenseModel(String vlmId, Version version, String user);
+
+ VendorLicenseModelEntity createVendorLicenseModel(
+ VendorLicenseModelEntity vendorLicenseModelEntity, String user);
+
+
+ LicenseAgreementEntity createLicenseAgreement(LicenseAgreementEntity licenseAgreement,
+ String user);
+
+ FeatureGroupEntity createFeatureGroup(FeatureGroupEntity featureGroup, String user);
+
+
+ Collection<ErrorCode> validateLicensingData(String vlmId, Version vlmVersion,
+ String licenseAgreementId,
+ Collection<String> featureGroupIds);
+
+ VersionInfo getVersionInfo(String vendorLicenseModelId, VersionableEntityAction action,
+ String user);
+
+ void updateVlmLastModificationTime(String vendorLicenseModelId, Version version);
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/facade/VendorLicenseFacadeFactory.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/facade/VendorLicenseFacadeFactory.java
new file mode 100644
index 0000000000..540cc5ba66
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/facade/VendorLicenseFacadeFactory.java
@@ -0,0 +1,32 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.facade;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+public abstract class VendorLicenseFacadeFactory
+ extends AbstractComponentFactory<VendorLicenseFacade> {
+
+ public static VendorLicenseFacadeFactory getInstance() {
+ return AbstractFactory.getInstance(VendorLicenseFacadeFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/healing/HealingService.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/healing/HealingService.java
new file mode 100644
index 0000000000..027cb1e5be
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/healing/HealingService.java
@@ -0,0 +1,31 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.healing;
+
+import org.openecomp.sdc.versioning.dao.types.VersionableEntity;
+
+public interface HealingService {
+
+ // VersionableEntity heal(VersionableEntity toHeal, String user);
+ VersionableEntity heal(VersionableEntity toHeal, String user);
+}
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/VendorLicenseArtifactsService.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/VendorLicenseArtifactsService.java
new file mode 100644
index 0000000000..c0610a99cd
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/VendorLicenseArtifactsService.java
@@ -0,0 +1,32 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.licenseartifacts;
+
+import org.openecomp.core.utilities.file.FileContentHandler;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.util.List;
+
+public interface VendorLicenseArtifactsService {
+
+ FileContentHandler createLicenseArtifacts(String vspId, String vlmId, Version vlmVersion,
+ List<String> featureGroups, String user);
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/types/VersionedVendorLicenseModel.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/types/VersionedVendorLicenseModel.java
new file mode 100644
index 0000000000..deb321f14e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/types/VersionedVendorLicenseModel.java
@@ -0,0 +1,54 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.types;
+
+import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity;
+import org.openecomp.sdc.versioning.types.VersionInfo;
+
+public class VersionedVendorLicenseModel {
+ private VendorLicenseModelEntity vendorLicenseModel;
+ private VersionInfo versionInfo;
+
+ public VersionedVendorLicenseModel() {
+ }
+
+ public VersionedVendorLicenseModel(VendorLicenseModelEntity vendorLicenseModel,
+ VersionInfo versionInfo) {
+ this.vendorLicenseModel = vendorLicenseModel;
+ this.versionInfo = versionInfo;
+ }
+
+ public VendorLicenseModelEntity getVendorLicenseModel() {
+ return vendorLicenseModel;
+ }
+
+ public void setVendorLicenseModel(VendorLicenseModelEntity vendorLicenseModel) {
+ this.vendorLicenseModel = vendorLicenseModel;
+ }
+
+ public VersionInfo getVersionInfo() {
+ return versionInfo;
+ }
+
+ public void setVersionInfo(VersionInfo versionInfo) {
+ this.versionInfo = versionInfo;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/resources/factoryConfiguration.json b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/resources/factoryConfiguration.json
new file mode 100644
index 0000000000..7f59b42103
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/resources/factoryConfiguration.json
@@ -0,0 +1,11 @@
+{
+ "org.openecomp.sdc.vendorlicense.VendorLicenseArtifactServiceFactory": "org.openecomp.sdc.vendorlicense.VendorLicenseArtifactServiceFactoryImpl",
+ "org.openecomp.sdc.vendorlicense.HealingServiceFactory": "org.openecomp.sdc.vendorlicense.SimpleHealingServiceServiceFactoryImpl",
+ "org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacadeFactory": "org.openecomp.sdc.vendorlicense.facade.impl.VendorLicenseFacadeFactoryImpl",
+ "org.openecomp.sdc.vendorlicense.dao.VendorLicenseModelDaoFactory": "org.openecomp.sdc.vendorlicense.dao.impl.VendorLicenseModelDaoFactoryImpl",
+ "org.openecomp.sdc.vendorlicense.dao.LicenseAgreementDaoFactory": "org.openecomp.sdc.vendorlicense.dao.impl.LicenseAgreementDaoFactoryImpl",
+ "org.openecomp.sdc.vendorlicense.dao.FeatureGroupDaoFactory": "org.openecomp.sdc.vendorlicense.dao.impl.FeatureGroupDaoFactoryImpl",
+ "org.openecomp.sdc.vendorlicense.dao.LicenseKeyGroupDaoFactory": "org.openecomp.sdc.vendorlicense.dao.impl.LicenseKeyGroupDaoFactoryImpl",
+ "org.openecomp.sdc.vendorlicense.dao.EntitlementPoolDaoFactory": "org.openecomp.sdc.vendorlicense.dao.impl.EntitlementPoolDaoFactoryImpl"
+
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/pom.xml b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/pom.xml
new file mode 100644
index 0000000000..7b66b2a505
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/pom.xml
@@ -0,0 +1,48 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <name>openecomp-sdc-vendor-license-core</name>
+ <artifactId>openecomp-sdc-vendor-license-core</artifactId>
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-lib</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../..</relativePath>
+ </parent>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-vendor-license-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <scope>test</scope>
+ <version>1.10.19</version>
+ </dependency>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <scope>test</scope>
+ <version>6.8.5</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>snakeyaml</artifactId>
+ <groupId>org.yaml</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ <version>RELEASE</version>
+ </dependency>
+ </dependencies>
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/SimpleHealingServiceServiceFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/SimpleHealingServiceServiceFactoryImpl.java
new file mode 100644
index 0000000000..79973bb888
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/SimpleHealingServiceServiceFactoryImpl.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense;
+
+import org.openecomp.sdc.vendorlicense.healing.HealingService;
+import org.openecomp.sdc.vendorlicense.healing.impl.SimpleHealingServiceImpl;
+
+public class SimpleHealingServiceServiceFactoryImpl extends HealingServiceFactory {
+ private static HealingService INSTANCE = new SimpleHealingServiceImpl();
+
+ @Override
+ public HealingService createInterface() {
+ return INSTANCE;
+ }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/VendorLicenseArtifactServiceFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/VendorLicenseArtifactServiceFactoryImpl.java
new file mode 100644
index 0000000000..582b0e2094
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/VendorLicenseArtifactServiceFactoryImpl.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense;
+
+import org.openecomp.sdc.vendorlicense.licenseartifacts.VendorLicenseArtifactsService;
+import org.openecomp.sdc.vendorlicense.licenseartifacts.impl.VendorLicenseArtifactsServiceImpl;
+
+public class VendorLicenseArtifactServiceFactoryImpl extends VendorLicenseArtifactServiceFactory {
+ private static VendorLicenseArtifactsService INSTANCE = new VendorLicenseArtifactsServiceImpl();
+
+ @Override
+ public VendorLicenseArtifactsService createInterface() {
+ return INSTANCE;
+ }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/EntitlementPoolCassandraDaoImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/EntitlementPoolCassandraDaoImpl.java
new file mode 100644
index 0000000000..1722f8f8de
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/EntitlementPoolCassandraDaoImpl.java
@@ -0,0 +1,148 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao.impl;
+
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.UDTValue;
+import com.datastax.driver.mapping.Mapper;
+import com.datastax.driver.mapping.Result;
+import com.datastax.driver.mapping.UDTMapper;
+import com.datastax.driver.mapping.annotations.Accessor;
+import com.datastax.driver.mapping.annotations.Query;
+import org.openecomp.core.dao.impl.CassandraBaseDao;
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
+import org.openecomp.core.utilities.CommonMethods;
+import org.openecomp.sdc.vendorlicense.VendorLicenseConstants;
+import org.openecomp.sdc.vendorlicense.dao.EntitlementPoolDao;
+import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity;
+import org.openecomp.sdc.versioning.VersioningManagerFactory;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.types.UniqueValueMetadata;
+import org.openecomp.sdc.versioning.types.VersionableEntityMetadata;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Set;
+
+public class EntitlementPoolCassandraDaoImpl extends CassandraBaseDao<EntitlementPoolEntity>
+ implements EntitlementPoolDao {
+
+ private static NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
+ private static Mapper<EntitlementPoolEntity> mapper =
+ noSqlDb.getMappingManager().mapper(EntitlementPoolEntity.class);
+ private static EntitlementPoolAccessor accessor =
+ noSqlDb.getMappingManager().createAccessor(EntitlementPoolAccessor.class);
+ private static UDTMapper<Version> versionMapper =
+ noSqlDb.getMappingManager().udtMapper(Version.class);
+
+ @Override
+ public void registerVersioning(String versionableEntityType) {
+ VersionableEntityMetadata metadata = new VersionableEntityMetadata(
+ mapper.getTableMetadata().getName(),
+ mapper.getTableMetadata().getPartitionKey().get(0).getName(),
+ mapper.getTableMetadata().getPartitionKey().get(1).getName());
+
+ metadata.setUniqueValuesMetadata(Collections.singletonList(
+ new UniqueValueMetadata(VendorLicenseConstants.UniqueValues.ENTITLEMENT_POOL_NAME,
+ Arrays.asList(mapper.getTableMetadata().getPartitionKey().get(0).getName(),
+ mapper.getTableMetadata().getPartitionKey().get(1).getName(), "name"))));
+
+ VersioningManagerFactory.getInstance().createInterface()
+ .register(versionableEntityType, metadata);
+ }
+
+ @Override
+ protected Mapper<EntitlementPoolEntity> getMapper() {
+ return mapper;
+ }
+
+ @Override
+ protected Object[] getKeys(EntitlementPoolEntity entity) {
+ return new Object[]{entity.getVendorLicenseModelId(), versionMapper.toUDT(entity.getVersion()),
+ entity.getId()};
+ }
+
+ @Override
+ public Collection<EntitlementPoolEntity> list(EntitlementPoolEntity entity) {
+ return accessor.listByVlmVersion(entity.getVendorLicenseModelId(),
+ versionMapper.toUDT(entity.getVersion())).all();
+ }
+
+ @Override
+ public long count(EntitlementPoolEntity entity) {
+ return accessor.countByVlmVersion(entity.getVendorLicenseModelId(),
+ versionMapper.toUDT(entity.getVersion())).one().getLong("count");
+ }
+
+ @Override
+ public void deleteAll(EntitlementPoolEntity entity) {
+ accessor.deleteByVlmVersion(entity.getVendorLicenseModelId(),
+ versionMapper.toUDT(entity.getVersion())).all();
+ }
+
+ @Override
+ public void addReferencingFeatureGroup(EntitlementPoolEntity entity,
+ String referencingFeatureGroupId) {
+ accessor
+ .addReferencingFeatureGroups(CommonMethods.toSingleElementSet(referencingFeatureGroupId),
+ entity.getVendorLicenseModelId(), versionMapper.toUDT(entity.getVersion()),
+ entity.getId());
+ }
+
+ @Override
+ public void removeReferencingFeatureGroup(EntitlementPoolEntity entity,
+ String referencingFeatureGroupId) {
+ accessor
+ .removeReferencingFeatureGroups(CommonMethods.toSingleElementSet(referencingFeatureGroupId),
+ entity.getVendorLicenseModelId(), versionMapper.toUDT(entity.getVersion()),
+ entity.getId());
+ }
+
+ @Accessor
+ interface EntitlementPoolAccessor {
+
+ @Query("select * from entitlement_pool where vlm_id=? AND version=?")
+ Result<EntitlementPoolEntity> listByVlmVersion(String vendorLicenseModelId,
+ UDTValue vendorLicenseModelVersion);
+
+ @Query("delete from entitlement_pool where vlm_id=? AND version=?")
+ ResultSet deleteByVlmVersion(String vendorLicenseModelId, UDTValue vendorLicenseModelVersion);
+
+ @Query("select count(1) from entitlement_pool where vlm_id=? AND version=?")
+ ResultSet countByVlmVersion(String vendorLicenseModelId, UDTValue vendorLicenseModelVersion);
+
+ @Query(
+ "UPDATE entitlement_pool SET ref_fg_ids = ref_fg_ids + ? WHERE vlm_id=? AND version=? "
+ + "AND ep_id=?")
+ ResultSet addReferencingFeatureGroups(Set<String> referencingFeatureGroups,
+ String vendorLicenseModelId,
+ UDTValue vendorLicenseModelVersion, String id);
+
+ @Query(
+ "UPDATE entitlement_pool SET ref_fg_ids = ref_fg_ids - ? WHERE vlm_id=? AND version=? "
+ + "AND ep_id=?")
+ ResultSet removeReferencingFeatureGroups(Set<String> referencingFeatureGroups,
+ String vendorLicenseModelId,
+ UDTValue vendorLicenseModelVersion, String id);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/EntitlementPoolDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/EntitlementPoolDaoFactoryImpl.java
new file mode 100644
index 0000000000..c1046f79cd
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/EntitlementPoolDaoFactoryImpl.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao.impl;
+
+import org.openecomp.sdc.vendorlicense.dao.EntitlementPoolDao;
+import org.openecomp.sdc.vendorlicense.dao.EntitlementPoolDaoFactory;
+
+public class EntitlementPoolDaoFactoryImpl extends EntitlementPoolDaoFactory {
+ private static EntitlementPoolDao INSTANCE = new EntitlementPoolCassandraDaoImpl();
+
+ @Override
+ public EntitlementPoolDao createInterface() {
+ return INSTANCE;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/FeatureGroupCassandraDaoImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/FeatureGroupCassandraDaoImpl.java
new file mode 100644
index 0000000000..86957a02c7
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/FeatureGroupCassandraDaoImpl.java
@@ -0,0 +1,206 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao.impl;
+
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.UDTValue;
+import com.datastax.driver.mapping.Mapper;
+import com.datastax.driver.mapping.Result;
+import com.datastax.driver.mapping.UDTMapper;
+import com.datastax.driver.mapping.annotations.Accessor;
+import com.datastax.driver.mapping.annotations.Query;
+import org.openecomp.core.dao.impl.CassandraBaseDao;
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
+import org.openecomp.core.utilities.CommonMethods;
+import org.openecomp.sdc.vendorlicense.VendorLicenseConstants;
+import org.openecomp.sdc.vendorlicense.dao.FeatureGroupDao;
+import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity;
+import org.openecomp.sdc.versioning.VersioningManagerFactory;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.types.UniqueValueMetadata;
+import org.openecomp.sdc.versioning.types.VersionableEntityMetadata;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+
+public class FeatureGroupCassandraDaoImpl extends CassandraBaseDao<FeatureGroupEntity>
+ implements FeatureGroupDao {
+
+ private static NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
+ private static Mapper<FeatureGroupEntity> mapper =
+ noSqlDb.getMappingManager().mapper(FeatureGroupEntity.class);
+ private static FeatureGroupAccessor accessor =
+ noSqlDb.getMappingManager().createAccessor(FeatureGroupAccessor.class);
+ private static UDTMapper<Version> versionMapper =
+ noSqlDb.getMappingManager().udtMapper(Version.class);
+
+ private static Set<String> emptyIfNull(Set<String> set) {
+ return set == null ? new HashSet<>() : set;
+ }
+
+ @Override
+ public void registerVersioning(String versionableEntityType) {
+ VersionableEntityMetadata metadata = new VersionableEntityMetadata(
+ mapper.getTableMetadata().getName(),
+ mapper.getTableMetadata().getPartitionKey().get(0).getName(),
+ mapper.getTableMetadata().getPartitionKey().get(1).getName());
+
+ metadata.setUniqueValuesMetadata(Collections.singletonList(
+ new UniqueValueMetadata(VendorLicenseConstants.UniqueValues.FEATURE_GROUP_NAME,
+ Arrays.asList(mapper.getTableMetadata().getPartitionKey().get(0).getName(),
+ mapper.getTableMetadata().getPartitionKey().get(1).getName(), "name"))));
+
+ VersioningManagerFactory.getInstance().createInterface()
+ .register(versionableEntityType, metadata);
+ }
+
+ @Override
+ protected Mapper<FeatureGroupEntity> getMapper() {
+ return mapper;
+ }
+
+ @Override
+ protected Object[] getKeys(FeatureGroupEntity entity) {
+ return new Object[]{entity.getVendorLicenseModelId(), versionMapper.toUDT(entity.getVersion()),
+ entity.getId()};
+ }
+
+ @Override
+ public long count(FeatureGroupEntity entity) {
+ return accessor.countByVlmVersion(entity.getVendorLicenseModelId(),
+ versionMapper.toUDT(entity.getVersion())).one().getLong("count");
+ }
+
+ @Override
+ public void updateFeatureGroup(FeatureGroupEntity entity,
+ Set<String> addedEntitlementPools,
+ Set<String> removedEntitlementPools,
+ Set<String> addedLicenseKeyGroups,
+ Set<String> removedLicenseKeyGroups) {
+ accessor.updateColumnsAndDeltaFeatureGroupIds(
+ entity.getName(),
+ entity.getDescription(),
+ entity.getPartNumber(),
+ emptyIfNull(addedEntitlementPools),
+ emptyIfNull(removedEntitlementPools),
+ emptyIfNull(addedLicenseKeyGroups),
+ emptyIfNull(removedLicenseKeyGroups),
+ entity.getVendorLicenseModelId(),
+ versionMapper.toUDT(entity.getVersion()),
+ entity.getId()
+ );
+ }
+
+ @Override
+ public Collection<FeatureGroupEntity> list(FeatureGroupEntity entity) {
+ return accessor.listByVlmVersion(entity.getVendorLicenseModelId(),
+ versionMapper.toUDT(entity.getVersion())).all();
+ }
+
+ @Override
+ public void deleteAll(FeatureGroupEntity entity) {
+ accessor.deleteByVlmVersion(entity.getVendorLicenseModelId(),
+ versionMapper.toUDT(entity.getVersion())).all();
+ }
+
+ @Override
+ public void addReferencingLicenseAgreement(FeatureGroupEntity entity, String licenseAgreementId) {
+ accessor.addReferencingLicenseAgreements(CommonMethods.toSingleElementSet(licenseAgreementId),
+ entity.getVendorLicenseModelId(), versionMapper.toUDT(entity.getVersion()), entity.getId());
+ }
+
+ @Override
+ public void removeReferencingLicenseAgreement(FeatureGroupEntity entity,
+ String licenseAgreementId) {
+ accessor
+ .removeReferencingLicenseAgreements(CommonMethods.toSingleElementSet(licenseAgreementId),
+ entity.getVendorLicenseModelId(), versionMapper.toUDT(entity.getVersion()),
+ entity.getId());
+ }
+
+ @Override
+ public void removeEntitlementPool(FeatureGroupEntity entity, String entitlementPoolId) {
+ accessor.removeEntitlementPools(CommonMethods.toSingleElementSet(entitlementPoolId),
+ entity.getVendorLicenseModelId(), versionMapper.toUDT(entity.getVersion()), entity.getId());
+ }
+
+ @Override
+ public void removeLicenseKeyGroup(FeatureGroupEntity entity, String licenseKeyGroupId) {
+ accessor.removeLicenseKeyGroup(CommonMethods.toSingleElementSet(licenseKeyGroupId),
+ entity.getVendorLicenseModelId(), versionMapper.toUDT(entity.getVersion()), entity.getId());
+ }
+
+ @Accessor
+ interface FeatureGroupAccessor {
+
+ @Query("select * from feature_group where vlm_id=? AND version=?")
+ Result<FeatureGroupEntity> listByVlmVersion(String vendorLicenseModelId, UDTValue version);
+
+ @Query("select count(1) from feature_group where vlm_id=? AND version=?")
+ ResultSet countByVlmVersion(String vendorLicenseModelId, UDTValue vendorLicenseModelVersion);
+
+ @Query("delete from feature_group where vlm_id=? AND version=?")
+ ResultSet deleteByVlmVersion(String vendorLicenseModelId, UDTValue vendorLicenseModelVersion);
+
+ @Query(
+ "update feature_group set name=?,description=?, part_num=?, ep_ids=ep_ids+ ?,"
+ + "ep_ids=ep_ids-?, lkg_ids=lkg_ids+?,lkg_ids=lkg_ids-? WHERE "
+ + "vlm_id=? AND version=? AND fg_id=?")
+ ResultSet updateColumnsAndDeltaFeatureGroupIds(String name, String description,
+ String partNumber,
+ Set<String> addedEntitlementPools,
+ Set<String> removedEntitlementPools,
+ Set<String> addedLicenseKeyGroups,
+ Set<String> removedLicenseKeyGroups,
+ String vendorLicenseModelId, UDTValue version,
+ String id);
+
+ @Query(
+ "UPDATE feature_group SET ref_la_ids = ref_la_ids "
+ + "+ ? WHERE vlm_id=? AND version=? AND fg_id=?")
+ ResultSet addReferencingLicenseAgreements(Set<String> licenseAgreementIds,
+ String vendorLicenseModelId, UDTValue version,
+ String id);
+
+ @Query(
+ "UPDATE feature_group SET ref_la_ids = ref_la_ids - ? "
+ + "WHERE vlm_id=? AND version=? AND fg_id=?")
+ ResultSet removeReferencingLicenseAgreements(Set<String> licenseAgreementIds,
+ String vendorLicenseModelId, UDTValue version,
+ String id);
+
+ @Query("UPDATE feature_group SET ep_ids = ep_ids - ? WHERE vlm_id=? AND version=? AND fg_id=?")
+ ResultSet removeEntitlementPools(Set<String> entitlementPoolIds, String vendorLicenseModelId,
+ UDTValue version, String id);
+
+ @Query(
+ "UPDATE feature_group SET lkg_ids = lkg_ids - ? WHERE vlm_id=? AND version=? AND fg_id=?")
+ ResultSet removeLicenseKeyGroup(Set<String> licenseKeyGroupIds, String vendorLicenseModelId,
+ UDTValue version, String id);
+
+ }
+}
+
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/FeatureGroupDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/FeatureGroupDaoFactoryImpl.java
new file mode 100644
index 0000000000..941b2b5ecc
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/FeatureGroupDaoFactoryImpl.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao.impl;
+
+import org.openecomp.sdc.vendorlicense.dao.FeatureGroupDao;
+import org.openecomp.sdc.vendorlicense.dao.FeatureGroupDaoFactory;
+
+public class FeatureGroupDaoFactoryImpl extends FeatureGroupDaoFactory {
+ private static FeatureGroupDao INSTANCE = new FeatureGroupCassandraDaoImpl();
+
+ @Override
+ public FeatureGroupDao createInterface() {
+ return INSTANCE;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/LicenseAgreementCassandraDaoImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/LicenseAgreementCassandraDaoImpl.java
new file mode 100644
index 0000000000..6a7cc2aa60
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/LicenseAgreementCassandraDaoImpl.java
@@ -0,0 +1,160 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao.impl;
+
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.UDTValue;
+import com.datastax.driver.mapping.Mapper;
+import com.datastax.driver.mapping.Result;
+import com.datastax.driver.mapping.UDTMapper;
+import com.datastax.driver.mapping.annotations.Accessor;
+import com.datastax.driver.mapping.annotations.Query;
+import org.openecomp.core.dao.impl.CassandraBaseDao;
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
+import org.openecomp.core.utilities.CommonMethods;
+import org.openecomp.sdc.vendorlicense.VendorLicenseConstants;
+import org.openecomp.sdc.vendorlicense.dao.LicenseAgreementDao;
+import org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther;
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity;
+import org.openecomp.sdc.versioning.VersioningManagerFactory;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.types.UniqueValueMetadata;
+import org.openecomp.sdc.versioning.types.VersionableEntityMetadata;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+public class LicenseAgreementCassandraDaoImpl extends CassandraBaseDao<LicenseAgreementEntity>
+ implements LicenseAgreementDao {
+ private static NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
+ private static Mapper<LicenseAgreementEntity> mapper =
+ noSqlDb.getMappingManager().mapper(LicenseAgreementEntity.class);
+ private static LicenseAgreementAccessor accessor =
+ noSqlDb.getMappingManager().createAccessor(LicenseAgreementAccessor.class);
+ private static UDTMapper<ChoiceOrOther> choiceOrOtherMapper =
+ noSqlDb.getMappingManager().udtMapper(ChoiceOrOther.class);
+ private static UDTMapper<Version> versionMapper =
+ noSqlDb.getMappingManager().udtMapper(Version.class);
+
+ private static Set<String> emptyIfNull(Set<String> set) {
+ return set == null ? new HashSet<>() : set;
+ }
+
+ @Override
+ public void registerVersioning(String versionableEntityType) {
+ VersionableEntityMetadata metadata = new VersionableEntityMetadata(
+ mapper.getTableMetadata().getName(),
+ mapper.getTableMetadata().getPartitionKey().get(0).getName(),
+ mapper.getTableMetadata().getPartitionKey().get(1).getName());
+
+ metadata.setUniqueValuesMetadata(Collections.singletonList(
+ new UniqueValueMetadata(VendorLicenseConstants.UniqueValues.LICENSE_AGREEMENT_NAME,
+ Arrays.asList(mapper.getTableMetadata().getPartitionKey().get(0).getName(),
+ mapper.getTableMetadata().getPartitionKey().get(1).getName(), "name"))));
+
+ VersioningManagerFactory.getInstance().createInterface()
+ .register(versionableEntityType, metadata);
+ }
+
+ @Override
+ protected Mapper<LicenseAgreementEntity> getMapper() {
+ return mapper;
+ }
+
+ @Override
+ protected Object[] getKeys(LicenseAgreementEntity entity) {
+ return new Object[]{entity.getVendorLicenseModelId(), versionMapper.toUDT(entity.getVersion()),
+ entity.getId()};
+ }
+
+ @Override
+ public Collection<LicenseAgreementEntity> list(LicenseAgreementEntity entity) {
+ return accessor.listByVlmVersion(entity.getVendorLicenseModelId(),
+ versionMapper.toUDT(entity.getVersion())).all();
+ }
+
+ @Override
+ public long count(LicenseAgreementEntity entity) {
+ return accessor.countByVlmVersion(entity.getVendorLicenseModelId(),
+ versionMapper.toUDT(entity.getVersion())).one().getLong("count");
+ }
+
+ @Override
+ public void deleteAll(LicenseAgreementEntity entity) {
+ accessor.deleteByVlmVersion(entity.getVendorLicenseModelId(),
+ versionMapper.toUDT(entity.getVersion())).all();
+ }
+
+ @Override
+ public void removeFeatureGroup(LicenseAgreementEntity licenseAgreement, String featureGroupId) {
+ accessor.removeFeatureGroup(CommonMethods.toSingleElementSet(featureGroupId),
+ licenseAgreement.getVendorLicenseModelId(),
+ versionMapper.toUDT(licenseAgreement.getVersion()), licenseAgreement.getId());
+ }
+
+ @Override
+ public void updateColumnsAndDeltaFeatureGroupIds(LicenseAgreementEntity licenseAgreement,
+ Set<String> addedFeatureGroupIds,
+ Set<String> removedFeatureGroupIds) {
+ accessor.updateColumnsAndDeltaFeatureGroupIds(licenseAgreement.getName(),
+ licenseAgreement.getDescription(),
+ licenseAgreement.getLicenseTerm() == null ? null
+ : choiceOrOtherMapper.toUDT(licenseAgreement.getLicenseTerm()),
+ licenseAgreement.getRequirementsAndConstrains(),
+ emptyIfNull(addedFeatureGroupIds),
+ emptyIfNull(removedFeatureGroupIds),
+ licenseAgreement.getVendorLicenseModelId(),
+ versionMapper.toUDT(licenseAgreement.getVersion()),
+ licenseAgreement.getId());
+
+ }
+
+ @Accessor
+ interface LicenseAgreementAccessor {
+
+ @Query("SELECT * FROM license_agreement WHERE vlm_id=? and version=?")
+ Result<LicenseAgreementEntity> listByVlmVersion(String vendorLicenseModelId, UDTValue version);
+
+ @Query("select count(1) from license_agreement where vlm_id=? AND version=?")
+ ResultSet countByVlmVersion(String vendorLicenseModelId, UDTValue vendorLicenseModelVersion);
+
+ @Query("delete from license_agreement where vlm_id=? AND version=?")
+ ResultSet deleteByVlmVersion(String vendorLicenseModelId, UDTValue vendorLicenseModelVersion);
+
+ @Query(
+ "UPDATE license_agreement SET name=?, description=?, lic_term=?, req_const=?, "
+ + "fg_ids=fg_ids+?, fg_ids=fg_ids-? WHERE vlm_id=? AND version=? AND la_id=?")
+ ResultSet updateColumnsAndDeltaFeatureGroupIds(String name, String description,
+ UDTValue licenseTerm, String reqAndConst,
+ Set<String> addedFeatureGroupIds,
+ Set<String> removedFeatureGroupIds,
+ String vendorLicenseModelId, UDTValue version,
+ String id);
+
+ @Query("UPDATE license_agreement SET fg_ids=fg_ids-? WHERE vlm_id=? AND version=? AND la_id=?")
+ ResultSet removeFeatureGroup(Set<String> featureGroupIds, String vendorLicenseModelId,
+ UDTValue version, String id);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/LicenseAgreementDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/LicenseAgreementDaoFactoryImpl.java
new file mode 100644
index 0000000000..d92e2562e9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/LicenseAgreementDaoFactoryImpl.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao.impl;
+
+import org.openecomp.sdc.vendorlicense.dao.LicenseAgreementDao;
+import org.openecomp.sdc.vendorlicense.dao.LicenseAgreementDaoFactory;
+
+public class LicenseAgreementDaoFactoryImpl extends LicenseAgreementDaoFactory {
+ private static LicenseAgreementDao INSTANCE = new LicenseAgreementCassandraDaoImpl();
+
+ @Override
+ public LicenseAgreementDao createInterface() {
+ return INSTANCE;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/LicenseKeyGroupCassandraDaoImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/LicenseKeyGroupCassandraDaoImpl.java
new file mode 100644
index 0000000000..c6952c8d03
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/LicenseKeyGroupCassandraDaoImpl.java
@@ -0,0 +1,130 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao.impl;
+
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.UDTValue;
+import com.datastax.driver.mapping.Mapper;
+import com.datastax.driver.mapping.Result;
+import com.datastax.driver.mapping.UDTMapper;
+import com.datastax.driver.mapping.annotations.Accessor;
+import com.datastax.driver.mapping.annotations.Query;
+import org.openecomp.core.dao.impl.CassandraBaseDao;
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
+import org.openecomp.core.utilities.CommonMethods;
+import org.openecomp.sdc.vendorlicense.VendorLicenseConstants;
+import org.openecomp.sdc.vendorlicense.dao.LicenseKeyGroupDao;
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity;
+import org.openecomp.sdc.versioning.VersioningManagerFactory;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.types.UniqueValueMetadata;
+import org.openecomp.sdc.versioning.types.VersionableEntityMetadata;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Set;
+
+
+public class LicenseKeyGroupCassandraDaoImpl extends CassandraBaseDao<LicenseKeyGroupEntity>
+ implements LicenseKeyGroupDao {
+ private static NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
+ private static Mapper<LicenseKeyGroupEntity> mapper =
+ noSqlDb.getMappingManager().mapper(LicenseKeyGroupEntity.class);
+ private static LicenseKeyGroupAccessor accessor =
+ noSqlDb.getMappingManager().createAccessor(LicenseKeyGroupAccessor.class);
+ private static UDTMapper<Version> versionMapper =
+ noSqlDb.getMappingManager().udtMapper(Version.class);
+
+ @Override
+ public void registerVersioning(String versionableEntityType) {
+ VersionableEntityMetadata metadata = new VersionableEntityMetadata(
+ mapper.getTableMetadata().getName(),
+ mapper.getTableMetadata().getPartitionKey().get(0).getName(),
+ mapper.getTableMetadata().getPartitionKey().get(1).getName());
+
+ metadata.setUniqueValuesMetadata(Collections.singletonList(
+ new UniqueValueMetadata(VendorLicenseConstants.UniqueValues.LICENSE_KEY_GROUP_NAME,
+ Arrays.asList(mapper.getTableMetadata().getPartitionKey().get(0).getName(),
+ mapper.getTableMetadata().getPartitionKey().get(1).getName(), "name"))));
+
+ VersioningManagerFactory.getInstance().createInterface()
+ .register(versionableEntityType, metadata);
+ }
+
+ @Override
+ protected Mapper<LicenseKeyGroupEntity> getMapper() {
+ return mapper;
+ }
+
+ @Override
+ protected Object[] getKeys(LicenseKeyGroupEntity entity) {
+ return new Object[]{entity.getVendorLicenseModelId(), versionMapper.toUDT(entity.getVersion()),
+ entity.getId()};
+ }
+
+ @Override
+ public Collection<LicenseKeyGroupEntity> list(LicenseKeyGroupEntity entity) {
+ return accessor.listByVlmVersion(entity.getVendorLicenseModelId(),
+ versionMapper.toUDT(entity.getVersion())).all();
+ }
+
+ @Override
+ public void deleteAll(LicenseKeyGroupEntity entity) {
+ accessor.deleteByVlmVersion(entity.getVendorLicenseModelId(),
+ versionMapper.toUDT(entity.getVersion())).all();
+ }
+
+ @Override
+ public void addReferencingFeatureGroup(LicenseKeyGroupEntity entity, String featureGroupId) {
+ accessor.addReferencingFeatureGroups(CommonMethods.toSingleElementSet(featureGroupId),
+ entity.getVendorLicenseModelId(), versionMapper.toUDT(entity.getVersion()), entity.getId());
+ }
+
+ @Override
+ public void removeReferencingFeatureGroup(LicenseKeyGroupEntity entity, String featureGroupId) {
+ accessor.removeReferencingFeatureGroups(CommonMethods.toSingleElementSet(featureGroupId),
+ entity.getVendorLicenseModelId(), versionMapper.toUDT(entity.getVersion()), entity.getId());
+ }
+
+ @Accessor
+ interface LicenseKeyGroupAccessor {
+ @Query("select * from license_key_group where vlm_id=? and version=?")
+ Result<LicenseKeyGroupEntity> listByVlmVersion(String vendorLicenseModelId, UDTValue version);
+
+ @Query("delete from license_key_group where vlm_id=? and version=?")
+ Result<LicenseKeyGroupEntity> deleteByVlmVersion(String vendorLicenseModelId, UDTValue version);
+
+ @Query(
+ "UPDATE license_key_group SET ref_fg_ids = ref_fg_ids + ? WHERE vlm_id=? AND version=?"
+ + " AND lkg_id=?")
+ ResultSet addReferencingFeatureGroups(Set<String> referencingFeatureGroups,
+ String vendorLicenseModelId, UDTValue version, String id);
+
+ @Query(
+ "UPDATE license_key_group SET ref_fg_ids = ref_fg_ids - ? WHERE vlm_id=? AND version=? "
+ + "AND lkg_id=?")
+ ResultSet removeReferencingFeatureGroups(Set<String> referencingFeatureGroups,
+ String vendorLicenseModelId, UDTValue version,
+ String id);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/LicenseKeyGroupDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/LicenseKeyGroupDaoFactoryImpl.java
new file mode 100644
index 0000000000..16d1fd2a3e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/LicenseKeyGroupDaoFactoryImpl.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao.impl;
+
+import org.openecomp.sdc.vendorlicense.dao.LicenseKeyGroupDao;
+import org.openecomp.sdc.vendorlicense.dao.LicenseKeyGroupDaoFactory;
+
+public class LicenseKeyGroupDaoFactoryImpl extends LicenseKeyGroupDaoFactory {
+ private static LicenseKeyGroupDao INSTANCE = new LicenseKeyGroupCassandraDaoImpl();
+
+ @Override
+ public LicenseKeyGroupDao createInterface() {
+ return INSTANCE;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/VendorLicenseModelCassandraDaoImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/VendorLicenseModelCassandraDaoImpl.java
new file mode 100644
index 0000000000..4d08d98bd7
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/VendorLicenseModelCassandraDaoImpl.java
@@ -0,0 +1,91 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao.impl;
+
+import com.datastax.driver.mapping.Mapper;
+import com.datastax.driver.mapping.Result;
+import com.datastax.driver.mapping.UDTMapper;
+import com.datastax.driver.mapping.annotations.Accessor;
+import com.datastax.driver.mapping.annotations.Query;
+import org.openecomp.core.dao.impl.CassandraBaseDao;
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
+import org.openecomp.sdc.vendorlicense.dao.VendorLicenseModelDao;
+import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity;
+import org.openecomp.sdc.versioning.VersioningManagerFactory;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.types.VersionableEntityMetadata;
+
+import java.util.Collection;
+
+public class VendorLicenseModelCassandraDaoImpl extends CassandraBaseDao<VendorLicenseModelEntity>
+ implements VendorLicenseModelDao {
+
+ private static NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
+ private static Mapper<VendorLicenseModelEntity> mapper =
+ noSqlDb.getMappingManager().mapper(VendorLicenseModelEntity.class);
+ private static VendorLicenseModelAccessor accessor =
+ noSqlDb.getMappingManager().createAccessor(VendorLicenseModelAccessor.class);
+ private static UDTMapper<Version> versionMapper =
+ noSqlDb.getMappingManager().udtMapper(Version.class);
+
+ @Override
+ public void registerVersioning(String versionableEntityType) {
+ VersioningManagerFactory.getInstance().createInterface()
+ .register(versionableEntityType, new VersionableEntityMetadata(
+ mapper.getTableMetadata().getName(),
+ mapper.getTableMetadata().getPartitionKey().get(0).getName(),
+ mapper.getTableMetadata().getPartitionKey().get(1).getName()));
+ }
+
+ @Override
+ protected Mapper<VendorLicenseModelEntity> getMapper() {
+ return mapper;
+ }
+
+ @Override
+ protected Object[] getKeys(VendorLicenseModelEntity entity) {
+ return new Object[]{entity.getId(), versionMapper.toUDT(entity.getVersion())};
+ }
+
+ @Override
+ public Collection<VendorLicenseModelEntity> list(VendorLicenseModelEntity vendorLicenseModel) {
+ return accessor.getAll().all();
+ }
+
+ // @Override
+ // public void updateLastModificationTime(VendorLicenseModelEntity vendorLicenseModel){
+ // accessor.updateLastModificationTime(vendorLicenseModel.getLastModificationTime(),
+ // vendorLicenseModel.getId(), versionMapper.toUDT(vendorLicenseModel.getVersion()));
+ // }
+
+ @Accessor
+ interface VendorLicenseModelAccessor {
+
+ @Query("SELECT * FROM vendor_license_model")
+ Result<VendorLicenseModelEntity> getAll();
+
+ // @Query("UPDATE vendor_license_model set last_modification_time
+ // = ? where vlm_id = ? and version = ?")
+ // ResultSet updateLastModificationTime(Date lastModificationTime,
+ // String vlmId, UDTValue version);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/VendorLicenseModelDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/VendorLicenseModelDaoFactoryImpl.java
new file mode 100644
index 0000000000..d218ca4907
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/VendorLicenseModelDaoFactoryImpl.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao.impl;
+
+import org.openecomp.sdc.vendorlicense.dao.VendorLicenseModelDao;
+import org.openecomp.sdc.vendorlicense.dao.VendorLicenseModelDaoFactory;
+
+public class VendorLicenseModelDaoFactoryImpl extends VendorLicenseModelDaoFactory {
+
+ private static VendorLicenseModelDao INSTANCE = new VendorLicenseModelCassandraDaoImpl();
+
+ @Override
+ public VendorLicenseModelDao createInterface() {
+ return INSTANCE;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/facade/impl/VendorLicenseFacadeFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/facade/impl/VendorLicenseFacadeFactoryImpl.java
new file mode 100644
index 0000000000..3cf6d0b806
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/facade/impl/VendorLicenseFacadeFactoryImpl.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.facade.impl;
+
+import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacade;
+import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacadeFactory;
+
+public class VendorLicenseFacadeFactoryImpl extends VendorLicenseFacadeFactory {
+ private static VendorLicenseFacade INSTANCE = new VendorLicenseFacadeImpl();
+
+ @Override
+ public VendorLicenseFacade createInterface() {
+ return INSTANCE;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/facade/impl/VendorLicenseFacadeImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/facade/impl/VendorLicenseFacadeImpl.java
new file mode 100644
index 0000000000..678a53583c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/facade/impl/VendorLicenseFacadeImpl.java
@@ -0,0 +1,478 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.facade.impl;
+
+import org.openecomp.core.util.UniqueValueUtil;
+import org.openecomp.core.utilities.CommonMethods;
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.common.errors.ErrorCode;
+import org.openecomp.sdc.vendorlicense.VendorLicenseConstants;
+import org.openecomp.sdc.vendorlicense.dao.EntitlementPoolDao;
+import org.openecomp.sdc.vendorlicense.dao.EntitlementPoolDaoFactory;
+import org.openecomp.sdc.vendorlicense.dao.FeatureGroupDao;
+import org.openecomp.sdc.vendorlicense.dao.FeatureGroupDaoFactory;
+import org.openecomp.sdc.vendorlicense.dao.LicenseAgreementDao;
+import org.openecomp.sdc.vendorlicense.dao.LicenseAgreementDaoFactory;
+import org.openecomp.sdc.vendorlicense.dao.LicenseKeyGroupDao;
+import org.openecomp.sdc.vendorlicense.dao.LicenseKeyGroupDaoFactory;
+import org.openecomp.sdc.vendorlicense.dao.VendorLicenseModelDao;
+import org.openecomp.sdc.vendorlicense.dao.VendorLicenseModelDaoFactory;
+import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupModel;
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementModel;
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity;
+import org.openecomp.sdc.vendorlicense.errors.SubmitUncompletedLicenseModelErrorBuilder;
+import org.openecomp.sdc.vendorlicense.errors.VendorLicenseModelNotFoundErrorBuilder;
+import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacade;
+import org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel;
+import org.openecomp.sdc.versioning.VersioningManager;
+import org.openecomp.sdc.versioning.VersioningManagerFactory;
+import org.openecomp.sdc.versioning.VersioningUtil;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.errors.RequestedVersionInvalidErrorBuilder;
+import org.openecomp.sdc.versioning.errors.VersionableSubEntityNotFoundErrorBuilder;
+import org.openecomp.sdc.versioning.types.VersionInfo;
+import org.openecomp.sdc.versioning.types.VersionableEntityAction;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+
+public class VendorLicenseFacadeImpl
+ implements VendorLicenseFacade {
+
+
+ private static final VersioningManager versioningManager =
+ VersioningManagerFactory.getInstance().createInterface();
+
+ private static final VendorLicenseModelDao vendorLicenseModelDao =
+ VendorLicenseModelDaoFactory.getInstance().createInterface();
+ private static final LicenseAgreementDao licenseAgreementDao =
+ LicenseAgreementDaoFactory.getInstance().createInterface();
+ private static final FeatureGroupDao featureGroupDao =
+ FeatureGroupDaoFactory.getInstance().createInterface();
+ private static final EntitlementPoolDao entitlementPoolDao =
+ EntitlementPoolDaoFactory.getInstance().createInterface();
+ private static final LicenseKeyGroupDao licenseKeyGroupDao =
+ LicenseKeyGroupDaoFactory.getInstance().createInterface();
+
+ /**
+ * Instantiates a new Vendor license facade.
+ */
+ public VendorLicenseFacadeImpl() {
+ vendorLicenseModelDao
+ .registerVersioning(VendorLicenseConstants.VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE);
+ licenseAgreementDao
+ .registerVersioning(VendorLicenseConstants.VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE);
+ featureGroupDao
+ .registerVersioning(VendorLicenseConstants.VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE);
+ entitlementPoolDao
+ .registerVersioning(VendorLicenseConstants.VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE);
+ licenseKeyGroupDao
+ .registerVersioning(VendorLicenseConstants.VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE);
+ }
+
+ @Override
+ public void checkin(String vendorLicenseModelId, String user) {
+ Version newVersion = versioningManager
+ .checkin(VendorLicenseConstants
+ .VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE,
+ vendorLicenseModelId, user, null);
+ updateVlmLastModificationTime(vendorLicenseModelId, newVersion);
+ }
+
+ @Override
+ public void submit(String vendorLicenseModelId, String user) {
+ validateCompletedVendorLicenseModel(vendorLicenseModelId, user);
+ Version newVersion = versioningManager
+ .submit(VendorLicenseConstants
+ .VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE,
+ vendorLicenseModelId, user, null);
+ updateVlmLastModificationTime(vendorLicenseModelId, newVersion);
+ }
+
+ @Override
+ public FeatureGroupEntity getFeatureGroup(FeatureGroupEntity featureGroup, String user) {
+ Version version = VersioningUtil.resolveVersion(featureGroup.getVersion(),
+ getVersionInfo(featureGroup.getVendorLicenseModelId(), VersionableEntityAction.Read, user));
+ featureGroup.setVersion(version);
+ return getFeatureGroup(featureGroup);
+ }
+
+ private FeatureGroupEntity getFeatureGroup(FeatureGroupEntity featureGroup) {
+ FeatureGroupEntity retrieved = featureGroupDao.get(featureGroup);
+ VersioningUtil
+ .validateEntityExistence(retrieved, featureGroup, VendorLicenseModelEntity.ENTITY_TYPE);
+ return retrieved;
+ }
+
+ @Override
+ public FeatureGroupModel getFeatureGroupModel(FeatureGroupEntity featureGroup, String user) {
+ FeatureGroupEntity retrieved = getFeatureGroup(featureGroup, user);
+
+ FeatureGroupModel featureGroupModel = new FeatureGroupModel();
+ featureGroupModel.setFeatureGroup(retrieved);
+
+ for (String licenseKeyGroupId : retrieved.getLicenseKeyGroupIds()) {
+ featureGroupModel.getLicenseKeyGroups().add(licenseKeyGroupDao.get(
+ new LicenseKeyGroupEntity(retrieved.getVendorLicenseModelId(), retrieved.getVersion(),
+ licenseKeyGroupId)));
+ }
+ for (String entitlementPoolId : retrieved.getEntitlementPoolIds()) {
+ featureGroupModel.getEntitlementPools().add(entitlementPoolDao.get(
+ new EntitlementPoolEntity(retrieved.getVendorLicenseModelId(), retrieved.getVersion(),
+ entitlementPoolId)));
+ }
+
+ return featureGroupModel;
+ }
+
+ @Override
+ public LicenseAgreementEntity getLicenseAgreement(String vlmId, Version version,
+ String licenseAgreementId, String user) {
+ return getLicenseAgreement(vlmId, licenseAgreementId, VersioningUtil
+ .resolveVersion(version, getVersionInfo(vlmId, VersionableEntityAction.Read, user)));
+ }
+
+ private LicenseAgreementEntity getLicenseAgreement(String vlmId, String licenseAgreementId,
+ Version version) {
+ LicenseAgreementEntity input = new LicenseAgreementEntity(vlmId, version, licenseAgreementId);
+ LicenseAgreementEntity retrieved = licenseAgreementDao.get(input);
+ VersioningUtil.validateEntityExistence(retrieved, input, VendorLicenseModelEntity.ENTITY_TYPE);
+ return retrieved;
+ }
+
+ @Override
+ public LicenseAgreementModel getLicenseAgreementModel(String vlmId, Version version,
+ String licenseAgreementId, String user) {
+ LicenseAgreementEntity retrieved =
+ getLicenseAgreement(vlmId, version, licenseAgreementId, user);
+
+ LicenseAgreementModel licenseAgreementModel = new LicenseAgreementModel();
+ licenseAgreementModel.setLicenseAgreement(retrieved);
+
+ for (String featureGroupId : retrieved.getFeatureGroupIds()) {
+ licenseAgreementModel.getFeatureGroups().add(featureGroupDao
+ .get(new FeatureGroupEntity(vlmId, retrieved.getVersion(), featureGroupId)));
+ }
+
+ return licenseAgreementModel;
+ }
+
+ @Override
+ public EntitlementPoolEntity createEntitlementPool(EntitlementPoolEntity entitlementPool,
+ String user) {
+ entitlementPool.setVersion(
+ getVersionInfo(entitlementPool.getVendorLicenseModelId(), VersionableEntityAction.Write,
+ user).getActiveVersion());
+ entitlementPool.setId(CommonMethods.nextUuId());
+ entitlementPool.setVersionUuId(CommonMethods.nextUuId());
+ UniqueValueUtil.createUniqueValue(VendorLicenseConstants.UniqueValues.ENTITLEMENT_POOL_NAME,
+ entitlementPool.getVendorLicenseModelId(), entitlementPool.getVersion().toString(),
+ entitlementPool.getName());
+ entitlementPoolDao.create(entitlementPool);
+ updateVlmLastModificationTime(entitlementPool.getVendorLicenseModelId(),
+ entitlementPool.getVersion());
+ return entitlementPool;
+ }
+
+ @Override
+ public LicenseKeyGroupEntity createLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup,
+ String user) {
+ licenseKeyGroup.setVersion(
+ getVersionInfo(licenseKeyGroup.getVendorLicenseModelId(), VersionableEntityAction.Write,
+ user).getActiveVersion());
+ licenseKeyGroup.setId(CommonMethods.nextUuId());
+ licenseKeyGroup.setVersionUuId(CommonMethods.nextUuId());
+ UniqueValueUtil.createUniqueValue(VendorLicenseConstants.UniqueValues.LICENSE_KEY_GROUP_NAME,
+ licenseKeyGroup.getVendorLicenseModelId(), licenseKeyGroup.getVersion().toString(),
+ licenseKeyGroup.getName());
+ licenseKeyGroupDao.create(licenseKeyGroup);
+ updateVlmLastModificationTime(licenseKeyGroup.getVendorLicenseModelId(),
+ licenseKeyGroup.getVersion());
+ return licenseKeyGroup;
+ }
+
+ @Override
+ public void updateEntitlementPool(EntitlementPoolEntity entitlementPool, String user) {
+ entitlementPool.setVersion(
+ getVersionInfo(entitlementPool.getVendorLicenseModelId(), VersionableEntityAction.Write,
+ user).getActiveVersion());
+ EntitlementPoolEntity retrieved = entitlementPoolDao.get(entitlementPool);
+ VersioningUtil
+ .validateEntityExistence(retrieved, entitlementPool, VendorLicenseModelEntity.ENTITY_TYPE);
+
+ UniqueValueUtil.updateUniqueValue(VendorLicenseConstants.UniqueValues.ENTITLEMENT_POOL_NAME,
+ retrieved.getName(), entitlementPool.getName(), entitlementPool.getVendorLicenseModelId(),
+ entitlementPool.getVersion().toString());
+ entitlementPool.setVersionUuId(CommonMethods.nextUuId());
+ entitlementPoolDao.update(entitlementPool);
+
+ updateVlmLastModificationTime(entitlementPool.getVendorLicenseModelId(),
+ entitlementPool.getVersion());
+
+ }
+
+ @Override
+ public Collection<LicenseKeyGroupEntity> listLicenseKeyGroups(String vlmId, Version version,
+ String user) {
+ return licenseKeyGroupDao.list(new LicenseKeyGroupEntity(vlmId, VersioningUtil
+ .resolveVersion(version, getVersionInfo(vlmId, VersionableEntityAction.Read, user)), null));
+ }
+
+ @Override
+ public Collection<EntitlementPoolEntity> listEntitlementPools(String vlmId, Version version,
+ String user) {
+ return entitlementPoolDao.list(new EntitlementPoolEntity(vlmId, VersioningUtil
+ .resolveVersion(version, getVersionInfo(vlmId, VersionableEntityAction.Read, user)), null));
+ }
+
+ @Override
+ public void updateLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup, String user) {
+ licenseKeyGroup.setVersion(
+ getVersionInfo(licenseKeyGroup.getVendorLicenseModelId(), VersionableEntityAction.Write,
+ user).getActiveVersion());
+ LicenseKeyGroupEntity retrieved = licenseKeyGroupDao.get(licenseKeyGroup);
+ licenseKeyGroup.setVersionUuId((CommonMethods.nextUuId()));
+ VersioningUtil
+ .validateEntityExistence(retrieved, licenseKeyGroup, VendorLicenseModelEntity.ENTITY_TYPE);
+ UniqueValueUtil.updateUniqueValue(VendorLicenseConstants.UniqueValues.LICENSE_KEY_GROUP_NAME,
+ retrieved.getName(), licenseKeyGroup.getName(), licenseKeyGroup.getVendorLicenseModelId(),
+ licenseKeyGroup.getVersion().toString());
+ licenseKeyGroupDao.update(licenseKeyGroup);
+
+ updateVlmLastModificationTime(licenseKeyGroup.getVendorLicenseModelId(),
+ licenseKeyGroup.getVersion());
+ }
+
+
+ @Override
+ public VersionInfo getVersionInfo(String vendorLicenseModelId, VersionableEntityAction action,
+ String user) {
+ return versioningManager
+ .getEntityVersionInfo(VendorLicenseConstants
+ .VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE,
+ vendorLicenseModelId, user,
+ action);
+ }
+
+ @Override
+ public VersionedVendorLicenseModel getVendorLicenseModel(String vlmId, Version version,
+ String user) {
+ VersionInfo versionInfo = getVersionInfo(vlmId, VersionableEntityAction.Read, user);
+
+ VendorLicenseModelEntity vendorLicenseModel = vendorLicenseModelDao.get(
+ new VendorLicenseModelEntity(vlmId, VersioningUtil.resolveVersion(version, versionInfo)));
+ if (vendorLicenseModel == null) {
+ throw new CoreException(new VendorLicenseModelNotFoundErrorBuilder(vlmId).build());
+ }
+
+ return new VersionedVendorLicenseModel(vendorLicenseModel, versionInfo);
+ }
+
+ @Override
+ public VendorLicenseModelEntity createVendorLicenseModel(
+ VendorLicenseModelEntity vendorLicenseModelEntity, String user) {
+ UniqueValueUtil.validateUniqueValue(VendorLicenseConstants.UniqueValues.VENDOR_NAME,
+ vendorLicenseModelEntity.getVendorName());
+ vendorLicenseModelEntity.setId(CommonMethods.nextUuId());
+
+ Version version = versioningManager
+ .create(VendorLicenseConstants
+ .VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE,
+ vendorLicenseModelEntity.getId(), user);
+ vendorLicenseModelEntity.setVersion(version);
+
+ // vendorLicenseModelEntity.setLastModificationTime(new Date());
+
+ vendorLicenseModelDao.create(vendorLicenseModelEntity);
+ UniqueValueUtil.createUniqueValue(VendorLicenseConstants.UniqueValues.VENDOR_NAME,
+ vendorLicenseModelEntity.getVendorName());
+
+ return vendorLicenseModelEntity;
+ }
+
+ @Override
+ public LicenseAgreementEntity createLicenseAgreement(LicenseAgreementEntity licenseAgreement,
+ String user) {
+ Version activeVersion =
+ getVersionInfo(licenseAgreement.getVendorLicenseModelId(), VersionableEntityAction.Write,
+ user).getActiveVersion();
+ licenseAgreement.setVersion(activeVersion);
+ licenseAgreement.setId(CommonMethods.nextUuId());
+ VersioningUtil.validateEntitiesExistence(licenseAgreement.getFeatureGroupIds(),
+ new FeatureGroupEntity(licenseAgreement.getVendorLicenseModelId(), activeVersion, null),
+ featureGroupDao, VendorLicenseModelEntity.ENTITY_TYPE);
+ UniqueValueUtil.validateUniqueValue(VendorLicenseConstants.UniqueValues.LICENSE_AGREEMENT_NAME,
+ licenseAgreement.getVendorLicenseModelId(), licenseAgreement.getVersion().toString(),
+ licenseAgreement.getName());
+
+ if (licenseAgreement.getFeatureGroupIds() != null) {
+ for (String addedFgId : licenseAgreement.getFeatureGroupIds()) {
+ featureGroupDao.addReferencingLicenseAgreement(
+ new FeatureGroupEntity(licenseAgreement.getVendorLicenseModelId(), activeVersion,
+ addedFgId), licenseAgreement.getId());
+ }
+ }
+
+ licenseAgreementDao.create(licenseAgreement);
+ UniqueValueUtil.createUniqueValue(VendorLicenseConstants.UniqueValues.LICENSE_AGREEMENT_NAME,
+ licenseAgreement.getVendorLicenseModelId(), licenseAgreement.getVersion().toString(),
+ licenseAgreement.getName());
+
+ updateVlmLastModificationTime(licenseAgreement.getVendorLicenseModelId(),
+ licenseAgreement.getVersion());
+
+ return licenseAgreement;
+ }
+
+ @Override
+ public FeatureGroupEntity createFeatureGroup(FeatureGroupEntity featureGroup, String user) {
+ Version activeVersion =
+ getVersionInfo(featureGroup.getVendorLicenseModelId(), VersionableEntityAction.Write, user)
+ .getActiveVersion();
+ featureGroup.setId(CommonMethods.nextUuId());
+ featureGroup.setVersion(activeVersion);
+ VersioningUtil.validateEntitiesExistence(featureGroup.getLicenseKeyGroupIds(),
+ new LicenseKeyGroupEntity(featureGroup.getVendorLicenseModelId(), activeVersion, null),
+ licenseKeyGroupDao, VendorLicenseModelEntity.ENTITY_TYPE);
+ VersioningUtil.validateEntitiesExistence(featureGroup.getEntitlementPoolIds(),
+ new EntitlementPoolEntity(featureGroup.getVendorLicenseModelId(), activeVersion, null),
+ entitlementPoolDao, VendorLicenseModelEntity.ENTITY_TYPE);
+ UniqueValueUtil.validateUniqueValue(VendorLicenseConstants.UniqueValues.FEATURE_GROUP_NAME,
+ featureGroup.getVendorLicenseModelId(), featureGroup.getVersion().toString(),
+ featureGroup.getName());
+
+ if (featureGroup.getLicenseKeyGroupIds() != null) {
+ for (String addedLkgId : featureGroup.getLicenseKeyGroupIds()) {
+ licenseKeyGroupDao.addReferencingFeatureGroup(
+ new LicenseKeyGroupEntity(featureGroup.getVendorLicenseModelId(), activeVersion,
+ addedLkgId), featureGroup.getId());
+ }
+ }
+
+ if (featureGroup.getEntitlementPoolIds() != null) {
+ for (String addedEpId : featureGroup.getEntitlementPoolIds()) {
+ entitlementPoolDao.addReferencingFeatureGroup(
+ new EntitlementPoolEntity(featureGroup.getVendorLicenseModelId(), activeVersion,
+ addedEpId), featureGroup.getId());
+ }
+ }
+
+ featureGroupDao.create(featureGroup);
+ UniqueValueUtil.createUniqueValue(VendorLicenseConstants.UniqueValues.FEATURE_GROUP_NAME,
+ featureGroup.getVendorLicenseModelId(), featureGroup.getVersion().toString(),
+ featureGroup.getName());
+
+ updateVlmLastModificationTime(featureGroup.getVendorLicenseModelId(),
+ featureGroup.getVersion());
+
+ return featureGroup;
+ }
+
+
+ @Override
+ public Collection<ErrorCode> validateLicensingData(String vlmId, Version version,
+ String licenseAgreementId,
+ Collection<String> featureGroupIds) {
+ try {
+ VersionInfo versionInfo = getVersionInfo(vlmId, VersionableEntityAction.Read, "");
+ if (version == null || !version.isFinal()
+ || !versionInfo.getViewableVersions().contains(version)) {
+ return Collections.singletonList(new RequestedVersionInvalidErrorBuilder().build());
+ }
+ } catch (CoreException coreException) {
+ return Collections.singletonList(coreException.code());
+ }
+
+ List<ErrorCode> errorMessages = new ArrayList<>();
+
+ try {
+ getLicenseAgreement(vlmId, licenseAgreementId, version);
+ } catch (CoreException coreException) {
+ errorMessages.add(coreException.code());
+ }
+
+ for (String featureGroupId : featureGroupIds) {
+ try {
+ FeatureGroupEntity featureGroup =
+ getFeatureGroup(new FeatureGroupEntity(vlmId, version, featureGroupId));
+ if (!featureGroup.getReferencingLicenseAgreements().contains(licenseAgreementId)) {
+ errorMessages.add(new VersionableSubEntityNotFoundErrorBuilder(
+ featureGroup.getEntityType(),
+ featureGroupId,
+ LicenseAgreementEntity.ENTITY_TYPE,
+ licenseAgreementId,
+ version).build());
+ }
+ } catch (CoreException coreException) {
+ errorMessages.add(coreException.code());
+ }
+ }
+
+ return errorMessages;
+ }
+
+ @Override
+ public void updateVlmLastModificationTime(String vendorLicenseModelId, Version version) {
+ VendorLicenseModelEntity retrieved =
+ vendorLicenseModelDao.get(new VendorLicenseModelEntity(vendorLicenseModelId, version));
+ vendorLicenseModelDao.update(retrieved);
+ // entity.setLastModificationTime(new Date());
+ //
+ // vendorLicenseModelDao.updateLastModificationTime(entity);
+ }
+
+ private void validateCompletedVendorLicenseModel(String vendorLicenseModelId, String user) {
+ Version activeVersion =
+ getVersionInfo(vendorLicenseModelId, VersionableEntityAction.Read, user).getActiveVersion();
+ Collection<LicenseAgreementEntity> licenseAgreements = licenseAgreementDao
+ .list(new LicenseAgreementEntity(vendorLicenseModelId, activeVersion, null));
+
+ if (licenseAgreements == null || licenseAgreements.isEmpty()) {
+ throw new CoreException(
+ new SubmitUncompletedLicenseModelErrorBuilder(vendorLicenseModelId).build());
+ }
+
+ for (LicenseAgreementEntity licenseAgreement : licenseAgreements) {
+ if (licenseAgreement.getFeatureGroupIds() == null
+ || licenseAgreement.getFeatureGroupIds().isEmpty()) {
+ throw new CoreException(
+ new SubmitUncompletedLicenseModelErrorBuilder(vendorLicenseModelId).build());
+ }
+ }
+
+ Collection<FeatureGroupEntity> featureGroupEntities = featureGroupDao
+ .list(new FeatureGroupEntity(vendorLicenseModelId, activeVersion, null));
+ for (FeatureGroupEntity featureGroupEntity : featureGroupEntities) {
+ if (featureGroupEntity.getEntitlementPoolIds() == null
+ || featureGroupEntity.getEntitlementPoolIds().isEmpty()) {
+ throw new CoreException(
+ new SubmitUncompletedLicenseModelErrorBuilder(vendorLicenseModelId).build());
+ }
+ }
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/healing/impl/SimpleHealingServiceImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/healing/impl/SimpleHealingServiceImpl.java
new file mode 100644
index 0000000000..8f8f34e471
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/healing/impl/SimpleHealingServiceImpl.java
@@ -0,0 +1,63 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.healing.impl;
+
+import org.openecomp.sdc.vendorlicense.dao.EntitlementPoolDao;
+import org.openecomp.sdc.vendorlicense.dao.EntitlementPoolDaoFactory;
+import org.openecomp.sdc.vendorlicense.dao.LicenseKeyGroupDao;
+import org.openecomp.sdc.vendorlicense.dao.LicenseKeyGroupDaoFactory;
+import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity;
+import org.openecomp.sdc.vendorlicense.healing.HealingService;
+import org.openecomp.sdc.versioning.dao.types.VersionableEntity;
+
+public class SimpleHealingServiceImpl implements HealingService {
+ private static final EntitlementPoolDao entitlementPoolDao =
+ EntitlementPoolDaoFactory.getInstance().createInterface();
+ private static final LicenseKeyGroupDao licenseKeyGroupDao =
+ LicenseKeyGroupDaoFactory.getInstance().createInterface();
+
+ @Override
+ public VersionableEntity heal(VersionableEntity toHeal, String user) {
+ return handleMissingVersionId(toHeal, user);
+ }
+
+ private VersionableEntity handleMissingVersionId(VersionableEntity toHeal, String user) {
+ if (toHeal.getVersionUuId() != null) {
+ return toHeal;
+ }
+
+
+ if (toHeal instanceof EntitlementPoolEntity) {
+ toHeal.setVersionUuId(toHeal.getId());
+ entitlementPoolDao.update((EntitlementPoolEntity) toHeal);
+ } else if (toHeal instanceof LicenseKeyGroupEntity) {
+ toHeal.setVersionUuId(toHeal.getId());
+ licenseKeyGroupDao.update((LicenseKeyGroupEntity) toHeal);
+ } else {
+ throw new UnsupportedOperationException(
+ "Unsupported operation for 1610 release/1607->1610 migration.");
+ //todo maybe errorbuilder?
+ }
+ return toHeal;
+ }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/VendorLicenseArtifactsServiceImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/VendorLicenseArtifactsServiceImpl.java
new file mode 100644
index 0000000000..2f11b75a98
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/VendorLicenseArtifactsServiceImpl.java
@@ -0,0 +1,200 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.licenseartifacts.impl;
+
+import org.apache.commons.collections4.MultiValuedMap;
+import org.apache.commons.collections4.multimap.ArrayListValuedHashMap;
+import org.openecomp.core.utilities.file.FileContentHandler;
+import org.openecomp.sdc.vendorlicense.HealingServiceFactory;
+import org.openecomp.sdc.vendorlicense.VendorLicenseConstants;
+import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupModel;
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity;
+import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacade;
+import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacadeFactory;
+import org.openecomp.sdc.vendorlicense.healing.HealingService;
+import org.openecomp.sdc.vendorlicense.licenseartifacts.VendorLicenseArtifactsService;
+import org.openecomp.sdc.vendorlicense.licenseartifacts.impl.types.VendorLicenseArtifact;
+import org.openecomp.sdc.vendorlicense.licenseartifacts.impl.types.VnfLicenseArtifact;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.dao.types.VersionableEntity;
+import org.openecomp.sdc.versioning.types.VersionInfo;
+import org.openecomp.sdc.versioning.types.VersionableEntityAction;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+public class VendorLicenseArtifactsServiceImpl implements VendorLicenseArtifactsService {
+
+ private static final VendorLicenseFacade vendorLicenseFacade = VendorLicenseFacadeFactory
+ .getInstance().createInterface();
+ private static final HealingService healingService = HealingServiceFactory
+ .getInstance().createInterface();
+
+ /**
+ * Create License Artifacts.
+ *
+ * @param vspId the vsp id
+ * @param vlmId the vlm id
+ * @param vlmVersion the vlm version
+ * @param featureGroups the feature groups
+ * @param user the user
+ * @return FileContentHandler
+ */
+ public FileContentHandler createLicenseArtifacts(String vspId, String vlmId,
+ Version vlmVersion,
+ List<String> featureGroups, String user) {
+ FileContentHandler artifacts = new FileContentHandler();
+ String vendorName = getVendorName(vlmId, user);
+
+ artifacts.addFile(VendorLicenseConstants.VNF_ARTIFACT_NAME_WITH_PATH,
+ createVnfArtifact(vspId, vlmId, vlmVersion, vendorName, featureGroups, user));
+ artifacts.addFile(VendorLicenseConstants.VENDOR_LICENSE_MODEL_ARTIFACT_NAME_WITH_PATH,
+ createVendorLicenseArtifact(vlmId, vendorName, user));
+
+ return artifacts;
+ }
+
+ static byte[] createVnfArtifact(
+ String vspId, String vlmId, Version vlmVersion,
+ String vendorName, List<String> featureGroups,
+ String user) {
+ VnfLicenseArtifact artifact = new VnfLicenseArtifact();
+
+ artifact.setVspId(vspId);
+ artifact.setVendorName(vendorName);
+ for (String featureGroupId : featureGroups) {
+ FeatureGroupModel featureGroupModel =
+ vendorLicenseFacade.getFeatureGroupModel(new FeatureGroupEntity(
+ vlmId, vlmVersion, featureGroupId), user);
+ Set<EntitlementPoolEntity> entitlementPoolEntities = featureGroupModel.getEntitlementPools();
+ Set<LicenseKeyGroupEntity> licenseKeyGroupEntities = featureGroupModel.getLicenseKeyGroups();
+
+ featureGroupModel.setEntitlementPools(
+ entitlementPoolEntities.stream()
+ .map(entitlementPoolEntity -> (EntitlementPoolEntity) healingService
+ .heal(entitlementPoolEntity, user))
+ .collect(Collectors.toSet()));
+ featureGroupModel.setLicenseKeyGroups(
+ licenseKeyGroupEntities.stream()
+ .map(licenseKeyGroupEntity -> (LicenseKeyGroupEntity) healingService
+ .heal(licenseKeyGroupEntity, user))
+ .collect(Collectors.toSet()));
+ artifact.getFeatureGroups().add(featureGroupModel);
+ }
+
+ return artifact.toXml().getBytes();
+ }
+
+
+ static byte[] createVendorLicenseArtifact(String vlmId, String vendorName, String user) {
+ VendorLicenseArtifact vendorLicenseArtifact = new VendorLicenseArtifact();
+ vendorLicenseArtifact.setVendorName(vendorName);
+ Set<EntitlementPoolEntity> entitlementPoolEntities = new HashSet<>();
+ Set<LicenseKeyGroupEntity> licenseKeyGroupEntities = new HashSet<>();
+
+ List<Version> finalVersions = getFinalVersionsForVlm(vlmId);
+ for (Version finalVersion : finalVersions) {
+ entitlementPoolEntities.addAll(
+ vendorLicenseFacade.listEntitlementPools(vlmId, finalVersion, user));
+ licenseKeyGroupEntities.addAll(
+ vendorLicenseFacade.listLicenseKeyGroups(vlmId, finalVersion, user));
+ }
+
+
+ entitlementPoolEntities = healEPs(user, filterChangedEntities(entitlementPoolEntities));
+ licenseKeyGroupEntities = healLkgs(user, filterChangedEntities(licenseKeyGroupEntities));
+
+ vendorLicenseArtifact.setEntitlementPoolEntities(entitlementPoolEntities);
+ vendorLicenseArtifact.setLicenseKeyGroupEntities(licenseKeyGroupEntities);
+ return vendorLicenseArtifact.toXml().getBytes();
+ }
+
+ private static List<VersionableEntity> filterChangedEntities(
+ Collection<? extends VersionableEntity> versionableEntities) {
+ MultiValuedMap<String, VersionableEntity> entitiesById = mapById(versionableEntities);
+ Map<String, VersionableEntity> entitiesByVersionUuId = new HashMap<>();
+ List<VersionableEntity> changedOnly = new ArrayList<>();
+
+ for (String epId : entitiesById.keySet()) {
+ Collection<VersionableEntity> versionableEntitiesForId = entitiesById.get(epId);
+ for (VersionableEntity ep : versionableEntitiesForId) {
+ entitiesByVersionUuId.put(ep.getVersionUuId(), ep);
+ }
+ }
+
+ changedOnly.addAll(entitiesByVersionUuId.values());
+
+ return changedOnly;
+ }
+
+ private static MultiValuedMap<String, VersionableEntity> mapById(
+ Collection<? extends VersionableEntity> versionableEntities) {
+ MultiValuedMap<String, VersionableEntity> mappedById = new ArrayListValuedHashMap<>();
+ for (VersionableEntity ve : versionableEntities) {
+ mappedById.put(ve.getId(), ve);
+ }
+ return mappedById;
+ }
+
+
+ private static Set<LicenseKeyGroupEntity> healLkgs(
+ String user, Collection<? extends VersionableEntity> licenseKeyGroupEntities) {
+ Set<LicenseKeyGroupEntity> healed = new HashSet<>();
+ for (VersionableEntity licenseKeyGroupEntity : licenseKeyGroupEntities) {
+ healed.add((LicenseKeyGroupEntity) healingService.heal(licenseKeyGroupEntity, user));
+ }
+
+ return healed;
+ }
+
+ private static Set<EntitlementPoolEntity> healEPs(
+ String user, Collection<? extends VersionableEntity> entitlementPoolEntities) {
+ Set<EntitlementPoolEntity> healed = new HashSet<>();
+ for (VersionableEntity entitlementPoolEntity : entitlementPoolEntities) {
+ healed.add((EntitlementPoolEntity) healingService.heal(entitlementPoolEntity, user));
+ }
+
+ return healed;
+ }
+
+ private static List<Version> getFinalVersionsForVlm(String vlmId) {
+ VersionInfo versionInfo = vendorLicenseFacade
+ .getVersionInfo(vlmId, VersionableEntityAction.Read, "");
+ return versionInfo.getFinalVersions();
+
+ }
+
+
+ private static String getVendorName(String vendorLicenseModelId, String user) {
+ return vendorLicenseFacade
+ .getVendorLicenseModel(vendorLicenseModelId, null, user)
+ .getVendorLicenseModel().getVendorName();
+ }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/FeatureGroupForArtifact.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/FeatureGroupForArtifact.java
new file mode 100644
index 0000000000..6dddb9ac69
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/FeatureGroupForArtifact.java
@@ -0,0 +1,60 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.licenseartifacts.impl.types;
+
+import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+public class FeatureGroupForArtifact {
+ Collection<EntitlementPoolEntity> entitlementPoolEntities = new ArrayList<>();
+ Collection<LicenseKeyGroupEntity> licenseKeyGroupEntities = new ArrayList<>();
+ private String name;
+ private String description;
+ private String partNumber;
+ private String id;
+
+ public String getName() {
+ return name;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public String getPartNumber() {
+ return partNumber;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public Collection<EntitlementPoolEntity> getEntitlementPoolEntities() {
+ return entitlementPoolEntities;
+ }
+
+ public Collection<LicenseKeyGroupEntity> getLicenseKeyGroupEntities() {
+ return licenseKeyGroupEntities;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/VendorLicenseArtifact.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/VendorLicenseArtifact.java
new file mode 100644
index 0000000000..589b7fa668
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/VendorLicenseArtifact.java
@@ -0,0 +1,80 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.licenseartifacts.impl.types;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity;
+import org.openecomp.sdc.vendorlicense.licenseartifacts.impl.types.mixins.MixinEntitlementPoolEntityForVendorLicenseArtifact;
+import org.openecomp.sdc.vendorlicense.licenseartifacts.impl.types.mixins.MixinLicenseKeyGroupEntityForVendorLicenseArtifact;
+
+import java.util.Collection;
+
+@JacksonXmlRootElement(localName = "vendor-license-model",
+ namespace = "http://xmlns.openecomp.org/asdc/license-model/1.0")
+public class VendorLicenseArtifact extends XmlArtifact {
+ @JsonProperty(value = "vendor-name")
+ String vendorName;
+
+ Collection<EntitlementPoolEntity> entitlementPoolEntities;
+ Collection<LicenseKeyGroupEntity> licenseKeyGroupEntities;
+
+ public String getVendorName() {
+ return vendorName;
+ }
+
+ public void setVendorName(String vendorName) {
+ this.vendorName = vendorName;
+ }
+
+ @JacksonXmlProperty(isAttribute = false, localName = "entitlement-pool")
+ @JacksonXmlElementWrapper(localName = "entitlement-pool-list")
+ public Collection<EntitlementPoolEntity> getEntitlementPoolEntities() {
+ return entitlementPoolEntities;
+ }
+
+ public void setEntitlementPoolEntities(
+ Collection<EntitlementPoolEntity> entitlementPoolEntities) {
+ this.entitlementPoolEntities = entitlementPoolEntities;
+ }
+
+ @JacksonXmlProperty(isAttribute = false, localName = "license-key-group")
+ @JacksonXmlElementWrapper(localName = "license-key-group-list")
+ public Collection<LicenseKeyGroupEntity> getLicenseKeyGroupEntities() {
+ return licenseKeyGroupEntities;
+ }
+
+ public void setLicenseKeyGroupEntities(
+ Collection<LicenseKeyGroupEntity> licenseKeyGroupEntities) {
+ this.licenseKeyGroupEntities = licenseKeyGroupEntities;
+ }
+
+ @Override
+ void initMapper() {
+ xmlMapper.addMixIn(EntitlementPoolEntity.class,
+ MixinEntitlementPoolEntityForVendorLicenseArtifact.class);
+ xmlMapper.addMixIn(LicenseKeyGroupEntity.class,
+ MixinLicenseKeyGroupEntityForVendorLicenseArtifact.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/VnfLicenseArtifact.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/VnfLicenseArtifact.java
new file mode 100644
index 0000000000..1f8607765a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/VnfLicenseArtifact.java
@@ -0,0 +1,97 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.licenseartifacts.impl.types;
+
+import com.ctc.wstx.api.WstxInputProperties;
+import com.ctc.wstx.stax.WstxInputFactory;
+import com.ctc.wstx.stax.WstxOutputFactory;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.dataformat.xml.XmlFactory;
+import com.fasterxml.jackson.dataformat.xml.XmlMapper;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupModel;
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity;
+import org.openecomp.sdc.vendorlicense.licenseartifacts.impl.types.mixins.MixinEntitlementPoolEntityForVnfArtifact;
+import org.openecomp.sdc.vendorlicense.licenseartifacts.impl.types.mixins.MixinFeatureGroupModel;
+import org.openecomp.sdc.vendorlicense.licenseartifacts.impl.types.mixins.MixinLicenseKeyGroupEntityForVnfArtifact;
+
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+@JacksonXmlRootElement(localName = "vf-license-model",
+ namespace = "http://xmlns.openecomp.org/asdc/license-model/1.0")
+public class VnfLicenseArtifact extends XmlArtifact {
+ @JsonProperty(value = "vendor-name")
+ String vendorName;
+ @JsonProperty(value = "vf-id")
+ String vspId;
+ List<FeatureGroupModel> featureGroups = new ArrayList<>();
+
+ public String getVspId() {
+ return vspId;
+ }
+
+ public void setVspId(String vspId) {
+ this.vspId = vspId;
+ }
+
+ public String getVendorName() {
+ return vendorName;
+ }
+
+ public void setVendorName(String vendorName) {
+ this.vendorName = vendorName;
+ }
+
+ @JacksonXmlProperty(isAttribute = false, localName = "feature-group")
+ @JacksonXmlElementWrapper(localName = "feature-group-list")
+ public List<FeatureGroupModel> getFeatureGroups() {
+ return featureGroups;
+ }
+
+ public void setFeatureGroups(List<FeatureGroupModel> featureGroups) {
+ this.featureGroups = featureGroups;
+ }
+
+ void initMapper() {
+ WstxOutputFactory wstxOutputFactory = new WstxOutputFactory() {
+ @Override
+ public XMLStreamWriter createXMLStreamWriter(Writer writer) throws XMLStreamException {
+ mConfig.setProperty(WstxInputProperties.P_RETURN_NULL_FOR_DEFAULT_NAMESPACE, true);
+ return super.createXMLStreamWriter(writer);
+ }
+ };
+ XmlFactory factory = new XmlFactory(new WstxInputFactory(), wstxOutputFactory);
+
+ xmlMapper = new XmlMapper(factory);
+
+
+ xmlMapper.addMixIn(EntitlementPoolEntity.class, MixinEntitlementPoolEntityForVnfArtifact.class);
+ xmlMapper.addMixIn(LicenseKeyGroupEntity.class, MixinLicenseKeyGroupEntityForVnfArtifact.class);
+ xmlMapper.addMixIn(FeatureGroupModel.class, MixinFeatureGroupModel.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/XmlArtifact.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/XmlArtifact.java
new file mode 100644
index 0000000000..78d5e22412
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/XmlArtifact.java
@@ -0,0 +1,54 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.licenseartifacts.impl.types;
+
+import com.fasterxml.jackson.dataformat.xml.XmlMapper;
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.vendorlicense.VendorLicenseConstants;
+import org.openecomp.sdc.vendorlicense.errors.JsonErrorBuilder;
+
+public abstract class XmlArtifact {
+
+ XmlMapper xmlMapper = new XmlMapper();
+
+ abstract void initMapper();
+
+ /**
+ * To xml string.
+ *
+ * @return the string
+ */
+ public String toXml() {
+ initMapper();
+ String xml = "";
+
+ try {
+ xml = xmlMapper.writeValueAsString(this);
+ } catch (com.fasterxml.jackson.core.JsonProcessingException jsonProcessingException) {
+ throw new CoreException(new JsonErrorBuilder(jsonProcessingException.getMessage()).build());
+
+ }
+
+ return xml.replaceAll(VendorLicenseConstants.VENDOR_LICENSE_MODEL_ARTIFACT_REGEX_REMOVE, "");
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinEntitlementPoolEntityForVendorLicenseArtifact.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinEntitlementPoolEntityForVendorLicenseArtifact.java
new file mode 100644
index 0000000000..1458fa80a7
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinEntitlementPoolEntityForVendorLicenseArtifact.java
@@ -0,0 +1,100 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.licenseartifacts.impl.types.mixins;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import org.openecomp.sdc.vendorlicense.dao.types.AggregationFunction;
+import org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther;
+import org.openecomp.sdc.vendorlicense.dao.types.EntitlementMetric;
+import org.openecomp.sdc.vendorlicense.dao.types.EntitlementTime;
+import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope;
+import org.openecomp.sdc.vendorlicense.dao.types.xml.AggregationFunctionForXml;
+import org.openecomp.sdc.vendorlicense.dao.types.xml.EntitlementMetricForXml;
+import org.openecomp.sdc.vendorlicense.dao.types.xml.EntitlementTimeForXml;
+import org.openecomp.sdc.vendorlicense.dao.types.xml.ThresholdForXml;
+
+import java.util.Set;
+
+public abstract class MixinEntitlementPoolEntityForVendorLicenseArtifact {
+ @JsonProperty(value = "threshold-value")
+ abstract ThresholdForXml getThresholdForArtifact();
+
+ @JsonProperty(value = "entitlement-pool-uuid")
+ abstract String getVersionUuId();
+
+ @JsonProperty(value = "manufacturer-reference-number")
+ abstract String getManufacturerReferenceNumber();
+
+ @JsonIgnore
+ abstract Set<String> getReferencingFeatureGroups();
+
+ @JsonIgnore
+ abstract String getFirstClassCitizenId();
+
+ @JsonIgnore
+ abstract String getId();
+
+ @JsonIgnore
+ abstract String getVersion();
+
+ @JsonIgnore
+ abstract String getVendorLicenseModelId();
+
+ @JsonIgnore
+ abstract String getThresholdUnit();
+
+ @JsonIgnore
+ abstract float getThresholdValue();
+
+ @JsonIgnore
+ abstract ChoiceOrOther<EntitlementMetric> getEntitlementMetric();
+
+ @JsonIgnore
+ abstract ChoiceOrOther<EntitlementTime> getTime();
+
+ @JsonIgnore
+ abstract ChoiceOrOther<AggregationFunction> getAggregationFunction();
+
+ @JsonIgnore
+ abstract String getEntityType();
+
+ @JacksonXmlProperty(isAttribute = false, localName = "value")
+ @JacksonXmlElementWrapper(localName = "operational-scope")
+ abstract String getOperationalScopeForArtifact();
+
+ @JsonIgnore
+ abstract ChoiceOrOther<OperationalScope> getOperationalScope();
+
+
+ @JsonProperty(value = "entitlement-metric")
+ abstract EntitlementMetricForXml getEntitlementMetricForArtifact();
+
+ @JsonProperty(value = "time")
+ abstract EntitlementTimeForXml getTimeForArtifact();
+
+
+ @JsonProperty(value = "aggregation-function")
+ abstract AggregationFunctionForXml getAggregationFunctionForArtifact();
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinEntitlementPoolEntityForVnfArtifact.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinEntitlementPoolEntityForVnfArtifact.java
new file mode 100644
index 0000000000..c4f2b4d4bd
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinEntitlementPoolEntityForVnfArtifact.java
@@ -0,0 +1,100 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.licenseartifacts.impl.types.mixins;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import org.openecomp.sdc.vendorlicense.dao.types.AggregationFunction;
+import org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther;
+import org.openecomp.sdc.vendorlicense.dao.types.EntitlementMetric;
+import org.openecomp.sdc.vendorlicense.dao.types.EntitlementTime;
+import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope;
+import org.openecomp.sdc.vendorlicense.dao.types.xml.AggregationFunctionForXml;
+import org.openecomp.sdc.vendorlicense.dao.types.xml.EntitlementMetricForXml;
+import org.openecomp.sdc.vendorlicense.dao.types.xml.EntitlementTimeForXml;
+import org.openecomp.sdc.vendorlicense.dao.types.xml.ThresholdForXml;
+
+import java.util.Set;
+
+public abstract class MixinEntitlementPoolEntityForVnfArtifact {
+ @JsonProperty(value = "threshold-value")
+ abstract ThresholdForXml getThresholdForArtifact();
+
+ @JsonIgnore
+ abstract String getId();
+
+ @JsonProperty(value = "manufacturer-reference-number")
+ abstract String getManufacturerReferenceNumber();
+
+ @JsonIgnore
+ abstract Set<String> getReferencingFeatureGroups();
+
+ @JsonIgnore
+ abstract String getFirstClassCitizenId();
+
+ @JsonProperty(value = "entitlement-pool-uuid")
+ abstract String getVersionUuId();
+
+ @JsonIgnore
+ abstract String getVersion();
+
+ @JsonIgnore
+ abstract String getVendorLicenseModelId();
+
+ @JsonIgnore
+ abstract String getThresholdUnit();
+
+ @JsonIgnore
+ abstract float getThresholdValue();
+
+ @JsonIgnore
+ abstract ChoiceOrOther<EntitlementMetric> getEntitlementMetric();
+
+ @JsonIgnore
+ abstract ChoiceOrOther<EntitlementTime> getTime();
+
+ @JsonIgnore
+ abstract ChoiceOrOther<AggregationFunction> getAggregationFunction();
+
+ @JsonIgnore
+ abstract String getEntityType();
+
+ @JacksonXmlProperty(isAttribute = false, localName = "value")
+ @JacksonXmlElementWrapper(localName = "operational-scope")
+ abstract String getOperationalScopeForArtifact();
+
+ @JsonIgnore
+ abstract ChoiceOrOther<OperationalScope> getOperationalScope();
+
+
+ @JsonProperty(value = "entitlement-metric")
+ abstract EntitlementMetricForXml getEntitlementMetricForArtifact();
+
+ @JsonProperty(value = "time")
+ abstract EntitlementTimeForXml getTimeForArtifact();
+
+
+ @JsonProperty(value = "aggregation-function")
+ abstract AggregationFunctionForXml getAggregationFunctionForArtifact();
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinFeatureGroupEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinFeatureGroupEntity.java
new file mode 100644
index 0000000000..be6bd61357
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinFeatureGroupEntity.java
@@ -0,0 +1,62 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.licenseartifacts.impl.types.mixins;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.util.Set;
+
+public abstract class MixinFeatureGroupEntity {
+
+ @JsonIgnore
+ abstract String getVendorLicenseModelId();
+
+ @JsonIgnore
+ abstract String getEntityType();
+
+
+ @JsonIgnore
+ abstract Version getVersion();
+
+ @JsonIgnore
+ abstract String getId();
+
+ @JsonIgnore
+ abstract String getName();
+
+ @JsonIgnore
+ abstract String getDescription();
+
+ @JsonIgnore
+ abstract String getPartNumber();
+
+ @JsonIgnore
+ abstract Set<String> getLicenseKeyGroupIds();
+
+ @JsonIgnore
+ abstract Set<String> getEntitlementPoolIds();
+
+
+ @JsonIgnore
+ abstract Set<String> getReferencingLicenseAgreements();
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinFeatureGroupModel.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinFeatureGroupModel.java
new file mode 100644
index 0000000000..1e76a74f4c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinFeatureGroupModel.java
@@ -0,0 +1,61 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.licenseartifacts.impl.types.mixins;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity;
+
+import java.util.Set;
+
+public abstract class MixinFeatureGroupModel {
+ @JacksonXmlProperty(isAttribute = false, localName = "entitlement-pool")
+ @JacksonXmlElementWrapper(localName = "entitlement-pool-list")
+ abstract Set<EntitlementPoolEntity> getEntitlementPools();
+
+ @JacksonXmlProperty(isAttribute = false, localName = "license-key-group")
+ @JacksonXmlElementWrapper(localName = "license-key-group-list")
+ abstract Set<LicenseKeyGroupEntity> getLicenseKeyGroups();
+
+ @JacksonXmlProperty(isAttribute = false, localName = "internal-part-number")
+ abstract String getEntityPartNumber();
+
+ @JacksonXmlProperty(isAttribute = false, localName = "feature-group-uuid")
+ abstract String getEntityId();
+
+ @JacksonXmlProperty(isAttribute = false, localName = "description")
+ abstract String getEntityDesc();
+
+ @JacksonXmlProperty(isAttribute = false, localName = "name")
+ abstract String getEntityName();
+
+
+ @JsonIgnore
+ abstract FeatureGroupEntity getFeatureGroup();
+
+ @JsonIgnore
+ abstract String getEntityType();
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinLicenseKeyGroupEntityForVendorLicenseArtifact.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinLicenseKeyGroupEntityForVendorLicenseArtifact.java
new file mode 100644
index 0000000000..ed3083afe3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinLicenseKeyGroupEntityForVendorLicenseArtifact.java
@@ -0,0 +1,72 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.licenseartifacts.impl.types.mixins;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther;
+import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope;
+import org.openecomp.sdc.vendorlicense.dao.types.xml.LicenseKeyTypeForXml;
+
+import java.util.Set;
+
+public abstract class MixinLicenseKeyGroupEntityForVendorLicenseArtifact {
+ @JsonProperty(value = "license-key-group-uuid")
+ abstract String getVersionUuId();
+
+ @JsonIgnore
+ abstract Set<String> getReferencingFeatureGroups();
+
+ @JsonIgnore
+ abstract String getVersion();
+
+ @JsonIgnore
+ abstract String getVendorLicenseModelId();
+
+
+ @JsonIgnore
+ abstract String getEntityType();
+
+ @JsonIgnore
+ abstract String getFirstClassCitizenId();
+
+ @JsonIgnore
+ abstract String getId();
+
+
+ @JsonIgnore
+ abstract ChoiceOrOther<OperationalScope> getOperationalScope();
+
+ @JacksonXmlProperty(isAttribute = false, localName = "value")
+ @JacksonXmlElementWrapper(localName = "operational-scope")
+ abstract String getOperationalScopeForArtifact();
+
+
+ @JsonIgnore
+ abstract LicenseKeyTypeForXml getTypeForArtifact();
+
+ @JsonIgnore
+ abstract String getVersionableId();
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinLicenseKeyGroupEntityForVnfArtifact.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinLicenseKeyGroupEntityForVnfArtifact.java
new file mode 100644
index 0000000000..6281c44830
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinLicenseKeyGroupEntityForVnfArtifact.java
@@ -0,0 +1,74 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.licenseartifacts.impl.types.mixins;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther;
+import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope;
+import org.openecomp.sdc.vendorlicense.dao.types.xml.LicenseKeyTypeForXml;
+
+import java.util.Set;
+
+public abstract class MixinLicenseKeyGroupEntityForVnfArtifact {
+ @JsonIgnore
+ abstract String getId();
+
+ @JsonIgnore
+ abstract Set<String> getReferencingFeatureGroups();
+
+ @JsonIgnore
+ abstract String getVersion();
+
+ @JsonIgnore
+ abstract String getVendorLicenseModelId();
+
+
+ @JsonIgnore
+ abstract String getEntityType();
+
+ @JsonProperty(value = "license-key-group-uuid")
+ abstract String getVersionUuId();
+
+ @JsonIgnore
+ abstract String getFirstClassCitizenId();
+
+
+
+ @JsonIgnore
+ abstract ChoiceOrOther<OperationalScope> getOperationalScope();
+
+ @JacksonXmlProperty(isAttribute = false, localName = "value")
+ @JacksonXmlElementWrapper(localName = "operational-scope")
+ abstract String getOperationalScopeForArtifact();
+
+
+ @JsonIgnore
+ abstract LicenseKeyTypeForXml getTypeForArtifact();
+
+ @JsonIgnore
+ abstract String getVersionableId();
+
+
+}
+
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/pom.xml b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/pom.xml
new file mode 100644
index 0000000000..5b1cef8ef7
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/pom.xml
@@ -0,0 +1,24 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <artifactId>openecomp-sdc-lib</artifactId>
+ <groupId>org.openecomp.sdc</groupId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <name>openecomp-sdc-vendor-license-lib</name>
+ <artifactId>openecomp-sdc-vendor-license-lib</artifactId>
+
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>openecomp-sdc-vendor-license-api</module>
+ <module>openecomp-sdc-vendor-license-core</module>
+ </modules>
+
+ <dependencies>
+
+ </dependencies>
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/pom.xml b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/pom.xml
new file mode 100644
index 0000000000..100e85536d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/pom.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-vendor-software-product-lib</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>openecomp-sdc-vendor-software-product-api</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <version>2.3.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-core-lib</artifactId>
+ <type>pom</type>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-facade-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-nosqldb-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-versioning-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-translator-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-enrichment-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-model-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+
+
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductConstants.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductConstants.java
new file mode 100644
index 0000000000..860ef5fd41
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductConstants.java
@@ -0,0 +1,38 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct;
+
+public final class VendorSoftwareProductConstants {
+ public static final String VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE = "VendorSoftwareProduct";
+ public static final String GENERAL_COMPONENT_ID = "General";
+ public static final String VSP_PACKAGE_ZIP = "VSPPackage.zip";
+ public static final String CSAR = "CSAR";
+ public static final String UPLOAD_RAW_DATA = "UPLOAD_RAW_DATA";
+
+ public final class UniqueValues {
+ public static final String VENDOR_SOFTWARE_PRODUCT_NAME = "Vendor Software Product name";
+ public static final String PROCESS_NAME = "Process name";
+ public static final String NETWORK_NAME = "Network name";
+ public static final String COMPONENT_NAME = "ComponentData name";
+ public static final String NIC_NAME = "NIC name";
+ //public static final String COMPONENT_ARTIFACT_NAME = "ComponentArtifact name";
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ComponentArtifactDao.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ComponentArtifactDao.java
new file mode 100644
index 0000000000..d43c9687c2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ComponentArtifactDao.java
@@ -0,0 +1,40 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao;
+
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentArtifactEntity;
+import org.openecomp.sdc.versioning.dao.VersionableDao;
+
+import java.util.Collection;
+
+public interface ComponentArtifactDao extends VersionableDao {
+
+ ComponentArtifactEntity getArtifactByType(ComponentArtifactEntity entity);
+
+ void update(ComponentArtifactEntity entity);
+
+ void delete(ComponentArtifactEntity entity);
+
+ Collection<ComponentArtifactEntity> getArtifactNamesAndTypesForComponent(
+ ComponentArtifactEntity entity);
+
+ void deleteAll(ComponentArtifactEntity entity);
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ComponentArtifactDaoFactory.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ComponentArtifactDaoFactory.java
new file mode 100644
index 0000000000..56a0ec65af
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ComponentArtifactDaoFactory.java
@@ -0,0 +1,32 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+public abstract class ComponentArtifactDaoFactory
+ extends AbstractComponentFactory<ComponentArtifactDao> {
+
+ public static ComponentArtifactDaoFactory getInstance() {
+ return AbstractFactory.getInstance(ComponentArtifactDaoFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ComponentDao.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ComponentDao.java
new file mode 100644
index 0000000000..ca795b4929
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ComponentDao.java
@@ -0,0 +1,38 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao;
+
+import org.openecomp.core.dao.BaseDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
+import org.openecomp.sdc.versioning.dao.VersionableDao;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.util.Collection;
+
+public interface ComponentDao extends VersionableDao, BaseDao<ComponentEntity> {
+
+ void updateQuestionnaireData(String vspId, Version version, String componentId,
+ String questionnaireData);
+
+ Collection<ComponentEntity> listQuestionnaires(String vspId, Version version);
+
+ void deleteAll(String vspId, Version version);
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ComponentDaoFactory.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ComponentDaoFactory.java
new file mode 100644
index 0000000000..e1cf30bfb1
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ComponentDaoFactory.java
@@ -0,0 +1,31 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+public abstract class ComponentDaoFactory extends AbstractComponentFactory<ComponentDao> {
+
+ public static ComponentDaoFactory getInstance() {
+ return AbstractFactory.getInstance(ComponentDaoFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/NetworkDao.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/NetworkDao.java
new file mode 100644
index 0000000000..199e65fd83
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/NetworkDao.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao;
+
+import org.openecomp.core.dao.BaseDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity;
+import org.openecomp.sdc.versioning.dao.VersionableDao;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+public interface NetworkDao extends VersionableDao, BaseDao<NetworkEntity> {
+
+ void updateQuestionnaireData(String vspId, Version version, String id, String questionnaireData);
+
+ void deleteAll(String vspId, Version version);
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/NetworkDaoFactory.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/NetworkDaoFactory.java
new file mode 100644
index 0000000000..8db3d605e4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/NetworkDaoFactory.java
@@ -0,0 +1,31 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+public abstract class NetworkDaoFactory extends AbstractComponentFactory<NetworkDao> {
+
+ public static NetworkDaoFactory getInstance() {
+ return AbstractFactory.getInstance(NetworkDaoFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/NicDao.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/NicDao.java
new file mode 100644
index 0000000000..bbfa8bf8c0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/NicDao.java
@@ -0,0 +1,40 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao;
+
+import org.openecomp.core.dao.BaseDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity;
+import org.openecomp.sdc.versioning.dao.VersionableDao;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.util.Collection;
+
+public interface NicDao extends VersionableDao, BaseDao<NicEntity> {
+
+ void updateQuestionnaireData(String vspId, Version version, String componentId, String nicId,
+ String questionnaireData);
+
+ Collection<NicEntity> listByVsp(String vspId, Version version);
+
+ void deleteByComponentId(String vspId, Version version, String componentId);
+
+ void deleteByVspId(String vspId, Version version);
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/NicDaoFactory.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/NicDaoFactory.java
new file mode 100644
index 0000000000..b61ad6a3ca
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/NicDaoFactory.java
@@ -0,0 +1,31 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+public abstract class NicDaoFactory extends AbstractComponentFactory<NicDao> {
+
+ public static NicDaoFactory getInstance() {
+ return AbstractFactory.getInstance(NicDaoFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/PackageInfoDao.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/PackageInfoDao.java
new file mode 100644
index 0000000000..a22c725b6f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/PackageInfoDao.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao;
+
+import org.openecomp.core.dao.BaseDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.PackageInfo;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.util.List;
+
+public interface PackageInfoDao extends BaseDao<PackageInfo> {
+ List<PackageInfo> listByCategory(String category, String subCategory);
+
+ void deleteRowTranslateContent(String vspId, Version version);
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/PackageInfoDaoFactory.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/PackageInfoDaoFactory.java
new file mode 100644
index 0000000000..a8e3d6563d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/PackageInfoDaoFactory.java
@@ -0,0 +1,31 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+public abstract class PackageInfoDaoFactory extends AbstractComponentFactory<PackageInfoDao> {
+
+ public static PackageInfoDaoFactory getInstance() {
+ return AbstractFactory.getInstance(PackageInfoDaoFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ProcessArtifactDao.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ProcessArtifactDao.java
new file mode 100644
index 0000000000..5b562368b5
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ProcessArtifactDao.java
@@ -0,0 +1,32 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao;
+
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessArtifactEntity;
+
+public interface ProcessArtifactDao {
+
+ void update(ProcessArtifactEntity entity);
+
+ ProcessArtifactEntity get(ProcessArtifactEntity entity);
+
+ void delete(ProcessArtifactEntity entity);
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ProcessArtifactDaoFactory.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ProcessArtifactDaoFactory.java
new file mode 100644
index 0000000000..534777c701
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ProcessArtifactDaoFactory.java
@@ -0,0 +1,32 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+public abstract class ProcessArtifactDaoFactory
+ extends AbstractComponentFactory<ProcessArtifactDao> {
+
+ public static ProcessArtifactDaoFactory getInstance() {
+ return AbstractFactory.getInstance(ProcessArtifactDaoFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ProcessDao.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ProcessDao.java
new file mode 100644
index 0000000000..8aa3400d24
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ProcessDao.java
@@ -0,0 +1,30 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao;
+
+import org.openecomp.core.dao.BaseDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity;
+import org.openecomp.sdc.versioning.dao.VersionableDao;
+
+public interface ProcessDao extends VersionableDao, BaseDao<ProcessEntity> {
+
+ void deleteAll(ProcessEntity entity);
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ProcessDaoFactory.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ProcessDaoFactory.java
new file mode 100644
index 0000000000..f661a0ccda
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ProcessDaoFactory.java
@@ -0,0 +1,31 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+public abstract class ProcessDaoFactory extends AbstractComponentFactory<ProcessDao> {
+
+ public static ProcessDaoFactory getInstance() {
+ return AbstractFactory.getInstance(ProcessDaoFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDao.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDao.java
new file mode 100644
index 0000000000..cdc3a770db
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDao.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao;
+
+import org.openecomp.core.dao.BaseDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.UploadDataEntity;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.nio.ByteBuffer;
+
+public interface UploadDataDao extends BaseDao<UploadDataEntity> {
+
+ void deleteContentDataAndValidationData(String vspId, Version version);
+
+ ByteBuffer getContentData(String vspId, Version version);
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDaoFactory.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDaoFactory.java
new file mode 100644
index 0000000000..9654551f8f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDaoFactory.java
@@ -0,0 +1,31 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+public abstract class UploadDataDaoFactory extends AbstractComponentFactory<UploadDataDao> {
+
+ public static UploadDataDaoFactory getInstance() {
+ return AbstractFactory.getInstance(UploadDataDaoFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductDao.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductDao.java
new file mode 100644
index 0000000000..d8de3c6bd4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductDao.java
@@ -0,0 +1,140 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao;
+
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.PackageInfo;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessArtifactEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.UploadDataEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspQuestionnaireEntity;
+import org.openecomp.sdc.versioning.dao.VersionableDao;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.nio.ByteBuffer;
+import java.util.Collection;
+import java.util.List;
+
+public interface VendorSoftwareProductDao extends VersionableDao {
+
+ void createVendorSoftwareProductInfo(VspDetails vspDetails);
+
+ Collection<VspDetails> listVendorSoftwareProductsInfo();
+
+ VspDetails getVendorSoftwareProductInfo(VspDetails vspDetails);
+
+ void updateVendorSoftwareProductInfo(VspDetails vspDetails);
+
+ void deleteVendorSoftwareProductInfo(VspDetails vspDetails);
+
+
+ void updateUploadData(UploadDataEntity uploadData);
+
+ UploadDataEntity getUploadData(UploadDataEntity uploadData);
+
+ ByteBuffer getContentData(UploadDataEntity uploadDataEntity);
+
+
+ List<PackageInfo> listPackages(String category, String subCategory);
+
+ void insertPackageDetails(PackageInfo packageInfo);
+
+ PackageInfo getPackageInfo(PackageInfo packageInfo);
+
+ void deletePackageInfo(PackageInfo packageInfo);
+
+
+ Collection<NetworkEntity> listNetworks(String vspId, Version version);
+
+ void createNetwork(NetworkEntity network);
+
+ void updateNetwork(NetworkEntity network);
+
+ NetworkEntity getNetwork(String vspId, Version version, String networkId);
+
+ void deleteNetwork(String vspId, Version version);
+
+
+ Collection<ComponentEntity> listComponents(String vspId, Version version);
+
+ void createComponent(ComponentEntity component);
+
+ void updateComponent(ComponentEntity component);
+
+ ComponentEntity getComponent(String vspId, Version version, String componentId);
+
+ Collection<ComponentEntity> listComponentsQuestionnaire(String vspId, Version version);
+
+ void updateComponentQuestionnaire(String vspId, Version version, String componentId,
+ String questionnaireData);
+
+ void deleteComponent(String vspId, Version version);
+
+
+ Collection<ProcessEntity> listProcesses(String vspId, Version version, String componentId);
+
+ void deleteProcesses(String vspId, Version version, String componentId);
+
+ ProcessEntity getProcess(String vspId, Version version, String componentId, String processId);
+
+ void createProcess(ProcessEntity processEntity);
+
+ void updateProcess(ProcessEntity processEntity);
+
+ void deleteProcess(String vspId, Version version, String componentId, String processId);
+
+
+ void uploadProcessArtifact(String vspId, Version version, String componentId, String processId,
+ byte[] artifact, String artifactFileName);
+
+ ProcessArtifactEntity getProcessArtifact(String vspId, Version version, String componentId,
+ String processId);
+
+ void deleteProcessArtifact(String vspId, Version version, String componentId, String processId);
+
+
+ VspQuestionnaireEntity getQuestionnaire(String vspId, Version version);
+
+ void updateQuestionnaire(String vspId, Version version, String questionnaireData);
+
+
+ Collection<NicEntity> listNics(String vspId, Version version, String componentId);
+
+ void createNic(NicEntity nic);
+
+ void updateNic(NicEntity nicEntity);
+
+ NicEntity getNic(String vspId, Version version, String componentId, String nicId);
+
+ void updateNicQuestionnaire(String vspId, Version version, String componentId, String nicId,
+ String questionnaireData);
+
+ Collection<NicEntity> listNicsByVsp(String vspId, Version version);
+
+ void deleteNic(String vspId, Version version, String componentId);
+
+ void deleteUploadData(String vspId, Version version);
+
+ void updateVspLatestModificationTime(String vspId, Version version);
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductDaoFactory.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductDaoFactory.java
new file mode 100644
index 0000000000..33aaa8e1ad
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductDaoFactory.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+public abstract class VendorSoftwareProductDaoFactory
+ extends AbstractComponentFactory<VendorSoftwareProductDao> {
+
+
+ public static VendorSoftwareProductDaoFactory getInstance() {
+ return AbstractFactory.getInstance(VendorSoftwareProductDaoFactory.class);
+ }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductInfoDao.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductInfoDao.java
new file mode 100644
index 0000000000..74a3f69e6c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductInfoDao.java
@@ -0,0 +1,30 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao;
+
+import org.openecomp.core.dao.BaseDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
+import org.openecomp.sdc.versioning.dao.VersionableDao;
+
+public interface VendorSoftwareProductInfoDao extends VersionableDao, BaseDao<VspDetails> {
+
+// void updateLastModificationTime(VspDetails entity);
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductInfoDaoFactory.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductInfoDaoFactory.java
new file mode 100644
index 0000000000..570ddc496e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductInfoDaoFactory.java
@@ -0,0 +1,32 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+public abstract class VendorSoftwareProductInfoDaoFactory
+ extends AbstractComponentFactory<VendorSoftwareProductInfoDao> {
+
+ public static VendorSoftwareProductInfoDaoFactory getInstance() {
+ return AbstractFactory.getInstance(VendorSoftwareProductInfoDaoFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VspQuestionnaireDao.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VspQuestionnaireDao.java
new file mode 100644
index 0000000000..4658f71d2a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VspQuestionnaireDao.java
@@ -0,0 +1,32 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao;
+
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspQuestionnaireEntity;
+import org.openecomp.sdc.versioning.dao.VersionableDao;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+public interface VspQuestionnaireDao extends VersionableDao {
+
+ VspQuestionnaireEntity get(VspQuestionnaireEntity entity);
+
+ void updateQuestionnaireData(String id, Version version, String questionnaireData);
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VspQuestionnaireDaoFactory.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VspQuestionnaireDaoFactory.java
new file mode 100644
index 0000000000..afc3dc9649
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VspQuestionnaireDaoFactory.java
@@ -0,0 +1,32 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+public abstract class VspQuestionnaireDaoFactory
+ extends AbstractComponentFactory<VspQuestionnaireDao> {
+
+ public static VspQuestionnaireDaoFactory getInstance() {
+ return AbstractFactory.getInstance(VspQuestionnaireDaoFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/Action.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/Action.java
new file mode 100644
index 0000000000..3e82053574
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/Action.java
@@ -0,0 +1,27 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao.type;
+
+public enum Action {
+ CREATE_PACKAGE,
+ CHECK_IN,
+ CHECK_OUT
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ComponentArtifactEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ComponentArtifactEntity.java
new file mode 100644
index 0000000000..3636a591d4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ComponentArtifactEntity.java
@@ -0,0 +1,140 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao.type;
+
+import com.datastax.driver.mapping.annotations.ClusteringColumn;
+import com.datastax.driver.mapping.annotations.Column;
+import com.datastax.driver.mapping.annotations.Frozen;
+import com.datastax.driver.mapping.annotations.PartitionKey;
+import com.datastax.driver.mapping.annotations.Table;
+import org.openecomp.core.enrichment.types.ComponentArtifactType;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.dao.types.VersionableEntity;
+
+import java.nio.ByteBuffer;
+
+@Table(keyspace = "dox", name = "vsp_component_artifact")
+public class ComponentArtifactEntity implements VersionableEntity {
+ public static final String ENTITY_TYPE = "Vendor Software Product Component Artifact";
+ @PartitionKey
+ @Column(name = "vsp_id")
+ private String vspId;
+ @PartitionKey(value = 1)
+ @Frozen
+ private Version version;
+ @ClusteringColumn
+ @Column(name = "component_id")
+ private String componentId;
+ @ClusteringColumn(value = 1)
+ @Column(name = "artifact_type")
+ private ComponentArtifactType type;
+ @ClusteringColumn(value = 2)
+ @Column(name = "artifact_id")
+ private String id;
+ @Column(name = "name")
+ private String artifactName;
+ private ByteBuffer artifact;
+
+ public ComponentArtifactEntity() {
+
+ }
+
+ /**
+ * Instantiates a new Component artifact entity.
+ *
+ * @param vspId the vsp id
+ * @param version the version
+ * @param componentId the component id
+ * @param id the id
+ */
+ public ComponentArtifactEntity(String vspId, Version version, String componentId, String id) {
+ this.vspId = vspId;
+ this.version = version;
+ this.componentId = componentId;
+ this.id = id;
+ }
+
+ public String getVspId() {
+ return vspId;
+ }
+
+ public void setVspId(String vspId) {
+ this.vspId = vspId;
+ }
+
+ public Version getVersion() {
+ return version;
+ }
+
+ public void setVersion(Version version) {
+ this.version = version;
+ }
+
+ public String getComponentId() {
+ return componentId;
+ }
+
+ public void setComponentId(String componentId) {
+ this.componentId = componentId;
+ }
+
+ @Override
+ public String getEntityType() {
+ return ENTITY_TYPE;
+ }
+
+ @Override
+ public String getFirstClassCitizenId() {
+ return getVspId();
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getArtifactName() {
+ return artifactName;
+ }
+
+ public void setArtifactName(String artifactName) {
+ this.artifactName = artifactName;
+ }
+
+ public ByteBuffer getArtifact() {
+ return artifact;
+ }
+
+ public void setArtifact(ByteBuffer artifact) {
+ this.artifact = artifact;
+ }
+
+ public ComponentArtifactType getType() {
+ return type;
+ }
+
+ public void setType(ComponentArtifactType type) {
+ this.type = type;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ComponentEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ComponentEntity.java
new file mode 100644
index 0000000000..a74ba04ec4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ComponentEntity.java
@@ -0,0 +1,199 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao.type;
+
+import com.datastax.driver.mapping.annotations.ClusteringColumn;
+import com.datastax.driver.mapping.annotations.Column;
+import com.datastax.driver.mapping.annotations.Frozen;
+import com.datastax.driver.mapping.annotations.PartitionKey;
+import com.datastax.driver.mapping.annotations.Table;
+import com.datastax.driver.mapping.annotations.Transient;
+import org.openecomp.core.utilities.json.JsonUtil;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+@Table(keyspace = "dox", name = "vsp_component")
+public class ComponentEntity implements CompositionEntity {
+ private static final String ENTITY_TYPE = "Vendor Software Product ComponentData";
+
+ @PartitionKey
+ @Column(name = "vsp_id")
+ private String vspId;
+ @PartitionKey(value = 1)
+ @Frozen
+ private Version version;
+ @ClusteringColumn
+ @Column(name = "component_id")
+ private String id;
+ @Column(name = "composition_data")
+ private String compositionData;
+ @Column(name = "questionnaire_data")
+ private String questionnaireData;
+ @Transient
+ private List<NicEntity> nics = new ArrayList<>();
+
+ public ComponentEntity() {
+
+ }
+
+ /**
+ * Instantiates a new Component entity.
+ *
+ * @param vspId the vsp id
+ * @param version the version
+ * @param id the id
+ */
+ public ComponentEntity(String vspId, Version version, String id) {
+ this.vspId = vspId;
+ this.version = version;
+ this.id = id;
+ }
+
+ @Override
+ public CompositionEntityType getType() {
+ return CompositionEntityType.component;
+ }
+
+ @Override
+ public CompositionEntityId getCompositionEntityId() {
+ return new CompositionEntityId(getId(), new CompositionEntityId(getVspId(), null));
+ }
+
+ public String getVspId() {
+ return vspId;
+ }
+
+ public void setVspId(String vspId) {
+ this.vspId = vspId;
+ }
+
+ @Override
+ public Version getVersion() {
+ return version;
+ }
+
+ @Override
+ public void setVersion(Version version) {
+ this.version = version;
+ }
+
+ @Override
+ public String getEntityType() {
+ return ENTITY_TYPE;
+ }
+
+ @Override
+ public String getFirstClassCitizenId() {
+ return getVspId();
+ }
+
+ @Override
+ public String getId() {
+ return id;
+ }
+
+ @Override
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ @Override
+ public String getCompositionData() {
+ return compositionData;
+ }
+
+ @Override
+ public void setCompositionData(String compositionData) {
+ this.compositionData = compositionData;
+ }
+
+ public ComponentData getComponentCompositionData() {
+ return compositionData == null ? null
+ : JsonUtil.json2Object(compositionData, ComponentData.class);
+ }
+
+ public void setComponentCompositionData(ComponentData component) {
+ this.compositionData = component == null ? null : JsonUtil.object2Json(component);
+ }
+
+ @Override
+ public String getQuestionnaireData() {
+ return questionnaireData;
+ }
+
+ @Override
+ public void setQuestionnaireData(String questionnaireData) {
+ this.questionnaireData = questionnaireData;
+ }
+
+ public List<NicEntity> getNics() {
+ return nics;
+ }
+
+ public void setNics(List<NicEntity> nics) {
+ this.nics = nics;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null || getClass() != obj.getClass()) {
+ return false;
+ }
+
+ ComponentEntity that = (ComponentEntity) obj;
+
+ if (vspId != null ? !vspId.equals(that.vspId) : that.vspId != null) {
+ return false;
+ }
+ if (version != null ? !version.equals(that.version) : that.version != null) {
+ return false;
+ }
+ if (id != null ? !id.equals(that.id) : that.id != null) {
+ return false;
+ }
+ if (compositionData != null ? !compositionData.equals(that.compositionData)
+ : that.compositionData != null) {
+ return false;
+ }
+ return questionnaireData != null ? questionnaireData.equals(that.questionnaireData)
+ : that.questionnaireData == null;
+
+ }
+
+ @Override
+ public int hashCode() {
+ int result = vspId != null ? vspId.hashCode() : 0;
+ result = 31 * result + (version != null ? version.hashCode() : 0);
+ result = 31 * result + (id != null ? id.hashCode() : 0);
+ result = 31 * result + (compositionData != null ? compositionData.hashCode() : 0);
+ result = 31 * result + (questionnaireData != null ? questionnaireData.hashCode() : 0);
+ return result;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/CompositionEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/CompositionEntity.java
new file mode 100644
index 0000000000..b3e8eef3f2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/CompositionEntity.java
@@ -0,0 +1,40 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao.type;
+
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType;
+import org.openecomp.sdc.versioning.dao.types.VersionableEntity;
+
+public interface CompositionEntity extends VersionableEntity {
+
+ CompositionEntityType getType();
+
+ CompositionEntityId getCompositionEntityId();
+
+ String getCompositionData();
+
+ void setCompositionData(String compositionData);
+
+ String getQuestionnaireData();
+
+ void setQuestionnaireData(String questionnaireData);
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/NetworkEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/NetworkEntity.java
new file mode 100644
index 0000000000..1599e4a88c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/NetworkEntity.java
@@ -0,0 +1,183 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao.type;
+
+import com.datastax.driver.mapping.annotations.ClusteringColumn;
+import com.datastax.driver.mapping.annotations.Column;
+import com.datastax.driver.mapping.annotations.Frozen;
+import com.datastax.driver.mapping.annotations.PartitionKey;
+import com.datastax.driver.mapping.annotations.Table;
+import org.openecomp.core.utilities.json.JsonUtil;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+@Table(keyspace = "dox", name = "vsp_network")
+public class NetworkEntity implements CompositionEntity {
+ private static final String ENTITY_TYPE = "Vendor Software Product Network";
+
+ @PartitionKey
+ @Column(name = "vsp_id")
+ private String vspId;
+ @PartitionKey(value = 1)
+ @Frozen
+ private Version version;
+ @ClusteringColumn
+ @Column(name = "network_id")
+ private String id;
+ @Column(name = "composition_data")
+ private String compositionData;
+ @Column(name = "questionnaire_data")
+ private String questionnaireData;
+
+ public NetworkEntity() {
+
+ }
+
+ /**
+ * Instantiates a new Network entity.
+ *
+ * @param vspId the vsp id
+ * @param version the version
+ * @param id the id
+ */
+ public NetworkEntity(String vspId, Version version, String id) {
+ this.vspId = vspId;
+ this.version = version;
+ this.id = id;
+ }
+
+ @Override
+ public CompositionEntityType getType() {
+ return CompositionEntityType.network;
+ }
+
+ @Override
+ public CompositionEntityId getCompositionEntityId() {
+ return new CompositionEntityId(getId(), new CompositionEntityId(getVspId(), null));
+ }
+
+ public String getVspId() {
+ return vspId;
+ }
+
+ public void setVspId(String vspId) {
+ this.vspId = vspId;
+ }
+
+ @Override
+ public Version getVersion() {
+ return version;
+ }
+
+ @Override
+ public void setVersion(Version version) {
+ this.version = version;
+ }
+
+ @Override
+ public String getEntityType() {
+ return ENTITY_TYPE;
+ }
+
+ @Override
+ public String getFirstClassCitizenId() {
+ return getVspId();
+ }
+
+ @Override
+ public String getId() {
+ return id;
+ }
+
+ @Override
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ @Override
+ public String getCompositionData() {
+ return compositionData;
+ }
+
+ @Override
+ public void setCompositionData(String compositionData) {
+ this.compositionData = compositionData;
+ }
+
+ public Network getNetworkCompositionData() {
+ return compositionData == null ? null : JsonUtil.json2Object(compositionData, Network.class);
+ }
+
+ public void setNetworkCompositionData(Network network) {
+ this.compositionData = network == null ? null : JsonUtil.object2Json(network);
+ }
+
+ @Override
+ public String getQuestionnaireData() {
+ return questionnaireData;
+ }
+
+ @Override
+ public void setQuestionnaireData(String questionnaireData) {
+ this.questionnaireData = questionnaireData;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null || getClass() != obj.getClass()) {
+ return false;
+ }
+
+ NetworkEntity that = (NetworkEntity) obj;
+
+ if (vspId != null ? !vspId.equals(that.vspId) : that.vspId != null) {
+ return false;
+ }
+ if (version != null ? !version.equals(that.version) : that.version != null) {
+ return false;
+ }
+ if (id != null ? !id.equals(that.id) : that.id != null) {
+ return false;
+ }
+ if (compositionData != null ? !compositionData.equals(that.compositionData)
+ : that.compositionData != null) {
+ return false;
+ }
+ return questionnaireData != null ? questionnaireData.equals(that.questionnaireData)
+ : that.questionnaireData == null;
+
+ }
+
+ @Override
+ public int hashCode() {
+ int result = vspId != null ? vspId.hashCode() : 0;
+ result = 31 * result + (version != null ? version.hashCode() : 0);
+ result = 31 * result + (id != null ? id.hashCode() : 0);
+ result = 31 * result + (compositionData != null ? compositionData.hashCode() : 0);
+ result = 31 * result + (questionnaireData != null ? questionnaireData.hashCode() : 0);
+ return result;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/NicEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/NicEntity.java
new file mode 100644
index 0000000000..33042a128a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/NicEntity.java
@@ -0,0 +1,203 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao.type;
+
+import com.datastax.driver.mapping.annotations.ClusteringColumn;
+import com.datastax.driver.mapping.annotations.Column;
+import com.datastax.driver.mapping.annotations.Frozen;
+import com.datastax.driver.mapping.annotations.PartitionKey;
+import com.datastax.driver.mapping.annotations.Table;
+import org.openecomp.core.utilities.json.JsonUtil;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+
+@Table(keyspace = "dox", name = "vsp_component_nic")
+public class NicEntity implements CompositionEntity {
+ private static final String ENTITY_TYPE = "Vendor Software Product ComponentData NIC";
+
+ @PartitionKey
+ @Column(name = "vsp_id")
+ private String vspId;
+ @PartitionKey(value = 1)
+ @Frozen
+ private Version version;
+ @ClusteringColumn
+ @Column(name = "component_id")
+ private String componentId;
+ @ClusteringColumn(value = 1)
+ @Column(name = "nic_id")
+ private String id;
+ @Column(name = "composition_data")
+ private String compositionData;
+ @Column(name = "questionnaire_data")
+ private String questionnaireData;
+
+ public NicEntity() {
+
+ }
+
+ /**
+ * Instantiates a new Nic entity.
+ *
+ * @param vspId the vsp id
+ * @param version the version
+ * @param componentId the component id
+ * @param id the id
+ */
+ public NicEntity(String vspId, Version version, String componentId, String id) {
+ this.vspId = vspId;
+ this.version = version;
+ this.componentId = componentId;
+ this.id = id;
+ }
+
+ @Override
+ public CompositionEntityType getType() {
+ return CompositionEntityType.nic;
+ }
+
+ @Override
+ public CompositionEntityId getCompositionEntityId() {
+ return new CompositionEntityId(getId(),
+ new CompositionEntityId(getComponentId(), new CompositionEntityId(getVspId(), null)));
+ }
+
+ public String getVspId() {
+ return vspId;
+ }
+
+ public void setVspId(String vspId) {
+ this.vspId = vspId;
+ }
+
+ @Override
+ public Version getVersion() {
+ return version;
+ }
+
+ @Override
+ public void setVersion(Version version) {
+ this.version = version;
+ }
+
+ @Override
+ public String getEntityType() {
+ return ENTITY_TYPE;
+ }
+
+ @Override
+ public String getFirstClassCitizenId() {
+ return getVspId();
+ }
+
+ public String getComponentId() {
+ return componentId;
+ }
+
+ public void setComponentId(String componentId) {
+ this.componentId = componentId;
+ }
+
+ @Override
+ public String getId() {
+ return id;
+ }
+
+ @Override
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ @Override
+ public String getCompositionData() {
+ return compositionData;
+ }
+
+ @Override
+ public void setCompositionData(String compositionData) {
+ this.compositionData = compositionData;
+ }
+
+ public Nic getNicCompositionData() {
+ return compositionData == null ? null : JsonUtil.json2Object(compositionData, Nic.class);
+ }
+
+ public void setNicCompositionData(Nic nic) {
+ this.compositionData = nic == null ? null : JsonUtil.object2Json(nic);
+ }
+
+ @Override
+ public String getQuestionnaireData() {
+ return questionnaireData;
+ }
+
+ @Override
+ public void setQuestionnaireData(String questionnaireData) {
+ this.questionnaireData = questionnaireData;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null || getClass() != obj.getClass()) {
+ return false;
+ }
+
+ NicEntity nicEntity = (NicEntity) obj;
+
+ if (vspId != null ? !vspId.equals(nicEntity.vspId) : nicEntity.vspId != null) {
+ return false;
+ }
+ if (version != null ? !version.equals(nicEntity.version) : nicEntity.version != null) {
+ return false;
+ }
+ if (componentId != null ? !componentId.equals(nicEntity.componentId)
+ : nicEntity.componentId != null) {
+ return false;
+ }
+ if (id != null ? !id.equals(nicEntity.id) : nicEntity.id != null) {
+ return false;
+ }
+ if (compositionData != null ? !compositionData.equals(nicEntity.compositionData)
+ : nicEntity.compositionData != null) {
+ return false;
+ }
+ return questionnaireData != null ? questionnaireData.equals(nicEntity.questionnaireData)
+ : nicEntity.questionnaireData == null;
+
+ }
+
+ @Override
+ public int hashCode() {
+ int result = vspId != null ? vspId.hashCode() : 0;
+ result = 31 * result + (version != null ? version.hashCode() : 0);
+ result = 31 * result + (componentId != null ? componentId.hashCode() : 0);
+ result = 31 * result + (id != null ? id.hashCode() : 0);
+ result = 31 * result + (compositionData != null ? compositionData.hashCode() : 0);
+ result = 31 * result + (questionnaireData != null ? questionnaireData.hashCode() : 0);
+ return result;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/PackageInfo.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/PackageInfo.java
new file mode 100644
index 0000000000..03f26cb57d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/PackageInfo.java
@@ -0,0 +1,176 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao.type;
+
+
+import com.datastax.driver.mapping.annotations.Column;
+import com.datastax.driver.mapping.annotations.Frozen;
+import com.datastax.driver.mapping.annotations.PartitionKey;
+import com.datastax.driver.mapping.annotations.Table;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.nio.ByteBuffer;
+
+@Table(keyspace = "dox", name = "package_details")
+public class PackageInfo {
+
+
+ @PartitionKey
+ @Column(name = "vsp_id")
+ private String vspId;
+
+ @PartitionKey(value = 1)
+ @Frozen
+ private Version version;
+
+ @Column(name = "display_name")
+ private String displayName;
+
+ @Column(name = "vsp_name")
+ private String vspName;
+
+ @Column(name = "vsp_description")
+ private String vspDescription;
+
+ @Column(name = "vendor_name")
+ private String vendorName;
+
+ private String category;
+
+ @Column(name = "sub_category")
+ private String subCategory;
+
+ @Column(name = "vendor_release")
+ private String vendorRelease;
+
+ @Column(name = "package_checksum")
+ private String packageChecksum;
+
+ @Column(name = "package_type")
+ private String packageType;
+
+ @Column(name = "translate_content")
+ private ByteBuffer translatedFile;
+
+ public PackageInfo() {
+ }
+
+ public PackageInfo(String packageId, Version version) {
+ this.vspId = packageId;
+ this.version = version;
+ }
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+ public void setDisplayName(String displayName) {
+ this.displayName = displayName;
+ }
+
+ public String getVspDescription() {
+ return vspDescription;
+ }
+
+ public void setVspDescription(String vspDescription) {
+ this.vspDescription = vspDescription;
+ }
+
+ public Version getVersion() {
+ return version;
+ }
+
+ public void setVersion(Version version) {
+ this.version = version;
+ }
+
+ public String getVspId() {
+ return vspId;
+ }
+
+ public void setVspId(String vspId) {
+ this.vspId = vspId;
+ }
+
+ public String getCategory() {
+ return category;
+ }
+
+ public void setCategory(String category) {
+ this.category = category;
+ }
+
+ public String getSubCategory() {
+ return subCategory;
+ }
+
+ public void setSubCategory(String subCategory) {
+ this.subCategory = subCategory;
+ }
+
+ public String getVendorName() {
+ return vendorName;
+ }
+
+ public void setVendorName(String vendorName) {
+ this.vendorName = vendorName;
+ }
+
+ public String getVendorRelease() {
+ return vendorRelease;
+ }
+
+ public void setVendorRelease(String vendorRelease) {
+ this.vendorRelease = vendorRelease;
+ }
+
+ public String getPackageChecksum() {
+ return packageChecksum;
+ }
+
+ public void setPackageChecksum(String packageChecksum) {
+ this.packageChecksum = packageChecksum;
+ }
+
+ public String getPackageType() {
+ return packageType;
+ }
+
+ public void setPackageType(String packageType) {
+ this.packageType = packageType;
+ }
+
+ public ByteBuffer getTranslatedFile() {
+ return translatedFile;
+ }
+
+ public void setTranslatedFile(ByteBuffer translatedFile) {
+ this.translatedFile = translatedFile;
+ }
+
+ public String getVspName() {
+ return vspName;
+ }
+
+ public void setVspName(String vendorName) {
+ this.vspName = vendorName;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ProcessArtifactEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ProcessArtifactEntity.java
new file mode 100644
index 0000000000..89e6de1e87
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ProcessArtifactEntity.java
@@ -0,0 +1,128 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao.type;
+
+import com.datastax.driver.mapping.annotations.ClusteringColumn;
+import com.datastax.driver.mapping.annotations.Column;
+import com.datastax.driver.mapping.annotations.Frozen;
+import com.datastax.driver.mapping.annotations.PartitionKey;
+import com.datastax.driver.mapping.annotations.Table;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.dao.types.VersionableEntity;
+
+import java.nio.ByteBuffer;
+
+@Table(keyspace = "dox", name = "vsp_process")
+public class ProcessArtifactEntity implements VersionableEntity {
+ public static final String ENTITY_TYPE = "Vendor Software Product Process artifact";
+ @PartitionKey
+ @Column(name = "vsp_id")
+ private String vspId;
+ @PartitionKey(value = 1)
+ @Frozen
+ private Version version;
+ @ClusteringColumn
+ @Column(name = "component_id")
+ private String componentId;
+ @ClusteringColumn(value = 1)
+ @Column(name = "process_id")
+ private String id;
+ @Column(name = "artifact_name")
+ private String artifactName;
+ private ByteBuffer artifact;
+
+ public ProcessArtifactEntity() {
+
+ }
+
+ /**
+ * Instantiates a new Process artifact entity.
+ *
+ * @param vspId the vsp id
+ * @param version the version
+ * @param componentId the component id
+ * @param id the id
+ */
+ public ProcessArtifactEntity(String vspId, Version version, String componentId, String id) {
+ this.vspId = vspId;
+ this.version = version;
+ this.componentId = componentId;
+ this.id = id;
+ }
+
+ public String getVspId() {
+ return vspId;
+ }
+
+ public void setVspId(String vspId) {
+ this.vspId = vspId;
+ }
+
+ public Version getVersion() {
+ return version;
+ }
+
+ public void setVersion(Version version) {
+ this.version = version;
+ }
+
+ public String getComponentId() {
+ return componentId;
+ }
+
+ public void setComponentId(String componentId) {
+ this.componentId = componentId;
+ }
+
+ @Override
+ public String getEntityType() {
+ return ENTITY_TYPE;
+ }
+
+ @Override
+ public String getFirstClassCitizenId() {
+ return getVspId();
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getArtifactName() {
+ return artifactName;
+ }
+
+ public void setArtifactName(String artifactName) {
+ this.artifactName = artifactName;
+ }
+
+ public ByteBuffer getArtifact() {
+ return artifact;
+ }
+
+ public void setArtifact(ByteBuffer artifact) {
+ this.artifact = artifact;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ProcessEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ProcessEntity.java
new file mode 100644
index 0000000000..d407540194
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ProcessEntity.java
@@ -0,0 +1,179 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao.type;
+
+import com.datastax.driver.mapping.annotations.ClusteringColumn;
+import com.datastax.driver.mapping.annotations.Column;
+import com.datastax.driver.mapping.annotations.Frozen;
+import com.datastax.driver.mapping.annotations.PartitionKey;
+import com.datastax.driver.mapping.annotations.Table;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.dao.types.VersionableEntity;
+
+@Table(keyspace = "dox", name = "vsp_process")
+public class ProcessEntity implements VersionableEntity {
+ public static final String ENTITY_TYPE = "Vendor Software Product Process";
+ @PartitionKey
+ @Column(name = "vsp_id")
+ private String vspId;
+ @PartitionKey(value = 1)
+ @Frozen
+ private Version version;
+ @ClusteringColumn
+ @Column(name = "component_id")
+ private String componentId;
+ @ClusteringColumn(value = 1)
+ @Column(name = "process_id")
+ private String id;
+ private String name;
+ private String description;
+ @Column(name = "artifact_name")
+ private String artifactName;
+
+ public ProcessEntity() {
+
+ }
+
+ /**
+ * Instantiates a new Process entity.
+ *
+ * @param vspId the vsp id
+ * @param version the version
+ * @param componentId the component id
+ * @param id the id
+ */
+ public ProcessEntity(String vspId, Version version, String componentId, String id) {
+ this.vspId = vspId;
+ this.version = version;
+ this.componentId = componentId;
+ this.id = id;
+ }
+
+ public String getVspId() {
+ return vspId;
+ }
+
+ public void setVspId(String vspId) {
+ this.vspId = vspId;
+ }
+
+ public Version getVersion() {
+ return version;
+ }
+
+ public void setVersion(Version version) {
+ this.version = version;
+ }
+
+ public String getComponentId() {
+ return componentId;
+ }
+
+ public void setComponentId(String componentId) {
+ this.componentId = componentId;
+ }
+
+ @Override
+ public String getEntityType() {
+ return ENTITY_TYPE;
+ }
+
+ @Override
+ public String getFirstClassCitizenId() {
+ return getVspId();
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getArtifactName() {
+ return artifactName;
+ }
+
+ public void setArtifactName(String artifactName) {
+ this.artifactName = artifactName;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null || getClass() != obj.getClass()) {
+ return false;
+ }
+
+ ProcessEntity that = (ProcessEntity) obj;
+
+ if (vspId != null ? !vspId.equals(that.vspId) : that.vspId != null) {
+ return false;
+ }
+ if (version != null ? !version.equals(that.version) : that.version != null) {
+ return false;
+ }
+ if (componentId != null ? !componentId.equals(that.componentId) : that.componentId != null) {
+ return false;
+ }
+ if (id != null ? !id.equals(that.id) : that.id != null) {
+ return false;
+ }
+ if (name != null ? !name.equals(that.name) : that.name != null) {
+ return false;
+ }
+ return description != null ? description.equals(that.description) : that.description == null
+ &&
+ (artifactName != null ? artifactName.equals(that.artifactName) : that.artifactName == null);
+
+ }
+
+ @Override
+ public int hashCode() {
+ int result = vspId != null ? vspId.hashCode() : 0;
+ result = 31 * result + (version != null ? version.hashCode() : 0);
+ result = 31 * result + (componentId != null ? componentId.hashCode() : 0);
+ result = 31 * result + (id != null ? id.hashCode() : 0);
+ result = 31 * result + (name != null ? name.hashCode() : 0);
+ result = 31 * result + (description != null ? description.hashCode() : 0);
+ result = 31 * result + (artifactName != null ? artifactName.hashCode() : 0);
+ return result;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/TranslatedFileData.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/TranslatedFileData.java
new file mode 100644
index 0000000000..c6f197a4cf
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/TranslatedFileData.java
@@ -0,0 +1,97 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao.type;
+
+public class TranslatedFileData {
+
+ private String displayName;
+ private String version;
+ private String category;
+ private String subcategory;
+ private String vandorName;
+ private String vendorRelease;
+ private String packageChecksum;
+ private String packageType;
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+ public void setDisplayName(String displayName) {
+ this.displayName = displayName;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ public String getCategory() {
+ return category;
+ }
+
+ public void setCategory(String category) {
+ this.category = category;
+ }
+
+ public String getSubcategory() {
+ return subcategory;
+ }
+
+ public void setSubcategory(String subcategory) {
+ this.subcategory = subcategory;
+ }
+
+ public String getVandorName() {
+ return vandorName;
+ }
+
+ public void setVandorName(String vandorName) {
+ this.vandorName = vandorName;
+ }
+
+ public String getVendorRelease() {
+ return vendorRelease;
+ }
+
+ public void setVendorRelease(String vendorRelease) {
+ this.vendorRelease = vendorRelease;
+ }
+
+ public String getPackageChecksum() {
+ return packageChecksum;
+ }
+
+ public void setPackageChecksum(String packageChecksum) {
+ this.packageChecksum = packageChecksum;
+ }
+
+ public String getPackageType() {
+ return packageType;
+ }
+
+ public void setPackageType(String packageType) {
+ this.packageType = packageType;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/UploadDataEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/UploadDataEntity.java
new file mode 100644
index 0000000000..a70b2cd6c8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/UploadDataEntity.java
@@ -0,0 +1,135 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao.type;
+
+import com.datastax.driver.mapping.annotations.Column;
+import com.datastax.driver.mapping.annotations.Frozen;
+import com.datastax.driver.mapping.annotations.PartitionKey;
+import com.datastax.driver.mapping.annotations.Table;
+import org.openecomp.core.utilities.json.JsonUtil;
+import org.openecomp.sdc.heat.datatypes.structure.ValidationStructureList;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.dao.types.VersionableEntity;
+
+import java.nio.ByteBuffer;
+
+@Table(keyspace = "dox", name = "vsp_information")
+public class UploadDataEntity implements VersionableEntity {
+ private static final String ENTITY_TYPE = "Vendor Software Product Upload data";
+
+ @PartitionKey
+ @Column(name = "vsp_id")
+ private String id;
+
+ @PartitionKey(value = 1)
+ @Frozen
+ private Version version;
+
+ @Column(name = "package_name")
+ private String packageName;
+
+ @Column(name = "package_version")
+ private String packageVersion;
+
+ @Column(name = "validation_data")
+ private String validationData;
+
+ @Column(name = "content_data")
+ private ByteBuffer contentData;
+
+ public UploadDataEntity() {
+ }
+
+ public UploadDataEntity(String id, Version version) {
+ this.id = id;
+ this.version = version;
+ }
+
+ @Override
+ public String getEntityType() {
+ return ENTITY_TYPE;
+ }
+
+ @Override
+ public String getFirstClassCitizenId() {
+ return getId();
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ @Override
+ public Version getVersion() {
+ return version;
+ }
+
+ @Override
+ public void setVersion(Version version) {
+ this.version = version;
+ }
+
+ public String getPackageName() {
+ return packageName;
+ }
+
+ public void setPackageName(String packageName) {
+ this.packageName = packageName;
+ }
+
+ public String getPackageVersion() {
+ return packageVersion;
+ }
+
+ public void setPackageVersion(String packageVersion) {
+ this.packageVersion = packageVersion;
+ }
+
+ public String getValidationData() {
+ return validationData;
+ }
+
+ public void setValidationData(String validationData) {
+ this.validationData = validationData;
+ }
+
+ public ValidationStructureList getValidationDataStructure() {
+ return validationData == null ? null
+ : JsonUtil.json2Object(validationData, ValidationStructureList.class);
+ }
+
+ public void setValidationDataStructure(ValidationStructureList validationData) {
+ this.validationData = validationData == null ? null
+ : JsonUtil.object2Json(validationData);
+ }
+
+ public ByteBuffer getContentData() {
+ return contentData;
+ }
+
+ public void setContentData(ByteBuffer contentData) {
+ this.contentData = contentData;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/VspDetails.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/VspDetails.java
new file mode 100644
index 0000000000..3423ba36b3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/VspDetails.java
@@ -0,0 +1,242 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao.type;
+
+import com.datastax.driver.mapping.annotations.Column;
+import com.datastax.driver.mapping.annotations.Computed;
+import com.datastax.driver.mapping.annotations.Frozen;
+import com.datastax.driver.mapping.annotations.PartitionKey;
+import com.datastax.driver.mapping.annotations.Table;
+import org.openecomp.core.utilities.json.JsonUtil;
+import org.openecomp.sdc.heat.datatypes.structure.ValidationStructureList;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.dao.types.VersionableEntity;
+
+import java.util.List;
+
+@Table(keyspace = "dox", name = "vsp_information")
+public class VspDetails implements VersionableEntity {
+ public static final String ENTITY_TYPE = "Vendor Software Product";
+
+ @PartitionKey
+ @Column(name = "vsp_id")
+ private String id;
+
+ @PartitionKey(value = 1)
+ @Frozen
+ private Version version;
+
+ private String name;
+ private String description;
+
+ private String category;
+
+ @Column(name = "sub_category")
+ private String subCategory;
+
+ private String icon;
+
+ @Column(name = "vendor_name")
+ private String vendorName;
+
+ @Column(name = "vendor_id")
+ private String vendorId;
+
+ @Column(name = "vlm_version")
+ @Frozen
+ private Version vlmVersion;
+
+ @Column(name = "license_agreement")
+ private String licenseAgreement;
+
+ @Column(name = "feature_groups")
+ private List<String> featureGroups;
+
+ @Column(name = "package_name")
+ private String packageName;
+
+ @Column(name = "package_version")
+ private String packageVersion;
+
+ @Column(name = "validation_data")
+ private String validationData;
+
+ @Computed("writetime(name)")
+ private Long writetimeMicroSeconds;
+
+ public VspDetails() {
+ }
+
+ public VspDetails(String id, Version version) {
+ this.id = id;
+ this.version = version;
+ }
+
+ @Override
+ public String getEntityType() {
+ return ENTITY_TYPE;
+ }
+
+ @Override
+ public String getFirstClassCitizenId() {
+ return getId();
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ @Override
+ public Version getVersion() {
+ return version;
+ }
+
+ @Override
+ public void setVersion(Version version) {
+ this.version = version;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getCategory() {
+ return category;
+ }
+
+ public void setCategory(String category) {
+ this.category = category;
+ }
+
+ public String getSubCategory() {
+ return subCategory;
+ }
+
+ public void setSubCategory(String subCategory) {
+ this.subCategory = subCategory;
+ }
+
+ public String getIcon() {
+ return icon;
+ }
+
+ public void setIcon(String icon) {
+ this.icon = icon;
+ }
+
+ public String getVendorName() {
+ return vendorName;
+ }
+
+ public void setVendorName(String vendorName) {
+ this.vendorName = vendorName;
+ }
+
+ public String getVendorId() {
+ return vendorId;
+ }
+
+ public void setVendorId(String vendorId) {
+ this.vendorId = vendorId;
+ }
+
+ public Version getVlmVersion() {
+ return vlmVersion;
+ }
+
+ public void setVlmVersion(Version vlmVersion) {
+ this.vlmVersion = vlmVersion;
+ }
+
+ public String getLicenseAgreement() {
+ return licenseAgreement;
+ }
+
+ public void setLicenseAgreement(String licenseAgreement) {
+ this.licenseAgreement = licenseAgreement;
+ }
+
+ public List<String> getFeatureGroups() {
+ return featureGroups;
+ }
+
+ public void setFeatureGroups(List<String> featureGroups) {
+ this.featureGroups = featureGroups;
+ }
+
+ public String getPackageName() {
+ return packageName;
+ }
+
+ public void setPackageName(String packageName) {
+ this.packageName = packageName;
+ }
+
+ public String getPackageVersion() {
+ return packageVersion;
+ }
+
+ public void setPackageVersion(String packageVersion) {
+ this.packageVersion = packageVersion;
+ }
+
+ public String getValidationData() {
+ return validationData;
+ }
+
+ public void setValidationData(String validationData) {
+ this.validationData = validationData;
+ }
+
+ public ValidationStructureList getValidationDataStructure() {
+ return validationData == null ? null
+ : JsonUtil.json2Object(validationData, ValidationStructureList.class);
+ }
+
+ public void setValidationDataStructure(ValidationStructureList validationData) {
+ this.validationData = validationData == null ? null
+ : JsonUtil.object2Json(validationData);
+ }
+
+ public Long getWritetimeMicroSeconds() {
+ return this.writetimeMicroSeconds;
+ }
+
+ public void setWritetimeMicroSeconds(Long writetimeMicroSeconds) {
+ this.writetimeMicroSeconds = writetimeMicroSeconds;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/VspQuestionnaireEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/VspQuestionnaireEntity.java
new file mode 100644
index 0000000000..42fbecfe01
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/VspQuestionnaireEntity.java
@@ -0,0 +1,111 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao.type;
+
+import com.datastax.driver.mapping.annotations.Column;
+import com.datastax.driver.mapping.annotations.Frozen;
+import com.datastax.driver.mapping.annotations.PartitionKey;
+import com.datastax.driver.mapping.annotations.Table;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId;
+import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+@Table(keyspace = "dox", name = "vsp_information")
+public class VspQuestionnaireEntity implements CompositionEntity {
+ private static final String ENTITY_TYPE = "Vendor Software Product";
+
+ @PartitionKey
+ @Column(name = "vsp_id")
+ private String id;
+ @PartitionKey(value = 1)
+ @Frozen
+ private Version version;
+ @Column(name = "questionnaire_data")
+ private String questionnaireData;
+
+ public VspQuestionnaireEntity() {
+
+ }
+
+ public VspQuestionnaireEntity(String vspId, Version version) {
+ this.id = vspId;
+ this.version = version;
+ }
+
+ @Override
+ public String getId() {
+ return id;
+ }
+
+ @Override
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ @Override
+ public Version getVersion() {
+ return version;
+ }
+
+ @Override
+ public void setVersion(Version version) {
+ this.version = version;
+ }
+
+ @Override
+ public String getEntityType() {
+ return ENTITY_TYPE;
+ }
+
+ @Override
+ public String getFirstClassCitizenId() {
+ return getId();
+ }
+
+ @Override
+ public CompositionEntityType getType() {
+ return CompositionEntityType.vsp;
+ }
+
+ @Override
+ public CompositionEntityId getCompositionEntityId() {
+ return new CompositionEntityId(getId(), null);
+ }
+
+ @Override
+ public String getCompositionData() {
+ return null; //none
+ }
+
+ @Override
+ public void setCompositionData(String compositionData) {
+ //none
+ }
+
+ public String getQuestionnaireData() {
+ return questionnaireData;
+ }
+
+ public void setQuestionnaireData(String questionnaireData) {
+ this.questionnaireData = questionnaireData;
+ }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/Component.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/Component.java
new file mode 100644
index 0000000000..b112ee2216
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/Component.java
@@ -0,0 +1,44 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.types.composition;
+
+import java.util.List;
+
+public class Component {
+ private ComponentData data;
+ private List<Nic> nics;
+
+ public ComponentData getData() {
+ return data;
+ }
+
+ public void setData(ComponentData data) {
+ this.data = data;
+ }
+
+ public List<Nic> getNics() {
+ return nics;
+ }
+
+ public void setNics(List<Nic> nics) {
+ this.nics = nics;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/ComponentData.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/ComponentData.java
new file mode 100644
index 0000000000..0b3096c686
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/ComponentData.java
@@ -0,0 +1,80 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.types.composition;
+
+public class ComponentData implements CompositionDataEntity {
+ private String name;
+ private String description;
+ private String displayName;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+ public void setDisplayName(String displayName) {
+ this.displayName = displayName;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (!(obj instanceof ComponentData)) {
+ return false;
+ }
+
+ ComponentData that = (ComponentData) obj;
+
+ if (!name.equals(that.name)) {
+ return false;
+ }
+ if (description != null ? !description.equals(that.description) : that.description != null) {
+ return false;
+ }
+ return displayName != null ? displayName.equals(that.displayName) : that.displayName == null;
+
+ }
+
+ @Override
+ public int hashCode() {
+ int result = name.hashCode();
+ result = 31 * result + (description != null ? description.hashCode() : 0);
+ result = 31 * result + (displayName != null ? displayName.hashCode() : 0);
+ return result;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/CompositionData.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/CompositionData.java
new file mode 100644
index 0000000000..30e11cde60
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/CompositionData.java
@@ -0,0 +1,44 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.types.composition;
+
+import java.util.List;
+
+public class CompositionData {
+ private List<Network> networks;
+ private List<Component> components;
+
+ public List<Network> getNetworks() {
+ return networks;
+ }
+
+ public void setNetworks(List<Network> networks) {
+ this.networks = networks;
+ }
+
+ public List<Component> getComponents() {
+ return components;
+ }
+
+ public void setComponents(List<Component> components) {
+ this.components = components;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/CompositionDataEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/CompositionDataEntity.java
new file mode 100644
index 0000000000..9c09b0ded4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/CompositionDataEntity.java
@@ -0,0 +1,24 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.types.composition;
+
+public interface CompositionDataEntity {
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/CompositionEntityId.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/CompositionEntityId.java
new file mode 100644
index 0000000000..af1123b2e8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/CompositionEntityId.java
@@ -0,0 +1,64 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.types.composition;
+
+public class CompositionEntityId {
+ private String id;
+ private CompositionEntityId parentId;
+
+ public CompositionEntityId(String id, CompositionEntityId parentId) {
+ this.id = id;
+ this.parentId = parentId;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public CompositionEntityId getParentId() {
+ return parentId;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null || getClass() != obj.getClass()) {
+ return false;
+ }
+
+ CompositionEntityId that = (CompositionEntityId) obj;
+
+ if (id != null ? !id.equals(that.id) : that.id != null) {
+ return false;
+ }
+ return parentId != null ? parentId.equals(that.parentId) : that.parentId == null;
+
+ }
+
+ @Override
+ public int hashCode() {
+ int result = id != null ? id.hashCode() : 0;
+ result = 31 * result + (parentId != null ? parentId.hashCode() : 0);
+ return result;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/CompositionEntityType.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/CompositionEntityType.java
new file mode 100644
index 0000000000..f762aeb341
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/CompositionEntityType.java
@@ -0,0 +1,28 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.types.composition;
+
+public enum CompositionEntityType {
+ vsp,
+ network,
+ component,
+ nic
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/Network.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/Network.java
new file mode 100644
index 0000000000..2f9eb4e69c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/Network.java
@@ -0,0 +1,67 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.types.composition;
+
+public class Network implements CompositionDataEntity {
+ private String name;
+ private boolean dhcp;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public boolean isDhcp() {
+ return dhcp;
+ }
+
+ public void setDhcp(boolean dhcp) {
+ this.dhcp = dhcp;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null || getClass() != obj.getClass()) {
+ return false;
+ }
+
+ Network network = (Network) obj;
+
+ if (dhcp != network.dhcp) {
+ return false;
+ }
+ return name != null ? name.equals(network.name) : network.name == null;
+
+ }
+
+ @Override
+ public int hashCode() {
+ int result = name != null ? name.hashCode() : 0;
+ result = 31 * result + (dhcp ? 1 : 0);
+ return result;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/NetworkType.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/NetworkType.java
new file mode 100644
index 0000000000..d90135a205
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/NetworkType.java
@@ -0,0 +1,26 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.types.composition;
+
+public enum NetworkType {
+ Internal,
+ External
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/Nic.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/Nic.java
new file mode 100644
index 0000000000..e44a731824
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/Nic.java
@@ -0,0 +1,102 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.types.composition;
+
+public class Nic implements CompositionDataEntity {
+ private String name;
+ private String description;
+ private String networkId;
+ private String networkName;
+ private NetworkType networkType;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getNetworkId() {
+ return networkId;
+ }
+
+ public void setNetworkId(String networkId) {
+ this.networkId = networkId;
+ }
+
+ public String getNetworkName() {
+ return networkName;
+ }
+
+ public void setNetworkName(String networkName) {
+ this.networkName = networkName;
+ }
+
+ public NetworkType getNetworkType() {
+ return networkType;
+ }
+
+ public void setNetworkType(NetworkType networkType) {
+ this.networkType = networkType;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null || getClass() != obj.getClass()) {
+ return false;
+ }
+
+ Nic nic = (Nic) obj;
+
+ if (name != null ? !name.equals(nic.name) : nic.name != null) {
+ return false;
+ }
+ if (description != null ? !description.equals(nic.description) : nic.description != null) {
+ return false;
+ }
+ if (networkId != null ? !networkId.equals(nic.networkId) : nic.networkId != null) {
+ return false;
+ }
+ return networkType == nic.networkType;
+
+ }
+
+ @Override
+ public int hashCode() {
+ int result = name != null ? name.hashCode() : 0;
+ result = 31 * result + (description != null ? description.hashCode() : 0);
+ result = 31 * result + (networkId != null ? networkId.hashCode() : 0);
+ result = 31 * result + (networkType != null ? networkType.hashCode() : 0);
+ return result;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/resources/factoryConfiguration.json b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/resources/factoryConfiguration.json
new file mode 100644
index 0000000000..86b2f857cf
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/resources/factoryConfiguration.json
@@ -0,0 +1,14 @@
+{
+ "org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory": "org.openecomp.sdc.vendorsoftwareproduct.dao.impl.VendorSoftwareProductDaoFactoryImpl",
+ "org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDaoFactory": "org.openecomp.sdc.vendorsoftwareproduct.dao.impl.VendorSoftwareProductInfoDaoFactoryImpl",
+ "org.openecomp.sdc.vendorsoftwareproduct.dao.UploadDataDaoFactory": "org.openecomp.sdc.vendorsoftwareproduct.dao.impl.UploadDataDaoFactoryImpl",
+ "org.openecomp.sdc.vendorsoftwareproduct.dao.PackageInfoDaoFactory": "org.openecomp.sdc.vendorsoftwareproduct.dao.impl.PackageInfoDaoFactoryImpl",
+ "org.openecomp.sdc.vendorsoftwareproduct.dao.NetworkDaoFactory": "org.openecomp.sdc.vendorsoftwareproduct.dao.impl.NetworkDaoFactoryImpl",
+ "org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDaoFactory": "org.openecomp.sdc.vendorsoftwareproduct.dao.impl.ComponentDaoFactoryImpl",
+ "org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentArtifactDaoFactory": "org.openecomp.sdc.vendorsoftwareproduct.dao.impl.ComponentArtifactDaoFactoryImpl",
+ "org.openecomp.sdc.vendorsoftwareproduct.dao.NicDaoFactory": "org.openecomp.sdc.vendorsoftwareproduct.dao.impl.NicDaoFactoryImpl",
+ "org.openecomp.sdc.vendorsoftwareproduct.dao.VspQuestionnaireDaoFactory": "org.openecomp.sdc.vendorsoftwareproduct.dao.impl.VspQuestionnaireDaoFactoryImpl",
+ "org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessDaoFactory": "org.openecomp.sdc.vendorsoftwareproduct.dao.impl.ProcessDaoFactoryImpl",
+ "org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessArtifactDaoFactory": "org.openecomp.sdc.vendorsoftwareproduct.dao.impl.ProcessArtifactDaoFactoryImpl"
+
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/pom.xml b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/pom.xml
new file mode 100644
index 0000000000..c732472152
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/pom.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-vendor-software-product-lib</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>openecomp-sdc-vendor-software-product-core</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <version>2.3.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.yaml</groupId>
+ <artifactId>snakeyaml</artifactId>
+ <version>1.14</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-enrichment-impl</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-vendor-software-product-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-nosqldb-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.freemarker</groupId>
+ <artifactId>freemarker</artifactId>
+ <version>2.3.23</version>
+ </dependency>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>${testng.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-config-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-model-impl</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentArtifactDaoCassandraImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentArtifactDaoCassandraImpl.java
new file mode 100644
index 0000000000..2525537cef
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentArtifactDaoCassandraImpl.java
@@ -0,0 +1,159 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl;
+
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.UDTValue;
+import com.datastax.driver.mapping.Mapper;
+import com.datastax.driver.mapping.Result;
+import com.datastax.driver.mapping.UDTMapper;
+import com.datastax.driver.mapping.annotations.Accessor;
+import com.datastax.driver.mapping.annotations.Query;
+import org.openecomp.core.dao.impl.CassandraBaseDao;
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentArtifactDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentArtifactEntity;
+import org.openecomp.sdc.versioning.VersioningManagerFactory;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.types.VersionableEntityMetadata;
+
+
+import java.nio.ByteBuffer;
+import java.util.Collection;
+
+public class ComponentArtifactDaoCassandraImpl extends CassandraBaseDao<ComponentArtifactEntity>
+ implements ComponentArtifactDao {
+
+ private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
+ private static final ComponentArtifactAccessor accessor =
+ noSqlDb.getMappingManager().createAccessor(ComponentArtifactAccessor.class);
+ private static final Mapper<ComponentArtifactEntity> mapper =
+ noSqlDb.getMappingManager().mapper(ComponentArtifactEntity.class);
+ private static final UDTMapper<Version> versionMapper =
+ noSqlDb.getMappingManager().udtMapper(Version.class);
+
+
+ @Override
+ public void registerVersioning(String versionableEntityType) {
+ VersionableEntityMetadata metadata = new VersionableEntityMetadata(
+ mapper.getTableMetadata().getName(),
+ mapper.getTableMetadata().getPartitionKey().get(0).getName(),
+ mapper.getTableMetadata().getPartitionKey().get(1).getName());
+
+ // metadata.setUniqueValuesMetadata(Collections.singletonList(new UniqueValueMetadata
+ // (VendorSoftwareProductConstants.UniqueValues.COMPONENT_ARTIFACT_NAME,
+ // Arrays.asList(mapper.getTableMetadata().getPartitionKey().get(0).getName(), mapper
+ // .getTableMetadata().getPartitionKey().get(1).getName(), "name"))));
+
+ VersioningManagerFactory.getInstance().createInterface()
+ .register(versionableEntityType, metadata);
+ }
+
+ @Override
+ public ComponentArtifactEntity getArtifactByType(ComponentArtifactEntity entity) {
+ return accessor.listByType(entity.getVspId(), versionMapper.toUDT(entity.getVersion()),
+ entity.getComponentId(), entity.getType().toString()).one();
+ }
+
+ @Override
+ protected Mapper<ComponentArtifactEntity> getMapper() {
+ return mapper;
+ }
+
+ @Override
+ protected Object[] getKeys(ComponentArtifactEntity entity) {
+ return new Object[]{entity.getVspId(), versionMapper.toUDT(entity.getVersion()),
+ entity.getComponentId(), entity.getType().toString(), entity.getId()};
+ }
+
+ @Override
+ public Collection<ComponentArtifactEntity> list(ComponentArtifactEntity entity) {
+ return accessor.listByType(entity.getVspId(), versionMapper.toUDT(entity.getVersion()),
+ entity.getComponentId(), entity.getType().toString()).all();
+ }
+
+ @Override
+ public void update(ComponentArtifactEntity entity) {
+ accessor.update(entity.getVspId(), versionMapper.toUDT(entity.getVersion()),
+ entity.getComponentId(), entity.getId(), entity.getArtifactName(), entity.getArtifact(),
+ entity.getType().toString());
+
+ }
+
+ @Override
+ public void delete(ComponentArtifactEntity entity) {
+ accessor.delete(entity.getVspId(), versionMapper.toUDT(entity.getVersion()),
+ entity.getComponentId(), entity.getType().toString());
+ }
+
+ @Override
+ public Collection<ComponentArtifactEntity> getArtifactNamesAndTypesForComponent(
+ ComponentArtifactEntity entity) {
+ return accessor.getArtifactNamesAndTypesForComponent(entity.getVspId(),
+ versionMapper.toUDT(entity.getVersion()), entity.getComponentId()).all();
+ }
+
+ @Override
+ public void deleteAll(ComponentArtifactEntity entity) {
+ accessor.deleteAll(entity.getVspId(), versionMapper.toUDT(entity.getVersion()));
+ }
+
+
+ @Accessor
+ interface ComponentArtifactAccessor {
+
+ @Query(
+ "insert into vsp_component_artifact (vsp_id, version, component_id, artifact_id, name, "
+ + "artifact, artifact_type) values (?,?,?,?,?,?,?)")
+ ResultSet update(String vspId, UDTValue version, String componentId, String id,
+ String artifactName, ByteBuffer artifact, String type);
+
+ @Query(
+ "select vsp_id, version, component_id, artifact_type, artifact_id, name, artifact from "
+ + "vsp_component_artifact where vsp_id=? and version=? and component_id=? and "
+ + "artifact_type =?")
+ Result<ComponentArtifactEntity> listByType(String vspId, UDTValue version, String componentId,
+ String type);
+
+ @Query(
+ "delete name, artifact from vsp_component_artifact where vsp_id=? and version=? and "
+ + "component_id=? and artifact_type=? and artifact_id=?")
+ ResultSet delete(String vspId, UDTValue version, String componentId, String type,
+ String artifactId);
+
+ @Query(
+ "delete from vsp_component_artifact where vsp_id=? and version=? and component_id=? "
+ + "and artifact_type=?")
+ ResultSet delete(String vspId, UDTValue version, String componentId, String artifactType);
+
+ @Query("delete from vsp_component_artifact where vsp_id=? and version=?")
+ ResultSet deleteAll(String vspId, UDTValue version);
+
+ @Query(
+ "select name, artifact_type from vsp_component_artifact where vsp_id=? and version=? "
+ + "and component_id=?")
+ Result<ComponentArtifactEntity> getArtifactNamesAndTypesForComponent(String vspId,
+ UDTValue version,
+ String componentId);
+
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentArtifactDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentArtifactDaoFactoryImpl.java
new file mode 100644
index 0000000000..07a9f104f4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentArtifactDaoFactoryImpl.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl;
+
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentArtifactDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentArtifactDaoFactory;
+
+public class ComponentArtifactDaoFactoryImpl extends ComponentArtifactDaoFactory {
+ private static final ComponentArtifactDao INSTANCE = new ComponentArtifactDaoCassandraImpl();
+
+ @Override
+ public ComponentArtifactDao createInterface() {
+ return INSTANCE;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentDaoCassandraImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentDaoCassandraImpl.java
new file mode 100644
index 0000000000..85372380c0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentDaoCassandraImpl.java
@@ -0,0 +1,139 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl;
+
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.UDTValue;
+import com.datastax.driver.mapping.Mapper;
+import com.datastax.driver.mapping.Result;
+import com.datastax.driver.mapping.UDTMapper;
+import com.datastax.driver.mapping.annotations.Accessor;
+import com.datastax.driver.mapping.annotations.Query;
+import org.openecomp.core.dao.impl.CassandraBaseDao;
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
+import org.openecomp.sdc.versioning.VersioningManagerFactory;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.types.UniqueValueMetadata;
+import org.openecomp.sdc.versioning.types.VersionableEntityMetadata;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+
+public class ComponentDaoCassandraImpl extends CassandraBaseDao<ComponentEntity>
+ implements ComponentDao {
+
+ private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
+ private static final Mapper<ComponentEntity> mapper =
+ noSqlDb.getMappingManager().mapper(ComponentEntity.class);
+ private static final ComponentAccessor accessor =
+ noSqlDb.getMappingManager().createAccessor(ComponentAccessor.class);
+ private static final UDTMapper<Version> versionMapper =
+ noSqlDb.getMappingManager().udtMapper(Version.class);
+
+ @Override
+ public void registerVersioning(String versionableEntityType) {
+ VersionableEntityMetadata metadata = new VersionableEntityMetadata(
+ mapper.getTableMetadata().getName(),
+ mapper.getTableMetadata().getPartitionKey().get(0).getName(),
+ mapper.getTableMetadata().getPartitionKey().get(1).getName());
+
+
+ metadata.setUniqueValuesMetadata(Collections.singletonList(
+ new UniqueValueMetadata(VendorSoftwareProductConstants.UniqueValues.COMPONENT_NAME,
+ Arrays.asList(mapper.getTableMetadata().getPartitionKey().get(0).getName(),
+ mapper.getTableMetadata().getPartitionKey().get(1).getName(), "name"))));
+
+ VersioningManagerFactory.getInstance().createInterface()
+ .register(versionableEntityType, metadata);
+ }
+
+ @Override
+ protected Mapper<ComponentEntity> getMapper() {
+ return mapper;
+ }
+
+ @Override
+ protected Object[] getKeys(ComponentEntity entity) {
+ return new Object[]{entity.getVspId(), versionMapper.toUDT(entity.getVersion()),
+ entity.getId()};
+ }
+
+ @Override
+ public void update(ComponentEntity entity) {
+ accessor.updateCompositionData(entity.getVspId(), versionMapper.toUDT(entity.getVersion()),
+ entity.getId(), entity.getCompositionData());
+ }
+
+ @Override
+ public Collection<ComponentEntity> list(ComponentEntity entity) {
+ return accessor.list(entity.getVspId(), versionMapper.toUDT(entity.getVersion())).all();
+ }
+
+ @Override
+ public void updateQuestionnaireData(String vspId, Version version, String id,
+ String questionnaireData) {
+ accessor.updateQuestionnaireData(questionnaireData, vspId, versionMapper.toUDT(version), id);
+ }
+
+ @Override
+ public Collection<ComponentEntity> listQuestionnaires(String vspId, Version version) {
+ return accessor.listQuestionnaires(vspId, versionMapper.toUDT(version)).all();
+ }
+
+ @Override
+ public void deleteAll(String vspId, Version version) {
+ accessor.deleteAll(vspId, version);
+ }
+
+ @Accessor
+ interface ComponentAccessor {
+
+ @Query(
+ "select vsp_id, version, component_id, composition_data from vsp_component "
+ + "where vsp_id=? and version=?")
+ Result<ComponentEntity> list(String vspId, UDTValue version);
+
+ @Query(
+ "select vsp_id, version, component_id, questionnaire_data from vsp_component "
+ + "where vsp_id=? and version=?")
+ Result<ComponentEntity> listQuestionnaires(String vspId, UDTValue version);
+
+ @Query(
+ "insert into vsp_component (vsp_id, version, component_id, composition_data) "
+ + "values (?,?,?,?)")
+ ResultSet updateCompositionData(String vspId, UDTValue version, String id,
+ String compositionData);
+
+ @Query(
+ "update vsp_component set questionnaire_data=? where vsp_id=? and version=? "
+ + "and component_id=?")
+ ResultSet updateQuestionnaireData(String questionnaireData, String vspId, UDTValue version,
+ String id);
+
+ @Query("delete from vsp_component where vsp_id=? and version=?")
+ ResultSet deleteAll(String vspId, Version version);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentDaoFactoryImpl.java
new file mode 100644
index 0000000000..1e57242ce1
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentDaoFactoryImpl.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl;
+
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDaoFactory;
+
+public class ComponentDaoFactoryImpl extends ComponentDaoFactory {
+ private static final ComponentDao INSTANCE = new ComponentDaoCassandraImpl();
+
+ @Override
+ public ComponentDao createInterface() {
+ return INSTANCE;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/NetworkDaoCassandraImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/NetworkDaoCassandraImpl.java
new file mode 100644
index 0000000000..f7b8f30f0a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/NetworkDaoCassandraImpl.java
@@ -0,0 +1,127 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl;
+
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.UDTValue;
+import com.datastax.driver.mapping.Mapper;
+import com.datastax.driver.mapping.Result;
+import com.datastax.driver.mapping.UDTMapper;
+import com.datastax.driver.mapping.annotations.Accessor;
+import com.datastax.driver.mapping.annotations.Query;
+import org.openecomp.core.dao.impl.CassandraBaseDao;
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.NetworkDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity;
+import org.openecomp.sdc.versioning.VersioningManagerFactory;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.types.UniqueValueMetadata;
+import org.openecomp.sdc.versioning.types.VersionableEntityMetadata;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+
+public class NetworkDaoCassandraImpl extends CassandraBaseDao<NetworkEntity> implements NetworkDao {
+
+ private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
+ private static final Mapper<NetworkEntity> mapper =
+ noSqlDb.getMappingManager().mapper(NetworkEntity.class);
+ private static final NetworkAccessor accessor =
+ noSqlDb.getMappingManager().createAccessor(NetworkAccessor.class);
+ private static final UDTMapper<Version> versionMapper =
+ noSqlDb.getMappingManager().udtMapper(Version.class);
+
+ @Override
+ public void registerVersioning(String versionableEntityType) {
+ VersionableEntityMetadata metadata = new VersionableEntityMetadata(
+ mapper.getTableMetadata().getName(),
+ mapper.getTableMetadata().getPartitionKey().get(0).getName(),
+ mapper.getTableMetadata().getPartitionKey().get(1).getName());
+
+
+ metadata.setUniqueValuesMetadata(Collections.singletonList(
+ new UniqueValueMetadata(VendorSoftwareProductConstants.UniqueValues.NETWORK_NAME,
+ Arrays.asList(mapper.getTableMetadata().getPartitionKey().get(0).getName(),
+ mapper.getTableMetadata().getPartitionKey().get(1).getName(), "name"))));
+
+ VersioningManagerFactory.getInstance().createInterface()
+ .register(versionableEntityType, metadata);
+ }
+
+ @Override
+ protected Mapper<NetworkEntity> getMapper() {
+ return mapper;
+ }
+
+ @Override
+ protected Object[] getKeys(NetworkEntity entity) {
+ return new Object[]{entity.getVspId(), versionMapper.toUDT(entity.getVersion()),
+ entity.getId()};
+ }
+
+ @Override
+ public void update(NetworkEntity entity) {
+ accessor.updateCompositionData(entity.getVspId(), versionMapper.toUDT(entity.getVersion()),
+ entity.getId(), entity.getCompositionData());
+ }
+
+ @Override
+ public void updateQuestionnaireData(String vspId, Version version, String id,
+ String questionnaireData) {
+ accessor.updateQuestionnaireData(questionnaireData, vspId, versionMapper.toUDT(version), id);
+ }
+
+ @Override
+ public Collection<NetworkEntity> list(NetworkEntity entity) {
+ return accessor.list(entity.getVspId(), versionMapper.toUDT(entity.getVersion())).all();
+ }
+
+ @Override
+ public void deleteAll(String vspId, Version version) {
+ accessor.deleteAll(vspId, version);
+ }
+
+ @Accessor
+ interface NetworkAccessor {
+
+ @Query(
+ "select vsp_id, version, network_id, composition_data from vsp_network where vsp_id=? "
+ + "and version=?")
+ Result<NetworkEntity> list(String vspId, UDTValue version);
+
+ @Query(
+ "insert into vsp_network (vsp_id, version, network_id, composition_data) values (?,?,?,?)")
+ ResultSet updateCompositionData(String vspId, UDTValue version, String id,
+ String compositionData);
+
+ @Query(
+ "update vsp_network set questionnaire_data=? where vsp_id=? and version=? and network_id=?")
+ ResultSet updateQuestionnaireData(String questionnaireData, String vspId, UDTValue version,
+ String id);
+
+ @Query("delete from vsp_network where vsp_id=? and version=?")
+ ResultSet deleteAll(String vspId, Version version);
+
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/NetworkDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/NetworkDaoFactoryImpl.java
new file mode 100644
index 0000000000..b4360996df
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/NetworkDaoFactoryImpl.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl;
+
+import org.openecomp.sdc.vendorsoftwareproduct.dao.NetworkDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.NetworkDaoFactory;
+
+public class NetworkDaoFactoryImpl extends NetworkDaoFactory {
+ private static final NetworkDao INSTANCE = new NetworkDaoCassandraImpl();
+
+ @Override
+ public NetworkDao createInterface() {
+ return INSTANCE;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/NicDaoCassandraImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/NicDaoCassandraImpl.java
new file mode 100644
index 0000000000..e7e1eed8e0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/NicDaoCassandraImpl.java
@@ -0,0 +1,148 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl;
+
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.UDTValue;
+import com.datastax.driver.mapping.Mapper;
+import com.datastax.driver.mapping.Result;
+import com.datastax.driver.mapping.UDTMapper;
+import com.datastax.driver.mapping.annotations.Accessor;
+import com.datastax.driver.mapping.annotations.Query;
+import org.openecomp.core.dao.impl.CassandraBaseDao;
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.NicDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity;
+import org.openecomp.sdc.versioning.VersioningManagerFactory;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.types.UniqueValueMetadata;
+import org.openecomp.sdc.versioning.types.VersionableEntityMetadata;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+
+public class NicDaoCassandraImpl extends CassandraBaseDao<NicEntity> implements NicDao {
+
+ private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
+ private static final Mapper<NicEntity> mapper =
+ noSqlDb.getMappingManager().mapper(NicEntity.class);
+ private static final NicAccessor accessor =
+ noSqlDb.getMappingManager().createAccessor(NicAccessor.class);
+ private static final UDTMapper<Version> versionMapper =
+ noSqlDb.getMappingManager().udtMapper(Version.class);
+
+ @Override
+ public void registerVersioning(String versionableEntityType) {
+ VersionableEntityMetadata metadata = new VersionableEntityMetadata(
+ mapper.getTableMetadata().getName(),
+ mapper.getTableMetadata().getPartitionKey().get(0).getName(),
+ mapper.getTableMetadata().getPartitionKey().get(1).getName());
+
+
+ metadata.setUniqueValuesMetadata(Collections
+ .singletonList(new UniqueValueMetadata(VendorSoftwareProductConstants.UniqueValues.NIC_NAME,
+ Arrays.asList("vsp_id", "version", "component_id", "name"))));
+
+ VersioningManagerFactory.getInstance().createInterface()
+ .register(versionableEntityType, metadata);
+ }
+
+ @Override
+ protected Mapper<NicEntity> getMapper() {
+ return mapper;
+ }
+
+ @Override
+ protected Object[] getKeys(NicEntity entity) {
+ return new Object[]{entity.getVspId(), versionMapper.toUDT(entity.getVersion()),
+ entity.getComponentId(), entity.getId()};
+ }
+
+ @Override
+ public void create(NicEntity entity) {
+ super.create(entity);
+ }
+
+ @Override
+ public void update(NicEntity entity) {
+ accessor.updateCompositionData(entity.getVspId(), versionMapper.toUDT(entity.getVersion()),
+ entity.getComponentId(), entity.getId(), entity.getCompositionData());
+ }
+
+ @Override
+ public void updateQuestionnaireData(String vspId, Version version, String id, String componentId,
+ String questionnaireData) {
+ accessor.updateQuestionnaireData(questionnaireData, vspId, versionMapper.toUDT(version), id,
+ componentId);
+ }
+
+ @Override
+ public Collection<NicEntity> listByVsp(String vspId, Version version) {
+ return accessor.listByVspId(vspId, versionMapper.toUDT(version)).all();
+ }
+
+ @Override
+ public Collection<NicEntity> list(NicEntity entity) {
+ return accessor.listByComponentId(entity.getVspId(), versionMapper.toUDT(entity.getVersion()),
+ entity.getComponentId()).all();
+ }
+
+ public void deleteByComponentId(String vspId, Version version, String componentId) {
+ accessor.deleteByComponentId(vspId, version, componentId);
+ }
+
+ public void deleteByVspId(String vspId, Version version) {
+ accessor.deleteByVspId(vspId, versionMapper.toUDT(version));
+ }
+
+ @Accessor
+ interface NicAccessor {
+
+ @Query(
+ "select vsp_id, version, component_id, nic_id, composition_data "
+ + "from vsp_component_nic where vsp_id=? and version=? and component_id=?")
+ Result<NicEntity> listByComponentId(String vspId, UDTValue version, String componentId);
+
+ @Query("select * from vsp_component_nic where vsp_id=? and version=?")
+ Result<NicEntity> listByVspId(String vspId, UDTValue version);
+
+ @Query(
+ "insert into vsp_component_nic (vsp_id, version, component_id, nic_id, composition_data) "
+ + "values (?,?,?,?,?)")
+ ResultSet updateCompositionData(String vspId, UDTValue version, String componentId, String id,
+ String compositionData);
+
+ @Query(
+ "update vsp_component_nic set questionnaire_data=? where vsp_id=? and version=? "
+ + "and component_id=? and nic_id=?")
+ ResultSet updateQuestionnaireData(String questionnaireData, String vspId, UDTValue version,
+ String componentId, String id);
+
+ @Query("delete from vsp_component_nic where vsp_id=? and version=? and component_id=?")
+ ResultSet deleteByComponentId(String vspId, Version version, String componentId);
+
+ @Query("delete from vsp_component_nic where vsp_id=? and version=?")
+ ResultSet deleteByVspId(String vspId, UDTValue version);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/NicDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/NicDaoFactoryImpl.java
new file mode 100644
index 0000000000..f4dd8d5a71
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/NicDaoFactoryImpl.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl;
+
+import org.openecomp.sdc.vendorsoftwareproduct.dao.NicDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.NicDaoFactory;
+
+public class NicDaoFactoryImpl extends NicDaoFactory {
+ private static final NicDao INSTANCE = new NicDaoCassandraImpl();
+
+ @Override
+ public NicDao createInterface() {
+ return INSTANCE;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/PackageInfoDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/PackageInfoDaoFactoryImpl.java
new file mode 100644
index 0000000000..8b9bedcd3a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/PackageInfoDaoFactoryImpl.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl;
+
+import org.openecomp.sdc.vendorsoftwareproduct.dao.PackageInfoDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.PackageInfoDaoFactory;
+
+public class PackageInfoDaoFactoryImpl extends PackageInfoDaoFactory {
+ private static final PackageInfoDao INSTANCE = new PackageInfoDaoImpl();
+
+ @Override
+ public PackageInfoDao createInterface() {
+ return INSTANCE;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/PackageInfoDaoImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/PackageInfoDaoImpl.java
new file mode 100644
index 0000000000..9b7b81fe52
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/PackageInfoDaoImpl.java
@@ -0,0 +1,103 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl;
+
+import com.datastax.driver.mapping.Mapper;
+import com.datastax.driver.mapping.Result;
+import com.datastax.driver.mapping.UDTMapper;
+import com.datastax.driver.mapping.annotations.Accessor;
+import com.datastax.driver.mapping.annotations.Query;
+import org.openecomp.core.dao.impl.CassandraBaseDao;
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.PackageInfoDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.PackageInfo;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+public class PackageInfoDaoImpl extends CassandraBaseDao<PackageInfo> implements PackageInfoDao {
+
+ private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
+ private static final Mapper<PackageInfo> mapper =
+ noSqlDb.getMappingManager().mapper(PackageInfo.class);
+ private static final PackageInfoAccessor accessor =
+ noSqlDb.getMappingManager().createAccessor(PackageInfoAccessor.class);
+ private static final UDTMapper<Version> versionMapper =
+ noSqlDb.getMappingManager().udtMapper(Version.class);
+
+ @Override
+ protected Mapper<PackageInfo> getMapper() {
+ return mapper;
+ }
+
+ @Override
+ protected Object[] getKeys(PackageInfo entity) {
+ return new Object[]{entity.getVspId(), versionMapper.toUDT(entity.getVersion())};
+ }
+
+ @Override
+ public Collection<PackageInfo> list(PackageInfo entity) {
+ return accessor.listInfo().all();
+ }
+
+ @Override
+ public List<PackageInfo> listByCategory(String category, String subCategory) {
+ Result<PackageInfo> packages = accessor.listInfo();
+
+ List<PackageInfo> filteredPackages = new ArrayList<>();
+ for (PackageInfo packageInfo : packages) {
+ if (category != null) {
+ if (category.equals(packageInfo.getCategory())) {
+ filteredPackages.add(packageInfo);
+ }
+ } else if (subCategory != null) {
+ if (subCategory.equals(packageInfo.getSubCategory())) {
+ filteredPackages.add(packageInfo);
+ }
+ } else {
+ filteredPackages.add(packageInfo);
+ }
+ }
+
+ return filteredPackages;
+ }
+
+ @Override
+ public void deleteRowTranslateContent(String vspId, Version version) {
+ accessor.deleteRowTranslateContent(vspId, version);
+ }
+
+ @Accessor
+ interface PackageInfoAccessor {
+
+ @Query(
+ "SELECT vsp_id,version,display_name,vsp_name,vsp_description,vendor_name,category,"
+ + "sub_category,vendor_release,package_checksum,package_type FROM package_details")
+ Result<PackageInfo> listInfo();
+
+ @Query("DELETE TRANSLATE_CONTENT FROM package_details WHERE vsp_id=? and version=?")
+ Result<PackageInfo> deleteRowTranslateContent(String vspId, Version version);
+
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ProcessArtifactDaoCassandraImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ProcessArtifactDaoCassandraImpl.java
new file mode 100644
index 0000000000..0e9fd90a13
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ProcessArtifactDaoCassandraImpl.java
@@ -0,0 +1,82 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl;
+
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.UDTValue;
+import com.datastax.driver.mapping.UDTMapper;
+import com.datastax.driver.mapping.annotations.Accessor;
+import com.datastax.driver.mapping.annotations.Query;
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessArtifactDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessArtifactEntity;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.nio.ByteBuffer;
+
+public class ProcessArtifactDaoCassandraImpl implements ProcessArtifactDao {
+
+ private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
+ private static final ProcessArtifactAccessor accessor =
+ noSqlDb.getMappingManager().createAccessor(ProcessArtifactAccessor.class);
+ private static final UDTMapper<Version> versionMapper =
+ noSqlDb.getMappingManager().udtMapper(Version.class);
+
+ @Override
+ public void update(ProcessArtifactEntity entity) {
+ accessor.update(entity.getVspId(), versionMapper.toUDT(entity.getVersion()),
+ entity.getComponentId(), entity.getId(), entity.getArtifactName(), entity.getArtifact());
+ }
+
+ @Override
+ public ProcessArtifactEntity get(ProcessArtifactEntity entity) {
+ return accessor
+ .get(entity.getVspId(), versionMapper.toUDT(entity.getVersion()), entity.getComponentId(),
+ entity.getId());
+ }
+
+ @Override
+ public void delete(ProcessArtifactEntity entity) {
+ accessor.delete(entity.getVspId(), versionMapper.toUDT(entity.getVersion()),
+ entity.getComponentId(), entity.getId());
+ }
+
+ @Accessor
+ interface ProcessArtifactAccessor {
+
+ @Query(
+ "insert into vsp_process (vsp_id, version, component_id, process_id, artifact_name,"
+ + " artifact) values (?,?,?,?,?,?)")
+ ResultSet update(String vspId, UDTValue version, String componentId, String id,
+ String artifactName, ByteBuffer artifact);
+
+ @Query(
+ "select vsp_id, version, component_id, process_id, artifact_name, artifact "
+ + "from vsp_process where vsp_id=? and version=? and component_id=? and process_id=?")
+ ProcessArtifactEntity get(String vspId, UDTValue version, String componentId, String id);
+
+ @Query(
+ "delete artifact_name, artifact from vsp_process where vsp_id=? and version=? and"
+ + " component_id=? and process_id=?")
+ ResultSet delete(String vspId, UDTValue version, String componentId, String id);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ProcessArtifactDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ProcessArtifactDaoFactoryImpl.java
new file mode 100644
index 0000000000..2a5d9013bd
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ProcessArtifactDaoFactoryImpl.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl;
+
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessArtifactDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessArtifactDaoFactory;
+
+public class ProcessArtifactDaoFactoryImpl extends ProcessArtifactDaoFactory {
+ private static final ProcessArtifactDao INSTANCE = new ProcessArtifactDaoCassandraImpl();
+
+ @Override
+ public ProcessArtifactDao createInterface() {
+ return INSTANCE;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ProcessDaoCassandraImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ProcessDaoCassandraImpl.java
new file mode 100644
index 0000000000..b8900eb5d3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ProcessDaoCassandraImpl.java
@@ -0,0 +1,139 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl;
+
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.UDTValue;
+import com.datastax.driver.mapping.Mapper;
+import com.datastax.driver.mapping.Result;
+import com.datastax.driver.mapping.UDTMapper;
+import com.datastax.driver.mapping.annotations.Accessor;
+import com.datastax.driver.mapping.annotations.Query;
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity;
+import org.openecomp.sdc.versioning.VersioningManagerFactory;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.types.UniqueValueMetadata;
+import org.openecomp.sdc.versioning.types.VersionableEntityMetadata;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+
+public class ProcessDaoCassandraImpl implements ProcessDao {
+
+ private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
+ private static final Mapper<ProcessEntity> mapper =
+ noSqlDb.getMappingManager().mapper(ProcessEntity.class);
+ private static final ProcessAccessor accessor =
+ noSqlDb.getMappingManager().createAccessor(ProcessAccessor.class);
+ private static final UDTMapper<Version> versionMapper =
+ noSqlDb.getMappingManager().udtMapper(Version.class);
+
+ @Override
+ public void registerVersioning(String versionableEntityType) {
+ VersionableEntityMetadata metadata = new VersionableEntityMetadata(
+ mapper.getTableMetadata().getName(),
+ mapper.getTableMetadata().getPartitionKey().get(0).getName(),
+ mapper.getTableMetadata().getPartitionKey().get(1).getName());
+
+ metadata.setUniqueValuesMetadata(Collections.singletonList(
+ new UniqueValueMetadata(VendorSoftwareProductConstants.UniqueValues.PROCESS_NAME,
+ Arrays.asList("vsp_id", "version", "component_id", "name"))));
+
+ VersioningManagerFactory.getInstance().createInterface()
+ .register(versionableEntityType, metadata);
+ }
+
+ @Override
+ public Collection<ProcessEntity> list(ProcessEntity entity) {
+ return accessor
+ .list(entity.getVspId(), versionMapper.toUDT(entity.getVersion()), entity.getComponentId())
+ .all();
+ }
+
+ @Override
+ public void create(ProcessEntity entity) {
+ accessor.update(entity.getVspId(), versionMapper.toUDT(entity.getVersion()),
+ entity.getComponentId(), entity.getId(), entity.getName(), entity.getDescription());
+ }
+
+ @Override
+ public void update(ProcessEntity entity) {
+ accessor.update(entity.getVspId(), versionMapper.toUDT(entity.getVersion()),
+ entity.getComponentId(), entity.getId(), entity.getName(), entity.getDescription());
+ }
+
+ @Override
+ public ProcessEntity get(ProcessEntity entity) {
+ return accessor
+ .get(entity.getVspId(), versionMapper.toUDT(entity.getVersion()), entity.getComponentId(),
+ entity.getId());
+ }
+
+ @Override
+ public void delete(ProcessEntity entity) {
+ if (entity.getId() == null) {
+ accessor.deleteAll(entity.getVspId(), versionMapper.toUDT(entity.getVersion()),
+ entity.getComponentId());
+ } else {
+ accessor.delete(entity.getVspId(), versionMapper.toUDT(entity.getVersion()),
+ entity.getComponentId(), entity.getId());
+ }
+ }
+
+ public void deleteAll(ProcessEntity entity) {
+ accessor.deleteAll(entity.getVspId(), versionMapper.toUDT(entity.getVersion()));
+ }
+
+ @Accessor
+ interface ProcessAccessor {
+
+ @Query(
+ "insert into vsp_process (vsp_id, version, component_id, process_id, name, description) "
+ + "values (?,?,?,?,?,?)")
+ ResultSet update(String vspId, UDTValue version, String componentId, String id, String name,
+ String description);
+
+ @Query(
+ "select vsp_id, version, component_id, process_id, name, description, artifact_name "
+ + "from vsp_process where vsp_id=? and version=? and component_id=? and process_id=?")
+ ProcessEntity get(String vspId, UDTValue version, String componentId, String id);
+
+ @Query(
+ "select vsp_id, version, component_id, process_id, name, description, artifact_name "
+ + "from vsp_process where vsp_id=? and version=? and component_id=?")
+ Result<ProcessEntity> list(String vspId, UDTValue version, String componentId);
+
+ @Query(
+ "delete from vsp_process where vsp_id=? and version=? and component_id=? and process_id=?")
+ ResultSet delete(String vspId, UDTValue version, String componentId, String id);
+
+ @Query("delete from vsp_process where vsp_id=? and version=? and component_id=?")
+ ResultSet deleteAll(String vspId, UDTValue version, String componentId);
+
+ @Query("delete from vsp_process where vsp_id=? and version=?")
+ ResultSet deleteAll(String vspId, UDTValue version);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ProcessDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ProcessDaoFactoryImpl.java
new file mode 100644
index 0000000000..4c981d8448
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ProcessDaoFactoryImpl.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl;
+
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessDaoFactory;
+
+public class ProcessDaoFactoryImpl extends ProcessDaoFactory {
+ private static final ProcessDao INSTANCE = new ProcessDaoCassandraImpl();
+
+ @Override
+ public ProcessDao createInterface() {
+ return INSTANCE;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/UploadDataDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/UploadDataDaoFactoryImpl.java
new file mode 100644
index 0000000000..317bc344c4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/UploadDataDaoFactoryImpl.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl;
+
+import org.openecomp.sdc.vendorsoftwareproduct.dao.UploadDataDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.UploadDataDaoFactory;
+
+public class UploadDataDaoFactoryImpl extends UploadDataDaoFactory {
+ private static final UploadDataDao INSTANCE = new UploadDataDaoImpl();
+
+ @Override
+ public UploadDataDao createInterface() {
+ return INSTANCE;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/UploadDataDaoImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/UploadDataDaoImpl.java
new file mode 100644
index 0000000000..df019a4f53
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/UploadDataDaoImpl.java
@@ -0,0 +1,92 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl;
+
+import com.datastax.driver.core.UDTValue;
+import com.datastax.driver.mapping.Mapper;
+import com.datastax.driver.mapping.Result;
+import com.datastax.driver.mapping.UDTMapper;
+import com.datastax.driver.mapping.annotations.Accessor;
+import com.datastax.driver.mapping.annotations.Query;
+import org.openecomp.core.dao.impl.CassandraBaseDao;
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.UploadDataDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.UploadDataEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.nio.ByteBuffer;
+import java.util.Collection;
+
+public class UploadDataDaoImpl extends CassandraBaseDao<UploadDataEntity> implements UploadDataDao {
+
+ private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
+ private static final Mapper<UploadDataEntity> mapper =
+ noSqlDb.getMappingManager().mapper(UploadDataEntity.class);
+ private static final UploadDataAccessor accessor =
+ noSqlDb.getMappingManager().createAccessor(UploadDataAccessor.class);
+ private static final UDTMapper<Version> versionMapper =
+ noSqlDb.getMappingManager().udtMapper(Version.class);
+
+ @Override
+ protected Mapper<UploadDataEntity> getMapper() {
+ return mapper;
+ }
+
+ @Override
+ protected Object[] getKeys(UploadDataEntity entity) {
+ return new Object[]{entity.getId(), versionMapper.toUDT(entity.getVersion())};
+ }
+
+ @Override
+ public Collection<UploadDataEntity> list(UploadDataEntity entity) {
+ return accessor.listAll().all();
+ }
+
+ @Override
+ public void deleteContentDataAndValidationData(String vspId, Version version) {
+ accessor.deleteContentDataAndValidationData(vspId, versionMapper.toUDT(version));
+ }
+
+ @Override
+ public ByteBuffer getContentData(String vspId, Version version) {
+ return accessor.getContentData(vspId, version).one().getContentData();
+ }
+
+
+ @Accessor
+ interface UploadDataAccessor {
+
+ @Query(
+ "SELECT package_name, package_version, content_data, validation_data FROM vsp_information")
+ Result<UploadDataEntity> listAll();
+
+ @Query(
+ "DELETE package_name, package_version, content_data, validation_data FROM vsp_information "
+ + "WHERE vsp_id=? and version=?")
+ Result<VspDetails> deleteContentDataAndValidationData(String vspId, UDTValue udtValue);
+
+ @Query("SELECT CONTENT_DATA FROM vsp_information WHERE vsp_id=? and version=?")
+ Result<UploadDataEntity> getContentData(String vspId, Version version);
+
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductDaoFactoryImpl.java
new file mode 100644
index 0000000000..587f8ac036
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductDaoFactoryImpl.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl;
+
+import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory;
+
+public class VendorSoftwareProductDaoFactoryImpl extends VendorSoftwareProductDaoFactory {
+ private static final VendorSoftwareProductDao INSTANCE = new VendorSoftwareProductDaoImpl();
+
+ @Override
+ public VendorSoftwareProductDao createInterface() {
+ return INSTANCE;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductDaoImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductDaoImpl.java
new file mode 100644
index 0000000000..f592e63280
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductDaoImpl.java
@@ -0,0 +1,349 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl;
+
+import org.openecomp.core.model.dao.EnrichedServiceArtifactDao;
+import org.openecomp.core.model.dao.EnrichedServiceArtifactDaoFactory;
+import org.openecomp.core.model.dao.ServiceArtifactDaoFactory;
+import org.openecomp.core.model.dao.ServiceArtifactDaoInter;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentArtifactDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentArtifactDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.NetworkDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.NetworkDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.NicDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.NicDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.PackageInfoDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.PackageInfoDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessArtifactDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessArtifactDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.UploadDataDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.UploadDataDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.VspQuestionnaireDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.VspQuestionnaireDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentArtifactEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.PackageInfo;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessArtifactEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.UploadDataEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspQuestionnaireEntity;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.nio.ByteBuffer;
+import java.util.Collection;
+import java.util.List;
+import java.util.Objects;
+
+public class VendorSoftwareProductDaoImpl implements VendorSoftwareProductDao {
+
+ private static final VendorSoftwareProductInfoDao vspInfoDao =
+ VendorSoftwareProductInfoDaoFactory.getInstance().createInterface();
+ private static final PackageInfoDao packageInfoDao =
+ PackageInfoDaoFactory.getInstance().createInterface();
+ private static final UploadDataDao uploadDataDao =
+ UploadDataDaoFactory.getInstance().createInterface();
+ private static final VspQuestionnaireDao vspQuestionnaireDao =
+ VspQuestionnaireDaoFactory.getInstance().createInterface();
+ private static final NetworkDao networkDao = NetworkDaoFactory.getInstance().createInterface();
+ private static final ComponentDao componentDao =
+ ComponentDaoFactory.getInstance().createInterface();
+ private static final NicDao nicDao = NicDaoFactory.getInstance().createInterface();
+ private static final ProcessDao processDao = ProcessDaoFactory.getInstance().createInterface();
+ private static final ProcessArtifactDao processArtifactDao =
+ ProcessArtifactDaoFactory.getInstance().createInterface();
+ private static final ComponentArtifactDao componentArtifactDao =
+ ComponentArtifactDaoFactory.getInstance().createInterface();
+ private static final ServiceArtifactDaoInter artifactDao =
+ ServiceArtifactDaoFactory.getInstance().createInterface();
+ private static final EnrichedServiceArtifactDao enrichArtifactDao =
+ EnrichedServiceArtifactDaoFactory.getInstance().createInterface();
+
+ @Override
+ public void registerVersioning(String versionableEntityType) {
+ vspInfoDao.registerVersioning(versionableEntityType);
+ vspQuestionnaireDao.registerVersioning(versionableEntityType);
+ networkDao.registerVersioning(versionableEntityType);
+ componentDao.registerVersioning(versionableEntityType);
+ nicDao.registerVersioning(versionableEntityType);
+ processDao.registerVersioning(versionableEntityType);
+ }
+
+ @Override
+ public void createVendorSoftwareProductInfo(VspDetails vspDetails) {
+ vspInfoDao.create(vspDetails);
+ }
+
+ @Override
+ public Collection<VspDetails> listVendorSoftwareProductsInfo() {
+ return vspInfoDao.list(new VspDetails());
+ }
+
+ public VspDetails getVendorSoftwareProductInfo(VspDetails vspDetails) {
+ return vspInfoDao.get(vspDetails);
+ }
+
+
+ @Override
+ public void updateVendorSoftwareProductInfo(VspDetails vspDetails) {
+ vspInfoDao.update(vspDetails);
+ }
+
+ @Override
+ public void deleteVendorSoftwareProductInfo(VspDetails vspDetails) {
+ vspInfoDao.delete(vspDetails);
+ }
+
+ @Override
+ public void updateUploadData(UploadDataEntity uploadData) {
+ uploadDataDao.update(uploadData);
+ }
+
+ @Override
+ public UploadDataEntity getUploadData(UploadDataEntity uploadData) {
+ return uploadDataDao.get(uploadData);
+ }
+
+ @Override
+ public ByteBuffer getContentData(UploadDataEntity uploadDataEntity) {
+ return uploadDataDao.getContentData(uploadDataEntity.getId(), uploadDataEntity.getVersion());
+ }
+
+ @Override
+ public void insertPackageDetails(PackageInfo packageInfo) {
+ packageInfoDao.update(packageInfo);
+ }
+
+ @Override
+ public PackageInfo getPackageInfo(PackageInfo packageInfo) {
+ return packageInfoDao.get(packageInfo);
+ }
+
+ @Override
+ public void deletePackageInfo(PackageInfo packageInfo) {
+ packageInfoDao.delete(packageInfo);
+ }
+
+ @Override
+ public Collection<NetworkEntity> listNetworks(String vspId, Version version) {
+ return networkDao.list(new NetworkEntity(vspId, version, null));
+ }
+
+ @Override
+ public void createNetwork(NetworkEntity network) {
+ networkDao.create(network);
+ }
+
+ @Override
+ public void updateNetwork(NetworkEntity networkEntity) {
+ networkDao.update(networkEntity);
+ }
+
+ @Override
+ public NetworkEntity getNetwork(String vspId, Version version, String networkId) {
+ return networkDao.get(new NetworkEntity(vspId, version, networkId));
+ }
+
+ @Override
+ public void deleteNetwork(String vspId, Version version) {
+ NetworkEntity networkEntity = new NetworkEntity(vspId, version, null);
+ networkDao.delete(networkEntity);
+ }
+
+ @Override
+ public List<PackageInfo> listPackages(String category, String subCategory) {
+ return packageInfoDao.listByCategory(category, subCategory);
+ }
+
+
+ @Override
+ public Collection<ComponentEntity> listComponents(String vspId, Version version) {
+ return componentDao.list(new ComponentEntity(vspId, version, null));
+ }
+
+ @Override
+ public void createComponent(ComponentEntity component) {
+ componentDao.create(component);
+ }
+
+ @Override
+ public void updateComponent(ComponentEntity component) {
+ componentDao.update(component);
+ }
+
+ @Override
+ public ComponentEntity getComponent(String vspId, Version version, String componentId) {
+ return componentDao.get(new ComponentEntity(vspId, version, componentId));
+ }
+
+ @Override
+ public Collection<ComponentEntity> listComponentsQuestionnaire(String vspId, Version version) {
+ return componentDao.listQuestionnaires(vspId, version);
+ }
+
+ @Override
+ public void updateComponentQuestionnaire(String vspId, Version version, String componentId,
+ String questionnaireData) {
+ componentDao.updateQuestionnaireData(vspId, version, componentId, questionnaireData);
+ }
+
+ @Override
+ public void deleteComponent(String vspId, Version version) {
+ ComponentEntity componentEntity = new ComponentEntity(vspId, version, null);
+ componentDao.delete(componentEntity);
+ }
+
+ @Override
+ public Collection<ProcessEntity> listProcesses(String vspId, Version version,
+ String componentId) {
+ return processDao.list(new ProcessEntity(vspId, version, componentId, null));
+ }
+
+ @Override
+ public void deleteProcesses(String vspId, Version version, String componentId) {
+ processDao.delete(new ProcessEntity(vspId, version, componentId, null));
+ }
+
+ @Override
+ public ProcessEntity getProcess(String vspId, Version version, String componentId,
+ String processId) {
+ return processDao.get(new ProcessEntity(vspId, version, componentId, processId));
+ }
+
+ @Override
+ public void createProcess(ProcessEntity processEntity) {
+ processDao.create(processEntity);
+ }
+
+ @Override
+ public void updateProcess(ProcessEntity processEntity) {
+ processDao.update(processEntity);
+ }
+
+ @Override
+ public void deleteProcess(String vspId, Version version, String componentId, String processId) {
+ processDao.delete(new ProcessEntity(vspId, version, componentId, processId));
+ }
+
+ @Override
+ public void uploadProcessArtifact(String vspId, Version version, String componentId,
+ String processId, byte[] artifact, String artifactName) {
+ ProcessArtifactEntity processArtifact =
+ new ProcessArtifactEntity(vspId, version, componentId, processId);
+ processArtifact.setArtifact(ByteBuffer.wrap(artifact));
+ processArtifact.setArtifactName(artifactName);
+ processArtifactDao.update(processArtifact);
+ }
+
+ @Override
+ public ProcessArtifactEntity getProcessArtifact(String vspId, Version version, String componentId,
+ String processId) {
+ return processArtifactDao
+ .get(new ProcessArtifactEntity(vspId, version, componentId, processId));
+ }
+
+ @Override
+ public void deleteProcessArtifact(String vspId, Version version, String componentId,
+ String processId) {
+ processArtifactDao.delete(new ProcessArtifactEntity(vspId, version, componentId, processId));
+ }
+
+ @Override
+ public VspQuestionnaireEntity getQuestionnaire(String vspId, Version version) {
+ return vspQuestionnaireDao.get(new VspQuestionnaireEntity(vspId, version));
+ }
+
+ @Override
+ public void updateQuestionnaire(String vspId, Version version, String questionnaireData) {
+ vspQuestionnaireDao.updateQuestionnaireData(vspId, version, questionnaireData);
+ }
+
+ @Override
+ public Collection<NicEntity> listNics(String vspId, Version version, String componentId) {
+ return nicDao.list(new NicEntity(vspId, version, componentId, null));
+ }
+
+ @Override
+ public void createNic(NicEntity nic) {
+ nicDao.create(nic);
+ }
+
+ @Override
+ public NicEntity getNic(String vspId, Version version, String componentId, String nicId) {
+ return nicDao.get(new NicEntity(vspId, version, componentId, nicId));
+ }
+
+ @Override
+ public void updateNic(NicEntity nicEntity) {
+ nicDao.update(nicEntity);
+ }
+
+ @Override
+ public void updateNicQuestionnaire(String vspId, Version version, String componentId,
+ String nicId, String questionnaireData) {
+ nicDao.updateQuestionnaireData(vspId, version, componentId, nicId, questionnaireData);
+ }
+
+ @Override
+ public Collection<NicEntity> listNicsByVsp(String vspId, Version version) {
+ return nicDao.listByVsp(vspId, version);
+ }
+
+ @Override
+ public void deleteNic(String vspId, Version version, String componentId) {
+ NicEntity nicEntity = new NicEntity(vspId, version, componentId, null);
+ nicDao.delete(nicEntity);
+ }
+
+ @Override
+ public void deleteUploadData(String vspId, Version version) {
+ networkDao.deleteAll(vspId, version);
+ nicDao.deleteByVspId(vspId, version);
+ artifactDao.delete(vspId, version);
+ enrichArtifactDao.delete(vspId, version);
+ ComponentArtifactEntity componentArtifactEntity =
+ new ComponentArtifactEntity(vspId, version, null, null);
+ ProcessEntity processEntity = new ProcessEntity(vspId, version, null, null);
+ componentArtifactDao.deleteAll(componentArtifactEntity);
+ processDao.deleteAll(processEntity);
+ componentDao.deleteAll(vspId, version);
+ uploadDataDao.deleteContentDataAndValidationData(vspId, version);
+ }
+
+ @Override
+ public void updateVspLatestModificationTime(String vspId, Version version) {
+ if (Objects.isNull(vspId) || Objects.isNull(version)) {
+ return;
+ }
+
+ VspDetails retrieved = getVendorSoftwareProductInfo(new VspDetails(vspId, version));
+ updateVendorSoftwareProductInfo(retrieved);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductInfoDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductInfoDaoFactoryImpl.java
new file mode 100644
index 0000000000..1dcb3f4c66
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductInfoDaoFactoryImpl.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl;
+
+import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDaoFactory;
+
+public class VendorSoftwareProductInfoDaoFactoryImpl extends VendorSoftwareProductInfoDaoFactory {
+ private static final VendorSoftwareProductInfoDao INSTANCE =
+ new VendorSoftwareProductInfoDaoImpl();
+
+ @Override
+ public VendorSoftwareProductInfoDao createInterface() {
+ return INSTANCE;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductInfoDaoImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductInfoDaoImpl.java
new file mode 100644
index 0000000000..c3096dab29
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductInfoDaoImpl.java
@@ -0,0 +1,83 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl;
+
+import com.datastax.driver.mapping.Mapper;
+import com.datastax.driver.mapping.Result;
+import com.datastax.driver.mapping.UDTMapper;
+import com.datastax.driver.mapping.annotations.Accessor;
+import com.datastax.driver.mapping.annotations.Query;
+import org.openecomp.core.dao.impl.CassandraBaseDao;
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
+import org.openecomp.sdc.versioning.VersioningManagerFactory;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.types.VersionableEntityMetadata;
+
+import java.util.Collection;
+
+public class VendorSoftwareProductInfoDaoImpl extends CassandraBaseDao<VspDetails>
+ implements VendorSoftwareProductInfoDao {
+
+ private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
+ private static final Mapper<VspDetails> mapper =
+ noSqlDb.getMappingManager().mapper(VspDetails.class);
+ private static final VendorSoftwareProductInfoAccessor accessor =
+ noSqlDb.getMappingManager().createAccessor(VendorSoftwareProductInfoAccessor.class);
+ private static final UDTMapper<Version> versionMapper =
+ noSqlDb.getMappingManager().udtMapper(Version.class);
+
+ @Override
+ public void registerVersioning(String versionableEntityType) {
+ VersioningManagerFactory.getInstance().createInterface()
+ .register(versionableEntityType, new VersionableEntityMetadata(
+ mapper.getTableMetadata().getName(),
+ mapper.getTableMetadata().getPartitionKey().get(0).getName(),
+ mapper.getTableMetadata().getPartitionKey().get(1).getName()));
+ }
+
+ @Override
+ protected Mapper<VspDetails> getMapper() {
+ return mapper;
+ }
+
+ @Override
+ protected Object[] getKeys(VspDetails entity) {
+ return new Object[]{entity.getId(), versionMapper.toUDT(entity.getVersion())};
+ }
+
+ @Override
+ public Collection<VspDetails> list(VspDetails entity) {
+ return accessor.listAll().all();
+ }
+
+ @Accessor
+ interface VendorSoftwareProductInfoAccessor {
+
+ @Query(
+ "SELECT vsp_id,version,name,description,icon,category,sub_category,vendor_id,"
+ + "vlm_version,license_agreement,feature_groups FROM vsp_information")
+ Result<VspDetails> listAll();
+
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VspQuestionnaireDaoCassandraImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VspQuestionnaireDaoCassandraImpl.java
new file mode 100644
index 0000000000..ef4dd0de74
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VspQuestionnaireDaoCassandraImpl.java
@@ -0,0 +1,72 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl;
+
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.UDTValue;
+import com.datastax.driver.mapping.Mapper;
+import com.datastax.driver.mapping.UDTMapper;
+import com.datastax.driver.mapping.annotations.Accessor;
+import com.datastax.driver.mapping.annotations.Query;
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.VspQuestionnaireDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspQuestionnaireEntity;
+import org.openecomp.sdc.versioning.VersioningManagerFactory;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.types.VersionableEntityMetadata;
+
+public class VspQuestionnaireDaoCassandraImpl implements VspQuestionnaireDao {
+
+ private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
+ private static final Mapper<VspQuestionnaireEntity> mapper =
+ noSqlDb.getMappingManager().mapper(VspQuestionnaireEntity.class);
+ private static final VspQuestionnaireAccessor accessor =
+ noSqlDb.getMappingManager().createAccessor(VspQuestionnaireAccessor.class);
+ private static final UDTMapper<Version> versionMapper =
+ noSqlDb.getMappingManager().udtMapper(Version.class);
+
+ @Override
+ public void registerVersioning(String versionableEntityType) {
+ VersioningManagerFactory.getInstance().createInterface()
+ .register(versionableEntityType, new VersionableEntityMetadata(
+ mapper.getTableMetadata().getName(),
+ mapper.getTableMetadata().getPartitionKey().get(0).getName(),
+ mapper.getTableMetadata().getPartitionKey().get(1).getName()));
+ }
+
+ @Override
+ public VspQuestionnaireEntity get(VspQuestionnaireEntity entity) {
+ return mapper.get(entity.getId(), versionMapper.toUDT(entity.getVersion()));
+ }
+
+ @Override
+ public void updateQuestionnaireData(String id, Version version, String questionnaireData) {
+ accessor.updateQuestionnaireData(questionnaireData, id, versionMapper.toUDT(version));
+ }
+
+ @Accessor
+ interface VspQuestionnaireAccessor {
+
+ @Query("update vsp_information set questionnaire_data=? where vsp_id=? and version=?")
+ ResultSet updateQuestionnaireData(String questionnaireData, String id, UDTValue version);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VspQuestionnaireDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VspQuestionnaireDaoFactoryImpl.java
new file mode 100644
index 0000000000..aa91302ca2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VspQuestionnaireDaoFactoryImpl.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl;
+
+import org.openecomp.sdc.vendorsoftwareproduct.dao.VspQuestionnaireDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.VspQuestionnaireDaoFactory;
+
+public class VspQuestionnaireDaoFactoryImpl extends VspQuestionnaireDaoFactory {
+ private static final VspQuestionnaireDao INSTANCE = new VspQuestionnaireDaoCassandraImpl();
+
+ @Override
+ public VspQuestionnaireDao createInterface() {
+ return INSTANCE;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ServiceModelDaoFactoryTest.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ServiceModelDaoFactoryTest.java
new file mode 100644
index 0000000000..2c8ffb1ded
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ServiceModelDaoFactoryTest.java
@@ -0,0 +1,97 @@
+package org.openecomp.sdc.vendorsoftwareproduct.dao;
+
+import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.core.model.dao.ServiceModelDaoFactory;
+import org.openecomp.core.model.types.ServiceArtifact;
+import org.openecomp.core.utilities.CommonMethods;
+import org.openecomp.core.utilities.file.FileContentHandler;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class ServiceModelDaoFactoryTest {
+
+ private static final String vspId = CommonMethods.nextUuId();
+ private static final Version version = Version.valueOf("1.0");
+ private static final String baseServiceTemplateName = "baseYaml.yaml";
+ private static String artifact001;
+
+
+// @Test
+ public void storeServiceModelTest() {
+
+
+ ToscaServiceModel model = getToscaServiceModel();
+ ServiceModelDaoFactory.getInstance().createInterface().storeServiceModel(vspId, version, model);
+ }
+
+
+// @Test(dependsOnMethods = "storeServiceModelTest")
+ public void getServiceModelTest() {
+ Object model =
+ ServiceModelDaoFactory.getInstance().createInterface().getServiceModel(vspId, version);
+ Assert.assertNotNull(model);
+ Assert.assertTrue(model instanceof ToscaServiceModel);
+ if (model instanceof ToscaServiceModel) {
+
+ artifact001 =
+ (String) ((ToscaServiceModel) model).getArtifactFiles().getFileList().toArray()[0];
+ }
+ }
+
+// @Test(dependsOnMethods = "getServiceModelTest")
+ public void getServiceModelInfoTest() {
+ Object info = ServiceModelDaoFactory.getInstance().createInterface()
+ .getServiceModelInfo(vspId, version, artifact001);
+ Assert.assertNotNull(info);
+ Assert.assertTrue(info instanceof ServiceArtifact);
+ if (info instanceof ServiceArtifact) {
+ Assert.assertEquals(((ServiceArtifact) info).getName(), artifact001);
+ }
+ }
+
+ private ToscaServiceModel getToscaServiceModel() {
+
+ Map<String, ServiceTemplate> serviceTemplates = getServiceTemplates(baseServiceTemplateName);
+ FileContentHandler artifacts = getArtifacts();
+ return new ToscaServiceModel(artifacts, serviceTemplates, baseServiceTemplateName);
+ }
+
+
+ private Map<String, ServiceTemplate> getServiceTemplates(String base) {
+
+ Map<String, ServiceTemplate> serviceTemplates = new HashMap<>();
+
+ serviceTemplates.put(base, getServiceTemplate());
+ serviceTemplates.put("SERV1", getServiceTemplate());
+ serviceTemplates.put("SERV2", getServiceTemplate());
+ serviceTemplates.put("SERV3", getServiceTemplate());
+ serviceTemplates.put("SERV4", getServiceTemplate());
+
+ return serviceTemplates;
+ }
+
+ public FileContentHandler getArtifacts() {
+ Map<String, byte[]> artifacts = new HashMap<>();
+ artifacts.put("art1", "this is art1".getBytes());
+ artifacts.put("art2", ("this is art2 desc:" + CommonMethods.nextUuId()).getBytes());
+ artifacts.put("art2", ("this is art3 desc:" + CommonMethods.nextUuId()).getBytes());
+ artifacts.put("art2", ("this is art4 desc:" + CommonMethods.nextUuId()).getBytes());
+
+ FileContentHandler fileContentHandler = new FileContentHandler();
+ fileContentHandler.putAll(artifacts);
+ return fileContentHandler;
+ }
+
+ public ServiceTemplate getServiceTemplate() {
+ ServiceTemplate serviceTemplate = new ServiceTemplate();
+ serviceTemplate.setTosca_definitions_version("version 1.0");
+ serviceTemplate.setDescription(CommonMethods.nextUuId());
+ return serviceTemplate;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/pom.xml b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/pom.xml
new file mode 100644
index 0000000000..8eabd76102
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/pom.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-lib</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+
+ <artifactId>openecomp-sdc-vendor-software-product-lib</artifactId>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>openecomp-sdc-vendor-software-product-api</module>
+ <module>openecomp-sdc-vendor-software-product-core</module>
+ </modules>
+
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/pom.xml b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/pom.xml
new file mode 100644
index 0000000000..180410dcf0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/pom.xml
@@ -0,0 +1,71 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-lib</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../..</relativePath>
+ </parent>
+
+ <artifactId>openecomp-sdc-versioning-api</artifactId>
+ <name>openecomp-sdc-versioning-api</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-facade-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-facade-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-nosqldb-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</artifactId>
+ <version>${hibernate.validator.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>javax.el-api</artifactId>
+ <version>${javax.el-api.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.web</groupId>
+ <artifactId>javax.el</artifactId>
+ <version>2.2.4</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <scope>test</scope>
+ <version>1.10.19</version>
+ </dependency>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <scope>test</scope>
+ <version>6.8.5</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>snakeyaml</artifactId>
+ <groupId>org.yaml</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ <version>RELEASE</version>
+ </dependency>
+ </dependencies>
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/VersioningManager.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/VersioningManager.java
new file mode 100644
index 0000000000..7fab25456c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/VersioningManager.java
@@ -0,0 +1,57 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning;
+
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.types.VersionInfo;
+import org.openecomp.sdc.versioning.types.VersionableEntityAction;
+import org.openecomp.sdc.versioning.types.VersionableEntityMetadata;
+
+import java.util.Map;
+
+public interface VersioningManager {
+
+ void register(String entityType, VersionableEntityMetadata entityMetadata);
+
+ Version create(String entityType, String entityId, String user);
+
+ void delete(String entityType, String entityId, String user);
+
+ void undoDelete(String entityType, String entityId, String user);
+
+ Version checkout(String entityType, String entityId, String user);
+
+ Version undoCheckout(String entityType, String entityId, String user);
+
+ Version checkin(String entityType, String entityId, String user, String checkinDescription);
+
+ Version submit(String entityType, String entityId, String user, String submitDescription);
+
+ VersionInfo getEntityVersionInfo(String entityType, String entityId, String user,
+ VersionableEntityAction action);
+
+ Map<String, VersionInfo> listEntitiesVersionInfo(String entityType, String user,
+ VersionableEntityAction action);
+
+ Map<String, VersionInfo> listDeletedEntitiesVersionInfo(String entityType, String user,
+ VersionableEntityAction action);
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/VersioningManagerFactory.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/VersioningManagerFactory.java
new file mode 100644
index 0000000000..089777bbe6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/VersioningManagerFactory.java
@@ -0,0 +1,31 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+public abstract class VersioningManagerFactory extends AbstractComponentFactory<VersioningManager> {
+
+ public static VersioningManagerFactory getInstance() {
+ return AbstractFactory.getInstance(VersioningManagerFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/VersioningUtil.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/VersioningUtil.java
new file mode 100644
index 0000000000..d51f8c0a2b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/VersioningUtil.java
@@ -0,0 +1,187 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning;
+
+import org.openecomp.core.dao.BaseDao;
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.dao.types.VersionableEntity;
+import org.openecomp.sdc.versioning.errors.RequestedVersionInvalidErrorBuilder;
+import org.openecomp.sdc.versioning.errors.VersionableSubEntityNotFoundErrorBuilder;
+import org.openecomp.sdc.versioning.types.VersionInfo;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+/**
+ * The type Versioning util.
+ */
+public class VersioningUtil {
+
+ /**
+ * Validate entity existence.
+ *
+ * @param <T> the type parameter
+ * @param retrievedEntity the retrieved entity
+ * @param inputEntity the input entity
+ * @param firstClassCitizenType the first class citizen type
+ */
+ public static <T extends VersionableEntity> void validateEntityExistence(Object retrievedEntity,
+ T inputEntity,
+ String firstClassCitizenType) {
+ if (retrievedEntity == null) {
+ throw new CoreException(new VersionableSubEntityNotFoundErrorBuilder(
+ inputEntity.getEntityType(),
+ inputEntity.getId(),
+ firstClassCitizenType,
+ inputEntity.getFirstClassCitizenId(),
+ inputEntity.getVersion()).build());
+ }
+ }
+
+ /**
+ * Validate entities existence.
+ *
+ * @param <T> the type parameter
+ * @param <D> the type parameter
+ * @param entityIds the entity ids
+ * @param entity the entity
+ * @param entityDao the entity dao
+ * @param firstClassCitizenType the first class citizen type
+ */
+ public static <T extends VersionableEntity, D extends BaseDao<T>> void validateEntitiesExistence(
+ Set<String> entityIds, T entity, D entityDao, String firstClassCitizenType) {
+ if (entityIds == null) {
+ return;
+ }
+
+ List<String> nonExistingIds = new ArrayList<>();
+ for (String entityId : entityIds) {
+ entity.setId(entityId);
+ if (entityDao.get(entity) == null) {
+ nonExistingIds.add(entityId);
+ }
+ }
+
+ if (nonExistingIds.size() > 0) {
+ if (nonExistingIds.size() == 1) {
+ throw new CoreException(new VersionableSubEntityNotFoundErrorBuilder(
+ entity.getEntityType(),
+ nonExistingIds.get(0),
+ firstClassCitizenType,
+ entity.getFirstClassCitizenId(),
+ entity.getVersion()).build());
+ }
+ throw new CoreException(new VersionableSubEntityNotFoundErrorBuilder(
+ entity.getEntityType(),
+ nonExistingIds,
+ firstClassCitizenType,
+ entity.getFirstClassCitizenId(),
+ entity.getVersion()).build());
+ }
+ }
+
+ /**
+ * Validate contained entities existence.
+ *
+ * @param <T> the type parameter
+ * @param containedEntityType the contained entity type
+ * @param inputContainedEntityIds the input contained entity ids
+ * @param containingEntity the containing entity
+ * @param retrievedContainedEntityIds the retrieved contained entity ids
+ */
+ public static <T extends VersionableEntity> void validateContainedEntitiesExistence(
+ String containedEntityType, Set<String> inputContainedEntityIds, T containingEntity,
+ Set<String> retrievedContainedEntityIds) {
+ if (inputContainedEntityIds == null) {
+ return;
+ }
+
+ List<String> nonExistingIds = inputContainedEntityIds.stream()
+ .filter(entityId -> !retrievedContainedEntityIds.contains(entityId))
+ .collect(Collectors.toList());
+
+ if (nonExistingIds.size() > 0) {
+ if (nonExistingIds.size() == 1) {
+ throw new CoreException(new VersionableSubEntityNotFoundErrorBuilder(
+ containedEntityType,
+ nonExistingIds.get(0),
+ containingEntity.getEntityType(),
+ containingEntity.getId(),
+ containingEntity.getVersion()).build());
+ }
+ throw new CoreException(new VersionableSubEntityNotFoundErrorBuilder(
+ containedEntityType,
+ nonExistingIds,
+ containingEntity.getEntityType(),
+ containingEntity.getId(),
+ containingEntity.getVersion()).build());
+ }
+ }
+
+ /**
+ * Resolve version version.
+ *
+ * @param requestedVersion the requested version
+ * @param versionInfo the version info
+ * @param finalOnly the final only
+ * @return the version
+ */
+ public static Version resolveVersion(Version requestedVersion, VersionInfo versionInfo,
+ boolean finalOnly) {
+ if (requestedVersion == null) {
+ if (finalOnly) {
+ if (versionInfo.getLatestFinalVersion() == null) {
+ throw new CoreException(new RequestedVersionInvalidErrorBuilder().build());
+ }
+ requestedVersion = versionInfo.getLatestFinalVersion();
+ } else {
+ requestedVersion = versionInfo.getActiveVersion();
+ }
+ } else {
+ if ((finalOnly && !requestedVersion.isFinal())
+ || !versionInfo.getViewableVersions().contains(requestedVersion)) {
+ throw new CoreException(new RequestedVersionInvalidErrorBuilder().build());
+ }
+ }
+ return requestedVersion;
+ }
+
+ /**
+ * Resolve version version.
+ *
+ * @param requestedVersion the requested version
+ * @param versionInfo the version info
+ * @return the version
+ */
+ public static Version resolveVersion(Version requestedVersion, VersionInfo versionInfo) {
+ if (requestedVersion == null) {
+ requestedVersion = versionInfo.getActiveVersion();
+ } else {
+ if (!versionInfo.getViewableVersions().contains(requestedVersion)) {
+ throw new CoreException(new RequestedVersionInvalidErrorBuilder().build());
+ }
+ }
+ return requestedVersion;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionHistoryDao.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionHistoryDao.java
new file mode 100644
index 0000000000..f90265aeb6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionHistoryDao.java
@@ -0,0 +1,27 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.dao;
+
+import org.openecomp.core.dao.BaseDao;
+import org.openecomp.sdc.versioning.dao.types.VersionHistoryEntity;
+
+public interface VersionHistoryDao extends BaseDao<VersionHistoryEntity> {
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionHistoryDaoFactory.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionHistoryDaoFactory.java
new file mode 100644
index 0000000000..9ea8d714b0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionHistoryDaoFactory.java
@@ -0,0 +1,30 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.dao;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+public abstract class VersionHistoryDaoFactory extends AbstractComponentFactory<VersionHistoryDao> {
+ public static VersionHistoryDaoFactory getInstance() {
+ return AbstractFactory.getInstance(VersionHistoryDaoFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionInfoDao.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionInfoDao.java
new file mode 100644
index 0000000000..260214eb07
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionInfoDao.java
@@ -0,0 +1,28 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.dao;
+
+import org.openecomp.core.dao.BaseDao;
+import org.openecomp.sdc.versioning.dao.types.VersionInfoEntity;
+
+public interface VersionInfoDao extends BaseDao<VersionInfoEntity> {
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionInfoDaoFactory.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionInfoDaoFactory.java
new file mode 100644
index 0000000000..ebdb1a590b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionInfoDaoFactory.java
@@ -0,0 +1,30 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.dao;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+public abstract class VersionInfoDaoFactory extends AbstractComponentFactory<VersionInfoDao> {
+ public static VersionInfoDaoFactory getInstance() {
+ return AbstractFactory.getInstance(VersionInfoDaoFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionInfoDeletedDao.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionInfoDeletedDao.java
new file mode 100644
index 0000000000..cb6c050520
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionInfoDeletedDao.java
@@ -0,0 +1,29 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.dao;
+
+
+import org.openecomp.core.dao.BaseDao;
+import org.openecomp.sdc.versioning.dao.types.VersionInfoDeletedEntity;
+
+public interface VersionInfoDeletedDao extends BaseDao<VersionInfoDeletedEntity> {
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionInfoDeletedDaoFactory.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionInfoDeletedDaoFactory.java
new file mode 100644
index 0000000000..d14cbfeb0b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionInfoDeletedDaoFactory.java
@@ -0,0 +1,32 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.dao;
+
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+public abstract class VersionInfoDeletedDaoFactory
+ extends AbstractComponentFactory<VersionInfoDeletedDao> {
+ public static VersionInfoDeletedDaoFactory getInstance() {
+ return AbstractFactory.getInstance(VersionInfoDeletedDaoFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionableDao.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionableDao.java
new file mode 100644
index 0000000000..12cef62f44
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionableDao.java
@@ -0,0 +1,25 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.dao;
+
+public interface VersionableDao {
+ void registerVersioning(String versionableEntityType);
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionableEntityDao.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionableEntityDao.java
new file mode 100644
index 0000000000..8709a983a3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionableEntityDao.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.dao;
+
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.types.VersionableEntityMetadata;
+
+public interface VersionableEntityDao {
+
+ void initVersion(VersionableEntityMetadata versionableTableMetadata, String entityId,
+ Version baseVersion, Version newVersion);
+
+ void deleteVersion(VersionableEntityMetadata versionableTableMetadata, String entityId,
+ Version versionToDelete);
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionableEntityDaoFactory.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionableEntityDaoFactory.java
new file mode 100644
index 0000000000..be3c635be2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionableEntityDaoFactory.java
@@ -0,0 +1,31 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.dao;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+public abstract class VersionableEntityDaoFactory
+ extends AbstractComponentFactory<VersionableEntityDao> {
+ public static VersionableEntityDaoFactory getInstance() {
+ return AbstractFactory.getInstance(VersionableEntityDaoFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/UserCandidateVersion.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/UserCandidateVersion.java
new file mode 100644
index 0000000000..ca044142de
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/UserCandidateVersion.java
@@ -0,0 +1,56 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.dao.types;
+
+import com.datastax.driver.mapping.annotations.Frozen;
+import com.datastax.driver.mapping.annotations.UDT;
+
+@UDT(name = "user_candidate_version", keyspace = "dox")
+public class UserCandidateVersion {
+
+ @Frozen
+ private Version version;
+ private String user;
+
+ public UserCandidateVersion() {
+ }
+
+ public UserCandidateVersion(String user, Version candidateVersion) {
+ this.user = user;
+ this.version = candidateVersion;
+ }
+
+ public Version getVersion() {
+ return version;
+ }
+
+ public void setVersion(Version version) {
+ this.version = version;
+ }
+
+ public String getUser() {
+ return user;
+ }
+
+ public void setUser(String user) {
+ this.user = user;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/Version.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/Version.java
new file mode 100644
index 0000000000..e6ac799fd4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/Version.java
@@ -0,0 +1,119 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.dao.types;
+
+import com.datastax.driver.mapping.annotations.UDT;
+
+@UDT(name = "version", keyspace = "dox")
+public class Version {
+ public static final String VERSION_REGEX = "^\\d+\\.\\d+$";
+ public static final String VERSION_STRING_VIOLATION_MSG =
+ "Version string must be in the format of: {integer}.{integer}";
+
+ private int major;
+ private int minor;
+
+ public Version() {
+ }
+
+ public Version(int major, int minor) {
+ this.major = major;
+ this.minor = minor;
+ }
+
+ /**
+ * Value of version.
+ *
+ * @param versionString the version string
+ * @return the version
+ */
+ public static Version valueOf(String versionString) {
+ if (versionString == null) {
+ return null;
+ }
+ String[] versionLevels = versionString.split("\\.");
+ Version version;
+ if (versionLevels.length != 2) {
+ throw new IllegalArgumentException(VERSION_STRING_VIOLATION_MSG);
+ }
+ try {
+ version = new Version(Integer.parseInt(versionLevels[0]), Integer.parseInt(versionLevels[1]));
+ } catch (Exception exception) {
+ throw new IllegalArgumentException(VERSION_STRING_VIOLATION_MSG);
+ }
+
+ return version;
+ }
+
+ public int getMajor() {
+ return major;
+ }
+
+ public void setMajor(int major) {
+ this.major = major;
+ }
+
+ public int getMinor() {
+ return minor;
+ }
+
+ public void setMinor(int minor) {
+ this.minor = minor;
+ }
+
+ public Version calculateNextCandidate() {
+ return new Version(major, minor + 1);
+ }
+
+ public Version calculateNextFinal() {
+ return new Version(major + 1, 0);
+ }
+
+ public boolean isFinal() {
+ return major != 0 && minor == 0;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null || getClass() != obj.getClass()) {
+ return false;
+ }
+
+ Version version = (Version) obj;
+
+ return major == version.major && minor == version.minor;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = major;
+ result = 31 * result + minor;
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ return major + "." + minor;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionHistoryEntity.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionHistoryEntity.java
new file mode 100644
index 0000000000..e97e177f52
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionHistoryEntity.java
@@ -0,0 +1,90 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.dao.types;
+
+import com.datastax.driver.mapping.annotations.Column;
+import com.datastax.driver.mapping.annotations.Frozen;
+import com.datastax.driver.mapping.annotations.PartitionKey;
+import com.datastax.driver.mapping.annotations.Table;
+
+@Table(keyspace = "dox", name = "version_history")
+public class VersionHistoryEntity {
+
+ @PartitionKey
+ @Column(name = "entity_id")
+ @Frozen
+ private VersionableEntityId entityId;
+
+ @Column(name = "active_version")
+ @Frozen
+ private Version version;
+
+ private String user;
+ private String description;
+ private VersionType type;
+
+ public VersionHistoryEntity() {
+ }
+
+ public VersionHistoryEntity(VersionableEntityId entityId) {
+ this.entityId = entityId;
+ }
+
+ public VersionableEntityId getEntityId() {
+ return entityId;
+ }
+
+ public void setEntityId(VersionableEntityId entityId) {
+ this.entityId = entityId;
+ }
+
+ public Version getVersion() {
+ return version;
+ }
+
+ public void setVersion(Version version) {
+ this.version = version;
+ }
+
+ public String getUser() {
+ return user;
+ }
+
+ public void setUser(String user) {
+ this.user = user;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public VersionType getType() {
+ return type;
+ }
+
+ public void setType(VersionType type) {
+ this.type = type;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionInfoDeletedEntity.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionInfoDeletedEntity.java
new file mode 100644
index 0000000000..9a60aa3b4a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionInfoDeletedEntity.java
@@ -0,0 +1,126 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.dao.types;
+
+import com.datastax.driver.mapping.annotations.ClusteringColumn;
+import com.datastax.driver.mapping.annotations.Column;
+import com.datastax.driver.mapping.annotations.Enumerated;
+import com.datastax.driver.mapping.annotations.Frozen;
+import com.datastax.driver.mapping.annotations.FrozenValue;
+import com.datastax.driver.mapping.annotations.PartitionKey;
+import com.datastax.driver.mapping.annotations.Table;
+
+import java.util.HashSet;
+import java.util.Set;
+
+@Table(keyspace = "dox", name = "version_info_deleted")
+public class VersionInfoDeletedEntity {
+
+ @PartitionKey
+ @Column(name = "entity_type")
+ private String entityType;
+
+ @ClusteringColumn
+ @Column(name = "entity_id")
+ private String entityId;
+
+ @Column(name = "active_version")
+ @Frozen
+ private Version activeVersion;
+
+ @Enumerated
+ private VersionStatus status;
+
+ @Frozen
+ private UserCandidateVersion candidate;
+
+ @Column(name = "viewable_versions")
+ @FrozenValue
+ private Set<Version> viewableVersions = new HashSet<>();
+
+ @Column(name = "latest_final_version")
+ @Frozen
+ private Version latestFinalVersion;
+
+ public VersionInfoDeletedEntity() {
+ }
+
+ public VersionInfoDeletedEntity(String entityType, String entityId) {
+ this.entityType = entityType;
+ this.entityId = entityId;
+ }
+
+ public String getEntityType() {
+ return entityType;
+ }
+
+ public void setEntityType(String entityType) {
+ this.entityType = entityType;
+ }
+
+ public String getEntityId() {
+ return entityId;
+ }
+
+ public void setEntityId(String entityId) {
+ this.entityId = entityId;
+ }
+
+ public Version getActiveVersion() {
+ return activeVersion;
+ }
+
+ public void setActiveVersion(Version activeVersion) {
+ this.activeVersion = activeVersion;
+ }
+
+ public VersionStatus getStatus() {
+ return status;
+ }
+
+ public void setStatus(VersionStatus status) {
+ this.status = status;
+ }
+
+ public UserCandidateVersion getCandidate() {
+ return candidate;
+ }
+
+ public void setCandidate(UserCandidateVersion candidate) {
+ this.candidate = candidate;
+ }
+
+ public Set<Version> getViewableVersions() {
+ return viewableVersions;
+ }
+
+ public void setViewableVersions(Set<Version> viewableVersions) {
+ this.viewableVersions = viewableVersions;
+ }
+
+ public Version getLatestFinalVersion() {
+ return latestFinalVersion;
+ }
+
+ public void setLatestFinalVersion(Version latestFinalVersion) {
+ this.latestFinalVersion = latestFinalVersion;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionInfoEntity.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionInfoEntity.java
new file mode 100644
index 0000000000..35ab4056f9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionInfoEntity.java
@@ -0,0 +1,126 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.dao.types;
+
+import com.datastax.driver.mapping.annotations.ClusteringColumn;
+import com.datastax.driver.mapping.annotations.Column;
+import com.datastax.driver.mapping.annotations.Enumerated;
+import com.datastax.driver.mapping.annotations.Frozen;
+import com.datastax.driver.mapping.annotations.FrozenValue;
+import com.datastax.driver.mapping.annotations.PartitionKey;
+import com.datastax.driver.mapping.annotations.Table;
+
+import java.util.HashSet;
+import java.util.Set;
+
+@Table(keyspace = "dox", name = "version_info")
+public class VersionInfoEntity {
+
+ @PartitionKey
+ @Column(name = "entity_type")
+ private String entityType;
+
+ @ClusteringColumn
+ @Column(name = "entity_id")
+ private String entityId;
+
+ @Column(name = "active_version")
+ @Frozen
+ private Version activeVersion;
+
+ @Enumerated
+ private VersionStatus status;
+
+ @Frozen
+ private UserCandidateVersion candidate;
+
+ @Column(name = "viewable_versions")
+ @FrozenValue
+ private Set<Version> viewableVersions = new HashSet<>();
+
+ @Column(name = "latest_final_version")
+ @Frozen
+ private Version latestFinalVersion;
+
+ public VersionInfoEntity() {
+ }
+
+ public VersionInfoEntity(String entityType, String entityId) {
+ this.entityType = entityType;
+ this.entityId = entityId;
+ }
+
+ public String getEntityType() {
+ return entityType;
+ }
+
+ public void setEntityType(String entityType) {
+ this.entityType = entityType;
+ }
+
+ public String getEntityId() {
+ return entityId;
+ }
+
+ public void setEntityId(String entityId) {
+ this.entityId = entityId;
+ }
+
+ public Version getActiveVersion() {
+ return activeVersion;
+ }
+
+ public void setActiveVersion(Version activeVersion) {
+ this.activeVersion = activeVersion;
+ }
+
+ public VersionStatus getStatus() {
+ return status;
+ }
+
+ public void setStatus(VersionStatus status) {
+ this.status = status;
+ }
+
+ public UserCandidateVersion getCandidate() {
+ return candidate;
+ }
+
+ public void setCandidate(UserCandidateVersion candidate) {
+ this.candidate = candidate;
+ }
+
+ public Set<Version> getViewableVersions() {
+ return viewableVersions;
+ }
+
+ public void setViewableVersions(Set<Version> viewableVersions) {
+ this.viewableVersions = viewableVersions;
+ }
+
+ public Version getLatestFinalVersion() {
+ return latestFinalVersion;
+ }
+
+ public void setLatestFinalVersion(Version latestFinalVersion) {
+ this.latestFinalVersion = latestFinalVersion;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionStatus.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionStatus.java
new file mode 100644
index 0000000000..1fb68540d6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionStatus.java
@@ -0,0 +1,28 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.dao.types;
+
+public enum VersionStatus {
+ Available,
+ Locked,
+ Final
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionType.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionType.java
new file mode 100644
index 0000000000..5a395c6172
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionType.java
@@ -0,0 +1,26 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.dao.types;
+
+public enum VersionType {
+ Draft,
+ Finalized
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionableEntity.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionableEntity.java
new file mode 100644
index 0000000000..d909af86a3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionableEntity.java
@@ -0,0 +1,43 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.dao.types;
+
+public interface VersionableEntity {
+
+ String getEntityType();
+
+ String getFirstClassCitizenId();
+
+ String getId();
+
+ void setId(String id);
+
+ Version getVersion();
+
+ void setVersion(Version version);
+
+ default String getVersionUuId() {
+ return "";
+ }
+
+ default void setVersionUuId(String uuId) {
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionableEntityId.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionableEntityId.java
new file mode 100644
index 0000000000..78dc1b8811
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionableEntityId.java
@@ -0,0 +1,53 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.dao.types;
+
+import com.datastax.driver.mapping.annotations.UDT;
+
+@UDT(name = "versionable_entity_id", keyspace = "dox")
+public class VersionableEntityId {
+ private String type;
+ private String id;
+
+ public VersionableEntityId() {
+ }
+
+ public VersionableEntityId(String type, String id) {
+ this.type = type;
+ this.id = id;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/CheckinOnEntityLockedByOtherErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/CheckinOnEntityLockedByOtherErrorBuilder.java
new file mode 100644
index 0000000000..829ce2691b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/CheckinOnEntityLockedByOtherErrorBuilder.java
@@ -0,0 +1,52 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.errors;
+
+import static org.openecomp.sdc.versioning.errors.VersioningErrorCodes
+ .CHECKIN_ON_ENTITY_LOCKED_BY_OTHER_USER;
+
+import org.openecomp.sdc.common.errors.BaseErrorBuilder;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+
+/**
+ * The type Checkin on entity locked by other error builder.
+ */
+public class CheckinOnEntityLockedByOtherErrorBuilder extends BaseErrorBuilder {
+
+ private static final String CHECKIN_ON_ENTITY_LOCKED_BY_OTHER_USER_MSG =
+ "Can not check in versionable entity %s with id %s since it is "
+ + "checked out by other user: %s.";
+
+ /**
+ * Instantiates a new Checkin on entity locked by other error builder.
+ *
+ * @param entityType the entity type
+ * @param entityId the entity id
+ * @param lockingUser the locking user
+ */
+ public CheckinOnEntityLockedByOtherErrorBuilder(String entityType, String entityId,
+ String lockingUser) {
+ getErrorCodeBuilder().withId(CHECKIN_ON_ENTITY_LOCKED_BY_OTHER_USER);
+ getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION);
+ getErrorCodeBuilder().withMessage(String
+ .format(CHECKIN_ON_ENTITY_LOCKED_BY_OTHER_USER_MSG, entityType, entityId, lockingUser));
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/CheckinOnUnlockedEntityErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/CheckinOnUnlockedEntityErrorBuilder.java
new file mode 100644
index 0000000000..4628febe2b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/CheckinOnUnlockedEntityErrorBuilder.java
@@ -0,0 +1,46 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.errors;
+
+import org.openecomp.sdc.common.errors.BaseErrorBuilder;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+
+/**
+ * The type Checkin on unlocked entity error builder.
+ */
+public class CheckinOnUnlockedEntityErrorBuilder extends BaseErrorBuilder {
+
+ private static final String CHECKIN_ON_UNLOCKED_ENTITY_MSG =
+ "Can not check in versionable entity %s with id %s since it is not checked out.";
+
+ /**
+ * Instantiates a new Checkin on unlocked entity error builder.
+ *
+ * @param entityType the entity type
+ * @param entityId the entity id
+ */
+ public CheckinOnUnlockedEntityErrorBuilder(String entityType, String entityId) {
+ getErrorCodeBuilder().withId(VersioningErrorCodes.CHECKIN_ON_UNLOCKED_ENTITY);
+ getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION);
+ getErrorCodeBuilder()
+ .withMessage(String.format(CHECKIN_ON_UNLOCKED_ENTITY_MSG, entityType, entityId));
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/CheckoutOnLockedEntityErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/CheckoutOnLockedEntityErrorBuilder.java
new file mode 100644
index 0000000000..60c02474ad
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/CheckoutOnLockedEntityErrorBuilder.java
@@ -0,0 +1,51 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.errors;
+
+import org.openecomp.sdc.common.errors.BaseErrorBuilder;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+
+/**
+ * The type Checkout on locked entity error builder.
+ */
+public class CheckoutOnLockedEntityErrorBuilder extends BaseErrorBuilder {
+
+ private static final String CHECKOT_ON_LOCKED_ENTITY_MSG =
+ "Can not check out versionable entity %s with id %s since it is "
+ + "checked out by other user: %s.";
+
+ /**
+ * Instantiates a new Checkout on locked entity error builder.
+ *
+ * @param entityType the entity type
+ * @param entityId the entity id
+ * @param lockingUser the locking user
+ */
+ public CheckoutOnLockedEntityErrorBuilder(String entityType, String entityId,
+ String lockingUser) {
+ getErrorCodeBuilder().withId(VersioningErrorCodes.CHECKOT_ON_LOCKED_ENTITY);
+ getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION);
+ getErrorCodeBuilder().withMessage(
+ String.format(CHECKOT_ON_LOCKED_ENTITY_MSG, entityType, entityId, lockingUser));
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/DeleteOnLockedEntityErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/DeleteOnLockedEntityErrorBuilder.java
new file mode 100644
index 0000000000..a431e92ba4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/DeleteOnLockedEntityErrorBuilder.java
@@ -0,0 +1,49 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.errors;
+
+import org.openecomp.sdc.common.errors.BaseErrorBuilder;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+
+/**
+ * The type Delete on locked entity error builder.
+ */
+public class DeleteOnLockedEntityErrorBuilder extends BaseErrorBuilder {
+
+ private static final String DELETE_ON_LOCKED_ENTITY_MSG =
+ "Can not delete versionable entity %s with id %s since it is checked out by other user: %s.";
+
+ /**
+ * Instantiates a new Delete on locked entity error builder.
+ *
+ * @param entityType the entity type
+ * @param entityId the entity id
+ * @param lockingUser the locking user
+ */
+ public DeleteOnLockedEntityErrorBuilder(String entityType, String entityId, String lockingUser) {
+ getErrorCodeBuilder().withId(VersioningErrorCodes.DELETE_ON_LOCKED_ENTITY);
+ getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION);
+ getErrorCodeBuilder()
+ .withMessage(String.format(DELETE_ON_LOCKED_ENTITY_MSG, entityType, entityId, lockingUser));
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EditOnEntityLockedByOtherErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EditOnEntityLockedByOtherErrorBuilder.java
new file mode 100644
index 0000000000..2c41bdeab1
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EditOnEntityLockedByOtherErrorBuilder.java
@@ -0,0 +1,50 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.errors;
+
+import org.openecomp.sdc.common.errors.BaseErrorBuilder;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+
+/**
+ * The type Edit on entity locked by other error builder.
+ */
+public class EditOnEntityLockedByOtherErrorBuilder extends BaseErrorBuilder {
+
+ private static final String EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER_MSG =
+ "Versionable entity %s with id %s can not be edited since it is locked by other user %s.";
+
+ /**
+ * Instantiates a new Edit on entity locked by other error builder.
+ *
+ * @param entityType the entity type
+ * @param entityId the entity id
+ * @param lockingUser the locking user
+ */
+ public EditOnEntityLockedByOtherErrorBuilder(String entityType, String entityId,
+ String lockingUser) {
+ getErrorCodeBuilder().withId(VersioningErrorCodes.EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER);
+ getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION);
+ getErrorCodeBuilder().withMessage(
+ String.format(EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER_MSG, entityType, entityId, lockingUser));
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EditOnUnlockedEntityErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EditOnUnlockedEntityErrorBuilder.java
new file mode 100644
index 0000000000..fb61cce1f0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EditOnUnlockedEntityErrorBuilder.java
@@ -0,0 +1,48 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.errors;
+
+import org.openecomp.sdc.common.errors.BaseErrorBuilder;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+
+/**
+ * The type Edit on unlocked entity error builder.
+ */
+public class EditOnUnlockedEntityErrorBuilder extends BaseErrorBuilder {
+
+ private static final String EDIT_ON_UNLOCKED_ENTITY_MSG =
+ "Can not edit versionable entity %s with id %s since it is not checked out.";
+
+ /**
+ * Instantiates a new Edit on unlocked entity error builder.
+ *
+ * @param entityType the entity type
+ * @param entityId the entity id
+ */
+ public EditOnUnlockedEntityErrorBuilder(String entityType, String entityId) {
+ getErrorCodeBuilder().withId(VersioningErrorCodes.EDIT_ON_UNLOCKED_ENTITY);
+ getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION);
+ getErrorCodeBuilder()
+ .withMessage(String.format(EDIT_ON_UNLOCKED_ENTITY_MSG, entityType, entityId));
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EntityAlreadyExistErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EntityAlreadyExistErrorBuilder.java
new file mode 100644
index 0000000000..8f80f6e14e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EntityAlreadyExistErrorBuilder.java
@@ -0,0 +1,46 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.errors;
+
+import org.openecomp.sdc.common.errors.BaseErrorBuilder;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+
+/**
+ * The type Entity already exist error builder.
+ */
+public class EntityAlreadyExistErrorBuilder extends BaseErrorBuilder {
+
+ private static final String VERSIONABLE_ENTITY_ALREADY_EXIST_MSG =
+ "Versionable entity %s with id %s already exist.";
+
+ /**
+ * Instantiates a new Entity already exist error builder.
+ *
+ * @param entityType the entity type
+ * @param entityId the entity id
+ */
+ public EntityAlreadyExistErrorBuilder(String entityType, String entityId) {
+ getErrorCodeBuilder().withId(VersioningErrorCodes.VERSIONABLE_ENTITY_ALREADY_EXIST);
+ getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION);
+ getErrorCodeBuilder()
+ .withMessage(String.format(VERSIONABLE_ENTITY_ALREADY_EXIST_MSG, entityType, entityId));
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EntityAlreadyFinalizedErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EntityAlreadyFinalizedErrorBuilder.java
new file mode 100644
index 0000000000..22643ddc26
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EntityAlreadyFinalizedErrorBuilder.java
@@ -0,0 +1,51 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.errors;
+
+import static org.openecomp.sdc.versioning.errors.VersioningErrorCodes
+ .SUBMIT_FINALIZED_ENTITY_NOT_ALLOWED;
+
+import org.openecomp.sdc.common.errors.BaseErrorBuilder;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+
+/**
+ * The type Entity already finalized error builder.
+ */
+public class EntityAlreadyFinalizedErrorBuilder extends BaseErrorBuilder {
+
+ private static final String SUBMIT_FINALIZED_ENTITY_NOT_ALLOWED_MSG =
+ "Versionable entity %s with id %s can not be submitted since it is already final.";
+
+ /**
+ * Instantiates a new Entity already finalized error builder.
+ *
+ * @param entityType the entity type
+ * @param entityId the entity id
+ */
+ public EntityAlreadyFinalizedErrorBuilder(String entityType, String entityId) {
+ getErrorCodeBuilder().withId(SUBMIT_FINALIZED_ENTITY_NOT_ALLOWED);
+ getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION);
+ getErrorCodeBuilder()
+ .withMessage(String.format(SUBMIT_FINALIZED_ENTITY_NOT_ALLOWED_MSG, entityType, entityId));
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EntityNotExistErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EntityNotExistErrorBuilder.java
new file mode 100644
index 0000000000..806557f935
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EntityNotExistErrorBuilder.java
@@ -0,0 +1,46 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.errors;
+
+import org.openecomp.sdc.common.errors.BaseErrorBuilder;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+
+/**
+ * The type Entity not exist error builder.
+ */
+public class EntityNotExistErrorBuilder extends BaseErrorBuilder {
+
+ private static final String VERSIONABLE_ENTITY_NOT_EXIST_MSG =
+ "Versionable entity %s with id %s does not exist.";
+
+ /**
+ * Instantiates a new Entity not exist error builder.
+ *
+ * @param entityType the entity type
+ * @param entityId the entity id
+ */
+ public EntityNotExistErrorBuilder(String entityType, String entityId) {
+ getErrorCodeBuilder().withId(VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST);
+ getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION);
+ getErrorCodeBuilder()
+ .withMessage(String.format(VERSIONABLE_ENTITY_NOT_EXIST_MSG, entityType, entityId));
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/RequestedVersionInvalidErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/RequestedVersionInvalidErrorBuilder.java
new file mode 100644
index 0000000000..7d3afcb94a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/RequestedVersionInvalidErrorBuilder.java
@@ -0,0 +1,40 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.errors;
+
+import org.openecomp.sdc.common.errors.BaseErrorBuilder;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+
+/**
+ * The type Requested version invalid error builder.
+ */
+public class RequestedVersionInvalidErrorBuilder extends BaseErrorBuilder {
+ private static final String REQUESTED_VERSION_INVALID_MSG = "Invalid requested version.";
+
+ /**
+ * Instantiates a new Requested version invalid error builder.
+ */
+ public RequestedVersionInvalidErrorBuilder() {
+ getErrorCodeBuilder().withId(VersioningErrorCodes.REQUESTED_VERSION_INVALID);
+ getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION);
+ getErrorCodeBuilder().withMessage(REQUESTED_VERSION_INVALID_MSG);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/SubmitLockedEntityNotAllowedErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/SubmitLockedEntityNotAllowedErrorBuilder.java
new file mode 100644
index 0000000000..3f4fc81b76
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/SubmitLockedEntityNotAllowedErrorBuilder.java
@@ -0,0 +1,49 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.errors;
+
+import org.openecomp.sdc.common.errors.BaseErrorBuilder;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+
+/**
+ * The type Submit locked entity not allowed error builder.
+ */
+public class SubmitLockedEntityNotAllowedErrorBuilder extends BaseErrorBuilder {
+
+ private static final String SUBMIT_LOCKED_ENTITY_NOT_ALLOWED_MSG =
+ "Versionable entity %s with id %s can not be submitted since it is currently "
+ + "locked by user %s.";
+
+ /**
+ * Instantiates a new Submit locked entity not allowed error builder.
+ *
+ * @param entityType the entity type
+ * @param entityId the entity id
+ * @param lockingUser the locking user
+ */
+ public SubmitLockedEntityNotAllowedErrorBuilder(String entityType, String entityId,
+ String lockingUser) {
+ getErrorCodeBuilder().withId(VersioningErrorCodes.SUBMIT_LOCKED_ENTITY_NOT_ALLOWED);
+ getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION);
+ getErrorCodeBuilder().withMessage(
+ String.format(SUBMIT_LOCKED_ENTITY_NOT_ALLOWED_MSG, entityType, entityId, lockingUser));
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/UndoCheckoutOnEntityLockedByOtherErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/UndoCheckoutOnEntityLockedByOtherErrorBuilder.java
new file mode 100644
index 0000000000..5e2be13d61
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/UndoCheckoutOnEntityLockedByOtherErrorBuilder.java
@@ -0,0 +1,53 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.errors;
+
+import static org.openecomp.sdc.versioning.errors.VersioningErrorCodes
+ .UNDO_CHECKOUT_ON_ENTITY_LOCKED_BY_OTHER_USER;
+
+import org.openecomp.sdc.common.errors.BaseErrorBuilder;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+
+/**
+ * The type Undo checkout on entity locked by other error builder.
+ */
+public class UndoCheckoutOnEntityLockedByOtherErrorBuilder extends BaseErrorBuilder {
+
+ private static final String UNDO_CHECKOUT_ON_ENTITY_LOCKED_BY_OTHER_USER_MSG =
+ "Can not undo checkout on versionable entity %s with id %s since it is checked out by "
+ + "other user: %s.";
+
+ /**
+ * Instantiates a new Undo checkout on entity locked by other error builder.
+ *
+ * @param entityType the entity type
+ * @param entityId the entity id
+ * @param lockingUser the locking user
+ */
+ public UndoCheckoutOnEntityLockedByOtherErrorBuilder(String entityType, String entityId,
+ String lockingUser) {
+ getErrorCodeBuilder().withId(UNDO_CHECKOUT_ON_ENTITY_LOCKED_BY_OTHER_USER);
+ getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION);
+ getErrorCodeBuilder().withMessage(String
+ .format(UNDO_CHECKOUT_ON_ENTITY_LOCKED_BY_OTHER_USER_MSG, entityType, entityId,
+ lockingUser));
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/UndoCheckoutOnUnlockedEntityErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/UndoCheckoutOnUnlockedEntityErrorBuilder.java
new file mode 100644
index 0000000000..36ca5b5c41
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/UndoCheckoutOnUnlockedEntityErrorBuilder.java
@@ -0,0 +1,50 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.errors;
+
+import static org.openecomp.sdc.versioning.errors.VersioningErrorCodes
+ .UNDO_CHECKOUT_ON_UNLOCKED_ENTITY;
+
+import org.openecomp.sdc.common.errors.BaseErrorBuilder;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+
+
+/**
+ * The type Undo checkout on unlocked entity error builder.
+ */
+public class UndoCheckoutOnUnlockedEntityErrorBuilder extends BaseErrorBuilder {
+
+ private static final String UNDO_CHECKOUT_ON_UNLOCKED_ENTITY_MSG =
+ "Can not undo checkout on versionable entity %s with id %s since it is not checked out.";
+
+ /**
+ * Instantiates a new Undo checkout on unlocked entity error builder.
+ *
+ * @param entityType the entity type
+ * @param entityId the entity id
+ */
+ public UndoCheckoutOnUnlockedEntityErrorBuilder(String entityType, String entityId) {
+ getErrorCodeBuilder().withId(UNDO_CHECKOUT_ON_UNLOCKED_ENTITY);
+ getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION);
+ getErrorCodeBuilder()
+ .withMessage(String.format(UNDO_CHECKOUT_ON_UNLOCKED_ENTITY_MSG, entityType, entityId));
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/VersionableSubEntityNotFoundErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/VersionableSubEntityNotFoundErrorBuilder.java
new file mode 100644
index 0000000000..77be83f427
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/VersionableSubEntityNotFoundErrorBuilder.java
@@ -0,0 +1,77 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.errors;
+
+import org.openecomp.core.utilities.CommonMethods;
+import org.openecomp.sdc.common.errors.BaseErrorBuilder;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.util.List;
+
+/**
+ * The type Versionable sub entity not found error builder.
+ */
+public class VersionableSubEntityNotFoundErrorBuilder extends BaseErrorBuilder {
+
+ private static final String SUB_ENTITY_NOT_FOUND_MSG =
+ "%s with Id %s does not exist for %s with id %s and version %s";
+ private static final String SUB_ENTITIES_NOT_FOUND_MSG =
+ "%ss with Ids %s do not exist for %s with id %s and version %s";
+
+ /**
+ * Instantiates a new Versionable sub entity not found error builder.
+ *
+ * @param entityType the entity type
+ * @param entityId the entity id
+ * @param containingEntityType the containing entity type
+ * @param containingEntityId the containing entity id
+ * @param version the version
+ */
+ public VersionableSubEntityNotFoundErrorBuilder(String entityType, String entityId,
+ String containingEntityType,
+ String containingEntityId, Version version) {
+ getErrorCodeBuilder().withId(VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+ getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION);
+ getErrorCodeBuilder().withMessage(String
+ .format(SUB_ENTITY_NOT_FOUND_MSG, entityType, entityId, containingEntityType,
+ containingEntityId, version.toString()));
+ }
+
+ /**
+ * Instantiates a new Versionable sub entity not found error builder.
+ *
+ * @param entityType the entity type
+ * @param entityIds the entity ids
+ * @param containingEntityType the containing entity type
+ * @param containingEntityId the containing entity id
+ * @param version the version
+ */
+ public VersionableSubEntityNotFoundErrorBuilder(String entityType, List<String> entityIds,
+ String containingEntityType,
+ String containingEntityId, Version version) {
+ getErrorCodeBuilder().withId(VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+ getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION);
+ getErrorCodeBuilder().withMessage(String.format(SUB_ENTITIES_NOT_FOUND_MSG, entityType,
+ CommonMethods.listToSeparatedString(entityIds, ','), containingEntityType,
+ containingEntityId, version.toString()));
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/VersioningErrorCodes.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/VersioningErrorCodes.java
new file mode 100644
index 0000000000..c1c6b96bfd
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/VersioningErrorCodes.java
@@ -0,0 +1,43 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.errors;
+
+public class VersioningErrorCodes {
+
+ public static final String REQUESTED_VERSION_INVALID = "REQUESTED_VERSION_INVALID";
+ public static final String CHECKIN_ON_ENTITY_LOCKED_BY_OTHER_USER =
+ "CHECKIN_ON_ENTITY_LOCKED_BY_OTHER_USER";
+ public static final String CHECKIN_ON_UNLOCKED_ENTITY = "CHECKIN_ON_UNLOCKED_ENTITY";
+ public static final String CHECKOT_ON_LOCKED_ENTITY = "CHECKOT_ON_LOCKED_ENTITY";
+ public static final String DELETE_ON_LOCKED_ENTITY = "DELETE_ON_LOCKED_ENTITY";
+ public static final String EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER =
+ "EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER";
+ public static final String EDIT_ON_UNLOCKED_ENTITY = "EDIT_ON_UNLOCKED_ENTITY";
+ public static final String VERSIONABLE_ENTITY_ALREADY_EXIST = "VERSIONABLE_ENTITY_ALREADY_EXIST";
+ public static final String SUBMIT_FINALIZED_ENTITY_NOT_ALLOWED =
+ "SUBMIT_FINALIZED_ENTITY_NOT_ALLOWED";
+ public static final String VERSIONABLE_ENTITY_NOT_EXIST = "VERSIONABLE_ENTITY_NOT_EXIST";
+ public static final String VERSIONABLE_SUB_ENTITY_NOT_FOUND = "VERSIONABLE_SUB_ENTITY_NOT_FOUND";
+ public static final String SUBMIT_LOCKED_ENTITY_NOT_ALLOWED = "SUBMIT_LOCKED_ENTITY_NOT_ALLOWED";
+ public static final String UNDO_CHECKOUT_ON_ENTITY_LOCKED_BY_OTHER_USER =
+ "UNDO_CHECKOUT_ON_ENTITY_LOCKED_BY_OTHER_USER";
+ public static final String UNDO_CHECKOUT_ON_UNLOCKED_ENTITY = "UNDO_CHECKOUT_ON_UNLOCKED_ENTITY";
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/UniqueValueMetadata.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/UniqueValueMetadata.java
new file mode 100644
index 0000000000..21d42299fa
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/UniqueValueMetadata.java
@@ -0,0 +1,49 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.types;
+
+import java.util.List;
+
+public class UniqueValueMetadata {
+ private String type;
+ private List<String> uniqueConstraintIdentifiers;
+
+ public UniqueValueMetadata(String type, List<String> contextIdentifierNames) {
+ this.type = type;
+ this.uniqueConstraintIdentifiers = contextIdentifierNames;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public List<String> getUniqueConstraintIdentifiers() {
+ return uniqueConstraintIdentifiers;
+ }
+
+ public void setUniqueConstraintIdentifiers(List<String> uniqueConstraintIdentifiers) {
+ this.uniqueConstraintIdentifiers = uniqueConstraintIdentifiers;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/VersionInfo.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/VersionInfo.java
new file mode 100644
index 0000000000..02b5aaa3bd
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/VersionInfo.java
@@ -0,0 +1,97 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.types;
+
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.dao.types.VersionStatus;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class VersionInfo {
+ private Version activeVersion;
+ private Version latestFinalVersion;
+ private List<Version> viewableVersions = new ArrayList<>();
+ private List<Version> finalVersions = new ArrayList<>();
+ private VersionStatus status;
+ private String lockingUser;
+
+ public Version getActiveVersion() {
+ return activeVersion;
+ }
+
+ public void setActiveVersion(Version activeVersion) {
+ this.activeVersion = activeVersion;
+ }
+
+ public Version getLatestFinalVersion() {
+ return latestFinalVersion;
+ }
+
+ public void setLatestFinalVersion(Version latestFinalVersion) {
+ this.latestFinalVersion = latestFinalVersion;
+ }
+
+ public List<Version> getViewableVersions() {
+ return viewableVersions;
+ }
+
+ public void setViewableVersions(List<Version> viewableVersions) {
+ this.viewableVersions = viewableVersions;
+ }
+
+ public List<Version> getFinalVersions() {
+ return finalVersions;
+ }
+
+ public void setFinalVersions(List<Version> finalVersions) {
+ this.finalVersions = finalVersions;
+ }
+
+ public VersionStatus getStatus() {
+ return status;
+ }
+
+ public void setStatus(VersionStatus status) {
+ this.status = status;
+ }
+
+ public String getLockingUser() {
+ return lockingUser;
+ }
+
+ public void setLockingUser(String lockingUser) {
+ this.lockingUser = lockingUser;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("VersionInfo{");
+ sb.append("activeVersion=").append(activeVersion);
+ sb.append(", latestFinalVersion=").append(latestFinalVersion);
+ sb.append(", viewableVersions=").append(viewableVersions);
+ sb.append(", finalVersions=").append(finalVersions);
+ sb.append(", status=").append(status);
+ sb.append(", lockingUser='").append(lockingUser).append('\'');
+ sb.append('}');
+ return sb.toString();
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/VersionableEntityAction.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/VersionableEntityAction.java
new file mode 100644
index 0000000000..c7413858e5
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/VersionableEntityAction.java
@@ -0,0 +1,26 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.types;
+
+public enum VersionableEntityAction {
+ Read,
+ Write
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/VersionableEntityMetadata.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/VersionableEntityMetadata.java
new file mode 100644
index 0000000000..161221abe3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/VersionableEntityMetadata.java
@@ -0,0 +1,78 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.types;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class VersionableEntityMetadata {
+
+ private String name;
+ private String identifierName;
+ private String versionIdentifierName;
+ private List<UniqueValueMetadata> uniqueValuesMetadata = new ArrayList<>();
+
+ /**
+ * Instantiates a new Versionable entity metadata.
+ *
+ * @param name the name
+ * @param identifierName the identifier name
+ * @param versionIdentifierName the version identifier name
+ */
+ public VersionableEntityMetadata(String name, String identifierName,
+ String versionIdentifierName) {
+ this.name = name;
+ this.identifierName = identifierName;
+ this.versionIdentifierName = versionIdentifierName;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getIdentifierName() {
+ return identifierName;
+ }
+
+ public void setIdentifierName(String idColumnName) {
+ this.identifierName = idColumnName;
+ }
+
+ public String getVersionIdentifierName() {
+ return versionIdentifierName;
+ }
+
+ public void setVersionIdentifierName(String versionColumnName) {
+ this.versionIdentifierName = versionColumnName;
+ }
+
+ public List<UniqueValueMetadata> getUniqueValuesMetadata() {
+ return uniqueValuesMetadata;
+ }
+
+ public void setUniqueValuesMetadata(List<UniqueValueMetadata> uniqueValuesMetadata) {
+ this.uniqueValuesMetadata = uniqueValuesMetadata;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/resources/factoryConfiguration.json b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/resources/factoryConfiguration.json
new file mode 100644
index 0000000000..f36c2d5a43
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/resources/factoryConfiguration.json
@@ -0,0 +1,7 @@
+{
+ "org.openecomp.sdc.versioning.VersioningManagerFactory": "org.openecomp.sdc.versioning.impl.VersioningManagerFactoryImpl",
+ "org.openecomp.sdc.versioning.dao.VersionableEntityDaoFactory" : "org.openecomp.sdc.versioning.dao.impl.VersionableEntityDaoFactoryImpl",
+ "org.openecomp.sdc.versioning.dao.VersionInfoDaoFactory": "org.openecomp.sdc.versioning.dao.impl.VersionInfoDaoFactoryImpl",
+ "org.openecomp.sdc.versioning.dao.VersionInfoDeletedDaoFactory": "org.openecomp.sdc.versioning.dao.impl.VersionInfoDeletedDaoFactoryImpl"
+
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/pom.xml b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/pom.xml
new file mode 100644
index 0000000000..9812a3e941
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/pom.xml
@@ -0,0 +1,61 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-lib</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../..</relativePath>
+ </parent>
+
+ <name>openecomp-sdc-versioning-core</name>
+ <artifactId>openecomp-sdc-versioning-core</artifactId>
+
+
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-versioning-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <version>2.3.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.yaml</groupId>
+ <artifactId>snakeyaml</artifactId>
+ <version>1.14</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <scope>test</scope>
+ <version>1.10.19</version>
+ </dependency>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <scope>test</scope>
+ <version>6.8.5</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>snakeyaml</artifactId>
+ <groupId>org.yaml</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ <version>RELEASE</version>
+ </dependency>
+ </dependencies>
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionHistoryCassandraDaoImpl.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionHistoryCassandraDaoImpl.java
new file mode 100644
index 0000000000..a50a8b7beb
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionHistoryCassandraDaoImpl.java
@@ -0,0 +1,69 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.dao.impl;
+
+import com.datastax.driver.core.UDTValue;
+import com.datastax.driver.mapping.Mapper;
+import com.datastax.driver.mapping.Result;
+import com.datastax.driver.mapping.UDTMapper;
+import com.datastax.driver.mapping.annotations.Accessor;
+import com.datastax.driver.mapping.annotations.Query;
+import org.openecomp.core.dao.impl.CassandraBaseDao;
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
+import org.openecomp.sdc.versioning.dao.VersionHistoryDao;
+import org.openecomp.sdc.versioning.dao.types.VersionHistoryEntity;
+import org.openecomp.sdc.versioning.dao.types.VersionableEntityId;
+
+import java.util.Collection;
+
+public class VersionHistoryCassandraDaoImpl extends CassandraBaseDao<VersionHistoryEntity>
+ implements VersionHistoryDao {
+
+ private static NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
+ private static Mapper<VersionHistoryEntity> mapper =
+ noSqlDb.getMappingManager().mapper(VersionHistoryEntity.class);
+ private static VersionHistoryAccessor accessor =
+ noSqlDb.getMappingManager().createAccessor(VersionHistoryAccessor.class);
+ private static UDTMapper<VersionableEntityId> versionedEntityIdMapper =
+ noSqlDb.getMappingManager().udtMapper(VersionableEntityId.class);
+
+ @Override
+ protected Mapper<VersionHistoryEntity> getMapper() {
+ return mapper;
+ }
+
+ @Override
+ protected Object[] getKeys(VersionHistoryEntity entity) {
+ return new Object[]{versionedEntityIdMapper.toUDT(entity.getEntityId())};
+ }
+
+ @Override
+ public Collection<VersionHistoryEntity> list(VersionHistoryEntity entity) {
+ return accessor.getAll(versionedEntityIdMapper.toUDT(entity.getEntityId())).all();
+ }
+
+ @Accessor
+ interface VersionHistoryAccessor {
+ @Query("select * from version_history where entity_id=?")
+ Result<VersionHistoryEntity> getAll(UDTValue entityId);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionHistoryDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionHistoryDaoFactoryImpl.java
new file mode 100644
index 0000000000..ac1c7e9634
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionHistoryDaoFactoryImpl.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.dao.impl;
+
+import org.openecomp.sdc.versioning.dao.VersionHistoryDao;
+import org.openecomp.sdc.versioning.dao.VersionHistoryDaoFactory;
+
+public class VersionHistoryDaoFactoryImpl extends VersionHistoryDaoFactory {
+ private static final VersionHistoryDao INSTANCE = new VersionHistoryCassandraDaoImpl();
+
+ @Override
+ public VersionHistoryDao createInterface() {
+ return INSTANCE;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionInfoDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionInfoDaoFactoryImpl.java
new file mode 100644
index 0000000000..46c6a9d795
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionInfoDaoFactoryImpl.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.dao.impl;
+
+import org.openecomp.sdc.versioning.dao.VersionInfoDao;
+import org.openecomp.sdc.versioning.dao.VersionInfoDaoFactory;
+
+public class VersionInfoDaoFactoryImpl extends VersionInfoDaoFactory {
+ private static VersionInfoDao INSTANCE = new VersionInfoDaoImpl();
+
+ @Override
+ public VersionInfoDao createInterface() {
+ return INSTANCE;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionInfoDaoImpl.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionInfoDaoImpl.java
new file mode 100644
index 0000000000..a45c211f94
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionInfoDaoImpl.java
@@ -0,0 +1,66 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.dao.impl;
+
+import com.datastax.driver.mapping.Mapper;
+import com.datastax.driver.mapping.Result;
+import com.datastax.driver.mapping.annotations.Accessor;
+import com.datastax.driver.mapping.annotations.Query;
+import org.openecomp.core.dao.impl.CassandraBaseDao;
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
+import org.openecomp.sdc.versioning.dao.VersionInfoDao;
+import org.openecomp.sdc.versioning.dao.types.VersionInfoEntity;
+
+import java.util.Collection;
+
+public class VersionInfoDaoImpl extends CassandraBaseDao<VersionInfoEntity>
+ implements VersionInfoDao {
+
+ private static NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
+ private static Mapper<VersionInfoEntity> mapper =
+ noSqlDb.getMappingManager().mapper(VersionInfoEntity.class);
+ private static VersionInfoAccessor accessor =
+ noSqlDb.getMappingManager().createAccessor(VersionInfoAccessor.class);
+ //private static UDTMapper<VersionableEntityId> versionedEntityIdMapper = noSqlDb
+ //.getMappingManager().udtMapper(VersionableEntityId.class);
+
+ @Override
+ protected Mapper<VersionInfoEntity> getMapper() {
+ return mapper;
+ }
+
+ @Override
+ protected Object[] getKeys(VersionInfoEntity entity) {
+ return new Object[]{entity.getEntityType(), entity.getEntityId()};
+ }
+
+ @Override
+ public Collection<VersionInfoEntity> list(VersionInfoEntity entity) {
+ return accessor.getAll(entity.getEntityType()).all();
+ }
+
+ @Accessor
+ interface VersionInfoAccessor {
+ @Query("select * from version_info where entity_type=?")
+ Result<VersionInfoEntity> getAll(String entityType);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionInfoDeletedDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionInfoDeletedDaoFactoryImpl.java
new file mode 100644
index 0000000000..9163018a85
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionInfoDeletedDaoFactoryImpl.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.dao.impl;
+
+
+import org.openecomp.sdc.versioning.dao.VersionInfoDeletedDao;
+import org.openecomp.sdc.versioning.dao.VersionInfoDeletedDaoFactory;
+
+public class VersionInfoDeletedDaoFactoryImpl extends VersionInfoDeletedDaoFactory {
+ private static VersionInfoDeletedDao INSTANCE = new VersionInfoDeletedDaoImpl();
+
+ @Override
+ public VersionInfoDeletedDao createInterface() {
+ return INSTANCE;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionInfoDeletedDaoImpl.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionInfoDeletedDaoImpl.java
new file mode 100644
index 0000000000..82e4edcd80
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionInfoDeletedDaoImpl.java
@@ -0,0 +1,65 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.dao.impl;
+
+import com.datastax.driver.mapping.Mapper;
+import com.datastax.driver.mapping.Result;
+import com.datastax.driver.mapping.annotations.Accessor;
+import com.datastax.driver.mapping.annotations.Query;
+import org.openecomp.core.dao.impl.CassandraBaseDao;
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
+import org.openecomp.sdc.versioning.dao.VersionInfoDeletedDao;
+import org.openecomp.sdc.versioning.dao.types.VersionInfoDeletedEntity;
+
+import java.util.Collection;
+
+public class VersionInfoDeletedDaoImpl extends CassandraBaseDao<VersionInfoDeletedEntity>
+ implements VersionInfoDeletedDao {
+
+ private static NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
+ private static Mapper<VersionInfoDeletedEntity> mapper =
+ noSqlDb.getMappingManager().mapper(VersionInfoDeletedEntity.class);
+ private static VersionInfoAccessor accessor =
+ noSqlDb.getMappingManager().createAccessor(VersionInfoAccessor.class);
+
+
+ @Override
+ protected Mapper<VersionInfoDeletedEntity> getMapper() {
+ return mapper;
+ }
+
+ @Override
+ protected Object[] getKeys(VersionInfoDeletedEntity entity) {
+ return new Object[]{entity.getEntityType(), entity.getEntityId()};
+ }
+
+ @Override
+ public Collection<VersionInfoDeletedEntity> list(VersionInfoDeletedEntity entity) {
+ return accessor.getAll(entity.getEntityType()).all();
+ }
+
+ @Accessor
+ interface VersionInfoAccessor {
+ @Query("select * from version_info_deleted where entity_type=?")
+ Result<VersionInfoDeletedEntity> getAll(String entityType);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionableEntityDaoCassandraImpl.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionableEntityDaoCassandraImpl.java
new file mode 100644
index 0000000000..f02ea89e34
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionableEntityDaoCassandraImpl.java
@@ -0,0 +1,159 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.dao.impl;
+
+import com.datastax.driver.core.ColumnDefinitions;
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.Row;
+import com.datastax.driver.mapping.UDTMapper;
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
+import org.openecomp.core.util.UniqueValueUtil;
+import org.openecomp.core.utilities.CommonMethods;
+import org.openecomp.sdc.versioning.dao.VersionableEntityDao;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.types.UniqueValueMetadata;
+import org.openecomp.sdc.versioning.types.VersionableEntityMetadata;
+
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
+class VersionableEntityDaoCassandraImpl implements VersionableEntityDao {
+
+ private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
+ private static org.slf4j.Logger Logger =
+ LoggerFactory.getLogger(VersionableEntityDaoCassandraImpl.class);
+ private static UDTMapper<Version> versionMapper =
+ noSqlDb.getMappingManager().udtMapper(Version.class);
+
+ private static String commaSeparatedQuestionMarks(int size) {
+ StringBuilder sb = new StringBuilder(size * 2 - 1);
+ for (int i = 0; i < size; i++) {
+ if (i > 0) {
+ sb.append(',');
+ }
+ sb.append('?');
+ }
+ return sb.toString();
+
+ }
+
+ @Override
+ public void initVersion(VersionableEntityMetadata metadata, String entityId, Version baseVersion,
+ Version newVersion) {
+ ResultSet rows = loadVersionRows(metadata, entityId, baseVersion);
+ List<String> columnNames =
+ rows.getColumnDefinitions().asList().stream().map(ColumnDefinitions.Definition::getName)
+ .collect(Collectors.toList());
+
+ String insertCql = String.format("insert into %s (%s) values (%s)", metadata.getName(),
+ CommonMethods.listToSeparatedString(columnNames, ','),
+ commaSeparatedQuestionMarks(columnNames.size()));
+ Logger.debug("insertCql", insertCql);
+
+ for (Row row : rows) {
+ List<Object> columnValues = new ArrayList<>();
+ Map<String, Object> columnNameToValue = new HashMap<>();
+
+ for (String columnName : columnNames) {
+ if (metadata.getVersionIdentifierName().equals(columnName)) {
+ columnValues.add(versionMapper.toUDT(newVersion));
+ columnNameToValue.put(columnName, newVersion.toString());
+ } else {
+ Object value = row.getObject(columnName);
+ columnValues.add(value);
+ columnNameToValue.put(columnName, value);
+ }
+ }
+
+ initRowUniqueValues(metadata.getUniqueValuesMetadata(), columnNameToValue);
+
+ noSqlDb.execute(insertCql, columnValues.toArray());
+ }
+ }
+
+ private ResultSet loadVersionRows(VersionableEntityMetadata metadata, String entityId,
+ Version version) {
+ String selectCql = String.format("select * from %s where %s=? and %s=?", metadata.getName(),
+ metadata.getIdentifierName(), metadata.getVersionIdentifierName());
+ Logger.debug("selectCql", selectCql);
+ Logger.debug("entityId", entityId);
+ Logger.debug("version", version);
+
+ return noSqlDb.execute(selectCql, entityId, versionMapper.toUDT(version));
+ }
+
+ @Override
+ public void deleteVersion(VersionableEntityMetadata metadata, String entityId,
+ Version versionToDelete) {
+ deleteRowsUniqueValues(metadata, entityId, versionToDelete);
+
+ String deleteCql = String.format("delete from %s where %s=? and %s=?", metadata.getName(),
+ metadata.getIdentifierName(), metadata.getVersionIdentifierName());
+ noSqlDb.execute(deleteCql, entityId, versionMapper.toUDT(versionToDelete));
+ }
+
+ private void initRowUniqueValues(List<UniqueValueMetadata> metadata,
+ Map<String, Object> columnNameToValue) {
+ for (UniqueValueMetadata uniqueMetadata : metadata) {
+ List<String> uniqueValueCombination = uniqueMetadata.getUniqueConstraintIdentifiers().stream()
+ .map(colName -> (String) columnNameToValue.get(colName)).collect(Collectors.toList());
+ UniqueValueUtil.createUniqueValue(uniqueMetadata.getType(),
+ uniqueValueCombination.toArray(new String[uniqueValueCombination.size()]));
+ }
+ }
+
+ private void deleteRowUniqueValues(List<UniqueValueMetadata> metadata,
+ Map<String, Object> columnNameToValue) {
+ for (UniqueValueMetadata uniqueMetadata : metadata) {
+ List<String> uniqueValueCombination = uniqueMetadata.getUniqueConstraintIdentifiers().stream()
+ .map(colName -> (String) columnNameToValue.get(colName)).collect(Collectors.toList());
+ UniqueValueUtil.deleteUniqueValue(uniqueMetadata.getType(),
+ uniqueValueCombination.toArray(new String[uniqueValueCombination.size()]));
+ }
+ }
+
+ private void deleteRowsUniqueValues(VersionableEntityMetadata metadata, String entityId,
+ Version version) {
+ if (metadata.getUniqueValuesMetadata().isEmpty()) {
+ return;
+ }
+ ResultSet rows = loadVersionRows(metadata, entityId, version);
+ List<String> columnNames =
+ rows.getColumnDefinitions().asList().stream().map(ColumnDefinitions.Definition::getName)
+ .collect(Collectors.toList());
+
+ for (Row row : rows) {
+ Map<String, Object> columnNameToValue =
+ columnNames.stream().filter(name -> row.getObject(name) != null).collect(Collectors
+ .toMap(Function.identity(),
+ columnName -> metadata.getVersionIdentifierName().equals(columnName) ? version
+ .toString() : row.getObject(columnName)));
+ deleteRowUniqueValues(metadata.getUniqueValuesMetadata(), columnNameToValue);
+ }
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionableEntityDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionableEntityDaoFactoryImpl.java
new file mode 100644
index 0000000000..8ec0814fc9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionableEntityDaoFactoryImpl.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.dao.impl;
+
+import org.openecomp.sdc.versioning.dao.VersionableEntityDao;
+import org.openecomp.sdc.versioning.dao.VersionableEntityDaoFactory;
+
+public class VersionableEntityDaoFactoryImpl extends VersionableEntityDaoFactory {
+ private static VersionableEntityDao INSTANCE = new VersionableEntityDaoCassandraImpl();
+
+ @Override
+ public VersionableEntityDao createInterface() {
+ return INSTANCE;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/VersioningManagerFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/VersioningManagerFactoryImpl.java
new file mode 100644
index 0000000000..f7065cfda4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/VersioningManagerFactoryImpl.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.impl;
+
+import org.openecomp.sdc.versioning.VersioningManager;
+import org.openecomp.sdc.versioning.VersioningManagerFactory;
+
+public class VersioningManagerFactoryImpl extends VersioningManagerFactory {
+ private static final VersioningManager INSTANCE = new VersioningManagerImpl();
+
+ @Override
+ public VersioningManager createInterface() {
+ return INSTANCE;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/VersioningManagerImpl.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/VersioningManagerImpl.java
new file mode 100644
index 0000000000..6aa2a9f63c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/VersioningManagerImpl.java
@@ -0,0 +1,468 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.versioning.impl;
+
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.versioning.VersioningManager;
+import org.openecomp.sdc.versioning.dao.VersionInfoDao;
+import org.openecomp.sdc.versioning.dao.VersionInfoDaoFactory;
+import org.openecomp.sdc.versioning.dao.VersionInfoDeletedDao;
+import org.openecomp.sdc.versioning.dao.VersionInfoDeletedDaoFactory;
+import org.openecomp.sdc.versioning.dao.VersionableEntityDao;
+import org.openecomp.sdc.versioning.dao.VersionableEntityDaoFactory;
+import org.openecomp.sdc.versioning.dao.types.UserCandidateVersion;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.dao.types.VersionHistoryEntity;
+import org.openecomp.sdc.versioning.dao.types.VersionInfoDeletedEntity;
+import org.openecomp.sdc.versioning.dao.types.VersionInfoEntity;
+import org.openecomp.sdc.versioning.dao.types.VersionStatus;
+import org.openecomp.sdc.versioning.dao.types.VersionType;
+import org.openecomp.sdc.versioning.dao.types.VersionableEntityId;
+import org.openecomp.sdc.versioning.errors.CheckinOnEntityLockedByOtherErrorBuilder;
+import org.openecomp.sdc.versioning.errors.CheckinOnUnlockedEntityErrorBuilder;
+import org.openecomp.sdc.versioning.errors.CheckoutOnLockedEntityErrorBuilder;
+import org.openecomp.sdc.versioning.errors.DeleteOnLockedEntityErrorBuilder;
+import org.openecomp.sdc.versioning.errors.EditOnEntityLockedByOtherErrorBuilder;
+import org.openecomp.sdc.versioning.errors.EditOnUnlockedEntityErrorBuilder;
+import org.openecomp.sdc.versioning.errors.EntityAlreadyExistErrorBuilder;
+import org.openecomp.sdc.versioning.errors.EntityAlreadyFinalizedErrorBuilder;
+import org.openecomp.sdc.versioning.errors.EntityNotExistErrorBuilder;
+import org.openecomp.sdc.versioning.errors.SubmitLockedEntityNotAllowedErrorBuilder;
+import org.openecomp.sdc.versioning.errors.UndoCheckoutOnEntityLockedByOtherErrorBuilder;
+import org.openecomp.sdc.versioning.errors.UndoCheckoutOnUnlockedEntityErrorBuilder;
+import org.openecomp.sdc.versioning.types.VersionInfo;
+import org.openecomp.sdc.versioning.types.VersionableEntityAction;
+import org.openecomp.sdc.versioning.types.VersionableEntityMetadata;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+public class VersioningManagerImpl implements VersioningManager {
+
+ private static final Version INITIAL_ACTIVE_VERSION = new Version(0, 0);
+ private static VersionInfoDao versionInfoDao =
+ VersionInfoDaoFactory.getInstance().createInterface();
+ private static VersionInfoDeletedDao versionInfoDeletedDao =
+ VersionInfoDeletedDaoFactory.getInstance().createInterface();
+ private static VersionableEntityDao versionableEntityDao =
+ VersionableEntityDaoFactory.getInstance().createInterface();
+
+ private static Map<String, Set<VersionableEntityMetadata>> versionableEntities = new HashMap<>();
+
+ private static VersionInfo getVersionInfo(VersionInfoEntity versionInfoEntity, String user,
+ VersionableEntityAction action) {
+ return getVersionInfo(versionInfoEntity.getEntityId(),
+ versionInfoEntity.getEntityType(),
+ versionInfoEntity.getActiveVersion(),
+ versionInfoEntity.getCandidate(),
+ versionInfoEntity.getStatus(),
+ versionInfoEntity.getLatestFinalVersion(),
+ versionInfoEntity.getViewableVersions(),
+ action,
+ user);
+ }
+
+ private static VersionInfo getVersionInfo(VersionInfoDeletedEntity versionInfoEntity, String user,
+ VersionableEntityAction action) {
+ return getVersionInfo(versionInfoEntity.getEntityId(),
+ versionInfoEntity.getEntityType(),
+ versionInfoEntity.getActiveVersion(),
+ versionInfoEntity.getCandidate(),
+ versionInfoEntity.getStatus(),
+ versionInfoEntity.getLatestFinalVersion(),
+ versionInfoEntity.getViewableVersions(),
+ action,
+ user);
+ }
+
+ private static VersionInfo getVersionInfo(String entityId, String entityType, Version activeVer,
+ UserCandidateVersion candidate, VersionStatus status,
+ Version latestFinalVersion,
+ Set<Version> viewableVersions,
+ VersionableEntityAction action, String user) {
+ Version activeVersion;
+
+ if (action == VersionableEntityAction.Write) {
+ if (candidate != null) {
+ if (user.equals(candidate.getUser())) {
+ activeVersion = candidate.getVersion();
+ } else {
+ throw new CoreException(
+ new EditOnEntityLockedByOtherErrorBuilder(entityType, entityId, candidate.getUser())
+ .build());
+ }
+ } else {
+ throw new CoreException(new EditOnUnlockedEntityErrorBuilder(entityType, entityId).build());
+ }
+ } else {
+ if (candidate != null && user.equals(candidate.getUser())) {
+ activeVersion = candidate.getVersion();
+ } else {
+ activeVersion = activeVer;
+ }
+ }
+
+ VersionInfo versionInfo = new VersionInfo();
+ versionInfo.setActiveVersion(activeVersion);
+ versionInfo.setLatestFinalVersion(latestFinalVersion);
+ versionInfo.setViewableVersions(toSortedList(viewableVersions));
+ versionInfo.setFinalVersions(getFinalVersions(viewableVersions));
+ versionInfo.setStatus(status);
+ if (candidate != null) {
+ versionInfo.setLockingUser(candidate.getUser());
+ if (user.equals(candidate.getUser())) {
+ versionInfo.getViewableVersions().add(candidate.getVersion());
+ }
+ }
+ return versionInfo;
+ }
+
+ private static List<Version> toSortedList(
+ Set<Version> versions) { // changing the Set to List in DB will require migration...
+ return versions.stream().sorted((o1, o2) -> {
+ return o1.getMajor() > o2.getMajor() ? 1
+ : o1.getMajor() == o2.getMajor() ? (o1.getMinor() > o2.getMinor() ? 1
+ : o1.getMinor() == o2.getMinor() ? 0 : -1) : -1;
+ }).collect(Collectors.toList());
+ }
+
+ private static List<Version> getFinalVersions(Set<Version> versions) {
+ return versions.stream().filter(version -> version.isFinal()).collect(Collectors.toList());
+ }
+
+ @Override
+ public void register(String entityType, VersionableEntityMetadata entityMetadata) {
+ Set<VersionableEntityMetadata> entitiesMetadata = versionableEntities.get(entityType);
+ if (entitiesMetadata == null) {
+ entitiesMetadata = new HashSet<>();
+ versionableEntities.put(entityType, entitiesMetadata);
+ }
+ entitiesMetadata.add(entityMetadata);
+ }
+
+ @Override
+ public Version create(String entityType, String entityId, String user) {
+ VersionInfoEntity versionInfoEntity =
+ versionInfoDao.get(new VersionInfoEntity(entityType, entityId));
+ if (versionInfoEntity != null) {
+ throw new CoreException(new EntityAlreadyExistErrorBuilder(entityType, entityId).build());
+ }
+
+ versionInfoEntity = new VersionInfoEntity(entityType, entityId);
+ versionInfoEntity.setActiveVersion(INITIAL_ACTIVE_VERSION);
+ markAsCheckedOut(versionInfoEntity, user);
+ versionInfoDao.create(versionInfoEntity);
+
+ return versionInfoEntity.getCandidate().getVersion();
+ }
+
+ @Override
+ public Version checkout(String entityType, String entityId, String user) {
+ VersionInfoEntity versionInfoEntity =
+ versionInfoDao.get(new VersionInfoEntity(entityType, entityId));
+ if (versionInfoEntity == null) {
+ throw new CoreException(new EntityNotExistErrorBuilder(entityType, entityId).build());
+ }
+
+ Version checkoutVersion = null;
+ switch (versionInfoEntity.getStatus()) {
+ case Locked:
+ throw new CoreException(new CheckoutOnLockedEntityErrorBuilder(entityType, entityId,
+ versionInfoEntity.getCandidate().getUser()).build());
+ case Final:
+ case Available:
+ checkoutVersion = doCheckout(versionInfoEntity, user);
+ break;
+ default:
+ }
+ return checkoutVersion;
+ }
+
+ @Override
+ public Version undoCheckout(String entityType, String entityId, String user) {
+ VersionInfoEntity versionInfoEntity =
+ versionInfoDao.get(new VersionInfoEntity(entityType, entityId));
+ if (versionInfoEntity == null) {
+ throw new CoreException(new EntityNotExistErrorBuilder(entityType, entityId).build());
+ }
+
+ Version activeVersion = null;
+ switch (versionInfoEntity.getStatus()) {
+ case Locked:
+ if (!user.equals(versionInfoEntity.getCandidate().getUser())) {
+ throw new CoreException(
+ new UndoCheckoutOnEntityLockedByOtherErrorBuilder(entityType, entityId,
+ versionInfoEntity.getCandidate().getUser()).build());
+ }
+ activeVersion = undoCheckout(versionInfoEntity);
+ break;
+ case Final:
+ case Available:
+ throw new CoreException(
+ new UndoCheckoutOnUnlockedEntityErrorBuilder(entityType, entityId).build());
+ default:
+ }
+ return activeVersion;
+ }
+
+ private Version undoCheckout(VersionInfoEntity versionInfoEntity) {
+ deleteVersionFromEntity(versionInfoEntity.getEntityType(), versionInfoEntity.getEntityId(),
+ versionInfoEntity.getCandidate().getVersion());
+
+ versionInfoEntity.setStatus(versionInfoEntity.getActiveVersion().isFinal() ? VersionStatus.Final
+ : VersionStatus.Available);
+ versionInfoEntity.setCandidate(null);
+ versionInfoDao.update(versionInfoEntity);
+ return versionInfoEntity.getActiveVersion();
+ }
+
+ @Override
+ public Version checkin(String entityType, String entityId, String user,
+ String checkinDescription) {
+ VersionInfoEntity versionInfoEntity =
+ versionInfoDao.get(new VersionInfoEntity(entityType, entityId));
+ if (versionInfoEntity == null) {
+ throw new CoreException(new EntityNotExistErrorBuilder(entityType, entityId).build());
+ }
+
+ Version checkedInVersion = null;
+ switch (versionInfoEntity.getStatus()) {
+ case Available:
+ case Final:
+ throw new CoreException(
+ new CheckinOnUnlockedEntityErrorBuilder(entityType, entityId).build());
+ case Locked:
+ if (!user.equals(versionInfoEntity.getCandidate().getUser())) {
+ throw new CoreException(new CheckinOnEntityLockedByOtherErrorBuilder(entityType, entityId,
+ versionInfoEntity.getCandidate().getUser()).build());
+ }
+ checkedInVersion = doCheckin(versionInfoEntity, checkinDescription);
+ break;
+ default:
+ }
+ return checkedInVersion;
+ }
+
+ @Override
+ public Version submit(String entityType, String entityId, String user, String submitDescription) {
+ VersionInfoEntity versionInfoEntity =
+ versionInfoDao.get(new VersionInfoEntity(entityType, entityId));
+ if (versionInfoEntity == null) {
+ throw new CoreException(new EntityNotExistErrorBuilder(entityType, entityId).build());
+ }
+
+ Version submitVersion = null;
+ switch (versionInfoEntity.getStatus()) {
+ case Final:
+ throw new CoreException(
+ new EntityAlreadyFinalizedErrorBuilder(entityType, entityId).build());
+ case Locked:
+ throw new CoreException(new SubmitLockedEntityNotAllowedErrorBuilder(entityType, entityId,
+ versionInfoEntity.getCandidate().getUser()).build());
+ case Available:
+ submitVersion = doSubmit(versionInfoEntity, user, submitDescription);
+ break;
+ default:
+ }
+ return submitVersion;
+ }
+
+ @Override
+ public VersionInfo getEntityVersionInfo(String entityType, String entityId, String user,
+ VersionableEntityAction action) {
+ VersionInfoEntity versionInfoEntity =
+ versionInfoDao.get(new VersionInfoEntity(entityType, entityId));
+ if (versionInfoEntity == null) {
+ throw new CoreException(new EntityNotExistErrorBuilder(entityType, entityId).build());
+ }
+ return getVersionInfo(versionInfoEntity, user, action);
+ }
+
+ @Override
+ public Map<String, VersionInfo> listEntitiesVersionInfo(String entityType, String user,
+ VersionableEntityAction action) {
+ Collection<VersionInfoEntity> versionInfoEntities =
+ versionInfoDao.list(new VersionInfoEntity(entityType, null));
+ Map<String, VersionInfo> activeVersions = new HashMap<>();
+ for (VersionInfoEntity versionInfoEntity : versionInfoEntities) {
+ activeVersions
+ .put(versionInfoEntity.getEntityId(), getVersionInfo(versionInfoEntity, user, action));
+ }
+ return activeVersions;
+ }
+
+ @Override
+ public Map<String, VersionInfo> listDeletedEntitiesVersionInfo(String entityType, String user,
+ VersionableEntityAction action) {
+ Collection<VersionInfoDeletedEntity> versionInfoDeletedEntities =
+ versionInfoDeletedDao.list(new VersionInfoDeletedEntity(entityType, null));
+ Map<String, VersionInfo> activeVersions = new HashMap<>();
+
+
+ for (VersionInfoDeletedEntity versionInfoDeletedEntity : versionInfoDeletedEntities) {
+ activeVersions.put(versionInfoDeletedEntity.getEntityId(),
+ getVersionInfo(versionInfoDeletedEntity, user, action));
+ }
+ return activeVersions;
+ }
+
+ @Override
+ public void delete(String entityType, String entityId, String user) {
+ VersionInfoEntity versionInfoEntity =
+ versionInfoDao.get(new VersionInfoEntity(entityType, entityId));
+ if (versionInfoEntity == null) {
+ throw new CoreException(new EntityNotExistErrorBuilder(entityType, entityId).build());
+ }
+
+ switch (versionInfoEntity.getStatus()) {
+ case Locked:
+ throw new CoreException(new DeleteOnLockedEntityErrorBuilder(entityType, entityId,
+ versionInfoEntity.getCandidate().getUser()).build());
+ default:
+ }
+
+ doDelete(versionInfoEntity, user);
+ }
+
+ @Override
+ public void undoDelete(String entityType, String entityId, String user) {
+ VersionInfoDeletedEntity versionInfoDeletedEntity =
+ versionInfoDeletedDao.get(new VersionInfoDeletedEntity(entityType, entityId));
+ if (versionInfoDeletedEntity == null) {
+ throw new CoreException(new EntityNotExistErrorBuilder(entityType, entityId).build());
+ }
+
+ doUndoDelete(versionInfoDeletedEntity, user);
+ }
+
+ private void markAsCheckedOut(VersionInfoEntity versionInfoEntity, String checkingOutUser) {
+ versionInfoEntity.setStatus(VersionStatus.Locked);
+ versionInfoEntity.setCandidate(new UserCandidateVersion(checkingOutUser,
+ versionInfoEntity.getActiveVersion().calculateNextCandidate()));
+ }
+
+ private Version doCheckout(VersionInfoEntity versionInfoEntity, String user) {
+ markAsCheckedOut(versionInfoEntity, user);
+ versionInfoDao.update(versionInfoEntity);
+
+ initVersionOnEntity(versionInfoEntity.getEntityType(), versionInfoEntity.getEntityId(),
+ versionInfoEntity.getActiveVersion(), versionInfoEntity.getCandidate().getVersion());
+
+ return versionInfoEntity.getCandidate().getVersion();
+ }
+
+ private void doDelete(VersionInfoEntity versionInfoEntity, String user) {
+
+ VersionInfoDeletedEntity versionInfoDeletedEntity = new VersionInfoDeletedEntity();
+ versionInfoDeletedEntity.setStatus(versionInfoEntity.getStatus());
+ versionInfoDeletedEntity.setViewableVersions(versionInfoEntity.getViewableVersions());
+ versionInfoDeletedEntity.setActiveVersion(versionInfoEntity.getActiveVersion());
+ versionInfoDeletedEntity.setCandidate(versionInfoEntity.getCandidate());
+ versionInfoDeletedEntity.setEntityId(versionInfoEntity.getEntityId());
+ versionInfoDeletedEntity.setEntityType(versionInfoEntity.getEntityType());
+ versionInfoDeletedEntity.setLatestFinalVersion(versionInfoEntity.getLatestFinalVersion());
+ versionInfoDeletedDao.create(versionInfoDeletedEntity);
+ versionInfoDao.delete(versionInfoEntity);
+
+ }
+
+ private void doUndoDelete(VersionInfoDeletedEntity versionInfoDeletedEntity, String user) {
+
+ VersionInfoEntity versionInfoEntity = new VersionInfoEntity();
+ versionInfoEntity.setStatus(versionInfoDeletedEntity.getStatus());
+ versionInfoEntity.setViewableVersions(versionInfoDeletedEntity.getViewableVersions());
+ versionInfoEntity.setActiveVersion(versionInfoDeletedEntity.getActiveVersion());
+ versionInfoEntity.setCandidate(versionInfoDeletedEntity.getCandidate());
+ versionInfoEntity.setEntityId(versionInfoDeletedEntity.getEntityId());
+ versionInfoEntity.setEntityType(versionInfoDeletedEntity.getEntityType());
+ versionInfoEntity.setLatestFinalVersion(versionInfoDeletedEntity.getLatestFinalVersion());
+ versionInfoDao.create(versionInfoEntity);
+ versionInfoDeletedDao.delete(versionInfoDeletedEntity);
+
+ }
+
+ private Version doCheckin(VersionInfoEntity versionInfoEntity, String checkinDescription) {
+ UserCandidateVersion userCandidateVersion = versionInfoEntity.getCandidate();
+ versionInfoEntity.setCandidate(null);
+ versionInfoEntity.setActiveVersion(userCandidateVersion.getVersion());
+ versionInfoEntity.getViewableVersions().add(versionInfoEntity.getActiveVersion());
+ versionInfoEntity.setStatus(VersionStatus.Available);
+ versionInfoDao.update(versionInfoEntity);
+
+ return versionInfoEntity.getActiveVersion();
+ }
+
+ private Version doSubmit(VersionInfoEntity versionInfoEntity, String submittingUser,
+ String submitDescription) {
+ Version finalVersion = versionInfoEntity.getActiveVersion().calculateNextFinal();
+ initVersionOnEntity(versionInfoEntity.getEntityType(), versionInfoEntity.getEntityId(),
+ versionInfoEntity.getActiveVersion(), finalVersion);
+
+ Set<Version> viewableVersions = new HashSet<>();
+ for (Version version : versionInfoEntity.getViewableVersions()) {
+ if (version.isFinal()) {
+ viewableVersions.add(version);
+ }
+ }
+ viewableVersions.add(finalVersion);
+ versionInfoEntity.setViewableVersions(viewableVersions);
+ versionInfoEntity.setActiveVersion(finalVersion);
+ versionInfoEntity.setLatestFinalVersion(finalVersion);
+ versionInfoEntity.setStatus(VersionStatus.Final);
+ versionInfoDao.update(versionInfoEntity);
+
+ return finalVersion;
+ }
+
+ private void createVersionHistory(VersionableEntityId entityId, Version version, String user,
+ String description, VersionType type) {
+ VersionHistoryEntity versionHistory = new VersionHistoryEntity(entityId);
+ versionHistory.setVersion(version);
+ versionHistory.setUser(user);
+ versionHistory.setDescription(description);
+ versionHistory.setType(type);
+ }
+
+ private void initVersionOnEntity(String entityType, String entityId, Version baseVersion,
+ Version newVersion) {
+ Set<VersionableEntityMetadata> entityMetadatas = versionableEntities.get(entityType);
+ if (entityMetadatas != null) {
+ for (VersionableEntityMetadata entityMetadata : entityMetadatas) {
+ versionableEntityDao.initVersion(entityMetadata, entityId, baseVersion, newVersion);
+ }
+ }
+ }
+
+ private void deleteVersionFromEntity(String entityType, String entityId,
+ Version versionToDelete) {
+ Set<VersionableEntityMetadata> entityMetadatas = versionableEntities.get(entityType);
+ if (entityMetadatas != null) {
+ for (VersionableEntityMetadata entityMetadata : entityMetadatas) {
+ versionableEntityDao.deleteVersion(entityMetadata, entityId, versionToDelete);
+ }
+ }
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/test/java/org/openecomp/sdc/versioning/VersioningManagerTest.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/test/java/org/openecomp/sdc/versioning/VersioningManagerTest.java
new file mode 100644
index 0000000000..3695f9ef2d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/test/java/org/openecomp/sdc/versioning/VersioningManagerTest.java
@@ -0,0 +1,364 @@
+package org.openecomp.sdc.versioning;
+
+
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.versioning.dao.VersionInfoDao;
+import org.openecomp.sdc.versioning.dao.VersionInfoDaoFactory;
+import org.openecomp.sdc.versioning.dao.VersionInfoDeletedDao;
+import org.openecomp.sdc.versioning.dao.VersionInfoDeletedDaoFactory;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.dao.types.VersionInfoDeletedEntity;
+import org.openecomp.sdc.versioning.dao.types.VersionInfoEntity;
+import org.openecomp.sdc.versioning.dao.types.VersionStatus;
+import org.openecomp.sdc.versioning.types.VersionInfo;
+import org.openecomp.sdc.versioning.types.VersionableEntityAction;
+import org.openecomp.sdc.versioning.types.VersionableEntityMetadata;
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.mapping.UDTMapper;
+
+import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+public class VersioningManagerTest {
+ private static final VersioningManager versioningManager =
+ VersioningManagerFactory.getInstance().createInterface();
+ private static final VersionInfoDao versionInfoDao =
+ VersionInfoDaoFactory.getInstance().createInterface();
+ private static final VersionInfoDeletedDao versionInfoDeletedDao =
+ VersionInfoDeletedDaoFactory.getInstance().createInterface();
+ private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
+ private static final String USR1 = "usr1";
+ private static final String USR2 = "usr2";
+ private static final String USR3 = "usr3";
+ private static final String TYPE1 = "Type1";
+ private static final String TYPE2 = "Type2";
+ private static final String ID1 = "Id1";
+ private static final String ID2 = "Id2";
+ private static final String ID3 = "Id3";
+ private static final String TYPE1_TABLE_NAME = "vendor_license_model";
+ private static final String TYPE1_ID_NAME = "vlm_id";
+ private static final String TYPE1_VERSION_NAME = "version";
+ private static final String TYPE2_TABLE_NAME = "feature_group";
+ private static final String TYPE2_ID_NAME = "vlm_id";
+ private static final String TYPE2_VERSION_NAME = "version";
+ private static final Version VERSION01 = new Version(0, 1);
+ private static final Version VERSION02 = new Version(0, 2);
+ private static final Version VERSION10 = new Version(1, 0);
+ private static final Version VERSION11 = new Version(1, 1);
+ private static UDTMapper<Version> versionMapper =
+ noSqlDb.getMappingManager().udtMapper(Version.class);
+ private static Set<Version> expectedViewableVersionsType1Id1 = new HashSet<>();
+
+ private static void assretVersionInfoEntity(VersionInfoEntity actual, String entityType,
+ String entityId, Version activeVersion,
+ Version candidateVersion, String candidateUser,
+ VersionStatus status, Set<Version> viewbleVersions,
+ Version latestFinalVersion) {
+ Assert.assertNotNull(actual);
+ Assert.assertEquals(actual.getEntityType(), entityType);
+ Assert.assertEquals(actual.getEntityId(), entityId);
+ Assert.assertEquals(actual.getActiveVersion(), activeVersion);
+ if (candidateVersion != null && candidateUser != null) {
+ Assert.assertEquals(actual.getCandidate().getVersion(), candidateVersion);
+ Assert.assertEquals(actual.getCandidate().getUser(), candidateUser);
+ } else {
+ Assert.assertNull(actual.getCandidate());
+ }
+ Assert.assertEquals(actual.getStatus(), status);
+ Assert.assertEquals(actual.getViewableVersions().size(), viewbleVersions.size());
+ Assert.assertEquals(actual.getViewableVersions(), viewbleVersions);
+ Assert.assertEquals(actual.getLatestFinalVersion(), latestFinalVersion);
+ }
+
+ private static void assretVersionInfo(VersionInfo actual, Version activeVersion,
+ VersionStatus status, String lockingUser,
+ Set<Version> viewableVersions, Version latestFinalVersion) {
+ Assert.assertNotNull(actual);
+ Assert.assertEquals(actual.getActiveVersion(), activeVersion);
+ Assert.assertEquals(actual.getStatus(), status);
+ Assert.assertEquals(actual.getLockingUser(), lockingUser);
+ Assert.assertEquals(actual.getViewableVersions().size(), viewableVersions.size());
+ Assert.assertEquals(actual.getViewableVersions(), viewableVersions);
+ Assert.assertEquals(actual.getLatestFinalVersion(), latestFinalVersion);
+ }
+
+// @BeforeClass
+ private void init() {
+ versionInfoDao.delete(new VersionInfoEntity(TYPE1, ID1));
+ versionInfoDao.delete(new VersionInfoEntity(TYPE1, ID2));
+ versionInfoDao.delete(new VersionInfoEntity(TYPE2, ID3));
+ String deleteFromType1 = String
+ .format("delete from %s where %s=? and %s=?", TYPE1_TABLE_NAME, TYPE1_ID_NAME,
+ TYPE1_VERSION_NAME);
+ noSqlDb.execute(deleteFromType1, ID1, versionMapper.toUDT(VERSION01));
+ noSqlDb.execute(deleteFromType1, ID1, versionMapper.toUDT(VERSION02));
+ noSqlDb.execute(deleteFromType1, ID1, versionMapper.toUDT(VERSION11));
+
+ versioningManager.register(TYPE1,
+ new VersionableEntityMetadata(TYPE1_TABLE_NAME, TYPE1_ID_NAME, TYPE1_VERSION_NAME));
+ versioningManager.register(TYPE2,
+ new VersionableEntityMetadata(TYPE2_TABLE_NAME, TYPE2_ID_NAME, TYPE2_VERSION_NAME));
+ }
+
+// @Test
+ public void createTest() {
+ Version version = versioningManager.create(TYPE1, ID1, USR1);
+ createVersionableEntityRecord(TYPE1_TABLE_NAME, TYPE1_ID_NAME, TYPE1_VERSION_NAME, ID1,
+ version);
+
+ VersionInfoEntity versionInfoEntity = versionInfoDao.get(new VersionInfoEntity(TYPE1, ID1));
+ assretVersionInfoEntity(versionInfoEntity, TYPE1, ID1, new Version(0, 0), VERSION01, USR1,
+ VersionStatus.Locked, expectedViewableVersionsType1Id1, null);
+ }
+
+// @Test(dependsOnMethods = "createTest")
+ public void checkinTest() {
+ Version version = versioningManager.checkin(TYPE1, ID1, USR1, "checkin 0.1");
+ Assert.assertEquals(version, VERSION01);
+
+ VersionInfoEntity versionInfoEntity = versionInfoDao.get(new VersionInfoEntity(TYPE1, ID1));
+ expectedViewableVersionsType1Id1.add(VERSION01);
+ assretVersionInfoEntity(versionInfoEntity, TYPE1, ID1, VERSION01, null, null,
+ VersionStatus.Available, expectedViewableVersionsType1Id1, null);
+ }
+
+// @Test(dependsOnMethods = "checkinTest")
+ public void getVersionInfoForReadOnAvailableTest() {
+ VersionInfo versionInfo =
+ versioningManager.getEntityVersionInfo(TYPE1, ID1, USR2, VersionableEntityAction.Read);
+ assretVersionInfo(versionInfo, VERSION01, VersionStatus.Available, null,
+ expectedViewableVersionsType1Id1, null);
+ }
+
+// @Test(dependsOnMethods = "getVersionInfoForReadOnAvailableTest",
+// expectedExceptions = CoreException.class)
+ public void getVersionInfoForWriteOnAvailableTest() {
+ versioningManager.getEntityVersionInfo(TYPE1, ID1, USR2, VersionableEntityAction.Write);
+ }
+
+// @Test(dependsOnMethods = "getVersionInfoForWriteOnAvailableTest",
+// expectedExceptions = CoreException.class)
+ public void checkinOnAvailableTest() {
+ versioningManager.checkin(TYPE1, ID1, USR1, "fail checkin");
+ }
+
+// @Test(dependsOnMethods = "checkinOnAvailableTest", expectedExceptions = CoreException.class)
+ public void undoCheckoutOnAvailableTest() {
+ versioningManager.undoCheckout(TYPE1, ID1, USR1);
+ }
+
+// @Test(dependsOnMethods = "undoCheckoutOnAvailableTest")
+ public void checkoutTest() {
+ Version version = versioningManager.checkout(TYPE1, ID1, USR2);
+ Assert.assertEquals(version, VERSION02);
+
+ VersionInfoEntity versionInfoEntity = versionInfoDao.get(new VersionInfoEntity(TYPE1, ID1));
+ assretVersionInfoEntity(versionInfoEntity, TYPE1, ID1, VERSION01, VERSION02, USR2,
+ VersionStatus.Locked, expectedViewableVersionsType1Id1, null);
+
+ ResultSet results =
+ loadVersionableEntityRecord(TYPE1_TABLE_NAME, TYPE1_ID_NAME, TYPE1_VERSION_NAME, ID1,
+ VERSION02);
+ Assert.assertTrue(results.iterator().hasNext());
+ }
+
+// @Test(dependsOnMethods = "checkoutTest")
+ public void getVersionInfoForReadOnLockedSameUserTest() {
+ VersionInfo versionInfo =
+ versioningManager.getEntityVersionInfo(TYPE1, ID1, USR2, VersionableEntityAction.Read);
+ Set<Version> expectedViewableVersions = new HashSet<>();
+ expectedViewableVersions.addAll(expectedViewableVersionsType1Id1);
+ expectedViewableVersions.add(VERSION02);
+ assretVersionInfo(versionInfo, VERSION02, VersionStatus.Locked, USR2, expectedViewableVersions,
+ null);
+ }
+
+// @Test(dependsOnMethods = "getVersionInfoForReadOnLockedSameUserTest")
+ public void getVersionInfoForReadOnLockedOtherUserTest() {
+ VersionInfo entityVersionInfo =
+ versioningManager.getEntityVersionInfo(TYPE1, ID1, USR1, VersionableEntityAction.Read);
+ Assert.assertEquals(entityVersionInfo.getActiveVersion(), VERSION01);
+ }
+
+// @Test(dependsOnMethods = "getVersionInfoForReadOnLockedOtherUserTest",
+// expectedExceptions = CoreException.class)
+ public void getVersionInfoForWriteOnLockedOtherUserTest() {
+ versioningManager.getEntityVersionInfo(TYPE1, ID1, USR1, VersionableEntityAction.Write)
+ .getActiveVersion();
+ }
+
+// @Test(dependsOnMethods = "getVersionInfoForWriteOnLockedOtherUserTest")
+ public void getVersionInfoForWriteOnLockedSameUserTest() {
+ Version activeVersion =
+ versioningManager.getEntityVersionInfo(TYPE1, ID1, USR2, VersionableEntityAction.Write)
+ .getActiveVersion();
+ Assert.assertEquals(activeVersion, VERSION02);
+ }
+
+// @Test(dependsOnMethods = "getVersionInfoForWriteOnLockedSameUserTest",
+// expectedExceptions = CoreException.class)
+ public void checkoutOnLockedSameUserTest() {
+ versioningManager.checkout(TYPE1, ID1, USR2);
+ }
+
+// @Test(dependsOnMethods = "checkoutOnLockedSameUserTest", expectedExceptions = CoreException.class)
+ public void checkoutOnLockedOtherUserTest() {
+ versioningManager.checkout(TYPE1, ID1, USR1);
+ }
+
+// @Test(dependsOnMethods = "checkoutOnLockedSameUserTest", expectedExceptions = CoreException.class)
+ public void undoCheckoutOnLockedOtherUserTest() {
+ versioningManager.undoCheckout(TYPE1, ID1, USR1);
+ }
+
+// @Test(dependsOnMethods = "undoCheckoutOnLockedOtherUserTest",
+// expectedExceptions = CoreException.class)
+ public void submitOnLockedTest() {
+ versioningManager.submit(TYPE1, ID1, USR2, "failed submit");
+ }
+
+// @Test(dependsOnMethods = "submitOnLockedTest")
+ public void undoCheckoutTest() {
+ Version version = versioningManager.undoCheckout(TYPE1, ID1, USR2);
+ Assert.assertEquals(version, VERSION01);
+
+ VersionInfoEntity versionInfoEntity = versionInfoDao.get(new VersionInfoEntity(TYPE1, ID1));
+ assretVersionInfoEntity(versionInfoEntity, TYPE1, ID1, VERSION01, null, null,
+ VersionStatus.Available, expectedViewableVersionsType1Id1, null);
+
+ ResultSet results =
+ loadVersionableEntityRecord(TYPE1_TABLE_NAME, TYPE1_ID_NAME, TYPE1_VERSION_NAME, ID1,
+ VERSION02);
+ Assert.assertFalse(results.iterator().hasNext());
+ }
+
+// @Test(dependsOnMethods = "undoCheckoutTest")
+ public void submitTest() {
+ Version version = versioningManager.submit(TYPE1, ID1, USR3, "submit msg");
+ Assert.assertEquals(version, VERSION10);
+ expectedViewableVersionsType1Id1 = new HashSet<>();
+ expectedViewableVersionsType1Id1.add(version);
+
+ VersionInfoEntity versionInfoEntity = versionInfoDao.get(new VersionInfoEntity(TYPE1, ID1));
+ assretVersionInfoEntity(versionInfoEntity, TYPE1, ID1, VERSION10, null, null,
+ VersionStatus.Final, expectedViewableVersionsType1Id1, VERSION10);
+
+ ResultSet results =
+ loadVersionableEntityRecord(TYPE1_TABLE_NAME, TYPE1_ID_NAME, TYPE1_VERSION_NAME, ID1,
+ VERSION10);
+ Assert.assertTrue(results.iterator().hasNext());
+ }
+
+// @Test(dependsOnMethods = "submitTest", expectedExceptions = CoreException.class)
+ public void checkinOnFinalizedTest() {
+ versioningManager.checkin(TYPE1, ID1, USR2, "failed checkin");
+ }
+
+// @Test(dependsOnMethods = "checkinOnFinalizedTest", expectedExceptions = CoreException.class)
+ public void undoCheckouOnFinalizedTest() {
+ versioningManager.undoCheckout(TYPE1, ID1, USR2);
+ }
+
+// @Test(dependsOnMethods = "undoCheckouOnFinalizedTest", expectedExceptions = CoreException.class)
+ public void submitOnFinalizedTest() {
+ versioningManager.submit(TYPE1, ID1, USR2, "failed submit");
+ }
+
+// @Test(dependsOnMethods = "submitOnFinalizedTest")
+ public void checkoutOnFinalizedTest() {
+ Version version = versioningManager.checkout(TYPE1, ID1, USR3);
+ Assert.assertEquals(version, VERSION11);
+
+ VersionInfoEntity versionInfoEntity = versionInfoDao.get(new VersionInfoEntity(TYPE1, ID1));
+ assretVersionInfoEntity(versionInfoEntity, TYPE1, ID1, VERSION10, VERSION11, USR3,
+ VersionStatus.Locked, expectedViewableVersionsType1Id1, VERSION10);
+
+ ResultSet results =
+ loadVersionableEntityRecord(TYPE1_TABLE_NAME, TYPE1_ID_NAME, TYPE1_VERSION_NAME, ID1,
+ VERSION11);
+ Assert.assertTrue(results.iterator().hasNext());
+ }
+
+// @Test(dependsOnMethods = "checkoutOnFinalizedTest")
+ public void viewableVersionsTest() {
+ versioningManager.checkin(TYPE1, ID1, USR3, "check in 1.1");
+ versioningManager.checkout(TYPE1, ID1, USR3);
+ versioningManager.checkin(TYPE1, ID1, USR3, "check in 1.2");
+ versioningManager.submit(TYPE1, ID1, USR3, "submit in 2.0");
+ versioningManager.checkout(TYPE1, ID1, USR3);
+ versioningManager.checkin(TYPE1, ID1, USR3, "check in 2.1");
+ versioningManager.submit(TYPE1, ID1, USR3, "submit in 3.0");
+ versioningManager.checkout(TYPE1, ID1, USR3);
+ versioningManager.checkin(TYPE1, ID1, USR3, "check in 3.1");
+ versioningManager.checkout(TYPE1, ID1, USR3);
+ versioningManager.checkin(TYPE1, ID1, USR3, "check in 3.2");
+ versioningManager.checkout(TYPE1, ID1, USR2);
+
+ VersionInfoEntity versionInfoEntity = versionInfoDao.get(new VersionInfoEntity(TYPE1, ID1));
+ HashSet<Version> expectedViewableVersions = new HashSet<>();
+ expectedViewableVersions.add(VERSION10);
+ expectedViewableVersions.add(new Version(2, 0));
+ expectedViewableVersions.add(new Version(3, 0));
+ expectedViewableVersions.add(new Version(3, 1));
+ expectedViewableVersions.add(new Version(3, 2));
+ assretVersionInfoEntity(versionInfoEntity, TYPE1, ID1, new Version(3, 2), new Version(3, 3),
+ USR2, VersionStatus.Locked, expectedViewableVersions, new Version(3, 0));
+ }
+
+// @Test(dependsOnMethods = "viewableVersionsTest")
+ public void listActiveVersionsTest() {
+ versioningManager.create(TYPE1, ID2, USR3);
+ versioningManager.checkin(TYPE1, ID2, USR3, "check in 0.1");
+
+ versioningManager.create(TYPE2, ID3, USR3);
+ versioningManager.checkin(TYPE2, ID3, USR3, "check in 0.1");
+
+ Map<String, VersionInfo> idToVersionInfo =
+ versioningManager.listEntitiesVersionInfo(TYPE1, USR2, VersionableEntityAction.Read);
+ Assert.assertEquals(idToVersionInfo.size(), 2);
+ Assert.assertEquals(idToVersionInfo.get(ID1).getActiveVersion(), new Version(3, 3));
+ Assert.assertEquals(idToVersionInfo.get(ID2).getActiveVersion(), VERSION01);
+ }
+
+// @Test(dependsOnMethods = "listActiveVersionsTest")
+ public void deleteTest() {
+ versioningManager.checkin(TYPE1, ID1, USR2, "check in for delete");
+ versioningManager.delete(TYPE1, ID1, USR1);
+
+ VersionInfoDeletedEntity versionInfoDeletedEntity =
+ versionInfoDeletedDao.get(new VersionInfoDeletedEntity(TYPE1, ID1));
+ Assert.assertNotNull(versionInfoDeletedEntity);
+
+ Map<String, VersionInfo> entitiesInfoMap =
+ versioningManager.listDeletedEntitiesVersionInfo(TYPE1, USR2, null);
+ Assert.assertEquals(entitiesInfoMap.size(), 1);
+ VersionInfoEntity versionInfoEntity = versionInfoDao.get(new VersionInfoEntity(TYPE1, ID1));
+ Assert.assertNull(versionInfoEntity);
+ versioningManager.undoDelete(TYPE1, ID1, USR1);
+ versionInfoEntity = versionInfoDao.get(new VersionInfoEntity(TYPE1, ID1));
+ Assert.assertNotNull(versionInfoEntity);
+
+
+ }
+
+ private void createVersionableEntityRecord(String tableName, String idName, String versionName,
+ String id, Version version) {
+ noSqlDb.execute(
+ String.format("insert into %s (%s,%s) values (?,?)", tableName, idName, versionName), id,
+ versionMapper.toUDT(version));
+ }
+
+ private ResultSet loadVersionableEntityRecord(String tableName, String idName, String versionName,
+ String id, Version version) {
+ return noSqlDb.execute(
+ String.format("select * from %s where %s=? and %s=?", tableName, idName, versionName), id,
+ versionMapper.toUDT(version));
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/pom.xml b/openecomp-be/lib/openecomp-sdc-versioning-lib/pom.xml
new file mode 100644
index 0000000000..b94d9a1cac
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/pom.xml
@@ -0,0 +1,23 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <artifactId>openecomp-sdc-lib</artifactId>
+ <groupId>org.openecomp.sdc</groupId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>openecomp-sdc-versioning-lib</artifactId>
+ <packaging>pom</packaging>
+ <name>openecomp-sdc-versioning-lib</name>
+
+ <modules>
+ <module>openecomp-sdc-versioning-api</module>
+ <module>openecomp-sdc-versioning-core</module>
+ </modules>
+
+ <dependencies>
+
+ </dependencies>
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-tosca-lib/pom.xml b/openecomp-be/lib/openecomp-tosca-lib/pom.xml
new file mode 100644
index 0000000000..eb67349896
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/pom.xml
@@ -0,0 +1,66 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+
+
+ <parent>
+ <artifactId>openecomp-sdc-lib</artifactId>
+ <groupId>org.openecomp.sdc</groupId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-tosca-lib</artifactId>
+ <name>openecomp-tosca-lib</name>
+
+
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-utilities-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-datatypes-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.core</groupId>
+ <artifactId>openecomp-common-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <version>1.1.2</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>RELEASE</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <version>1.10.19</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <version>19.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.yaml</groupId>
+ <artifactId>snakeyaml</artifactId>
+ </dependency>
+ </dependencies>
+
+
+
+
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaArtifactType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaArtifactType.java
new file mode 100644
index 0000000000..2da60c0b79
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaArtifactType.java
@@ -0,0 +1,39 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes;
+
+
+public enum ToscaArtifactType {
+
+ DEPLOYMENT("tosca.artifacts.Deployment"),;
+
+ private String displayName;
+
+ ToscaArtifactType(String displayName) {
+ this.displayName = displayName;
+ }
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaCapabilityType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaCapabilityType.java
new file mode 100644
index 0000000000..d26eb3a83a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaCapabilityType.java
@@ -0,0 +1,52 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes;
+
+
+public enum ToscaCapabilityType {
+
+ ROOT("tosca.capabilities.Root"),
+ NODE("tosca.capabilities.Node"),
+ CONTAINER("tosca.capabilities.Container"),
+ NETWORK_BINDABLE("tosca.capabilities.network.Bindable"),
+ SCALABLE("tosca.capabilities.Scalable"),
+ OPERATING_SYSTEM("tosca.capabilities.OperatingSystem"),
+ ENDPOINT_ADMIN("tosca.capabilities.Endpoint.Admin"),
+ ATTACHMENT("tosca.capabilities.Attachment"),
+ NETWORK_LINKABLE("tosca.capabilities.network.Linkable"),
+ METRIC("org.openecomp.capabilities.Metric"),
+ NFV_METRIC("tosca.capabilities.nfv.Metric"),
+ METRIC_CEILOMETER("org.openecomp.capabilities.metric.Ceilometer"),
+ METRIC_SNMP_TRAP("org.openecomp.capabilities.metric.SnmpTrap"),
+ METRIC_SNMP_POLLING("org.openecomp.capabilities.metric.SnmpPolling"),;
+
+ private String displayName;
+
+ ToscaCapabilityType(String displayName) {
+ this.displayName = displayName;
+ }
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaDataType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaDataType.java
new file mode 100644
index 0000000000..2a9df65b17
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaDataType.java
@@ -0,0 +1,84 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes;
+
+
+public enum ToscaDataType {
+
+ ROOT("tosca.datatypes.Root"),
+ NETWORK_NETWORK_INFO("tosca.datatypes.network.NetworkInfo"),
+ NETWORK_PORT_INFO("tosca.datatypes.network.PortInfo"),
+ NOVA_SERVER_PORT_EXTRA_PROPERTIES(
+ "org.openecomp.datatypes.heat.novaServer.network.PortExtraProperties"),
+ NETWORK_ADDRESS_PAIR("org.openecomp.datatypes.heat.network.AddressPair"),
+ NEUTRON_PORT_FIXED_IPS("org.openecomp.datatypes.heat.neutron.port.FixedIps"),
+ CONTRAIL_NETWORK_RULE("org.openecomp.datatypes.heat.contrail.network.rule.Rule"),
+ CONTRAIL_NETWORK_RULE_LIST("org.openecomp.datatypes.heat.contrail.network.rule.RuleList"),
+ CONTRAIL_NETWORK_RULE_PORT_PAIRS("org.openecomp.datatypes.heat.contrail.network.rule.PortPairs"),
+ CONTRAIL_NETWORK_RULE_VIRTUAL_NETWORK(
+ "org.openecomp.datatypes.heat.contrail.network.rule.VirtualNetwork"),
+ CONTRAILV2_NETWORK_RULE("org.openecomp.datatypes.heat.contrailV2.network.rule.Rule"),
+ CONTRAILV2_NETWORK_RULE_LIST("org.openecomp.datatypes.heat.contrailV2.network.rule.RuleList"),
+ CONTRAILV2_NETWORK_RULE_SRC_PORT_PAIRS(
+ "org.openecomp.datatypes.heat.contrailV2.network.rule.SrcPortPairs"),
+ CONTRAILV2_NETWORK_RULE_DST_PORT_PAIRS(
+ "org.openecomp.datatypes.heat.contrailV2.network.rule.DstPortPairs"),
+ CONTRAILV2_NETWORK_RULE_DST_VIRTUAL_NETWORK(
+ "org.openecomp.datatypes.heat.contrailV2.network.rule.DstVirtualNetwork"),
+ CONTRAILV2_NETWORK_RULE_SRC_VIRTUAL_NETWORK(
+ "org.openecomp.datatypes.heat.contrailV2.network.rule.SrcVirtualNetwork"),
+ CONTRAILV2_VIRTUAL_MACHINE_INTERFACE_PROPERTIES(
+ "org.openecomp.datatypes.heat.contrailV2.virtual.machine.interface.Properties"),
+ CONTRAILV2_NETWORK_RULE_ACTION_LIST(
+ "org.openecomp.datatypes.heat.contrailV2.network.rule.ActionList"),
+ CONTRAILV2_VIRTUAL_NETWORK_IPAM_REF_DATA(
+ "org.openecomp.datatypes.heat.contrailV2.virtual.network.rule.IpamRefData"),
+ CONTRAILV2_VIRTUAL_NETWORK_IPAM_REF_DATA_IPAM_SUBNET_LIST(
+ "org.openecomp.datatypes.heat.contrailV2.virtual.network.rule.ref.data.IpamSubnetList"),
+ CONTRAILV2_VIRTUAL_NETWORK_IPAM_REF_DATA_IPAM_SUBNET(
+ "org.openecomp.datatypes.heat.contrailV2.virtual.network.rule.ref.data.IpamSubnet"),
+ CONTRAILV2_VIRTUAL_NETWORK_POLICY_REF_DATA(
+ "org.openecomp.datatypes.heat.contrailV2.virtual.network.rule.RefData"),
+ CONTRAILV2_VIRTUAL_NETWORK_POLICY_REF_DATA_SEQUENCE(
+ "org.openecomp.datatypes.heat.contrailV2.virtual.network.rule.RefDataSequence"),
+ NOVA_SERVER_NETWORK_ADDRESS_INFO("org.openecomp.datatypes.heat.novaServer.network.AddressInfo"),
+ NEUTRON_SUBNET("org.openecomp.datatypes.heat.network.neutron.Subnet"),
+ NETWORK_ALLOCATION_POOL("org.openecomp.datatypes.heat.network.AllocationPool"),
+ NETWORK_HOST_ROUTE("org.openecomp.datatypes.heat.network.subnet.HostRoute"),
+ SUBSTITUTION_FILTER("org.openecomp.datatypes.heat.substitution.SubstitutionFilter"),
+ SUBSTITUTION_FILTERING("org.openecomp.datatypes.heat.substitution.SubstitutionFiltering"),
+ NEUTRON_SECURITY_RULES_RULE("org.openecomp.datatypes.heat.network.neutron.SecurityRules.Rule"),
+ CONTRAIL_STATIC_ROUTE("org.openecomp.datatypes.heat.network.contrail.port.StaticRoute"),
+ CONTRAIL_ADDRESS_PAIR("org.openecomp.datatypes.heat.network.contrail.AddressPair"),
+ CONTRAIL_INTERFACE_DATA("org.openecomp.datatypes.heat.network.contrail.InterfaceData");
+
+ private String displayName;
+
+ ToscaDataType(String displayName) {
+ this.displayName = displayName;
+ }
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaElementTypes.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaElementTypes.java
new file mode 100644
index 0000000000..97fec7ae7d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaElementTypes.java
@@ -0,0 +1,25 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes;
+
+public enum ToscaElementTypes {
+ CAPABILITY_TYPE
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaFunctions.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaFunctions.java
new file mode 100644
index 0000000000..989a1c6178
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaFunctions.java
@@ -0,0 +1,43 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes;
+
+public enum ToscaFunctions {
+
+ TOKEN("token"),
+ GET_PROPERTY("get_property"),
+ GET_ATTRIBUTE("get_attribute"),
+ GET_ARTIFACT("get_artifact"),
+ GET_INPUT("get_input"),
+ CONCAT("concat");
+
+ private String displayName;
+
+ ToscaFunctions(String displayName) {
+ this.displayName = displayName;
+ }
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaGroupType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaGroupType.java
new file mode 100644
index 0000000000..5422fa6dc9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaGroupType.java
@@ -0,0 +1,40 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes;
+
+
+public enum ToscaGroupType {
+
+ ROOT("tosca.groups.Root"),
+ HEAT_STACK("org.openecomp.groups.heat.HeatStack"),;
+
+ private String displayName;
+
+ ToscaGroupType(String displayName) {
+ this.displayName = displayName;
+ }
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaNodeType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaNodeType.java
new file mode 100644
index 0000000000..c7c5a6e64e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaNodeType.java
@@ -0,0 +1,162 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes;
+
+import org.openecomp.sdc.tosca.services.ToscaConstants;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+
+/**
+ * The enum Tosca node type.
+ */
+public enum ToscaNodeType {
+
+ /**
+ * Compute tosca node type.
+ */
+ COMPUTE("tosca.nodes.Compute"),
+ /**
+ * Root tosca node type.
+ */
+ ROOT("tosca.nodes.Root"),
+ /**
+ * Block storage tosca node type.
+ */
+ BLOCK_STORAGE("tosca.nodes.BlockStorage"),
+ /**
+ * Network tosca node type.
+ */
+ NETWORK("tosca.nodes.network.Network"),
+ /**
+ * Network port tosca node type.
+ */
+ NETWORK_PORT("tosca.nodes.network.Port"),
+ /**
+ * Nova server tosca node type.
+ */
+ NOVA_SERVER(ToscaConstants.NODES_PREFIX + "nova.Server"),
+ /**
+ * Cinder volume tosca node type.
+ */
+ CINDER_VOLUME(ToscaConstants.NODES_PREFIX + "cinder.Volume"),
+ /**
+ * Neutron net tosca node type.
+ */
+ NEUTRON_NET("org.openecomp.resource.vl.nodes.heat.network.neutron.Net"),
+ /**
+ * Neutron port tosca node type.
+ */
+ NEUTRON_PORT("org.openecomp.resource.cp.nodes.heat.network.neutron.Port"),
+ /**
+ * Neutron security rules tosca node type.
+ */
+ NEUTRON_SECURITY_RULES("org.openecomp.resource.vfc.rules.nodes"
+ + ".heat.network.neutron.SecurityRules"),
+ /**
+ * Contrail virtual network tosca node type.
+ */
+ CONTRAIL_VIRTUAL_NETWORK("org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork"),
+ /**
+ * Contrail network rule tosca node type.
+ */
+ CONTRAIL_NETWORK_RULE("org.openecomp.resource.vfc."
+ + "rules.nodes.heat.network.contrail.NetworkRules"),
+ /**
+ * Contrailv 2 virtual network tosca node type.
+ */
+ CONTRAILV2_VIRTUAL_NETWORK("org.openecomp.resource.vl.nodes."
+ + "heat.network.contrailV2.VirtualNetwork"),
+ /**
+ * Contrailv 2 network rule tosca node type.
+ */
+ CONTRAILV2_NETWORK_RULE(
+ "org.openecomp.resource.vfc.rules.nodes.heat.network.contrailV2.NetworkRules"),
+ /**
+ * Contrailv 2 virtual machine interface tosca node type.
+ */
+ CONTRAILV2_VIRTUAL_MACHINE_INTERFACE(
+ "org.openecomp.resource.cp.nodes.heat.contrailV2.VirtualMachineInterface"),
+ /**
+ * Abstract substitute tosca node type.
+ */
+ ABSTRACT_SUBSTITUTE("org.openecomp.resource.abstract.nodes.AbstractSubstitute"),
+ /**
+ * Contrail compute tosca node type.
+ */
+ CONTRAIL_COMPUTE(ToscaConstants.NODES_PREFIX + "contrail.Compute"),
+ /**
+ * Contrail port tosca node type.
+ */
+ CONTRAIL_PORT("org.openecomp.resource.cp.nodes.heat.network.contrail.Port"),
+ /**
+ * Contrail abstract substitute tosca node type.
+ */
+ CONTRAIL_ABSTRACT_SUBSTITUTE("org.openecomp.resource.abstract."
+ + "nodes.contrail.AbstractSubstitute"),;
+
+ private static final Map<String, ToscaNodeType> mMap =
+ Collections.unmodifiableMap(initializeMapping());
+ private String displayName;
+
+ ToscaNodeType(String displayName) {
+ this.displayName = displayName;
+ }
+
+ /**
+ * Initialize mapping map.
+ *
+ * @return the map
+ */
+ public static Map<String, ToscaNodeType> initializeMapping() {
+ Map<String, ToscaNodeType> toscaMap = new HashMap<>();
+ for (ToscaNodeType v : ToscaNodeType.values()) {
+ toscaMap.put(v.displayName, v);
+ }
+ return toscaMap;
+ }
+
+ /**
+ * Gets tosca node type by display name.
+ *
+ * @param displayName the display name
+ * @return the tosca node type by display name
+ */
+ public static ToscaNodeType getToscaNodeTypeByDisplayName(String displayName) {
+ if (mMap.containsKey(displayName)) {
+ return mMap.get(displayName);
+ }
+ return null;
+ }
+
+ /**
+ * Gets display name.
+ *
+ * @return the display name
+ */
+ public String getDisplayName() {
+ return displayName;
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaPolicyType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaPolicyType.java
new file mode 100644
index 0000000000..38195782d2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaPolicyType.java
@@ -0,0 +1,43 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes;
+
+public enum ToscaPolicyType {
+
+ PLACEMENT("tosca.policy.placement"),
+ PLACEMENT_ANTILOCATE("org.openecomp.policies.placement.Antilocate"),
+ PLACEMENT_COLOCATE("org.openecomp.policies.placement.Colocate"),
+ PLACEMENT_VALET_AFFINITY("org.openecomp.policies.placement.valet.Affinity"),
+ PLACEMENT_VALET_EXCLUSIVITY("org.openecomp.policies.placement.valet.Exclusivity"),
+ PLACEMENT_VALET_DIVERSITY("org.openecomp.policies.placement.valet.Diversity");
+
+ private String displayName;
+
+ ToscaPolicyType(String displayName) {
+ this.displayName = displayName;
+ }
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaRelationshipType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaRelationshipType.java
new file mode 100644
index 0000000000..03a35bd4d0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaRelationshipType.java
@@ -0,0 +1,44 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes;
+
+public enum ToscaRelationshipType {
+
+ ROOT("tosca.relationships.Root"),
+ NATIVE_ATTACHES_TO("tosca.relationships.AttachesTo"),
+ DEPENDS_ON("tosca.relationships.DependsOn"),
+ NETWORK_LINK_TO("tosca.relationships.network.LinksTo"),
+ NETWORK_BINDS_TO("tosca.relationships.network.BindsTo"),
+ CINDER_VOLUME_ATTACHES_TO("org.openecomp.relationships.heat.cinder.VolumeAttachesTo"),
+ ATTACHES_TO("org.openecomp.relationships.AttachesTo"),;
+
+ private String displayName;
+
+ ToscaRelationshipType(String displayName) {
+ this.displayName = displayName;
+ }
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaServiceModel.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaServiceModel.java
new file mode 100644
index 0000000000..70b23ae3f6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaServiceModel.java
@@ -0,0 +1,72 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes;
+
+import org.openecomp.core.utilities.file.FileContentHandler;
+import org.openecomp.sdc.datatypes.model.AsdcModel;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+
+import java.util.Collections;
+import java.util.Map;
+
+public class ToscaServiceModel implements AsdcModel {
+ private FileContentHandler artifactFiles;
+ private Map<String, ServiceTemplate> serviceTemplates;
+ private String entryDefinitionServiceTemplate;
+
+ /**
+ * Instantiates a new Tosca service model.
+ *
+ * @param artifactFiles the artifact files
+ * @param serviceTemplates the service templates
+ * @param entryDefinitionServiceTemplate the entry definition service template
+ */
+ public ToscaServiceModel(FileContentHandler artifactFiles,
+ Map<String, ServiceTemplate> serviceTemplates,
+ String entryDefinitionServiceTemplate) {
+ this.artifactFiles = artifactFiles;
+ this.serviceTemplates = serviceTemplates;
+ this.entryDefinitionServiceTemplate = entryDefinitionServiceTemplate;
+ }
+
+
+ public FileContentHandler getArtifactFiles() {
+ return artifactFiles;//MapUtils.isEmpty(artifactFiles) ? Collections.EMPTY_MAP
+ // : Collections.unmodifiableMap(artifactFiles);
+ }
+
+
+ public Map<String, ServiceTemplate> getServiceTemplates() {
+ return Collections.unmodifiableMap(serviceTemplates);
+ }
+
+ public void setServiceTemplates(Map<String, ServiceTemplate> serviceTemplates) {
+ this.serviceTemplates = serviceTemplates;
+ }
+
+ public String getEntryDefinitionServiceTemplate() {
+ return entryDefinitionServiceTemplate;
+ }
+
+ public void setEntryDefinitionServiceTemplate(String entryDefinitionServiceTemplate) {
+ this.entryDefinitionServiceTemplate = entryDefinitionServiceTemplate;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/ArtifactDefinition.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/ArtifactDefinition.java
new file mode 100644
index 0000000000..8461fef85f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/ArtifactDefinition.java
@@ -0,0 +1,69 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes.model;
+
+public class ArtifactDefinition {
+ private String type;
+ private String file;
+ private String repository;
+ private String description;
+ private String deploy_path;
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getFile() {
+ return file;
+ }
+
+ public void setFile(String file) {
+ this.file = file;
+ }
+
+ public String getRepository() {
+ return repository;
+ }
+
+ public void setRepository(String repository) {
+ this.repository = repository;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getDeploy_path() {
+ return deploy_path;
+ }
+
+ public void setDeploy_path(String deployPath) {
+ this.deploy_path = deployPath;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/ArtifactType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/ArtifactType.java
new file mode 100644
index 0000000000..80580e97f3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/ArtifactType.java
@@ -0,0 +1,83 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes.model;
+
+import java.util.List;
+import java.util.Map;
+
+public class ArtifactType {
+
+ private String derived_from;
+ private String version;
+ private String description;
+ private String mime_type;
+ private List<String> file_ext;
+ private Map<String, PropertyDefinition> properties;
+
+
+ public String getDerived_from() {
+ return derived_from;
+ }
+
+ public void setDerived_from(String derivedFrom) {
+ this.derived_from = derivedFrom;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getMime_type() {
+ return mime_type;
+ }
+
+ public void setMime_type(String mimeType) {
+ this.mime_type = mimeType;
+ }
+
+ public List<String> getFile_ext() {
+ return file_ext;
+ }
+
+ public void setFile_ext(List<String> fileExt) {
+ this.file_ext = fileExt;
+ }
+
+ public Map<String, PropertyDefinition> getProperties() {
+ return properties;
+ }
+
+ public void setProperties(Map<String, PropertyDefinition> properties) {
+ this.properties = properties;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/AttributeDefinition.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/AttributeDefinition.java
new file mode 100644
index 0000000000..13c93a283d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/AttributeDefinition.java
@@ -0,0 +1,85 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes.model;
+
+public class AttributeDefinition {
+
+ private String type;
+ private String description;
+ private Object _default;
+ private Status status;
+ private EntrySchema entry_schema;
+
+ public AttributeDefinition() {
+ status = Status.SUPPORTED;
+ }
+
+ public EntrySchema getEntry_schema() {
+ return entry_schema;
+ }
+
+ public void setEntry_schema(EntrySchema entrySchema) {
+ this.entry_schema = entrySchema;
+ }
+
+ public Status getStatus() {
+ return status;
+ }
+
+ public void setStatus(Status status) {
+ this.status = status;
+ }
+
+ public Object get_default() {
+ return _default;
+ }
+
+ public void set_default(Object defaultValue) {
+ this._default = defaultValue;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ @Override
+ public AttributeDefinition clone() {
+ AttributeDefinition attributeDefinition = new AttributeDefinition();
+ attributeDefinition.setType(this.getType());
+ attributeDefinition.setDescription(this.getDescription());
+ attributeDefinition.set_default(this.get_default());
+ attributeDefinition.setStatus(this.getStatus());
+ attributeDefinition.setEntry_schema(this.getEntry_schema().clone());
+ return attributeDefinition;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityAssignment.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityAssignment.java
new file mode 100644
index 0000000000..b548f7855c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityAssignment.java
@@ -0,0 +1,45 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes.model;
+
+import java.util.Map;
+
+public class CapabilityAssignment {
+
+ private Map<String, Object> properties;
+ private Map<String, Object> attributes;
+
+ public Map<String, Object> getProperties() {
+ return properties;
+ }
+
+ public void setProperties(Map<String, Object> properties) {
+ this.properties = properties;
+ }
+
+ public Map<String, Object> getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Map<String, Object> attributes) {
+ this.attributes = attributes;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityDefinition.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityDefinition.java
new file mode 100644
index 0000000000..36dccad6eb
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityDefinition.java
@@ -0,0 +1,113 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes.model;
+
+import org.openecomp.sdc.tosca.services.DataModelUtil;
+import org.openecomp.sdc.tosca.services.ToscaConstants;
+
+import java.util.List;
+import java.util.Map;
+
+public class CapabilityDefinition {
+
+ private String type;
+ private String description;
+ private Map<String, PropertyDefinition> properties;
+ private Map<String, AttributeDefinition> attributes;
+ private List<String> valid_source_types;
+ private Object[] occurrences;
+
+
+ /**
+ * Instantiates a new Capability definition.
+ */
+ public CapabilityDefinition() {
+ occurrences = new Object[2];
+ occurrences[0] = 1;
+ occurrences[1] = ToscaConstants.UNBOUNDED;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public Map<String, PropertyDefinition> getProperties() {
+ return properties;
+ }
+
+ public void setProperties(Map<String, PropertyDefinition> properties) {
+ this.properties = properties;
+ }
+
+ public Map<String, AttributeDefinition> getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Map<String, AttributeDefinition> attributes) {
+ this.attributes = attributes;
+ }
+
+ public List<String> getValid_source_types() {
+ return valid_source_types;
+ }
+
+ public void setValid_source_types(List<String> validSourceTypes) {
+ this.valid_source_types = validSourceTypes;
+ }
+
+ public Object[] getOccurrences() {
+ return occurrences;
+ }
+
+ public void setOccurrences(Object[] occurrences) {
+ this.occurrences = occurrences;
+ }
+
+ @Override
+ public CapabilityDefinition clone() {
+ CapabilityDefinition capabilityDefinition = new CapabilityDefinition();
+ capabilityDefinition
+ .setOccurrences(new Object[]{this.getOccurrences()[0], this.getOccurrences()[1]});
+ capabilityDefinition
+ .setProperties(DataModelUtil.clonePropertyDefinitions(this.getProperties()));
+ capabilityDefinition.setType(this.getType());
+ capabilityDefinition
+ .setAttributes(DataModelUtil.cloneAttributeDefinitions(this.getAttributes()));
+ capabilityDefinition.setDescription(this.getDescription());
+ capabilityDefinition
+ .setValid_source_types(DataModelUtil.cloneValidSourceTypes(this.getValid_source_types()));
+ return capabilityDefinition;
+
+ }
+
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityFilterDefinition.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityFilterDefinition.java
new file mode 100644
index 0000000000..3678583384
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityFilterDefinition.java
@@ -0,0 +1,35 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes.model;
+
+import java.util.List;
+
+public class CapabilityFilterDefinition {
+ List<Constraint> properties;
+
+ public List<Constraint> getProperties() {
+ return properties;
+ }
+
+ public void setProperties(List<Constraint> properties) {
+ this.properties = properties;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityType.java
new file mode 100644
index 0000000000..b0281b4ca0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityType.java
@@ -0,0 +1,82 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes.model;
+
+import java.util.List;
+import java.util.Map;
+
+public class CapabilityType {
+
+ private String derived_from;
+ private String version;
+ private String description;
+ private Map<String, PropertyDefinition> properties;
+ private Map<String, AttributeDefinition> attributes;
+ private List<String> valid_source_types;
+
+ public String getDerived_from() {
+ return derived_from;
+ }
+
+ public void setDerived_from(String derivedFrom) {
+ this.derived_from = derivedFrom;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public Map<String, PropertyDefinition> getProperties() {
+ return properties;
+ }
+
+ public void setProperties(Map<String, PropertyDefinition> properties) {
+ this.properties = properties;
+ }
+
+ public Map<String, AttributeDefinition> getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Map<String, AttributeDefinition> attributes) {
+ this.attributes = attributes;
+ }
+
+ public List<String> getValid_source_types() {
+ return valid_source_types;
+ }
+
+ public void setValid_source_types(List<String> validSourceTypes) {
+ this.valid_source_types = validSourceTypes;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Constraint.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Constraint.java
new file mode 100644
index 0000000000..2c39ce3902
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Constraint.java
@@ -0,0 +1,181 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class Constraint {
+ private Object equal;
+ private Object greater_or_equal;
+ private Object greater_than;
+ private Object less_than;
+ private Object less_or_equal;
+ private Object[] in_range;
+ private List<Object> valid_values;
+ private Integer length;
+ private Integer min_length;
+ private Integer max_length;
+ private Object pattern;
+
+ public Constraint() {
+ }
+
+ public Object getGreater_or_equal() {
+ return greater_or_equal;
+ }
+
+ public void setGreater_or_equal(Object greaterOrEqual) {
+ this.greater_or_equal = greaterOrEqual;
+ }
+
+ public Object getEqual() {
+ return equal;
+ }
+
+ public void setEqual(Object equal) {
+ this.equal = equal;
+ }
+
+ public Object getGreater_than() {
+ return greater_than;
+ }
+
+ public void setGreater_than(Object greaterThan) {
+ this.greater_than = greaterThan;
+ }
+
+ public Object getLess_than() {
+ return less_than;
+ }
+
+ public void setLess_than(Object lessThan) {
+ this.less_than = lessThan;
+ }
+
+ public Object getLess_or_equal() {
+ return less_or_equal;
+ }
+
+ public void setLess_or_equal(Object lessOrEqual) {
+ this.less_or_equal = lessOrEqual;
+ }
+
+ public Object[] getIn_range() {
+ return in_range;
+ }
+
+ /**
+ * Sets in range.
+ *
+ * @param inRange the in range
+ */
+ public void setIn_range(Object[] inRange) {
+ this.in_range = new Object[2];
+ this.in_range[0] = inRange[0];
+ this.in_range[1] = inRange[1];
+ }
+
+ public List<Object> getValid_values() {
+ return valid_values;
+ }
+
+ public void setValid_values(List<Object> validValues) {
+ this.valid_values = validValues;
+ }
+
+ /**
+ * Add valid value.
+ *
+ * @param validValue the valid value
+ */
+ public void addValidValue(Object validValue) {
+ if (this.valid_values == null) {
+ this.valid_values = new ArrayList<>();
+ }
+ valid_values.add(validValue);
+ }
+
+ public Integer getLength() {
+ return length;
+ }
+
+ public void setLength(Integer length) {
+ this.length = length;
+ }
+
+ public Integer getMin_length() {
+ return min_length;
+ }
+
+ public void setMin_length(Integer minLength) {
+ this.min_length = minLength;
+ }
+
+ public Integer getMax_length() {
+ return max_length;
+ }
+
+ public void setMax_length(Integer maxLength) {
+ this.max_length = maxLength;
+ }
+
+ public Object getPattern() {
+ return pattern;
+ }
+
+ public void setPattern(Object pattern) {
+ this.pattern = pattern;
+ }
+
+ @Override
+ public Constraint clone() {
+ Constraint constraint = new Constraint();
+ constraint.setEqual(this.getEqual());
+ constraint.setGreater_or_equal(this.getGreater_or_equal());
+ constraint.setGreater_than(this.getGreater_than());
+ cloneInRange(constraint);
+ constraint.setLength(this.getLength());
+ constraint.setLess_or_equal(this.getLess_or_equal());
+ constraint.setLess_than(this.getLess_than());
+ constraint.setMax_length(this.getMax_length());
+ constraint.setMin_length(this.getMin_length());
+ constraint.setPattern(this.getPattern());
+ cloneValidValues(constraint);
+
+ return constraint;
+ }
+
+ private void cloneInRange(Constraint constraint) {
+ if (this.getIn_range() != null) {
+ constraint.setIn_range(new Object[]{this.getIn_range()[0], this.getIn_range()[1]});
+ }
+ }
+
+ private void cloneValidValues(Constraint constraint) {
+ if (this.getValid_values() != null) {
+ constraint.setValid_values(new ArrayList<>());
+ for (Object entry : this.getValid_values()) {
+ constraint.getValid_values().add(entry);
+ }
+ }
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/DataType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/DataType.java
new file mode 100644
index 0000000000..866c5774d8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/DataType.java
@@ -0,0 +1,73 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes.model;
+
+import java.util.List;
+import java.util.Map;
+
+public class DataType {
+
+ private String derived_from;
+ private String version;
+ private String description;
+ private List<Constraint> constraints;
+ private Map<String, PropertyDefinition> properties;
+
+ public String getDerived_from() {
+ return derived_from;
+ }
+
+ public void setDerived_from(String derivedFrom) {
+ this.derived_from = derivedFrom;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public List<Constraint> getConstraints() {
+ return constraints;
+ }
+
+ public void setConstraints(List<Constraint> constraints) {
+ this.constraints = constraints;
+ }
+
+ public Map<String, PropertyDefinition> getProperties() {
+ return properties;
+ }
+
+ public void setProperties(Map<String, PropertyDefinition> properties) {
+ this.properties = properties;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Directive.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Directive.java
new file mode 100644
index 0000000000..078a6449ea
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Directive.java
@@ -0,0 +1,40 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes.model;
+
+public enum Directive {
+
+
+ SELECTABLE("selectable"),
+ SUBSTITUTABLE("substitutable");
+
+ private String displayName;
+
+ Directive(String displayName) {
+ this.displayName = displayName;
+ }
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/EntrySchema.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/EntrySchema.java
new file mode 100644
index 0000000000..8b08e54c01
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/EntrySchema.java
@@ -0,0 +1,65 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes.model;
+
+import org.openecomp.sdc.tosca.services.DataModelUtil;
+
+import java.util.List;
+
+public class EntrySchema {
+
+ private String description;
+ private String type;
+ private List<Constraint> constraints;
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public List<Constraint> getConstraints() {
+ return constraints;
+ }
+
+ public void setConstraints(List<Constraint> constraints) {
+ this.constraints = constraints;
+ }
+
+ @Override
+ public EntrySchema clone() {
+ EntrySchema entrySchema = new EntrySchema();
+ entrySchema.setDescription(this.getDescription());
+ entrySchema.setType(this.getType());
+ entrySchema.setConstraints(DataModelUtil.cloneConstraints(this.getConstraints()));
+ return entrySchema;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/GroupDefinition.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/GroupDefinition.java
new file mode 100644
index 0000000000..807bf260c3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/GroupDefinition.java
@@ -0,0 +1,64 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes.model;
+
+import java.util.List;
+import java.util.Map;
+
+public class GroupDefinition {
+
+ private String type;
+ private String description;
+ private Map<String, Object> properties;
+ private List<String> members;
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public Map<String, Object> getProperties() {
+ return properties;
+ }
+
+ public void setProperties(Map<String, Object> properties) {
+ this.properties = properties;
+ }
+
+ public List<String> getMembers() {
+ return members;
+ }
+
+ public void setMembers(List<String> members) {
+ this.members = members;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/GroupType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/GroupType.java
new file mode 100644
index 0000000000..4bbb861286
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/GroupType.java
@@ -0,0 +1,82 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes.model;
+
+import java.util.List;
+import java.util.Map;
+
+public class GroupType {
+
+ private String derived_from;
+ private String version;
+ private String description;
+ private Map<String, PropertyDefinition> properties;
+ private List<String> members;
+ private Map<String, InterfaceDefinition> interfaces;
+
+ public String getDerived_from() {
+ return derived_from;
+ }
+
+ public void setDerived_from(String derivedFrom) {
+ this.derived_from = derivedFrom;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public Map<String, PropertyDefinition> getProperties() {
+ return properties;
+ }
+
+ public void setProperties(Map<String, PropertyDefinition> properties) {
+ this.properties = properties;
+ }
+
+ public List<String> getMembers() {
+ return members;
+ }
+
+ public void setMembers(List<String> members) {
+ this.members = members;
+ }
+
+ public Map<String, InterfaceDefinition> getInterfaces() {
+ return interfaces;
+ }
+
+ public void setInterfaces(Map<String, InterfaceDefinition> interfaces) {
+ this.interfaces = interfaces;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Import.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Import.java
new file mode 100644
index 0000000000..207a1b520a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Import.java
@@ -0,0 +1,61 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes.model;
+
+public class Import {
+
+ private String file;
+ private String repository;
+ private String namespace_uri;
+ private String namespace_prefix;
+
+ public String getFile() {
+ return file;
+ }
+
+ public void setFile(String file) {
+ this.file = file;
+ }
+
+ public String getRepository() {
+ return repository;
+ }
+
+ public void setRepository(String repository) {
+ this.repository = repository;
+ }
+
+ public String getNamespace_uri() {
+ return namespace_uri;
+ }
+
+ public void setNamespace_uri(String namespaceUri) {
+ this.namespace_uri = namespaceUri;
+ }
+
+ public String getNamespace_prefix() {
+ return namespace_prefix;
+ }
+
+ public void setNamespace_prefix(String namespacePrefix) {
+ this.namespace_prefix = namespacePrefix;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/InterfaceDefinition.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/InterfaceDefinition.java
new file mode 100644
index 0000000000..cf09510083
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/InterfaceDefinition.java
@@ -0,0 +1,24 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes.model;
+
+public class InterfaceDefinition {
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/InterfaceType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/InterfaceType.java
new file mode 100644
index 0000000000..b177b0660a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/InterfaceType.java
@@ -0,0 +1,24 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes.model;
+
+public class InterfaceType {
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Metadata.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Metadata.java
new file mode 100644
index 0000000000..162e693dba
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Metadata.java
@@ -0,0 +1,55 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes.model;
+
+import java.util.Map;
+
+public class Metadata {
+
+ private String template_name;
+ private String template_author;
+ private String template_version;
+
+
+ public String getTemplate_name() {
+ return template_name;
+ }
+
+ public void setTemplate_name(String templateName) {
+ this.template_name = templateName;
+ }
+
+ public String getTemplate_author() {
+ return template_author;
+ }
+
+ public void setTemplate_author(String templateAuthor) {
+ this.template_author = templateAuthor;
+ }
+
+ public String getTemplate_version() {
+ return template_version;
+ }
+
+ public void setTemplate_version(String templateVersion) {
+ this.template_version = templateVersion;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/NodeFilter.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/NodeFilter.java
new file mode 100644
index 0000000000..d87dcd7b1d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/NodeFilter.java
@@ -0,0 +1,47 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes.model;
+
+import java.util.List;
+import java.util.Map;
+
+public class NodeFilter {
+
+ Map<String, List<Constraint>> properties;
+ Map<String, CapabilityFilterDefinition> capabilities;
+
+ public Map<String, List<Constraint>> getProperties() {
+
+ return properties;
+ }
+
+ public void setProperties(Map<String, List<Constraint>> properties) {
+ this.properties = properties;
+ }
+
+ public Map<String, CapabilityFilterDefinition> getCapabilities() {
+ return capabilities;
+ }
+
+ public void setCapabilities(Map<String, CapabilityFilterDefinition> capabilities) {
+ this.capabilities = capabilities;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/NodeTemplate.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/NodeTemplate.java
new file mode 100644
index 0000000000..41ac232605
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/NodeTemplate.java
@@ -0,0 +1,127 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes.model;
+
+import java.util.List;
+import java.util.Map;
+
+public class NodeTemplate implements Template {
+
+ private String type;
+ private String description;
+ private List<String> directives;
+ private Map<String, Object> properties;
+ private Map<String, Object> attributes;
+ private List<Map<String, RequirementAssignment>> requirements;
+ private List<Map<String, CapabilityAssignment>> capabilities;
+ private Map<String, InterfaceDefinition> interfaces;
+ private Map<String, ArtifactDefinition> artifacts;
+ private NodeFilter node_filter;
+ private String copy;
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public List<String> getDirectives() {
+ return directives;
+ }
+
+ public void setDirectives(List<String> directives) {
+ this.directives = directives;
+ }
+
+ public Map<String, Object> getProperties() {
+ return properties;
+ }
+
+ public void setProperties(Map<String, Object> properties) {
+ this.properties = properties;
+ }
+
+ public Map<String, Object> getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Map<String, Object> attributes) {
+ this.attributes = attributes;
+ }
+
+ public List<Map<String, RequirementAssignment>> getRequirements() {
+ return requirements;
+ }
+
+ public void setRequirements(List<Map<String, RequirementAssignment>> requirements) {
+ this.requirements = requirements;
+ }
+
+ public List<Map<String, CapabilityAssignment>> getCapabilities() {
+ return capabilities;
+ }
+
+ public void setCapabilities(List<Map<String, CapabilityAssignment>> capabilities) {
+ this.capabilities = capabilities;
+ }
+
+ public Map<String, InterfaceDefinition> getInterfaces() {
+ return interfaces;
+ }
+
+ public void setInterfaces(Map<String, InterfaceDefinition> interfaces) {
+ this.interfaces = interfaces;
+ }
+
+ public Map<String, ArtifactDefinition> getArtifacts() {
+ return artifacts;
+ }
+
+ public void setArtifacts(Map<String, ArtifactDefinition> artifacts) {
+ this.artifacts = artifacts;
+ }
+
+ public NodeFilter getNode_filter() {
+ return node_filter;
+ }
+
+ public void setNode_filter(NodeFilter nodeFilter) {
+ this.node_filter = nodeFilter;
+ }
+
+ public String getCopy() {
+ return copy;
+ }
+
+ public void setCopy(String copy) {
+ this.copy = copy;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/NodeType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/NodeType.java
new file mode 100644
index 0000000000..d477f286ee
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/NodeType.java
@@ -0,0 +1,125 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes.model;
+
+import java.util.List;
+import java.util.Map;
+
+public class NodeType {
+
+ private String derived_from;
+ private String version;
+ private String description;
+ private Map<String, PropertyDefinition> properties;
+ private Map<String, AttributeDefinition> attributes;
+ private List<Map<String, RequirementDefinition>> requirements;
+ private Map<String, CapabilityDefinition> capabilities;
+ private Map<String, InterfaceDefinition> interfaces;
+ private Map<String, ArtifactDefinition> artifacts;
+
+
+ public String getDerived_from() {
+ return derived_from;
+ }
+
+ public void setDerived_from(String derivedFrom) {
+ this.derived_from = derivedFrom;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public Map<String, PropertyDefinition> getProperties() {
+ return properties;
+ }
+
+ public void setProperties(Map<String, PropertyDefinition> properties) {
+ this.properties = properties;
+ }
+
+ public Map<String, AttributeDefinition> getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Map<String, AttributeDefinition> attributes) {
+ this.attributes = attributes;
+ }
+
+ public List<Map<String, RequirementDefinition>> getRequirements() {
+ return requirements;
+ }
+
+ public void setRequirements(List<Map<String, RequirementDefinition>> requirements) {
+ this.requirements = requirements;
+ }
+
+ public Map<String, CapabilityDefinition> getCapabilities() {
+ return capabilities;
+ }
+
+ public void setCapabilities(Map<String, CapabilityDefinition> capabilities) {
+ this.capabilities = capabilities;
+ }
+
+ public Map<String, InterfaceDefinition> getInterfaces() {
+ return interfaces;
+ }
+
+ public void setInterfaces(Map<String, InterfaceDefinition> interfaces) {
+ this.interfaces = interfaces;
+ }
+
+ public Map<String, ArtifactDefinition> getArtifacts() {
+ return artifacts;
+ }
+
+ public void setArtifacts(Map<String, ArtifactDefinition> artifacts) {
+ this.artifacts = artifacts;
+ }
+
+ @Override
+ public NodeType clone() {
+ NodeType clone = new NodeType();
+ clone.setCapabilities(this.getCapabilities());
+ clone.setDerived_from(this.getDerived_from());
+ clone.setProperties(this.getProperties());
+ clone.setRequirements(this.getRequirements());
+ clone.setDescription(this.getDescription());
+ clone.setAttributes(this.getAttributes());
+ clone.setInterfaces(this.getInterfaces());
+ clone.setVersion(this.getVersion());
+ clone.setArtifacts(this.getArtifacts());
+ return clone;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/ParameterDefinition.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/ParameterDefinition.java
new file mode 100644
index 0000000000..6ef4c782f5
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/ParameterDefinition.java
@@ -0,0 +1,99 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes.model;
+
+import java.util.List;
+
+public class ParameterDefinition {
+
+ private String type;
+ private String description;
+ private Object value;
+ private Boolean required;
+ private Object _default;
+ private Status status;
+ private List<Constraint> constraints;
+ private EntrySchema entry_schema;
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public Object getValue() {
+ return value;
+ }
+
+ public void setValue(Object value) {
+ this.value = value;
+ }
+
+ public Boolean getRequired() {
+ return required;
+ }
+
+ public void setRequired(Boolean required) {
+ this.required = required;
+ }
+
+ public Object get_default() {
+ return _default;
+ }
+
+ public void set_default(Object defaultValue) {
+ this._default = defaultValue;
+ }
+
+ public Status getStatus() {
+ return status;
+ }
+
+ public void setStatus(Status status) {
+ this.status = status;
+ }
+
+ public List<Constraint> getConstraints() {
+ return constraints;
+ }
+
+ public void setConstraints(List<Constraint> constraints) {
+ this.constraints = constraints;
+ }
+
+ public EntrySchema getEntry_schema() {
+ return entry_schema;
+ }
+
+ public void setEntry_schema(EntrySchema entrySchema) {
+ this.entry_schema = entrySchema;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/PolicyDefinition.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/PolicyDefinition.java
new file mode 100644
index 0000000000..90f44ae36a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/PolicyDefinition.java
@@ -0,0 +1,63 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes.model;
+
+import java.util.List;
+import java.util.Map;
+
+public class PolicyDefinition implements Template {
+ private String type;
+ private String description;
+ private Map<String, Object> properties;
+ private List<String> targets;
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public Map<String, Object> getProperties() {
+ return properties;
+ }
+
+ public void setProperties(Map<String, Object> properties) {
+ this.properties = properties;
+ }
+
+ public List<String> getTargets() {
+ return targets;
+ }
+
+ public void setTargets(List<String> targets) {
+ this.targets = targets;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/PolicyType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/PolicyType.java
new file mode 100644
index 0000000000..07412cda59
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/PolicyType.java
@@ -0,0 +1,73 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes.model;
+
+import java.util.List;
+import java.util.Map;
+
+public class PolicyType {
+
+ private String derived_from;
+ private String version;
+ private String description;
+ private Map<String, PropertyDefinition> properties;
+ private List<String> targets;
+
+ public String getDerived_from() {
+ return derived_from;
+ }
+
+ public void setDerived_from(String derivedFrom) {
+ this.derived_from = derivedFrom;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public Map<String, PropertyDefinition> getProperties() {
+ return properties;
+ }
+
+ public void setProperties(Map<String, PropertyDefinition> properties) {
+ this.properties = properties;
+ }
+
+ public List<String> getTargets() {
+ return targets;
+ }
+
+ public void setTargets(List<String> targets) {
+ this.targets = targets;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/PropertyDefinition.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/PropertyDefinition.java
new file mode 100644
index 0000000000..cf47d0b113
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/PropertyDefinition.java
@@ -0,0 +1,112 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes.model;
+
+import org.openecomp.sdc.tosca.services.DataModelUtil;
+
+import java.util.List;
+
+public class PropertyDefinition {
+
+ private String type;
+ private String description;
+ private Boolean required;
+ private Object _default;
+ private Status status;
+ private List<Constraint> constraints;
+ private EntrySchema entry_schema;
+
+ public PropertyDefinition() {
+ status = Status.SUPPORTED;
+ required = true;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public Boolean getRequired() {
+ return required;
+ }
+
+ public void setRequired(Boolean required) {
+ this.required = required;
+ }
+
+ public Object get_default() {
+ return _default;
+ }
+
+ public void set_default(Object defaultValue) {
+ this._default = defaultValue;
+ }
+
+ public Status getStatus() {
+ return status;
+ }
+
+ public void setStatus(Status status) {
+ this.status = status;
+ }
+
+ public List<Constraint> getConstraints() {
+ return constraints;
+ }
+
+ public void setConstraints(List<Constraint> constraints) {
+ this.constraints = constraints;
+ }
+
+ public EntrySchema getEntry_schema() {
+ return entry_schema;
+ }
+
+ public void setEntry_schema(EntrySchema entrySchema) {
+ this.entry_schema = entrySchema;
+ }
+
+ @Override
+ public PropertyDefinition clone() {
+ PropertyDefinition propertyDefinition = new PropertyDefinition();
+ propertyDefinition.setType(this.getType());
+ propertyDefinition.setDescription(this.getDescription());
+ propertyDefinition.setRequired(this.getRequired());
+ propertyDefinition.set_default(this.get_default());
+ propertyDefinition.setStatus(this.getStatus());
+ propertyDefinition.setEntry_schema(this.getEntry_schema().clone());
+ propertyDefinition.setConstraints(DataModelUtil.cloneConstraints(this.getConstraints()));
+ return propertyDefinition;
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/PropertyType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/PropertyType.java
new file mode 100644
index 0000000000..3fdd9bba0e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/PropertyType.java
@@ -0,0 +1,117 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes.model;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * The enum Property type.
+ */
+public enum PropertyType {
+
+ /**
+ * String property type.
+ */
+ STRING("string"),
+ /**
+ * Integer property type.
+ */
+ INTEGER("integer"),
+ /**
+ * Float property type.
+ */
+ FLOAT("float"),
+ /**
+ * Boolean property type.
+ */
+ BOOLEAN("boolean"),
+ /**
+ * Timestamp property type.
+ */
+ TIMESTAMP("timestamp"),
+ /**
+ * Null property type.
+ */
+ NULL("null"),
+ /**
+ * Map property type.
+ */
+ MAP("map"),
+ /**
+ * List property type.
+ */
+ LIST("list"),
+ /**
+ * Scalar unit size property type.
+ */
+ SCALAR_UNIT_SIZE("scalar-unit.size");
+
+ private static final Map<String, PropertyType> mMap =
+ Collections.unmodifiableMap(initializeMapping());
+ private String displayName;
+
+ PropertyType(String displayName) {
+
+ this.displayName = displayName;
+ }
+
+ /**
+ * Initialize mapping map.
+ *
+ * @return the map
+ */
+ public static Map<String, PropertyType> initializeMapping() {
+ Map<String, PropertyType> typeMap = new HashMap<String, PropertyType>();
+ for (PropertyType v : PropertyType.values()) {
+ typeMap.put(v.displayName, v);
+ }
+ return typeMap;
+ }
+
+ /**
+ * Gets property type by display name.
+ *
+ * @param displayName the display name
+ * @return the property type by display name
+ */
+ public static PropertyType getPropertyTypeByDisplayName(String displayName) {
+ if (mMap == null) {
+ initializeMapping();
+ }
+ if (mMap.containsKey(displayName)) {
+ return mMap.get(displayName);
+ }
+ return null;
+ }
+
+ /**
+ * Gets display name.
+ *
+ * @return the display name
+ */
+ public String getDisplayName() {
+ return displayName;
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/RelationshipTemplate.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/RelationshipTemplate.java
new file mode 100644
index 0000000000..c3a1195565
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/RelationshipTemplate.java
@@ -0,0 +1,99 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes.model;
+
+import java.util.Map;
+
+public class RelationshipTemplate implements Template {
+
+ private String type;
+ private String description;
+ private Map<String, Object> properties;
+ private Map<String, Object> attributes;
+ private Map<String, RequirementAssignment> requirements;
+ private Map<String, CapabilityAssignment> capabilities;
+ private Map<String, InterfaceDefinition> interfaces;
+ private String copy;
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public Map<String, Object> getProperties() {
+ return properties;
+ }
+
+ public void setProperties(Map<String, Object> properties) {
+ this.properties = properties;
+ }
+
+ public Map<String, Object> getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Map<String, Object> attributes) {
+ this.attributes = attributes;
+ }
+
+ public Map<String, RequirementAssignment> getRequirements() {
+ return requirements;
+ }
+
+ public void setRequirements(Map<String, RequirementAssignment> requirements) {
+ this.requirements = requirements;
+ }
+
+ public Map<String, CapabilityAssignment> getCapabilities() {
+ return capabilities;
+ }
+
+ public void setCapabilities(Map<String, CapabilityAssignment> capabilities) {
+ this.capabilities = capabilities;
+ }
+
+ public Map<String, InterfaceDefinition> getInterfaces() {
+ return interfaces;
+ }
+
+ public void setInterfaces(Map<String, InterfaceDefinition> interfaces) {
+ this.interfaces = interfaces;
+ }
+
+ public String getCopy() {
+ return copy;
+ }
+
+ public void setCopy(String copy) {
+ this.copy = copy;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/RelationshipType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/RelationshipType.java
new file mode 100644
index 0000000000..173a8a0f64
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/RelationshipType.java
@@ -0,0 +1,93 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes.model;
+
+import java.util.List;
+import java.util.Map;
+
+public class RelationshipType {
+
+ private String derived_from;
+ private String version;
+ private String description;
+ private Map<String, PropertyDefinition> properties;
+ private Map<String, AttributeDefinition> attributes;
+ private Map<String, InterfaceDefinition> interfaces;
+ private List<String> valid_target_types;
+ //An optional list of one or more names of Capability Types that are valid targets
+ //for this relationship
+
+ public String getDerived_from() {
+ return derived_from;
+ }
+
+ public void setDerived_from(String derivedFrom) {
+ this.derived_from = derivedFrom;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public Map<String, PropertyDefinition> getProperties() {
+ return properties;
+ }
+
+ public void setProperties(Map<String, PropertyDefinition> properties) {
+ this.properties = properties;
+ }
+
+ public Map<String, AttributeDefinition> getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Map<String, AttributeDefinition> attributes) {
+ this.attributes = attributes;
+ }
+
+ public Map<String, InterfaceDefinition> getInterfaces() {
+ return interfaces;
+ }
+
+ public void setInterfaces(Map<String, InterfaceDefinition> interfaces) {
+ this.interfaces = interfaces;
+ }
+
+ public List<String> getValid_target_types() {
+ return valid_target_types;
+ }
+
+ public void setValid_target_types(List<String> validTargetTypes) {
+ this.valid_target_types = validTargetTypes;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/RequirementAssignment.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/RequirementAssignment.java
new file mode 100644
index 0000000000..445063a3ed
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/RequirementAssignment.java
@@ -0,0 +1,70 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes.model;
+
+public class RequirementAssignment {
+
+ private String capability;
+ private String node;
+ private String relationship;
+ private NodeFilter node_filter;
+ private Object[] occurrences;
+
+ public String getCapability() {
+ return capability;
+ }
+
+ public void setCapability(String capability) {
+ this.capability = capability;
+ }
+
+ public String getNode() {
+ return node;
+ }
+
+ public void setNode(String node) {
+ this.node = node;
+ }
+
+ public String getRelationship() {
+ return relationship;
+ }
+
+ public void setRelationship(String relationship) {
+ this.relationship = relationship;
+ }
+
+ public NodeFilter getNode_filter() {
+ return node_filter;
+ }
+
+ public void setNode_filter(NodeFilter nodeFilter) {
+ this.node_filter = nodeFilter;
+ }
+
+ public Object[] getOccurrences() {
+ return occurrences;
+ }
+
+ public void setOccurrences(Object[] occurrences) {
+ this.occurrences = occurrences;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/RequirementDefinition.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/RequirementDefinition.java
new file mode 100644
index 0000000000..fe3238f1b5
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/RequirementDefinition.java
@@ -0,0 +1,82 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes.model;
+
+public class RequirementDefinition {
+
+ private String capability;
+ private String node;
+ private String relationship;
+ private Object[] occurrences;
+
+ /**
+ * Instantiates a new Requirement definition.
+ */
+ public RequirementDefinition() {
+ occurrences = new Object[2];
+ occurrences[0] = 1;
+ occurrences[1] = 1;
+ }
+
+ public String getCapability() {
+ return capability;
+ }
+
+ public void setCapability(String capability) {
+ this.capability = capability;
+ }
+
+ public String getNode() {
+ return node;
+ }
+
+ public void setNode(String node) {
+ this.node = node;
+ }
+
+ public String getRelationship() {
+ return relationship;
+ }
+
+ public void setRelationship(String relationship) {
+ this.relationship = relationship;
+ }
+
+ public Object[] getOccurrences() {
+ return occurrences;
+ }
+
+ public void setOccurrences(Object[] occurrences) {
+ this.occurrences = occurrences;
+ }
+
+ @Override
+ public RequirementDefinition clone() {
+ RequirementDefinition requirementDefinition = new RequirementDefinition();
+ requirementDefinition.setNode(this.getNode());
+ requirementDefinition.setRelationship(this.getRelationship());
+ requirementDefinition.setCapability(this.getCapability());
+ requirementDefinition
+ .setOccurrences(new Object[]{this.getOccurrences()[0], this.getOccurrences()[1]});
+ return requirementDefinition;
+ }
+
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Scalar.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Scalar.java
new file mode 100644
index 0000000000..619ac510b0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Scalar.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes.model;
+
+public class Scalar {
+
+ private Float value;
+
+ public Float getValue() {
+ return value;
+ }
+
+ public void setValue(Float value) {
+ this.value = value;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/ServiceTemplate.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/ServiceTemplate.java
new file mode 100644
index 0000000000..98da0104b8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/ServiceTemplate.java
@@ -0,0 +1,144 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes.model;
+
+import java.util.Map;
+
+public class ServiceTemplate implements Template {
+
+ private String tosca_definitions_version;
+ private Metadata metadata;
+ private String description;
+ private Map<String, Import> imports;
+ private Map<String, ArtifactType> artifact_types;
+ private Map<String, DataType> data_types;
+ private Map<String, CapabilityType> capability_types;
+ private Map<String, InterfaceType> interface_types;
+ private Map<String, RelationshipType> relationship_types;
+ private Map<String, NodeType> node_types;
+ private Map<String, GroupType> group_types;
+ private Map<String, PolicyType> policy_types;
+ private TopologyTemplate topology_template;
+
+ public String getTosca_definitions_version() {
+ return tosca_definitions_version;
+ }
+
+ public void setTosca_definitions_version(String toscaDefinitionsVersion) {
+ this.tosca_definitions_version = toscaDefinitionsVersion;
+ }
+
+ public Metadata getMetadata() {
+ return metadata;
+ }
+
+ public void setMetadata(Metadata metadata) {
+ this.metadata = metadata;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public Map<String, Import> getImports() {
+ return imports;
+ }
+
+ public void setImports(Map<String, Import> imports) {
+ this.imports = imports;
+ }
+
+ public Map<String, ArtifactType> getArtifact_types() {
+ return artifact_types;
+ }
+
+ public void setArtifact_types(Map<String, ArtifactType> artifactTypes) {
+ this.artifact_types = artifactTypes;
+ }
+
+ public Map<String, DataType> getData_types() {
+ return data_types;
+ }
+
+ public void setData_types(Map<String, DataType> dataTypes) {
+ this.data_types = dataTypes;
+ }
+
+ public Map<String, CapabilityType> getCapability_types() {
+ return capability_types;
+ }
+
+ public void setCapability_types(Map<String, CapabilityType> capabilityTypes) {
+ this.capability_types = capabilityTypes;
+ }
+
+ public Map<String, RelationshipType> getRelationship_types() {
+ return relationship_types;
+ }
+
+ public void setRelationship_types(Map<String, RelationshipType> relationshipTypes) {
+ this.relationship_types = relationshipTypes;
+ }
+
+ public Map<String, NodeType> getNode_types() {
+ return node_types;
+ }
+
+ public void setNode_types(Map<String, NodeType> nodeTypes) {
+ this.node_types = nodeTypes;
+ }
+
+ public Map<String, GroupType> getGroup_types() {
+ return group_types;
+ }
+
+ public void setGroup_types(Map<String, GroupType> groupTypes) {
+ this.group_types = groupTypes;
+ }
+
+ public Map<String, InterfaceType> getInterface_types() {
+ return interface_types;
+ }
+
+ public void setInterface_types(Map<String, InterfaceType> interfaceTypes) {
+ this.interface_types = interfaceTypes;
+ }
+
+ public Map<String, PolicyType> getPolicy_types() {
+ return policy_types;
+ }
+
+ public void setPolicy_types(Map<String, PolicyType> policyTypes) {
+ this.policy_types = policyTypes;
+ }
+
+ public TopologyTemplate getTopology_template() {
+ return topology_template;
+ }
+
+ public void setTopology_template(TopologyTemplate topologyTemplate) {
+ this.topology_template = topologyTemplate;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Status.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Status.java
new file mode 100644
index 0000000000..0805982a54
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Status.java
@@ -0,0 +1,42 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes.model;
+
+import java.util.Map;
+
+public enum Status {
+
+ SUPPORTED("supported"),
+ UNSUPPORTED("unsupported"),
+ EXPERIMENTAL("experimental"),
+ DEPRECATED("deprecated"),;
+ private String displayName;
+
+ Status(String displayName) {
+ this.displayName = displayName;
+ }
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/SubstitutionMapping.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/SubstitutionMapping.java
new file mode 100644
index 0000000000..50c262dc42
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/SubstitutionMapping.java
@@ -0,0 +1,54 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes.model;
+
+import java.util.List;
+import java.util.Map;
+
+public class SubstitutionMapping {
+ private String node_type;
+ private Map<String, List<String>> capabilities;
+ private Map<String, List<String>> requirements;
+
+ public String getNode_type() {
+ return node_type;
+ }
+
+ public void setNode_type(String nodeType) {
+ this.node_type = nodeType;
+ }
+
+ public Map<String, List<String>> getRequirements() {
+ return requirements;
+ }
+
+ public void setRequirements(Map<String, List<String>> requirements) {
+ this.requirements = requirements;
+ }
+
+ public Map<String, List<String>> getCapabilities() {
+ return capabilities;
+ }
+
+ public void setCapabilities(Map<String, List<String>> capabilities) {
+ this.capabilities = capabilities;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Template.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Template.java
new file mode 100644
index 0000000000..128bb3c0a9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Template.java
@@ -0,0 +1,24 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes.model;
+
+public interface Template {
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/TopologyTemplate.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/TopologyTemplate.java
new file mode 100644
index 0000000000..288242946a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/TopologyTemplate.java
@@ -0,0 +1,114 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes.model;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+public class TopologyTemplate {
+
+ private String description;
+ private Map<String, ParameterDefinition> inputs;
+ private Map<String, NodeTemplate> node_templates;
+ private Map<String, RelationshipTemplate> relationship_templates;
+ private Map<String, GroupDefinition> groups;
+ private Map<String, ParameterDefinition> outputs;
+ private SubstitutionMapping substitution_mappings;
+ private Map<String, PolicyDefinition> policies;
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public Map<String, ParameterDefinition> getInputs() {
+ return inputs;
+ }
+
+ public void setInputs(Map<String, ParameterDefinition> inputs) {
+ this.inputs = inputs;
+ }
+
+ public Map<String, NodeTemplate> getNode_templates() {
+ return node_templates;
+ }
+
+ public void setNode_templates(Map<String, NodeTemplate> nodeTemplates) {
+ this.node_templates = nodeTemplates;
+ }
+
+ public Map<String, RelationshipTemplate> getRelationship_templates() {
+ return relationship_templates;
+ }
+
+ public void setRelationship_templates(Map<String, RelationshipTemplate> relationshipTemplates) {
+ this.relationship_templates = relationshipTemplates;
+ }
+
+ public Map<String, GroupDefinition> getGroups() {
+ return groups;
+ }
+
+ public void setGroups(Map<String, GroupDefinition> groups) {
+ this.groups = groups;
+ }
+
+ /**
+ * Add group.
+ *
+ * @param groupKey the group key
+ * @param groupDefinition the group definition
+ */
+ public void addGroup(String groupKey, GroupDefinition groupDefinition) {
+ if (Objects.isNull(this.groups)) {
+ this.groups = new HashMap<>();
+ }
+ this.groups.put(groupKey, groupDefinition);
+ }
+
+ public Map<String, ParameterDefinition> getOutputs() {
+ return outputs;
+ }
+
+ public void setOutputs(Map<String, ParameterDefinition> outputs) {
+ this.outputs = outputs;
+ }
+
+ public SubstitutionMapping getSubstitution_mappings() {
+ return substitution_mappings;
+ }
+
+ public void setSubstitution_mappings(SubstitutionMapping substitutionMapping) {
+ this.substitution_mappings = substitutionMapping;
+ }
+
+ public Map<String, PolicyDefinition> getPolicies() {
+ return policies;
+ }
+
+ public void setPolicies(Map<String, PolicyDefinition> policies) {
+ this.policies = policies;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/heatextend/ParameterDefinitionExt.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/heatextend/ParameterDefinitionExt.java
new file mode 100644
index 0000000000..bde81108de
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/heatextend/ParameterDefinitionExt.java
@@ -0,0 +1,55 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes.model.heatextend;
+
+
+import org.openecomp.sdc.tosca.datatypes.model.ParameterDefinition;
+
+public class ParameterDefinitionExt extends ParameterDefinition {
+
+ String label;
+ Boolean hidden;
+ Boolean immutable;
+
+ public String getLabel() {
+ return label;
+ }
+
+ public void setLabel(String label) {
+ this.label = label;
+ }
+
+ public Boolean getHidden() {
+ return hidden;
+ }
+
+ public void setHidden(Boolean hidden) {
+ this.hidden = hidden;
+ }
+
+ public Boolean getImmutable() {
+ return immutable;
+ }
+
+ public void setImmutable(Boolean immutable) {
+ this.immutable = immutable;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/heatextend/PropertyTypeExt.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/heatextend/PropertyTypeExt.java
new file mode 100644
index 0000000000..f92d674070
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/heatextend/PropertyTypeExt.java
@@ -0,0 +1,85 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.datatypes.model.heatextend;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * The enum Property type ext.
+ */
+public enum PropertyTypeExt {
+
+ /**
+ * Json property type ext.
+ */
+ JSON("json");
+
+ private static final Map<String, PropertyTypeExt> mMap =
+ Collections.unmodifiableMap(initializeMapping());
+ private String displayName;
+
+ PropertyTypeExt(String displayName) {
+
+ this.displayName = displayName;
+ }
+
+ /**
+ * Initialize mapping map.
+ *
+ * @return the map
+ */
+ public static Map<String, PropertyTypeExt> initializeMapping() {
+ Map<String, PropertyTypeExt> typeMap = new HashMap<String, PropertyTypeExt>();
+ for (PropertyTypeExt v : PropertyTypeExt.values()) {
+ typeMap.put(v.displayName, v);
+ }
+ return typeMap;
+ }
+
+ /**
+ * Gets property type by display name.
+ *
+ * @param displayName the display name
+ * @return the property type by display name
+ */
+ public static PropertyTypeExt getPropertyTypeByDisplayName(String displayName) {
+ if (mMap == null) {
+ initializeMapping();
+ }
+ if (mMap.containsKey(displayName)) {
+ return mMap.get(displayName);
+ }
+ return null;
+ }
+
+ /**
+ * Gets display name.
+ *
+ * @return the display name
+ */
+ public String getDisplayName() {
+ return displayName;
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/InvalidAddActionNullEntityErrorBuilder.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/InvalidAddActionNullEntityErrorBuilder.java
new file mode 100644
index 0000000000..02bee69251
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/InvalidAddActionNullEntityErrorBuilder.java
@@ -0,0 +1,58 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.errors;
+
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+
+/**
+ * The type Invalid add action null entity error builder.
+ */
+public class InvalidAddActionNullEntityErrorBuilder {
+
+ private static final String INVALID_ACTION_NULL_ENTITY_ERR_MSG =
+ "Invalid action, can't add '%s' to '%s', '%s' entity is NULL.";
+
+ private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
+
+ /**
+ * Instantiates a new Invalid add action null entity error builder.
+ *
+ * @param addedData the added data
+ * @param updatedEntity the updated entity
+ */
+ public InvalidAddActionNullEntityErrorBuilder(String addedData, String updatedEntity) {
+ builder.withId(ToscaErrorCodes.TOSCA_INVALID_ADD_ACTION_NULL_ENTITY);
+ builder.withCategory(ErrorCategory.APPLICATION);
+ builder.withMessage(
+ String.format(INVALID_ACTION_NULL_ENTITY_ERR_MSG, addedData, updatedEntity, updatedEntity));
+ }
+
+ /**
+ * Build error code.
+ *
+ * @return the error code
+ */
+ public ErrorCode build() {
+ return builder.build();
+ }
+
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/InvalidRequirementAssignmentErrorBuilder.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/InvalidRequirementAssignmentErrorBuilder.java
new file mode 100644
index 0000000000..cc0b821748
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/InvalidRequirementAssignmentErrorBuilder.java
@@ -0,0 +1,57 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.errors;
+
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+
+/**
+ * The type Invalid requirement assignment error builder.
+ */
+public class InvalidRequirementAssignmentErrorBuilder {
+
+ private static final String INVALID_REQ_ASSIGNMENT_ERR_ID = "INVALID_REQ_ASSIGNMENT_ERR_ID";
+ private static final String INVALID_REQ_ASSIGNMENT_ERR_MSG =
+ "Invalid Requirement Assignment, Node value is NULL, Requirement ID '%s'.";
+
+ private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
+
+ /**
+ * Instantiates a new Invalid requirement assignment error builder.
+ *
+ * @param requirementId the requirement id
+ */
+ public InvalidRequirementAssignmentErrorBuilder(String requirementId) {
+ builder.withId(INVALID_REQ_ASSIGNMENT_ERR_ID);
+ builder.withCategory(ErrorCategory.APPLICATION);
+ builder.withMessage(String.format(INVALID_REQ_ASSIGNMENT_ERR_MSG, requirementId));
+ }
+
+ /**
+ * Build error code.
+ *
+ * @return the error code
+ */
+ public ErrorCode build() {
+ return builder.build();
+ }
+
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaErrorCodes.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaErrorCodes.java
new file mode 100644
index 0000000000..099f0771f2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaErrorCodes.java
@@ -0,0 +1,36 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.errors;
+
+public class ToscaErrorCodes {
+
+ static final String INVALID_SUBSTITUTE_NODE_TEMPLATE = "INVALID_SUBSTITUTE_NODE_TEMPLATE";
+ static final String INVALID_SUBSTITUTION_SERVICE_TEMPLATE =
+ "INVALID_SUBSTITUTION_SERVICE_TEMPLATE";
+ static final String TOSCA_ENTRY_NOT_FOUND = "TOSCA_ENTRY_NOT_FOUND";
+ static final String MISSING_SUBSTITUTION_MAPPING_FOR_REQ_CAP =
+ "MISSING_SUBSTITUTION_MAPPING_FOR_REQ_CAP";
+ static final String TOSCA_INVALID_SUBSTITUTE_NODE_TEMPLATE =
+ "TOSCA_INVALID_SUBSTITUTE_NODE_TEMPLATE";
+ static final String TOSCA_INVALID_ADD_ACTION_NULL_ENTITY = "TOSCA_INVALID_ADD_ACTION_NULL_ENTITY";
+
+
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaInvalidEntryNotFoundErrorBuilder.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaInvalidEntryNotFoundErrorBuilder.java
new file mode 100644
index 0000000000..7e05d18755
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaInvalidEntryNotFoundErrorBuilder.java
@@ -0,0 +1,55 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.errors;
+
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+
+/**
+ * The type Tosca invalid entry not found error builder.
+ */
+public class ToscaInvalidEntryNotFoundErrorBuilder {
+ //
+ private static final String ENTRY_NOT_FOUND_MSG =
+ "Invalid Tosca model data, missing '%s' entry for '%s' id %s";
+ private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
+
+ /**
+ * Instantiates a new Tosca invalid entry not found error builder.
+ *
+ * @param entryName the entry name
+ * @param entryId the entry id
+ */
+ public ToscaInvalidEntryNotFoundErrorBuilder(String entryName, String entryId) {
+ builder.withId(ToscaErrorCodes.TOSCA_ENTRY_NOT_FOUND);
+ builder.withCategory(ErrorCategory.APPLICATION);
+ builder.withMessage(String.format(ENTRY_NOT_FOUND_MSG, entryName, entryName, entryId));
+ }
+
+ /**
+ * Build error code.
+ *
+ * @return the error code
+ */
+ public ErrorCode build() {
+ return builder.build();
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaInvalidSubstituteNodeTemplateErrorBuilder.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaInvalidSubstituteNodeTemplateErrorBuilder.java
new file mode 100644
index 0000000000..5913e5ffba
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaInvalidSubstituteNodeTemplateErrorBuilder.java
@@ -0,0 +1,55 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.errors;
+
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+
+
+/**
+ * The type Tosca invalid substitute node template error builder.
+ */
+public class ToscaInvalidSubstituteNodeTemplateErrorBuilder {
+ private static final String INVALID_SUBSTITUTE_NODE_TEMPLATE_MSG =
+ "Invalid substitute node template, directives with substitutable value must be defined. "
+ + "node template id %s";
+ private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
+
+ /**
+ * Instantiates a new Tosca invalid substitute node template error builder.
+ *
+ * @param nodeTemplateId the node template id
+ */
+ public ToscaInvalidSubstituteNodeTemplateErrorBuilder(String nodeTemplateId) {
+ builder.withId(ToscaErrorCodes.TOSCA_INVALID_SUBSTITUTE_NODE_TEMPLATE);
+ builder.withCategory(ErrorCategory.APPLICATION);
+ builder.withMessage(String.format(INVALID_SUBSTITUTE_NODE_TEMPLATE_MSG, nodeTemplateId));
+ }
+
+ /**
+ * Build error code.
+ *
+ * @return the error code
+ */
+ public ErrorCode build() {
+ return builder.build();
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaInvalidSubstituteNodeTemplatePropertiesErrorBuilder.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaInvalidSubstituteNodeTemplatePropertiesErrorBuilder.java
new file mode 100644
index 0000000000..90c681efc9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaInvalidSubstituteNodeTemplatePropertiesErrorBuilder.java
@@ -0,0 +1,59 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.errors;
+
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+import org.openecomp.sdc.tosca.services.ToscaConstants;
+
+
+/**
+ * The type Tosca invalid substitute node template properties error builder.
+ */
+public class ToscaInvalidSubstituteNodeTemplatePropertiesErrorBuilder {
+
+ private static final String INVALID_SUBSTITUTE_NODE_TEMPLATE_MSG =
+ "Invalid Substitute Node Template %s, mandatory map property %s with mandatory "
+ + "key %s must be defined.";
+ private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
+
+ /**
+ * Instantiates a new Tosca invalid substitute node template properties error builder.
+ *
+ * @param nodeTemplateId the node template id
+ */
+ public ToscaInvalidSubstituteNodeTemplatePropertiesErrorBuilder(String nodeTemplateId) {
+ builder.withId(ToscaErrorCodes.INVALID_SUBSTITUTE_NODE_TEMPLATE);
+ builder.withCategory(ErrorCategory.APPLICATION);
+ builder.withMessage(String.format(INVALID_SUBSTITUTE_NODE_TEMPLATE_MSG, nodeTemplateId,
+ ToscaConstants.SERVICE_TEMPLATE_FILTER_PROPERTY_NAME,
+ ToscaConstants.SUBSTITUTE_SERVICE_TEMPLATE_PROPERTY_NAME));
+ }
+
+ /**
+ * Build error code.
+ *
+ * @return the error code
+ */
+ public ErrorCode build() {
+ return builder.build();
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaInvalidSubstitutionServiceTemplateErrorBuilder.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaInvalidSubstitutionServiceTemplateErrorBuilder.java
new file mode 100644
index 0000000000..c240992597
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaInvalidSubstitutionServiceTemplateErrorBuilder.java
@@ -0,0 +1,57 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.errors;
+
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+
+
+/**
+ * The type Tosca invalid substitution service template error builder.
+ */
+public class ToscaInvalidSubstitutionServiceTemplateErrorBuilder {
+
+ private static final String INVALID_SUBSTITUTION_SERVICE_TEMPLATE_MSG =
+ "Invalid Substitution Service Template %s, missing mandatory file 'Node type' "
+ + "in substitution mapping.";
+ private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
+
+ /**
+ * Instantiates a new Tosca invalid substitution service template error builder.
+ *
+ * @param serviceTemplateFileName the service template file name
+ */
+ public ToscaInvalidSubstitutionServiceTemplateErrorBuilder(String serviceTemplateFileName) {
+ builder.withId(ToscaErrorCodes.INVALID_SUBSTITUTION_SERVICE_TEMPLATE);
+ builder.withCategory(ErrorCategory.APPLICATION);
+ builder.withMessage(
+ String.format(INVALID_SUBSTITUTION_SERVICE_TEMPLATE_MSG, serviceTemplateFileName));
+ }
+
+ /**
+ * Build error code.
+ *
+ * @return the error code
+ */
+ public ErrorCode build() {
+ return builder.build();
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaMissingSubstitutionMappingForReqCapErrorBuilder.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaMissingSubstitutionMappingForReqCapErrorBuilder.java
new file mode 100644
index 0000000000..74392cdcdb
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaMissingSubstitutionMappingForReqCapErrorBuilder.java
@@ -0,0 +1,88 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.errors;
+
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+
+/**
+ * The type Tosca missing substitution mapping for req cap error builder.
+ */
+public class ToscaMissingSubstitutionMappingForReqCapErrorBuilder {
+
+ private static final String MISSING_SUBSTITUTION_MAPPING_FOR_REQ_CAP_MSG =
+ "Invalid Substitution, Missing Substitution Mapping for %s with Id %s.";
+ private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
+
+ /**
+ * Instantiates a new Tosca missing substitution mapping for req cap error builder.
+ *
+ * @param exposedEntry the exposed entry
+ * @param id the id
+ */
+ public ToscaMissingSubstitutionMappingForReqCapErrorBuilder(MappingExposedEntry exposedEntry,
+ String id) {
+ builder.withId(ToscaErrorCodes.MISSING_SUBSTITUTION_MAPPING_FOR_REQ_CAP);
+ builder.withCategory(ErrorCategory.APPLICATION);
+ builder.withMessage(String
+ .format(MISSING_SUBSTITUTION_MAPPING_FOR_REQ_CAP_MSG, exposedEntry.getDisplayName(), id));
+ }
+
+ /**
+ * Build error code.
+ *
+ * @return the error code
+ */
+ public ErrorCode build() {
+ return builder.build();
+ }
+
+ /**
+ * The enum Mapping exposed entry.
+ */
+ public enum MappingExposedEntry {
+
+ /**
+ * Capability mapping exposed entry.
+ */
+ CAPABILITY("Capability"),
+ /**
+ * Requirement mapping exposed entry.
+ */
+ REQUIREMENT("Requirement"),;
+
+ private String displayName;
+
+ MappingExposedEntry(String displayName) {
+ this.displayName = displayName;
+ }
+
+ /**
+ * Gets display name.
+ *
+ * @return the display name
+ */
+ public String getDisplayName() {
+ return displayName;
+ }
+
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaNodeTypeNotFoundErrorBuilder.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaNodeTypeNotFoundErrorBuilder.java
new file mode 100644
index 0000000000..3d51970d50
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaNodeTypeNotFoundErrorBuilder.java
@@ -0,0 +1,46 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.errors;
+
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+
+public class ToscaNodeTypeNotFoundErrorBuilder {
+ private static final String ENTRY_NOT_FOUND_MSG =
+ "NodeType '%s' or one of its derivedFrom node type hierarchy, "
+ + "is not defined in tosca service model";
+ private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
+
+ /**
+ * Instantiates a new Tosca node type not found error builder.
+ *
+ * @param nodeType the node type
+ */
+ public ToscaNodeTypeNotFoundErrorBuilder(String nodeType) {
+ builder.withId(ToscaErrorCodes.TOSCA_ENTRY_NOT_FOUND);
+ builder.withCategory(ErrorCategory.APPLICATION);
+ builder.withMessage(String.format(ENTRY_NOT_FOUND_MSG, nodeType));
+ }
+
+ public ErrorCode build() {
+ return builder.build();
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/exceptions/CsarCreationErrorBuilder.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/exceptions/CsarCreationErrorBuilder.java
new file mode 100644
index 0000000000..c7b9bc2da4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/exceptions/CsarCreationErrorBuilder.java
@@ -0,0 +1,43 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.exceptions;
+
+import org.openecomp.sdc.common.errors.BaseErrorBuilder;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+
+/**
+ * The type Csar creation error builder.
+ */
+public class CsarCreationErrorBuilder extends BaseErrorBuilder {
+
+ private static final String MANDATORY_PROPERTY_IS_MISSING_MSG =
+ "Failed to create CSAR file from ToscaServiceModel";
+ private static final String ZIP_FILE_CREATION = "ZIP_FILE_CREATION";
+
+ /**
+ * Instantiates a new Csar creation error builder.
+ */
+ public CsarCreationErrorBuilder() {
+ getErrorCodeBuilder().withId(ZIP_FILE_CREATION);
+ getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION);
+ getErrorCodeBuilder().withMessage(MANDATORY_PROPERTY_IS_MISSING_MSG);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/exceptions/CsarMissingEntryPointErrorBuilder.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/exceptions/CsarMissingEntryPointErrorBuilder.java
new file mode 100644
index 0000000000..9b9257ad33
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/exceptions/CsarMissingEntryPointErrorBuilder.java
@@ -0,0 +1,44 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.exceptions;
+
+import org.openecomp.sdc.common.errors.BaseErrorBuilder;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+
+/**
+ * The type Csar missing entry point error builder.
+ */
+public class CsarMissingEntryPointErrorBuilder extends BaseErrorBuilder {
+
+ private static final String MANDATORY_PROPERTY_IS_MISSING_MSG =
+ "Failed to create CSAR file from ToscaServiceModel,missing mandatory "
+ + "EntryDefinitionServiceTemplate ";
+ private static final String ZIP_FILE_CREATION = "ZIP_FILE_CREATION__MISSING_ENTRY_DEFINITION";
+
+ /**
+ * Instantiates a new Csar missing entry point error builder.
+ */
+ public CsarMissingEntryPointErrorBuilder() {
+ getErrorCodeBuilder().withId(ZIP_FILE_CREATION);
+ getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION);
+ getErrorCodeBuilder().withMessage(MANDATORY_PROPERTY_IS_MISSING_MSG);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java
new file mode 100644
index 0000000000..d0d7ccf621
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java
@@ -0,0 +1,588 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.services;
+
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.tosca.datatypes.ToscaFunctions;
+import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.Constraint;
+import org.openecomp.sdc.tosca.datatypes.model.EntrySchema;
+import org.openecomp.sdc.tosca.datatypes.model.GroupDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.Metadata;
+import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.NodeType;
+import org.openecomp.sdc.tosca.datatypes.model.PolicyDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.RelationshipTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.RequirementAssignment;
+import org.openecomp.sdc.tosca.datatypes.model.RequirementDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.Status;
+import org.openecomp.sdc.tosca.datatypes.model.SubstitutionMapping;
+import org.openecomp.sdc.tosca.datatypes.model.TopologyTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.heatextend.ParameterDefinitionExt;
+import org.openecomp.sdc.tosca.errors.InvalidAddActionNullEntityErrorBuilder;
+import org.openecomp.sdc.tosca.errors.InvalidRequirementAssignmentErrorBuilder;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+/**
+ * The type Data model util.
+ */
+public class DataModelUtil {
+
+ /**
+ * Add substitution mapping.
+ *
+ * @param serviceTemplate the service template
+ * @param substitutionMapping the substitution mapping
+ */
+ public static void addSubstitutionMapping(ServiceTemplate serviceTemplate,
+ SubstitutionMapping substitutionMapping) {
+ if (serviceTemplate == null) {
+ throw new CoreException(
+ new InvalidAddActionNullEntityErrorBuilder("Substitution Mapping", "Service Template")
+ .build());
+ }
+
+ if (serviceTemplate.getTopology_template() == null) {
+ serviceTemplate.setTopology_template(new TopologyTemplate());
+ }
+ serviceTemplate.getTopology_template().setSubstitution_mappings(substitutionMapping);
+ }
+
+ /**
+ * Add substitution mapping req.
+ *
+ * @param serviceTemplate the service template
+ * @param substitutionMappingRequirementId the substitution mapping requirement id
+ * @param substitutionMappingRequirementList the substitution mapping requirement list
+ */
+ public static void addSubstitutionMappingReq(ServiceTemplate serviceTemplate,
+ String substitutionMappingRequirementId,
+ List<String> substitutionMappingRequirementList) {
+ if (serviceTemplate == null) {
+ throw new CoreException(
+ new InvalidAddActionNullEntityErrorBuilder("Substitution Mapping Requirements",
+ "Service Template").build());
+ }
+
+ if (serviceTemplate.getTopology_template() == null) {
+ serviceTemplate.setTopology_template(new TopologyTemplate());
+ }
+ if (serviceTemplate.getTopology_template().getSubstitution_mappings() == null) {
+ serviceTemplate.getTopology_template().setSubstitution_mappings(new SubstitutionMapping());
+ }
+ if (serviceTemplate.getTopology_template().getSubstitution_mappings().getRequirements()
+ == null) {
+ serviceTemplate.getTopology_template().getSubstitution_mappings()
+ .setRequirements(new HashMap<>());
+ }
+
+ serviceTemplate.getTopology_template().getSubstitution_mappings().getRequirements()
+ .put(substitutionMappingRequirementId, substitutionMappingRequirementList);
+ }
+
+ /**
+ * Add node template.
+ *
+ * @param serviceTemplate the service template
+ * @param nodeTemplateId the node template id
+ * @param nodeTemplate the node template
+ */
+ public static void addNodeTemplate(ServiceTemplate serviceTemplate, String nodeTemplateId,
+ NodeTemplate nodeTemplate) {
+ if (serviceTemplate == null) {
+ throw new CoreException(
+ new InvalidAddActionNullEntityErrorBuilder("Node Template", "Service Template").build());
+ }
+ TopologyTemplate topologyTemplate = serviceTemplate.getTopology_template();
+ if (Objects.isNull(topologyTemplate)) {
+ topologyTemplate = new TopologyTemplate();
+ serviceTemplate.setTopology_template(topologyTemplate);
+ }
+ if (topologyTemplate.getNode_templates() == null) {
+ topologyTemplate.setNode_templates(new HashMap<>());
+ }
+ topologyTemplate.getNode_templates().put(nodeTemplateId, nodeTemplate);
+ }
+
+ /**
+ * Add policy definition.
+ *
+ * @param serviceTemplate the service template
+ * @param policyId the policy id
+ * @param policyDefinition the policy definition
+ */
+ public static void addPolicyDefinition(ServiceTemplate serviceTemplate, String policyId,
+ PolicyDefinition policyDefinition) {
+ if (serviceTemplate == null) {
+ throw new CoreException(
+ new InvalidAddActionNullEntityErrorBuilder("Policy Definition", "Service Template")
+ .build());
+ }
+ TopologyTemplate topologyTemplate = serviceTemplate.getTopology_template();
+ if (Objects.isNull(topologyTemplate)) {
+ topologyTemplate = new TopologyTemplate();
+ serviceTemplate.setTopology_template(topologyTemplate);
+ }
+ if (topologyTemplate.getPolicies() == null) {
+ topologyTemplate.setPolicies(new HashMap<>());
+ }
+ topologyTemplate.getPolicies().put(policyId, policyDefinition);
+ }
+
+ /**
+ * Add node type.
+ *
+ * @param serviceTemplate the service template
+ * @param nodeTypeId the node type id
+ * @param nodeType the node type
+ */
+ public static void addNodeType(ServiceTemplate serviceTemplate, String nodeTypeId,
+ NodeType nodeType) {
+ if (serviceTemplate == null) {
+ throw new CoreException(
+ new InvalidAddActionNullEntityErrorBuilder("Node Type", "Service Template").build());
+ }
+ if (serviceTemplate.getNode_types() == null) {
+ serviceTemplate.setNode_types(new HashMap<>());
+ }
+ serviceTemplate.getNode_types().put(nodeTypeId, nodeType);
+ }
+
+ /**
+ * Add relationship template.
+ *
+ * @param serviceTemplate the service template
+ * @param relationshipTemplateId the relationship template id
+ * @param relationshipTemplate the relationship template
+ */
+ public static void addRelationshipTemplate(ServiceTemplate serviceTemplate,
+ String relationshipTemplateId,
+ RelationshipTemplate relationshipTemplate) {
+ if (serviceTemplate == null) {
+ throw new CoreException(
+ new InvalidAddActionNullEntityErrorBuilder("Relationship Template", "Service Template")
+ .build());
+ }
+ if (serviceTemplate.getTopology_template() == null) {
+ serviceTemplate.setTopology_template(new TopologyTemplate());
+ }
+ if (serviceTemplate.getTopology_template().getRelationship_templates() == null) {
+ serviceTemplate.getTopology_template().setRelationship_templates(new HashMap<>());
+ }
+ serviceTemplate.getTopology_template().getRelationship_templates()
+ .put(relationshipTemplateId, relationshipTemplate);
+ }
+
+ /**
+ * Add requirement assignment.
+ *
+ * @param nodeTemplate the node template
+ * @param requirementId the requirement id
+ * @param requirementAssignment the requirement assignment
+ */
+ public static void addRequirementAssignment(NodeTemplate nodeTemplate, String requirementId,
+ RequirementAssignment requirementAssignment) {
+ if (nodeTemplate == null) {
+ throw new CoreException(
+ new InvalidAddActionNullEntityErrorBuilder("Requirement Assignment", "Node Template")
+ .build());
+ }
+ if (requirementAssignment.getNode() == null) {
+ throw new CoreException(new InvalidRequirementAssignmentErrorBuilder(requirementId).build());
+ }
+
+ if (nodeTemplate.getRequirements() == null) {
+ nodeTemplate.setRequirements(new ArrayList<>());
+ }
+ Map<String, RequirementAssignment> requirement = new HashMap<>();
+ requirement.put(requirementId, requirementAssignment);
+ nodeTemplate.getRequirements().add(requirement);
+ }
+
+ /**
+ * Gets node template.
+ *
+ * @param serviceTemplate the service template
+ * @param nodeTemplateId the node template id
+ * @return the node template
+ */
+ public static NodeTemplate getNodeTemplate(ServiceTemplate serviceTemplate,
+ String nodeTemplateId) {
+ if (serviceTemplate == null
+ || serviceTemplate.getTopology_template() == null
+ || serviceTemplate.getTopology_template().getNode_templates() == null) {
+ return null;
+ }
+ return serviceTemplate.getTopology_template().getNode_templates().get(nodeTemplateId);
+ }
+
+ /**
+ * Gets node type.
+ *
+ * @param serviceTemplate the service template
+ * @param nodeTypeId the node type id
+ * @return the node type
+ */
+ public static NodeType getNodeType(ServiceTemplate serviceTemplate, String nodeTypeId) {
+ if (serviceTemplate == null || serviceTemplate.getNode_types() == null) {
+ return null;
+ }
+ return serviceTemplate.getNode_types().get(nodeTypeId);
+ }
+
+ /**
+ * Add group definition to topology template.
+ *
+ * @param serviceTemplate the service template
+ * @param groupName the group name
+ * @param group the group
+ */
+ public static void addGroupDefinitionToTopologyTemplate(ServiceTemplate serviceTemplate,
+ String groupName, GroupDefinition group) {
+ if (serviceTemplate == null) {
+ throw new CoreException(
+ new InvalidAddActionNullEntityErrorBuilder("Group Definition", "Service Template")
+ .build());
+ }
+
+ TopologyTemplate topologyTemplate = serviceTemplate.getTopology_template();
+ if (Objects.isNull(topologyTemplate)) {
+ topologyTemplate = new TopologyTemplate();
+ serviceTemplate.setTopology_template(topologyTemplate);
+ }
+ if (topologyTemplate.getGroups() == null) {
+ topologyTemplate.setGroups(new HashMap<>());
+ }
+ if (serviceTemplate.getTopology_template().getGroups() == null) {
+ Map<String, GroupDefinition> groups = new HashMap<>();
+ serviceTemplate.getTopology_template().setGroups(groups);
+ }
+ serviceTemplate.getTopology_template().getGroups().put(groupName, group);
+ }
+
+ /**
+ * Create property definition property definition.
+ *
+ * @param type the type
+ * @param description the description
+ * @param required the required
+ * @param constraints the constraints
+ * @param status the status
+ * @param entrySchema the entry schema
+ * @param defaultVal the default val
+ * @return the property definition
+ */
+ public static PropertyDefinition createPropertyDefinition(String type, String description,
+ boolean required,
+ List<Constraint> constraints,
+ Status status,
+ EntrySchema entrySchema,
+ Object defaultVal) {
+ PropertyDefinition propDef = new PropertyDefinition();
+ propDef.setType(type);
+ propDef.setDescription(description);
+ propDef.setRequired(required);
+ propDef.setConstraints(constraints);
+ if (status != null) {
+ propDef.setStatus(status);
+ }
+ propDef.setEntry_schema(entrySchema);
+ propDef.set_default(defaultVal);
+
+ return propDef;
+ }
+
+ /**
+ * Create requirement requirement definition.
+ *
+ * @param capability the capability
+ * @param node the node
+ * @param relationship the relationship
+ * @param occurrences the occurrences
+ * @return the requirement definition
+ */
+ public static RequirementDefinition createRequirement(String capability, String node,
+ String relationship, Object[] occurrences) {
+ RequirementDefinition requirementDefinition = new RequirementDefinition();
+ requirementDefinition.setCapability(capability);
+ requirementDefinition.setNode(node);
+ requirementDefinition.setRelationship(relationship);
+ if (occurrences != null) {
+ requirementDefinition.setOccurrences(occurrences);
+ }
+ return requirementDefinition;
+ }
+
+ /**
+ * Create attribute definition attribute definition.
+ *
+ * @param type the type
+ * @param description the description
+ * @param status the status
+ * @param entrySchema the entry schema
+ * @param defaultVal the default val
+ * @return the attribute definition
+ */
+ public static AttributeDefinition createAttributeDefinition(String type, String description,
+ Status status,
+ EntrySchema entrySchema,
+ Object defaultVal) {
+ AttributeDefinition attributeDef = new AttributeDefinition();
+ attributeDef.setType(type);
+
+ if (description != null) {
+ attributeDef.setDescription(description);
+ }
+ if (status != null) {
+ attributeDef.setStatus(status);
+ }
+ attributeDef.setEntry_schema(entrySchema);
+ attributeDef.set_default(defaultVal);
+
+ return attributeDef;
+ }
+
+ /**
+ * Create valid values constraint constraint.
+ *
+ * @param values the values
+ * @return the constraint
+ */
+ public static Constraint createValidValuesConstraint(Object... values) {
+ Constraint validValues = new Constraint();
+ for (Object value : values) {
+ validValues.addValidValue(value);
+ }
+ return validValues;
+ }
+
+ /**
+ * Create metadata metadata.
+ *
+ * @param templateName the template name
+ * @param templateVersion the template version
+ * @param templateAuthor the template author
+ * @return the metadata
+ */
+ public static Metadata createMetadata(String templateName, String templateVersion,
+ String templateAuthor) {
+ Metadata metadata = new Metadata();
+ metadata.setTemplate_name(templateName);
+ metadata.setTemplate_version(templateVersion);
+ metadata.setTemplate_author(templateAuthor);
+
+ return metadata;
+ }
+
+ /**
+ * Create entry schema entry schema.
+ *
+ * @param type the type
+ * @param description the description
+ * @param constraints the constraints
+ * @return the entry schema
+ */
+ public static EntrySchema createEntrySchema(String type, String description,
+ List<Constraint> constraints) {
+ EntrySchema entrySchema = new EntrySchema();
+ entrySchema.setType(type);
+ entrySchema.setDescription(description);
+ entrySchema.setConstraints(constraints);
+ return entrySchema;
+ }
+
+ /**
+ * Create valid values constraints list list.
+ *
+ * @param values the values
+ * @return the list
+ */
+ public static List<Constraint> createValidValuesConstraintsList(String... values) {
+ List<Constraint> constraints;
+ Constraint validValues;
+ constraints = new ArrayList<>();
+ validValues = DataModelUtil.createValidValuesConstraint(values);
+ constraints.add(validValues);
+ return constraints;
+ }
+
+ /**
+ * Create greater or equal constrain constraint.
+ *
+ * @param value the value
+ * @return the constraint
+ */
+ public static Constraint createGreaterOrEqualConstrain(Object value) {
+
+ Constraint constraint = new Constraint();
+ constraint.setGreater_or_equal(value);
+ return constraint;
+ }
+
+ /**
+ * Gets constrain list.
+ *
+ * @param constrains the constrains
+ * @return the constrain list
+ */
+ public static List<Constraint> getConstrainList(Constraint... constrains) {
+ return Arrays.asList(constrains);
+
+ }
+
+ /**
+ * Create get input property value from list parameter map.
+ *
+ * @param inputPropertyListName the input property list name
+ * @param indexInTheList the index in the list
+ * @param nestedPropertyName the nested property name
+ * @return the map
+ */
+ public static Map createGetInputPropertyValueFromListParameter(String inputPropertyListName,
+ int indexInTheList,
+ String... nestedPropertyName) {
+ List propertyList = new ArrayList<>();
+ propertyList.add(inputPropertyListName);
+ propertyList.add(indexInTheList);
+ if (nestedPropertyName != null) {
+ Collections.addAll(propertyList, nestedPropertyName);
+ }
+ Map getInputProperty = new HashMap<>();
+ getInputProperty.put(ToscaFunctions.GET_INPUT.getDisplayName(), propertyList);
+ return getInputProperty;
+ }
+
+ /**
+ * Convert property def to parameter def parameter definition ext.
+ *
+ * @param propertyDefinition the property definition
+ * @return the parameter definition ext
+ */
+ public static ParameterDefinitionExt convertPropertyDefToParameterDef(
+ PropertyDefinition propertyDefinition) {
+ if (propertyDefinition == null) {
+ return null;
+ }
+
+ ParameterDefinitionExt parameterDefinition = new ParameterDefinitionExt();
+ parameterDefinition.setType(propertyDefinition.getType());
+ parameterDefinition.setDescription(propertyDefinition.getDescription());
+ parameterDefinition.setRequired(propertyDefinition.getRequired());
+ parameterDefinition.set_default(propertyDefinition.get_default());
+ parameterDefinition.setStatus(propertyDefinition.getStatus());
+ parameterDefinition.setConstraints(propertyDefinition.getConstraints());
+ parameterDefinition.setEntry_schema(propertyDefinition.getEntry_schema());
+ parameterDefinition.setHidden(false);
+ parameterDefinition.setImmutable(false);
+
+ return parameterDefinition;
+ }
+
+ /**
+ * Convert attribute def to parameter def parameter definition ext.
+ *
+ * @param attributeDefinition the attribute definition
+ * @param outputValue the output value
+ * @return the parameter definition ext
+ */
+ public static ParameterDefinitionExt convertAttributeDefToParameterDef(
+ AttributeDefinition attributeDefinition, Map<String, List> outputValue) {
+ if (attributeDefinition == null) {
+ return null;
+ }
+ ParameterDefinitionExt parameterDefinition = new ParameterDefinitionExt();
+ parameterDefinition.setDescription(attributeDefinition.getDescription());
+ parameterDefinition.setValue(outputValue);
+ return parameterDefinition;
+ }
+
+ /**
+ * Clone constraints list.
+ *
+ * @param constraints the constraints
+ * @return the list
+ */
+ public static List<Constraint> cloneConstraints(List<Constraint> constraints) {
+ if (constraints == null) {
+ return null;
+ }
+ return constraints.stream().map(Constraint::clone).collect(Collectors.toList());
+ }
+
+ /**
+ * Clone valid source types list.
+ *
+ * @param validSourceTypes the valid source types
+ * @return the list
+ */
+ public static List<String> cloneValidSourceTypes(List<String> validSourceTypes) {
+ if (validSourceTypes == null) {
+ return null;
+ }
+ return validSourceTypes.stream().collect(Collectors.toList());
+ }
+
+ /**
+ * Clone property definitions map.
+ *
+ * @param propertyDefinitions the property definitions
+ * @return the map
+ */
+ public static Map<String, PropertyDefinition> clonePropertyDefinitions(
+ Map<String, PropertyDefinition> propertyDefinitions) {
+ if (propertyDefinitions == null) {
+ return null;
+ }
+ Map<String, PropertyDefinition> clonedProperties = new HashMap<>();
+ for (String propertyKey : propertyDefinitions.keySet()) {
+ clonedProperties.put(propertyKey, propertyDefinitions.get(propertyKey).clone());
+ }
+ return clonedProperties;
+ }
+
+ /**
+ * Clone attribute definitions map.
+ *
+ * @param attributeDefinitions the attribute definitions
+ * @return the map
+ */
+ public static Map<String, AttributeDefinition> cloneAttributeDefinitions(
+ Map<String, AttributeDefinition> attributeDefinitions) {
+ if (attributeDefinitions == null) {
+ return null;
+ }
+ Map<String, AttributeDefinition> clonedAttributeDefinitions = new HashMap<>();
+ for (String attributeKey : attributeDefinitions.keySet()) {
+ clonedAttributeDefinitions.put(attributeKey, attributeDefinitions.get(attributeKey).clone());
+ }
+ return clonedAttributeDefinitions;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaAnalyzerService.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaAnalyzerService.java
new file mode 100644
index 0000000000..271c471922
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaAnalyzerService.java
@@ -0,0 +1,66 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.services;
+
+import org.openecomp.sdc.tosca.datatypes.ToscaElementTypes;
+import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
+import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.RequirementAssignment;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+
+public interface ToscaAnalyzerService {
+
+ /*
+ node template with type equal to node type or derived from node type
+ */
+ Map<String, NodeTemplate> getNodeTemplatesByType(ServiceTemplate serviceTemplate, String nodeType,
+ ToscaServiceModel toscaServiceModel);
+
+ boolean isTypeOf(NodeTemplate nodeTemplate, String nodeType, ServiceTemplate serviceTemplate,
+ ToscaServiceModel toscaServiceModel);
+
+ List<RequirementAssignment> getRequirements(NodeTemplate nodeTemplate, String requirementId);
+
+ Optional<NodeTemplate> getNodeTemplateById(ServiceTemplate serviceTemplate,
+ String nodeTemplateId);
+
+ Optional<String> getSubstituteServiceTemplateName(String substituteNodeTemplateId,
+ NodeTemplate substitutableNodeTemplate);
+
+ Map<String, NodeTemplate> getSubstitutableNodeTemplates(ServiceTemplate serviceTemplate);
+
+ Optional<Map.Entry<String, NodeTemplate>> getSubstitutionMappedNodeTemplateByExposedReq(
+ String substituteServiceTemplateFileName, ServiceTemplate substituteServiceTemplate,
+ String requirementId);
+
+ /*
+ match only for the input which is not null
+ */
+ boolean isDesiredRequirementAssignment(RequirementAssignment requirementAssignment,
+ String capability, String node, String relationship);
+
+ Object getFlatEntity(ToscaElementTypes elementType, String type, ServiceTemplate serviceTemplate,
+ ToscaServiceModel toscaModel);
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaConstants.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaConstants.java
new file mode 100644
index 0000000000..27cf07e166
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaConstants.java
@@ -0,0 +1,65 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.services;
+
+
+public class ToscaConstants {
+
+ //TOSCA Node Types prefix
+ public static final String NODES_PREFIX = "org.openecomp.resource.vfc.nodes.heat.";
+ public static final String NODES_SUBSTITUTION_PREFIX
+ = "org.openecomp.resource.abstract.nodes.heat.";
+
+ //TOSCA Requirement Ids
+ public static final String DEPENDS_ON_REQUIREMENT_ID = "dependency";
+ public static final String BINDING_REQUIREMENT_ID = "binding";
+ public static final String LINK_REQUIREMENT_ID = "link";
+ public static final String LOCAL_STORAGE_REQUIREMENT_ID = "local_storage";
+ public static final String NETWORK_REQUIREMENT_ID = "network";
+ public static final String PORT_REQUIREMENT_ID = "port";
+
+ //TOSCA Capability Ids
+ public static final String BINDING_CAPABILITY_ID = "binding";
+ public static final String LINK_CAPABILITY_ID = "link";
+ public static final String HOST_CAPABILITY_ID = "host";
+ public static final String ENDPOINT_CAPABILITY_ID = "endpoint";
+ public static final String OS_CAPABILITY_ID = "os";
+ public static final String SCALABLE_CAPABILITY_ID = "scalable";
+
+ //General
+ public static final String TOSCA_DEFINITIONS_VERSION = "tosca_simple_yaml_1_0_0";
+ public static final String MODELABLE_ENTITY_NAME_SELF = "SELF";
+ public static final String NODE_TEMPLATE_DIRECTIVE_SUBSTITUTABLE = "substitutable";
+ public static final String NATIVE_TYPES_SERVICE_TEMPLATE_NAME = "NativeTypesServiceTemplate";
+ public static final String UNBOUNDED = "UNBOUNDED";
+
+ //properties
+ public static final String SERVICE_TEMPLATE_FILTER_PROPERTY_NAME = "service_template_filter";
+ public static final String SUBSTITUTE_SERVICE_TEMPLATE_PROPERTY_NAME =
+ "substitute_service_template";
+ public static final String COUNT_PROPERTY_NAME = "count";
+ public static final String INDEX_VALUE_PROPERTY_NAME = "index_value";
+ public static final String SCALING_ENABLED_PROPERTY_NAME = "scaling_enabled";
+
+ public static final String DHCP_ENABLED_PROPERTY_NAME = "dhcp_enabled";
+
+
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaFileOutputService.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaFileOutputService.java
new file mode 100644
index 0000000000..7ec2fffa2b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaFileOutputService.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.services;
+
+import org.openecomp.core.utilities.file.FileContentHandler;
+import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
+
+public interface ToscaFileOutputService {
+ byte[] createOutputFile(ToscaServiceModel toscaServiceModel,
+ FileContentHandler externalArtifacts);
+
+ String createMetaFile(String entryDefinitionsFileName);
+
+ String getArtifactsFolderName();
+
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaNativeTypesServiceTemplate.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaNativeTypesServiceTemplate.java
new file mode 100644
index 0000000000..013d761168
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaNativeTypesServiceTemplate.java
@@ -0,0 +1,309 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.services;
+
+import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType;
+import org.openecomp.sdc.tosca.datatypes.ToscaDataType;
+import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
+import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType;
+
+import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.CapabilityDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.InterfaceDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.NodeType;
+import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.PropertyType;
+import org.openecomp.sdc.tosca.datatypes.model.RequirementDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * The type Tosca native types service template.
+ */
+public class ToscaNativeTypesServiceTemplate {
+ /**
+ * Create service template service template.
+ *
+ * @return the service template
+ */
+ public static ServiceTemplate createServiceTemplate() {
+ ServiceTemplate nativeNodeTypesServiceTemplate = new ServiceTemplate();
+ nativeNodeTypesServiceTemplate
+ .setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION);
+ nativeNodeTypesServiceTemplate.setMetadata(DataModelUtil
+ .createMetadata(ToscaConstants.NATIVE_TYPES_SERVICE_TEMPLATE_NAME, "1.0.0", null));
+ nativeNodeTypesServiceTemplate.setDescription("TOSCA Native Node Types");
+ nativeNodeTypesServiceTemplate.setNode_types(createNativeNodeTypes());
+ return nativeNodeTypesServiceTemplate;
+ }
+
+ private static Map<String, NodeType> createNativeNodeTypes() {
+ Map<String, NodeType> nativeNodeTypes = new HashMap<>();
+ nativeNodeTypes.put(ToscaNodeType.COMPUTE.getDisplayName(), createToscaNodesComputeNodeType());
+ nativeNodeTypes.put(ToscaNodeType.ROOT.getDisplayName(), createToscaNodesRootNodeType());
+ nativeNodeTypes
+ .put(ToscaNodeType.NETWORK_PORT.getDisplayName(), createToscaNodesPortsNodeType());
+ nativeNodeTypes
+ .put(ToscaNodeType.BLOCK_STORAGE.getDisplayName(), createToscaNodesBlockStorageNodeType());
+ nativeNodeTypes.put(ToscaNodeType.NETWORK.getDisplayName(), createToscaNodesNetworkNodeType());
+ return nativeNodeTypes;
+ }
+
+ private static NodeType createToscaNodesComputeNodeType() {
+ NodeType computeNodeType = new NodeType();
+ computeNodeType.setDerived_from(ToscaNodeType.ROOT.getDisplayName());
+ computeNodeType.setAttributes(createComputeAttributes());
+ computeNodeType.setRequirements(createComputeRequirements());
+ computeNodeType.setCapabilities(createComputeCapabilities());
+ return computeNodeType;
+ }
+
+ private static NodeType createToscaNodesRootNodeType() {
+ NodeType computeNodeType = new NodeType();
+ computeNodeType.setAttributes(createRootAttributes());
+ computeNodeType.setInterfaces(createRootInterfaces());
+ return computeNodeType;
+ }
+
+ private static NodeType createToscaNodesPortsNodeType() {
+ NodeType computeNodeType = new NodeType();
+ computeNodeType.setDerived_from(ToscaNodeType.ROOT.getDisplayName());
+ computeNodeType.setProperties(createToscaNodesPortProperties());
+ computeNodeType.setRequirements(createToscaNodesPortRequirements());
+ return computeNodeType;
+ }
+
+ private static NodeType createToscaNodesBlockStorageNodeType() {
+ NodeType computeNodeType = new NodeType();
+ computeNodeType.setDerived_from(ToscaNodeType.ROOT.getDisplayName());
+ computeNodeType.setProperties(createToscaNodesBlockStorageProperties());
+ computeNodeType.setCapabilities(createToscaNodesBlockStorageCapabilities());
+ return computeNodeType;
+ }
+
+ private static NodeType createToscaNodesNetworkNodeType() {
+ NodeType computeNodeType = new NodeType();
+ computeNodeType.setDerived_from(ToscaNodeType.ROOT.getDisplayName());
+ computeNodeType.setProperties(createToscaNodesNetworkProperties());
+ computeNodeType.setCapabilities(createToscaNodesNetworkCapabilities());
+ return computeNodeType;
+ }
+
+ private static Map<String, PropertyDefinition> createToscaNodesPortProperties() {
+ Map<String, PropertyDefinition> propertyDefinitionMap = new HashMap<>();
+ propertyDefinitionMap.put("ip_address", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), null, false, null, null,
+ null, null));
+ propertyDefinitionMap.put("order", DataModelUtil
+ .createPropertyDefinition(PropertyType.INTEGER.getDisplayName(), null, true,
+ DataModelUtil.getConstrainList(DataModelUtil.createGreaterOrEqualConstrain(0)), null,
+ null, 0));
+ propertyDefinitionMap.put("is_default", DataModelUtil
+ .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(), null, false, null, null,
+ null, false));
+ propertyDefinitionMap.put("ip_range_start", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), null, false, null, null,
+ null, null));
+ propertyDefinitionMap.put("ip_range_end", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), null, false, null, null,
+ null, null));
+ return propertyDefinitionMap;
+ }
+
+ private static Map<String, PropertyDefinition> createToscaNodesBlockStorageProperties() {
+ Map<String, PropertyDefinition> propertyDefinitionMap = new HashMap<>();
+ propertyDefinitionMap.put("size", DataModelUtil
+ .createPropertyDefinition(PropertyType.SCALAR_UNIT_SIZE.getDisplayName(), null, false,
+ DataModelUtil.getConstrainList(DataModelUtil.createGreaterOrEqualConstrain("1 MB")),
+ null, null, null));
+ propertyDefinitionMap.put("volume_id", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), null, false, null, null,
+ null, null));
+ propertyDefinitionMap.put("snapshot_id", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), null, false, null, null,
+ null, null));
+ return propertyDefinitionMap;
+ }
+
+ private static Map<String, PropertyDefinition> createToscaNodesNetworkProperties() {
+ Map<String, PropertyDefinition> propertyDefinitionMap = new HashMap<>();
+ propertyDefinitionMap.put("ip_version", DataModelUtil
+ .createPropertyDefinition(PropertyType.INTEGER.getDisplayName(), null, false,
+ DataModelUtil.getConstrainList(DataModelUtil.createValidValuesConstraint(4, 6)), null,
+ null, 4));
+ propertyDefinitionMap.put("cidr", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), null, false, null, null,
+ null, null));
+ propertyDefinitionMap.put("start_ip", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), null, false, null, null,
+ null, null));
+ propertyDefinitionMap.put("end_ip", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), null, false, null, null,
+ null, null));
+ propertyDefinitionMap.put("gateway_ip", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), null, false, null, null,
+ null, null));
+ propertyDefinitionMap.put("network_name", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), null, false, null, null,
+ null, null));
+ propertyDefinitionMap.put("network_id", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), null, false, null, null,
+ null, null));
+ propertyDefinitionMap.put("segmentation_id", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), null, false, null, null,
+ null, null));
+ propertyDefinitionMap.put("network_type", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), null, false, null, null,
+ null, null));
+ propertyDefinitionMap.put("physical_network", DataModelUtil
+ .createPropertyDefinition(PropertyType.STRING.getDisplayName(), null, false, null, null,
+ null, null));
+ propertyDefinitionMap.put("dhcp_enabled", DataModelUtil
+ .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(), null, false, null, null,
+ null, true));
+
+ return propertyDefinitionMap;
+ }
+
+ private static Map<String, InterfaceDefinition> createRootInterfaces() {
+ return new HashMap<>();
+ }
+
+ private static Map<String, CapabilityDefinition> createComputeCapabilities() {
+ Map<String, CapabilityDefinition> computeCapabilities = new HashMap<>();
+ computeCapabilities.put(ToscaConstants.HOST_CAPABILITY_ID,
+ createCapabilityDefinition(ToscaCapabilityType.CONTAINER.getDisplayName(),
+ createValidSourceTypes("tosca.nodes.SoftwareComponent")));
+ computeCapabilities.put(ToscaConstants.ENDPOINT_CAPABILITY_ID,
+ createCapabilityDefinition(ToscaCapabilityType.ENDPOINT_ADMIN.getDisplayName(), null));
+ computeCapabilities.put(ToscaConstants.OS_CAPABILITY_ID,
+ createCapabilityDefinition(ToscaCapabilityType.OPERATING_SYSTEM.getDisplayName(), null));
+ computeCapabilities.put(ToscaConstants.SCALABLE_CAPABILITY_ID,
+ createCapabilityDefinition(ToscaCapabilityType.SCALABLE.getDisplayName(), null));
+ computeCapabilities.put(ToscaConstants.BINDING_CAPABILITY_ID,
+ createCapabilityDefinition(ToscaCapabilityType.NETWORK_BINDABLE.getDisplayName(), null));
+ return computeCapabilities;
+ }
+
+ private static Map<String, CapabilityDefinition> createToscaNodesBlockStorageCapabilities() {
+ Map<String, CapabilityDefinition> computeCapabilities = new HashMap<>();
+ computeCapabilities.put("attachment",
+ createCapabilityDefinition(ToscaCapabilityType.ATTACHMENT.getDisplayName(), null));
+ return computeCapabilities;
+ }
+
+ private static Map<String, CapabilityDefinition> createToscaNodesNetworkCapabilities() {
+ Map<String, CapabilityDefinition> computeCapabilities = new HashMap<>();
+ computeCapabilities.put(ToscaConstants.LINK_CAPABILITY_ID,
+ createCapabilityDefinition(ToscaCapabilityType.NETWORK_LINKABLE.getDisplayName(), null));
+ return computeCapabilities;
+ }
+
+ private static List<String> createValidSourceTypes(String... validSourceTypes) {
+ return Arrays.asList(validSourceTypes);
+ }
+
+ private static CapabilityDefinition createCapabilityDefinition(String type,
+ List<String> validSourceTypes) {
+ CapabilityDefinition capabilityDefinition = new CapabilityDefinition();
+ capabilityDefinition.setType(type);
+ capabilityDefinition.setValid_source_types(validSourceTypes);
+ return capabilityDefinition;
+ }
+
+ private static List<Map<String, RequirementDefinition>> createComputeRequirements() {
+ List<Map<String, RequirementDefinition>> computeRequirementList = new ArrayList<>();
+ Map<String, RequirementDefinition> localStorageRequirement = new HashMap<>();
+ localStorageRequirement.put("local_storage", DataModelUtil
+ .createRequirement(ToscaCapabilityType.ATTACHMENT.getDisplayName(),
+ ToscaNodeType.BLOCK_STORAGE.getDisplayName(),
+ ToscaRelationshipType.NATIVE_ATTACHES_TO.getDisplayName(),
+ createOccurrences(0, ToscaConstants.UNBOUNDED)));
+ computeRequirementList.add(localStorageRequirement);
+ return computeRequirementList;
+ }
+
+ private static List<Map<String, RequirementDefinition>> createToscaNodesPortRequirements() {
+ List<Map<String, RequirementDefinition>> requirements = new ArrayList<>();
+
+ Map<String, RequirementDefinition> linkRequirement = new HashMap<>();
+ linkRequirement.put(ToscaConstants.LINK_REQUIREMENT_ID, DataModelUtil
+ .createRequirement(ToscaCapabilityType.NETWORK_LINKABLE.getDisplayName(),
+ ToscaNodeType.ROOT.getDisplayName(),
+ ToscaRelationshipType.NETWORK_LINK_TO.getDisplayName(), null));
+ requirements.add(linkRequirement);
+
+ Map<String, RequirementDefinition> bindingRequirement = new HashMap<>();
+ bindingRequirement.put(ToscaConstants.BINDING_REQUIREMENT_ID, DataModelUtil
+ .createRequirement(ToscaCapabilityType.NETWORK_BINDABLE.getDisplayName(),
+ ToscaNodeType.ROOT.getDisplayName(),
+ ToscaRelationshipType.NETWORK_BINDS_TO.getDisplayName(), null));
+ requirements.add(bindingRequirement);
+
+ return requirements;
+ }
+
+
+ private static Object[] createOccurrences(Object min, Object max) {
+ return new Object[]{min, max};
+
+ }
+
+ private static Map<String, AttributeDefinition> createComputeAttributes() {
+ Map<String, AttributeDefinition> computeAttributesDefMap = new HashMap<>();
+ computeAttributesDefMap.put("private_address", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "private address", null,
+ null, null));
+ computeAttributesDefMap.put("public_address", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "public_address", null,
+ null, null));
+ computeAttributesDefMap.put("networks", DataModelUtil
+ .createAttributeDefinition(PropertyType.MAP.getDisplayName(), "networks", null,
+ DataModelUtil
+ .createEntrySchema(ToscaDataType.NETWORK_NETWORK_INFO.getDisplayName(), null, null),
+ null));
+ computeAttributesDefMap.put("ports", DataModelUtil
+ .createAttributeDefinition(PropertyType.MAP.getDisplayName(), "ports", null, DataModelUtil
+ .createEntrySchema(ToscaDataType.NETWORK_PORT_INFO.getDisplayName(), null, null),
+ null));
+ return computeAttributesDefMap;
+ }
+
+ private static Map<String, AttributeDefinition> createRootAttributes() {
+ Map<String, AttributeDefinition> attributesDefMap = new HashMap<>();
+ attributesDefMap.put("tosca_id", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "tosca id", null, null,
+ null));
+ attributesDefMap.put("tosca_name", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "tosca name", null, null,
+ null));
+ attributesDefMap.put("state", DataModelUtil
+ .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "state", null, null,
+ null));
+ return attributesDefMap;
+ }
+
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaUtil.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaUtil.java
new file mode 100644
index 0000000000..4f9c70267d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaUtil.java
@@ -0,0 +1,151 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.services;
+
+import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
+import org.openecomp.sdc.tosca.datatypes.model.CapabilityDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.CapabilityType;
+import org.openecomp.sdc.tosca.datatypes.model.NodeType;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import java.util.UUID;
+
+/**
+ * The type Tosca util.
+ */
+public class ToscaUtil {
+
+ /**
+ * Gets service template file name.
+ *
+ * @param serviceTemplate the service template
+ * @return the service template file name
+ */
+ public static String getServiceTemplateFileName(ServiceTemplate serviceTemplate) {
+ if (serviceTemplate == null) {
+ return null;
+ }
+ if (serviceTemplate.getMetadata() == null) {
+ return UUID.randomUUID().toString() + "ServiceTemplate.yaml";
+ }
+ return getServiceTemplateFileName(serviceTemplate.getMetadata().getTemplate_name());
+ }
+
+ /**
+ * Gets service template file name.
+ *
+ * @param templateName the template name
+ * @return the service template file name
+ */
+ public static String getServiceTemplateFileName(String templateName) {
+ return (Objects.isNull(templateName) ? UUID.randomUUID().toString() : templateName)
+ + "ServiceTemplate.yaml";
+ }
+
+ /**
+ * Add service template to map with key file name.
+ *
+ * @param serviceTemplates the service templates
+ * @param commonServiceTemplate the common service template
+ */
+ public static void addServiceTemplateToMapWithKeyFileName(
+ Map<String, ServiceTemplate> serviceTemplates, ServiceTemplate commonServiceTemplate) {
+ serviceTemplates
+ .put(ToscaUtil.getServiceTemplateFileName(commonServiceTemplate), commonServiceTemplate);
+ }
+
+ /**
+ * Convert type to definition capability definition.
+ *
+ * @param type the type
+ * @param capabilityType the capability type
+ * @param properties the properties
+ * @param description the description
+ * @return the capability definition
+ */
+ public static CapabilityDefinition convertTypeToDefinition(String type,
+ CapabilityType capabilityType,
+ Map<String, Object> properties,
+ String description) {
+ CapabilityDefinition capabilityDefinition = new CapabilityDefinition();
+ capabilityDefinition.setAttributes(capabilityType.getAttributes());
+ capabilityDefinition.setProperties(capabilityType.getProperties());
+ if (description == null) {
+ capabilityDefinition.setDescription(capabilityType.getDescription());
+ } else {
+ capabilityDefinition.setDescription(description);
+ }
+ capabilityDefinition.setType(type);
+
+ capabilityDefinition.getProperties()
+ .entrySet()
+ .stream()
+ .filter(entry -> properties.containsKey(entry.getKey()))
+ .forEach(entry -> entry.getValue()
+ .set_default(properties.get(entry.getKey())));
+
+
+ return capabilityDefinition;
+
+ }
+
+ /**
+ * Normalize component name node type map.
+ *
+ * @param toscaModel the tosca model
+ * @param components the components
+ * @return the map
+ */
+ public static Map<String, List<NodeType>> normalizeComponentNameNodeType(
+ ToscaServiceModel toscaModel, Set<String> components) {
+
+ Map<String, List<NodeType>> normalizedData = new HashMap<>();
+ toscaModel
+ .getServiceTemplates()
+ .entrySet().stream().filter(entry -> entry
+ .getValue()
+ .getNode_types() != null)
+ .forEach(entry -> entry
+ .getValue()
+ .getNode_types()
+ .entrySet().stream()
+ .filter(nodeTypeEntry -> components
+ .contains(nodeTypeEntry
+ .getKey()))
+ .forEach(nodeTypeEntry -> addNodeType(nodeTypeEntry.getKey(), nodeTypeEntry.getValue(),
+ normalizedData)));
+ return normalizedData;
+ }
+
+ private static void addNodeType(String key, NodeType value,
+ Map<String, List<NodeType>> normalizedData) {
+ if (!normalizedData.containsKey(key)) {
+ normalizedData.put(key, new ArrayList<>());
+ }
+ normalizedData.get(key).add(value);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImpl.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImpl.java
new file mode 100644
index 0000000000..a11bff4b6a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImpl.java
@@ -0,0 +1,467 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.services.impl;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.MapUtils;
+import org.openecomp.core.utilities.CommonMethods;
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType;
+import org.openecomp.sdc.tosca.datatypes.ToscaElementTypes;
+import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
+import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
+import org.openecomp.sdc.tosca.datatypes.model.CapabilityType;
+import org.openecomp.sdc.tosca.datatypes.model.Import;
+import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.NodeType;
+import org.openecomp.sdc.tosca.datatypes.model.RequirementAssignment;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.tosca.errors.ToscaInvalidEntryNotFoundErrorBuilder;
+import org.openecomp.sdc.tosca.errors.ToscaInvalidSubstituteNodeTemplatePropertiesErrorBuilder;
+import org.openecomp.sdc.tosca.errors.ToscaInvalidSubstitutionServiceTemplateErrorBuilder;
+import org.openecomp.sdc.tosca.errors.ToscaNodeTypeNotFoundErrorBuilder;
+import org.openecomp.sdc.tosca.services.ToscaAnalyzerService;
+import org.openecomp.sdc.tosca.services.ToscaConstants;
+import org.openecomp.sdc.tosca.services.yamlutil.ToscaExtensionYamlUtil;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.Set;
+
+public class ToscaAnalyzerServiceImpl implements ToscaAnalyzerService {
+ /*
+ node template with type equal to node type or derived from node type.
+ */
+ @Override
+ public Map<String, NodeTemplate> getNodeTemplatesByType(ServiceTemplate serviceTemplate,
+ String nodeType,
+ ToscaServiceModel toscaServiceModel) {
+ Map<String, NodeTemplate> nodeTemplates = new HashMap<>();
+
+ if (Objects.nonNull(serviceTemplate.getTopology_template())
+ && MapUtils.isNotEmpty(serviceTemplate.getTopology_template().getNode_templates())) {
+ for (Map.Entry<String, NodeTemplate> nodeTemplateEntry : serviceTemplate
+ .getTopology_template().getNode_templates().entrySet()) {
+ if (isTypeOf(nodeTemplateEntry.getValue(), nodeType, serviceTemplate, toscaServiceModel)) {
+ nodeTemplates.put(nodeTemplateEntry.getKey(), nodeTemplateEntry.getValue());
+ }
+
+ }
+ }
+ return nodeTemplates;
+ }
+
+ @Override
+ public boolean isTypeOf(NodeTemplate nodeTemplate, String nodeType,
+ ServiceTemplate serviceTemplate, ToscaServiceModel toscaServiceModel) {
+ if (nodeTemplate == null) {
+ return false;
+ }
+
+ if (isNodeTemplateOfTypeNodeType(nodeTemplate, nodeType)) {
+ return true;
+ }
+
+ Optional<Boolean> nodeTypeExistInServiceTemplateHierarchy =
+ isNodeTypeExistInServiceTemplateHierarchy(nodeType, nodeTemplate.getType(), serviceTemplate,
+ toscaServiceModel, null);
+ return nodeTypeExistInServiceTemplateHierarchy.orElseThrow(() -> new CoreException(
+ new ToscaNodeTypeNotFoundErrorBuilder(nodeTemplate.getType()).build()));
+ }
+
+
+ private Optional<Boolean> isNodeTypeExistInServiceTemplateHierarchy(String nodeTypeToMatch,
+ String nodeTypeToSearch,
+ ServiceTemplate serviceTemplate,
+ ToscaServiceModel toscaServiceModel,
+ Set<String> analyzedImportFiles) {
+ Map<String, NodeType> searchableNodeTypes = serviceTemplate.getNode_types();
+ if (!MapUtils.isEmpty(searchableNodeTypes)) {
+ NodeType nodeType = searchableNodeTypes.get(nodeTypeToSearch);
+ if (Objects.nonNull(nodeType)) {
+ if (Objects.equals(nodeType.getDerived_from(), nodeTypeToMatch)) {
+ return Optional.of(true);
+ } else if (isNodeTypeIsToscaRoot(nodeType)) {
+ return Optional.of(false);
+ } else {
+ return isNodeTypeExistInServiceTemplateHierarchy(nodeTypeToMatch,
+ nodeType.getDerived_from(), serviceTemplate, toscaServiceModel, null);
+ }
+ } else {
+ return isNodeTypeExistInImports(nodeTypeToMatch, nodeTypeToSearch, serviceTemplate,
+ toscaServiceModel, analyzedImportFiles);
+ }
+ }
+ return isNodeTypeExistInImports(nodeTypeToMatch, nodeTypeToSearch, serviceTemplate,
+ toscaServiceModel, analyzedImportFiles);
+
+ }
+
+ private Optional<Boolean> isNodeTypeExistInImports(String nodeTypeToMatch,
+ String nodeTypeToSearch,
+ ServiceTemplate serviceTemplate,
+ ToscaServiceModel toscaServiceModel,
+ Set<String> analyzedImportFiles) {
+ Map<String, Import> imports = serviceTemplate.getImports();
+ if (imports == null) {
+ return Optional.empty();
+ }
+
+ analyzedImportFiles = createAnalyzedImportFilesSet(analyzedImportFiles);
+ for (Import anImport : imports.values()) {
+ if (Objects.isNull(anImport) || Objects.isNull(anImport.getFile())) {
+ throw new RuntimeException("import without file entry");
+ }
+ String importFile = anImport.getFile();
+ if (analyzedImportFiles.contains(importFile)) {
+ continue;
+ }
+ addImportFileToAnalyzedImportFilesSet(analyzedImportFiles, importFile);
+ ServiceTemplate template = toscaServiceModel.getServiceTemplates().get(importFile);
+ Optional<Boolean> nodeTypeExistInServiceTemplateHierarchy =
+ isNodeTypeExistInServiceTemplateHierarchy(nodeTypeToMatch, nodeTypeToSearch, template,
+ toscaServiceModel, analyzedImportFiles);
+ if (nodeTypeExistInServiceTemplateHierarchy.isPresent()) {
+ if (nodeTypeExistInServiceTemplateHierarchy.get()) {
+ return Optional.of(true);
+ }
+ }
+ }
+ return Optional.of(false);
+ }
+
+ private Set<String> addImportFileToAnalyzedImportFilesSet(Set<String> analyzedImportFiles,
+ String importFile) {
+ analyzedImportFiles.add(importFile);
+ return analyzedImportFiles;
+ }
+
+ private Set<String> createAnalyzedImportFilesSet(Set<String> analyzedImportFiles) {
+ if (Objects.isNull(analyzedImportFiles)) {
+ analyzedImportFiles = new HashSet<>();
+ }
+ return analyzedImportFiles;
+ }
+
+ private boolean isNodeTypeIsToscaRoot(NodeType stNodeType) {
+ return Objects.equals(stNodeType.getDerived_from(), ToscaNodeType.ROOT.getDisplayName());
+ }
+
+ private boolean isNodeTemplateOfTypeNodeType(NodeTemplate nodeTemplate, String nodeType) {
+ return Objects.equals(nodeTemplate.getType(), nodeType);
+ }
+
+ @Override
+ public List<RequirementAssignment> getRequirements(NodeTemplate nodeTemplate,
+ String requirementId) {
+ List<RequirementAssignment> requirements = new ArrayList<>();
+ List<Map<String, RequirementAssignment>> requirementList = nodeTemplate.getRequirements();
+ if (requirementList != null) {
+ requirementList.stream().filter(reqMap -> reqMap.get(requirementId) != null)
+ .forEach(reqMap -> {
+ ToscaExtensionYamlUtil toscaExtensionYamlUtil = new ToscaExtensionYamlUtil();
+ RequirementAssignment reqAssignment = toscaExtensionYamlUtil
+ .yamlToObject(toscaExtensionYamlUtil.objectToYaml(reqMap.get(requirementId)),
+ RequirementAssignment.class);
+ requirements.add(reqAssignment);
+ });
+ }
+ return requirements;
+ }
+
+ @Override
+ public Optional<NodeTemplate> getNodeTemplateById(ServiceTemplate serviceTemplate,
+ String nodeTemplateId) {
+ if ((serviceTemplate.getTopology_template() != null)
+ && (serviceTemplate.getTopology_template().getNode_templates() != null)
+ && (serviceTemplate.getTopology_template().getNode_templates()
+ .get(nodeTemplateId) != null)) {
+ return Optional
+ .of(serviceTemplate.getTopology_template().getNode_templates().get(nodeTemplateId));
+ }
+ return Optional.empty();
+ }
+
+ @Override
+ public Optional<String> getSubstituteServiceTemplateName(String substituteNodeTemplateId,
+ NodeTemplate substitutableNodeTemplate) {
+ if (!isSubstitutableNodeTemplate(substitutableNodeTemplate)) {
+ return Optional.empty();
+ }
+
+ if (substitutableNodeTemplate.getProperties() != null
+ && substitutableNodeTemplate.getProperties()
+ .get(ToscaConstants.SERVICE_TEMPLATE_FILTER_PROPERTY_NAME) != null) {
+ Object serviceTemplateFilter = substitutableNodeTemplate.getProperties()
+ .get(ToscaConstants.SERVICE_TEMPLATE_FILTER_PROPERTY_NAME);
+ if (serviceTemplateFilter != null && serviceTemplateFilter instanceof Map) {
+ Object substituteServiceTemplate = ((Map) serviceTemplateFilter)
+ .get(ToscaConstants.SUBSTITUTE_SERVICE_TEMPLATE_PROPERTY_NAME);
+ if (substituteServiceTemplate == null) {
+ throw new CoreException(
+ new ToscaInvalidSubstituteNodeTemplatePropertiesErrorBuilder(substituteNodeTemplateId)
+ .build());
+ }
+ return Optional.of(substituteServiceTemplate.toString());
+ }
+ }
+ throw new CoreException(
+ new ToscaInvalidSubstituteNodeTemplatePropertiesErrorBuilder(substituteNodeTemplateId)
+ .build());
+ }
+
+ @Override
+ public Map<String, NodeTemplate> getSubstitutableNodeTemplates(ServiceTemplate serviceTemplate) {
+ Map<String, NodeTemplate> substitutableNodeTemplates = new HashMap<>();
+
+ if (serviceTemplate == null
+ || serviceTemplate.getTopology_template() == null
+ || serviceTemplate.getTopology_template().getNode_templates() == null) {
+ return substitutableNodeTemplates;
+ }
+
+ Map<String, NodeTemplate> nodeTemplates =
+ serviceTemplate.getTopology_template().getNode_templates();
+ for (String nodeTemplateId : nodeTemplates.keySet()) {
+ NodeTemplate nodeTemplate = nodeTemplates.get(nodeTemplateId);
+ if (isSubstitutableNodeTemplate(nodeTemplate)) {
+ substitutableNodeTemplates.put(nodeTemplateId, nodeTemplate);
+ }
+ }
+
+ return substitutableNodeTemplates;
+ }
+
+ private boolean isSubstitutableNodeTemplate(NodeTemplate nodeTemplate) {
+ return nodeTemplate.getDirectives() != null
+ && nodeTemplate.getDirectives().contains(ToscaConstants
+ .NODE_TEMPLATE_DIRECTIVE_SUBSTITUTABLE);
+ }
+
+ private boolean isSubstitutionServiceTemplate(String substituteServiceTemplateFileName,
+ ServiceTemplate substituteServiceTemplate) {
+ if (substituteServiceTemplate != null
+ && substituteServiceTemplate.getTopology_template() != null
+ && substituteServiceTemplate.getTopology_template().getSubstitution_mappings() != null) {
+ if (substituteServiceTemplate.getTopology_template().getSubstitution_mappings()
+ .getNode_type() == null) {
+ throw new CoreException(new ToscaInvalidSubstitutionServiceTemplateErrorBuilder(
+ substituteServiceTemplateFileName).build());
+ }
+ return true;
+ }
+ return false;
+
+ }
+
+ @Override
+ public Optional<Map.Entry<String, NodeTemplate>> getSubstitutionMappedNodeTemplateByExposedReq(
+ String substituteServiceTemplateFileName, ServiceTemplate substituteServiceTemplate,
+ String requirementId) {
+ if (isSubstitutionServiceTemplate(substituteServiceTemplateFileName,
+ substituteServiceTemplate)) {
+ Map<String, List<String>> substitutionMappingRequirements =
+ substituteServiceTemplate.getTopology_template().getSubstitution_mappings()
+ .getRequirements();
+ if (substitutionMappingRequirements != null) {
+ List<String> requirementMapping = substitutionMappingRequirements.get(requirementId);
+ if (requirementMapping != null && !requirementMapping.isEmpty()) {
+ String mappedNodeTemplateId = requirementMapping.get(0);
+ Optional<NodeTemplate> mappedNodeTemplate =
+ getNodeTemplateById(substituteServiceTemplate, mappedNodeTemplateId);
+ mappedNodeTemplate.orElseThrow(() -> new CoreException(
+ new ToscaInvalidEntryNotFoundErrorBuilder("Node Template", mappedNodeTemplateId)
+ .build()));
+ Map.Entry<String, NodeTemplate> mappedNodeTemplateEntry =
+ new Map.Entry<String, NodeTemplate>() {
+ @Override
+ public String getKey() {
+ return mappedNodeTemplateId;
+ }
+
+ @Override
+ public NodeTemplate getValue() {
+ return mappedNodeTemplate.get();
+ }
+
+ @Override
+ public NodeTemplate setValue(NodeTemplate value) {
+ return null;
+ }
+ };
+ return Optional.of(mappedNodeTemplateEntry);
+ }
+ }
+ }
+ return Optional.empty();
+ }
+
+
+ /*
+ match only for the input which is not null
+ */
+ @Override
+ public boolean isDesiredRequirementAssignment(RequirementAssignment requirementAssignment,
+ String capability, String node,
+ String relationship) {
+ if (capability != null) {
+ if (requirementAssignment.getCapability() == null
+ || !requirementAssignment.getCapability().equals(capability)) {
+ return false;
+ }
+ }
+
+ if (node != null) {
+ if (requirementAssignment.getNode() == null
+ || !requirementAssignment.getNode().equals(node)) {
+ return false;
+ }
+ }
+
+ if (relationship != null) {
+ if (requirementAssignment.getRelationship() == null
+ || !requirementAssignment.getRelationship().equals(relationship)) {
+ return false;
+ }
+ }
+
+ return !(capability == null && node == null && relationship == null);
+
+ }
+
+ @Override
+ public Object getFlatEntity(ToscaElementTypes elementType, String typeId,
+ ServiceTemplate serviceTemplate, ToscaServiceModel toscaModel) {
+ Object returnEntity;
+
+ switch (elementType) {
+ case CAPABILITY_TYPE:
+ returnEntity = new CapabilityType();
+ break;
+ default:
+ throw new RuntimeException(
+ "Entity[" + elementType + "] id[" + typeId + "] flat not supported");
+ }
+
+ scanAnFlatEntity(elementType, typeId, returnEntity, serviceTemplate, toscaModel);
+
+
+ return returnEntity;
+ }
+
+ private void scanAnFlatEntity(ToscaElementTypes elementType, String typeId, Object entity,
+ ServiceTemplate serviceTemplate, ToscaServiceModel toscaModel) {
+
+
+ boolean entityFound =
+ enrichEntityFromCurrentServiceTemplate(elementType, typeId, entity, serviceTemplate,
+ toscaModel);
+ if (!entityFound) {
+ Map<String, Import> imports = serviceTemplate.getImports();
+ if (MapUtils.isEmpty(imports)) {
+ return;
+ }
+ for (Import importServiceTemplate : imports.values()) {
+ ServiceTemplate template =
+ toscaModel.getServiceTemplates().get(importServiceTemplate.getFile());
+ scanAnFlatEntity(elementType, typeId, entity, template, toscaModel);
+ }
+ }
+
+
+ }
+
+ private boolean enrichEntityFromCurrentServiceTemplate(ToscaElementTypes elementType,
+ String typeId, Object entity,
+ ServiceTemplate serviceTemplate,
+ ToscaServiceModel toscaModel) {
+ String derivedFrom;
+ switch (elementType) {
+ case CAPABILITY_TYPE:
+ if (serviceTemplate.getCapability_types() != null
+ && serviceTemplate.getCapability_types().containsKey(typeId)) {
+
+ CapabilityType targetCapabilityType = ((CapabilityType) entity);
+ CapabilityType sourceCapabilityType = serviceTemplate.getCapability_types().get(typeId);
+ derivedFrom = sourceCapabilityType.getDerived_from();
+ if (derivedFrom != null
+ && !ToscaCapabilityType.NFV_METRIC.getDisplayName().equals(derivedFrom)) {
+ scanAnFlatEntity(elementType, derivedFrom, entity, serviceTemplate, toscaModel);
+ }
+ combineCapabilityTypeInfo(sourceCapabilityType, targetCapabilityType);
+ } else {
+ return false;
+ }
+ break;
+ default:
+ throw new RuntimeException(
+ "Entity[" + elementType + "] id[" + typeId + "] flat not supported");
+ }
+
+ return true;
+
+
+ }
+
+ private void combineCapabilityTypeInfo(CapabilityType sourceCapabilityType,
+ CapabilityType targetCapabilityType) {
+ if (MapUtils.isNotEmpty(sourceCapabilityType.getAttributes())) {
+ if (targetCapabilityType.getAttributes() == null) {
+ targetCapabilityType.setAttributes(new HashMap<>());
+ }
+ targetCapabilityType.getAttributes().putAll(sourceCapabilityType.getAttributes());
+ }
+
+ if (MapUtils.isNotEmpty(sourceCapabilityType.getProperties())) {
+ if (targetCapabilityType.getProperties() == null) {
+ targetCapabilityType.setProperties(new HashMap<>());
+ }
+ targetCapabilityType.getProperties().putAll(sourceCapabilityType.getProperties());
+ }
+
+ if (CollectionUtils.isNotEmpty(sourceCapabilityType.getValid_source_types())) {
+ if (targetCapabilityType.getValid_source_types() == null) {
+ targetCapabilityType.setValid_source_types(new ArrayList<>());
+ }
+ targetCapabilityType.getValid_source_types()
+ .addAll(sourceCapabilityType.getValid_source_types());
+ }
+
+ if (CommonMethods.isEmpty(sourceCapabilityType.getDerived_from())) {
+ targetCapabilityType.setDerived_from(sourceCapabilityType.getDerived_from());
+ }
+ if (CommonMethods.isEmpty(sourceCapabilityType.getDescription())) {
+ targetCapabilityType.setDescription(sourceCapabilityType.getDescription());
+ }
+ if (CommonMethods.isEmpty(sourceCapabilityType.getVersion())) {
+ targetCapabilityType.setVersion(sourceCapabilityType.getVersion());
+ }
+
+
+ }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaFileOutputServiceCsarImpl.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaFileOutputServiceCsarImpl.java
new file mode 100644
index 0000000000..d4c22f105f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaFileOutputServiceCsarImpl.java
@@ -0,0 +1,158 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.services.impl;
+
+import org.openecomp.core.utilities.file.FileContentHandler;
+import org.openecomp.core.utilities.file.FileUtils;
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.tosca.exceptions.CsarCreationErrorBuilder;
+import org.openecomp.sdc.tosca.exceptions.CsarMissingEntryPointErrorBuilder;
+import org.openecomp.sdc.tosca.services.ToscaFileOutputService;
+
+import java.io.BufferedOutputStream;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Map;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
+
+public class ToscaFileOutputServiceCsarImpl implements ToscaFileOutputService {
+ static final String EXTERNAL_ARTIFACTS_FOLDER_NAME = "Artifacts";
+ private static final String DEFINITIONS_FOLDER_NAME = "Definitions";
+ private static final String ARTIFACTS_FOLDER_NAME = "Artifacts";
+ //todo currently duplicated, to be changed when external artifacts are separated from internal
+ private static final String TOSCA_META_FOLDER_NAME = "TOSCA-Metadata";
+ private static final String TOSCA_META_FILE_VERSION = "TOSCA-Meta-File-Version";
+ private static final String TOSCA_META_FILE_VERSION_VALUE = "1.0";
+ private static final String TOSCA_META_FILE_NAME = "TOSCA.meta";
+ private static final String CSAR_VERSION = "CSAR-Version";
+ private static final String CSAR_VERSION_VALUE = "1.1";
+ private static final String CREATED_BY = "Created-By";
+ private static final String CREATED_BY_VALUE = "ASDC Onboarding portal";
+ private static final String ENTRY_DEFINITIONS = "Entry-Definitions";
+ private static final String META_FILE_DELIMITER = ":";
+ private static final String SPACE = " ";
+ private static final String FILE_SEPARATOR = File.separator;
+
+ @Override
+ public byte[] createOutputFile(ToscaServiceModel toscaServiceModel,
+ FileContentHandler externalArtifacts) {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ try (ZipOutputStream zos = new ZipOutputStream(new BufferedOutputStream(baos))) {
+ packDefinitions(zos, toscaServiceModel.getServiceTemplates());
+ FileContentHandler artifactFiles = toscaServiceModel.getArtifactFiles();
+ if (artifactFiles != null && !artifactFiles.isEmpty()) {
+ packArtifacts(zos, artifactFiles);
+ }
+ if (toscaServiceModel.getEntryDefinitionServiceTemplate() == null) {
+ throw new CoreException(new CsarMissingEntryPointErrorBuilder().build());
+ }
+ createAndPackToscaMetaFile(zos, toscaServiceModel.getEntryDefinitionServiceTemplate());
+ if (externalArtifacts != null) {
+ packExternalArtifacts(zos, externalArtifacts);
+ }
+ } catch (IOException exc) {
+ throw new CoreException(new CsarCreationErrorBuilder().build(), exc);
+ }
+ return baos.toByteArray();
+ }
+
+ @Override
+ public String createMetaFile(String entryDefinitionsFileName) {
+ return TOSCA_META_FILE_VERSION + META_FILE_DELIMITER + SPACE + TOSCA_META_FILE_VERSION_VALUE
+ + System.lineSeparator()
+ + CSAR_VERSION + META_FILE_DELIMITER + SPACE + CSAR_VERSION_VALUE + System.lineSeparator()
+ + CREATED_BY + META_FILE_DELIMITER + SPACE + CREATED_BY_VALUE + System.lineSeparator()
+ + ENTRY_DEFINITIONS + META_FILE_DELIMITER + SPACE + DEFINITIONS_FOLDER_NAME
+ + FILE_SEPARATOR + entryDefinitionsFileName;
+ }
+
+ @Override
+ public String getArtifactsFolderName() {
+ return ARTIFACTS_FOLDER_NAME;
+ }
+
+ private void createAndPackToscaMetaFile(ZipOutputStream zos, String entryDefinitionsFileName)
+ throws IOException {
+ String metaFile = createMetaFile(entryDefinitionsFileName);
+ zos.putNextEntry(
+ new ZipEntry((TOSCA_META_FOLDER_NAME + FILE_SEPARATOR + TOSCA_META_FILE_NAME)));
+ writeBytesToZip(zos, new ByteArrayInputStream(metaFile.getBytes()));
+ }
+
+ private void packDefinitions(ZipOutputStream zos, Map<String, ServiceTemplate> serviceTemplates)
+ throws IOException {
+ for (Map.Entry<String, ServiceTemplate> serviceTemplate : serviceTemplates.entrySet()) {
+ String fileName = serviceTemplate.getKey();
+ zos.putNextEntry(new ZipEntry(DEFINITIONS_FOLDER_NAME + FILE_SEPARATOR + fileName));
+ writeBytesToZip(zos,
+ FileUtils.convertToInputStream(serviceTemplate.getValue(), FileUtils.FileExtension.YAML));
+ }
+ }
+
+ private void packExternalArtifacts(ZipOutputStream zos, FileContentHandler externalArtifacts) {
+
+ for (String filenameIncludingPath : externalArtifacts.getFileList()) {
+ try {
+ zos.putNextEntry(new ZipEntry(filenameIncludingPath));
+ writeBytesToZip(zos, externalArtifacts.getFileContent(filenameIncludingPath));
+
+ } catch (IOException exc) {
+ throw new RuntimeException(exc);
+ } finally {
+ try {
+ zos.closeEntry();
+ } catch (IOException ignore) {
+ //do nothing
+ }
+ }
+ }
+
+ }
+
+ private void packArtifacts(ZipOutputStream zos, FileContentHandler artifacts) {
+
+ for (String fileName : artifacts.getFileList()) {
+ try {
+ zos.putNextEntry(new ZipEntry((ARTIFACTS_FOLDER_NAME + FILE_SEPARATOR + fileName)));
+ writeBytesToZip(zos, artifacts.getFileContent(fileName));
+
+ } catch (IOException exc) {
+ throw new RuntimeException(exc);
+ } finally {
+ try {
+ zos.closeEntry();
+ } catch (IOException ignore) {
+ //do nothing
+ }
+ }
+ }
+ }
+
+ private void writeBytesToZip(ZipOutputStream zos, InputStream is) throws IOException {
+ FileUtils.copy(is, zos);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/yamlutil/ToscaExtensionYamlUtil.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/yamlutil/ToscaExtensionYamlUtil.java
new file mode 100644
index 0000000000..a1c11c2483
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/yamlutil/ToscaExtensionYamlUtil.java
@@ -0,0 +1,93 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.services.yamlutil;
+
+import org.openecomp.core.utilities.yaml.YamlUtil;
+import org.yaml.snakeyaml.constructor.Constructor;
+import org.yaml.snakeyaml.introspector.Property;
+import org.yaml.snakeyaml.introspector.PropertyUtils;
+import org.yaml.snakeyaml.nodes.MappingNode;
+import org.yaml.snakeyaml.nodes.NodeId;
+
+import java.beans.IntrospectionException;
+
+public class ToscaExtensionYamlUtil extends YamlUtil {
+
+ @Override
+ public <T> Constructor getConstructor(Class<T> typClass) {
+ return new ToscaWithHeatExtensionConstructor(typClass);
+ }
+
+ @Override
+ protected PropertyUtils getPropertyUtils() {
+ return new ToscaPropertyUtilsWithHeatExtension();
+ }
+
+ public class ToscaPropertyUtilsWithHeatExtension extends MyPropertyUtils {
+ @Override
+ public Property getProperty(Class<? extends Object> type, String name)
+ throws IntrospectionException {
+ try {
+ if (type.equals(
+ Class.forName("org.openecomp.sdc.tosca.datatypes.model.ParameterDefinition"))) {
+ type = Class.forName(
+ "org.openecomp.sdc.tosca.datatypes.model.heatextend.ParameterDefinitionExt");
+ }
+ } catch (ClassNotFoundException exception) {
+ throw new RuntimeException(exception);
+ }
+ return super.getProperty(type, name);
+ }
+ }
+
+ protected class ToscaWithHeatExtensionConstructor extends StrictMapAppenderConstructor {
+ public ToscaWithHeatExtensionConstructor(Class<?> theRoot) {
+ super(theRoot);
+ yamlClassConstructors.put(NodeId.mapping, new MyPersistentObjectConstruct());
+ }
+
+ class MyPersistentObjectConstruct extends ConstructMapping {
+ @Override
+ protected Object constructJavaBean2ndStep(MappingNode node, Object object) {
+ Class type = node.getType();
+ try {
+ if (type.equals(
+ Class.forName("org.openecomp.sdc.tosca.datatypes.model.ParameterDefinition"))) {
+ Class extendHeatClass = Class.forName(
+ "org.openecomp.sdc.tosca.datatypes.model.heatextend.ParameterDefinitionExt");
+ Object extendHeatObject = extendHeatClass.newInstance();
+ // create JavaBean
+ return super.constructJavaBean2ndStep(node, extendHeatObject);
+ } else {
+ // create JavaBean
+ return super.constructJavaBean2ndStep(node, object);
+ }
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException exception) {
+ throw new RuntimeException(exception);
+ }
+ }
+ }
+ }
+}
+
+
+
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/TestUtil.java b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/TestUtil.java
new file mode 100644
index 0000000000..da3ae76f27
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/TestUtil.java
@@ -0,0 +1,71 @@
+package org.openecomp.sdc.tosca;
+
+import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.tosca.services.yamlutil.ToscaExtensionYamlUtil;
+
+import java.io.*;
+import java.net.URL;
+import java.nio.file.NotDirectoryException;
+import java.util.HashMap;
+import java.util.Map;
+
+public class TestUtil {
+
+ public static ToscaServiceModel loadToscaServiceModel(String serviceTemplatesPath,
+ String globalServiceTemplatesPath,
+ String entryDefinitionServiceTemplate)
+ throws IOException {
+ ToscaExtensionYamlUtil toscaExtensionYamlUtil = new ToscaExtensionYamlUtil();
+ Map<String, ServiceTemplate> serviceTemplates = new HashMap<>();
+ if (entryDefinitionServiceTemplate == null) {
+ entryDefinitionServiceTemplate = "MainServiceTemplate.yaml";
+ }
+
+ loadServiceTemplates(serviceTemplatesPath, toscaExtensionYamlUtil, serviceTemplates);
+ if (globalServiceTemplatesPath != null) {
+ loadServiceTemplates(globalServiceTemplatesPath, toscaExtensionYamlUtil, serviceTemplates);
+ }
+
+ return new ToscaServiceModel(null, serviceTemplates, entryDefinitionServiceTemplate);
+ }
+
+ private static void loadServiceTemplates(String serviceTemplatesPath,
+ ToscaExtensionYamlUtil toscaExtensionYamlUtil,
+ Map<String, ServiceTemplate> serviceTemplates)
+ throws IOException {
+ URL urlFile = TestUtil.class.getResource(serviceTemplatesPath);
+ if (urlFile != null) {
+ File pathFile = new File(urlFile.getFile());
+ File[] files = pathFile.listFiles();
+ if (files != null) {
+ addServiceTemplateFiles(serviceTemplates, files, toscaExtensionYamlUtil);
+ } else {
+ throw new NotDirectoryException(serviceTemplatesPath);
+ }
+ } else {
+ throw new NotDirectoryException(serviceTemplatesPath);
+ }
+ }
+
+ private static void addServiceTemplateFiles(Map<String, ServiceTemplate> serviceTemplates,
+ File[] files,
+ ToscaExtensionYamlUtil toscaExtensionYamlUtil)
+ throws IOException {
+ for (File file : files) {
+ try (InputStream yamlFile = new FileInputStream(file)) {
+ ServiceTemplate serviceTemplateFromYaml =
+ toscaExtensionYamlUtil.yamlToObject(yamlFile, ServiceTemplate.class);
+ serviceTemplates.put(file.getName(), serviceTemplateFromYaml);
+ try {
+ yamlFile.close();
+ } catch (IOException ignore) {
+ }
+ } catch (FileNotFoundException e) {
+ throw e;
+ } catch (IOException e) {
+ throw e;
+ }
+ }
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/PropertyTypeTest.java b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/PropertyTypeTest.java
new file mode 100644
index 0000000000..470dd9784a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/PropertyTypeTest.java
@@ -0,0 +1,20 @@
+package org.openecomp.sdc.tosca.datatypes;
+
+import org.openecomp.sdc.tosca.datatypes.model.PropertyType;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class PropertyTypeTest {
+ @Test
+ public void shouldReturnNullWhenDisplayNameDoesNotExistForAnyProperty() {
+ String s = "blabla";
+ Assert.assertEquals(PropertyType.getPropertyTypeByDisplayName(s), null);
+ }
+
+ @Test
+ public void shouldReturnApproppriatePropertyTypeWhenDisplayNameExist() {
+ String s = "scalar-unit.size";
+ Assert
+ .assertEquals(PropertyType.getPropertyTypeByDisplayName(s), PropertyType.SCALAR_UNIT_SIZE);
+ }
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/ToscaModelTest.java b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/ToscaModelTest.java
new file mode 100644
index 0000000000..13b05543fb
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/ToscaModelTest.java
@@ -0,0 +1,282 @@
+package org.openecomp.sdc.tosca.datatypes;
+
+import org.openecomp.sdc.tosca.datatypes.model.ArtifactType;
+import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.CapabilityAssignment;
+import org.openecomp.sdc.tosca.datatypes.model.CapabilityDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.Constraint;
+import org.openecomp.sdc.tosca.datatypes.model.Directive;
+import org.openecomp.sdc.tosca.datatypes.model.Import;
+import org.openecomp.sdc.tosca.datatypes.model.Metadata;
+import org.openecomp.sdc.tosca.datatypes.model.NodeFilter;
+import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.NodeType;
+import org.openecomp.sdc.tosca.datatypes.model.ParameterDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.PropertyType;
+import org.openecomp.sdc.tosca.datatypes.model.RequirementAssignment;
+import org.openecomp.sdc.tosca.datatypes.model.RequirementDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.SubstitutionMapping;
+import org.openecomp.sdc.tosca.datatypes.model.TopologyTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.heatextend.ParameterDefinitionExt;
+import org.openecomp.sdc.tosca.services.DataModelUtil;
+import org.openecomp.sdc.tosca.services.ToscaConstants;
+import org.openecomp.sdc.tosca.services.yamlutil.ToscaExtensionYamlUtil;
+import org.openecomp.core.utilities.yaml.YamlUtil;
+import org.junit.Assert;
+import org.junit.Test;
+
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+
+public class ToscaModelTest {
+
+ @Test
+ public void testServiceTemplateJavaToYaml() {
+
+ ServiceTemplate serviceTemplate = new ServiceTemplate();
+ Metadata metadata = new Metadata();
+ metadata.setTemplate_author("OPENECOMP");
+ metadata.setTemplate_name("Test");
+ metadata.setTemplate_version("1.0.0");
+ serviceTemplate.setTosca_definitions_version("tosca_simple_yaml_1_0_0");
+ serviceTemplate.setDescription("testing desc tosca service template");
+ serviceTemplate.setMetadata(metadata);
+
+ Import fileImport1 = new Import();
+ fileImport1.setFile("path1/path2/file1.yaml");
+ Import fileImport2 = new Import();
+ fileImport2.setFile("path1/path2/file2.yaml");
+ Map<String, Import> imports = new HashMap<>();
+ imports.put("myfile1", fileImport1);
+ imports.put("myfile2", fileImport2);
+ serviceTemplate.setImports(imports);
+
+ ArtifactType artifact = new ArtifactType();
+ artifact.setMime_type("application/java-archive");
+ ArrayList<String> ext = new ArrayList<>();
+ ext.add("yaml");
+ ext.add("xml");
+ artifact.setFile_ext(ext);
+ Map<String, ArtifactType> artifactTypes = new HashMap<>();
+ artifactTypes.put("one_artifact", artifact);
+ serviceTemplate.setArtifact_types(artifactTypes);
+
+ NodeType nodeType = new NodeType();
+ nodeType.setDerived_from("tosca.nodes.Root");
+ nodeType.setVersion("1.0.0");
+ nodeType.setDescription("tosca compute test");
+
+ PropertyDefinition propDef1 = new PropertyDefinition();
+ propDef1.setType("integer");
+ propDef1.setDescription("Number of CPUs requested for a software node instance");
+ propDef1.setRequired(true);
+ propDef1.set_default(1);
+
+ Constraint graterOrEqual = new Constraint();
+ graterOrEqual.setGreater_or_equal((float) 5.0);
+ Constraint constraintEqual = new Constraint();
+ constraintEqual.setEqual(5);
+ Constraint greater_than = new Constraint();
+ greater_than.setGreater_than(6.02);
+ Constraint inRange = new Constraint();
+ inRange.setIn_range(new Object[2]);
+ inRange.getIn_range()[0] = 0;
+ inRange.getIn_range()[1] = ToscaConstants.UNBOUNDED;
+
+ List<Constraint> constraints = new ArrayList<>();
+ constraints.add(graterOrEqual);
+ constraints.add(constraintEqual);
+ constraints.add(greater_than);
+ constraints.add(inRange);
+ propDef1.setConstraints(constraints);
+
+ Map<String, PropertyDefinition> properties = new HashMap<>();
+ properties.put("cpu_num", propDef1);
+ nodeType.setProperties(properties);
+
+ Map<String, AttributeDefinition> attributesDef = new HashMap<>();
+ AttributeDefinition attDef = new AttributeDefinition();
+ attDef.setType(PropertyType.STRING.getDisplayName());
+ attDef.set_default("hi");
+ attributesDef.put("attDef1", attDef);
+ nodeType.setAttributes(attributesDef);
+
+ Map<String, RequirementDefinition> reqsDef = new HashMap<>();
+ RequirementDefinition reqDef = new RequirementDefinition();
+ reqDef.setCapability("tosca.cap1");
+ reqDef.getOccurrences()[0] = 5;
+ reqsDef.put("re1", reqDef);
+ List<Map<String, RequirementDefinition>> reqList = new ArrayList<>();
+ reqList.add(reqsDef);
+ nodeType.setRequirements(reqList);
+
+
+ Map<String, CapabilityDefinition> capsDef = new HashMap<>();
+ CapabilityDefinition capdef = new CapabilityDefinition();
+ capdef.setType("tosca.cap");
+ List<String> vvSource = new ArrayList<>();
+ vvSource.add("node1");
+ vvSource.add("node2");
+ capdef.setValid_source_types(vvSource);
+ capsDef.put("cap1", capdef);
+ nodeType.setCapabilities(capsDef);
+
+ Map<String, NodeType> nodeTypes = new HashMap<>();
+ nodeTypes.put("compute_node_type", nodeType);
+ serviceTemplate.setNode_types(nodeTypes);
+
+ TopologyTemplate topologyTemplate = new TopologyTemplate();
+ topologyTemplate.setDescription("topologi template descroption");
+ Map<String, ParameterDefinition> inputs = new HashMap<>();
+ ParameterDefinition paramDef = new ParameterDefinition();
+ paramDef.setType(PropertyType.STRING.getDisplayName());
+ paramDef.setDescription("desc");
+ paramDef.set_default("my default val");
+ paramDef.setRequired(false);
+ paramDef.setEntry_schema(DataModelUtil.createEntrySchema("tosca.myType", null, null));
+ List<Constraint> paramConstraint = new ArrayList<>();
+ Constraint paramConst1 = new Constraint();
+ paramConst1.setGreater_than(6);
+ Constraint paramConst2 = new Constraint();
+ paramConst2.setGreater_or_equal(9);
+ paramConstraint.add(paramConst1);
+ paramConstraint.add(paramConst2);
+ paramDef.setConstraints(paramConstraint);
+ inputs.put("inParam1", paramDef);
+ topologyTemplate.setInputs(inputs);
+
+ Map<String, NodeTemplate> nodeTemplates = new HashMap<>();
+ NodeTemplate nodeTemplate = new NodeTemplate();
+ nodeTemplate.setType("nodeTypeRef");
+ List<String> directives = new ArrayList<>();
+ directives.add(Directive.SELECTABLE.getDisplayName());
+ directives.add(Directive.SUBSTITUTABLE.getDisplayName());
+ nodeTemplate.setDirectives(directives);
+ Map<String, Object> nodeTemplateProperties = new HashMap<>();
+ nodeTemplateProperties.put("prop1", "abcd");
+ nodeTemplateProperties.put("prop2", "{ get_input: my_mysql_rootpw }");
+ nodeTemplate.setProperties(nodeTemplateProperties);
+ Map<String, Object> nodeTemplateAtts = new HashMap<>();
+ nodeTemplateAtts.put("att1", "att1Val");
+ nodeTemplateAtts.put("att2", "{ get_input: my_mysql_rootpw }");
+ nodeTemplate.setAttributes(nodeTemplateAtts);
+
+
+ RequirementAssignment reqAssignment1 = new RequirementAssignment();
+ reqAssignment1.setNode("nodeA");
+ reqAssignment1.setCapability("capA");
+ reqAssignment1.setRelationship("relationB");
+ Object[] reqAssOccurrences = new Object[2];
+ reqAssOccurrences[0] = 1;
+ reqAssOccurrences[1] = 2;
+ reqAssignment1.setOccurrences(reqAssOccurrences);
+ NodeFilter reqNodeFilter = new NodeFilter();
+ List<Constraint> propConstrain1 = new ArrayList<>();
+ Constraint propConst1 = new Constraint();
+ propConst1.setGreater_or_equal(9);
+ propConstrain1.add(propConst1);
+ List<Constraint> propConstrain2 = new ArrayList<>();
+ Constraint propConst2 = new Constraint();
+ propConst2.setMin_length(1);
+ propConstrain2.add(propConst2);
+ Constraint propConst3 = new Constraint();
+ propConst3.setMax_length(2);
+ propConstrain2.add(propConst3);
+ Map<String, List<Constraint>> nodeFilterProp = new HashMap<>();
+ nodeFilterProp.put("propName1", propConstrain1);
+ nodeFilterProp.put("propName2", propConstrain2);
+ reqNodeFilter.setProperties(nodeFilterProp);
+ reqAssignment1.setNode_filter(reqNodeFilter);
+
+ RequirementAssignment reqAssignment2 = new RequirementAssignment();
+ reqAssignment2.setNode("nodeA");
+ reqAssignment2.setCapability("capA");
+ reqAssignment2.setRelationship("relationB");
+ Map<String, RequirementAssignment> nodeTemplateRequirement1 = new HashMap<>();
+ Map<String, RequirementAssignment> nodeTemplateRequirement2 = new HashMap<>();
+ nodeTemplateRequirement1.put("req1", reqAssignment1);
+ nodeTemplateRequirement2.put("req2", reqAssignment2);
+ nodeTemplate.setRequirements(new ArrayList<>());
+ nodeTemplate.getRequirements().add(nodeTemplateRequirement1);
+ nodeTemplate.getRequirements().add(nodeTemplateRequirement2);
+
+ Map<String, CapabilityAssignment> nodeTemplateCapability = new HashMap<>();
+ CapabilityAssignment capAss = new CapabilityAssignment();
+ Map<String, Object> capProps = new HashMap<>();
+ capProps.put("num_cpus", "{ get_input: cpus }");
+ capAss.setProperties(capProps);
+ Map<String, Object> capAtts = new HashMap<>();
+ capAtts.put("num_cpus", "66");
+ capAss.setAttributes(capAtts);
+ nodeTemplateCapability.put("cap1", capAss);
+ nodeTemplate.setCapabilities(new ArrayList<>());
+ nodeTemplate.getCapabilities().add(nodeTemplateCapability);
+
+ NodeFilter nodeTemplateNodeFilter = new NodeFilter();
+ Map<String, List<Constraint>> ntProp = new HashMap<>();
+ Constraint c1 = new Constraint();
+ c1.setEqual("1 MB");
+ List<Constraint> consList = new ArrayList<>();
+ consList.add(c1);
+ ntProp.put("test1", consList);
+ nodeTemplateNodeFilter.setProperties(ntProp);
+ nodeTemplate.setNode_filter(nodeTemplateNodeFilter);
+ nodeTemplates.put("firatNodeTemplate", nodeTemplate);
+ topologyTemplate.setNode_templates(nodeTemplates);
+
+ SubstitutionMapping subMap = new SubstitutionMapping();
+ subMap.setNode_type("myNodeType.node");
+ Map<String, List<String>> mapCapabilities = new HashMap<>();
+ List<String> NodeCap = new ArrayList<>();
+ NodeCap.add("database");
+ NodeCap.add("database_endpoint");
+ mapCapabilities.put("database_endpoint", NodeCap);
+ subMap.setCapabilities(mapCapabilities);
+ topologyTemplate.setSubstitution_mappings(subMap);
+ serviceTemplate.setTopology_template(topologyTemplate);
+
+ String yaml = new YamlUtil().objectToYaml(serviceTemplate);
+ ServiceTemplate serviceTemplateFromYaml =
+ new YamlUtil().yamlToObject(yaml, ServiceTemplate.class);
+ Assert.assertNotNull(serviceTemplateFromYaml);
+ }
+
+
+ @Test
+ public void testYamlToServiceTemplateObj() {
+ InputStream yamlFile = new YamlUtil().loadYamlFileIs("/mock/model/serviceTemplate.yaml");
+ ServiceTemplate serviceTemplateFromYaml =
+ new YamlUtil().yamlToObject(yamlFile, ServiceTemplate.class);
+ Assert.assertNotNull(serviceTemplateFromYaml);
+ }
+
+
+ @Test
+ public void testYamlToServiceTemplateIncludingHeatExtend() {
+ ToscaExtensionYamlUtil toscaExtensionYamlUtil = new ToscaExtensionYamlUtil();
+ InputStream yamlFile =
+ toscaExtensionYamlUtil.loadYamlFileIs("/mock/model/serviceTemplateHeatExtend.yaml");
+ ServiceTemplate serviceTemplateFromYaml =
+ toscaExtensionYamlUtil.yamlToObject(yamlFile, ServiceTemplate.class);
+ ParameterDefinitionExt parameterDefinitionExt =
+ (ParameterDefinitionExt) serviceTemplateFromYaml.getTopology_template().getInputs()
+ .get("inParam1");
+ Assert.assertNotNull(parameterDefinitionExt.getLabel());
+ String backToYamlString = toscaExtensionYamlUtil.objectToYaml(serviceTemplateFromYaml);
+ Assert.assertNotNull(backToYamlString);
+ }
+
+}
+
+
+
+
+
+
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityDefinitionTest.java b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityDefinitionTest.java
new file mode 100644
index 0000000000..2b0f88fdea
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityDefinitionTest.java
@@ -0,0 +1,101 @@
+package org.openecomp.sdc.tosca.datatypes.model;
+
+import org.openecomp.sdc.tosca.services.ToscaConstants;
+import org.openecomp.core.utilities.yaml.YamlUtil;
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class CapabilityDefinitionTest {
+
+ @Test
+ public void cloneTest() {
+ CapabilityDefinition capDef1 = new CapabilityDefinition();
+ Map<String, AttributeDefinition> attributes = new HashMap<>();
+ attributes.put("key1", getAttributeDefinition());
+ capDef1.setAttributes(attributes);
+
+ capDef1.setDescription("This is my desc");
+ capDef1.setOccurrences(getMockOccurrences());
+
+ Map<String, PropertyDefinition> properties = new HashMap<>();
+ PropertyDefinition propertyDefinition = getMockPropertyDefinition();
+ properties.put("key1", propertyDefinition);
+ capDef1.setProperties(properties);
+ capDef1.setType("My Type");
+ List<String> valid_source_types = new ArrayList<>();
+ valid_source_types.add("nonono");
+ capDef1.setValid_source_types(valid_source_types);
+
+ CapabilityDefinition capDef2 = capDef1.clone();
+ NodeType nodeType = new NodeType();
+ nodeType.setCapabilities(new HashMap<>());
+ nodeType.getCapabilities().put("cap1", capDef1);
+ nodeType.getCapabilities().put("cap2", capDef2);
+
+ String yamlString = new YamlUtil().objectToYaml(nodeType);
+ Boolean passResult = !yamlString.contains("&") && !yamlString.contains("*");
+ Assert.assertEquals(true, passResult);
+ }
+
+ private PropertyDefinition getMockPropertyDefinition() {
+ PropertyDefinition propertyDefinition = new PropertyDefinition();
+ propertyDefinition.setConstraints(getMockConstraints());
+ propertyDefinition.setDescription("desc");
+ propertyDefinition.setType("typeProp");
+ propertyDefinition.set_default(5);
+ propertyDefinition.setEntry_schema(getMockEntrySchema());
+ propertyDefinition.setRequired(false);
+ propertyDefinition.setStatus(Status.UNSUPPORTED);
+ return propertyDefinition;
+ }
+
+ private Object[] getMockOccurrences() {
+ Object[] occurrences = new Object[2];
+ occurrences[0] = 2;
+ occurrences[1] = ToscaConstants.UNBOUNDED;
+ return occurrences;
+ }
+
+ private ArtifactDefinition getMockArtifactDefinition() {
+ ArtifactDefinition artifactDefinition = new ArtifactDefinition();
+ artifactDefinition.setType("type1");
+ artifactDefinition.setDescription("description of OPENECOMP def");
+ artifactDefinition.setDeploy_path("my deployment path");
+ artifactDefinition.setFile("my file");
+ artifactDefinition.setRepository("my repository");
+ return artifactDefinition;
+ }
+
+ private AttributeDefinition getAttributeDefinition() {
+ AttributeDefinition attributeDefinition = new AttributeDefinition();
+ attributeDefinition.setDescription("desc1");
+ attributeDefinition.setType("type1");
+ attributeDefinition.set_default("none");
+ attributeDefinition.setEntry_schema(getMockEntrySchema());
+ attributeDefinition.setStatus(Status.UNSUPPORTED);
+ return attributeDefinition;
+ }
+
+ private EntrySchema getMockEntrySchema() {
+ EntrySchema entrySchema = new EntrySchema();
+ entrySchema.setType("string");
+ entrySchema.setDescription("string for string");
+ List<Constraint> constraints = getMockConstraints();
+ entrySchema.setConstraints(constraints);
+ return entrySchema;
+ }
+
+ private List<Constraint> getMockConstraints() {
+ List<Constraint> constraints = new ArrayList<>();
+ Constraint constraint = new Constraint();
+ constraint.setEqual("5");
+ constraints.add(constraint);
+ return constraints;
+ }
+
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/model/RequirementDefinitionTest.java b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/model/RequirementDefinitionTest.java
new file mode 100644
index 0000000000..3109a8abff
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/model/RequirementDefinitionTest.java
@@ -0,0 +1,40 @@
+package org.openecomp.sdc.tosca.datatypes.model;
+
+import org.openecomp.core.utilities.yaml.YamlUtil;
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class RequirementDefinitionTest {
+
+ @Test
+ public void cloneTest() {
+ RequirementDefinition reqDef1 = new RequirementDefinition();
+ reqDef1.setNode("node1");
+ reqDef1.setRelationship("my Relationship");
+ reqDef1.setCapability("capabilities");
+ reqDef1.setOccurrences(new Object[]{1, 1});
+
+ RequirementDefinition reqDef2 = reqDef1.clone();
+ NodeType nodeType = new NodeType();
+
+ List<Map<String, RequirementDefinition>> requirements = new ArrayList<>();
+ Map<String, RequirementDefinition> reqMap1 = new HashMap<>();
+ reqMap1.put("req1", reqDef1);
+ requirements.add(reqMap1);
+ Map<String, RequirementDefinition> reqMap2 = new HashMap<>();
+ reqMap2.put("req2", reqDef2);
+ requirements.add(reqMap2);
+ nodeType.setRequirements(requirements);
+
+ String yamlString = new YamlUtil().objectToYaml(nodeType);
+ Boolean passResult = !yamlString.contains("&") && !yamlString.contains("*");
+ Assert.assertEquals(true, passResult);
+ }
+
+
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/DataModelUtilTest.java b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/DataModelUtilTest.java
new file mode 100644
index 0000000000..893f7a1a5e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/DataModelUtilTest.java
@@ -0,0 +1,104 @@
+package org.openecomp.sdc.tosca.services;
+
+import org.openecomp.sdc.common.errors.CoreException;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.junit.runner.RunWith;
+import org.mockito.runners.MockitoJUnitRunner;
+import org.openecomp.sdc.tosca.datatypes.model.GroupDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.NodeType;
+import org.openecomp.sdc.tosca.datatypes.model.PolicyDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.RelationshipTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.RequirementAssignment;
+import org.openecomp.sdc.tosca.datatypes.model.SubstitutionMapping;
+
+import java.util.ArrayList;
+
+@RunWith(MockitoJUnitRunner.class)
+public class DataModelUtilTest {
+
+ @Rule
+ public ExpectedException thrown = ExpectedException.none();
+
+ @Test
+ public void testAddSubstitutionMapping() throws Exception {
+ thrown.expect(CoreException.class);
+ thrown.expectMessage(
+ "Invalid action, can't add 'Substitution Mapping' to 'Service Template', 'Service Template' entity is NULL.");
+ DataModelUtil.addSubstitutionMapping(null, new SubstitutionMapping());
+ }
+
+ @Test
+ public void testAddSubstitutionMappingReq() throws Exception {
+ thrown.expect(CoreException.class);
+ thrown.expectMessage(
+ "Invalid action, can't add 'Substitution Mapping Requirements' to 'Service Template', 'Service Template' entity is NULL.");
+ DataModelUtil.addSubstitutionMappingReq(null, "123", new ArrayList<>());
+ }
+
+ @Test
+ public void testAddNodeTemplate() throws Exception {
+ thrown.expect(CoreException.class);
+ thrown.expectMessage(
+ "Invalid action, can't add 'Node Template' to 'Service Template', 'Service Template' entity is NULL.");
+ DataModelUtil.addNodeTemplate(null, "123", new NodeTemplate());
+ }
+
+ @Test
+ public void testAddPolicyDefinition() throws Exception {
+ thrown.expect(CoreException.class);
+ thrown.expectMessage(
+ "Invalid action, can't add 'Policy Definition' to 'Service Template', 'Service Template' entity is NULL.");
+ DataModelUtil.addPolicyDefinition(null, "123", new PolicyDefinition());
+ }
+
+ @Test
+ public void testAddNodeType() throws Exception {
+ thrown.expect(CoreException.class);
+ thrown.expectMessage(
+ "Invalid action, can't add 'Node Type' to 'Service Template', 'Service Template' entity is NULL.");
+ DataModelUtil.addNodeType(null, "123", new NodeType());
+ }
+
+ @Test
+ public void testAddRelationshipTemplate() throws Exception {
+ thrown.expect(CoreException.class);
+ thrown.expectMessage(
+ "Invalid action, can't add 'Relationship Template' to 'Service Template', 'Service Template' entity is NULL.");
+ DataModelUtil.addRelationshipTemplate(null, "123", new RelationshipTemplate());
+ }
+
+ @Test
+ public void testAddRequirementAssignment() throws Exception {
+ thrown.expect(CoreException.class);
+ thrown.expectMessage(
+ "Invalid action, can't add 'Requirement Assignment' to 'Node Template', 'Node Template' entity is NULL.");
+ DataModelUtil.addRequirementAssignment(null, "123", new RequirementAssignment());
+ }
+
+ @Test
+ public void testGetNodeTemplate() throws Exception {
+ thrown.expect(CoreException.class);
+ thrown.expectMessage(
+ "Invalid action, can't add 'Node Template' to 'Service Template', 'Service Template' entity is NULL.");
+ DataModelUtil.addNodeTemplate(null, "123", new NodeTemplate());
+ }
+
+ @Test
+ public void testGetNodeType() throws Exception {
+ thrown.expect(CoreException.class);
+ thrown.expectMessage(
+ "Invalid action, can't add 'Node Type' to 'Service Template', 'Service Template' entity is NULL.");
+ DataModelUtil.addNodeType(null, "123", new NodeType());
+ }
+
+ @Test
+ public void testAddGroupToTopologyTemplate() throws Exception {
+ thrown.expect(CoreException.class);
+ thrown.expectMessage(
+ "Invalid action, can't add 'Group Definition' to 'Service Template', 'Service Template' entity is NULL.");
+ DataModelUtil.addGroupDefinitionToTopologyTemplate(null, "123", new GroupDefinition());
+ }
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImplTest.java b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImplTest.java
new file mode 100644
index 0000000000..47f0bd9aef
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImplTest.java
@@ -0,0 +1,472 @@
+package org.openecomp.sdc.tosca.services.impl;
+
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.tosca.TestUtil;
+import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
+import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
+import org.openecomp.sdc.tosca.services.ToscaAnalyzerService;
+import org.openecomp.sdc.tosca.services.ToscaConstants;
+import org.openecomp.sdc.tosca.services.yamlutil.ToscaExtensionYamlUtil;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.mockito.runners.MockitoJUnitRunner;
+import org.openecomp.sdc.tosca.datatypes.model.Import;
+import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.NodeType;
+import org.openecomp.sdc.tosca.datatypes.model.RequirementAssignment;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.SubstitutionMapping;
+import org.openecomp.sdc.tosca.datatypes.model.TopologyTemplate;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+
+import static org.junit.Assert.*;
+import static org.mockito.Mockito.when;
+
+@RunWith(MockitoJUnitRunner.class)
+public class ToscaAnalyzerServiceImplTest {
+ /*
+ Dictionary:
+ SrvTmp: ServiceTemplate
+ NdTmp: NodeTemplate
+ NdTy: NodeType
+ */
+
+ private static ToscaAnalyzerService toscaAnalyzerService;
+ private static ToscaServiceModel toscaServiceModel;
+ @Rule
+ public ExpectedException thrown = ExpectedException.none();
+
+ @Mock
+ NodeTemplate nodeTemplateMock;
+ @Mock
+ ToscaServiceModel toscaServiceModelMock;
+
+ @BeforeClass
+ public static void onlyOnceSetUp() throws IOException {
+ toscaAnalyzerService = new ToscaAnalyzerServiceImpl();
+ toscaServiceModel = TestUtil.loadToscaServiceModel("/mock/analyzerService/toscasubstitution/",
+ "/mock/globalServiceTemplates/", null);
+ }
+
+ @Before
+ public void init() throws IOException {
+ MockitoAnnotations.initMocks(this);
+ }
+
+ @Test
+ public void testGetRequirements() throws Exception {
+ ToscaExtensionYamlUtil toscaExtensionYamlUtil = new ToscaExtensionYamlUtil();
+ InputStream yamlFile = toscaExtensionYamlUtil
+ .loadYamlFileIs("/mock/analyzerService/NestedServiceTemplateReqTest.yaml");
+ ServiceTemplate serviceTemplateFromYaml =
+ toscaExtensionYamlUtil.yamlToObject(yamlFile, ServiceTemplate.class);
+
+ NodeTemplate port_0 =
+ serviceTemplateFromYaml.getTopology_template().getNode_templates().get("cmaui_port_0");
+ List<RequirementAssignment> reqList =
+ toscaAnalyzerService.getRequirements(port_0, ToscaConstants.BINDING_REQUIREMENT_ID);
+ assertEquals(1, reqList.size());
+
+ reqList.clear();
+ NodeTemplate port_1 =
+ serviceTemplateFromYaml.getTopology_template().getNode_templates().get("cmaui1_port_1");
+ reqList = toscaAnalyzerService.getRequirements(port_1, ToscaConstants.LINK_REQUIREMENT_ID);
+ assertEquals(2, reqList.size());
+
+ reqList.clear();
+ reqList = toscaAnalyzerService.getRequirements(port_0, ToscaConstants.LINK_REQUIREMENT_ID);
+ assertEquals(0, reqList.size());
+ }
+
+ @Test
+ public void testGetNodeTemplateById() throws Exception {
+ ServiceTemplate emptyServiceTemplate = new ServiceTemplate();
+ Optional<NodeTemplate> nodeTemplate =
+ toscaAnalyzerService.getNodeTemplateById(emptyServiceTemplate, "test_net222");
+ assertEquals(false, nodeTemplate.isPresent());
+
+ ServiceTemplate mainServiceTemplate = toscaServiceModel.getServiceTemplates()
+ .get(toscaServiceModel.getEntryDefinitionServiceTemplate());
+ nodeTemplate = toscaAnalyzerService.getNodeTemplateById(mainServiceTemplate, "test_net");
+ assertEquals(true, nodeTemplate.isPresent());
+
+ nodeTemplate = toscaAnalyzerService.getNodeTemplateById(mainServiceTemplate, "test_net222");
+ assertEquals(false, nodeTemplate.isPresent());
+ }
+
+ @Test
+ public void testGetSubstituteServiceTemplateName() throws Exception {
+ thrown.expect(CoreException.class);
+ thrown.expectMessage(
+ "Invalid Substitute Node Template invalid2, mandatory map property service_template_filter with mandatory key substitute_service_template must be defined.");
+
+ ServiceTemplate mainServiceTemplate = toscaServiceModel.getServiceTemplates()
+ .get(toscaServiceModel.getEntryDefinitionServiceTemplate());
+ Optional<NodeTemplate> notSubstitutableNodeTemplate =
+ toscaAnalyzerService.getNodeTemplateById(mainServiceTemplate, "test_net");
+ Optional<String> substituteServiceTemplateName = toscaAnalyzerService
+ .getSubstituteServiceTemplateName("test_net", notSubstitutableNodeTemplate.get());
+ assertEquals(false, substituteServiceTemplateName.isPresent());
+
+ Optional<NodeTemplate> substitutableNodeTemplate =
+ toscaAnalyzerService.getNodeTemplateById(mainServiceTemplate, "test_nested");
+ substituteServiceTemplateName = toscaAnalyzerService
+ .getSubstituteServiceTemplateName("test_nested", substitutableNodeTemplate.get());
+ assertEquals(true, substituteServiceTemplateName.isPresent());
+ assertEquals("nestedServiceTemplate.yaml", substituteServiceTemplateName.get());
+
+ NodeTemplate invalidSubstitutableNodeTemplate1 = new NodeTemplate();
+ substituteServiceTemplateName = toscaAnalyzerService
+ .getSubstituteServiceTemplateName("invalid1", invalidSubstitutableNodeTemplate1);
+ assertEquals(false, substituteServiceTemplateName.isPresent());
+
+
+ NodeTemplate invalidSubstitutableNodeTemplate2 = substitutableNodeTemplate.get();
+ Object serviceTemplateFilter = invalidSubstitutableNodeTemplate2.getProperties()
+ .get(ToscaConstants.SERVICE_TEMPLATE_FILTER_PROPERTY_NAME);
+ ((Map) serviceTemplateFilter).clear();
+ toscaAnalyzerService
+ .getSubstituteServiceTemplateName("invalid2", invalidSubstitutableNodeTemplate2);
+
+
+ }
+
+
+ @Test
+ public void testGetSubstitutableNodeTemplates() throws Exception {
+ ToscaExtensionYamlUtil toscaExtensionYamlUtil = new ToscaExtensionYamlUtil();
+ InputStream yamlFile = toscaExtensionYamlUtil
+ .loadYamlFileIs("/mock/analyzerService/ServiceTemplateSubstituteTest.yaml");
+ ServiceTemplate serviceTemplateFromYaml =
+ toscaExtensionYamlUtil.yamlToObject(yamlFile, ServiceTemplate.class);
+
+ Map<String, NodeTemplate> substitutableNodeTemplates =
+ toscaAnalyzerService.getSubstitutableNodeTemplates(serviceTemplateFromYaml);
+ assertEquals(2, substitutableNodeTemplates.size());
+ assertNotNull(substitutableNodeTemplates.get("test_nested1"));
+ assertNotNull(substitutableNodeTemplates.get("test_nested2"));
+
+ ServiceTemplate emptyServiceTemplate = new ServiceTemplate();
+ emptyServiceTemplate.setTopology_template(new TopologyTemplate());
+ substitutableNodeTemplates =
+ toscaAnalyzerService.getSubstitutableNodeTemplates(emptyServiceTemplate);
+ assertEquals(0, substitutableNodeTemplates.size());
+
+ yamlFile = toscaExtensionYamlUtil
+ .loadYamlFileIs("/mock/analyzerService/NestedServiceTemplateReqTest.yaml");
+ serviceTemplateFromYaml = toscaExtensionYamlUtil.yamlToObject(yamlFile, ServiceTemplate.class);
+ substitutableNodeTemplates =
+ toscaAnalyzerService.getSubstitutableNodeTemplates(serviceTemplateFromYaml);
+ assertEquals(0, substitutableNodeTemplates.size());
+ }
+
+ @Test
+ public void testGetSubstitutionMappedNodeTemplateByExposedReq() throws Exception {
+ thrown.expect(CoreException.class);
+ thrown.expectMessage(
+ "Invalid Tosca model data, missing 'Node Template' entry for 'Node Template' id cmaui_port_9");
+ ToscaExtensionYamlUtil toscaExtensionYamlUtil = new ToscaExtensionYamlUtil();
+ InputStream yamlFile = toscaExtensionYamlUtil
+ .loadYamlFileIs("/mock/analyzerService/NestedServiceTemplateReqTest.yaml");
+ ServiceTemplate nestedServiceTemplateFromYaml =
+ toscaExtensionYamlUtil.yamlToObject(yamlFile, ServiceTemplate.class);
+
+ Optional<Map.Entry<String, NodeTemplate>> mappedNodeTemplate = toscaAnalyzerService
+ .getSubstitutionMappedNodeTemplateByExposedReq("NestedServiceTemplateSubstituteTest.yaml",
+ nestedServiceTemplateFromYaml, "local_storage_server_cmaui");
+ assertEquals("server_cmaui", mappedNodeTemplate.get().getKey());
+ assertNotNull(mappedNodeTemplate.get().getValue());
+
+ mappedNodeTemplate = toscaAnalyzerService
+ .getSubstitutionMappedNodeTemplateByExposedReq("NestedServiceTemplateSubstituteTest.yaml",
+ nestedServiceTemplateFromYaml, "link_cmaui_port_invalid");
+ assertEquals("server_cmaui", mappedNodeTemplate.get().getKey());
+ assertNotNull(mappedNodeTemplate.get().getValue());
+
+ ServiceTemplate mainServiceTemplate = toscaServiceModel.getServiceTemplates()
+ .get(toscaServiceModel.getEntryDefinitionServiceTemplate());
+ mappedNodeTemplate = toscaAnalyzerService.getSubstitutionMappedNodeTemplateByExposedReq(
+ toscaServiceModel.getEntryDefinitionServiceTemplate(), mainServiceTemplate,
+ "local_storage_server_cmaui");
+ assertEquals(false, mappedNodeTemplate.isPresent());
+ }
+
+ @Test
+ public void invalidSubstitutableMapping() throws Exception {
+ thrown.expect(CoreException.class);
+ thrown.expectMessage(
+ "Invalid Substitution Service Template invalidMappingServiceTemplate.yaml, missing mandatory file 'Node type' in substitution mapping.");
+ ServiceTemplate invalidMappingServiceTemplate = new ServiceTemplate();
+ invalidMappingServiceTemplate.setTopology_template(new TopologyTemplate());
+ invalidMappingServiceTemplate.getTopology_template()
+ .setSubstitution_mappings(new SubstitutionMapping());
+ toscaAnalyzerService
+ .getSubstitutionMappedNodeTemplateByExposedReq("invalidMappingServiceTemplate.yaml",
+ invalidMappingServiceTemplate, "local_storage_server_cmaui");
+ }
+
+ @Test
+ public void substitutableMappingWithNoReqMap() throws Exception {
+ ServiceTemplate mainServiceTemplate = toscaServiceModel.getServiceTemplates()
+ .get(toscaServiceModel.getEntryDefinitionServiceTemplate());
+ ServiceTemplate emptyReqMapping = new ServiceTemplate();
+ emptyReqMapping.setTopology_template(new TopologyTemplate());
+ emptyReqMapping.getTopology_template().setSubstitution_mappings(new SubstitutionMapping());
+ emptyReqMapping.getTopology_template().getSubstitution_mappings().setNode_type("temp");
+ Optional<Map.Entry<String, NodeTemplate>> mappedNodeTemplate = toscaAnalyzerService
+ .getSubstitutionMappedNodeTemplateByExposedReq(
+ toscaServiceModel.getEntryDefinitionServiceTemplate(), mainServiceTemplate,
+ "local_storage_server_cmaui");
+ assertEquals(false, mappedNodeTemplate.isPresent());
+ }
+
+ @Test
+ public void testGetSubstitutionMappedNodeTemplateByExposedReqInvalid() throws Exception {
+ thrown.expect(CoreException.class);
+ thrown.expectMessage(
+ "Invalid Tosca model data, missing 'Node Template' entry for 'Node Template' id cmaui_port_9");
+ ToscaExtensionYamlUtil toscaExtensionYamlUtil = new ToscaExtensionYamlUtil();
+ InputStream yamlFile = toscaExtensionYamlUtil
+ .loadYamlFileIs("/mock/analyzerService/NestedServiceTemplateReqTest.yaml");
+ ServiceTemplate nestedServiceTemplateFromYaml =
+ toscaExtensionYamlUtil.yamlToObject(yamlFile, ServiceTemplate.class);
+
+ toscaAnalyzerService
+ .getSubstitutionMappedNodeTemplateByExposedReq("NestedServiceTemplateSubstituteTest.yaml",
+ nestedServiceTemplateFromYaml, "link_cmaui_port_invalid");
+ }
+
+ @Test
+ public void testIsDesiredRequirementAssignmentMatch() throws Exception {
+
+ RequirementAssignment requirementAssignment = new RequirementAssignment();
+ String capability = "Test.Capability";
+ String node = "Test.node";
+ String relationship = "Test.relationship";
+ requirementAssignment.setCapability(capability);
+ requirementAssignment.setNode(node);
+ requirementAssignment.setRelationship(relationship);
+
+ assertEquals(true, toscaAnalyzerService
+ .isDesiredRequirementAssignment(requirementAssignment, capability, node, relationship));
+ assertEquals(true, toscaAnalyzerService
+ .isDesiredRequirementAssignment(requirementAssignment, null, node, relationship));
+ assertEquals(true, toscaAnalyzerService
+ .isDesiredRequirementAssignment(requirementAssignment, capability, null, relationship));
+ assertEquals(true, toscaAnalyzerService
+ .isDesiredRequirementAssignment(requirementAssignment, capability, node, null));
+ assertEquals(true, toscaAnalyzerService
+ .isDesiredRequirementAssignment(requirementAssignment, null, null, relationship));
+ assertEquals(true, toscaAnalyzerService
+ .isDesiredRequirementAssignment(requirementAssignment, capability, null, null));
+ assertEquals(true, toscaAnalyzerService
+ .isDesiredRequirementAssignment(requirementAssignment, null, node, null));
+
+ }
+
+ @Test
+ public void testIsDesiredRequirementAssignmentNoMatch() throws Exception {
+
+ RequirementAssignment requirementAssignment = new RequirementAssignment();
+ String capability = "Test.Capability";
+ String node = "Test.node";
+ String relationship = "Test.relationship";
+ requirementAssignment.setCapability(capability);
+ requirementAssignment.setNode(node);
+ requirementAssignment.setRelationship(relationship);
+
+ assertEquals(false, toscaAnalyzerService
+ .isDesiredRequirementAssignment(requirementAssignment, "no", node, relationship));
+ assertEquals(false, toscaAnalyzerService
+ .isDesiredRequirementAssignment(requirementAssignment, "no", "no", relationship));
+ assertEquals(false, toscaAnalyzerService
+ .isDesiredRequirementAssignment(requirementAssignment, "no", "no", "no"));
+ assertEquals(false, toscaAnalyzerService
+ .isDesiredRequirementAssignment(requirementAssignment, capability, "no", relationship));
+ assertEquals(false, toscaAnalyzerService
+ .isDesiredRequirementAssignment(requirementAssignment, capability, node, "no"));
+ assertEquals(false, toscaAnalyzerService
+ .isDesiredRequirementAssignment(requirementAssignment, capability, "no", "no"));
+ assertEquals(false, toscaAnalyzerService
+ .isDesiredRequirementAssignment(requirementAssignment, "no", null, null));
+ assertEquals(false, toscaAnalyzerService
+ .isDesiredRequirementAssignment(requirementAssignment, null, null, null));
+
+
+ }
+
+ @Test
+ public void shouldReturnFalseIfNdTmpIsNull() {
+ assertFalse(toscaAnalyzerService
+ .isTypeOf(null, ToscaNodeType.NETWORK.getDisplayName(), new ServiceTemplate(),
+ toscaServiceModelMock));
+ }
+
+ @Test
+ public void shouldReturnTrueIfNdTmpTypeIsOfRequestedType() {
+ NodeTemplate nodeTemplate = new NodeTemplate();
+ ToscaNodeType nodeTypeToSearch = ToscaNodeType.BLOCK_STORAGE;
+ nodeTemplate.setType(nodeTypeToSearch.getDisplayName());
+ assertTrue(toscaAnalyzerService
+ .isTypeOf(nodeTemplate, nodeTypeToSearch.getDisplayName(), new ServiceTemplate(),
+ toscaServiceModelMock));
+ }
+
+ @Test
+ public void shouldReturnTrueIfNdTmpTypeIsFoundInSrvTmpNdTyAndNdTyDerivedFromRequestedType() {
+ String typeToMatch = ToscaNodeType.CINDER_VOLUME.getDisplayName();
+ when(nodeTemplateMock.getType()).thenReturn(typeToMatch);
+ Map<String, NodeType> stNodeTypes = new HashMap<>();
+ addNodeType(stNodeTypes, ToscaNodeType.COMPUTE.getDisplayName(), new NodeType());
+ NodeType nodeType = createNodeType(ToscaNodeType.BLOCK_STORAGE.getDisplayName());
+ addNodeType(stNodeTypes, typeToMatch, nodeType);
+ ServiceTemplate serviceTemplate = new ServiceTemplate();
+ serviceTemplate.setNode_types(stNodeTypes);
+ assertTrue(toscaAnalyzerService
+ .isTypeOf(nodeTemplateMock, ToscaNodeType.BLOCK_STORAGE.getDisplayName(), serviceTemplate,
+ toscaServiceModelMock));
+
+ }
+
+ @Test
+ public void shouldThrowCoreExceptionForInvalidNodeType() {
+ thrown.expect(CoreException.class);
+ thrown.expectMessage(
+ "NodeType 'AAA' or one of its derivedFrom node type hierarchy, is not defined in tosca service model");
+ when(nodeTemplateMock.getType()).thenReturn("AAA");
+ Map<String, NodeType> stNodeTypes = new HashMap<>();
+ addNodeType(stNodeTypes, "notImportant", new NodeType());
+ ServiceTemplate serviceTemplate = new ServiceTemplate();
+ serviceTemplate.setNode_types(stNodeTypes);
+ toscaAnalyzerService
+ .isTypeOf(nodeTemplateMock, ToscaNodeType.COMPUTE.getDisplayName(), serviceTemplate,
+ toscaServiceModelMock);
+ }
+
+ @Test
+ public void shouldThrowCoreExceptionForInvalidNodeType2Level() {
+ thrown.expect(CoreException.class);
+ thrown.expectMessage(
+ "NodeType 'A' or one of its derivedFrom node type hierarchy, is not defined in tosca service model");
+ String typeToMatch = "A";
+ when(nodeTemplateMock.getType()).thenReturn(typeToMatch);
+ Map<String, NodeType> stNodeTypes = new HashMap<>();
+ addNodeType(stNodeTypes, "notImportant", new NodeType());
+ addNodeType(stNodeTypes, "A", createNodeType("ADerivedFromB"));
+ addNodeType(stNodeTypes, "ADerivedFromB'", createNodeType("BDerivedFromC"));
+ ServiceTemplate serviceTemplate = new ServiceTemplate();
+ serviceTemplate.setNode_types(stNodeTypes);
+ assertTrue(toscaAnalyzerService
+ .isTypeOf(nodeTemplateMock, "BDerivedFromC", serviceTemplate, toscaServiceModelMock));
+ }
+
+ @Test
+ public void shouldReturnTrueIfNdTmpTypeIsFoundInSrvTmpNdTyAndNotDerivedFromRequestedTypeBut2ndLevelDerivedFromMatch() {
+ String typeToMatch = "A";
+ when(nodeTemplateMock.getType()).thenReturn(typeToMatch);
+ Map<String, NodeType> stNodeTypes = new HashMap<>();
+ addNodeType(stNodeTypes, "notImportant", new NodeType());
+ addNodeType(stNodeTypes, "A", createNodeType("ADerivedFromB"));
+ addNodeType(stNodeTypes, "ADerivedFromB", createNodeType("BDerivedFromC"));
+ ServiceTemplate serviceTemplate = new ServiceTemplate();
+ serviceTemplate.setNode_types(stNodeTypes);
+ assertTrue(toscaAnalyzerService
+ .isTypeOf(nodeTemplateMock, "BDerivedFromC", serviceTemplate, toscaServiceModelMock));
+ }
+
+ private NodeType createNodeType(String derivedFrom) {
+ NodeType nodeType = new NodeType();
+ nodeType.setDerived_from(derivedFrom);
+ return nodeType;
+ }
+
+ private void addNodeType(Map<String, NodeType> stNodeTypes, String key, NodeType nodeType) {
+ stNodeTypes.put(key, nodeType);
+ }
+
+ @Test
+ public void shouldReturnTrueIfNdTmpTypeIsFoundInSrvTmpNdTyButRequestedTypeNotMatchButFoundIn1stLevelImports() {
+ String typeToMatch = ToscaNodeType.CINDER_VOLUME.getDisplayName();
+ when(nodeTemplateMock.getType()).thenReturn(typeToMatch);
+ ServiceTemplate mainST = new ServiceTemplate();
+ Map<String, Import> imports = new HashMap<>();
+ Import anImport = new Import();
+ anImport.setFile("mainImport");
+ imports.put("bla bla", anImport);
+ mainST.setImports(imports);
+
+ //create searchable service template
+ Map<String, NodeType> stNodeTypes = new HashMap<>();
+ addNodeType(stNodeTypes, ToscaNodeType.COMPUTE.getDisplayName(), new NodeType());
+ NodeType nodeType = createNodeType(ToscaNodeType.BLOCK_STORAGE.getDisplayName());
+ addNodeType(stNodeTypes, typeToMatch, nodeType);
+ ServiceTemplate serviceTemplate = new ServiceTemplate();
+ serviceTemplate.setNode_types(stNodeTypes);
+
+ // add service templates to tosca service model
+ Map<String, ServiceTemplate> serviceTemplates = toscaServiceModelMock.getServiceTemplates();
+ serviceTemplates.put("testMainServiceTemplate", mainST);
+ serviceTemplates.put("mainImport", serviceTemplate);
+ when(toscaServiceModelMock.getServiceTemplates()).thenReturn(serviceTemplates);
+
+ assertTrue(toscaAnalyzerService
+ .isTypeOf(nodeTemplateMock, ToscaNodeType.BLOCK_STORAGE.getDisplayName(), mainST,
+ toscaServiceModelMock));
+ }
+
+ @Test
+ public void shouldReturnTrueIfNdTmpTypeIsFoundInSrvTmpNdTyButRequestedTypeNotMatchButFoundIn2ndLevelImports() {
+ String typeToMatch = ToscaNodeType.CINDER_VOLUME.getDisplayName();
+ when(nodeTemplateMock.getType()).thenReturn(typeToMatch);
+ ServiceTemplate mainST = new ServiceTemplate();
+ Map<String, Import> imports = new HashMap<>();
+ Import anImport = new Import();
+ anImport.setFile("refToMainImport");
+ imports.put("bla bla", anImport);
+ mainST.setImports(imports);
+
+ //create searchable service template
+ Map<String, NodeType> stNodeTypes = new HashMap<>();
+ addNodeType(stNodeTypes, ToscaNodeType.COMPUTE.getDisplayName(), new NodeType());
+ NodeType nodeType = createNodeType(ToscaNodeType.BLOCK_STORAGE.getDisplayName());
+ addNodeType(stNodeTypes, typeToMatch, nodeType);
+ ServiceTemplate serviceTemplate = new ServiceTemplate();
+ serviceTemplate.setNode_types(stNodeTypes);
+
+ // create 1st level service template with import only
+ ServiceTemplate firstLevelST = new ServiceTemplate();
+ Map<String, Import> firstLevelImports = new HashMap<>();
+ Import firstLevelImport = new Import();
+ firstLevelImport.setFile("mainImport");
+ firstLevelImports.put("bla bla 2", firstLevelImport);
+
+ firstLevelST.setImports(firstLevelImports);
+
+ // add service templates to tosca service model
+ Map<String, ServiceTemplate> serviceTemplates = toscaServiceModelMock.getServiceTemplates();
+ serviceTemplates.put("testMainServiceTemplate", mainST);
+ serviceTemplates.put("refToMainImport", firstLevelST);
+ serviceTemplates.put("mainImport", serviceTemplate);
+ when(toscaServiceModelMock.getServiceTemplates()).thenReturn(serviceTemplates);
+
+ assertTrue(toscaAnalyzerService
+ .isTypeOf(nodeTemplateMock, ToscaNodeType.BLOCK_STORAGE.getDisplayName(), mainST,
+ toscaServiceModelMock));
+ }
+
+ // not found at all should throw core exception
+
+
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/impl/ToscaFileOutputServiceCsarImplTest.java b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/impl/ToscaFileOutputServiceCsarImplTest.java
new file mode 100644
index 0000000000..963b8a6f57
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/impl/ToscaFileOutputServiceCsarImplTest.java
@@ -0,0 +1,150 @@
+package org.openecomp.sdc.tosca.services.impl;
+
+import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
+import org.openecomp.sdc.tosca.datatypes.model.Metadata;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.tosca.services.ToscaUtil;
+import org.openecomp.core.utilities.file.FileContentHandler;
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+public class ToscaFileOutputServiceCsarImplTest {
+
+ private ToscaFileOutputServiceCsarImpl toscaFileOutputServiceCsarImpl =
+ new ToscaFileOutputServiceCsarImpl();
+
+ @Test
+ public void testCreationMetaFile() {
+ String createdMeta = toscaFileOutputServiceCsarImpl.createMetaFile("entryFile.yaml");
+ String expectedMeta =
+ "TOSCA-Meta-File-Version: 1.0\n" +
+ "CSAR-Version: 1.1\n" +
+ "Created-By: ASDC Onboarding portal\n" +
+ "Entry-Definitions: Definitions" + File.separator + "entryFile.yaml";
+ Assert.assertEquals(createdMeta.replaceAll("\\s+", ""), expectedMeta.replaceAll("\\s+", ""));
+ }
+
+ @Test
+ public void testCSARFileCreationWithExternalArtifacts() throws IOException {
+ ServiceTemplate mainServiceTemplate = new ServiceTemplate();
+ Metadata metadata1 = new Metadata();
+ metadata1.setTemplate_author("OPENECOMP");
+ metadata1.setTemplate_name("ST1");
+ metadata1.setTemplate_version("1.0.0");
+ mainServiceTemplate.setTosca_definitions_version("tosca_simple_yaml_1_0_0");
+ mainServiceTemplate.setDescription("testing desc tosca service template");
+ mainServiceTemplate.setMetadata(metadata1);
+
+ ServiceTemplate additionalServiceTemplate = new ServiceTemplate();
+ Metadata metadata2 = new Metadata();
+ metadata2.setTemplate_author("OPENECOMP");
+ metadata2.setTemplate_name("ST2");
+ metadata2.setTemplate_version("1.0.0");
+ additionalServiceTemplate.setTosca_definitions_version("tosca_simple_yaml_1_0_0");
+ additionalServiceTemplate.setDescription("testing desc tosca service template");
+ additionalServiceTemplate.setMetadata(metadata2);
+
+ Map<String, ServiceTemplate> definitionsInput = new HashMap<>();
+ definitionsInput
+ .put(ToscaUtil.getServiceTemplateFileName(mainServiceTemplate), mainServiceTemplate);
+ definitionsInput.put(ToscaUtil.getServiceTemplateFileName(additionalServiceTemplate),
+ additionalServiceTemplate);
+
+
+ Map<String, byte[]> dummyHeatArtifacts = new HashMap<>();
+ String file1Content = "this is file number 1";
+ String file2Content = "this is file number 2";
+ String file1 = "file1.xml";
+ dummyHeatArtifacts.put(file1, file1Content.getBytes());
+ String file2 = "file2.yml";
+ dummyHeatArtifacts.put(file2, file2Content.getBytes());
+
+
+ FileContentHandler heatFiles = new FileContentHandler();
+ heatFiles.putAll(dummyHeatArtifacts);
+ Map<String, byte[]> licenseArtifacts = new HashMap<>();
+
+ FileContentHandler licenseArtifactsFiles = new FileContentHandler();
+
+ licenseArtifacts.put(
+ ToscaFileOutputServiceCsarImpl.EXTERNAL_ARTIFACTS_FOLDER_NAME + File.separator +
+ "license-file-1.xml", file1Content.getBytes());
+ licenseArtifacts.put(
+ ToscaFileOutputServiceCsarImpl.EXTERNAL_ARTIFACTS_FOLDER_NAME + File.separator +
+ "license-file-2.xml", file1Content.getBytes());
+
+ licenseArtifactsFiles.putAll(licenseArtifacts);
+
+ byte[] csarFile = toscaFileOutputServiceCsarImpl.createOutputFile(
+ new ToscaServiceModel(heatFiles, definitionsInput,
+ ToscaUtil.getServiceTemplateFileName(mainServiceTemplate)), licenseArtifactsFiles);
+
+ String resultFileName = "resultFile.zip";
+ File file = new File(resultFileName);
+ FileOutputStream fos = new FileOutputStream(file);
+ fos.write(csarFile);
+ fos.close();
+
+ ZipFile zipFile = new ZipFile(resultFileName);
+
+ Enumeration<? extends ZipEntry> entries = zipFile.entries();
+
+ int count = 0;
+ while (entries.hasMoreElements()) {
+ count++;
+ entries.nextElement();
+ }
+ Assert.assertEquals(7, count);
+ zipFile.close();
+ Files.delete(Paths.get(file.getPath()));
+ }
+
+ @Test
+ public void testCSARFileCreation_noArtifacts() throws IOException {
+ ServiceTemplate serviceTemplate = new ServiceTemplate();
+ Metadata metadata = new Metadata();
+ metadata.setTemplate_author("OPENECOMP");
+ metadata.setTemplate_name("Test");
+ metadata.setTemplate_version("1.0.0");
+ serviceTemplate.setTosca_definitions_version("tosca_simple_yaml_1_0_0");
+ serviceTemplate.setDescription("testing desc tosca service template");
+ serviceTemplate.setMetadata(metadata);
+ Map<String, ServiceTemplate> definitionsInput = new HashMap<>();
+ String serviceTemplateFileName = ToscaUtil.getServiceTemplateFileName(serviceTemplate);
+ definitionsInput.put(serviceTemplateFileName, serviceTemplate);
+ byte[] csarFile = toscaFileOutputServiceCsarImpl
+ .createOutputFile(new ToscaServiceModel(null, definitionsInput, serviceTemplateFileName),
+ null);
+
+
+ String resultFileName = "resultFile.zip";
+ File file = new File(resultFileName);
+ FileOutputStream fos = new FileOutputStream(file);
+ fos.write(csarFile);
+ fos.close();
+
+ ZipFile zipFile = new ZipFile(resultFileName);
+
+ Enumeration<? extends ZipEntry> entries = zipFile.entries();
+
+ int count = 0;
+ while (entries.hasMoreElements()) {
+ count++;
+ entries.nextElement();
+ }
+ Assert.assertEquals(2, count);
+ zipFile.close();
+ Files.delete(Paths.get(file.getPath()));
+ }
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/analyzerService/NestedServiceTemplateReqTest.yaml b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/analyzerService/NestedServiceTemplateReqTest.yaml
new file mode 100644
index 0000000000..f64cb709f0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/analyzerService/NestedServiceTemplateReqTest.yaml
@@ -0,0 +1,176 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested
+imports:
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ nested:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cmaui_image:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: String
+ p1:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ security_group_name:
+ hidden: false
+ immutable: false
+ description: not impotrtant
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ node_templates:
+ server_cmaui:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui_image
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ cmaui_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: p1
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ cmaui1_port_1:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - subnet: subnetNameVal
+ ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 1
+ - subnet: subnetNameVal2
+ ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 1
+ network: jsa_net
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: jsa_net1
+ relationship: tosca.relationships.network.LinksTo
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: jsa_net2
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ jsa_net1:
+ type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
+ properties:
+ shared: true
+ network_name:
+ get_input: jsa_net_name
+ jsa_net2:
+ type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
+ properties:
+ shared: true
+ network_name:
+ get_input: jsa_net_name
+ groups:
+ nested:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested.yml
+ description: cmaui server template for vMMSC
+ members:
+ - server_cmaui
+ - cmaui_port_0
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested
+ capabilities:
+ host_server_cmaui:
+ - server_cmaui
+ - host
+ os_server_cmaui:
+ - server_cmaui
+ - os
+ endpoint_server_cmaui:
+ - server_cmaui
+ - endpoint
+ binding_server_cmaui:
+ - server_cmaui
+ - binding
+ scalable_server_cmaui:
+ - server_cmaui
+ - scalable
+ attachment_cmaui_port_0:
+ - cmaui_port_0
+ - attachment
+ requirements:
+ local_storage_server_cmaui:
+ - server_cmaui
+ - local_storage
+ link_cmaui_port_0:
+ - cmaui_port_0
+ - link
+ link_cmaui_port_invalid:
+ - cmaui_port_9
+ - link
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/analyzerService/ServiceTemplateSubstituteTest.yaml b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/analyzerService/ServiceTemplateSubstituteTest.yaml
new file mode 100644
index 0000000000..c4df76a1aa
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/analyzerService/ServiceTemplateSubstituteTest.yaml
@@ -0,0 +1,89 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+topology_template:
+ inputs:
+ shared_network_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ jsa_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ node_templates:
+ test_net:
+ type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
+ properties:
+ shared: true
+ network_name:
+ get_input: jsa_net_name
+ test_nested1:
+ type: org.openecomp.resource.abstract.nodes.heat.nested
+ directives:
+ - substitutable
+ properties:
+ p1:
+ get_input: shared_network_id
+ service_template_filter:
+ substitute_service_template: nestedServiceTemplate.yaml
+ requirements:
+ - link_cmaui_port_0:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net
+ relationship: tosca.relationships.network.LinksTo
+ test_nested2:
+ type: org.openecomp.resource.abstract.nodes.heat.nested
+ directives:
+ - substitutable
+ properties:
+ p1:
+ get_input: shared_network_id
+ service_template_filter:
+ substitute_service_template: nestedServiceTemplate.yaml
+ requirements:
+ - link_cmaui_port_0:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net
+ relationship: tosca.relationships.network.LinksTo
+ groups:
+ addOn:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/addOn.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - test_nested
+ main:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/main.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - test_net
+ outputs:
+ shared_network_id:
+ value: test_net \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/analyzerService/toscasubstitution/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/analyzerService/toscasubstitution/MainServiceTemplate.yaml
new file mode 100644
index 0000000000..65b90ef5b1
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/analyzerService/toscasubstitution/MainServiceTemplate.yaml
@@ -0,0 +1,75 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Main
+imports:
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+topology_template:
+ inputs:
+ shared_network_id:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ jsa_net_name:
+ hidden: false
+ immutable: false
+ type: string
+ description: network name of jsa log network
+ node_templates:
+ test_net:
+ type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
+ properties:
+ shared: true
+ network_name:
+ get_input: jsa_net_name
+ test_nested:
+ type: org.openecomp.resource.abstract.nodes.heat.nested
+ directives:
+ - substitutable
+ properties:
+ p1:
+ get_input: shared_network_id
+ service_template_filter:
+ substitute_service_template: nestedServiceTemplate.yaml
+ requirements:
+ - link_cmaui_port_0:
+ capability: tosca.capabilities.network.Linkable
+ node: test_net
+ relationship: tosca.relationships.network.LinksTo
+ groups:
+ addOn:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/addOn.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - test_nested
+ main:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/main.yml
+ description: |
+ Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
+ members:
+ - test_net
+ outputs:
+ shared_network_id:
+ value: test_net \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/analyzerService/toscasubstitution/nestedServiceTemplate.yaml b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/analyzerService/toscasubstitution/nestedServiceTemplate.yaml
new file mode 100644
index 0000000000..cd27e7ba1a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/analyzerService/toscasubstitution/nestedServiceTemplate.yaml
@@ -0,0 +1,130 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: nested
+imports:
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+ nested:
+ file: GlobalSubstitutionTypesServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cmaui_image:
+ derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server
+topology_template:
+ inputs:
+ cmaui_names:
+ hidden: false
+ immutable: false
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: String
+ p1:
+ hidden: false
+ immutable: false
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ hidden: false
+ immutable: false
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ hidden: false
+ immutable: false
+ type: string
+ description: Flavor for CMAUI server
+ security_group_name:
+ hidden: false
+ immutable: false
+ description: not impotrtant
+ availability_zone_0:
+ label: availabilityzone name
+ hidden: false
+ immutable: false
+ type: string
+ description: availabilityzone name
+ node_templates:
+ server_cmaui:
+ type: org.openecomp.resource.vfc.nodes.heat.cmaui_image
+ properties:
+ flavor:
+ get_input: cmaui_flavor
+ availability_zone:
+ get_input: availability_zone_0
+ image:
+ get_input: cmaui_image
+ name:
+ get_input:
+ - cmaui_names
+ - 0
+ cmaui_port_0:
+ type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ properties:
+ replacement_policy: AUTO
+ security_groups:
+ - get_input: security_group_name
+ fixed_ips:
+ - ip_address:
+ get_input:
+ - cmaui_oam_ips
+ - 0
+ network:
+ get_input: p1
+ requirements:
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: server_cmaui
+ relationship: tosca.relationships.network.BindsTo
+ groups:
+ nested:
+ type: org.openecomp.groups.heat.HeatStack
+ properties:
+ heat_file: ../Artifacts/nested.yml
+ description: cmaui server template for vMMSC
+ members:
+ - server_cmaui
+ - cmaui_port_0
+ substitution_mappings:
+ node_type: org.openecomp.resource.abstract.nodes.heat.nested
+ capabilities:
+ host_server_cmaui:
+ - server_cmaui
+ - host
+ os_server_cmaui:
+ - server_cmaui
+ - os
+ endpoint_server_cmaui:
+ - server_cmaui
+ - endpoint
+ binding_server_cmaui:
+ - server_cmaui
+ - binding
+ scalable_server_cmaui:
+ - server_cmaui
+ - scalable
+ attachment_cmaui_port_0:
+ - cmaui_port_0
+ - attachment
+ requirements:
+ local_storage_server_cmaui:
+ - server_cmaui
+ - local_storage
+ link_cmaui_port_0:
+ - cmaui_port_0
+ - link \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/AbstractSubstituteGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/AbstractSubstituteGlobalTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..8813b0abf6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/AbstractSubstituteGlobalTypesServiceTemplate.yaml
@@ -0,0 +1,47 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: AbstractSubstituteGlobalTypes
+ template_version: 1.0.0
+description: Abstract Substitute Global Types
+imports:
+ common_definitions:
+ file: CommonGlobalTypesServiceTemplate.yaml
+data_types:
+ org.openecomp.datatypes.heat.substitution.SubstitutionFilter:
+ derived_from: tosca.datatypes.Root
+ description: Substitution Filter
+ properties:
+ substitute_service_template:
+ type: string
+ description: Substitute Service Template
+ required: true
+ status: SUPPORTED
+ index_variable:
+ type: string
+ description: Index variable
+ required: false
+ default: '%index%'
+ status: SUPPORTED
+ constraints:
+ - min_length: 3
+ count:
+ type: string
+ description: Count
+ required: false
+ default: 1
+ status: SUPPORTED
+ mandatory:
+ type: boolean
+ description: Mandatory
+ required: false
+ default: true
+ status: SUPPORTED
+node_types:
+ org.openecomp.resource.abstract.nodes.AbstractSubstitute:
+ derived_from: tosca.nodes.Root
+ properties:
+ service_template_filter:
+ type: org.openecomp.datatypes.heat.substitution.SubstitutionFilter
+ description: Substitution Filter
+ required: true
+ status: SUPPORTED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/CinderVolumeGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/CinderVolumeGlobalTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..3ef94f22e7
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/CinderVolumeGlobalTypesServiceTemplate.yaml
@@ -0,0 +1,176 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: CinderVolumeGlobalTypes
+ template_version: 1.0.0
+description: Cinder Volume TOSCA Global Types
+relationship_types:
+ org.openecomp.relationships.heat.cinder.VolumeAttachesTo:
+ derived_from: tosca.relationships.AttachesTo
+ description: This type represents an attachment relationship for associating volume
+ properties:
+ volume_id:
+ type: string
+ description: The ID of the volume to be attached
+ required: true
+ status: SUPPORTED
+ location:
+ type: string
+ description: The location where the volume is exposed on the instance, mountpoint
+ required: false
+ status: SUPPORTED
+ instance_uuid:
+ type: string
+ description: The ID of the server to which the volume attaches
+ required: true
+ status: SUPPORTED
+ attributes:
+ show:
+ type: string
+ description: Detailed information about resource
+ status: SUPPORTED
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.cinder.Volume:
+ derived_from: tosca.nodes.BlockStorage
+ properties:
+ availability_zone:
+ type: string
+ description: The availability zone in which the volume will be created
+ required: false
+ status: SUPPORTED
+ image:
+ type: string
+ description: If specified, the name or ID of the image to create the volume from
+ required: false
+ status: SUPPORTED
+ metadata:
+ type: map
+ description: Key/value pairs to associate with the volume
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ volume_type:
+ type: string
+ description: If specified, the type of volume to use, mapping to a specific backend
+ required: false
+ status: SUPPORTED
+ description:
+ type: string
+ description: A description of the volume
+ required: false
+ status: SUPPORTED
+ device_type:
+ type: string
+ description: Device type
+ required: false
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - cdrom
+ - disk
+ disk_bus:
+ type: string
+ description: 'Bus of the device: hypervisor driver chooses a suitable default
+ if omitted'
+ required: false
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - ide
+ - lame_bus
+ - scsi
+ - usb
+ - virtio
+ backup_id:
+ type: string
+ description: If specified, the backup to create the volume from
+ required: false
+ status: SUPPORTED
+ source_volid:
+ type: string
+ description: If specified, the volume to use as source
+ required: false
+ status: SUPPORTED
+ boot_index:
+ type: integer
+ description: Integer used for ordering the boot disks
+ required: false
+ status: SUPPORTED
+ size:
+ type: scalar-unit.size
+ description: The requested storage size (default unit is MB)
+ required: false
+ status: SUPPORTED
+ constraints:
+ - greater_or_equal: 1 GB
+ read_only:
+ type: boolean
+ description: Enables or disables read-only access mode of volume
+ required: false
+ status: SUPPORTED
+ name:
+ type: string
+ description: A name used to distinguish the volume
+ required: false
+ status: SUPPORTED
+ scheduler_hints:
+ type: map
+ description: Arbitrary key-value pairs specified by the client to help the Cinder scheduler creating a volume
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ swap_size:
+ type: scalar-unit.size
+ description: The size of the swap, in MB
+ required: false
+ status: SUPPORTED
+ delete_on_termination:
+ type: boolean
+ description: Indicate whether the volume should be deleted when the server is terminated
+ required: false
+ status: SUPPORTED
+ multiattach:
+ type: boolean
+ description: Whether allow the volume to be attached more than once
+ required: false
+ status: SUPPORTED
+ attributes:
+ display_description:
+ type: string
+ description: Description of the volume
+ status: SUPPORTED
+ attachments:
+ type: string
+ description: The list of attachments of the volume
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ encrypted:
+ type: boolean
+ description: Boolean indicating if the volume is encrypted or not
+ status: SUPPORTED
+ show:
+ type: string
+ description: Detailed information about resource
+ status: SUPPORTED
+ created_at:
+ type: timestamp
+ description: The timestamp indicating volume creation
+ status: SUPPORTED
+ display_name:
+ type: string
+ description: Name of the volume
+ status: SUPPORTED
+ metadata_values:
+ type: map
+ description: Key/value pairs associated with the volume in raw dict form
+ status: SUPPORTED
+ bootable:
+ type: boolean
+ description: Boolean indicating if the volume can be booted or not
+ status: SUPPORTED
+ status:
+ type: string
+ description: The current status of the volume
+ status: SUPPORTED
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/CommonGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/CommonGlobalTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..1a183e9c50
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/CommonGlobalTypesServiceTemplate.yaml
@@ -0,0 +1,210 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: CommonGlobalTypes
+ template_version: 1.0.0
+description: TOSCA Global Types
+data_types:
+ org.openecomp.datatypes.heat.network.AddressPair:
+ derived_from: tosca.datatypes.Root
+ description: MAC/IP address pairs
+ properties:
+ mac_address:
+ type: string
+ description: MAC address
+ required: false
+ status: SUPPORTED
+ ip_address:
+ type: string
+ description: IP address
+ required: false
+ status: SUPPORTED
+ org.openecomp.datatypes.heat.network.subnet.HostRoute:
+ derived_from: tosca.datatypes.Root
+ description: Host route info for the subnet
+ properties:
+ destination:
+ type: string
+ description: The destination for static route
+ required: false
+ status: SUPPORTED
+ nexthop:
+ type: string
+ description: The next hop for the destination
+ required: false
+ status: SUPPORTED
+ org.openecomp.datatypes.heat.network.neutron.Subnet:
+ derived_from: tosca.datatypes.Root
+ description: A subnet represents an IP address block that can be used for assigning IP addresses to virtual instances
+ properties:
+ tenant_id:
+ type: string
+ description: The ID of the tenant who owns the network
+ required: false
+ status: SUPPORTED
+ enable_dhcp:
+ type: boolean
+ description: Set to true if DHCP is enabled and false if DHCP is disabled
+ required: false
+ default: true
+ status: SUPPORTED
+ ipv6_address_mode:
+ type: string
+ description: IPv6 address mode
+ required: false
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - dhcpv6-stateful
+ - dhcpv6-stateless
+ - slaac
+ ipv6_ra_mode:
+ type: string
+ description: IPv6 RA (Router Advertisement) mode
+ required: false
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - dhcpv6-stateful
+ - dhcpv6-stateless
+ - slaac
+ value_specs:
+ type: map
+ description: Extra parameters to include in the request
+ required: false
+ default: {
+ }
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ allocation_pools:
+ type: list
+ description: The start and end addresses for the allocation pools
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.AllocationPool
+ subnetpool:
+ type: string
+ description: The name or ID of the subnet pool
+ required: false
+ status: SUPPORTED
+ dns_nameservers:
+ type: list
+ description: A specified set of DNS name servers to be used
+ required: false
+ default: [
+ ]
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ host_routes:
+ type: list
+ description: The gateway IP address
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.subnet.HostRoute
+ ip_version:
+ type: integer
+ description: The gateway IP address
+ required: false
+ default: 4
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - '4'
+ - '6'
+ name:
+ type: string
+ description: The name of the subnet
+ required: false
+ status: SUPPORTED
+ prefixlen:
+ type: integer
+ description: Prefix length for subnet allocation from subnet pool
+ required: false
+ status: SUPPORTED
+ constraints:
+ - greater_or_equal: 0
+ cidr:
+ type: string
+ description: The CIDR
+ required: false
+ status: SUPPORTED
+ gateway_ip:
+ type: string
+ description: The gateway IP address
+ required: false
+ status: SUPPORTED
+ org.openecomp.datatypes.heat.network.AllocationPool:
+ derived_from: tosca.datatypes.Root
+ description: The start and end addresses for the allocation pool
+ properties:
+ start:
+ type: string
+ description: Start address for the allocation pool
+ required: false
+ status: SUPPORTED
+ end:
+ type: string
+ description: End address for the allocation pool
+ required: false
+ status: SUPPORTED
+relationship_types:
+ org.openecomp.relationships.AttachesTo:
+ derived_from: tosca.relationships.Root
+ description: This type represents an attachment relationship
+group_types:
+ org.openecomp.groups.heat.HeatStack:
+ derived_from: tosca.groups.Root
+ description: Grouped all heat resources which are in the same heat stack
+ properties:
+ heat_file:
+ type: string
+ description: Heat file which associate to this group/heat stack
+ required: true
+ status: SUPPORTED
+ description:
+ type: string
+ description: Heat file description
+ required: false
+ status: SUPPORTED
+policy_types:
+ org.openecomp.policies.placement.Colocate:
+ derived_from: tosca.policy.placement
+ description: Keep associated nodes (groups of nodes) based upon affinity value
+ properties:
+ name:
+ type: string
+ description: The name of the policy
+ required: false
+ status: SUPPORTED
+ affinity:
+ type: string
+ description: affinity
+ required: true
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - host
+ - region
+ - compute
+ org.openecomp.policies.placement.Antilocate:
+ derived_from: tosca.policy.placement
+ description: My placement policy for separation based upon container type value
+ properties:
+ name:
+ type: string
+ description: The name of the policy
+ required: false
+ status: SUPPORTED
+ container_type:
+ type: string
+ description: container type
+ required: false
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - host
+ - region
+ - compute
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/ContrailNetworkRuleGlobalTypeServiceTemplate.yaml b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
new file mode 100644
index 0000000000..98317310fa
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
@@ -0,0 +1,117 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: ContrailNetworkRuleGlobalType
+ template_version: 1.0.0
+description: Contrail Network Rule Global Types
+imports:
+ common_definitions:
+ file: CommonGlobalTypesServiceTemplate.yaml
+data_types:
+ org.openecomp.datatypes.heat.contrail.network.rule.PortPairs:
+ derived_from: tosca.datatypes.Root
+ description: source and destination port pairs
+ properties:
+ start_port:
+ type: string
+ description: Start port
+ required: false
+ status: SUPPORTED
+ end_port:
+ type: string
+ description: End port
+ required: false
+ status: SUPPORTED
+ org.openecomp.datatypes.heat.contrail.network.rule.Rule:
+ derived_from: tosca.datatypes.Root
+ description: policy rule
+ properties:
+ src_ports:
+ type: list
+ description: Source ports
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.contrail.network.rule.PortPairs
+ protocol:
+ type: string
+ description: Protocol
+ required: false
+ status: SUPPORTED
+ dst_addresses:
+ type: list
+ description: Destination addresses
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.contrail.network.rule.VirtualNetwork
+ apply_service:
+ type: string
+ description: Service to apply
+ required: false
+ status: SUPPORTED
+ dst_ports:
+ type: list
+ description: Destination ports
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.contrail.network.rule.PortPairs
+ src_addresses:
+ type: list
+ description: Source addresses
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.contrail.network.rule.VirtualNetwork
+ direction:
+ type: string
+ description: Direction
+ required: false
+ status: SUPPORTED
+ org.openecomp.datatypes.heat.contrail.network.rule.RuleList:
+ derived_from: tosca.datatypes.Root
+ description: list of policy rules
+ properties:
+ policy_rule:
+ type: list
+ description: Contrail network rule
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.contrail.network.rule.Rule
+ org.openecomp.datatypes.heat.contrail.network.rule.VirtualNetwork:
+ derived_from: tosca.datatypes.Root
+ description: source and destination addresses
+ properties:
+ virtual_network:
+ type: string
+ description: Virtual network
+ required: false
+ status: SUPPORTED
+node_types:
+ org.openecomp.resource.nodes.heat.network.contrail.NetworkRules:
+ derived_from: tosca.nodes.Root
+ properties:
+ entries:
+ type: org.openecomp.datatypes.heat.contrail.network.rule.RuleList
+ description: A symbolic name for this contrail network rule
+ required: false
+ status: SUPPORTED
+ name:
+ type: string
+ description: A symbolic name for this contrail network rule
+ required: false
+ status: SUPPORTED
+ attributes:
+ fq_name:
+ type: string
+ description: fq_name
+ status: SUPPORTED
+ requirements:
+ - network:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.network.Network
+ relationship: org.openecomp.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
new file mode 100644
index 0000000000..0927e3dd0e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
@@ -0,0 +1,71 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: ContrailVirtualNetworkGlobalType
+ template_version: 1.0.0
+description: Contrail Virtual Network Global Types
+imports:
+ common_definitions:
+ file: CommonGlobalTypesServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork:
+ derived_from: tosca.nodes.network.Network
+ properties:
+ shared:
+ type: string
+ description: Is virtual network shared
+ required: false
+ status: SUPPORTED
+ forwarding_mode:
+ type: string
+ description: forwarding mode of the virtual network
+ required: false
+ status: SUPPORTED
+ external:
+ type: string
+ description: Is virtual network external
+ required: false
+ status: SUPPORTED
+ flood_unknown_unicast:
+ type: string
+ description: flood L2 packets on network
+ required: false
+ status: SUPPORTED
+ route_targets:
+ type: list
+ description: route targets associated with the virtual network
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ subnets:
+ type: map
+ description: Network related subnets
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.neutron.Subnet
+ attributes:
+ subnets_name:
+ type: list
+ description: Subnets name of this network
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ subnets_show:
+ type: map
+ description: Detailed information about each subnet
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ subnets:
+ type: map
+ description: Network related subnets
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.neutron.Subnet
+ capabilities:
+ attachment:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/GlobalSubstitutionTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..08c47bc646
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/GlobalSubstitutionTypesServiceTemplate.yaml
@@ -0,0 +1,93 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: GlobalSubstitutionTypes
+imports:
+ NeutronPortGlobalTypes:
+ file: NeutronPortGlobalTypesServiceTemplate.yaml
+ NeutronNetGlobalTypes:
+ file: NeutronNetGlobalTypesServiceTemplate.yaml
+ CommonGlobalTypes:
+ file: CommonGlobalTypesServiceTemplate.yaml
+ CinderVolumeGlobalTypes:
+ file: CinderVolumeGlobalTypesServiceTemplate.yaml
+ ContrailNetworkRuleGlobalType:
+ file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
+ NeutronSecurityRulesGlobalTypes:
+ file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
+ NovaServerGlobalTypes:
+ file: NovaServerGlobalTypesServiceTemplate.yaml
+ ContrailVirtualNetworkGlobalType:
+ file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
+ AbstractSubstituteGlobalTypes:
+ file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.abstract.nodes.heat.nested:
+ derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute
+ properties:
+ cmaui_names:
+ type: list
+ description: CMAUI1, CMAUI2 server names
+ entry_schema:
+ type: String
+ p1:
+ type: string
+ description: UID of OAM network
+ cmaui_image:
+ type: string
+ description: Image for CMAUI server
+ cmaui_flavor:
+ type: string
+ description: Flavor for CMAUI server
+ security_group_name:
+ description: not impotrtant
+ availability_zone_0:
+ type: string
+ description: availabilityzone name
+ requirements:
+ - local_storage_server_cmaui:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ - link_cmaui_port_0:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ occurrences:
+ - 1
+ - 1
+ capabilities:
+ host_server_cmaui:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os_server_cmaui:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint_server_cmaui:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding_server_cmaui:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ scalable_server_cmaui:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ attachment_cmaui_port_0:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/NativeTypesServiceTemplateServiceTemplate.yaml b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/NativeTypesServiceTemplateServiceTemplate.yaml
new file mode 100644
index 0000000000..e7dfd49ed9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/NativeTypesServiceTemplateServiceTemplate.yaml
@@ -0,0 +1,194 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: NativeTypesServiceTemplate
+ template_version: 1.0.0
+description: TOSCA Native Node Types
+node_types:
+ tosca.nodes.Compute:
+ derived_from: tosca.nodes.Root
+ attributes:
+ private_address:
+ type: string
+ description: private address
+ status: SUPPORTED
+ public_address:
+ type: string
+ description: public_address
+ status: SUPPORTED
+ networks:
+ type: map
+ description: networks
+ status: SUPPORTED
+ entry_schema:
+ type: tosca.datatypes.network.NetworkInfo
+ ports:
+ type: map
+ description: ports
+ status: SUPPORTED
+ entry_schema:
+ type: tosca.datatypes.network.PortInfo
+ requirements:
+ - local_storage:
+ capability: tosca.capabilities.Attachment
+ node: tosca.nodes.BlockStorage
+ relationship: tosca.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED
+ capabilities:
+ scalable:
+ type: tosca.capabilities.Scalable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ endpoint:
+ type: tosca.capabilities.Endpoint.Admin
+ occurrences:
+ - 1
+ - UNBOUNDED
+ os:
+ type: tosca.capabilities.OperatingSystem
+ occurrences:
+ - 1
+ - UNBOUNDED
+ host:
+ type: tosca.capabilities.Container
+ valid_source_types:
+ - tosca.nodes.SoftwareComponent
+ occurrences:
+ - 1
+ - UNBOUNDED
+ binding:
+ type: tosca.capabilities.network.Bindable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ tosca.nodes.network.Port:
+ derived_from: tosca.nodes.Root
+ properties:
+ ip_range_end:
+ type: string
+ required: false
+ status: SUPPORTED
+ ip_range_start:
+ type: string
+ required: false
+ status: SUPPORTED
+ ip_address:
+ type: string
+ required: false
+ status: SUPPORTED
+ is_default:
+ type: boolean
+ required: false
+ default: false
+ status: SUPPORTED
+ order:
+ type: integer
+ required: true
+ default: 0
+ status: SUPPORTED
+ constraints:
+ - greater_or_equal: 0
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: tosca.nodes.Root
+ relationship: tosca.relationships.network.BindsTo
+ tosca.nodes.Root:
+ attributes:
+ tosca_name:
+ type: string
+ description: tosca name
+ status: SUPPORTED
+ state:
+ type: string
+ description: state
+ status: SUPPORTED
+ tosca_id:
+ type: string
+ description: tosca id
+ status: SUPPORTED
+ interfaces: {
+ }
+ tosca.nodes.network.Network:
+ derived_from: tosca.nodes.Root
+ properties:
+ physical_network:
+ type: string
+ required: false
+ status: SUPPORTED
+ segmentation_id:
+ type: string
+ required: false
+ status: SUPPORTED
+ network_id:
+ type: string
+ required: false
+ status: SUPPORTED
+ ip_version:
+ type: integer
+ required: false
+ default: 4
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - 4
+ - 6
+ start_ip:
+ type: string
+ required: false
+ status: SUPPORTED
+ network_name:
+ type: string
+ required: false
+ status: SUPPORTED
+ cidr:
+ type: string
+ required: false
+ status: SUPPORTED
+ gateway_ip:
+ type: string
+ required: false
+ status: SUPPORTED
+ network_type:
+ type: string
+ required: false
+ status: SUPPORTED
+ end_ip:
+ type: string
+ required: false
+ status: SUPPORTED
+ capabilities:
+ link:
+ type: tosca.capabilities.network.Linkable
+ occurrences:
+ - 1
+ - UNBOUNDED
+ tosca.nodes.BlockStorage:
+ derived_from: tosca.nodes.Root
+ properties:
+ size:
+ type: scalar-unit.size
+ required: false
+ status: SUPPORTED
+ constraints:
+ - greater_or_equal: 1 MB
+ volume_id:
+ type: string
+ required: false
+ status: SUPPORTED
+ snapshot_id:
+ type: string
+ required: false
+ status: SUPPORTED
+ capabilities:
+ attachment:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/NeutronNetGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/NeutronNetGlobalTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..e80e2727c7
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/NeutronNetGlobalTypesServiceTemplate.yaml
@@ -0,0 +1,97 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: NeutronNetGlobalTypes
+ template_version: 1.0.0
+description: Neutron Network TOSCA Global Types
+imports:
+ common_definitions:
+ file: CommonGlobalTypesServiceTemplate.yaml
+node_types:
+ org.openecomp.resource.vl.nodes.heat.network.neutron.Net:
+ derived_from: tosca.nodes.network.Network
+ properties:
+ dhcp_agent_ids:
+ type: list
+ description: The IDs of the DHCP agent to schedule the network
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ tenant_id:
+ type: string
+ description: The ID of the tenant which will own the network
+ required: false
+ status: SUPPORTED
+ port_security_enabled:
+ type: boolean
+ description: Flag to enable/disable port security on the network
+ required: false
+ status: SUPPORTED
+ shared:
+ type: boolean
+ description: Whether this network should be shared across all tenants
+ required: false
+ default: false
+ status: SUPPORTED
+ admin_state_up:
+ type: boolean
+ description: A boolean value specifying the administrative status of the network
+ required: false
+ default: true
+ status: SUPPORTED
+ qos_policy:
+ type: string
+ description: The name or ID of QoS policy to attach to this network
+ required: false
+ status: SUPPORTED
+ subnets:
+ type: map
+ description: Network related subnets
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.neutron.Subnet
+ value_specs:
+ type: map
+ description: Extra parameters to include in the request
+ required: false
+ default: {
+ }
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ attributes:
+ qos_policy_id:
+ type: string
+ description: The QoS policy ID attached to this network
+ status: SUPPORTED
+ show:
+ type: string
+ description: Detailed information about resource
+ status: SUPPORTED
+ subnets_name:
+ type: list
+ description: Subnets name of this network
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ subnets:
+ type: map
+ description: Network related subnets
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.neutron.Subnet
+ mtu:
+ type: scalar-unit.size
+ description: The maximum transmission unit size(in bytes) for the network
+ status: SUPPORTED
+ status:
+ type: string
+ description: The status of the network
+ status: SUPPORTED
+ capabilities:
+ attachment:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/NeutronPortGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/NeutronPortGlobalTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..a337d6ed18
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/NeutronPortGlobalTypesServiceTemplate.yaml
@@ -0,0 +1,151 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: NeutronPortGlobalTypes
+ template_version: 1.0.0
+description: Neutron Port TOSCA Global Types
+imports:
+ common_definitions:
+ file: CommonGlobalTypesServiceTemplate.yaml
+data_types:
+ org.openecomp.datatypes.heat.neutron.port.FixedIps:
+ derived_from: tosca.datatypes.Root
+ description: subnet/ip_address
+ properties:
+ subnet:
+ type: string
+ description: Subnet in which to allocate the IP address for this port
+ required: false
+ status: SUPPORTED
+ ip_address:
+ type: string
+ description: IP address desired in the subnet for this port
+ required: false
+ status: SUPPORTED
+node_types:
+ org.openecomp.resource.cp.nodes.heat.network.neutron.Port:
+ derived_from: tosca.nodes.network.Port
+ properties:
+ port_security_enabled:
+ type: boolean
+ description: Flag to enable/disable port security on the network
+ required: false
+ status: SUPPORTED
+ device_id:
+ type: string
+ description: Device ID of this port
+ required: false
+ status: SUPPORTED
+ qos_policy:
+ type: string
+ description: The name or ID of QoS policy to attach to this network
+ required: false
+ status: SUPPORTED
+ allowed_address_pairs:
+ type: list
+ description: Additional MAC/IP address pairs allowed to pass through the port
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.AddressPair
+ binding:vnic_type:
+ type: string
+ description: The vnic type to be bound on the neutron port
+ required: false
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - macvtap
+ - direct
+ - normal
+ value_specs:
+ type: map
+ description: Extra parameters to include in the request
+ required: false
+ default: {
+ }
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ device_owner:
+ type: string
+ description: Name of the network owning the port
+ required: false
+ status: SUPPORTED
+ network:
+ type: string
+ description: Network this port belongs to
+ required: false
+ status: SUPPORTED
+ replacement_policy:
+ type: string
+ description: Policy on how to respond to a stack-update for this resource
+ required: false
+ default: AUTO
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - REPLACE_ALWAYS
+ - AUTO
+ security_groups:
+ type: list
+ description: List of security group names or IDs
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ fixed_ips:
+ type: list
+ description: Desired IPs for this port
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.neutron.port.FixedIps
+ mac_address:
+ type: string
+ description: MAC address to give to this port
+ required: false
+ status: SUPPORTED
+ admin_state_up:
+ type: boolean
+ description: A boolean value specifying the administrative status of the network
+ required: false
+ default: true
+ status: SUPPORTED
+ name:
+ type: string
+ description: A symbolic name for this port
+ required: false
+ status: SUPPORTED
+ attributes:
+ tenant_id:
+ type: string
+ description: Tenant owning the port
+ status: SUPPORTED
+ network_id:
+ type: string
+ description: Unique identifier for the network owning the port
+ status: SUPPORTED
+ qos_policy_id:
+ type: string
+ description: The QoS policy ID attached to this network
+ status: SUPPORTED
+ show:
+ type: string
+ description: Detailed information about resource
+ status: SUPPORTED
+ subnets:
+ type: list
+ description: Subnets of this network
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ status:
+ type: string
+ description: The status of the network
+ status: SUPPORTED
+ capabilities:
+ attachment:
+ type: tosca.capabilities.Attachment
+ occurrences:
+ - 1
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/NeutronSecurityRulesGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..49c9a102c8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
@@ -0,0 +1,116 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: NeutronSecurityRulesGlobalTypes
+ template_version: 1.0.0
+description: Neutron Security Rules TOSCA Global Types
+imports:
+ common_definitions:
+ file: CommonGlobalTypesServiceTemplate.yaml
+data_types:
+ org.openecomp.datatypes.heat.network.neutron.SecurityRules.Rule:
+ derived_from: tosca.datatypes.Root
+ description: Rules Pairs
+ properties:
+ remote_group_id:
+ type: string
+ description: The remote group ID to be associated with this security group rule
+ required: false
+ status: SUPPORTED
+ protocol:
+ type: string
+ description: The protocol that is matched by the security group rule
+ required: false
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - tcp
+ - udp
+ - icmp
+ ethertype:
+ type: string
+ description: Ethertype of the traffic
+ required: false
+ default: IPv4
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - IPv4
+ - IPv6
+ port_range_max:
+ type: integer
+ description: 'The maximum port number in the range that is matched by the
+ security group rule. '
+ required: false
+ status: SUPPORTED
+ constraints:
+ - in_range:
+ - 0
+ - 65535
+ remote_ip_prefix:
+ type: string
+ description: The remote IP prefix (CIDR) to be associated with this security group rule
+ required: false
+ status: SUPPORTED
+ remote_mode:
+ type: string
+ description: Whether to specify a remote group or a remote IP prefix
+ required: false
+ default: remote_ip_prefix
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - remote_ip_prefix
+ - remote_group_id
+ direction:
+ type: string
+ description: The direction in which the security group rule is applied
+ required: false
+ default: ingress
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - egress
+ - ingress
+ port_range_min:
+ type: integer
+ description: The minimum port number in the range that is matched by the security group rule.
+ required: false
+ status: SUPPORTED
+ constraints:
+ - in_range:
+ - 0
+ - 65535
+node_types:
+ org.openecomp.resource.nodes.heat.network.neutron.SecurityRules:
+ derived_from: tosca.nodes.Root
+ properties:
+ description:
+ type: string
+ description: Description of the security group
+ required: false
+ status: SUPPORTED
+ name:
+ type: string
+ description: A symbolic name for this security group, which is not required to be unique.
+ required: false
+ status: SUPPORTED
+ rules:
+ type: list
+ description: List of security group rules
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.neutron.SecurityRules.Rule
+ attributes:
+ show:
+ type: string
+ description: Detailed information about resource
+ status: SUPPORTED
+ requirements:
+ - port:
+ capability: tosca.capabilities.Attachment
+ node: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
+ relationship: org.openecomp.relationships.AttachesTo
+ occurrences:
+ - 0
+ - UNBOUNDED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/NovaServerGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/NovaServerGlobalTypesServiceTemplate.yaml
new file mode 100644
index 0000000000..2253a1e4af
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/NovaServerGlobalTypesServiceTemplate.yaml
@@ -0,0 +1,249 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: NovaServerGlobalTypes
+ template_version: 1.0.0
+description: Nova Server TOSCA Global Types
+imports:
+ common_definitions:
+ file: CommonGlobalTypesServiceTemplate.yaml
+data_types:
+ org.openecomp.datatypes.heat.novaServer.network.PortExtraProperties:
+ derived_from: tosca.datatypes.Root
+ description: Nova server network expand properties for port
+ properties:
+ port_security_enabled:
+ type: boolean
+ description: Flag to enable/disable port security on the port
+ required: false
+ status: SUPPORTED
+ mac_address:
+ type: string
+ description: MAC address to give to this port
+ required: false
+ status: SUPPORTED
+ admin_state_up:
+ type: boolean
+ description: The administrative state of this port
+ required: false
+ default: true
+ status: SUPPORTED
+ qos_policy:
+ type: string
+ description: The name or ID of QoS policy to attach to this port
+ required: false
+ status: SUPPORTED
+ allowed_address_pairs:
+ type: list
+ description: Additional MAC/IP address pairs allowed to pass through the port
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.network.AddressPair
+ binding:vnic_type:
+ type: string
+ description: The vnic type to be bound on the neutron port
+ required: false
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - macvtap
+ - direct
+ - normal
+ value_specs:
+ type: map
+ description: Extra parameters to include in the request
+ required: false
+ default: {
+ }
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ org.openecomp.datatypes.heat.novaServer.network.AddressInfo:
+ derived_from: tosca.datatypes.network.NetworkInfo
+ description: Network addresses with corresponding port id
+ properties:
+ port_id:
+ type: string
+ description: Port id
+ required: false
+ status: SUPPORTED
+node_types:
+ org.openecomp.resource.vfc.nodes.heat.nova.Server:
+ derived_from: tosca.nodes.Compute
+ properties:
+ admin_pass:
+ type: string
+ description: The administrator password for the server
+ required: false
+ status: SUPPORTED
+ availability_zone:
+ type: string
+ description: Availability zone to create servers in
+ required: false
+ status: SUPPORTED
+ image:
+ type: string
+ description: The ID or name of the image to boot with
+ required: false
+ status: SUPPORTED
+ image_update_policy:
+ type: string
+ description: Policy on how to apply an image-id update
+ required: false
+ default: REBUILD
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - REBUILD_PRESERVE_EPHEMERAL
+ - REPLACE
+ - REBUILD
+ metadata:
+ type: map
+ description: Arbitrary key/value metadata to store for this server
+ required: false
+ status: SUPPORTED
+ constraints:
+ - max_length: 255
+ entry_schema:
+ type: string
+ constraints:
+ - max_length: 255
+ user_data_update_policy:
+ type: string
+ description: Policy on how to apply a user_data update
+ required: false
+ default: REPLACE
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - REPLACE
+ - IGNORE
+ flavor_update_policy:
+ type: string
+ description: Policy on how to apply a flavor update
+ required: false
+ default: RESIZE
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - RESIZE
+ - REPLACE
+ user_data:
+ type: string
+ description: User data script to be executed by cloud-init
+ required: false
+ default: ''
+ status: SUPPORTED
+ flavor:
+ type: string
+ description: The ID or name of the flavor to boot onto
+ required: true
+ status: SUPPORTED
+ key_name:
+ type: string
+ description: Name of keypair to inject into the server
+ required: false
+ status: SUPPORTED
+ reservation_id:
+ type: string
+ description: A UUID for the set of servers being requested
+ required: false
+ status: SUPPORTED
+ security_groups:
+ type: list
+ description: List of security group names or IDs
+ required: false
+ default: [
+ ]
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ config_drive:
+ type: boolean
+ description: enable config drive on the server
+ required: false
+ status: SUPPORTED
+ personality:
+ type: map
+ description: A map of files to create/overwrite on the server upon boot
+ required: false
+ default: {
+ }
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ software_config_transport:
+ type: string
+ description: How the server should receive the metadata required for software configuration
+ required: false
+ default: POLL_SERVER_CFN
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - POLL_SERVER_CFN
+ - POLL_SERVER_HEAT
+ - POLL_TEMP_URL
+ - ZAQAR_MESSAGE
+ user_data_format:
+ type: string
+ description: How the user_data should be formatted for the server
+ required: false
+ default: HEAT_CFNTOOLS
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - SOFTWARE_CONFIG
+ - RAW
+ - HEAT_CFNTOOLS
+ diskConfig:
+ type: string
+ description: Control how the disk is partitioned when the server is created
+ required: false
+ status: SUPPORTED
+ constraints:
+ - valid_values:
+ - AUTO
+ - MANUAL
+ name:
+ type: string
+ description: Server name
+ required: false
+ status: SUPPORTED
+ scheduler_hints:
+ type: map
+ description: Arbitrary key-value pairs specified by the client to help boot a server
+ required: false
+ status: SUPPORTED
+ entry_schema:
+ type: string
+ attributes:
+ accessIPv4:
+ type: string
+ description: The manually assigned alternative public IPv4 address of the server
+ status: SUPPORTED
+ addresses:
+ type: map
+ description: A dict of all network addresses with corresponding port_id
+ status: SUPPORTED
+ entry_schema:
+ type: org.openecomp.datatypes.heat.novaServer.network.AddressInfo
+ accessIPv6:
+ type: string
+ description: The manually assigned alternative public IPv6 address of the server
+ status: SUPPORTED
+ instance_name:
+ type: string
+ description: AWS compatible instance name
+ status: SUPPORTED
+ name:
+ type: string
+ description: Name of the server
+ status: SUPPORTED
+ show:
+ type: string
+ description: Detailed information about resource
+ status: SUPPORTED
+ console_urls:
+ type: string
+ description: URLs of servers consoles
+ status: SUPPORTED \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/model/serviceTemplate.yaml b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/model/serviceTemplate.yaml
new file mode 100644
index 0000000000..612bc2d2fa
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/model/serviceTemplate.yaml
@@ -0,0 +1,116 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Test
+ template_author: OPENECOMP
+ template_version: 1.0.0
+description: testing desc tosca service template
+imports:
+ myfile1:
+ file: path1/path2/file1.yaml
+ myfile2:
+ file: path1/path2/file2.yaml
+artifact_types:
+ one_artifact:
+ mime_type: application/java-archive
+ file_ext:
+ - yaml
+ - xml
+node_types:
+ compute_node_type:
+ derived_from: tosca.nodes.Root
+ version: 1.0.0
+ description: tosca compute test
+ properties:
+ cpu_num:
+ type: integer
+ description: Number of CPUs requested for a software node instance
+ required: true
+ default: 1
+ status: SUPPORTED
+ constraints:
+ - greater_or_equal: 5.0
+ - equal: 5
+ - greater_than: 6.02
+ - in_range:
+ - 0
+ - UNBOUNDED
+ attributes:
+ attDef1:
+ type: string
+ default: hi
+ status: SUPPORTED
+ requirements:
+ - re1:
+ capability: tosca.cap1
+ occurrences:
+ - 5
+ - 1
+ capabilities:
+ cap1:
+ type: tosca.cap
+ valid_source_types:
+ - node1
+ - node2
+ occurrences:
+ - 1
+ - UNBOUNDED
+topology_template:
+ description: topologi template descroption
+ inputs:
+ inParam1:
+ type: string
+ description: desc
+ required: false
+ default: my default val
+ constraints:
+ - greater_than: 6
+ - greater_or_equal: 9
+ entry_schema:
+ type: tosca.myType
+ node_templates:
+ firatNodeTemplate:
+ type: nodeTypeRef
+ directives:
+ - selectable
+ - substitutable
+ properties:
+ prop2: '{ get_input: my_mysql_rootpw }'
+ prop1: abcd
+ attributes:
+ att2: '{ get_input: my_mysql_rootpw }'
+ att1: att1Val
+ requirements:
+ - req1:
+ capability: capA
+ node: nodeA
+ relationship: relationB
+ node_filter:
+ properties:
+ propName1:
+ - greater_or_equal: 9
+ propName2:
+ - min_length: 1
+ - max_length: 2
+ occurrences:
+ - 1
+ - 2
+ - req2:
+ capability: capA
+ node: nodeA
+ relationship: relationB
+ capabilities:
+ - cap1:
+ properties:
+ num_cpus: '{ get_input: cpus }'
+ attributes:
+ num_cpus: '66'
+ node_filter:
+ properties:
+ test1:
+ - equal: 1 MB
+ substitution_mappings:
+ node_type: myNodeType.node
+ capabilities:
+ database_endpoint:
+ - database
+ - database_endpoint
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/model/serviceTemplateHeatExtend.yaml b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/model/serviceTemplateHeatExtend.yaml
new file mode 100644
index 0000000000..4515e3dee3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/model/serviceTemplateHeatExtend.yaml
@@ -0,0 +1,117 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+metadata:
+ template_name: Test
+ template_author: OPENECOMP
+ template_version: 1.0.0
+description: testing desc tosca service template
+imports:
+ myfile1:
+ file: path1/path2/file1.yaml
+ myfile2:
+ file: path1/path2/file2.yaml
+artifact_types:
+ one_artifact:
+ mime_type: application/java-archive
+ file_ext:
+ - yaml
+ - xml
+node_types:
+ compute_node_type:
+ derived_from: tosca.nodes.Root
+ version: 1.0.0
+ description: tosca compute test
+ properties:
+ cpu_num:
+ type: integer
+ description: Number of CPUs requested for a software node instance
+ required: true
+ default: 1
+ status: SUPPORTED
+ constraints:
+ - greater_or_equal: 5.0
+ - equal: 5
+ - greater_than: 6.02
+ - in_range:
+ - 0
+ - UNBOUNDED
+ attributes:
+ attDef1:
+ type: string
+ default: hi
+ status: SUPPORTED
+ requirements:
+ - re1:
+ capability: tosca.cap1
+ occurrences:
+ - 5
+ - 1
+ capabilities:
+ cap1:
+ type: tosca.cap
+ valid_source_types:
+ - node1
+ - node2
+ occurrences:
+ - 1
+ - UNBOUNDED
+topology_template:
+ description: topologi template descroption
+ inputs:
+ inParam1:
+ type: string
+ description: desc
+ required: false
+ default: my default val
+ label: my label
+ constraints:
+ - greater_than: 6
+ - greater_or_equal: 9
+ entry_schema:
+ type: tosca.myType
+ node_templates:
+ firatNodeTemplate:
+ type: nodeTypeRef
+ directives:
+ - selectable
+ - substitutable
+ properties:
+ prop2: '{ get_input: my_mysql_rootpw }'
+ prop1: abcd
+ attributes:
+ att2: '{ get_input: my_mysql_rootpw }'
+ att1: att1Val
+ requirements:
+ - req1:
+ capability: capA
+ node: nodeA
+ relationship: relationB
+ node_filter:
+ properties:
+ propName1:
+ - greater_or_equal: 9
+ propName2:
+ - min_length: 1
+ - max_length: 2
+ occurrences:
+ - 1
+ - 2
+ - req2:
+ capability: capA
+ node: nodeA
+ relationship: relationB
+ capabilities:
+ - cap1:
+ properties:
+ num_cpus: '{ get_input: cpus }'
+ attributes:
+ num_cpus: '66'
+ node_filter:
+ properties:
+ test1:
+ - equal: 1 MB
+ substitution_mappings:
+ node_type: myNodeType.node
+ capabilities:
+ database_endpoint:
+ - database
+ - database_endpoint
diff --git a/openecomp-be/lib/pom.xml b/openecomp-be/lib/pom.xml
new file mode 100644
index 0000000000..9665bd47c4
--- /dev/null
+++ b/openecomp-be/lib/pom.xml
@@ -0,0 +1,30 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <artifactId>openecomp-sdc</artifactId>
+ <groupId>org.openecomp.sdc</groupId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <name>openecomp-sdc-lib</name>
+ <artifactId>openecomp-sdc-lib</artifactId>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>openecomp-core-lib</module>
+ <module>openecomp-common-lib</module>
+ <module>openecomp-sdc-versioning-lib</module>
+ <module>openecomp-sdc-vendor-license-lib</module>
+ <module>openecomp-sdc-vendor-software-product-lib</module>
+ <module>openecomp-sdc-translator-lib</module>
+ <module>openecomp-sdc-model-lib</module>
+ <module>openecomp-sdc-validation-lib</module>
+ <module>openecomp-sdc-datatypes-lib</module>
+ <module>openecomp-heat-lib</module>
+ <module>openecomp-tosca-lib</module>
+ <module>openecomp-sdc-action-lib</module>
+ <module>openecomp-sdc-enrichment-lib</module>
+ </modules>
+</project> \ No newline at end of file
diff --git a/openecomp-be/logs/ASDC/Debug.1.log.zip b/openecomp-be/logs/ASDC/Debug.1.log.zip
new file mode 100644
index 0000000000..80f2f013bd
--- /dev/null
+++ b/openecomp-be/logs/ASDC/Debug.1.log.zip
Binary files differ
diff --git a/openecomp-be/logs/ASDC/Debug.2.log.zip b/openecomp-be/logs/ASDC/Debug.2.log.zip
new file mode 100644
index 0000000000..eec96198c0
--- /dev/null
+++ b/openecomp-be/logs/ASDC/Debug.2.log.zip
Binary files differ
diff --git a/openecomp-be/logs/ASDC/Debug.3.log.zip b/openecomp-be/logs/ASDC/Debug.3.log.zip
new file mode 100644
index 0000000000..5230f444f7
--- /dev/null
+++ b/openecomp-be/logs/ASDC/Debug.3.log.zip
Binary files differ
diff --git a/openecomp-be/logs/ASDC/Debug.4.log.zip b/openecomp-be/logs/ASDC/Debug.4.log.zip
new file mode 100644
index 0000000000..0aaab3b0e2
--- /dev/null
+++ b/openecomp-be/logs/ASDC/Debug.4.log.zip
Binary files differ
diff --git a/openecomp-be/logs/ASDC/Debug.5.log.zip b/openecomp-be/logs/ASDC/Debug.5.log.zip
new file mode 100644
index 0000000000..af6df90701
--- /dev/null
+++ b/openecomp-be/logs/ASDC/Debug.5.log.zip
Binary files differ
diff --git a/openecomp-be/logs/ASDC/Debug.6.log.zip b/openecomp-be/logs/ASDC/Debug.6.log.zip
new file mode 100644
index 0000000000..485c772831
--- /dev/null
+++ b/openecomp-be/logs/ASDC/Debug.6.log.zip
Binary files differ
diff --git a/openecomp-be/pom.xml b/openecomp-be/pom.xml
new file mode 100644
index 0000000000..4b7e7e80f0
--- /dev/null
+++ b/openecomp-be/pom.xml
@@ -0,0 +1,158 @@
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>sdc-main</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc</artifactId>
+
+ <name>openecomp-sdc</name>
+ <packaging>pom</packaging>
+ <url>http://maven.apache.org</url>
+
+
+ <properties>
+ <spring.framework.version>4.1.3.RELEASE</spring.framework.version> <!-- orignal 4.0.7.RELEASE 4.1.3.RELEASE-->
+ <org.codehaus.jackson.version>1.9.13</org.codehaus.jackson.version> <!-- orignal 1.9.2 -->
+ <http.client.version>4.4.1</http.client.version>
+ <cxf.version>3.1.8</cxf.version>
+ <ws.rs.version>2.0.1</ws.rs.version> <!-- New version 2.0.1 to fix blackduck
+ violation Failing with comiplation issues-->
+ <javax.inject.version>1</javax.inject.version>
+ <javax.servlet.version>2.5</javax.servlet.version>
+ <datasatx.version>2.1.9</datasatx.version>
+ <swagger.version>1.5.3</swagger.version>
+ <testng.version>6.9.10</testng.version> <!--new 6.9.13.6 still shows blackduck risk -->
+ <java.source>1.8</java.source>
+ <java.target>1.8</java.target>
+ <commons.io.version>2.5</commons.io.version>
+ <org.everit.json.schema.version>1.3.0</org.everit.json.schema.version> <!--new 1.4.1
+ orignal 1.3.0
+ updated to resolve
+ blackduck violation -->
+ <commons.codec.version>1.10</commons.codec.version> <!-- orignal 1.6 updated to resolve
+ blackduck violation -->
+ <commons.lang.version>2.6</commons.lang.version> <!-- orignal 2.5. updated to resolve
+ blackduck violation -->
+ <cglib.nodep.version>3.2.4</cglib.nodep.version> <!--old : 2.1_3. new 3.2.4 -->
+ <javax.el-api.version>3.0.1-b04</javax.el-api.version> <!-- orignal 2.2.4 updated to resolve
+ blackduck violation -->
+ <hibernate.validator.version>5.3.1.Final</hibernate.validator.version>
+
+ <janino.version>3.0.6</janino.version>
+
+ </properties>
+
+
+
+ <modules>
+ <module>/api</module>
+ <module>/lib</module>
+ <module>/configuration</module>
+ <module>/tools/swagger-ui</module>
+ <module>/backend</module>
+ </modules>
+
+
+ <build>
+ <plugins>
+
+ <!-- ================================================== -->
+ <!-- Set the JDK compiler version. -->
+ <!-- ================================================== -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.5.1</version>
+ <inherited>true</inherited>
+ <configuration>
+ <source>${java.source}</source>
+ <target>${java.target}</target>
+ </configuration>
+ </plugin>
+ <!-- blackduck maven plugin -->
+ <!--
+ <plugin>
+ <groupId>com.blackducksoftware.integration</groupId>
+ <artifactId>hub-maven-plugin</artifactId>
+ <version>1.0.4</version>
+ <inherited>false</inherited>
+ <configuration>
+ <target>${project.basedir}</target>
+ </configuration>
+ <executions>
+ <execution>
+ <id>create-bdio-file</id>
+ <phase>package</phase>
+ <goals>
+ <goal>createHubOutput</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>-->
+ </plugins>
+ </build>
+
+ <!--Added to resolve blackduck operational risks for indirect dependencies referred -->
+ <dependencyManagement>
+ <dependencies>
+ <!-- https://mvnrepository.com/artifact/commons-beanutils/commons-beanutils -->
+ <dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ <version>1.9.3</version>
+ </dependency>
+ <!-- https://mvnrepository.com/artifact/com.beust/jcommander -->
+ <dependency>
+ <groupId>com.beust</groupId>
+ <artifactId>jcommander</artifactId>
+ <version>1.58</version>
+ </dependency>
+ <!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpasyncclient -->
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpasyncclient</artifactId>
+ <version>4.1.2</version>
+ </dependency>
+ <!-- https://mvnrepository.com/artifact/com.sun.xml.bind/jaxb-impl -->
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <version>2.2.11</version>
+ </dependency>
+ <!-- https://mvnrepository.com/artifact/org.beanshell/bsh -->
+ <dependency>
+ <groupId>org.beanshell</groupId>
+ <artifactId>bsh</artifactId>
+ <version>2.0b5</version>
+ </dependency>
+ <!-- https://mvnrepository.com/artifact/commons-digester/commons-digester -->
+ <dependency>
+ <groupId>commons-digester</groupId>
+ <artifactId>commons-digester</artifactId>
+ <version>2.1</version>
+ </dependency>
+ <!-- https://mvnrepository.com/artifact/com.fasterxml/classmate -->
+ <dependency>
+ <groupId>com.fasterxml</groupId>
+ <artifactId>classmate</artifactId>
+ <version>1.3.3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codehaus.janino</groupId>
+ <artifactId>janino</artifactId>
+ <version>${janino.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ </dependencyManagement>
+
+</project>
+
diff --git a/openecomp-be/readMe.txt b/openecomp-be/readMe.txt
new file mode 100644
index 0000000000..04838502b5
--- /dev/null
+++ b/openecomp-be/readMe.txt
@@ -0,0 +1,42 @@
+# OpenECOMP SDC Onboarding(back-end)
+
+---
+---
+
+# Introduction
+
+SDC is the component within the design time environment that provides multiple organizations the ability to create and manage ECOMP assets in terms of “modelsâ€. SDC asset models are generally categorized into four object types: Resource, Service, Product and Offer.
+
+# Compiling Onboarding be war
+
+###SDC can be compiled easily with a `mvn clean install`. Integration tests are started with the following profile
+ `-P with-integration-tests`
+
+###Location of war : \sdc\openecomp-be\api\openecomp-sdc-rest-webapp\onboarding-rest-war\target\onboarding-be-1.0-SNAPSHOT.war
+
+# Starting SDC
+
+Steps :
+
+### Copy onboarding war on jetty server : onboarding-be.war
+
+###open rpm
+###install jetty
+###run installJettyBase.sh
+###copy jvm.properties to base
+###export variables
+###run startJetty.sh
+
+# Accessing SDC
+
+You can access SDC at the following link : http://<hostname>:<portname>/sdc1/proxy-designer1#/onboardVendor
+
+# Logging
+
+SDC Onboarding supports EELF Logger, which is of the following types :
+
+### Error
+### Debug
+### Metrics
+### Audit
+
diff --git a/openecomp-be/tools/build/scripts/action_library_client/action_library_client.py b/openecomp-be/tools/build/scripts/action_library_client/action_library_client.py
new file mode 100644
index 0000000000..7d6e32e4a8
--- /dev/null
+++ b/openecomp-be/tools/build/scripts/action_library_client/action_library_client.py
@@ -0,0 +1,704 @@
+#!/usr/bin/python
+
+##############################################################################
+#
+# action_library_client.py
+#
+# A command-line client for the SDC Action Library.
+#
+#
+# Usage:
+#
+# Usage: action_library_client.py [--help] [--url <url>] [--in <filename>]
+# [--out <filename>] [--config <filename>]
+# [--log <filename>] [--uuid <uuid>]
+# [--curl] [--dryrun] [--verbose] [--version]
+# [--list | --create | --update= | --delete |
+# --checkout | --undocheckout | --checkin | --submit]
+#
+# Optional arguments:
+# --help Show this help message and exit
+# --url <url> REST endpoint URL
+# --in <filename> Path to JSON input file (else STDIN)
+# --out <filename> Path to JSON output file (else STDOUT or logfile)
+# --config <filename> Path to configuration file
+# --log <filename> Path to logfile (else STDOUT)
+# --uuid <uuid> Action UUID, (=='actionInvariantUUID')
+# --curl Use curl transport impl
+# --dryrun Describe what will happen, execute nothing
+# --verbose Verbose diagnostic output
+# --version Print script version and exit
+# --list List actions
+# --create Create new action (requires --in)
+# --update Update existing action (requires --uuid, --in)
+# --delete Delete existing action (requires --uuid)
+# --checkout Create minor version candidate (requires --uuid)
+# --undocheckout Discard minor version candidate (requires --uuid)
+# --checkin Create minor version from candidate (requires --uuid)
+# --submit Create next major version (requires --uuid)
+#
+# For example:
+#
+# ./action_library_client.py --url http://10.147.97.199:8080 --list
+#
+# Output:
+# - Return values:
+# - 0 - OK
+# - 1 - GENERAL_ERROR
+# - 2 - ARGUMENTS_ERROR
+# - 3 - HTTP_FORBIDDEN_ERROR
+# - 4 - HTTP_BAD_REQUEST_ERROR
+# - 5 - HTTP_GENERAL_ERROR
+# - 6 - PROCESS_ERROR
+# - JSON - to stdout:
+# - Delimited by "----------"
+# - Delimiter overrideable with ALC_JSON_DELIMITER setting.
+#
+# Configuration/env settings:
+# - ALC_HTTP_USER - HTTP BASIC username
+# - ALC_HTTP_PASS - HTTP BASIC password
+# - ALC_HTTP_INSECURE - allow untrusted SSL (server) connections.
+# - ALC_TIMEOUT_SECONDS - invocation (e.g. HTTP) timeout in seconds.
+# - ALC_JSON_DELIMITER - JSON delimiter in ouput.
+# - ALC_ECOMP_INSTANCE_ID - X-ECOMP-InstanceID header
+#
+# Configuration by 0600-mode INI file (section "action_library_client") is preferred.
+#
+# See:
+# http://10.147.97.199:8080/api-docs/ - REST API Swagger docs
+# https://www.python.org/dev/peps/pep-0008/ - style guide
+# ../doc/SDC_Action_Lib_API_AID_1610_13.pdf - REST API dev guide
+#
+# Version history:
+# - 1.0.0 November 28th 2016, LP, initial impl.
+# - 1.0.1 November 29th 2016, LP, constants, documentation, add --version.
+# - 1.0.2 November 29th 2016, LP, logging to files, stream-handling.
+# - 1.0.3 November 30th 2016, LP, optionally read config from env or config file.
+# - 1.1.0 December 3rd 2016, LP, backport from Python 3.4.2 to 2.6.6(!).
+#
+##############################################################################
+
+
+import sys
+import os
+import logging
+import base64
+import tempfile
+import uuid
+import json
+import ssl
+import urllib2
+import subprocess
+import ConfigParser
+from abc import abstractmethod
+
+
+###############################################################################
+
+
+class Constants(object):
+ """Common constants, for want of a better language feature..."""
+ # Values.
+ VERSION = "1.1.0"
+ APPLICATION = "action_library_client"
+ ACTIONS_URI = "onboarding-api/workflow/v1.0/actions"
+ ECOMP_INSTANCE_ID = "sdc_alc"
+ TIMEOUT_SECONDS_DEFAULT = 30
+ JSON_DELIMITER_DEFAULT = "----------"
+ LOG_FORMAT = "%(name)s\t%(levelname)s\t%(asctime)s\t%(message)s"
+ # Env variable names.
+ ENV_HTTP_USER = "ALC_HTTP_USER"
+ ENV_HTTP_PASS = "ALC_HTTP_PASS"
+ ENV_HTTP_INSECURE = "ALC_HTTP_INSECURE"
+ ENV_HTTP_CAFILE = "ALC_HTTP_CAFILE"
+ ENV_TIMEOUT_SECONDS = "ALC_TIMEOUT_SECONDS"
+ ENV_JSON_DELIMITER = "ALC_JSON_DELIMITER"
+ ENV_ECOMP_INSTANCE_ID = "ALC_ECOMP_INSTANCE_ID"
+
+
+###############################################################################
+
+
+class ResponseCodes(object):
+ """Responses returned by IRESTClient impls."""
+ OK = 0
+ GENERAL_ERROR = 1
+ ARGUMENTS_ERROR = 2
+ HTTP_NOT_FOUND_ERROR = 3
+ HTTP_FORBIDDEN_ERROR = 4
+ HTTP_BAD_REQUEST_ERROR = 5
+ HTTP_GENERAL_ERROR = 6
+ PROCESS_GENERAL_ERROR = 9
+
+
+###############################################################################
+
+
+class FinalizeStatus(object):
+ """Finalization operations."""
+ Checkout = "Checkout"
+ UndoCheckout = "Undo_Checkout"
+ CheckIn = "Checkin"
+ Submit = "Submit"
+
+
+###############################################################################
+
+
+class ArgsDict(dict):
+ """A dict which makes attributes accessible as properties."""
+ def __getattr__(self, attr):
+ return self[attr]
+
+ def __setattr__(self, attr, value):
+ self[attr] = value
+
+
+###############################################################################
+
+
+class ArgumentParser(object):
+ """A minimal reimpl of the argparse library, core in later Python releases"""
+ ACTIONS = ["list", "create", "update", "delete", "checkout", "undocheckout", "checkin", "submit"]
+ PARMS = ["url", "in", "out", "config", "log", "uuid"]
+ OTHER = ["curl", "dryrun", "verbose", "version", "help"]
+
+ def parse_args(self, clargs):
+ """Parse command-line args, returning a dict that exposes everything as properties."""
+ args = ArgsDict()
+ args.action = None
+ for arg in self.ACTIONS + self.PARMS + self.OTHER:
+ args[arg] = None
+ skip = False
+ try:
+ for i, clarg in enumerate(clargs):
+ if skip:
+ skip = False
+ continue
+ if not clarg.startswith("--"):
+ raise Exception("Invalid argument: {0}".format(clarg))
+ arg = str(clarg[2:])
+ if arg in self.ACTIONS:
+ if args.action:
+ raise Exception("Duplicate actions: --{0}, {1}".format(args.action, clarg))
+ args.action = arg
+ elif arg in self.PARMS:
+ try:
+ args[arg] = clargs[i + 1]
+ skip = True
+ except IndexError:
+ raise Exception("Option {0} requires an argument".format(clarg))
+ elif arg in self.OTHER:
+ args[arg] = True
+ else:
+ raise Exception("Invalid argument: {0}".format(clarg))
+
+ # Check action args.
+
+ if args.action:
+ if not args.url:
+ raise Exception("--url required for every action")
+ if not args.uuid:
+ if args.action not in ["create", "list"]:
+ raise Exception("--uuid required for every action EXCEPT --list/--create")
+
+ # Read from file or stdin, and replace the problematic "in"
+ # property with "infile".
+
+ if args.action in ["create", "update"]:
+ if args["in"]:
+ args.infile = open(args["in"], mode="r")
+ else:
+ args.infile = sys.stdin
+
+ except Exception as e:
+ print(e)
+ ArgumentParser.usage()
+ sys.exit(ResponseCodes.ARGUMENTS_ERROR)
+ return args
+
+ @staticmethod
+ def usage():
+ """Print usage message."""
+ print("" +
+ "Usage: action_library_client.py [--help] [--url <url>] [--in <filename>]\n" +
+ " [--out <filename>] [--config <filename>]\n" +
+ " [--log <filename>] [--uuid <uuid>]\n" +
+ " [--curl] [--dryrun] [--verbose] [--version]\n" +
+ " [--list | --create | --update= | --delete |\n" +
+ " --checkout | --undocheckout | --checkin | --submit]\n" +
+ "\n" +
+ "Optional arguments:\n" +
+ " --help Show this help message and exit\n" +
+ " --url <url> REST endpoint URL\n" +
+ " --in <filename> Path to JSON input file (else STDIN)\n" +
+ " --out <filename> Path to JSON output file (else STDOUT or logfile)\n" +
+ " --config <filename> Path to configuration file\n" +
+ " --log <filename> Path to logfile (else STDOUT)\n" +
+ " --uuid <uuid> Action UUID, (=='actionInvariantUUID')\n" +
+ " --curl Use curl transport impl\n" +
+ " --dryrun Describe what will happen, execute nothing\n" +
+ " --verbose Verbose diagnostic output\n" +
+ " --version Print script version and exit\n" +
+ " --list List actions\n" +
+ " --create Create new action (requires --in)\n" +
+ " --update Update existing action (requires --uuid, --in)\n" +
+ " --delete Delete existing action (requires --uuid)\n" +
+ " --checkout Create minor version candidate (requires --uuid)\n" +
+ " --undocheckout Discard minor version candidate (requires --uuid)\n" +
+ " --checkin Create minor version from candidate (requires --uuid)\n" +
+ " --submit Create next major version (requires --uuid)")
+
+
+###############################################################################
+
+
+class Settings(object):
+ """Settings read from (optional) configfile, or environment."""
+
+ def __init__(self, args):
+ """Construct for command-line args."""
+ self.config = ConfigParser.ConfigParser()
+ if args.config:
+ self.config.read(args.config)
+
+ def get(self, name, default_value=None):
+ """Get setting from configfile or environment"""
+ try:
+ return self.config.get(Constants.APPLICATION, name)
+ except (KeyError, ConfigParser.NoSectionError, ConfigParser.NoOptionError):
+ try:
+ return os.environ[name]
+ except KeyError:
+ return default_value
+
+
+###############################################################################
+
+
+# Python3: metaclass=ABCMeta
+class IRESTClient(object):
+ """Base class for local, proxy and dryrun impls."""
+
+ def __init__(self, args):
+ self.args = args
+ self.logger = Runner.get_logger()
+ self.settings = Settings(args)
+
+ @abstractmethod
+ def list(self):
+ """Abstract list operation."""
+ pass
+
+ @abstractmethod
+ def create(self):
+ """Abstract list operation."""
+ pass
+
+ @abstractmethod
+ def update(self):
+ """Abstract list operation."""
+ pass
+
+ @abstractmethod
+ def delete(self):
+ """Abstract list operation."""
+ pass
+
+ @abstractmethod
+ def version(self, status):
+ """Abstract list operation."""
+ pass
+
+ @staticmethod
+ def new_uuid():
+ """Generate UUID."""
+ return str(uuid.uuid4())
+
+ def get_timeout_seconds(self):
+ """Get request timeout in seconds."""
+ return self.settings.get(Constants.ENV_TIMEOUT_SECONDS,
+ Constants.TIMEOUT_SECONDS_DEFAULT)
+
+ def get_http_insecure(self):
+ """Get whether SSL certificate checks are (inadvisably) disabled."""
+ return True if self.settings.get(Constants.ENV_HTTP_INSECURE) else False
+
+ def get_http_cafile(self):
+ """Get optional CA file for SSL server cert validation"""
+ if not self.get_http_insecure():
+ return self.settings.get(Constants.ENV_HTTP_CAFILE)
+
+ def get_basic_credentials(self):
+ """Generate Authorization: header."""
+ usr = self.settings.get(Constants.ENV_HTTP_USER)
+ pwd = self.settings.get(Constants.ENV_HTTP_PASS)
+ if usr and pwd:
+ return base64.b64encode(bytes("{0}:{1}".format(usr, pwd))).decode("ascii")
+ else:
+ raise Exception("REST service credentials not found")
+
+ def make_service_url(self):
+ """Generate service URL based on command-line arguments."""
+ url = self.args.url
+ if "/onboarding-api/" not in url:
+ separator = "" if url.endswith("/") else "/"
+ url = "{0}{1}{2}".format(url, separator, str(Constants.ACTIONS_URI))
+ if self.args.uuid:
+ separator = "" if url.endswith("/") else "/"
+ url = "{0}{1}{2}".format(url, separator, self.args.uuid)
+ return url
+
+ def log_json_response(self, method, json_dict):
+ """Log JSON response regardless of transport."""
+ json_str = json.dumps(json_dict, indent=4)
+ delimiter = self.settings.get(Constants.ENV_JSON_DELIMITER, Constants.JSON_DELIMITER_DEFAULT)
+ self.logger.info("HTTP {0} JSON response:\n{1}\n{2}\n{3}\n".format(method, delimiter, json_str, delimiter))
+ if self.args.out:
+ with open(self.args.out, "w") as tmp:
+ tmp.write(json_str)
+ tmp.flush()
+ elif self.args.log:
+ # Directly to stdout if logging is sent to a file.
+ print(json_str)
+
+ def log_action(self, action, status=None):
+ """Debug action before invocation."""
+ url = self.make_service_url()
+ name = status if status else self.__get_name()
+ self.logger.debug("{0}::{1}({2})".format(name, action, url))
+
+ @staticmethod
+ def _get_result_from_http_response(code):
+ """Get script returncode from HTTP error."""
+ if code == 400:
+ return ResponseCodes.HTTP_BAD_REQUEST_ERROR
+ elif code == 403:
+ return ResponseCodes.HTTP_FORBIDDEN_ERROR
+ elif code == 404:
+ return ResponseCodes.HTTP_NOT_FOUND_ERROR
+ return ResponseCodes.HTTP_GENERAL_ERROR
+
+ def __get_name(self):
+ """Get classname for diags"""
+ return type(self).__name__
+
+
+###############################################################################
+
+
+class NativeRESTClient(IRESTClient):
+ """In-process IRESTClient impl."""
+
+ def list(self):
+ """In-process list impl."""
+ self.log_action("list")
+ return self.__exec(method="GET", expect_json=True)
+
+ def create(self):
+ """In-process create impl."""
+ self.log_action("create")
+ json_bytes = bytes(self.args.infile.read())
+ return self.__exec(method="POST", json_bytes=json_bytes, expect_json=True)
+
+ def update(self):
+ """In-process update impl."""
+ self.log_action("update")
+ json_bytes = bytes(self.args.infile.read())
+ return self.__exec(method="PUT", json_bytes=json_bytes, expect_json=True)
+
+ def delete(self):
+ """In-process delete impl."""
+ self.log_action("delete")
+ return self.__exec(method="DELETE")
+
+ def version(self, status):
+ """In-process version impl."""
+ self.log_action("version", status)
+ json_bytes = bytes(json.dumps({"status": status}))
+ return self.__exec(method="POST", json_bytes=json_bytes, expect_json=True)
+
+ def __exec(self, method, json_bytes=None, expect_json=None):
+ """Build command, execute it, validate and return response."""
+ try:
+ url = self.make_service_url()
+ timeout = float(self.get_timeout_seconds())
+ cafile = self.get_http_cafile()
+ headers = {
+ "Content-Type": "application/json",
+ "Accept": "application/json",
+ "Authorization": "Basic {0}".format(self.get_basic_credentials()),
+ "X-ECOMP-InstanceID": Constants.ECOMP_INSTANCE_ID,
+ "X-ECOMP-RequestID": IRESTClient.new_uuid()
+ }
+
+ handler = urllib2.HTTPHandler
+ if hasattr(ssl, 'create_default_context'):
+ ctx = ssl.create_default_context(cafile=cafile)
+ if self.get_http_insecure():
+ ctx.check_hostname = False
+ ctx.verify_mode = ssl.CERT_NONE
+ handler = urllib2.HTTPSHandler(context=ctx) if url.lower().startswith("https") else urllib2.HTTPHandler
+
+ self.logger.debug("URL {0} {1}: {2}".format(url, method, json_bytes))
+
+ opener = urllib2.build_opener(handler)
+ request = urllib2.Request(url, data=json_bytes, headers=headers)
+ request.get_method = lambda: method
+
+ f = None
+ try:
+ f = opener.open(request, timeout=timeout)
+ return self.__handle_response(f, method, expect_json)
+ finally:
+ if f:
+ f.close()
+
+ except urllib2.HTTPError as err:
+ self.logger.exception(err)
+ return IRESTClient._get_result_from_http_response(err.getcode())
+ except urllib2.URLError as err:
+ self.logger.exception(err)
+ return ResponseCodes.HTTP_GENERAL_ERROR
+
+ def __handle_response(self, f, method, expect_json):
+ """Devolve response handling because of the """
+ self.logger.debug("HTTP {0} status {1}, reason:\n{2}".format(method, f.getcode(), f.info()))
+ if expect_json:
+ # JSON responses get "returned", but actually it's the logging that
+ # most callers will be looking for.
+ json_body = json.loads(f.read().decode("utf-8"))
+ self.log_json_response(method, json_body)
+ return json_body
+ # Not JSON, but the operation succeeded, so return True.
+ return ResponseCodes.OK
+
+
+###############################################################################
+
+
+class CURLRESTClient(IRESTClient):
+ """Remote/curl IRESTClient impl."""
+
+ def list(self):
+ """curl list impl"""
+ self.log_action("list")
+ return self._exec(method="GET", expect_json=True)
+
+ def create(self):
+ """curl create impl"""
+ self.log_action("create")
+ data_args = ["--data", "@{0}".format(self.args.infile.name)]
+ return self._exec(method="POST", extra_args=data_args, expect_json=True)
+
+ def update(self):
+ """curl update impl"""
+ self.log_action("update")
+ data_args = ["--data", "@{0}".format(self.args.infile.name)]
+ return self._exec(method="PUT", extra_args=data_args, expect_json=True)
+
+ def delete(self):
+ """curl delete impl"""
+ self.log_action("delete")
+ return self._exec(method="DELETE", expect_json=False)
+
+ def version(self, status):
+ """curl version impl"""
+ self.log_action("version", status)
+ with tempfile.NamedTemporaryFile(mode="w", delete=False) as tmp:
+ tmp.write(json.dumps({"status": status}))
+ tmp.flush()
+ data_args = ["--data", "@{0}".format(tmp.name)]
+ return self._exec(method="POST", extra_args=data_args, expect_json=True)
+
+ def make_curl_cmd(self, method, url, extra_args):
+ """Build curl command without executing."""
+ cmd = ["curl", "-i", "-s", "-X", method]
+ if self.get_http_insecure():
+ cmd.append("-k")
+ cmd.extend(["--connect-timeout", str(self.get_timeout_seconds())])
+ cmd.extend(["--header", "Accept: application/json"])
+ cmd.extend(["--header", "Content-Type: application/json"])
+ cmd.extend(["--header", "Authorization: Basic {0}".format(self.get_basic_credentials())])
+ cmd.extend(["--header", "X-ECOMP-InstanceID: {0}".format(Constants.ECOMP_INSTANCE_ID)])
+ cmd.extend(["--header", "X-ECOMP-RequestID: {0}".format(IRESTClient.new_uuid())])
+ if extra_args:
+ for extra_arg in extra_args:
+ cmd.append(extra_arg)
+ cmd.append("{0}".format(url))
+ return cmd
+
+ @staticmethod
+ def debug_curl_cmd(cmd):
+ """Debug curl command, for diags and dryrun."""
+ buf = ""
+ for token in cmd:
+ if token is "curl" or token.startswith("-"):
+ buf = "{0}{1} ".format(buf, token)
+ else:
+ buf = "{0}\"{1}\" ".format(buf, token)
+ return buf
+
+ def _exec(self, method, extra_args=None, expect_json=None):
+ """Execute action.
+
+ Build command, invoke curl, validate and return response.
+ Overridden by DryRunRESTClient.
+ """
+ url = self.make_service_url()
+ cmd = self.make_curl_cmd(method, url, extra_args)
+ self.logger.info("Executing: {0}".format(CURLRESTClient.debug_curl_cmd(cmd)))
+
+ try:
+ output = subprocess.check_output(cmd, stderr=subprocess.STDOUT).decode()
+ if not expect_json:
+ return ResponseCodes.OK
+ try:
+ separator = output.index("\r\n\r\n{")
+ self.logger.debug("HTTP preamble:\n{0}".format(output[:separator]))
+ json_body = json.loads(output[(separator+4):])
+ self.log_json_response(method, json_body)
+ return json_body
+ except ValueError:
+ self.logger.warning("Couldn't find HTTP separator in curl output:\n{}".format(output))
+ code = CURLRESTClient.__get_http_code(output)
+ return IRESTClient._get_result_from_http_response(code)
+ except subprocess.CalledProcessError as err:
+ self.logger.exception(err)
+ return ResponseCodes.PROCESS_GENERAL_ERROR
+
+ @staticmethod
+ def __get_http_code(output):
+ """Attempt to guess HTTP result from (error) output."""
+ for line in output.splitlines():
+ if line.startswith("HTTP"):
+ tokens = line.split()
+ if len(tokens) > 2:
+ try:
+ return int(tokens[1])
+ except ValueError:
+ pass
+ return ResponseCodes.HTTP_GENERAL_ERROR
+
+
+###############################################################################
+
+
+class DryRunRESTClient(CURLRESTClient):
+ """Neutered IRESTClient impl; only logs."""
+
+ def _exec(self, method, extra_args=None, expect_json=None):
+ """Override."""
+ url = self.make_service_url()
+ cmd = self.make_curl_cmd(method, url, extra_args)
+ self.logger.info("[DryRun] {0}".format(CURLRESTClient.debug_curl_cmd(cmd)))
+
+
+###############################################################################
+
+
+class Runner(object):
+ """A bunch of static housekeeping supporting the launcher."""
+
+ @staticmethod
+ def get_logger():
+ """Get logger instance."""
+ return logging.getLogger(Constants.APPLICATION)
+
+ @staticmethod
+ def get_rest_client(args):
+ """Get the configured REST client impl, local, remote or dryrun."""
+ if args.dryrun:
+ return DryRunRESTClient(args)
+ elif args.curl:
+ return CURLRESTClient(args)
+ else:
+ return NativeRESTClient(args)
+
+ @staticmethod
+ def execute(args):
+ """Execute the requested action."""
+ client = Runner.get_rest_client(args)
+ if args.version:
+ print(Constants.VERSION)
+ elif args.help:
+ ArgumentParser.usage()
+ elif args.action == "list":
+ return client.list()
+ elif args.action == "create":
+ return client.create()
+ elif args.action == "update":
+ return client.update()
+ elif args.action == "delete":
+ return client.delete()
+ elif args.action == "checkout":
+ return client.version(FinalizeStatus.Checkout)
+ elif args.action == "checkin":
+ return client.version(FinalizeStatus.CheckIn)
+ elif args.action == "undocheckout":
+ return client.version(FinalizeStatus.UndoCheckout)
+ elif args.action == "submit":
+ return client.version(FinalizeStatus.Submit)
+ else:
+ logger = Runner.get_logger()
+ logger.info("No action specified. Try --help.")
+
+ @staticmethod
+ def parse_args(raw):
+ """Parse command-line args, returning dict."""
+ return ArgumentParser().parse_args(raw)
+
+
+###############################################################################
+
+
+def execute(raw):
+ """Delegate which executes minus error-handling, exposed for unit-testing."""
+
+ # Intercept Python 2.X.
+
+ if not (sys.version_info[0] == 2 and sys.version_info[1] >= 6):
+ raise EnvironmentError("Python 2.6/2.7 required")
+
+ # Parse command-line args.
+
+ args = Runner.parse_args(raw)
+
+ # Redirect logging to a file (freeing up STDIN) if directed.
+
+ logging.basicConfig(level=logging.INFO, filename=args.log, format=Constants.LOG_FORMAT)
+
+ # Set loglevel.
+
+ logger = Runner.get_logger()
+ if args.verbose:
+ logger.setLevel(logging.DEBUG)
+ logger.debug("Parsed arguments: {0}".format(args))
+
+ # Execute request.
+
+ return Runner.execute(args)
+
+
+###############################################################################
+
+
+def main(raw):
+ """Execute for command-line arguments."""
+
+ logger = Runner.get_logger()
+ try:
+ result = execute(raw)
+ result_code = result if isinstance(result, int) else ResponseCodes.OK
+ logger.debug("Execution complete. Returning result {0} ({1})".format(result, result_code))
+ sys.exit(result_code)
+ except Exception as err:
+ logger.exception(err)
+ sys.exit(ResponseCodes.GENERAL_ERROR)
+
+
+###############################################################################
+
+
+if __name__ == "__main__":
+ main(sys.argv[1:])
diff --git a/openecomp-be/tools/build/scripts/action_library_client/doc/TESTPLAN.TXT b/openecomp-be/tools/build/scripts/action_library_client/doc/TESTPLAN.TXT
new file mode 100644
index 0000000000..be6a77c847
--- /dev/null
+++ b/openecomp-be/tools/build/scripts/action_library_client/doc/TESTPLAN.TXT
@@ -0,0 +1,10 @@
+1. Unit + integration tests.
+2. Reading credentials from configfile.
+3. Writing output to logfile, response to stdout.
+4. Reading JSON from stdin.
+5. TLS URL, success, failure (if Python checks, and with insecure mode enabled).
+6. Auth failure.
+7. Print help, version.
+8. Python 2.6/2.7 sanity (whichever isn't primary)
+9. Run BASH example scripts.
+10. Run Python example script(s).
diff --git a/openecomp-be/tools/build/scripts/action_library_client/test/scenarios/Backout.json b/openecomp-be/tools/build/scripts/action_library_client/test/scenarios/Backout.json
new file mode 100644
index 0000000000..12b7b4dd2c
--- /dev/null
+++ b/openecomp-be/tools/build/scripts/action_library_client/test/scenarios/Backout.json
@@ -0,0 +1,45 @@
+{
+ "name": "Backout",
+ "displayName": "Backout",
+ "description": "MCAP Backout",
+ "vendorList": ["BROCADE"],
+ "categoryList": ["Upgrade"],
+ "endpointURI": "engine-rest/process-definition/key/Backout/start",
+ "supportedModels": [{
+ "versionID": "AA56B177-9383-4934-8543-0F91A7A04971",
+ "versionInvariantUUID": "CC87B177-9383-4934-8543-0F91A7A07193",
+ "name": "vCE",
+ "version": "2.1",
+ "category": "cpe"
+ }],
+ "supportedComponents": [{
+ "ID": "BB47B177-9383-4934-8543-0F91A7A06448",
+ "componentName": "appc"
+ }],
+ "inputParameters": [{
+ "name": "VNF_NAME",
+ "description": "VNF name",
+ "type": "STRING",
+ "max-length": "50",
+ "optional": true,
+ "allowed_values": ["string1", "string2"]
+ }],
+ "outputParameters": [{
+ "name": "STATUS",
+ "defaultValue": "Default Value",
+ "type": "STRING",
+ "description": "The status of execution"
+ }],
+ "operationalData": {
+ "outageDuration": "0",
+ "approxDuration": "5",
+ "staticFields": {},
+ "updatableFields": {}
+ },
+ "serverList": [{
+ "name": "appcserver",
+ "hostName": "cm-server1.client.com",
+ "port": "666"
+ }],
+ "updatedBy": "AUTHusername"
+}
diff --git a/openecomp-be/tools/build/scripts/action_library_client/test/scenarios/Copy_image.json b/openecomp-be/tools/build/scripts/action_library_client/test/scenarios/Copy_image.json
new file mode 100644
index 0000000000..06da2ae48f
--- /dev/null
+++ b/openecomp-be/tools/build/scripts/action_library_client/test/scenarios/Copy_image.json
@@ -0,0 +1,45 @@
+{
+ "name": "Copy_image",
+ "displayName": "Copy_image",
+ "description": "MCAP Copy Image",
+ "vendorList": ["BROCADE"],
+ "categoryList": ["Upgrade"],
+ "endpointURI": "engine-rest/process-definition/key/Copy_image/start",
+ "supportedModels": [{
+ "versionID": "AA56B177-9383-4934-8543-0F91A7A04971",
+ "versionInvariantUUID": "CC87B177-9383-4934-8543-0F91A7A07193",
+ "name": "vCE",
+ "version": "2.1",
+ "category": "cpe"
+ }],
+ "supportedComponents": [{
+ "ID": "BB47B177-9383-4934-8543-0F91A7A06448",
+ "componentName": "appc"
+ }],
+ "inputParameters": [{
+ "name": "VNF_NAME",
+ "description": "VNF name",
+ "type": "STRING",
+ "max-length": "50",
+ "optional": true,
+ "allowed_values": ["string1", "string2"]
+ }],
+ "outputParameters": [{
+ "name": "STATUS",
+ "defaultValue": "Default Value",
+ "type": "STRING",
+ "description": "The status of execution"
+ }],
+ "operationalData": {
+ "outageDuration": "0",
+ "approxDuration": "5",
+ "staticFields": {},
+ "updatableFields": {}
+ },
+ "serverList": [{
+ "name": "appcserver",
+ "hostName": "cm-server1.client.com",
+ "port": "666"
+ }],
+ "updatedBy": "AUTHusername"
+}
diff --git a/openecomp-be/tools/build/scripts/action_library_client/test/scenarios/Healthcheck.json b/openecomp-be/tools/build/scripts/action_library_client/test/scenarios/Healthcheck.json
new file mode 100644
index 0000000000..b1be8f77df
--- /dev/null
+++ b/openecomp-be/tools/build/scripts/action_library_client/test/scenarios/Healthcheck.json
@@ -0,0 +1,45 @@
+{
+ "name": "Healthcheck",
+ "displayName": "Healthcheck",
+ "description": "MCAP Healthcheck",
+ "vendorList": ["BROCADE"],
+ "categoryList": ["Upgrade"],
+ "endpointURI": "engine-rest/process-definition/key/Healthcheck/start",
+ "supportedModels": [{
+ "versionID": "AA56B177-9383-4934-8543-0F91A7A04971",
+ "versionInvariantUUID": "CC87B177-9383-4934-8543-0F91A7A07193",
+ "name": "vCE",
+ "version": "2.1",
+ "category": "cpe"
+ }],
+ "supportedComponents": [{
+ "ID": "BB47B177-9383-4934-8543-0F91A7A06448",
+ "componentName": "appc"
+ }],
+ "inputParameters": [{
+ "name": "VNF_NAME",
+ "description": "VNF name",
+ "type": "STRING",
+ "max-length": "50",
+ "optional": true,
+ "allowed_values": ["string1", "string2"]
+ }],
+ "outputParameters": [{
+ "name": "STATUS",
+ "defaultValue": "Default Value",
+ "type": "STRING",
+ "description": "The status of execution"
+ }],
+ "operationalData": {
+ "outageDuration": "0",
+ "approxDuration": "5",
+ "staticFields": {},
+ "updatableFields": {}
+ },
+ "serverList": [{
+ "name": "appcserver",
+ "hostName": "cm-server1.client.com",
+ "port": "666"
+ }],
+ "updatedBy": "AUTHusername"
+}
diff --git a/openecomp-be/tools/build/scripts/action_library_client/test/scenarios/Reboot.json b/openecomp-be/tools/build/scripts/action_library_client/test/scenarios/Reboot.json
new file mode 100644
index 0000000000..72cbb659e3
--- /dev/null
+++ b/openecomp-be/tools/build/scripts/action_library_client/test/scenarios/Reboot.json
@@ -0,0 +1,45 @@
+{
+ "name": "Reboot",
+ "displayName": "Reboot",
+ "description": "MCAP Reboot",
+ "vendorList": ["BROCADE"],
+ "categoryList": ["Upgrade"],
+ "endpointURI": "engine-rest/process-definition/key/Reboot/start",
+ "supportedModels": [{
+ "versionID": "AA56B177-9383-4934-8543-0F91A7A04971",
+ "versionInvariantUUID": "CC87B177-9383-4934-8543-0F91A7A07193",
+ "name": "vCE",
+ "version": "2.1",
+ "category": "cpe"
+ }],
+ "supportedComponents": [{
+ "ID": "BB47B177-9383-4934-8543-0F91A7A06448",
+ "componentName": "appc"
+ }],
+ "inputParameters": [{
+ "name": "VNF_NAME",
+ "description": "VNF name",
+ "type": "STRING",
+ "max-length": "50",
+ "optional": true,
+ "allowed_values": ["string1", "string2"]
+ }],
+ "outputParameters": [{
+ "name": "STATUS",
+ "defaultValue": "Default Value",
+ "type": "STRING",
+ "description": "The status of execution"
+ }],
+ "operationalData": {
+ "outageDuration": "0",
+ "approxDuration": "5",
+ "staticFields": {},
+ "updatableFields": {}
+ },
+ "serverList": [{
+ "name": "appcserver",
+ "hostName": "cm-server1.client.com",
+ "port": "666"
+ }],
+ "updatedBy": "AUTHusername"
+}
diff --git a/openecomp-be/tools/build/scripts/action_library_client/test/seq.txt b/openecomp-be/tools/build/scripts/action_library_client/test/seq.txt
new file mode 100644
index 0000000000..b18fcc5ba2
--- /dev/null
+++ b/openecomp-be/tools/build/scripts/action_library_client/test/seq.txt
@@ -0,0 +1 @@
+535 \ No newline at end of file
diff --git a/openecomp-be/tools/build/scripts/action_library_client/test/test_action_library_client.py b/openecomp-be/tools/build/scripts/action_library_client/test/test_action_library_client.py
new file mode 100644
index 0000000000..dc1161c184
--- /dev/null
+++ b/openecomp-be/tools/build/scripts/action_library_client/test/test_action_library_client.py
@@ -0,0 +1,154 @@
+import unittest
+import os
+import tempfile
+import ConfigParser
+import action_library_client as ALC
+
+
+class D(dict):
+
+ def __init__(self, *args, **kwargs):
+ super(D, self).__init__(*args, **kwargs)
+ self.__dict__ = self
+
+
+class UnitTest(unittest.TestCase):
+
+ def __write_config_file(self, map):
+ with tempfile.NamedTemporaryFile(mode="w", delete=False) as tmp:
+ config = ConfigParser.ConfigParser()
+ config.add_section("action_library_client")
+ for k, v in map.items():
+ section = config.set("action_library_client", k, v)
+ config.write(tmp)
+ tmp.flush()
+ return tmp.name
+
+ def test_argument_parser(self):
+ # nothing = ALC.ArgumentParser().parse_args([])
+ # self.assertEquals(nothing.help, None)
+ # self.assertEquals(nothing.version, None)
+ # self.assertEquals(nothing.verbose, None)
+ #
+ # help = ALC.ArgumentParser().parse_args(["--help"])
+ # self.assertEquals(help.help, True)
+
+ uuidx = ALC.ArgumentParser().parse_args(["--uuid", "abc"])
+ self.assertEquals(uuidx.uuid, "abc")
+
+
+ def test_settings_get(self):
+
+ os.environ["a"] = "aa"
+ os.environ["b"] = "WILL_BE_OVERRIDDEN"
+
+ section = dict()
+ section['ALC_HTTP_USER'] = "batman"
+ section['ECOMP_INSTANCE_ID'] = "acdc"
+ section['b'] = "bb"
+ filename = self.__write_config_file(section)
+
+ # with tempfile.NamedTemporaryFile(mode="w", delete=False) as tmp:
+ # config = configparser.ConfigParser()
+ # config.add_section("action_library_client")
+ # section = config["action_library_client"]
+ # config.write(tmp)
+ # tmp.flush()
+
+ settings = ALC.Settings(ALC.Runner.parse_args(["--config", filename]))
+ self.assertEquals("aa", settings.get("a"))
+ self.assertEquals("bb", settings.get("b"))
+ self.assertEquals("batman", settings.get("ALC_HTTP_USER"))
+ self.assertEquals("batman", settings.get(ALC.Constants.ENV_HTTP_USER))
+ self.assertEquals("ALC_ECOMP_INSTANCE_ID", settings.get("c", ALC.Constants.ENV_ECOMP_INSTANCE_ID))
+
+ os.remove(filename)
+
+ def test_parse_args(self):
+ c1 = ALC.Runner.parse_args(["--version"])
+ with tempfile.NamedTemporaryFile(mode="w", delete=False) as tmp:
+ config = ConfigParser.ConfigParser()
+ config.add_section("action_library_client")
+ config.set("action_library_client", "ALC_HTTP_USER", "batman")
+ config.write(tmp)
+ tmp.flush()
+ self.assertEquals(c1.version, True)
+
+ def test_get_http_insecure(self):
+ c = ALC.DryRunRESTClient(ALC.Runner.parse_args([]))
+ self.assertEquals(False, c.get_http_insecure())
+
+ def test_get_http_cafile(self):
+ c1 = ALC.DryRunRESTClient(ALC.Runner.parse_args([]))
+ self.assertEquals(False, c1.get_http_insecure())
+ self.assertIsNone(c1.get_http_cafile())
+
+ filename = self.__write_config_file({"ALC_HTTP_CAFILE": "/tmp/x"})
+ c2 = ALC.DryRunRESTClient(ALC.Runner.parse_args(["--config", filename]))
+ self.assertEquals(False, c2.get_http_insecure())
+ self.assertEquals("/tmp/x", c2.get_http_cafile())
+
+ def test_get_timeout_seconds(self):
+ args = ALC.Runner.parse_args(["--version"])
+ self.assertEquals(30, ALC.DryRunRESTClient(args).get_timeout_seconds())
+
+ def test_get_basic_credentials(self):
+ try:
+ saved_user = os.environ["ALC_HTTP_USER"]
+ saved_pass = os.environ["ALC_HTTP_PASS"]
+ except KeyError:
+ saved_user = ""
+ saved_pass = ""
+ try:
+ os.environ["ALC_HTTP_USER"] = "AUTH-DELETE"
+ os.environ["ALC_HTTP_PASS"] = "test"
+ c = ALC.DryRunRESTClient(ALC.Runner.parse_args([]))
+ c1 = c.get_basic_credentials()
+ self.assertEqual(c1, "QVVUSC1ERUxFVEU6dGVzdA==")
+ os.environ["ALC_HTTP_USER"] = "AUTH-DELETE"
+ os.environ["ALC_HTTP_PASS"] = "death"
+ c2 = c.get_basic_credentials()
+ self.assertNotEqual(c2, "QVVUSC1ERUxFVEU6dGVzdA==")
+ finally:
+ os.environ["ALC_HTTP_USER"] = saved_user
+ os.environ["ALC_HTTP_PASS"] = saved_pass
+
+ def test_get_rest_client(self):
+ uuid = ALC.IRESTClient.new_uuid()
+ c1 = ALC.Runner.get_rest_client(ALC.Runner.parse_args(["--dryrun"]))
+ self.assertTrue(isinstance(c1, ALC.DryRunRESTClient))
+ c2 = ALC.Runner.get_rest_client(ALC.Runner.parse_args(["--curl"]))
+ self.assertTrue(isinstance(c2, ALC.CURLRESTClient))
+ c3 = ALC.Runner.get_rest_client(ALC.Runner.parse_args(["--uuid", uuid]))
+ self.assertTrue(isinstance(c3, ALC.NativeRESTClient))
+
+ def test_get_logger(self):
+ logger = ALC.Runner.get_logger()
+ logger.info("idotlogger")
+
+ def test_new_uuid(self):
+ uuid = ALC.IRESTClient.new_uuid()
+ self.assertEqual(len(uuid), 36)
+
+ def test_make_service_url(self):
+ uuid = ALC.IRESTClient.new_uuid()
+
+ args1 = ALC.Runner.parse_args(["--url", "http://banana"])
+ client1 = ALC.DryRunRESTClient(args1)
+ self.assertEqual(client1.make_service_url(),
+ "http://banana/onboarding-api/workflow/v1.0/actions")
+
+ args2 = ALC.Runner.parse_args(["--url", "http://banana/"])
+ client2 = ALC.DryRunRESTClient(args2)
+ self.assertEqual(client2.make_service_url(),
+ "http://banana/onboarding-api/workflow/v1.0/actions")
+
+ args3 = ["--url", "http://banana/onboarding-api/workflow/v1.1/actions", "--uuid", uuid]
+ client3 = ALC.DryRunRESTClient(ALC.Runner.parse_args(args3))
+ self.assertEqual(client3.make_service_url(),
+ "http://banana/onboarding-api/workflow/v1.1/actions/{}".format(uuid))
+
+ def test_debug_curl_cmd(self):
+ cmd = ["curl", "--header", "banana", "http://something/somewhere"]
+ debug = ALC.CURLRESTClient.debug_curl_cmd(cmd)
+ self.assertEqual("curl --header \"banana\" \"http://something/somewhere\" ", debug) \ No newline at end of file
diff --git a/openecomp-be/tools/build/scripts/action_library_client/test/test_action_library_client_integration.py b/openecomp-be/tools/build/scripts/action_library_client/test/test_action_library_client_integration.py
new file mode 100644
index 0000000000..b6418e617e
--- /dev/null
+++ b/openecomp-be/tools/build/scripts/action_library_client/test/test_action_library_client_integration.py
@@ -0,0 +1,329 @@
+import sys
+import os
+import unittest
+import uuid
+import json
+import tempfile
+import action_library_client
+
+class IntegrationTest(unittest.TestCase):
+
+ HTTP = "http://10.147.97.199:8080"
+ HTTPS = "https://10.147.97.199:8443"
+
+ def setUp(self):
+ os.environ["ALC_HTTP_USER"] = "AUTH-DELETE"
+ os.environ["ALC_HTTP_PASS"] = "test"
+
+ def tearDown(self):
+ os.environ["ALC_HTTP_INSECURE"] = ""
+ os.environ["ALC_HTTP_USER"] = ""
+ os.environ["ALC_HTTP_PASS"] = ""
+
+ @staticmethod
+ def __prepare(testcase, name):
+ with open(testcase, 'r') as fin:
+ jsonk = json.loads(fin.read())
+ jsonk['name'] = name
+ with tempfile.NamedTemporaryFile(mode='w', delete=False) as temp:
+ temp.write(json.dumps(jsonk))
+ temp.flush()
+ return temp.name
+
+ @staticmethod
+ def __get_sequence():
+ with open(r'./seq.txt', 'r+') as f:
+ value = int(f.read())
+ f.seek(0)
+ f.write(str(value + 1))
+ return value
+
+ def __print_separator(self):
+ logger = action_library_client.Runner.get_logger()
+ logger.info("==================================================")
+
+ def __list(self, stdargs):
+ logger = action_library_client.Runner.get_logger()
+ list_response = action_library_client.execute(["--list"] + stdargs)
+ logger.info("--list response: {}".format(list_response))
+ self.assertTrue(isinstance(list_response, dict))
+ return list_response
+
+ def __get_action(self, list_response, ai_uuid):
+ for action in list_response['actionList']:
+ if action['actionInvariantUUID'] == ai_uuid:
+ return action
+
+ def __create_delete(self, extraargs):
+
+ logger = action_library_client.Runner.get_logger()
+
+ # Setup.
+
+ seq = IntegrationTest.__get_sequence()
+ name = "Backout{}".format(seq)
+ path = IntegrationTest.__prepare("scenarios/Backout.json", name)
+ stdargs = ["--url", self.HTTP, "--verbose"]
+ if extraargs:
+ stdargs.extend(extraargs)
+
+ # List actions.
+
+ self.__print_separator()
+ list_response1 = self.__list(stdargs)
+ self.assertTrue(isinstance(list_response1, dict))
+
+ # CREATE action.
+
+ self.__print_separator()
+ create_response = action_library_client.execute(["--create", "--in", path] + stdargs)
+ logger.info("--create response: {}".format(create_response))
+ self.assertTrue(isinstance(create_response, dict))
+ ai_uuid = create_response['actionInvariantUUID']
+ self.assertTrue(ai_uuid)
+ self.assertEquals(create_response['status'], 'Locked')
+ self.assertEquals(create_response['version'], '0.1')
+
+ # UPDATE action #1.
+
+ self.__print_separator()
+ update_response1 = action_library_client.execute(["--update", "--in", path, "--uuid", ai_uuid] + stdargs)
+ logger.info("--update response: {}".format(update_response1))
+ self.assertTrue(isinstance(update_response1, dict))
+
+ # UPDATE action #2.
+
+ self.__print_separator()
+ update_response2 = action_library_client.execute(["--update", "--in", path, "--uuid", ai_uuid] + stdargs)
+ logger.info("--update response: {}".format(update_response2))
+ self.assertTrue(isinstance(update_response2, dict))
+
+ # CHECKOUT action (usage unknown).
+
+ self.__print_separator()
+ try:
+ action_library_client.execute(["--checkout", "--uuid", ai_uuid] + stdargs)
+ self.fail("--checkout should fail")
+ except Exception as err:
+ print(err)
+
+ # CHECKIN action.
+
+ self.__print_separator()
+ checkin_response = action_library_client.execute(["--checkin", "--in", path, "--uuid", ai_uuid] + stdargs)
+ logger.info("--checkin response: {}".format(checkin_response))
+ self.assertTrue(isinstance(checkin_response, dict))
+ self.assertEquals(checkin_response['status'], 'Available')
+ self.assertEquals(checkin_response['version'], '0.1')
+
+ # SUBMIT action.
+
+ self.__print_separator()
+ submit_response = action_library_client.execute(["--submit", "--in", path, "--uuid", ai_uuid] + stdargs)
+ logger.info("--submit response: {}".format(submit_response))
+ self.assertTrue(isinstance(submit_response, dict))
+ self.assertEquals(submit_response['status'], 'Final')
+ self.assertEquals(submit_response['version'], '1.0')
+
+ # LIST again
+
+ self.__print_separator()
+ list_response2 = self.__list(stdargs)
+ action_found2 = self.__get_action(list_response2, ai_uuid)
+ self.assertTrue(action_found2)
+
+ # DELETE action.
+
+ self.__print_separator()
+ delete_response = action_library_client.execute(["--delete", "--uuid", ai_uuid] + stdargs)
+ logger.info("--delete response: {}".format(delete_response))
+ self.assertEqual(delete_response, action_library_client.ResponseCodes.OK)
+
+ # LIST yet again
+
+ self.__print_separator()
+ list_response3 = self.__list(stdargs)
+ action_found3 = self.__get_action(list_response3, ai_uuid)
+ self.assertFalse(action_found3)
+
+ def __create_undo(self, extraargs):
+
+ # Setup
+
+ logger = action_library_client.Runner.get_logger()
+ seq = IntegrationTest.__get_sequence()
+ name = "Backout{}".format(seq)
+ path = IntegrationTest.__prepare("scenarios/Backout.json", name)
+ stdargs = ["--url", self.HTTP, "--verbose"]
+
+ # CREATE action.
+
+ self.__print_separator()
+ create_response = action_library_client.execute(["--create", "--in", path] + stdargs + extraargs)
+ logger.info("--create response: {}".format(create_response))
+ self.assertTrue(isinstance(create_response, dict))
+ ai_uuid = create_response['actionInvariantUUID']
+ self.assertTrue(ai_uuid)
+ self.assertEquals(create_response['status'], 'Locked')
+ self.assertEquals(create_response['version'], '0.1')
+
+ # UNDOCHECKOUT action
+
+ self.__print_separator()
+ undocheckout_response = action_library_client.execute(["--undocheckout", "--uuid", ai_uuid] + stdargs + extraargs)
+ self.assertTrue(isinstance(undocheckout_response, dict))
+
+ def __create_list(self, extraargs):
+ # Setup
+
+ logger = action_library_client.Runner.get_logger()
+ seq = IntegrationTest.__get_sequence()
+ name = "Backout{}".format(seq)
+ path = IntegrationTest.__prepare("scenarios/Backout.json", name)
+ stdargs = ["--url", self.HTTP, "--verbose"]
+
+ # CREATE action.
+
+ self.__print_separator()
+ create_response = action_library_client.execute(["--create", "--in", path] + stdargs + extraargs)
+ logger.info("--create response: {}".format(create_response))
+ self.assertTrue(isinstance(create_response, dict))
+ ai_uuid = create_response['actionInvariantUUID']
+ self.assertTrue(ai_uuid)
+ self.assertEquals(create_response['status'], 'Locked')
+ self.assertEquals(create_response['version'], '0.1')
+
+ # CHECKIN action.
+
+ self.__print_separator()
+ checkin_response = action_library_client.execute(["--checkin", "--in", path, "--uuid", ai_uuid] +
+ stdargs + extraargs)
+ logger.info("--checkin response: {}".format(checkin_response))
+ self.assertTrue(isinstance(checkin_response, dict))
+ self.assertEquals(checkin_response['status'], 'Available')
+ self.assertEquals(checkin_response['version'], '0.1')
+
+ try:
+ # LIST.
+
+ self.__print_separator()
+ list_response1 = self.__list(stdargs + extraargs)
+ action_found1 = self.__get_action(list_response1, ai_uuid)
+ self.assertTrue(action_found1)
+
+ # LIST with UUID.
+
+ self.__print_separator()
+ list_response2 = self.__list(stdargs + extraargs + ["--uuid", ai_uuid])
+ self.assertFalse(hasattr(list_response2, 'actionList'))
+ self.assertEquals(len(list_response2['versions']), 1)
+
+ # LIST with bad UUID.
+
+ self.__print_separator()
+ list_response3 = action_library_client.execute(["--list"] + stdargs + extraargs +
+ ["--uuid", "where_the_wind_blows"])
+ if isinstance(list_response3, int):
+ self.assertEquals(action_library_client.ResponseCodes.HTTP_NOT_FOUND_ERROR, list_response3)
+ else:
+ self.assertEquals("ACT1045", list_response3["code"])
+
+ finally:
+
+ # DELETE action
+
+ self.__print_separator()
+ action_library_client.execute(["--delete", "--uuid", ai_uuid] + stdargs + extraargs)
+
+ def __http_secure(self, extraargs):
+ os.environ["ALC_HTTP_INSECURE"] = ""
+ try:
+ self.__list(["--url", self.HTTPS, "--verbose"] + extraargs)
+ if not (sys.version_info[0] == 2 and sys.version_info[1] == 6):
+ self.fail("Should fail (non-2.6) for TLS + secure")
+ except Exception:
+ pass
+
+ def __http_insecure(self, extraargs):
+ os.environ["ALC_HTTP_INSECURE"] = True
+ self.__list(["--url", self.HTTPS, "--verbose"] + extraargs)
+
+ def __no_credentials(self, extraargs):
+
+ args = ["--url", self.HTTP] + extraargs
+ self.__list(args)
+ print("OK")
+
+ os.environ["ALC_HTTP_USER"] = ""
+ os.environ["ALC_HTTP_PASS"] = ""
+ try:
+ action_library_client.execute(["--list"] + args)
+ self.fail("Should fail for missing credentials")
+ except Exception as e:
+ self.assertEquals("REST service credentials not found", e.message)
+
+ def __bad_credentials(self, extraargs):
+
+ args = ["--url", self.HTTP] + extraargs
+ self.__list(args)
+
+ os.environ["ALC_HTTP_USER"] = "wakey_wakey"
+ os.environ["ALC_HTTP_PASS"] = "rise_and_shine"
+ code = action_library_client.execute(["--list"] + args)
+ self.assertEquals(action_library_client.ResponseCodes.HTTP_FORBIDDEN_ERROR, code)
+
+ ################################################################################
+
+ def test_https_insecure_local_fail(self):
+ self.__http_secure([])
+
+ def test_https_insecure_remote_fail(self):
+ self.__http_secure(["--curl"])
+
+ def test_https_native(self):
+ self.__http_secure([])
+
+ def test_https_curl(self):
+ self.__http_secure(["--curl"])
+
+ def test_undo_checkout_native(self):
+ self.__create_undo([])
+
+ def test_undo_checkout_curl(self):
+ self.__create_undo(["--curl"])
+
+ def test_create_delete_native(self):
+ self.__create_delete([])
+
+ def test_create_delete_curl(self):
+ self.__create_delete(["--curl"])
+
+ def test_create_list_native(self):
+ self.__create_list([])
+
+ def test_create_list_curl(self):
+ self.__create_list(["--curl"])
+
+ def test_bad_credentials_native(self):
+ self.__bad_credentials([])
+
+ def test_bad_credentials_curl(self):
+ self.__bad_credentials(["--curl"])
+ #
+ def test_no_credentials_native(self):
+ self.__no_credentials([])
+
+ def test_no_credentials_curl(self):
+ self.__no_credentials(["--curl"])
+
+ def test_create_to_delete_dryrun(self):
+ ai_uuid = str(uuid.uuid4())
+ path = IntegrationTest.__prepare("scenarios/Backout.json", "Backout{}".format("001"))
+ stdargs = ["--url", self.HTTP, "--verbose", "--dryrun"]
+ action_library_client.execute(["--create", "--in", path] + stdargs)
+ action_library_client.execute(["--update", "--in", path, "--uuid", ai_uuid] + stdargs)
+ action_library_client.execute(["--checkout", "--uuid", ai_uuid] + stdargs)
+ action_library_client.execute(["--undocheckout", "--uuid", ai_uuid] + stdargs)
+ action_library_client.execute(["--checkin", "--uuid", ai_uuid] + stdargs)
+ action_library_client.execute(["--submit", "--uuid", ai_uuid] + stdargs)
+ action_library_client.execute(["--list"] + stdargs)
diff --git a/openecomp-be/tools/build/scripts/cassandra-commands.json b/openecomp-be/tools/build/scripts/cassandra-commands.json
new file mode 100644
index 0000000000..8354ff2532
--- /dev/null
+++ b/openecomp-be/tools/build/scripts/cassandra-commands.json
@@ -0,0 +1,76 @@
+{
+ "create": {
+ "version": "CREATE TYPE IF NOT EXISTS version (major int, minor int)",
+ "user_candidate_version": "CREATE TYPE IF NOT EXISTS user_candidate_version (version frozen<version>, user text)",
+ "version_info": "CREATE TABLE IF NOT EXISTS version_info (entity_type text, entity_id text, active_version frozen<version>, status text, candidate frozen<user_candidate_version>, viewable_versions set<frozen<version>>, latest_final_version frozen<version>, PRIMARY KEY (entity_type, entity_id))",
+ "version_info_deleted": "CREATE TABLE IF NOT EXISTS version_info_deleted (entity_type text, entity_id text, active_version frozen<version>, status text, candidate frozen<user_candidate_version>, viewable_versions set<frozen<version>>, latest_final_version frozen<version>, PRIMARY KEY (entity_type, entity_id))",
+ "unique_value" : "CREATE TABLE IF NOT EXISTS unique_value (type text, value text, PRIMARY KEY ((type, value)))",
+ "choice_or_other": "CREATE TYPE IF NOT EXISTS choice_or_other (result text)",
+ "multi_choice_or_other": "CREATE TYPE IF NOT EXISTS multi_choice_or_other (results set<text>)",
+ "vendor_license_model": "CREATE TABLE IF NOT EXISTS vendor_license_model (vlm_id text, version frozen<version>, vendor_name text, description text, icon text, PRIMARY KEY ((vlm_id, version)))",
+ "license_agreement": "CREATE TABLE IF NOT EXISTS license_agreement (vlm_id text, version frozen<version>, la_id text, name text, description text, lic_term frozen<choice_or_other>, req_const text, fg_ids set<text>, PRIMARY KEY ((vlm_id, version), la_id))",
+ "feature_group": "CREATE TABLE IF NOT EXISTS feature_group (vlm_id text, version frozen<version>, fg_id text, name text, description text, part_num text, ep_ids set<text>, lkg_ids set<text>, ref_la_ids set<text>, PRIMARY KEY ((vlm_id, version), fg_id))",
+ "license_key_group": "CREATE TABLE IF NOT EXISTS license_key_group (vlm_id text, version frozen<version>, lkg_id text,name text,description text, type text, operational_scope frozen<multi_choice_or_other>, ref_fg_ids set<text>, version_uuid text, PRIMARY KEY ((vlm_id, version), lkg_id))",
+ "entitlement_pool": "CREATE TABLE IF NOT EXISTS entitlement_pool (vlm_id text, version frozen<version>, ep_id text,name text,description text,threshold float,threshold_unit text,entitlement_metric frozen<choice_or_other>,increments text,aggregation_func frozen<choice_or_other>, operational_scope frozen<multi_choice_or_other>, time frozen<choice_or_other>,manufacturer_ref_num text,ref_fg_ids set<text>, version_uuid text, PRIMARY KEY ((vlm_id, version), ep_id))",
+ "vsp_information": "CREATE TABLE IF NOT EXISTS vsp_information (VSP_ID text, version frozen<version>, NAME text,DESCRIPTION text,CATEGORY text,SUB_CATEGORY text,ICON text,PACKAGE_NAME text,PACKAGE_VERSION text,vendor_name text, vendor_id text,LICENSE_AGREEMENT text,FEATURE_GROUPS list<text>,VALIDATION_DATA text,CONTENT_DATA blob, questionnaire_data text, vlm_version frozen<version>, PRIMARY KEY ((VSP_ID, version)))",
+ "package_details": "CREATE TABLE IF NOT EXISTS package_details (VSP_ID text, version frozen<version>,DISPLAY_NAME text,vsp_name text,vsp_description text,VENDOR_NAME text,CATEGORY text,SUB_CATEGORY text,VENDOR_RELEASE text,PACKAGE_CHECKSUM text,PACKAGE_TYPE text,TRANSLATE_CONTENT blob,PRIMARY KEY ((VSP_ID, version)))",
+ "vsp_network": "CREATE TABLE IF NOT EXISTS vsp_network (vsp_id text, version frozen<version>, network_id text, composition_data text, questionnaire_data text, PRIMARY KEY ((vsp_id, version), network_id))",
+ "vsp_component": "CREATE TABLE IF NOT EXISTS vsp_component (vsp_id text, version frozen<version>, component_id text, composition_data text, questionnaire_data text, PRIMARY KEY ((vsp_id, version), component_id))",
+ "vsp_component_nic": "CREATE TABLE IF NOT EXISTS vsp_component_nic (vsp_id text, version frozen<version>, component_id text, nic_id text, composition_data text, questionnaire_data text, PRIMARY KEY ((vsp_id, version), component_id, nic_id))",
+ "vsp_process" : "CREATE TABLE IF NOT EXISTS vsp_process (vsp_id text, version frozen<version>, component_id text, process_id text, name text, description text, artifact_name text, artifact blob, PRIMARY KEY ((vsp_id, version), component_id, process_id))",
+ "vsp_service_artifact" : "CREATE TABLE IF NOT EXISTS vsp_service_artifact (vsp_id text, version frozen<version>, name text, content_data blob, PRIMARY KEY ((vsp_id, version), name))",
+ "vsp_service_template" : "CREATE TABLE IF NOT EXISTS vsp_service_template (vsp_id text, version frozen<version>, base_name text static, name text, content_data blob, PRIMARY KEY ((vsp_id, version), name))",
+ "vsp_enriched_service_template" : "CREATE TABLE IF NOT EXISTS vsp_enriched_service_template (vsp_id text, version frozen<version>, base_name text static, name text, content_data blob, PRIMARY KEY ((vsp_id, version), name))",
+ "vsp_enriched_service_artifact" : "CREATE TABLE IF NOT EXISTS vsp_enriched_service_artifact (vsp_id text, version frozen<version>, name text, content_data blob, PRIMARY KEY ((vsp_id, version), name))",
+ "application_config" : "CREATE TABLE IF NOT EXISTS application_config (namespace text, key text, value text, PRIMARY KEY (namespace, key))",
+ "action" : "CREATE TABLE IF NOT EXISTS dox.Action (actionUUID text, actionInvariantUUID text, version frozen<version>, status text, name text, vendor_list set<text>, category_list set<text>, timestamp timestamp, user text, supportedModels set<text>, supportedComponents set<text>, data text, PRIMARY KEY ((actionInvariantUUID, version)))",
+ "supportedComponents_index" : "CREATE INDEX IF NOT EXISTS action_supportedComponents ON dox.Action (supportedComponents)",
+ "category_list_index" : "CREATE INDEX IF NOT EXISTS action_category_list ON dox.Action (category_list)",
+ "supportedModels_index" : "CREATE INDEX IF NOT EXISTS action_supportedModels ON dox.Action (supportedModels)",
+ "vendor_list_index" : "CREATE INDEX IF NOT EXISTS action_vendor_list ON dox.Action (vendor_list)",
+ "actionUUID_index" : "CREATE INDEX IF NOT EXISTS action_actionUUID ON dox.Action (actionUUID)",
+ "ecomp_component": "CREATE TABLE IF NOT EXISTS dox.ecompcomponent(id text PRIMARY KEY, name text)",
+ "vsp_component_artifact": "CREATE TABLE IF NOT EXISTS vsp_component_artifact (vsp_id text, version frozen<version>, component_id text, artifact_type text, artifact_id text, name text, description text, artifact blob, PRIMARY KEY ((vsp_id, version), component_id, artifact_type, artifact_id))",
+ "name_index": "CREATE INDEX IF NOT EXISTS action_name ON dox.Action (name)",
+ "action_artifact":"CREATE TABLE IF NOT EXISTS action_artifact(artifactuuid text, effective_version int, artifact blob, PRIMARY KEY(artifactuuid, effective_version)) WITH CLUSTERING ORDER BY (effective_version DESC)"
+ },
+ "drop": {
+ "version_info": "DROP TABLE IF EXISTS version_info",
+ "version_info_deleted": "DROP TABLE IF EXISTS version_info_deleted",
+ "unique_value": "DROP TABLE IF EXISTS unique_value",
+ "entitlement_pool": "DROP TABLE IF EXISTS entitlement_pool",
+ "vendor_license_model": "DROP TABLE IF EXISTS vendor_license_model",
+ "license_agreement": "DROP TABLE IF EXISTS license_agreement",
+ "feature_group": "DROP TABLE IF EXISTS feature_group",
+ "license_key_group": "DROP TABLE IF EXISTS license_key_group",
+ "vsp_information": "DROP TABLE IF EXISTS vsp_information",
+ "package_details": "DROP TABLE IF EXISTS package_details",
+ "vsp_network": "DROP TABLE IF EXISTS vsp_network",
+ "vsp_component": "DROP TABLE IF EXISTS vsp_component",
+ "vsp_component_nic": "DROP TABLE IF EXISTS vsp_component_nic",
+ "vsp_process":"DROP TABLE IF EXISTS vsp_process",
+ "choice_or_other": "DROP TYPE IF EXISTS choice_or_other",
+ "multi_choice_or_other": "DROP TYPE IF EXISTS multi_choice_or_other",
+ "application_config" : "DROP TABLE IF EXISTS application_config",
+ "vsp_service_artifact" :"DROP TABLE IF EXISTS vsp_service_artifact",
+ "vsp_service_template" :"DROP TABLE IF EXISTS vsp_service_template",
+ "vsp_enriched_service_artifact" :"DROP TABLE IF EXISTS vsp_enriched_service_artifact",
+ "vsp_enriched_service_template" :"DROP TABLE IF EXISTS vsp_enriched_service_template",
+ "action" : "DROP TABLE IF EXISTS action",
+ "supportedComponents_index" : "DROP INDEX IF EXISTS dox.action_supportedComponents",
+ "category_list_index" : "DROP INDEX IF EXISTS dox.action_category_list",
+ "supportedModels_index" : "DROP INDEX IF EXISTS dox.action_supportedModels",
+ "vendor_list_index" : "DROP INDEX IF EXISTS dox.action_vendor_list",
+ "actionUUID_index" : "DROP INDEX IF EXISTS dox.action_actionUUID",
+ "name_index" : "DROP INDEX IF EXISTS dox.action_name",
+ "ecomp_component": "DROP TABLE IF EXISTS dox.ecompcomponent",
+ "vsp_component_artifact": "DROP TABLE IF EXISTS dox.vsp_component_artifact",
+ "action_artifact":"DROP TABLE IF EXISTS action_artifact"
+ },
+ "alter": {
+ "vsp_information": "ALTER TABLE vsp_information ADD questionnaire_data text",
+ "vsp_information_1": "ALTER TABLE vsp_information ADD vlm_version frozen<version>",
+ "entitlement_pool": "alter table entitlement_pool ADD version_uuid text",
+ "license_key_group": "alter table license_key_group ADD version_uuid text"
+ }
+}
diff --git a/openecomp-be/tools/build/scripts/generate-application-config-insert-cql.sh b/openecomp-be/tools/build/scripts/generate-application-config-insert-cql.sh
new file mode 100644
index 0000000000..e4e1ff0075
--- /dev/null
+++ b/openecomp-be/tools/build/scripts/generate-application-config-insert-cql.sh
@@ -0,0 +1,64 @@
+#/bin/sh
+
+##############################################################################
+###
+### generate-application-config-insert-cql.sh
+###
+### A script that generates the CQL commands to INSERT validation schemas to the application_config table.
+### We keep the schemas FTL files under a folder - this folder will be parsed and INSERT commands will be created.
+###
+### If the path is 'schemaTemplates/composition/myFile.ftl' the result KEY will be: composition.myFile .
+###
+### Usage:
+###
+### ./generate-application-config-insert-cql.sh <namespace> <schemas-folder>
+###
+###
+### Author: Avi Ziv
+### Version 1.0 for OPENECOMP
+### Date: 10 Aug 2016
+###
+##############################################################################
+
+#GLOBALS
+
+APP_CONFIG_TABLE='application_config'
+
+#### Functions - Start ####
+usage() { echo "Usage: $0 <namespace> <schemaTemplates-folder>, for example: $0 vsp.schemaTemplates schemaTemplates/" 1>&2; exit 1; }
+
+getFileContent()
+{
+ file=$1
+ str=$(<$file)
+ echo $str
+}
+
+
+main()
+{
+ namespace=$1
+ path=$2
+ for fileName in $(find ${path} -type f)
+ do
+ value=$(getFileContent ${fileName})
+ onlyFilename=$(basename $fileName)
+ name="${onlyFilename%.*}"
+ tempPath=$(dirname $fileName)
+ keyColumn=$(basename $tempPath).$name
+ echo "INSERT INTO $APP_CONFIG_TABLE (namespace,key,value) VALUES ('$namespace', '$keyColumn', '$value');"
+ done
+
+
+exit 0
+}
+
+#### Functions - End ####
+
+# Check arguements
+if [ "$#" -lt 2 ] || [ "$#" -gt 2 ]; then
+ usage
+fi
+
+
+main $1 $2
diff --git a/openecomp-be/tools/build/scripts/generate-cassandra-alter-cql.sh b/openecomp-be/tools/build/scripts/generate-cassandra-alter-cql.sh
new file mode 100644
index 0000000000..827b3ab330
--- /dev/null
+++ b/openecomp-be/tools/build/scripts/generate-cassandra-alter-cql.sh
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+##############################################################################
+###
+### generate-cassandra-alter-cql.sh
+###
+### A script that generates the CQL commands of ALTER for the Cassnadra init.
+###
+### Usage:
+###
+### ./generate-cassandra-alter-cql.sh cassandra-commands.json
+###
+###
+### Author: Avi Ziv
+### Version 2.0 for OPENECOMP
+### Date: 21 Sep 2016
+###
+##############################################################################
+
+#GLOBALS
+
+RUN_PATH=$(cd "$(dirname "$0")" && pwd)
+
+#### Functions - Start ####
+usage() { echo "Usage: $0 <db-cql-json-file>, for example: $0 cassandra-commands.json" 1>&2; exit 1; }
+
+main()
+{
+ echo "USE dox;"
+ $RUN_PATH/parse-json.py -t alter -f $1
+}
+
+#### Functions - End ####
+
+# Check arguements
+if [ "$#" -lt 1 ] || [ "$#" -gt 1 ]; then
+ usage
+fi
+
+main $1
diff --git a/openecomp-be/tools/build/scripts/generate-cassandra-drop-cql.sh b/openecomp-be/tools/build/scripts/generate-cassandra-drop-cql.sh
new file mode 100644
index 0000000000..ddbf846b30
--- /dev/null
+++ b/openecomp-be/tools/build/scripts/generate-cassandra-drop-cql.sh
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+##############################################################################
+###
+### generate-cassandra-drop-cql.sh
+###
+### A script that generates the CQL commands of DROP for the Cassnadra init.
+###
+### Usage:
+###
+### ./generate-cassandra-init-cql.sh cassandra-commands.json
+###
+###
+### Author: Avi Ziv
+### Version 1.0 for OPENECOMP
+### Date: 21 Sep 2016
+###
+##############################################################################
+
+#GLOBALS
+
+RUN_PATH=$(cd "$(dirname "$0")" && pwd)
+
+#### Functions - Start ####
+usage() { echo "Usage: $0 <db-cql-json-file>, for example: $0 cassandra-commands.json" 1>&2; exit 1; }
+
+main()
+{
+ echo "USE dox;"
+ $RUN_PATH/parse-json.py -t drop -f $1
+}
+
+#### Functions - End ####
+
+# Check arguements
+if [ "$#" -lt 1 ] || [ "$#" -gt 1 ]; then
+ usage
+fi
+
+main $1
diff --git a/openecomp-be/tools/build/scripts/generate-cassandra-init-cql.sh b/openecomp-be/tools/build/scripts/generate-cassandra-init-cql.sh
new file mode 100644
index 0000000000..65af5a51ae
--- /dev/null
+++ b/openecomp-be/tools/build/scripts/generate-cassandra-init-cql.sh
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+##############################################################################
+###
+### generate-cassandra-init-cql.sh
+###
+### A script that generates the CQL commands of CREATE for the Cassnadra init.
+###
+### Usage:
+###
+### ./generate-cassandra-init-cql.sh cassandra-commands.json
+###
+###
+### Author: Avi Ziv
+### Version 2.0 for OPENECOMP
+### Date: 21 Sep 2016, added support for keyspace yes/no for OPENECOMP DevOps build
+###
+##############################################################################
+
+#GLOBALS
+
+RUN_PATH=$(cd "$(dirname "$0")" && pwd)
+
+#### Functions - Start ####
+usage() { echo "Usage: $0 <db-cql-json-file> keyspace yes/no, for example: $0 cassandra-commands.json keyspace yes" 1>&2; exit 1; }
+
+main()
+{
+ if [ $3 == 'yes' ]; then
+ echo "CREATE KEYSPACE IF NOT EXISTS dox WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 3 };"
+ fi
+ echo "USE dox;"
+ $RUN_PATH/parse-json.py -t create -f $1
+
+}
+
+#### Functions - End ####
+
+# Check arguements
+if [ "$#" -lt 1 ] || [ "$#" -gt 3 ]; then
+ usage
+fi
+
+main $1 $2 $3
diff --git a/openecomp-be/tools/build/scripts/parse-json.py b/openecomp-be/tools/build/scripts/parse-json.py
new file mode 100644
index 0000000000..46537ceac5
--- /dev/null
+++ b/openecomp-be/tools/build/scripts/parse-json.py
@@ -0,0 +1,83 @@
+#!/usr/bin/python
+
+##############################################################################
+###
+### parse-json.py
+###
+### A utility to parse a cassnadra-commands file and return the commands per type
+### An Example for a json file:
+### {
+### "create":{
+### "choice_or_other":"CREATE TYPE IF NOT EXISTS choice_or_other (results text)",
+### "vendor_license_model": "CREATE TABLE IF NOT EXISTS vendor_license_model (vlm_id text PRIMARY KEY, name text, description text, icon text)",
+### "license_agreement": "CREATE TABLE IF NOT EXISTS license_agreement (vlm_id text, la_id text, name text, description text, type text, contract text, req_const text, fg_ids set<text>, PRIMARY KEY (vlm_id, la_id))",
+### "feature_group": "CREATE TABLE IF NOT EXISTS feature_group (vlm_id text, fg_id text, name text, description text, ep_ids set<text>, lkg_ids set<text>, refd_by_las set<text>, PRIMARY KEY (vlm_id, fg_id))",
+### "license_key_group": "CREATE TABLE IF NOT EXISTS license_key_group (vlm_id text,lkg_id text,name text,description text, type text, operational_scope text, ref_fgs set<text>,PRIMARY KEY (vlm_id, lkg_id))",
+### }
+### }
+###
+### The return for "create" will be:
+### CREATE TYPE IF NOT EXISTS choice_or_other (results text)
+### CREATE TABLE IF NOT EXISTS vendor_license_model (vlm_id text PRIMARY KEY, name text, description text, icon text)
+### CREATE TABLE IF NOT EXISTS license_agreement (vlm_id text, la_id text, name text, description text, type text, contract text, req_const text, fg_ids set<text>, PRIMARY KEY (vlm_id, la_id))
+### CREATE TABLE IF NOT EXISTS feature_group (vlm_id text, fg_id text, name text, description text, ep_ids set<text>, lkg_ids set<text>, refd_by_las set<text>, PRIMARY KEY (vlm_id, fg_id))
+### CREATE TABLE IF NOT EXISTS license_key_group (vlm_id text,lkg_id text,name text,description text, type text, operational_scope text, ref_fgs set<text>,PRIMARY KEY (vlm_id, lkg_id))
+### Usage:
+###
+### parse-json.py -t create -f cassandra-commands.json
+###
+### For example:
+###
+###
+### Author: Avi Ziv
+### Version 1.0
+### Date: 3 May 2016
+###
+##############################################################################
+
+import sys, getopt
+import json as json
+from collections import OrderedDict
+
+
+def readJsonFile(file, type):
+ with open(file, 'r') as f:
+ data = json.load(f, object_pairs_hook=OrderedDict)
+ return data[type]
+
+def printJsonTypeEntries(jsonData):
+ for i in jsonData.keys():
+ print jsonData[i] + ';'
+
+
+def usage():
+ print 'parseJsonFile.py [-f <json-file> & -t <cql-type: drop|create|insert|update|select]'
+
+def main(argv):
+ action = ''
+
+ try:
+ opts, args = getopt.getopt(argv, "h:f:t:")
+ except getopt.GetoptError:
+ usage()
+ sys.exit(2)
+ for opt, arg in opts:
+ if opt == '-h':
+ usage()
+ sys.exit()
+ elif opt == '-f':
+ jsonFile = arg
+ action = 'file'
+ elif opt == '-t':
+ type = arg
+
+ if action == 'file':
+ sJson = readJsonFile(jsonFile, type)
+ printJsonTypeEntries(sJson)
+ sys.exit()
+ else:
+ usage()
+
+
+if __name__ == "__main__":
+ main(sys.argv[1:])
diff --git a/openecomp-be/tools/install/database/monitoring/component/ceilometer.ftl b/openecomp-be/tools/install/database/monitoring/component/ceilometer.ftl
new file mode 100644
index 0000000000..6cf3dfdb66
--- /dev/null
+++ b/openecomp-be/tools/install/database/monitoring/component/ceilometer.ftl
@@ -0,0 +1,67 @@
+{
+ "ceilometerInfoList": [
+ {
+ "name": "instance",
+ "type": "Gauge",
+ "unit": "instance",
+ "category": "compute",
+ "description": "Existence of instance"
+ },
+ {
+ "name": "instance:type",
+ "type": "Gauge",
+ "unit": "instance",
+ "category": "compute",
+ "description": "Existence of instance <type> (OpenStack types)"
+ },
+ {
+ "name": "memory",
+ "type": "Gauge",
+ "unit": "MB",
+ "category": "compute",
+ "description": "Volume of RAM allocated to the instance"
+ },
+ {
+ "name": "memory.usage",
+ "type": "Gauge",
+ "unit": "MB",
+ "category": "compute",
+ "description": "Volume of RAM used by the instance from the amount of its allocated memory"
+ },
+ {
+ "name": "memory.resident",
+ "type": "Gauge",
+ "unit": "MB",
+ "category": "compute",
+ "description": "Volume of RAM used by the instance on the physical machine"
+ },
+ {
+ "name": "cpu",
+ "type": "Cumulative",
+ "unit": "ns",
+ "category": "compute",
+ "description": "CPU time used"
+ },
+ {
+ "name": "cpu_util",
+ "type": "Gauge",
+ "unit": "%",
+ "category": "compute",
+ "description": "Average CPU utilization"
+ },
+ {
+ "name": "cpu.delta",
+ "type": "Delta",
+ "unit": "ns",
+ "category": "compute",
+ "description": "CPU time used since previous datapoint"
+ },
+ {
+ "name": "vcpus",
+ "type": "Gauge",
+ "unit": "ms",
+ "category": "compute",
+ "description": "Average disk latency"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/tools/install/database/schemaTemplates/composition/component.ftl b/openecomp-be/tools/install/database/schemaTemplates/composition/component.ftl
new file mode 100644
index 0000000000..1c0cb4eb8a
--- /dev/null
+++ b/openecomp-be/tools/install/database/schemaTemplates/composition/component.ftl
@@ -0,0 +1,28 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"<#if !manual>,
+ "enum": [
+ "${component.name}"
+ ],
+ "default": "${component.name}"</#if>
+ },
+ "displayName": {
+ "type": "string"<#if !manual && component.displayName??>,
+ "enum": [
+ "${component.displayName}"
+ ],
+ "default": "${component.displayName}"</#if>
+ },
+ "description": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false,
+ "required": [
+ "name"<#if !manual && component.displayName??>,
+ "displayName"</#if>
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/tools/install/database/schemaTemplates/composition/network.ftl b/openecomp-be/tools/install/database/schemaTemplates/composition/network.ftl
new file mode 100644
index 0000000000..1193992923
--- /dev/null
+++ b/openecomp-be/tools/install/database/schemaTemplates/composition/network.ftl
@@ -0,0 +1,25 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"<#if !manual>,
+ "enum": [
+ "${network.name}"
+ ],
+ "default": "${network.name}"</#if>
+ },
+ "dhcp": {
+ "type": "boolean"<#if !manual>,
+ "enum": [
+ ${network.dhcp?c}
+ ],
+ "default": ${network.dhcp?c}</#if>
+ }
+ },
+ "additionalProperties": false,
+ "required": [
+ "name",
+ "dhcp"
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/tools/install/database/schemaTemplates/composition/nic.ftl b/openecomp-be/tools/install/database/schemaTemplates/composition/nic.ftl
new file mode 100644
index 0000000000..6111348f88
--- /dev/null
+++ b/openecomp-be/tools/install/database/schemaTemplates/composition/nic.ftl
@@ -0,0 +1,36 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"<#if !manual>,
+ "enum": [
+ "${nic.name}"
+ ],
+ "default": "${nic.name}"
+ </#if>
+ },
+ "description": {
+ "type": "string"
+ }<#if !manual><#if nic.networkId??>,
+ "networkId": {
+ "type": "string",
+ "enum": [
+ "${nic.networkId}"
+ ],
+ "default": "${nic.networkId}"
+ }
+ </#if><#else>,
+ "networkId": {
+ "type": "string",
+ "enum": [<#list networkIds as networkId>
+ "${networkId}"<#sep>,</#list>
+ ]
+ }
+ </#if>
+ },
+ "additionalProperties": false,
+ "required": [
+ "name"
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/tools/install/database/schemaTemplates/questionnaire/component.ftl b/openecomp-be/tools/install/database/schemaTemplates/questionnaire/component.ftl
new file mode 100644
index 0000000000..540afca430
--- /dev/null
+++ b/openecomp-be/tools/install/database/schemaTemplates/questionnaire/component.ftl
@@ -0,0 +1,327 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type": "object",
+ "properties": {
+ "general": {
+ "type": "object",
+ "properties": {
+ "hypervisor": {
+ "type": "object",
+ "properties": {
+ "hypervisor": {
+ "type": "string",
+ "enum": [
+ "KVM",
+ "VMWare ESXi"
+ ],
+ "default": "KVM"
+ },
+ "drivers": {
+ "type": "string",
+ "maxLength": 300,
+ "pattern": "^[A-Za-z0-9_,-]*$"
+ },
+ "containerFeaturesDescription": {
+ "type": "string",
+ "maxLength": 1000,
+ "pattern": "^[A-Za-z0-9_, -]*$"
+ }
+ },
+ "additionalProperties": false
+ },
+ "image": {
+ "type": "object",
+ "properties": {
+ "format": {
+ "type": "string",
+ "enum": [
+ "aki",
+ "ami",
+ "ari",
+ "iso",
+ "qcow2",
+ "raw",
+ "vdi",
+ "vhd",
+ "vmdk"
+ ],
+ "default": "qcow2"
+ },
+ "providedBy": {
+ "type": "string",
+ "enum": [
+ "Vendor"
+ ],
+ "default": "Vendor"
+ },
+ "bootDiskSizePerVM": {
+ "type": "number",
+ "maximum": 100
+ },
+ "ephemeralDiskSizePerVM": {
+ "type": "number",
+ "maximum": 400
+ }
+ },
+ "additionalProperties": false
+ },
+ "recovery": {
+ "type": "object",
+ "properties": {
+ "pointObjective": {
+ "type": "number",
+ "minimum": 0,
+ "exclusiveMinimum": true,
+ "maximum": 15,
+ "exclusiveMaximum ": true
+ },
+ "timeObjective": {
+ "type": "number",
+ "minimum": 0,
+ "exclusiveMinimum": true,
+ "maximum": 300,
+ "exclusiveMaximum ": true
+ },
+ "vmProcessFailuresHandling": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "dnsConfiguration": {
+ "type": "string"
+ },
+ "vmCloneUsage": {
+ "type": "string",
+ "maximum": 300
+ }
+ },
+ "additionalProperties": false
+ },
+ "compute": {
+ "type": "object",
+ "properties": {
+ "vmSizing": {
+ "type": "object",
+ "properties": {
+ "numOfCPUs": {
+ "type": "number",
+ "minimum": 0,
+ "exclusiveMinimum": true,
+ "maximum": 16,
+ "default": 2
+ },
+ "fileSystemSizeGB": {
+ "type": "number",
+ "minimum": 0,
+ "exclusiveMinimum": true,
+ "default": 5
+ },
+ "persistentStorageVolumeSize": {
+ "type": "number",
+ "minimum": 0,
+ "exclusiveMinimum": true
+ },
+ "IOOperationsPerSec": {
+ "type": "number",
+ "minimum": 0,
+ "exclusiveMinimum": true
+ }
+ },
+ "additionalProperties": false
+ },
+ "numOfVMs": {
+ "type": "object",
+ "properties": {
+ "minimum": {
+ "type": "number",
+ "minimum": 0,
+ "exclusiveMinimum": true,
+ "maximum": 100
+ },
+ "maximum": {
+ "type": "number",
+ "minimum": <#if (componentQuestionnaireData.compute.numOfVMs.minimum)??
+ && (componentQuestionnaireData.compute.numOfVMs.minimum)?is_number
+ && ((componentQuestionnaireData.compute.numOfVMs.minimum) > 0
+ && (componentQuestionnaireData.compute.numOfVMs.minimum) <= 100)>
+ ${componentQuestionnaireData.compute.numOfVMs.minimum}<#else>
+ 0</#if> ,
+ "exclusiveMinimum": true,
+ "maximum": 100
+ },
+ "CpuOverSubscriptionRatio": {
+ "type": "string",
+ "enum": [
+ "1:1",
+ "4:1",
+ "16:1"
+ ],
+ "default": "4:1"
+ },
+ "MemoryRAM": {
+ "type": "string",
+ "enum": [
+ "2 GB",
+ "4 GB",
+ "8 GB"
+ ],
+ "default": "2 GB"
+ }
+ },
+ "additionalProperties": false
+ },
+ "guestOS": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "maxLength": 50
+ },
+ "bitSize": {
+ "type": "number",
+ "enum": [
+ 64,
+ 32
+ ],
+ "default": 64
+ },
+ "tools": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "highAvailabilityAndLoadBalancing": {
+ "type": "object",
+ "properties": {
+ "failureLoadDistribution": {
+ "type": "string",
+ "maxLength": 1000
+ },
+ "nkModelImplementation": {
+ "type": "string",
+ "maxLength": 1000
+ },
+ "architectureChoice": {
+ "type": "string",
+ "maxLength": 1000
+ },
+ "slaRequirements": {
+ "type": "string",
+ "maxLength": 1000
+ },
+ "horizontalScaling": {
+ "type": "string",
+ "maxLength": 1000
+ },
+ "loadDistributionMechanism": {
+ "type": "string",
+ "maxLength": 1000
+ }
+ },
+ "additionalProperties": false
+ },
+ "network": {
+ "type": "object",
+ "properties": {
+ "networkCapacity": {
+ "type": "object",
+ "properties": {
+ "protocolWithHighestTrafficProfileAcrossAllNICs": {
+ "type": "string",
+ "enum": [
+ "",
+ "TCP",
+ "UDP",
+ "SCTP",
+ "IPsec"
+ ],
+ "default": ""
+ },
+ "networkTransactionsPerSecond": {
+ "type": "number"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "storage": {
+ "type": "object",
+ "properties": {
+ "backup": {
+ "type": "object",
+ "properties": {
+ "backupType": {
+ "type": "string",
+ "enum": [
+ "On Site",
+ "Off Site"
+ ],
+ "default": "On Site"
+ },
+ "backupStorageSize": {
+ "type": "number"
+ },
+ "backupSolution": {
+ "type": "string"
+ },
+ "backupNIC": {
+ "type": "string",
+ "enum": [
+ "", <#if nicNames??><#list nicNames as nicName>
+ "${nicName}"<#sep>,</#list></#if>
+ ],
+ "default": ""
+ }
+ },
+ "additionalProperties": false
+ },
+ "snapshotBackup": {
+ "type": "object",
+ "properties": {
+ "snapshotFrequency": {
+ "type": "number",
+ "default": 24,
+ "minimum": 1,
+ "exclusiveMinimum": true
+ }
+ },
+ "additionalProperties": false
+ },
+ "logBackup": {
+ "type": "object",
+ "properties": {
+ "sizeOfLogFiles": {
+ "type": "number",
+ "maximum": 5,
+ "exclusiveMaximum": true
+ },
+ "logBackupFrequency": {
+ "type": "number",
+ "maximum": 4,
+ "exclusiveMaximum": true
+ },
+ "logRetentionPeriod": {
+ "type": "number",
+ "maximum": 15,
+ "exclusiveMaximum": true
+ },
+ "logFileLocation": {
+ "type": "string",
+ "maxLength": 300
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+} \ No newline at end of file
diff --git a/openecomp-be/tools/install/database/schemaTemplates/questionnaire/nic.ftl b/openecomp-be/tools/install/database/schemaTemplates/questionnaire/nic.ftl
new file mode 100644
index 0000000000..f5ea08b98a
--- /dev/null
+++ b/openecomp-be/tools/install/database/schemaTemplates/questionnaire/nic.ftl
@@ -0,0 +1,120 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type": "object",
+ "properties": {
+ "protocols": {
+ "type": "object",
+ "properties": {
+ "protocols": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "",
+ "TCP",
+ "UDP",
+ "SCTP",
+ "IPsec"
+ ],
+ "default": ""
+ },
+ "minItems": 1
+ },
+ "protocolWithHighestTrafficProfile": {
+ "$ref": "#/properties/protocols/properties/protocols/items"
+ }
+ },
+ "additionalProperties": false
+ },
+ "ipConfiguration": {
+ "type": "object",
+ "properties": {
+ "ipv4Required": {
+ "type": "boolean",
+ "default": true
+ },
+ "ipv6Required": {
+ "type": "boolean",
+ "default": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "network": {
+ "type": "object",
+ "properties": {
+ "networkDescription": {
+ "type": "string",
+ "pattern": "[A-Za-z]+",
+ "maxLength": 300
+ }
+ },
+ "additionalProperties": false
+ },
+ "sizing": {
+ "type": "object",
+ "definitions": {
+ "peakAndAvg": {
+ "type": "object",
+ "properties": {
+ "peak": {
+ "type": "number"
+ },
+ "avg": {
+ "type": "number"
+ }
+ },
+ "additionalProperties": false
+ },
+ "packetsAndBytes": {
+ "type": "object",
+ "properties": {
+ "packets": {
+ "$ref": "#/properties/sizing/definitions/peakAndAvg"
+ },
+ "bytes": {
+ "$ref": "#/properties/sizing/definitions/peakAndAvg"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "properties": {
+ "describeQualityOfService": {
+ "type": "string"
+ },
+ "inflowTrafficPerSecond": {
+ "$ref": "#/properties/sizing/definitions/packetsAndBytes"
+ },
+ "outflowTrafficPerSecond": {
+ "$ref": "#/properties/sizing/definitions/packetsAndBytes"
+ },
+ "flowLength": {
+ "$ref": "#/properties/sizing/definitions/packetsAndBytes"
+ },
+ "acceptableJitter": {
+ "type": "object",
+ "properties": {
+ "mean": {
+ "type": "number"
+ },
+ "max": {
+ "type": "number"
+ },
+ "variable": {
+ "type": "number"
+ }
+ },
+ "additionalProperties": false
+ },
+ "acceptablePacketLoss": {
+ "type": "number",
+ "minimum": 0,
+ "maximum": 100
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+} \ No newline at end of file
diff --git a/openecomp-be/tools/install/database/schemaTemplates/questionnaire/vsp.ftl b/openecomp-be/tools/install/database/schemaTemplates/questionnaire/vsp.ftl
new file mode 100644
index 0000000000..6b1502c4a2
--- /dev/null
+++ b/openecomp-be/tools/install/database/schemaTemplates/questionnaire/vsp.ftl
@@ -0,0 +1,89 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type": "object",
+ "properties": {
+ "general": {
+ "type": "object",
+ "properties": {
+ "affinityData": {
+ "type": "string",
+ "enum": [
+ "",
+ "Affinity",
+ "Anti Affinity",
+ "None"
+ ],
+ "default": ""
+ },
+ "availability": {
+ "type": "object",
+ "properties": {
+ "useAvailabilityZonesForHighAvailability": {
+ "type": "boolean",
+ "default": false
+ }
+ },
+ "additionalProperties": false
+ },
+ "regionsData": {
+ "type": "object",
+ "properties": {
+ "multiRegion": {
+ "type": "boolean",
+ "default": false
+ },
+ "regions": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "",
+ "1",
+ "2",
+ "3",
+ "4",
+ "5",
+ "6",
+ "7",
+ "8",
+ "9"
+ ],
+ "default": ""
+ }
+ }
+ },
+ "additionalProperties": false
+ },
+ "storageDataReplication": {
+ "type": "object",
+ "properties": {
+ "storageReplicationAcrossRegion": {
+ "type": "boolean",
+ "default": false
+ },
+ "storageReplicationSize": {
+ "type": "number",
+ "maximum": 100,
+ "exclusiveMaximum": true
+ },
+ "storageReplicationFrequency": {
+ "type": "number",
+ "minimum": 5
+ },
+ "storageReplicationSource": {
+ "type": "string",
+ "maxLength": 300
+ },
+ "storageReplicationDestination": {
+ "type": "string",
+ "maxLength": 300
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+} \ No newline at end of file
diff --git a/openecomp-be/tools/migration/1607_to_1610.py b/openecomp-be/tools/migration/1607_to_1610.py
new file mode 100644
index 0000000000..2cec48b04d
--- /dev/null
+++ b/openecomp-be/tools/migration/1607_to_1610.py
@@ -0,0 +1,281 @@
+#!/usr/bin/python
+import os
+import sys,json,datetime,time,types,httplib,re
+import mimetypes
+
+DEFAULT_HOST = "127.0.0.1"
+OPENECOMP_BE = "127.0.0.1"
+
+HOST = DEFAULT_HOST
+DEFAULT_PORT = "8080"
+DEFAULT_USERNAME = "cs0008"
+DEFAULT_PASSWORD = "cs0008"
+
+ONBOARD_BASE_PATH = "/onboarding-api/v1.0"
+VSP_LIST_PATH = "{0}/vendor-software-products".format(ONBOARD_BASE_PATH)
+VSP_ACTIONS_PATH = "{0}/vendor-software-products/{{vspId}}/actions".format(ONBOARD_BASE_PATH)
+VSP_UPLOAD_PATH = "{0}/vendor-software-products/{{vspId}}/upload".format(ONBOARD_BASE_PATH)
+VSP_DOWNLOAD_PATH = "{0}/vendor-software-products/{{vspId}}/downloadHeat".format(ONBOARD_BASE_PATH)
+VSP_GET_URL = "{0}/vendor-software-products/{{vspId}}".format(ONBOARD_BASE_PATH)
+
+def main(argv):
+ username=DEFAULT_USERNAME
+ password=DEFAULT_PASSWORD
+ host=DEFAULT_HOST
+
+ if not argv:
+ print "Going to use default values"
+ else:
+ if argv[0].lower() == 'h' or argv[0].lower() == '-h':
+ printHelp()
+ return
+
+ if argv[0] == '-ip':
+ host=argv[1]
+ else:
+ if argv[0].lower() == '-a' and '/' not in argv[1]:
+ print '\n>>> Error: Credentials required (username/password)\n'
+ printHelp()
+ return
+
+ else:
+ creds = argv[1].split('/')
+ username = creds[0]
+ password = creds[1] # not used
+
+ try:
+ cmdIp=argv[2]
+ host=argv[3]
+ except IndexError:
+ host=DEFAULT_HOST
+ print "Going to use user defined values"
+ Service.server(host)
+
+ webHandler=WebHandler(host=host, port=DEFAULT_PORT)
+ response, headers = webHandler.rest(url=VSP_LIST_PATH, method='GET', data=None, attuid=username)
+ jResult = json.loads(response)
+ jSrvices = jResult["results"]
+ reportFileName = 'upgradereport.csv' #datetime.now()
+ reportFile = open(reportFileName, 'w')
+ reportFile.write(Service.header())
+
+ for jService in jSrvices:
+ serviceName = jService["name"]
+ vendorName = jService["vendorName"]
+ vspId = jService["id"]
+ status = jService["status"]
+ if status != "Locked":
+ lockingUser = "None"
+ else:
+ lockingUser = jService["lockingUser"]
+
+ service = Service(serviceName=serviceName, vspId=vspId, vendorName=vendorName, lockingUser=lockingUser )
+ print service
+ # Will try to GET the service
+ res = service.Get()
+ if res == 500:
+ serviceMigration(service, status, username)
+ else:
+ print "Service {0} was tested and does not need a migration".format(serviceName)
+
+ reportFile.write(service.line())
+ reportFile.close()
+
+
+def serviceMigration(service, serviceStatus, username):
+ print "Service {0} was tested and it needs a migration".format(service.serviceName)
+ print "Service {0} - Migration start"
+ if serviceStatus == "Locked":
+ print "Service {0} is locked - forcing checkin".format(service.serviceName)
+ service.Checkin()
+ print "Doing new checkout"
+ service.Checkout(username)
+
+ zipName = service.DownloadHeat()
+ if not zipName:
+ print "no heat found"
+ service.uploadStatus = "no heat found"
+ else:
+ uploadResponse = service.UploadHeat(zipName)
+ uploadResults = json.loads(uploadResponse)
+ if uploadResults['status'] == 'Success' and uploadResults['errors'].__len__() == 0:
+ service.uploadStatus = "Heat uploaded successfully"
+ else:
+ service.uploadStatus = "Heat uploaded with errors"
+ print "Doing new checkin"
+ service.Checkin()
+
+ print "Service {0} - Migration end"
+
+
+def printHelp():
+ print("Upgrade script Help:")
+ print("==================================")
+ print("1607_to_1610 -h --> get help")
+ print("1607_to_1610 -a <username>/<password> [-ip {ip}]")
+ print("Example: 1607_to_1610 -a root/secret")
+
+class Service(object):
+ def __init__(self, serviceName, vspId ,vendorName, lockingUser):
+ self.serviceName = serviceName
+ self.vspId = vspId
+ self.vendorName = vendorName
+ self.lockingUser = lockingUser
+ self.webHandler = WebHandler(host=Service.serveraddress, port=DEFAULT_PORT) # Schema?
+ self.uploadStatus = "not started"
+
+ def __repr__(self):
+ return 'Name: {0}, Id: {1}, Vendor: {2}, locked by: {3}, status {4}'.format(self.serviceName, self.vspId ,self.vendorName, self.lockingUser, self.uploadStatus)
+ @classmethod
+ def header(cls):
+ return 'Name,Id,Vendor,locked-by,status\n'
+
+ @classmethod
+ def server(cls, address):
+ cls.serveraddress=address
+
+ def line(self):
+ return '{0},{1},{2},{3},{4}\n'.format(self.serviceName, self.vspId ,self.vendorName, self.lockingUser, self.uploadStatus)
+
+ def Checkout(self, attuid):
+ # /v1.0/vendor-software-products/{vspId}/actions
+ urlpath=VSP_ACTIONS_PATH.format(vspId=self.vspId)
+ response, headers = self.webHandler.rest( url=urlpath, method='PUT', data={"action": "Checkout"}, attuid=attuid)
+ self.lockingUser=attuid #we will later use this user to checkin
+ return response
+
+ def Checkin(self):
+ # /v1.0/vendor-software-products/{vspId}/actions
+ urlpath = VSP_ACTIONS_PATH.format(vspId=self.vspId)
+ response, headers = self.webHandler.rest(url=urlpath, method='PUT', data={"action": "Checkin"}, attuid=self.lockingUser)
+ return response
+
+ def Get(self):
+ # /v1.0/vendor-software-products/{vspId}
+ urlpath = VSP_GET_URL.format(vspId=self.vspId)
+ try:
+ response, headers = self.webHandler.rest(url=urlpath, method='GET', data=None, attuid=self.lockingUser)
+ except HttpError as e:
+ print e.message
+ response = e.status
+ return response
+
+ def UploadHeat(self, zipName):
+ #/v1.0/vendor-software-products/{vspId}/upload
+ urlpath = VSP_UPLOAD_PATH.format(vspId=self.vspId)
+ try:
+ fields = []
+ with open(zipName, 'rb') as fin:
+ buffer = fin.read()
+ fin.close()
+ files = [('upload', 'heatfile.zip', buffer)]
+ response = self.webHandler.post_multipart('HTTP', urlpath, fields, files, self.lockingUser)
+
+ return response
+ finally:
+ print "done upload"
+
+ def DownloadHeat(self):
+ urlpath=VSP_DOWNLOAD_PATH.format(vspId=self.vspId)
+ try:
+ response, headers = self.webHandler.rest(url=urlpath, method='Get', data=None, attuid=self.lockingUser, accept='application/octet-stream')
+ except HttpError as e:
+ if e.status == 404:
+ return ""
+
+ for (key, value) in headers:
+ if key.lower() == "content-disposition":
+ file_name = value[value.index('=')+1:]
+ break
+ heatsDir= os.path.join(os.path.dirname(__file__), 'heats')
+ if not os.path.exists(heatsDir):
+ os.makedirs(heatsDir)
+ file_name = os.path.join(heatsDir, file_name)
+ with open(file_name, "wb") as fout:
+ fout.write(response)
+ fout.close()
+
+ return file_name
+
+
+
+class WebHandler(object):
+ def __init__(self, host, port):
+ self.host = host
+ self.port = port
+
+ def rest(self, url, method, data, attuid, accept='application/json', content_type='application/json'):
+ connection = httplib.HTTPConnection(host=self.host, port=self.port)
+
+ try:
+ headers = {'Content-Type':content_type ,'Accept':accept}
+ headers['USER_ID'] = attuid
+
+ connection.request(method=method, headers=headers, body=json.dumps(data), url=url)
+ response = connection.getresponse()
+ if response.status not in range(200, 300):
+ raise HttpError(status= response.status, message=response.reason)
+
+ return response.read(), response.getheaders()
+ finally:
+ connection.close()
+
+ def post_multipart(self, scheme, selector, fields, files, attuid):
+ """
+ Post fields and files to an http host as multipart/form-data.
+ fields is a sequence of (name, value) elements for regular form fields.
+ files is a sequence of (name, filename, value) elements for data to be uploaded as files
+ Return the server's response page.
+ """
+ content_type, body = self.encode_multipart_form_data(fields, files)
+ if scheme and scheme.lower() == "http":
+ h = httplib.HTTP(self.host, self.port)
+ else:
+ h = httplib.HTTPS(self.host, self.port)
+ h.putrequest('POST', selector)
+ h.putheader('content-type', content_type)
+ h.putheader('content-length', str(len(body)))
+ h.putheader('Accept', 'application/json')
+ h.putheader('USER_ID', attuid)
+
+ h.endheaders()
+ h.send(body)
+ errcode, errmsg, headers = h.getreply()
+ print errcode, errmsg, headers
+ return h.file.read()
+
+ def encode_multipart_form_data(self, fields, files):
+ LIMIT = '----------lImIt_of_THE_fIle_eW_$'
+ CRLF = '\r\n'
+ L = []
+ for (key, value) in fields:
+ L.append('--' + LIMIT)
+ L.append('Content-Disposition: form-data; name="%s"' % key)
+ L.append('')
+ L.append(value)
+ for (key, filename, value) in files:
+ L.append('--' + LIMIT)
+ L.append('Content-Disposition: form-data; name="%s"; filename="%s"' % (key, filename))
+ L.append('Content-Type: %s' % self.get_content_type(filename))
+ L.append('')
+ L.append(value)
+ L.append('--' + LIMIT + '--')
+ L.append('')
+ body = CRLF.join(L)
+ content_type = 'multipart/form-data; boundary=%s' % LIMIT
+ return content_type, body
+
+ def get_content_type(self, filename):
+ return mimetypes.guess_type(filename)[0] or 'application/octet-stream'
+
+class HttpError(Exception):
+ def __init__(self, status, message):
+ self.status = status
+ self.message=message
+ def __str__(self):
+ return repr(self.value, self.message)
+
+if __name__ == "__main__":
+ main(sys.argv[1:])
+
+
diff --git a/openecomp-be/tools/migration/README b/openecomp-be/tools/migration/README
new file mode 100644
index 0000000000..7bca1f3f5e
--- /dev/null
+++ b/openecomp-be/tools/migration/README
@@ -0,0 +1,88 @@
+Info -
+ Name: 1607 to 1610 ASDC VSP migration tool
+ Version: 4.0
+ Date: 15 Sep, 2016
+
+General -
+ This is a utility used for migration of VSP data from ASDC version 1607 to version 1610.
+ This utility will be executed post upgrade process to 1610.
+ This utility must run from the ASDC backend (BE) machine.
+
+ From version 3.0 the tool can be run several times without changing a VSP version more then once, the first time.
+ Once the VSP is "fixed" it will not be migrated by this tool.
+
+Concept -
+ Once migrating ASDC from 1607 to 1610 changes were made in the VSP load/validation.
+ In order to support these changes and force a valid HEAT file upload, the migration process should be
+ run on the existing data.
+ Not doing so will result in VSPs that will not open for update action.
+
+ The migration will run on VSPs that were upgraded from 1607 to 1610 and are not able to be retrieved.
+
+Pre ASDC upgrade requisite -
+ In order to achieve the best result from this tool users must check-in ALL VSPs.
+
+Limitations -
+
+ * Will not work if user did not create a first version of the VSP, i.e. at least one time check-in action.
+ * Once run, user must checkout a VSP, go to General and re select a license model version.
+
+
+Usage -
+
+ Note: There are default values if the script is run without arguments.
+ The values are credentials: cs0008/cs0008, with host: 127.0.0.1
+ 1607_to_1610 -h --> get help
+ 1607_to_1610 -a <username>/<password> [-ip {ip}]
+ Example:
+ using cassandra on localhost - 1607_to_1610 -a root/secret
+ using cassandra on remote host - 1607_to_1610 -a root/secert -ip 10.147.97.191
+
+ Result:
+ The migration result will be listed in a CSV file: upgradereport.csv
+ "None" is an indication that the VSP was not in a checkout status prior to the upgrade.
+
+ Exmample for a valid output:
+
+ Name: VSP-OK, Id: 9DB0E1563B22481D911ECD33989E1FDD, Vendor: OPENECOMP, locked by: None, status not started
+ Service VSP-OK was tested and does not need a migration
+ Name: VSP02-Checkout, Id: 8DF8D65535414AAAA23682E2532675E6, Vendor: OPENECOMP, locked by: cs0008, status not started
+ Server Error
+ Service VSP02-Checkout was tested and it needs a migration
+ Service VSP02 - Migration start
+ Service VSP02-Checkout is locked - forcing checkin
+ Doing new checkout
+ 200 OK Content-Type: application/json
+ Date: Thu, 08 Sep 2016 13:25:21 GMT
+ Server: Jetty(9.3.6.v20151106)
+
+ done upload
+ Doing new checkin
+ Service VSP-EMPTY - Migration end
+ Name: VSP-EMPTY, Id: D26892D2839746E18075EF49C4586320, Vendor: OPENECOMP, locked by: None, status not started
+ Service VSP-EMPTY was tested and does not need a migration
+ Name: VSP01, Id: 98F5DDFD4F684086801E86A88A0D77AB, Vendor: OPENECOMP, locked by: None, status not started
+ Server Error
+ Service VSP01 was tested and it needs a migration
+ Service VSP-EMPTY - Migration start
+ Doing new checkout
+ 200 OK Content-Type: application/json
+ Date: Thu, 08 Sep 2016 13:25:22 GMT
+ Server: Jetty(9.3.6.v20151106)
+
+ done upload
+ Doing new checkin
+ Service {0} - Migration end
+
+ Example for a case with no migration needed:
+
+ Name: VSP-OK, Id: 9DB0E1563B22481D911ECD33989E1FDD, Vendor: OPENECOMP, locked by: None, status not started
+ Service VSP-OK was tested and does not need a migration
+ Name: VSP02-Checkout, Id: 8DF8D65535414AAAA23682E2532675E6, Vendor: OPENECOMP, locked by: None, status not started
+ Service VSP02-Checkout was tested and does not need a migration
+ Name: VSP-EMPTY, Id: D26892D2839746E18075EF49C4586320, Vendor: OPENECOMP, locked by: None, status not started
+ Service VSP-EMPTY was tested and does not need a migration
+ Name: VSP01, Id: 98F5DDFD4F684086801E86A88A0D77AB, Vendor: OPENECOMP, locked by: None, status not started
+ Service VSP01 was tested and does not need a migration
+
+
diff --git a/openecomp-be/tools/scripts/generate-manifest.py b/openecomp-be/tools/scripts/generate-manifest.py
new file mode 100644
index 0000000000..87968e0f89
--- /dev/null
+++ b/openecomp-be/tools/scripts/generate-manifest.py
@@ -0,0 +1,435 @@
+#!/usr/bin/python
+
+##############################################################################
+###
+### generate-manifest.py
+###
+### A Vendor utility to generate a valid heat zip manifest file for the AT&T onboarding.
+###
+### Usage:
+###
+### generate-manifest.py [-f|--folder] vendor-heat-directory [-n|--name] manifest-name [-d|--description] manifet-description
+###
+### For example:
+###
+### ./generate-manifest.py --folder ./vota --name vOTA --description "HOT template to create vOTA server"
+###
+### Help:
+### The script is doing the following:
+### 1) Split the files into different types
+### a. .env files
+### b. Network files (anything containing the string network)
+### c. Volume files (anything containing the string volume)
+### d. Top level Heat files
+### e. Other types
+### 2) Match env files to heat files – looking for same name ignoring suffix and extension
+### 3) Match Network childs
+### a. Look for Top level heats which name is a substring of the name of the Network heat name.
+### 4) Match Volume childs
+### a. Look for Top level heats which name is a substring of the name of the Volume heat name.
+### 5) Generate the JSON file from the above
+###
+###
+### Author: Avi Ziv
+### Version 1.4 for OPENECOMP 1.0
+### Date: 13 July 2016 (c) OPENECOMP
+###
+##############################################################################
+
+# import os,sys,getopt,json,re
+import os, sys, getopt, re
+from collections import OrderedDict
+from json import JSONEncoder
+import json
+
+VERSION = "1.4"
+ENV_EXT = ".env"
+SHELL_EXT = ".sh"
+YAML_EXT = [".yaml", ".yml"]
+# VERSION_DELIMITER_PATTERN='_v\d{*}.\d{*}'
+# VERSION_DELIMITER_PATTERN='_v*.*'
+#v1.0
+VERSION_DELIMITER_PATTERN = '_v\d+.\d+'
+#07_12_2016
+VERSION_DELIMITER_PATTERN2 = '_\d+-\d+-\d+'
+
+# types
+HEAT = "HEAT"
+HEAT_BASE = "HEAT_BASE"
+HEAT_NET = "HEAT_NET"
+HEAT_VOL = "HEAT_VOL"
+HEAT_ENV = "HEAT_ENV"
+SHELL = "SHELL"
+OTHER = "OTHER"
+
+globalVolumeVal = "VOLUME"
+globalNetworkVal = "NETWORK"
+globalBaseVal = "BASE"
+
+
+def version():
+ return VERSION
+
+
+def usage():
+ print ('usage: ' + sys.argv[0] + ' [-f|--folder] vendor-heat-directory [-n|--name] manifest-name [-d|--description] manifet-description' )
+
+
+def header():
+ print ("\nASDC Vendor manifest file generator, version " + version() + "\n")
+
+
+def getEnvVariables(value, defaultValue):
+ try:
+ eVal = os.environ[value]
+ return eVal
+ except KeyError:
+ print ("Missing ${" + value + "} envirunment variable. Using default value: " + defaultValue)
+ return defaultValue
+
+
+def getF(listFiles):
+ print ("Analyzing files ...")
+ foundABase = False
+ files = listFiles
+ jsons = {}
+ lOfEnvs = {}
+ lOfVolumes = {}
+ lOfNetworks = {}
+ lOfHeats = {}
+ lOfShels = {}
+ lOfArtifacts = {}
+
+ for f in files:
+ fullFilename = f[1]
+ fObj = ManifestFileInfo(fullFilename)
+ if fObj.isEnv():
+ lOfEnvs[fObj.file_name] = fObj
+ elif fObj.isShell():
+ lOfShels[fObj.file_name] = fObj
+ elif fObj.isVolume():
+ lOfVolumes[fObj.file_name] = fObj
+ elif fObj.isNetwork():
+ lOfNetworks[fObj.file_name] = fObj
+ elif (fObj.isYaml() and not fObj.isBase()):
+ lOfHeats[fObj.file_name] = fObj
+ elif fObj.isArtifact():
+ lOfArtifacts[fObj.file_name] = fObj
+ elif (fObj.isBase() and fObj.isYaml()):
+ foundABase = True
+ lOfHeats[fObj.file_name] = fObj
+
+ jsons['heats'] = lOfHeats
+ jsons['envs'] = lOfEnvs
+ jsons['shells'] = lOfShels
+ jsons['volumes'] = lOfVolumes
+ jsons['networks'] = lOfNetworks
+ jsons['artifacts'] = lOfArtifacts
+
+ if not foundABase:
+ print (">>> Warning: No Base was found")
+ return jsons
+
+def loadFilesToList(folder):
+ print ("Analyzing files in folder: << " + folder + " >>")
+ files = os.listdir(folder)
+ listOfFiles = []
+ for f in files:
+ if os.path.isdir(os.path.join(folder, f)):
+ ConsoleLogger.warning("Sub folders are ignored by this script, you may want to remove it before archiving")
+ continue
+
+ filename, file_extension = os.path.splitext(f)
+ if filename == 'MANIFEST':
+ ConsoleLogger.warning("Your folder already contains a manifest file that will be overridden")
+ continue
+ listOfFiles.append([filename, f])
+ return listOfFiles
+
+
+def make(files):
+ flist = []
+ dEnvs = {}
+ dEnvs = files['envs']
+ dHeats = files['heats']
+ dNetworks = files['networks']
+ dVolumes = files['volumes']
+ dArtifacts = files['artifacts']
+ dShells = files['shells']
+
+ env_items = dEnvs.items()
+ for fileItem in env_items:
+ env_name = fileItem[1].file_name
+ env_base = fileItem[1].base_file_name
+ if env_name in dHeats:
+ dHeats[env_name].add(fileItem[1])
+ continue
+
+ if env_name in dNetworks.items():
+ dNetworks[env_name].add(fileItem[1])
+ continue
+
+ if env_name in dVolumes.items():
+ dVolumes[env_name[0]].add(env_name[1])
+ continue
+
+ for fName in dHeats:
+ heat_base = dHeats[fName].base_file_name
+ if env_base in heat_base:
+ dHeats[fName].add(dEnvs[env_name])
+ break
+ else:
+ for fName in dNetworks:
+ net_base = dNetworks[fName].base_file_name
+ if env_base in net_base:
+ dNetworks[fName].add(dEnvs[env_name])
+ break
+ else:
+ for fName in dVolumes:
+ vol_base = dVolumes[fName].base_file_name
+ if env_base in vol_base:
+ dVolumes[fName].add(dEnvs[env_name])
+ break
+
+ else:
+ flist.append(dEnvs[env_name])
+
+ for fName in dVolumes:
+ vol_base = dVolumes[fName].base_file_name
+ for hfName in dHeats:
+ heat_base = dHeats[hfName].base_file_name
+ if heat_base in vol_base:
+ dHeats[hfName].add(dVolumes[fName])
+ break
+ else:
+ flist.append(dVolumes[fName])
+
+ for fName in dNetworks:
+ net_base = dNetworks[fName].base_file_name
+ for hfName in dHeats:
+ heat_base = dHeats[hfName].base_file_name
+ if heat_base in net_base:
+ dHeats[hfName].add(dNetworks[fName])
+ break
+ else:
+ flist.append(dNetworks[fName])
+
+ for fName in dHeats:
+ flist.append(dHeats[fName])
+ for fName in dShells:
+ flist.append(dShells[fName])
+ for fName in dArtifacts:
+ flist.append(dArtifacts[fName])
+
+ print ("\n------------------------------------------------------------\n")
+ return flist
+
+
+def generate(folder, name, description):
+ print ("Checking envirunment variables ...")
+ global globalVolumeVal
+ globalVolumeVal = getEnvVariables("VOLUME", globalVolumeVal)
+
+ global globalNetworkVal
+ globalNetworkVal = getEnvVariables("NETWORK", globalNetworkVal)
+
+ global globalBaseVal
+ globalBaseVal = getEnvVariables("BASE", globalBaseVal)
+
+ YamlTabCleaner(folder).cleanYamlTabs()
+
+ print ("Generating manifest file ...")
+ jsons = getF(loadFilesToList(folder))
+
+ lFiles = make(jsons)
+ manifest = Manifest(name, description, '1.0', lFiles)
+ output_json = json.dumps(manifest, default=jdefault, indent=4, sort_keys=False)
+
+ f = open(os.path.join(folder, 'MANIFEST.json'), 'w')
+ f.write(output_json)
+ print("MANIFEST file created")
+
+
+################
+
+def jdefault(obj):
+ if hasattr(obj, '__json__'):
+ return obj.__json__()
+ else:
+ return obj.__dict__
+
+
+class ManifestFileInfo(object):
+ def __init__(self, filename):
+ self.name = filename
+ self.base = 'false'
+ self.data = []
+ self.file_name, self.file_extension = os.path.splitext(filename)
+ self.base_file_name = re.sub(VERSION_DELIMITER_PATTERN, '', self.file_name)
+ self.base_file_name = re.sub(VERSION_DELIMITER_PATTERN2, '', self.base_file_name)
+
+ if self.isEnv():
+ self.heat_type = Types.ENV
+ elif self.isShell():
+ self.heat_type = Types.SHELL
+ elif self.isVolume():
+ self.heat_type = Types.VOL
+ elif self.isNetwork():
+ self.heat_type = Types.NET
+ elif self.isYaml() and not self.isBase():
+ self.heat_type = Types.HEAT
+ elif self.isArtifact():
+ self.heat_type = Types.OTHER
+ elif (self.isBase() and self.isYaml()):
+ self.heat_type = Types.HEAT
+ self.base = 'true'
+
+ def set(self, data):
+ self.data = data
+
+ def add(self, item):
+ self.data.append(item)
+
+ def isYaml(self):
+ return any(val in self.file_extension.lower() for val in YAML_EXT)
+
+ def isEnv(self):
+ return self.file_extension.lower() == ENV_EXT.lower()
+
+ def isShell(self):
+ return self.file_extension.lower() == SHELL_EXT.lower()
+
+ def isVolume(self):
+ res = globalVolumeVal.lower() in self.file_name.lower()
+ return res
+
+ def isNetwork(self):
+ res = globalNetworkVal.lower() in self.file_name.lower()
+ return res
+
+ def isBase(self):
+ res = globalBaseVal.lower() in self.file_name.lower()
+ return res
+
+ def isArtifact(self):
+ return (not self.isBase() and not self.isVolume() and not self.isNetwork() and not self.isEnv())
+
+ def isHEAT(self):
+ return ((self.heat_type == Types.HEAT) | (self.heat_type == Types.BASE) | (self.heat_type == Types.NET) | (
+ self.heat_type == Types.VOL))
+
+ def __json__(self):
+ dict = OrderedDict(
+ [('file', self.name), ('type', self.heat_type)])
+ if self.isHEAT():
+ dict['isBase'] = self.base
+ if self.data != []:
+ dict['data'] = self.data
+
+ return dict
+
+
+class Manifest(object):
+ def __init__(self, name, description, version, data):
+ self.name = name
+ self.description = description
+ self.version = version
+ self.data = data
+
+ def add(self, data):
+ self.data.append(data)
+
+ def __json__(self):
+ return OrderedDict([('name', self.name), ('description', self.description), ('data', self.data)])
+
+
+class YamlTabCleaner(object):
+ def __init__(self, folder):
+ self.folder = folder
+
+ def replaceTabs(self, sourceFile, targetFile):
+ with open(sourceFile, "rt") as fin:
+ if '\t' in fin.read():
+ print("\'tab\' character was found in the file: " + sourceFile + "\na clean version of the file can be found under \'clean\' folder")
+ target = os.path.dirname(targetFile)
+ if not os.path.exists(target):
+ os.makedirs(target)
+ fin.seek(0)
+ with open(targetFile, "wt") as fout:
+ for line in fin:
+ fout.write(line.replace('\t', ' '))
+
+ def cleanYamlTabs(self):
+ included_extenstions = ['yml', 'yaml']
+ files = [fn for fn in os.listdir(self.folder)
+ if any(fn.endswith(ext) for ext in included_extenstions)]
+ target = os.path.join(self.folder, "clean")
+ for file in files:
+ self.replaceTabs(os.path.join(self.folder, file), os.path.join(target, file))
+
+class ConsoleLogger(object):
+ @classmethod
+ def error(cls, message):
+ print(">>> Error: " + message)
+
+ @classmethod
+ def warning(cls, message):
+ print(">>> Warning: " + message)
+
+
+ @classmethod
+ def info(cls, message):
+ print(">>> Info: " + message)
+
+
+def enum(**named_values):
+ return type('Enum', (), named_values)
+
+
+################
+
+def main(argv):
+ action = ''
+ folderName = '.'
+ name = ''
+ description = ''
+ version = ''
+
+ try:
+ opts, args = getopt.getopt(argv, "h:f:n:d", ["folder=", "name=", "description=", ])
+ except getopt.GetoptError as err:
+ # print help information and exit:
+ print ('>>>>' + str(err))
+ usage()
+ sys.exit(2)
+ for opt, arg in opts:
+ if opt == '-h':
+ usage()
+ sys.exit()
+ elif opt in ('-f', '--folder'):
+ action = 'generate'
+ if not arg:
+ print ("Error: missing heat files directory")
+ usage()
+ sys.exit(2)
+ else:
+ folderName = arg
+ elif opt in ('-n', '--name'):
+ name = arg
+ elif opt in ('-d', '--description'):
+ description = arg
+ else:
+ usage()
+
+ if action == 'generate':
+ generate(folderName, name, description)
+ sys.exit()
+ else:
+ usage()
+
+
+if __name__ == "__main__":
+ header()
+ Types = enum(HEAT='HEAT', BASE='HEAT_BASE', NET='HEAT_NET', VOL='HEAT_VOL', ENV='HEAT_ENV', SHELL='SHELL',
+ OTHER='OTHER')
+ main(sys.argv[1:])
diff --git a/openecomp-be/tools/swagger-ui/WEB-INF/jetty-web.xml b/openecomp-be/tools/swagger-ui/WEB-INF/jetty-web.xml
new file mode 100644
index 0000000000..11f2d9ec9e
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/WEB-INF/jetty-web.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE Configure PUBLIC
+ "-//Mort Bay Consulting//DTD Configure//EN"
+ "http://www.eclipse.org/jetty/configure_9_0.dtd">
+
+<Configure class="org.eclipse.jetty.webapp.WebAppContext">
+ <Set name="contextPath">/api-docs</Set>
+</Configure>
diff --git a/openecomp-be/tools/swagger-ui/api-docs/api.html b/openecomp-be/tools/swagger-ui/api-docs/api.html
new file mode 100644
index 0000000000..35bf7db136
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/api-docs/api.html
@@ -0,0 +1,13140 @@
+<!DOCTYPE html>
+<html>
+<title>API Document</title>
+
+<!--xmp theme="united" style="display:none;"-->
+<xmp theme="united" style="display:none;">
+#Rest API
+
+
+## HTTP:///onboarding-api
+
+
+Rest API Documentation
+
+
+
+**Version** v1.0, build #${buildNumber}
+
+
+
+
+
+
+
+
+
+
+
+
+# APIs
+
+
+## /v1.0/application-configuration
+
+
+
+
+
+
+### POST
+
+
+<a id="insertToTable">Insert JSON schema into application config table</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** multipart/form-data
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>namespace</th>
+ <td>query</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>key</th>
+ <td>query</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+ <a href="#/definitions/InputStream">InputStream</a>
+ </td>
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## /v1.0/application-configuration/{namespace}
+
+
+### GET
+
+<a id="getListOfConfigurationByNamespaceFromTable">Get List of keys and values by namespace</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>namespace</th>
+ <td>path</td>
+ <td>yes</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## /v1.0/application-configuration/{namespace}/{key}
+
+
+### GET
+
+<a id="getFromTable">Get JSON schema by namespace and key</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>namespace</th>
+ <td>path</td>
+ <td>yes</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>key</th>
+ <td>path</td>
+ <td>yes</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| 200 | successful operation | <a href="#/definitions/ConfigurationDataDto">ConfigurationDataDto</a>|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## /v1.0/validation/{type}/validate
+
+
+
+
+
+
+### POST
+
+
+<a id="validateFile">Validate a package</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** multipart/form-data
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>type</th>
+ <td>path</td>
+ <td>yes</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+ <a href="#/definitions/InputStream">InputStream</a>
+ </td>
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## /v1.0/vendor-license-models
+
+
+### GET
+
+<a id="listLicenseModels">List vendor license models</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>versionFilter</th>
+ <td>query</td>
+ <td>no</td>
+ <td>Currently supported value: &#x27;Final&#x27; - only vendor License models with final versions will be return - with their latest final version</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| 200 | successful operation | Array[<a href="#/definitions/VendorLicenseModelEntity">VendorLicenseModelEntity</a>]|
+
+
+
+
+
+
+### POST
+
+
+<a id="createLicenseModel">Create vendor license model</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+ <a href="#/definitions/VendorLicenseModelRequest">VendorLicenseModelRequest</a>
+ </td>
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## /v1.0/vendor-license-models/{vlmId}
+
+
+### GET
+
+<a id="getLicenseModel">Get vendor license model</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vlmId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor license model Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>version</th>
+ <td>query</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| 200 | successful operation | <a href="#/definitions/VendorLicenseModelEntity">VendorLicenseModelEntity</a>|
+
+
+
+
+### PUT
+
+<a id="updateLicenseModel">Update vendor license model</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+ <a href="#/definitions/VendorLicenseModelRequest">VendorLicenseModelRequest</a>
+ </td>
+
+</tr>
+
+<tr>
+ <th>vlmId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor license model Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+### DELETE
+
+<a id="deleteLicenseModel">Delete vendor license model</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vlmId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor license model Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+## /v1.0/vendor-license-models/{vlmId}/actions
+
+
+
+
+### PUT
+
+<a id="actOnLicenseModel">Update vendor license model</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+ <a href="#/definitions/VendorLicenseModelActionRequestDto">VendorLicenseModelActionRequestDto</a>
+ </td>
+
+</tr>
+
+<tr>
+ <th>vlmId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor license model Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## /v1.0/vendor-license-models/{vlmId}/entitlement-pools
+
+
+### GET
+
+<a id="listEntitlementPools">List vendor entitlement pools</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vlmId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor license model Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>version</th>
+ <td>query</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| 200 | successful operation | Array[<a href="#/definitions/EntitlementPoolEntity">EntitlementPoolEntity</a>]|
+
+
+
+
+
+
+### POST
+
+
+<a id="createEntitlementPool">Create vendor entitlement pool</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+ <a href="#/definitions/EntitlementPoolRequest">EntitlementPoolRequest</a>
+ </td>
+
+</tr>
+
+<tr>
+ <th>vlmId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor license model Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## /v1.0/vendor-license-models/{vlmId}/entitlement-pools/{entitlementPoolId}
+
+
+### GET
+
+<a id="getEntitlementPool">Get vendor entitlement pool</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vlmId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor license model Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>version</th>
+ <td>query</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>entitlementPoolId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| 200 | successful operation | <a href="#/definitions/EntitlementPoolEntity">EntitlementPoolEntity</a>|
+
+
+
+
+### PUT
+
+<a id="updateEntitlementPool">Update vendor entitlement pool</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+ <a href="#/definitions/EntitlementPoolRequest">EntitlementPoolRequest</a>
+ </td>
+
+</tr>
+
+<tr>
+ <th>vlmId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor license model Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>entitlementPoolId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+### DELETE
+
+<a id="deleteEntitlementPool">Delete vendor entitlement pool</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vlmId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor license model Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>entitlementPoolId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+## /v1.0/vendor-license-models/{vlmId}/feature-groups
+
+
+### GET
+
+<a id="listFeatureGroups">List vendor feature groups</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vlmId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor license model Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>version</th>
+ <td>query</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| 200 | successful operation | Array[<a href="#/definitions/FeatureGroupEntity">FeatureGroupEntity</a>]|
+
+
+
+
+
+
+### POST
+
+
+<a id="createFeatureGroup">Create vendor feature group</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+ <a href="#/definitions/FeatureGroupRequest">FeatureGroupRequest</a>
+ </td>
+
+</tr>
+
+<tr>
+ <th>vlmId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor license model Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## /v1.0/vendor-license-models/{vlmId}/feature-groups/{featureGroupId}
+
+
+### GET
+
+<a id="getFeatureGroup">Get vendor feature group</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vlmId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor license model Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>version</th>
+ <td>query</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>featureGroupId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| 200 | successful operation | <a href="#/definitions/FeatureGroupModel">FeatureGroupModel</a>|
+
+
+
+
+### PUT
+
+<a id="updateFeatureGroup">Update vendor feature group</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+ <a href="#/definitions/FeatureGroupUpdateRequest">FeatureGroupUpdateRequest</a>
+ </td>
+
+</tr>
+
+<tr>
+ <th>vlmId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor license model Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>featureGroupId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+### DELETE
+
+<a id="deleteFeatureGroup">Delete vendor feature group</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vlmId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor license model Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>featureGroupId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+## /v1.0/vendor-license-models/{vlmId}/license-agreements
+
+
+### GET
+
+<a id="listLicenseAgreements">List vendor license agreements</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vlmId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor license model Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>version</th>
+ <td>query</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| 200 | successful operation | Array[<a href="#/definitions/LicenseAgreementEntity">LicenseAgreementEntity</a>]|
+
+
+
+
+
+
+### POST
+
+
+<a id="createLicenseAgreement">Create vendor license agreement</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+ <a href="#/definitions/LicenseAgreementRequest">LicenseAgreementRequest</a>
+ </td>
+
+</tr>
+
+<tr>
+ <th>vlmId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor license model Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## /v1.0/vendor-license-models/{vlmId}/license-agreements/{licenseAgreementId}
+
+
+### GET
+
+<a id="getLicenseAgreement">Get vendor license agreement</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vlmId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor license model Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>version</th>
+ <td>query</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>licenseAgreementId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| 200 | successful operation | <a href="#/definitions/LicenseAgreementModel">LicenseAgreementModel</a>|
+
+
+
+
+### PUT
+
+<a id="updateLicenseAgreement">Update vendor license agreement</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+ <a href="#/definitions/LicenseAgreementUpdateRequest">LicenseAgreementUpdateRequest</a>
+ </td>
+
+</tr>
+
+<tr>
+ <th>vlmId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor license model Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>licenseAgreementId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+### DELETE
+
+<a id="deleteLicenseAgreement">Delete vendor license agreement</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vlmId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor license model Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>licenseAgreementId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+## /v1.0/vendor-license-models/{vlmId}/license-key-groups
+
+
+### GET
+
+<a id="listLicenseKeyGroups">List vendor license key groups</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vlmId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor license model Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>version</th>
+ <td>query</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| 200 | successful operation | Array[<a href="#/definitions/LicenseKeyGroupEntityDto">LicenseKeyGroupEntityDto</a>]|
+
+
+
+
+
+
+### POST
+
+
+<a id="createLicenseKeyGroup">Create vendor license key group</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+ <a href="#/definitions/LicenseKeyGroupRequestDto">LicenseKeyGroupRequestDto</a>
+ </td>
+
+</tr>
+
+<tr>
+ <th>vlmId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor license model Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## /v1.0/vendor-license-models/{vlmId}/license-key-groups/{licenseKeyGroupId}
+
+
+### GET
+
+<a id="getLicenseKeyGroup">Get vendor license key group</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vlmId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor license model Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>version</th>
+ <td>query</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>licenseKeyGroupId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| 200 | successful operation | <a href="#/definitions/LicenseKeyGroupEntityDto">LicenseKeyGroupEntityDto</a>|
+
+
+
+
+### PUT
+
+<a id="updateLicenseKeyGroup">Update vendor license key group</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+ <a href="#/definitions/LicenseKeyGroupRequestDto">LicenseKeyGroupRequestDto</a>
+ </td>
+
+</tr>
+
+<tr>
+ <th>vlmId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor license model Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>licenseKeyGroupId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+### DELETE
+
+<a id="deleteLicenseKeyGroup">Delete vendor license key group</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vlmId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor license model Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>licenseKeyGroupId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+## /v1.0/vendor-software-products
+
+
+### GET
+
+<a id="getVspList">Get list of vendor software products and their description</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>versionFilter</th>
+ <td>query</td>
+ <td>no</td>
+ <td>Currently supported values: &#x27;Final&#x27; - only vendor software products with final version will be return - with their latest final version</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+### POST
+
+
+<a id="createNewVsp">Create a new vendor software product</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+ <a href="#/definitions/VspDescriptionDto">VspDescriptionDto</a>
+ </td>
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| 200 | successful operation | <a href="#/definitions/VspCreationDto">VspCreationDto</a>|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## /v1.0/vendor-software-products/packages
+
+
+### GET
+
+<a id="listPackages">Get list of translated CSAR files details</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>category</th>
+ <td>query</td>
+ <td>no</td>
+ <td>Category</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>subCategory</th>
+ <td>query</td>
+ <td>no</td>
+ <td>Sub-category</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| 200 | successful operation | Array[<a href="#/definitions/PackageInfoDto">PackageInfoDto</a>]|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## /v1.0/vendor-software-products/packages/{vspId}
+
+
+### GET
+
+<a id="getTranslatedFile">Get translated CSAR file</a>
+
+Exports translated file to a zip file
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>version</th>
+ <td>query</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/octet-stream
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| 200 | successful operation | <a href="#/definitions/File">File</a>|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## /v1.0/vendor-software-products/{vspId}
+
+
+### GET
+
+<a id="getVspDetails">Get details of a vendor software product</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>version</th>
+ <td>query</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+### PUT
+
+<a id="updateVsp">Update an existing vendor software product</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+ <a href="#/definitions/VspDescriptionDto">VspDescriptionDto</a>
+ </td>
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+### DELETE
+
+<a id="deleteVsp">Deletes vendor software product by given id</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+## /v1.0/vendor-software-products/{vspId}/actions
+
+
+
+
+### PUT
+
+<a id="actOnVendorSoftwareProduct">Actions on a vendor software product</a>
+
+Performs one of the following actions on a vendor software product: |Checkout: Locks it for edits by other users. Only the locking user sees the edited version.|Undo_Checkout: Unlocks it and deletes the edits that were done.|Checkin: Unlocks it and activates the edited version to all users.| Submit: Finalize its active version.|Create_Package: Creates a CSAR zip file.|
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+ <a href="#/definitions/VersionSoftwareProductActionRequestDto">VersionSoftwareProductActionRequestDto</a>
+ </td>
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## /v1.0/vendor-software-products/{vspId}/components
+
+
+### GET
+
+<a id="list">List vendor software product components</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>version</th>
+ <td>query</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| 200 | successful operation | Array[<a href="#/definitions/ComponentDto">ComponentDto</a>]|
+
+
+
+
+
+
+### POST
+
+
+<a id="create">Create a vendor software product component</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+ <a href="#/definitions/ComponentRequestDto">ComponentRequestDto</a>
+ </td>
+
+</tr>
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+### DELETE
+
+<a id="deleteList">Delete vendor software product components</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+## /v1.0/vendor-software-products/{vspId}/components/{componentId}
+
+
+### GET
+
+<a id="get">Get vendor software product component</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>componentId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product component Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>version</th>
+ <td>query</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| 200 | successful operation | <a href="#/definitions/ComponentData">ComponentData</a>|
+
+
+
+
+### PUT
+
+<a id="update">Update vendor software product component</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+ <a href="#/definitions/ComponentRequestDto">ComponentRequestDto</a>
+ </td>
+
+</tr>
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>componentId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product component Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+### DELETE
+
+<a id="delete">Delete vendor software product component</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>componentId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product component Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+## /v1.0/vendor-software-products/{vspId}/components/{componentId}/monitors/snmp
+
+
+### GET
+
+<a id="list">Get the filenames of uploaded MIB definitions</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>componentId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product component Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| 200 | successful operation | <a href="#/definitions/MibUploadStatusDto">MibUploadStatusDto</a>|
+
+
+
+
+
+
+
+
+### DELETE
+
+<a id="deletePollMibFile">Delete vendor software product MIB Poll Definitions file</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>componentId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product component Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+## /v1.0/vendor-software-products/{vspId}/components/{componentId}/monitors/snmp-trap
+
+
+
+
+
+
+
+
+### DELETE
+
+<a id="deleteTrapMibFile">Delete vendor software product MIB Trap Definitions file</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>componentId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product component Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+## /v1.0/vendor-software-products/{vspId}/components/{componentId}/monitors/snmp-trap/upload
+
+
+
+
+
+
+### POST
+
+
+<a id="uploadTrapMibFile">Upload vendor software product MIB Trap Definitions file</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** multipart/form-data
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+ <a href="#/definitions/Attachment">Attachment</a>
+ </td>
+
+</tr>
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>componentId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product component Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## /v1.0/vendor-software-products/{vspId}/components/{componentId}/monitors/snmp/upload
+
+
+
+
+
+
+### POST
+
+
+<a id="uploadPollMibFile">Upload vendor software product MIB Poll Definitions file</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** multipart/form-data
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+ <a href="#/definitions/Attachment">Attachment</a>
+ </td>
+
+</tr>
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>componentId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product component Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## /v1.0/vendor-software-products/{vspId}/components/{componentId}/nics
+
+
+### GET
+
+<a id="list">List vendor software product component NICs</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>componentId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product component Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>version</th>
+ <td>query</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| 200 | successful operation | Array[<a href="#/definitions/NicDto">NicDto</a>]|
+
+
+
+
+
+
+### POST
+
+
+<a id="create">Create a vendor software product NIC</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+ <a href="#/definitions/NicRequestDto">NicRequestDto</a>
+ </td>
+
+</tr>
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>componentId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product component Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## /v1.0/vendor-software-products/{vspId}/components/{componentId}/nics/{nicId}
+
+
+### GET
+
+<a id="get">Get vendor software product NIC</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>componentId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product component Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>nicId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product NIC Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>version</th>
+ <td>query</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| 200 | successful operation | <a href="#/definitions/NicDto">NicDto</a>|
+
+
+
+
+### PUT
+
+<a id="update">Update vendor software product NIC</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+ <a href="#/definitions/NicRequestDto">NicRequestDto</a>
+ </td>
+
+</tr>
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>componentId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product component Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>nicId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product NIC Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+### DELETE
+
+<a id="delete">Delete vendor software product NIC</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>componentId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product component Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>nicId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product NIC Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+## /v1.0/vendor-software-products/{vspId}/components/{componentId}/nics/{nicId}/questionnaire
+
+
+### GET
+
+<a id="getQuestionnaire">Get vendor software product component NIC questionnaire</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>componentId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product component Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>nicId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product NIC Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>version</th>
+ <td>query</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| 200 | successful operation | <a href="#/definitions/QuestionnaireResponseDto">QuestionnaireResponseDto</a>|
+
+
+
+
+### PUT
+
+<a id="updateQuestionnaire">Update vendor software product component NIC questionnaire</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+
+ </td>
+
+</tr>
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>componentId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product component Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>nicId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product NIC Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## /v1.0/vendor-software-products/{vspId}/components/{componentId}/processes
+
+
+### GET
+
+<a id="list">List vendor software product component processes</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>componentId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product component Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>version</th>
+ <td>query</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| 200 | successful operation | Array[<a href="#/definitions/ProcessEntityDto">ProcessEntityDto</a>]|
+
+
+
+
+
+
+### POST
+
+
+<a id="create">Create a vendor software product process</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+ <a href="#/definitions/ProcessRequestDto">ProcessRequestDto</a>
+ </td>
+
+</tr>
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>componentId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product component Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+### DELETE
+
+<a id="deleteList">Delete vendor software product processes</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>componentId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product component Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+## /v1.0/vendor-software-products/{vspId}/components/{componentId}/processes/{processId}
+
+
+### GET
+
+<a id="get">Get vendor software product process</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>componentId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product component Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>processId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product process Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>version</th>
+ <td>query</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| 200 | successful operation | <a href="#/definitions/ProcessEntityDto">ProcessEntityDto</a>|
+
+
+
+
+### PUT
+
+<a id="update">Update vendor software product process</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+ <a href="#/definitions/ProcessRequestDto">ProcessRequestDto</a>
+ </td>
+
+</tr>
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>componentId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product component Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>processId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product process Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+### DELETE
+
+<a id="delete">Delete vendor software product process</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>componentId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product component Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>processId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product process Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+## /v1.0/vendor-software-products/{vspId}/components/{componentId}/processes/{processId}/upload
+
+
+### GET
+
+<a id="getUploadedFile">Get vendor software product process uploaded file</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>componentId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product component Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>processId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product process Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>version</th>
+ <td>query</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/octet-stream
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+### POST
+
+
+<a id="uploadFile">Update vendor software product process upload</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** multipart/form-data
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+ <a href="#/definitions/Attachment">Attachment</a>
+ </td>
+
+</tr>
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>componentId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product component Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>processId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product process Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+### DELETE
+
+<a id="deleteUploadedFile">Delete vendor software product process uploaded file</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>componentId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product component Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>processId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product process Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+## /v1.0/vendor-software-products/{vspId}/components/{componentId}/questionnaire
+
+
+### GET
+
+<a id="getQuestionnaire">Get vendor software product component questionnaire</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>componentId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product component Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>version</th>
+ <td>query</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| 200 | successful operation | <a href="#/definitions/QuestionnaireResponseDto">QuestionnaireResponseDto</a>|
+
+
+
+
+### PUT
+
+<a id="updateQuestionnaire">Update vendor software product component questionnaire</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+
+ </td>
+
+</tr>
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>componentId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product component Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## /v1.0/vendor-software-products/{vspId}/downloadHeat
+
+
+### GET
+
+<a id="getLatestHeatPackage">Get uploaded HEAT file</a>
+
+Downloads the latest HEAT package
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/octet-stream
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| 200 | successful operation | <a href="#/definitions/File">File</a>|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## /v1.0/vendor-software-products/{vspId}/networks
+
+
+### GET
+
+<a id="list">List vendor software product networks</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>version</th>
+ <td>query</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| 200 | successful operation | Array[<a href="#/definitions/NetworkDto">NetworkDto</a>]|
+
+
+
+
+
+
+### POST
+
+
+<a id="create">Create a vendor software product network</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+ <a href="#/definitions/NetworkRequestDto">NetworkRequestDto</a>
+ </td>
+
+</tr>
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## /v1.0/vendor-software-products/{vspId}/networks/{networkId}
+
+
+### GET
+
+<a id="get">Get vendor software product network</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>networkId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product network Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>version</th>
+ <td>query</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| 200 | successful operation | <a href="#/definitions/NetworkDto">NetworkDto</a>|
+
+
+
+
+### PUT
+
+<a id="update">Update vendor software product network</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+ <a href="#/definitions/NetworkRequestDto">NetworkRequestDto</a>
+ </td>
+
+</tr>
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>networkId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product network Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+### DELETE
+
+<a id="delete">Delete vendor software product network</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>networkId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product network Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+## /v1.0/vendor-software-products/{vspId}/processes
+
+
+### GET
+
+<a id="list">List vendor software product processes</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>version</th>
+ <td>query</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| 200 | successful operation | Array[<a href="#/definitions/ProcessEntityDto">ProcessEntityDto</a>]|
+
+
+
+
+
+
+### POST
+
+
+<a id="create">Create a vendor software product process</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+ <a href="#/definitions/ProcessRequestDto">ProcessRequestDto</a>
+ </td>
+
+</tr>
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+### DELETE
+
+<a id="deleteList">Delete vendor software product processes</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+## /v1.0/vendor-software-products/{vspId}/processes/{processId}
+
+
+### GET
+
+<a id="get">Get vendor software product process</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>processId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product process Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>version</th>
+ <td>query</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| 200 | successful operation | <a href="#/definitions/ProcessEntityDto">ProcessEntityDto</a>|
+
+
+
+
+### PUT
+
+<a id="update">Update vendor software product process</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+ <a href="#/definitions/ProcessRequestDto">ProcessRequestDto</a>
+ </td>
+
+</tr>
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>processId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product process Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+### DELETE
+
+<a id="delete">Delete vendor software product process</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>processId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product process Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+## /v1.0/vendor-software-products/{vspId}/processes/{processId}/upload
+
+
+### GET
+
+<a id="getUploadedFile">Get vendor software product process uploaded file</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>processId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product process Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>version</th>
+ <td>query</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/octet-stream
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+### POST
+
+
+<a id="uploadFile">Update vendor software product process upload</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** multipart/form-data
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+ <a href="#/definitions/Attachment">Attachment</a>
+ </td>
+
+</tr>
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>processId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product process Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+### DELETE
+
+<a id="deleteUploadedFile">Delete vendor software product process uploaded file</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>processId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td>Vendor software product process Id</td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+## /v1.0/vendor-software-products/{vspId}/questionnaire
+
+
+### GET
+
+<a id="getQuestionnaire">Get vendor software product questionnaire</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>version</th>
+ <td>query</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| 200 | successful operation | <a href="#/definitions/QuestionnaireResponseDto">QuestionnaireResponseDto</a>|
+
+
+
+
+### PUT
+
+<a id="updateQuestionnaire">Update vendor software product questionnaire</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+
+ </td>
+
+</tr>
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## /v1.0/vendor-software-products/{vspId}/upload
+
+
+
+
+
+
+### POST
+
+
+<a id="uploadFile">Uploads a HEAT package to translate</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** multipart/form-data
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vspId</th>
+ <td>path</td>
+ <td>yes</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+ <a href="#/definitions/InputStream">InputStream</a>
+ </td>
+
+</tr>
+
+<tr>
+ <th>USER_ID</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| 200 | successful operation | <a href="#/definitions/UploadFileResponseDto">UploadFileResponseDto</a>|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## /workflow/v1.0/actions
+
+
+### GET
+
+<a id="getFilteredActions">List Filtered Actions </a>
+
+Get list of actions based on a filter criteria | If no filter is sent all actions will be returned
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>vendor</th>
+ <td>query</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>category</th>
+ <td>query</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>name</th>
+ <td>query</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>modelId</th>
+ <td>query</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>componentId</th>
+ <td>query</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+### POST
+
+
+<a id="createAction">Create a new Action</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+
+ </td>
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## /workflow/v1.0/actions/components
+
+
+### GET
+
+<a id="getEcompComponents">List ECOMP Components supported by Action Library</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+
+
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## /workflow/v1.0/actions/{actionInvariantUUID}
+
+
+### GET
+
+<a id="getActionsByActionInvariantUuId">List Actions For Given Action Invariant UUID</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>actionInvariantUUID</th>
+ <td>path</td>
+ <td>yes</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>version</th>
+ <td>query</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+### PUT
+
+<a id="updateAction">Update an existing action</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>actionInvariantUUID</th>
+ <td>path</td>
+ <td>yes</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+
+ </td>
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+### POST
+
+
+<a id="actOnAction">Actions on a action</a>
+
+Performs one of the following actions on a action: |Checkout: Locks it for edits by other users. Only the locking user sees the edited version.|Undo_Checkout: Unlocks it and deletes the edits that were done.|Checkin: Unlocks it and activates the edited version to all users.| Submit: Finalize its active version.|
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>actionInvariantUUID</th>
+ <td>path</td>
+ <td>yes</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+
+ </td>
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+### DELETE
+
+<a id="deleteAction">Delete Action</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>actionInvariantUUID</th>
+ <td>path</td>
+ <td>yes</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+## /workflow/v1.0/actions/{actionInvariantUUID}/artifacts
+
+
+
+
+
+
+### POST
+
+
+<a id="uploadArtifact">Upload new Artifact</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** multipart/form-data
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>actionInvariantUUID</th>
+ <td>path</td>
+ <td>yes</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+
+ </td>
+
+</tr>
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+
+ </td>
+
+</tr>
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+
+ </td>
+
+</tr>
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+
+ </td>
+
+</tr>
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+
+ </td>
+
+</tr>
+
+<tr>
+ <th>Content-MD5</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+ <a href="#/definitions/Attachment">Attachment</a>
+ </td>
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## /workflow/v1.0/actions/{actionInvariantUUID}/artifacts/{artifactUUID}
+
+
+
+
+### PUT
+
+<a id="updateArtifact">Update an existing artifact</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** multipart/form-data
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>actionInvariantUUID</th>
+ <td>path</td>
+ <td>yes</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>artifactUUID</th>
+ <td>path</td>
+ <td>yes</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+
+ </td>
+
+</tr>
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+
+ </td>
+
+</tr>
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+
+ </td>
+
+</tr>
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+
+ </td>
+
+</tr>
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+
+ </td>
+
+</tr>
+
+<tr>
+ <th>Content-MD5</th>
+ <td>header</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>body</th>
+ <td>body</td>
+ <td>no</td>
+ <td></td>
+ <td> - </td>
+
+ <td>
+
+ <a href="#/definitions/Attachment">Attachment</a>
+ </td>
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+### DELETE
+
+<a id="deleteArtifact">Delete Artifact</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>actionInvariantUUID</th>
+ <td>path</td>
+ <td>yes</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>artifactUUID</th>
+ <td>path</td>
+ <td>yes</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/json
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+## /workflow/v1.0/actions/{actionUUID}/artifacts/{artifactUUID}
+
+
+### GET
+
+<a id="downloadArtifact">Downloads artifact for action</a>
+
+
+
+
+
+
+
+
+
+#### Request
+
+
+**Content-Type: ** application/json
+
+##### Parameters
+
+<table border="1">
+ <tr>
+ <th>Name</th>
+ <th>Located in</th>
+ <th>Required</th>
+ <th>Description</th>
+ <th>Default</th>
+ <th>Schema</th>
+ </tr>
+
+
+
+<tr>
+ <th>actionUUID</th>
+ <td>path</td>
+ <td>yes</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+<tr>
+ <th>artifactUUID</th>
+ <td>path</td>
+ <td>yes</td>
+ <td></td>
+ <td> - </td>
+
+
+ <td>string </td>
+
+
+</tr>
+
+
+</table>
+
+
+
+#### Response
+
+**Content-Type: ** application/octet-stream
+
+
+| Status Code | Reason | Response Model |
+|-------------|-------------|----------------|
+| default | successful operation | - |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Definitions
+
+## <a name="/definitions/Attachment">Attachment</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>headers</td>
+ <td>
+
+
+ object
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>object</td>
+ <td>
+
+
+ object
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>contentType</td>
+ <td>
+
+ <a href="#/definitions/MediaType">MediaType</a>
+
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>contentDisposition</td>
+ <td>
+
+ <a href="#/definitions/ContentDisposition">ContentDisposition</a>
+
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>dataHandler</td>
+ <td>
+
+ <a href="#/definitions/DataHandler">DataHandler</a>
+
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>contentId</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/ChoiceOrOtherDtoAggregationFunction">ChoiceOrOtherDtoAggregationFunction</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>choice</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>other</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/ChoiceOrOtherDtoEntitlementMetric">ChoiceOrOtherDtoEntitlementMetric</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>choice</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>other</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/ChoiceOrOtherDtoEntitlementTime">ChoiceOrOtherDtoEntitlementTime</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>choice</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>other</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/ChoiceOrOtherDtoLicenseTerm">ChoiceOrOtherDtoLicenseTerm</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>choice</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>other</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/CommandInfo">CommandInfo</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>commandClass</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>commandName</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/ComponentData">ComponentData</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>name</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>description</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>displayName</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/ComponentDto">ComponentDto</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>name</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>displayName</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>description</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>id</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/ComponentRequestDto">ComponentRequestDto</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>name</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>displayName</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>description</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/ConfigurationDataDto">ConfigurationDataDto</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>value</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>timeStamp</td>
+ <td>
+
+
+ integer (int64)
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/ContentDisposition">ContentDisposition</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>type</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>parameters</td>
+ <td>
+
+
+ object
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>filename</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/DataFlavor">DataFlavor</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>mimeType</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>humanPresentableName</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>subType</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>defaultRepresentationClassAsString</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>primaryType</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>flavorJavaFileListType</td>
+ <td>
+
+
+ boolean
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>flavorRemoteObjectType</td>
+ <td>
+
+
+ boolean
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>flavorSerializedObjectType</td>
+ <td>
+
+
+ boolean
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>flavorTextType</td>
+ <td>
+
+
+ boolean
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>mimeTypeSerializedObject</td>
+ <td>
+
+
+ boolean
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>representationClassByteBuffer</td>
+ <td>
+
+
+ boolean
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>representationClassCharBuffer</td>
+ <td>
+
+
+ boolean
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>representationClassInputStream</td>
+ <td>
+
+
+ boolean
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>representationClassReader</td>
+ <td>
+
+
+ boolean
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>representationClassRemote</td>
+ <td>
+
+
+ boolean
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>representationClassSerializable</td>
+ <td>
+
+
+ boolean
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/DataHandler">DataHandler</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>dataSource</td>
+ <td>
+
+ <a href="#/definitions/DataSource">DataSource</a>
+
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>name</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>inputStream</td>
+ <td>
+
+ <a href="#/definitions/InputStream">InputStream</a>
+
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>content</td>
+ <td>
+
+
+ object
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>contentType</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>outputStream</td>
+ <td>
+
+ <a href="#/definitions/OutputStream">OutputStream</a>
+
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>allCommands</td>
+ <td>
+
+
+ array[<a href="#/definitions/CommandInfo">CommandInfo</a>]
+
+
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>preferredCommands</td>
+ <td>
+
+
+ array[<a href="#/definitions/CommandInfo">CommandInfo</a>]
+
+
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>transferDataFlavors</td>
+ <td>
+
+
+ array[<a href="#/definitions/DataFlavor">DataFlavor</a>]
+
+
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/DataSource">DataSource</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>name</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>inputStream</td>
+ <td>
+
+ <a href="#/definitions/InputStream">InputStream</a>
+
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>contentType</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>outputStream</td>
+ <td>
+
+ <a href="#/definitions/OutputStream">OutputStream</a>
+
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/EntitlementPoolEntity">EntitlementPoolEntity</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>name</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>description</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>thresholdValue</td>
+ <td>
+
+
+ integer (int32)
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>thresholdUnits</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>entitlementMetric</td>
+ <td>
+
+ <a href="#/definitions/ChoiceOrOtherDtoEntitlementMetric">ChoiceOrOtherDtoEntitlementMetric</a>
+
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>increments</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>aggregationFunction</td>
+ <td>
+
+ <a href="#/definitions/ChoiceOrOtherDtoAggregationFunction">ChoiceOrOtherDtoAggregationFunction</a>
+
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>operationalScope</td>
+ <td>
+
+ <a href="#/definitions/MultiChoiceOrOtherDtoOperationalScope">MultiChoiceOrOtherDtoOperationalScope</a>
+
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>time</td>
+ <td>
+
+ <a href="#/definitions/ChoiceOrOtherDtoEntitlementTime">ChoiceOrOtherDtoEntitlementTime</a>
+
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>manufacturerReferenceNumber</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>id</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>referencingFeatureGroups</td>
+ <td>
+
+
+ array[string]
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/EntitlementPoolRequest">EntitlementPoolRequest</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>name</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>description</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>thresholdValue</td>
+ <td>
+
+
+ integer (int32)
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>thresholdUnits</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>entitlementMetric</td>
+ <td>
+
+ <a href="#/definitions/ChoiceOrOtherDtoEntitlementMetric">ChoiceOrOtherDtoEntitlementMetric</a>
+
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>increments</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>aggregationFunction</td>
+ <td>
+
+ <a href="#/definitions/ChoiceOrOtherDtoAggregationFunction">ChoiceOrOtherDtoAggregationFunction</a>
+
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>operationalScope</td>
+ <td>
+
+ <a href="#/definitions/MultiChoiceOrOtherDtoOperationalScope">MultiChoiceOrOtherDtoOperationalScope</a>
+
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>time</td>
+ <td>
+
+ <a href="#/definitions/ChoiceOrOtherDtoEntitlementTime">ChoiceOrOtherDtoEntitlementTime</a>
+
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>manufacturerReferenceNumber</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/ErrorMessage">ErrorMessage</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>level</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>message</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/FeatureGroupEntity">FeatureGroupEntity</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>name</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>description</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>partNumber</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>id</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>licenseKeyGroupsIds</td>
+ <td>
+
+
+ array[string]
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>entitlementPoolsIds</td>
+ <td>
+
+
+ array[string]
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>referencingLicenseAgreements</td>
+ <td>
+
+
+ array[string]
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/FeatureGroupModel">FeatureGroupModel</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>name</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>description</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>partNumber</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>id</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>referencingLicenseAgreements</td>
+ <td>
+
+
+ array[string]
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>licenseKeyGroups</td>
+ <td>
+
+
+ array[<a href="#/definitions/LicenseKeyGroupEntityDto">LicenseKeyGroupEntityDto</a>]
+
+
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>entitlementPools</td>
+ <td>
+
+
+ array[<a href="#/definitions/EntitlementPoolEntity">EntitlementPoolEntity</a>]
+
+
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/FeatureGroupRequest">FeatureGroupRequest</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>name</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>description</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>partNumber</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>addedLicenseKeyGroupsIds</td>
+ <td>
+
+
+ array[string]
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>addedEntitlementPoolsIds</td>
+ <td>
+
+
+ array[string]
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/FeatureGroupUpdateRequest">FeatureGroupUpdateRequest</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>name</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>description</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>partNumber</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>addedLicenseKeyGroupsIds</td>
+ <td>
+
+
+ array[string]
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>addedEntitlementPoolsIds</td>
+ <td>
+
+
+ array[string]
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>removedLicenseKeyGroupsIds</td>
+ <td>
+
+
+ array[string]
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>removedEntitlementPoolsIds</td>
+ <td>
+
+
+ array[string]
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/File">File</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>path</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>name</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>canonicalPath</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>parent</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>absolute</td>
+ <td>
+
+
+ boolean
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>absoluteFile</td>
+ <td>
+
+ <a href="#/definitions/File">File</a>
+
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>absolutePath</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>canonicalFile</td>
+ <td>
+
+ <a href="#/definitions/File">File</a>
+
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>freeSpace</td>
+ <td>
+
+
+ integer (int64)
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>parentFile</td>
+ <td>
+
+ <a href="#/definitions/File">File</a>
+
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>totalSpace</td>
+ <td>
+
+
+ integer (int64)
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>usableSpace</td>
+ <td>
+
+
+ integer (int64)
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>directory</td>
+ <td>
+
+
+ boolean
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>file</td>
+ <td>
+
+
+ boolean
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>hidden</td>
+ <td>
+
+
+ boolean
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/InputStream">InputStream</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+</table>
+
+## <a name="/definitions/LicenseAgreementEntity">LicenseAgreementEntity</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>name</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>description</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>licenseTerm</td>
+ <td>
+
+ <a href="#/definitions/ChoiceOrOtherDtoLicenseTerm">ChoiceOrOtherDtoLicenseTerm</a>
+
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>requirementsAndConstrains</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>id</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>featureGroupsIds</td>
+ <td>
+
+
+ array[string]
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/LicenseAgreementModel">LicenseAgreementModel</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>name</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>description</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>licenseTerm</td>
+ <td>
+
+ <a href="#/definitions/ChoiceOrOtherDtoLicenseTerm">ChoiceOrOtherDtoLicenseTerm</a>
+
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>requirementsAndConstrains</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>id</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>featureGroups</td>
+ <td>
+
+
+ array[<a href="#/definitions/FeatureGroupEntity">FeatureGroupEntity</a>]
+
+
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/LicenseAgreementRequest">LicenseAgreementRequest</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>name</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>description</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>licenseTerm</td>
+ <td>
+
+ <a href="#/definitions/ChoiceOrOtherDtoLicenseTerm">ChoiceOrOtherDtoLicenseTerm</a>
+
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>requirementsAndConstrains</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>addedFeatureGroupsIds</td>
+ <td>
+
+
+ array[string]
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/LicenseAgreementUpdateRequest">LicenseAgreementUpdateRequest</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>name</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>description</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>licenseTerm</td>
+ <td>
+
+ <a href="#/definitions/ChoiceOrOtherDtoLicenseTerm">ChoiceOrOtherDtoLicenseTerm</a>
+
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>requirementsAndConstrains</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>addedFeatureGroupsIds</td>
+ <td>
+
+
+ array[string]
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>removedFeatureGroupsIds</td>
+ <td>
+
+
+ array[string]
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/LicenseKeyGroupEntityDto">LicenseKeyGroupEntityDto</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>name</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>description</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>type</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>operationalScope</td>
+ <td>
+
+ <a href="#/definitions/MultiChoiceOrOtherDtoOperationalScope">MultiChoiceOrOtherDtoOperationalScope</a>
+
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>id</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>referencingFeatureGroups</td>
+ <td>
+
+
+ array[string]
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/LicenseKeyGroupRequestDto">LicenseKeyGroupRequestDto</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>name</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>description</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>type</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>operationalScope</td>
+ <td>
+
+ <a href="#/definitions/MultiChoiceOrOtherDtoOperationalScope">MultiChoiceOrOtherDtoOperationalScope</a>
+
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/LicensingData">LicensingData</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>licenseAgreement</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>featureGroups</td>
+ <td>
+
+
+ array[string]
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/MediaType">MediaType</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>type</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>subtype</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>parameters</td>
+ <td>
+
+
+ object
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>wildcardSubtype</td>
+ <td>
+
+
+ boolean
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>wildcardType</td>
+ <td>
+
+
+ boolean
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/MibUploadStatusDto">MibUploadStatusDto</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>snmpTrap</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>snmpPoll</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/MultiChoiceOrOtherDtoOperationalScope">MultiChoiceOrOtherDtoOperationalScope</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>choices</td>
+ <td>
+
+
+ array[string]
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>other</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/NetworkDto">NetworkDto</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>name</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>dhcp</td>
+ <td>
+
+
+ boolean
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>id</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/NetworkRequestDto">NetworkRequestDto</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>name</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>dhcp</td>
+ <td>
+
+
+ boolean
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/NicDto">NicDto</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>name</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>description</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>networkId</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>id</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>networkName</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/NicRequestDto">NicRequestDto</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>name</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>description</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>networkId</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/OutputStream">OutputStream</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+</table>
+
+## <a name="/definitions/PackageInfoDto">PackageInfoDto</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>displayName</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>description</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>vspName</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>version</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>packageId</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>category</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>subCategory</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>vendorName</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>vendorRelease</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>packageChecksum</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>packageType</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/ProcessEntityDto">ProcessEntityDto</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>name</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>description</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>id</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>artifactName</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/ProcessRequestDto">ProcessRequestDto</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>name</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>description</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/QuestionnaireResponseDto">QuestionnaireResponseDto</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>schema</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>data</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/UploadFileResponseDto">UploadFileResponseDto</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>fileNames</td>
+ <td>
+
+
+ array[string]
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>errors</td>
+ <td>
+
+
+ object
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>status</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/VendorLicenseModelActionRequestDto">VendorLicenseModelActionRequestDto</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>action</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/VendorLicenseModelEntity">VendorLicenseModelEntity</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>vendorName</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>description</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>iconRef</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>id</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>version</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>status</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>lockingUser</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>viewableVersions</td>
+ <td>
+
+
+ array[string]
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>finalVersions</td>
+ <td>
+
+
+ array[string]
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/VendorLicenseModelRequest">VendorLicenseModelRequest</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>vendorName</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>description</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>iconRef</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/VersionSoftwareProductActionRequestDto">VersionSoftwareProductActionRequestDto</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>action</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/VspCreationDto">VspCreationDto</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>vspId</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+## <a name="/definitions/VspDescriptionDto">VspDescriptionDto</a>
+
+<table border="1">
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>required</th>
+ <th>description</th>
+ <th>example</th>
+ </tr>
+
+ <tr>
+ <td>name</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>description</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>icon</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>category</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>subCategory</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>vendorName</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>vendorId</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>required</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>licensingVersion</td>
+ <td>
+
+
+ string
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>licensingData</td>
+ <td>
+
+ <a href="#/definitions/LicensingData">LicensingData</a>
+
+
+ </td>
+ <td>optional</td>
+ <td>-</td>
+ <td></td>
+ </tr>
+
+</table>
+
+</xmp>
+
+<script src="http://strapdownjs.com/v/0.2/strapdown.js"></script>
+</html> \ No newline at end of file
diff --git a/openecomp-be/tools/swagger-ui/api-docs/api.json b/openecomp-be/tools/swagger-ui/api-docs/api.json
new file mode 100644
index 0000000000..8396339628
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/api-docs/api.json
@@ -0,0 +1,4676 @@
+{
+ "swagger" : "2.0",
+ "info" : {
+ "description" : "Rest API Documentation",
+ "version" : "v1.0, build #${buildNumber}",
+ "title" : "Rest API",
+ "termsOfService" : "http://www.github.com/kongchen/swagger-maven-plugin"
+ },
+ "basePath" : "/onboarding-api",
+ "tags" : [ {
+ "name" : "Vendor License Models"
+ }, {
+ "name" : "Vendor License Model - Entitlement Pools"
+ }, {
+ "name" : "Vendor Software Product Processes"
+ }, {
+ "name" : "Application Configuration"
+ }, {
+ "name" : "Actions"
+ }, {
+ "name" : "Vendor License Model - License Key Groups"
+ }, {
+ "name" : "Vendor Software Product Component Processes"
+ }, {
+ "name" : "Vendor Software Product Components"
+ }, {
+ "name" : "Validation"
+ }, {
+ "name" : "Vendor Software Product Component MIB Uploads"
+ }, {
+ "name" : "Vendor License Model - License Agreements"
+ }, {
+ "name" : "Vendor Software Product Networks"
+ }, {
+ "name" : "Vendor Software Products"
+ }, {
+ "name" : "Vendor Software Product Component NICs"
+ }, {
+ "name" : "Vendor License Model - Feature Groups"
+ } ],
+ "schemes" : [ "http" ],
+ "paths" : {
+ "/v1.0/application-configuration" : {
+ "post" : {
+ "tags" : [ "Application Configuration" ],
+ "summary" : "Insert JSON schema into application config table",
+ "description" : "",
+ "operationId" : "insertToTable",
+ "consumes" : [ "multipart/form-data" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "namespace",
+ "in" : "query",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "key",
+ "in" : "query",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "$ref" : "#/definitions/InputStream"
+ }
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ },
+ "/v1.0/application-configuration/{namespace}" : {
+ "get" : {
+ "tags" : [ "Application Configuration" ],
+ "summary" : "Get List of keys and values by namespace",
+ "description" : "",
+ "operationId" : "getListOfConfigurationByNamespaceFromTable",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "namespace",
+ "in" : "path",
+ "required" : true,
+ "type" : "string"
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ },
+ "/v1.0/application-configuration/{namespace}/{key}" : {
+ "get" : {
+ "tags" : [ "Application Configuration" ],
+ "summary" : "Get JSON schema by namespace and key",
+ "description" : "",
+ "operationId" : "getFromTable",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "namespace",
+ "in" : "path",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "key",
+ "in" : "path",
+ "required" : true,
+ "type" : "string"
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "successful operation",
+ "schema" : {
+ "$ref" : "#/definitions/ConfigurationDataDto"
+ }
+ }
+ }
+ }
+ },
+ "/v1.0/validation/{type}/validate" : {
+ "post" : {
+ "tags" : [ "Validation" ],
+ "summary" : "Validate a package",
+ "description" : "",
+ "operationId" : "validateFile",
+ "consumes" : [ "multipart/form-data" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "type",
+ "in" : "path",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "$ref" : "#/definitions/InputStream"
+ }
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ },
+ "/v1.0/vendor-license-models" : {
+ "get" : {
+ "tags" : [ "Vendor License Models" ],
+ "summary" : "List vendor license models",
+ "description" : "",
+ "operationId" : "listLicenseModels",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "versionFilter",
+ "in" : "query",
+ "description" : "Currently supported value: 'Final' - only vendor License models with final versions will be return - with their latest final version",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "successful operation",
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/definitions/VendorLicenseModelEntity"
+ }
+ }
+ }
+ }
+ },
+ "post" : {
+ "tags" : [ "Vendor License Models" ],
+ "summary" : "Create vendor license model",
+ "description" : "",
+ "operationId" : "createLicenseModel",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "$ref" : "#/definitions/VendorLicenseModelRequest"
+ }
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ },
+ "/v1.0/vendor-license-models/{vlmId}" : {
+ "get" : {
+ "tags" : [ "Vendor License Models" ],
+ "summary" : "Get vendor license model",
+ "description" : "",
+ "operationId" : "getLicenseModel",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vlmId",
+ "in" : "path",
+ "description" : "Vendor license model Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "version",
+ "in" : "query",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "successful operation",
+ "schema" : {
+ "$ref" : "#/definitions/VendorLicenseModelEntity"
+ }
+ }
+ }
+ },
+ "put" : {
+ "tags" : [ "Vendor License Models" ],
+ "summary" : "Update vendor license model",
+ "description" : "",
+ "operationId" : "updateLicenseModel",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "$ref" : "#/definitions/VendorLicenseModelRequest"
+ }
+ }, {
+ "name" : "vlmId",
+ "in" : "path",
+ "description" : "Vendor license model Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ },
+ "delete" : {
+ "tags" : [ "Vendor License Models" ],
+ "summary" : "Delete vendor license model",
+ "description" : "",
+ "operationId" : "deleteLicenseModel",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vlmId",
+ "in" : "path",
+ "description" : "Vendor license model Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ },
+ "/v1.0/vendor-license-models/{vlmId}/actions" : {
+ "put" : {
+ "tags" : [ "Vendor License Models" ],
+ "summary" : "Update vendor license model",
+ "description" : "",
+ "operationId" : "actOnLicenseModel",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "$ref" : "#/definitions/VendorLicenseModelActionRequestDto"
+ }
+ }, {
+ "name" : "vlmId",
+ "in" : "path",
+ "description" : "Vendor license model Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ },
+ "/v1.0/vendor-license-models/{vlmId}/entitlement-pools" : {
+ "get" : {
+ "tags" : [ "Vendor License Model - Entitlement Pools" ],
+ "summary" : "List vendor entitlement pools",
+ "description" : "",
+ "operationId" : "listEntitlementPools",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vlmId",
+ "in" : "path",
+ "description" : "Vendor license model Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "version",
+ "in" : "query",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "successful operation",
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/definitions/EntitlementPoolEntity"
+ }
+ }
+ }
+ }
+ },
+ "post" : {
+ "tags" : [ "Vendor License Model - Entitlement Pools" ],
+ "summary" : "Create vendor entitlement pool",
+ "description" : "",
+ "operationId" : "createEntitlementPool",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "$ref" : "#/definitions/EntitlementPoolRequest"
+ }
+ }, {
+ "name" : "vlmId",
+ "in" : "path",
+ "description" : "Vendor license model Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ },
+ "/v1.0/vendor-license-models/{vlmId}/entitlement-pools/{entitlementPoolId}" : {
+ "get" : {
+ "tags" : [ "Vendor License Model - Entitlement Pools" ],
+ "summary" : "Get vendor entitlement pool",
+ "description" : "",
+ "operationId" : "getEntitlementPool",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vlmId",
+ "in" : "path",
+ "description" : "Vendor license model Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "version",
+ "in" : "query",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "entitlementPoolId",
+ "in" : "path",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "successful operation",
+ "schema" : {
+ "$ref" : "#/definitions/EntitlementPoolEntity"
+ }
+ }
+ }
+ },
+ "put" : {
+ "tags" : [ "Vendor License Model - Entitlement Pools" ],
+ "summary" : "Update vendor entitlement pool",
+ "description" : "",
+ "operationId" : "updateEntitlementPool",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "$ref" : "#/definitions/EntitlementPoolRequest"
+ }
+ }, {
+ "name" : "vlmId",
+ "in" : "path",
+ "description" : "Vendor license model Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "entitlementPoolId",
+ "in" : "path",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ },
+ "delete" : {
+ "tags" : [ "Vendor License Model - Entitlement Pools" ],
+ "summary" : "Delete vendor entitlement pool",
+ "description" : "",
+ "operationId" : "deleteEntitlementPool",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vlmId",
+ "in" : "path",
+ "description" : "Vendor license model Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "entitlementPoolId",
+ "in" : "path",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ },
+ "/v1.0/vendor-license-models/{vlmId}/feature-groups" : {
+ "get" : {
+ "tags" : [ "Vendor License Model - Feature Groups" ],
+ "summary" : "List vendor feature groups",
+ "description" : "",
+ "operationId" : "listFeatureGroups",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vlmId",
+ "in" : "path",
+ "description" : "Vendor license model Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "version",
+ "in" : "query",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "successful operation",
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/definitions/FeatureGroupEntity"
+ }
+ }
+ }
+ }
+ },
+ "post" : {
+ "tags" : [ "Vendor License Model - Feature Groups" ],
+ "summary" : "Create vendor feature group",
+ "description" : "",
+ "operationId" : "createFeatureGroup",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "$ref" : "#/definitions/FeatureGroupRequest"
+ }
+ }, {
+ "name" : "vlmId",
+ "in" : "path",
+ "description" : "Vendor license model Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ },
+ "/v1.0/vendor-license-models/{vlmId}/feature-groups/{featureGroupId}" : {
+ "get" : {
+ "tags" : [ "Vendor License Model - Feature Groups" ],
+ "summary" : "Get vendor feature group",
+ "description" : "",
+ "operationId" : "getFeatureGroup",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vlmId",
+ "in" : "path",
+ "description" : "Vendor license model Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "version",
+ "in" : "query",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "featureGroupId",
+ "in" : "path",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "successful operation",
+ "schema" : {
+ "$ref" : "#/definitions/FeatureGroupModel"
+ }
+ }
+ }
+ },
+ "put" : {
+ "tags" : [ "Vendor License Model - Feature Groups" ],
+ "summary" : "Update vendor feature group",
+ "description" : "",
+ "operationId" : "updateFeatureGroup",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "$ref" : "#/definitions/FeatureGroupUpdateRequest"
+ }
+ }, {
+ "name" : "vlmId",
+ "in" : "path",
+ "description" : "Vendor license model Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "featureGroupId",
+ "in" : "path",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ },
+ "delete" : {
+ "tags" : [ "Vendor License Model - Feature Groups" ],
+ "summary" : "Delete vendor feature group",
+ "description" : "",
+ "operationId" : "deleteFeatureGroup",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vlmId",
+ "in" : "path",
+ "description" : "Vendor license model Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "featureGroupId",
+ "in" : "path",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ },
+ "/v1.0/vendor-license-models/{vlmId}/license-agreements" : {
+ "get" : {
+ "tags" : [ "Vendor License Model - License Agreements" ],
+ "summary" : "List vendor license agreements",
+ "description" : "",
+ "operationId" : "listLicenseAgreements",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vlmId",
+ "in" : "path",
+ "description" : "Vendor license model Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "version",
+ "in" : "query",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "successful operation",
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/definitions/LicenseAgreementEntity"
+ }
+ }
+ }
+ }
+ },
+ "post" : {
+ "tags" : [ "Vendor License Model - License Agreements" ],
+ "summary" : "Create vendor license agreement",
+ "description" : "",
+ "operationId" : "createLicenseAgreement",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "$ref" : "#/definitions/LicenseAgreementRequest"
+ }
+ }, {
+ "name" : "vlmId",
+ "in" : "path",
+ "description" : "Vendor license model Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ },
+ "/v1.0/vendor-license-models/{vlmId}/license-agreements/{licenseAgreementId}" : {
+ "get" : {
+ "tags" : [ "Vendor License Model - License Agreements" ],
+ "summary" : "Get vendor license agreement",
+ "description" : "",
+ "operationId" : "getLicenseAgreement",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vlmId",
+ "in" : "path",
+ "description" : "Vendor license model Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "version",
+ "in" : "query",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "licenseAgreementId",
+ "in" : "path",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "successful operation",
+ "schema" : {
+ "$ref" : "#/definitions/LicenseAgreementModel"
+ }
+ }
+ }
+ },
+ "put" : {
+ "tags" : [ "Vendor License Model - License Agreements" ],
+ "summary" : "Update vendor license agreement",
+ "description" : "",
+ "operationId" : "updateLicenseAgreement",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "$ref" : "#/definitions/LicenseAgreementUpdateRequest"
+ }
+ }, {
+ "name" : "vlmId",
+ "in" : "path",
+ "description" : "Vendor license model Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "licenseAgreementId",
+ "in" : "path",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ },
+ "delete" : {
+ "tags" : [ "Vendor License Model - License Agreements" ],
+ "summary" : "Delete vendor license agreement",
+ "description" : "",
+ "operationId" : "deleteLicenseAgreement",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vlmId",
+ "in" : "path",
+ "description" : "Vendor license model Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "licenseAgreementId",
+ "in" : "path",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ },
+ "/v1.0/vendor-license-models/{vlmId}/license-key-groups" : {
+ "get" : {
+ "tags" : [ "Vendor License Model - License Key Groups" ],
+ "summary" : "List vendor license key groups",
+ "description" : "",
+ "operationId" : "listLicenseKeyGroups",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vlmId",
+ "in" : "path",
+ "description" : "Vendor license model Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "version",
+ "in" : "query",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "successful operation",
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/definitions/LicenseKeyGroupEntityDto"
+ }
+ }
+ }
+ }
+ },
+ "post" : {
+ "tags" : [ "Vendor License Model - License Key Groups" ],
+ "summary" : "Create vendor license key group",
+ "description" : "",
+ "operationId" : "createLicenseKeyGroup",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "$ref" : "#/definitions/LicenseKeyGroupRequestDto"
+ }
+ }, {
+ "name" : "vlmId",
+ "in" : "path",
+ "description" : "Vendor license model Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ },
+ "/v1.0/vendor-license-models/{vlmId}/license-key-groups/{licenseKeyGroupId}" : {
+ "get" : {
+ "tags" : [ "Vendor License Model - License Key Groups" ],
+ "summary" : "Get vendor license key group",
+ "description" : "",
+ "operationId" : "getLicenseKeyGroup",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vlmId",
+ "in" : "path",
+ "description" : "Vendor license model Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "version",
+ "in" : "query",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "licenseKeyGroupId",
+ "in" : "path",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "successful operation",
+ "schema" : {
+ "$ref" : "#/definitions/LicenseKeyGroupEntityDto"
+ }
+ }
+ }
+ },
+ "put" : {
+ "tags" : [ "Vendor License Model - License Key Groups" ],
+ "summary" : "Update vendor license key group",
+ "description" : "",
+ "operationId" : "updateLicenseKeyGroup",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "$ref" : "#/definitions/LicenseKeyGroupRequestDto"
+ }
+ }, {
+ "name" : "vlmId",
+ "in" : "path",
+ "description" : "Vendor license model Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "licenseKeyGroupId",
+ "in" : "path",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ },
+ "delete" : {
+ "tags" : [ "Vendor License Model - License Key Groups" ],
+ "summary" : "Delete vendor license key group",
+ "description" : "",
+ "operationId" : "deleteLicenseKeyGroup",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vlmId",
+ "in" : "path",
+ "description" : "Vendor license model Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "licenseKeyGroupId",
+ "in" : "path",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ },
+ "/v1.0/vendor-software-products" : {
+ "get" : {
+ "tags" : [ "Vendor Software Products" ],
+ "summary" : "Get list of vendor software products and their description",
+ "description" : "",
+ "operationId" : "getVspList",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "versionFilter",
+ "in" : "query",
+ "description" : "Currently supported values: 'Final' - only vendor software products with final version will be return - with their latest final version",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ },
+ "post" : {
+ "tags" : [ "Vendor Software Products" ],
+ "summary" : "Create a new vendor software product",
+ "description" : "",
+ "operationId" : "createNewVsp",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "$ref" : "#/definitions/VspDescriptionDto"
+ }
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "successful operation",
+ "schema" : {
+ "$ref" : "#/definitions/VspCreationDto"
+ }
+ }
+ }
+ }
+ },
+ "/v1.0/vendor-software-products/packages" : {
+ "get" : {
+ "tags" : [ "Vendor Software Products" ],
+ "summary" : "Get list of translated CSAR files details",
+ "description" : "",
+ "operationId" : "listPackages",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "category",
+ "in" : "query",
+ "description" : "Category",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "subCategory",
+ "in" : "query",
+ "description" : "Sub-category",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "successful operation",
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/definitions/PackageInfoDto"
+ }
+ }
+ }
+ }
+ }
+ },
+ "/v1.0/vendor-software-products/packages/{vspId}" : {
+ "get" : {
+ "tags" : [ "Vendor Software Products" ],
+ "summary" : "Get translated CSAR file",
+ "description" : "Exports translated file to a zip file",
+ "operationId" : "getTranslatedFile",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/octet-stream" ],
+ "parameters" : [ {
+ "name" : "vspId",
+ "in" : "path",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "version",
+ "in" : "query",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "successful operation",
+ "schema" : {
+ "$ref" : "#/definitions/File"
+ }
+ }
+ }
+ }
+ },
+ "/v1.0/vendor-software-products/{vspId}" : {
+ "get" : {
+ "tags" : [ "Vendor Software Products" ],
+ "summary" : "Get details of a vendor software product",
+ "description" : "",
+ "operationId" : "getVspDetails",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vspId",
+ "in" : "path",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "version",
+ "in" : "query",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ },
+ "put" : {
+ "tags" : [ "Vendor Software Products" ],
+ "summary" : "Update an existing vendor software product",
+ "description" : "",
+ "operationId" : "updateVsp",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vspId",
+ "in" : "path",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "$ref" : "#/definitions/VspDescriptionDto"
+ }
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ },
+ "delete" : {
+ "tags" : [ "Vendor Software Products" ],
+ "summary" : "Deletes vendor software product by given id",
+ "description" : "",
+ "operationId" : "deleteVsp",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vspId",
+ "in" : "path",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ },
+ "/v1.0/vendor-software-products/{vspId}/actions" : {
+ "put" : {
+ "tags" : [ "Vendor Software Products" ],
+ "summary" : "Actions on a vendor software product",
+ "description" : "Performs one of the following actions on a vendor software product: |Checkout: Locks it for edits by other users. Only the locking user sees the edited version.|Undo_Checkout: Unlocks it and deletes the edits that were done.|Checkin: Unlocks it and activates the edited version to all users.| Submit: Finalize its active version.|Create_Package: Creates a CSAR zip file.|",
+ "operationId" : "actOnVendorSoftwareProduct",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vspId",
+ "in" : "path",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "$ref" : "#/definitions/VersionSoftwareProductActionRequestDto"
+ }
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ },
+ "/v1.0/vendor-software-products/{vspId}/components" : {
+ "get" : {
+ "tags" : [ "Vendor Software Product Components" ],
+ "summary" : "List vendor software product components",
+ "description" : "",
+ "operationId" : "list",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "version",
+ "in" : "query",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "successful operation",
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/definitions/ComponentDto"
+ }
+ }
+ }
+ }
+ },
+ "post" : {
+ "tags" : [ "Vendor Software Product Components" ],
+ "summary" : "Create a vendor software product component",
+ "description" : "",
+ "operationId" : "create",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "$ref" : "#/definitions/ComponentRequestDto"
+ }
+ }, {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ },
+ "delete" : {
+ "tags" : [ "Vendor Software Product Components" ],
+ "summary" : "Delete vendor software product components",
+ "description" : "",
+ "operationId" : "deleteList",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ },
+ "/v1.0/vendor-software-products/{vspId}/components/{componentId}" : {
+ "get" : {
+ "tags" : [ "Vendor Software Product Components" ],
+ "summary" : "Get vendor software product component",
+ "description" : "",
+ "operationId" : "get",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "componentId",
+ "in" : "path",
+ "description" : "Vendor software product component Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "version",
+ "in" : "query",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "successful operation",
+ "schema" : {
+ "$ref" : "#/definitions/ComponentData"
+ }
+ }
+ }
+ },
+ "put" : {
+ "tags" : [ "Vendor Software Product Components" ],
+ "summary" : "Update vendor software product component",
+ "description" : "",
+ "operationId" : "update",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "$ref" : "#/definitions/ComponentRequestDto"
+ }
+ }, {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "componentId",
+ "in" : "path",
+ "description" : "Vendor software product component Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ },
+ "delete" : {
+ "tags" : [ "Vendor Software Product Components" ],
+ "summary" : "Delete vendor software product component",
+ "description" : "",
+ "operationId" : "delete",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "componentId",
+ "in" : "path",
+ "description" : "Vendor software product component Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ },
+ "/v1.0/vendor-software-products/{vspId}/components/{componentId}/monitors/snmp" : {
+ "get" : {
+ "tags" : [ "Vendor Software Product Component MIB Uploads" ],
+ "summary" : "Get the filenames of uploaded MIB definitions",
+ "description" : "",
+ "operationId" : "list",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "componentId",
+ "in" : "path",
+ "description" : "Vendor software product component Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "successful operation",
+ "schema" : {
+ "$ref" : "#/definitions/MibUploadStatusDto"
+ }
+ }
+ }
+ },
+ "delete" : {
+ "tags" : [ "Vendor Software Product Component MIB Uploads" ],
+ "summary" : "Delete vendor software product MIB Poll Definitions file",
+ "description" : "",
+ "operationId" : "deletePollMibFile",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "componentId",
+ "in" : "path",
+ "description" : "Vendor software product component Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ },
+ "/v1.0/vendor-software-products/{vspId}/components/{componentId}/monitors/snmp-trap" : {
+ "delete" : {
+ "tags" : [ "Vendor Software Product Component MIB Uploads" ],
+ "summary" : "Delete vendor software product MIB Trap Definitions file",
+ "description" : "",
+ "operationId" : "deleteTrapMibFile",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "componentId",
+ "in" : "path",
+ "description" : "Vendor software product component Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ },
+ "/v1.0/vendor-software-products/{vspId}/components/{componentId}/monitors/snmp-trap/upload" : {
+ "post" : {
+ "tags" : [ "Vendor Software Product Component MIB Uploads" ],
+ "summary" : "Upload vendor software product MIB Trap Definitions file",
+ "description" : "",
+ "operationId" : "uploadTrapMibFile",
+ "consumes" : [ "multipart/form-data" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "$ref" : "#/definitions/Attachment"
+ }
+ }, {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "componentId",
+ "in" : "path",
+ "description" : "Vendor software product component Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ },
+ "/v1.0/vendor-software-products/{vspId}/components/{componentId}/monitors/snmp/upload" : {
+ "post" : {
+ "tags" : [ "Vendor Software Product Component MIB Uploads" ],
+ "summary" : "Upload vendor software product MIB Poll Definitions file",
+ "description" : "",
+ "operationId" : "uploadPollMibFile",
+ "consumes" : [ "multipart/form-data" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "$ref" : "#/definitions/Attachment"
+ }
+ }, {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "componentId",
+ "in" : "path",
+ "description" : "Vendor software product component Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ },
+ "/v1.0/vendor-software-products/{vspId}/components/{componentId}/nics" : {
+ "get" : {
+ "tags" : [ "Vendor Software Product Component NICs" ],
+ "summary" : "List vendor software product component NICs",
+ "description" : "",
+ "operationId" : "list",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "componentId",
+ "in" : "path",
+ "description" : "Vendor software product component Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "version",
+ "in" : "query",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "successful operation",
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/definitions/NicDto"
+ }
+ }
+ }
+ }
+ },
+ "post" : {
+ "tags" : [ "Vendor Software Product Component NICs" ],
+ "summary" : "Create a vendor software product NIC",
+ "description" : "",
+ "operationId" : "create",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "$ref" : "#/definitions/NicRequestDto"
+ }
+ }, {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "componentId",
+ "in" : "path",
+ "description" : "Vendor software product component Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ },
+ "/v1.0/vendor-software-products/{vspId}/components/{componentId}/nics/{nicId}" : {
+ "get" : {
+ "tags" : [ "Vendor Software Product Component NICs" ],
+ "summary" : "Get vendor software product NIC",
+ "description" : "",
+ "operationId" : "get",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "componentId",
+ "in" : "path",
+ "description" : "Vendor software product component Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "nicId",
+ "in" : "path",
+ "description" : "Vendor software product NIC Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "version",
+ "in" : "query",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "successful operation",
+ "schema" : {
+ "$ref" : "#/definitions/NicDto"
+ }
+ }
+ }
+ },
+ "put" : {
+ "tags" : [ "Vendor Software Product Component NICs" ],
+ "summary" : "Update vendor software product NIC",
+ "description" : "",
+ "operationId" : "update",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "$ref" : "#/definitions/NicRequestDto"
+ }
+ }, {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "componentId",
+ "in" : "path",
+ "description" : "Vendor software product component Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "nicId",
+ "in" : "path",
+ "description" : "Vendor software product NIC Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ },
+ "delete" : {
+ "tags" : [ "Vendor Software Product Component NICs" ],
+ "summary" : "Delete vendor software product NIC",
+ "description" : "",
+ "operationId" : "delete",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "componentId",
+ "in" : "path",
+ "description" : "Vendor software product component Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "nicId",
+ "in" : "path",
+ "description" : "Vendor software product NIC Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ },
+ "/v1.0/vendor-software-products/{vspId}/components/{componentId}/nics/{nicId}/questionnaire" : {
+ "get" : {
+ "tags" : [ "Vendor Software Product Component NICs" ],
+ "summary" : "Get vendor software product component NIC questionnaire",
+ "description" : "",
+ "operationId" : "getQuestionnaire",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "componentId",
+ "in" : "path",
+ "description" : "Vendor software product component Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "nicId",
+ "in" : "path",
+ "description" : "Vendor software product NIC Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "version",
+ "in" : "query",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "successful operation",
+ "schema" : {
+ "$ref" : "#/definitions/QuestionnaireResponseDto"
+ }
+ }
+ }
+ },
+ "put" : {
+ "tags" : [ "Vendor Software Product Component NICs" ],
+ "summary" : "Update vendor software product component NIC questionnaire",
+ "description" : "",
+ "operationId" : "updateQuestionnaire",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "componentId",
+ "in" : "path",
+ "description" : "Vendor software product component Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "nicId",
+ "in" : "path",
+ "description" : "Vendor software product NIC Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ },
+ "/v1.0/vendor-software-products/{vspId}/components/{componentId}/processes" : {
+ "get" : {
+ "tags" : [ "Vendor Software Product Component Processes" ],
+ "summary" : "List vendor software product component processes",
+ "description" : "",
+ "operationId" : "list",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "componentId",
+ "in" : "path",
+ "description" : "Vendor software product component Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "version",
+ "in" : "query",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "successful operation",
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/definitions/ProcessEntityDto"
+ }
+ }
+ }
+ }
+ },
+ "post" : {
+ "tags" : [ "Vendor Software Product Component Processes" ],
+ "summary" : "Create a vendor software product process",
+ "description" : "",
+ "operationId" : "create",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "$ref" : "#/definitions/ProcessRequestDto"
+ }
+ }, {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "componentId",
+ "in" : "path",
+ "description" : "Vendor software product component Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ },
+ "delete" : {
+ "tags" : [ "Vendor Software Product Component Processes" ],
+ "summary" : "Delete vendor software product processes",
+ "description" : "",
+ "operationId" : "deleteList",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "componentId",
+ "in" : "path",
+ "description" : "Vendor software product component Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ },
+ "/v1.0/vendor-software-products/{vspId}/components/{componentId}/processes/{processId}" : {
+ "get" : {
+ "tags" : [ "Vendor Software Product Component Processes" ],
+ "summary" : "Get vendor software product process",
+ "description" : "",
+ "operationId" : "get",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "componentId",
+ "in" : "path",
+ "description" : "Vendor software product component Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "processId",
+ "in" : "path",
+ "description" : "Vendor software product process Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "version",
+ "in" : "query",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "successful operation",
+ "schema" : {
+ "$ref" : "#/definitions/ProcessEntityDto"
+ }
+ }
+ }
+ },
+ "put" : {
+ "tags" : [ "Vendor Software Product Component Processes" ],
+ "summary" : "Update vendor software product process",
+ "description" : "",
+ "operationId" : "update",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "$ref" : "#/definitions/ProcessRequestDto"
+ }
+ }, {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "componentId",
+ "in" : "path",
+ "description" : "Vendor software product component Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "processId",
+ "in" : "path",
+ "description" : "Vendor software product process Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ },
+ "delete" : {
+ "tags" : [ "Vendor Software Product Component Processes" ],
+ "summary" : "Delete vendor software product process",
+ "description" : "",
+ "operationId" : "delete",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "componentId",
+ "in" : "path",
+ "description" : "Vendor software product component Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "processId",
+ "in" : "path",
+ "description" : "Vendor software product process Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ },
+ "/v1.0/vendor-software-products/{vspId}/components/{componentId}/processes/{processId}/upload" : {
+ "get" : {
+ "tags" : [ "Vendor Software Product Component Processes" ],
+ "summary" : "Get vendor software product process uploaded file",
+ "description" : "",
+ "operationId" : "getUploadedFile",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/octet-stream" ],
+ "parameters" : [ {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "componentId",
+ "in" : "path",
+ "description" : "Vendor software product component Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "processId",
+ "in" : "path",
+ "description" : "Vendor software product process Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "version",
+ "in" : "query",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ },
+ "post" : {
+ "tags" : [ "Vendor Software Product Component Processes" ],
+ "summary" : "Update vendor software product process upload",
+ "description" : "",
+ "operationId" : "uploadFile",
+ "consumes" : [ "multipart/form-data" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "$ref" : "#/definitions/Attachment"
+ }
+ }, {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "componentId",
+ "in" : "path",
+ "description" : "Vendor software product component Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "processId",
+ "in" : "path",
+ "description" : "Vendor software product process Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ },
+ "delete" : {
+ "tags" : [ "Vendor Software Product Component Processes" ],
+ "summary" : "Delete vendor software product process uploaded file",
+ "description" : "",
+ "operationId" : "deleteUploadedFile",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "componentId",
+ "in" : "path",
+ "description" : "Vendor software product component Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "processId",
+ "in" : "path",
+ "description" : "Vendor software product process Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ },
+ "/v1.0/vendor-software-products/{vspId}/components/{componentId}/questionnaire" : {
+ "get" : {
+ "tags" : [ "Vendor Software Product Components" ],
+ "summary" : "Get vendor software product component questionnaire",
+ "description" : "",
+ "operationId" : "getQuestionnaire",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "componentId",
+ "in" : "path",
+ "description" : "Vendor software product component Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "version",
+ "in" : "query",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "successful operation",
+ "schema" : {
+ "$ref" : "#/definitions/QuestionnaireResponseDto"
+ }
+ }
+ }
+ },
+ "put" : {
+ "tags" : [ "Vendor Software Product Components" ],
+ "summary" : "Update vendor software product component questionnaire",
+ "description" : "",
+ "operationId" : "updateQuestionnaire",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "componentId",
+ "in" : "path",
+ "description" : "Vendor software product component Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ },
+ "/v1.0/vendor-software-products/{vspId}/downloadHeat" : {
+ "get" : {
+ "tags" : [ "Vendor Software Products" ],
+ "summary" : "Get uploaded HEAT file",
+ "description" : "Downloads the latest HEAT package",
+ "operationId" : "getLatestHeatPackage",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/octet-stream" ],
+ "parameters" : [ {
+ "name" : "vspId",
+ "in" : "path",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "successful operation",
+ "schema" : {
+ "$ref" : "#/definitions/File"
+ }
+ }
+ }
+ }
+ },
+ "/v1.0/vendor-software-products/{vspId}/networks" : {
+ "get" : {
+ "tags" : [ "Vendor Software Product Networks" ],
+ "summary" : "List vendor software product networks",
+ "description" : "",
+ "operationId" : "list",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "version",
+ "in" : "query",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "successful operation",
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/definitions/NetworkDto"
+ }
+ }
+ }
+ }
+ },
+ "post" : {
+ "tags" : [ "Vendor Software Product Networks" ],
+ "summary" : "Create a vendor software product network",
+ "description" : "",
+ "operationId" : "create",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "$ref" : "#/definitions/NetworkRequestDto"
+ }
+ }, {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ },
+ "/v1.0/vendor-software-products/{vspId}/networks/{networkId}" : {
+ "get" : {
+ "tags" : [ "Vendor Software Product Networks" ],
+ "summary" : "Get vendor software product network",
+ "description" : "",
+ "operationId" : "get",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "networkId",
+ "in" : "path",
+ "description" : "Vendor software product network Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "version",
+ "in" : "query",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "successful operation",
+ "schema" : {
+ "$ref" : "#/definitions/NetworkDto"
+ }
+ }
+ }
+ },
+ "put" : {
+ "tags" : [ "Vendor Software Product Networks" ],
+ "summary" : "Update vendor software product network",
+ "description" : "",
+ "operationId" : "update",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "$ref" : "#/definitions/NetworkRequestDto"
+ }
+ }, {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "networkId",
+ "in" : "path",
+ "description" : "Vendor software product network Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ },
+ "delete" : {
+ "tags" : [ "Vendor Software Product Networks" ],
+ "summary" : "Delete vendor software product network",
+ "description" : "",
+ "operationId" : "delete",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "networkId",
+ "in" : "path",
+ "description" : "Vendor software product network Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ },
+ "/v1.0/vendor-software-products/{vspId}/processes" : {
+ "get" : {
+ "tags" : [ "Vendor Software Product Processes" ],
+ "summary" : "List vendor software product processes",
+ "description" : "",
+ "operationId" : "list",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "version",
+ "in" : "query",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "successful operation",
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/definitions/ProcessEntityDto"
+ }
+ }
+ }
+ }
+ },
+ "post" : {
+ "tags" : [ "Vendor Software Product Processes" ],
+ "summary" : "Create a vendor software product process",
+ "description" : "",
+ "operationId" : "create",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "$ref" : "#/definitions/ProcessRequestDto"
+ }
+ }, {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ },
+ "delete" : {
+ "tags" : [ "Vendor Software Product Processes" ],
+ "summary" : "Delete vendor software product processes",
+ "description" : "",
+ "operationId" : "deleteList",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ },
+ "/v1.0/vendor-software-products/{vspId}/processes/{processId}" : {
+ "get" : {
+ "tags" : [ "Vendor Software Product Processes" ],
+ "summary" : "Get vendor software product process",
+ "description" : "",
+ "operationId" : "get",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "processId",
+ "in" : "path",
+ "description" : "Vendor software product process Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "version",
+ "in" : "query",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "successful operation",
+ "schema" : {
+ "$ref" : "#/definitions/ProcessEntityDto"
+ }
+ }
+ }
+ },
+ "put" : {
+ "tags" : [ "Vendor Software Product Processes" ],
+ "summary" : "Update vendor software product process",
+ "description" : "",
+ "operationId" : "update",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "$ref" : "#/definitions/ProcessRequestDto"
+ }
+ }, {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "processId",
+ "in" : "path",
+ "description" : "Vendor software product process Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ },
+ "delete" : {
+ "tags" : [ "Vendor Software Product Processes" ],
+ "summary" : "Delete vendor software product process",
+ "description" : "",
+ "operationId" : "delete",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "processId",
+ "in" : "path",
+ "description" : "Vendor software product process Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ },
+ "/v1.0/vendor-software-products/{vspId}/processes/{processId}/upload" : {
+ "get" : {
+ "tags" : [ "Vendor Software Product Processes" ],
+ "summary" : "Get vendor software product process uploaded file",
+ "description" : "",
+ "operationId" : "getUploadedFile",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/octet-stream" ],
+ "parameters" : [ {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "processId",
+ "in" : "path",
+ "description" : "Vendor software product process Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "version",
+ "in" : "query",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ },
+ "post" : {
+ "tags" : [ "Vendor Software Product Processes" ],
+ "summary" : "Update vendor software product process upload",
+ "description" : "",
+ "operationId" : "uploadFile",
+ "consumes" : [ "multipart/form-data" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "$ref" : "#/definitions/Attachment"
+ }
+ }, {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "processId",
+ "in" : "path",
+ "description" : "Vendor software product process Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ },
+ "delete" : {
+ "tags" : [ "Vendor Software Product Processes" ],
+ "summary" : "Delete vendor software product process uploaded file",
+ "description" : "",
+ "operationId" : "deleteUploadedFile",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vspId",
+ "in" : "path",
+ "description" : "Vendor software product Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "processId",
+ "in" : "path",
+ "description" : "Vendor software product process Id",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ },
+ "/v1.0/vendor-software-products/{vspId}/questionnaire" : {
+ "get" : {
+ "tags" : [ "Vendor Software Products" ],
+ "summary" : "Get vendor software product questionnaire",
+ "description" : "",
+ "operationId" : "getQuestionnaire",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vspId",
+ "in" : "path",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "version",
+ "in" : "query",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "successful operation",
+ "schema" : {
+ "$ref" : "#/definitions/QuestionnaireResponseDto"
+ }
+ }
+ }
+ },
+ "put" : {
+ "tags" : [ "Vendor Software Products" ],
+ "summary" : "Update vendor software product questionnaire",
+ "description" : "",
+ "operationId" : "updateQuestionnaire",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "vspId",
+ "in" : "path",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ },
+ "/v1.0/vendor-software-products/{vspId}/upload" : {
+ "post" : {
+ "tags" : [ "Vendor Software Products" ],
+ "summary" : "Uploads a HEAT package to translate",
+ "description" : "",
+ "operationId" : "uploadFile",
+ "consumes" : [ "multipart/form-data" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vspId",
+ "in" : "path",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "$ref" : "#/definitions/InputStream"
+ }
+ }, {
+ "name" : "USER_ID",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "successful operation",
+ "schema" : {
+ "$ref" : "#/definitions/UploadFileResponseDto"
+ }
+ }
+ }
+ }
+ },
+ "/workflow/v1.0/actions" : {
+ "get" : {
+ "tags" : [ "Actions" ],
+ "summary" : "List Filtered Actions ",
+ "description" : "Get list of actions based on a filter criteria | If no filter is sent all actions will be returned",
+ "operationId" : "getFilteredActions",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "vendor",
+ "in" : "query",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "category",
+ "in" : "query",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "name",
+ "in" : "query",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "modelId",
+ "in" : "query",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "componentId",
+ "in" : "query",
+ "required" : false,
+ "type" : "string"
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ },
+ "post" : {
+ "tags" : [ "Actions" ],
+ "summary" : "Create a new Action",
+ "description" : "",
+ "operationId" : "createAction",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ },
+ "/workflow/v1.0/actions/components" : {
+ "get" : {
+ "tags" : [ "Actions" ],
+ "summary" : "List ECOMP Components supported by Action Library",
+ "description" : "",
+ "operationId" : "getEcompComponents",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ },
+ "/workflow/v1.0/actions/{actionInvariantUUID}" : {
+ "get" : {
+ "tags" : [ "Actions" ],
+ "summary" : "List Actions For Given Action Invariant UUID",
+ "description" : "",
+ "operationId" : "getActionsByActionInvariantUuId",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "actionInvariantUUID",
+ "in" : "path",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "version",
+ "in" : "query",
+ "required" : false,
+ "type" : "string"
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ },
+ "post" : {
+ "tags" : [ "Actions" ],
+ "summary" : "Actions on a action",
+ "description" : "Performs one of the following actions on a action: |Checkout: Locks it for edits by other users. Only the locking user sees the edited version.|Undo_Checkout: Unlocks it and deletes the edits that were done.|Checkin: Unlocks it and activates the edited version to all users.| Submit: Finalize its active version.|",
+ "operationId" : "actOnAction",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "actionInvariantUUID",
+ "in" : "path",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ },
+ "put" : {
+ "tags" : [ "Actions" ],
+ "summary" : "Update an existing action",
+ "description" : "",
+ "operationId" : "updateAction",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "actionInvariantUUID",
+ "in" : "path",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ },
+ "delete" : {
+ "tags" : [ "Actions" ],
+ "summary" : "Delete Action",
+ "description" : "",
+ "operationId" : "deleteAction",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "actionInvariantUUID",
+ "in" : "path",
+ "required" : true,
+ "type" : "string"
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ },
+ "/workflow/v1.0/actions/{actionInvariantUUID}/artifacts" : {
+ "post" : {
+ "tags" : [ "Actions" ],
+ "summary" : "Upload new Artifact",
+ "description" : "",
+ "operationId" : "uploadArtifact",
+ "consumes" : [ "multipart/form-data" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "actionInvariantUUID",
+ "in" : "path",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "Content-MD5",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ }, {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "$ref" : "#/definitions/Attachment"
+ }
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ },
+ "/workflow/v1.0/actions/{actionInvariantUUID}/artifacts/{artifactUUID}" : {
+ "put" : {
+ "tags" : [ "Actions" ],
+ "summary" : "Update an existing artifact",
+ "description" : "",
+ "operationId" : "updateArtifact",
+ "consumes" : [ "multipart/form-data" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "actionInvariantUUID",
+ "in" : "path",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "artifactUUID",
+ "in" : "path",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "Content-MD5",
+ "in" : "header",
+ "required" : false,
+ "type" : "string",
+ "default" : ""
+ }, {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "$ref" : "#/definitions/Attachment"
+ }
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ },
+ "delete" : {
+ "tags" : [ "Actions" ],
+ "summary" : "Delete Artifact",
+ "description" : "",
+ "operationId" : "deleteArtifact",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "actionInvariantUUID",
+ "in" : "path",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "artifactUUID",
+ "in" : "path",
+ "required" : true,
+ "type" : "string"
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ },
+ "/workflow/v1.0/actions/{actionUUID}/artifacts/{artifactUUID}" : {
+ "get" : {
+ "tags" : [ "Actions" ],
+ "summary" : "Downloads artifact for action",
+ "description" : "",
+ "operationId" : "downloadArtifact",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/octet-stream" ],
+ "parameters" : [ {
+ "name" : "actionUUID",
+ "in" : "path",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "artifactUUID",
+ "in" : "path",
+ "required" : true,
+ "type" : "string"
+ } ],
+ "responses" : {
+ "default" : {
+ "description" : "successful operation"
+ }
+ }
+ }
+ }
+ },
+ "definitions" : {
+ "Attachment" : {
+ "type" : "object",
+ "properties" : {
+ "headers" : {
+ "type" : "object",
+ "additionalProperties" : {
+ "type" : "array",
+ "items" : {
+ "type" : "string"
+ }
+ }
+ },
+ "object" : {
+ "type" : "object"
+ },
+ "contentType" : {
+ "$ref" : "#/definitions/MediaType"
+ },
+ "contentDisposition" : {
+ "$ref" : "#/definitions/ContentDisposition"
+ },
+ "dataHandler" : {
+ "$ref" : "#/definitions/DataHandler"
+ },
+ "contentId" : {
+ "type" : "string"
+ }
+ }
+ },
+ "ChoiceOrOtherDtoAggregationFunction" : {
+ "type" : "object",
+ "required" : [ "choice", "other" ],
+ "properties" : {
+ "choice" : {
+ "type" : "string",
+ "enum" : [ "Peak", "Average", "Other" ]
+ },
+ "other" : {
+ "type" : "string"
+ }
+ }
+ },
+ "ChoiceOrOtherDtoEntitlementMetric" : {
+ "type" : "object",
+ "required" : [ "choice", "other" ],
+ "properties" : {
+ "choice" : {
+ "type" : "string",
+ "enum" : [ "Software_Instances_Count", "Core", "CPU", "Trunks", "User", "Subscribers", "Tenants", "Tokens", "Seats", "Units_TB", "Units_MB", "Units_GB", "Other" ]
+ },
+ "other" : {
+ "type" : "string"
+ }
+ }
+ },
+ "ChoiceOrOtherDtoEntitlementTime" : {
+ "type" : "object",
+ "required" : [ "choice", "other" ],
+ "properties" : {
+ "choice" : {
+ "type" : "string",
+ "enum" : [ "Hour", "Day", "Month", "Quarter", "Year", "Other" ]
+ },
+ "other" : {
+ "type" : "string"
+ }
+ }
+ },
+ "ChoiceOrOtherDtoLicenseTerm" : {
+ "type" : "object",
+ "required" : [ "choice", "other" ],
+ "properties" : {
+ "choice" : {
+ "type" : "string",
+ "enum" : [ "Fixed_Term", "Perpetual", "Unlimited", "Other" ]
+ },
+ "other" : {
+ "type" : "string"
+ }
+ }
+ },
+ "CommandInfo" : {
+ "type" : "object",
+ "properties" : {
+ "commandClass" : {
+ "type" : "string"
+ },
+ "commandName" : {
+ "type" : "string"
+ }
+ }
+ },
+ "ComponentData" : {
+ "type" : "object",
+ "properties" : {
+ "name" : {
+ "type" : "string"
+ },
+ "description" : {
+ "type" : "string"
+ },
+ "displayName" : {
+ "type" : "string"
+ }
+ }
+ },
+ "ComponentDto" : {
+ "type" : "object",
+ "properties" : {
+ "name" : {
+ "type" : "string"
+ },
+ "displayName" : {
+ "type" : "string"
+ },
+ "description" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "ComponentRequestDto" : {
+ "type" : "object",
+ "properties" : {
+ "name" : {
+ "type" : "string"
+ },
+ "displayName" : {
+ "type" : "string"
+ },
+ "description" : {
+ "type" : "string"
+ }
+ }
+ },
+ "ConfigurationDataDto" : {
+ "type" : "object",
+ "properties" : {
+ "value" : {
+ "type" : "string"
+ },
+ "timeStamp" : {
+ "type" : "integer",
+ "format" : "int64"
+ }
+ }
+ },
+ "ContentDisposition" : {
+ "type" : "object",
+ "properties" : {
+ "type" : {
+ "type" : "string"
+ },
+ "parameters" : {
+ "type" : "object",
+ "additionalProperties" : {
+ "type" : "string"
+ }
+ },
+ "filename" : {
+ "type" : "string"
+ }
+ }
+ },
+ "DataFlavor" : {
+ "type" : "object",
+ "properties" : {
+ "mimeType" : {
+ "type" : "string"
+ },
+ "humanPresentableName" : {
+ "type" : "string"
+ },
+ "subType" : {
+ "type" : "string"
+ },
+ "defaultRepresentationClassAsString" : {
+ "type" : "string"
+ },
+ "primaryType" : {
+ "type" : "string"
+ },
+ "flavorJavaFileListType" : {
+ "type" : "boolean",
+ "default" : false
+ },
+ "flavorRemoteObjectType" : {
+ "type" : "boolean",
+ "default" : false
+ },
+ "flavorSerializedObjectType" : {
+ "type" : "boolean",
+ "default" : false
+ },
+ "flavorTextType" : {
+ "type" : "boolean",
+ "default" : false
+ },
+ "mimeTypeSerializedObject" : {
+ "type" : "boolean",
+ "default" : false
+ },
+ "representationClassByteBuffer" : {
+ "type" : "boolean",
+ "default" : false
+ },
+ "representationClassCharBuffer" : {
+ "type" : "boolean",
+ "default" : false
+ },
+ "representationClassInputStream" : {
+ "type" : "boolean",
+ "default" : false
+ },
+ "representationClassReader" : {
+ "type" : "boolean",
+ "default" : false
+ },
+ "representationClassRemote" : {
+ "type" : "boolean",
+ "default" : false
+ },
+ "representationClassSerializable" : {
+ "type" : "boolean",
+ "default" : false
+ }
+ }
+ },
+ "DataHandler" : {
+ "type" : "object",
+ "properties" : {
+ "dataSource" : {
+ "$ref" : "#/definitions/DataSource"
+ },
+ "name" : {
+ "type" : "string"
+ },
+ "inputStream" : {
+ "$ref" : "#/definitions/InputStream"
+ },
+ "content" : {
+ "type" : "object"
+ },
+ "contentType" : {
+ "type" : "string"
+ },
+ "outputStream" : {
+ "$ref" : "#/definitions/OutputStream"
+ },
+ "allCommands" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/definitions/CommandInfo"
+ }
+ },
+ "preferredCommands" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/definitions/CommandInfo"
+ }
+ },
+ "transferDataFlavors" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/definitions/DataFlavor"
+ }
+ }
+ }
+ },
+ "DataSource" : {
+ "type" : "object",
+ "properties" : {
+ "name" : {
+ "type" : "string"
+ },
+ "inputStream" : {
+ "$ref" : "#/definitions/InputStream"
+ },
+ "contentType" : {
+ "type" : "string"
+ },
+ "outputStream" : {
+ "$ref" : "#/definitions/OutputStream"
+ }
+ }
+ },
+ "EntitlementPoolEntity" : {
+ "type" : "object",
+ "required" : [ "aggregationFunction", "description", "entitlementMetric", "manufacturerReferenceNumber", "name", "operationalScope", "thresholdUnits", "thresholdValue", "time" ],
+ "properties" : {
+ "name" : {
+ "type" : "string",
+ "minLength" : 0,
+ "maxLength" : 120
+ },
+ "description" : {
+ "type" : "string",
+ "minLength" : 0,
+ "maxLength" : 1000
+ },
+ "thresholdValue" : {
+ "type" : "integer",
+ "format" : "int32"
+ },
+ "thresholdUnits" : {
+ "type" : "string",
+ "enum" : [ "Absolute", "Percentage" ]
+ },
+ "entitlementMetric" : {
+ "$ref" : "#/definitions/ChoiceOrOtherDtoEntitlementMetric"
+ },
+ "increments" : {
+ "type" : "string",
+ "minLength" : 0,
+ "maxLength" : 120
+ },
+ "aggregationFunction" : {
+ "$ref" : "#/definitions/ChoiceOrOtherDtoAggregationFunction"
+ },
+ "operationalScope" : {
+ "$ref" : "#/definitions/MultiChoiceOrOtherDtoOperationalScope"
+ },
+ "time" : {
+ "$ref" : "#/definitions/ChoiceOrOtherDtoEntitlementTime"
+ },
+ "manufacturerReferenceNumber" : {
+ "type" : "string",
+ "minLength" : 0,
+ "maxLength" : 100
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "referencingFeatureGroups" : {
+ "type" : "array",
+ "uniqueItems" : true,
+ "items" : {
+ "type" : "string"
+ }
+ }
+ }
+ },
+ "EntitlementPoolRequest" : {
+ "type" : "object",
+ "required" : [ "aggregationFunction", "description", "entitlementMetric", "manufacturerReferenceNumber", "name", "operationalScope", "thresholdUnits", "thresholdValue", "time" ],
+ "properties" : {
+ "name" : {
+ "type" : "string",
+ "minLength" : 0,
+ "maxLength" : 120
+ },
+ "description" : {
+ "type" : "string",
+ "minLength" : 0,
+ "maxLength" : 1000
+ },
+ "thresholdValue" : {
+ "type" : "integer",
+ "format" : "int32"
+ },
+ "thresholdUnits" : {
+ "type" : "string",
+ "enum" : [ "Absolute", "Percentage" ]
+ },
+ "entitlementMetric" : {
+ "$ref" : "#/definitions/ChoiceOrOtherDtoEntitlementMetric"
+ },
+ "increments" : {
+ "type" : "string",
+ "minLength" : 0,
+ "maxLength" : 120
+ },
+ "aggregationFunction" : {
+ "$ref" : "#/definitions/ChoiceOrOtherDtoAggregationFunction"
+ },
+ "operationalScope" : {
+ "$ref" : "#/definitions/MultiChoiceOrOtherDtoOperationalScope"
+ },
+ "time" : {
+ "$ref" : "#/definitions/ChoiceOrOtherDtoEntitlementTime"
+ },
+ "manufacturerReferenceNumber" : {
+ "type" : "string",
+ "minLength" : 0,
+ "maxLength" : 100
+ }
+ }
+ },
+ "ErrorMessage" : {
+ "type" : "object",
+ "properties" : {
+ "level" : {
+ "type" : "string",
+ "enum" : [ "ERROR", "WARNING", "INFO" ]
+ },
+ "message" : {
+ "type" : "string"
+ }
+ }
+ },
+ "FeatureGroupEntity" : {
+ "type" : "object",
+ "required" : [ "description", "name", "partNumber" ],
+ "properties" : {
+ "name" : {
+ "type" : "string",
+ "minLength" : 0,
+ "maxLength" : 120
+ },
+ "description" : {
+ "type" : "string",
+ "minLength" : 0,
+ "maxLength" : 1000
+ },
+ "partNumber" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "licenseKeyGroupsIds" : {
+ "type" : "array",
+ "uniqueItems" : true,
+ "items" : {
+ "type" : "string"
+ }
+ },
+ "entitlementPoolsIds" : {
+ "type" : "array",
+ "uniqueItems" : true,
+ "items" : {
+ "type" : "string"
+ }
+ },
+ "referencingLicenseAgreements" : {
+ "type" : "array",
+ "uniqueItems" : true,
+ "items" : {
+ "type" : "string"
+ }
+ }
+ }
+ },
+ "FeatureGroupModel" : {
+ "type" : "object",
+ "required" : [ "description", "name", "partNumber" ],
+ "properties" : {
+ "name" : {
+ "type" : "string",
+ "minLength" : 0,
+ "maxLength" : 120
+ },
+ "description" : {
+ "type" : "string",
+ "minLength" : 0,
+ "maxLength" : 1000
+ },
+ "partNumber" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "referencingLicenseAgreements" : {
+ "type" : "array",
+ "uniqueItems" : true,
+ "items" : {
+ "type" : "string"
+ }
+ },
+ "licenseKeyGroups" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/definitions/LicenseKeyGroupEntityDto"
+ }
+ },
+ "entitlementPools" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/definitions/EntitlementPoolEntity"
+ }
+ }
+ }
+ },
+ "FeatureGroupRequest" : {
+ "type" : "object",
+ "required" : [ "description", "name", "partNumber" ],
+ "properties" : {
+ "name" : {
+ "type" : "string",
+ "minLength" : 0,
+ "maxLength" : 120
+ },
+ "description" : {
+ "type" : "string",
+ "minLength" : 0,
+ "maxLength" : 1000
+ },
+ "partNumber" : {
+ "type" : "string"
+ },
+ "addedLicenseKeyGroupsIds" : {
+ "type" : "array",
+ "uniqueItems" : true,
+ "items" : {
+ "type" : "string"
+ }
+ },
+ "addedEntitlementPoolsIds" : {
+ "type" : "array",
+ "uniqueItems" : true,
+ "items" : {
+ "type" : "string"
+ }
+ }
+ }
+ },
+ "FeatureGroupUpdateRequest" : {
+ "type" : "object",
+ "required" : [ "description", "name", "partNumber" ],
+ "properties" : {
+ "name" : {
+ "type" : "string",
+ "minLength" : 0,
+ "maxLength" : 120
+ },
+ "description" : {
+ "type" : "string",
+ "minLength" : 0,
+ "maxLength" : 1000
+ },
+ "partNumber" : {
+ "type" : "string"
+ },
+ "addedLicenseKeyGroupsIds" : {
+ "type" : "array",
+ "uniqueItems" : true,
+ "items" : {
+ "type" : "string"
+ }
+ },
+ "addedEntitlementPoolsIds" : {
+ "type" : "array",
+ "uniqueItems" : true,
+ "items" : {
+ "type" : "string"
+ }
+ },
+ "removedLicenseKeyGroupsIds" : {
+ "type" : "array",
+ "uniqueItems" : true,
+ "items" : {
+ "type" : "string"
+ }
+ },
+ "removedEntitlementPoolsIds" : {
+ "type" : "array",
+ "uniqueItems" : true,
+ "items" : {
+ "type" : "string"
+ }
+ }
+ }
+ },
+ "File" : {
+ "type" : "object",
+ "properties" : {
+ "path" : {
+ "type" : "string"
+ },
+ "name" : {
+ "type" : "string"
+ },
+ "canonicalPath" : {
+ "type" : "string"
+ },
+ "parent" : {
+ "type" : "string"
+ },
+ "absolute" : {
+ "type" : "boolean",
+ "default" : false
+ },
+ "absoluteFile" : {
+ "$ref" : "#/definitions/File"
+ },
+ "absolutePath" : {
+ "type" : "string"
+ },
+ "canonicalFile" : {
+ "$ref" : "#/definitions/File"
+ },
+ "freeSpace" : {
+ "type" : "integer",
+ "format" : "int64"
+ },
+ "parentFile" : {
+ "$ref" : "#/definitions/File"
+ },
+ "totalSpace" : {
+ "type" : "integer",
+ "format" : "int64"
+ },
+ "usableSpace" : {
+ "type" : "integer",
+ "format" : "int64"
+ },
+ "directory" : {
+ "type" : "boolean",
+ "default" : false
+ },
+ "file" : {
+ "type" : "boolean",
+ "default" : false
+ },
+ "hidden" : {
+ "type" : "boolean",
+ "default" : false
+ }
+ }
+ },
+ "InputStream" : {
+ "type" : "object"
+ },
+ "LicenseAgreementEntity" : {
+ "type" : "object",
+ "required" : [ "description", "licenseTerm", "name" ],
+ "properties" : {
+ "name" : {
+ "type" : "string",
+ "minLength" : 0,
+ "maxLength" : 120
+ },
+ "description" : {
+ "type" : "string",
+ "minLength" : 0,
+ "maxLength" : 1000
+ },
+ "licenseTerm" : {
+ "$ref" : "#/definitions/ChoiceOrOtherDtoLicenseTerm"
+ },
+ "requirementsAndConstrains" : {
+ "type" : "string",
+ "minLength" : 0,
+ "maxLength" : 1000
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "featureGroupsIds" : {
+ "type" : "array",
+ "uniqueItems" : true,
+ "items" : {
+ "type" : "string"
+ }
+ }
+ }
+ },
+ "LicenseAgreementModel" : {
+ "type" : "object",
+ "required" : [ "description", "licenseTerm", "name" ],
+ "properties" : {
+ "name" : {
+ "type" : "string",
+ "minLength" : 0,
+ "maxLength" : 120
+ },
+ "description" : {
+ "type" : "string",
+ "minLength" : 0,
+ "maxLength" : 1000
+ },
+ "licenseTerm" : {
+ "$ref" : "#/definitions/ChoiceOrOtherDtoLicenseTerm"
+ },
+ "requirementsAndConstrains" : {
+ "type" : "string",
+ "minLength" : 0,
+ "maxLength" : 1000
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "featureGroups" : {
+ "type" : "array",
+ "uniqueItems" : true,
+ "items" : {
+ "$ref" : "#/definitions/FeatureGroupEntity"
+ }
+ }
+ }
+ },
+ "LicenseAgreementRequest" : {
+ "type" : "object",
+ "required" : [ "description", "licenseTerm", "name" ],
+ "properties" : {
+ "name" : {
+ "type" : "string",
+ "minLength" : 0,
+ "maxLength" : 120
+ },
+ "description" : {
+ "type" : "string",
+ "minLength" : 0,
+ "maxLength" : 1000
+ },
+ "licenseTerm" : {
+ "$ref" : "#/definitions/ChoiceOrOtherDtoLicenseTerm"
+ },
+ "requirementsAndConstrains" : {
+ "type" : "string",
+ "minLength" : 0,
+ "maxLength" : 1000
+ },
+ "addedFeatureGroupsIds" : {
+ "type" : "array",
+ "uniqueItems" : true,
+ "items" : {
+ "type" : "string"
+ }
+ }
+ }
+ },
+ "LicenseAgreementUpdateRequest" : {
+ "type" : "object",
+ "required" : [ "description", "licenseTerm", "name" ],
+ "properties" : {
+ "name" : {
+ "type" : "string",
+ "minLength" : 0,
+ "maxLength" : 120
+ },
+ "description" : {
+ "type" : "string",
+ "minLength" : 0,
+ "maxLength" : 1000
+ },
+ "licenseTerm" : {
+ "$ref" : "#/definitions/ChoiceOrOtherDtoLicenseTerm"
+ },
+ "requirementsAndConstrains" : {
+ "type" : "string",
+ "minLength" : 0,
+ "maxLength" : 1000
+ },
+ "addedFeatureGroupsIds" : {
+ "type" : "array",
+ "uniqueItems" : true,
+ "items" : {
+ "type" : "string"
+ }
+ },
+ "removedFeatureGroupsIds" : {
+ "type" : "array",
+ "uniqueItems" : true,
+ "items" : {
+ "type" : "string"
+ }
+ }
+ }
+ },
+ "LicenseKeyGroupEntityDto" : {
+ "type" : "object",
+ "required" : [ "description", "name", "operationalScope", "type" ],
+ "properties" : {
+ "name" : {
+ "type" : "string",
+ "minLength" : 0,
+ "maxLength" : 120
+ },
+ "description" : {
+ "type" : "string",
+ "minLength" : 0,
+ "maxLength" : 1000
+ },
+ "type" : {
+ "type" : "string",
+ "enum" : [ "Universal", "Unique", "One_Time" ]
+ },
+ "operationalScope" : {
+ "$ref" : "#/definitions/MultiChoiceOrOtherDtoOperationalScope"
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "referencingFeatureGroups" : {
+ "type" : "array",
+ "uniqueItems" : true,
+ "items" : {
+ "type" : "string"
+ }
+ }
+ }
+ },
+ "LicenseKeyGroupRequestDto" : {
+ "type" : "object",
+ "required" : [ "description", "name", "operationalScope", "type" ],
+ "properties" : {
+ "name" : {
+ "type" : "string",
+ "minLength" : 0,
+ "maxLength" : 120
+ },
+ "description" : {
+ "type" : "string",
+ "minLength" : 0,
+ "maxLength" : 1000
+ },
+ "type" : {
+ "type" : "string",
+ "enum" : [ "Universal", "Unique", "One_Time" ]
+ },
+ "operationalScope" : {
+ "$ref" : "#/definitions/MultiChoiceOrOtherDtoOperationalScope"
+ }
+ }
+ },
+ "LicensingData" : {
+ "type" : "object",
+ "properties" : {
+ "licenseAgreement" : {
+ "type" : "string"
+ },
+ "featureGroups" : {
+ "type" : "array",
+ "items" : {
+ "type" : "string"
+ }
+ }
+ }
+ },
+ "MediaType" : {
+ "type" : "object",
+ "properties" : {
+ "type" : {
+ "type" : "string"
+ },
+ "subtype" : {
+ "type" : "string"
+ },
+ "parameters" : {
+ "type" : "object",
+ "additionalProperties" : {
+ "type" : "string"
+ }
+ },
+ "wildcardSubtype" : {
+ "type" : "boolean",
+ "default" : false
+ },
+ "wildcardType" : {
+ "type" : "boolean",
+ "default" : false
+ }
+ }
+ },
+ "MibUploadStatusDto" : {
+ "type" : "object",
+ "properties" : {
+ "snmpTrap" : {
+ "type" : "string"
+ },
+ "snmpPoll" : {
+ "type" : "string"
+ }
+ }
+ },
+ "MultiChoiceOrOtherDtoOperationalScope" : {
+ "type" : "object",
+ "required" : [ "choices", "other" ],
+ "properties" : {
+ "choices" : {
+ "type" : "array",
+ "uniqueItems" : true,
+ "items" : {
+ "type" : "string",
+ "enum" : [ "Network_Wide", "Availability_Zone", "Data_Center", "Tenant", "VM", "CPU", "Core", "Other" ]
+ }
+ },
+ "other" : {
+ "type" : "string"
+ }
+ }
+ },
+ "NetworkDto" : {
+ "type" : "object",
+ "required" : [ "dhcp", "name" ],
+ "properties" : {
+ "name" : {
+ "type" : "string"
+ },
+ "dhcp" : {
+ "type" : "boolean",
+ "default" : false
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "NetworkRequestDto" : {
+ "type" : "object",
+ "required" : [ "dhcp", "name" ],
+ "properties" : {
+ "name" : {
+ "type" : "string"
+ },
+ "dhcp" : {
+ "type" : "boolean",
+ "default" : false
+ }
+ }
+ },
+ "NicDto" : {
+ "type" : "object",
+ "properties" : {
+ "name" : {
+ "type" : "string"
+ },
+ "description" : {
+ "type" : "string"
+ },
+ "networkId" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "networkName" : {
+ "type" : "string"
+ }
+ }
+ },
+ "NicRequestDto" : {
+ "type" : "object",
+ "properties" : {
+ "name" : {
+ "type" : "string"
+ },
+ "description" : {
+ "type" : "string"
+ },
+ "networkId" : {
+ "type" : "string"
+ }
+ }
+ },
+ "OutputStream" : {
+ "type" : "object"
+ },
+ "PackageInfoDto" : {
+ "type" : "object",
+ "properties" : {
+ "displayName" : {
+ "type" : "string"
+ },
+ "description" : {
+ "type" : "string"
+ },
+ "vspName" : {
+ "type" : "string"
+ },
+ "version" : {
+ "type" : "string"
+ },
+ "packageId" : {
+ "type" : "string"
+ },
+ "category" : {
+ "type" : "string"
+ },
+ "subCategory" : {
+ "type" : "string"
+ },
+ "vendorName" : {
+ "type" : "string"
+ },
+ "vendorRelease" : {
+ "type" : "string"
+ },
+ "packageChecksum" : {
+ "type" : "string"
+ },
+ "packageType" : {
+ "type" : "string"
+ }
+ }
+ },
+ "ProcessEntityDto" : {
+ "type" : "object",
+ "required" : [ "name" ],
+ "properties" : {
+ "name" : {
+ "type" : "string"
+ },
+ "description" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "artifactName" : {
+ "type" : "string"
+ }
+ }
+ },
+ "ProcessRequestDto" : {
+ "type" : "object",
+ "required" : [ "name" ],
+ "properties" : {
+ "name" : {
+ "type" : "string"
+ },
+ "description" : {
+ "type" : "string"
+ }
+ }
+ },
+ "QuestionnaireResponseDto" : {
+ "type" : "object",
+ "properties" : {
+ "schema" : {
+ "type" : "string"
+ },
+ "data" : {
+ "type" : "string"
+ }
+ }
+ },
+ "UploadFileResponseDto" : {
+ "type" : "object",
+ "properties" : {
+ "fileNames" : {
+ "type" : "array",
+ "items" : {
+ "type" : "string"
+ }
+ },
+ "errors" : {
+ "type" : "object",
+ "additionalProperties" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/definitions/ErrorMessage"
+ }
+ }
+ },
+ "status" : {
+ "type" : "string",
+ "enum" : [ "Success", "Failure" ]
+ }
+ }
+ },
+ "VendorLicenseModelActionRequestDto" : {
+ "type" : "object",
+ "properties" : {
+ "action" : {
+ "type" : "string",
+ "enum" : [ "Checkout", "Undo_Checkout", "Checkin", "Submit" ]
+ }
+ }
+ },
+ "VendorLicenseModelEntity" : {
+ "type" : "object",
+ "required" : [ "description", "iconRef", "vendorName" ],
+ "properties" : {
+ "vendorName" : {
+ "type" : "string",
+ "minLength" : 0,
+ "maxLength" : 25
+ },
+ "description" : {
+ "type" : "string",
+ "minLength" : 0,
+ "maxLength" : 1000
+ },
+ "iconRef" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "version" : {
+ "type" : "string"
+ },
+ "status" : {
+ "type" : "string",
+ "enum" : [ "Available", "Locked", "Final" ]
+ },
+ "lockingUser" : {
+ "type" : "string"
+ },
+ "viewableVersions" : {
+ "type" : "array",
+ "items" : {
+ "type" : "string"
+ }
+ },
+ "finalVersions" : {
+ "type" : "array",
+ "items" : {
+ "type" : "string"
+ }
+ }
+ }
+ },
+ "VendorLicenseModelRequest" : {
+ "type" : "object",
+ "required" : [ "description", "iconRef", "vendorName" ],
+ "properties" : {
+ "vendorName" : {
+ "type" : "string",
+ "minLength" : 0,
+ "maxLength" : 25
+ },
+ "description" : {
+ "type" : "string",
+ "minLength" : 0,
+ "maxLength" : 1000
+ },
+ "iconRef" : {
+ "type" : "string"
+ }
+ }
+ },
+ "VersionSoftwareProductActionRequestDto" : {
+ "type" : "object",
+ "properties" : {
+ "action" : {
+ "type" : "string",
+ "enum" : [ "Checkout", "Undo_Checkout", "Checkin", "Submit", "Create_Package" ]
+ }
+ }
+ },
+ "VspCreationDto" : {
+ "type" : "object",
+ "properties" : {
+ "vspId" : {
+ "type" : "string"
+ }
+ }
+ },
+ "VspDescriptionDto" : {
+ "type" : "object",
+ "required" : [ "category", "description", "name", "subCategory", "vendorId", "vendorName" ],
+ "properties" : {
+ "name" : {
+ "type" : "string"
+ },
+ "description" : {
+ "type" : "string"
+ },
+ "icon" : {
+ "type" : "string"
+ },
+ "category" : {
+ "type" : "string"
+ },
+ "subCategory" : {
+ "type" : "string"
+ },
+ "vendorName" : {
+ "type" : "string"
+ },
+ "vendorId" : {
+ "type" : "string"
+ },
+ "licensingVersion" : {
+ "type" : "string"
+ },
+ "licensingData" : {
+ "$ref" : "#/definitions/LicensingData"
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/openecomp-be/tools/swagger-ui/assembly/swagger.xml b/openecomp-be/tools/swagger-ui/assembly/swagger.xml
new file mode 100644
index 0000000000..769cc64840
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/assembly/swagger.xml
@@ -0,0 +1,76 @@
+<assembly
+ xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+ <formats>
+ <format>war</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+
+ <fileSets>
+ <fileSet>
+ <directory>css</directory>
+ <outputDirectory>/css</outputDirectory>
+ </fileSet>
+ <fileSet>
+ <directory>fonts</directory>
+ <outputDirectory>/fonts</outputDirectory>
+ </fileSet>
+ <fileSet>
+ <directory>images</directory>
+ <outputDirectory>/images</outputDirectory>
+ </fileSet>
+ <fileSet>
+ <directory>lang</directory>
+ <outputDirectory>/lang</outputDirectory>
+ </fileSet>
+ <fileSet>
+ <directory>lib</directory>
+ <outputDirectory>/lib</outputDirectory>
+ </fileSet>
+ <fileSet>
+ <directory>WEB-INF</directory>
+ <outputDirectory>/WEB-INF</outputDirectory>
+ </fileSet>
+ <fileSet>
+ <directory>.</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>index.html</include>
+ <include>o2c.html</include>
+ <include>swagger-ui.js</include>
+ <include>swagger-ui.min.js</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>./target</directory>
+ <outputDirectory>/css</outputDirectory>
+ <includes>
+ <include>${ncso.style.css.file}</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>./target</directory>
+ <outputDirectory>/fonts</outputDirectory>
+ <includes>
+ <include>SourceSansPro-Light.otf</include>
+ <include>SourceSansPro-Regular.otf</include>
+ <include>SourceSansPro-Semibold.otf</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>./target</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>${api.json.file}</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>./target</directory>
+ <outputDirectory>/images</outputDirectory>
+ <includes>
+ <include>favicon.ico</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+</assembly> \ No newline at end of file
diff --git a/openecomp-be/tools/swagger-ui/css/ncso-style.css b/openecomp-be/tools/swagger-ui/css/ncso-style.css
new file mode 100644
index 0000000000..fd1283918f
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/css/ncso-style.css
@@ -0,0 +1,8659 @@
+/*!
+ * Bootstrap v3.3.2 (http://getbootstrap.com)
+ * Copyright 2011-2015 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ */
+/*! normalize.css v3.0.2 | MIT License | git.io/normalize */
+html {
+ font-family: sans-serif;
+ -webkit-text-size-adjust: 100%;
+ -ms-text-size-adjust: 100%; }
+
+body {
+ margin: 0; }
+
+article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, nav, section, summary {
+ display: block; }
+
+audio, canvas, progress, video {
+ display: inline-block;
+ vertical-align: baseline; }
+
+audio:not([controls]) {
+ display: none;
+ height: 0; }
+
+[hidden], template {
+ display: none; }
+
+a {
+ background-color: transparent; }
+
+a:active, a:hover {
+ outline: 0; }
+
+abbr[title] {
+ border-bottom: 1px dotted; }
+
+b, strong {
+ font-weight: 700; }
+
+dfn {
+ font-style: italic; }
+
+h1 {
+ margin: .67em 0;
+ font-size: 2em; }
+
+mark {
+ color: #000;
+ background: #ff0; }
+
+small {
+ font-size: 80%; }
+
+sub, sup {
+ position: relative;
+ font-size: 75%;
+ line-height: 0;
+ vertical-align: baseline; }
+
+sup {
+ top: -.5em; }
+
+sub {
+ bottom: -.25em; }
+
+img {
+ border: 0; }
+
+svg:not(:root) {
+ overflow: hidden; }
+
+figure {
+ margin: 1em 40px; }
+
+hr {
+ height: 0;
+ -webkit-box-sizing: content-box;
+ -moz-box-sizing: content-box;
+ box-sizing: content-box; }
+
+pre {
+ overflow: auto; }
+
+code, kbd, pre, samp {
+ font-family: monospace, monospace;
+ font-size: 1em; }
+
+button, input, optgroup, select, textarea {
+ margin: 0;
+ font: inherit;
+ color: inherit; }
+
+button {
+ overflow: visible; }
+
+button, select {
+ text-transform: none; }
+
+button, html input[type=button], input[type=reset], input[type=submit] {
+ -webkit-appearance: button;
+ cursor: pointer; }
+
+button[disabled], html input[disabled] {
+ cursor: default; }
+
+button::-moz-focus-inner, input::-moz-focus-inner {
+ padding: 0;
+ border: 0; }
+
+input {
+ line-height: normal; }
+
+input[type=checkbox], input[type=radio] {
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ padding: 0; }
+
+input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button {
+ height: auto; }
+
+input[type=search] {
+ -webkit-box-sizing: content-box;
+ -moz-box-sizing: content-box;
+ box-sizing: content-box;
+ -webkit-appearance: textfield; }
+
+input[type=search]::-webkit-search-cancel-button, input[type=search]::-webkit-search-decoration {
+ -webkit-appearance: none; }
+
+fieldset {
+ padding: 0.35em 0.625em 0.75em;
+ margin: 0 2px;
+ border: 1px solid silver; }
+
+legend {
+ padding: 0;
+ border: 0; }
+
+textarea {
+ overflow: auto; }
+
+optgroup {
+ font-weight: 700; }
+
+table {
+ border-spacing: 0;
+ border-collapse: collapse; }
+
+td, th {
+ padding: 0; }
+
+/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */
+@media print {
+ *, :after, :before {
+ color: #000 !important;
+ text-shadow: none !important;
+ background: 0 0 !important;
+ -webkit-box-shadow: none !important;
+ box-shadow: none !important; }
+ a, a:visited {
+ text-decoration: underline; }
+ a[href]:after {
+ content: " (" attr(href) ")"; }
+ abbr[title]:after {
+ content: " (" attr(title) ")"; }
+ a[href^="javascript:"]:after, a[href^="#"]:after {
+ content: ""; }
+ blockquote, pre {
+ border: 1px solid #999;
+ page-break-inside: avoid; }
+ thead {
+ display: table-header-group; }
+ img, tr {
+ page-break-inside: avoid; }
+ img {
+ max-width: 100% !important; }
+ h2, h3, p {
+ orphans: 3;
+ widows: 3; }
+ h2, h3 {
+ page-break-after: avoid; }
+ select {
+ background: #fff !important; }
+ .navbar {
+ display: none; }
+ .btn > .caret, .dropup > .btn > .caret {
+ border-top-color: #000 !important; } }
+
+/*@font-face {
+ font-family: 'Glyphicons Halflings';
+ src: url(../fonts/glyphicons-halflings-regular.eot);
+ src: url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'), url(../fonts/glyphicons-halflings-regular.woff2) format('woff2'), url(../fonts/glyphicons-halflings-regular.woff) format('woff'), url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'), url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')
+}*/
+.glyphicon {
+ position: relative;
+ top: 1px;
+ display: inline-block;
+ font-family: 'Glyphicons Halflings';
+ font-style: normal;
+ font-weight: 400;
+ line-height: 1;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale; }
+
+.glyphicon-asterisk:before {
+ content: "\2a"; }
+
+.glyphicon-plus:before {
+ content: "\2b"; }
+
+.glyphicon-eur:before, .glyphicon-euro:before {
+ content: "\20ac"; }
+
+.glyphicon-minus:before {
+ content: "\2212"; }
+
+.glyphicon-cloud:before {
+ content: "\2601"; }
+
+.glyphicon-envelope:before {
+ content: "\2709"; }
+
+.glyphicon-pencil:before {
+ content: "\270f"; }
+
+.glyphicon-glass:before {
+ content: "\e001"; }
+
+.glyphicon-music:before {
+ content: "\e002"; }
+
+.glyphicon-search:before {
+ content: "\e003"; }
+
+.glyphicon-heart:before {
+ content: "\e005"; }
+
+.glyphicon-star:before {
+ content: "\e006"; }
+
+.glyphicon-star-empty:before {
+ content: "\e007"; }
+
+.glyphicon-user:before {
+ content: "\e008"; }
+
+.glyphicon-film:before {
+ content: "\e009"; }
+
+.glyphicon-th-large:before {
+ content: "\e010"; }
+
+.glyphicon-th:before {
+ content: "\e011"; }
+
+.glyphicon-th-list:before {
+ content: "\e012"; }
+
+.glyphicon-ok:before {
+ content: "\e013"; }
+
+.glyphicon-remove:before {
+ content: "\e014"; }
+
+.glyphicon-zoom-in:before {
+ content: "\e015"; }
+
+.glyphicon-zoom-out:before {
+ content: "\e016"; }
+
+.glyphicon-off:before {
+ content: "\e017"; }
+
+.glyphicon-signal:before {
+ content: "\e018"; }
+
+.glyphicon-cog:before {
+ content: "\e019"; }
+
+.glyphicon-trash:before {
+ content: "\e020"; }
+
+.glyphicon-home:before {
+ content: "\e021"; }
+
+.glyphicon-file:before {
+ content: "\e022"; }
+
+.glyphicon-time:before {
+ content: "\e023"; }
+
+.glyphicon-road:before {
+ content: "\e024"; }
+
+.glyphicon-download-alt:before {
+ content: "\e025"; }
+
+.glyphicon-download:before {
+ content: "\e026"; }
+
+.glyphicon-upload:before {
+ content: "\e027"; }
+
+.glyphicon-inbox:before {
+ content: "\e028"; }
+
+.glyphicon-play-circle:before {
+ content: "\e029"; }
+
+.glyphicon-repeat:before {
+ content: "\e030"; }
+
+.glyphicon-refresh:before {
+ content: "\e031"; }
+
+.glyphicon-list-alt:before {
+ content: "\e032"; }
+
+.glyphicon-lock:before {
+ content: "\e033"; }
+
+.glyphicon-flag:before {
+ content: "\e034"; }
+
+.glyphicon-headphones:before {
+ content: "\e035"; }
+
+.glyphicon-volume-off:before {
+ content: "\e036"; }
+
+.glyphicon-volume-down:before {
+ content: "\e037"; }
+
+.glyphicon-volume-up:before {
+ content: "\e038"; }
+
+.glyphicon-qrcode:before {
+ content: "\e039"; }
+
+.glyphicon-barcode:before {
+ content: "\e040"; }
+
+.glyphicon-tag:before {
+ content: "\e041"; }
+
+.glyphicon-tags:before {
+ content: "\e042"; }
+
+.glyphicon-book:before {
+ content: "\e043"; }
+
+.glyphicon-bookmark:before {
+ content: "\e044"; }
+
+.glyphicon-print:before {
+ content: "\e045"; }
+
+.glyphicon-camera:before {
+ content: "\e046"; }
+
+.glyphicon-font:before {
+ content: "\e047"; }
+
+.glyphicon-bold:before {
+ content: "\e048"; }
+
+.glyphicon-italic:before {
+ content: "\e049"; }
+
+.glyphicon-text-height:before {
+ content: "\e050"; }
+
+.glyphicon-text-width:before {
+ content: "\e051"; }
+
+.glyphicon-align-left:before {
+ content: "\e052"; }
+
+.glyphicon-align-center:before {
+ content: "\e053"; }
+
+.glyphicon-align-right:before {
+ content: "\e054"; }
+
+.glyphicon-align-justify:before {
+ content: "\e055"; }
+
+.glyphicon-list:before {
+ content: "\e056"; }
+
+.glyphicon-indent-left:before {
+ content: "\e057"; }
+
+.glyphicon-indent-right:before {
+ content: "\e058"; }
+
+.glyphicon-facetime-video:before {
+ content: "\e059"; }
+
+.glyphicon-picture:before {
+ content: "\e060"; }
+
+.glyphicon-map-marker:before {
+ content: "\e062"; }
+
+.glyphicon-adjust:before {
+ content: "\e063"; }
+
+.glyphicon-tint:before {
+ content: "\e064"; }
+
+.glyphicon-edit:before {
+ content: "\e065"; }
+
+.glyphicon-share:before {
+ content: "\e066"; }
+
+.glyphicon-check:before {
+ content: "\e067"; }
+
+.glyphicon-move:before {
+ content: "\e068"; }
+
+.glyphicon-step-backward:before {
+ content: "\e069"; }
+
+.glyphicon-fast-backward:before {
+ content: "\e070"; }
+
+.glyphicon-backward:before {
+ content: "\e071"; }
+
+.glyphicon-play:before {
+ content: "\e072"; }
+
+.glyphicon-pause:before {
+ content: "\e073"; }
+
+.glyphicon-stop:before {
+ content: "\e074"; }
+
+.glyphicon-forward:before {
+ content: "\e075"; }
+
+.glyphicon-fast-forward:before {
+ content: "\e076"; }
+
+.glyphicon-step-forward:before {
+ content: "\e077"; }
+
+.glyphicon-eject:before {
+ content: "\e078"; }
+
+.glyphicon-chevron-left:before {
+ content: "\e079"; }
+
+.glyphicon-chevron-right:before {
+ content: "\e080"; }
+
+.glyphicon-plus-sign:before {
+ content: "\e081"; }
+
+.glyphicon-minus-sign:before {
+ content: "\e082"; }
+
+.glyphicon-remove-sign:before {
+ content: "\e083"; }
+
+.glyphicon-ok-sign:before {
+ content: "\e084"; }
+
+.glyphicon-question-sign:before {
+ content: "\e085"; }
+
+.glyphicon-info-sign:before {
+ content: "\e086"; }
+
+.glyphicon-screenshot:before {
+ content: "\e087"; }
+
+.glyphicon-remove-circle:before {
+ content: "\e088"; }
+
+.glyphicon-ok-circle:before {
+ content: "\e089"; }
+
+.glyphicon-ban-circle:before {
+ content: "\e090"; }
+
+.glyphicon-arrow-left:before {
+ content: "\e091"; }
+
+.glyphicon-arrow-right:before {
+ content: "\e092"; }
+
+.glyphicon-arrow-up:before {
+ content: "\e093"; }
+
+.glyphicon-arrow-down:before {
+ content: "\e094"; }
+
+.glyphicon-share-alt:before {
+ content: "\e095"; }
+
+.glyphicon-resize-full:before {
+ content: "\e096"; }
+
+.glyphicon-resize-small:before {
+ content: "\e097"; }
+
+.glyphicon-exclamation-sign:before {
+ content: "\e101"; }
+
+.glyphicon-gift:before {
+ content: "\e102"; }
+
+.glyphicon-leaf:before {
+ content: "\e103"; }
+
+.glyphicon-fire:before {
+ content: "\e104"; }
+
+.glyphicon-eye-open:before {
+ content: "\e105"; }
+
+.glyphicon-eye-close:before {
+ content: "\e106"; }
+
+.glyphicon-warning-sign:before {
+ content: "\e107"; }
+
+.glyphicon-plane:before {
+ content: "\e108"; }
+
+.glyphicon-calendar:before {
+ content: "\e109"; }
+
+.glyphicon-random:before {
+ content: "\e110"; }
+
+.glyphicon-comment:before {
+ content: "\e111"; }
+
+.glyphicon-magnet:before {
+ content: "\e112"; }
+
+.glyphicon-chevron-up:before {
+ content: "\e113"; }
+
+.glyphicon-chevron-down:before {
+ content: "\e114"; }
+
+.glyphicon-retweet:before {
+ content: "\e115"; }
+
+.glyphicon-shopping-cart:before {
+ content: "\e116"; }
+
+.glyphicon-folder-close:before {
+ content: "\e117"; }
+
+.glyphicon-folder-open:before {
+ content: "\e118"; }
+
+.glyphicon-resize-vertical:before {
+ content: "\e119"; }
+
+.glyphicon-resize-horizontal:before {
+ content: "\e120"; }
+
+.glyphicon-hdd:before {
+ content: "\e121"; }
+
+.glyphicon-bullhorn:before {
+ content: "\e122"; }
+
+.glyphicon-bell:before {
+ content: "\e123"; }
+
+.glyphicon-certificate:before {
+ content: "\e124"; }
+
+.glyphicon-thumbs-up:before {
+ content: "\e125"; }
+
+.glyphicon-thumbs-down:before {
+ content: "\e126"; }
+
+.glyphicon-hand-right:before {
+ content: "\e127"; }
+
+.glyphicon-hand-left:before {
+ content: "\e128"; }
+
+.glyphicon-hand-up:before {
+ content: "\e129"; }
+
+.glyphicon-hand-down:before {
+ content: "\e130"; }
+
+.glyphicon-circle-arrow-right:before {
+ content: "\e131"; }
+
+.glyphicon-circle-arrow-left:before {
+ content: "\e132"; }
+
+.glyphicon-circle-arrow-up:before {
+ content: "\e133"; }
+
+.glyphicon-circle-arrow-down:before {
+ content: "\e134"; }
+
+.glyphicon-globe:before {
+ content: "\e135"; }
+
+.glyphicon-wrench:before {
+ content: "\e136"; }
+
+.glyphicon-tasks:before {
+ content: "\e137"; }
+
+.glyphicon-filter:before {
+ content: "\e138"; }
+
+.glyphicon-briefcase:before {
+ content: "\e139"; }
+
+.glyphicon-fullscreen:before {
+ content: "\e140"; }
+
+.glyphicon-dashboard:before {
+ content: "\e141"; }
+
+.glyphicon-paperclip:before {
+ content: "\e142"; }
+
+.glyphicon-heart-empty:before {
+ content: "\e143"; }
+
+.glyphicon-link:before {
+ content: "\e144"; }
+
+.glyphicon-phone:before {
+ content: "\e145"; }
+
+.glyphicon-pushpin:before {
+ content: "\e146"; }
+
+.glyphicon-usd:before {
+ content: "\e148"; }
+
+.glyphicon-gbp:before {
+ content: "\e149"; }
+
+.glyphicon-sort:before {
+ content: "\e150"; }
+
+.glyphicon-sort-by-alphabet:before {
+ content: "\e151"; }
+
+.glyphicon-sort-by-alphabet-alt:before {
+ content: "\e152"; }
+
+.glyphicon-sort-by-order:before {
+ content: "\e153"; }
+
+.glyphicon-sort-by-order-alt:before {
+ content: "\e154"; }
+
+.glyphicon-sort-by-attributes:before {
+ content: "\e155"; }
+
+.glyphicon-sort-by-attributes-alt:before {
+ content: "\e156"; }
+
+.glyphicon-unchecked:before {
+ content: "\e157"; }
+
+.glyphicon-expand:before {
+ content: "\e158"; }
+
+.glyphicon-collapse-down:before {
+ content: "\e159"; }
+
+.glyphicon-collapse-up:before {
+ content: "\e160"; }
+
+.glyphicon-log-in:before {
+ content: "\e161"; }
+
+.glyphicon-flash:before {
+ content: "\e162"; }
+
+.glyphicon-log-out:before {
+ content: "\e163"; }
+
+.glyphicon-new-window:before {
+ content: "\e164"; }
+
+.glyphicon-record:before {
+ content: "\e165"; }
+
+.glyphicon-save:before {
+ content: "\e166"; }
+
+.glyphicon-open:before {
+ content: "\e167"; }
+
+.glyphicon-saved:before {
+ content: "\e168"; }
+
+.glyphicon-import:before {
+ content: "\e169"; }
+
+.glyphicon-export:before {
+ content: "\e170"; }
+
+.glyphicon-send:before {
+ content: "\e171"; }
+
+.glyphicon-floppy-disk:before {
+ content: "\e172"; }
+
+.glyphicon-floppy-saved:before {
+ content: "\e173"; }
+
+.glyphicon-floppy-remove:before {
+ content: "\e174"; }
+
+.glyphicon-floppy-save:before {
+ content: "\e175"; }
+
+.glyphicon-floppy-open:before {
+ content: "\e176"; }
+
+.glyphicon-credit-card:before {
+ content: "\e177"; }
+
+.glyphicon-transfer:before {
+ content: "\e178"; }
+
+.glyphicon-cutlery:before {
+ content: "\e179"; }
+
+.glyphicon-header:before {
+ content: "\e180"; }
+
+.glyphicon-compressed:before {
+ content: "\e181"; }
+
+.glyphicon-earphone:before {
+ content: "\e182"; }
+
+.glyphicon-phone-alt:before {
+ content: "\e183"; }
+
+.glyphicon-tower:before {
+ content: "\e184"; }
+
+.glyphicon-stats:before {
+ content: "\e185"; }
+
+.glyphicon-sd-video:before {
+ content: "\e186"; }
+
+.glyphicon-hd-video:before {
+ content: "\e187"; }
+
+.glyphicon-subtitles:before {
+ content: "\e188"; }
+
+.glyphicon-sound-stereo:before {
+ content: "\e189"; }
+
+.glyphicon-sound-dolby:before {
+ content: "\e190"; }
+
+.glyphicon-sound-5-1:before {
+ content: "\e191"; }
+
+.glyphicon-sound-6-1:before {
+ content: "\e192"; }
+
+.glyphicon-sound-7-1:before {
+ content: "\e193"; }
+
+.glyphicon-copyright-mark:before {
+ content: "\e194"; }
+
+.glyphicon-registration-mark:before {
+ content: "\e195"; }
+
+.glyphicon-cloud-download:before {
+ content: "\e197"; }
+
+.glyphicon-cloud-upload:before {
+ content: "\e198"; }
+
+.glyphicon-tree-conifer:before {
+ content: "\e199"; }
+
+.glyphicon-tree-deciduous:before {
+ content: "\e200"; }
+
+.glyphicon-cd:before {
+ content: "\e201"; }
+
+.glyphicon-save-file:before {
+ content: "\e202"; }
+
+.glyphicon-open-file:before {
+ content: "\e203"; }
+
+.glyphicon-level-up:before {
+ content: "\e204"; }
+
+.glyphicon-copy:before {
+ content: "\e205"; }
+
+.glyphicon-paste:before {
+ content: "\e206"; }
+
+.glyphicon-alert:before {
+ content: "\e209"; }
+
+.glyphicon-equalizer:before {
+ content: "\e210"; }
+
+.glyphicon-king:before {
+ content: "\e211"; }
+
+.glyphicon-queen:before {
+ content: "\e212"; }
+
+.glyphicon-pawn:before {
+ content: "\e213"; }
+
+.glyphicon-bishop:before {
+ content: "\e214"; }
+
+.glyphicon-knight:before {
+ content: "\e215"; }
+
+.glyphicon-baby-formula:before {
+ content: "\e216"; }
+
+.glyphicon-tent:before {
+ content: "\26fa"; }
+
+.glyphicon-blackboard:before {
+ content: "\e218"; }
+
+.glyphicon-bed:before {
+ content: "\e219"; }
+
+.glyphicon-apple:before {
+ content: "\f8ff"; }
+
+.glyphicon-erase:before {
+ content: "\e221"; }
+
+.glyphicon-hourglass:before {
+ content: "\231b"; }
+
+.glyphicon-lamp:before {
+ content: "\e223"; }
+
+.glyphicon-duplicate:before {
+ content: "\e224"; }
+
+.glyphicon-piggy-bank:before {
+ content: "\e225"; }
+
+.glyphicon-scissors:before {
+ content: "\e226"; }
+
+.glyphicon-bitcoin:before {
+ content: "\e227"; }
+
+.glyphicon-yen:before {
+ content: "\00a5"; }
+
+.glyphicon-ruble:before {
+ content: "\20bd"; }
+
+.glyphicon-scale:before {
+ content: "\e230"; }
+
+.glyphicon-ice-lolly:before {
+ content: "\e231"; }
+
+.glyphicon-ice-lolly-tasted:before {
+ content: "\e232"; }
+
+.glyphicon-education:before {
+ content: "\e233"; }
+
+.glyphicon-option-horizontal:before {
+ content: "\e234"; }
+
+.glyphicon-option-vertical:before {
+ content: "\e235"; }
+
+.glyphicon-menu-hamburger:before {
+ content: "\e236"; }
+
+.glyphicon-modal-window:before {
+ content: "\e237"; }
+
+.glyphicon-oil:before {
+ content: "\e238"; }
+
+.glyphicon-grain:before {
+ content: "\e239"; }
+
+.glyphicon-sunglasses:before {
+ content: "\e240"; }
+
+.glyphicon-text-size:before {
+ content: "\e241"; }
+
+.glyphicon-text-color:before {
+ content: "\e242"; }
+
+.glyphicon-text-background:before {
+ content: "\e243"; }
+
+.glyphicon-object-align-top:before {
+ content: "\e244"; }
+
+.glyphicon-object-align-bottom:before {
+ content: "\e245"; }
+
+.glyphicon-object-align-horizontal:before {
+ content: "\e246"; }
+
+.glyphicon-object-align-left:before {
+ content: "\e247"; }
+
+.glyphicon-object-align-vertical:before {
+ content: "\e248"; }
+
+.glyphicon-object-align-right:before {
+ content: "\e249"; }
+
+.glyphicon-triangle-right:before {
+ content: "\e250"; }
+
+.glyphicon-triangle-left:before {
+ content: "\e251"; }
+
+.glyphicon-triangle-bottom:before {
+ content: "\e252"; }
+
+.glyphicon-triangle-top:before {
+ content: "\e253"; }
+
+.glyphicon-console:before {
+ content: "\e254"; }
+
+.glyphicon-superscript:before {
+ content: "\e255"; }
+
+.glyphicon-subscript:before {
+ content: "\e256"; }
+
+.glyphicon-menu-left:before {
+ content: "\e257"; }
+
+.glyphicon-menu-right:before {
+ content: "\e258"; }
+
+.glyphicon-menu-down:before {
+ content: "\e259"; }
+
+.glyphicon-menu-up:before {
+ content: "\e260"; }
+
+/** {
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box
+}
+*/
+:after, :before {
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box; }
+
+html {
+ font-size: 10px;
+ -webkit-tap-highlight-color: transparent; }
+
+body {
+ color: #333;
+ background-color: #fff; }
+
+button, input, select, textarea {
+ font-family: inherit;
+ font-size: inherit;
+ line-height: inherit; }
+
+a {
+ color: #337ab7;
+ text-decoration: none; }
+
+a:focus, a:hover {
+ color: #23527c;
+ text-decoration: underline; }
+
+a:focus {
+ outline: thin dotted;
+ outline: 5px auto -webkit-focus-ring-color;
+ outline-offset: -2px; }
+
+figure {
+ margin: 0; }
+
+img {
+ vertical-align: middle; }
+
+.carousel-inner > .item > a > img, .carousel-inner > .item > img, .img-responsive, .thumbnail a > img, .thumbnail > img {
+ display: block;
+ max-width: 100%;
+ height: auto; }
+
+.img-rounded {
+ border-radius: 6px; }
+
+.img-thumbnail {
+ display: inline-block;
+ max-width: 100%;
+ height: auto;
+ padding: 4px;
+ line-height: 1.42857143;
+ background-color: #fff;
+ border: 1px solid #ddd;
+ border-radius: 4px;
+ -webkit-transition: all 0.2s ease-in-out;
+ -o-transition: all 0.2s ease-in-out;
+ transition: all 0.2s ease-in-out; }
+
+.img-circle {
+ border-radius: 50%; }
+
+hr {
+ margin-top: 20px;
+ margin-bottom: 20px;
+ border: 0;
+ border-top: 1px solid #eee; }
+
+.sr-only {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ padding: 0;
+ margin: -1px;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0; }
+
+.sr-only-focusable:active, .sr-only-focusable:focus {
+ position: static;
+ width: auto;
+ height: auto;
+ margin: 0;
+ overflow: visible;
+ clip: auto; }
+
+.h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 {
+ font-family: inherit;
+ font-weight: 500;
+ line-height: 1.1;
+ color: inherit; }
+
+.h1 .small, .h1 small, .h2 .small, .h2 small, .h3 .small, .h3 small, .h4 .small, .h4 small, .h5 .small, .h5 small, .h6 .small, .h6 small, h1 .small, h1 small, h2 .small, h2 small, h3 .small, h3 small, h4 .small, h4 small, h5 .small, h5 small, h6 .small, h6 small {
+ font-weight: 400;
+ line-height: 1;
+ color: #777; }
+
+.h1, .h2, .h3, h1, h2, h3 {
+ margin-top: 20px;
+ margin-bottom: 10px; }
+
+.h1 .small, .h1 small, .h2 .small, .h2 small, .h3 .small, .h3 small, h1 .small, h1 small, h2 .small, h2 small, h3 .small, h3 small {
+ font-size: 65%; }
+
+.h4, .h5, .h6, h4, h5, h6 {
+ margin-top: 10px;
+ margin-bottom: 10px; }
+
+.h4 .small, .h4 small, .h5 .small, .h5 small, .h6 .small, .h6 small, h4 .small, h4 small, h5 .small, h5 small, h6 .small, h6 small {
+ font-size: 75%; }
+
+.h1, h1 {
+ font-size: 36px; }
+
+.h2, h2 {
+ font-size: 30px; }
+
+.h3, h3 {
+ font-size: 24px; }
+
+.h4, h4 {
+ font-size: 18px; }
+
+.h5, h5 {
+ font-size: 14px; }
+
+.h6, h6 {
+ font-size: 12px; }
+
+p {
+ margin: 0 0 10px; }
+
+.lead {
+ margin-bottom: 20px;
+ font-size: 16px;
+ font-weight: 300;
+ line-height: 1.4; }
+
+@media (min-width: 768px) {
+ .lead {
+ font-size: 21px; } }
+
+.small, small {
+ font-size: 85%; }
+
+.mark, mark {
+ padding: .2em;
+ background-color: #fcf8e3; }
+
+.text-left {
+ text-align: left; }
+
+.text-right {
+ text-align: right; }
+
+.text-center {
+ text-align: center; }
+
+.text-justify {
+ text-align: justify; }
+
+.text-nowrap {
+ white-space: nowrap; }
+
+.text-lowercase {
+ text-transform: lowercase; }
+
+.text-uppercase {
+ text-transform: uppercase; }
+
+.text-capitalize {
+ text-transform: capitalize; }
+
+.text-muted {
+ color: #777; }
+
+.text-primary {
+ color: #337ab7; }
+
+a.text-primary:hover {
+ color: #286090; }
+
+.text-success {
+ color: #3c763d; }
+
+a.text-success:hover {
+ color: #2b542c; }
+
+.text-info {
+ color: #31708f; }
+
+a.text-info:hover {
+ color: #245269; }
+
+.text-warning {
+ color: #8a6d3b; }
+
+a.text-warning:hover {
+ color: #66512c; }
+
+.text-danger {
+ color: #a94442; }
+
+a.text-danger:hover {
+ color: #843534; }
+
+.bg-primary {
+ color: #fff;
+ background-color: #337ab7; }
+
+a.bg-primary:hover {
+ background-color: #286090; }
+
+.bg-success {
+ background-color: #dff0d8; }
+
+a.bg-success:hover {
+ background-color: #c1e2b3; }
+
+.bg-info {
+ background-color: #d9edf7; }
+
+a.bg-info:hover {
+ background-color: #afd9ee; }
+
+.bg-warning {
+ background-color: #fcf8e3; }
+
+a.bg-warning:hover {
+ background-color: #f7ecb5; }
+
+.bg-danger {
+ background-color: #f2dede; }
+
+a.bg-danger:hover {
+ background-color: #e4b9b9; }
+
+.page-header {
+ padding-bottom: 9px;
+ margin: 40px 0 20px;
+ border-bottom: 1px solid #eee; }
+
+ol, ul {
+ margin-top: 0;
+ margin-bottom: 10px; }
+
+ol ol, ol ul, ul ol, ul ul {
+ margin-bottom: 0; }
+
+.list-unstyled {
+ padding-left: 0;
+ list-style: none; }
+
+.list-inline {
+ padding-left: 0;
+ margin-left: -5px;
+ list-style: none; }
+
+.list-inline > li {
+ display: inline-block;
+ padding-right: 5px;
+ padding-left: 5px; }
+
+dl {
+ margin-top: 0;
+ margin-bottom: 20px; }
+
+dd, dt {
+ line-height: 1.42857143; }
+
+dt {
+ font-weight: 700; }
+
+dd {
+ margin-left: 0; }
+
+@media (min-width: 768px) {
+ .dl-horizontal dt {
+ float: left;
+ width: 160px;
+ overflow: hidden;
+ clear: left;
+ text-align: right;
+ text-overflow: ellipsis;
+ white-space: nowrap; }
+ .dl-horizontal dd {
+ margin-left: 180px; } }
+
+abbr[data-original-title], abbr[title] {
+ cursor: help;
+ border-bottom: 1px dotted #777; }
+
+.initialism {
+ font-size: 90%;
+ text-transform: uppercase; }
+
+blockquote {
+ padding: 10px 20px;
+ margin: 0 0 20px;
+ font-size: 17.5px;
+ border-left: 5px solid #eee; }
+
+blockquote ol:last-child, blockquote p:last-child, blockquote ul:last-child {
+ margin-bottom: 0; }
+
+blockquote .small, blockquote footer, blockquote small {
+ display: block;
+ font-size: 80%;
+ line-height: 1.42857143;
+ color: #777; }
+
+blockquote .small:before, blockquote footer:before, blockquote small:before {
+ content: '\2014 \00A0'; }
+
+.blockquote-reverse, blockquote.pull-right {
+ padding-right: 15px;
+ padding-left: 0;
+ text-align: right;
+ border-right: 5px solid #eee;
+ border-left: 0; }
+
+.blockquote-reverse .small:before, .blockquote-reverse footer:before, .blockquote-reverse small:before, blockquote.pull-right .small:before, blockquote.pull-right footer:before, blockquote.pull-right small:before {
+ content: ''; }
+
+.blockquote-reverse .small:after, .blockquote-reverse footer:after, .blockquote-reverse small:after, blockquote.pull-right .small:after, blockquote.pull-right footer:after, blockquote.pull-right small:after {
+ content: '\00A0 \2014'; }
+
+address {
+ margin-bottom: 20px;
+ font-style: normal;
+ line-height: 1.42857143; }
+
+code, kbd, pre, samp {
+ font-family: Menlo, Monaco, Consolas, "Courier New", monospace; }
+
+code {
+ padding: 2px 4px;
+ font-size: 90%;
+ color: #c7254e;
+ background-color: #f9f2f4;
+ border-radius: 4px; }
+
+kbd {
+ padding: 2px 4px;
+ font-size: 90%;
+ color: #fff;
+ background-color: #333;
+ border-radius: 3px;
+ -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25);
+ box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25); }
+
+kbd kbd {
+ padding: 0;
+ font-size: 100%;
+ font-weight: 700;
+ -webkit-box-shadow: none;
+ box-shadow: none; }
+
+pre {
+ display: block;
+ padding: 9.5px;
+ margin: 0 0 10px;
+ font-size: 13px;
+ line-height: 1.42857143;
+ color: #333;
+ word-break: break-all;
+ word-wrap: break-word;
+ background-color: #f5f5f5;
+ border: 1px solid #ccc;
+ border-radius: 4px; }
+
+pre code {
+ padding: 0;
+ font-size: inherit;
+ color: inherit;
+ white-space: pre-wrap;
+ background-color: transparent;
+ border-radius: 0; }
+
+.pre-scrollable {
+ max-height: 340px;
+ overflow-y: scroll; }
+
+.container {
+ padding-right: 15px;
+ padding-left: 15px;
+ margin-right: auto;
+ margin-left: auto; }
+
+@media (min-width: 768px) {
+ .container {
+ width: 750px; } }
+
+@media (min-width: 992px) {
+ .container {
+ width: 970px; } }
+
+@media (min-width: 1200px) {
+ .container {
+ width: 1170px; } }
+
+.container-fluid {
+ padding-right: 15px;
+ padding-left: 15px;
+ margin-right: auto;
+ margin-left: auto; }
+
+.row {
+ margin-right: -15px;
+ margin-left: -15px; }
+
+.col-lg-1, .col-lg-10, .col-lg-11, .col-lg-12, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-md-1, .col-md-10, .col-md-11, .col-md-12, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-sm-1, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-xs-1, .col-xs-10, .col-xs-11, .col-xs-12, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9 {
+ position: relative;
+ min-height: 1px;
+ padding-right: 15px;
+ padding-left: 15px; }
+
+.col-xs-1, .col-xs-10, .col-xs-11, .col-xs-12, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9 {
+ float: left; }
+
+.col-xs-12 {
+ width: 100%; }
+
+.col-xs-11 {
+ width: 91.66666667%; }
+
+.col-xs-10 {
+ width: 83.33333333%; }
+
+.col-xs-9 {
+ width: 75%; }
+
+.col-xs-8 {
+ width: 66.66666667%; }
+
+.col-xs-7 {
+ width: 58.33333333%; }
+
+.col-xs-6 {
+ width: 50%; }
+
+.col-xs-5 {
+ width: 41.66666667%; }
+
+.col-xs-4 {
+ width: 33.33333333%; }
+
+.col-xs-3 {
+ width: 25%; }
+
+.col-xs-2 {
+ width: 16.66666667%; }
+
+.col-xs-1 {
+ width: 8.33333333%; }
+
+.col-xs-pull-12 {
+ right: 100%; }
+
+.col-xs-pull-11 {
+ right: 91.66666667%; }
+
+.col-xs-pull-10 {
+ right: 83.33333333%; }
+
+.col-xs-pull-9 {
+ right: 75%; }
+
+.col-xs-pull-8 {
+ right: 66.66666667%; }
+
+.col-xs-pull-7 {
+ right: 58.33333333%; }
+
+.col-xs-pull-6 {
+ right: 50%; }
+
+.col-xs-pull-5 {
+ right: 41.66666667%; }
+
+.col-xs-pull-4 {
+ right: 33.33333333%; }
+
+.col-xs-pull-3 {
+ right: 25%; }
+
+.col-xs-pull-2 {
+ right: 16.66666667%; }
+
+.col-xs-pull-1 {
+ right: 8.33333333%; }
+
+.col-xs-pull-0 {
+ right: auto; }
+
+.col-xs-push-12 {
+ left: 100%; }
+
+.col-xs-push-11 {
+ left: 91.66666667%; }
+
+.col-xs-push-10 {
+ left: 83.33333333%; }
+
+.col-xs-push-9 {
+ left: 75%; }
+
+.col-xs-push-8 {
+ left: 66.66666667%; }
+
+.col-xs-push-7 {
+ left: 58.33333333%; }
+
+.col-xs-push-6 {
+ left: 50%; }
+
+.col-xs-push-5 {
+ left: 41.66666667%; }
+
+.col-xs-push-4 {
+ left: 33.33333333%; }
+
+.col-xs-push-3 {
+ left: 25%; }
+
+.col-xs-push-2 {
+ left: 16.66666667%; }
+
+.col-xs-push-1 {
+ left: 8.33333333%; }
+
+.col-xs-push-0 {
+ left: auto; }
+
+.col-xs-offset-12 {
+ margin-left: 100%; }
+
+.col-xs-offset-11 {
+ margin-left: 91.66666667%; }
+
+.col-xs-offset-10 {
+ margin-left: 83.33333333%; }
+
+.col-xs-offset-9 {
+ margin-left: 75%; }
+
+.col-xs-offset-8 {
+ margin-left: 66.66666667%; }
+
+.col-xs-offset-7 {
+ margin-left: 58.33333333%; }
+
+.col-xs-offset-6 {
+ margin-left: 50%; }
+
+.col-xs-offset-5 {
+ margin-left: 41.66666667%; }
+
+.col-xs-offset-4 {
+ margin-left: 33.33333333%; }
+
+.col-xs-offset-3 {
+ margin-left: 25%; }
+
+.col-xs-offset-2 {
+ margin-left: 16.66666667%; }
+
+.col-xs-offset-1 {
+ margin-left: 8.33333333%; }
+
+.col-xs-offset-0 {
+ margin-left: 0; }
+
+@media (min-width: 768px) {
+ .col-sm-1, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9 {
+ float: left; }
+ .col-sm-12 {
+ width: 98%; }
+ .col-sm-11 {
+ width: 91.66666667%; }
+ .col-sm-10 {
+ width: 83.33333333%; }
+ .col-sm-9 {
+ width: 75%; }
+ .col-sm-8 {
+ width: 66.66666667%; }
+ .col-sm-7 {
+ width: 58.33333333%; }
+ .col-sm-6 {
+ width: 48%; }
+ .col-sm-5 {
+ width: 41.66666667%; }
+ .col-sm-4 {
+ width: 33.33333333%; }
+ .col-sm-3 {
+ width: 25%; }
+ .col-sm-2 {
+ width: 16.66666667%; }
+ .col-sm-1 {
+ width: 8.33333333%; }
+ .col-sm-pull-12 {
+ right: 100%; }
+ .col-sm-pull-11 {
+ right: 91.66666667%; }
+ .col-sm-pull-10 {
+ right: 83.33333333%; }
+ .col-sm-pull-9 {
+ right: 75%; }
+ .col-sm-pull-8 {
+ right: 66.66666667%; }
+ .col-sm-pull-7 {
+ right: 58.33333333%; }
+ .col-sm-pull-6 {
+ right: 50%; }
+ .col-sm-pull-5 {
+ right: 41.66666667%; }
+ .col-sm-pull-4 {
+ right: 33.33333333%; }
+ .col-sm-pull-3 {
+ right: 25%; }
+ .col-sm-pull-2 {
+ right: 16.66666667%; }
+ .col-sm-pull-1 {
+ right: 8.33333333%; }
+ .col-sm-pull-0 {
+ right: auto; }
+ .col-sm-push-12 {
+ left: 100%; }
+ .col-sm-push-11 {
+ left: 91.66666667%; }
+ .col-sm-push-10 {
+ left: 83.33333333%; }
+ .col-sm-push-9 {
+ left: 75%; }
+ .col-sm-push-8 {
+ left: 66.66666667%; }
+ .col-sm-push-7 {
+ left: 58.33333333%; }
+ .col-sm-push-6 {
+ left: 50%; }
+ .col-sm-push-5 {
+ left: 41.66666667%; }
+ .col-sm-push-4 {
+ left: 33.33333333%; }
+ .col-sm-push-3 {
+ left: 25%; }
+ .col-sm-push-2 {
+ left: 16.66666667%; }
+ .col-sm-push-1 {
+ left: 8.33333333%; }
+ .col-sm-push-0 {
+ left: auto; }
+ .col-sm-offset-12 {
+ margin-left: 100%; }
+ .col-sm-offset-11 {
+ margin-left: 91.66666667%; }
+ .col-sm-offset-10 {
+ margin-left: 83.33333333%; }
+ .col-sm-offset-9 {
+ margin-left: 75%; }
+ .col-sm-offset-8 {
+ margin-left: 66.66666667%; }
+ .col-sm-offset-7 {
+ margin-left: 58.33333333%; }
+ .col-sm-offset-6 {
+ margin-left: 50%; }
+ .col-sm-offset-5 {
+ margin-left: 41.66666667%; }
+ .col-sm-offset-4 {
+ margin-left: 33.33333333%; }
+ .col-sm-offset-3 {
+ margin-left: 25%; }
+ .col-sm-offset-2 {
+ margin-left: 16.66666667%; }
+ .col-sm-offset-1 {
+ margin-left: 8.33333333%; }
+ .col-sm-offset-0 {
+ margin-left: 0; } }
+
+@media (min-width: 992px) {
+ .col-md-1, .col-md-10, .col-md-11, .col-md-12, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9 {
+ float: left; }
+ .col-md-12 {
+ width: 100%; }
+ .col-md-11 {
+ width: 91.66666667%; }
+ .col-md-10 {
+ width: 83.33333333%; }
+ .col-md-9 {
+ width: 75%; }
+ .col-md-8 {
+ width: 66.66666667%; }
+ .col-md-7 {
+ width: 58.33333333%; }
+ .col-md-6 {
+ width: 50%; }
+ .col-md-5 {
+ width: 41.66666667%; }
+ .col-md-4 {
+ width: 33.33333333%; }
+ .col-md-3 {
+ width: 25%; }
+ .col-md-2 {
+ width: 16.66666667%; }
+ .col-md-1 {
+ width: 8.33333333%; }
+ .col-md-pull-12 {
+ right: 100%; }
+ .col-md-pull-11 {
+ right: 91.66666667%; }
+ .col-md-pull-10 {
+ right: 83.33333333%; }
+ .col-md-pull-9 {
+ right: 75%; }
+ .col-md-pull-8 {
+ right: 66.66666667%; }
+ .col-md-pull-7 {
+ right: 58.33333333%; }
+ .col-md-pull-6 {
+ right: 50%; }
+ .col-md-pull-5 {
+ right: 41.66666667%; }
+ .col-md-pull-4 {
+ right: 33.33333333%; }
+ .col-md-pull-3 {
+ right: 25%; }
+ .col-md-pull-2 {
+ right: 16.66666667%; }
+ .col-md-pull-1 {
+ right: 8.33333333%; }
+ .col-md-pull-0 {
+ right: auto; }
+ .col-md-push-12 {
+ left: 100%; }
+ .col-md-push-11 {
+ left: 91.66666667%; }
+ .col-md-push-10 {
+ left: 83.33333333%; }
+ .col-md-push-9 {
+ left: 75%; }
+ .col-md-push-8 {
+ left: 66.66666667%; }
+ .col-md-push-7 {
+ left: 58.33333333%; }
+ .col-md-push-6 {
+ left: 50%; }
+ .col-md-push-5 {
+ left: 41.66666667%; }
+ .col-md-push-4 {
+ left: 33.33333333%; }
+ .col-md-push-3 {
+ left: 25%; }
+ .col-md-push-2 {
+ left: 16.66666667%; }
+ .col-md-push-1 {
+ left: 8.33333333%; }
+ .col-md-push-0 {
+ left: auto; }
+ .col-md-offset-12 {
+ margin-left: 100%; }
+ .col-md-offset-11 {
+ margin-left: 91.66666667%; }
+ .col-md-offset-10 {
+ margin-left: 83.33333333%; }
+ .col-md-offset-9 {
+ margin-left: 75%; }
+ .col-md-offset-8 {
+ margin-left: 66.66666667%; }
+ .col-md-offset-7 {
+ margin-left: 58.33333333%; }
+ .col-md-offset-6 {
+ margin-left: 50%; }
+ .col-md-offset-5 {
+ margin-left: 41.66666667%; }
+ .col-md-offset-4 {
+ margin-left: 33.33333333%; }
+ .col-md-offset-3 {
+ margin-left: 25%; }
+ .col-md-offset-2 {
+ margin-left: 16.66666667%; }
+ .col-md-offset-1 {
+ margin-left: 8.33333333%; }
+ .col-md-offset-0 {
+ margin-left: 0; } }
+
+@media (min-width: 1200px) {
+ .col-lg-1, .col-lg-10, .col-lg-11, .col-lg-12, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9 {
+ float: left; }
+ .col-lg-12 {
+ width: 100%; }
+ .col-lg-11 {
+ width: 91.66666667%; }
+ .col-lg-10 {
+ width: 83.33333333%; }
+ .col-lg-9 {
+ width: 75%; }
+ .col-lg-8 {
+ width: 66.66666667%; }
+ .col-lg-7 {
+ width: 58.33333333%; }
+ .col-lg-6 {
+ width: 50%; }
+ .col-lg-5 {
+ width: 41.66666667%; }
+ .col-lg-4 {
+ width: 33.33333333%; }
+ .col-lg-3 {
+ width: 25%; }
+ .col-lg-2 {
+ width: 16.66666667%; }
+ .col-lg-1 {
+ width: 8.33333333%; }
+ .col-lg-pull-12 {
+ right: 100%; }
+ .col-lg-pull-11 {
+ right: 91.66666667%; }
+ .col-lg-pull-10 {
+ right: 83.33333333%; }
+ .col-lg-pull-9 {
+ right: 75%; }
+ .col-lg-pull-8 {
+ right: 66.66666667%; }
+ .col-lg-pull-7 {
+ right: 58.33333333%; }
+ .col-lg-pull-6 {
+ right: 50%; }
+ .col-lg-pull-5 {
+ right: 41.66666667%; }
+ .col-lg-pull-4 {
+ right: 33.33333333%; }
+ .col-lg-pull-3 {
+ right: 25%; }
+ .col-lg-pull-2 {
+ right: 16.66666667%; }
+ .col-lg-pull-1 {
+ right: 8.33333333%; }
+ .col-lg-pull-0 {
+ right: auto; }
+ .col-lg-push-12 {
+ left: 100%; }
+ .col-lg-push-11 {
+ left: 91.66666667%; }
+ .col-lg-push-10 {
+ left: 83.33333333%; }
+ .col-lg-push-9 {
+ left: 75%; }
+ .col-lg-push-8 {
+ left: 66.66666667%; }
+ .col-lg-push-7 {
+ left: 58.33333333%; }
+ .col-lg-push-6 {
+ left: 50%; }
+ .col-lg-push-5 {
+ left: 41.66666667%; }
+ .col-lg-push-4 {
+ left: 33.33333333%; }
+ .col-lg-push-3 {
+ left: 25%; }
+ .col-lg-push-2 {
+ left: 16.66666667%; }
+ .col-lg-push-1 {
+ left: 8.33333333%; }
+ .col-lg-push-0 {
+ left: auto; }
+ .col-lg-offset-12 {
+ margin-left: 100%; }
+ .col-lg-offset-11 {
+ margin-left: 91.66666667%; }
+ .col-lg-offset-10 {
+ margin-left: 83.33333333%; }
+ .col-lg-offset-9 {
+ margin-left: 75%; }
+ .col-lg-offset-8 {
+ margin-left: 66.66666667%; }
+ .col-lg-offset-7 {
+ margin-left: 58.33333333%; }
+ .col-lg-offset-6 {
+ margin-left: 50%; }
+ .col-lg-offset-5 {
+ margin-left: 41.66666667%; }
+ .col-lg-offset-4 {
+ margin-left: 33.33333333%; }
+ .col-lg-offset-3 {
+ margin-left: 25%; }
+ .col-lg-offset-2 {
+ margin-left: 16.66666667%; }
+ .col-lg-offset-1 {
+ margin-left: 8.33333333%; }
+ .col-lg-offset-0 {
+ margin-left: 0; } }
+
+table {
+ background-color: transparent; }
+
+caption {
+ padding-top: 8px;
+ padding-bottom: 8px;
+ color: #777;
+ text-align: left; }
+
+th {
+ text-align: left; }
+
+.table {
+ width: 100%;
+ max-width: 100%;
+ margin-bottom: 20px; }
+
+.table > tbody > tr > td, .table > tbody > tr > th, .table > tfoot > tr > td, .table > tfoot > tr > th, .table > thead > tr > td, .table > thead > tr > th {
+ padding: 8px;
+ line-height: 1.42857143;
+ vertical-align: top; }
+
+.table > thead > tr > th {
+ vertical-align: bottom; }
+
+.table > caption + thead > tr:first-child > td, .table > caption + thead > tr:first-child > th, .table > colgroup + thead > tr:first-child > td, .table > colgroup + thead > tr:first-child > th, .table > thead:first-child > tr:first-child > td, .table > thead:first-child > tr:first-child > th {
+ border-top: 0; }
+
+.table .table {
+ background-color: #fff; }
+
+.table-condensed > tbody > tr > td, .table-condensed > tbody > tr > th, .table-condensed > tfoot > tr > td, .table-condensed > tfoot > tr > th, .table-condensed > thead > tr > td, .table-condensed > thead > tr > th {
+ padding: 5px; }
+
+.table-bordered > thead > tr > td, .table-bordered > thead > tr > th {
+ border-bottom-width: 1px; }
+
+table col[class*=col-] {
+ position: static;
+ display: table-column;
+ float: none; }
+
+table td[class*=col-], table th[class*=col-] {
+ position: static;
+ display: table-cell;
+ float: none; }
+
+.table-responsive {
+ min-height: .01%;
+ overflow-x: auto; }
+
+@media screen and (max-width: 767px) {
+ .table-responsive {
+ width: 100%;
+ margin-bottom: 15px;
+ overflow-y: hidden;
+ -ms-overflow-style: -ms-autohiding-scrollbar; }
+ .table-responsive > .table {
+ margin-bottom: 0; }
+ .table-responsive > .table > tbody > tr > td, .table-responsive > .table > tbody > tr > th, .table-responsive > .table > tfoot > tr > td, .table-responsive > .table > tfoot > tr > th, .table-responsive > .table > thead > tr > td, .table-responsive > .table > thead > tr > th {
+ white-space: nowrap; }
+ .table-responsive > .table-bordered {
+ border: 0; }
+ .table-responsive > .table-bordered > tbody > tr > td:first-child, .table-responsive > .table-bordered > tbody > tr > th:first-child, .table-responsive > .table-bordered > tfoot > tr > td:first-child, .table-responsive > .table-bordered > tfoot > tr > th:first-child, .table-responsive > .table-bordered > thead > tr > td:first-child, .table-responsive > .table-bordered > thead > tr > th:first-child {
+ border-left: 0; }
+ .table-responsive > .table-bordered > tbody > tr > td:last-child, .table-responsive > .table-bordered > tbody > tr > th:last-child, .table-responsive > .table-bordered > tfoot > tr > td:last-child, .table-responsive > .table-bordered > tfoot > tr > th:last-child, .table-responsive > .table-bordered > thead > tr > td:last-child, .table-responsive > .table-bordered > thead > tr > th:last-child {
+ border-right: 0; }
+ .table-responsive > .table-bordered > tbody > tr:last-child > td, .table-responsive > .table-bordered > tbody > tr:last-child > th, .table-responsive > .table-bordered > tfoot > tr:last-child > td, .table-responsive > .table-bordered > tfoot > tr:last-child > th {
+ border-bottom: 0; } }
+
+input[type=search] {
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box; }
+
+input[type=checkbox], input[type=radio] {
+ margin: 4px 0 0;
+ margin-top: 1px \9;
+ line-height: normal; }
+
+input[type=range] {
+ display: block;
+ width: 100%; }
+
+select[multiple], select[size] {
+ height: auto; }
+
+input[type=file]:focus, input[type=checkbox]:focus, input[type=radio]:focus {
+ outline: thin dotted;
+ outline: 5px auto -webkit-focus-ring-color;
+ outline-offset: -2px; }
+
+output {
+ display: block;
+ padding-top: 7px;
+ font-size: 14px;
+ line-height: 1.42857143;
+ color: #555; }
+
+.form-control {
+ display: block;
+ width: 100%;
+ height: 34px;
+ padding: 6px 12px;
+ font-size: 14px;
+ line-height: 1.42857143;
+ color: #555;
+ background-color: #fff;
+ background-image: none;
+ border: 1px solid #ccc;
+ border-radius: 4px; }
+
+.form-control:focus {
+ border-color: #66afe9;
+ outline: 0; }
+
+.form-control::-moz-placeholder {
+ color: #999;
+ opacity: 1; }
+
+.form-control:-ms-input-placeholder {
+ color: #999; }
+
+.form-control::-webkit-input-placeholder {
+ color: #999; }
+
+.form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control {
+ cursor: not-allowed;
+ background-color: #eee;
+ opacity: 1; }
+
+textarea.form-control {
+ height: auto; }
+
+input[type=search] {
+ -webkit-appearance: none; }
+
+@media screen and (-webkit-min-device-pixel-ratio: 0) {
+ input[type=date], input[type=time], input[type=datetime-local], input[type=month] {
+ line-height: 34px; }
+ .input-group-sm input[type=date], .input-group-sm input[type=time], .input-group-sm input[type=datetime-local], .input-group-sm input[type=month], input[type=date].input-sm, input[type=time].input-sm, input[type=datetime-local].input-sm, input[type=month].input-sm {
+ line-height: 30px; }
+ .input-group-lg input[type=date], .input-group-lg input[type=time], .input-group-lg input[type=datetime-local], .input-group-lg input[type=month], input[type=date].input-lg, input[type=time].input-lg, input[type=datetime-local].input-lg, input[type=month].input-lg {
+ line-height: 46px; } }
+
+.form-group {
+ margin-bottom: 15px; }
+
+.checkbox, .radio {
+ position: relative;
+ display: block;
+ margin-top: 10px;
+ margin-bottom: 10px; }
+
+.checkbox label, .radio label {
+ min-height: 20px;
+ padding-left: 20px;
+ margin-bottom: 0;
+ font-weight: 400;
+ cursor: pointer; }
+
+.checkbox input[type=checkbox], .checkbox-inline input[type=checkbox], .radio input[type=radio], .radio-inline input[type=radio] {
+ position: absolute;
+ margin-top: 4px \9;
+ margin-left: -20px; }
+
+.checkbox + .checkbox, .radio + .radio {
+ margin-top: -5px; }
+
+.checkbox-inline, .radio-inline {
+ display: inline-block;
+ padding-left: 20px;
+ margin-bottom: 0;
+ font-weight: 400;
+ vertical-align: middle;
+ cursor: pointer; }
+
+.checkbox-inline + .checkbox-inline, .radio-inline + .radio-inline {
+ margin-top: 0;
+ margin-left: 10px; }
+
+fieldset[disabled] input[type=checkbox], fieldset[disabled] input[type=radio], input[type=checkbox].disabled, input[type=checkbox][disabled], input[type=radio].disabled, input[type=radio][disabled] {
+ cursor: not-allowed; }
+
+.checkbox-inline.disabled, .radio-inline.disabled, fieldset[disabled] .checkbox-inline, fieldset[disabled] .radio-inline {
+ cursor: not-allowed; }
+
+.checkbox.disabled label, .radio.disabled label, fieldset[disabled] .checkbox label, fieldset[disabled] .radio label {
+ cursor: not-allowed; }
+
+.form-control-static {
+ padding-top: 7px;
+ padding-bottom: 7px;
+ margin-bottom: 0; }
+
+.form-control-static.input-lg, .form-control-static.input-sm {
+ padding-right: 0;
+ padding-left: 0; }
+
+.input-sm {
+ height: 30px;
+ padding: 5px 10px;
+ font-size: 12px;
+ line-height: 1.5;
+ border-radius: 3px; }
+
+select.input-sm {
+ height: 30px;
+ line-height: 30px; }
+
+select[multiple].input-sm, textarea.input-sm {
+ height: auto; }
+
+.form-group-sm .form-control {
+ height: 30px;
+ padding: 5px 10px;
+ font-size: 12px;
+ line-height: 1.5;
+ border-radius: 3px; }
+
+select.form-group-sm .form-control {
+ height: 30px;
+ line-height: 30px; }
+
+select[multiple].form-group-sm .form-control, textarea.form-group-sm .form-control {
+ height: auto; }
+
+.form-group-sm .form-control-static {
+ height: 30px;
+ padding: 5px 10px;
+ font-size: 12px;
+ line-height: 1.5; }
+
+.input-lg {
+ height: 46px;
+ padding: 10px 16px;
+ font-size: 18px;
+ line-height: 1.3333333;
+ border-radius: 6px; }
+
+select.input-lg {
+ height: 46px;
+ line-height: 46px; }
+
+select[multiple].input-lg, textarea.input-lg {
+ height: auto; }
+
+.form-group-lg .form-control {
+ height: 46px;
+ padding: 10px 16px;
+ font-size: 18px;
+ line-height: 1.3333333;
+ border-radius: 6px; }
+
+select.form-group-lg .form-control {
+ height: 46px;
+ line-height: 46px; }
+
+select[multiple].form-group-lg .form-control, textarea.form-group-lg .form-control {
+ height: auto; }
+
+.form-group-lg .form-control-static {
+ height: 46px;
+ padding: 10px 16px;
+ font-size: 18px;
+ line-height: 1.3333333; }
+
+.has-feedback {
+ position: relative; }
+
+.has-feedback .form-control {
+ padding-right: 42.5px; }
+
+.form-control-feedback {
+ position: absolute;
+ top: 0;
+ right: 0;
+ z-index: 2;
+ display: block;
+ width: 34px;
+ height: 34px;
+ line-height: 34px;
+ text-align: center;
+ pointer-events: none; }
+
+.input-lg + .form-control-feedback {
+ width: 46px;
+ height: 46px;
+ line-height: 46px; }
+
+.input-sm + .form-control-feedback {
+ width: 30px;
+ height: 30px;
+ line-height: 30px; }
+
+.has-success .checkbox, .has-success .checkbox-inline, .has-success .control-label, .has-success .help-block, .has-success .radio, .has-success .radio-inline, .has-success.checkbox label, .has-success.checkbox-inline label, .has-success.radio label, .has-success.radio-inline label {
+ color: #3c763d; }
+
+.has-success .form-control {
+ border-color: #3c763d;
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); }
+
+.has-success .form-control:focus {
+ border-color: #2b542c;
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168;
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168; }
+
+.has-success .input-group-addon {
+ color: #3c763d;
+ background-color: #dff0d8;
+ border-color: #3c763d; }
+
+.has-success .form-control-feedback {
+ color: #3c763d; }
+
+.has-warning .checkbox, .has-warning .checkbox-inline, .has-warning .control-label, .has-warning .help-block, .has-warning .radio, .has-warning .radio-inline, .has-warning.checkbox label, .has-warning.checkbox-inline label, .has-warning.radio label, .has-warning.radio-inline label {
+ color: #8a6d3b; }
+
+.has-warning .form-control {
+ border-color: #8a6d3b;
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); }
+
+.has-warning .form-control:focus {
+ border-color: #66512c;
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b;
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b; }
+
+.has-warning .input-group-addon {
+ color: #8a6d3b;
+ background-color: #fcf8e3;
+ border-color: #8a6d3b; }
+
+.has-warning .form-control-feedback {
+ color: #8a6d3b; }
+
+.has-error .checkbox, .has-error .checkbox-inline, .has-error .control-label, .has-error .help-block, .has-error .radio, .has-error .radio-inline, .has-error.checkbox label, .has-error.checkbox-inline label, .has-error.radio label, .has-error.radio-inline label {
+ color: #a94442; }
+
+.has-error .form-control {
+ border-color: #a94442;
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); }
+
+.has-error .form-control:focus {
+ border-color: #843534;
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483;
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483; }
+
+.has-error .input-group-addon {
+ color: #a94442;
+ background-color: #f2dede;
+ border-color: #a94442; }
+
+.has-error .form-control-feedback {
+ color: #a94442; }
+
+.has-feedback label ~ .form-control-feedback {
+ top: 25px; }
+
+.has-feedback label.sr-only ~ .form-control-feedback {
+ top: 0; }
+
+.help-block {
+ display: block;
+ margin-top: 5px;
+ margin-bottom: 10px;
+ color: #737373; }
+
+@media (min-width: 768px) {
+ .form-inline .form-group {
+ display: inline-block;
+ margin-bottom: 0;
+ vertical-align: middle; }
+ .form-inline .form-control {
+ display: inline-block;
+ width: auto;
+ vertical-align: middle; }
+ .form-inline .form-control-static {
+ display: inline-block; }
+ .form-inline .input-group {
+ display: inline-table;
+ vertical-align: middle; }
+ .form-inline .input-group .form-control, .form-inline .input-group .input-group-addon, .form-inline .input-group .input-group-btn {
+ width: auto; }
+ .form-inline .input-group > .form-control {
+ width: 100%; }
+ .form-inline .control-label {
+ margin-bottom: 0;
+ vertical-align: middle; }
+ .form-inline .checkbox, .form-inline .radio {
+ display: inline-block;
+ margin-top: 0;
+ margin-bottom: 0;
+ vertical-align: middle; }
+ .form-inline .checkbox label, .form-inline .radio label {
+ padding-left: 0; }
+ .form-inline .checkbox input[type=checkbox], .form-inline .radio input[type=radio] {
+ position: relative;
+ margin-left: 0; }
+ .form-inline .has-feedback .form-control-feedback {
+ top: 0; } }
+
+.form-horizontal .checkbox, .form-horizontal .checkbox-inline, .form-horizontal .radio, .form-horizontal .radio-inline {
+ padding-top: 7px;
+ margin-top: 0;
+ margin-bottom: 0; }
+
+.form-horizontal .checkbox, .form-horizontal .radio {
+ min-height: 27px; }
+
+.form-horizontal .form-group {
+ margin-right: -15px;
+ margin-left: -15px; }
+
+@media (min-width: 768px) {
+ .form-horizontal .control-label {
+ padding-top: 7px;
+ margin-bottom: 0;
+ text-align: right; } }
+
+.form-horizontal .has-feedback .form-control-feedback {
+ right: 15px; }
+
+@media (min-width: 768px) {
+ .form-horizontal .form-group-lg .control-label {
+ padding-top: 14.33px; } }
+
+@media (min-width: 768px) {
+ .form-horizontal .form-group-sm .control-label {
+ padding-top: 6px; } }
+
+.btn {
+ display: inline-block;
+ padding: 6px 12px;
+ margin-bottom: 0;
+ font-size: 14px;
+ font-weight: 400;
+ line-height: 1.42857143;
+ text-align: center;
+ white-space: nowrap;
+ vertical-align: middle;
+ -ms-touch-action: manipulation;
+ touch-action: manipulation;
+ cursor: pointer;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ background-image: none;
+ border: 1px solid transparent;
+ border-radius: 4px; }
+
+.btn.active.focus, .btn.active:focus, .btn.focus, .btn:active.focus, .btn:active:focus, .btn:focus {
+ outline: thin dotted;
+ outline: 5px auto -webkit-focus-ring-color;
+ outline-offset: -2px; }
+
+.btn.focus, .btn:focus, .btn:hover {
+ color: #333;
+ text-decoration: none; }
+
+.btn.active, .btn:active {
+ background-image: none;
+ outline: 0;
+ -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
+ box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); }
+
+.btn.disabled, .btn[disabled], fieldset[disabled] .btn {
+ pointer-events: none;
+ cursor: not-allowed;
+ filter: alpha(opacity=65);
+ -webkit-box-shadow: none;
+ box-shadow: none;
+ opacity: .65; }
+
+.btn-default {
+ color: #333;
+ background-color: #fff;
+ border-color: #ccc; }
+
+.btn-default.active, .btn-default.focus, .btn-default:active, .btn-default:focus, .btn-default:hover, .open > .dropdown-toggle.btn-default {
+ color: #333;
+ background-color: #e6e6e6;
+ border-color: #adadad; }
+
+.btn-default.active, .btn-default:active, .open > .dropdown-toggle.btn-default {
+ background-image: none; }
+
+.btn-default.disabled, .btn-default.disabled.active, .btn-default.disabled.focus, .btn-default.disabled:active, .btn-default.disabled:focus, .btn-default.disabled:hover, .btn-default[disabled], .btn-default[disabled].active, .btn-default[disabled].focus, .btn-default[disabled]:active, .btn-default[disabled]:focus, .btn-default[disabled]:hover, fieldset[disabled] .btn-default, fieldset[disabled] .btn-default.active, fieldset[disabled] .btn-default.focus, fieldset[disabled] .btn-default:active, fieldset[disabled] .btn-default:focus, fieldset[disabled] .btn-default:hover {
+ background-color: #fff;
+ border-color: #ccc; }
+
+.btn-default .badge {
+ color: #fff;
+ background-color: #333; }
+
+.btn-primary {
+ color: #fff;
+ background-color: #337ab7;
+ border-color: #2e6da4; }
+
+.btn-primary.active, .btn-primary.focus, .btn-primary:active, .btn-primary:focus, .btn-primary:hover, .open > .dropdown-toggle.btn-primary {
+ color: #fff;
+ background-color: #286090;
+ border-color: #204d74; }
+
+.btn-primary.active, .btn-primary:active, .open > .dropdown-toggle.btn-primary {
+ background-image: none; }
+
+.btn-primary.disabled, .btn-primary.disabled.active, .btn-primary.disabled.focus, .btn-primary.disabled:active, .btn-primary.disabled:focus, .btn-primary.disabled:hover, .btn-primary[disabled], .btn-primary[disabled].active, .btn-primary[disabled].focus, .btn-primary[disabled]:active, .btn-primary[disabled]:focus, .btn-primary[disabled]:hover, fieldset[disabled] .btn-primary, fieldset[disabled] .btn-primary.active, fieldset[disabled] .btn-primary.focus, fieldset[disabled] .btn-primary:active, fieldset[disabled] .btn-primary:focus, fieldset[disabled] .btn-primary:hover {
+ background-color: #337ab7;
+ border-color: #2e6da4; }
+
+.btn-primary .badge {
+ color: #337ab7;
+ background-color: #fff; }
+
+.btn-success {
+ color: #fff;
+ background-color: #5cb85c;
+ border-color: #4cae4c; }
+
+.btn-success.active, .btn-success.focus, .btn-success:active, .btn-success:focus, .btn-success:hover, .open > .dropdown-toggle.btn-success {
+ color: #fff;
+ background-color: #449d44;
+ border-color: #398439; }
+
+.btn-success.active, .btn-success:active, .open > .dropdown-toggle.btn-success {
+ background-image: none; }
+
+.btn-success.disabled, .btn-success.disabled.active, .btn-success.disabled.focus, .btn-success.disabled:active, .btn-success.disabled:focus, .btn-success.disabled:hover, .btn-success[disabled], .btn-success[disabled].active, .btn-success[disabled].focus, .btn-success[disabled]:active, .btn-success[disabled]:focus, .btn-success[disabled]:hover, fieldset[disabled] .btn-success, fieldset[disabled] .btn-success.active, fieldset[disabled] .btn-success.focus, fieldset[disabled] .btn-success:active, fieldset[disabled] .btn-success:focus, fieldset[disabled] .btn-success:hover {
+ background-color: #5cb85c;
+ border-color: #4cae4c; }
+
+.btn-success .badge {
+ color: #5cb85c;
+ background-color: #fff; }
+
+.btn-info {
+ color: #fff;
+ background-color: #5bc0de;
+ border-color: #46b8da; }
+
+.btn-info.active, .btn-info.focus, .btn-info:active, .btn-info:focus, .btn-info:hover, .open > .dropdown-toggle.btn-info {
+ color: #fff;
+ background-color: #31b0d5;
+ border-color: #269abc; }
+
+.btn-info.active, .btn-info:active, .open > .dropdown-toggle.btn-info {
+ background-image: none; }
+
+.btn-info.disabled, .btn-info.disabled.active, .btn-info.disabled.focus, .btn-info.disabled:active, .btn-info.disabled:focus, .btn-info.disabled:hover, .btn-info[disabled], .btn-info[disabled].active, .btn-info[disabled].focus, .btn-info[disabled]:active, .btn-info[disabled]:focus, .btn-info[disabled]:hover, fieldset[disabled] .btn-info, fieldset[disabled] .btn-info.active, fieldset[disabled] .btn-info.focus, fieldset[disabled] .btn-info:active, fieldset[disabled] .btn-info:focus, fieldset[disabled] .btn-info:hover {
+ background-color: #5bc0de;
+ border-color: #46b8da; }
+
+.btn-info .badge {
+ color: #5bc0de;
+ background-color: #fff; }
+
+.btn-warning {
+ color: #fff;
+ background-color: #f0ad4e;
+ border-color: #eea236; }
+
+.btn-warning.active, .btn-warning.focus, .btn-warning:active, .btn-warning:focus, .btn-warning:hover, .open > .dropdown-toggle.btn-warning {
+ color: #fff;
+ background-color: #ec971f;
+ border-color: #d58512; }
+
+.btn-warning.active, .btn-warning:active, .open > .dropdown-toggle.btn-warning {
+ background-image: none; }
+
+.btn-warning.disabled, .btn-warning.disabled.active, .btn-warning.disabled.focus, .btn-warning.disabled:active, .btn-warning.disabled:focus, .btn-warning.disabled:hover, .btn-warning[disabled], .btn-warning[disabled].active, .btn-warning[disabled].focus, .btn-warning[disabled]:active, .btn-warning[disabled]:focus, .btn-warning[disabled]:hover, fieldset[disabled] .btn-warning, fieldset[disabled] .btn-warning.active, fieldset[disabled] .btn-warning.focus, fieldset[disabled] .btn-warning:active, fieldset[disabled] .btn-warning:focus, fieldset[disabled] .btn-warning:hover {
+ background-color: #f0ad4e;
+ border-color: #eea236; }
+
+.btn-warning .badge {
+ color: #f0ad4e;
+ background-color: #fff; }
+
+.btn-danger {
+ color: #fff;
+ background-color: #d9534f;
+ border-color: #d43f3a; }
+
+.btn-danger.active, .btn-danger.focus, .btn-danger:active, .btn-danger:focus, .btn-danger:hover, .open > .dropdown-toggle.btn-danger {
+ color: #fff;
+ background-color: #c9302c;
+ border-color: #ac2925; }
+
+.btn-danger.active, .btn-danger:active, .open > .dropdown-toggle.btn-danger {
+ background-image: none; }
+
+.btn-danger.disabled, .btn-danger.disabled.active, .btn-danger.disabled.focus, .btn-danger.disabled:active, .btn-danger.disabled:focus, .btn-danger.disabled:hover, .btn-danger[disabled], .btn-danger[disabled].active, .btn-danger[disabled].focus, .btn-danger[disabled]:active, .btn-danger[disabled]:focus, .btn-danger[disabled]:hover, fieldset[disabled] .btn-danger, fieldset[disabled] .btn-danger.active, fieldset[disabled] .btn-danger.focus, fieldset[disabled] .btn-danger:active, fieldset[disabled] .btn-danger:focus, fieldset[disabled] .btn-danger:hover {
+ background-color: #d9534f;
+ border-color: #d43f3a; }
+
+.btn-danger .badge {
+ color: #d9534f;
+ background-color: #fff; }
+
+.btn-link {
+ font-weight: 400;
+ color: #337ab7;
+ border-radius: 0; }
+
+.btn-link, .btn-link.active, .btn-link:active, .btn-link[disabled], fieldset[disabled] .btn-link {
+ background-color: transparent;
+ -webkit-box-shadow: none;
+ box-shadow: none; }
+
+.btn-link, .btn-link:active, .btn-link:focus, .btn-link:hover {
+ border-color: transparent; }
+
+.btn-link:focus, .btn-link:hover {
+ color: #23527c;
+ text-decoration: underline;
+ background-color: transparent; }
+
+.btn-link[disabled]:focus, .btn-link[disabled]:hover, fieldset[disabled] .btn-link:focus, fieldset[disabled] .btn-link:hover {
+ color: #777;
+ text-decoration: none; }
+
+.btn-group-lg > .btn, .btn-lg {
+ padding: 10px 16px;
+ font-size: 18px;
+ line-height: 1.3333333;
+ border-radius: 6px; }
+
+.btn-group-sm > .btn, .btn-sm {
+ padding: 5px 10px;
+ font-size: 12px;
+ line-height: 1.5;
+ border-radius: 3px; }
+
+.btn-group-xs > .btn, .btn-xs {
+ padding: 1px 5px;
+ font-size: 12px;
+ line-height: 1.5;
+ border-radius: 3px; }
+
+.btn-block {
+ display: block;
+ width: 100%; }
+
+.btn-block + .btn-block {
+ margin-top: 5px; }
+
+input[type=button].btn-block, input[type=reset].btn-block, input[type=submit].btn-block {
+ width: 100%; }
+
+.fade {
+ opacity: 0;
+ -webkit-transition: opacity 0.15s linear;
+ -o-transition: opacity 0.15s linear;
+ transition: opacity 0.15s linear; }
+
+.fade.in {
+ opacity: 1; }
+
+.collapse {
+ display: none;
+ visibility: hidden; }
+
+.collapse.in {
+ display: block;
+ visibility: visible; }
+
+tr.collapse.in {
+ display: table-row; }
+
+tbody.collapse.in {
+ display: table-row-group; }
+
+.collapsing {
+ position: relative;
+ height: 0;
+ overflow: hidden;
+ -webkit-transition-timing-function: ease;
+ -o-transition-timing-function: ease;
+ transition-timing-function: ease;
+ -webkit-transition-duration: .35s;
+ -o-transition-duration: .35s;
+ transition-duration: .35s;
+ -webkit-transition-property: height, visibility;
+ -o-transition-property: height, visibility;
+ transition-property: height, visibility; }
+
+.caret {
+ display: inline-block;
+ width: 0;
+ height: 0;
+ margin-left: 2px;
+ vertical-align: middle;
+ border-top: 4px solid;
+ border-right: 4px solid transparent;
+ border-left: 4px solid transparent; }
+
+.dropdown, .dropup {
+ position: relative; }
+
+.dropdown-toggle:focus {
+ outline: 0; }
+
+.dropdown-menu {
+ position: absolute;
+ top: 100%;
+ left: 0;
+ z-index: 1000;
+ display: none;
+ float: left;
+ min-width: 160px;
+ padding: 5px 0;
+ margin: 2px 0 0;
+ font-size: 14px;
+ text-align: left;
+ list-style: none;
+ background-color: #fff;
+ -webkit-background-clip: padding-box;
+ background-clip: padding-box;
+ border: 1px solid #ccc;
+ border: 1px solid rgba(0, 0, 0, 0.15);
+ border-radius: 4px;
+ -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
+ box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); }
+
+.dropdown-menu.pull-right {
+ right: 0;
+ left: auto; }
+
+.dropdown-menu .divider {
+ height: 1px;
+ margin: 9px 0;
+ overflow: hidden;
+ background-color: #e5e5e5; }
+
+.dropdown-menu > li > a {
+ display: block;
+ padding: 3px 20px;
+ clear: both;
+ font-weight: 400;
+ line-height: 1.42857143;
+ color: #333;
+ white-space: nowrap; }
+
+.dropdown-menu > li > a:focus, .dropdown-menu > li > a:hover {
+ color: #262626;
+ text-decoration: none;
+ background-color: #f5f5f5; }
+
+.dropdown-menu > .active > a, .dropdown-menu > .active > a:focus, .dropdown-menu > .active > a:hover {
+ color: #fff;
+ text-decoration: none;
+ background-color: #337ab7;
+ outline: 0; }
+
+.dropdown-menu > .disabled > a, .dropdown-menu > .disabled > a:focus, .dropdown-menu > .disabled > a:hover {
+ color: #777; }
+
+.dropdown-menu > .disabled > a:focus, .dropdown-menu > .disabled > a:hover {
+ text-decoration: none;
+ cursor: not-allowed;
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); }
+
+.open > .dropdown-menu {
+ display: block; }
+
+.open > a {
+ outline: 0; }
+
+.dropdown-menu-right {
+ right: 0;
+ left: auto; }
+
+.dropdown-menu-left {
+ right: auto;
+ left: 0; }
+
+.dropdown-header {
+ display: block;
+ padding: 3px 20px;
+ font-size: 12px;
+ line-height: 1.42857143;
+ color: #777;
+ white-space: nowrap; }
+
+.dropdown-backdrop {
+ position: fixed;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ z-index: 990; }
+
+.pull-right > .dropdown-menu {
+ right: 0;
+ left: auto; }
+
+.dropup .caret, .navbar-fixed-bottom .dropdown .caret {
+ content: "";
+ border-top: 0;
+ border-bottom: 4px solid; }
+
+.dropup .dropdown-menu, .navbar-fixed-bottom .dropdown .dropdown-menu {
+ top: auto;
+ bottom: 100%;
+ margin-bottom: 2px; }
+
+@media (min-width: 768px) {
+ .navbar-right .dropdown-menu {
+ right: 0;
+ left: auto; }
+ .navbar-right .dropdown-menu-left {
+ right: auto;
+ left: 0; } }
+
+.btn-group, .btn-group-vertical {
+ position: relative;
+ display: inline-block;
+ vertical-align: middle; }
+
+.btn-group-vertical > .btn, .btn-group > .btn {
+ position: relative;
+ float: left; }
+
+.btn-group-vertical > .btn.active, .btn-group-vertical > .btn:active, .btn-group-vertical > .btn:focus, .btn-group-vertical > .btn:hover, .btn-group > .btn.active, .btn-group > .btn:active, .btn-group > .btn:focus, .btn-group > .btn:hover {
+ z-index: 2; }
+
+.btn-group .btn + .btn, .btn-group .btn + .btn-group, .btn-group .btn-group + .btn, .btn-group .btn-group + .btn-group {
+ margin-left: -1px; }
+
+.btn-toolbar {
+ margin-left: -5px; }
+
+.btn-toolbar .btn-group, .btn-toolbar .input-group {
+ float: left; }
+
+.btn-toolbar > .btn, .btn-toolbar > .btn-group, .btn-toolbar > .input-group {
+ margin-left: 5px; }
+
+.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {
+ border-radius: 0; }
+
+.btn-group > .btn:first-child {
+ margin-left: 0; }
+
+.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) {
+ border-top-right-radius: 0;
+ border-bottom-right-radius: 0; }
+
+.btn-group > .btn:last-child:not(:first-child), .btn-group > .dropdown-toggle:not(:first-child) {
+ border-top-left-radius: 0;
+ border-bottom-left-radius: 0; }
+
+.btn-group > .btn-group {
+ float: left; }
+
+.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn {
+ border-radius: 0; }
+
+.btn-group > .btn-group:first-child:not(:last-child) > .btn:last-child, .btn-group > .btn-group:first-child:not(:last-child) > .dropdown-toggle {
+ border-top-right-radius: 0;
+ border-bottom-right-radius: 0; }
+
+.btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child {
+ border-top-left-radius: 0;
+ border-bottom-left-radius: 0; }
+
+.btn-group .dropdown-toggle:active, .btn-group.open .dropdown-toggle {
+ outline: 0; }
+
+.btn-group > .btn + .dropdown-toggle {
+ padding-right: 8px;
+ padding-left: 8px; }
+
+.btn-group > .btn-lg + .dropdown-toggle {
+ padding-right: 12px;
+ padding-left: 12px; }
+
+.btn-group.open .dropdown-toggle {
+ -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
+ box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); }
+
+.btn-group.open .dropdown-toggle.btn-link {
+ -webkit-box-shadow: none;
+ box-shadow: none; }
+
+.btn .caret {
+ margin-left: 0; }
+
+.btn-lg .caret {
+ border-width: 5px 5px 0;
+ border-bottom-width: 0; }
+
+.dropup .btn-lg .caret {
+ border-width: 0 5px 5px; }
+
+.btn-group-vertical > .btn, .btn-group-vertical > .btn-group, .btn-group-vertical > .btn-group > .btn {
+ display: block;
+ float: none;
+ width: 100%;
+ max-width: 100%; }
+
+.btn-group-vertical > .btn-group > .btn {
+ float: none; }
+
+.btn-group-vertical > .btn + .btn, .btn-group-vertical > .btn + .btn-group, .btn-group-vertical > .btn-group + .btn, .btn-group-vertical > .btn-group + .btn-group {
+ margin-top: -1px;
+ margin-left: 0; }
+
+.btn-group-vertical > .btn:not(:first-child):not(:last-child) {
+ border-radius: 0; }
+
+.btn-group-vertical > .btn:first-child:not(:last-child) {
+ border-top-right-radius: 4px;
+ border-bottom-right-radius: 0;
+ border-bottom-left-radius: 0; }
+
+.btn-group-vertical > .btn:last-child:not(:first-child) {
+ border-top-left-radius: 0;
+ border-top-right-radius: 0;
+ border-bottom-left-radius: 4px; }
+
+.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn {
+ border-radius: 0; }
+
+.btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child, .btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle {
+ border-bottom-right-radius: 0;
+ border-bottom-left-radius: 0; }
+
+.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child {
+ border-top-left-radius: 0;
+ border-top-right-radius: 0; }
+
+.btn-group-justified {
+ display: table;
+ width: 100%;
+ table-layout: fixed;
+ border-collapse: separate; }
+
+.btn-group-justified > .btn, .btn-group-justified > .btn-group {
+ display: table-cell;
+ float: none;
+ width: 1%; }
+
+.btn-group-justified > .btn-group .btn {
+ width: 100%; }
+
+.btn-group-justified > .btn-group .dropdown-menu {
+ left: auto; }
+
+[data-toggle=buttons] > .btn input[type=checkbox], [data-toggle=buttons] > .btn input[type=radio], [data-toggle=buttons] > .btn-group > .btn input[type=checkbox], [data-toggle=buttons] > .btn-group > .btn input[type=radio] {
+ position: absolute;
+ clip: rect(0, 0, 0, 0);
+ pointer-events: none; }
+
+.input-group {
+ position: relative;
+ display: table;
+ border-collapse: separate; }
+
+.input-group[class*=col-] {
+ float: none;
+ padding-right: 0;
+ padding-left: 0; }
+
+.input-group .form-control {
+ position: relative;
+ z-index: 2;
+ float: left;
+ width: 100%;
+ margin-bottom: 0; }
+
+.input-group-lg > .form-control, .input-group-lg > .input-group-addon, .input-group-lg > .input-group-btn > .btn {
+ height: 46px;
+ padding: 10px 16px;
+ font-size: 18px;
+ line-height: 1.3333333;
+ border-radius: 6px; }
+
+select.input-group-lg > .form-control, select.input-group-lg > .input-group-addon, select.input-group-lg > .input-group-btn > .btn {
+ height: 46px;
+ line-height: 46px; }
+
+select[multiple].input-group-lg > .form-control, select[multiple].input-group-lg > .input-group-addon, select[multiple].input-group-lg > .input-group-btn > .btn, textarea.input-group-lg > .form-control, textarea.input-group-lg > .input-group-addon, textarea.input-group-lg > .input-group-btn > .btn {
+ height: auto; }
+
+.input-group-sm > .form-control, .input-group-sm > .input-group-addon, .input-group-sm > .input-group-btn > .btn {
+ height: 30px;
+ padding: 5px 10px;
+ font-size: 12px;
+ line-height: 1.5;
+ border-radius: 3px; }
+
+select.input-group-sm > .form-control, select.input-group-sm > .input-group-addon, select.input-group-sm > .input-group-btn > .btn {
+ height: 30px;
+ line-height: 30px; }
+
+select[multiple].input-group-sm > .form-control, select[multiple].input-group-sm > .input-group-addon, select[multiple].input-group-sm > .input-group-btn > .btn, textarea.input-group-sm > .form-control, textarea.input-group-sm > .input-group-addon, textarea.input-group-sm > .input-group-btn > .btn {
+ height: auto; }
+
+.input-group .form-control, .input-group-addon, .input-group-btn {
+ display: table-cell; }
+
+.input-group .form-control:not(:first-child):not(:last-child), .input-group-addon:not(:first-child):not(:last-child), .input-group-btn:not(:first-child):not(:last-child) {
+ border-radius: 0; }
+
+.input-group-addon, .input-group-btn {
+ width: 1%;
+ white-space: nowrap;
+ vertical-align: middle; }
+
+.input-group-addon {
+ padding: 6px 12px;
+ font-size: 14px;
+ font-weight: 400;
+ line-height: 1;
+ color: #555;
+ text-align: center;
+ background-color: #eee;
+ border: 1px solid #ccc;
+ border-radius: 4px; }
+
+.input-group-addon.input-sm {
+ padding: 5px 10px;
+ font-size: 12px;
+ border-radius: 3px; }
+
+.input-group-addon.input-lg {
+ padding: 10px 16px;
+ font-size: 18px;
+ border-radius: 6px; }
+
+.input-group-addon input[type=checkbox], .input-group-addon input[type=radio] {
+ margin-top: 0; }
+
+.input-group .form-control:first-child, .input-group-addon:first-child, .input-group-btn:first-child > .btn, .input-group-btn:first-child > .btn-group > .btn, .input-group-btn:first-child > .dropdown-toggle, .input-group-btn:last-child > .btn-group:not(:last-child) > .btn, .input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle) {
+ border-top-right-radius: 0;
+ border-bottom-right-radius: 0; }
+
+.input-group-addon:first-child {
+ border-right: 0; }
+
+.input-group .form-control:last-child, .input-group-addon:last-child, .input-group-btn:first-child > .btn-group:not(:first-child) > .btn, .input-group-btn:first-child > .btn:not(:first-child), .input-group-btn:last-child > .btn, .input-group-btn:last-child > .btn-group > .btn, .input-group-btn:last-child > .dropdown-toggle {
+ border-top-left-radius: 0;
+ border-bottom-left-radius: 0; }
+
+.input-group-addon:last-child {
+ border-left: 0; }
+
+.input-group-btn {
+ position: relative;
+ font-size: 0;
+ white-space: nowrap; }
+
+.input-group-btn > .btn {
+ position: relative; }
+
+.input-group-btn > .btn + .btn {
+ margin-left: -1px; }
+
+.input-group-btn > .btn:active, .input-group-btn > .btn:focus, .input-group-btn > .btn:hover {
+ z-index: 2; }
+
+.input-group-btn:first-child > .btn, .input-group-btn:first-child > .btn-group {
+ margin-right: -1px; }
+
+.input-group-btn:last-child > .btn, .input-group-btn:last-child > .btn-group {
+ margin-left: -1px; }
+
+.nav {
+ padding-left: 0;
+ margin-bottom: 0;
+ list-style: none; }
+
+.nav > li {
+ position: relative;
+ display: block; }
+
+.nav > li > a {
+ position: relative;
+ display: block;
+ padding: 10px 15px; }
+
+.nav > li > a:focus, .nav > li > a:hover {
+ text-decoration: none;
+ background-color: #eee; }
+
+.nav > li.disabled > a {
+ color: #777; }
+
+.nav > li.disabled > a:focus, .nav > li.disabled > a:hover {
+ color: #777;
+ text-decoration: none;
+ cursor: not-allowed;
+ background-color: transparent; }
+
+.nav .open > a, .nav .open > a:focus, .nav .open > a:hover {
+ background-color: #eee;
+ border-color: #337ab7; }
+
+.nav .nav-divider {
+ height: 1px;
+ margin: 9px 0;
+ overflow: hidden;
+ background-color: #e5e5e5; }
+
+.nav > li > a > img {
+ max-width: none; }
+
+.nav-tabs {
+ border-bottom: 1px solid #ddd; }
+
+.nav-tabs > li {
+ float: left;
+ margin-bottom: -1px; }
+
+.nav-tabs > li > a {
+ margin-right: 2px;
+ line-height: 1.42857143;
+ border: 1px solid transparent;
+ border-radius: 4px 4px 0 0; }
+
+.nav-tabs > li > a:hover {
+ border-color: #eee #eee #ddd; }
+
+.nav-tabs > li.active > a, .nav-tabs > li.active > a:focus, .nav-tabs > li.active > a:hover {
+ color: #555;
+ cursor: default;
+ background-color: #fff;
+ border: 1px solid #ddd;
+ border-bottom-color: transparent; }
+
+.nav-tabs.nav-justified {
+ width: 100%;
+ border-bottom: 0; }
+
+.nav-tabs.nav-justified > li {
+ float: none; }
+
+.nav-tabs.nav-justified > li > a {
+ margin-bottom: 5px;
+ text-align: center; }
+
+.nav-tabs.nav-justified > .dropdown .dropdown-menu {
+ top: auto;
+ left: auto; }
+
+@media (min-width: 768px) {
+ .nav-tabs.nav-justified > li {
+ display: table-cell;
+ width: 1%; }
+ .nav-tabs.nav-justified > li > a {
+ margin-bottom: 0; } }
+
+.nav-tabs.nav-justified > li > a {
+ margin-right: 0;
+ border-radius: 4px; }
+
+.nav-tabs.nav-justified > .active > a, .nav-tabs.nav-justified > .active > a:focus, .nav-tabs.nav-justified > .active > a:hover {
+ border: 1px solid #ddd; }
+
+@media (min-width: 768px) {
+ .nav-tabs.nav-justified > li > a {
+ border-bottom: 1px solid #ddd;
+ border-radius: 4px 4px 0 0; }
+ .nav-tabs.nav-justified > .active > a, .nav-tabs.nav-justified > .active > a:focus, .nav-tabs.nav-justified > .active > a:hover {
+ border-bottom-color: #fff; } }
+
+.nav-pills > li {
+ float: left; }
+
+.nav-pills > li > a {
+ border-radius: 4px; }
+
+.nav-pills > li + li {
+ margin-left: 2px; }
+
+.nav-pills > li.active > a, .nav-pills > li.active > a:focus, .nav-pills > li.active > a:hover {
+ color: #fff;
+ background-color: #337ab7; }
+
+.nav-stacked > li {
+ float: none; }
+
+.nav-stacked > li + li {
+ margin-top: 2px;
+ margin-left: 0; }
+
+.nav-justified {
+ width: 100%; }
+
+.nav-justified > li {
+ float: none; }
+
+.nav-justified > li > a {
+ margin-bottom: 5px;
+ text-align: center; }
+
+.nav-justified > .dropdown .dropdown-menu {
+ top: auto;
+ left: auto; }
+
+@media (min-width: 768px) {
+ .nav-justified > li {
+ display: table-cell;
+ width: 1%; }
+ .nav-justified > li > a {
+ margin-bottom: 0; } }
+
+.nav-tabs-justified {
+ border-bottom: 0; }
+
+.nav-tabs-justified > li > a {
+ margin-right: 0;
+ border-radius: 4px; }
+
+.nav-tabs-justified > .active > a, .nav-tabs-justified > .active > a:focus, .nav-tabs-justified > .active > a:hover {
+ border: 1px solid #ddd; }
+
+@media (min-width: 768px) {
+ .nav-tabs-justified > li > a {
+ border-bottom: 1px solid #ddd;
+ border-radius: 4px 4px 0 0; }
+ .nav-tabs-justified > .active > a, .nav-tabs-justified > .active > a:focus, .nav-tabs-justified > .active > a:hover {
+ border-bottom-color: #fff; } }
+
+.tab-content > .tab-pane {
+ display: none;
+ visibility: hidden; }
+
+.tab-content > .active {
+ display: block;
+ visibility: visible; }
+
+.nav-tabs .dropdown-menu {
+ margin-top: -1px;
+ border-top-left-radius: 0;
+ border-top-right-radius: 0; }
+
+.navbar {
+ position: relative;
+ min-height: 50px;
+ margin-bottom: 20px;
+ border: 1px solid transparent; }
+
+@media (min-width: 768px) {
+ .navbar {
+ border-radius: 4px; } }
+
+@media (min-width: 768px) {
+ .navbar-header {
+ float: left; } }
+
+.navbar-collapse {
+ padding-right: 15px;
+ padding-left: 15px;
+ overflow-x: visible;
+ -webkit-overflow-scrolling: touch;
+ border-top: 1px solid transparent;
+ -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); }
+
+.navbar-collapse.in {
+ overflow-y: auto; }
+
+@media (min-width: 768px) {
+ .navbar-collapse {
+ width: auto;
+ border-top: 0;
+ -webkit-box-shadow: none;
+ box-shadow: none; }
+ .navbar-collapse.collapse {
+ display: block !important;
+ height: auto !important;
+ padding-bottom: 0;
+ overflow: visible !important;
+ visibility: visible !important; }
+ .navbar-collapse.in {
+ overflow-y: visible; }
+ .navbar-fixed-bottom .navbar-collapse, .navbar-fixed-top .navbar-collapse, .navbar-static-top .navbar-collapse {
+ padding-right: 0;
+ padding-left: 0; } }
+
+.navbar-fixed-bottom .navbar-collapse, .navbar-fixed-top .navbar-collapse {
+ max-height: 340px; }
+
+@media (max-device-width: 480px) and (orientation: landscape) {
+ .navbar-fixed-bottom .navbar-collapse, .navbar-fixed-top .navbar-collapse {
+ max-height: 200px; } }
+
+.container-fluid > .navbar-collapse, .container-fluid > .navbar-header, .container > .navbar-collapse, .container > .navbar-header {
+ margin-right: -15px;
+ margin-left: -15px; }
+
+@media (min-width: 768px) {
+ .container-fluid > .navbar-collapse, .container-fluid > .navbar-header, .container > .navbar-collapse, .container > .navbar-header {
+ margin-right: 0;
+ margin-left: 0; } }
+
+.navbar-static-top {
+ z-index: 1000;
+ border-width: 0 0 1px; }
+
+@media (min-width: 768px) {
+ .navbar-static-top {
+ border-radius: 0; } }
+
+.navbar-fixed-bottom, .navbar-fixed-top {
+ position: fixed;
+ right: 0;
+ left: 0;
+ z-index: 1030; }
+
+@media (min-width: 768px) {
+ .navbar-fixed-bottom, .navbar-fixed-top {
+ border-radius: 0; } }
+
+.navbar-fixed-top {
+ top: 0;
+ border-width: 0 0 1px; }
+
+.navbar-fixed-bottom {
+ bottom: 0;
+ margin-bottom: 0;
+ border-width: 1px 0 0; }
+
+.navbar-brand {
+ float: left;
+ height: 50px;
+ padding: 15px 15px;
+ font-size: 18px;
+ line-height: 20px; }
+
+.navbar-brand:focus, .navbar-brand:hover {
+ text-decoration: none; }
+
+.navbar-brand > img {
+ display: block; }
+
+@media (min-width: 768px) {
+ .navbar > .container .navbar-brand, .navbar > .container-fluid .navbar-brand {
+ margin-left: -15px; } }
+
+.navbar-toggle {
+ position: relative;
+ float: right;
+ padding: 9px 10px;
+ margin-top: 8px;
+ margin-right: 15px;
+ margin-bottom: 8px;
+ background-color: transparent;
+ background-image: none;
+ border: 1px solid transparent;
+ border-radius: 4px; }
+
+.navbar-toggle:focus {
+ outline: 0; }
+
+.navbar-toggle .icon-bar {
+ display: block;
+ width: 22px;
+ height: 2px;
+ border-radius: 1px; }
+
+.navbar-toggle .icon-bar + .icon-bar {
+ margin-top: 4px; }
+
+@media (min-width: 768px) {
+ .navbar-toggle {
+ display: none; } }
+
+.navbar-nav {
+ margin: 7.5px -15px; }
+
+.navbar-nav > li > a {
+ padding-top: 10px;
+ padding-bottom: 10px;
+ line-height: 20px; }
+
+@media (max-width: 767px) {
+ .navbar-nav .open .dropdown-menu {
+ position: static;
+ float: none;
+ width: auto;
+ margin-top: 0;
+ background-color: transparent;
+ border: 0;
+ -webkit-box-shadow: none;
+ box-shadow: none; }
+ .navbar-nav .open .dropdown-menu .dropdown-header, .navbar-nav .open .dropdown-menu > li > a {
+ padding: 5px 15px 5px 25px; }
+ .navbar-nav .open .dropdown-menu > li > a {
+ line-height: 20px; }
+ .navbar-nav .open .dropdown-menu > li > a:focus, .navbar-nav .open .dropdown-menu > li > a:hover {
+ background-image: none; } }
+
+@media (min-width: 768px) {
+ .navbar-nav {
+ float: left;
+ margin: 0; }
+ .navbar-nav > li {
+ float: left; }
+ .navbar-nav > li > a {
+ padding-top: 15px;
+ padding-bottom: 15px; } }
+
+.navbar-form {
+ padding: 10px 15px;
+ margin-top: 8px;
+ margin-right: -15px;
+ margin-bottom: 8px;
+ margin-left: -15px;
+ border-top: 1px solid transparent;
+ border-bottom: 1px solid transparent;
+ -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); }
+
+@media (min-width: 768px) {
+ .navbar-form .form-group {
+ display: inline-block;
+ margin-bottom: 0;
+ vertical-align: middle; }
+ .navbar-form .form-control {
+ display: inline-block;
+ width: auto;
+ vertical-align: middle; }
+ .navbar-form .form-control-static {
+ display: inline-block; }
+ .navbar-form .input-group {
+ display: inline-table;
+ vertical-align: middle; }
+ .navbar-form .input-group .form-control, .navbar-form .input-group .input-group-addon, .navbar-form .input-group .input-group-btn {
+ width: auto; }
+ .navbar-form .input-group > .form-control {
+ width: 100%; }
+ .navbar-form .control-label {
+ margin-bottom: 0;
+ vertical-align: middle; }
+ .navbar-form .checkbox, .navbar-form .radio {
+ display: inline-block;
+ margin-top: 0;
+ margin-bottom: 0;
+ vertical-align: middle; }
+ .navbar-form .checkbox label, .navbar-form .radio label {
+ padding-left: 0; }
+ .navbar-form .checkbox input[type=checkbox], .navbar-form .radio input[type=radio] {
+ position: relative;
+ margin-left: 0; }
+ .navbar-form .has-feedback .form-control-feedback {
+ top: 0; } }
+
+@media (max-width: 767px) {
+ .navbar-form .form-group {
+ margin-bottom: 5px; }
+ .navbar-form .form-group:last-child {
+ margin-bottom: 0; } }
+
+@media (min-width: 768px) {
+ .navbar-form {
+ width: auto;
+ padding-top: 0;
+ padding-bottom: 0;
+ margin-right: 0;
+ margin-left: 0;
+ border: 0;
+ -webkit-box-shadow: none;
+ box-shadow: none; } }
+
+.navbar-nav > li > .dropdown-menu {
+ margin-top: 0;
+ border-top-left-radius: 0;
+ border-top-right-radius: 0; }
+
+.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {
+ margin-bottom: 0;
+ border-top-left-radius: 4px;
+ border-top-right-radius: 4px;
+ border-bottom-right-radius: 0;
+ border-bottom-left-radius: 0; }
+
+.navbar-btn {
+ margin-top: 8px;
+ margin-bottom: 8px; }
+
+.navbar-btn.btn-sm {
+ margin-top: 10px;
+ margin-bottom: 10px; }
+
+.navbar-btn.btn-xs {
+ margin-top: 14px;
+ margin-bottom: 14px; }
+
+.navbar-text {
+ margin-top: 15px;
+ margin-bottom: 15px; }
+
+@media (min-width: 768px) {
+ .navbar-text {
+ float: left;
+ margin-right: 15px;
+ margin-left: 15px; } }
+
+@media (min-width: 768px) {
+ .navbar-left {
+ float: left !important; }
+ .navbar-right {
+ float: right !important;
+ margin-right: -15px; }
+ .navbar-right ~ .navbar-right {
+ margin-right: 0; } }
+
+.navbar-default {
+ background-color: #f8f8f8;
+ border-color: #e7e7e7; }
+
+.navbar-default .navbar-brand {
+ color: #777; }
+
+.navbar-default .navbar-brand:focus, .navbar-default .navbar-brand:hover {
+ color: #5e5e5e;
+ background-color: transparent; }
+
+.navbar-default .navbar-text {
+ color: #777; }
+
+.navbar-default .navbar-nav > li > a {
+ color: #777; }
+
+.navbar-default .navbar-nav > li > a:focus, .navbar-default .navbar-nav > li > a:hover {
+ color: #333;
+ background-color: transparent; }
+
+.navbar-default .navbar-nav > .active > a, .navbar-default .navbar-nav > .active > a:focus, .navbar-default .navbar-nav > .active > a:hover {
+ color: #555;
+ background-color: #e7e7e7; }
+
+.navbar-default .navbar-nav > .disabled > a, .navbar-default .navbar-nav > .disabled > a:focus, .navbar-default .navbar-nav > .disabled > a:hover {
+ color: #ccc;
+ background-color: transparent; }
+
+.navbar-default .navbar-toggle {
+ border-color: #ddd; }
+
+.navbar-default .navbar-toggle:focus, .navbar-default .navbar-toggle:hover {
+ background-color: #ddd; }
+
+.navbar-default .navbar-toggle .icon-bar {
+ background-color: #888; }
+
+.navbar-default .navbar-collapse, .navbar-default .navbar-form {
+ border-color: #e7e7e7; }
+
+.navbar-default .navbar-nav > .open > a, .navbar-default .navbar-nav > .open > a:focus, .navbar-default .navbar-nav > .open > a:hover {
+ color: #555;
+ background-color: #e7e7e7; }
+
+@media (max-width: 767px) {
+ .navbar-default .navbar-nav .open .dropdown-menu > li > a {
+ color: #777; }
+ .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus, .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover {
+ color: #333;
+ background-color: transparent; }
+ .navbar-default .navbar-nav .open .dropdown-menu > .active > a, .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus, .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover {
+ color: #555;
+ background-color: #e7e7e7; }
+ .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a, .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus, .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover {
+ color: #ccc;
+ background-color: transparent; } }
+
+.navbar-default .navbar-link {
+ color: #777; }
+
+.navbar-default .navbar-link:hover {
+ color: #333; }
+
+.navbar-default .btn-link {
+ color: #777; }
+
+.navbar-default .btn-link:focus, .navbar-default .btn-link:hover {
+ color: #333; }
+
+.navbar-default .btn-link[disabled]:focus, .navbar-default .btn-link[disabled]:hover, fieldset[disabled] .navbar-default .btn-link:focus, fieldset[disabled] .navbar-default .btn-link:hover {
+ color: #ccc; }
+
+.navbar-inverse {
+ background-color: #222;
+ border-color: #080808; }
+
+.navbar-inverse .navbar-brand {
+ color: #9d9d9d; }
+
+.navbar-inverse .navbar-brand:focus, .navbar-inverse .navbar-brand:hover {
+ color: #fff;
+ background-color: transparent; }
+
+.navbar-inverse .navbar-text {
+ color: #9d9d9d; }
+
+.navbar-inverse .navbar-nav > li > a {
+ color: #9d9d9d; }
+
+.navbar-inverse .navbar-nav > li > a:focus, .navbar-inverse .navbar-nav > li > a:hover {
+ color: #fff;
+ background-color: transparent; }
+
+.navbar-inverse .navbar-nav > .active > a, .navbar-inverse .navbar-nav > .active > a:focus, .navbar-inverse .navbar-nav > .active > a:hover {
+ color: #fff;
+ background-color: #080808; }
+
+.navbar-inverse .navbar-nav > .disabled > a, .navbar-inverse .navbar-nav > .disabled > a:focus, .navbar-inverse .navbar-nav > .disabled > a:hover {
+ color: #444;
+ background-color: transparent; }
+
+.navbar-inverse .navbar-toggle {
+ border-color: #333; }
+
+.navbar-inverse .navbar-toggle:focus, .navbar-inverse .navbar-toggle:hover {
+ background-color: #333; }
+
+.navbar-inverse .navbar-toggle .icon-bar {
+ background-color: #fff; }
+
+.navbar-inverse .navbar-collapse, .navbar-inverse .navbar-form {
+ border-color: #101010; }
+
+.navbar-inverse .navbar-nav > .open > a, .navbar-inverse .navbar-nav > .open > a:focus, .navbar-inverse .navbar-nav > .open > a:hover {
+ color: #fff;
+ background-color: #080808; }
+
+@media (max-width: 767px) {
+ .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header {
+ border-color: #080808; }
+ .navbar-inverse .navbar-nav .open .dropdown-menu .divider {
+ background-color: #080808; }
+ .navbar-inverse .navbar-nav .open .dropdown-menu > li > a {
+ color: #9d9d9d; }
+ .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus, .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover {
+ color: #fff;
+ background-color: transparent; }
+ .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a, .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus, .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover {
+ color: #fff;
+ background-color: #080808; }
+ .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a, .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus, .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover {
+ color: #444;
+ background-color: transparent; } }
+
+.navbar-inverse .navbar-link {
+ color: #9d9d9d; }
+
+.navbar-inverse .navbar-link:hover {
+ color: #fff; }
+
+.navbar-inverse .btn-link {
+ color: #9d9d9d; }
+
+.navbar-inverse .btn-link:focus, .navbar-inverse .btn-link:hover {
+ color: #fff; }
+
+.navbar-inverse .btn-link[disabled]:focus, .navbar-inverse .btn-link[disabled]:hover, fieldset[disabled] .navbar-inverse .btn-link:focus, fieldset[disabled] .navbar-inverse .btn-link:hover {
+ color: #444; }
+
+.breadcrumb {
+ padding: 8px 15px;
+ margin-bottom: 20px;
+ list-style: none;
+ background-color: #f5f5f5;
+ border-radius: 4px; }
+
+.breadcrumb > li {
+ display: inline-block; }
+
+.breadcrumb > li + li:before {
+ padding: 0 5px;
+ color: #ccc;
+ content: "/\00a0"; }
+
+.breadcrumb > .active {
+ color: #777; }
+
+.pagination {
+ display: inline-block;
+ padding-left: 0;
+ margin: 20px 0;
+ border-radius: 4px; }
+
+.pagination > li {
+ display: inline; }
+
+.pagination > li > a, .pagination > li > span {
+ position: relative;
+ float: left;
+ padding: 6px 12px;
+ margin-left: -1px;
+ line-height: 1.42857143;
+ text-decoration: none; }
+
+.pagination > li:first-child > a, .pagination > li:first-child > span {
+ margin-left: 0;
+ border-top-left-radius: 4px;
+ border-bottom-left-radius: 4px; }
+
+.pagination > li:last-child > a, .pagination > li:last-child > span {
+ border-top-right-radius: 4px;
+ border-bottom-right-radius: 4px; }
+
+.pagination > .active > a, .pagination > .active > a:focus, .pagination > .active > a:hover, .pagination > .active > span, .pagination > .active > span:focus, .pagination > .active > span:hover {
+ z-index: 2;
+ cursor: default; }
+
+.pagination > .disabled > a, .pagination > .disabled > a:focus, .pagination > .disabled > a:hover, .pagination > .disabled > span, .pagination > .disabled > span:focus, .pagination > .disabled > span:hover {
+ cursor: not-allowed; }
+
+.pagination-lg > li > a, .pagination-lg > li > span {
+ padding: 10px 16px;
+ font-size: 18px; }
+
+.pagination-lg > li:first-child > a, .pagination-lg > li:first-child > span {
+ border-top-left-radius: 6px;
+ border-bottom-left-radius: 6px; }
+
+.pagination-lg > li:last-child > a, .pagination-lg > li:last-child > span {
+ border-top-right-radius: 6px;
+ border-bottom-right-radius: 6px; }
+
+.pagination-sm > li > a, .pagination-sm > li > span {
+ padding: 5px 10px;
+ font-size: 12px; }
+
+.pagination-sm > li:first-child > a, .pagination-sm > li:first-child > span {
+ border-top-left-radius: 3px;
+ border-bottom-left-radius: 3px; }
+
+.pagination-sm > li:last-child > a, .pagination-sm > li:last-child > span {
+ border-top-right-radius: 3px;
+ border-bottom-right-radius: 3px; }
+
+.pager {
+ padding-left: 0;
+ margin: 20px 0;
+ text-align: center;
+ list-style: none; }
+
+.pager li {
+ display: inline; }
+
+.pager li > a, .pager li > span {
+ display: inline-block;
+ padding: 5px 14px;
+ background-color: #fff;
+ border: 1px solid #ddd;
+ border-radius: 15px; }
+
+.pager li > a:focus, .pager li > a:hover {
+ text-decoration: none;
+ background-color: #eee; }
+
+.pager .next > a, .pager .next > span {
+ float: right; }
+
+.pager .previous > a, .pager .previous > span {
+ float: left; }
+
+.pager .disabled > a, .pager .disabled > a:focus, .pager .disabled > a:hover, .pager .disabled > span {
+ color: #777;
+ cursor: not-allowed;
+ background-color: #fff; }
+
+.label {
+ display: inline;
+ /* padding: .2em .6em .3em; */
+ font-size: 75%;
+ /* font-weight: 700;*/
+ line-height: 1;
+ /* color: #fff;*/
+ text-align: center;
+ white-space: nowrap;
+ vertical-align: baseline;
+ border-radius: .25em; }
+
+a.label:focus, a.label:hover {
+ color: #fff;
+ text-decoration: none;
+ cursor: pointer; }
+
+.label:empty {
+ display: none; }
+
+.btn .label {
+ position: relative;
+ top: -1px; }
+
+.label-default {
+ background-color: #777; }
+
+.label-default[href]:focus, .label-default[href]:hover {
+ background-color: #5e5e5e; }
+
+.label-primary {
+ background-color: #337ab7; }
+
+.label-primary[href]:focus, .label-primary[href]:hover {
+ background-color: #286090; }
+
+.label-success {
+ background-color: #5cb85c; }
+
+.label-success[href]:focus, .label-success[href]:hover {
+ background-color: #449d44; }
+
+.label-info {
+ background-color: #5bc0de; }
+
+.label-info[href]:focus, .label-info[href]:hover {
+ background-color: #31b0d5; }
+
+.label-warning {
+ background-color: #f0ad4e; }
+
+.label-warning[href]:focus, .label-warning[href]:hover {
+ background-color: #ec971f; }
+
+.label-danger {
+ background-color: #d9534f; }
+
+.label-danger[href]:focus, .label-danger[href]:hover {
+ background-color: #c9302c; }
+
+.badge {
+ display: inline-block;
+ min-width: 10px;
+ padding: 3px 7px;
+ font-size: 12px;
+ font-weight: 700;
+ line-height: 1;
+ color: #fff;
+ text-align: center;
+ white-space: nowrap;
+ vertical-align: baseline;
+ background-color: #777;
+ border-radius: 10px; }
+
+.badge:empty {
+ display: none; }
+
+.btn .badge {
+ position: relative;
+ top: -1px; }
+
+.btn-xs .badge {
+ top: 0;
+ padding: 1px 5px; }
+
+a.badge:focus, a.badge:hover {
+ color: #fff;
+ text-decoration: none;
+ cursor: pointer; }
+
+.list-group-item.active > .badge, .nav-pills > .active > a > .badge {
+ color: #337ab7;
+ background-color: #fff; }
+
+.list-group-item > .badge {
+ float: right; }
+
+.list-group-item > .badge + .badge {
+ margin-right: 5px; }
+
+.nav-pills > li > a > .badge {
+ margin-left: 3px; }
+
+.jumbotron {
+ padding: 30px 15px;
+ margin-bottom: 30px;
+ color: inherit;
+ background-color: #eee; }
+
+.jumbotron .h1, .jumbotron h1 {
+ color: inherit; }
+
+.jumbotron p {
+ margin-bottom: 15px;
+ font-size: 21px;
+ font-weight: 200; }
+
+.jumbotron > hr {
+ border-top-color: #d5d5d5; }
+
+.container .jumbotron, .container-fluid .jumbotron {
+ border-radius: 6px; }
+
+.jumbotron .container {
+ max-width: 100%; }
+
+@media screen and (min-width: 768px) {
+ .jumbotron {
+ padding: 48px 0; }
+ .container .jumbotron, .container-fluid .jumbotron {
+ padding-right: 60px;
+ padding-left: 60px; }
+ .jumbotron .h1, .jumbotron h1 {
+ font-size: 63px; } }
+
+.thumbnail {
+ display: block;
+ padding: 4px;
+ margin-bottom: 20px;
+ line-height: 1.42857143;
+ background-color: #fff;
+ border: 1px solid #ddd;
+ border-radius: 4px;
+ -webkit-transition: border 0.2s ease-in-out;
+ -o-transition: border 0.2s ease-in-out;
+ transition: border 0.2s ease-in-out; }
+
+.thumbnail a > img, .thumbnail > img {
+ margin-right: auto;
+ margin-left: auto; }
+
+a.thumbnail.active, a.thumbnail:focus, a.thumbnail:hover {
+ border-color: #337ab7; }
+
+.thumbnail .caption {
+ padding: 9px;
+ color: #333; }
+
+.alert {
+ padding: 15px;
+ margin-bottom: 20px;
+ border: 1px solid transparent;
+ border-radius: 4px; }
+
+.alert h4 {
+ margin-top: 0;
+ color: inherit; }
+
+.alert .alert-link {
+ font-weight: 700; }
+
+.alert > p, .alert > ul {
+ margin-bottom: 0; }
+
+.alert > p + p {
+ margin-top: 5px; }
+
+.alert-dismissable, .alert-dismissible {
+ padding-right: 35px; }
+
+.alert-dismissable .close, .alert-dismissible .close {
+ position: relative;
+ top: -2px;
+ right: -21px;
+ color: inherit; }
+
+.alert-success {
+ color: #3c763d;
+ background-color: #dff0d8;
+ border-color: #d6e9c6; }
+
+.alert-success hr {
+ border-top-color: #c9e2b3; }
+
+.alert-success .alert-link {
+ color: #2b542c; }
+
+.alert-info {
+ color: #31708f;
+ background-color: #d9edf7;
+ border-color: #bce8f1; }
+
+.alert-info hr {
+ border-top-color: #a6e1ec; }
+
+.alert-info .alert-link {
+ color: #245269; }
+
+.alert-warning {
+ color: #8a6d3b;
+ background-color: #fcf8e3;
+ border-color: #faebcc; }
+
+.alert-warning hr {
+ border-top-color: #f7e1b5; }
+
+.alert-warning .alert-link {
+ color: #66512c; }
+
+.alert-danger {
+ color: #a94442;
+ background-color: #f2dede;
+ border-color: #ebccd1; }
+
+.alert-danger hr {
+ border-top-color: #e4b9c0; }
+
+.alert-danger .alert-link {
+ color: #843534; }
+
+@-webkit-keyframes progress-bar-stripes {
+ from {
+ background-position: 40px 0; }
+ to {
+ background-position: 0 0; } }
+
+@-o-keyframes progress-bar-stripes {
+ from {
+ background-position: 40px 0; }
+ to {
+ background-position: 0 0; } }
+
+@keyframes progress-bar-stripes {
+ from {
+ background-position: 40px 0; }
+ to {
+ background-position: 0 0; } }
+
+.progress {
+ height: 20px;
+ margin-bottom: 20px;
+ overflow: hidden;
+ background-color: #f5f5f5;
+ border-radius: 4px;
+ -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
+ box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); }
+
+.progress-bar {
+ float: left;
+ width: 0;
+ height: 100%;
+ font-size: 12px;
+ line-height: 20px;
+ color: #fff;
+ text-align: center;
+ background-color: #337ab7;
+ -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
+ box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
+ -webkit-transition: width 0.6s ease;
+ -o-transition: width 0.6s ease;
+ transition: width 0.6s ease; }
+
+.progress-bar-striped, .progress-striped .progress-bar {
+ background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+ background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+ background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+ -webkit-background-size: 40px 40px;
+ background-size: 40px 40px; }
+
+.progress-bar.active, .progress.active .progress-bar {
+ -webkit-animation: progress-bar-stripes 2s linear infinite;
+ -o-animation: progress-bar-stripes 2s linear infinite;
+ animation: progress-bar-stripes 2s linear infinite; }
+
+.progress-bar-success {
+ background-color: #5cb85c; }
+
+.progress-striped .progress-bar-success {
+ background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+ background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+ background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); }
+
+.progress-bar-info {
+ background-color: #5bc0de; }
+
+.progress-striped .progress-bar-info {
+ background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+ background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+ background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); }
+
+.progress-bar-warning {
+ background-color: #f0ad4e; }
+
+.progress-striped .progress-bar-warning {
+ background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+ background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+ background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); }
+
+.progress-bar-danger {
+ background-color: #d9534f; }
+
+.progress-striped .progress-bar-danger {
+ background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+ background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+ background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); }
+
+.media {
+ margin-top: 15px; }
+
+.media:first-child {
+ margin-top: 0; }
+
+.media, .media-body {
+ overflow: hidden;
+ zoom: 1; }
+
+.media-body {
+ width: 10000px; }
+
+.media-object {
+ display: block; }
+
+.media-right, .media > .pull-right {
+ padding-left: 10px; }
+
+.media-left, .media > .pull-left {
+ padding-right: 10px; }
+
+.media-body, .media-left, .media-right {
+ display: table-cell;
+ vertical-align: top; }
+
+.media-middle {
+ vertical-align: middle; }
+
+.media-bottom {
+ vertical-align: bottom; }
+
+.media-heading {
+ margin-top: 0;
+ margin-bottom: 5px; }
+
+.media-list {
+ padding-left: 0;
+ list-style: none; }
+
+.list-group {
+ padding-left: 0;
+ margin-bottom: 20px; }
+
+.list-group-item {
+ position: relative;
+ display: block;
+ padding: 10px 15px;
+ margin-bottom: -1px;
+ background-color: #fff;
+ border: 1px solid #ddd; }
+
+.list-group-item:first-child {
+ border-top-left-radius: 4px;
+ border-top-right-radius: 4px; }
+
+.list-group-item:last-child {
+ margin-bottom: 0;
+ border-bottom-right-radius: 4px;
+ border-bottom-left-radius: 4px; }
+
+a.list-group-item {
+ color: #555; }
+
+a.list-group-item .list-group-item-heading {
+ color: #333; }
+
+a.list-group-item:focus, a.list-group-item:hover {
+ color: #555;
+ text-decoration: none;
+ background-color: #f5f5f5; }
+
+.list-group-item.disabled, .list-group-item.disabled:focus, .list-group-item.disabled:hover {
+ color: #777;
+ cursor: not-allowed;
+ background-color: #eee; }
+
+.list-group-item.disabled .list-group-item-heading, .list-group-item.disabled:focus .list-group-item-heading, .list-group-item.disabled:hover .list-group-item-heading {
+ color: inherit; }
+
+.list-group-item.disabled .list-group-item-text, .list-group-item.disabled:focus .list-group-item-text, .list-group-item.disabled:hover .list-group-item-text {
+ color: #777; }
+
+.list-group-item.active, .list-group-item.active:focus, .list-group-item.active:hover {
+ z-index: 2;
+ color: #fff;
+ background-color: #337ab7;
+ border-color: #337ab7; }
+
+.list-group-item.active .list-group-item-heading, .list-group-item.active .list-group-item-heading > .small, .list-group-item.active .list-group-item-heading > small, .list-group-item.active:focus .list-group-item-heading, .list-group-item.active:focus .list-group-item-heading > .small, .list-group-item.active:focus .list-group-item-heading > small, .list-group-item.active:hover .list-group-item-heading, .list-group-item.active:hover .list-group-item-heading > .small, .list-group-item.active:hover .list-group-item-heading > small {
+ color: inherit; }
+
+.list-group-item.active .list-group-item-text, .list-group-item.active:focus .list-group-item-text, .list-group-item.active:hover .list-group-item-text {
+ color: #c7ddef; }
+
+.list-group-item-success {
+ color: #3c763d;
+ background-color: #dff0d8; }
+
+a.list-group-item-success {
+ color: #3c763d; }
+
+a.list-group-item-success .list-group-item-heading {
+ color: inherit; }
+
+a.list-group-item-success:focus, a.list-group-item-success:hover {
+ color: #3c763d;
+ background-color: #d0e9c6; }
+
+a.list-group-item-success.active, a.list-group-item-success.active:focus, a.list-group-item-success.active:hover {
+ color: #fff;
+ background-color: #3c763d;
+ border-color: #3c763d; }
+
+.list-group-item-info {
+ color: #31708f;
+ background-color: #d9edf7; }
+
+a.list-group-item-info {
+ color: #31708f; }
+
+a.list-group-item-info .list-group-item-heading {
+ color: inherit; }
+
+a.list-group-item-info:focus, a.list-group-item-info:hover {
+ color: #31708f;
+ background-color: #c4e3f3; }
+
+a.list-group-item-info.active, a.list-group-item-info.active:focus, a.list-group-item-info.active:hover {
+ color: #fff;
+ background-color: #31708f;
+ border-color: #31708f; }
+
+.list-group-item-warning {
+ color: #8a6d3b;
+ background-color: #fcf8e3; }
+
+a.list-group-item-warning {
+ color: #8a6d3b; }
+
+a.list-group-item-warning .list-group-item-heading {
+ color: inherit; }
+
+a.list-group-item-warning:focus, a.list-group-item-warning:hover {
+ color: #8a6d3b;
+ background-color: #faf2cc; }
+
+a.list-group-item-warning.active, a.list-group-item-warning.active:focus, a.list-group-item-warning.active:hover {
+ color: #fff;
+ background-color: #8a6d3b;
+ border-color: #8a6d3b; }
+
+.list-group-item-danger {
+ color: #a94442;
+ background-color: #f2dede; }
+
+a.list-group-item-danger {
+ color: #a94442; }
+
+a.list-group-item-danger .list-group-item-heading {
+ color: inherit; }
+
+a.list-group-item-danger:focus, a.list-group-item-danger:hover {
+ color: #a94442;
+ background-color: #ebcccc; }
+
+a.list-group-item-danger.active, a.list-group-item-danger.active:focus, a.list-group-item-danger.active:hover {
+ color: #fff;
+ background-color: #a94442;
+ border-color: #a94442; }
+
+.list-group-item-heading {
+ margin-top: 0;
+ margin-bottom: 5px; }
+
+.list-group-item-text {
+ margin-bottom: 0;
+ line-height: 1.3; }
+
+.panel {
+ margin-bottom: 20px;
+ background-color: #fff;
+ border: 1px solid transparent;
+ border-radius: 4px;
+ -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); }
+
+.panel-body {
+ padding: 15px; }
+
+.panel-heading {
+ padding: 10px 15px;
+ border-bottom: 1px solid transparent;
+ border-top-left-radius: 3px;
+ border-top-right-radius: 3px; }
+
+.panel-heading > .dropdown .dropdown-toggle {
+ color: inherit; }
+
+.panel-title {
+ margin-top: 0;
+ margin-bottom: 0;
+ font-size: 16px;
+ color: inherit; }
+
+.panel-title > .small, .panel-title > .small > a, .panel-title > a, .panel-title > small, .panel-title > small > a {
+ color: inherit; }
+
+.panel-footer {
+ padding: 10px 15px;
+ background-color: #f5f5f5;
+ border-top: 1px solid #ddd;
+ border-bottom-right-radius: 3px;
+ border-bottom-left-radius: 3px; }
+
+.panel > .list-group, .panel > .panel-collapse > .list-group {
+ margin-bottom: 0; }
+
+.panel > .list-group .list-group-item, .panel > .panel-collapse > .list-group .list-group-item {
+ border-width: 1px 0;
+ border-radius: 0; }
+
+.panel > .list-group:first-child .list-group-item:first-child, .panel > .panel-collapse > .list-group:first-child .list-group-item:first-child {
+ border-top: 0;
+ border-top-left-radius: 3px;
+ border-top-right-radius: 3px; }
+
+.panel > .list-group:last-child .list-group-item:last-child, .panel > .panel-collapse > .list-group:last-child .list-group-item:last-child {
+ border-bottom: 0;
+ border-bottom-right-radius: 3px;
+ border-bottom-left-radius: 3px; }
+
+.panel-heading + .list-group .list-group-item:first-child {
+ border-top-width: 0; }
+
+.list-group + .panel-footer {
+ border-top-width: 0; }
+
+.panel > .panel-collapse > .table, .panel > .table, .panel > .table-responsive > .table {
+ margin-bottom: 0; }
+
+.panel > .panel-collapse > .table caption, .panel > .table caption, .panel > .table-responsive > .table caption {
+ padding-right: 15px;
+ padding-left: 15px; }
+
+.panel > .table-responsive:first-child > .table:first-child, .panel > .table:first-child {
+ border-top-left-radius: 3px;
+ border-top-right-radius: 3px; }
+
+.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child, .panel > .table:first-child > tbody:first-child > tr:first-child, .panel > .table:first-child > thead:first-child > tr:first-child {
+ border-top-left-radius: 3px;
+ border-top-right-radius: 3px; }
+
+.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child, .panel > .table:first-child > tbody:first-child > tr:first-child td:first-child, .panel > .table:first-child > tbody:first-child > tr:first-child th:first-child, .panel > .table:first-child > thead:first-child > tr:first-child td:first-child, .panel > .table:first-child > thead:first-child > tr:first-child th:first-child {
+ border-top-left-radius: 3px; }
+
+.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child, .panel > .table:first-child > tbody:first-child > tr:first-child td:last-child, .panel > .table:first-child > tbody:first-child > tr:first-child th:last-child, .panel > .table:first-child > thead:first-child > tr:first-child td:last-child, .panel > .table:first-child > thead:first-child > tr:first-child th:last-child {
+ border-top-right-radius: 3px; }
+
+.panel > .table-responsive:last-child > .table:last-child, .panel > .table:last-child {
+ border-bottom-right-radius: 3px;
+ border-bottom-left-radius: 3px; }
+
+.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child, .panel > .table:last-child > tbody:last-child > tr:last-child, .panel > .table:last-child > tfoot:last-child > tr:last-child {
+ border-bottom-right-radius: 3px;
+ border-bottom-left-radius: 3px; }
+
+.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child, .panel > .table:last-child > tbody:last-child > tr:last-child td:first-child, .panel > .table:last-child > tbody:last-child > tr:last-child th:first-child, .panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child, .panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child {
+ border-bottom-left-radius: 3px; }
+
+.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child, .panel > .table:last-child > tbody:last-child > tr:last-child td:last-child, .panel > .table:last-child > tbody:last-child > tr:last-child th:last-child, .panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child, .panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child {
+ border-bottom-right-radius: 3px; }
+
+.panel > .panel-body + .table, .panel > .panel-body + .table-responsive, .panel > .table + .panel-body, .panel > .table-responsive + .panel-body {
+ border-top: 1px solid #ddd; }
+
+.panel > .table > tbody:first-child > tr:first-child td, .panel > .table > tbody:first-child > tr:first-child th {
+ border-top: 0; }
+
+.panel > .table-bordered, .panel > .table-responsive > .table-bordered {
+ border: 0; }
+
+.panel > .table-bordered > tbody > tr > td:first-child, .panel > .table-bordered > tbody > tr > th:first-child, .panel > .table-bordered > tfoot > tr > td:first-child, .panel > .table-bordered > tfoot > tr > th:first-child, .panel > .table-bordered > thead > tr > td:first-child, .panel > .table-bordered > thead > tr > th:first-child, .panel > .table-responsive > .table-bordered > tbody > tr > td:first-child, .panel > .table-responsive > .table-bordered > tbody > tr > th:first-child, .panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child, .panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child, .panel > .table-responsive > .table-bordered > thead > tr > td:first-child, .panel > .table-responsive > .table-bordered > thead > tr > th:first-child {
+ border-left: 0; }
+
+.panel > .table-bordered > tbody > tr > td:last-child, .panel > .table-bordered > tbody > tr > th:last-child, .panel > .table-bordered > tfoot > tr > td:last-child, .panel > .table-bordered > tfoot > tr > th:last-child, .panel > .table-bordered > thead > tr > td:last-child, .panel > .table-bordered > thead > tr > th:last-child, .panel > .table-responsive > .table-bordered > tbody > tr > td:last-child, .panel > .table-responsive > .table-bordered > tbody > tr > th:last-child, .panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child, .panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child, .panel > .table-responsive > .table-bordered > thead > tr > td:last-child, .panel > .table-responsive > .table-bordered > thead > tr > th:last-child {
+ border-right: 0; }
+
+.panel > .table-bordered > tbody > tr:first-child > td, .panel > .table-bordered > tbody > tr:first-child > th, .panel > .table-bordered > thead > tr:first-child > td, .panel > .table-bordered > thead > tr:first-child > th, .panel > .table-responsive > .table-bordered > tbody > tr:first-child > td, .panel > .table-responsive > .table-bordered > tbody > tr:first-child > th, .panel > .table-responsive > .table-bordered > thead > tr:first-child > td, .panel > .table-responsive > .table-bordered > thead > tr:first-child > th {
+ border-bottom: 0; }
+
+.panel > .table-bordered > tbody > tr:last-child > td, .panel > .table-bordered > tbody > tr:last-child > th, .panel > .table-bordered > tfoot > tr:last-child > td, .panel > .table-bordered > tfoot > tr:last-child > th, .panel > .table-responsive > .table-bordered > tbody > tr:last-child > td, .panel > .table-responsive > .table-bordered > tbody > tr:last-child > th, .panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td, .panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th {
+ border-bottom: 0; }
+
+.panel > .table-responsive {
+ margin-bottom: 0;
+ border: 0; }
+
+.panel-group {
+ margin-bottom: 20px; }
+
+.panel-group .panel {
+ margin-bottom: 0;
+ border-radius: 4px; }
+
+.panel-group .panel + .panel {
+ margin-top: 5px; }
+
+.panel-group .panel-heading {
+ border-bottom: 0; }
+
+.panel-group .panel-heading + .panel-collapse > .list-group, .panel-group .panel-heading + .panel-collapse > .panel-body {
+ border-top: 1px solid #ddd; }
+
+.panel-group .panel-footer {
+ border-top: 0; }
+
+.panel-group .panel-footer + .panel-collapse .panel-body {
+ border-bottom: 1px solid #ddd; }
+
+.panel-default {
+ border-color: #ddd; }
+
+.panel-default > .panel-heading {
+ color: #333;
+ background-color: #f5f5f5;
+ border-color: #ddd; }
+
+.panel-default > .panel-heading + .panel-collapse > .panel-body {
+ border-top-color: #ddd; }
+
+.panel-default > .panel-heading .badge {
+ color: #f5f5f5;
+ background-color: #333; }
+
+.panel-default > .panel-footer + .panel-collapse > .panel-body {
+ border-bottom-color: #ddd; }
+
+.panel-primary {
+ border-color: #337ab7; }
+
+.panel-primary > .panel-heading {
+ color: #fff;
+ background-color: #337ab7;
+ border-color: #337ab7; }
+
+.panel-primary > .panel-heading + .panel-collapse > .panel-body {
+ border-top-color: #337ab7; }
+
+.panel-primary > .panel-heading .badge {
+ color: #337ab7;
+ background-color: #fff; }
+
+.panel-primary > .panel-footer + .panel-collapse > .panel-body {
+ border-bottom-color: #337ab7; }
+
+.panel-success {
+ border-color: #d6e9c6; }
+
+.panel-success > .panel-heading {
+ color: #3c763d;
+ background-color: #dff0d8;
+ border-color: #d6e9c6; }
+
+.panel-success > .panel-heading + .panel-collapse > .panel-body {
+ border-top-color: #d6e9c6; }
+
+.panel-success > .panel-heading .badge {
+ color: #dff0d8;
+ background-color: #3c763d; }
+
+.panel-success > .panel-footer + .panel-collapse > .panel-body {
+ border-bottom-color: #d6e9c6; }
+
+.panel-info {
+ border-color: #bce8f1; }
+
+.panel-info > .panel-heading {
+ color: #31708f;
+ background-color: #d9edf7;
+ border-color: #bce8f1; }
+
+.panel-info > .panel-heading + .panel-collapse > .panel-body {
+ border-top-color: #bce8f1; }
+
+.panel-info > .panel-heading .badge {
+ color: #d9edf7;
+ background-color: #31708f; }
+
+.panel-info > .panel-footer + .panel-collapse > .panel-body {
+ border-bottom-color: #bce8f1; }
+
+.panel-warning {
+ border-color: #faebcc; }
+
+.panel-warning > .panel-heading {
+ color: #8a6d3b;
+ background-color: #fcf8e3;
+ border-color: #faebcc; }
+
+.panel-warning > .panel-heading + .panel-collapse > .panel-body {
+ border-top-color: #faebcc; }
+
+.panel-warning > .panel-heading .badge {
+ color: #fcf8e3;
+ background-color: #8a6d3b; }
+
+.panel-warning > .panel-footer + .panel-collapse > .panel-body {
+ border-bottom-color: #faebcc; }
+
+.panel-danger {
+ border-color: #ebccd1; }
+
+.panel-danger > .panel-heading {
+ color: #a94442;
+ background-color: #f2dede;
+ border-color: #ebccd1; }
+
+.panel-danger > .panel-heading + .panel-collapse > .panel-body {
+ border-top-color: #ebccd1; }
+
+.panel-danger > .panel-heading .badge {
+ color: #f2dede;
+ background-color: #a94442; }
+
+.panel-danger > .panel-footer + .panel-collapse > .panel-body {
+ border-bottom-color: #ebccd1; }
+
+.embed-responsive {
+ position: relative;
+ display: block;
+ height: 0;
+ padding: 0;
+ overflow: hidden; }
+
+.embed-responsive .embed-responsive-item, .embed-responsive embed, .embed-responsive iframe, .embed-responsive object, .embed-responsive video {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ border: 0; }
+
+.embed-responsive.embed-responsive-16by9 {
+ padding-bottom: 56.25%; }
+
+.embed-responsive.embed-responsive-4by3 {
+ padding-bottom: 75%; }
+
+.well {
+ min-height: 20px;
+ padding: 19px;
+ margin-bottom: 20px;
+ background-color: #f5f5f5;
+ border: 1px solid #e3e3e3;
+ border-radius: 4px;
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); }
+
+.well blockquote {
+ border-color: #ddd;
+ border-color: rgba(0, 0, 0, 0.15); }
+
+.well-lg {
+ padding: 24px;
+ border-radius: 6px; }
+
+.well-sm {
+ padding: 9px;
+ border-radius: 3px; }
+
+.close {
+ float: right;
+ font-size: 21px;
+ font-weight: 700;
+ line-height: 1;
+ color: #000;
+ text-shadow: 0 1px 0 #fff;
+ filter: alpha(opacity=20);
+ opacity: .2; }
+
+.close:focus, .close:hover {
+ color: #000;
+ text-decoration: none;
+ cursor: pointer;
+ filter: alpha(opacity=50);
+ opacity: .5; }
+
+button.close {
+ -webkit-appearance: none;
+ padding: 0;
+ cursor: pointer;
+ background: 0 0;
+ border: 0; }
+
+.modal-open {
+ overflow: hidden; }
+
+.modal {
+ position: fixed;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ z-index: 1040;
+ display: none;
+ overflow: hidden;
+ -webkit-overflow-scrolling: touch;
+ outline: 0; }
+
+.modal.fade .modal-dialog {
+ -webkit-transition: -webkit-transform 0.3s ease-out;
+ -o-transition: -o-transform 0.3s ease-out;
+ transition: transform 0.3s ease-out;
+ -webkit-transform: translate(0, -25%);
+ -ms-transform: translate(0, -25%);
+ -o-transform: translate(0, -25%);
+ transform: translate(0, -25%); }
+
+.modal.in .modal-dialog {
+ -webkit-transform: translate(0, 0);
+ -ms-transform: translate(0, 0);
+ -o-transform: translate(0, 0);
+ transform: translate(0, 0); }
+
+.modal-open .modal {
+ overflow-x: hidden;
+ overflow-y: auto; }
+
+.modal-dialog {
+ position: relative;
+ width: auto;
+ margin: 10px; }
+
+.modal-content {
+ position: relative;
+ background-color: #fff;
+ -webkit-background-clip: padding-box;
+ background-clip: padding-box;
+ border: 1px solid #999;
+ border: 1px solid rgba(0, 0, 0, 0.2);
+ border-radius: 6px;
+ outline: 0;
+ -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
+ box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); }
+
+.modal-backdrop {
+ position: absolute;
+ top: 0;
+ right: 0;
+ left: 0;
+ background-color: #000; }
+
+.modal-backdrop.fade {
+ filter: alpha(opacity=0);
+ opacity: 0; }
+
+.modal-backdrop.in {
+ filter: alpha(opacity=50);
+ opacity: .5; }
+
+.modal-header {
+ min-height: 16.43px;
+ padding: 15px;
+ border-bottom: 1px solid #e5e5e5; }
+
+.modal-header .close {
+ margin-top: -2px; }
+
+.modal-title {
+ margin: 0;
+ line-height: 1.42857143; }
+
+.modal-body {
+ position: relative;
+ padding: 15px; }
+
+.modal-footer {
+ padding: 15px;
+ text-align: right;
+ border-top: 1px solid #e5e5e5; }
+
+.modal-footer .btn + .btn {
+ margin-bottom: 0;
+ margin-left: 5px; }
+
+.modal-footer .btn-group .btn + .btn {
+ margin-left: -1px; }
+
+.modal-footer .btn-block + .btn-block {
+ margin-left: 0; }
+
+.modal-scrollbar-measure {
+ position: absolute;
+ top: -9999px;
+ width: 50px;
+ height: 50px;
+ overflow: scroll; }
+
+@media (min-width: 768px) {
+ .modal-dialog {
+ width: 600px;
+ margin: 30px auto; }
+ .modal-content {
+ -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
+ box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); }
+ .modal-sm {
+ width: 300px; } }
+
+@media (min-width: 992px) {
+ .modal-lg {
+ width: 900px; } }
+
+.tooltip {
+ position: absolute;
+ z-index: 1070;
+ display: block;
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+ font-size: 12px;
+ font-weight: 400;
+ line-height: 1.4;
+ visibility: visible;
+ filter: alpha(opacity=0);
+ opacity: 0; }
+
+.tooltip.in {
+ filter: alpha(opacity=90);
+ opacity: .9; }
+
+.tooltip.top {
+ padding: 5px 0;
+ margin-top: -3px; }
+
+.tooltip.right {
+ padding: 0 5px;
+ margin-left: 3px; }
+
+.tooltip.bottom {
+ padding: 5px 0;
+ margin-top: 3px; }
+
+.tooltip.left {
+ padding: 0 5px;
+ margin-left: -3px; }
+
+.tooltip-inner {
+ max-width: 200px;
+ padding: 3px 8px;
+ color: #fff;
+ text-align: center;
+ text-decoration: none;
+ background-color: #000;
+ border-radius: 4px; }
+
+.tooltip-arrow {
+ position: absolute;
+ width: 0;
+ height: 0;
+ border-color: transparent;
+ border-style: solid; }
+
+.tooltip.top .tooltip-arrow {
+ bottom: 0;
+ left: 50%;
+ margin-left: -5px;
+ border-width: 5px 5px 0;
+ border-top-color: #000; }
+
+.tooltip.top-left .tooltip-arrow {
+ right: 5px;
+ bottom: 0;
+ margin-bottom: -5px;
+ border-width: 5px 5px 0;
+ border-top-color: #000; }
+
+.tooltip.top-right .tooltip-arrow {
+ bottom: 0;
+ left: 5px;
+ margin-bottom: -5px;
+ border-width: 5px 5px 0;
+ border-top-color: #000; }
+
+.tooltip.right .tooltip-arrow {
+ top: 50%;
+ left: 0;
+ margin-top: -5px;
+ border-width: 5px 5px 5px 0;
+ border-right-color: #000; }
+
+.tooltip.left .tooltip-arrow {
+ top: 50%;
+ right: 0;
+ margin-top: -5px;
+ border-width: 5px 0 5px 5px;
+ border-left-color: #000; }
+
+.tooltip.bottom .tooltip-arrow {
+ top: 0;
+ left: 50%;
+ margin-left: -5px;
+ border-width: 0 5px 5px;
+ border-bottom-color: #000; }
+
+.tooltip.bottom-left .tooltip-arrow {
+ top: 0;
+ right: 5px;
+ margin-top: -5px;
+ border-width: 0 5px 5px;
+ border-bottom-color: #000; }
+
+.tooltip.bottom-right .tooltip-arrow {
+ top: 0;
+ left: 5px;
+ margin-top: -5px;
+ border-width: 0 5px 5px;
+ border-bottom-color: #000; }
+
+.popover {
+ position: absolute;
+ top: 0;
+ left: 0;
+ z-index: 1060;
+ display: none;
+ max-width: 276px;
+ padding: 1px;
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+ font-size: 14px;
+ font-weight: 400;
+ line-height: 1.42857143;
+ text-align: left;
+ white-space: normal;
+ background-color: #fff;
+ -webkit-background-clip: padding-box;
+ background-clip: padding-box;
+ border: 1px solid #ccc;
+ border: 1px solid rgba(0, 0, 0, 0.2);
+ border-radius: 6px;
+ -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
+ box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); }
+
+.popover.top {
+ margin-top: -10px; }
+
+.popover.right {
+ margin-left: 10px; }
+
+.popover.bottom {
+ margin-top: 10px; }
+
+.popover.left {
+ margin-left: -10px; }
+
+.popover-title {
+ padding: 8px 14px;
+ margin: 0;
+ font-size: 14px;
+ background-color: #f7f7f7;
+ border-bottom: 1px solid #ebebeb;
+ border-radius: 5px 5px 0 0; }
+
+.popover-content {
+ padding: 9px 14px; }
+
+.popover > .arrow, .popover > .arrow:after {
+ position: absolute;
+ display: block;
+ width: 0;
+ height: 0;
+ border-color: transparent;
+ border-style: solid; }
+
+.popover > .arrow {
+ border-width: 11px; }
+
+.popover > .arrow:after {
+ content: "";
+ border-width: 10px; }
+
+.popover.top > .arrow {
+ bottom: -11px;
+ left: 50%;
+ margin-left: -11px;
+ border-top-color: #999;
+ border-top-color: rgba(0, 0, 0, 0.25);
+ border-bottom-width: 0; }
+
+.popover.top > .arrow:after {
+ bottom: 1px;
+ margin-left: -10px;
+ content: " ";
+ border-top-color: #fff;
+ border-bottom-width: 0; }
+
+.popover.right > .arrow {
+ top: 50%;
+ left: -11px;
+ margin-top: -11px;
+ border-right-color: #999;
+ border-right-color: rgba(0, 0, 0, 0.25);
+ border-left-width: 0; }
+
+.popover.right > .arrow:after {
+ bottom: -10px;
+ left: 1px;
+ content: " ";
+ border-right-color: #fff;
+ border-left-width: 0; }
+
+.popover.bottom > .arrow {
+ top: -11px;
+ left: 50%;
+ margin-left: -11px;
+ border-top-width: 0;
+ border-bottom-color: #999;
+ border-bottom-color: rgba(0, 0, 0, 0.25); }
+
+.popover.bottom > .arrow:after {
+ top: 1px;
+ margin-left: -10px;
+ content: " ";
+ border-top-width: 0;
+ border-bottom-color: #fff; }
+
+.popover.left > .arrow {
+ top: 50%;
+ right: -11px;
+ margin-top: -11px;
+ border-right-width: 0;
+ border-left-color: #999;
+ border-left-color: rgba(0, 0, 0, 0.25); }
+
+.popover.left > .arrow:after {
+ right: 1px;
+ bottom: -10px;
+ content: " ";
+ border-right-width: 0;
+ border-left-color: #fff; }
+
+.carousel {
+ position: relative; }
+
+.carousel-inner {
+ position: relative;
+ width: 100%;
+ overflow: hidden; }
+
+.carousel-inner > .item {
+ position: relative;
+ display: none;
+ -webkit-transition: .6s ease-in-out left;
+ -o-transition: .6s ease-in-out left;
+ transition: .6s ease-in-out left; }
+
+.carousel-inner > .item > a > img, .carousel-inner > .item > img {
+ line-height: 1; }
+
+@media all and (transform-3d), (-webkit-transform-3d) {
+ .carousel-inner > .item {
+ -webkit-transition: -webkit-transform 0.6s ease-in-out;
+ -o-transition: -o-transform 0.6s ease-in-out;
+ transition: transform 0.6s ease-in-out;
+ -webkit-backface-visibility: hidden;
+ backface-visibility: hidden;
+ -webkit-perspective: 1000;
+ perspective: 1000; }
+ .carousel-inner > .item.active.right, .carousel-inner > .item.next {
+ left: 0;
+ -webkit-transform: translate3d(100%, 0, 0);
+ transform: translate3d(100%, 0, 0); }
+ .carousel-inner > .item.active.left, .carousel-inner > .item.prev {
+ left: 0;
+ -webkit-transform: translate3d(-100%, 0, 0);
+ transform: translate3d(-100%, 0, 0); }
+ .carousel-inner > .item.active, .carousel-inner > .item.next.left, .carousel-inner > .item.prev.right {
+ left: 0;
+ -webkit-transform: translate3d(0, 0, 0);
+ transform: translate3d(0, 0, 0); } }
+
+.carousel-inner > .active, .carousel-inner > .next, .carousel-inner > .prev {
+ display: block; }
+
+.carousel-inner > .active {
+ left: 0; }
+
+.carousel-inner > .next, .carousel-inner > .prev {
+ position: absolute;
+ top: 0;
+ width: 100%; }
+
+.carousel-inner > .next {
+ left: 100%; }
+
+.carousel-inner > .prev {
+ left: -100%; }
+
+.carousel-inner > .next.left, .carousel-inner > .prev.right {
+ left: 0; }
+
+.carousel-inner > .active.left {
+ left: -100%; }
+
+.carousel-inner > .active.right {
+ left: 100%; }
+
+.carousel-control {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ width: 15%;
+ font-size: 20px;
+ color: #fff;
+ text-align: center;
+ text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
+ filter: alpha(opacity=50);
+ opacity: .5; }
+
+.carousel-control.left {
+ background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.5) 0, rgba(0, 0, 0, 0.0001) 100%);
+ background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.5) 0, rgba(0, 0, 0, 0.0001) 100%);
+ background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0.0001)));
+ background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0, rgba(0, 0, 0, 0.0001) 100%);
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);
+ background-repeat: repeat-x; }
+
+.carousel-control.right {
+ right: 0;
+ left: auto;
+ background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0, rgba(0, 0, 0, 0.5) 100%);
+ background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0, rgba(0, 0, 0, 0.5) 100%);
+ background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, 0.0001)), to(rgba(0, 0, 0, 0.5)));
+ background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0001) 0, rgba(0, 0, 0, 0.5) 100%);
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);
+ background-repeat: repeat-x; }
+
+.carousel-control:focus, .carousel-control:hover {
+ color: #fff;
+ text-decoration: none;
+ filter: alpha(opacity=90);
+ outline: 0;
+ opacity: .9; }
+
+.carousel-control .glyphicon-chevron-left, .carousel-control .glyphicon-chevron-right, .carousel-control .icon-next, .carousel-control .icon-prev {
+ position: absolute;
+ top: 50%;
+ z-index: 5;
+ display: inline-block; }
+
+.carousel-control .glyphicon-chevron-left, .carousel-control .icon-prev {
+ left: 50%;
+ margin-left: -10px; }
+
+.carousel-control .glyphicon-chevron-right, .carousel-control .icon-next {
+ right: 50%;
+ margin-right: -10px; }
+
+.carousel-control .icon-next, .carousel-control .icon-prev {
+ width: 20px;
+ height: 20px;
+ margin-top: -10px;
+ font-family: serif;
+ line-height: 1; }
+
+.carousel-control .icon-prev:before {
+ content: '\2039'; }
+
+.carousel-control .icon-next:before {
+ content: '\203a'; }
+
+.carousel-indicators {
+ position: absolute;
+ bottom: 10px;
+ left: 50%;
+ z-index: 15;
+ width: 60%;
+ padding-left: 0;
+ margin-left: -30%;
+ text-align: center;
+ list-style: none; }
+
+.carousel-indicators li {
+ display: inline-block;
+ width: 10px;
+ height: 10px;
+ margin: 1px;
+ text-indent: -999px;
+ cursor: pointer;
+ background-color: #000 \9;
+ background-color: transparent;
+ border: 1px solid #fff;
+ border-radius: 10px; }
+
+.carousel-indicators .active {
+ width: 12px;
+ height: 12px;
+ margin: 0;
+ background-color: #fff; }
+
+.carousel-caption {
+ position: absolute;
+ right: 15%;
+ bottom: 20px;
+ left: 15%;
+ z-index: 10;
+ padding-top: 20px;
+ padding-bottom: 20px;
+ color: #fff;
+ text-align: center;
+ text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
+
+.carousel-caption .btn {
+ text-shadow: none; }
+
+@media screen and (min-width: 768px) {
+ .carousel-control .glyphicon-chevron-left, .carousel-control .glyphicon-chevron-right, .carousel-control .icon-next, .carousel-control .icon-prev {
+ width: 30px;
+ height: 30px;
+ margin-top: -15px;
+ font-size: 30px; }
+ .carousel-control .glyphicon-chevron-left, .carousel-control .icon-prev {
+ margin-left: -15px; }
+ .carousel-control .glyphicon-chevron-right, .carousel-control .icon-next {
+ margin-right: -15px; }
+ .carousel-caption {
+ right: 20%;
+ left: 20%;
+ padding-bottom: 30px; }
+ .carousel-indicators {
+ bottom: 20px; } }
+
+.btn-group-vertical > .btn-group:after, .btn-group-vertical > .btn-group:before, .btn-toolbar:after, .btn-toolbar:before, .clearfix:after, .clearfix:before, .container-fluid:after, .container-fluid:before, .container:after, .container:before, .dl-horizontal dd:after, .dl-horizontal dd:before, .form-horizontal .form-group:after, .form-horizontal .form-group:before, .modal-footer:after, .modal-footer:before, .nav:after, .nav:before, .navbar-collapse:after, .navbar-collapse:before, .navbar-header:after, .navbar-header:before, .navbar:after, .navbar:before, .pager:after, .pager:before, .panel-body:after, .panel-body:before, .row:after, .row:before {
+ display: table;
+ content: " "; }
+
+.btn-group-vertical > .btn-group:after, .btn-toolbar:after, .clearfix:after, .container-fluid:after, .container:after, .dl-horizontal dd:after, .form-horizontal .form-group:after, .modal-footer:after, .nav:after, .navbar-collapse:after, .navbar-header:after, .navbar:after, .pager:after, .panel-body:after, .row:after {
+ clear: both; }
+
+.center-block {
+ display: block;
+ margin-right: auto;
+ margin-left: auto; }
+
+.pull-right {
+ float: right !important; }
+
+.pull-left {
+ float: left !important; }
+
+.invisible {
+ visibility: hidden; }
+
+.text-hide {
+ font: 0/0 a;
+ color: transparent;
+ text-shadow: none;
+ background-color: transparent;
+ border: 0; }
+
+.hidden {
+ display: none !important;
+ visibility: hidden !important; }
+
+.affix {
+ position: fixed; }
+
+@-ms-viewport {
+ width: device-width; }
+
+.visible-lg, .visible-md, .visible-sm, .visible-xs {
+ display: none !important; }
+
+.visible-lg-block, .visible-lg-inline, .visible-lg-inline-block, .visible-md-block, .visible-md-inline, .visible-md-inline-block, .visible-sm-block, .visible-sm-inline, .visible-sm-inline-block, .visible-xs-block, .visible-xs-inline, .visible-xs-inline-block {
+ display: none !important; }
+
+@media (max-width: 767px) {
+ .visible-xs {
+ display: block !important; }
+ table.visible-xs {
+ display: table; }
+ tr.visible-xs {
+ display: table-row !important; }
+ td.visible-xs, th.visible-xs {
+ display: table-cell !important; } }
+
+@media (max-width: 767px) {
+ .visible-xs-block {
+ display: block !important; } }
+
+@media (max-width: 767px) {
+ .visible-xs-inline {
+ display: inline !important; } }
+
+@media (max-width: 767px) {
+ .visible-xs-inline-block {
+ display: inline-block !important; } }
+
+@media (min-width: 768px) and (max-width: 991px) {
+ .visible-sm {
+ display: block !important; }
+ table.visible-sm {
+ display: table; }
+ tr.visible-sm {
+ display: table-row !important; }
+ td.visible-sm, th.visible-sm {
+ display: table-cell !important; } }
+
+@media (min-width: 768px) and (max-width: 991px) {
+ .visible-sm-block {
+ display: block !important; } }
+
+@media (min-width: 768px) and (max-width: 991px) {
+ .visible-sm-inline {
+ display: inline !important; } }
+
+@media (min-width: 768px) and (max-width: 991px) {
+ .visible-sm-inline-block {
+ display: inline-block !important; } }
+
+@media (min-width: 992px) and (max-width: 1199px) {
+ .visible-md {
+ display: block !important; }
+ table.visible-md {
+ display: table; }
+ tr.visible-md {
+ display: table-row !important; }
+ td.visible-md, th.visible-md {
+ display: table-cell !important; } }
+
+@media (min-width: 992px) and (max-width: 1199px) {
+ .visible-md-block {
+ display: block !important; } }
+
+@media (min-width: 992px) and (max-width: 1199px) {
+ .visible-md-inline {
+ display: inline !important; } }
+
+@media (min-width: 992px) and (max-width: 1199px) {
+ .visible-md-inline-block {
+ display: inline-block !important; } }
+
+@media (min-width: 1200px) {
+ .visible-lg {
+ display: block !important; }
+ table.visible-lg {
+ display: table; }
+ tr.visible-lg {
+ display: table-row !important; }
+ td.visible-lg, th.visible-lg {
+ display: table-cell !important; } }
+
+@media (min-width: 1200px) {
+ .visible-lg-block {
+ display: block !important; } }
+
+@media (min-width: 1200px) {
+ .visible-lg-inline {
+ display: inline !important; } }
+
+@media (min-width: 1200px) {
+ .visible-lg-inline-block {
+ display: inline-block !important; } }
+
+@media (max-width: 767px) {
+ .hidden-xs {
+ display: none !important; } }
+
+@media (min-width: 768px) and (max-width: 991px) {
+ .hidden-sm {
+ display: none !important; } }
+
+@media (min-width: 992px) and (max-width: 1199px) {
+ .hidden-md {
+ display: none !important; } }
+
+@media (min-width: 1200px) {
+ .hidden-lg {
+ display: none !important; } }
+
+.visible-print {
+ display: none !important; }
+
+@media print {
+ .visible-print {
+ display: block !important; }
+ table.visible-print {
+ display: table; }
+ tr.visible-print {
+ display: table-row !important; }
+ td.visible-print, th.visible-print {
+ display: table-cell !important; } }
+
+.visible-print-block {
+ display: none !important; }
+
+@media print {
+ .visible-print-block {
+ display: block !important; } }
+
+.visible-print-inline {
+ display: none !important; }
+
+@media print {
+ .visible-print-inline {
+ display: inline !important; } }
+
+.visible-print-inline-block {
+ display: none !important; }
+
+@media print {
+ .visible-print-inline-block {
+ display: inline-block !important; } }
+
+@media print {
+ .hidden-print {
+ display: none !important; } }
+
+/* Private */
+/* Variables */
+/* Precision rounding function */
+/* Scale */
+/* Prefix */
+/* Value Prefix*/
+/* Font size */
+/* Box sizing */
+/* Borders & Shadows */
+/* Opacity */
+/* Ellipsis */
+/* Vertical placement of multuple lines of text */
+/* transform-rotate */
+/* transform-scale */
+/**/
+/* Clearfix */
+/* Bottom positioning */
+/* Fonts */
+@font-face {
+ font-family: SourceSanPro-Light;
+ src: url("../fonts/SourceSansPro-Light.otf"); }
+
+@font-face {
+ font-family: SourceSanPro-Regular;
+ src: url("../fonts/SourceSansPro-Regular.otf"); }
+
+@font-face {
+ font-family: SourceSanPro-Semibold;
+ src: url("../fonts/SourceSansPro-Semibold.otf"); }
+
+.nfv-heading-1, .nfv-header .header-content-wrapper .header-title .main-title, .nfv-header .header-content-wrapper .header-title .version-select, .service-overview-tab .service-metrics .service-metric .metric-details .metric-value {
+ font-family: "SourceSanPro-Light";
+ font-size: 32px; }
+
+.nfv-heading-2, .nfv-wizard-header .wizard .nfv-wizard-steps .wizard-step .step-item, .launch-service-wizard .nfv-wizard-content .select-service-title, .launch-service-wizard .nfv-wizard-content .launch-service-title, .launch-service-wizard .nfv-wizard-content .parameters-service-title, .service-overview-tab .service-detailed-info .service-tasks .list-header, .service-overview-tab .service-detailed-info .service-events .list-header, .service-overview-tab .service-detailed-info .service-performance .services-performance-header, .nfv-landing-page .landing-page-view h2 {
+ font-family: "SourceSanPro-Light";
+ font-size: 27px; }
+
+.nfv-heading-3 {
+ font-family: "SourceSanPro-Light";
+ font-size: 25px; }
+
+.nfv-heading-4, .service-attributes .form-container .form-element--label, .modify-service-wizard .impact-view .impact-view-title {
+ font-family: "SourceSanPro-Regular";
+ font-size: 22px; }
+
+.nfv-body-1, .ui-dialog[role="dialog"] .ui-dialog-titlebar .ui-dialog-title, .nfv-header .header-content-wrapper .header-title .version-select select, .nfv-wizard-header .wizard .nfv-wizard-steps .wizard-step .step-title, .nfv-tabpanel .nfv-tabs-v1 .ui-state-default .ui-tabs-anchor, .nfv-tabpanel .nfv-tabs-v1 .ui-state-default.ui-state-active .ui-tabs-anchor, .nfv-tabpanel .nfv-tabs-v2 .ui-state-default .ui-tabs-anchor, .nfv-tabpanel .nfv-tabs-v2 .ui-state-default.ui-state-active .ui-tabs-anchor, .nfv-tabpanel .nfv-tabs-v3 .ui-state-default .ui-tabs-anchor, .nfv-tabpanel .nfv-tabs-v3 .ui-state-default.ui-state-active .ui-tabs-anchor, .nfv-tabpanel .nfv-tabs .ui-state-default .ui-tabs-anchor, .nfv-tabpanel .nfv-tabs .ui-state-default.ui-state-active .ui-tabs-anchor, body.theme2 .nfv-tabs-v3 .ui-state-default .ui-tabs-anchor, body.theme2 .nfv-tabs-v3 .ui-state-default.ui-state-active .ui-tabs-anchor, .notification .notification-header, .notification .notification-content .notification-main, .service-overview-tab .service-metrics .service-metric .metric-details .desc, .service-overview-tab .service-detailed-info .service-tasks .task-list-item .task-message, .service-overview-tab .service-detailed-info .service-events .event-list-item .event-item-content .event-message, .nfv-landing-page .landing-page-view .lists-box .events ul > li time, .nfv-landing-page .landing-page-view .lists-box .services ul > li > h3 {
+ font-family: "SourceSanPro-Regular";
+ font-size: 15px; }
+
+.nfv-body-2, .nfv-header .tasks-notifications-container .notifications-popup .notifications-popup-header, .nfv-button-link .uxf-button .ui-button-text, .nfv-button-link.ui-button-text-only .ui-button-text, .LS-error, .nfv-wizard-header .wizard .nfv-wizard-steps .wizard-step.active .step-title, .nfv-balloon .balloon-header .balloon-title, .network-topology-view .right-pane-controller .header .node-attributes-title, .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .node-attribute-list-item:first-child .node-attribute, .network-topology-view .right-pane-controller .node-attributes .nfv-collapsible-item .nfv-collapsible-content .kpi-item .kpi-item-value, .network-topology-view .right-pane-controller .node-attributes .nfv-collapsible-item .nfv-collapsible-content .kpi-item .kpi-item-name, body.theme2 .network-topology-view .right-pane-controller .node-attributes .nfv-collapsible-item .nfv-collapsible-content .kpi-item .kpi-item-value, body.theme2 .network-topology-view .right-pane-controller .node-attributes .nfv-collapsible-item .nfv-collapsible-content .kpi-item .kpi-item-name, .service-overview-tab .service-metrics .service-status .service-details .status, .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item, .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceTitles .serviceName, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceTitles .serviceName, .system-tasks .task-details-container .task-details-header, .tasks-notifications-container .task-details-container .task-details-header, .system-tasks .task-details-container .task-details-header .serviceTitles .serviceName, .tasks-notifications-container .task-details-container .task-details-header .serviceTitles .serviceName {
+ font-family: "SourceSanPro-Semibold";
+ font-size: 15px; }
+
+.nfv-body-3, input, .nfv-header .header-content-wrapper .header-title .sub-title, .ui-state-default.ui-button .ui-button-text,
+.ui-widget-content .ui-state-default.ui-button .ui-button-text,
+.ui-widget-header .ui-state-default.ui-button .ui-button-text, .nfv-link, .uxf-selectinput select, .form-element select, .nfv-balloon .balloon-content .node-attribute, .network-graph .element.nfvo .label, .tree-graph .node text, .nfv-pagination a, .uxf-pagination a, .notification .notification-content .notification-secondary, .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .node-attribute-list-item .node-attribute, .service-attributes .form-element .form-element--label, .service-attributes .form-element .form-element--error-message, .launch-service-wizard .nfv-wizard-content .service-list-item .service-name .service-version, .service-overview-tab .service-metrics .service-status .service-details .service-times, .service-overview-tab .service-detailed-info .service-tasks .list-header .recent-notice, .service-overview-tab .service-detailed-info .service-events .list-header .recent-notice, .service-overview-tab .service-detailed-info .service-tasks .task-list-item .task-time .due, body.theme2 .service-overview-tab .service-detailed-info .service-tasks .task-list-item .task-time .due, .system-tasks .tasks-list-container .filters, .tasks-notifications-container .tasks-list-container .filters, .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceTitles .customer, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceTitles .customer, .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview, .system-tasks .task-details-container .task-details-header .serviceTitles .customer, .tasks-notifications-container .task-details-container .task-details-header .serviceTitles .customer, .system-tasks .task-details-container .task-details-header .dueDateGroup, .tasks-notifications-container .task-details-container .task-details-header .dueDateGroup, .system-tasks .task-details-container .task-details-header .description, .tasks-notifications-container .task-details-container .task-details-header .description, .nfv-landing-page .landing-page-view h2 .see-all-link span, .nfv-landing-page .landing-page-view .lists-box .events ul > li .event-message p, .nfv-landing-page .landing-page-view .lists-box .events ul > li .machine-id, .nfv-landing-page .landing-page-view .lists-box .services ul > li > label, .nfv-landing-page .landing-page-view .lists-box .services ul > li > time {
+ font-family: "SourceSanPro-Regular";
+ font-size: 13px; }
+
+.nfv-body-4, .nfv-header .tasks-notifications-container .notifications-popup .notifications-popup-user-menu .version-and-build, .service-attributes .form-element input, .service-attributes .form-element select, .service-overview-tab .service-detailed-info .service-tasks .see-all-link, .service-overview-tab .service-detailed-info .service-events .see-all-link, .service-overview-tab .service-detailed-info .service-tasks .task-list-item .task-time .time, .service-overview-tab .service-detailed-info .service-events .event-list-item .event-item-content .event-item-data .event-time {
+ font-family: "SourceSanPro-Semibold";
+ font-size: 13px; }
+
+.nfv-body-5, .tree-graph .node text.sub-title, .color-legend .statuses .legend, .color-legend .states .legend, .color-legend .statuses .new, .color-legend .states .new, .network-topology-view .right-pane-controller .kpi-graph .header .node-attributes-title, .network-topology-view .right-pane-controller .kpi-graph .header .toggle, .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview .action-taken .label, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview .action-taken .label, .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceParams .label, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceParams .label {
+ font-family: "SourceSanPro-Regular";
+ font-size: 11px; }
+
+.nfv-body-6, .network-graph .element.nfvo .port > .port-label, .color-legend .statuses .title, .color-legend .states .title, .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview .action-taken .value, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview .action-taken .value, .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceParams .value, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceParams .value {
+ font-family: "SourceSanPro-Semibold";
+ font-size: 11px; }
+
+/* light theme */
+/* Textures */
+/* Dimensions */
+/* Dimensions */
+.ui-state-disabled {
+ pointer-events: none; }
+
+.ui-icon {
+ display: inline-block; }
+
+.ui-widget-content {
+ background: #ffffff;
+ color: #1a2531;
+ border: none; }
+ .ui-widget-content a {
+ color: #419ef1; }
+
+.uxf-progressbar {
+ color: #ffffff;
+ height: 20px;
+ margin: 5px 0; }
+ .uxf-progressbar > div[data-uxf-point="remaining"] {
+ background: #ffffff;
+ border: none;
+ -webkit-box-shadow: inset 0 1px 2px 1px #ffffff;
+ -moz-box-shadow: inset 0 1px 2px 1px #ffffff;
+ box-shadow: inset 0 1px 2px 1px #ffffff; }
+ .uxf-progressbar > div[data-uxf-point="progress"] {
+ border: none; }
+ .uxf-progressbar .nfv-normal {
+ background: #1a2531; }
+ .uxf-progressbar .nfv-critical {
+ background: #e65353; }
+ .uxf-progressbar .progress-text {
+ line-height: 30px;
+ text-align: center;
+ color: #ffffff; }
+
+.nfv-white-bg.uxf-progressbar > div[data-uxf-point="remaining"] {
+ background: #ffffff;
+ border: none; }
+
+.ui-tabs {
+ margin: 0;
+ padding: 0; }
+ .ui-tabs .ui-tabs-nav {
+ padding: 0;
+ margin: 0; }
+ .ui-tabs .ui-tabs-panel {
+ padding: 0;
+ margin: 0; }
+
+.ui-accordion .ui-accordion-content {
+ padding: 0;
+ margin: 0; }
+
+.ui-helper-reset {
+ line-height: 1.25; }
+
+.ui-widget {
+ font-size: 100%;
+ font-family: "SourceSanPro-Regular"; }
+ .ui-widget input {
+ font-family: "SourceSanPro-Regular"; }
+ .ui-widget select {
+ font-family: "SourceSanPro-Regular"; }
+
+.ui-dialog[role="dialog"] {
+ left: 50%;
+ min-width: 400px;
+ top: 50%;
+ transform: translate(-50%, -50%);
+ z-index: 1002;
+ -webkit-box-shadow: none;
+ -moz-box-shadow: none;
+ box-shadow: none; }
+ @media only screen and (min-width: 1224px) {
+ .ui-dialog[role="dialog"] {
+ min-width: 500px; } }
+ .ui-dialog[role="dialog"] .ui-dialog-titlebar {
+ background: #ecf1f5;
+ color: #253244;
+ padding: 0.5em 1em; }
+ .ui-dialog[role="dialog"] .ui-dialog-titlebar .ui-dialog-title {
+ text-align: left;
+ font-weight: normal; }
+ .ui-dialog[role="dialog"] .ui-dialog-titlebar .ui-button {
+ display: none; }
+ .ui-dialog[role="dialog"] .ui-dialog-content {
+ padding: 20px 30px;
+ background: #ffffff; }
+ .ui-dialog[role="dialog"] .ui-dialog-buttonpane {
+ padding: 0;
+ margin: 0; }
+ .ui-dialog[role="dialog"] .ui-dialog-buttonpane button.ui-button {
+ min-width: 75px;
+ padding: 0; }
+ .ui-dialog[role="dialog"] .ui-dialog-buttonpane button.ui-button .ui-button-text {
+ padding: 3px 0; }
+
+.ui-widget-overlay {
+ background: rgba(26, 37, 49, 0.5);
+ opacity: 1;
+ filter: alpha(opacity = 100);
+ z-index: 1001;
+ position: fixed; }
+
+.ui-datepicker {
+ border: 1px solid #ffffff; }
+ .ui-datepicker .ui-state-default, .ui-datepicker .ui-widget-header {
+ color: #b9bab5;
+ background: #232323; }
+ .ui-datepicker .ui-state-highlight {
+ border: none;
+ background: #ffffff;
+ color: #e65353; }
+
+.ui-dialog-titlebar .ui-state-default.ui-button {
+ box-shadow: none;
+ background: transparent;
+ border: 0px;
+ border-radius: 0px; }
+
+.ui-dialog-titlebar .ui-state-default.ui-state-hover {
+ border: none;
+ background: #413a35 url(images/ui-bg_glass_0_413a35_1x400.png) 50% 50% repeat-x;
+ border-radius: 4px; }
+
+.ui-tooltip {
+ max-width: 350px; }
+
+body.theme2 .ui-widget-content {
+ background: #232323;
+ color: #b9bab5;
+ border: none; }
+ body.theme2 .ui-widget-content a {
+ color: #f4f6f1; }
+
+body.theme2 .uxf-progressbar {
+ color: #f4f6f1; }
+ body.theme2 .uxf-progressbar > div[data-uxf-point="remaining"] {
+ background: #333; }
+ body.theme2 .uxf-progressbar .nfv-normal {
+ background: #1a2531; }
+ body.theme2 .uxf-progressbar .nfv-critical {
+ background: #ff7c54; }
+ body.theme2 .uxf-progressbar .progress-text {
+ color: #f4f6f1; }
+
+body.theme2 .nfv-white-bg.uxf-progressbar > div[data-uxf-point="remaining"] {
+ background: #232323; }
+
+body.theme2 .ui-dialog .ui-widget-content {
+ background: #333; }
+
+body.theme2 .ui-dialog .ui-dialog-titlebar {
+ color: #8ccdf5;
+ background: #232323; }
+
+body.theme2 .ui-dialog .ui-dialog-content {
+ background: #333; }
+
+body.theme2 .ui-widget-overlay {
+ background: rgba(185, 186, 181, 0.3); }
+
+body.theme2 .ui-datepicker {
+ border: 1px solid #333; }
+ body.theme2 .ui-datepicker .ui-state-default, body.theme2 .ui-datepicker .ui-widget-header {
+ color: #b9bab5;
+ background: #232323; }
+ body.theme2 .ui-datepicker .ui-state-highlight {
+ border: none;
+ background: #232323;
+ color: #ff7c54; }
+
+body.theme2 .ui-dialog-titlebar .ui-state-default.ui-state-hover {
+ border: none;
+ background: #413a35 url(images/ui-bg_glass_0_413a35_1x400.png) 50% 50% repeat-x;
+ border-radius: 4px; }
+
+/* PX fallback for browsers that do not support REM units. */
+html {
+ font-size: 100%; }
+
+body {
+ font-weight: normal;
+ line-height: 1.25;
+ font-family: "SourceSanPro-Regular";
+ background-color: #ffffff;
+ color: #1a2531;
+ /* scrollbar styling for Internet Explorer */
+ scrollbar-face-color: #ff8a00;
+ scrollbar-track-color: #ecf1f5;
+ /* scrollbar styling for Google Chrome | Safari | Opera */
+ /* Mozilla Firefox currently doesn't support scrollbar styling */ }
+ body ::-webkit-scrollbar {
+ width: 8px;
+ height: 8px; }
+ body ::-webkit-scrollbar-track {
+ background-color: transparent;
+ border-radius: 10px; }
+ body ::-webkit-scrollbar-thumb {
+ border-radius: 10px;
+ border: 1px solid #ecf1f5;
+ background-color: #253244; }
+ body.theme2 {
+ background-color: #232323;
+ color: #b9bab5;
+ scrollbar-face-color: #ff8a00;
+ scrollbar-track-color: #333; }
+ body.theme2 ::-webkit-scrollbar-thumb {
+ border: 1px solid #333;
+ background-color: #232323; }
+
+ul {
+ list-style: none; }
+
+h1, h2, h3, h4, h5, h6, ul {
+ margin: 0;
+ padding: 0; }
+
+input {
+ background: #ffffff;
+ border: 1px solid #445a75;
+ padding: 7px 10px; }
+
+fieldset {
+ border: none; }
+
+fieldset label {
+ display: inline-block; }
+
+.nfv-header {
+ background-color: #419ef1;
+ display: table;
+ height: 70px;
+ transition: background-color 0.4s;
+ width: 100%; }
+ .nfv-header .nfv-logo {
+ height: 70px;
+ padding: 0px 20px;
+ vertical-align: middle;
+ display: table-cell;
+ font-size: 20px;
+ white-space: nowrap;
+ background-color: #253244; }
+ .nfv-header .nfv-logo a {
+ color: #ffffff; }
+ .nfv-header .nfv-logo a:hover {
+ text-decoration: none; }
+ .nfv-header .header-content-wrapper {
+ display: table-cell;
+ vertical-align: middle; }
+ .nfv-header .header-content-wrapper .header-title {
+ display: table-cell;
+ vertical-align: middle;
+ padding-left: 30px;
+ color: #ffffff;
+ transition: color 0.4s; }
+ .nfv-header .header-content-wrapper .header-title .main-title {
+ display: inline-block; }
+ .nfv-header .header-content-wrapper .header-title .version-select {
+ display: inline-block;
+ margin-left: 8px; }
+ .nfv-header .header-content-wrapper .header-title .version-select select {
+ max-height: 35px;
+ background: transparent url("../images/images_theme_1/drop_down_down_arrow_white.png") no-repeat 100% 50%;
+ border: none;
+ min-width: initial;
+ padding-right: 15px;
+ color: inherit;
+ padding-left: 8px; }
+ .nfv-header .header-content-wrapper .header-title .version-select select option {
+ background-color: #419ef1; }
+ .nfv-header .user-details {
+ position: absolute;
+ right: 10px;
+ top: 25px;
+ width: 200px; }
+ .nfv-header .user-details .nfv-header-logged-user {
+ background-size: 30px 30px;
+ background-repeat: no-repeat;
+ color: #ffffff;
+ position: relative; }
+ .nfv-header .tasks-notifications-container {
+ position: absolute;
+ right: 220px;
+ top: 22px; }
+ .nfv-header .tasks-notifications-container .tasks-notification-icon {
+ color: #ffffff;
+ font-size: 20px;
+ position: absolute;
+ width: 25px;
+ height: 25px;
+ right: 0px;
+ top: 1px;
+ text-align: center;
+ cursor: pointer; }
+ .nfv-header .tasks-notifications-container .notification-counter {
+ display: table-cell;
+ position: relative;
+ float: right;
+ background-color: #e65353;
+ color: #ffffff;
+ border-radius: 5px;
+ width: 21px;
+ right: -11px;
+ top: -8px;
+ vertical-align: middle;
+ text-align: center;
+ font-size: 70%; }
+ .nfv-header .tasks-notifications-container .notifications-popup {
+ cursor: default;
+ position: absolute;
+ top: 43px;
+ right: -26px;
+ z-index: 102;
+ width: 350px;
+ min-height: 100px;
+ background-color: #ffffff;
+ border: 1px solid #a8bbdc; }
+ .nfv-header .tasks-notifications-container .notifications-popup:after, .nfv-header .tasks-notifications-container .notifications-popup:before {
+ bottom: 100%;
+ left: 93%;
+ border: solid transparent;
+ content: " ";
+ height: 0;
+ width: 0;
+ position: absolute;
+ pointer-events: none; }
+ .nfv-header .tasks-notifications-container .notifications-popup:after {
+ border-color: rgba(255, 255, 255, 0);
+ border-bottom-color: #ffffff;
+ border-width: 11px;
+ margin-left: -25px; }
+ .nfv-header .tasks-notifications-container .notifications-popup:before {
+ border-color: rgba(167, 179, 178, 0);
+ border-bottom-color: #a8bbdc;
+ border-width: 13px;
+ margin-left: -27px; }
+ .nfv-header .tasks-notifications-container .notifications-popup .notifications-popup-header {
+ height: 46px;
+ line-height: 46px;
+ padding-left: 48px;
+ padding-right: 20px;
+ border-bottom: 1px solid #a8bbdc; }
+ .nfv-header .tasks-notifications-container .notifications-popup .notifications-popup-header .nfv-link {
+ float: right; }
+ .nfv-header .tasks-notifications-container .notifications-popup .notifications-popup-content {
+ position: relative;
+ min-height: 400px;
+ max-height: 414px;
+ left: 21px; }
+ .nfv-header .tasks-notifications-container .notifications-popup .notifications-popup-user-menu {
+ position: absolute;
+ top: 0px;
+ border-right: 1px solid #a8bbdc;
+ background: #e1e8f1;
+ width: 35px;
+ min-height: 446px;
+ font-size: 25px;
+ text-align: center; }
+ .nfv-header .tasks-notifications-container .notifications-popup .notifications-popup-user-menu .settings, .nfv-header .tasks-notifications-container .notifications-popup .notifications-popup-user-menu .logout, .nfv-header .tasks-notifications-container .notifications-popup .notifications-popup-user-menu .theme-select {
+ cursor: pointer;
+ margin-top: 10px; }
+ .nfv-header .tasks-notifications-container .notifications-popup .notifications-popup-user-menu .settings {
+ color: #ff8a00; }
+ .nfv-header .tasks-notifications-container .notifications-popup .notifications-popup-user-menu .theme-select {
+ color: #445a75; }
+ .nfv-header .tasks-notifications-container .notifications-popup .notifications-popup-user-menu .version-and-build {
+ transform: rotate(270deg);
+ /* IE10 and Mozilla */
+ -ms-transform: rotate(270deg);
+ /* IE 9 */
+ -webkit-transform: rotate(270deg);
+ /* Safari and Chrome */
+ top: 290px;
+ position: relative;
+ left: 0;
+ letter-spacing: 2px; }
+ .nfv-header .tasks-notifications-container .notifications-popup .notifications-popup-user-menu .logout {
+ color: #419ef1;
+ bottom: 0;
+ position: absolute;
+ left: 6px; }
+
+/* Themes */
+body.theme2 .nfv-header {
+ background-color: #333; }
+ body.theme2 .nfv-header .search-filter-input input[type="search"] {
+ background: #232323;
+ color: #f4f6f1; }
+ body.theme2 .nfv-header .nfv-logo {
+ background-color: #232323; }
+ body.theme2 .nfv-header .header-content-wrapper .header-title {
+ color: #9bdb69; }
+ body.theme2 .nfv-header .header-content-wrapper .version-select select {
+ color: #8ccdf5; }
+ body.theme2 .nfv-header .header-content-wrapper .version-select select option {
+ background-color: #333; }
+ body.theme2 .nfv-header .header-content-wrapper .sub-title {
+ color: #aaa6d9; }
+ body.theme2 .nfv-header .user-details .nfv-header-logged-user {
+ color: #f4f6f1; }
+
+body.theme2 .tasks-notifications-container .tasks-notification-icon {
+ color: #9bdb69; }
+
+body.theme2 .tasks-notifications-container .notification-counter {
+ background-color: #333;
+ color: #b9bab5; }
+
+body.theme2 .tasks-notifications-container .notifications-popup {
+ background-color: #333;
+ border: 1px solid #454544;
+ box-shadow: 0px 0px 5px 2px #b9bab5; }
+ body.theme2 .tasks-notifications-container .notifications-popup:after {
+ border-color: rgba(255, 255, 255, 0);
+ border-bottom-color: #232323; }
+ body.theme2 .tasks-notifications-container .notifications-popup:before {
+ border-color: rgba(167, 179, 178, 0);
+ border-bottom-color: #454544; }
+ body.theme2 .tasks-notifications-container .notifications-popup .notifications-popup-header {
+ border-bottom: 1px solid #454544;
+ background: #232323; }
+ body.theme2 .tasks-notifications-container .notifications-popup .notifications-popup-user-menu {
+ border-right: 1px solid #454544;
+ background: #232323; }
+ body.theme2 .tasks-notifications-container .notifications-popup .notifications-popup-user-menu .settings {
+ color: #aaa6d9; }
+ body.theme2 .tasks-notifications-container .notifications-popup .notifications-popup-user-menu .logout {
+ color: #ff7c54; }
+ body.theme2 .tasks-notifications-container .notifications-popup .notifications-popup-user-menu .theme-select {
+ color: #9bdb69; }
+
+.nfv-page {
+ overflow: hidden;
+ height: 100vh;
+ position: relative; }
+ .nfv-page .nfv-content {
+ background-color: #ffffff;
+ overflow: auto;
+ position: absolute;
+ top: 70px;
+ bottom: 0;
+ transition: background-color 0.2s;
+ width: 100%; }
+
+body.theme2 .nfv-page .nfv-content {
+ background-color: #232323; }
+
+.ui-dialog {
+ -webkit-box-shadow: 3px 5px 8px rgba(0, 0, 0, 0.6);
+ -moz-box-shadow: 3px 5px 8px rgba(0, 0, 0, 0.6);
+ box-shadow: 3px 5px 8px rgba(0, 0, 0, 0.6); }
+ .ui-dialog .nfv-content {
+ background: #ffffff;
+ color: #1a2531;
+ min-height: 0px;
+ width: auto;
+ margin: 0;
+ padding: 20px 35px 20px;
+ overflow-x: hidden; }
+ .ui-dialog .nfv-content p {
+ line-height: 1.6; }
+
+.ui-state-default.ui-button,
+.ui-widget-content .ui-state-default.ui-button,
+.ui-widget-header .ui-state-default.ui-button {
+ -webkit-border-radius: 2px;
+ border-radius: 2px;
+ color: #253244;
+ background: transparent;
+ min-width: 90px;
+ outline: none; }
+ .ui-state-default.ui-button .ui-button-text,
+ .ui-widget-content .ui-state-default.ui-button .ui-button-text,
+ .ui-widget-header .ui-state-default.ui-button .ui-button-text {
+ padding: 6px 10px; }
+
+.nfv-primary-button .ui-button.ui-widget, .nfv-secondary-button .ui-button.ui-widget, .ui-dialog[role="dialog"] .ui-dialog-buttonset .ui-button.ui-widget {
+ transition: background 0.4s, color 0.4s, border 0.4s; }
+ .nfv-primary-button .ui-button.ui-widget.ui-state-disabled, .nfv-secondary-button .ui-button.ui-widget.ui-state-disabled, .ui-dialog[role="dialog"] .ui-dialog-buttonset .ui-button.ui-widget.ui-state-disabled {
+ opacity: 0.5;
+ filter: alpha(opacity = 50);
+ background: transparent !important;
+ border: 1px solid #445a75; }
+ .nfv-primary-button .ui-button.ui-widget.ui-state-disabled .ui-button-text, .nfv-secondary-button .ui-button.ui-widget.ui-state-disabled .ui-button-text, .ui-dialog[role="dialog"] .ui-dialog-buttonset .ui-button.ui-widget.ui-state-disabled .ui-button-text {
+ color: #445a75 !important; }
+
+.nfv-primary-button .ui-button.ui-widget {
+ color: #253244;
+ background: #ff8a00;
+ border: none; }
+ .nfv-primary-button .ui-button.ui-widget:hover {
+ background: #a8bbdc; }
+
+.nfv-secondary-button .ui-button, .ui-dialog[role="dialog"] .ui-dialog-buttonset .ui-button {
+ color: #253244;
+ background: transparent;
+ border: 1px solid #253244;
+ min-width: 80px; }
+ .nfv-secondary-button .ui-button:hover, .ui-dialog[role="dialog"] .ui-dialog-buttonset .ui-button:hover {
+ color: #419ef1;
+ border: 1px solid #419ef1; }
+
+.nfv-button-link .uxf-button, .nfv-button-link.ui-button-text-only {
+ background: none;
+ border: none;
+ color: #253244;
+ box-shadow: none; }
+ .nfv-button-link .uxf-button.ui-button:hover, .nfv-button-link.ui-button-text-only.ui-button:hover {
+ background: none; }
+ .nfv-button-link .uxf-button .ui-button-text, .nfv-button-link.ui-button-text-only .ui-button-text {
+ padding: 0;
+ text-decoration: underline; }
+
+.nfv-button-link .ui-state-default.ui-button,
+.nfv-button-link .ui-widget-content .ui-state-default.ui-button,
+.nfv-button-link .ui-widget-header .ui-state-default.ui-button {
+ color: #253244;
+ background: none; }
+
+.nfv-button-link .ui-state-default.ui-state-hover,
+.nfv-button-link .ui-widget-content .ui-state-default.ui-state-hover,
+.nfv-button-link .ui-widget-header .ui-state-default.ui-state-hover {
+ box-shadow: none; }
+
+.nfv-button-link a {
+ background: none; }
+
+body.theme2 .ui-state-default.ui-button,
+body.theme2 .ui-widget-content .ui-state-default.ui-button,
+body.theme2 .ui-widget-header .ui-state-default.ui-button {
+ color: rgba(185, 186, 181, 0.5); }
+
+body.theme2 .nfv-primary-button .ui-button.ui-widget.ui-state-disabled, body.theme2 .nfv-secondary-button .ui-button.ui-widget.ui-state-disabled, body.theme2 .ui-dialog[role="dialog"] .ui-dialog-buttonset .ui-button.ui-widget.ui-state-disabled, .ui-dialog[role="dialog"] body.theme2 .ui-dialog-buttonset .ui-button.ui-widget.ui-state-disabled {
+ background: transparent !important;
+ border: 1px solid #2f2f2f; }
+ body.theme2 .nfv-primary-button .ui-button.ui-widget.ui-state-disabled .ui-button-text, body.theme2 .nfv-secondary-button .ui-button.ui-widget.ui-state-disabled .ui-button-text, body.theme2 .ui-dialog[role="dialog"] .ui-dialog-buttonset .ui-button.ui-widget.ui-state-disabled .ui-button-text, .ui-dialog[role="dialog"] body.theme2 .ui-dialog-buttonset .ui-button.ui-widget.ui-state-disabled .ui-button-text {
+ color: #b9bab5 !important; }
+
+body.theme2 .nfv-primary-button .ui-button.ui-widget {
+ color: #232323;
+ background: rgba(155, 219, 105, 0.8); }
+ body.theme2 .nfv-primary-button .ui-button.ui-widget:hover {
+ background: #9bdb69;
+ color: #232323; }
+
+body.theme2 .nfv-secondary-button .ui-button, body.theme2 .ui-dialog[role="dialog"] .ui-dialog-buttonset .ui-button, .ui-dialog[role="dialog"] body.theme2 .ui-dialog-buttonset .ui-button {
+ color: rgba(185, 186, 181, 0.7);
+ background: transparent;
+ border: 1px solid rgba(185, 186, 181, 0.7); }
+ body.theme2 .nfv-secondary-button .ui-button:hover, body.theme2 .ui-dialog[role="dialog"] .ui-dialog-buttonset .ui-button:hover, .ui-dialog[role="dialog"] body.theme2 .ui-dialog-buttonset .ui-button:hover {
+ color: #b9bab5;
+ border: 1px solid #b9bab5;
+ background: transparent; }
+
+body.theme2 .nfv-button-link .uxf-button, body.theme2 .nfv-button-link.ui-button-text-only {
+ color: #b9bab5; }
+
+body.theme2 .nfv-button-link .ui-state-default.ui-button,
+body.theme2 .nfv-button-link .ui-widget-content .ui-state-default.ui-button,
+body.theme2 .nfv-button-link .ui-widget-header .ui-state-default.ui-button {
+ color: #b9bab5; }
+
+a.nfv-button-link {
+ cursor: pointer;
+ padding: 0;
+ font-size: inherit;
+ text-decoration: underline; }
+ a.nfv-button-link:hover {
+ text-decoration: none; }
+ a.nfv-button-link.nfv-active {
+ text-decoration: none;
+ font-weight: bold; }
+
+.nfv-link {
+ color: #419ef1;
+ text-decoration: none;
+ cursor: pointer; }
+ .nfv-link:hover {
+ text-decoration: underline; }
+ .nfv-link.nfv-active {
+ text-decoration: none;
+ font-weight: bold; }
+ .nfv-link .uxf-button {
+ background: none;
+ border: none;
+ color: #419ef1; }
+ .nfv-link .uxf-button .ui-button-text {
+ padding: 0;
+ font-size: inherit;
+ text-decoration: none; }
+ .nfv-link .uxf-button .ui-button-text:hover {
+ text-decoration: none; }
+
+.nfv-checkbox-button input[type="checkbox"] {
+ display: none; }
+ .nfv-checkbox-button input[type="checkbox"]:checked + label:before {
+ font-family: FontAwesome;
+ content: "\f00c";
+ text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
+ font-size: 15px;
+ color: #419ef1;
+ text-align: center;
+ line-height: 15px;
+ font-weight: bold; }
+
+.nfv-checkbox-button label {
+ display: inline-block;
+ cursor: pointer;
+ position: relative;
+ padding-left: 25px; }
+ .nfv-checkbox-button label:before {
+ content: "";
+ display: inline-block;
+ width: 16px;
+ height: 16px;
+ margin-right: 10px;
+ position: absolute;
+ left: 0;
+ bottom: 3px;
+ background-color: #ffffff;
+ border: 1px solid #445a75; }
+
+.nfv-radio-button input[type="radio"] {
+ display: none; }
+ .nfv-radio-button input[type="radio"]:checked + label:after {
+ opacity: 1; }
+
+.nfv-radio-button label {
+ display: inline-block;
+ cursor: pointer;
+ position: relative;
+ padding-left: 25px; }
+ .nfv-radio-button label:before {
+ content: "";
+ display: inline-block;
+ width: 16px;
+ height: 16px;
+ margin-right: 10px;
+ position: absolute;
+ left: 0;
+ bottom: 3px;
+ background-color: #ffffff;
+ border: 1px solid #445a75;
+ -webkit-border-radius: 10px;
+ border-radius: 10px; }
+ .nfv-radio-button label:after {
+ opacity: 0;
+ content: "";
+ background-color: #419ef1;
+ width: 10px;
+ height: 10PX;
+ border-radius: 10px;
+ position: absolute;
+ left: 3px;
+ top: 8px;
+ transition: opacity 0.2s; }
+
+.uxf-textinput input, .uxf-searchinput input {
+ border: none;
+ border-bottom: 1px solid #a8bbdc;
+ background: transparent;
+ outline: 0; }
+ .uxf-textinput input::-webkit-input-placeholder, .uxf-searchinput input::-webkit-input-placeholder {
+ color: #a8bbdc; }
+ .uxf-textinput input::-moz-placeholder, .uxf-searchinput input::-moz-placeholder {
+ color: #a8bbdc; }
+
+.form-element .form-element--error-message {
+ color: #e65353;
+ margin-left: 20px; }
+
+.form-element input.form-element--control {
+ height: 19px;
+ border-radius: 2px;
+ border: none;
+ border-bottom: 1px solid #a8bbdc;
+ outline: 0; }
+ .form-element input.form-element--control[disabled] {
+ opacity: 0.35; }
+
+.form-element select.form-element--control {
+ height: 35px;
+ border-radius: 2px;
+ border-color: #a8bbdc; }
+
+.nfv-mandatory label:after, .is-mandatory label:after {
+ content: '*';
+ display: inline-block;
+ color: #e65353; }
+
+.nfv-mandatory-asterisk {
+ color: #e65353 !important; }
+
+.uxf-selectinput select, .form-element select {
+ color: #1a2531;
+ text-align: left;
+ min-width: 150px;
+ height: 35px !important;
+ padding-left: 10px;
+ padding-right: 17px;
+ appearance: none;
+ -moz-appearance: none;
+ -webkit-appearance: none;
+ background: url("../images/images_theme_1/drop_down_down_arrow.png") no-repeat 102% #ffffff;
+ border-radius: 3px;
+ border: 1px solid #a8bbdc;
+ outline: 0; }
+
+.uxf-selectinput .mlabel, .form-element .mlabel {
+ display: inline;
+ margin-right: 18px !important; }
+
+.LS-error {
+ display: none;
+ color: #e65353;
+ background-position: 0;
+ padding: 5px 0 5px 25px; }
+
+body.theme2 .nfv-link {
+ color: #f4f6f1; }
+ body.theme2 .nfv-link .uxf-button {
+ color: #f4f6f1; }
+
+body.theme2 .nfv-checkbox-button input[type=checkbox]:checked + label:before {
+ color: #9bdb69; }
+
+body.theme2 .nfv-checkbox-button label:before {
+ background-color: #333;
+ border: 1px solid #b9bab5; }
+
+body.theme2 .nfv-radio-button input[type="radio"]:checked + label:before {
+ color: #9bdb69; }
+
+body.theme2 .nfv-radio-button label:before {
+ background-color: #333;
+ border: 1px solid #b9bab5; }
+
+body.theme2 .nfv-radio-button label:after {
+ background-color: #9bdb69; }
+
+body.theme2 .uxf-textinput input, body.theme2 .uxf-searchinput input {
+ border-bottom: 1px solid #333; }
+
+body.theme2 .form-element .form-element--error-message {
+ color: #ff7c54; }
+
+body.theme2 .form-element input.form-element--control {
+ border-bottom: 1px solid #333;
+ background: #232323; }
+
+body.theme2 .form-element select.form-element--control {
+ border-color: #333; }
+
+body.theme2 .nfv-mandatory label:after, body.theme2 .is-mandatory label:after {
+ color: #ff7c54; }
+
+body.theme2 .nfv-mandatory-asterisk {
+ color: #ff7c54 !important; }
+
+body.theme2 .uxf-selectinput select, body.theme2 .form-element select {
+ color: #b9bab5;
+ background: url("../images/images_theme_1/drop_down_down_arrow.png") no-repeat 102% #232323;
+ border: 1px solid #333; }
+
+body.theme2 .LS-error {
+ color: #ff7c54; }
+
+body.theme2 .form-element-container > .form-element--label:first-child {
+ color: #9bdb69; }
+
+.nfv-wizard-header {
+ position: relative;
+ border-bottom: 1px solid rgba(168, 187, 220, 0.3);
+ padding: 0;
+ background: #ecf1f5; }
+ .nfv-wizard-header .wizard .nfv-wizard-steps {
+ padding: 10px 0; }
+ .nfv-wizard-header .wizard .nfv-wizard-steps .wizard-step {
+ display: inline-block;
+ text-align: center; }
+ .nfv-wizard-header .wizard .nfv-wizard-steps .wizard-step .step-item {
+ margin-left: 15px; }
+ .nfv-wizard-header .wizard .nfv-wizard-steps .wizard-step .step-title {
+ margin: 0 15px;
+ text-align: center; }
+ .nfv-wizard-header .wizard .nfv-wizard-steps .wizard-step .step-arrow {
+ font-size: 30px; }
+ .nfv-wizard-header .wizard .nfv-wizard-steps .wizard-step:first-child {
+ margin-left: 37px; }
+ .nfv-wizard-header .wizard .nfv-wizard-steps .wizard-step:first-child .step-item {
+ margin-left: 0; }
+ .nfv-wizard-header .wizard .nfv-wizard-steps .wizard-step:last-child .step-arrow {
+ display: none; }
+ .nfv-wizard-header .wizard .nfv-wizard-steps .wizard-step.active .step-item {
+ color: #419ef1; }
+ .nfv-wizard-header .wizard .nfv-wizard-steps .wizard-step.active .step-title {
+ color: #419ef1; }
+
+.wizard-nav-controls {
+ background: #ecf1f5;
+ padding: 12px 0;
+ border-top: 1px solid #445a75;
+ height: 38px;
+ position: fixed;
+ bottom: 0;
+ width: 100%;
+ z-index: 2; }
+ .wizard-nav-controls .nfv-button-link, .wizard-nav-controls .nfv-secondary-button, .wizard-nav-controls .ui-dialog[role="dialog"] .ui-dialog-buttonset, .ui-dialog[role="dialog"] .wizard-nav-controls .ui-dialog-buttonset, .wizard-nav-controls .nfv-primary-button {
+ display: inline-block; }
+ .wizard-nav-controls .nfv-secondary-button, .wizard-nav-controls .ui-dialog[role="dialog"] .ui-dialog-buttonset, .ui-dialog[role="dialog"] .wizard-nav-controls .ui-dialog-buttonset {
+ margin-left: 30px; }
+ .wizard-nav-controls .nfv-primary-button {
+ position: absolute;
+ top: 12px;
+ right: 2%; }
+
+body.theme2 .nfv-wizard-header {
+ border-bottom: 1px solid #454544;
+ background: #232323; }
+ body.theme2 .nfv-wizard-header .wizard .nfv-wizard-steps .wizard-step .step-arrow {
+ color: #9bdb69; }
+ body.theme2 .nfv-wizard-header .wizard .nfv-wizard-steps .wizard-step.active .step-item {
+ color: #8ccdf5; }
+ body.theme2 .nfv-wizard-header .wizard .nfv-wizard-steps .wizard-step.active .step-title {
+ color: #8ccdf5; }
+
+body.theme2 .wizard-nav-controls {
+ background: #333;
+ border-top: 1px solid #333; }
+
+.nfv-accordion .nfv-collapsible-item .nfv-collapsible-title {
+ background: #ecf1f5;
+ padding: 0px 10px;
+ height: 34px;
+ border: none;
+ border-bottom: 1px solid #a8bbdc;
+ margin-bottom: 10px;
+ display: table;
+ width: 99%; }
+ .nfv-accordion .nfv-collapsible-item .nfv-collapsible-title .nfv-collapsible-title-icon {
+ display: table-cell;
+ vertical-align: middle;
+ width: 14px; }
+ .nfv-accordion .nfv-collapsible-item .nfv-collapsible-title .nfv-collapsible-title-icon:before {
+ font-family: FontAwesome;
+ font-size: 15px;
+ content: "\f067";
+ color: #1a2531; }
+ .nfv-accordion .nfv-collapsible-item .nfv-collapsible-title .nfv-collapsible-title-text {
+ display: table-cell;
+ vertical-align: middle;
+ padding-left: 15px;
+ font-size: 25px;
+ color: #1a2531; }
+ .nfv-accordion .nfv-collapsible-item .nfv-collapsible-title .nfv-collapsible-subtitle-text {
+ display: table-cell;
+ vertical-align: middle;
+ font-size: 22px;
+ color: #1a2531;
+ margin-left: 0.5em; }
+ .nfv-accordion .nfv-collapsible-item .nfv-collapsible-title.ui-state-active {
+ background: #ecf1f5; }
+ .nfv-accordion .nfv-collapsible-item .nfv-collapsible-title.ui-state-active .nfv-collapsible-title-icon:before {
+ content: "\f068"; }
+
+.nfv-accordion .nfv-collapsible-item .nfv-collapsible-content {
+ padding: 10px; }
+
+body.theme2 .nfv-accordion .nfv-collapsible-item .nfv-collapsible-title {
+ background: #333;
+ border-bottom: 1px solid #2f2f2f; }
+ body.theme2 .nfv-accordion .nfv-collapsible-item .nfv-collapsible-title .nfv-collapsible-title-icon:before {
+ color: #b9bab5; }
+ body.theme2 .nfv-accordion .nfv-collapsible-item .nfv-collapsible-title .nfv-collapsible-title-text {
+ color: #b9bab5; }
+ body.theme2 .nfv-accordion .nfv-collapsible-item .nfv-collapsible-title .nfv-collapsible-subtitle-text {
+ color: #b9bab5; }
+ body.theme2 .nfv-accordion .nfv-collapsible-item .nfv-collapsible-title.ui-state-active {
+ background: #333; }
+
+.nfv-tabpanel {
+ background: transparent;
+ border: none; }
+ .nfv-tabpanel .nfv-tabs-v1 {
+ border: none;
+ background: #e1e8f1;
+ border-radius: 0;
+ padding: 3px 0; }
+ .nfv-tabpanel .nfv-tabs-v1 .ui-state-default {
+ margin: 0 35px;
+ border: none;
+ background: transparent; }
+ .nfv-tabpanel .nfv-tabs-v1 .ui-state-default .ui-tabs-anchor {
+ color: #253244;
+ padding: .5em 0;
+ width: 100%;
+ text-align: center; }
+ .nfv-tabpanel .nfv-tabs-v1 .ui-state-default.ui-state-active .ui-tabs-anchor {
+ color: #ff8a00;
+ outline: 0; }
+ .nfv-tabpanel .nfv-tabs-v2 {
+ border: none;
+ background: #ffffff;
+ border-radius: 0; }
+ .nfv-tabpanel .nfv-tabs-v2 .ui-state-default {
+ margin: 0;
+ border: 1px solid #a8bbdc;
+ background: transparent;
+ width: 140px; }
+ .nfv-tabpanel .nfv-tabs-v2 .ui-state-default .ui-tabs-anchor {
+ color: #253244;
+ padding: .5em 0;
+ width: 100%;
+ text-align: center; }
+ .nfv-tabpanel .nfv-tabs-v2 .ui-state-default.ui-state-active {
+ border-bottom: none; }
+ .nfv-tabpanel .nfv-tabs-v2 .ui-state-default.ui-state-active .ui-tabs-anchor {
+ color: #ff8a00;
+ outline: 0; }
+ .nfv-tabpanel .nfv-tabs-v3 {
+ border: none;
+ background: #ffffff;
+ border-radius: 0;
+ padding: 16px 0; }
+ .nfv-tabpanel .nfv-tabs-v3 .ui-state-default {
+ margin: 0;
+ border: 1px solid #a8bbdc !important;
+ border-left: none !important;
+ background: transparent;
+ border-radius: 0; }
+ .nfv-tabpanel .nfv-tabs-v3 .ui-state-default:first-child {
+ border-bottom-left-radius: 2px;
+ border-top-left-radius: 2px;
+ border-left: 1px solid #a8bbdc !important; }
+ .nfv-tabpanel .nfv-tabs-v3 .ui-state-default:last-child {
+ border-bottom-right-radius: 2px;
+ border-top-right-radius: 2px; }
+ .nfv-tabpanel .nfv-tabs-v3 .ui-state-default .ui-tabs-anchor {
+ color: #253244;
+ padding: 6px 18px;
+ text-align: center; }
+ .nfv-tabpanel .nfv-tabs-v3 .ui-state-default.ui-state-active .ui-tabs-anchor {
+ background: #ecf1f5;
+ outline: 0; }
+ .nfv-tabpanel .nfv-tabs {
+ border: none;
+ background: transparent; }
+ .nfv-tabpanel .nfv-tabs .ui-state-default {
+ height: 40px;
+ background: #445a75;
+ border: 1px solid #a8bbdc; }
+ .nfv-tabpanel .nfv-tabs .ui-state-default .ui-tabs-anchor {
+ color: #253244;
+ padding: .5em 0;
+ width: 100%;
+ text-align: center; }
+ .nfv-tabpanel .nfv-tabs .ui-state-default.ui-state-active {
+ background: #ffffff;
+ border: 1px solid #ffffff; }
+ .nfv-tabpanel .nfv-tabs .ui-state-default.ui-state-active .ui-tabs-anchor {
+ color: #ff8a00;
+ outline: 0; }
+ .nfv-tabpanel .ui-tabs-panel {
+ border-top: 1px solid #a8bbdc;
+ padding: 20 55px;
+ background: #ffffff; }
+ .nfv-tabpanel.ui-tabs-vertical {
+ width: 100%;
+ height: 385;
+ border-top: 1px solid #a8bbdc;
+ border-bottom: 1px solid #a8bbdc;
+ overflow: hidden;
+ -webkit-border-top-left-radius: 0;
+ border-top-left-radius: 0;
+ -webkit-border-top-right-radius: 0;
+ border-top-right-radius: 0; }
+ .nfv-tabpanel.ui-tabs-vertical .nfv-tabs {
+ float: left;
+ width: 26%;
+ height: inherit;
+ overflow-y: auto;
+ overflow-x: hidden; }
+ .nfv-tabpanel.ui-tabs-vertical .nfv-tabs .ui-state-default {
+ clear: left;
+ width: 100%;
+ top: 0;
+ -webkit-border-top-left-radius: 0;
+ border-top-left-radius: 0;
+ -webkit-border-top-right-radius: 0;
+ border-top-right-radius: 0;
+ border-right: none;
+ border-left: none;
+ margin: 0 0 5px 0; }
+ .nfv-tabpanel.ui-tabs-vertical .nfv-tabs .ui-state-default .ui-tabs-anchor {
+ display: block; }
+ .nfv-tabpanel.ui-tabs-vertical .nfv-tabs .ui-state-default.ui-tabs-active {
+ padding-bottom: 0;
+ border-bottom: #a8bbdc 2px solid !important;
+ border-top: #a8bbdc 2px solid !important;
+ height: 36px; }
+ .nfv-tabpanel.ui-tabs-vertical .ui-tabs-panel {
+ float: right;
+ width: 65.1%;
+ border: none;
+ height: 345;
+ overflow-y: auto; }
+
+body.theme2 .nfv-tabpanel .nfv-tabs-v1 {
+ background-color: #232323; }
+ body.theme2 .nfv-tabpanel .nfv-tabs-v1 .ui-state-default .ui-tabs-anchor {
+ color: #b9bab5; }
+ body.theme2 .nfv-tabpanel .nfv-tabs-v1 .ui-state-default.ui-state-active .ui-tabs-anchor {
+ color: #9bdb69; }
+
+body.theme2 .nfv-tabs-v2 {
+ background: #232323;
+ border-bottom: 1px solid #2f2f2f; }
+ body.theme2 .nfv-tabs-v2 .ui-state-default {
+ border: 1px solid #2f2f2f; }
+ body.theme2 .nfv-tabs-v2 .ui-state-default .ui-tabs-anchor {
+ color: #b9bab5; }
+ body.theme2 .nfv-tabs-v2 .ui-state-default.ui-state-active .ui-tabs-anchor {
+ color: #9bdb69; }
+
+body.theme2 .nfv-tabs-v3 {
+ background: #232323; }
+ body.theme2 .nfv-tabs-v3 .ui-state-default {
+ border: 1px solid #2f2f2f !important; }
+ body.theme2 .nfv-tabs-v3 .ui-state-default:first-child {
+ border-bottom-left-radius: 2px;
+ border-top-left-radius: 2px;
+ border-left: 1px solid #2f2f2f !important; }
+ body.theme2 .nfv-tabs-v3 .ui-state-default:last-child {
+ border-bottom-right-radius: 2px;
+ border-top-right-radius: 2px; }
+ body.theme2 .nfv-tabs-v3 .ui-state-default .ui-tabs-anchor {
+ color: #b9bab5; }
+ body.theme2 .nfv-tabs-v3 .ui-state-default.ui-state-active .ui-tabs-anchor {
+ color: #9bdb69;
+ background: #232323;
+ outline: 0; }
+
+body.theme2 .nfv-tabs .ui-state-default {
+ height: 40px;
+ background: #232323;
+ border: 1px solid #2f2f2f; }
+ body.theme2 .nfv-tabs .ui-state-default .ui-tabs-anchor {
+ color: #b9bab5; }
+ body.theme2 .nfv-tabs .ui-state-default.ui-state-active {
+ background: #333;
+ border: 1px solid #2f2f2f; }
+ body.theme2 .nfv-tabs .ui-state-default.ui-state-active .ui-tabs-anchor {
+ color: #9bdb69; }
+
+body.theme2 .ui-tabs-panel {
+ border-top: 1px solid #2f2f2f;
+ background: #232323; }
+
+body.theme2.ui-tabs-vertical {
+ border-top: 1px solid #2f2f2f;
+ border-bottom: 1px solid #2f2f2f; }
+ body.theme2.ui-tabs-vertical .nfv-tabs .ui-state-default.ui-tabs-active {
+ border-bottom-color: #2f2f2f !important;
+ border-top-color: #2f2f2f !important; }
+
+.nfv-balloon {
+ min-width: 60px;
+ border: 1px solid #445a75;
+ box-shadow: 1px 2px 3px rgba(0, 0, 0, 0.35);
+ color: #1a2531;
+ background-color: #ffffff;
+ opacity: 1;
+ max-width: 350px;
+ z-index: 1; }
+ .nfv-balloon.ui-draggable-dragging {
+ z-index: 10; }
+ .nfv-balloon .balloon-header {
+ padding: 10px 22px 5px;
+ background-color: #a8bbdc; }
+ .nfv-balloon .balloon-header .balloon-title {
+ color: #253244;
+ margin-bottom: 10px;
+ margin-right: 23px; }
+ .nfv-balloon .balloon-header .ui-button {
+ position: absolute;
+ top: 10px;
+ right: 10px;
+ min-width: 20px;
+ margin-left: 20px; }
+ .nfv-balloon .balloon-content {
+ padding: 5px 22px 10px;
+ overflow: auto;
+ max-height: 250px; }
+ .nfv-balloon .balloon-content .node-attribute {
+ word-wrap: break-word;
+ padding: 10px 0;
+ border-bottom: 1px solid #445a75; }
+
+body.theme2 .nfv-balloon {
+ border: 1px solid #2f2f2f;
+ color: #b9bab5;
+ background-color: #333;
+ box-shadow: 0px 0px 6px 2px rgba(244, 246, 241, 0.8); }
+ body.theme2 .nfv-balloon .balloon-header {
+ background-color: #232323; }
+ body.theme2 .nfv-balloon .balloon-header .balloon-title {
+ color: #9bdb69; }
+ body.theme2 .nfv-balloon .balloon-content .node-attribute {
+ border-bottom: 1px solid #454544; }
+
+.network-graph .element.nfvo rect {
+ stroke-width: 2px;
+ stroke: #445a75;
+ fill: #ecf1f5; }
+ .network-graph .element.nfvo rect.rect-fadeout {
+ -webkit-animation: fadeout 0.25s;
+ -moz-animation: fadeout 0.25s;
+ -ms-animation: fadeout 0.25s;
+ -o-animation: fadeout 0.25s;
+ animation: fadeout 0.25s; }
+
+@keyframes fadeout {
+ from {
+ opacity: 1; }
+ to {
+ opacity: 0.2; } }
+
+@-moz-keyframes fadeout {
+ /* Firefox */
+ from {
+ opacity: 1; }
+ to {
+ opacity: 0.2; } }
+
+@-webkit-keyframes fadeout {
+ /* Safari and Chrome */
+ from {
+ opacity: 1; }
+ to {
+ opacity: 0.2; } }
+
+@-o-keyframes fadeout {
+ /* Opera */
+ from {
+ opacity: 1; }
+ to {
+ opacity: 0.2; } }
+ .network-graph .element.nfvo rect.twins-container, .network-graph .element.nfvo rect.parent-container {
+ opacity: 0.5;
+ stroke-width: 1px;
+ fill: transparent; }
+ .network-graph .element.nfvo rect.node-title-frame {
+ fill: #a8bbdc;
+ stroke: #a8bbdc; }
+ .network-graph .element.nfvo rect.node-title-frame[status="removed"] {
+ fill: #a8bbdc;
+ stroke: #a8bbdc; }
+ .network-graph .element.nfvo rect.node-title-frame[status="completed"] {
+ fill: #1a2531;
+ stroke: #1a2531; }
+ .network-graph .element.nfvo rect.node-title-frame[status="in progress"] {
+ fill: #419ef1;
+ stroke: #419ef1; }
+ .network-graph .element.nfvo rect.node-title-frame[status="warning"] {
+ fill: #ff8a00;
+ stroke: #ff8a00; }
+ .network-graph .element.nfvo rect.node-title-frame[status="error"] {
+ fill: #e65353;
+ stroke: #e65353; }
+ .network-graph .element.nfvo rect.node-title-frame[status="down"] {
+ fill: #445a75;
+ stroke: #445a75; }
+ .network-graph .element.nfvo rect.main-rect[status="removed"] {
+ stroke: #a8bbdc; }
+ .network-graph .element.nfvo rect.main-rect[status="completed"] {
+ stroke: #1a2531; }
+ .network-graph .element.nfvo rect.main-rect[status="in progress"] {
+ stroke: #419ef1; }
+ .network-graph .element.nfvo rect.main-rect[status="warning"] {
+ stroke: #ff8a00; }
+ .network-graph .element.nfvo rect.main-rect[status="error"] {
+ stroke: #e65353; }
+ .network-graph .element.nfvo rect.main-rect[status="down"] {
+ stroke: #445a75; }
+
+.network-graph .element.nfvo path.right-arrow, .network-graph .element.nfvo path.left-arrow {
+ fill: transparent;
+ stroke: #ffffff;
+ stroke-width: 1.5px;
+ cursor: pointer; }
+
+.network-graph .element.nfvo .label {
+ fill: #ffffff; }
+ .network-graph .element.nfvo .label.twins-container-title {
+ fill: #344358; }
+ .network-graph .element.nfvo .label.sub-title {
+ font-size: 12px; }
+
+.network-graph .element.nfvo .port > .port-label {
+ opacity: 0;
+ z-index: 9999999;
+ fill: #1a2531; }
+
+.network-graph .element.nfvo .port > circle {
+ fill: #1a2531;
+ stroke: #ffffff; }
+
+.network-graph .element.nfvo .port:hover .port-label {
+ opacity: 1 !important; }
+
+.network-graph .link .connection {
+ stroke: #a8bbdc;
+ stroke-width: 2px; }
+
+.network-graph .link .marker-target {
+ stroke: #a8bbdc;
+ fill: #b9bab5;
+ stroke-width: 2px; }
+
+.network-graph .link .marker-source {
+ stroke: #b9bab5;
+ fill: #b9bab5; }
+
+.network-graph {
+ height: 690px; }
+
+.tree-graph .node {
+ cursor: pointer; }
+ .tree-graph .node circle {
+ stroke-width: 2px;
+ stroke: #445a75;
+ fill: #ecf1f5; }
+ .tree-graph .node text {
+ fill: #253244;
+ transform: rotate(-25deg); }
+ .tree-graph .node text.removed-node {
+ fill: rgba(37, 50, 68, 0.5); }
+ .tree-graph .node .nodeCircle.new-node {
+ stroke: #ff8a00;
+ stroke-dasharray: 4px; }
+ .tree-graph .node .nodeCircle.removed-node {
+ stroke: rgba(168, 187, 220, 0.5); }
+ .tree-graph .node .nodeCircle.has-children {
+ fill: #a8bbdc; }
+
+.tree-graph .link {
+ fill: none;
+ stroke: #a8bbdc;
+ stroke-width: 1.5px; }
+
+.link-tools .tool-remove {
+ display: none; }
+
+.marker-arrowheads .marker-arrowhead {
+ display: none; }
+
+.marker-vertex-group {
+ display: none; }
+
+.color-legend .statuses .legend, .color-legend .states .legend, .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-status-cell .status {
+ position: relative;
+ margin: 0px 0px 12px 30px; }
+ .color-legend .statuses .legend::before, .color-legend .states .legend::before, .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-status-cell .status::before {
+ width: 20px;
+ height: 20px;
+ position: absolute;
+ content: "";
+ left: -30px; }
+ .color-legend .statuses .up.legend:before, .color-legend .states .up.legend:before, .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-status-cell .up.status:before, .color-legend .statuses .completed.legend:before, .color-legend .states .completed.legend:before, .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-status-cell .completed.status:before {
+ background: #1a2531; }
+ .color-legend .statuses .error.legend:before, .color-legend .states .error.legend:before, .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-status-cell .error.status:before {
+ background: #e65353; }
+ .color-legend .statuses .warning.legend:before, .color-legend .states .warning.legend:before, .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-status-cell .warning.status:before {
+ background: #ff8a00; }
+ .color-legend .statuses .down.legend:before, .color-legend .states .down.legend:before, .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-status-cell .down.status:before {
+ background: #445a75; }
+ .color-legend .statuses .in-progress.legend:before, .color-legend .states .in-progress.legend:before, .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-status-cell .in-progress.status:before {
+ background: #419ef1; }
+ .color-legend .statuses .deleted.legend:before, .color-legend .states .deleted.legend:before, .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-status-cell .deleted.status:before {
+ background: #a8bbdc; }
+ .color-legend .statuses .modified.legend:before, .color-legend .states .modified.legend:before, .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-status-cell .modified.status:before {
+ border: 2px solid #445a75;
+ box-shadow: 0px 0px 5px 2px #3ebd6b; }
+
+.color-legend {
+ padding: 10px; }
+ .color-legend .statuses .title, .color-legend .states .title {
+ text-decoration: underline;
+ margin: 10px 0; }
+ .color-legend .statuses .new .legend, .color-legend .states .new .legend {
+ margin-left: 17px; }
+ .color-legend .statuses .new .legend::before, .color-legend .states .new .legend::before {
+ width: 15px;
+ border: 2px solid #445a75;
+ opacity: 0.5;
+ left: -17px; }
+
+body.theme2 .tree-graph .node circle {
+ stroke: #b9bab5;
+ fill: #2f2f2f; }
+
+body.theme2 .tree-graph .node text {
+ fill: #8ccdf5; }
+ body.theme2 .tree-graph .node text.removed-node {
+ fill: rgba(140, 205, 245, 0.5); }
+
+body.theme2 .tree-graph .node .nodeCircle.new-node {
+ stroke: #f4f6f1; }
+
+body.theme2 .tree-graph .node .nodeCircle.removed-node {
+ stroke: rgba(170, 166, 217, 0.5); }
+
+body.theme2 .tree-graph .node .nodeCircle.has-children {
+ fill: #454544; }
+
+body.theme2 .tree-graph .link {
+ stroke: #b9bab5; }
+
+body.theme2 .network-graph .element.nfvo rect {
+ stroke: #b9bab5;
+ fill: #454544; }
+ body.theme2 .network-graph .element.nfvo rect.twins-container, body.theme2 .network-graph .element.nfvo rect.parent-container {
+ fill: transparent; }
+ body.theme2 .network-graph .element.nfvo rect.node-title-frame {
+ fill: #a8bbdc; }
+ body.theme2 .network-graph .element.nfvo rect.node-title-frame[status="removed"] {
+ fill: rgba(69, 69, 68, 0.7);
+ stroke: rgba(69, 69, 68, 0.7); }
+ body.theme2 .network-graph .element.nfvo rect.node-title-frame[status="completed"] {
+ fill: #b9bab5;
+ stroke: #b9bab5; }
+ body.theme2 .network-graph .element.nfvo rect.node-title-frame[status="in progress"] {
+ fill: #8ccdf5;
+ stroke: #8ccdf5; }
+ body.theme2 .network-graph .element.nfvo rect.node-title-frame[status="warning"] {
+ fill: #f7e385;
+ stroke: #f7e385; }
+ body.theme2 .network-graph .element.nfvo rect.node-title-frame[status="error"] {
+ fill: #ff7c54;
+ stroke: #ff7c54; }
+ body.theme2 .network-graph .element.nfvo rect.node-title-frame[status="down"] {
+ fill: #f4f6f1;
+ stroke: #f4f6f1; }
+ body.theme2 .network-graph .element.nfvo rect.main-rect[status="removed"] {
+ stroke: rgba(69, 69, 68, 0.7); }
+ body.theme2 .network-graph .element.nfvo rect.main-rect[status="completed"] {
+ stroke: #b9bab5; }
+ body.theme2 .network-graph .element.nfvo rect.main-rect[status="in progress"] {
+ stroke: #8ccdf5; }
+ body.theme2 .network-graph .element.nfvo rect.main-rect[status="warning"] {
+ stroke: #f7e385; }
+ body.theme2 .network-graph .element.nfvo rect.main-rect[status="error"] {
+ stroke: #ff7c54; }
+ body.theme2 .network-graph .element.nfvo rect.main-rect[status="down"] {
+ stroke: #f4f6f1; }
+
+body.theme2 .network-graph .element.nfvo path.right-arrow, body.theme2 .network-graph .element.nfvo path.left-arrow {
+ stroke: #232323; }
+
+body.theme2 .network-graph .element.nfvo .label {
+ fill: #232323; }
+ body.theme2 .network-graph .element.nfvo .label.twins-container-title {
+ fill: #f4f6f1; }
+
+body.theme2 .network-graph .element.nfvo .port > .port-label {
+ fill: #b9bab5; }
+
+body.theme2 .network-graph .element.nfvo .port > circle {
+ fill: #292929;
+ stroke: #f4f6f1; }
+
+body.theme2 .network-graph .link .connection {
+ stroke: #b9bab5; }
+
+body.theme2 .network-graph .link .marker-target {
+ stroke: #b9bab5;
+ fill: #b9bab5; }
+
+body.theme2 .network-graph .link .marker-source {
+ stroke: #b9bab5;
+ fill: #b9bab5; }
+
+body.theme2 .color-legend .statuses .up.legend:before, body.theme2 .color-legend .states .up.legend:before, body.theme2 .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-status-cell .up.status:before, body.theme2 .color-legend .statuses .completed.legend:before, body.theme2 .color-legend .states .completed.legend:before, body.theme2 .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-status-cell .completed.status:before {
+ background: #b9bab5; }
+
+body.theme2 .color-legend .statuses .error.legend:before, body.theme2 .color-legend .states .error.legend:before, body.theme2 .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-status-cell .error.status:before {
+ background: #ff7c54; }
+
+body.theme2 .color-legend .statuses .warning.legend:before, body.theme2 .color-legend .states .warning.legend:before, body.theme2 .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-status-cell .warning.status:before {
+ background: #f7e385; }
+
+body.theme2 .color-legend .statuses .down.legend:before, body.theme2 .color-legend .states .down.legend:before, body.theme2 .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-status-cell .down.status:before {
+ background: #f4f6f1; }
+
+body.theme2 .color-legend .statuses .in-progress.legend:before, body.theme2 .color-legend .states .in-progress.legend:before, body.theme2 .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-status-cell .in-progress.status:before {
+ background: #8ccdf5; }
+
+body.theme2 .color-legend .statuses .deleted.legend:before, body.theme2 .color-legend .states .deleted.legend:before, body.theme2 .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-status-cell .deleted.status:before {
+ background: rgba(69, 69, 68, 0.7); }
+
+body.theme2 .color-legend .statuses .modified.legend:before, body.theme2 .color-legend .states .modified.legend:before, body.theme2 .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-status-cell .modified.status:before {
+ border-color: #b9bab5;
+ box-shadow: 0px 0px 5px 2px #9bdb69; }
+
+body.theme2 .color-legend .statuses .new .legend::before, body.theme2 .color-legend .states .new .legend::before {
+ border-color: #b9bab5; }
+
+.nfv-pagination, .uxf-pagination {
+ text-align: right; }
+ .nfv-pagination .nfv-pagination-info, .uxf-pagination .nfv-pagination-info {
+ display: inline-block;
+ margin: 0 16px; }
+ .nfv-pagination .uxf-pagination-goto, .uxf-pagination .uxf-pagination-goto {
+ display: inline; }
+ .nfv-pagination a, .uxf-pagination a {
+ color: #1a2531;
+ cursor: pointer;
+ width: 33px;
+ height: 33px;
+ display: inline-block;
+ text-align: center;
+ border: 1px solid #a8bbdc;
+ line-height: 30px; }
+ .nfv-pagination a.uxf-pagination-page.active, .uxf-pagination a.uxf-pagination-page.active {
+ background-color: #a8bbdc;
+ border: 1px solid #a8bbdc;
+ font-weight: bold;
+ text-decoration: underline; }
+ .nfv-pagination .uxf-pagination-prev, .nfv-pagination .uxf-pagination-prev, .uxf-pagination .uxf-pagination-prev, .uxf-pagination .uxf-pagination-prev {
+ font-weight: bold;
+ color: #419ef1;
+ margin-right: -3px; }
+ .nfv-pagination .uxf-pagination-prev.disable, .nfv-pagination .uxf-pagination-prev.disable, .uxf-pagination .uxf-pagination-prev.disable, .uxf-pagination .uxf-pagination-prev.disable {
+ color: #445a75; }
+ .nfv-pagination .uxf-pagination-next, .nfv-pagination .uxf-pagination-next, .uxf-pagination .uxf-pagination-next, .uxf-pagination .uxf-pagination-next {
+ font-weight: bold;
+ color: #419ef1;
+ margin-left: -2px; }
+ .nfv-pagination .uxf-pagination-next.disable, .nfv-pagination .uxf-pagination-next.disable, .uxf-pagination .uxf-pagination-next.disable, .uxf-pagination .uxf-pagination-next.disable {
+ color: #445a75; }
+
+/* dataTable overrides */
+div.dataTables_paginate > ul.pagination > li > a {
+ border-radius: initial;
+ color: #1a2531; }
+
+div.dataTables_paginate > ul.pagination > li.active > a {
+ background-color: #a8bbdc;
+ border-color: #a8bbdc; }
+
+div.dataTables_paginate > ul.pagination > li.previous > a,
+div.dataTables_paginate > ul.pagination > li.next > a {
+ color: #419ef1; }
+
+div.dataTables_paginate > ul.pagination > li.disabled > a {
+ background-color: transparent;
+ color: #445a75; }
+ div.dataTables_paginate > ul.pagination > li.disabled > a:hover {
+ color: initial; }
+
+body.theme2 {
+ /* dataTable overrides */ }
+ body.theme2 .nfv-pagination a, body.theme2 .uxf-pagination a {
+ color: #b9bab5;
+ border: 1px solid #2f2f2f; }
+ body.theme2 .nfv-pagination a.uxf-pagination-page.active, body.theme2 .uxf-pagination a.uxf-pagination-page.active {
+ background-color: #2f2f2f;
+ border: 1px solid #2f2f2f; }
+ body.theme2 .nfv-pagination .uxf-pagination-prev, body.theme2 .nfv-pagination .uxf-pagination-prev, body.theme2 .uxf-pagination .uxf-pagination-prev, body.theme2 .uxf-pagination .uxf-pagination-prev {
+ font-weight: bold;
+ color: #b9bab5; }
+ body.theme2 .nfv-pagination .uxf-pagination-prev.disable, body.theme2 .nfv-pagination .uxf-pagination-prev.disable, body.theme2 .uxf-pagination .uxf-pagination-prev.disable, body.theme2 .uxf-pagination .uxf-pagination-prev.disable {
+ color: #454544; }
+ body.theme2 .nfv-pagination .uxf-pagination-next, body.theme2 .nfv-pagination .uxf-pagination-next, body.theme2 .uxf-pagination .uxf-pagination-next, body.theme2 .uxf-pagination .uxf-pagination-next {
+ font-weight: bold;
+ color: #b9bab5; }
+ body.theme2 .nfv-pagination .uxf-pagination-next.disable, body.theme2 .nfv-pagination .uxf-pagination-next.disable, body.theme2 .uxf-pagination .uxf-pagination-next.disable, body.theme2 .uxf-pagination .uxf-pagination-next.disable {
+ color: #454544; }
+ body.theme2 div.dataTables_paginate > ul.pagination > li > a {
+ color: #b9bab5; }
+ body.theme2 div.dataTables_paginate > ul.pagination > li.active > a {
+ color: #9bdb69;
+ background-color: #333;
+ border-color: #333; }
+ body.theme2 div.dataTables_paginate > ul.pagination > li.previous > a,
+ body.theme2 div.dataTables_paginate > ul.pagination > li.next > a {
+ color: #b9bab5; }
+ body.theme2 div.dataTables_paginate > ul.pagination > li.disabled > a {
+ background-color: transparent;
+ color: #454544; }
+
+.nfv-notifications-manager {
+ position: fixed;
+ top: 40px;
+ width: 50%;
+ left: 25%;
+ z-index: 99999; }
+
+.notification {
+ position: relative;
+ padding-left: 5px;
+ padding-right: 5px;
+ height: 0px;
+ background: #ffffff;
+ border: 1px solid #419ef1;
+ border-top: 0;
+ line-height: 40px;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ color: #253244; }
+ .notification .notification-icon {
+ padding: 5px;
+ margin-right: 5px;
+ margin-left: 30px;
+ vertical-align: middle;
+ font-family: FontAwesome; }
+ .notification .notification-icon.error-icon:before {
+ content: "\f057";
+ color: #e65353; }
+ .notification .notification-icon.success-icon:before {
+ content: "\f058";
+ color: #3ebd6b; }
+ .notification .notification-icon.warning-icon:before {
+ content: "\f071";
+ color: #ff8a00; }
+ .notification .notification-header {
+ display: inline;
+ margin-right: 5px; }
+ .notification .notification-header.error {
+ color: #e65353; }
+ .notification .notification-header::after {
+ content: "!"; }
+ .notification .notification-content.error {
+ color: #e65353; }
+ .notification .notification-content .notification-secondary {
+ display: block;
+ margin-left: 64px;
+ margin-right: 49px;
+ position: relative;
+ top: -13px;
+ color: #445a75;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ line-height: 19px; }
+ .notification .close-button {
+ position: absolute;
+ top: 0px;
+ right: 0px;
+ font-size: 36px;
+ color: #253244;
+ text-shadow: 0 1px 0 #ffffff;
+ opacity: 0.2;
+ filter: alpha(opacity=20);
+ vertical-align: middle;
+ height: 100%;
+ cursor: pointer !important;
+ margin-right: 30px;
+ margin-left: 17px; }
+ .notification .close-button:hover {
+ text-decoration: none; }
+
+body.theme2 .notification {
+ background: #454544;
+ border-color: #2f2f2f;
+ color: #b9bab5; }
+ body.theme2 .notification .notification-icon.error-icon:before {
+ color: #ff7c54; }
+ body.theme2 .notification .notification-icon.success-icon:before {
+ color: #9bdb69; }
+ body.theme2 .notification .notification-icon.warning-icon:before {
+ color: #f7e385; }
+ body.theme2 .notification .notification-content .notification-secondary {
+ color: #b9bab5; }
+
+body.theme2 .close-button {
+ color: #b9bab5;
+ text-shadow: 0 1px 0 #f4f6f1; }
+
+/* dataTable overrides */
+.data-table-wrapper {
+ position: relative;
+ transition: background-color 0.2s, color 0.2s, border 0.2s; }
+ .data-table-wrapper table.dataTable.table-striped > tbody > tr:nth-of-type(even) {
+ background-color: #ecf1f5; }
+ .data-table-wrapper table.dataTable.table-striped > tbody > tr:nth-of-type(odd) {
+ background-color: #e1e8f1; }
+ .data-table-wrapper table.dataTable.table-striped > tbody > tr:nth-of-type(even):hover,
+ .data-table-wrapper table.dataTable.table-striped > tbody > tr:nth-of-type(odd):hover {
+ background-color: #f6e6cd; }
+ .data-table-wrapper table.dataTable > thead > tr,
+ .data-table-wrapper table.dataTable > tbody > tr {
+ transition: background-color 0.2s; }
+ .data-table-wrapper table.dataTable > thead > tr > th,
+ .data-table-wrapper table.dataTable .dataTables_wrapper.no-footer .dataTables_scrollBody {
+ border-bottom: 1px solid #a8bbdc; }
+ .data-table-wrapper table.dataTable > tbody > tr > td,
+ .data-table-wrapper table.dataTable > thead > tr > th {
+ border-left: 1px solid #a8bbdc;
+ border-top: 1px solid #a8bbdc; }
+ .data-table-wrapper table.dataTable > tbody > tr:first-child > td {
+ border-top: none; }
+ .data-table-wrapper table.dataTable > tbody > tr > td:last-child,
+ .data-table-wrapper table.dataTable > thead > tr > th:last-child {
+ border-right: 1px solid #a8bbdc; }
+ .data-table-wrapper table.dataTable > tbody > tr:hover {
+ background-color: #f6e6cd;
+ cursor: pointer; }
+ .data-table-wrapper table.dataTable > tbody > tr > td.dataTables_empty {
+ pointer-events: none; }
+ .data-table-wrapper table.dataTable > thead > tr > th:hover {
+ background-color: #f6e6cd; }
+ .data-table-wrapper div.dataTables_wrapper {
+ bottom: 30px;
+ left: 30px;
+ position: absolute;
+ right: 30px;
+ top: 30px;
+ width: auto; }
+ .data-table-wrapper div.dataTables_wrapper label select,
+ .data-table-wrapper div.dataTables_wrapper label input {
+ outline: 0;
+ height: 30px; }
+ .data-table-wrapper div.dataTables_wrapper.no-footer .dataTables_scrollBody {
+ border-bottom: 1px solid rgba(168, 187, 220, 0.3); }
+ .data-table-wrapper div.dataTables_wrapper .ColVis_Button.ColVis_MasterButton {
+ background: none;
+ border: none;
+ box-shadow: none;
+ color: #ff8a00 !important;
+ font-family: FontAwesome;
+ font-size: 21px;
+ margin-left: 15px;
+ outline: 0px; }
+ .data-table-wrapper div.dataTables_wrapper .ColVis_Button.ColVis_MasterButton:before {
+ content: '\f013'; }
+ .data-table-wrapper div.dataTables_wrapper .ColVis_Button.ColVis_MasterButton span {
+ display: none; }
+ .data-table-wrapper .dataTables_wrapper .dataTables_length,
+ .data-table-wrapper .dataTables_wrapper .dataTables_filter,
+ .data-table-wrapper .dataTables_wrapper .dataTables_info,
+ .data-table-wrapper .dataTables_wrapper .dataTables_processing,
+ .data-table-wrapper .dataTables_wrapper .dataTables_paginate {
+ color: #1a2531; }
+ .data-table-wrapper .dataTables_wrapper .dataTables_length .form-control.input-sm {
+ appearance: none;
+ -moz-appearance: none;
+ -webkit-appearance: none;
+ background: url("../images/images_theme_1/drop_down_down_arrow.png") no-repeat 102% #ffffff;
+ padding: 0 17px 0 10px;
+ text-align: left;
+ border: 1px solid #a8bbdc; }
+ .data-table-wrapper .dataTables_wrapper .dataTables_filter .form-control.input-sm {
+ border-radius: 2px;
+ border: none;
+ border-bottom: 1px solid #a8bbdc; }
+
+body.theme2 .data-table-wrapper table.dataTable thead tr th {
+ color: #aaa6d9; }
+
+body.theme2 .data-table-wrapper table.dataTable.table-striped > tbody > tr:nth-of-type(even) {
+ background-color: #333; }
+
+body.theme2 .data-table-wrapper table.dataTable.table-striped > tbody > tr:nth-of-type(odd) {
+ background-color: #292929; }
+
+body.theme2 .data-table-wrapper table.dataTable.table-striped > tbody > tr:nth-of-type(even):hover,
+body.theme2 .data-table-wrapper table.dataTable.table-striped > tbody > tr:nth-of-type(odd):hover {
+ background-color: #454544; }
+
+body.theme2 .data-table-wrapper table.dataTable > thead > tr,
+body.theme2 .data-table-wrapper table.dataTable > tbody > tr {
+ transition: background-color 0.2s; }
+
+body.theme2 .data-table-wrapper table.dataTable > thead > tr > th,
+body.theme2 .data-table-wrapper table.dataTable .dataTables_wrapper.no-footer .dataTables_scrollBody {
+ border-bottom: 1px solid #2f2f2f; }
+
+body.theme2 .data-table-wrapper table.dataTable > tbody > tr > td,
+body.theme2 .data-table-wrapper table.dataTable > thead > tr > th {
+ border-left: 1px solid #2f2f2f;
+ border-top: 1px solid #2f2f2f; }
+
+body.theme2 .data-table-wrapper table.dataTable > tbody > tr:first-child > td {
+ border-top: none; }
+
+body.theme2 .data-table-wrapper table.dataTable > tbody > tr > td:last-child,
+body.theme2 .data-table-wrapper table.dataTable > thead > tr > th:last-child {
+ border-right: 1px solid #2f2f2f; }
+
+body.theme2 .data-table-wrapper table.dataTable > tbody > tr:hover {
+ background-color: #454544;
+ cursor: pointer; }
+
+body.theme2 .data-table-wrapper table.dataTable > tbody > tr > td.dataTables_empty {
+ pointer-events: none; }
+
+body.theme2 .data-table-wrapper table.dataTable > thead > tr > th:hover {
+ background-color: #454544; }
+
+body.theme2 .data-table-wrapper .dataTables_wrapper .dataTables_length,
+body.theme2 .data-table-wrapper .dataTables_wrapper .dataTables_filter,
+body.theme2 .data-table-wrapper .dataTables_wrapper .dataTables_info,
+body.theme2 .data-table-wrapper .dataTables_wrapper .dataTables_processing,
+body.theme2 .data-table-wrapper .dataTables_wrapper .dataTables_paginate {
+ color: #8ccdf5; }
+
+body.theme2 .data-table-wrapper .dataTables_wrapper .dataTables_length .form-control.input-sm {
+ color: #b9bab5;
+ background: url("../images/images_theme_1/drop_down_down_arrow.png") no-repeat 102% #232323;
+ border: 1px solid #333; }
+
+body.theme2 .data-table-wrapper div.dataTables_wrapper.no-footer .dataTables_scrollBody {
+ border-bottom: 1px solid #454544; }
+
+body.theme2 .data-table-wrapper div.dataTables_wrapper label select,
+body.theme2 .data-table-wrapper div.dataTables_wrapper label input {
+ background-color: #232323;
+ color: #b9bab5; }
+
+body.theme2 .data-table-wrapper div.dataTables_wrapper .ColVis_Button.ColVis_MasterButton {
+ color: #8ccdf5 !important; }
+ body.theme2 .data-table-wrapper div.dataTables_wrapper .ColVis_Button.ColVis_MasterButton span {
+ display: none; }
+
+.topology-view .controllers {
+ width: 50px;
+ z-index: 20;
+ position: fixed; }
+ .topology-view .controllers .tree-toggle-button, .topology-view .controllers .network-toggle-button, .topology-view .controllers .service-toggle-button {
+ border: none;
+ min-width: 50px; }
+ .topology-view .controllers .tree-toggle-button .ui-button-text, .topology-view .controllers .network-toggle-button .ui-button-text, .topology-view .controllers .service-toggle-button .ui-button-text {
+ font-size: 20px;
+ padding: 0; }
+ .topology-view .controllers .tree-toggle-button.active, .topology-view .controllers .network-toggle-button.active, .topology-view .controllers .service-toggle-button.active {
+ color: #419ef1; }
+ .topology-view .controllers .diff-ind {
+ display: inline-block; }
+
+.network-topology-view .color-legend-icon {
+ display: inline-block;
+ position: absolute;
+ bottom: 10px;
+ left: 30px;
+ font-size: 25px; }
+
+.network-topology-view .right-click-context-menu {
+ display: none;
+ position: fixed;
+ border: 1px solid #1a2531;
+ box-shadow: 0px 1px 7px #1a2531;
+ background: #ecf1f5;
+ padding: 15px; }
+ .network-topology-view .right-click-context-menu .context-menu-item {
+ padding-top: 4px;
+ border-bottom: 2px solid #ecf1f5; }
+ .network-topology-view .right-click-context-menu .context-menu-item:first-child {
+ padding-top: 0; }
+ .network-topology-view .right-click-context-menu .context-menu-item:hover {
+ cursor: pointer;
+ display: inline-block;
+ border-bottom: 2px solid #419ef1; }
+
+.network-topology-view .right-pane-controller {
+ position: fixed;
+ right: -28%;
+ width: 28%;
+ top: 0;
+ background: rgba(255, 255, 255, 0.95);
+ border: 1px solid #253244;
+ height: 97%;
+ box-shadow: -3px 3px 10px 0px #1a2531;
+ z-index: 100; }
+ .network-topology-view .right-pane-controller .header {
+ padding: 10px;
+ background: #445a75;
+ color: #ecf1f5;
+ cursor: move; }
+ .network-topology-view .right-pane-controller .header .node-attributes-title {
+ display: inline-block; }
+ .network-topology-view .right-pane-controller .header .toggle {
+ float: right;
+ display: inline-block;
+ cursor: pointer;
+ font-size: 22px; }
+ .network-topology-view .right-pane-controller .header .toggle * {
+ margin-left: 5px; }
+ .network-topology-view .right-pane-controller .header .toggle .minimize {
+ vertical-align: text-bottom; }
+ .network-topology-view .right-pane-controller .header .toggle .minimize:hover, .network-topology-view .right-pane-controller .header .toggle .hide:hover {
+ color: #ff8a00; }
+ .network-topology-view .right-pane-controller .node-attributes .nfv-tabs-v3 {
+ padding: 10px; }
+ .network-topology-view .right-pane-controller .node-attributes .node-attributes-list {
+ overflow: auto;
+ height: 71vh; }
+ .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .node-attribute-list-item {
+ display: table;
+ width: 100%; }
+ .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .node-attribute-list-item .node-attribute {
+ display: table-cell;
+ padding: 5px 0 5px 10px;
+ max-width: 0px;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ white-space: nowrap; }
+ .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .node-attribute-list-item .node-attribute.name {
+ border-right: 1px solid #a8bbdc; }
+ .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .node-attribute-list-item:first-child {
+ border-top: 1px solid #a8bbdc;
+ border-bottom: 1px solid #a8bbdc; }
+ .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .node-attribute-list-item:last-child {
+ border-bottom: none; }
+ .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .node-attribute-list-item:nth-child(even) {
+ background: rgba(168, 187, 220, 0.2); }
+ .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .node-attribute-list-item:hover, .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .node-attribute-list-item.selected {
+ background: rgba(65, 158, 241, 0.5); }
+ .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-item .node-attribute.name, .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-header .node-attribute.name {
+ width: 85%;
+ text-align: center; }
+ .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-item .node-attribute.value, .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-header .node-attribute.value {
+ width: 15%;
+ text-align: center; }
+ .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-status-cell .status::before {
+ border-radius: 50%; }
+ .network-topology-view .right-pane-controller .node-attributes .nfv-collapsible-item .nfv-collapsible-title {
+ margin-bottom: 0;
+ height: 50px; }
+ .network-topology-view .right-pane-controller .node-attributes .nfv-collapsible-item .nfv-collapsible-content .kpi-item {
+ display: inline-block;
+ margin: 0 22px;
+ text-align: center; }
+ .network-topology-view .right-pane-controller .node-attributes .nfv-collapsible-item .nfv-collapsible-content .kpi-item .kpi-item-icon {
+ width: 30px;
+ height: 30px;
+ background-position-y: -27px; }
+ .network-topology-view .right-pane-controller .node-attributes .nfv-collapsible-item .nfv-collapsible-content .kpi-item .kpi-item-icon.cpu {
+ background-image: url("../images/images_theme_1/cpu.png");
+ background-repeat: no-repeat; }
+ .network-topology-view .right-pane-controller .node-attributes .nfv-collapsible-item .nfv-collapsible-content .kpi-item .kpi-item-icon.disk {
+ background-image: url("../images/images_theme_1/disk.png");
+ background-repeat: no-repeat; }
+ .network-topology-view .right-pane-controller .node-attributes .nfv-collapsible-item .nfv-collapsible-content .kpi-item .kpi-item-icon.memory {
+ background-image: url("../images/images_theme_1/memory.png");
+ background-repeat: no-repeat; }
+ .network-topology-view .right-pane-controller .node-attributes .nfv-collapsible-item .nfv-collapsible-content .kpi-item .kpi-item-icon.network {
+ background-image: url("../images/images_theme_1/network.png");
+ background-repeat: no-repeat; }
+ .network-topology-view .right-pane-controller .node-attributes .nfv-collapsible-item .nfv-collapsible-content .kpi-item .kpi-item-name {
+ text-transform: uppercase; }
+ .network-topology-view .right-pane-controller .kpi-graph {
+ overflow: hidden;
+ left: -315px;
+ top: 200px;
+ box-shadow: -3px 3px 10px 0px #1a2531; }
+ .network-topology-view .right-pane-controller .kpi-graph .header {
+ padding: 5px; }
+ .network-topology-view .right-pane-controller .kpi-graph .kpi-graph-area {
+ background: #ffffff;
+ border: 1px solid #253244; }
+ .network-topology-view .right-pane-controller .kpi-graph .kpi-graph-area .highcharts-container {
+ margin-top: 20px; }
+
+body.theme2 .topology-view .tree-toggle-button.active, body.theme2 .topology-view .network-toggle-button.active, body.theme2 .topology-view .service-toggle-button.active {
+ color: #9bdb69; }
+
+body.theme2 .network-topology-view .color-legend-icon {
+ color: #f7e385; }
+
+body.theme2 .network-topology-view .right-click-context-menu {
+ border: 1px solid #b9bab5;
+ box-shadow: 0px 1px 7px #b9bab5;
+ background: #232323; }
+ body.theme2 .network-topology-view .right-click-context-menu .context-menu-item {
+ border-bottom: 2px solid #232323; }
+ body.theme2 .network-topology-view .right-click-context-menu .context-menu-item:hover {
+ border-bottom: 2px solid #8ccdf5; }
+
+body.theme2 .network-topology-view .right-pane-controller {
+ background: #232323;
+ border-color: #333;
+ box-shadow: -3px 3px 10px 0px #333; }
+ body.theme2 .network-topology-view .right-pane-controller .header {
+ background: #232323;
+ color: #9bdb69; }
+ body.theme2 .network-topology-view .right-pane-controller .header .toggle .minimize:hover, body.theme2 .network-topology-view .right-pane-controller .header .toggle .hide:hover {
+ color: #ff8a00; }
+ body.theme2 .network-topology-view .right-pane-controller .node-attributes .ui-tabs-panel {
+ border-color: transparent; }
+ body.theme2 .network-topology-view .right-pane-controller .node-attributes [id=tabs-kpi] .node-attributes-list .node-attribute-list-item:nth-child(even) {
+ background: inherit; }
+ body.theme2 .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .node-attribute-list-item .node-attribute.name {
+ border-right-color: #333; }
+ body.theme2 .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .node-attribute-list-item:first-child {
+ border-top: 1px solid #333;
+ border-bottom: 1px solid #333;
+ color: #aaa6d9; }
+ body.theme2 .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .node-attribute-list-item:nth-child(even) {
+ background: #292929; }
+ body.theme2 .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .node-attribute-list-item:hover, body.theme2 .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .node-attribute-list-item.selected {
+ background: rgba(140, 205, 245, 0.5); }
+ body.theme2 .network-topology-view .right-pane-controller .node-attributes .nfv-collapsible-item .nfv-collapsible-content .kpi-item {
+ display: inline-block;
+ margin: 0 22px;
+ text-align: center; }
+ body.theme2 .network-topology-view .right-pane-controller .node-attributes .nfv-collapsible-item .nfv-collapsible-content .kpi-item .kpi-item-icon {
+ background-position-y: 0px; }
+ body.theme2 .network-topology-view .right-pane-controller .node-attributes .nfv-collapsible-item .nfv-collapsible-content .kpi-item .kpi-item-value {
+ color: #f4f6f1; }
+ body.theme2 .network-topology-view .right-pane-controller .node-attributes .nfv-collapsible-item .nfv-collapsible-content .kpi-item .kpi-item-name {
+ color: #9bdb69; }
+ body.theme2 .network-topology-view .right-pane-controller .kpi-graph {
+ box-shadow: -1px 1px 5px 0px #b9bab5; }
+ body.theme2 .network-topology-view .right-pane-controller .kpi-graph .kpi-graph-area {
+ background: #333;
+ border-color: #2f2f2f; }
+ body.theme2 .network-topology-view .right-pane-controller .kpi-graph .highcharts-container .highcharts-background {
+ fill: #333; }
+ body.theme2 .network-topology-view .right-pane-controller .kpi-graph .highcharts-container tspan {
+ fill: #f4f6f1; }
+ body.theme2 .network-topology-view .right-pane-controller .kpi-graph .highcharts-container .highcharts-tooltip rect:nth-child(4) {
+ fill: #232323; }
+
+.nfv-loader {
+ background-color: rgba(0, 0, 0, 0.65);
+ position: fixed;
+ top: 0;
+ left: 0;
+ z-index: 200001;
+ width: 100%;
+ height: 100%; }
+ .nfv-loader .loading {
+ width: 200px;
+ height: 200px;
+ position: absolute;
+ top: 40%;
+ left: 45%; }
+ .nfv-loader .loading .circle {
+ border-radius: 100%;
+ border-top: 5px solid #419ef1;
+ margin: auto;
+ transform-origin: 50%;
+ position: relative; }
+ .nfv-loader .loading .s_3 {
+ width: 200px;
+ height: 200px;
+ animation: rot_right 2s infinite linear;
+ -webkit-animation: rot_right 2s infinite linear;
+ transition: 2s;
+ -webkit-transition: 2s; }
+ .nfv-loader .loading .s_2 {
+ width: 150px;
+ height: 150px;
+ margin-top: 10px;
+ animation: rot_left 2s infinite linear;
+ -webkit-animation: rot_left 2s infinite linear;
+ transition: 2s;
+ -webkit-transition: 2s;
+ margin-top: -190px; }
+ .nfv-loader .loading .s_1 {
+ width: 100px;
+ height: 100px;
+ margin-top: 10px;
+ animation: rot_right 2s infinite linear;
+ -webkit-animation: rot_right 2s infinite linear;
+ transition: 2s;
+ -webkit-transition: 2s;
+ margin-top: -140px; }
+
+@keyframes rot_right {
+ from {
+ transform: rotate(0deg); }
+ to {
+ transform: rotate(360deg); } }
+
+@-webkit-keyframes rot_right {
+ from {
+ transform: rotate(0deg); }
+ to {
+ transform: rotate(360deg); } }
+
+@keyframes rot_left {
+ from {
+ transform: rotate(360deg); }
+ to {
+ transform: rotate(0deg); } }
+
+@-webkit-keyframes rot_left {
+ from {
+ transform: rotate(360deg); }
+ to {
+ transform: rotate(0deg); } }
+ .nfv-loader .loading .s_title {
+ border: 0;
+ color: white;
+ text-align: center;
+ margin-top: -60px;
+ animation: blink 2s infinite linear;
+ -webkit-animation: blink 2s infinite linear;
+ transition: 2s;
+ -webkit-transition: 2s;
+ letter-spacing: 1px; }
+
+@keyframes blink {
+ 0% {
+ opacity: 1; }
+ 50% {
+ opacity: 0.5; }
+ 100% {
+ opacity: 1; } }
+
+@-webkit-keyframes blink {
+ 0% {
+ opacity: 1; }
+ 50% {
+ opacity: 0.5; }
+ 100% {
+ opacity: 1; } }
+
+/* Components */
+.tasks-handler, .parameters-tab .tasks-handler {
+ position: absolute;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 170px; }
+ .tasks-handler .reject-button {
+ display: inline-block;
+ margin-top: 18px; }
+ .tasks-handler .right-side-buttons {
+ position: absolute;
+ display: inline-block;
+ top: 12px;
+ right: 2%; }
+ .tasks-handler .right-side-buttons .skip-to-end-button {
+ display: none; }
+ .tasks-handler .right-side-buttons .approve-button {
+ position: initial !important;
+ margin-left: 30px; }
+
+.not-editable {
+ pointer-events: none; }
+ .not-editable input, .not-editable select {
+ border: none;
+ background: #ffffff; }
+
+.service-attributes {
+ overflow-y: auto;
+ margin-top: 30px;
+ margin-bottom: 30px; }
+ .service-attributes .mandatory {
+ margin-bottom: 30px; }
+ .service-attributes .form-container .form-element--label {
+ margin-bottom: 15px;
+ border-left: none;
+ position: relative; }
+ .service-attributes .form-element {
+ padding-top: 20px;
+ border-left: 3px solid #419ef1; }
+ .service-attributes .form-element .form-element--label {
+ display: inline-block;
+ margin-right: 10px;
+ min-width: 200px;
+ padding-left: 20px; }
+ .service-attributes .form-element input {
+ min-width: 150px; }
+ .service-attributes .form-element select {
+ min-width: 172px; }
+ .service-attributes .form-element .form-element--error-message {
+ display: block;
+ margin-left: 235px; }
+ .service-attributes .form-element-container {
+ margin-bottom: 80px; }
+ .service-attributes .previous-value {
+ margin-left: 50px; }
+ .service-attributes .previous-value:before {
+ content: "Previous: "; }
+
+.orchestration-tree {
+ width: 120%; }
+
+.launch-service-wizard .nfv-wizard-content {
+ background: #ffffff;
+ padding-left: 30px;
+ padding-top: 30px;
+ position: absolute;
+ overflow-x: hidden;
+ overflow-y: auto;
+ top: 58px;
+ left: 0px;
+ bottom: 64px;
+ right: 0px; }
+ .launch-service-wizard .nfv-wizard-content .select-service-title, .launch-service-wizard .nfv-wizard-content .launch-service-title, .launch-service-wizard .nfv-wizard-content .parameters-service-title {
+ color: #253244;
+ margin-bottom: 30px; }
+ .launch-service-wizard .nfv-wizard-content .service-list-item {
+ display: inline-block;
+ background-color: rgba(236, 241, 245, 0.5);
+ padding-top: 15px;
+ width: 202px;
+ margin: 0 15px 15px 0;
+ height: 130px;
+ cursor: pointer;
+ transition: background-color 0.25s; }
+ .launch-service-wizard .nfv-wizard-content .service-list-item:hover {
+ background-color: #ecf1f5; }
+ .launch-service-wizard .nfv-wizard-content .service-list-item .service-image {
+ text-align: center;
+ font-size: 44px; }
+ .launch-service-wizard .nfv-wizard-content .service-list-item .service-name {
+ text-align: center;
+ display: block;
+ /* Fallback for non-webkit */
+ display: -webkit-box;
+ max-width: 170px;
+ height: 49.5px;
+ /* Fallback for non-webkit */
+ margin: 10px auto 0;
+ font-size: 15px;
+ line-height: 1.1;
+ -webkit-line-clamp: 3;
+ -webkit-box-orient: vertical;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ word-wrap: break-word; }
+
+.launch-service-wizard .wizard-nav-controls .skip-to-end {
+ position: absolute;
+ right: 160px; }
+
+body.theme2 .not-editable input, body.theme2 .not-editable select {
+ background: #232323; }
+
+body.theme2 .service-attributes .form-container .form-element--label::before {
+ background-color: #333; }
+
+body.theme2 .service-attributes .form-element {
+ border-left: 3px solid #8ccdf5; }
+
+body.theme2 .launch-service-wizard .nfv-wizard-content {
+ background: #232323;
+ padding-left: 30px; }
+ body.theme2 .launch-service-wizard .nfv-wizard-content .select-service-title, body.theme2 .launch-service-wizard .nfv-wizard-content .launch-service-title, body.theme2 .launch-service-wizard .nfv-wizard-content .parameters-service-title {
+ color: #aaa6d9; }
+ body.theme2 .launch-service-wizard .nfv-wizard-content .service-list-item {
+ background-color: rgba(47, 47, 47, 0.8); }
+ body.theme2 .launch-service-wizard .nfv-wizard-content .service-list-item:hover {
+ background-color: #2f2f2f; }
+
+.system-events .dataTable .column.type .type-icon, .service-events-tab .service-events .dataTable .column.type .type-icon {
+ width: 100%;
+ height: 28px;
+ font-family: FontAwesome;
+ font-size: 20px;
+ text-align: center; }
+ .system-events .dataTable .column.type .type-icon.error, .service-events-tab .service-events .dataTable .column.type .type-icon.error {
+ color: #e65353; }
+ .system-events .dataTable .column.type .type-icon.error:before, .service-events-tab .service-events .dataTable .column.type .type-icon.error:before {
+ content: '\f05c'; }
+ .system-events .dataTable .column.type .type-icon.info, .service-events-tab .service-events .dataTable .column.type .type-icon.info {
+ color: #419ef1; }
+ .system-events .dataTable .column.type .type-icon.info:before, .service-events-tab .service-events .dataTable .column.type .type-icon.info:before {
+ content: '\f05a'; }
+ .system-events .dataTable .column.type .type-icon.warning, .service-events-tab .service-events .dataTable .column.type .type-icon.warning {
+ color: #419ef1; }
+ .system-events .dataTable .column.type .type-icon.warning:before, .service-events-tab .service-events .dataTable .column.type .type-icon.warning:before {
+ content: '\f071'; }
+
+.system-events .dataTable .column.message .column-cell-content .flexible-content, .service-events-tab .service-events .dataTable .column.message .column-cell-content .flexible-content {
+ display: flex;
+ flex-wrap: nowrap; }
+ .system-events .dataTable .column.message .column-cell-content .flexible-content .service-message, .service-events-tab .service-events .dataTable .column.message .column-cell-content .flexible-content .service-message {
+ flex-basis: 85%;
+ width: 50px;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ padding-right: 20px; }
+ .system-events .dataTable .column.message .column-cell-content .flexible-content .nfv-secondary-button, .service-events-tab .service-events .dataTable .column.message .column-cell-content .flexible-content .nfv-secondary-button, .system-events .dataTable .column.message .column-cell-content .flexible-content .ui-dialog[role="dialog"] .ui-dialog-buttonset, .ui-dialog[role="dialog"] .system-events .dataTable .column.message .column-cell-content .flexible-content .ui-dialog-buttonset, .service-events-tab .service-events .dataTable .column.message .column-cell-content .flexible-content .ui-dialog[role="dialog"] .ui-dialog-buttonset, .ui-dialog[role="dialog"] .service-events-tab .service-events .dataTable .column.message .column-cell-content .flexible-content .ui-dialog-buttonset {
+ flex-basis: 15%;
+ flex-shrik: 0; }
+ .system-events .dataTable .column.message .column-cell-content .flexible-content .nfv-secondary-button .uxf-button, .service-events-tab .service-events .dataTable .column.message .column-cell-content .flexible-content .nfv-secondary-button .uxf-button, .system-events .dataTable .column.message .column-cell-content .flexible-content .ui-dialog[role="dialog"] .ui-dialog-buttonset .uxf-button, .ui-dialog[role="dialog"] .system-events .dataTable .column.message .column-cell-content .flexible-content .ui-dialog-buttonset .uxf-button, .service-events-tab .service-events .dataTable .column.message .column-cell-content .flexible-content .ui-dialog[role="dialog"] .ui-dialog-buttonset .uxf-button, .ui-dialog[role="dialog"] .service-events-tab .service-events .dataTable .column.message .column-cell-content .flexible-content .ui-dialog-buttonset .uxf-button {
+ width: 75px;
+ min-width: 0; }
+ .system-events .dataTable .column.message .column-cell-content .flexible-content .nfv-secondary-button .ui-button-text, .service-events-tab .service-events .dataTable .column.message .column-cell-content .flexible-content .nfv-secondary-button .ui-button-text, .system-events .dataTable .column.message .column-cell-content .flexible-content .ui-dialog[role="dialog"] .ui-dialog-buttonset .ui-button-text, .ui-dialog[role="dialog"] .system-events .dataTable .column.message .column-cell-content .flexible-content .ui-dialog-buttonset .ui-button-text, .service-events-tab .service-events .dataTable .column.message .column-cell-content .flexible-content .ui-dialog[role="dialog"] .ui-dialog-buttonset .ui-button-text, .ui-dialog[role="dialog"] .service-events-tab .service-events .dataTable .column.message .column-cell-content .flexible-content .ui-dialog-buttonset .ui-button-text {
+ padding: 3px 0; }
+
+.system-events .dataTable .column.where .column-cell-content, .service-events-tab .service-events .dataTable .column.where .column-cell-content {
+ max-width: 160px;
+ min-width: 150px; }
+
+.system-events .dataTable .column.component .column-cell-content, .service-events-tab .service-events .dataTable .column.component .column-cell-content {
+ display: table-cell;
+ margin-right: 25px;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ max-width: 170px; }
+
+body.theme2 .system-events .dataTable .column.type .type-icon.error, body.theme2 .service-events-tab .service-events .dataTable .column.type .type-icon.error, .service-events-tab body.theme2 .service-events .dataTable .column.type .type-icon.error {
+ color: #ff7c54; }
+
+body.theme2 .system-events .dataTable .column.type .type-icon.info, body.theme2 .service-events-tab .service-events .dataTable .column.type .type-icon.info, .service-events-tab body.theme2 .service-events .dataTable .column.type .type-icon.info {
+ color: #8ccdf5; }
+
+body.theme2 .system-events .dataTable .column.type .type-icon.warning, body.theme2 .service-events-tab .service-events .dataTable .column.type .type-icon.warning, .service-events-tab body.theme2 .service-events .dataTable .column.type .type-icon.warning {
+ color: #f7e385; }
+
+.service-details .activities-button {
+ float: right !important; }
+ .service-details .activities-button .uxf-button.ui-button.ui-widget.ui-state-default.ui-corner-all.ui-button-text-only {
+ border: 1px solid #253244;
+ color: #253244;
+ background-color: #ffffff; }
+ .service-details .activities-button .uxf-button.ui-button.ui-widget.ui-state-default.ui-corner-all.ui-button-text-only:hover {
+ color: #419ef1;
+ border: 1px solid #419ef1; }
+ @media screen and (max-width: 1024px) {
+ .service-details .activities-button .uxf-button {
+ margin: 8px;
+ min-width: 80px; }
+ .service-details .activities-button .uxf-button .ui-button-text {
+ padding: 0px 5px; } }
+
+@media screen and (max-width: 1024px) {
+ .service-details .nfv-tabs-v1 li.ui-state-default {
+ margin: 0 30px; } }
+
+.service-details .services-tabs {
+ left: 0px;
+ position: fixed;
+ right: 0px;
+ top: 70px;
+ transition: background-color 0.2s;
+ z-index: 100; }
+
+.service-details div[role="tabpanel"].ui-tabs-panel {
+ padding-top: 40px; }
+
+.service-details .workflow-view .refresh-button {
+ border: none; }
+ .service-details .workflow-view .refresh-button .ui-button-text {
+ font-size: 30px;
+ padding: 0; }
+
+/* service overview tab */
+.service-overview-tab .service-metrics {
+ padding: 14px 14px 0px 14px; }
+ .service-overview-tab .service-metrics .service-metric {
+ background-color: rgba(236, 241, 245, 0.5);
+ display: inline-block;
+ transition: background-color 0.2s;
+ padding: 10px; }
+ @media screen and (max-width: 1024px) {
+ .service-overview-tab .service-metrics .service-metric {
+ padding: 5px; }
+ .service-overview-tab .service-metrics .service-metric:first-child {
+ padding-top: 6px; } }
+ @media screen and (min-width: 1224px) {
+ .service-overview-tab .service-metrics .service-metric {
+ min-width: 150px;
+ margin-right: 12px; } }
+ .service-overview-tab .service-metrics .service-metric .vnf-icon, .service-overview-tab .service-metrics .service-metric .vm-icon {
+ font-size: 55px;
+ display: inline-block;
+ position: relative;
+ top: -5px; }
+ .service-overview-tab .service-metrics .service-metric .metric-details {
+ display: inline-block;
+ line-height: 1.0;
+ margin-left: 15px; }
+ .service-overview-tab .service-metrics .service-status .service-status-icon {
+ display: inline-block;
+ padding-right: 20px;
+ font-size: 55px;
+ position: relative;
+ top: -5px; }
+ .service-overview-tab .service-metrics .service-status .service-status-icon.active i:before {
+ color: #419ef1;
+ content: '\f046'; }
+ .service-overview-tab .service-metrics .service-status .service-status-icon.new i:before,
+ .service-overview-tab .service-metrics .service-status .service-status-icon.service-tree-created i:before,
+ .service-overview-tab .service-metrics .service-status .service-status-icon.service-tree-approved i:before,
+ .service-overview-tab .service-metrics .service-status .service-status-icon.workflow-created i:before,
+ .service-overview-tab .service-metrics .service-status .service-status-icon.workflow-started i:before {
+ color: #419ef1;
+ content: '\f017'; }
+ .service-overview-tab .service-metrics .service-status .service-status-icon.terminated i:before {
+ color: #419ef1;
+ content: '\f05e'; }
+ .service-overview-tab .service-metrics .service-status .service-status-icon.error i:before {
+ color: #e65353;
+ content: '\f05c'; }
+ .service-overview-tab .service-metrics .service-status .service-details {
+ display: inline-block;
+ border-left: 1px solid #454544;
+ padding-left: 20px; }
+ .service-overview-tab .service-metrics .service-status .service-details .status {
+ color: #419ef1; }
+ .service-overview-tab .service-metrics .service-status .service-details .service-times {
+ color: #1a2531; }
+ .service-overview-tab .service-metrics .service-status .service-details .service-times .service-time-value {
+ color: #419ef1;
+ float: right;
+ margin-left: 12px; }
+
+.service-overview-tab .service-detailed-info {
+ padding: 14px; }
+ .service-overview-tab .service-detailed-info .service-tasks, .service-overview-tab .service-detailed-info .service-events {
+ background: rgba(236, 241, 245, 0.5); }
+ @media screen and (min-width: 1224px) {
+ .service-overview-tab .service-detailed-info .service-tasks, .service-overview-tab .service-detailed-info .service-events {
+ display: inline-block;
+ vertical-align: top; } }
+ .service-overview-tab .service-detailed-info .service-tasks .list-header, .service-overview-tab .service-detailed-info .service-events .list-header {
+ color: #419ef1;
+ padding: 4px 30px;
+ border-bottom: 1px solid rgba(168, 187, 220, 0.3);
+ transition: color 0.2s, border 0.2s; }
+ .service-overview-tab .service-detailed-info .service-tasks .see-all-link, .service-overview-tab .service-detailed-info .service-events .see-all-link {
+ border-top: 1px solid rgba(168, 187, 220, 0.3);
+ padding: 11px 30px; }
+ @media screen and (min-width: 1224px) {
+ .service-overview-tab .service-detailed-info .service-tasks {
+ width: 34%;
+ margin-right: 14px; } }
+ @media screen and (max-width: 1024px) {
+ .service-overview-tab .service-detailed-info .service-tasks {
+ margin-bottom: 14px; } }
+ .service-overview-tab .service-detailed-info .service-tasks .service-tasks-list {
+ height: 260px;
+ overflow-y: auto;
+ overflow-x: hidden; }
+ .service-overview-tab .service-detailed-info .service-tasks .task-list-item {
+ border-bottom: 1px solid rgba(168, 187, 220, 0.3); }
+ .service-overview-tab .service-detailed-info .service-tasks .task-list-item .task-item-content {
+ cursor: pointer;
+ padding: 14px 30px; }
+ .service-overview-tab .service-detailed-info .service-tasks .task-list-item .task-time .due {
+ color: #445a75; }
+ .service-overview-tab .service-detailed-info .service-tasks .task-list-item .task-message {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ width: 100%;
+ white-space: nowrap;
+ margin-top: 4px; }
+ .service-overview-tab .service-detailed-info .service-tasks .task-list-item:hover {
+ background: #f6e6cd; }
+ @media screen and (min-width: 1224px) {
+ .service-overview-tab .service-detailed-info .service-events {
+ width: 63.8%; } }
+ .service-overview-tab .service-detailed-info .service-events .service-events-list {
+ height: 260px;
+ overflow-y: auto;
+ overflow-x: hidden; }
+ .service-overview-tab .service-detailed-info .service-events .event-list-item {
+ border-bottom: 1px solid rgba(168, 187, 220, 0.3); }
+ .service-overview-tab .service-detailed-info .service-events .event-list-item .event-item-icon {
+ display: table-cell;
+ width: 28px;
+ height: 28px;
+ font-family: FontAwesome;
+ font-size: 20px;
+ text-align: center; }
+ .service-overview-tab .service-detailed-info .service-events .event-list-item .event-item-icon.error {
+ color: #e65353; }
+ .service-overview-tab .service-detailed-info .service-events .event-list-item .event-item-icon.error:before {
+ content: '\f05c'; }
+ .service-overview-tab .service-detailed-info .service-events .event-list-item .event-item-icon.info {
+ color: #419ef1; }
+ .service-overview-tab .service-detailed-info .service-events .event-list-item .event-item-icon.info:before {
+ content: '\f05a'; }
+ .service-overview-tab .service-detailed-info .service-events .event-list-item .event-item-icon.warning, .service-overview-tab .service-detailed-info .service-events .event-list-item .event-item-icon.warn {
+ color: #419ef1; }
+ .service-overview-tab .service-detailed-info .service-events .event-list-item .event-item-icon.warning:before, .service-overview-tab .service-detailed-info .service-events .event-list-item .event-item-icon.warn:before {
+ content: '\f071'; }
+ .service-overview-tab .service-detailed-info .service-events .event-list-item .event-item-content {
+ padding: 10px 30px; }
+ .service-overview-tab .service-detailed-info .service-events .event-list-item .event-item-content .event-item-data .event-time {
+ display: table-cell;
+ vertical-align: middle;
+ padding-left: 12px; }
+ .service-overview-tab .service-detailed-info .service-events .event-list-item .event-item-content .event-message {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ width: 100%;
+ white-space: nowrap;
+ margin-top: 4px;
+ margin-left: 40px; }
+ .service-overview-tab .service-detailed-info .service-events .event-list-item:hover {
+ background: #f6e6cd; }
+ .service-overview-tab .service-detailed-info .service-performance {
+ margin-top: 20px;
+ text-align: center; }
+ .service-overview-tab .service-detailed-info .service-performance .services-performance-header {
+ padding: 10px;
+ color: #419ef1; }
+ .service-overview-tab .service-detailed-info .service-performance .services-performance-header .title {
+ display: inline-block; }
+ .service-overview-tab .service-detailed-info .service-performance .services-performance-header .scale-buttons {
+ display: inline-block;
+ float: right;
+ border: 1px solid #a8bbdc; }
+ .service-overview-tab .service-detailed-info .service-performance .services-performance-header .scale-buttons .scale-button {
+ min-width: 0;
+ width: 30px;
+ margin: 0;
+ border: none; }
+ .service-overview-tab .service-detailed-info .service-performance .services-performance-header .scale-buttons .scale-button .ui-button-text {
+ padding: 2px 5px; }
+ .service-overview-tab .service-detailed-info .service-performance .services-performance-header .scale-buttons .scale-button.active {
+ background: #419ef1; }
+ .service-overview-tab .service-detailed-info .service-performance .vm-chart {
+ margin: 0 auto; }
+ .service-overview-tab .service-detailed-info .service-performance svg {
+ padding: 0; }
+
+/* Service Events Tab */
+/* Service Parameters */
+.parameters-tab {
+ margin-left: 30px; }
+ .parameters-tab .edit-buttons-toolbar {
+ background: #ecf1f5;
+ padding: 12px 0;
+ border-top: 1px solid #445a75;
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ width: 100%;
+ z-index: 3; }
+ .parameters-tab .edit-buttons-toolbar .edit, .parameters-tab .edit-buttons-toolbar .submit, .parameters-tab .edit-buttons-toolbar .discard {
+ display: inline-block; }
+ .parameters-tab .edit-buttons-toolbar .edit {
+ margin-left: 30px; }
+ .parameters-tab .edit-buttons-toolbar .submit {
+ position: absolute;
+ right: 160px; }
+ .parameters-tab .edit-buttons-toolbar .continue {
+ position: absolute;
+ top: 12px;
+ right: 20px; }
+
+body.theme2 {
+ /* Service Parameters */ }
+ body.theme2 .service-details .activities-button .uxf-button.ui-button.ui-widget.ui-state-default.ui-corner-all.ui-button-text-only {
+ border: 1px solid rgba(185, 186, 181, 0.7);
+ color: rgba(185, 186, 181, 0.7);
+ background-color: transparent; }
+ body.theme2 .service-details .activities-button .uxf-button.ui-button.ui-widget.ui-state-default.ui-corner-all.ui-button-text-only:hover {
+ color: #b9bab5;
+ border: 1px solid #b9bab5; }
+ body.theme2 .service-overview-tab .service-metrics .service-metric {
+ background-color: #333; }
+ body.theme2 .service-overview-tab .service-metrics .service-metric .vnf-icon, body.theme2 .service-overview-tab .service-metrics .service-metric .vm-icon {
+ color: #8ccdf5; }
+ body.theme2 .service-overview-tab .service-metrics .service-status .service-status-icon.active i:before {
+ color: #9bdb69; }
+ body.theme2 .service-overview-tab .service-metrics .service-status .service-status-icon.new i:before,
+ body.theme2 .service-overview-tab .service-metrics .service-status .service-status-icon.service-tree-created i:before,
+ body.theme2 .service-overview-tab .service-metrics .service-status .service-status-icon.service-tree-approved i:before,
+ body.theme2 .service-overview-tab .service-metrics .service-status .service-status-icon.workflow-created i:before,
+ body.theme2 .service-overview-tab .service-metrics .service-status .service-status-icon.workflow-started i:before {
+ color: #8ccdf5; }
+ body.theme2 .service-overview-tab .service-metrics .service-status .service-status-icon.terminated i:before {
+ color: #f7e385; }
+ body.theme2 .service-overview-tab .service-metrics .service-status .service-status-icon.error i:before {
+ color: #ff7c54; }
+ body.theme2 .service-overview-tab .service-metrics .service-status .service-details {
+ border-left: 1px solid #454544; }
+ body.theme2 .service-overview-tab .service-metrics .service-status .service-details .status {
+ color: #f4f6f1; }
+ body.theme2 .service-overview-tab .service-metrics .service-status .service-details .service-times {
+ color: #b9bab5; }
+ body.theme2 .service-overview-tab .service-metrics .service-status .service-details .service-times .service-time-value {
+ color: #f7e385; }
+ body.theme2 .service-overview-tab .service-detailed-info .service-tasks, body.theme2 .service-overview-tab .service-detailed-info .service-events {
+ background: #333; }
+ body.theme2 .service-overview-tab .service-detailed-info .service-tasks .list-header, body.theme2 .service-overview-tab .service-detailed-info .service-events .list-header {
+ color: #8ccdf5;
+ border-bottom: 1px solid #454544; }
+ body.theme2 .service-overview-tab .service-detailed-info .service-tasks .see-all-link, body.theme2 .service-overview-tab .service-detailed-info .service-events .see-all-link {
+ border-top: 1px solid #454544; }
+ body.theme2 .service-overview-tab .service-detailed-info .service-tasks .task-list-item {
+ border-bottom: 1px solid #454544; }
+ body.theme2 .service-overview-tab .service-detailed-info .service-tasks .task-list-item .task-time .due {
+ color: #f4f6f1; }
+ body.theme2 .service-overview-tab .service-detailed-info .service-tasks .task-list-item:hover {
+ background: #454544; }
+ body.theme2 .service-overview-tab .service-detailed-info .service-events .event-list-item {
+ border-bottom: 1px solid #454544; }
+ body.theme2 .service-overview-tab .service-detailed-info .service-events .event-list-item .event-item-icon.error {
+ color: #ff7c54; }
+ body.theme2 .service-overview-tab .service-detailed-info .service-events .event-list-item .event-item-icon.info {
+ color: #8ccdf5; }
+ body.theme2 .service-overview-tab .service-detailed-info .service-events .event-list-item .event-item-icon.warning, body.theme2 .service-overview-tab .service-detailed-info .service-events .event-list-item .event-item-icon.warn {
+ color: #f7e385; }
+ body.theme2 .service-overview-tab .service-detailed-info .service-events .event-list-item:hover {
+ background: #454544; }
+ body.theme2 .service-overview-tab .service-detailed-info .service-performance .services-performance-header {
+ color: #8ccdf5; }
+ body.theme2 .service-overview-tab .service-detailed-info .service-performance .services-performance-header .scale-buttons {
+ border: 1px solid #a8bbdc; }
+ body.theme2 .service-overview-tab .service-detailed-info .service-performance .services-performance-header .scale-buttons .scale-button.active {
+ background: #419ef1; }
+ body.theme2 .service-overview-tab .service-detailed-info .service-performance .highcharts-container .highcharts-background {
+ fill: #333; }
+ body.theme2 .service-overview-tab .service-detailed-info .service-performance .highcharts-container tspan {
+ fill: #f4f6f1; }
+ body.theme2 .service-overview-tab .service-detailed-info .service-performance .highcharts-container .highcharts-tooltip rect:nth-child(4) {
+ fill: #232323; }
+ body.theme2 .parameters-tab .edit-buttons-toolbar {
+ background: #333;
+ border-top: 1px solid #333; }
+
+.modify-service-wizard {
+ margin-left: -30px; }
+ .modify-service-wizard .nfv-wizard-header {
+ background: transparent;
+ border-bottom: none; }
+ .modify-service-wizard .impact-view {
+ padding: 40px; }
+ .modify-service-wizard .impact-view .impact-view-title {
+ margin-bottom: 30px; }
+ .modify-service-wizard .impact-view .impact-list .impact-item {
+ margin: 20px 0; }
+ .modify-service-wizard .impact-view .impact-list .impact-item .impact-item-icon {
+ background: url("../images/images_theme_1/cloud.png") no-repeat;
+ width: 67px;
+ height: 42px;
+ display: table-cell;
+ vertical-align: middle; }
+ .modify-service-wizard .impact-view .impact-list .impact-item .impact-item-text {
+ display: table-cell;
+ vertical-align: middle;
+ padding-left: 20px; }
+ .modify-service-wizard .impact-view .nfv-collapsible-title-text {
+ width: 20px; }
+
+.system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceTitles .serviceName, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceTitles .serviceName, .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceTitles .customer, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceTitles .customer, .system-tasks .task-details-container .task-details-header .serviceTitles, .tasks-notifications-container .task-details-container .task-details-header .serviceTitles, .system-tasks .task-details-container .task-details-header .serviceTitles .serviceName, .system-tasks .task-details-container .task-details-header .serviceTitles .customer, .tasks-notifications-container .task-details-container .task-details-header .serviceTitles .serviceName, .tasks-notifications-container .task-details-container .task-details-header .serviceTitles .customer, .system-tasks .task-details-container .task-details-header .dueDateGroup, .tasks-notifications-container .task-details-container .task-details-header .dueDateGroup {
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis; }
+
+.system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview, .system-tasks .task-details-container .task-details-header .description, .tasks-notifications-container .task-details-container .task-details-header .description {
+ display: -webkit-box;
+ -webkit-line-clamp: 2;
+ line-height: 1.55;
+ -webkit-box-orient: vertical;
+ overflow: hidden;
+ text-overflow: ellipsis; }
+
+.system-tasks {
+ position: absolute;
+ bottom: 0;
+ top: 0;
+ right: 0;
+ left: 0; }
+
+.nfv-balloon.reject-balloon .reject-task-balloon {
+ width: 300px;
+ height: 220px; }
+ .nfv-balloon.reject-balloon .reject-task-balloon .reject-title, .nfv-balloon.reject-balloon .reject-task-balloon .buttons-container, .nfv-balloon.reject-balloon .reject-task-balloon .reject-reason {
+ padding-left: 14px;
+ padding-right: 14px; }
+ .nfv-balloon.reject-balloon .reject-task-balloon .reject-title {
+ padding-top: 10px;
+ padding-bottom: 10px; }
+ .nfv-balloon.reject-balloon .reject-task-balloon .buttons-container {
+ margin-top: 9px;
+ padding-top: 3px;
+ display: table;
+ width: 272px;
+ height: 40px;
+ background: #f6e6cd; }
+ .nfv-balloon.reject-balloon .reject-task-balloon .buttons-container .cancel-reject-btn-holder, .nfv-balloon.reject-balloon .reject-task-balloon .buttons-container .reject-btn-holder {
+ display: table-cell;
+ vertical-align: middle; }
+ .nfv-balloon.reject-balloon .reject-task-balloon .buttons-container .reject-btn-holder {
+ text-align: right; }
+ .nfv-balloon.reject-balloon .reject-task-balloon .reject-reason-text {
+ width: 99%;
+ height: 118px; }
+ .nfv-balloon.reject-balloon .reject-task-balloon .reject-reason-text.required {
+ border: 1px solid #e65353; }
+
+.system-tasks, .tasks-notifications-container {
+ color: #1a2531; }
+ .system-tasks .tasks-list-container, .tasks-notifications-container .tasks-list-container {
+ height: 100%;
+ width: 330px;
+ background: #ffffff;
+ overflow: hidden; }
+ .system-tasks .tasks-list-container .filters, .tasks-notifications-container .tasks-list-container .filters {
+ background-color: #ecf1f5;
+ height: 63px;
+ width: 100%;
+ display: table;
+ position: relative;
+ z-index: 5;
+ border-bottom: 2px solid #a8bbdc; }
+ .system-tasks .tasks-list-container .filters .select, .tasks-notifications-container .tasks-list-container .filters .select {
+ display: table-cell;
+ text-align: left;
+ vertical-align: middle;
+ position: relative;
+ padding-top: 5px; }
+ .system-tasks .tasks-list-container .filters .select select, .tasks-notifications-container .tasks-list-container .filters .select select {
+ min-width: 100px; }
+ .system-tasks .tasks-list-container .filters .tasks-list-footer, .system-tasks .tasks-list-container .filters .tasks-list-popup-footer, .tasks-notifications-container .tasks-list-container .filters .tasks-list-footer, .tasks-notifications-container .tasks-list-container .filters .tasks-list-popup-footer {
+ display: table-cell;
+ vertical-align: middle; }
+ .system-tasks .tasks-list-container .placeholder, .tasks-notifications-container .tasks-list-container .placeholder {
+ position: absolute;
+ left: 324px;
+ height: 110px;
+ width: 330px;
+ border-bottom: 1px solid #a8bbdc;
+ overflow: hidden; }
+ .system-tasks .tasks-list-container .placeholder .approve-bg, .tasks-notifications-container .tasks-list-container .placeholder .approve-bg {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background-color: #3ebd6b;
+ opacity: 0.1; }
+ .system-tasks .tasks-list-container .placeholder .reject-bg, .tasks-notifications-container .tasks-list-container .placeholder .reject-bg {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background-color: #e65353;
+ opacity: 0.1; }
+ .system-tasks .tasks-list-container .placeholder .replan-bg, .tasks-notifications-container .tasks-list-container .placeholder .replan-bg {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background-color: #ff8a00;
+ opacity: 0.1; }
+ .system-tasks .tasks-list-container .placeholder .text, .tasks-notifications-container .tasks-list-container .placeholder .text {
+ position: absolute;
+ top: 44px;
+ left: 137px;
+ opacity: 1; }
+ .system-tasks .tasks-list-container .tasks-collection-container, .tasks-notifications-container .tasks-list-container .tasks-collection-container {
+ overflow-y: auto;
+ overflow-x: hidden;
+ width: 330px;
+ position: absolute; }
+ .system-tasks .tasks-list-container .tasks-collection-container.popup, .tasks-notifications-container .tasks-list-container .tasks-collection-container.popup {
+ top: 0px;
+ bottom: 0px; }
+ .system-tasks .tasks-list-container .tasks-collection-container.full-mode, .tasks-notifications-container .tasks-list-container .tasks-collection-container.full-mode {
+ top: 63px;
+ bottom: 0px; }
+ .system-tasks .tasks-list-container .tasks-collection-container.full-mode .task-list-item.active, .tasks-notifications-container .tasks-list-container .tasks-collection-container.full-mode .task-list-item.active {
+ background-color: #ecf1f5;
+ border-left: 5px solid #419ef1;
+ padding-left: 25px; }
+ .system-tasks .tasks-list-container .tasks-collection-container.full-mode .task-list-item.active .serviceParams, .tasks-notifications-container .tasks-list-container .tasks-collection-container.full-mode .task-list-item.active .serviceParams {
+ left: 165px; }
+ .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist {
+ list-style-type: none;
+ padding: 0px;
+ margin: 0px; }
+ .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item {
+ cursor: pointer;
+ position: relative;
+ top: 0;
+ height: 98px;
+ width: 300px;
+ padding-left: 30px;
+ padding-top: 12px;
+ background-color: #ffffff;
+ border-bottom: 1px solid #a8bbdc; }
+ .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item:hover, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item:hover {
+ background-color: #ecf1f5; }
+ .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceTitles, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceTitles {
+ width: 130px; }
+ .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceTitles .customer, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceTitles .customer {
+ margin-top: 2px; }
+ .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceTitles .customer::before, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceTitles .customer::before {
+ content: "("; }
+ .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceTitles .customer::after, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceTitles .customer::after {
+ content: ")"; }
+ .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview {
+ word-spacing: 2px;
+ margin-top: 8px;
+ height: 37px;
+ width: 280px; }
+ .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview .message, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview .message {
+ color: #445a75;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ overflow: hidden; }
+ .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview .action-taken.action-taken-approve .value, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview .action-taken.action-taken-approve .value {
+ color: #3ebd6b; }
+ .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview .action-taken.action-taken-cancel .value, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview .action-taken.action-taken-cancel .value {
+ color: #e65353; }
+ .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceParams, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceParams {
+ position: absolute;
+ top: 12px;
+ left: 170px; }
+ .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceParams .Default, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceParams .Default {
+ height: 18px;
+ line-height: 18px; }
+ .system-tasks .task-details-container, .tasks-notifications-container .task-details-container {
+ height: 100%;
+ background: #ffffff;
+ position: absolute;
+ top: 0px;
+ left: 330px;
+ right: 0;
+ border-left: 2px solid #a8bbdc;
+ overflow: hidden; }
+ .system-tasks .task-details-container .empty, .tasks-notifications-container .task-details-container .empty {
+ display: table;
+ position: absolute;
+ background: #ffffff;
+ width: 100%;
+ z-index: 100;
+ height: 100%; }
+ .system-tasks .task-details-container .empty span, .tasks-notifications-container .task-details-container .empty span {
+ display: table-cell;
+ text-align: center;
+ vertical-align: middle; }
+ .system-tasks .task-details-container .task-details-header, .tasks-notifications-container .task-details-container .task-details-header {
+ overflow: hidden;
+ position: absolute;
+ right: 0;
+ left: 0;
+ height: 61px;
+ background-color: #ecf1f5;
+ padding-left: 15px; }
+ .system-tasks .task-details-container .task-details-header .serviceTitles, .tasks-notifications-container .task-details-container .task-details-header .serviceTitles {
+ display: inline-block;
+ height: 47px;
+ padding-top: 11px;
+ padding-right: 10px;
+ border-right: 1px solid #a8bbdc;
+ width: 170px; }
+ .system-tasks .task-details-container .task-details-header .serviceTitles .customer::before, .tasks-notifications-container .task-details-container .task-details-header .serviceTitles .customer::before {
+ content: "("; }
+ .system-tasks .task-details-container .task-details-header .serviceTitles .customer::after, .tasks-notifications-container .task-details-container .task-details-header .serviceTitles .customer::after {
+ content: ")"; }
+ .system-tasks .task-details-container .task-details-header .serviceTitles .customer:empty, .tasks-notifications-container .task-details-container .task-details-header .serviceTitles .customer:empty {
+ display: none; }
+ .system-tasks .task-details-container .task-details-header .dueDateGroup, .tasks-notifications-container .task-details-container .task-details-header .dueDateGroup {
+ display: inline-block;
+ height: 47px;
+ padding: 11px 10px 0 10px;
+ border-right: 1px solid #a8bbdc;
+ width: 110px; }
+ .system-tasks .task-details-container .task-details-header .description, .tasks-notifications-container .task-details-container .task-details-header .description {
+ height: 40px;
+ padding: 11px 10px 10px 10px;
+ position: absolute;
+ top: 0;
+ left: 330px;
+ right: 300px;
+ border-right: 1px solid #a8bbdc; }
+ .system-tasks .task-details-container .buttons-container, .tasks-notifications-container .task-details-container .buttons-container {
+ float: right;
+ margin: 10px 30px 10px 0; }
+ .system-tasks .task-details-container .buttons-container .approve-btn, .system-tasks .task-details-container .buttons-container .reject-btn, .system-tasks .task-details-container .buttons-container .replan-btn, .tasks-notifications-container .task-details-container .buttons-container .approve-btn, .tasks-notifications-container .task-details-container .buttons-container .reject-btn, .tasks-notifications-container .task-details-container .buttons-container .replan-btn {
+ border: none; }
+ .system-tasks .task-details-container .buttons-container .approve-btn:before, .tasks-notifications-container .task-details-container .buttons-container .approve-btn:before {
+ font-family: FontAwesome;
+ content: "\f00c";
+ color: #3ebd6b; }
+ .system-tasks .task-details-container .buttons-container .reject-btn:before, .tasks-notifications-container .task-details-container .buttons-container .reject-btn:before {
+ font-family: FontAwesome;
+ content: "\f00d";
+ color: #e65353; }
+ .system-tasks .task-details-container .buttons-container .replan-btn:before, .tasks-notifications-container .task-details-container .buttons-container .replan-btn:before {
+ font-family: FontAwesome;
+ content: "\f021"; }
+ .system-tasks .task-details-container .task-details-tabs-container, .tasks-notifications-container .task-details-container .task-details-tabs-container {
+ position: absolute;
+ top: 61px;
+ bottom: 0px;
+ left: 0;
+ right: 0; }
+ .system-tasks .task-details-container .task-details-tabs-container .tree-graph, .tasks-notifications-container .task-details-container .task-details-tabs-container .tree-graph {
+ height: 667px; }
+ .system-tasks .task-details-container .task-details-tabs-container .tree-graph svg, .tasks-notifications-container .task-details-container .task-details-tabs-container .tree-graph svg {
+ border: none; }
+ .system-tasks .task-details-container .task-details-tabs-container .nfv-tabpanel, .tasks-notifications-container .task-details-container .task-details-tabs-container .nfv-tabpanel {
+ position: absolute;
+ top: 0px;
+ bottom: 0px;
+ left: 0px;
+ right: 0px; }
+ .system-tasks .task-details-container .task-details-tabs-container .nfv-tabpanel .nfv-tabs-v3, .tasks-notifications-container .task-details-container .task-details-tabs-container .nfv-tabpanel .nfv-tabs-v3 {
+ padding: 0; }
+ .system-tasks .task-details-container .task-details-tabs-container .nfv-tabpanel #tabs-parameters-tab, .tasks-notifications-container .task-details-container .task-details-tabs-container .nfv-tabpanel #tabs-parameters-tab {
+ position: absolute;
+ top: 42px;
+ left: 0px;
+ right: 0px;
+ bottom: 0px;
+ overflow-y: auto; }
+
+body.theme2 .nfv-balloon.reject-balloon {
+ border-color: #333;
+ background-color: #454544; }
+ body.theme2 .nfv-balloon.reject-balloon .reject-task-balloon .reject-title {
+ color: #f4f6f1; }
+ body.theme2 .nfv-balloon.reject-balloon .reject-task-balloon .buttons-container {
+ background: #333; }
+ body.theme2 .nfv-balloon.reject-balloon .reject-task-balloon .buttons-container .reject-btn-holder a {
+ color: #f4f6f1;
+ border-color: #f4f6f1; }
+ body.theme2 .nfv-balloon.reject-balloon .reject-task-balloon .buttons-container .reject-btn-holder a:hover {
+ border-color: #ff7c54;
+ color: #ff7c54; }
+ body.theme2 .nfv-balloon.reject-balloon .reject-task-balloon .reject-reason-text {
+ background-color: inherit;
+ border-color: inherit;
+ color: #f4f6f1; }
+ body.theme2 .nfv-balloon.reject-balloon .reject-task-balloon .reject-reason-text.required {
+ border: 1px solid #f7e385; }
+
+body.theme2 .system-tasks, body.theme2 .tasks-notifications-container {
+ color: #b9bab5; }
+ body.theme2 .system-tasks .tasks-list-container, body.theme2 .tasks-notifications-container .tasks-list-container {
+ background: #232323; }
+ body.theme2 .system-tasks .tasks-list-container .filters, body.theme2 .tasks-notifications-container .tasks-list-container .filters {
+ background-color: #232323;
+ border-bottom: 2px solid #454544; }
+ body.theme2 .system-tasks .tasks-list-container .placeholder, body.theme2 .tasks-notifications-container .tasks-list-container .placeholder {
+ border-bottom: 1px solid #454544; }
+ body.theme2 .system-tasks .tasks-list-container .placeholder .approve-bg, body.theme2 .tasks-notifications-container .tasks-list-container .placeholder .approve-bg {
+ background-color: #9bdb69; }
+ body.theme2 .system-tasks .tasks-list-container .placeholder .reject-bg, body.theme2 .tasks-notifications-container .tasks-list-container .placeholder .reject-bg {
+ background-color: #f7e385; }
+ body.theme2 .system-tasks .tasks-list-container .placeholder .replan-bg, body.theme2 .tasks-notifications-container .tasks-list-container .placeholder .replan-bg {
+ background-color: #8ccdf5; }
+ body.theme2 .system-tasks .tasks-list-container .tasks-collection-container.full-mode .task-list-item.active, body.theme2 .tasks-notifications-container .tasks-list-container .tasks-collection-container.full-mode .task-list-item.active {
+ background-color: #333;
+ border-left: 5px solid #f4f6f1; }
+ body.theme2 .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item, body.theme2 .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item {
+ background-color: #232323;
+ border-bottom: 1px solid #454544; }
+ body.theme2 .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceTitles .serviceName, body.theme2 .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceTitles .serviceName {
+ color: #8ccdf5; }
+ body.theme2 .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceTitles .customer, body.theme2 .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceTitles .customer {
+ color: #aaa6d9; }
+ body.theme2 .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item:hover, body.theme2 .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item:hover {
+ background-color: #333; }
+ body.theme2 .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview .message, body.theme2 .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview .message {
+ color: #b9bab5; }
+ body.theme2 .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview .action-taken.action-taken-approve .value, body.theme2 .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview .action-taken.action-taken-approve .value {
+ color: #9bdb69; }
+ body.theme2 .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview .action-taken.action-taken-cancel .value, body.theme2 .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview .action-taken.action-taken-cancel .value {
+ color: #f7e385; }
+ body.theme2 .system-tasks .task-details-container, body.theme2 .tasks-notifications-container .task-details-container {
+ background: #333;
+ border-left: 2px solid #454544; }
+ body.theme2 .system-tasks .task-details-container .empty, body.theme2 .tasks-notifications-container .task-details-container .empty {
+ background: #333; }
+ body.theme2 .system-tasks .task-details-container .task-details-header, body.theme2 .tasks-notifications-container .task-details-container .task-details-header {
+ background-color: #292929;
+ border-bottom: 2px solid #454544; }
+ body.theme2 .system-tasks .task-details-container .task-details-header .serviceTitles, body.theme2 .tasks-notifications-container .task-details-container .task-details-header .serviceTitles {
+ border-right: 1px solid #454544; }
+ body.theme2 .system-tasks .task-details-container .task-details-header .serviceTitles .serviceName, body.theme2 .tasks-notifications-container .task-details-container .task-details-header .serviceTitles .serviceName {
+ color: #8ccdf5; }
+ body.theme2 .system-tasks .task-details-container .task-details-header .serviceTitles .customer, body.theme2 .tasks-notifications-container .task-details-container .task-details-header .serviceTitles .customer {
+ color: #aaa6d9; }
+ body.theme2 .system-tasks .task-details-container .task-details-header .dueDateGroup, body.theme2 .tasks-notifications-container .task-details-container .task-details-header .dueDateGroup {
+ border-right: 1px solid #454544; }
+ body.theme2 .system-tasks .task-details-container .task-details-header .description, body.theme2 .tasks-notifications-container .task-details-container .task-details-header .description {
+ border-color: #454544; }
+ body.theme2 .system-tasks .approve-btn:before, body.theme2 .tasks-notifications-container .approve-btn:before {
+ color: #9bdb69; }
+ body.theme2 .system-tasks .reject-btn:before, body.theme2 .tasks-notifications-container .reject-btn:before {
+ color: #ff7c54; }
+ body.theme2 .system-tasks .replan-btn:before, body.theme2 .tasks-notifications-container .replan-btn:before {
+ color: #8ccdf5; }
+
+[data-uxf-point="settings-cp-add"] {
+ background-color: #ecf1f5;
+ left: 30px;
+ padding-left: 30px;
+ position: absolute;
+ top: 270px;
+ width: 190px; }
+ [data-uxf-point="settings-cp-add"] button.ui-state-default.ui-button {
+ border: none;
+ position: relative;
+ text-align: left;
+ width: 150px; }
+ [data-uxf-point="settings-cp-add"] button.ui-state-default.ui-button:before {
+ font-family: FontAwesome;
+ content: '\f067';
+ position: absolute;
+ left: 0px;
+ top: 8px;
+ font-size: 10px; }
+ [data-uxf-point="settings-cp-add"] button.ui-state-default.ui-button:hover {
+ border: none; }
+
+.settings[data-uxf-point="settings-view"] {
+ background-color: #e1e8f1;
+ height: 100%;
+ /* DataTables modifications */ }
+ .settings[data-uxf-point="settings-view"] .image-controllers {
+ background-color: #ecf1f5;
+ margin: 30px 30px 0px 0px;
+ text-align: right;
+ padding: 3px 10px 2px 0;
+ border-bottom: 1px solid rgba(168, 187, 220, 0.3); }
+ .settings[data-uxf-point="settings-view"] .image-controllers .controller {
+ margin-left: 20px;
+ cursor: pointer;
+ transition: color 0.4s; }
+ .settings[data-uxf-point="settings-view"] .image-controllers .controller:hover {
+ color: #419ef1; }
+ .settings[data-uxf-point="settings-view"] .image-controllers .controller .fa {
+ margin-right: 5px; }
+ .settings[data-uxf-point="settings-view"] .nfv-tabpanel .nfv-tabs-v3 {
+ background-color: #ecf1f5;
+ border: none;
+ left: 30px;
+ position: absolute;
+ top: 30px;
+ width: 220px; }
+ .settings[data-uxf-point="settings-view"] .nfv-tabpanel .nfv-tabs-v3:after {
+ background-color: #ecf1f5;
+ content: '';
+ height: 40px;
+ position: absolute;
+ right: -30px;
+ top: 0px;
+ width: 30px; }
+ .settings[data-uxf-point="settings-view"] .nfv-tabpanel .nfv-tabs-v3 .ui-state-disabled,
+ .settings[data-uxf-point="settings-view"] .nfv-tabpanel .nfv-tabs-v3 .ui-widget-content .ui-state-disabled,
+ .settings[data-uxf-point="settings-view"] .nfv-tabpanel .nfv-tabs-v3 .ui-widget-header .ui-state-disabled {
+ opacity: 1; }
+ .settings[data-uxf-point="settings-view"] .nfv-tabpanel .nfv-tabs-v3 li.ui-state-default {
+ border: none !important;
+ float: none;
+ line-height: 27px; }
+ .settings[data-uxf-point="settings-view"] .nfv-tabpanel .nfv-tabs-v3 li.ui-state-default.ui-tabs-active.ui-state-active {
+ color: #ff8a00; }
+ .settings[data-uxf-point="settings-view"] .nfv-tabpanel .nfv-tabs-v3 li.ui-state-default a.ui-tabs-anchor {
+ background-color: #ffffff;
+ display: block;
+ float: none;
+ margin: 5px 20px;
+ text-align: left; }
+ .settings[data-uxf-point="settings-view"] .nfv-tabpanel .nfv-tabs-v3 li.ui-state-default a.ui-tabs-anchor:hover {
+ text-decoration: underline; }
+ .settings[data-uxf-point="settings-view"] .nfv-tabpanel .nfv-tabs-v3 li.ui-state-default:nth-child(2) a.ui-tabs-anchor,
+ .settings[data-uxf-point="settings-view"] .nfv-tabpanel .nfv-tabs-v3 li.ui-state-default:nth-child(3) a.ui-tabs-anchor,
+ .settings[data-uxf-point="settings-view"] .nfv-tabpanel .nfv-tabs-v3 li.ui-state-default:nth-child(4) a.ui-tabs-anchor {
+ background-color: #ecf1f5;
+ margin: 0px 0px 0px 30px; }
+ .settings[data-uxf-point="settings-view"] .nfv-tabpanel .ui-tabs-panel {
+ border: none;
+ left: 280px;
+ position: absolute;
+ right: 10px;
+ background: transparent; }
+ .settings[data-uxf-point="settings-view"] #tabs-images .data-table-wrapper div.dataTables_wrapper {
+ top: 0px; }
+ .settings[data-uxf-point="settings-view"] .data-table-wrapper div.dataTables_wrapper {
+ left: 0px; }
+ .settings[data-uxf-point="settings-view"] .data-table-wrapper .dataTables_scroll {
+ background-color: #ecf1f5; }
+ .settings[data-uxf-point="settings-view"] .data-table-wrapper table.dataTable.table-bordered {
+ border: none; }
+ .settings[data-uxf-point="settings-view"] .data-table-wrapper table.dataTable > tbody > tr > td,
+ .settings[data-uxf-point="settings-view"] .data-table-wrapper table.dataTable > thead > tr > th {
+ border: none; }
+ .settings[data-uxf-point="settings-view"] .data-table-wrapper table.dataTable > tbody > tr > td:nth-last-child(1) {
+ color: #ff7c54; }
+ .settings[data-uxf-point="settings-view"] .data-table-wrapper table.dataTable > tbody > tr > td:nth-last-child(2) {
+ border-left: solid 1px #a8bbdc;
+ color: #8ccdf5; }
+ .settings[data-uxf-point="settings-view"] .data-table-wrapper table.dataTable > tbody > tr > td:nth-last-child(-n+2) {
+ font-size: 20px;
+ text-align: center;
+ width: 20px; }
+ .settings[data-uxf-point="settings-view"] .data-table-wrapper table.dataTable > thead > tr > th {
+ border-bottom: solid 1px #a8bbdc; }
+ .settings[data-uxf-point="settings-view"] .data-table-wrapper table.dataTable > thead > tr > th:hover {
+ background-color: transparent; }
+
+.add-setting-popup-module .form-container {
+ border-left: solid 3px #419ef1;
+ margin-bottom: 20px;
+ padding-left: 20px; }
+ .add-setting-popup-module .form-container + .nfv-primary-button {
+ float: right; }
+ .add-setting-popup-module .form-container .form-element {
+ margin-bottom: 15px; }
+ .add-setting-popup-module .form-container .form-element .form-element--label {
+ display: inline-block;
+ width: 200px; }
+ .add-setting-popup-module .form-container .form-element select {
+ padding-right: 10px; }
+ .add-setting-popup-module .form-container .form-element .form-element--control {
+ width: 290px;
+ box-sizing: content-box;
+ display: block; }
+ .add-setting-popup-module .form-container .form-element .form-element--error-message {
+ margin-left: 0px; }
+
+body.theme2 [data-uxf-point="settings-cp-add"] {
+ background-color: #333; }
+
+body.theme2 .settings[data-uxf-point="settings-view"] {
+ background-color: #232323;
+ /* DataTables modifications */ }
+ body.theme2 .settings[data-uxf-point="settings-view"] .image-controllers {
+ background-color: #333;
+ border-bottom: 1px solid #454544; }
+ body.theme2 .settings[data-uxf-point="settings-view"] .image-controllers .controller:hover {
+ color: #9bdb69; }
+ body.theme2 .settings[data-uxf-point="settings-view"] .nfv-tabpanel .nfv-tabs-v3 {
+ background-color: #333; }
+ body.theme2 .settings[data-uxf-point="settings-view"] .nfv-tabpanel .nfv-tabs-v3:after {
+ background-color: #333; }
+ body.theme2 .settings[data-uxf-point="settings-view"] .nfv-tabpanel .nfv-tabs-v3 li.ui-state-default {
+ border: none !important; }
+ body.theme2 .settings[data-uxf-point="settings-view"] .nfv-tabpanel .nfv-tabs-v3 li.ui-state-default.ui-tabs-active.ui-state-active a.ui-tabs-anchor {
+ color: #9bdb69; }
+ body.theme2 .settings[data-uxf-point="settings-view"] .nfv-tabpanel .nfv-tabs-v3 li.ui-state-default a.ui-tabs-anchor {
+ background-color: #232323; }
+ body.theme2 .settings[data-uxf-point="settings-view"] .nfv-tabpanel .nfv-tabs-v3 li.ui-state-default:nth-child(2) a.ui-tabs-anchor,
+ body.theme2 .settings[data-uxf-point="settings-view"] .nfv-tabpanel .nfv-tabs-v3 li.ui-state-default:nth-child(3) a.ui-tabs-anchor,
+ body.theme2 .settings[data-uxf-point="settings-view"] .nfv-tabpanel .nfv-tabs-v3 li.ui-state-default:nth-child(4) a.ui-tabs-anchor {
+ background-color: #333; }
+ body.theme2 .settings[data-uxf-point="settings-view"] > tbody > tr > td:nth-last-child(2) {
+ border-left: solid 1px #2f2f2f; }
+ body.theme2 .settings[data-uxf-point="settings-view"] > thead > tr > th {
+ border-bottom: solid 1px #2f2f2f;
+ color: #aaa6d9; }
+ body.theme2 .settings[data-uxf-point="settings-view"] > thead > tr > th:hover {
+ background-color: transparent; }
+ body.theme2 .settings[data-uxf-point="settings-view"] .data-table-wrapper .dataTables_scroll {
+ background-color: #333; }
+ body.theme2 .settings[data-uxf-point="settings-view"] .data-table-wrapper table.dataTable > tbody > tr > td:nth-last-child(1) {
+ color: #ff7c54; }
+ body.theme2 .settings[data-uxf-point="settings-view"] .data-table-wrapper table.dataTable > tbody > tr > td:nth-last-child(2) {
+ border-left: solid 1px #2f2f2f;
+ color: #8ccdf5; }
+ body.theme2 .settings[data-uxf-point="settings-view"] .data-table-wrapper table.dataTable > thead > tr > th {
+ border-bottom: solid 1px #2f2f2f;
+ color: #aaa6d9; }
+
+body.theme2 .add-setting-popup-module .form-container {
+ border-left: solid 3px #454544; }
+
+.service-termination-view .service-termination-subtitle {
+ margin: 30px 0; }
+
+.service-termination-view .uxf-input select {
+ min-width: 200px; }
+
+.service-termination-view .service-termination-controllers {
+ margin-top: 30px; }
+
+.service-termination-view .nfv-button-link {
+ display: inline-block;
+ float: left; }
+
+.service-termination-view .nfv-primary-button {
+ display: inline-block;
+ float: right; }
+
+.confirmation-popup-view .confirmation-popup-subtitle {
+ margin-bottom: 30px;
+ padding-left: 42px;
+ padding-top: 15px;
+ height: 35px; }
+ .confirmation-popup-view .confirmation-popup-subtitle:before {
+ content: "\f071";
+ margin-right: 12px;
+ font-family: FontAwesome;
+ font-size: 18px; }
+
+.confirmation-popup-view .confirmation-popup-message {
+ background: #fcf3d4;
+ display: inline-block; }
+
+.confirmation-popup-view .confirmation-popup-controllers {
+ margin-top: 10px; }
+ .confirmation-popup-view .confirmation-popup-controllers .confirmation-popup-button {
+ display: inline-block; }
+ .confirmation-popup-view .confirmation-popup-controllers .confirmation-popup-button.nfv-primary-button {
+ float: right; }
+
+.nfv-anonymous-landing-page .nfv-content {
+ min-height: 595px; }
+
+.nfv-landing-page .landing-page-content {
+ height: 100%;
+ position: relative;
+ transition: background-color 0.4s, color 0.4s; }
+
+.nfv-landing-page .landing-page-view {
+ bottom: 0px;
+ left: 0px;
+ position: absolute;
+ right: 0px;
+ top: 0px; }
+ .nfv-landing-page .landing-page-view h2 {
+ box-sizing: border-box;
+ color: #253244;
+ float: left;
+ padding: 16px 20px;
+ position: relative;
+ width: 27%;
+ transition: color 0.2s; }
+ .nfv-landing-page .landing-page-view h2:nth-child(2) {
+ border-left: solid 2px #a8bbdc;
+ width: 73%; }
+ .nfv-landing-page .landing-page-view h2 [data-uxf-point="add-service-button"] {
+ color: #ff7c54;
+ font-size: 18px;
+ position: absolute;
+ right: 75px;
+ top: 50%;
+ transform: translateY(-50%); }
+ .nfv-landing-page .landing-page-view h2 [data-uxf-point="add-service-button"] button {
+ border: none;
+ min-width: initial;
+ position: absolute;
+ right: -3px;
+ width: 18px; }
+ .nfv-landing-page .landing-page-view h2 .see-all-link {
+ position: absolute;
+ right: 10px;
+ top: 40%;
+ transform: translateY(-50%); }
+ .nfv-landing-page .landing-page-view .search-filter-input {
+ position: fixed;
+ left: 420px;
+ top: 22px; }
+ .nfv-landing-page .landing-page-view .search-filter-input i.fa {
+ cursor: pointer; }
+ .nfv-landing-page .landing-page-view .search-filter-input input[type="search"] {
+ color: #1a2531;
+ border-bottom-color: #1a2531;
+ opacity: 0;
+ transition: width 0.4s, opacity 0.4s;
+ width: 20px; }
+ .nfv-landing-page .landing-page-view .search-filter-input input[type="search"]:focus {
+ width: 150px;
+ opacity: 1; }
+ .nfv-landing-page .landing-page-view .lists-box {
+ bottom: 0px;
+ left: 0px;
+ position: absolute;
+ right: 3px;
+ top: 0px; }
+ .nfv-landing-page .landing-page-view .lists-box .events {
+ border-left: solid 2px #a8bbdc;
+ left: 27%;
+ width: 73%; }
+ .nfv-landing-page .landing-page-view .lists-box .events ul > li {
+ display: table-row;
+ padding: 10px 20px;
+ transition: background-color 0.2s;
+ background-color: #ffffff; }
+ .nfv-landing-page .landing-page-view .lists-box .events ul > li:nth-child(even) {
+ background-color: #ecf1f5; }
+ .nfv-landing-page .landing-page-view .lists-box .events ul > li > * {
+ display: table-cell;
+ padding: 10px; }
+ .nfv-landing-page .landing-page-view .lists-box .events ul > li .status {
+ display: block;
+ font-size: 15px;
+ position: absolute;
+ right: 15px;
+ top: 20px; }
+ .nfv-landing-page .landing-page-view .lists-box .events ul > li .status.error {
+ color: #ff7c54; }
+ .nfv-landing-page .landing-page-view .lists-box .events ul > li .status.suspend {
+ color: #f7e385; }
+ .nfv-landing-page .landing-page-view .lists-box .events ul > li .event-message p {
+ position: relative;
+ display: block;
+ overflow: hidden;
+ height: 2.4em;
+ /* exactly two lines */
+ line-height: 1.4;
+ margin: 0;
+ -webkit-box-orient: vertical;
+ display: -webkit-box;
+ -webkit-line-clamp: 2; }
+ .nfv-landing-page .landing-page-view .lists-box .events ul > li .event-message p:after {
+ /* fade out last line until multiline ellipsis (clamp) browsers' support */
+ content: "";
+ text-align: right;
+ position: absolute;
+ bottom: 0;
+ right: 0;
+ width: 40%;
+ height: 1.2em;
+ background: linear-gradient(to right, rgba(255, 255, 255, 0), #ffffff 80%); }
+ .nfv-landing-page .landing-page-view .lists-box .events ul > li:nth-child(even) .event-message p:after {
+ background: linear-gradient(to right, rgba(236, 241, 245, 0), #ecf1f5 80%); }
+ .nfv-landing-page .landing-page-view .lists-box .events ul > li time {
+ color: #253244;
+ text-align: center;
+ width: 80px; }
+ .nfv-landing-page .landing-page-view .lists-box .events ul > li .machine-id {
+ text-align: center; }
+ .nfv-landing-page .landing-page-view .lists-box .events ul > li .task-icon, .nfv-landing-page .landing-page-view .lists-box .events ul > li .type {
+ position: relative; }
+ .nfv-landing-page .landing-page-view .lists-box .events ul > li .task-icon:before, .nfv-landing-page .landing-page-view .lists-box .events ul > li .type:before {
+ position: absolute;
+ top: 50%;
+ transform: translateY(-50%); }
+ .nfv-landing-page .landing-page-view .lists-box .events ul > li .task-icon {
+ color: #8ccdf5;
+ cursor: pointer;
+ font-size: 17px;
+ height: 30px;
+ width: 10px; }
+ .nfv-landing-page .landing-page-view .lists-box .events ul > li .task-icon.empty {
+ background: none;
+ cursor: default; }
+ .nfv-landing-page .landing-page-view .lists-box .events ul > li .task-icon.empty:before {
+ content: ''; }
+ .nfv-landing-page .landing-page-view .lists-box .events ul > li .type {
+ width: 20px; }
+ .nfv-landing-page .landing-page-view .lists-box .events ul > li .type:before {
+ transform: translateY(-45%); }
+ .nfv-landing-page .landing-page-view .lists-box .list {
+ border-top: solid 1px rgba(168, 187, 220, 0.3);
+ bottom: 20px;
+ overflow-y: scroll;
+ position: absolute;
+ top: 65px;
+ transition: border 0.2s; }
+ .nfv-landing-page .landing-page-view .lists-box .list::after, .nfv-landing-page .landing-page-view .lists-box .list::before {
+ background: rgba(0, 0, 0, 0.6);
+ bottom: inherit;
+ content: '';
+ height: 50px;
+ opacity: 0;
+ position: fixed;
+ transform: scale(1, 0.5);
+ transform-origin: bottom;
+ transition: opacity 0.2s, transform 0.2s;
+ width: inherit;
+ z-index: 1; }
+ .nfv-landing-page .landing-page-view .lists-box .list::after {
+ -moz-animation: loader-spin 5s infinite linear;
+ -ms-animation: loader-spin 5s infinite linear;
+ -webkit-animation: loader-spin 5s infinite linear;
+ background-color: transparent;
+ color: white;
+ content: '\21bb';
+ font-size: 40px;
+ text-align: center;
+ transform-origin: center;
+ z-index: 2; }
+ .nfv-landing-page .landing-page-view .lists-box .list.loader-on::after, .nfv-landing-page .landing-page-view .lists-box .list.loader-on::before {
+ opacity: 1;
+ transform: scale(1, 1); }
+ .nfv-landing-page .landing-page-view .lists-box .services {
+ width: 27%; }
+ .nfv-landing-page .landing-page-view .lists-box .services ul > li {
+ border-left: 5px solid transparent;
+ border-bottom: solid 1px rgba(168, 187, 220, 0.3);
+ cursor: pointer;
+ padding: 10px;
+ position: relative;
+ transition: border 0.2s; }
+ .nfv-landing-page .landing-page-view .lists-box .services ul > li > h3 {
+ color: #253244;
+ transition: color 0.2s; }
+ .nfv-landing-page .landing-page-view .lists-box .services ul > li > label {
+ color: #1a2531; }
+ .nfv-landing-page .landing-page-view .lists-box .services ul > li > time {
+ display: block;
+ margin-top: 10px;
+ transition: color 0.2s; }
+ .nfv-landing-page .landing-page-view .lists-box .services ul > li .machine-id {
+ color: #f4f6f1; }
+ .nfv-landing-page .landing-page-view .lists-box .services ul > li > .status {
+ display: block;
+ font-size: 17px;
+ position: absolute;
+ right: 17px;
+ top: 15px; }
+ .nfv-landing-page .landing-page-view .lists-box .services ul > li > .status.active {
+ color: #9bdb69; }
+ .nfv-landing-page .landing-page-view .lists-box .services ul > li > .status.error {
+ color: #e65353; }
+ .nfv-landing-page .landing-page-view .lists-box .services ul > li > .status.new, .nfv-landing-page .landing-page-view .lists-box .services ul > li > .status.service-tree-created, .nfv-landing-page .landing-page-view .lists-box .services ul > li > .status.service-tree-approved {
+ color: #344358; }
+ .nfv-landing-page .landing-page-view .lists-box .services ul > li > .status.workflow-created, .nfv-landing-page .landing-page-view .lists-box .services ul > li > .status.workflow-started {
+ color: #419ef1; }
+ .nfv-landing-page .landing-page-view .lists-box .services ul > li > .status.suspended {
+ color: #419ef1; }
+ .nfv-landing-page .landing-page-view .lists-box .services ul > li > .status.terminated {
+ color: #a8bbdc; }
+
+body.theme2 .landing-page-view h2 {
+ color: #8ccdf5; }
+ body.theme2 .landing-page-view h2:nth-child(2) {
+ border-left: solid 2px #454544; }
+ body.theme2 .landing-page-view h2 .see-all-link span {
+ color: #f4f6f1; }
+
+body.theme2 .landing-page-view .search-filter-input input[type="search"] {
+ color: #b9bab5;
+ border-bottom-color: #454544; }
+
+body.theme2 .landing-page-view .lists-box .events {
+ border-left: solid 3px #454544; }
+ body.theme2 .landing-page-view .lists-box .events ul > li {
+ background-color: #232323; }
+ body.theme2 .landing-page-view .lists-box .events ul > li:nth-child(even) {
+ background-color: #292929; }
+ body.theme2 .landing-page-view .lists-box .events ul > li time {
+ color: #aaa6d9; }
+ body.theme2 .landing-page-view .lists-box .events ul > li .machine-id {
+ color: #f4f6f1; }
+ body.theme2 .landing-page-view .lists-box .events ul > li .event-message p:after {
+ background: linear-gradient(to right, rgba(35, 35, 35, 0), #232323 80%); }
+ body.theme2 .landing-page-view .lists-box .events ul > li:nth-child(even) .event-message p:after {
+ background: linear-gradient(to right, rgba(41, 41, 41, 0), #292929 80%); }
+
+body.theme2 .landing-page-view .lists-box .list {
+ border-top: solid 1px #454544; }
+
+body.theme2 .landing-page-view .lists-box .services ul > li {
+ border-bottom: solid 1px #454544; }
+ body.theme2 .landing-page-view .lists-box .services ul > li > label {
+ color: #f4f6f1; }
+ body.theme2 .landing-page-view .lists-box .services ul > li h3 {
+ color: #8ccdf5; }
+ body.theme2 .landing-page-view .lists-box .services ul > li > .status.active {
+ color: #9bdb69; }
+ body.theme2 .landing-page-view .lists-box .services ul > li > .status.error {
+ color: #ff7c54; }
+ body.theme2 .landing-page-view .lists-box .services ul > li > .status.new, body.theme2 .landing-page-view .lists-box .services ul > li > .status.service-tree-created, body.theme2 .landing-page-view .lists-box .services ul > li > .status.service-tree-approved {
+ color: #aaa6d9; }
+ body.theme2 .landing-page-view .lists-box .services ul > li > .status.workflow-created, body.theme2 .landing-page-view .lists-box .services ul > li > .status.workflow-started {
+ color: #8ccdf5; }
+ body.theme2 .landing-page-view .lists-box .services ul > li > .status.suspended {
+ color: #aaa6d9; }
+ body.theme2 .landing-page-view .lists-box .services ul > li > .status.terminated {
+ color: #b9bab5; }
+
+@-moz-keyframes loader-spin {
+ from {
+ transform: rotate(0deg); }
+ to {
+ transform: rotate(3600deg); } }
+
+@-ms-keyframes loader-spin {
+ from {
+ transform: rotate(0deg); }
+ to {
+ transform: rotate(3600deg); } }
+
+@-webkit-keyframes loader-spin {
+ from {
+ transform: rotate(0deg); }
+ to {
+ transform: rotate(3600deg); } }
+
+.graph-simulator-page h1, .graph-simulator-page h2, .graph-simulator-page h3, .graph-simulator-page h4 {
+ margin: 10px; }
+
+.graph-simulator-page .simulator-content {
+ padding-top: 20px;
+ padding-left: 20px; }
+
+.graph-simulator-page .input-label-first-fieldset {
+ min-width: 150px; }
+
+.graph-simulator-page .input-label-second-fieldset {
+ min-width: 150px; }
+
+.graph-simulator-page .first-fieldset, .graph-simulator-page .second-fieldset {
+ display: inline-block;
+ vertical-align: top; }
+
+.graph-simulator-page .warning {
+ color: red; }
+
+.graph-simulator-page .nfv-checkbox-button {
+ margin: 13px; }
+
+.graph-simulator-page .nfv-primary-button {
+ margin-bottom: 13px; }
+
+/*# sourceMappingURL=style.css.map */ \ No newline at end of file
diff --git a/openecomp-be/tools/swagger-ui/css/print.css b/openecomp-be/tools/swagger-ui/css/print.css
new file mode 100644
index 0000000000..c90e9f568e
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/css/print.css
@@ -0,0 +1,1175 @@
+/* Original style from softwaremaniacs.org (c) Ivan Sagalaev <Maniac@SoftwareManiacs.Org> */
+.swagger-section pre code {
+ display: block;
+ padding: 0.5em;
+ background: #F0F0F0;
+}
+.swagger-section pre code,
+.swagger-section pre .subst,
+.swagger-section pre .tag .title,
+.swagger-section pre .lisp .title,
+.swagger-section pre .clojure .built_in,
+.swagger-section pre .nginx .title {
+ color: black;
+}
+.swagger-section pre .string,
+.swagger-section pre .title,
+.swagger-section pre .constant,
+.swagger-section pre .parent,
+.swagger-section pre .tag .value,
+.swagger-section pre .rules .value,
+.swagger-section pre .rules .value .number,
+.swagger-section pre .preprocessor,
+.swagger-section pre .ruby .symbol,
+.swagger-section pre .ruby .symbol .string,
+.swagger-section pre .aggregate,
+.swagger-section pre .template_tag,
+.swagger-section pre .django .variable,
+.swagger-section pre .smalltalk .class,
+.swagger-section pre .addition,
+.swagger-section pre .flow,
+.swagger-section pre .stream,
+.swagger-section pre .bash .variable,
+.swagger-section pre .apache .tag,
+.swagger-section pre .apache .cbracket,
+.swagger-section pre .tex .command,
+.swagger-section pre .tex .special,
+.swagger-section pre .erlang_repl .function_or_atom,
+.swagger-section pre .markdown .header {
+ color: #800;
+}
+.swagger-section pre .comment,
+.swagger-section pre .annotation,
+.swagger-section pre .template_comment,
+.swagger-section pre .diff .header,
+.swagger-section pre .chunk,
+.swagger-section pre .markdown .blockquote {
+ color: #888;
+}
+.swagger-section pre .number,
+.swagger-section pre .date,
+.swagger-section pre .regexp,
+.swagger-section pre .literal,
+.swagger-section pre .smalltalk .symbol,
+.swagger-section pre .smalltalk .char,
+.swagger-section pre .go .constant,
+.swagger-section pre .change,
+.swagger-section pre .markdown .bullet,
+.swagger-section pre .markdown .link_url {
+ color: #080;
+}
+.swagger-section pre .label,
+.swagger-section pre .javadoc,
+.swagger-section pre .ruby .string,
+.swagger-section pre .decorator,
+.swagger-section pre .filter .argument,
+.swagger-section pre .localvars,
+.swagger-section pre .array,
+.swagger-section pre .attr_selector,
+.swagger-section pre .important,
+.swagger-section pre .pseudo,
+.swagger-section pre .pi,
+.swagger-section pre .doctype,
+.swagger-section pre .deletion,
+.swagger-section pre .envvar,
+.swagger-section pre .shebang,
+.swagger-section pre .apache .sqbracket,
+.swagger-section pre .nginx .built_in,
+.swagger-section pre .tex .formula,
+.swagger-section pre .erlang_repl .reserved,
+.swagger-section pre .prompt,
+.swagger-section pre .markdown .link_label,
+.swagger-section pre .vhdl .attribute,
+.swagger-section pre .clojure .attribute,
+.swagger-section pre .coffeescript .property {
+ color: #8888ff;
+}
+.swagger-section pre .keyword,
+.swagger-section pre .id,
+.swagger-section pre .phpdoc,
+.swagger-section pre .title,
+.swagger-section pre .built_in,
+.swagger-section pre .aggregate,
+.swagger-section pre .css .tag,
+.swagger-section pre .javadoctag,
+.swagger-section pre .phpdoc,
+.swagger-section pre .yardoctag,
+.swagger-section pre .smalltalk .class,
+.swagger-section pre .winutils,
+.swagger-section pre .bash .variable,
+.swagger-section pre .apache .tag,
+.swagger-section pre .go .typename,
+.swagger-section pre .tex .command,
+.swagger-section pre .markdown .strong,
+.swagger-section pre .request,
+.swagger-section pre .status {
+ font-weight: bold;
+}
+.swagger-section pre .markdown .emphasis {
+ font-style: italic;
+}
+.swagger-section pre .nginx .built_in {
+ font-weight: normal;
+}
+.swagger-section pre .coffeescript .javascript,
+.swagger-section pre .javascript .xml,
+.swagger-section pre .tex .formula,
+.swagger-section pre .xml .javascript,
+.swagger-section pre .xml .vbscript,
+.swagger-section pre .xml .css,
+.swagger-section pre .xml .cdata {
+ opacity: 0.5;
+}
+.swagger-section .swagger-ui-wrap {
+ line-height: 1;
+ font-family: "Droid Sans", sans-serif;
+ max-width: 960px;
+ margin-left: auto;
+ margin-right: auto;
+}
+.swagger-section .swagger-ui-wrap b,
+.swagger-section .swagger-ui-wrap strong {
+ font-family: "Droid Sans", sans-serif;
+ font-weight: bold;
+}
+.swagger-section .swagger-ui-wrap q,
+.swagger-section .swagger-ui-wrap blockquote {
+ quotes: none;
+}
+.swagger-section .swagger-ui-wrap p {
+ line-height: 1.4em;
+ padding: 0 0 10px;
+ color: #333333;
+}
+.swagger-section .swagger-ui-wrap q:before,
+.swagger-section .swagger-ui-wrap q:after,
+.swagger-section .swagger-ui-wrap blockquote:before,
+.swagger-section .swagger-ui-wrap blockquote:after {
+ content: none;
+}
+.swagger-section .swagger-ui-wrap .heading_with_menu h1,
+.swagger-section .swagger-ui-wrap .heading_with_menu h2,
+.swagger-section .swagger-ui-wrap .heading_with_menu h3,
+.swagger-section .swagger-ui-wrap .heading_with_menu h4,
+.swagger-section .swagger-ui-wrap .heading_with_menu h5,
+.swagger-section .swagger-ui-wrap .heading_with_menu h6 {
+ display: block;
+ clear: none;
+ float: left;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ -ms-box-sizing: border-box;
+ box-sizing: border-box;
+ width: 60%;
+}
+.swagger-section .swagger-ui-wrap table {
+ border-collapse: collapse;
+ border-spacing: 0;
+}
+.swagger-section .swagger-ui-wrap table thead tr th {
+ padding: 5px;
+ font-size: 0.9em;
+ color: #666666;
+ border-bottom: 1px solid #999999;
+}
+.swagger-section .swagger-ui-wrap table tbody tr:last-child td {
+ border-bottom: none;
+}
+.swagger-section .swagger-ui-wrap table tbody tr.offset {
+ background-color: #f0f0f0;
+}
+.swagger-section .swagger-ui-wrap table tbody tr td {
+ padding: 6px;
+ font-size: 0.9em;
+ border-bottom: 1px solid #cccccc;
+ vertical-align: top;
+ line-height: 1.3em;
+}
+.swagger-section .swagger-ui-wrap ol {
+ margin: 0px 0 10px;
+ padding: 0 0 0 18px;
+ list-style-type: decimal;
+}
+.swagger-section .swagger-ui-wrap ol li {
+ padding: 5px 0px;
+ font-size: 0.9em;
+ color: #333333;
+}
+.swagger-section .swagger-ui-wrap ol,
+.swagger-section .swagger-ui-wrap ul {
+ list-style: none;
+}
+.swagger-section .swagger-ui-wrap h1 a,
+.swagger-section .swagger-ui-wrap h2 a,
+.swagger-section .swagger-ui-wrap h3 a,
+.swagger-section .swagger-ui-wrap h4 a,
+.swagger-section .swagger-ui-wrap h5 a,
+.swagger-section .swagger-ui-wrap h6 a {
+ text-decoration: none;
+}
+.swagger-section .swagger-ui-wrap h1 a:hover,
+.swagger-section .swagger-ui-wrap h2 a:hover,
+.swagger-section .swagger-ui-wrap h3 a:hover,
+.swagger-section .swagger-ui-wrap h4 a:hover,
+.swagger-section .swagger-ui-wrap h5 a:hover,
+.swagger-section .swagger-ui-wrap h6 a:hover {
+ text-decoration: underline;
+}
+.swagger-section .swagger-ui-wrap h1 span.divider,
+.swagger-section .swagger-ui-wrap h2 span.divider,
+.swagger-section .swagger-ui-wrap h3 span.divider,
+.swagger-section .swagger-ui-wrap h4 span.divider,
+.swagger-section .swagger-ui-wrap h5 span.divider,
+.swagger-section .swagger-ui-wrap h6 span.divider {
+ color: #aaaaaa;
+}
+.swagger-section .swagger-ui-wrap a {
+ color: #547f00;
+}
+.swagger-section .swagger-ui-wrap a img {
+ border: none;
+}
+.swagger-section .swagger-ui-wrap article,
+.swagger-section .swagger-ui-wrap aside,
+.swagger-section .swagger-ui-wrap details,
+.swagger-section .swagger-ui-wrap figcaption,
+.swagger-section .swagger-ui-wrap figure,
+.swagger-section .swagger-ui-wrap footer,
+.swagger-section .swagger-ui-wrap header,
+.swagger-section .swagger-ui-wrap hgroup,
+.swagger-section .swagger-ui-wrap menu,
+.swagger-section .swagger-ui-wrap nav,
+.swagger-section .swagger-ui-wrap section,
+.swagger-section .swagger-ui-wrap summary {
+ display: block;
+}
+.swagger-section .swagger-ui-wrap pre {
+ font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
+ background-color: #fcf6db;
+ border: 1px solid #e5e0c6;
+ padding: 10px;
+}
+.swagger-section .swagger-ui-wrap pre code {
+ line-height: 1.6em;
+ background: none;
+}
+.swagger-section .swagger-ui-wrap .content > .content-type > div > label {
+ clear: both;
+ display: block;
+ color: #0F6AB4;
+ font-size: 1.1em;
+ margin: 0;
+ padding: 15px 0 5px;
+}
+.swagger-section .swagger-ui-wrap .content pre {
+ font-size: 12px;
+ margin-top: 5px;
+ padding: 5px;
+}
+.swagger-section .swagger-ui-wrap .icon-btn {
+ cursor: pointer;
+}
+.swagger-section .swagger-ui-wrap .info_title {
+ padding-bottom: 10px;
+ font-weight: bold;
+ font-size: 25px;
+}
+.swagger-section .swagger-ui-wrap .footer {
+ margin-top: 20px;
+}
+.swagger-section .swagger-ui-wrap p.big,
+.swagger-section .swagger-ui-wrap div.big p {
+ font-size: 1em;
+ margin-bottom: 10px;
+}
+.swagger-section .swagger-ui-wrap form.fullwidth ol li.string input,
+.swagger-section .swagger-ui-wrap form.fullwidth ol li.url input,
+.swagger-section .swagger-ui-wrap form.fullwidth ol li.text textarea,
+.swagger-section .swagger-ui-wrap form.fullwidth ol li.numeric input {
+ width: 500px !important;
+}
+.swagger-section .swagger-ui-wrap .info_license {
+ padding-bottom: 5px;
+}
+.swagger-section .swagger-ui-wrap .info_tos {
+ padding-bottom: 5px;
+}
+.swagger-section .swagger-ui-wrap .message-fail {
+ color: #cc0000;
+}
+.swagger-section .swagger-ui-wrap .info_url {
+ padding-bottom: 5px;
+}
+.swagger-section .swagger-ui-wrap .info_email {
+ padding-bottom: 5px;
+}
+.swagger-section .swagger-ui-wrap .info_name {
+ padding-bottom: 5px;
+}
+.swagger-section .swagger-ui-wrap .info_description {
+ padding-bottom: 10px;
+ font-size: 15px;
+}
+.swagger-section .swagger-ui-wrap .markdown ol li,
+.swagger-section .swagger-ui-wrap .markdown ul li {
+ padding: 3px 0px;
+ line-height: 1.4em;
+ color: #333333;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input,
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input,
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input {
+ display: block;
+ padding: 4px;
+ width: auto;
+ clear: both;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input.title,
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input.title,
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input.title {
+ font-size: 1.3em;
+}
+.swagger-section .swagger-ui-wrap table.fullwidth {
+ width: 100%;
+}
+.swagger-section .swagger-ui-wrap .model-signature {
+ font-family: "Droid Sans", sans-serif;
+ font-size: 1em;
+ line-height: 1.5em;
+}
+.swagger-section .swagger-ui-wrap .model-signature .signature-nav a {
+ text-decoration: none;
+ color: #AAA;
+}
+.swagger-section .swagger-ui-wrap .model-signature .signature-nav a:hover {
+ text-decoration: underline;
+ color: black;
+}
+.swagger-section .swagger-ui-wrap .model-signature .signature-nav .selected {
+ color: black;
+ text-decoration: none;
+}
+.swagger-section .swagger-ui-wrap .model-signature .propType {
+ color: #5555aa;
+}
+.swagger-section .swagger-ui-wrap .model-signature pre:hover {
+ background-color: #ffffdd;
+}
+.swagger-section .swagger-ui-wrap .model-signature pre {
+ font-size: .85em;
+ line-height: 1.2em;
+ overflow: auto;
+ max-height: 200px;
+ cursor: pointer;
+}
+.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav {
+ display: block;
+ margin: 0;
+ padding: 0;
+}
+.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li:last-child {
+ padding-right: 0;
+ border-right: none;
+}
+.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li {
+ float: left;
+ margin: 0 5px 5px 0;
+ padding: 2px 5px 2px 0;
+ border-right: 1px solid #ddd;
+}
+.swagger-section .swagger-ui-wrap .model-signature .propOpt {
+ color: #555;
+}
+.swagger-section .swagger-ui-wrap .model-signature .snippet small {
+ font-size: 0.75em;
+}
+.swagger-section .swagger-ui-wrap .model-signature .propOptKey {
+ font-style: italic;
+}
+.swagger-section .swagger-ui-wrap .model-signature .description .strong {
+ font-weight: bold;
+ color: #000;
+ font-size: .9em;
+}
+.swagger-section .swagger-ui-wrap .model-signature .description div {
+ font-size: 0.9em;
+ line-height: 1.5em;
+ margin-left: 1em;
+}
+.swagger-section .swagger-ui-wrap .model-signature .description .stronger {
+ font-weight: bold;
+ color: #000;
+}
+.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper {
+ border-spacing: 0;
+ position: absolute;
+ background-color: #ffffff;
+ border: 1px solid #bbbbbb;
+ display: none;
+ font-size: 11px;
+ max-width: 400px;
+ line-height: 30px;
+ color: black;
+ padding: 5px;
+ margin-left: 10px;
+}
+.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper th {
+ text-align: center;
+ background-color: #eeeeee;
+ border: 1px solid #bbbbbb;
+ font-size: 11px;
+ color: #666666;
+ font-weight: bold;
+ padding: 5px;
+ line-height: 15px;
+}
+.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper .optionName {
+ font-weight: bold;
+}
+.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:first-child,
+.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:last-child {
+ display: inline;
+}
+.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:not(:first-child):before {
+ display: block;
+ content: '';
+}
+.swagger-section .swagger-ui-wrap .model-signature .description span:last-of-type.propDesc.markdown > p:only-child {
+ margin-right: -3px;
+}
+.swagger-section .swagger-ui-wrap .model-signature .propName {
+ font-weight: bold;
+}
+.swagger-section .swagger-ui-wrap .model-signature .signature-container {
+ clear: both;
+}
+.swagger-section .swagger-ui-wrap .body-textarea {
+ width: 300px;
+ height: 100px;
+ border: 1px solid #aaa;
+}
+.swagger-section .swagger-ui-wrap .markdown p code,
+.swagger-section .swagger-ui-wrap .markdown li code {
+ font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
+ background-color: #f0f0f0;
+ color: black;
+ padding: 1px 3px;
+}
+.swagger-section .swagger-ui-wrap .required {
+ font-weight: bold;
+}
+.swagger-section .swagger-ui-wrap input.parameter {
+ width: 300px;
+ border: 1px solid #aaa;
+}
+.swagger-section .swagger-ui-wrap h1 {
+ color: black;
+ font-size: 1.5em;
+ line-height: 1.3em;
+ padding: 10px 0 10px 0;
+ font-family: "Droid Sans", sans-serif;
+ font-weight: bold;
+}
+.swagger-section .swagger-ui-wrap .heading_with_menu {
+ float: none;
+ clear: both;
+ overflow: hidden;
+ display: block;
+}
+.swagger-section .swagger-ui-wrap .heading_with_menu ul {
+ display: block;
+ clear: none;
+ float: right;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ -ms-box-sizing: border-box;
+ box-sizing: border-box;
+ margin-top: 10px;
+}
+.swagger-section .swagger-ui-wrap h2 {
+ color: black;
+ font-size: 1.3em;
+ padding: 10px 0 10px 0;
+}
+.swagger-section .swagger-ui-wrap h2 a {
+ color: black;
+}
+.swagger-section .swagger-ui-wrap h2 span.sub {
+ font-size: 0.7em;
+ color: #999999;
+ font-style: italic;
+}
+.swagger-section .swagger-ui-wrap h2 span.sub a {
+ color: #777777;
+}
+.swagger-section .swagger-ui-wrap span.weak {
+ color: #666666;
+}
+.swagger-section .swagger-ui-wrap .message-success {
+ color: #89BF04;
+}
+.swagger-section .swagger-ui-wrap caption,
+.swagger-section .swagger-ui-wrap th,
+.swagger-section .swagger-ui-wrap td {
+ text-align: left;
+ font-weight: normal;
+ vertical-align: middle;
+}
+.swagger-section .swagger-ui-wrap .code {
+ font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.text textarea {
+ font-family: "Droid Sans", sans-serif;
+ height: 250px;
+ padding: 4px;
+ display: block;
+ clear: both;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.select select {
+ display: block;
+ clear: both;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean {
+ float: none;
+ clear: both;
+ overflow: hidden;
+ display: block;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean label {
+ display: block;
+ float: left;
+ clear: none;
+ margin: 0;
+ padding: 0;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean input {
+ display: block;
+ float: left;
+ clear: none;
+ margin: 0 5px 0 0;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.required label {
+ color: black;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label {
+ display: block;
+ clear: both;
+ width: auto;
+ padding: 0 0 3px;
+ color: #666666;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label abbr {
+ padding-left: 3px;
+ color: #888888;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li p.inline-hints {
+ margin-left: 0;
+ font-style: italic;
+ font-size: 0.9em;
+ margin: 0;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.buttons {
+ margin: 0;
+ padding: 0;
+}
+.swagger-section .swagger-ui-wrap span.blank,
+.swagger-section .swagger-ui-wrap span.empty {
+ color: #888888;
+ font-style: italic;
+}
+.swagger-section .swagger-ui-wrap .markdown h3 {
+ color: #547f00;
+}
+.swagger-section .swagger-ui-wrap .markdown h4 {
+ color: #666666;
+}
+.swagger-section .swagger-ui-wrap .markdown pre {
+ font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
+ background-color: #fcf6db;
+ border: 1px solid #e5e0c6;
+ padding: 10px;
+ margin: 0 0 10px 0;
+}
+.swagger-section .swagger-ui-wrap .markdown pre code {
+ line-height: 1.6em;
+}
+.swagger-section .swagger-ui-wrap div.gist {
+ margin: 20px 0 25px 0 !important;
+}
+.swagger-section .swagger-ui-wrap ul#resources {
+ font-family: "Droid Sans", sans-serif;
+ font-size: 0.9em;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource {
+ border-bottom: 1px solid #dddddd;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading h2 a,
+.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading h2 a {
+ color: black;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading ul.options li a,
+.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading ul.options li a {
+ color: #555555;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource:last-child {
+ border-bottom: none;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading {
+ border: 1px solid transparent;
+ float: none;
+ clear: both;
+ overflow: hidden;
+ display: block;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options {
+ overflow: hidden;
+ padding: 0;
+ display: block;
+ clear: none;
+ float: right;
+ margin: 14px 10px 0 0;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li {
+ float: left;
+ clear: none;
+ margin: 0;
+ padding: 2px 10px;
+ border-right: 1px solid #dddddd;
+ color: #666666;
+ font-size: 0.9em;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a {
+ color: #aaaaaa;
+ text-decoration: none;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover {
+ text-decoration: underline;
+ color: black;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover,
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:active,
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a.active {
+ text-decoration: underline;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:first-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.first {
+ padding-left: 0;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:last-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.last {
+ padding-right: 0;
+ border-right: none;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options:first-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options.first {
+ padding-left: 0;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 {
+ color: #999999;
+ padding-left: 0;
+ display: block;
+ clear: none;
+ float: left;
+ font-family: "Droid Sans", sans-serif;
+ font-weight: bold;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a {
+ color: #999999;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a:hover {
+ color: black;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation {
+ float: none;
+ clear: both;
+ overflow: hidden;
+ display: block;
+ margin: 0 0 10px;
+ padding: 0;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading {
+ float: none;
+ clear: both;
+ overflow: hidden;
+ display: block;
+ margin: 0;
+ padding: 0;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 {
+ display: block;
+ clear: none;
+ float: left;
+ width: auto;
+ margin: 0;
+ padding: 0;
+ line-height: 1.1em;
+ color: black;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path {
+ padding-left: 10px;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a {
+ color: black;
+ text-decoration: none;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a:hover {
+ text-decoration: underline;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.http_method a {
+ text-transform: uppercase;
+ text-decoration: none;
+ color: white;
+ display: inline-block;
+ width: 50px;
+ font-size: 0.7em;
+ text-align: center;
+ padding: 7px 0 4px;
+ -moz-border-radius: 2px;
+ -webkit-border-radius: 2px;
+ -o-border-radius: 2px;
+ -ms-border-radius: 2px;
+ -khtml-border-radius: 2px;
+ border-radius: 2px;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span {
+ margin: 0;
+ padding: 0;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options {
+ overflow: hidden;
+ padding: 0;
+ display: block;
+ clear: none;
+ float: right;
+ margin: 6px 10px 0 0;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li {
+ float: left;
+ clear: none;
+ margin: 0;
+ padding: 2px 10px;
+ font-size: 0.9em;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li a {
+ text-decoration: none;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li.access {
+ color: black;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content {
+ border-top: none;
+ padding: 10px;
+ -moz-border-radius-bottomleft: 6px;
+ -webkit-border-bottom-left-radius: 6px;
+ -o-border-bottom-left-radius: 6px;
+ -ms-border-bottom-left-radius: 6px;
+ -khtml-border-bottom-left-radius: 6px;
+ border-bottom-left-radius: 6px;
+ -moz-border-radius-bottomright: 6px;
+ -webkit-border-bottom-right-radius: 6px;
+ -o-border-bottom-right-radius: 6px;
+ -ms-border-bottom-right-radius: 6px;
+ -khtml-border-bottom-right-radius: 6px;
+ border-bottom-right-radius: 6px;
+ margin: 0 0 20px;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content h4 {
+ font-size: 1.1em;
+ margin: 0;
+ padding: 15px 0 5px;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header {
+ float: none;
+ clear: both;
+ overflow: hidden;
+ display: block;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header a {
+ padding: 4px 0 0 10px;
+ display: inline-block;
+ font-size: 0.9em;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header input.submit {
+ display: block;
+ clear: none;
+ float: left;
+ padding: 6px 8px;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header span.response_throbber {
+ background-image: url('../images/throbber.gif');
+ width: 128px;
+ height: 16px;
+ display: block;
+ clear: none;
+ float: right;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form input[type='text'].error {
+ outline: 2px solid black;
+ outline-color: #cc0000;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form select[name='parameterContentType'] {
+ max-width: 300px;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.response div.block pre {
+ font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
+ padding: 10px;
+ font-size: 0.9em;
+ max-height: 400px;
+ overflow-y: auto;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading {
+ background-color: #f9f2e9;
+ border: 1px solid #f0e0ca;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading h3 span.http_method a {
+ background-color: #c5862b;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li {
+ border-right: 1px solid #dddddd;
+ border-right-color: #f0e0ca;
+ color: #c5862b;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li a {
+ color: #c5862b;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content {
+ background-color: #faf5ee;
+ border: 1px solid #f0e0ca;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content h4 {
+ color: #c5862b;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content div.sandbox_header a {
+ color: #dcb67f;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading {
+ background-color: #fcffcd;
+ border: 1px solid black;
+ border-color: #ffd20f;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading h3 span.http_method a {
+ text-transform: uppercase;
+ background-color: #ffd20f;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li {
+ border-right: 1px solid #dddddd;
+ border-right-color: #ffd20f;
+ color: #ffd20f;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li a {
+ color: #ffd20f;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content {
+ background-color: #fcffcd;
+ border: 1px solid black;
+ border-color: #ffd20f;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content h4 {
+ color: #ffd20f;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content div.sandbox_header a {
+ color: #6fc992;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading {
+ background-color: #f5e8e8;
+ border: 1px solid #e8c6c7;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading h3 span.http_method a {
+ text-transform: uppercase;
+ background-color: #a41e22;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li {
+ border-right: 1px solid #dddddd;
+ border-right-color: #e8c6c7;
+ color: #a41e22;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li a {
+ color: #a41e22;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content {
+ background-color: #f7eded;
+ border: 1px solid #e8c6c7;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content h4 {
+ color: #a41e22;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content div.sandbox_header a {
+ color: #c8787a;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading {
+ background-color: #e7f6ec;
+ border: 1px solid #c3e8d1;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading h3 span.http_method a {
+ background-color: #10a54a;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li {
+ border-right: 1px solid #dddddd;
+ border-right-color: #c3e8d1;
+ color: #10a54a;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li a {
+ color: #10a54a;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content {
+ background-color: #ebf7f0;
+ border: 1px solid #c3e8d1;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content h4 {
+ color: #10a54a;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content div.sandbox_header a {
+ color: #6fc992;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading {
+ background-color: #FCE9E3;
+ border: 1px solid #F5D5C3;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading h3 span.http_method a {
+ background-color: #D38042;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li {
+ border-right: 1px solid #dddddd;
+ border-right-color: #f0cecb;
+ color: #D38042;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li a {
+ color: #D38042;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content {
+ background-color: #faf0ef;
+ border: 1px solid #f0cecb;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content h4 {
+ color: #D38042;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content div.sandbox_header a {
+ color: #dcb67f;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading {
+ background-color: #e7f0f7;
+ border: 1px solid #c3d9ec;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading h3 span.http_method a {
+ background-color: #0f6ab4;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li {
+ border-right: 1px solid #dddddd;
+ border-right-color: #c3d9ec;
+ color: #0f6ab4;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li a {
+ color: #0f6ab4;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content {
+ background-color: #ebf3f9;
+ border: 1px solid #c3d9ec;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content h4 {
+ color: #0f6ab4;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content div.sandbox_header a {
+ color: #6fa5d2;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading {
+ background-color: #e7f0f7;
+ border: 1px solid #c3d9ec;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading h3 span.http_method a {
+ background-color: #0f6ab4;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li {
+ border-right: 1px solid #dddddd;
+ border-right-color: #c3d9ec;
+ color: #0f6ab4;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li a {
+ color: #0f6ab4;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content {
+ background-color: #ebf3f9;
+ border: 1px solid #c3d9ec;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content h4 {
+ color: #0f6ab4;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content div.sandbox_header a {
+ color: #6fa5d2;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content {
+ border-top: none;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li:last-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li:last-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li:last-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li:last-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li:last-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li:last-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li.last,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li.last,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li.last,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li.last,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li.last,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li.last {
+ padding-right: 0;
+ border-right: none;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:hover,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:active,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a.active {
+ text-decoration: underline;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li:first-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li.first {
+ padding-left: 0;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations:first-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations.first {
+ padding-left: 0;
+}
+.swagger-section .swagger-ui-wrap p#colophon {
+ margin: 0 15px 40px 15px;
+ padding: 10px 0;
+ font-size: 0.8em;
+ border-top: 1px solid #dddddd;
+ font-family: "Droid Sans", sans-serif;
+ color: #999999;
+ font-style: italic;
+}
+.swagger-section .swagger-ui-wrap p#colophon a {
+ text-decoration: none;
+ color: #547f00;
+}
+.swagger-section .swagger-ui-wrap h3 {
+ color: black;
+ font-size: 1.1em;
+ padding: 10px 0 10px 0;
+}
+.swagger-section .swagger-ui-wrap .markdown ol,
+.swagger-section .swagger-ui-wrap .markdown ul {
+ font-family: "Droid Sans", sans-serif;
+ margin: 5px 0 10px;
+ padding: 0 0 0 18px;
+ list-style-type: disc;
+}
+.swagger-section .swagger-ui-wrap form.form_box {
+ background-color: #ebf3f9;
+ border: 1px solid #c3d9ec;
+ padding: 10px;
+}
+.swagger-section .swagger-ui-wrap form.form_box label {
+ color: #0f6ab4 !important;
+}
+.swagger-section .swagger-ui-wrap form.form_box input[type=submit] {
+ display: block;
+ padding: 10px;
+}
+.swagger-section .swagger-ui-wrap form.form_box p.weak {
+ font-size: 0.8em;
+}
+.swagger-section .swagger-ui-wrap form.form_box p {
+ font-size: 0.9em;
+ padding: 0 0 15px;
+ color: #7e7b6d;
+}
+.swagger-section .swagger-ui-wrap form.form_box p a {
+ color: #646257;
+}
+.swagger-section .swagger-ui-wrap form.form_box p strong {
+ color: black;
+}
+.swagger-section .swagger-ui-wrap .operation-status td.markdown > p:last-child {
+ padding-bottom: 0;
+}
+.swagger-section .title {
+ font-style: bold;
+}
+.swagger-section .secondary_form {
+ display: none;
+}
+.swagger-section .main_image {
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+}
+.swagger-section .oauth_body {
+ margin-left: 100px;
+ margin-right: 100px;
+}
+.swagger-section .oauth_submit {
+ text-align: center;
+}
+.swagger-section .api-popup-dialog {
+ z-index: 10000;
+ position: absolute;
+ width: 500px;
+ background: #FFF;
+ padding: 20px;
+ border: 1px solid #ccc;
+ border-radius: 5px;
+ display: none;
+ font-size: 13px;
+ color: #777;
+}
+.swagger-section .api-popup-dialog .api-popup-title {
+ font-size: 24px;
+ padding: 10px 0;
+}
+.swagger-section .api-popup-dialog .api-popup-title {
+ font-size: 24px;
+ padding: 10px 0;
+}
+.swagger-section .api-popup-dialog p.error-msg {
+ padding-left: 5px;
+ padding-bottom: 5px;
+}
+.swagger-section .api-popup-dialog button.api-popup-authbtn {
+ height: 30px;
+}
+.swagger-section .api-popup-dialog button.api-popup-cancel {
+ height: 30px;
+}
+.swagger-section .api-popup-scopes {
+ padding: 10px 20px;
+}
+.swagger-section .api-popup-scopes li {
+ padding: 5px 0;
+ line-height: 20px;
+}
+.swagger-section .api-popup-scopes .api-scope-desc {
+ padding-left: 20px;
+ font-style: italic;
+}
+.swagger-section .api-popup-scopes li input {
+ position: relative;
+ top: 2px;
+}
+.swagger-section .api-popup-actions {
+ padding-top: 10px;
+}
+#header {
+ display: none;
+}
+.swagger-section .swagger-ui-wrap .model-signature pre {
+ max-height: none;
+}
+.swagger-section .swagger-ui-wrap .body-textarea {
+ width: 100px;
+}
+.swagger-section .swagger-ui-wrap input.parameter {
+ width: 100px;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options {
+ display: none;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints {
+ display: block !important;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content {
+ display: block !important;
+}
diff --git a/openecomp-be/tools/swagger-ui/css/reset.css b/openecomp-be/tools/swagger-ui/css/reset.css
new file mode 100644
index 0000000000..b2b078943c
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/css/reset.css
@@ -0,0 +1,125 @@
+/* http://meyerweb.com/eric/tools/css/reset/ v2.0 | 20110126 */
+html,
+body,
+div,
+span,
+applet,
+object,
+iframe,
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+p,
+blockquote,
+pre,
+a,
+abbr,
+acronym,
+address,
+big,
+cite,
+code,
+del,
+dfn,
+em,
+img,
+ins,
+kbd,
+q,
+s,
+samp,
+small,
+strike,
+strong,
+sub,
+sup,
+tt,
+var,
+b,
+u,
+i,
+center,
+dl,
+dt,
+dd,
+ol,
+ul,
+li,
+fieldset,
+form,
+label,
+legend,
+table,
+caption,
+tbody,
+tfoot,
+thead,
+tr,
+th,
+td,
+article,
+aside,
+canvas,
+details,
+embed,
+figure,
+figcaption,
+footer,
+header,
+hgroup,
+menu,
+nav,
+output,
+ruby,
+section,
+summary,
+time,
+mark,
+audio,
+video {
+ margin: 0;
+ padding: 0;
+ border: 0;
+ font-size: 100%;
+ font: inherit;
+ vertical-align: baseline;
+}
+/* HTML5 display-role reset for older browsers */
+article,
+aside,
+details,
+figcaption,
+figure,
+footer,
+header,
+hgroup,
+menu,
+nav,
+section {
+ display: block;
+}
+body {
+ line-height: 1;
+}
+ol,
+ul {
+ list-style: none;
+}
+blockquote,
+q {
+ quotes: none;
+}
+blockquote:before,
+blockquote:after,
+q:before,
+q:after {
+ content: '';
+ content: none;
+}
+table {
+ border-collapse: collapse;
+ border-spacing: 0;
+}
diff --git a/openecomp-be/tools/swagger-ui/css/screen.css b/openecomp-be/tools/swagger-ui/css/screen.css
new file mode 100644
index 0000000000..96f54548c0
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/css/screen.css
@@ -0,0 +1,1282 @@
+/* Original style from softwaremaniacs.org (c) Ivan Sagalaev <Maniac@SoftwareManiacs.Org> */
+.swagger-section pre code {
+ display: block;
+ padding: 0.5em;
+ background: #F0F0F0;
+}
+.swagger-section pre code,
+.swagger-section pre .subst,
+.swagger-section pre .tag .title,
+.swagger-section pre .lisp .title,
+.swagger-section pre .clojure .built_in,
+.swagger-section pre .nginx .title {
+ color: black;
+}
+.swagger-section pre .string,
+.swagger-section pre .title,
+.swagger-section pre .constant,
+.swagger-section pre .parent,
+.swagger-section pre .tag .value,
+.swagger-section pre .rules .value,
+.swagger-section pre .rules .value .number,
+.swagger-section pre .preprocessor,
+.swagger-section pre .ruby .symbol,
+.swagger-section pre .ruby .symbol .string,
+.swagger-section pre .aggregate,
+.swagger-section pre .template_tag,
+.swagger-section pre .django .variable,
+.swagger-section pre .smalltalk .class,
+.swagger-section pre .addition,
+.swagger-section pre .flow,
+.swagger-section pre .stream,
+.swagger-section pre .bash .variable,
+.swagger-section pre .apache .tag,
+.swagger-section pre .apache .cbracket,
+.swagger-section pre .tex .command,
+.swagger-section pre .tex .special,
+.swagger-section pre .erlang_repl .function_or_atom,
+.swagger-section pre .markdown .header {
+ color: #800;
+}
+.swagger-section pre .comment,
+.swagger-section pre .annotation,
+.swagger-section pre .template_comment,
+.swagger-section pre .diff .header,
+.swagger-section pre .chunk,
+.swagger-section pre .markdown .blockquote {
+ color: #888;
+}
+.swagger-section pre .number,
+.swagger-section pre .date,
+.swagger-section pre .regexp,
+.swagger-section pre .literal,
+.swagger-section pre .smalltalk .symbol,
+.swagger-section pre .smalltalk .char,
+.swagger-section pre .go .constant,
+.swagger-section pre .change,
+.swagger-section pre .markdown .bullet,
+.swagger-section pre .markdown .link_url {
+ color: #080;
+}
+.swagger-section pre .label,
+.swagger-section pre .javadoc,
+.swagger-section pre .ruby .string,
+.swagger-section pre .decorator,
+.swagger-section pre .filter .argument,
+.swagger-section pre .localvars,
+.swagger-section pre .array,
+.swagger-section pre .attr_selector,
+.swagger-section pre .important,
+.swagger-section pre .pseudo,
+.swagger-section pre .pi,
+.swagger-section pre .doctype,
+.swagger-section pre .deletion,
+.swagger-section pre .envvar,
+.swagger-section pre .shebang,
+.swagger-section pre .apache .sqbracket,
+.swagger-section pre .nginx .built_in,
+.swagger-section pre .tex .formula,
+.swagger-section pre .erlang_repl .reserved,
+.swagger-section pre .prompt,
+.swagger-section pre .markdown .link_label,
+.swagger-section pre .vhdl .attribute,
+.swagger-section pre .clojure .attribute,
+.swagger-section pre .coffeescript .property {
+ color: #8888ff;
+}
+.swagger-section pre .keyword,
+.swagger-section pre .id,
+.swagger-section pre .phpdoc,
+.swagger-section pre .title,
+.swagger-section pre .built_in,
+.swagger-section pre .aggregate,
+.swagger-section pre .css .tag,
+.swagger-section pre .javadoctag,
+.swagger-section pre .phpdoc,
+.swagger-section pre .yardoctag,
+.swagger-section pre .smalltalk .class,
+.swagger-section pre .winutils,
+.swagger-section pre .bash .variable,
+.swagger-section pre .apache .tag,
+.swagger-section pre .go .typename,
+.swagger-section pre .tex .command,
+.swagger-section pre .markdown .strong,
+.swagger-section pre .request,
+.swagger-section pre .status {
+ font-weight: bold;
+}
+.swagger-section pre .markdown .emphasis {
+ font-style: italic;
+}
+.swagger-section pre .nginx .built_in {
+ font-weight: normal;
+}
+.swagger-section pre .coffeescript .javascript,
+.swagger-section pre .javascript .xml,
+.swagger-section pre .tex .formula,
+.swagger-section pre .xml .javascript,
+.swagger-section pre .xml .vbscript,
+.swagger-section pre .xml .css,
+.swagger-section pre .xml .cdata {
+ opacity: 0.5;
+}
+.swagger-section .swagger-ui-wrap {
+ line-height: 1;
+ font-family: "Droid Sans", sans-serif;
+ max-width: 960px;
+ margin-left: auto;
+ margin-right: auto;
+}
+.swagger-section .swagger-ui-wrap b,
+.swagger-section .swagger-ui-wrap strong {
+ font-family: "Droid Sans", sans-serif;
+ font-weight: bold;
+}
+.swagger-section .swagger-ui-wrap q,
+.swagger-section .swagger-ui-wrap blockquote {
+ quotes: none;
+}
+.swagger-section .swagger-ui-wrap p {
+ line-height: 1.4em;
+ padding: 0 0 10px;
+ color: #333333;
+}
+.swagger-section .swagger-ui-wrap q:before,
+.swagger-section .swagger-ui-wrap q:after,
+.swagger-section .swagger-ui-wrap blockquote:before,
+.swagger-section .swagger-ui-wrap blockquote:after {
+ content: none;
+}
+.swagger-section .swagger-ui-wrap .heading_with_menu h1,
+.swagger-section .swagger-ui-wrap .heading_with_menu h2,
+.swagger-section .swagger-ui-wrap .heading_with_menu h3,
+.swagger-section .swagger-ui-wrap .heading_with_menu h4,
+.swagger-section .swagger-ui-wrap .heading_with_menu h5,
+.swagger-section .swagger-ui-wrap .heading_with_menu h6 {
+ display: block;
+ clear: none;
+ float: left;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ -ms-box-sizing: border-box;
+ box-sizing: border-box;
+ width: 60%;
+}
+.swagger-section .swagger-ui-wrap table {
+ border-collapse: collapse;
+ border-spacing: 0;
+}
+.swagger-section .swagger-ui-wrap table thead tr th {
+ padding: 5px;
+ font-size: 0.9em;
+ color: #666666;
+ border-bottom: 1px solid #999999;
+}
+.swagger-section .swagger-ui-wrap table tbody tr:last-child td {
+ border-bottom: none;
+}
+.swagger-section .swagger-ui-wrap table tbody tr.offset {
+ background-color: #f0f0f0;
+}
+.swagger-section .swagger-ui-wrap table tbody tr td {
+ padding: 6px;
+ font-size: 0.9em;
+ border-bottom: 1px solid #cccccc;
+ vertical-align: top;
+ line-height: 1.3em;
+}
+.swagger-section .swagger-ui-wrap ol {
+ margin: 0px 0 10px;
+ padding: 0 0 0 18px;
+ list-style-type: decimal;
+}
+.swagger-section .swagger-ui-wrap ol li {
+ padding: 5px 0px;
+ font-size: 0.9em;
+ color: #333333;
+}
+.swagger-section .swagger-ui-wrap ol,
+.swagger-section .swagger-ui-wrap ul {
+ list-style: none;
+}
+.swagger-section .swagger-ui-wrap h1 a,
+.swagger-section .swagger-ui-wrap h2 a,
+.swagger-section .swagger-ui-wrap h3 a,
+.swagger-section .swagger-ui-wrap h4 a,
+.swagger-section .swagger-ui-wrap h5 a,
+.swagger-section .swagger-ui-wrap h6 a {
+ text-decoration: none;
+}
+.swagger-section .swagger-ui-wrap h1 a:hover,
+.swagger-section .swagger-ui-wrap h2 a:hover,
+.swagger-section .swagger-ui-wrap h3 a:hover,
+.swagger-section .swagger-ui-wrap h4 a:hover,
+.swagger-section .swagger-ui-wrap h5 a:hover,
+.swagger-section .swagger-ui-wrap h6 a:hover {
+ text-decoration: underline;
+}
+.swagger-section .swagger-ui-wrap h1 span.divider,
+.swagger-section .swagger-ui-wrap h2 span.divider,
+.swagger-section .swagger-ui-wrap h3 span.divider,
+.swagger-section .swagger-ui-wrap h4 span.divider,
+.swagger-section .swagger-ui-wrap h5 span.divider,
+.swagger-section .swagger-ui-wrap h6 span.divider {
+ color: #aaaaaa;
+}
+.swagger-section .swagger-ui-wrap a {
+ color: #547f00;
+}
+.swagger-section .swagger-ui-wrap a img {
+ border: none;
+}
+.swagger-section .swagger-ui-wrap article,
+.swagger-section .swagger-ui-wrap aside,
+.swagger-section .swagger-ui-wrap details,
+.swagger-section .swagger-ui-wrap figcaption,
+.swagger-section .swagger-ui-wrap figure,
+.swagger-section .swagger-ui-wrap footer,
+.swagger-section .swagger-ui-wrap header,
+.swagger-section .swagger-ui-wrap hgroup,
+.swagger-section .swagger-ui-wrap menu,
+.swagger-section .swagger-ui-wrap nav,
+.swagger-section .swagger-ui-wrap section,
+.swagger-section .swagger-ui-wrap summary {
+ display: block;
+}
+.swagger-section .swagger-ui-wrap pre {
+ font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
+ background-color: #fcf6db;
+ border: 1px solid #e5e0c6;
+ padding: 10px;
+}
+.swagger-section .swagger-ui-wrap pre code {
+ line-height: 1.6em;
+ background: none;
+}
+.swagger-section .swagger-ui-wrap .content > .content-type > div > label {
+ clear: both;
+ display: block;
+ color: #0F6AB4;
+ font-size: 1.1em;
+ margin: 0;
+ padding: 15px 0 5px;
+}
+.swagger-section .swagger-ui-wrap .content pre {
+ font-size: 12px;
+ margin-top: 5px;
+ padding: 5px;
+}
+.swagger-section .swagger-ui-wrap .icon-btn {
+ cursor: pointer;
+}
+.swagger-section .swagger-ui-wrap .info_title {
+ padding-bottom: 10px;
+ font-weight: bold;
+ font-size: 25px;
+}
+.swagger-section .swagger-ui-wrap .footer {
+ margin-top: 20px;
+}
+.swagger-section .swagger-ui-wrap p.big,
+.swagger-section .swagger-ui-wrap div.big p {
+ font-size: 1em;
+ margin-bottom: 10px;
+}
+.swagger-section .swagger-ui-wrap form.fullwidth ol li.string input,
+.swagger-section .swagger-ui-wrap form.fullwidth ol li.url input,
+.swagger-section .swagger-ui-wrap form.fullwidth ol li.text textarea,
+.swagger-section .swagger-ui-wrap form.fullwidth ol li.numeric input {
+ width: 500px !important;
+}
+.swagger-section .swagger-ui-wrap .info_license {
+ padding-bottom: 5px;
+}
+.swagger-section .swagger-ui-wrap .info_tos {
+ padding-bottom: 5px;
+}
+.swagger-section .swagger-ui-wrap .message-fail {
+ color: #cc0000;
+}
+.swagger-section .swagger-ui-wrap .info_url {
+ padding-bottom: 5px;
+}
+.swagger-section .swagger-ui-wrap .info_email {
+ padding-bottom: 5px;
+}
+.swagger-section .swagger-ui-wrap .info_name {
+ padding-bottom: 5px;
+}
+.swagger-section .swagger-ui-wrap .info_description {
+ padding-bottom: 10px;
+ font-size: 15px;
+}
+.swagger-section .swagger-ui-wrap .markdown ol li,
+.swagger-section .swagger-ui-wrap .markdown ul li {
+ padding: 3px 0px;
+ line-height: 1.4em;
+ color: #333333;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input,
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input,
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input {
+ display: block;
+ padding: 4px;
+ width: auto;
+ clear: both;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input.title,
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input.title,
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input.title {
+ font-size: 1.3em;
+}
+.swagger-section .swagger-ui-wrap table.fullwidth {
+ width: 100%;
+}
+.swagger-section .swagger-ui-wrap .model-signature {
+ font-family: "Droid Sans", sans-serif;
+ font-size: 1em;
+ line-height: 1.5em;
+}
+.swagger-section .swagger-ui-wrap .model-signature .signature-nav a {
+ text-decoration: none;
+ color: #AAA;
+}
+.swagger-section .swagger-ui-wrap .model-signature .signature-nav a:hover {
+ text-decoration: underline;
+ color: black;
+}
+.swagger-section .swagger-ui-wrap .model-signature .signature-nav .selected {
+ color: black;
+ text-decoration: none;
+}
+.swagger-section .swagger-ui-wrap .model-signature .propType {
+ color: #5555aa;
+}
+.swagger-section .swagger-ui-wrap .model-signature pre:hover {
+ background-color: #ffffdd;
+}
+.swagger-section .swagger-ui-wrap .model-signature pre {
+ font-size: .85em;
+ line-height: 1.2em;
+ overflow: auto;
+ max-height: 200px;
+ cursor: pointer;
+}
+.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav {
+ display: block;
+ margin: 0;
+ padding: 0;
+}
+.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li:last-child {
+ padding-right: 0;
+ border-right: none;
+}
+.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li {
+ float: left;
+ margin: 0 5px 5px 0;
+ padding: 2px 5px 2px 0;
+ border-right: 1px solid #ddd;
+}
+.swagger-section .swagger-ui-wrap .model-signature .propOpt {
+ color: #555;
+}
+.swagger-section .swagger-ui-wrap .model-signature .snippet small {
+ font-size: 0.75em;
+}
+.swagger-section .swagger-ui-wrap .model-signature .propOptKey {
+ font-style: italic;
+}
+.swagger-section .swagger-ui-wrap .model-signature .description .strong {
+ font-weight: bold;
+ color: #000;
+ font-size: .9em;
+}
+.swagger-section .swagger-ui-wrap .model-signature .description div {
+ font-size: 0.9em;
+ line-height: 1.5em;
+ margin-left: 1em;
+}
+.swagger-section .swagger-ui-wrap .model-signature .description .stronger {
+ font-weight: bold;
+ color: #000;
+}
+.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper {
+ border-spacing: 0;
+ position: absolute;
+ background-color: #ffffff;
+ border: 1px solid #bbbbbb;
+ display: none;
+ font-size: 11px;
+ max-width: 400px;
+ line-height: 30px;
+ color: black;
+ padding: 5px;
+ margin-left: 10px;
+}
+.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper th {
+ text-align: center;
+ background-color: #eeeeee;
+ border: 1px solid #bbbbbb;
+ font-size: 11px;
+ color: #666666;
+ font-weight: bold;
+ padding: 5px;
+ line-height: 15px;
+}
+.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper .optionName {
+ font-weight: bold;
+}
+.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:first-child,
+.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:last-child {
+ display: inline;
+}
+.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:not(:first-child):before {
+ display: block;
+ content: '';
+}
+.swagger-section .swagger-ui-wrap .model-signature .description span:last-of-type.propDesc.markdown > p:only-child {
+ margin-right: -3px;
+}
+.swagger-section .swagger-ui-wrap .model-signature .propName {
+ font-weight: bold;
+}
+.swagger-section .swagger-ui-wrap .model-signature .signature-container {
+ clear: both;
+}
+.swagger-section .swagger-ui-wrap .body-textarea {
+ width: 300px;
+ height: 100px;
+ border: 1px solid #aaa;
+}
+.swagger-section .swagger-ui-wrap .markdown p code,
+.swagger-section .swagger-ui-wrap .markdown li code {
+ font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
+ background-color: #f0f0f0;
+ color: black;
+ padding: 1px 3px;
+}
+.swagger-section .swagger-ui-wrap .required {
+ font-weight: bold;
+}
+.swagger-section .swagger-ui-wrap input.parameter {
+ width: 300px;
+ border: 1px solid #aaa;
+}
+.swagger-section .swagger-ui-wrap h1 {
+ color: black;
+ font-size: 1.5em;
+ line-height: 1.3em;
+ padding: 10px 0 10px 0;
+ font-family: "Droid Sans", sans-serif;
+ font-weight: bold;
+}
+.swagger-section .swagger-ui-wrap .heading_with_menu {
+ float: none;
+ clear: both;
+ overflow: hidden;
+ display: block;
+}
+.swagger-section .swagger-ui-wrap .heading_with_menu ul {
+ display: block;
+ clear: none;
+ float: right;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ -ms-box-sizing: border-box;
+ box-sizing: border-box;
+ margin-top: 10px;
+}
+.swagger-section .swagger-ui-wrap h2 {
+ color: black;
+ font-size: 1.3em;
+ padding: 10px 0 10px 0;
+}
+.swagger-section .swagger-ui-wrap h2 a {
+ color: black;
+}
+.swagger-section .swagger-ui-wrap h2 span.sub {
+ font-size: 0.7em;
+ color: #999999;
+ font-style: italic;
+}
+.swagger-section .swagger-ui-wrap h2 span.sub a {
+ color: #777777;
+}
+.swagger-section .swagger-ui-wrap span.weak {
+ color: #666666;
+}
+.swagger-section .swagger-ui-wrap .message-success {
+ color: #89BF04;
+}
+.swagger-section .swagger-ui-wrap caption,
+.swagger-section .swagger-ui-wrap th,
+.swagger-section .swagger-ui-wrap td {
+ text-align: left;
+ font-weight: normal;
+ vertical-align: middle;
+}
+.swagger-section .swagger-ui-wrap .code {
+ font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.text textarea {
+ font-family: "Droid Sans", sans-serif;
+ height: 250px;
+ padding: 4px;
+ display: block;
+ clear: both;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.select select {
+ display: block;
+ clear: both;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean {
+ float: none;
+ clear: both;
+ overflow: hidden;
+ display: block;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean label {
+ display: block;
+ float: left;
+ clear: none;
+ margin: 0;
+ padding: 0;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean input {
+ display: block;
+ float: left;
+ clear: none;
+ margin: 0 5px 0 0;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.required label {
+ color: black;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label {
+ display: block;
+ clear: both;
+ width: auto;
+ padding: 0 0 3px;
+ color: #666666;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label abbr {
+ padding-left: 3px;
+ color: #888888;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li p.inline-hints {
+ margin-left: 0;
+ font-style: italic;
+ font-size: 0.9em;
+ margin: 0;
+}
+.swagger-section .swagger-ui-wrap form.formtastic fieldset.buttons {
+ margin: 0;
+ padding: 0;
+}
+.swagger-section .swagger-ui-wrap span.blank,
+.swagger-section .swagger-ui-wrap span.empty {
+ color: #888888;
+ font-style: italic;
+}
+.swagger-section .swagger-ui-wrap .markdown h3 {
+ color: #547f00;
+}
+.swagger-section .swagger-ui-wrap .markdown h4 {
+ color: #666666;
+}
+.swagger-section .swagger-ui-wrap .markdown pre {
+ font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
+ background-color: #fcf6db;
+ border: 1px solid #e5e0c6;
+ padding: 10px;
+ margin: 0 0 10px 0;
+}
+.swagger-section .swagger-ui-wrap .markdown pre code {
+ line-height: 1.6em;
+}
+.swagger-section .swagger-ui-wrap div.gist {
+ margin: 20px 0 25px 0 !important;
+}
+.swagger-section .swagger-ui-wrap ul#resources {
+ font-family: "Droid Sans", sans-serif;
+ font-size: 0.9em;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource {
+ border-bottom: 1px solid #dddddd;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading h2 a,
+.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading h2 a {
+ color: black;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading ul.options li a,
+.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading ul.options li a {
+ color: #555555;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource:last-child {
+ border-bottom: none;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading {
+ border: 1px solid transparent;
+ float: none;
+ clear: both;
+ overflow: hidden;
+ display: block;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options {
+ overflow: hidden;
+ padding: 0;
+ display: block;
+ clear: none;
+ float: right;
+ margin: 14px 10px 0 0;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li {
+ float: left;
+ clear: none;
+ margin: 0;
+ padding: 2px 10px;
+ border-right: 1px solid #dddddd;
+ color: #666666;
+ font-size: 0.9em;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a {
+ color: #aaaaaa;
+ text-decoration: none;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover {
+ text-decoration: underline;
+ color: black;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover,
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:active,
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a.active {
+ text-decoration: underline;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:first-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.first {
+ padding-left: 0;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:last-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.last {
+ padding-right: 0;
+ border-right: none;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options:first-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options.first {
+ padding-left: 0;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 {
+ color: #999999;
+ padding-left: 0;
+ display: block;
+ clear: none;
+ float: left;
+ font-family: "Droid Sans", sans-serif;
+ font-weight: bold;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a {
+ color: #999999;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a:hover {
+ color: black;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation {
+ float: none;
+ clear: both;
+ overflow: hidden;
+ display: block;
+ margin: 0 0 10px;
+ padding: 0;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading {
+ float: none;
+ clear: both;
+ overflow: hidden;
+ display: block;
+ margin: 0;
+ padding: 0;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 {
+ display: block;
+ clear: none;
+ float: left;
+ width: auto;
+ margin: 0;
+ padding: 0;
+ line-height: 1.1em;
+ color: black;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path {
+ padding-left: 10px;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a {
+ color: black;
+ text-decoration: none;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a:hover {
+ text-decoration: underline;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.http_method a {
+ text-transform: uppercase;
+ text-decoration: none;
+ color: white;
+ display: inline-block;
+ width: 50px;
+ font-size: 0.7em;
+ text-align: center;
+ padding: 7px 0 4px;
+ -moz-border-radius: 2px;
+ -webkit-border-radius: 2px;
+ -o-border-radius: 2px;
+ -ms-border-radius: 2px;
+ -khtml-border-radius: 2px;
+ border-radius: 2px;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span {
+ margin: 0;
+ padding: 0;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options {
+ overflow: hidden;
+ padding: 0;
+ display: block;
+ clear: none;
+ float: right;
+ margin: 6px 10px 0 0;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li {
+ float: left;
+ clear: none;
+ margin: 0;
+ padding: 2px 10px;
+ font-size: 0.9em;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li a {
+ text-decoration: none;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li.access {
+ color: black;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content {
+ border-top: none;
+ padding: 10px;
+ -moz-border-radius-bottomleft: 6px;
+ -webkit-border-bottom-left-radius: 6px;
+ -o-border-bottom-left-radius: 6px;
+ -ms-border-bottom-left-radius: 6px;
+ -khtml-border-bottom-left-radius: 6px;
+ border-bottom-left-radius: 6px;
+ -moz-border-radius-bottomright: 6px;
+ -webkit-border-bottom-right-radius: 6px;
+ -o-border-bottom-right-radius: 6px;
+ -ms-border-bottom-right-radius: 6px;
+ -khtml-border-bottom-right-radius: 6px;
+ border-bottom-right-radius: 6px;
+ margin: 0 0 20px;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content h4 {
+ font-size: 1.1em;
+ margin: 0;
+ padding: 15px 0 5px;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header {
+ float: none;
+ clear: both;
+ overflow: hidden;
+ display: block;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header a {
+ padding: 4px 0 0 10px;
+ display: inline-block;
+ font-size: 0.9em;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header input.submit {
+ display: block;
+ clear: none;
+ float: left;
+ padding: 6px 8px;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header span.response_throbber {
+ background-image: url('../images/throbber.gif');
+ width: 128px;
+ height: 16px;
+ display: block;
+ clear: none;
+ float: right;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form input[type='text'].error {
+ outline: 2px solid black;
+ outline-color: #cc0000;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form select[name='parameterContentType'] {
+ max-width: 300px;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.response div.block pre {
+ font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
+ padding: 10px;
+ font-size: 0.9em;
+ max-height: 400px;
+ overflow-y: auto;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading {
+ background-color: #f9f2e9;
+ border: 1px solid #f0e0ca;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading h3 span.http_method a {
+ background-color: #c5862b;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li {
+ border-right: 1px solid #dddddd;
+ border-right-color: #f0e0ca;
+ color: #c5862b;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li a {
+ color: #c5862b;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content {
+ background-color: #faf5ee;
+ border: 1px solid #f0e0ca;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content h4 {
+ color: #c5862b;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content div.sandbox_header a {
+ color: #dcb67f;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading {
+ background-color: #fcffcd;
+ border: 1px solid black;
+ border-color: #ffd20f;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading h3 span.http_method a {
+ text-transform: uppercase;
+ background-color: #ffd20f;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li {
+ border-right: 1px solid #dddddd;
+ border-right-color: #ffd20f;
+ color: #ffd20f;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li a {
+ color: #ffd20f;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content {
+ background-color: #fcffcd;
+ border: 1px solid black;
+ border-color: #ffd20f;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content h4 {
+ color: #ffd20f;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content div.sandbox_header a {
+ color: #6fc992;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading {
+ background-color: #f5e8e8;
+ border: 1px solid #e8c6c7;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading h3 span.http_method a {
+ text-transform: uppercase;
+ background-color: #a41e22;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li {
+ border-right: 1px solid #dddddd;
+ border-right-color: #e8c6c7;
+ color: #a41e22;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li a {
+ color: #a41e22;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content {
+ background-color: #f7eded;
+ border: 1px solid #e8c6c7;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content h4 {
+ color: #a41e22;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content div.sandbox_header a {
+ color: #c8787a;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading {
+ background-color: #e7f6ec;
+ border: 1px solid #c3e8d1;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading h3 span.http_method a {
+ background-color: #10a54a;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li {
+ border-right: 1px solid #dddddd;
+ border-right-color: #c3e8d1;
+ color: #10a54a;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li a {
+ color: #10a54a;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content {
+ background-color: #ebf7f0;
+ border: 1px solid #c3e8d1;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content h4 {
+ color: #10a54a;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content div.sandbox_header a {
+ color: #6fc992;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading {
+ background-color: #FCE9E3;
+ border: 1px solid #F5D5C3;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading h3 span.http_method a {
+ background-color: #D38042;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li {
+ border-right: 1px solid #dddddd;
+ border-right-color: #f0cecb;
+ color: #D38042;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li a {
+ color: #D38042;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content {
+ background-color: #faf0ef;
+ border: 1px solid #f0cecb;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content h4 {
+ color: #D38042;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content div.sandbox_header a {
+ color: #dcb67f;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading {
+ background-color: #e7f0f7;
+ border: 1px solid #c3d9ec;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading h3 span.http_method a {
+ background-color: #0f6ab4;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li {
+ border-right: 1px solid #dddddd;
+ border-right-color: #c3d9ec;
+ color: #0f6ab4;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li a {
+ color: #0f6ab4;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content {
+ background-color: #ebf3f9;
+ border: 1px solid #c3d9ec;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content h4 {
+ color: #0f6ab4;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content div.sandbox_header a {
+ color: #6fa5d2;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading {
+ background-color: #e7f0f7;
+ border: 1px solid #c3d9ec;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading h3 span.http_method a {
+ background-color: #0f6ab4;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li {
+ border-right: 1px solid #dddddd;
+ border-right-color: #c3d9ec;
+ color: #0f6ab4;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li a {
+ color: #0f6ab4;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content {
+ background-color: #ebf3f9;
+ border: 1px solid #c3d9ec;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content h4 {
+ color: #0f6ab4;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content div.sandbox_header a {
+ color: #6fa5d2;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content {
+ border-top: none;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li:last-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li:last-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li:last-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li:last-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li:last-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li:last-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li.last,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li.last,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li.last,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li.last,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li.last,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li.last {
+ padding-right: 0;
+ border-right: none;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:hover,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:active,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a.active {
+ text-decoration: underline;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li:first-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li.first {
+ padding-left: 0;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations:first-child,
+.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations.first {
+ padding-left: 0;
+}
+.swagger-section .swagger-ui-wrap p#colophon {
+ margin: 0 15px 40px 15px;
+ padding: 10px 0;
+ font-size: 0.8em;
+ border-top: 1px solid #dddddd;
+ font-family: "Droid Sans", sans-serif;
+ color: #999999;
+ font-style: italic;
+}
+.swagger-section .swagger-ui-wrap p#colophon a {
+ text-decoration: none;
+ color: #547f00;
+}
+.swagger-section .swagger-ui-wrap h3 {
+ color: black;
+ font-size: 1.1em;
+ padding: 10px 0 10px 0;
+}
+.swagger-section .swagger-ui-wrap .markdown ol,
+.swagger-section .swagger-ui-wrap .markdown ul {
+ font-family: "Droid Sans", sans-serif;
+ margin: 5px 0 10px;
+ padding: 0 0 0 18px;
+ list-style-type: disc;
+}
+.swagger-section .swagger-ui-wrap form.form_box {
+ background-color: #ebf3f9;
+ border: 1px solid #c3d9ec;
+ padding: 10px;
+}
+.swagger-section .swagger-ui-wrap form.form_box label {
+ color: #0f6ab4 !important;
+}
+.swagger-section .swagger-ui-wrap form.form_box input[type=submit] {
+ display: block;
+ padding: 10px;
+}
+.swagger-section .swagger-ui-wrap form.form_box p.weak {
+ font-size: 0.8em;
+}
+.swagger-section .swagger-ui-wrap form.form_box p {
+ font-size: 0.9em;
+ padding: 0 0 15px;
+ color: #7e7b6d;
+}
+.swagger-section .swagger-ui-wrap form.form_box p a {
+ color: #646257;
+}
+.swagger-section .swagger-ui-wrap form.form_box p strong {
+ color: black;
+}
+.swagger-section .swagger-ui-wrap .operation-status td.markdown > p:last-child {
+ padding-bottom: 0;
+}
+.swagger-section .title {
+ font-style: bold;
+}
+.swagger-section .secondary_form {
+ display: none;
+}
+.swagger-section .main_image {
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+}
+.swagger-section .oauth_body {
+ margin-left: 100px;
+ margin-right: 100px;
+}
+.swagger-section .oauth_submit {
+ text-align: center;
+}
+.swagger-section .api-popup-dialog {
+ z-index: 10000;
+ position: absolute;
+ width: 500px;
+ background: #FFF;
+ padding: 20px;
+ border: 1px solid #ccc;
+ border-radius: 5px;
+ display: none;
+ font-size: 13px;
+ color: #777;
+}
+.swagger-section .api-popup-dialog .api-popup-title {
+ font-size: 24px;
+ padding: 10px 0;
+}
+.swagger-section .api-popup-dialog .api-popup-title {
+ font-size: 24px;
+ padding: 10px 0;
+}
+.swagger-section .api-popup-dialog p.error-msg {
+ padding-left: 5px;
+ padding-bottom: 5px;
+}
+.swagger-section .api-popup-dialog button.api-popup-authbtn {
+ height: 30px;
+}
+.swagger-section .api-popup-dialog button.api-popup-cancel {
+ height: 30px;
+}
+.swagger-section .api-popup-scopes {
+ padding: 10px 20px;
+}
+.swagger-section .api-popup-scopes li {
+ padding: 5px 0;
+ line-height: 20px;
+}
+.swagger-section .api-popup-scopes .api-scope-desc {
+ padding-left: 20px;
+ font-style: italic;
+}
+.swagger-section .api-popup-scopes li input {
+ position: relative;
+ top: 2px;
+}
+.swagger-section .api-popup-actions {
+ padding-top: 10px;
+}
+.swagger-section .access {
+ float: right;
+}
+.swagger-section .auth {
+ float: right;
+}
+.swagger-section .api-ic {
+ height: 18px;
+ vertical-align: middle;
+ display: inline-block;
+ background: url(../images/explorer_icons.png) no-repeat;
+}
+.swagger-section .api-ic .api_information_panel {
+ position: relative;
+ margin-top: 20px;
+ margin-left: -5px;
+ background: #FFF;
+ border: 1px solid #ccc;
+ border-radius: 5px;
+ display: none;
+ font-size: 13px;
+ max-width: 300px;
+ line-height: 30px;
+ color: black;
+ padding: 5px;
+}
+.swagger-section .api-ic .api_information_panel p .api-msg-enabled {
+ color: green;
+}
+.swagger-section .api-ic .api_information_panel p .api-msg-disabled {
+ color: red;
+}
+.swagger-section .api-ic:hover .api_information_panel {
+ position: absolute;
+ display: block;
+}
+.swagger-section .ic-info {
+ background-position: 0 0;
+ width: 18px;
+ margin-top: -6px;
+ margin-left: 4px;
+}
+.swagger-section .ic-warning {
+ background-position: -60px 0;
+ width: 18px;
+ margin-top: -6px;
+ margin-left: 4px;
+}
+.swagger-section .ic-error {
+ background-position: -30px 0;
+ width: 18px;
+ margin-top: -6px;
+ margin-left: 4px;
+}
+.swagger-section .ic-off {
+ background-position: -90px 0;
+ width: 58px;
+ margin-top: -4px;
+ cursor: pointer;
+}
+.swagger-section .ic-on {
+ background-position: -160px 0;
+ width: 58px;
+ margin-top: -4px;
+ cursor: pointer;
+}
+.swagger-section #header {
+ background-color: #89bf04;
+ padding: 14px;
+}
+.swagger-section #header a#logo {
+ font-size: 1.5em;
+ font-weight: bold;
+ text-decoration: none;
+ background: transparent url(../images/logo_small.png) no-repeat left center;
+ padding: 20px 0 20px 40px;
+ color: white;
+}
+.swagger-section #header form#api_selector {
+ display: block;
+ clear: none;
+ float: right;
+}
+.swagger-section #header form#api_selector .input {
+ display: block;
+ clear: none;
+ float: left;
+ margin: 0 10px 0 0;
+}
+.swagger-section #header form#api_selector .input input#input_apiKey {
+ width: 200px;
+}
+.swagger-section #header form#api_selector .input input#input_baseUrl {
+ width: 400px;
+}
+.swagger-section #header form#api_selector .input a#explore {
+ display: block;
+ text-decoration: none;
+ font-weight: bold;
+ padding: 6px 8px;
+ font-size: 0.9em;
+ color: white;
+ background-color: #547f00;
+ -moz-border-radius: 4px;
+ -webkit-border-radius: 4px;
+ -o-border-radius: 4px;
+ -ms-border-radius: 4px;
+ -khtml-border-radius: 4px;
+ border-radius: 4px;
+}
+.swagger-section #header form#api_selector .input a#explore:hover {
+ background-color: #547f00;
+}
+.swagger-section #header form#api_selector .input input {
+ font-size: 0.9em;
+ padding: 3px;
+ margin: 0;
+}
+.swagger-section #content_message {
+ margin: 10px 15px;
+ font-style: italic;
+ color: #999999;
+}
+.swagger-section #message-bar {
+ min-height: 30px;
+ text-align: center;
+ padding-top: 10px;
+}
diff --git a/openecomp-be/tools/swagger-ui/css/style.css b/openecomp-be/tools/swagger-ui/css/style.css
new file mode 100644
index 0000000000..fc21a31db5
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/css/style.css
@@ -0,0 +1,250 @@
+.swagger-section #header a#logo {
+ font-size: 1.5em;
+ font-weight: bold;
+ text-decoration: none;
+ background: transparent url(../images/logo.png) no-repeat left center;
+ padding: 20px 0 20px 40px;
+}
+#text-head {
+ font-size: 80px;
+ font-family: 'Roboto', sans-serif;
+ color: #ffffff;
+ float: right;
+ margin-right: 20%;
+}
+.navbar-fixed-top .navbar-nav {
+ height: auto;
+}
+.navbar-fixed-top .navbar-brand {
+ height: auto;
+}
+.navbar-header {
+ height: auto;
+}
+.navbar-inverse {
+ background-color: #000;
+ border-color: #000;
+}
+#navbar-brand {
+ margin-left: 20%;
+}
+.navtext {
+ font-size: 10px;
+}
+.h1,
+h1 {
+ font-size: 60px;
+}
+.navbar-default .navbar-header .navbar-brand {
+ color: #a2dfee;
+}
+/* tag titles */
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a {
+ color: #393939;
+ font-family: 'Arvo', serif;
+ font-size: 1.5em;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a:hover {
+ color: black;
+}
+.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 {
+ color: #525252;
+ padding-left: 0px;
+ display: block;
+ clear: none;
+ float: left;
+ font-family: 'Arvo', serif;
+ font-weight: bold;
+}
+.navbar-default .navbar-collapse,
+.navbar-default .navbar-form {
+ border-color: #0A0A0A;
+}
+.container1 {
+ width: 1500px;
+ margin: auto;
+ margin-top: 0;
+ background-image: url('../images/shield.png');
+ background-repeat: no-repeat;
+ background-position: -40px -20px;
+ margin-bottom: 210px;
+}
+.container-inner {
+ width: 1200px;
+ margin: auto;
+ background-color: rgba(223, 227, 228, 0.75);
+ padding-bottom: 40px;
+ padding-top: 40px;
+ border-radius: 15px;
+}
+.header-content {
+ padding: 0;
+ width: 1000px;
+}
+.title1 {
+ font-size: 80px;
+ font-family: 'Vollkorn', serif;
+ color: #404040;
+ text-align: center;
+ padding-top: 40px;
+ padding-bottom: 100px;
+}
+#icon {
+ margin-top: -18px;
+}
+.subtext {
+ font-size: 25px;
+ font-style: italic;
+ color: #08b;
+ text-align: right;
+ padding-right: 250px;
+}
+.bg-primary {
+ background-color: #00468b;
+}
+.navbar-default .nav > li > a,
+.navbar-default .nav > li > a:focus {
+ color: #08b;
+}
+.navbar-default .nav > li > a,
+.navbar-default .nav > li > a:hover {
+ color: #08b;
+}
+.navbar-default .nav > li > a,
+.navbar-default .nav > li > a:focus:hover {
+ color: #08b;
+}
+.text-faded {
+ font-size: 25px;
+ font-family: 'Vollkorn', serif;
+}
+.section-heading {
+ font-family: 'Vollkorn', serif;
+ font-size: 45px;
+ padding-bottom: 10px;
+}
+hr {
+ border-color: #00468b;
+ padding-bottom: 10px;
+}
+.description {
+ margin-top: 20px;
+ padding-bottom: 200px;
+}
+.description li {
+ font-family: 'Vollkorn', serif;
+ font-size: 25px;
+ color: #525252;
+ margin-left: 28%;
+ padding-top: 5px;
+}
+.gap {
+ margin-top: 200px;
+}
+.troubleshootingtext {
+ color: rgba(255, 255, 255, 0.7);
+ padding-left: 30%;
+}
+.troubleshootingtext li {
+ list-style-type: circle;
+ font-size: 25px;
+ padding-bottom: 5px;
+}
+.overlay {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ z-index: 1000;
+}
+.block.response_body.json:hover {
+ cursor: pointer;
+}
+.backdrop {
+ color: blue;
+}
+#myModal {
+ height: 100%;
+}
+.modal-backdrop {
+ bottom: 0;
+ position: fixed;
+}
+.curl {
+ padding: 10px;
+ font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
+ font-size: 0.9em;
+ max-height: 400px;
+ margin-top: 5px;
+ overflow-y: auto;
+ background-color: #fcf6db;
+ border: 1px solid #e5e0c6;
+ border-radius: 4px;
+}
+.curl_title {
+ font-size: 1.1em;
+ margin: 0;
+ padding: 15px 0 5px;
+ font-family: 'Open Sans', 'Helvetica Neue', Arial, sans-serif;
+ font-weight: 500;
+ line-height: 1.1;
+}
+.footer {
+ display: none;
+}
+.swagger-section .swagger-ui-wrap h2 {
+ padding: 0;
+}
+h2 {
+ margin: 0;
+ margin-bottom: 5px;
+}
+.markdown p {
+ font-size: 15px;
+ font-family: 'Arvo', serif;
+}
+.swagger-section .swagger-ui-wrap .code {
+ font-size: 15px;
+ font-family: 'Arvo', serif;
+}
+.swagger-section .swagger-ui-wrap b {
+ font-family: 'Arvo', serif;
+}
+#signin:hover {
+ cursor: pointer;
+}
+.dropdown-menu {
+ padding: 15px;
+}
+.navbar-right .dropdown-menu {
+ left: 0;
+ right: auto;
+}
+#signinbutton {
+ width: 100%;
+ height: 32px;
+ font-size: 13px;
+ font-weight: bold;
+ color: #08b;
+}
+.navbar-default .nav > li .details {
+ color: #000000;
+ text-transform: none;
+ font-size: 15px;
+ font-weight: normal;
+ font-family: 'Open Sans', sans-serif;
+ font-style: italic;
+ line-height: 20px;
+ top: -2px;
+}
+.navbar-default .nav > li .details:hover {
+ color: black;
+}
+#signout {
+ width: 100%;
+ height: 32px;
+ font-size: 13px;
+ font-weight: bold;
+ color: #08b;
+}
diff --git a/openecomp-be/tools/swagger-ui/css/typography.css b/openecomp-be/tools/swagger-ui/css/typography.css
new file mode 100644
index 0000000000..27c3751ac2
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/css/typography.css
@@ -0,0 +1,26 @@
+/* droid-sans-regular - latin */
+@font-face {
+ font-family: 'Droid Sans';
+ font-style: normal;
+ font-weight: 400;
+ src: url('../fonts/droid-sans-v6-latin-regular.eot'); /* IE9 Compat Modes */
+ src: local('Droid Sans'), local('DroidSans'),
+ url('../fonts/droid-sans-v6-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
+ url('../fonts/droid-sans-v6-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */
+ url('../fonts/droid-sans-v6-latin-regular.woff') format('woff'), /* Modern Browsers */
+ url('../fonts/droid-sans-v6-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */
+ url('../fonts/droid-sans-v6-latin-regular.svg#DroidSans') format('svg'); /* Legacy iOS */
+}
+/* droid-sans-700 - latin */
+@font-face {
+ font-family: 'Droid Sans';
+ font-style: normal;
+ font-weight: 700;
+ src: url('../fonts/droid-sans-v6-latin-700.eot'); /* IE9 Compat Modes */
+ src: local('Droid Sans Bold'), local('DroidSans-Bold'),
+ url('../fonts/droid-sans-v6-latin-700.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
+ url('../fonts/droid-sans-v6-latin-700.woff2') format('woff2'), /* Super Modern Browsers */
+ url('../fonts/droid-sans-v6-latin-700.woff') format('woff'), /* Modern Browsers */
+ url('../fonts/droid-sans-v6-latin-700.ttf') format('truetype'), /* Safari, Android, iOS */
+ url('../fonts/droid-sans-v6-latin-700.svg#DroidSans') format('svg'); /* Legacy iOS */
+}
diff --git a/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-700.eot b/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-700.eot
new file mode 100644
index 0000000000..d8524983ad
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-700.eot
Binary files differ
diff --git a/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-700.svg b/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-700.svg
new file mode 100644
index 0000000000..a54bbbbf25
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-700.svg
@@ -0,0 +1,411 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg">
+<defs >
+<font id="DroidSans" horiz-adv-x="1123" ><font-face
+ font-family="Droid Sans"
+ units-per-em="2048"
+ panose-1="2 11 8 6 3 8 4 2 2 4"
+ ascent="1907"
+ descent="-492"
+ alphabetic="0" />
+<glyph unicode=" " glyph-name="space" horiz-adv-x="532" />
+<glyph unicode="!" glyph-name="exclam" horiz-adv-x="586" d="M416 485H172L121 1462H467L416 485ZM117 143Q117 190 130 222T168 275T224 304T293 313Q328 313 359 304T415 275T453 223T467 143Q467 98 453 66T415 13T360 -17T293 -27Q256 -27 224 -18T168 13T131
+66T117 143Z" />
+<glyph unicode="&quot;" glyph-name="quotedbl" horiz-adv-x="967" d="M412 1462L371 934H174L133 1462H412ZM834 1462L793 934H596L555 1462H834Z" />
+<glyph unicode="#" glyph-name="numbersign" horiz-adv-x="1323" d="M999 844L952 612H1210V406H913L836 0H616L694 406H500L424 0H209L283 406H45V612H322L369 844H117V1053H406L483 1460H702L625 1053H823L901 1460H1116L1038 1053H1278V844H999ZM539 612H735L782
+844H586L539 612Z" />
+<glyph unicode="$" glyph-name="dollar" horiz-adv-x="1128" d="M1061 457Q1061 382 1035 318T956 206T825 127T645 86V-119H508V82Q442 84 386 90T281 107T188 133T100 168V432Q142 411 191 392T294 358T401 331T508 317V635Q500 638 491 642Q483 645 475 648T461
+653Q370 688 302 726T189 811T121 915T98 1044Q98 1119 126 1180T208 1287T337 1361T508 1399V1556H645V1405Q732 1400 823 1380T1014 1317L913 1083Q848 1109 778 1129T645 1155V862L684 848Q779 813 850 776T968 693T1038 590T1061 457ZM760 451Q760 475 754
+493T733 526T698 553T645 580V328Q704 337 732 367T760 451ZM399 1051Q399 1004 425 973T508 920V1153Q454 1147 427 1123T399 1051Z" />
+<glyph unicode="%" glyph-name="percent" horiz-adv-x="1804" d="M315 1024Q315 897 337 835T410 772Q459 772 482 834T506 1024Q506 1274 410 1274Q360 1274 338 1213T315 1024ZM758 1026Q758 918 738 832T674 687T565 597T408 565Q323 565 259 596T151 687T85
+832T63 1026Q63 1134 83 1219T145 1362T253 1452T408 1483Q494 1483 559 1452T669 1363T735 1219T758 1026ZM1425 1462L614 0H375L1186 1462H1425ZM1298 440Q1298 313 1320 251T1393 188Q1442 188 1465 250T1489 440Q1489 690 1393 690Q1343 690 1321 629T1298
+440ZM1741 442Q1741 334 1721 249T1657 104T1548 14T1391 -18Q1306 -18 1242 13T1135 104T1069 248T1047 442Q1047 550 1067 635T1129 778T1236 868T1391 899Q1477 899 1542 868T1652 779T1718 635T1741 442Z" />
+<glyph unicode="&amp;" glyph-name="ampersand" horiz-adv-x="1479" d="M1475 0H1098L1001 100Q921 45 825 13T612 -20Q492 -20 395 10T228 94T120 225T82 395Q82 472 100 532T153 642T235 731T344 807Q306 853 280 895T237 979T214 1062T207 1149Q207 1227 237
+1288T322 1393T452 1460T618 1483Q704 1483 776 1462T901 1401T984 1301T1014 1165Q1014 1096 992 1039T931 932T842 842T731 766L991 498Q1026 564 1052 637T1098 784H1415Q1400 727 1380 664T1332 538T1270 411T1192 291L1475 0ZM403 424Q403 380 419 345T463
+286T530 249T614 236Q674 236 725 251T819 295L510 625Q459 583 431 535T403 424ZM731 1124Q731 1155 721 1176T695 1212T658 1232T616 1239Q594 1239 572 1233T531 1214T501 1178T489 1122Q489 1070 512 1024T575 932Q652 976 691 1020T731 1124Z" />
+<glyph unicode="&apos;" glyph-name="quotesingle" horiz-adv-x="545" d="M412 1462L371 934H174L133 1462H412Z" />
+<glyph unicode="(" glyph-name="parenleft" horiz-adv-x="694" d="M82 561Q82 686 100 807T155 1043T248 1263T383 1462H633Q492 1269 420 1038T348 563Q348 444 366 326T420 95T509 -124T631 -324H383Q305 -234 249 -131T155 84T100 317T82 561Z" />
+<glyph unicode=")" glyph-name="parenright" horiz-adv-x="694" d="M612 561Q612 437 594 317T539 85T446 -131T311 -324H63Q132 -230 185 -124T274 95T328 326T346 563Q346 807 274 1038T61 1462H311Q389 1369 445 1264T539 1044T594 808T612 561Z" />
+<glyph unicode="*" glyph-name="asterisk" horiz-adv-x="1116" d="M688 1556L647 1188L1020 1292L1053 1040L713 1016L936 719L709 598L553 911L416 600L180 719L401 1016L63 1042L102 1292L467 1188L426 1556H688Z" />
+<glyph unicode="+" glyph-name="plus" horiz-adv-x="1128" d="M455 612H88V831H455V1200H674V831H1040V612H674V248H455V612Z" />
+<glyph unicode="," glyph-name="comma" horiz-adv-x="594" d="M459 215Q445 161 426 100T383 -23T334 -146T283 -264H63Q78 -203 92 -137T120 -6T145 122T164 238H444L459 215Z" />
+<glyph unicode="-" glyph-name="hyphen" horiz-adv-x="659" d="M61 424V674H598V424H61Z" />
+<glyph unicode="." glyph-name="period" horiz-adv-x="584" d="M117 143Q117 190 130 222T168 275T224 304T293 313Q328 313 359 304T415 275T453 223T467 143Q467 98 453 66T415 13T360 -17T293 -27Q256 -27 224 -18T168 13T131 66T117 143Z" />
+<glyph unicode="/" glyph-name="slash" horiz-adv-x="846" d="M836 1462L291 0H14L559 1462H836Z" />
+<glyph unicode="0" glyph-name="zero" horiz-adv-x="1128" d="M1065 731Q1065 554 1038 415T950 179T794 31T563 -20Q436 -20 342 31T186 179T94 415T63 731Q63 908 90 1048T178 1285T333 1433T563 1485Q689 1485 783 1434T940 1286T1034 1049T1065 731ZM371 731Q371
+481 414 355T563 229Q667 229 712 354T758 731Q758 982 713 1108T563 1235Q510 1235 474 1203T414 1108T381 951T371 731Z" />
+<glyph unicode="1" glyph-name="one" horiz-adv-x="1128" d="M817 0H508V846Q508 872 508 908T510 984T513 1064T516 1137Q511 1131 499 1119T472 1093T441 1063T410 1036L242 901L92 1087L563 1462H817V0Z" />
+<glyph unicode="2" glyph-name="two" horiz-adv-x="1128" d="M1063 0H82V215L426 586Q491 656 544 715T635 830T694 944T715 1069Q715 1143 671 1184T551 1225Q472 1225 399 1186T246 1075L78 1274Q123 1315 172 1352T280 1419T410 1465T569 1483Q674 1483 757
+1454T900 1372T990 1242T1022 1071Q1022 985 992 907T910 753T790 603T643 451L467 274V260H1063V0Z" />
+<glyph unicode="3" glyph-name="three" horiz-adv-x="1128" d="M1006 1135Q1006 1059 982 999T915 893T815 817T690 770V764Q867 742 958 657T1049 426Q1049 330 1015 249T909 107T729 14T473 -20Q355 -20 251 -1T57 59V322Q102 298 152 280T252 250T350 231T442
+225Q528 225 585 241T676 286T724 355T739 444Q739 489 721 525T661 587T552 627T387 641H283V858H385Q477 858 538 874T635 919T687 986T702 1067Q702 1145 654 1189T500 1233Q452 1233 411 1224T334 1200T269 1168T215 1133L59 1339Q101 1370 150 1396T258 1441T383
+1472T526 1483Q634 1483 722 1460T874 1392T971 1283T1006 1135Z" />
+<glyph unicode="4" glyph-name="four" horiz-adv-x="1128" d="M1085 303H909V0H608V303H4V518L625 1462H909V543H1085V303ZM608 543V791Q608 804 608 828T610 884T612 948T615 1011T618 1063T621 1096H612Q594 1054 572 1007T520 913L276 543H608Z" />
+<glyph unicode="5" glyph-name="five" horiz-adv-x="1128" d="M598 934Q692 934 773 905T914 820T1008 681T1042 489Q1042 370 1005 276T896 116T718 15T473 -20Q418 -20 364 -15T261 -1T167 24T86 59V326Q121 306 167 289T262 259T362 239T457 231Q591 231 661
+286T731 463Q731 571 663 627T451 684Q425 684 396 681T338 673T283 663T238 651L115 717L170 1462H942V1200H438L414 913Q446 920 488 927T598 934Z" />
+<glyph unicode="6" glyph-name="six" horiz-adv-x="1128" d="M76 621Q76 726 87 830T128 1029T208 1207T336 1349T522 1444T776 1479Q797 1479 822 1478T872 1476T922 1471T965 1464V1217Q927 1226 885 1231T799 1237Q664 1237 577 1204T439 1110T367 966T340
+780H352Q372 816 400 847T467 901T552 937T659 950Q754 950 830 919T958 829T1039 684T1067 487Q1067 368 1034 274T938 115T788 15T590 -20Q482 -20 388 18T225 136T116 335T76 621ZM584 227Q625 227 658 242T716 289T754 369T768 483Q768 590 724 651T588 713Q542
+713 504 695T439 648T398 583T383 510Q383 459 395 409T433 318T496 252T584 227Z" />
+<glyph unicode="7" glyph-name="seven" horiz-adv-x="1128" d="M207 0L727 1200H55V1460H1063V1266L530 0H207Z" />
+<glyph unicode="8" glyph-name="eight" horiz-adv-x="1128" d="M565 1481Q656 1481 737 1459T879 1393T976 1283T1012 1128Q1012 1062 992 1009T937 912T854 834T750 772Q808 741 863 703T962 618T1031 511T1057 379Q1057 288 1021 214T920 88T765 8T565 -20Q447
+-20 355 7T200 84T105 207T72 371Q72 446 94 506T154 614T243 699T352 764Q303 795 260 831T186 912T136 1011T117 1130Q117 1217 153 1282T252 1392T395 1459T565 1481ZM358 389Q358 349 371 316T409 258T473 221T561 207Q666 207 718 256T770 387Q770 429 753
+462T708 524T645 577T575 623L553 637Q509 615 473 590T412 534T372 467T358 389ZM563 1255Q530 1255 502 1245T453 1216T420 1169T408 1106Q408 1064 420 1034T454 980T504 938T565 901Q596 917 624 936T673 979T708 1035T721 1106Q721 1141 709 1169T676 1216T626
+1245T563 1255Z" />
+<glyph unicode="9" glyph-name="nine" horiz-adv-x="1128" d="M1055 838Q1055 733 1044 629T1003 429T923 252T795 109T609 15T354 -20Q333 -20 308 -19T258 -17T208 -13T166 -6V242Q203 232 245 227T332 221Q467 221 554 254T692 348T764 493T791 678H778Q758
+642 730 611T664 557T578 521T471 508Q376 508 300 539T172 629T91 774T63 971Q63 1090 96 1184T192 1343T342 1444T541 1479Q649 1479 743 1441T906 1323T1015 1123T1055 838ZM547 1231Q506 1231 472 1216T414 1170T376 1090T362 975Q362 869 407 807T543 745Q589
+745 627 763T692 810T733 875T748 948Q748 999 736 1049T698 1140T635 1206T547 1231Z" />
+<glyph unicode=":" glyph-name="colon" horiz-adv-x="584" d="M117 143Q117 190 130 222T168 275T224 304T293 313Q328 313 359 304T415 275T453 223T467 143Q467 98 453 66T415 13T360 -17T293 -27Q256 -27 224 -18T168 13T131 66T117 143ZM117 969Q117 1016
+130 1048T168 1101T224 1130T293 1139Q328 1139 359 1130T415 1101T453 1049T467 969Q467 924 453 892T415 839T360 809T293 799Q256 799 224 808T168 838T131 891T117 969Z" />
+<glyph unicode=";" glyph-name="semicolon" horiz-adv-x="594" d="M444 238L459 215Q445 161 426 100T383 -23T334 -146T283 -264H63Q78 -203 92 -137T120 -6T145 122T164 238H444ZM117 969Q117 1016 130 1048T168 1101T224 1130T293 1139Q328 1139 359 1130T415
+1101T453 1049T467 969Q467 924 453 892T415 839T360 809T293 799Q256 799 224 808T168 838T131 891T117 969Z" />
+<glyph unicode="&lt;" glyph-name="less" horiz-adv-x="1128" d="M1040 203L88 641V784L1040 1280V1040L397 723L1040 442V203Z" />
+<glyph unicode="=" glyph-name="equal" horiz-adv-x="1128" d="M88 807V1024H1040V807H88ZM88 418V637H1040V418H88Z" />
+<glyph unicode="&gt;" glyph-name="greater" horiz-adv-x="1128" d="M88 442L731 723L88 1040V1280L1040 784V641L88 203V442Z" />
+<glyph unicode="?" glyph-name="question" horiz-adv-x="940" d="M264 485V559Q264 610 274 651T306 730T362 803T444 877Q486 910 515 936T562 987T588 1041T596 1106Q596 1163 558 1200T440 1237Q371 1237 292 1208T127 1137L25 1358Q68 1383 118 1405T223 1445T334
+1473T444 1483Q546 1483 628 1459T767 1387T854 1273T885 1120Q885 1057 871 1008T830 916T761 834T664 750Q622 717 596 693T554 646T534 601T528 545V485H264ZM231 143Q231 190 244 222T282 275T338 304T408 313Q443 313 474 304T530 275T568 223T582 143Q582
+98 568 66T530 13T475 -17T408 -27Q371 -27 339 -18T282 13T245 66T231 143Z" />
+<glyph unicode="@" glyph-name="at" horiz-adv-x="1774" d="M1673 752Q1673 657 1651 564T1582 398T1467 279T1303 233Q1265 233 1232 242T1170 269T1122 310T1090 362H1075Q1056 337 1031 314T975 272T907 244T825 233Q742 233 678 261T569 342T502 468T479 631Q479
+734 510 820T599 968T740 1065T926 1100Q971 1100 1019 1095T1111 1082T1195 1064T1262 1044L1241 625Q1239 603 1239 582T1239 555Q1239 513 1245 486T1262 444T1286 422T1315 416Q1350 416 1376 443T1419 516T1445 623T1454 754Q1454 882 1416 982T1311 1151T1150
+1256T948 1292Q795 1292 679 1241T484 1099T365 882T324 608Q324 470 359 364T463 185T633 75T866 37Q922 37 981 44T1098 63T1213 92T1321 129V-63Q1227 -105 1113 -129T868 -154Q687 -154 545 -103T304 46T154 283T102 602Q102 726 129 839T207 1050T331 1227T499
+1363T706 1450T948 1481Q1106 1481 1239 1431T1468 1286T1619 1056T1673 752ZM711 627Q711 515 749 466T850 416Q892 416 922 435T972 490T1002 575T1016 686L1028 907Q1008 912 981 915T926 918Q867 918 826 893T760 827T723 734T711 627Z" />
+<glyph unicode="A" glyph-name="A" horiz-adv-x="1331" d="M1018 0L918 348H414L313 0H0L475 1468H854L1331 0H1018ZM846 608L752 928Q746 946 734 987T709 1077T683 1177T666 1262Q662 1240 656 1210T641 1147T623 1079T606 1015T592 962T582 928L489 608H846Z" />
+<glyph unicode="B" glyph-name="B" horiz-adv-x="1315" d="M184 1462H612Q750 1462 854 1443T1028 1380T1133 1266T1169 1092Q1169 1030 1154 976T1110 881T1040 813T944 776V766Q999 754 1046 732T1129 670T1185 570T1206 424Q1206 324 1171 246T1071 113T912
+29T700 0H184V1462ZM494 883H655Q713 883 752 893T815 925T849 977T860 1051Q860 1135 808 1171T641 1208H494V883ZM494 637V256H676Q737 256 778 270T845 310T882 373T893 455Q893 496 882 529T845 587T775 624T668 637H494Z" />
+<glyph unicode="C" glyph-name="C" horiz-adv-x="1305" d="M805 1225Q716 1225 648 1191T533 1092T462 935T438 727Q438 610 459 519T525 366T639 271T805 238Q894 238 983 258T1178 315V55Q1130 35 1083 21T987 -2T887 -15T776 -20Q607 -20 483 34T278 186T158
+422T119 729Q119 895 164 1033T296 1272T511 1427T805 1483Q914 1483 1023 1456T1233 1380L1133 1128Q1051 1167 968 1196T805 1225Z" />
+<glyph unicode="D" glyph-name="D" horiz-adv-x="1434" d="M1315 745Q1315 560 1265 421T1119 188T885 47T569 0H184V1462H612Q773 1462 902 1416T1124 1280T1265 1055T1315 745ZM1001 737Q1001 859 977 947T906 1094T792 1180T637 1208H494V256H608Q804 256 902
+376T1001 737Z" />
+<glyph unicode="E" glyph-name="E" horiz-adv-x="1147" d="M1026 0H184V1462H1026V1208H494V887H989V633H494V256H1026V0Z" />
+<glyph unicode="F" glyph-name="F" horiz-adv-x="1124" d="M489 0H184V1462H1022V1208H489V831H985V578H489V0Z" />
+<glyph unicode="G" glyph-name="G" horiz-adv-x="1483" d="M739 821H1319V63Q1261 44 1202 29T1080 3T947 -14T799 -20Q635 -20 509 28T296 172T164 408T119 733Q119 905 169 1044T316 1280T556 1430T883 1483Q1000 1483 1112 1458T1317 1393L1214 1145Q1146 1179
+1061 1202T881 1225Q779 1225 698 1190T558 1089T469 932T438 727Q438 619 459 530T527 375T645 274T819 238Q885 238 930 244T1016 258V563H739V821Z" />
+<glyph unicode="H" glyph-name="H" horiz-adv-x="1485" d="M1300 0H991V631H494V0H184V1462H494V889H991V1462H1300V0Z" />
+<glyph unicode="I" glyph-name="I" horiz-adv-x="797" d="M731 0H66V176L244 258V1204L66 1286V1462H731V1286L553 1204V258L731 176V0Z" />
+<glyph unicode="J" glyph-name="J" horiz-adv-x="678" d="M-2 -430Q-67 -430 -116 -424T-199 -408V-150Q-162 -158 -122 -164T-33 -170Q13 -170 52 -160T121 -126T167 -60T184 43V1462H494V53Q494 -73 458 -164T356 -314T199 -402T-2 -430Z" />
+<glyph unicode="K" glyph-name="K" horiz-adv-x="1298" d="M1298 0H946L610 608L494 522V0H184V1462H494V758L616 965L950 1462H1294L827 803L1298 0Z" />
+<glyph unicode="L" glyph-name="L" horiz-adv-x="1096" d="M184 0V1462H494V256H1026V0H184Z" />
+<glyph unicode="M" glyph-name="M" horiz-adv-x="1870" d="M772 0L451 1147H442Q448 1055 452 969Q454 932 455 893T458 816T460 743T461 680V0H184V1462H606L922 344H928L1264 1462H1686V0H1397V692Q1397 718 1397 751T1399 821T1401 896T1404 970Q1408 1054
+1411 1145H1403L1057 0H772Z" />
+<glyph unicode="N" glyph-name="N" horiz-adv-x="1604" d="M1419 0H1026L451 1106H442Q448 1029 452 953Q456 888 458 817T461 688V0H184V1462H575L1149 367H1155Q1152 443 1148 517Q1147 549 1146 582T1143 649T1142 714T1141 770V1462H1419V0Z" />
+<glyph unicode="O" glyph-name="O" horiz-adv-x="1548" d="M1430 733Q1430 564 1391 425T1270 187T1066 34T774 -20Q606 -20 483 34T279 187T159 425T119 735Q119 905 158 1043T279 1280T483 1431T776 1485Q944 1485 1067 1432T1270 1280T1390 1043T1430 733ZM438
+733Q438 618 458 527T519 372T624 274T774 240Q863 240 926 274T1030 371T1090 526T1110 733Q1110 848 1091 939T1031 1095T927 1193T776 1227Q689 1227 625 1193T520 1095T458 940T438 733Z" />
+<glyph unicode="P" glyph-name="P" horiz-adv-x="1225" d="M494 774H555Q686 774 752 826T819 995Q819 1104 760 1156T573 1208H494V774ZM1133 1006Q1133 910 1104 822T1009 667T834 560T565 520H494V0H184V1462H590Q731 1462 833 1431T1002 1341T1101 1198T1133 1006Z" />
+<glyph unicode="Q" glyph-name="Q" horiz-adv-x="1548" d="M1430 733Q1430 614 1411 510T1352 319T1253 166T1112 55L1473 -348H1075L807 -18Q800 -18 794 -19Q789 -20 784 -20T774 -20Q606 -20 483 34T279 187T159 425T119 735Q119 905 158 1043T279 1280T483
+1431T776 1485Q944 1485 1067 1432T1270 1280T1390 1043T1430 733ZM438 733Q438 618 458 527T519 372T624 274T774 240Q863 240 926 274T1030 371T1090 526T1110 733Q1110 848 1091 939T1031 1095T927 1193T776 1227Q689 1227 625 1193T520 1095T458 940T438 733Z"
+/>
+<glyph unicode="R" glyph-name="R" horiz-adv-x="1290" d="M494 813H578Q707 813 763 864T819 1016Q819 1120 759 1164T573 1208H494V813ZM494 561V0H184V1462H584Q865 1462 999 1354T1133 1024Q1133 949 1113 888T1060 780T983 697T891 637Q1002 459 1090 319Q1128
+259 1163 202T1227 100T1273 28L1290 0H946L629 561H494Z" />
+<glyph unicode="S" glyph-name="S" horiz-adv-x="1073" d="M985 406Q985 308 952 230T854 96T696 10T481 -20Q375 -20 277 2T94 68V356Q142 333 191 312T290 273T391 246T492 236Q543 236 579 247T638 279T671 328T682 391Q682 432 665 463T616 522T540 576T440
+631Q394 655 337 689T230 773T145 895T111 1067Q111 1165 143 1242T236 1373T381 1455T573 1483Q626 1483 676 1476T776 1456T876 1424T979 1380L879 1139Q834 1160 795 1176T719 1203T647 1219T575 1225Q497 1225 456 1184T414 1073Q414 1036 426 1008T466 954T537
+903T643 844Q718 804 781 763T889 671T960 556T985 406Z" />
+<glyph unicode="T" glyph-name="T" horiz-adv-x="1124" d="M717 0H408V1204H41V1462H1083V1204H717V0Z" />
+<glyph unicode="U" glyph-name="U" horiz-adv-x="1466" d="M1292 1462V516Q1292 402 1258 304T1153 134T976 21T727 -20Q592 -20 489 18T316 128T210 298T174 520V1462H483V543Q483 462 499 405T546 311T625 257T735 240Q866 240 924 316T983 545V1462H1292Z" />
+<glyph unicode="V" glyph-name="V" horiz-adv-x="1249" d="M936 1462H1249L793 0H455L0 1462H313L561 582Q566 565 574 525T592 437T611 341T625 260Q630 293 639 341T658 436T677 524T692 582L936 1462Z" />
+<glyph unicode="W" glyph-name="W" horiz-adv-x="1898" d="M1546 0H1194L1014 721Q1010 736 1005 763T992 824T978 895T965 967T955 1031T948 1079Q946 1061 942 1032T931 968T919 896T906 825T893 763T883 719L705 0H352L0 1462H305L471 664Q474 648 479 618T492
+549T506 469T521 387T534 313T543 256Q546 278 551 312T563 384T576 464T590 540T601 603T610 643L813 1462H1085L1288 643Q1291 631 1296 604T1308 541T1322 464T1335 385T1347 312T1356 256Q1359 278 1364 312T1377 387T1391 469T1406 549T1418 617T1427 664L1593
+1462H1898L1546 0Z" />
+<glyph unicode="X" glyph-name="X" horiz-adv-x="1284" d="M1284 0H930L631 553L332 0H0L444 754L31 1462H373L647 936L915 1462H1249L831 737L1284 0Z" />
+<glyph unicode="Y" glyph-name="Y" horiz-adv-x="1196" d="M598 860L862 1462H1196L752 569V0H444V559L0 1462H336L598 860Z" />
+<glyph unicode="Z" glyph-name="Z" horiz-adv-x="1104" d="M1055 0H49V201L668 1206H68V1462H1036V1262L418 256H1055V0Z" />
+<glyph unicode="[" glyph-name="bracketleft" horiz-adv-x="678" d="M627 -324H143V1462H627V1251H403V-113H627V-324Z" />
+<glyph unicode="\" glyph-name="backslash" horiz-adv-x="846" d="M289 1462L834 0H557L12 1462H289Z" />
+<glyph unicode="]" glyph-name="bracketright" horiz-adv-x="678" d="M51 -113H274V1251H51V1462H535V-324H51V-113Z" />
+<glyph unicode="^" glyph-name="asciicircum" horiz-adv-x="1090" d="M8 520L446 1470H590L1085 520H846L524 1163Q455 1002 384 839T244 520H8Z" />
+<glyph unicode="_" glyph-name="underscore" horiz-adv-x="842" d="M846 -324H-4V-184H846V-324Z" />
+<glyph unicode="`" glyph-name="grave" horiz-adv-x="1182" d="M645 1241Q611 1269 564 1310T470 1396T386 1480T332 1548V1569H674Q690 1535 711 1495T756 1414T803 1335T848 1268V1241H645Z" />
+<glyph unicode="a" glyph-name="a" horiz-adv-x="1176" d="M809 0L750 152H741Q708 107 675 75T603 21T516 -10T403 -20Q335 -20 277 1T177 66T110 176T86 334Q86 512 200 596T541 690L719 696V780Q719 849 679 882T567 915Q495 915 427 894T289 838L190 1040Q274
+1087 376 1114T590 1141Q799 1141 910 1043T1022 745V0H809ZM719 518L618 514Q557 512 515 498T448 461T411 405T399 332Q399 262 433 233T522 203Q564 203 600 217T662 260T704 330T719 426V518Z" />
+<glyph unicode="b" glyph-name="b" horiz-adv-x="1245" d="M756 1139Q842 1139 913 1102T1035 992T1114 811T1143 561Q1143 417 1115 309T1034 127T909 17T748 -20Q692 -20 649 -8T571 24T512 69T465 123H444L393 0H160V1556H465V1194Q465 1161 463 1123T459 1051Q456
+1012 453 973H465Q486 1008 513 1038T575 1090T656 1126T756 1139ZM653 895Q602 895 567 877T509 821T477 728T465 596V563Q465 482 474 419T506 314T564 249T655 227Q746 227 788 313T831 565Q831 730 789 812T653 895Z" />
+<glyph unicode="c" glyph-name="c" horiz-adv-x="1022" d="M625 -20Q505 -20 409 13T244 115T139 293T102 553Q102 720 139 832T245 1013T410 1110T625 1139Q711 1139 796 1118T956 1059L868 827Q802 856 741 874T625 893Q514 893 464 809T414 555Q414 387 464
+307T621 227Q708 227 779 249T924 307V53Q887 35 852 21T782 -2T708 -15T625 -20Z" />
+<glyph unicode="d" glyph-name="d" horiz-adv-x="1245" d="M489 -20Q403 -20 332 17T210 126T131 307T102 557Q102 701 130 809T211 991T337 1102T498 1139Q552 1139 597 1127T678 1092T742 1040T793 975H803Q797 1014 792 1054Q787 1088 784 1126T780 1198V1556H1085V0H852L793
+145H780Q759 111 732 81T670 28T590 -7T489 -20ZM600 223Q654 223 692 241T753 297T788 391T801 522V555Q801 636 791 699T758 804T696 869T598 891Q502 891 457 805T412 553Q412 388 457 306T600 223Z" />
+<glyph unicode="e" glyph-name="e" horiz-adv-x="1190" d="M612 922Q531 922 478 865T416 686H805Q804 737 792 780T756 854T696 904T612 922ZM651 -20Q531 -20 430 15T256 120T143 298T102 551Q102 698 139 808T242 991T402 1102T610 1139Q721 1139 810 1106T962
+1007T1058 848T1092 631V483H410Q412 419 430 368T482 281T563 226T672 207Q723 207 768 212T857 229T942 256T1028 295V59Q988 38 948 24T862 -1T765 -15T651 -20Z" />
+<glyph unicode="f" glyph-name="f" horiz-adv-x="793" d="M741 889H514V0H209V889H41V1036L209 1118V1200Q209 1307 235 1377T309 1490T425 1549T578 1567Q670 1567 733 1553T840 1520L768 1296Q737 1307 703 1316T623 1325Q563 1325 539 1287T514 1188V1118H741V889Z" />
+<glyph unicode="g" glyph-name="g" horiz-adv-x="1130" d="M1085 1116V950L922 899Q942 865 950 829T958 750Q958 665 931 595T851 474T718 397T532 369Q509 369 482 371T442 377Q422 360 411 342T399 297Q399 276 412 264T446 244T495 234T553 231H727Q808 231
+872 213T980 156T1049 60T1073 -80Q1073 -175 1035 -251T922 -381T734 -463T475 -492Q361 -492 276 -471T134 -409T49 -311T20 -182Q20 -121 41 -76T97 1T176 53T268 84Q247 93 227 109T190 146T163 192T152 246Q152 278 161 304T189 352T234 395T295 436Q207 474
+156 558T104 756Q104 846 132 917T214 1037T348 1113T532 1139Q552 1139 577 1137T626 1131T672 1123T705 1116H1085ZM285 -158Q285 -183 295 -206T330 -248T393 -276T489 -287Q645 -287 724 -243T803 -125Q803 -62 754 -41T602 -20H461Q434 -20 403 -26T346 -49T303
+-91T285 -158ZM395 752Q395 661 429 611T532 561Q604 561 636 611T668 752Q668 842 637 895T532 948Q395 948 395 752Z" />
+<glyph unicode="h" glyph-name="h" horiz-adv-x="1284" d="M1130 0H825V653Q825 774 788 834T672 895Q613 895 573 871T509 800T475 684T465 526V0H160V1556H465V1239Q465 1197 463 1151T458 1065Q454 1019 451 975H467Q516 1062 592 1100T764 1139Q847 1139 914
+1116T1030 1042T1104 915T1130 729V0Z" />
+<glyph unicode="i" glyph-name="i" horiz-adv-x="625" d="M147 1407Q147 1450 160 1478T195 1524T248 1549T313 1556Q347 1556 377 1549T429 1525T465 1479T479 1407Q479 1365 466 1336T430 1290T377 1265T313 1257Q279 1257 249 1264T196 1289T160 1336T147 1407ZM465
+0H160V1118H465V0Z" />
+<glyph unicode="j" glyph-name="j" horiz-adv-x="625" d="M102 -492Q54 -492 3 -485T-82 -467V-227Q-51 -237 -24 -241T37 -246Q62 -246 84 -239T123 -212T150 -160T160 -76V1118H465V-121Q465 -198 446 -265T383 -383T270 -463T102 -492ZM147 1407Q147 1450 160
+1478T195 1524T248 1549T313 1556Q347 1556 377 1549T429 1525T465 1479T479 1407Q479 1365 466 1336T430 1290T377 1265T313 1257Q279 1257 249 1264T196 1289T160 1336T147 1407Z" />
+<glyph unicode="k" glyph-name="k" horiz-adv-x="1208" d="M453 608L565 778L838 1118H1182L778 633L1208 0H856L584 430L465 348V0H160V1556H465V862L449 608H453Z" />
+<glyph unicode="l" glyph-name="l" horiz-adv-x="625" d="M465 0H160V1556H465V0Z" />
+<glyph unicode="m" glyph-name="m" horiz-adv-x="1929" d="M1120 0H815V653Q815 774 779 834T666 895Q608 895 570 871T508 800T475 684T465 526V0H160V1118H393L434 975H451Q475 1018 508 1049T582 1100T667 1129T758 1139Q873 1139 953 1100T1077 975H1102Q1126
+1018 1160 1049T1235 1100T1321 1129T1413 1139Q1593 1139 1684 1042T1776 729V0H1470V653Q1470 774 1434 834T1321 895Q1212 895 1166 809T1120 561V0Z" />
+<glyph unicode="n" glyph-name="n" horiz-adv-x="1284" d="M1130 0H825V653Q825 774 789 834T672 895Q612 895 572 871T509 800T475 684T465 526V0H160V1118H393L434 975H451Q475 1018 509 1049T585 1100T672 1129T766 1139Q848 1139 915 1116T1030 1042T1104
+915T1130 729V0Z" />
+<glyph unicode="o" glyph-name="o" horiz-adv-x="1227" d="M414 561Q414 394 461 310T614 225Q719 225 766 310T813 561Q813 728 766 810T612 893Q507 893 461 811T414 561ZM1124 561Q1124 421 1089 313T987 131T825 19T610 -20Q499 -20 406 18T246 131T140 313T102
+561Q102 700 137 808T239 989T401 1101T616 1139Q727 1139 820 1101T980 990T1086 808T1124 561Z" />
+<glyph unicode="p" glyph-name="p" horiz-adv-x="1245" d="M748 -20Q693 -20 650 -8T572 24T512 69T465 123H449Q453 88 457 57Q460 31 462 4T465 -39V-492H160V1118H408L451 973H465Q486 1007 513 1037T575 1089T656 1125T756 1139Q843 1139 914 1102T1036 992T1115
+811T1143 561Q1143 418 1114 310T1033 128T908 17T748 -20ZM653 895Q602 895 567 877T509 821T477 728T465 596V563Q465 482 474 419T506 314T564 249T655 227Q746 227 788 313T831 565Q831 730 789 812T653 895Z" />
+<glyph unicode="q" glyph-name="q" horiz-adv-x="1245" d="M602 219Q657 219 694 237T755 293T789 386T801 518V555Q801 636 792 699T759 804T697 869T600 891Q504 891 459 805T414 553Q414 385 459 302T602 219ZM489 -20Q402 -20 331 17T209 126T130 307T102
+557Q102 700 130 808T211 990T337 1101T498 1139Q554 1139 599 1127T680 1092T745 1040T795 975H803L827 1118H1085V-492H780V-23Q780 -4 782 24T787 80Q790 112 793 145H780Q760 111 733 81T671 28T590 -7T489 -20Z" />
+<glyph unicode="r" glyph-name="r" horiz-adv-x="889" d="M743 1139Q755 1139 769 1139T797 1137T822 1134T840 1130V844Q832 846 818 848T789 851T758 853T733 854Q674 854 625 839T540 791T485 703T465 569V0H160V1118H391L436 950H451Q475 993 503 1028T565
+1087T643 1125T743 1139Z" />
+<glyph unicode="s" glyph-name="s" horiz-adv-x="985" d="M905 332Q905 244 873 178T782 68T639 2T451 -20Q396 -20 349 -17T260 -5T179 15T100 45V297Q142 276 188 259T281 230T370 210T451 203Q492 203 521 210T568 231T595 263T604 303Q604 324 598 340T568
+375T501 417T381 475Q308 508 255 540T167 613T115 704T98 827Q98 905 128 963T213 1061T345 1119T518 1139Q618 1139 708 1116T893 1047L801 831Q725 867 656 890T518 913Q456 913 429 891T401 831Q401 811 408 796T436 764T495 728T594 680Q665 649 722 619T820
+549T883 458T905 332Z" />
+<glyph unicode="t" glyph-name="t" horiz-adv-x="848" d="M614 223Q659 223 699 233T782 258V31Q739 9 676 -5T537 -20Q464 -20 401 -3T292 56T220 170T193 350V889H47V1018L215 1120L303 1356H498V1118H770V889H498V350Q498 285 530 254T614 223Z" />
+<glyph unicode="u" glyph-name="u" horiz-adv-x="1284" d="M891 0L850 143H834Q809 100 775 70T699 19T612 -10T518 -20Q436 -20 369 3T254 77T180 204T154 389V1118H459V465Q459 344 495 284T612 223Q672 223 712 247T775 318T809 434T819 592V1118H1124V0H891Z" />
+<glyph unicode="v" glyph-name="v" horiz-adv-x="1104" d="M395 0L0 1118H319L504 481Q521 424 533 363T549 252H555Q558 305 570 364T600 481L784 1118H1104L709 0H395Z" />
+<glyph unicode="w" glyph-name="w" horiz-adv-x="1651" d="M1014 0L928 391Q924 408 918 439T903 510T887 594T869 683Q849 786 825 905H819Q796 786 777 682Q769 638 761 593T744 509T730 437T719 387L629 0H301L0 1118H303L416 623Q425 584 434 530T452 420T468
+315T479 236H485Q486 255 489 285T498 351T508 422T519 491T529 547T537 582L659 1118H995L1112 582Q1117 560 1125 514T1141 416T1156 314T1163 236H1169Q1172 261 1179 310T1196 415T1215 528T1235 623L1352 1118H1651L1346 0H1014Z" />
+<glyph unicode="x" glyph-name="x" horiz-adv-x="1122" d="M389 571L29 1118H375L561 782L750 1118H1096L731 571L1112 0H766L561 362L356 0H10L389 571Z" />
+<glyph unicode="y" glyph-name="y" horiz-adv-x="1104" d="M0 1118H334L514 489Q530 437 537 378T547 272H553Q555 295 558 323T567 380T578 437T592 489L768 1118H1104L662 -143Q600 -320 493 -406T225 -492Q173 -492 135 -487T70 -475V-233Q91 -238 123 -242T190
+-246Q238 -246 272 -233T330 -197T372 -140T403 -66L422 -10L0 1118Z" />
+<glyph unicode="z" glyph-name="z" horiz-adv-x="936" d="M877 0H55V180L512 885H86V1118H858V920L416 233H877V0Z" />
+<glyph unicode="{" glyph-name="braceleft" horiz-adv-x="745" d="M287 367T222 408T31 449V688Q93 688 141 697T223 728T272 784T287 866V1184Q287 1258 306 1310T374 1396T509 1446T725 1462V1237Q685 1236 653 1230T598 1209T563 1166T551 1096V797Q545 610
+317 575V563Q432 546 493 491T551 342V43Q551 0 563 -27T597 -69T652 -91T725 -98V-324Q594 -324 509 -308T375 -259T306 -172T287 -45V270Q287 367 222 408Z" />
+<glyph unicode="|" glyph-name="bar" horiz-adv-x="1128" d="M455 1550H674V-465H455V1550Z" />
+<glyph unicode="}" glyph-name="braceright" horiz-adv-x="745" d="M469 -45Q469 -119 450 -172T382 -258T247 -308T31 -324V-98Q71 -97 103 -91T157 -70T192 -27T205 43V342Q202 436 263 491T438 563V575Q211 610 205 797V1096Q205 1139 193 1166T158 1208T103
+1230T31 1237V1462Q162 1462 247 1446T381 1397T450 1311T469 1184V866Q468 818 484 784T533 729T614 698T725 688V449Q600 449 535 408T469 270V-45Z" />
+<glyph unicode="~" glyph-name="asciitilde" horiz-adv-x="1128" d="M528 616Q491 632 463 643T411 660T366 669T322 672Q293 672 262 663T201 637T143 598T88 551V782Q139 836 202 863T344 891Q374 891 399 889T453 879T517 860T600 827Q638 811 666 801T719
+784T764 775T807 772Q836 772 867 781T928 807T986 845T1040 893V662Q939 553 784 553Q754 553 729 555T675 564T611 583T528 616Z" />
+<glyph unicode="&#xa0;" glyph-name="nbspace" horiz-adv-x="532" />
+<glyph unicode="&#xa1;" glyph-name="exclamdown" horiz-adv-x="586" d="M168 606H412L463 -369H117L168 606ZM467 948Q467 901 454 869T416 816T360 787T291 778Q256 778 225 787T169 816T131 868T117 948Q117 993 131 1025T169 1078T224 1108T291 1118Q328 1118
+360 1109T416 1079T453 1026T467 948Z" />
+<glyph unicode="&#xa2;" glyph-name="cent" horiz-adv-x="1128" d="M543 -20V186Q451 199 377 236T251 340T171 506T143 743Q143 884 171 985T251 1155T378 1260T543 1311V1483H721V1319Q759 1318 797 1313T870 1299T937 1281T993 1260L907 1034Q886 1044 860
+1053T805 1070T750 1082T698 1087Q632 1087 586 1067T511 1006T468 901T455 750Q455 579 512 500T698 420Q774 420 844 438T965 481V242Q914 213 852 198T721 180V-20H543Z" />
+<glyph unicode="&#xa3;" glyph-name="sterling" horiz-adv-x="1128" d="M680 1483Q790 1483 879 1459T1049 1401L956 1171Q885 1200 827 1217T705 1235Q638 1235 601 1197T563 1063V870H897V651H563V508Q563 453 550 413T514 343T466 294T412 260H1090V0H82V248Q124
+266 157 287T214 337T250 407T262 506V651H84V870H262V1065Q262 1178 293 1257T380 1387T512 1460T680 1483Z" />
+<glyph unicode="&#xa4;" glyph-name="currency" horiz-adv-x="1128" d="M168 723Q168 777 182 826T221 920L92 1047L240 1194L367 1067Q410 1092 461 1106T563 1120Q617 1120 665 1107T760 1065L887 1194L1036 1051L907 922Q932 880 946 829T961 723Q961 667 947
+618T907 524L1032 399L887 254L760 379Q716 356 667 342T563 328Q507 328 458 340T365 379L240 256L94 401L221 526Q168 617 168 723ZM375 723Q375 684 390 650T430 590T490 550T563 535Q603 535 638 549T699 589T741 649T756 723Q756 763 741 797T700 857T638
+898T563 913Q524 913 490 898T431 858T390 798T375 723Z" />
+<glyph unicode="&#xa5;" glyph-name="yen" horiz-adv-x="1128" d="M565 860L809 1462H1122L760 715H954V537H709V399H954V221H709V0H422V221H174V399H422V537H174V715H365L8 1462H324L565 860Z" />
+<glyph unicode="&#xa6;" glyph-name="brokenbar" horiz-adv-x="1128" d="M455 1550H674V735H455V1550ZM455 350H674V-465H455V350Z" />
+<glyph unicode="&#xa7;" glyph-name="section" horiz-adv-x="995" d="M121 805Q121 849 131 886T160 955T203 1012T254 1055Q191 1095 156 1154T121 1288Q121 1353 150 1406T232 1498T360 1556T526 1577Q628 1577 716 1554T889 1493L807 1303Q739 1335 669 1360T520
+1386Q439 1386 402 1363T365 1292Q365 1267 377 1246T415 1206T481 1167T578 1124Q649 1096 707 1062T807 987T872 895T895 782Q895 682 861 621T770 522Q832 482 863 430T895 303Q895 229 864 170T776 68T638 3T455 -20Q345 -20 261 0T106 59V266Q145 246 190
+229T281 198T371 176T455 168Q511 168 548 177T607 202T639 239T649 285Q649 310 642 329T612 368T549 408T442 457Q366 489 306 521T205 593T143 685T121 805ZM344 827Q344 764 400 716T575 616L590 610Q605 621 619 635T644 668T661 708T668 756Q668 788 658
+815T621 867T550 917T434 967Q416 960 400 947T372 915T352 875T344 827Z" />
+<glyph unicode="&#xa8;" glyph-name="dieresis" horiz-adv-x="1182" d="M248 1405Q248 1440 259 1465T288 1507T332 1532T387 1540Q416 1540 441 1532T486 1508T516 1466T528 1405Q528 1371 517 1346T486 1305T442 1280T387 1272Q358 1272 333 1280T289 1304T259
+1346T248 1405ZM651 1405Q651 1440 662 1465T692 1507T737 1532T793 1540Q821 1540 846 1532T891 1508T922 1466T934 1405Q934 1371 923 1346T892 1305T847 1280T793 1272Q733 1272 692 1305T651 1405Z" />
+<glyph unicode="&#xa9;" glyph-name="copyright" horiz-adv-x="1704" d="M895 1010Q798 1010 745 936T692 731Q692 596 740 524T895 451Q952 451 1018 466T1141 510V319Q1084 292 1025 277T889 262Q782 262 702 296T569 392T488 540T461 733Q461 836 487 921T565
+1068T697 1164T881 1198Q964 1198 1041 1176T1186 1120L1112 952Q999 1010 895 1010ZM100 731Q100 835 127 931T202 1110T320 1263T472 1380T652 1456T852 1483Q956 1483 1052 1456T1231 1381T1384 1263T1501 1111T1577 931T1604 731Q1604 627 1577 531T1502 352T1384
+200T1232 82T1052 7T852 -20Q748 -20 652 6T473 82T320 199T203 351T127 531T100 731ZM242 731Q242 604 290 493T420 300T614 169T852 121Q979 121 1090 169T1283 299T1414 493T1462 731Q1462 858 1414 969T1284 1162T1090 1293T852 1341Q725 1341 614 1293T421
+1163T290 969T242 731Z" />
+<glyph unicode="&#xaa;" glyph-name="ordfeminine" horiz-adv-x="743" d="M520 764L489 874Q449 816 393 784T268 752Q218 752 178 765T108 806T63 876T47 975Q47 1035 68 1076T130 1144T230 1184T365 1202L455 1206Q455 1269 426 1296T342 1323Q302 1323 253
+1306T152 1262L86 1397Q148 1429 222 1454T387 1479Q455 1479 505 1460T589 1405T638 1319T655 1206V764H520ZM373 1081Q335 1078 312 1068T275 1044T257 1012T252 977Q252 939 271 921T317 903Q349 903 374 914T418 944T445 991T455 1051V1087L373 1081Z" />
+<glyph unicode="&#xab;" glyph-name="guillemotleft" horiz-adv-x="1198" d="M82 573L391 1028L610 909L393 561L610 213L391 94L82 547V573ZM588 573L897 1028L1116 909L899 561L1116 213L897 94L588 547V573Z" />
+<glyph unicode="&#xac;" glyph-name="logicalnot" horiz-adv-x="1128" d="M1040 248H821V612H88V831H1040V248Z" />
+<glyph unicode="&#xad;" glyph-name="uni00AD" horiz-adv-x="659" d="M61 424V674H598V424H61Z" />
+<glyph unicode="&#xae;" glyph-name="registered" horiz-adv-x="1704" d="M1157 905Q1157 811 1119 756T1014 672L1251 272H997L819 610H772V272H543V1188H807Q989 1188 1073 1118T1157 905ZM772 778H803Q869 778 897 806T926 901Q926 936 919 959T896 995T857
+1014T801 1020H772V778ZM100 731Q100 835 127 931T202 1110T320 1263T472 1380T652 1456T852 1483Q956 1483 1052 1456T1231 1381T1384 1263T1501 1111T1577 931T1604 731Q1604 627 1577 531T1502 352T1384 200T1232 82T1052 7T852 -20Q748 -20 652 6T473 82T320
+199T203 351T127 531T100 731ZM242 731Q242 604 290 493T420 300T614 169T852 121Q979 121 1090 169T1283 299T1414 493T1462 731Q1462 858 1414 969T1284 1162T1090 1293T852 1341Q725 1341 614 1293T421 1163T290 969T242 731Z" />
+<glyph unicode="&#xaf;" glyph-name="overscore" horiz-adv-x="1024" d="M1030 1556H-6V1757H1030V1556Z" />
+<glyph unicode="&#xb0;" glyph-name="degree" horiz-adv-x="877" d="M92 1137Q92 1208 119 1271T193 1381T303 1455T438 1483Q510 1483 573 1456T683 1381T757 1271T784 1137Q784 1065 757 1002T684 893T574 820T438 793Q366 793 303 819T193 892T119 1002T92
+1137ZM283 1137Q283 1106 295 1078T328 1029T377 996T438 983Q470 983 498 995T548 1029T581 1078T594 1137Q594 1169 582 1197T548 1247T499 1281T438 1294Q406 1294 378 1282T328 1248T295 1198T283 1137Z" />
+<glyph unicode="&#xb1;" glyph-name="plusminus" horiz-adv-x="1128" d="M455 674H88V893H455V1262H674V893H1040V674H674V309H455V674ZM88 0V219H1040V0H88Z" />
+<glyph unicode="&#xb2;" glyph-name="twosuperior" horiz-adv-x="776" d="M702 586H55V754L279 973Q325 1018 355 1051T404 1111T430 1161T438 1212Q438 1250 414 1270T350 1290Q310 1290 267 1270T170 1202L47 1354Q112 1411 193 1447T383 1483Q449 1483 503
+1467T596 1419T656 1341T678 1233Q678 1187 666 1147T626 1065T557 980T455 881L350 786H702V586Z" />
+<glyph unicode="&#xb3;" glyph-name="threesuperior" horiz-adv-x="776" d="M666 1249Q666 1180 626 1130T496 1051V1038Q547 1028 584 1007T645 959T682 898T694 829Q694 708 606 639T332 569Q256 569 190 586T59 639V829Q125 789 191 764T330 739Q404 739 438
+766T473 846Q473 867 465 886T438 919T387 943T307 952H195V1112H287Q339 1112 371 1121T421 1145T445 1180T451 1221Q451 1259 426 1284T350 1309Q303 1309 261 1290T162 1231L61 1372Q123 1419 198 1450T377 1481Q439 1481 492 1465T583 1418T644 1345T666 1249Z"
+/>
+<glyph unicode="&#xb4;" glyph-name="acute" horiz-adv-x="1182" d="M332 1241V1268Q353 1297 377 1335T424 1413T469 1494T506 1569H848V1548Q837 1530 816 1506T768 1453T710 1396T648 1338T587 1285T535 1241H332Z" />
+<glyph unicode="&#xb5;" glyph-name="mu" horiz-adv-x="1290" d="M465 465Q465 344 502 284T621 223Q679 223 718 247T781 318T815 434T825 592V1118H1130V0H897L854 150H842Q807 65 755 23T627 -20Q573 -20 528 3T455 70Q457 28 460 -15Q462 -52 463 -94T465
+-172V-492H160V1118H465V465Z" />
+<glyph unicode="&#xb6;" glyph-name="paragraph" horiz-adv-x="1341" d="M1167 -260H1006V1356H840V-260H678V559Q617 541 532 541Q437 541 360 566T228 651T143 806T113 1042Q113 1189 145 1287T237 1446T380 1531T563 1556H1167V-260Z" />
+<glyph unicode="&#xb7;" glyph-name="middot" horiz-adv-x="584" d="M117 723Q117 770 130 802T168 855T224 884T293 893Q328 893 359 884T415 855T453 803T467 723Q467 678 453 646T415 593T360 563T293 553Q256 553 224 562T168 592T131 645T117 723Z" />
+<glyph unicode="&#xb8;" glyph-name="cedilla" horiz-adv-x="420" d="M418 -250Q418 -307 403 -352T351 -428T256 -475T109 -492Q64 -492 28 -486T-37 -471V-303Q-22 -307 -4 -310T34 -317T72 -322T106 -324Q135 -324 156 -311T178 -262Q178 -225 141 -197T12
+-154L90 0H283L256 -61Q287 -71 316 -88T367 -128T404 -182T418 -250Z" />
+<glyph unicode="&#xb9;" glyph-name="onesuperior" horiz-adv-x="776" d="M584 586H346V1032Q346 1052 346 1082T348 1144T351 1201T354 1239Q348 1231 339 1221T319 1199T298 1178T279 1161L201 1100L92 1227L393 1462H584V586Z" />
+<glyph unicode="&#xba;" glyph-name="ordmasculine" horiz-adv-x="754" d="M696 1116Q696 1029 674 962T609 848T508 777T375 752Q306 752 248 776T147 847T81 961T57 1116Q57 1203 79 1270T143 1384T244 1455T379 1479Q447 1479 504 1455T605 1385T672 1271T696
+1116ZM260 1116Q260 1016 287 966T377 915Q437 915 464 965T492 1116Q492 1216 465 1265T377 1315Q315 1315 288 1266T260 1116Z" />
+<glyph unicode="&#xbb;" glyph-name="guillemotright" horiz-adv-x="1198" d="M1118 547L809 94L590 213L807 561L590 909L809 1028L1118 573V547ZM612 547L303 94L84 213L301 561L84 909L303 1028L612 573V547Z" />
+<glyph unicode="&#xbc;" glyph-name="onequarter" horiz-adv-x="1804" d="M1370 1462L559 0H320L1131 1462H1370ZM794 586H556V1032Q556 1052 556 1082T558 1144T561 1201T564 1239Q558 1231 549 1221T529 1199T508 1178T489 1161L411 1100L302 1227L603 1462H794V586ZM1682
+152H1557V1H1319V152H936V306L1321 883H1557V320H1682V152ZM1319 320V484Q1319 526 1320 572T1325 668Q1320 655 1311 634T1290 590T1268 546T1248 511L1121 320H1319Z" />
+<glyph unicode="&#xbd;" glyph-name="onehalf" horiz-adv-x="1804" d="M1370 1462L559 0H320L1131 1462H1370ZM794 586H556V1032Q556 1052 556 1082T558 1144T561 1201T564 1239Q558 1231 549 1221T529 1199T508 1178T489 1161L411 1100L302 1227L603 1462H794V586ZM1716
+1H1069V169L1293 388Q1339 433 1369 466T1418 526T1444 576T1452 627Q1452 665 1428 685T1364 705Q1324 705 1281 685T1184 617L1061 769Q1126 826 1207 862T1397 898Q1463 898 1517 882T1610 834T1670 756T1692 648Q1692 602 1680 562T1640 480T1571 395T1469
+296L1364 201H1716V1Z" />
+<glyph unicode="&#xbe;" glyph-name="threequarters" horiz-adv-x="1804" d="M1441 1462L630 0H391L1202 1462H1441ZM1712 152H1587V1H1349V152H966V306L1351 883H1587V320H1712V152ZM1349 320V484Q1349 526 1350 572T1355 668Q1350 655 1341 634T1320 590T1298
+546T1278 511L1151 320H1349ZM697 1249Q697 1180 657 1130T527 1051V1038Q578 1028 615 1007T676 959T713 898T725 829Q725 708 637 639T363 569Q287 569 221 586T90 639V829Q156 789 222 764T361 739Q435 739 469 766T504 846Q504 867 496 886T469 919T418 943T338
+952H226V1112H318Q370 1112 402 1121T452 1145T476 1180T482 1221Q482 1259 457 1284T381 1309Q334 1309 292 1290T193 1231L92 1372Q154 1419 229 1450T408 1481Q470 1481 523 1465T614 1418T675 1345T697 1249Z" />
+<glyph unicode="&#xbf;" glyph-name="questiondown" horiz-adv-x="940" d="M686 606V532Q686 481 676 440T644 361T588 288T506 215Q464 182 435 156T388 105T362 51T354 -14Q354 -71 393 -108T510 -145Q579 -145 659 -116T823 -45L926 -266Q883 -292 832 -314T727
+-354T616 -381T506 -391Q404 -391 323 -367T184 -296T97 -182T66 -29Q66 34 79 83T121 175T190 258T287 342Q328 375 354 399T396 446T416 492T422 547V606H686ZM719 948Q719 901 706 869T668 816T612 787T543 778Q508 778 477 787T421 816T383 868T369 948Q369
+993 383 1025T421 1078T476 1108T543 1118Q580 1118 612 1109T668 1079T705 1026T719 948Z" />
+<glyph unicode="&#xc0;" glyph-name="Agrave" horiz-adv-x="1331" d="M1018 0L918 348H414L313 0H0L475 1468H854L1331 0H1018ZM846 608L752 928Q746 946 734 987T709 1077T683 1177T666 1262Q662 1240 656 1210T641 1147T623 1079T606 1015T592 962T582 928L489
+608H846ZM632 1579Q598 1607 551 1648T457 1734T373 1818T319 1886V1907H661Q677 1873 698 1833T743 1752T790 1673T835 1606V1579H632Z" />
+<glyph unicode="&#xc1;" glyph-name="Aacute" horiz-adv-x="1331" d="M1018 0L918 348H414L313 0H0L475 1468H854L1331 0H1018ZM846 608L752 928Q746 946 734 987T709 1077T683 1177T666 1262Q662 1240 656 1210T641 1147T623 1079T606 1015T592 962T582 928L489
+608H846ZM494 1579V1606Q515 1635 539 1673T586 1751T631 1832T668 1907H1010V1886Q999 1868 978 1844T930 1791T872 1734T810 1676T749 1623T697 1579H494Z" />
+<glyph unicode="&#xc2;" glyph-name="Acircumflex" horiz-adv-x="1331" d="M1018 0L918 348H414L313 0H0L475 1468H854L1331 0H1018ZM846 608L752 928Q746 946 734 987T709 1077T683 1177T666 1262Q662 1240 656 1210T641 1147T623 1079T606 1015T592 962T582
+928L489 608H846ZM879 1579Q828 1613 773 1656T666 1755Q612 1699 560 1656T457 1579H254V1606Q280 1635 311 1673T375 1751T438 1832T490 1907H846Q867 1873 897 1833T959 1752T1024 1673T1082 1606V1579H879Z" />
+<glyph unicode="&#xc3;" glyph-name="Atilde" horiz-adv-x="1331" d="M1018 0L918 348H414L313 0H0L475 1468H854L1331 0H1018ZM846 608L752 928Q746 946 734 987T709 1077T683 1177T666 1262Q662 1240 656 1210T641 1147T623 1079T606 1015T592 962T582 928L489
+608H846ZM504 1684Q473 1684 455 1658T424 1577H275Q281 1657 301 1715T353 1811T430 1867T527 1886Q568 1886 607 1870T684 1835T760 1799T834 1782Q865 1782 883 1808T914 1888H1063Q1057 1809 1037 1751T983 1655T907 1598T811 1579Q771 1579 731 1595T653 1631T578
+1667T504 1684Z" />
+<glyph unicode="&#xc4;" glyph-name="Adieresis" horiz-adv-x="1331" d="M1018 0L918 348H414L313 0H0L475 1468H854L1331 0H1018ZM846 608L752 928Q746 946 734 987T709 1077T683 1177T666 1262Q662 1240 656 1210T641 1147T623 1079T606 1015T592 962T582 928L489
+608H846ZM324 1743Q324 1778 335 1803T364 1845T408 1870T463 1878Q492 1878 517 1870T562 1846T592 1804T604 1743Q604 1709 593 1684T562 1643T518 1618T463 1610Q434 1610 409 1618T365 1642T335 1684T324 1743ZM727 1743Q727 1778 738 1803T768 1845T813 1870T869
+1878Q897 1878 922 1870T967 1846T998 1804T1010 1743Q1010 1709 999 1684T968 1643T923 1618T869 1610Q809 1610 768 1643T727 1743Z" />
+<glyph unicode="&#xc5;" glyph-name="Aring" horiz-adv-x="1331" d="M1018 0L918 348H414L313 0H0L475 1468H854L1331 0H1018ZM846 608L752 928Q746 946 734 987T709 1077T683 1177T666 1262Q662 1240 656 1210T641 1147T623 1079T606 1015T592 962T582 928L489
+608H846ZM918 1567Q918 1511 899 1467T845 1391T764 1344T664 1327Q609 1327 563 1343T485 1390T434 1465T416 1565Q416 1620 434 1664T484 1738T563 1785T664 1802Q717 1802 763 1786T843 1739T898 1665T918 1567ZM760 1565Q760 1610 733 1635T664 1661Q622 1661
+595 1636T568 1565Q568 1520 592 1494T664 1468Q706 1468 733 1494T760 1565Z" />
+<glyph unicode="&#xc6;" glyph-name="AE" horiz-adv-x="1888" d="M1767 0H926V348H465L315 0H0L655 1462H1767V1208H1235V887H1731V633H1235V256H1767V0ZM578 608H926V1198H829L578 608Z" />
+<glyph unicode="&#xc7;" glyph-name="Ccedilla" horiz-adv-x="1305" d="M805 1225Q716 1225 648 1191T533 1092T462 935T438 727Q438 610 459 519T525 366T639 271T805 238Q894 238 983 258T1178 315V55Q1130 35 1083 21T987 -2T887 -15T776 -20Q607 -20 483 34T278
+186T158 422T119 729Q119 895 164 1033T296 1272T511 1427T805 1483Q914 1483 1023 1456T1233 1380L1133 1128Q1051 1167 968 1196T805 1225ZM926 -250Q926 -307 911 -352T859 -428T764 -475T617 -492Q572 -492 536 -486T471 -471V-303Q486 -307 504 -310T542 -317T580
+-322T614 -324Q643 -324 664 -311T686 -262Q686 -225 649 -197T520 -154L598 0H791L764 -61Q795 -71 824 -88T875 -128T912 -182T926 -250Z" />
+<glyph unicode="&#xc8;" glyph-name="Egrave" horiz-adv-x="1147" d="M1026 0H184V1462H1026V1208H494V887H989V633H494V256H1026V0ZM572 1579Q538 1607 491 1648T397 1734T313 1818T259 1886V1907H601Q617 1873 638 1833T683 1752T730 1673T775 1606V1579H572Z" />
+<glyph unicode="&#xc9;" glyph-name="Eacute" horiz-adv-x="1147" d="M1026 0H184V1462H1026V1208H494V887H989V633H494V256H1026V0ZM424 1579V1606Q445 1635 469 1673T516 1751T561 1832T598 1907H940V1886Q929 1868 908 1844T860 1791T802 1734T740 1676T679
+1623T627 1579H424Z" />
+<glyph unicode="&#xca;" glyph-name="Ecircumflex" horiz-adv-x="1147" d="M1026 0H184V1462H1026V1208H494V887H989V633H494V256H1026V0ZM832 1579Q781 1613 726 1656T619 1755Q565 1699 513 1656T410 1579H207V1606Q233 1635 264 1673T328 1751T391 1832T443
+1907H799Q820 1873 850 1833T912 1752T977 1673T1035 1606V1579H832Z" />
+<glyph unicode="&#xcb;" glyph-name="Edieresis" horiz-adv-x="1147" d="M1026 0H184V1462H1026V1208H494V887H989V633H494V256H1026V0ZM273 1743Q273 1778 284 1803T313 1845T357 1870T412 1878Q441 1878 466 1870T511 1846T541 1804T553 1743Q553 1709 542 1684T511
+1643T467 1618T412 1610Q383 1610 358 1618T314 1642T284 1684T273 1743ZM676 1743Q676 1778 687 1803T717 1845T762 1870T818 1878Q846 1878 871 1870T916 1846T947 1804T959 1743Q959 1709 948 1684T917 1643T872 1618T818 1610Q758 1610 717 1643T676 1743Z"
+/>
+<glyph unicode="&#xcc;" glyph-name="Igrave" horiz-adv-x="797" d="M731 0H66V176L244 258V1204L66 1286V1462H731V1286L553 1204V258L731 176V0ZM355 1579Q321 1607 274 1648T180 1734T96 1818T42 1886V1907H384Q400 1873 421 1833T466 1752T513 1673T558 1606V1579H355Z"
+/>
+<glyph unicode="&#xcd;" glyph-name="Iacute" horiz-adv-x="797" d="M731 0H66V176L244 258V1204L66 1286V1462H731V1286L553 1204V258L731 176V0ZM237 1579V1606Q258 1635 282 1673T329 1751T374 1832T411 1907H753V1886Q742 1868 721 1844T673 1791T615 1734T553
+1676T492 1623T440 1579H237Z" />
+<glyph unicode="&#xce;" glyph-name="Icircumflex" horiz-adv-x="797" d="M731 0H66V176L244 258V1204L66 1286V1462H731V1286L553 1204V258L731 176V0ZM609 1579Q558 1613 503 1656T396 1755Q342 1699 290 1656T187 1579H-16V1606Q10 1635 41 1673T105 1751T168
+1832T220 1907H576Q597 1873 627 1833T689 1752T754 1673T812 1606V1579H609Z" />
+<glyph unicode="&#xcf;" glyph-name="Idieresis" horiz-adv-x="797" d="M731 0H66V176L244 258V1204L66 1286V1462H731V1286L553 1204V258L731 176V0ZM54 1743Q54 1778 65 1803T94 1845T138 1870T193 1878Q222 1878 247 1870T292 1846T322 1804T334 1743Q334 1709
+323 1684T292 1643T248 1618T193 1610Q164 1610 139 1618T95 1642T65 1684T54 1743ZM457 1743Q457 1778 468 1803T498 1845T543 1870T599 1878Q627 1878 652 1870T697 1846T728 1804T740 1743Q740 1709 729 1684T698 1643T653 1618T599 1610Q539 1610 498 1643T457
+1743Z" />
+<glyph unicode="&#xd0;" glyph-name="Eth" horiz-adv-x="1434" d="M47 850H184V1462H612Q773 1462 902 1416T1124 1280T1265 1055T1315 745Q1315 560 1265 421T1119 188T885 47T569 0H184V596H47V850ZM1001 737Q1001 859 977 947T906 1094T792 1180T637 1208H494V850H731V596H494V256H608Q804
+256 902 376T1001 737Z" />
+<glyph unicode="&#xd1;" glyph-name="Ntilde" horiz-adv-x="1604" d="M1419 0H1026L451 1106H442Q448 1029 452 953Q456 888 458 817T461 688V0H184V1462H575L1149 367H1155Q1152 443 1148 517Q1147 549 1146 582T1143 649T1142 714T1141 770V1462H1419V0ZM623
+1684Q592 1684 574 1658T543 1577H394Q400 1657 420 1715T472 1811T549 1867T646 1886Q687 1886 726 1870T803 1835T879 1799T953 1782Q984 1782 1002 1808T1033 1888H1182Q1176 1809 1156 1751T1102 1655T1026 1598T930 1579Q890 1579 850 1595T772 1631T697 1667T623
+1684Z" />
+<glyph unicode="&#xd2;" glyph-name="Ograve" horiz-adv-x="1548" d="M1430 733Q1430 564 1391 425T1270 187T1066 34T774 -20Q606 -20 483 34T279 187T159 425T119 735Q119 905 158 1043T279 1280T483 1431T776 1485Q944 1485 1067 1432T1270 1280T1390 1043T1430
+733ZM438 733Q438 618 458 527T519 372T624 274T774 240Q863 240 926 274T1030 371T1090 526T1110 733Q1110 848 1091 939T1031 1095T927 1193T776 1227Q689 1227 625 1193T520 1095T458 940T438 733ZM729 1579Q695 1607 648 1648T554 1734T470 1818T416 1886V1907H758Q774
+1873 795 1833T840 1752T887 1673T932 1606V1579H729Z" />
+<glyph unicode="&#xd3;" glyph-name="Oacute" horiz-adv-x="1548" d="M1430 733Q1430 564 1391 425T1270 187T1066 34T774 -20Q606 -20 483 34T279 187T159 425T119 735Q119 905 158 1043T279 1280T483 1431T776 1485Q944 1485 1067 1432T1270 1280T1390 1043T1430
+733ZM438 733Q438 618 458 527T519 372T624 274T774 240Q863 240 926 274T1030 371T1090 526T1110 733Q1110 848 1091 939T1031 1095T927 1193T776 1227Q689 1227 625 1193T520 1095T458 940T438 733ZM590 1579V1606Q611 1635 635 1673T682 1751T727 1832T764 1907H1106V1886Q1095
+1868 1074 1844T1026 1791T968 1734T906 1676T845 1623T793 1579H590Z" />
+<glyph unicode="&#xd4;" glyph-name="Ocircumflex" horiz-adv-x="1548" d="M1430 733Q1430 564 1391 425T1270 187T1066 34T774 -20Q606 -20 483 34T279 187T159 425T119 735Q119 905 158 1043T279 1280T483 1431T776 1485Q944 1485 1067 1432T1270 1280T1390
+1043T1430 733ZM438 733Q438 618 458 527T519 372T624 274T774 240Q863 240 926 274T1030 371T1090 526T1110 733Q1110 848 1091 939T1031 1095T927 1193T776 1227Q689 1227 625 1193T520 1095T458 940T438 733ZM975 1579Q924 1613 869 1656T762 1755Q708 1699
+656 1656T553 1579H350V1606Q376 1635 407 1673T471 1751T534 1832T586 1907H942Q963 1873 993 1833T1055 1752T1120 1673T1178 1606V1579H975Z" />
+<glyph unicode="&#xd5;" glyph-name="Otilde" horiz-adv-x="1548" d="M1430 733Q1430 564 1391 425T1270 187T1066 34T774 -20Q606 -20 483 34T279 187T159 425T119 735Q119 905 158 1043T279 1280T483 1431T776 1485Q944 1485 1067 1432T1270 1280T1390 1043T1430
+733ZM438 733Q438 618 458 527T519 372T624 274T774 240Q863 240 926 274T1030 371T1090 526T1110 733Q1110 848 1091 939T1031 1095T927 1193T776 1227Q689 1227 625 1193T520 1095T458 940T438 733ZM612 1684Q581 1684 563 1658T532 1577H383Q389 1657 409 1715T461
+1811T538 1867T635 1886Q676 1886 715 1870T792 1835T868 1799T942 1782Q973 1782 991 1808T1022 1888H1171Q1165 1809 1145 1751T1091 1655T1015 1598T919 1579Q879 1579 839 1595T761 1631T686 1667T612 1684Z" />
+<glyph unicode="&#xd6;" glyph-name="Odieresis" horiz-adv-x="1548" d="M1430 733Q1430 564 1391 425T1270 187T1066 34T774 -20Q606 -20 483 34T279 187T159 425T119 735Q119 905 158 1043T279 1280T483 1431T776 1485Q944 1485 1067 1432T1270 1280T1390 1043T1430
+733ZM438 733Q438 618 458 527T519 372T624 274T774 240Q863 240 926 274T1030 371T1090 526T1110 733Q1110 848 1091 939T1031 1095T927 1193T776 1227Q689 1227 625 1193T520 1095T458 940T438 733ZM428 1743Q428 1778 439 1803T468 1845T512 1870T567 1878Q596
+1878 621 1870T666 1846T696 1804T708 1743Q708 1709 697 1684T666 1643T622 1618T567 1610Q538 1610 513 1618T469 1642T439 1684T428 1743ZM831 1743Q831 1778 842 1803T872 1845T917 1870T973 1878Q1001 1878 1026 1870T1071 1846T1102 1804T1114 1743Q1114
+1709 1103 1684T1072 1643T1027 1618T973 1610Q913 1610 872 1643T831 1743Z" />
+<glyph unicode="&#xd7;" glyph-name="multiply" horiz-adv-x="1128" d="M408 723L109 1024L260 1178L561 879L866 1178L1020 1028L715 723L1016 420L866 268L561 569L260 270L111 422L408 723Z" />
+<glyph unicode="&#xd8;" glyph-name="Oslash" horiz-adv-x="1548" d="M1430 733Q1430 564 1391 425T1270 187T1066 34T774 -20Q595 -20 467 41L395 -76L227 18L309 152Q212 252 166 400T119 735Q119 905 158 1043T279 1280T483 1431T776 1485Q867 1485 944 1469T1087
+1421L1157 1532L1323 1436L1243 1307Q1337 1208 1383 1063T1430 733ZM438 733Q438 553 485 438L942 1184Q873 1227 776 1227Q689 1227 625 1193T520 1095T458 940T438 733ZM1110 733Q1110 904 1067 1020L612 279Q646 260 686 250T774 240Q863 240 926 274T1030
+371T1090 526T1110 733Z" />
+<glyph unicode="&#xd9;" glyph-name="Ugrave" horiz-adv-x="1466" d="M1292 1462V516Q1292 402 1258 304T1153 134T976 21T727 -20Q592 -20 489 18T316 128T210 298T174 520V1462H483V543Q483 462 499 405T546 311T625 257T735 240Q866 240 924 316T983 545V1462H1292ZM706
+1579Q672 1607 625 1648T531 1734T447 1818T393 1886V1907H735Q751 1873 772 1833T817 1752T864 1673T909 1606V1579H706Z" />
+<glyph unicode="&#xda;" glyph-name="Uacute" horiz-adv-x="1466" d="M1292 1462V516Q1292 402 1258 304T1153 134T976 21T727 -20Q592 -20 489 18T316 128T210 298T174 520V1462H483V543Q483 462 499 405T546 311T625 257T735 240Q866 240 924 316T983 545V1462H1292ZM570
+1579V1606Q591 1635 615 1673T662 1751T707 1832T744 1907H1086V1886Q1075 1868 1054 1844T1006 1791T948 1734T886 1676T825 1623T773 1579H570Z" />
+<glyph unicode="&#xdb;" glyph-name="Ucircumflex" horiz-adv-x="1466" d="M1292 1462V516Q1292 402 1258 304T1153 134T976 21T727 -20Q592 -20 489 18T316 128T210 298T174 520V1462H483V543Q483 462 499 405T546 311T625 257T735 240Q866 240 924 316T983 545V1462H1292ZM942
+1579Q891 1613 836 1656T729 1755Q675 1699 623 1656T520 1579H317V1606Q343 1635 374 1673T438 1751T501 1832T553 1907H909Q930 1873 960 1833T1022 1752T1087 1673T1145 1606V1579H942Z" />
+<glyph unicode="&#xdc;" glyph-name="Udieresis" horiz-adv-x="1466" d="M1292 1462V516Q1292 402 1258 304T1153 134T976 21T727 -20Q592 -20 489 18T316 128T210 298T174 520V1462H483V543Q483 462 499 405T546 311T625 257T735 240Q866 240 924 316T983 545V1462H1292ZM393
+1743Q393 1778 404 1803T433 1845T477 1870T532 1878Q561 1878 586 1870T631 1846T661 1804T673 1743Q673 1709 662 1684T631 1643T587 1618T532 1610Q503 1610 478 1618T434 1642T404 1684T393 1743ZM796 1743Q796 1778 807 1803T837 1845T882 1870T938 1878Q966
+1878 991 1870T1036 1846T1067 1804T1079 1743Q1079 1709 1068 1684T1037 1643T992 1618T938 1610Q878 1610 837 1643T796 1743Z" />
+<glyph unicode="&#xdd;" glyph-name="Yacute" horiz-adv-x="1196" d="M598 860L862 1462H1196L752 569V0H444V559L0 1462H336L598 860ZM422 1579V1606Q443 1635 467 1673T514 1751T559 1832T596 1907H938V1886Q927 1868 906 1844T858 1791T800 1734T738 1676T677
+1623T625 1579H422Z" />
+<glyph unicode="&#xde;" glyph-name="Thorn" horiz-adv-x="1225" d="M1133 770Q1133 676 1108 590T1024 438T870 333T633 293H494V0H184V1462H494V1233H655Q779 1233 869 1200T1017 1107T1104 961T1133 770ZM494 543H578Q699 543 759 595T819 770Q819 878 766
+929T598 981H494V543Z" />
+<glyph unicode="&#xdf;" glyph-name="germandbls" horiz-adv-x="1395" d="M1188 1241Q1188 1177 1167 1129T1114 1042T1045 975T976 922T923 877T901 834Q901 814 913 797T952 760T1020 715T1118 651Q1167 620 1205 588T1269 517T1309 432T1323 326Q1323 154 1206
+67T862 -20Q764 -20 692 -6T559 43V285Q583 269 617 254T690 226T768 207T842 199Q922 199 966 229T1010 322Q1010 349 1003 370T976 412T918 457T821 516Q758 552 716 584T647 647T609 713T598 788Q598 841 618 880T670 950T737 1007T805 1059T856 1117T877 1188Q877
+1251 827 1290T680 1329Q572 1329 519 1281T465 1128V0H160V1139Q160 1248 197 1328T302 1462T467 1541T680 1567Q795 1567 889 1546T1049 1483T1152 1380T1188 1241Z" />
+<glyph unicode="&#xe0;" glyph-name="agrave" horiz-adv-x="1176" d="M809 0L750 152H741Q708 107 675 75T603 21T516 -10T403 -20Q335 -20 277 1T177 66T110 176T86 334Q86 512 200 596T541 690L719 696V780Q719 849 679 882T567 915Q495 915 427 894T289 838L190
+1040Q274 1087 376 1114T590 1141Q799 1141 910 1043T1022 745V0H809ZM719 518L618 514Q557 512 515 498T448 461T411 405T399 332Q399 262 433 233T522 203Q564 203 600 217T662 260T704 330T719 426V518ZM808 1241Q774 1269 727 1310T633 1396T549 1480T495 1548V1569H837Q853
+1535 874 1495T919 1414T966 1335T1011 1268V1241H808Z" />
+<glyph unicode="&#xe1;" glyph-name="aacute" horiz-adv-x="1176" d="M809 0L750 152H741Q708 107 675 75T603 21T516 -10T403 -20Q335 -20 277 1T177 66T110 176T86 334Q86 512 200 596T541 690L719 696V780Q719 849 679 882T567 915Q495 915 427 894T289 838L190
+1040Q274 1087 376 1114T590 1141Q799 1141 910 1043T1022 745V0H809ZM719 518L618 514Q557 512 515 498T448 461T411 405T399 332Q399 262 433 233T522 203Q564 203 600 217T662 260T704 330T719 426V518ZM441 1241V1268Q462 1297 486 1335T533 1413T578 1494T615
+1569H957V1548Q946 1530 925 1506T877 1453T819 1396T757 1338T696 1285T644 1241H441Z" />
+<glyph unicode="&#xe2;" glyph-name="acircumflex" horiz-adv-x="1176" d="M809 0L750 152H741Q708 107 675 75T603 21T516 -10T403 -20Q335 -20 277 1T177 66T110 176T86 334Q86 512 200 596T541 690L719 696V780Q719 849 679 882T567 915Q495 915 427 894T289
+838L190 1040Q274 1087 376 1114T590 1141Q799 1141 910 1043T1022 745V0H809ZM719 518L618 514Q557 512 515 498T448 461T411 405T399 332Q399 262 433 233T522 203Q564 203 600 217T662 260T704 330T719 426V518ZM801 1496Q750 1530 695 1573T588 1672Q534 1616
+482 1573T379 1496H176V1523Q202 1552 233 1590T297 1668T360 1749T412 1824H768Q789 1790 819 1750T881 1669T946 1590T1004 1523V1496H801Z" />
+<glyph unicode="&#xe3;" glyph-name="atilde" horiz-adv-x="1176" d="M809 0L750 152H741Q708 107 675 75T603 21T516 -10T403 -20Q335 -20 277 1T177 66T110 176T86 334Q86 512 200 596T541 690L719 696V780Q719 849 679 882T567 915Q495 915 427 894T289 838L190
+1040Q274 1087 376 1114T590 1141Q799 1141 910 1043T1022 745V0H809ZM719 518L618 514Q557 512 515 498T448 461T411 405T399 332Q399 262 433 233T522 203Q564 203 600 217T662 260T704 330T719 426V518ZM681 1346Q650 1346 632 1320T601 1239H452Q458 1319 478
+1377T530 1473T607 1529T704 1548Q745 1548 784 1532T861 1497T937 1461T1011 1444Q1042 1444 1060 1470T1091 1550H1240Q1234 1471 1214 1413T1160 1317T1084 1260T988 1241Q948 1241 908 1257T830 1293T755 1329T681 1346Z" />
+<glyph unicode="&#xe4;" glyph-name="adieresis" horiz-adv-x="1176" d="M809 0L750 152H741Q708 107 675 75T603 21T516 -10T403 -20Q335 -20 277 1T177 66T110 176T86 334Q86 512 200 596T541 690L719 696V780Q719 849 679 882T567 915Q495 915 427 894T289
+838L190 1040Q274 1087 376 1114T590 1141Q799 1141 910 1043T1022 745V0H809ZM719 518L618 514Q557 512 515 498T448 461T411 405T399 332Q399 262 433 233T522 203Q564 203 600 217T662 260T704 330T719 426V518ZM254 1405Q254 1440 265 1465T294 1507T338 1532T393
+1540Q422 1540 447 1532T492 1508T522 1466T534 1405Q534 1371 523 1346T492 1305T448 1280T393 1272Q364 1272 339 1280T295 1304T265 1346T254 1405ZM657 1405Q657 1440 668 1465T698 1507T743 1532T799 1540Q827 1540 852 1532T897 1508T928 1466T940 1405Q940
+1371 929 1346T898 1305T853 1280T799 1272Q739 1272 698 1305T657 1405Z" />
+<glyph unicode="&#xe5;" glyph-name="aring" horiz-adv-x="1176" d="M809 0L750 152H741Q708 107 675 75T603 21T516 -10T403 -20Q335 -20 277 1T177 66T110 176T86 334Q86 512 200 596T541 690L719 696V780Q719 849 679 882T567 915Q495 915 427 894T289 838L190
+1040Q274 1087 376 1114T590 1141Q799 1141 910 1043T1022 745V0H809ZM719 518L618 514Q557 512 515 498T448 461T411 405T399 332Q399 262 433 233T522 203Q564 203 600 217T662 260T704 330T719 426V518ZM842 1479Q842 1423 823 1379T769 1303T688 1256T588 1239Q533
+1239 487 1255T409 1302T358 1377T340 1477Q340 1532 358 1576T408 1650T487 1697T588 1714Q641 1714 687 1698T767 1651T822 1577T842 1479ZM684 1477Q684 1522 657 1547T588 1573Q546 1573 519 1548T492 1477Q492 1432 516 1406T588 1380Q630 1380 657 1406T684
+1477Z" />
+<glyph unicode="&#xe6;" glyph-name="ae" horiz-adv-x="1806" d="M1268 -20Q1137 -20 1030 30T854 186Q811 132 769 94T678 30T568 -8T424 -20Q356 -20 295 1T187 66T113 176T86 334Q86 512 200 596T541 690L719 696V780Q719 849 679 882T567 915Q495 915 427
+894T289 838L190 1040Q274 1087 376 1114T590 1141Q804 1141 913 1010Q1039 1139 1227 1139Q1338 1139 1427 1106T1579 1007T1674 848T1708 631V483H1026Q1028 419 1046 368T1098 281T1179 226T1288 207Q1382 207 1469 228T1645 295V59Q1605 38 1565 24T1479 -1T1382
+-15T1268 -20ZM719 518L618 514Q557 512 515 498T448 461T411 405T399 332Q399 262 433 233T522 203Q564 203 600 217T662 260T704 330T719 426V518ZM1229 922Q1147 922 1094 865T1032 686H1421Q1420 737 1408 780T1373 854T1313 904T1229 922Z" />
+<glyph unicode="&#xe7;" glyph-name="ccedilla" horiz-adv-x="1022" d="M625 -20Q505 -20 409 13T244 115T139 293T102 553Q102 720 139 832T245 1013T410 1110T625 1139Q711 1139 796 1118T956 1059L868 827Q802 856 741 874T625 893Q514 893 464 809T414 555Q414
+387 464 307T621 227Q708 227 779 249T924 307V53Q887 35 852 21T782 -2T708 -15T625 -20ZM778 -250Q778 -307 763 -352T711 -428T616 -475T469 -492Q424 -492 388 -486T323 -471V-303Q338 -307 356 -310T394 -317T432 -322T466 -324Q495 -324 516 -311T538 -262Q538
+-225 501 -197T372 -154L450 0H643L616 -61Q647 -71 676 -88T727 -128T764 -182T778 -250Z" />
+<glyph unicode="&#xe8;" glyph-name="egrave" horiz-adv-x="1190" d="M612 922Q531 922 478 865T416 686H805Q804 737 792 780T756 854T696 904T612 922ZM651 -20Q531 -20 430 15T256 120T143 298T102 551Q102 698 139 808T242 991T402 1102T610 1139Q721 1139
+810 1106T962 1007T1058 848T1092 631V483H410Q412 419 430 368T482 281T563 226T672 207Q723 207 768 212T857 229T942 256T1028 295V59Q988 38 948 24T862 -1T765 -15T651 -20ZM834 1241Q800 1269 753 1310T659 1396T575 1480T521 1548V1569H863Q879 1535 900
+1495T945 1414T992 1335T1037 1268V1241H834Z" />
+<glyph unicode="&#xe9;" glyph-name="eacute" horiz-adv-x="1190" d="M612 922Q531 922 478 865T416 686H805Q804 737 792 780T756 854T696 904T612 922ZM651 -20Q531 -20 430 15T256 120T143 298T102 551Q102 698 139 808T242 991T402 1102T610 1139Q721 1139
+810 1106T962 1007T1058 848T1092 631V483H410Q412 419 430 368T482 281T563 226T672 207Q723 207 768 212T857 229T942 256T1028 295V59Q988 38 948 24T862 -1T765 -15T651 -20ZM447 1241V1268Q468 1297 492 1335T539 1413T584 1494T621 1569H963V1548Q952 1530
+931 1506T883 1453T825 1396T763 1338T702 1285T650 1241H447Z" />
+<glyph unicode="&#xea;" glyph-name="ecircumflex" horiz-adv-x="1190" d="M612 922Q531 922 478 865T416 686H805Q804 737 792 780T756 854T696 904T612 922ZM651 -20Q531 -20 430 15T256 120T143 298T102 551Q102 698 139 808T242 991T402 1102T610 1139Q721
+1139 810 1106T962 1007T1058 848T1092 631V483H410Q412 419 430 368T482 281T563 226T672 207Q723 207 768 212T857 229T942 256T1028 295V59Q988 38 948 24T862 -1T765 -15T651 -20ZM819 1241Q768 1275 713 1318T606 1417Q552 1361 500 1318T397 1241H194V1268Q220
+1297 251 1335T315 1413T378 1494T430 1569H786Q807 1535 837 1495T899 1414T964 1335T1022 1268V1241H819Z" />
+<glyph unicode="&#xeb;" glyph-name="edieresis" horiz-adv-x="1190" d="M612 922Q531 922 478 865T416 686H805Q804 737 792 780T756 854T696 904T612 922ZM651 -20Q531 -20 430 15T256 120T143 298T102 551Q102 698 139 808T242 991T402 1102T610 1139Q721 1139
+810 1106T962 1007T1058 848T1092 631V483H410Q412 419 430 368T482 281T563 226T672 207Q723 207 768 212T857 229T942 256T1028 295V59Q988 38 948 24T862 -1T765 -15T651 -20ZM266 1405Q266 1440 277 1465T306 1507T350 1532T405 1540Q434 1540 459 1532T504
+1508T534 1466T546 1405Q546 1371 535 1346T504 1305T460 1280T405 1272Q376 1272 351 1280T307 1304T277 1346T266 1405ZM669 1405Q669 1440 680 1465T710 1507T755 1532T811 1540Q839 1540 864 1532T909 1508T940 1466T952 1405Q952 1371 941 1346T910 1305T865
+1280T811 1272Q751 1272 710 1305T669 1405Z" />
+<glyph unicode="&#xec;" glyph-name="igrave" horiz-adv-x="625" d="M465 0H160V1118H465V0ZM269 1241Q235 1269 188 1310T94 1396T10 1480T-44 1548V1569H298Q314 1535 335 1495T380 1414T427 1335T472 1268V1241H269Z" />
+<glyph unicode="&#xed;" glyph-name="iacute" horiz-adv-x="625" d="M465 0H160V1118H465V0ZM145 1241V1268Q166 1297 190 1335T237 1413T282 1494T319 1569H661V1548Q650 1530 629 1506T581 1453T523 1396T461 1338T400 1285T348 1241H145Z" />
+<glyph unicode="&#xee;" glyph-name="icircumflex" horiz-adv-x="625" d="M465 0H160V1118H465V0ZM521 1241Q470 1275 415 1318T308 1417Q254 1361 202 1318T99 1241H-104V1268Q-78 1297 -47 1335T17 1413T80 1494T132 1569H488Q509 1535 539 1495T601 1414T666
+1335T724 1268V1241H521Z" />
+<glyph unicode="&#xef;" glyph-name="idieresis" horiz-adv-x="625" d="M465 0H160V1118H465V0ZM-32 1405Q-32 1440 -21 1465T8 1507T52 1532T107 1540Q136 1540 161 1532T206 1508T236 1466T248 1405Q248 1371 237 1346T206 1305T162 1280T107 1272Q78 1272 53
+1280T9 1304T-21 1346T-32 1405ZM371 1405Q371 1440 382 1465T412 1507T457 1532T513 1540Q541 1540 566 1532T611 1508T642 1466T654 1405Q654 1371 643 1346T612 1305T567 1280T513 1272Q453 1272 412 1305T371 1405Z" />
+<glyph unicode="&#xf0;" glyph-name="eth" horiz-adv-x="1182" d="M457 1309Q423 1330 384 1354T303 1401L399 1571Q472 1537 536 1503T657 1430L883 1569L983 1415L809 1309Q881 1240 935 1162T1024 993T1078 798T1096 573Q1096 431 1060 321T957 135T795 20T582
+-20Q471 -20 378 14T218 113T112 272T74 489Q74 611 106 705T197 863T337 961T516 995Q612 995 680 964T780 883L801 885Q773 973 723 1050T606 1184L375 1040L274 1196L457 1309ZM784 532Q784 579 773 622T737 698T675 750T586 770Q478 770 432 700T385 487Q385
+424 396 372T432 283T495 226T586 205Q692 205 738 286T784 532Z" />
+<glyph unicode="&#xf1;" glyph-name="ntilde" horiz-adv-x="1284" d="M1130 0H825V653Q825 774 789 834T672 895Q612 895 572 871T509 800T475 684T465 526V0H160V1118H393L434 975H451Q475 1018 509 1049T585 1100T672 1129T766 1139Q848 1139 915 1116T1030
+1042T1104 915T1130 729V0ZM477 1346Q446 1346 428 1320T397 1239H248Q254 1319 274 1377T326 1473T403 1529T500 1548Q541 1548 580 1532T657 1497T733 1461T807 1444Q838 1444 856 1470T887 1550H1036Q1030 1471 1010 1413T956 1317T880 1260T784 1241Q744 1241
+704 1257T626 1293T551 1329T477 1346Z" />
+<glyph unicode="&#xf2;" glyph-name="ograve" horiz-adv-x="1227" d="M414 561Q414 394 461 310T614 225Q719 225 766 310T813 561Q813 728 766 810T612 893Q507 893 461 811T414 561ZM1124 561Q1124 421 1089 313T987 131T825 19T610 -20Q499 -20 406 18T246
+131T140 313T102 561Q102 700 137 808T239 989T401 1101T616 1139Q727 1139 820 1101T980 990T1086 808T1124 561ZM841 1241Q807 1269 760 1310T666 1396T582 1480T528 1548V1569H870Q886 1535 907 1495T952 1414T999 1335T1044 1268V1241H841Z" />
+<glyph unicode="&#xf3;" glyph-name="oacute" horiz-adv-x="1227" d="M414 561Q414 394 461 310T614 225Q719 225 766 310T813 561Q813 728 766 810T612 893Q507 893 461 811T414 561ZM1124 561Q1124 421 1089 313T987 131T825 19T610 -20Q499 -20 406 18T246
+131T140 313T102 561Q102 700 137 808T239 989T401 1101T616 1139Q727 1139 820 1101T980 990T1086 808T1124 561ZM434 1241V1268Q455 1297 479 1335T526 1413T571 1494T608 1569H950V1548Q939 1530 918 1506T870 1453T812 1396T750 1338T689 1285T637 1241H434Z"
+/>
+<glyph unicode="&#xf4;" glyph-name="ocircumflex" horiz-adv-x="1227" d="M414 561Q414 394 461 310T614 225Q719 225 766 310T813 561Q813 728 766 810T612 893Q507 893 461 811T414 561ZM1124 561Q1124 421 1089 313T987 131T825 19T610 -20Q499 -20 406 18T246
+131T140 313T102 561Q102 700 137 808T239 989T401 1101T616 1139Q727 1139 820 1101T980 990T1086 808T1124 561ZM821 1241Q770 1275 715 1318T608 1417Q554 1361 502 1318T399 1241H196V1268Q222 1297 253 1335T317 1413T380 1494T432 1569H788Q809 1535 839
+1495T901 1414T966 1335T1024 1268V1241H821Z" />
+<glyph unicode="&#xf5;" glyph-name="otilde" horiz-adv-x="1227" d="M414 561Q414 394 461 310T614 225Q719 225 766 310T813 561Q813 728 766 810T612 893Q507 893 461 811T414 561ZM1124 561Q1124 421 1089 313T987 131T825 19T610 -20Q499 -20 406 18T246
+131T140 313T102 561Q102 700 137 808T239 989T401 1101T616 1139Q727 1139 820 1101T980 990T1086 808T1124 561ZM444 1346Q413 1346 395 1320T364 1239H215Q221 1319 241 1377T293 1473T370 1529T467 1548Q508 1548 547 1532T624 1497T700 1461T774 1444Q805
+1444 823 1470T854 1550H1003Q997 1471 977 1413T923 1317T847 1260T751 1241Q711 1241 671 1257T593 1293T518 1329T444 1346Z" />
+<glyph unicode="&#xf6;" glyph-name="odieresis" horiz-adv-x="1227" d="M414 561Q414 394 461 310T614 225Q719 225 766 310T813 561Q813 728 766 810T612 893Q507 893 461 811T414 561ZM1124 561Q1124 421 1089 313T987 131T825 19T610 -20Q499 -20 406 18T246
+131T140 313T102 561Q102 700 137 808T239 989T401 1101T616 1139Q727 1139 820 1101T980 990T1086 808T1124 561ZM266 1405Q266 1440 277 1465T306 1507T350 1532T405 1540Q434 1540 459 1532T504 1508T534 1466T546 1405Q546 1371 535 1346T504 1305T460 1280T405
+1272Q376 1272 351 1280T307 1304T277 1346T266 1405ZM669 1405Q669 1440 680 1465T710 1507T755 1532T811 1540Q839 1540 864 1532T909 1508T940 1466T952 1405Q952 1371 941 1346T910 1305T865 1280T811 1272Q751 1272 710 1305T669 1405Z" />
+<glyph unicode="&#xf7;" glyph-name="divide" horiz-adv-x="1128" d="M88 612V831H1040V612H88ZM424 373Q424 415 435 444T465 490T509 516T563 524Q591 524 616 516T660 491T690 444T702 373Q702 333 691 304T660 257T616 230T563 221Q535 221 510 229T465 256T435
+304T424 373ZM424 1071Q424 1113 435 1142T465 1189T509 1215T563 1223Q591 1223 616 1215T660 1189T690 1142T702 1071Q702 1031 691 1003T660 956T616 929T563 920Q535 920 510 928T465 955T435 1002T424 1071Z" />
+<glyph unicode="&#xf8;" glyph-name="oslash" horiz-adv-x="1227" d="M1124 561Q1124 421 1089 313T987 131T825 19T610 -20Q553 -20 501 -10T401 18L344 -76L182 14L250 125Q181 199 142 308T102 561Q102 700 137 808T239 989T401 1101T616 1139Q678 1139 735
+1126T844 1090L893 1169L1053 1073L991 975Q1054 903 1089 799T1124 561ZM414 561Q414 475 426 410L709 868Q669 893 612 893Q507 893 461 811T414 561ZM813 561Q813 625 807 674L539 240Q556 232 574 229T614 225Q719 225 766 310T813 561Z" />
+<glyph unicode="&#xf9;" glyph-name="ugrave" horiz-adv-x="1284" d="M891 0L850 143H834Q809 100 775 70T699 19T612 -10T518 -20Q436 -20 369 3T254 77T180 204T154 389V1118H459V465Q459 344 495 284T612 223Q672 223 712 247T775 318T809 434T819 592V1118H1124V0H891ZM839
+1241Q805 1269 758 1310T664 1396T580 1480T526 1548V1569H868Q884 1535 905 1495T950 1414T997 1335T1042 1268V1241H839Z" />
+<glyph unicode="&#xfa;" glyph-name="uacute" horiz-adv-x="1284" d="M891 0L850 143H834Q809 100 775 70T699 19T612 -10T518 -20Q436 -20 369 3T254 77T180 204T154 389V1118H459V465Q459 344 495 284T612 223Q672 223 712 247T775 318T809 434T819 592V1118H1124V0H891ZM461
+1241V1268Q482 1297 506 1335T553 1413T598 1494T635 1569H977V1548Q966 1530 945 1506T897 1453T839 1396T777 1338T716 1285T664 1241H461Z" />
+<glyph unicode="&#xfb;" glyph-name="ucircumflex" horiz-adv-x="1284" d="M891 0L850 143H834Q809 100 775 70T699 19T612 -10T518 -20Q436 -20 369 3T254 77T180 204T154 389V1118H459V465Q459 344 495 284T612 223Q672 223 712 247T775 318T809 434T819 592V1118H1124V0H891ZM842
+1241Q791 1275 736 1318T629 1417Q575 1361 523 1318T420 1241H217V1268Q243 1297 274 1335T338 1413T401 1494T453 1569H809Q830 1535 860 1495T922 1414T987 1335T1045 1268V1241H842Z" />
+<glyph unicode="&#xfc;" glyph-name="udieresis" horiz-adv-x="1284" d="M891 0L850 143H834Q809 100 775 70T699 19T612 -10T518 -20Q436 -20 369 3T254 77T180 204T154 389V1118H459V465Q459 344 495 284T612 223Q672 223 712 247T775 318T809 434T819 592V1118H1124V0H891ZM295
+1405Q295 1440 306 1465T335 1507T379 1532T434 1540Q463 1540 488 1532T533 1508T563 1466T575 1405Q575 1371 564 1346T533 1305T489 1280T434 1272Q405 1272 380 1280T336 1304T306 1346T295 1405ZM698 1405Q698 1440 709 1465T739 1507T784 1532T840 1540Q868
+1540 893 1532T938 1508T969 1466T981 1405Q981 1371 970 1346T939 1305T894 1280T840 1272Q780 1272 739 1305T698 1405Z" />
+<glyph unicode="&#xfd;" glyph-name="yacute" horiz-adv-x="1104" d="M0 1118H334L514 489Q530 437 537 378T547 272H553Q555 295 558 323T567 380T578 437T592 489L768 1118H1104L662 -143Q600 -320 493 -406T225 -492Q173 -492 135 -487T70 -475V-233Q91 -238
+123 -242T190 -246Q238 -246 272 -233T330 -197T372 -140T403 -66L422 -10L0 1118ZM393 1241V1268Q414 1297 438 1335T485 1413T530 1494T567 1569H909V1548Q898 1530 877 1506T829 1453T771 1396T709 1338T648 1285T596 1241H393Z" />
+<glyph unicode="&#xfe;" glyph-name="thorn" horiz-adv-x="1245" d="M465 973Q485 1008 512 1038T576 1090T656 1126T756 1139Q842 1139 913 1102T1035 992T1114 811T1143 561Q1143 418 1115 310T1036 128T914 17T756 -20Q701 -20 656 -10T576 20T513 64T465 117H451Q454
+85 458 55Q461 29 463 3T465 -39V-492H160V1556H465V1165Q465 1141 463 1108T458 1045Q454 1010 451 973H465ZM653 895Q602 895 567 877T509 821T477 728T465 596V563Q465 482 474 419T506 314T564 249T655 227Q746 227 788 313T831 565Q831 730 789 812T653 895Z"
+/>
+<glyph unicode="&#xff;" glyph-name="ydieresis" horiz-adv-x="1104" d="M0 1118H334L514 489Q530 437 537 378T547 272H553Q555 295 558 323T567 380T578 437T592 489L768 1118H1104L662 -143Q600 -320 493 -406T225 -492Q173 -492 135 -487T70 -475V-233Q91
+-238 123 -242T190 -246Q238 -246 272 -233T330 -197T372 -140T403 -66L422 -10L0 1118ZM466 1405Q466 1440 477 1465T506 1507T550 1532T605 1540Q634 1540 659 1532T704 1508T734 1466T746 1405Q746 1371 735 1346T704 1305T660 1280T605 1272Q576 1272 551 1280T507
+1304T477 1346T466 1405ZM869 1405Q869 1440 880 1465T910 1507T955 1532T1011 1540Q1039 1540 1064 1532T1109 1508T1140 1466T1152 1405Q1152 1371 1141 1346T1110 1305T1065 1280T1011 1272Q951 1272 910 1305T869 1405Z" />
+<glyph unicode="&#x2013;" glyph-name="endash" horiz-adv-x="1024" d="M82 436V666H942V436H82Z" />
+<glyph unicode="&#x2014;" glyph-name="emdash" horiz-adv-x="2048" d="M82 436V666H1966V436H82Z" />
+<glyph unicode="&#x2018;" glyph-name="quoteleft" horiz-adv-x="440" d="M37 961L23 983Q37 1037 56 1098T99 1221T148 1344T199 1462H418Q403 1401 389 1335T361 1204T336 1076T317 961H37Z" />
+<glyph unicode="&#x2019;" glyph-name="quoteright" horiz-adv-x="440" d="M403 1462L418 1440Q404 1385 385 1325T342 1202T293 1078T242 961H23Q37 1021 51 1087T79 1219T104 1347T123 1462H403Z" />
+<glyph unicode="&#x201a;" glyph-name="quotesinglbase" horiz-adv-x="594" d="M459 215Q445 161 426 100T383 -23T334 -146T283 -264H63Q78 -203 92 -137T120 -6T145 122T164 238H444L459 215Z" />
+<glyph unicode="&#x201c;" glyph-name="quotedblleft" horiz-adv-x="907" d="M489 983Q503 1037 523 1098T566 1221T615 1344T666 1462H885Q870 1401 856 1335T828 1204T803 1076T784 961H504L489 983ZM23 983Q37 1037 56 1098T99 1221T148 1344T199 1462H418Q403
+1401 389 1335T361 1204T336 1076T317 961H37L23 983Z" />
+<glyph unicode="&#x201d;" glyph-name="quotedblright" horiz-adv-x="907" d="M418 1440Q404 1385 385 1325T342 1202T293 1078T242 961H23Q37 1021 51 1087T79 1219T104 1347T123 1462H403L418 1440ZM885 1440Q871 1385 852 1325T809 1202T760 1078T709 961H489Q504
+1021 518 1087T546 1219T571 1347T590 1462H870L885 1440Z" />
+<glyph unicode="&#x201e;" glyph-name="quotedblbase" horiz-adv-x="1061" d="M459 215Q445 161 426 100T383 -23T334 -146T283 -264H63Q78 -203 92 -137T120 -6T145 122T164 238H444L459 215ZM926 215Q912 161 893 100T850 -23T801 -146T750 -264H530Q545 -203
+559 -137T587 -6T612 122T631 238H911L926 215Z" />
+<glyph unicode="&#x2022;" glyph-name="bullet" horiz-adv-x="770" d="M98 748Q98 834 120 894T180 992T271 1047T385 1065Q444 1065 496 1048T588 992T649 894T672 748Q672 663 650 603T588 505T497 448T385 430Q324 430 272 448T181 504T120 603T98 748Z" />
+<glyph unicode="&#x2039;" glyph-name="guilsinglleft" horiz-adv-x="692" d="M82 573L391 1028L610 909L393 561L610 213L391 94L82 547V573Z" />
+<glyph unicode="&#x203a;" glyph-name="guilsinglright" horiz-adv-x="692" d="M610 547L301 94L82 213L299 561L82 909L301 1028L610 573V547Z" />
+</font>
+</defs>
+</svg>
diff --git a/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-700.ttf b/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-700.ttf
new file mode 100644
index 0000000000..15896c441f
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-700.ttf
Binary files differ
diff --git a/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-700.woff b/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-700.woff
new file mode 100644
index 0000000000..67e3e25f83
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-700.woff
Binary files differ
diff --git a/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-700.woff2 b/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-700.woff2
new file mode 100644
index 0000000000..1e726a7cfc
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-700.woff2
Binary files differ
diff --git a/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-regular.eot b/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-regular.eot
new file mode 100644
index 0000000000..ac2698e85a
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-regular.eot
Binary files differ
diff --git a/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-regular.svg b/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-regular.svg
new file mode 100644
index 0000000000..d9f2a214f9
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-regular.svg
@@ -0,0 +1,403 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg">
+<defs >
+<font id="DroidSans" horiz-adv-x="1062" ><font-face
+ font-family="Droid Sans"
+ units-per-em="2048"
+ panose-1="2 11 6 6 3 8 4 2 2 4"
+ ascent="1907"
+ descent="-492"
+ alphabetic="0" />
+<glyph unicode=" " glyph-name="space" horiz-adv-x="532" />
+<glyph unicode="!" glyph-name="exclam" horiz-adv-x="551" d="M336 414H215L164 1462H387L336 414ZM147 111Q147 149 157 175T184 218T224 242T274 250Q300 250 323 243T364 219T391 176T401 111Q401 74 391 48T364 4T324 -21T274 -29Q247 -29 224 -21T184 4T157
+47T147 111Z" />
+<glyph unicode="&quot;" glyph-name="quotedbl" horiz-adv-x="823" d="M330 1462L289 934H174L133 1462H330ZM690 1462L649 934H535L494 1462H690Z" />
+<glyph unicode="#" glyph-name="numbersign" horiz-adv-x="1323" d="M983 893L920 565H1200V428H893L811 0H664L748 428H457L375 0H231L309 428H51V565H336L401 893H127V1030H426L508 1462H655L573 1030H866L950 1462H1094L1010 1030H1272V893H983ZM483 565H774L838
+893H547L483 565Z" />
+<glyph unicode="$" glyph-name="dollar" horiz-adv-x="1128" d="M985 446Q985 376 960 319T889 220T776 151T625 111V-119H487V102Q437 102 386 106T287 120T197 142T123 172V344Q156 328 199 312T291 282T389 261T487 252V686Q398 716 333 749T224 824T160 922T139
+1051Q139 1118 163 1173T233 1270T343 1338T487 1374V1554H625V1378Q725 1373 809 1352T961 1300L895 1155Q839 1180 769 1200T625 1227V805Q713 774 780 741T893 667T962 572T985 446ZM809 446Q809 479 799 506T768 556T711 598T625 635V262Q718 276 763 325T809
+446ZM315 1049Q315 1013 323 985T352 933T405 890T487 854V1223Q398 1207 357 1163T315 1049Z" />
+<glyph unicode="%" glyph-name="percent" horiz-adv-x="1690" d="M250 1026Q250 861 285 779T401 696Q557 696 557 1026Q557 1354 401 1354Q321 1354 286 1273T250 1026ZM705 1026Q705 918 687 832T632 687T538 597T401 565Q328 565 272 596T178 687T121 832T102
+1026Q102 1134 119 1219T173 1362T266 1452T401 1483Q476 1483 532 1452T627 1363T685 1219T705 1026ZM1133 440Q1133 275 1168 193T1284 111Q1440 111 1440 440Q1440 768 1284 768Q1204 768 1169 687T1133 440ZM1587 440Q1587 332 1570 247T1515 102T1421 12T1284
+-20Q1210 -20 1154 11T1061 102T1004 246T985 440Q985 548 1002 633T1056 776T1149 866T1284 897Q1359 897 1415 866T1510 777T1567 633T1587 440ZM1331 1462L520 0H362L1174 1462H1331Z" />
+<glyph unicode="&amp;" glyph-name="ampersand" horiz-adv-x="1438" d="M422 1165Q422 1131 430 1099T454 1034T497 968T559 897Q618 932 661 963T732 1026T774 1093T788 1169Q788 1205 776 1235T740 1288T683 1322T608 1335Q522 1335 472 1291T422 1165ZM557
+141Q615 141 664 152T755 184T833 231T901 289L514 696Q462 663 422 632T355 564T313 486T299 387Q299 333 316 288T367 210T448 159T557 141ZM109 381Q109 459 129 520T187 631T281 724T408 809Q377 845 347 883T295 965T258 1058T244 1165Q244 1240 269 1299T341
+1400T457 1463T614 1485Q697 1485 762 1464T873 1401T943 1300T967 1165Q967 1101 942 1047T875 946T779 860T664 784L1016 412Q1043 441 1064 471T1103 535T1133 608T1157 694H1341Q1326 628 1306 573T1259 468T1200 377T1128 293L1405 0H1180L1012 172Q963 127
+915 92T813 32T697 -6T557 -20Q452 -20 369 6T228 84T140 210T109 381Z" />
+<glyph unicode="&apos;" glyph-name="quotesingle" horiz-adv-x="463" d="M330 1462L289 934H174L133 1462H330Z" />
+<glyph unicode="(" glyph-name="parenleft" horiz-adv-x="616" d="M82 561Q82 686 100 807T155 1043T248 1263T383 1462H555Q415 1269 343 1038T270 563Q270 444 288 326T342 95T431 -124T553 -324H383Q305 -234 249 -131T155 84T100 317T82 561Z" />
+<glyph unicode=")" glyph-name="parenright" horiz-adv-x="616" d="M535 561Q535 437 517 317T462 85T368 -131T233 -324H63Q132 -230 185 -124T274 95T328 326T346 563Q346 807 274 1038T61 1462H233Q311 1369 367 1264T461 1044T517 808T535 561Z" />
+<glyph unicode="*" glyph-name="asterisk" horiz-adv-x="1128" d="M664 1556L621 1163L1018 1274L1044 1081L666 1053L911 727L733 631L557 989L399 631L215 727L457 1053L82 1081L111 1274L502 1163L459 1556H664Z" />
+<glyph unicode="+" glyph-name="plus" horiz-adv-x="1128" d="M489 647H102V797H489V1186H639V797H1026V647H639V262H489V647Z" />
+<glyph unicode="," glyph-name="comma" horiz-adv-x="512" d="M362 238L377 215Q363 161 344 100T301 -23T252 -146T201 -264H63Q78 -203 92 -137T120 -6T145 122T164 238H362Z" />
+<glyph unicode="-" glyph-name="hyphen" horiz-adv-x="659" d="M82 465V633H578V465H82Z" />
+<glyph unicode="." glyph-name="period" horiz-adv-x="549" d="M147 111Q147 149 157 175T184 218T224 242T274 250Q300 250 323 243T364 219T391 176T401 111Q401 74 391 48T364 4T324 -21T274 -29Q247 -29 224 -21T184 4T157 47T147 111Z" />
+<glyph unicode="/" glyph-name="slash" horiz-adv-x="764" d="M743 1462L199 0H20L565 1462H743Z" />
+<glyph unicode="0" glyph-name="zero" horiz-adv-x="1128" d="M1032 733Q1032 556 1007 416T925 179T779 31T563 -20Q445 -20 358 31T213 179T127 416T98 733Q98 910 123 1050T204 1286T348 1434T563 1485Q682 1485 770 1435T916 1288T1003 1051T1032 733ZM283
+733Q283 583 298 471T346 285T432 173T563 135Q640 135 694 172T782 283T832 469T848 733Q848 883 833 995T783 1181T694 1292T563 1329Q486 1329 433 1292T346 1181T298 995T283 733Z" />
+<glyph unicode="1" glyph-name="one" horiz-adv-x="1128" d="M711 0H535V913Q535 956 535 1005T537 1102T540 1195T543 1274Q526 1256 513 1243T487 1218T458 1193T422 1161L274 1040L178 1163L561 1462H711V0Z" />
+<glyph unicode="2" glyph-name="two" horiz-adv-x="1128" d="M1008 0H96V156L446 537Q521 618 580 685T680 816T744 944T766 1085Q766 1144 749 1189T701 1265T626 1313T530 1329Q435 1329 359 1291T213 1192L111 1311Q151 1347 197 1378T296 1433T408 1469T532
+1483Q628 1483 705 1456T837 1379T920 1256T950 1092Q950 1007 924 930T851 779T740 629T600 473L319 174V166H1008V0Z" />
+<glyph unicode="3" glyph-name="three" horiz-adv-x="1128" d="M961 1120Q961 1047 938 987T874 883T774 811T645 770V764Q822 742 914 652T1006 416Q1006 320 974 240T875 102T708 12T469 -20Q360 -20 264 -3T82 59V229Q169 183 270 158T465 133Q557 133 624
+153T734 210T798 301T819 422Q819 490 793 538T717 618T598 665T438 680H305V831H438Q519 831 582 851T687 908T752 996T774 1108Q774 1160 756 1201T705 1270T626 1314T524 1329Q417 1329 336 1296T180 1208L88 1333Q126 1364 172 1391T274 1438T391 1471T524
+1483Q632 1483 713 1456T850 1381T933 1266T961 1120Z" />
+<glyph unicode="4" glyph-name="four" horiz-adv-x="1128" d="M1087 328H874V0H698V328H23V487L686 1470H874V494H1087V328ZM698 494V850Q698 906 699 967T703 1087T707 1197T711 1282H702Q695 1262 685 1238T662 1189T636 1141T612 1102L201 494H698Z" />
+<glyph unicode="5" glyph-name="five" horiz-adv-x="1128" d="M545 897Q644 897 729 870T878 788T978 654T1014 469Q1014 355 980 264T879 110T714 14T487 -20Q436 -20 387 -15T292 -1T205 24T131 59V231Q164 208 208 190T302 160T400 142T492 135Q571 135 633
+153T738 211T804 309T827 449Q827 592 739 667T483 743Q456 743 425 741T362 734T302 726T252 717L162 774L217 1462H907V1296H375L336 877Q368 883 420 890T545 897Z" />
+<glyph unicode="6" glyph-name="six" horiz-adv-x="1128" d="M113 625Q113 730 123 834T160 1033T233 1211T350 1353T520 1448T752 1483Q771 1483 794 1482T840 1479T885 1473T924 1464V1309Q889 1321 845 1327T758 1333Q668 1333 600 1312T481 1251T398 1158T343
+1039T312 899T299 745H311Q331 781 359 812T426 866T511 902T618 915Q713 915 790 886T921 799T1004 660T1034 471Q1034 357 1003 266T914 112T774 14T590 -20Q490 -20 403 19T251 138T150 339T113 625ZM588 133Q648 133 697 153T783 215T838 320T858 471Q858 541
+842 596T792 691T710 751T594 772Q527 772 472 749T377 688T317 602T295 506Q295 439 313 373T368 253T460 167T588 133Z" />
+<glyph unicode="7" glyph-name="seven" horiz-adv-x="1128" d="M281 0L844 1296H90V1462H1030V1317L475 0H281Z" />
+<glyph unicode="8" glyph-name="eight" horiz-adv-x="1128" d="M565 1485Q649 1485 723 1463T854 1397T944 1287T977 1133Q977 1066 957 1012T902 915T819 837T715 774Q773 743 828 705T927 620T997 513T1024 381Q1024 289 991 215T897 88T752 8T565 -20Q455 -20
+370 7T226 84T137 208T106 373Q106 448 128 508T189 616T279 701T389 766Q340 797 297 833T223 915T173 1014T154 1135Q154 1222 187 1287T278 1397T409 1463T565 1485ZM285 371Q285 318 301 274T351 198T437 149T561 131Q631 131 684 148T774 198T828 277T846
+379Q846 431 827 473T771 551T683 619T569 682L539 696Q413 636 349 559T285 371ZM563 1333Q457 1333 395 1280T332 1126Q332 1069 349 1028T398 955T472 898T567 848Q615 870 657 896T731 955T781 1030T799 1126Q799 1227 736 1280T563 1333Z" />
+<glyph unicode="9" glyph-name="nine" horiz-adv-x="1128" d="M1028 838Q1028 733 1018 629T981 429T908 252T791 109T621 15T389 -20Q370 -20 347 -19T301 -16T256 -10T217 -2V154Q252 141 296 135T383 129Q518 129 605 176T743 303T815 491T842 717H829Q809
+681 781 650T715 596T629 560T522 547Q427 547 350 576T219 663T136 802T106 991Q106 1105 137 1196T226 1351T366 1449T551 1483Q652 1483 739 1444T890 1325T991 1124T1028 838ZM553 1329Q493 1329 444 1309T358 1247T303 1142T283 991Q283 921 299 866T349 771T431
+711T547 690Q615 690 670 713T764 774T824 860T846 956Q846 1023 828 1089T773 1209T681 1296T553 1329Z" />
+<glyph unicode=":" glyph-name="colon" horiz-adv-x="549" d="M147 111Q147 149 157 175T184 218T224 242T274 250Q300 250 323 243T364 219T391 176T401 111Q401 74 391 48T364 4T324 -21T274 -29Q247 -29 224 -21T184 4T157 47T147 111ZM147 987Q147 1026 157
+1052T184 1095T224 1119T274 1126Q300 1126 323 1119T364 1096T391 1053T401 987Q401 950 391 924T364 881T324 856T274 848Q247 848 224 856T184 881T157 924T147 987Z" />
+<glyph unicode=";" glyph-name="semicolon" horiz-adv-x="549" d="M362 238L377 215Q363 161 344 100T301 -23T252 -146T201 -264H63Q78 -203 92 -137T120 -6T145 122T164 238H362ZM147 987Q147 1026 157 1052T184 1095T224 1119T274 1126Q300 1126 323 1119T364
+1096T391 1053T401 987Q401 950 391 924T364 881T324 856T274 848Q247 848 224 856T184 881T157 924T147 987Z" />
+<glyph unicode="&lt;" glyph-name="less" horiz-adv-x="1128" d="M1026 238L102 662V764L1026 1245V1085L291 721L1026 399V238Z" />
+<glyph unicode="=" glyph-name="equal" horiz-adv-x="1128" d="M102 852V1001H1026V852H102ZM102 442V592H1026V442H102Z" />
+<glyph unicode="&gt;" glyph-name="greater" horiz-adv-x="1128" d="M102 399L838 721L102 1085V1245L1026 764V662L102 238V399Z" />
+<glyph unicode="?" glyph-name="question" horiz-adv-x="872" d="M281 414V451Q281 508 288 554T315 640T368 718T451 799Q499 840 533 873T588 941T620 1015T631 1108Q631 1156 616 1195T573 1263T502 1307T403 1323Q320 1323 245 1297T100 1237L37 1382Q118
+1424 212 1453T403 1483Q496 1483 570 1458T697 1384T777 1267T805 1110Q805 1043 792 991T751 893T684 806T590 717Q538 672 505 639T453 574T427 509T420 432V414H281ZM233 111Q233 149 243 175T270 218T310 242T360 250Q386 250 409 243T450 219T477 176T487
+111Q487 74 477 48T450 4T410 -21T360 -29Q333 -29 310 -21T270 4T243 47T233 111Z" />
+<glyph unicode="@" glyph-name="at" horiz-adv-x="1774" d="M1665 731Q1665 669 1656 607T1628 488T1581 383T1514 298T1428 242T1321 221Q1276 221 1240 236T1177 276T1135 333T1112 401H1108Q1090 364 1063 331T1001 274T921 235T823 221Q746 221 687 249T586
+327T524 449T502 606Q502 707 531 791T616 936T751 1031T928 1065Q973 1065 1018 1061T1104 1050T1179 1035T1237 1018L1214 602Q1213 580 1213 567T1212 545T1212 533T1212 526Q1212 473 1222 439T1250 385T1288 358T1333 350Q1379 350 1414 380T1472 463T1508
+585T1520 733Q1520 875 1477 985T1358 1172T1178 1287T950 1327Q781 1327 652 1272T436 1117T303 881T258 582Q258 431 297 314T413 117T603 -4T864 -45Q925 -45 984 -38T1099 -19T1205 8T1298 41V-100Q1212 -138 1104 -160T866 -182Q687 -182 547 -131T309 17T160
+255T109 575Q109 763 168 925T336 1207T601 1394T950 1462Q1106 1462 1237 1412T1463 1267T1612 1037T1665 731ZM662 602Q662 469 712 410T848 350Q903 350 942 372T1006 436T1044 535T1061 662L1075 915Q1047 923 1009 929T928 936Q854 936 804 907T722 831T676
+724T662 602Z" />
+<glyph unicode="A" glyph-name="A" horiz-adv-x="1245" d="M1055 0L895 453H350L188 0H0L537 1468H707L1245 0H1055ZM836 618L688 1042Q682 1060 674 1086T656 1142T638 1204T621 1268Q614 1237 605 1204T587 1141T570 1085T555 1042L410 618H836Z" />
+<glyph unicode="B" glyph-name="B" horiz-adv-x="1272" d="M199 1462H598Q726 1462 823 1443T986 1380T1085 1266T1118 1092Q1118 1030 1099 976T1042 881T951 813T827 776V766Q896 754 956 732T1062 670T1133 570T1159 424Q1159 324 1127 246T1033 113T883 29T684
+0H199V1462ZM385 842H629Q713 842 770 857T862 901T912 975T928 1079Q928 1199 851 1251T608 1303H385V842ZM385 686V158H651Q739 158 798 178T894 234T947 320T963 432Q963 488 947 535T893 615T793 667T639 686H385Z" />
+<glyph unicode="C" glyph-name="C" horiz-adv-x="1235" d="M793 1319Q686 1319 599 1279T451 1162T356 977T322 731Q322 590 351 481T440 296T587 182T793 143Q882 143 962 160T1120 201V39Q1081 24 1042 13T961 -6T870 -16T762 -20Q598 -20 478 34T280 187T163
+425T125 733Q125 899 168 1037T296 1274T506 1428T793 1483Q901 1483 999 1461T1176 1397L1098 1241Q1035 1273 961 1296T793 1319Z" />
+<glyph unicode="D" glyph-name="D" horiz-adv-x="1401" d="M1276 745Q1276 560 1228 421T1089 188T866 47T565 0H199V1462H606Q759 1462 883 1416T1094 1280T1228 1055T1276 745ZM1079 739Q1079 885 1046 991T950 1167T795 1269T586 1303H385V160H547Q811 160
+945 306T1079 739Z" />
+<glyph unicode="E" glyph-name="E" horiz-adv-x="1081" d="M958 0H199V1462H958V1298H385V846H920V684H385V164H958V0Z" />
+<glyph unicode="F" glyph-name="F" horiz-adv-x="1006" d="M385 0H199V1462H958V1298H385V782H920V618H385V0Z" />
+<glyph unicode="G" glyph-name="G" horiz-adv-x="1413" d="M782 772H1266V55Q1211 37 1155 23T1040 0T916 -15T776 -20Q619 -20 498 32T294 182T168 419T125 733Q125 905 172 1044T311 1280T535 1430T840 1483Q951 1483 1053 1461T1243 1397L1171 1235Q1135 1252
+1094 1267T1008 1293T918 1312T825 1319Q703 1319 609 1279T452 1162T355 977T322 731Q322 601 349 493T437 307T592 186T821 143Q865 143 901 145T969 152T1027 161T1081 172V608H782V772Z" />
+<glyph unicode="H" glyph-name="H" horiz-adv-x="1436" d="M1237 0H1051V682H385V0H199V1462H385V846H1051V1462H1237V0Z" />
+<glyph unicode="I" glyph-name="I" horiz-adv-x="694" d="M612 0H82V102L254 143V1319L82 1360V1462H612V1360L440 1319V143L612 102V0Z" />
+<glyph unicode="J" glyph-name="J" horiz-adv-x="555" d="M-29 -389Q-80 -389 -118 -383T-184 -365V-205Q-150 -214 -111 -219T-27 -225Q10 -225 47 -216T115 -181T165 -112T184 0V1462H371V20Q371 -85 342 -162T260 -289T134 -364T-29 -389Z" />
+<glyph unicode="K" glyph-name="K" horiz-adv-x="1186" d="M1186 0H975L524 698L385 584V0H199V1462H385V731L506 899L958 1462H1167L647 825L1186 0Z" />
+<glyph unicode="L" glyph-name="L" horiz-adv-x="1006" d="M199 0V1462H385V166H958V0H199Z" />
+<glyph unicode="M" glyph-name="M" horiz-adv-x="1782" d="M803 0L360 1280H352Q358 1206 362 1133Q366 1070 368 1001T371 874V0H199V1462H475L887 270H893L1307 1462H1583V0H1397V887Q1397 939 1399 1006T1404 1134Q1408 1205 1411 1278H1403L956 0H803Z" />
+<glyph unicode="N" glyph-name="N" horiz-adv-x="1493" d="M1294 0H1079L360 1210H352Q358 1133 362 1057Q366 992 368 921T371 793V0H199V1462H412L1128 258H1135Q1132 334 1128 408Q1127 440 1126 473T1123 540T1121 605T1120 662V1462H1294V0Z" />
+<glyph unicode="O" glyph-name="O" horiz-adv-x="1520" d="M1393 733Q1393 564 1353 425T1232 187T1034 34T760 -20Q597 -20 478 34T280 187T163 425T125 735Q125 905 163 1043T280 1280T479 1431T762 1485Q917 1485 1034 1432T1232 1280T1352 1043T1393 733ZM322
+733Q322 596 348 487T427 301T563 184T760 143Q874 143 956 183T1092 300T1171 486T1196 733Q1196 871 1171 980T1093 1164T958 1280T762 1321Q648 1321 565 1281T428 1165T348 980T322 733Z" />
+<glyph unicode="P" glyph-name="P" horiz-adv-x="1180" d="M1075 1034Q1075 943 1048 859T957 711T791 608T535 569H385V0H199V1462H561Q695 1462 792 1434T952 1351T1045 1216T1075 1034ZM385 727H514Q607 727 676 743T791 794T860 886T883 1024Q883 1166 801
+1234T545 1303H385V727Z" />
+<glyph unicode="Q" glyph-name="Q" horiz-adv-x="1518" d="M1393 733Q1393 602 1369 489T1297 286T1178 129T1014 25Q1057 -69 1125 -140T1284 -272L1163 -414Q1060 -341 974 -242T836 -16Q819 -18 799 -19T760 -20Q597 -20 478 34T280 187T163 425T125 735Q125
+905 163 1043T280 1280T479 1431T762 1485Q917 1485 1034 1432T1232 1280T1352 1043T1393 733ZM322 733Q322 596 348 487T427 301T563 184T760 143Q874 143 956 183T1092 300T1171 486T1196 733Q1196 871 1171 980T1093 1164T958 1280T762 1321Q648 1321 565 1281T428
+1165T348 980T322 733Z" />
+<glyph unicode="R" glyph-name="R" horiz-adv-x="1208" d="M385 604V0H199V1462H555Q821 1462 948 1359T1075 1047Q1075 960 1051 895T986 784T893 706T786 655L1184 0H965L614 604H385ZM385 762H549Q639 762 702 779T805 831T864 917T883 1038Q883 1110 863 1160T801
+1242T696 1288T545 1303H385V762Z" />
+<glyph unicode="S" glyph-name="S" horiz-adv-x="1063" d="M969 391Q969 294 935 218T836 88T680 8T473 -20Q362 -20 266 -3T104 49V227Q138 211 181 196T273 168T372 149T473 141Q633 141 709 201T786 373Q786 427 772 467T721 540T623 605T469 674Q380 709 315
+750T207 844T144 962T123 1112Q123 1200 155 1269T245 1385T383 1458T561 1483Q680 1483 775 1461T944 1403L877 1247Q812 1276 730 1297T559 1319Q437 1319 370 1263T303 1110Q303 1053 318 1012T368 937T460 874T602 811Q693 775 761 737T876 651T945 540T969
+391Z" />
+<glyph unicode="T" glyph-name="T" horiz-adv-x="1063" d="M625 0H438V1298H20V1462H1042V1298H625V0Z" />
+<glyph unicode="U" glyph-name="U" horiz-adv-x="1430" d="M1245 1464V516Q1245 402 1212 304T1113 134T946 21T709 -20Q581 -20 483 18T319 128T218 298T184 520V1462H371V510Q371 335 457 239T719 143Q808 143 872 170T977 246T1038 363T1059 512V1464H1245Z" />
+<glyph unicode="V" glyph-name="V" horiz-adv-x="1163" d="M965 1462H1163L674 0H487L0 1462H197L492 535Q521 444 542 360T580 201Q595 275 618 359T672 541L965 1462Z" />
+<glyph unicode="W" glyph-name="W" horiz-adv-x="1810" d="M809 1462H1006L1235 606Q1250 550 1264 494T1291 386T1313 286T1329 201Q1333 239 1339 284T1353 378T1370 479T1391 580L1591 1462H1790L1423 0H1235L981 938Q967 989 954 1043T930 1144Q918 1199 907
+1251Q896 1200 885 1145Q875 1098 863 1042T836 932L594 0H406L20 1462H217L440 573Q452 527 462 478T480 379T496 285T508 201Q513 238 520 287T538 390T559 499T584 604L809 1462Z" />
+<glyph unicode="X" glyph-name="X" horiz-adv-x="1120" d="M1120 0H909L555 635L188 0H0L453 764L31 1462H229L561 903L895 1462H1085L664 770L1120 0Z" />
+<glyph unicode="Y" glyph-name="Y" horiz-adv-x="1079" d="M539 723L879 1462H1079L633 569V0H446V559L0 1462H203L539 723Z" />
+<glyph unicode="Z" glyph-name="Z" horiz-adv-x="1104" d="M1022 0H82V145L793 1296H102V1462H1001V1317L291 166H1022V0Z" />
+<glyph unicode="[" glyph-name="bracketleft" horiz-adv-x="621" d="M569 -324H164V1462H569V1313H346V-174H569V-324Z" />
+<glyph unicode="\" glyph-name="backslash" horiz-adv-x="764" d="M201 1462L745 0H567L23 1462H201Z" />
+<glyph unicode="]" glyph-name="bracketright" horiz-adv-x="621" d="M51 -174H274V1313H51V1462H457V-324H51V-174Z" />
+<glyph unicode="^" glyph-name="asciicircum" horiz-adv-x="1090" d="M41 549L500 1473H602L1049 549H888L551 1284L202 549H41Z" />
+<glyph unicode="_" glyph-name="underscore" horiz-adv-x="842" d="M846 -324H-4V-184H846V-324Z" />
+<glyph unicode="`" glyph-name="grave" horiz-adv-x="1182" d="M786 1241H666Q631 1269 590 1310T511 1396T441 1480T393 1548V1569H612Q628 1535 649 1495T694 1414T741 1335T786 1268V1241Z" />
+<glyph unicode="a" glyph-name="a" horiz-adv-x="1087" d="M793 0L756 152H748Q715 107 682 75T610 21T523 -10T412 -20Q343 -20 285 -1T185 59T118 161T94 307Q94 471 209 559T561 655L745 662V731Q745 798 731 843T689 915T621 955T528 967Q445 967 374 943T236
+885L172 1022Q246 1062 337 1090T528 1118Q630 1118 704 1098T827 1033T900 919T924 752V0H793ZM459 127Q520 127 572 146T662 203T721 300T743 438V537L600 530Q510 526 449 510T352 466T299 397T283 305Q283 213 331 170T459 127Z" />
+<glyph unicode="b" glyph-name="b" horiz-adv-x="1200" d="M670 1118Q764 1118 841 1082T972 975T1057 797T1087 551Q1087 410 1057 304T973 125T841 17T670 -20Q611 -20 563 -7T477 27T409 78T356 139H344L307 0H174V1556H356V1180Q356 1145 355 1106T352 1032Q350
+992 348 954H356Q379 989 408 1019T475 1071T562 1105T670 1118ZM635 967Q555 967 502 942T416 864T370 734T356 551Q356 450 369 372T415 240T502 159T637 131Q772 131 835 240T899 553Q899 761 836 864T635 967Z" />
+<glyph unicode="c" glyph-name="c" horiz-adv-x="948" d="M594 -20Q493 -20 405 11T252 111T150 286T113 543Q113 700 151 809T255 987T411 1087T602 1118Q680 1118 754 1101T879 1059L825 905Q802 915 774 924T716 941T657 953T602 958Q445 958 373 858T301 545Q301
+334 373 237T594 139Q675 139 740 157T860 201V39Q806 10 745 -5T594 -20Z" />
+<glyph unicode="d" glyph-name="d" horiz-adv-x="1200" d="M852 147H844Q822 113 793 83T725 29T638 -7T530 -20Q437 -20 360 16T228 123T143 301T113 547Q113 688 143 794T228 973T360 1081T530 1118Q589 1118 637 1105T723 1070T792 1019T844 958H856Q853 992
+850 1023Q848 1049 846 1076T844 1120V1556H1026V0H879L852 147ZM565 131Q641 131 693 154T778 224T826 341T844 506V547Q844 648 831 726T785 858T698 939T563 967Q428 967 365 858T301 545Q301 336 364 234T565 131Z" />
+<glyph unicode="e" glyph-name="e" horiz-adv-x="1096" d="M608 -20Q498 -20 407 17T251 125T149 301T113 541Q113 677 146 784T239 965T382 1079T567 1118Q666 1118 745 1083T879 983T963 828T993 627V514H301Q306 321 382 230T610 139Q661 139 704 144T788 158T867
+182T944 215V53Q904 34 866 20T787 -3T703 -16T608 -20ZM563 967Q449 967 383 889T305 662H797Q797 730 784 786T742 883T669 945T563 967Z" />
+<glyph unicode="f" glyph-name="f" horiz-adv-x="674" d="M651 961H406V0H223V961H29V1036L223 1104V1200Q223 1307 245 1377T310 1490T415 1549T555 1567Q614 1567 663 1556T752 1530L705 1389Q674 1400 638 1408T561 1417Q521 1417 492 1408T444 1374T416 1309T406
+1202V1098H651V961Z" />
+<glyph unicode="g" glyph-name="g" horiz-adv-x="1061" d="M1020 1098V985L823 958Q851 923 870 869T889 745Q889 669 866 605T795 493T677 420T514 393Q492 393 470 393T434 397Q417 387 401 375T371 346T349 310T340 266Q340 239 352 223T384 197T433 185T492
+182H668Q761 182 825 159T929 95T988 1T1006 -115Q1006 -203 974 -273T874 -391T705 -466T463 -492Q356 -492 276 -471T143 -410T64 -314T37 -186Q37 -126 56 -81T109 -2T185 52T276 84Q234 103 207 144T180 238Q180 299 212 343T313 430Q270 448 235 479T175 551T137
+640T123 739Q123 828 148 898T222 1017T344 1092T514 1118Q551 1118 590 1113T657 1098H1020ZM209 -180Q209 -217 222 -249T264 -304T342 -340T463 -354Q649 -354 741 -297T834 -131Q834 -85 822 -56T783 -11T710 12T600 18H424Q389 18 351 10T282 -20T230 -80T209
+-180ZM301 745Q301 630 355 574T508 518Q608 518 659 573T711 748Q711 871 659 929T506 987Q407 987 354 927T301 745Z" />
+<glyph unicode="h" glyph-name="h" horiz-adv-x="1206" d="M860 0V707Q860 837 808 902T643 967Q562 967 507 941T419 864T371 739T356 569V0H174V1556H356V1094L348 950H358Q383 993 417 1024T493 1077T580 1108T674 1118Q857 1118 949 1023T1042 717V0H860Z" />
+<glyph unicode="i" glyph-name="i" horiz-adv-x="530" d="M356 0H174V1098H356V0ZM160 1395Q160 1455 190 1482T266 1509Q288 1509 307 1503T341 1482T364 1447T373 1395Q373 1337 342 1309T266 1280Q221 1280 191 1308T160 1395Z" />
+<glyph unicode="j" glyph-name="j" horiz-adv-x="530" d="M66 -492Q18 -492 -13 -485T-68 -467V-319Q-42 -329 -15 -334T47 -340Q74 -340 97 -333T137 -306T164 -254T174 -170V1098H356V-158Q356 -235 339 -296T286 -401T196 -468T66 -492ZM160 1395Q160 1455
+190 1482T266 1509Q288 1509 307 1503T341 1482T364 1447T373 1395Q373 1337 342 1309T266 1280Q221 1280 191 1308T160 1395Z" />
+<glyph unicode="k" glyph-name="k" horiz-adv-x="1016" d="M342 567L477 737L770 1098H981L580 623L1008 0H799L463 504L354 422V0H174V1556H354V842L338 567H342Z" />
+<glyph unicode="l" glyph-name="l" horiz-adv-x="530" d="M356 0H174V1556H356V0Z" />
+<glyph unicode="m" glyph-name="m" horiz-adv-x="1835" d="M1489 0V707Q1489 837 1439 902T1284 967Q1211 967 1160 944T1077 875T1029 762T1014 606V0H831V707Q831 837 782 902T627 967Q550 967 498 941T415 864T370 739T356 569V0H174V1098H322L348 950H358Q382
+993 415 1024T487 1077T571 1108T662 1118Q782 1118 861 1074T979 936H987Q1013 983 1049 1017T1129 1073T1221 1107T1319 1118Q1494 1118 1582 1023T1671 717V0H1489Z" />
+<glyph unicode="n" glyph-name="n" horiz-adv-x="1206" d="M860 0V707Q860 837 808 902T643 967Q562 967 507 941T419 864T371 739T356 569V0H174V1098H322L348 950H358Q383 993 417 1024T493 1077T580 1108T674 1118Q857 1118 949 1023T1042 717V0H860Z" />
+<glyph unicode="o" glyph-name="o" horiz-adv-x="1182" d="M1069 551Q1069 414 1036 308T940 129T788 18T588 -20Q485 -20 398 18T248 128T149 307T113 551Q113 687 146 792T242 970T393 1080T594 1118Q697 1118 784 1081T934 971T1033 793T1069 551ZM301 551Q301
+342 369 237T592 131Q746 131 813 236T881 551Q881 760 813 863T590 967Q436 967 369 864T301 551Z" />
+<glyph unicode="p" glyph-name="p" horiz-adv-x="1200" d="M670 -20Q611 -20 563 -7T477 27T409 78T356 139H344Q347 105 350 74Q352 48 354 21T356 -23V-492H174V1098H322L348 950H356Q379 985 408 1015T475 1068T562 1104T670 1118Q764 1118 841 1082T972 975T1057
+797T1087 551Q1087 410 1057 304T973 125T841 17T670 -20ZM635 967Q559 967 507 944T422 874T374 757T356 592V551Q356 450 369 372T415 240T502 159T637 131Q772 131 835 240T899 553Q899 761 836 864T635 967Z" />
+<glyph unicode="q" glyph-name="q" horiz-adv-x="1200" d="M565 131Q641 131 693 154T778 224T826 341T844 506V547Q844 648 831 726T785 858T698 939T563 967Q428 967 365 858T301 545Q301 336 364 234T565 131ZM530 -20Q437 -20 360 16T228 123T143 301T113
+547Q113 688 143 794T228 973T360 1081T530 1118Q589 1118 637 1105T723 1069T791 1016T844 950H852L879 1098H1026V-492H844V-23Q844 -4 846 25T850 81Q853 113 856 147H844Q822 113 793 83T725 29T638 -7T530 -20Z" />
+<glyph unicode="r" glyph-name="r" horiz-adv-x="817" d="M649 1118Q678 1118 714 1116T776 1108L752 940Q724 945 695 948T639 952Q576 952 524 927T435 854T377 740T356 592V0H174V1098H322L344 897H352Q377 940 405 980T469 1050T549 1099T649 1118Z" />
+<glyph unicode="s" glyph-name="s" horiz-adv-x="924" d="M831 301Q831 221 802 161T719 61T587 0T414 -20Q305 -20 227 -3T90 49V215Q121 199 159 184T239 156T325 137T414 129Q479 129 524 140T598 171T640 221T653 287Q653 318 643 343T607 392T534 442T416
+498Q344 529 287 559T189 626T128 711T106 827Q106 897 133 951T211 1043T331 1099T487 1118Q584 1118 664 1097T817 1042L754 895Q689 924 621 945T481 967Q379 967 330 934T281 838Q281 803 292 777T332 728T407 682T524 629Q596 599 652 569T749 502T810 416T831
+301Z" />
+<glyph unicode="t" glyph-name="t" horiz-adv-x="694" d="M506 129Q524 129 546 131T590 136T628 143T655 150V12Q642 6 622 0T578 -10T528 -17T477 -20Q415 -20 362 -4T271 51T210 156T188 324V961H33V1042L188 1120L266 1350H371V1098H647V961H371V324Q371 227
+402 178T506 129Z" />
+<glyph unicode="u" glyph-name="u" horiz-adv-x="1206" d="M885 0L858 147H848Q823 104 789 73T713 21T626 -10T532 -20Q441 -20 372 3T257 75T188 200T164 381V1098H346V391Q346 261 399 196T563 131Q644 131 699 157T787 233T835 358T850 528V1098H1032V0H885Z" />
+<glyph unicode="v" glyph-name="v" horiz-adv-x="981" d="M375 0L0 1098H188L387 487Q398 454 413 402T443 296T470 194T487 121H494Q499 146 511 194T538 296T568 402T594 487L793 1098H981L606 0H375Z" />
+<glyph unicode="w" glyph-name="w" horiz-adv-x="1528" d="M1008 0L840 616Q836 634 830 656T818 704T806 755T793 806Q779 864 764 926H758Q744 863 731 805Q720 755 708 702T684 612L512 0H301L20 1098H211L342 514Q352 469 362 417T381 313T397 216T408 141H414Q419
+167 427 210T446 302T468 398T489 479L668 1098H864L1036 479Q1045 445 1056 399T1079 306T1099 214T1112 141H1118Q1121 167 1127 210T1143 306T1162 412T1184 514L1321 1098H1507L1223 0H1008Z" />
+<glyph unicode="x" glyph-name="x" horiz-adv-x="1024" d="M408 563L55 1098H262L512 688L762 1098H969L614 563L987 0H780L512 436L242 0H35L408 563Z" />
+<glyph unicode="y" glyph-name="y" horiz-adv-x="1001" d="M10 1098H199L414 485Q428 445 442 401T469 313T491 228T504 152H510Q515 177 526 220T550 311T578 407T604 487L803 1098H991L557 -143Q529 -224 497 -288T421 -398T320 -467T182 -492Q130 -492 92 -487T27
+-475V-330Q48 -335 80 -338T147 -342Q195 -342 230 -331T291 -297T335 -243T369 -170L426 -10L10 1098Z" />
+<glyph unicode="z" glyph-name="z" horiz-adv-x="903" d="M821 0H82V125L618 961H115V1098H803V952L279 137H821V0Z" />
+<glyph unicode="{" glyph-name="braceleft" horiz-adv-x="725" d="M500 -16Q500 -64 512 -94T546 -142T601 -166T674 -174V-324Q597 -323 532 -307T419 -255T344 -164T317 -31V303Q317 406 252 449T61 492V647Q186 647 251 690T317 836V1169Q317 1247 344 1302T418
+1392T531 1444T674 1462V1313Q634 1312 602 1306T547 1282T512 1234T500 1155V823Q500 718 441 657T266 575V563Q381 543 440 482T500 315V-16Z" />
+<glyph unicode="|" glyph-name="bar" horiz-adv-x="1128" d="M489 1556H639V-492H489V1556Z" />
+<glyph unicode="}" glyph-name="braceright" horiz-adv-x="725" d="M225 315Q225 421 284 482T459 563V575Q344 595 285 656T225 823V1155Q225 1203 213 1233T179 1281T124 1305T51 1313V1462Q128 1461 193 1445T306 1393T381 1302T408 1169V836Q408 784 424 748T473
+690T554 657T664 647V492Q539 492 474 449T408 303V-31Q408 -109 381 -164T307 -254T194 -306T51 -324V-174Q91 -173 123 -167T178 -143T213 -95T225 -16V315Z" />
+<glyph unicode="~" glyph-name="asciitilde" horiz-adv-x="1128" d="M530 651Q493 667 466 678T416 695T373 704T330 707Q302 707 272 698T213 672T155 633T102 586V748Q202 856 350 856Q379 856 404 854T456 845T517 826T598 793Q635 777 662 766T713 749T757
+740T799 737Q827 737 857 746T916 772T974 811T1026 858V696Q927 588 778 588Q749 588 724 590T672 599T611 618T530 651Z" />
+<glyph unicode="&#xa0;" glyph-name="nbspace" horiz-adv-x="532" />
+<glyph unicode="&#xa1;" glyph-name="exclamdown" horiz-adv-x="551" d="M213 676H334L385 -373H162L213 676ZM401 979Q401 941 392 915T365 872T324 848T274 840Q248 840 225 847T185 871T157 914T147 979Q147 1016 157 1042T184 1085T225 1110T274 1118Q301
+1118 324 1110T364 1085T391 1042T401 979Z" />
+<glyph unicode="&#xa2;" glyph-name="cent" horiz-adv-x="1128" d="M886 212T831 197T700 180V-20H563V186Q476 199 407 236T289 340T214 506T188 743Q188 884 214 985T289 1155T407 1260T563 1311V1483H700V1319Q772 1316 840 1300T954 1260L901 1106Q878 1116
+850 1125T792 1142T733 1154T678 1159Q521 1159 449 1058T377 745Q377 535 449 438T670 340Q751 340 816 358T936 401V240Q886 212 831 197Z" />
+<glyph unicode="&#xa3;" glyph-name="sterling" horiz-adv-x="1128" d="M666 1481Q772 1481 859 1459T1012 1401L946 1257Q890 1286 820 1307T674 1329Q626 1329 585 1316T514 1273T468 1196T451 1083V788H827V651H451V440Q451 378 440 334T409 257T364 204T311
+166H1059V0H68V154Q112 165 148 185T211 240T253 322T268 438V651H70V788H268V1112Q268 1199 297 1267T379 1383T505 1456T666 1481Z" />
+<glyph unicode="&#xa4;" glyph-name="currency" horiz-adv-x="1128" d="M186 723Q186 782 203 835T252 936L123 1065L221 1163L348 1034Q395 1066 449 1084T563 1102Q623 1102 676 1084T776 1034L905 1163L1004 1067L874 938Q905 892 923 838T942 723Q942 663
+925 608T874 508L1001 381L905 285L776 412Q730 381 677 364T563 346Q503 346 448 364T348 414L221 287L125 383L252 510Q221 555 204 609T186 723ZM324 723Q324 673 342 630T393 554T469 502T563 483Q614 483 658 502T736 553T788 629T807 723Q807 774 788 818T736
+896T659 948T563 967Q513 967 470 948T394 896T343 819T324 723Z" />
+<glyph unicode="&#xa5;" glyph-name="yen" horiz-adv-x="1128" d="M563 723L909 1462H1100L715 694H954V557H653V399H954V262H653V0H475V262H174V399H475V557H174V694H408L29 1462H221L563 723Z" />
+<glyph unicode="&#xa6;" glyph-name="brokenbar" horiz-adv-x="1128" d="M489 1556H639V776H489V1556ZM489 289H639V-492H489V289Z" />
+<glyph unicode="&#xa7;" glyph-name="section" horiz-adv-x="995" d="M137 809Q137 860 150 901T185 975T237 1029T297 1067Q222 1105 180 1162T137 1303Q137 1364 164 1413T242 1496T362 1548T518 1567Q615 1567 693 1547T844 1495L788 1356Q723 1384 653 1403T512
+1423Q413 1423 362 1394T311 1307Q311 1280 323 1257T363 1212T439 1167T557 1114Q629 1086 685 1054T781 982T841 895T862 784Q862 732 850 690T818 613T771 555T717 514Q786 476 824 422T862 289Q862 218 833 163T749 69T618 10T444 -10Q336 -10 258 6T121 55V213Q152
+198 190 183T270 157T356 138T444 131Q513 131 559 143T633 174T672 219T684 272Q684 301 676 323T642 368T569 415T446 471Q373 502 316 533T218 603T158 692T137 809ZM291 831Q291 794 305 763T350 702T432 646T555 588L590 573Q610 586 630 604T667 645T694
+696T705 758Q705 796 692 828T647 889T560 947T424 1006Q399 998 376 983T333 945T303 893T291 831Z" />
+<glyph unicode="&#xa8;" glyph-name="dieresis" horiz-adv-x="1182" d="M307 1395Q307 1449 335 1473T403 1497Q442 1497 471 1473T500 1395Q500 1342 471 1317T403 1292Q363 1292 335 1317T307 1395ZM682 1395Q682 1449 710 1473T778 1497Q797 1497 814 1491T845
+1473T866 1441T874 1395Q874 1342 845 1317T778 1292Q738 1292 710 1317T682 1395Z" />
+<glyph unicode="&#xa9;" glyph-name="copyright" horiz-adv-x="1704" d="M891 1053Q830 1053 783 1031T704 968T656 866T639 731Q639 653 653 593T698 492T776 430T891 408Q914 408 941 411T996 421T1053 435T1106 453V322Q1082 311 1058 302T1007 286T950 276T885
+272Q783 272 707 305T581 399T505 545T479 733Q479 834 506 917T585 1061T714 1154T891 1188Q954 1188 1020 1172T1145 1126L1083 999Q1031 1025 983 1039T891 1053ZM100 731Q100 835 127 931T202 1110T320 1263T472 1380T652 1456T852 1483Q956 1483 1052 1456T1231
+1381T1384 1263T1501 1111T1577 931T1604 731Q1604 627 1577 531T1502 352T1384 200T1232 82T1052 7T852 -20Q748 -20 652 6T473 82T320 199T203 351T127 531T100 731ZM209 731Q209 598 259 481T397 277T602 139T852 88Q985 88 1102 138T1306 276T1444 481T1495
+731Q1495 864 1445 981T1307 1185T1102 1323T852 1374Q719 1374 602 1324T398 1186T260 981T209 731Z" />
+<glyph unicode="&#xaa;" glyph-name="ordfeminine" horiz-adv-x="678" d="M487 797L459 879Q441 857 422 840T379 810T327 791T264 784Q221 784 185 797T123 835T83 899T68 989Q68 1091 138 1145T352 1204L451 1208V1239Q451 1311 421 1339T334 1368Q286 1368
+241 1354T154 1317L106 1417Q157 1443 215 1461T334 1479Q459 1479 518 1426T578 1251V797H487ZM377 1110Q326 1107 292 1098T238 1074T208 1038T199 987Q199 936 224 914T291 891Q325 891 354 901T404 934T438 988T451 1065V1114L377 1110Z" />
+<glyph unicode="&#xab;" glyph-name="guillemotleft" horiz-adv-x="997" d="M82 553L391 967L508 889L270 541L508 193L391 115L82 526V553ZM489 553L799 967L915 889L678 541L915 193L799 115L489 526V553Z" />
+<glyph unicode="&#xac;" glyph-name="logicalnot" horiz-adv-x="1128" d="M1026 797V262H877V647H102V797H1026Z" />
+<glyph unicode="&#xad;" glyph-name="uni00AD" horiz-adv-x="659" d="M82 465V633H578V465H82Z" />
+<glyph unicode="&#xae;" glyph-name="registered" horiz-adv-x="1704" d="M743 768H815Q906 768 945 804T985 909Q985 983 944 1012T813 1042H743V768ZM1145 913Q1145 865 1132 828T1096 762T1045 713T985 680Q1052 570 1105 483Q1128 446 1149 411T1186 347T1213
+302L1223 285H1044L838 637H743V285H586V1178H819Q987 1178 1066 1113T1145 913ZM100 731Q100 835 127 931T202 1110T320 1263T472 1380T652 1456T852 1483Q956 1483 1052 1456T1231 1381T1384 1263T1501 1111T1577 931T1604 731Q1604 627 1577 531T1502 352T1384
+200T1232 82T1052 7T852 -20Q748 -20 652 6T473 82T320 199T203 351T127 531T100 731ZM209 731Q209 598 259 481T397 277T602 139T852 88Q985 88 1102 138T1306 276T1444 481T1495 731Q1495 864 1445 981T1307 1185T1102 1323T852 1374Q719 1374 602 1324T398 1186T260
+981T209 731Z" />
+<glyph unicode="&#xaf;" glyph-name="overscore" horiz-adv-x="1024" d="M1030 1556H-6V1696H1030V1556Z" />
+<glyph unicode="&#xb0;" glyph-name="degree" horiz-adv-x="877" d="M123 1167Q123 1232 148 1289T215 1390T315 1458T438 1483Q503 1483 560 1458T661 1390T729 1290T754 1167Q754 1102 729 1045T661 946T561 879T438 854Q373 854 316 878T216 945T148 1045T123
+1167ZM246 1167Q246 1128 261 1094T302 1033T363 992T438 977Q478 977 513 992T574 1033T616 1093T631 1167Q631 1207 616 1242T575 1304T513 1346T438 1362Q398 1362 363 1347T302 1305T261 1243T246 1167Z" />
+<glyph unicode="&#xb1;" glyph-name="plusminus" horiz-adv-x="1128" d="M489 647H102V797H489V1186H639V797H1026V647H639V262H489V647ZM102 0V150H1026V0H102Z" />
+<glyph unicode="&#xb2;" glyph-name="twosuperior" horiz-adv-x="678" d="M621 586H49V698L258 926Q315 988 351 1030T407 1106T434 1169T442 1233Q442 1298 409 1330T322 1362Q271 1362 225 1337T133 1274L55 1368Q109 1416 175 1448T324 1481Q384 1481 432 1465T515
+1417T567 1340T586 1237Q586 1187 572 1144T530 1059T464 971T373 870L225 713H621V586Z" />
+<glyph unicode="&#xb3;" glyph-name="threesuperior" horiz-adv-x="678" d="M590 1255Q590 1177 550 1124T440 1047Q528 1024 572 971T616 840Q616 780 596 730T535 645T430 589T281 569Q211 569 150 581T31 625V758Q94 724 160 705T279 686Q377 686 421 727T465
+842Q465 916 412 949T262 983H164V1096H262Q354 1096 396 1135T438 1239Q438 1271 428 1294T401 1333T360 1355T309 1362Q250 1362 202 1342T102 1284L33 1380Q62 1403 92 1421T157 1453T229 1473T311 1481Q380 1481 432 1464T520 1417T572 1346T590 1255Z" />
+<glyph unicode="&#xb4;" glyph-name="acute" horiz-adv-x="1182" d="M393 1268Q415 1297 438 1335T485 1413T530 1494T567 1569H786V1548Q770 1521 739 1481T669 1396T590 1311T514 1241H393V1268Z" />
+<glyph unicode="&#xb5;" glyph-name="mu" horiz-adv-x="1217" d="M356 391Q356 261 409 196T573 131Q655 131 710 157T798 233T846 358T860 528V1098H1042V0H895L868 147H858Q810 64 738 22T563 -20Q491 -20 438 3T350 68Q351 30 353 -10Q355 -45 355 -87T356
+-172V-492H174V1098H356V391Z" />
+<glyph unicode="&#xb6;" glyph-name="paragraph" horiz-adv-x="1341" d="M1126 -260H1006V1397H799V-260H678V559Q617 541 532 541Q437 541 360 566T228 651T143 806T113 1042Q113 1189 145 1287T237 1446T380 1531T563 1556H1126V-260Z" />
+<glyph unicode="&#xb7;" glyph-name="middot" horiz-adv-x="549" d="M147 723Q147 761 157 787T184 830T224 854T274 862Q300 862 323 855T364 831T391 788T401 723Q401 686 391 660T364 617T324 592T274 584Q247 584 224 592T184 617T157 660T147 723Z" />
+<glyph unicode="&#xb8;" glyph-name="cedilla" horiz-adv-x="420" d="M408 -287Q408 -384 338 -438T117 -492Q95 -492 73 -489T35 -483V-375Q50 -378 74 -379T115 -381Q186 -381 226 -360T266 -289Q266 -265 253 -248T217 -217T163 -195T94 -176L184 0H305L248
+-115Q282 -123 311 -136T361 -169T395 -219T408 -287Z" />
+<glyph unicode="&#xb9;" glyph-name="onesuperior" horiz-adv-x="678" d="M307 1462H442V586H297V1102Q297 1127 297 1157T299 1217T302 1275T305 1325Q291 1308 272 1288T231 1251L137 1178L63 1274L307 1462Z" />
+<glyph unicode="&#xba;" glyph-name="ordmasculine" horiz-adv-x="717" d="M651 1133Q651 1050 631 985T572 876T479 808T356 784Q293 784 240 807T148 875T88 985T66 1133Q66 1216 86 1280T145 1389T237 1456T360 1479Q422 1479 475 1456T568 1389T629 1281T651
+1133ZM197 1133Q197 1014 234 954T358 893Q443 893 480 953T518 1133Q518 1253 481 1310T358 1368Q272 1368 235 1311T197 1133Z" />
+<glyph unicode="&#xbb;" glyph-name="guillemotright" horiz-adv-x="997" d="M918 526L608 115L492 193L729 541L492 889L608 967L918 553V526ZM510 526L201 115L84 193L322 541L84 889L201 967L510 553V526Z" />
+<glyph unicode="&#xbc;" glyph-name="onequarter" horiz-adv-x="1509" d="M307 1462H442V586H297V1102Q297 1127 297 1157T299 1217T302 1275T305 1325Q291 1308 272 1288T231 1251L137 1178L63 1274L307 1462ZM1202 1462L391 0H234L1045 1462H1202ZM1419 193H1294V1H1151V193H776V304L1153
+883H1294V320H1419V193ZM1151 320V515Q1151 557 1152 606T1157 705Q1152 694 1142 676T1121 636T1098 595T1077 560L922 320H1151Z" />
+<glyph unicode="&#xbd;" glyph-name="onehalf" horiz-adv-x="1509" d="M544 1462H679V586H534V1102Q534 1127 534 1157T536 1217T539 1275T542 1325Q528 1308 509 1288T468 1251L374 1178L300 1274L544 1462ZM1181 1462L370 0H213L1024 1462H1181ZM1440 1H868V113L1077
+341Q1134 403 1170 445T1226 521T1253 584T1261 648Q1261 713 1228 745T1141 777Q1090 777 1044 752T952 689L874 783Q928 831 994 863T1143 896Q1203 896 1251 880T1334 832T1386 755T1405 652Q1405 602 1391 559T1349 474T1283 386T1192 285L1044 128H1440V1Z"
+/>
+<glyph unicode="&#xbe;" glyph-name="threequarters" horiz-adv-x="1509" d="M590 1255Q590 1177 550 1124T440 1047Q528 1024 572 971T616 840Q616 780 596 730T535 645T430 589T281 569Q211 569 150 581T31 625V758Q94 724 160 705T279 686Q377 686 421 727T465
+842Q465 916 412 949T262 983H164V1096H262Q354 1096 396 1135T438 1239Q438 1271 428 1294T401 1333T360 1355T309 1362Q250 1362 202 1342T102 1284L33 1380Q62 1403 92 1421T157 1453T229 1473T311 1481Q380 1481 432 1464T520 1417T572 1346T590 1255ZM1296
+1462L485 0H328L1139 1462H1296ZM1486 193H1361V1H1218V193H843V304L1220 883H1361V320H1486V193ZM1218 320V515Q1218 557 1219 606T1224 705Q1219 694 1209 676T1188 636T1165 595T1144 560L989 320H1218Z" />
+<glyph unicode="&#xbf;" glyph-name="questiondown" horiz-adv-x="872" d="M592 676V639Q592 581 584 536T557 450T505 371T422 291Q374 250 340 217T285 149T253 75T242 -18Q242 -66 257 -105T300 -173T371 -217T469 -233Q553 -233 628 -208T772 -147L836 -293Q754
+-335 660 -364T469 -393Q376 -393 302 -368T176 -294T96 -177T68 -20Q68 48 81 100T121 197T188 284T283 373Q335 418 368 451T420 516T446 580T453 657V676H592ZM639 979Q639 941 630 915T603 872T562 848T512 840Q486 840 463 847T423 871T395 914T385 979Q385
+1016 395 1042T422 1085T463 1110T512 1118Q539 1118 562 1110T602 1085T629 1042T639 979Z" />
+<glyph unicode="&#xc0;" glyph-name="Agrave" horiz-adv-x="1245" d="M1055 0L895 453H350L188 0H0L537 1468H707L1245 0H1055ZM836 618L688 1042Q682 1060 674 1086T656 1142T638 1204T621 1268Q614 1237 605 1204T587 1141T570 1085T555 1042L410 618H836ZM719
+1579H599Q564 1607 523 1648T444 1734T374 1818T326 1886V1907H545Q561 1873 582 1833T627 1752T674 1673T719 1606V1579Z" />
+<glyph unicode="&#xc1;" glyph-name="Aacute" horiz-adv-x="1245" d="M1055 0L895 453H350L188 0H0L537 1468H707L1245 0H1055ZM836 618L688 1042Q682 1060 674 1086T656 1142T638 1204T621 1268Q614 1237 605 1204T587 1141T570 1085T555 1042L410 618H836ZM534
+1606Q556 1635 579 1673T626 1751T671 1832T708 1907H927V1886Q911 1859 880 1819T810 1734T731 1649T655 1579H534V1606Z" />
+<glyph unicode="&#xc2;" glyph-name="Acircumflex" horiz-adv-x="1245" d="M1055 0L895 453H350L188 0H0L537 1468H707L1245 0H1055ZM836 618L688 1042Q682 1060 674 1086T656 1142T638 1204T621 1268Q614 1237 605 1204T587 1141T570 1085T555 1042L410 618H836ZM953
+1579H832Q781 1613 727 1661T621 1765Q567 1710 514 1662T410 1579H289V1606Q315 1635 349 1673T416 1751T479 1832T525 1907H717Q733 1873 762 1833T825 1752T893 1673T953 1606V1579Z" />
+<glyph unicode="&#xc3;" glyph-name="Atilde" horiz-adv-x="1245" d="M1055 0L895 453H350L188 0H0L537 1468H707L1245 0H1055ZM836 618L688 1042Q682 1060 674 1086T656 1142T638 1204T621 1268Q614 1237 605 1204T587 1141T570 1085T555 1042L410 618H836ZM772
+1581Q732 1581 693 1598T615 1637T542 1676T475 1694Q430 1694 406 1668T368 1579H264Q269 1639 285 1688T328 1771T392 1824T475 1843Q517 1843 557 1826T636 1787T708 1749T772 1731Q817 1731 840 1757T878 1845H983Q978 1785 962 1737T919 1654T855 1600T772
+1581Z" />
+<glyph unicode="&#xc4;" glyph-name="Adieresis" horiz-adv-x="1245" d="M1055 0L895 453H350L188 0H0L537 1468H707L1245 0H1055ZM836 618L688 1042Q682 1060 674 1086T656 1142T638 1204T621 1268Q614 1237 605 1204T587 1141T570 1085T555 1042L410 618H836ZM340
+1733Q340 1787 368 1811T436 1835Q475 1835 504 1811T533 1733Q533 1680 504 1655T436 1630Q396 1630 368 1655T340 1733ZM715 1733Q715 1787 743 1811T811 1835Q830 1835 847 1829T878 1811T899 1779T907 1733Q907 1680 878 1655T811 1630Q771 1630 743 1655T715
+1733Z" />
+<glyph unicode="&#xc5;" glyph-name="Aring" horiz-adv-x="1245" d="M1055 0L895 453H350L188 0H0L537 1468H707L1245 0H1055ZM836 618L688 1042Q682 1060 674 1086T656 1142T638 1204T621 1268Q614 1237 605 1204T587 1141T570 1085T555 1042L410 618H836ZM848
+1583Q848 1532 831 1492T783 1423T710 1381T619 1366Q569 1366 528 1380T458 1423T412 1490T396 1581Q396 1632 412 1671T457 1739T528 1781T619 1796Q667 1796 709 1782T782 1740T830 1673T848 1583ZM731 1581Q731 1634 700 1664T619 1694Q569 1694 538 1664T506
+1581Q506 1528 534 1498T619 1468Q668 1468 699 1498T731 1581Z" />
+<glyph unicode="&#xc6;" glyph-name="AE" horiz-adv-x="1745" d="M1622 0H862V453H387L184 0H-2L653 1462H1622V1298H1049V846H1583V684H1049V164H1622V0ZM459 618H862V1298H754L459 618Z" />
+<glyph unicode="&#xc7;" glyph-name="Ccedilla" horiz-adv-x="1235" d="M793 1319Q686 1319 599 1279T451 1162T356 977T322 731Q322 590 351 481T440 296T587 182T793 143Q882 143 962 160T1120 201V39Q1081 24 1042 13T961 -6T870 -16T762 -20Q598 -20 478 34T280
+187T163 425T125 733Q125 899 168 1037T296 1274T506 1428T793 1483Q901 1483 999 1461T1176 1397L1098 1241Q1035 1273 961 1296T793 1319ZM916 -287Q916 -384 846 -438T625 -492Q603 -492 581 -489T543 -483V-375Q558 -378 582 -379T623 -381Q694 -381 734 -360T774
+-289Q774 -265 761 -248T725 -217T671 -195T602 -176L692 0H813L756 -115Q790 -123 819 -136T869 -169T903 -219T916 -287Z" />
+<glyph unicode="&#xc8;" glyph-name="Egrave" horiz-adv-x="1081" d="M958 0H199V1462H958V1298H385V846H920V684H385V164H958V0ZM713 1579H593Q558 1607 517 1648T438 1734T368 1818T320 1886V1907H539Q555 1873 576 1833T621 1752T668 1673T713 1606V1579Z" />
+<glyph unicode="&#xc9;" glyph-name="Eacute" horiz-adv-x="1081" d="M958 0H199V1462H958V1298H385V846H920V684H385V164H958V0ZM456 1606Q478 1635 501 1673T548 1751T593 1832T630 1907H849V1886Q833 1859 802 1819T732 1734T653 1649T577 1579H456V1606Z" />
+<glyph unicode="&#xca;" glyph-name="Ecircumflex" horiz-adv-x="1081" d="M958 0H199V1462H958V1298H385V846H920V684H385V164H958V0ZM907 1579H786Q735 1613 681 1661T575 1765Q521 1710 468 1662T364 1579H243V1606Q269 1635 303 1673T370 1751T433 1832T479
+1907H671Q687 1873 716 1833T779 1752T847 1673T907 1606V1579Z" />
+<glyph unicode="&#xcb;" glyph-name="Edieresis" horiz-adv-x="1081" d="M958 0H199V1462H958V1298H385V846H920V684H385V164H958V0ZM296 1733Q296 1787 324 1811T392 1835Q431 1835 460 1811T489 1733Q489 1680 460 1655T392 1630Q352 1630 324 1655T296 1733ZM671
+1733Q671 1787 699 1811T767 1835Q786 1835 803 1829T834 1811T855 1779T863 1733Q863 1680 834 1655T767 1630Q727 1630 699 1655T671 1733Z" />
+<glyph unicode="&#xcc;" glyph-name="Igrave" horiz-adv-x="694" d="M612 0H82V102L254 143V1319L82 1360V1462H612V1360L440 1319V143L612 102V0ZM455 1579H335Q300 1607 259 1648T180 1734T110 1818T62 1886V1907H281Q297 1873 318 1833T363 1752T410 1673T455
+1606V1579Z" />
+<glyph unicode="&#xcd;" glyph-name="Iacute" horiz-adv-x="694" d="M612 0H82V102L254 143V1319L82 1360V1462H612V1360L440 1319V143L612 102V0ZM257 1606Q279 1635 302 1673T349 1751T394 1832T431 1907H650V1886Q634 1859 603 1819T533 1734T454 1649T378
+1579H257V1606Z" />
+<glyph unicode="&#xce;" glyph-name="Icircumflex" horiz-adv-x="694" d="M612 0H82V102L254 143V1319L82 1360V1462H612V1360L440 1319V143L612 102V0ZM681 1579H560Q509 1613 455 1661T349 1765Q295 1710 242 1662T138 1579H17V1606Q43 1635 77 1673T144 1751T207
+1832T253 1907H445Q461 1873 490 1833T553 1752T621 1673T681 1606V1579Z" />
+<glyph unicode="&#xcf;" glyph-name="Idieresis" horiz-adv-x="694" d="M612 0H82V102L254 143V1319L82 1360V1462H612V1360L440 1319V143L612 102V0ZM64 1733Q64 1787 92 1811T160 1835Q199 1835 228 1811T257 1733Q257 1680 228 1655T160 1630Q120 1630 92 1655T64
+1733ZM439 1733Q439 1787 467 1811T535 1835Q554 1835 571 1829T602 1811T623 1779T631 1733Q631 1680 602 1655T535 1630Q495 1630 467 1655T439 1733Z" />
+<glyph unicode="&#xd0;" glyph-name="Eth" horiz-adv-x="1401" d="M47 805H199V1462H606Q759 1462 883 1416T1094 1280T1228 1055T1276 745Q1276 560 1228 421T1089 188T866 47T565 0H199V643H47V805ZM1079 739Q1079 885 1046 991T950 1167T795 1269T586 1303H385V805H721V643H385V160H547Q811
+160 945 306T1079 739Z" />
+<glyph unicode="&#xd1;" glyph-name="Ntilde" horiz-adv-x="1493" d="M1294 0H1079L360 1210H352Q358 1133 362 1057Q366 992 368 921T371 793V0H199V1462H412L1128 258H1135Q1132 334 1128 408Q1127 440 1126 473T1123 540T1121 605T1120 662V1462H1294V0ZM905
+1581Q865 1581 826 1598T748 1637T675 1676T608 1694Q563 1694 539 1668T501 1579H397Q402 1639 418 1688T461 1771T525 1824T608 1843Q650 1843 690 1826T769 1787T841 1749T905 1731Q950 1731 973 1757T1011 1845H1116Q1111 1785 1095 1737T1052 1654T988 1600T905
+1581Z" />
+<glyph unicode="&#xd2;" glyph-name="Ograve" horiz-adv-x="1520" d="M1393 733Q1393 564 1353 425T1232 187T1034 34T760 -20Q597 -20 478 34T280 187T163 425T125 735Q125 905 163 1043T280 1280T479 1431T762 1485Q917 1485 1034 1432T1232 1280T1352 1043T1393
+733ZM322 733Q322 596 348 487T427 301T563 184T760 143Q874 143 956 183T1092 300T1171 486T1196 733Q1196 871 1171 980T1093 1164T958 1280T762 1321Q648 1321 565 1281T428 1165T348 980T322 733ZM870 1579H750Q715 1607 674 1648T595 1734T525 1818T477 1886V1907H696Q712
+1873 733 1833T778 1752T825 1673T870 1606V1579Z" />
+<glyph unicode="&#xd3;" glyph-name="Oacute" horiz-adv-x="1520" d="M1393 733Q1393 564 1353 425T1232 187T1034 34T760 -20Q597 -20 478 34T280 187T163 425T125 735Q125 905 163 1043T280 1280T479 1431T762 1485Q917 1485 1034 1432T1232 1280T1352 1043T1393
+733ZM322 733Q322 596 348 487T427 301T563 184T760 143Q874 143 956 183T1092 300T1171 486T1196 733Q1196 871 1171 980T1093 1164T958 1280T762 1321Q648 1321 565 1281T428 1165T348 980T322 733ZM651 1606Q673 1635 696 1673T743 1751T788 1832T825 1907H1044V1886Q1028
+1859 997 1819T927 1734T848 1649T772 1579H651V1606Z" />
+<glyph unicode="&#xd4;" glyph-name="Ocircumflex" horiz-adv-x="1520" d="M1393 733Q1393 564 1353 425T1232 187T1034 34T760 -20Q597 -20 478 34T280 187T163 425T125 735Q125 905 163 1043T280 1280T479 1431T762 1485Q917 1485 1034 1432T1232 1280T1352
+1043T1393 733ZM322 733Q322 596 348 487T427 301T563 184T760 143Q874 143 956 183T1092 300T1171 486T1196 733Q1196 871 1171 980T1093 1164T958 1280T762 1321Q648 1321 565 1281T428 1165T348 980T322 733ZM1096 1579H975Q924 1613 870 1661T764 1765Q710
+1710 657 1662T553 1579H432V1606Q458 1635 492 1673T559 1751T622 1832T668 1907H860Q876 1873 905 1833T968 1752T1036 1673T1096 1606V1579Z" />
+<glyph unicode="&#xd5;" glyph-name="Otilde" horiz-adv-x="1520" d="M1393 733Q1393 564 1353 425T1232 187T1034 34T760 -20Q597 -20 478 34T280 187T163 425T125 735Q125 905 163 1043T280 1280T479 1431T762 1485Q917 1485 1034 1432T1232 1280T1352 1043T1393
+733ZM322 733Q322 596 348 487T427 301T563 184T760 143Q874 143 956 183T1092 300T1171 486T1196 733Q1196 871 1171 980T1093 1164T958 1280T762 1321Q648 1321 565 1281T428 1165T348 980T322 733ZM891 1581Q851 1581 812 1598T734 1637T661 1676T594 1694Q549
+1694 525 1668T487 1579H383Q388 1639 404 1688T447 1771T511 1824T594 1843Q636 1843 676 1826T755 1787T827 1749T891 1731Q936 1731 959 1757T997 1845H1102Q1097 1785 1081 1737T1038 1654T974 1600T891 1581Z" />
+<glyph unicode="&#xd6;" glyph-name="Odieresis" horiz-adv-x="1520" d="M1393 733Q1393 564 1353 425T1232 187T1034 34T760 -20Q597 -20 478 34T280 187T163 425T125 735Q125 905 163 1043T280 1280T479 1431T762 1485Q917 1485 1034 1432T1232 1280T1352 1043T1393
+733ZM322 733Q322 596 348 487T427 301T563 184T760 143Q874 143 956 183T1092 300T1171 486T1196 733Q1196 871 1171 980T1093 1164T958 1280T762 1321Q648 1321 565 1281T428 1165T348 980T322 733ZM477 1733Q477 1787 505 1811T573 1835Q612 1835 641 1811T670
+1733Q670 1680 641 1655T573 1630Q533 1630 505 1655T477 1733ZM852 1733Q852 1787 880 1811T948 1835Q967 1835 984 1829T1015 1811T1036 1779T1044 1733Q1044 1680 1015 1655T948 1630Q908 1630 880 1655T852 1733Z" />
+<glyph unicode="&#xd7;" glyph-name="multiply" horiz-adv-x="1128" d="M459 723L141 1042L246 1147L563 829L885 1147L989 1044L668 723L987 403L885 301L563 618L246 303L143 406L459 723Z" />
+<glyph unicode="&#xd8;" glyph-name="Oslash" horiz-adv-x="1520" d="M1300 1454L1208 1305Q1299 1206 1346 1061T1393 733Q1393 564 1353 425T1232 187T1034 34T760 -20Q571 -20 438 51L360 -76L223 2L313 147Q216 247 171 396T125 735Q125 905 163 1043T280
+1280T479 1431T762 1485Q856 1485 936 1464T1083 1405L1163 1532L1300 1454ZM322 733Q322 602 345 498T416 315L995 1260Q947 1289 890 1305T762 1321Q648 1321 565 1281T428 1165T348 980T322 733ZM1196 733Q1196 990 1108 1141L530 201Q577 173 634 158T760 143Q874
+143 956 183T1092 300T1171 486T1196 733Z" />
+<glyph unicode="&#xd9;" glyph-name="Ugrave" horiz-adv-x="1430" d="M1245 1464V516Q1245 402 1212 304T1113 134T946 21T709 -20Q581 -20 483 18T319 128T218 298T184 520V1462H371V510Q371 335 457 239T719 143Q808 143 872 170T977 246T1038 363T1059 512V1464H1245ZM847
+1579H727Q692 1607 651 1648T572 1734T502 1818T454 1886V1907H673Q689 1873 710 1833T755 1752T802 1673T847 1606V1579Z" />
+<glyph unicode="&#xda;" glyph-name="Uacute" horiz-adv-x="1430" d="M1245 1464V516Q1245 402 1212 304T1113 134T946 21T709 -20Q581 -20 483 18T319 128T218 298T184 520V1462H371V510Q371 335 457 239T719 143Q808 143 872 170T977 246T1038 363T1059 512V1464H1245ZM590
+1606Q612 1635 635 1673T682 1751T727 1832T764 1907H983V1886Q967 1859 936 1819T866 1734T787 1649T711 1579H590V1606Z" />
+<glyph unicode="&#xdb;" glyph-name="Ucircumflex" horiz-adv-x="1430" d="M1245 1464V516Q1245 402 1212 304T1113 134T946 21T709 -20Q581 -20 483 18T319 128T218 298T184 520V1462H371V510Q371 335 457 239T719 143Q808 143 872 170T977 246T1038 363T1059
+512V1464H1245ZM1043 1579H922Q871 1613 817 1661T711 1765Q657 1710 604 1662T500 1579H379V1606Q405 1635 439 1673T506 1751T569 1832T615 1907H807Q823 1873 852 1833T915 1752T983 1673T1043 1606V1579Z" />
+<glyph unicode="&#xdc;" glyph-name="Udieresis" horiz-adv-x="1430" d="M1245 1464V516Q1245 402 1212 304T1113 134T946 21T709 -20Q581 -20 483 18T319 128T218 298T184 520V1462H371V510Q371 335 457 239T719 143Q808 143 872 170T977 246T1038 363T1059 512V1464H1245ZM432
+1733Q432 1787 460 1811T528 1835Q567 1835 596 1811T625 1733Q625 1680 596 1655T528 1630Q488 1630 460 1655T432 1733ZM807 1733Q807 1787 835 1811T903 1835Q922 1835 939 1829T970 1811T991 1779T999 1733Q999 1680 970 1655T903 1630Q863 1630 835 1655T807
+1733Z" />
+<glyph unicode="&#xdd;" glyph-name="Yacute" horiz-adv-x="1079" d="M539 723L879 1462H1079L633 569V0H446V559L0 1462H203L539 723ZM442 1606Q464 1635 487 1673T534 1751T579 1832T616 1907H835V1886Q819 1859 788 1819T718 1734T639 1649T563 1579H442V1606Z" />
+<glyph unicode="&#xde;" glyph-name="Thorn" horiz-adv-x="1180" d="M1075 782Q1075 691 1048 607T957 459T791 356T535 317H385V0H199V1462H385V1210H561Q695 1210 792 1182T952 1099T1045 964T1075 782ZM385 475H514Q607 475 676 491T791 542T860 634T883 772Q883
+915 801 983T545 1051H385V475Z" />
+<glyph unicode="&#xdf;" glyph-name="germandbls" horiz-adv-x="1233" d="M1010 1260Q1010 1203 989 1159T936 1078T867 1011T798 954T745 899T723 842Q723 821 730 805T756 769T811 725T903 662Q959 625 1003 589T1077 512T1124 423T1141 313Q1141 226 1113 163T1035
+60T914 0T758 -20Q661 -20 592 -3T469 49V215Q495 199 527 184T596 156T670 137T745 129Q801 129 841 141T908 176T946 231T958 303Q958 339 950 368T920 426T862 483T770 547Q707 587 665 621T596 688T558 757T547 834Q547 888 567 927T619 998T686 1057T753 1113T804
+1175T825 1253Q825 1295 809 1326T762 1377T691 1407T598 1417Q549 1417 505 1408T428 1374T376 1309T356 1202V0H174V1200Q174 1304 205 1374T293 1487T428 1548T598 1567Q690 1567 766 1548T896 1491T980 1395T1010 1260Z" />
+<glyph unicode="&#xe0;" glyph-name="agrave" horiz-adv-x="1087" d="M793 0L756 152H748Q715 107 682 75T610 21T523 -10T412 -20Q343 -20 285 -1T185 59T118 161T94 307Q94 471 209 559T561 655L745 662V731Q745 798 731 843T689 915T621 955T528 967Q445 967
+374 943T236 885L172 1022Q246 1062 337 1090T528 1118Q630 1118 704 1098T827 1033T900 919T924 752V0H793ZM459 127Q520 127 572 146T662 203T721 300T743 438V537L600 530Q510 526 449 510T352 466T299 397T283 305Q283 213 331 170T459 127ZM934 1241H814Q779
+1269 738 1310T659 1396T589 1480T541 1548V1569H760Q776 1535 797 1495T842 1414T889 1335T934 1268V1241Z" />
+<glyph unicode="&#xe1;" glyph-name="aacute" horiz-adv-x="1087" d="M793 0L756 152H748Q715 107 682 75T610 21T523 -10T412 -20Q343 -20 285 -1T185 59T118 161T94 307Q94 471 209 559T561 655L745 662V731Q745 798 731 843T689 915T621 955T528 967Q445 967
+374 943T236 885L172 1022Q246 1062 337 1090T528 1118Q630 1118 704 1098T827 1033T900 919T924 752V0H793ZM459 127Q520 127 572 146T662 203T721 300T743 438V537L600 530Q510 526 449 510T352 466T299 397T283 305Q283 213 331 170T459 127ZM446 1268Q468 1297
+491 1335T538 1413T583 1494T620 1569H839V1548Q823 1521 792 1481T722 1396T643 1311T567 1241H446V1268Z" />
+<glyph unicode="&#xe2;" glyph-name="acircumflex" horiz-adv-x="1087" d="M793 0L756 152H748Q715 107 682 75T610 21T523 -10T412 -20Q343 -20 285 -1T185 59T118 161T94 307Q94 471 209 559T561 655L745 662V731Q745 798 731 843T689 915T621 955T528 967Q445
+967 374 943T236 885L172 1022Q246 1062 337 1090T528 1118Q630 1118 704 1098T827 1033T900 919T924 752V0H793ZM459 127Q520 127 572 146T662 203T721 300T743 438V537L600 530Q510 526 449 510T352 466T299 397T283 305Q283 213 331 170T459 127ZM1148 1241H1027Q976
+1275 922 1323T816 1427Q762 1372 709 1324T605 1241H484V1268Q510 1297 544 1335T611 1413T674 1494T720 1569H912Q928 1535 957 1495T1020 1414T1088 1335T1148 1268V1241Z" />
+<glyph unicode="&#xe3;" glyph-name="atilde" horiz-adv-x="1087" d="M793 0L756 152H748Q715 107 682 75T610 21T523 -10T412 -20Q343 -20 285 -1T185 59T118 161T94 307Q94 471 209 559T561 655L745 662V731Q745 798 731 843T689 915T621 955T528 967Q445 967
+374 943T236 885L172 1022Q246 1062 337 1090T528 1118Q630 1118 704 1098T827 1033T900 919T924 752V0H793ZM459 127Q520 127 572 146T662 203T721 300T743 438V537L600 530Q510 526 449 510T352 466T299 397T283 305Q283 213 331 170T459 127ZM955 1243Q915 1243
+876 1260T798 1299T725 1338T658 1356Q613 1356 589 1330T551 1241H447Q452 1301 468 1350T511 1433T575 1486T658 1505Q700 1505 740 1488T819 1449T891 1411T955 1393Q1000 1393 1023 1419T1061 1507H1166Q1161 1447 1145 1399T1102 1316T1038 1262T955 1243Z"
+/>
+<glyph unicode="&#xe4;" glyph-name="adieresis" horiz-adv-x="1087" d="M793 0L756 152H748Q715 107 682 75T610 21T523 -10T412 -20Q343 -20 285 -1T185 59T118 161T94 307Q94 471 209 559T561 655L745 662V731Q745 798 731 843T689 915T621 955T528 967Q445
+967 374 943T236 885L172 1022Q246 1062 337 1090T528 1118Q630 1118 704 1098T827 1033T900 919T924 752V0H793ZM459 127Q520 127 572 146T662 203T721 300T743 438V537L600 530Q510 526 449 510T352 466T299 397T283 305Q283 213 331 170T459 127ZM529 1395Q529
+1449 557 1473T625 1497Q664 1497 693 1473T722 1395Q722 1342 693 1317T625 1292Q585 1292 557 1317T529 1395ZM904 1395Q904 1449 932 1473T1000 1497Q1019 1497 1036 1491T1067 1473T1088 1441T1096 1395Q1096 1342 1067 1317T1000 1292Q960 1292 932 1317T904
+1395Z" />
+<glyph unicode="&#xe5;" glyph-name="aring" horiz-adv-x="1087" d="M793 0L756 152H748Q715 107 682 75T610 21T523 -10T412 -20Q343 -20 285 -1T185 59T118 161T94 307Q94 471 209 559T561 655L745 662V731Q745 798 731 843T689 915T621 955T528 967Q445 967
+374 943T236 885L172 1022Q246 1062 337 1090T528 1118Q630 1118 704 1098T827 1033T900 919T924 752V0H793ZM459 127Q520 127 572 146T662 203T721 300T743 438V537L600 530Q510 526 449 510T352 466T299 397T283 305Q283 213 331 170T459 127ZM1039 1458Q1039
+1407 1022 1367T974 1298T901 1256T810 1241Q760 1241 719 1255T649 1298T603 1365T587 1456Q587 1507 603 1546T648 1614T719 1656T810 1671Q858 1671 900 1657T973 1615T1021 1548T1039 1458ZM922 1456Q922 1509 891 1539T810 1569Q760 1569 729 1539T697 1456Q697
+1403 725 1373T810 1343Q859 1343 890 1373T922 1456Z" />
+<glyph unicode="&#xe6;" glyph-name="ae" horiz-adv-x="1706" d="M94 307Q94 471 209 559T561 655L745 662V731Q745 798 731 843T689 915T621 955T528 967Q445 967 374 943T236 885L172 1022Q246 1062 337 1090T528 1118Q659 1118 742 1076T868 940Q919 1025 1002
+1071T1188 1118Q1285 1118 1362 1083T1493 983T1575 828T1604 627V514H932Q937 321 1010 230T1231 139Q1280 139 1322 144T1404 158T1480 182T1554 215V53Q1515 34 1478 20T1401 -3T1319 -16T1227 -20Q1089 -20 988 37T825 209Q791 155 753 113T668 41T562 -4T430
+-20Q359 -20 298 -1T191 59T120 161T94 307ZM283 305Q283 213 331 170T459 127Q520 127 572 146T662 203T721 300T743 438V537L600 530Q510 526 449 510T352 466T299 397T283 305ZM1184 967Q1074 967 1011 889T936 662H1407Q1407 730 1394 786T1354 883T1284 945T1184
+967Z" />
+<glyph unicode="&#xe7;" glyph-name="ccedilla" horiz-adv-x="948" d="M594 -20Q493 -20 405 11T252 111T150 286T113 543Q113 700 151 809T255 987T411 1087T602 1118Q680 1118 754 1101T879 1059L825 905Q802 915 774 924T716 941T657 953T602 958Q445 958 373
+858T301 545Q301 334 373 237T594 139Q675 139 740 157T860 201V39Q806 10 745 -5T594 -20ZM730 -287Q730 -384 660 -438T439 -492Q417 -492 395 -489T357 -483V-375Q372 -378 396 -379T437 -381Q508 -381 548 -360T588 -289Q588 -265 575 -248T539 -217T485 -195T416
+-176L506 0H627L570 -115Q604 -123 633 -136T683 -169T717 -219T730 -287Z" />
+<glyph unicode="&#xe8;" glyph-name="egrave" horiz-adv-x="1096" d="M608 -20Q498 -20 407 17T251 125T149 301T113 541Q113 677 146 784T239 965T382 1079T567 1118Q666 1118 745 1083T879 983T963 828T993 627V514H301Q306 321 382 230T610 139Q661 139 704
+144T788 158T867 182T944 215V53Q904 34 866 20T787 -3T703 -16T608 -20ZM563 967Q449 967 383 889T305 662H797Q797 730 784 786T742 883T669 945T563 967ZM934 1241H814Q779 1269 738 1310T659 1396T589 1480T541 1548V1569H760Q776 1535 797 1495T842 1414T889
+1335T934 1268V1241Z" />
+<glyph unicode="&#xe9;" glyph-name="eacute" horiz-adv-x="1096" d="M608 -20Q498 -20 407 17T251 125T149 301T113 541Q113 677 146 784T239 965T382 1079T567 1118Q666 1118 745 1083T879 983T963 828T993 627V514H301Q306 321 382 230T610 139Q661 139 704
+144T788 158T867 182T944 215V53Q904 34 866 20T787 -3T703 -16T608 -20ZM563 967Q449 967 383 889T305 662H797Q797 730 784 786T742 883T669 945T563 967ZM475 1268Q497 1297 520 1335T567 1413T612 1494T649 1569H868V1548Q852 1521 821 1481T751 1396T672 1311T596
+1241H475V1268Z" />
+<glyph unicode="&#xea;" glyph-name="ecircumflex" horiz-adv-x="1096" d="M608 -20Q498 -20 407 17T251 125T149 301T113 541Q113 677 146 784T239 965T382 1079T567 1118Q666 1118 745 1083T879 983T963 828T993 627V514H301Q306 321 382 230T610 139Q661 139
+704 144T788 158T867 182T944 215V53Q904 34 866 20T787 -3T703 -16T608 -20ZM563 967Q449 967 383 889T305 662H797Q797 730 784 786T742 883T669 945T563 967ZM1144 1241H1023Q972 1275 918 1323T812 1427Q758 1372 705 1324T601 1241H480V1268Q506 1297 540
+1335T607 1413T670 1494T716 1569H908Q924 1535 953 1495T1016 1414T1084 1335T1144 1268V1241Z" />
+<glyph unicode="&#xeb;" glyph-name="edieresis" horiz-adv-x="1096" d="M608 -20Q498 -20 407 17T251 125T149 301T113 541Q113 677 146 784T239 965T382 1079T567 1118Q666 1118 745 1083T879 983T963 828T993 627V514H301Q306 321 382 230T610 139Q661 139
+704 144T788 158T867 182T944 215V53Q904 34 866 20T787 -3T703 -16T608 -20ZM563 967Q449 967 383 889T305 662H797Q797 730 784 786T742 883T669 945T563 967ZM525 1395Q525 1449 553 1473T621 1497Q660 1497 689 1473T718 1395Q718 1342 689 1317T621 1292Q581
+1292 553 1317T525 1395ZM900 1395Q900 1449 928 1473T996 1497Q1015 1497 1032 1491T1063 1473T1084 1441T1092 1395Q1092 1342 1063 1317T996 1292Q956 1292 928 1317T900 1395Z" />
+<glyph unicode="&#xec;" glyph-name="igrave" horiz-adv-x="530" d="M356 0H174V1098H356V0ZM359 1241H239Q204 1269 163 1310T84 1396T14 1480T-34 1548V1569H185Q201 1535 222 1495T267 1414T314 1335T359 1268V1241Z" />
+<glyph unicode="&#xed;" glyph-name="iacute" horiz-adv-x="530" d="M356 0H174V1098H356V0ZM185 1268Q207 1297 230 1335T277 1413T322 1494T359 1569H578V1548Q562 1521 531 1481T461 1396T382 1311T306 1241H185V1268Z" />
+<glyph unicode="&#xee;" glyph-name="icircumflex" horiz-adv-x="530" d="M356 0H174V1098H356V0ZM597 1241H476Q425 1275 371 1323T265 1427Q211 1372 158 1324T54 1241H-67V1268Q-41 1297 -7 1335T60 1413T123 1494T169 1569H361Q377 1535 406 1495T469 1414T537
+1335T597 1268V1241Z" />
+<glyph unicode="&#xef;" glyph-name="idieresis" horiz-adv-x="530" d="M356 0H174V1098H356V0ZM-18 1395Q-18 1449 10 1473T78 1497Q117 1497 146 1473T175 1395Q175 1342 146 1317T78 1292Q38 1292 10 1317T-18 1395ZM357 1395Q357 1449 385 1473T453 1497Q472
+1497 489 1491T520 1473T541 1441T549 1395Q549 1342 520 1317T453 1292Q413 1292 385 1317T357 1395Z" />
+<glyph unicode="&#xf0;" glyph-name="eth" horiz-adv-x="1182" d="M1069 573Q1069 431 1036 321T940 135T788 20T588 -20Q484 -20 397 13T246 109T147 265T111 477Q111 596 142 688T233 843T376 938T565 971Q667 971 744 942T864 852L872 856Q841 974 781 1070T631
+1247L375 1094L301 1208L518 1339Q478 1367 436 1394T346 1448L416 1571Q481 1539 542 1503T662 1423L889 1561L963 1448L768 1331Q835 1266 890 1188T985 1017T1047 813T1069 573ZM881 526Q881 582 864 635T812 730T722 796T592 821Q515 821 461 798T371 731T320
+622T303 471Q303 395 319 333T371 225T461 156T592 131Q746 131 813 230T881 526Z" />
+<glyph unicode="&#xf1;" glyph-name="ntilde" horiz-adv-x="1206" d="M860 0V707Q860 837 808 902T643 967Q562 967 507 941T419 864T371 739T356 569V0H174V1098H322L348 950H358Q383 993 417 1024T493 1077T580 1108T674 1118Q857 1118 949 1023T1042 717V0H860ZM1015
+1243Q975 1243 936 1260T858 1299T785 1338T718 1356Q673 1356 649 1330T611 1241H507Q512 1301 528 1350T571 1433T635 1486T718 1505Q760 1505 800 1488T879 1449T951 1411T1015 1393Q1060 1393 1083 1419T1121 1507H1226Q1221 1447 1205 1399T1162 1316T1098
+1262T1015 1243Z" />
+<glyph unicode="&#xf2;" glyph-name="ograve" horiz-adv-x="1182" d="M1069 551Q1069 414 1036 308T940 129T788 18T588 -20Q485 -20 398 18T248 128T149 307T113 551Q113 687 146 792T242 970T393 1080T594 1118Q697 1118 784 1081T934 971T1033 793T1069 551ZM301
+551Q301 342 369 237T592 131Q746 131 813 236T881 551Q881 760 813 863T590 967Q436 967 369 864T301 551ZM1002 1241H882Q847 1269 806 1310T727 1396T657 1480T609 1548V1569H828Q844 1535 865 1495T910 1414T957 1335T1002 1268V1241Z" />
+<glyph unicode="&#xf3;" glyph-name="oacute" horiz-adv-x="1182" d="M1069 551Q1069 414 1036 308T940 129T788 18T588 -20Q485 -20 398 18T248 128T149 307T113 551Q113 687 146 792T242 970T393 1080T594 1118Q697 1118 784 1081T934 971T1033 793T1069 551ZM301
+551Q301 342 369 237T592 131Q746 131 813 236T881 551Q881 760 813 863T590 967Q436 967 369 864T301 551ZM473 1268Q495 1297 518 1335T565 1413T610 1494T647 1569H866V1548Q850 1521 819 1481T749 1396T670 1311T594 1241H473V1268Z" />
+<glyph unicode="&#xf4;" glyph-name="ocircumflex" horiz-adv-x="1182" d="M1069 551Q1069 414 1036 308T940 129T788 18T588 -20Q485 -20 398 18T248 128T149 307T113 551Q113 687 146 792T242 970T393 1080T594 1118Q697 1118 784 1081T934 971T1033 793T1069
+551ZM301 551Q301 342 369 237T592 131Q746 131 813 236T881 551Q881 760 813 863T590 967Q436 967 369 864T301 551ZM1173 1241H1052Q1001 1275 947 1323T841 1427Q787 1372 734 1324T630 1241H509V1268Q535 1297 569 1335T636 1413T699 1494T745 1569H937Q953
+1535 982 1495T1045 1414T1113 1335T1173 1268V1241Z" />
+<glyph unicode="&#xf5;" glyph-name="otilde" horiz-adv-x="1182" d="M1069 551Q1069 414 1036 308T940 129T788 18T588 -20Q485 -20 398 18T248 128T149 307T113 551Q113 687 146 792T242 970T393 1080T594 1118Q697 1118 784 1081T934 971T1033 793T1069 551ZM301
+551Q301 342 369 237T592 131Q746 131 813 236T881 551Q881 760 813 863T590 967Q436 967 369 864T301 551ZM992 1243Q952 1243 913 1260T835 1299T762 1338T695 1356Q650 1356 626 1330T588 1241H484Q489 1301 505 1350T548 1433T612 1486T695 1505Q737 1505 777
+1488T856 1449T928 1411T992 1393Q1037 1393 1060 1419T1098 1507H1203Q1198 1447 1182 1399T1139 1316T1075 1262T992 1243Z" />
+<glyph unicode="&#xf6;" glyph-name="odieresis" horiz-adv-x="1182" d="M1069 551Q1069 414 1036 308T940 129T788 18T588 -20Q485 -20 398 18T248 128T149 307T113 551Q113 687 146 792T242 970T393 1080T594 1118Q697 1118 784 1081T934 971T1033 793T1069
+551ZM301 551Q301 342 369 237T592 131Q746 131 813 236T881 551Q881 760 813 863T590 967Q436 967 369 864T301 551ZM556 1395Q556 1449 584 1473T652 1497Q691 1497 720 1473T749 1395Q749 1342 720 1317T652 1292Q612 1292 584 1317T556 1395ZM931 1395Q931
+1449 959 1473T1027 1497Q1046 1497 1063 1491T1094 1473T1115 1441T1123 1395Q1123 1342 1094 1317T1027 1292Q987 1292 959 1317T931 1395Z" />
+<glyph unicode="&#xf7;" glyph-name="divide" horiz-adv-x="1128" d="M102 647V797H1026V647H102ZM449 373Q449 408 458 431T482 470T518 491T563 498Q586 498 607 492T644 470T669 432T678 373Q678 340 669 317T644 278T607 255T563 248Q539 248 519 255T483
+277T458 316T449 373ZM449 1071Q449 1106 458 1129T482 1168T518 1189T563 1196Q586 1196 607 1190T644 1168T669 1130T678 1071Q678 1038 669 1015T644 976T607 953T563 946Q539 946 519 953T483 975T458 1014T449 1071Z" />
+<glyph unicode="&#xf8;" glyph-name="oslash" horiz-adv-x="1182" d="M1071 551Q1071 414 1038 308T942 129T790 18T590 -20Q465 -20 367 33L299 -76L168 -2L248 129Q185 201 150 307T115 551Q115 687 148 792T244 970T395 1080T596 1118Q659 1118 715 1104T821
+1061L889 1169L1020 1096L940 967Q1002 894 1036 790T1071 551ZM303 551Q303 467 312 402T344 285L741 932Q712 949 675 958T592 967Q438 967 371 864T303 551ZM883 551Q883 710 844 809L446 164Q477 147 513 139T594 131Q748 131 815 236T883 551Z" />
+<glyph unicode="&#xf9;" glyph-name="ugrave" horiz-adv-x="1206" d="M885 0L858 147H848Q823 104 789 73T713 21T626 -10T532 -20Q441 -20 372 3T257 75T188 200T164 381V1098H346V391Q346 261 399 196T563 131Q644 131 699 157T787 233T835 358T850 528V1098H1032V0H885ZM949
+1241H829Q794 1269 753 1310T674 1396T604 1480T556 1548V1569H775Q791 1535 812 1495T857 1414T904 1335T949 1268V1241Z" />
+<glyph unicode="&#xfa;" glyph-name="uacute" horiz-adv-x="1206" d="M885 0L858 147H848Q823 104 789 73T713 21T626 -10T532 -20Q441 -20 372 3T257 75T188 200T164 381V1098H346V391Q346 261 399 196T563 131Q644 131 699 157T787 233T835 358T850 528V1098H1032V0H885ZM489
+1268Q511 1297 534 1335T581 1413T626 1494T663 1569H882V1548Q866 1521 835 1481T765 1396T686 1311T610 1241H489V1268Z" />
+<glyph unicode="&#xfb;" glyph-name="ucircumflex" horiz-adv-x="1206" d="M885 0L858 147H848Q823 104 789 73T713 21T626 -10T532 -20Q441 -20 372 3T257 75T188 200T164 381V1098H346V391Q346 261 399 196T563 131Q644 131 699 157T787 233T835 358T850 528V1098H1032V0H885ZM930
+1241H809Q758 1275 704 1323T598 1427Q544 1372 491 1324T387 1241H266V1268Q292 1297 326 1335T393 1413T456 1494T502 1569H694Q710 1535 739 1495T802 1414T870 1335T930 1268V1241Z" />
+<glyph unicode="&#xfc;" glyph-name="udieresis" horiz-adv-x="1206" d="M885 0L858 147H848Q823 104 789 73T713 21T626 -10T532 -20Q441 -20 372 3T257 75T188 200T164 381V1098H346V391Q346 261 399 196T563 131Q644 131 699 157T787 233T835 358T850 528V1098H1032V0H885ZM309
+1395Q309 1449 337 1473T405 1497Q444 1497 473 1473T502 1395Q502 1342 473 1317T405 1292Q365 1292 337 1317T309 1395ZM684 1395Q684 1449 712 1473T780 1497Q799 1497 816 1491T847 1473T868 1441T876 1395Q876 1342 847 1317T780 1292Q740 1292 712 1317T684
+1395Z" />
+<glyph unicode="&#xfd;" glyph-name="yacute" horiz-adv-x="1001" d="M10 1098H199L414 485Q428 445 442 401T469 313T491 228T504 152H510Q515 177 526 220T550 311T578 407T604 487L803 1098H991L557 -143Q529 -224 497 -288T421 -398T320 -467T182 -492Q130
+-492 92 -487T27 -475V-330Q48 -335 80 -338T147 -342Q195 -342 230 -331T291 -297T335 -243T369 -170L426 -10L10 1098ZM407 1268Q429 1297 452 1335T499 1413T544 1494T581 1569H800V1548Q784 1521 753 1481T683 1396T604 1311T528 1241H407V1268Z" />
+<glyph unicode="&#xfe;" glyph-name="thorn" horiz-adv-x="1200" d="M356 950Q379 985 408 1015T475 1068T562 1104T670 1118Q764 1118 841 1082T972 975T1057 797T1087 551Q1087 410 1057 304T973 125T841 17T670 -20Q611 -20 563 -7T477 27T409 78T356 139H344Q347
+105 350 74Q352 48 354 21T356 -23V-492H174V1556H356V1098L348 950H356ZM635 967Q559 967 507 944T422 874T374 757T356 592V551Q356 450 369 372T415 240T502 159T637 131Q772 131 835 240T899 553Q899 761 836 864T635 967Z" />
+<glyph unicode="&#xff;" glyph-name="ydieresis" horiz-adv-x="1001" d="M10 1098H199L414 485Q428 445 442 401T469 313T491 228T504 152H510Q515 177 526 220T550 311T578 407T604 487L803 1098H991L557 -143Q529 -224 497 -288T421 -398T320 -467T182 -492Q130
+-492 92 -487T27 -475V-330Q48 -335 80 -338T147 -342Q195 -342 230 -331T291 -297T335 -243T369 -170L426 -10L10 1098ZM484 1395Q484 1449 512 1473T580 1497Q619 1497 648 1473T677 1395Q677 1342 648 1317T580 1292Q540 1292 512 1317T484 1395ZM859 1395Q859
+1449 887 1473T955 1497Q974 1497 991 1491T1022 1473T1043 1441T1051 1395Q1051 1342 1022 1317T955 1292Q915 1292 887 1317T859 1395Z" />
+<glyph unicode="&#x2013;" glyph-name="endash" horiz-adv-x="1024" d="M82 465V633H942V465H82Z" />
+<glyph unicode="&#x2014;" glyph-name="emdash" horiz-adv-x="2048" d="M82 465V633H1966V465H82Z" />
+<glyph unicode="&#x2018;" glyph-name="quoteleft" horiz-adv-x="358" d="M37 961L23 983Q37 1037 56 1098T99 1221T148 1344T199 1462H336Q321 1401 307 1335T279 1204T255 1076T236 961H37Z" />
+<glyph unicode="&#x2019;" glyph-name="quoteright" horiz-adv-x="358" d="M322 1462L336 1440Q322 1385 303 1325T260 1202T211 1078T160 961H23Q37 1021 51 1087T79 1219T104 1347T123 1462H322Z" />
+<glyph unicode="&#x201a;" glyph-name="quotesinglbase" horiz-adv-x="512" d="M362 238L377 215Q363 161 344 100T301 -23T252 -146T201 -264H63Q78 -203 92 -137T120 -6T145 122T164 238H362Z" />
+<glyph unicode="&#x201c;" glyph-name="quotedblleft" horiz-adv-x="743" d="M422 961L408 983Q422 1037 441 1098T484 1221T533 1344T584 1462H721Q706 1401 692 1335T664 1204T640 1076T621 961H422ZM37 961L23 983Q37 1037 56 1098T99 1221T148 1344T199 1462H336Q321
+1401 307 1335T279 1204T255 1076T236 961H37Z" />
+<glyph unicode="&#x201d;" glyph-name="quotedblright" horiz-adv-x="743" d="M322 1462L336 1440Q322 1385 303 1325T260 1202T211 1078T160 961H23Q37 1021 51 1087T79 1219T104 1347T123 1462H322ZM707 1462L721 1440Q707 1385 688 1325T645 1202T596 1078T545
+961H408Q422 1021 436 1087T464 1219T489 1347T508 1462H707Z" />
+<glyph unicode="&#x201e;" glyph-name="quotedblbase" horiz-adv-x="897" d="M362 238L377 215Q363 161 344 100T301 -23T252 -146T201 -264H63Q78 -203 92 -137T120 -6T145 122T164 238H362ZM748 238L762 215Q748 161 729 100T686 -23T637 -146T586 -264H449Q463
+-203 477 -137T505 -6T530 122T549 238H748Z" />
+<glyph unicode="&#x2022;" glyph-name="bullet" horiz-adv-x="770" d="M150 748Q150 819 168 869T217 950T292 996T385 1010Q434 1010 477 996T552 951T602 869T621 748Q621 678 603 628T552 547T477 500T385 485Q335 485 292 500T218 546T168 628T150 748Z" />
+<glyph unicode="&#x2039;" glyph-name="guilsinglleft" horiz-adv-x="590" d="M82 553L391 967L508 889L270 541L508 193L391 115L82 526V553Z" />
+<glyph unicode="&#x203a;" glyph-name="guilsinglright" horiz-adv-x="590" d="M508 526L199 115L82 193L319 541L82 889L199 967L508 553V526Z" />
+</font>
+</defs>
+</svg>
diff --git a/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-regular.ttf b/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-regular.ttf
new file mode 100644
index 0000000000..fb8cea662b
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-regular.ttf
Binary files differ
diff --git a/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-regular.woff b/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-regular.woff
new file mode 100644
index 0000000000..abf19899f7
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-regular.woff
Binary files differ
diff --git a/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-regular.woff2 b/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-regular.woff2
new file mode 100644
index 0000000000..9f93f74c3b
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-regular.woff2
Binary files differ
diff --git a/openecomp-be/tools/swagger-ui/images/Thumbs.db b/openecomp-be/tools/swagger-ui/images/Thumbs.db
new file mode 100644
index 0000000000..400bf4e0ec
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/images/Thumbs.db
Binary files differ
diff --git a/openecomp-be/tools/swagger-ui/images/explorer_icons.png b/openecomp-be/tools/swagger-ui/images/explorer_icons.png
new file mode 100644
index 0000000000..ed9d2fffb6
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/images/explorer_icons.png
Binary files differ
diff --git a/openecomp-be/tools/swagger-ui/images/favicon-16x16.png b/openecomp-be/tools/swagger-ui/images/favicon-16x16.png
new file mode 100644
index 0000000000..66b1a5bfb9
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/images/favicon-16x16.png
Binary files differ
diff --git a/openecomp-be/tools/swagger-ui/images/favicon-32x32.png b/openecomp-be/tools/swagger-ui/images/favicon-32x32.png
new file mode 100644
index 0000000000..32f319f89b
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/images/favicon-32x32.png
Binary files differ
diff --git a/openecomp-be/tools/swagger-ui/images/favicon.ico b/openecomp-be/tools/swagger-ui/images/favicon.ico
new file mode 100644
index 0000000000..36c02749fc
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/images/favicon.ico
Binary files differ
diff --git a/openecomp-be/tools/swagger-ui/images/logo_small.png b/openecomp-be/tools/swagger-ui/images/logo_small.png
new file mode 100644
index 0000000000..5496a65579
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/images/logo_small.png
Binary files differ
diff --git a/openecomp-be/tools/swagger-ui/images/pet_store_api.png b/openecomp-be/tools/swagger-ui/images/pet_store_api.png
new file mode 100644
index 0000000000..f9f9cd4aeb
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/images/pet_store_api.png
Binary files differ
diff --git a/openecomp-be/tools/swagger-ui/images/throbber.gif b/openecomp-be/tools/swagger-ui/images/throbber.gif
new file mode 100644
index 0000000000..0639388924
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/images/throbber.gif
Binary files differ
diff --git a/openecomp-be/tools/swagger-ui/images/wordnik_api.png b/openecomp-be/tools/swagger-ui/images/wordnik_api.png
new file mode 100644
index 0000000000..dca4f1455a
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/images/wordnik_api.png
Binary files differ
diff --git a/openecomp-be/tools/swagger-ui/index.html b/openecomp-be/tools/swagger-ui/index.html
new file mode 100644
index 0000000000..fe0c8ad7c7
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/index.html
@@ -0,0 +1,328 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="UTF-8">
+ <title>API Docs</title>
+ <link rel="SHORTCUT ICON" href="images/favicon.ico"/>
+ <link href='css/typography.css' media='screen' rel='stylesheet' type='text/css'/>
+ <link href='css/reset.css' media='screen' rel='stylesheet' type='text/css'/>
+ <link href='css/screen.css' media='screen' rel='stylesheet' type='text/css'/>
+ <link href='css/reset.css' media='print' rel='stylesheet' type='text/css'/>
+ <link href='css/print.css' media='print' rel='stylesheet' type='text/css'/>
+ <!--Custom: Take from application\frontend\nfv-client\dist\optimize\resources\nfv\css\style.css-->
+ <link href='css/ncso-style.css' rel='stylesheet' type='text/css'/>
+ <!--/Custom: Take from application\frontend\nfv-client\dist\optimize\resources\nfv\css\style.css-->
+
+ <script src='lib/jquery-1.8.0.min.js' type='text/javascript'></script>
+ <script src='lib/jquery.slideto.min.js' type='text/javascript'></script>
+ <script src='lib/jquery.wiggle.min.js' type='text/javascript'></script>
+ <script src='lib/jquery.ba-bbq.min.js' type='text/javascript'></script>
+ <script src='lib/handlebars-2.0.0.js' type='text/javascript'></script>
+ <script src='lib/underscore-min.js' type='text/javascript'></script>
+ <script src='lib/backbone-min.js' type='text/javascript'></script>
+ <script src='swagger-ui.js' type='text/javascript'></script>
+ <script src='lib/highlight.7.3.pack.js' type='text/javascript'></script>
+ <script src='lib/marked.js' type='text/javascript'></script>
+ <script src='lib/swagger-oauth.js' type='text/javascript'></script>
+
+ <!-- Some basic translations -->
+ <!-- <script src='lang/translator.js' type='text/javascript'></script> -->
+ <!-- <script src='lang/ru.js' type='text/javascript'></script> -->
+ <!-- <script src='lang/en.js' type='text/javascript'></script> -->
+
+ <script type="text/javascript">
+ $(function () {
+ var url = window.location.protocol + "//" + window.location.host;
+ if (window.location.pathname.indexOf('/api-docs') > 0) {
+ url += window.location.pathname.substring(0, window.location.pathname.indexOf('/api-docs'))
+ }
+ url += "/api-docs/api.json";
+ log('API URL: ' + url);
+
+ // Pre load translate...
+ if(window.SwaggerTranslator) {
+ window.SwaggerTranslator.translate();
+ }
+ window.swaggerUi = new SwaggerUi({
+ url: url,
+ dom_id: "swagger-ui-container",
+ supportedSubmitMethods: ['get', 'post', 'put', 'delete', 'patch'],
+ onComplete: function(swaggerApi, swaggerUi){
+ if(typeof initOAuth == "function") {
+ initOAuth({
+ clientId: "your-client-id",
+ clientSecret: "your-client-secret",
+ realm: "your-realms",
+ appName: "your-app-name",
+ scopeSeparator: ","
+ });
+ }
+
+ if(window.SwaggerTranslator) {
+ window.SwaggerTranslator.translate();
+ }
+
+ $('pre code').each(function(i, e) {
+ hljs.highlightBlock(e)
+ });
+
+ },
+ onFailure: function(data) {
+ log("Unable to Load SwaggerUI");
+ },
+ docExpansion: "none",
+ apisSorter: "alpha",
+ showRequestHeaders: false
+ });
+
+
+ window.swaggerUi.load();
+
+ function log() {
+ if ('console' in window) {
+ console.log.apply(console, arguments);
+ }
+ }
+ });
+ </script>
+
+ <!-- Hide the swagger io -->
+ <style>
+ .footer a, .footer img{
+ display: none !important;
+ }
+ </style>
+</head>
+
+<body class="swagger-section">
+
+<!--NCSO script-->
+<script>
+
+ //SET TITLE - START
+ function pollData() {
+ if(!(document.querySelector('#api_info .info_title') && document.querySelector('#api_info .info_title').innerText)) {
+ setTimeout(pollData, 50);
+ }
+ else {
+ setData();
+ }
+ }
+
+ function setData() {
+ document.querySelector('[data-uxf-point="main-title"]').innerText = document.querySelector('#api_info .info_title').innerText;
+ document.querySelector('#api_info .info_title').innerText = '';
+ }
+
+ pollData();
+ //SET TITLE - END
+
+ var __LOGIN_REST_STATUS = {OPEN: 'OPEN', SEND: 'SEND'};
+ var __loginPath = '/auth/tokens', __isLoginInProcess, __xAuthToken;
+
+ function isAuthanticationRest(path) {
+ return path.endsWith(__loginPath);
+ }
+
+ //Proxy requests - START
+
+ //Proxy Open Method
+ (function() {
+ var proxiedOpen = window.XMLHttpRequest.prototype.open;
+ window.XMLHttpRequest.prototype.open = function(method, path) {
+ if(isAuthanticationRest(path)) {
+ __isLoginInProcess = true;
+ }
+ else {
+ __isLoginInProcess = false;
+ }
+ return proxiedOpen.apply(this, Array.prototype.slice.call(arguments));
+ };
+ })();
+
+ //Proxy Send Method - X-AUTH-STUFF
+ (function() {
+ var proxiedSend = window.XMLHttpRequest.prototype.send;
+ window.XMLHttpRequest.prototype.send = function() {
+ if(__isLoginInProcess) {
+ proxyAuthanticationCallback(this);
+ }
+ return proxiedSend.apply(this, Array.prototype.slice.call(arguments));
+ };
+ })();
+
+ //Proxy Authantication Callback Method - X-AUTH-STUFF
+ function proxyAuthanticationCallback(xhrObject) {
+ var proxy = xhrObject.onreadystatechange;
+ xhrObject.onreadystatechange = function() {
+ if (xhrObject.readyState == 4) {
+ if(xhrObject.status == 200 || xhrObject.status == 401) {
+ window.swaggerUi.api.clientAuthorizations.remove('X-AUTH-TOKEN');
+ if(xhrObject.status == 200) {
+ var key = xhrObject.getResponseHeader('x-auth-token');
+ if(key && key.trim() != "") {
+ var apiKeyAuth = new SwaggerClient.ApiKeyAuthorization("X-AUTH-TOKEN", key, "header");
+ window.swaggerUi.api.clientAuthorizations.add("X-AUTH-TOKEN", apiKeyAuth);
+ console.log("added x-auth-key ", key);
+ }
+ }
+ }
+ }
+ return proxy.apply(xhrObject, Array.prototype.slice.call(arguments));
+ }
+ }
+
+ //Proxy Send Method - CUSTOM HEADERS STUFF
+ (function () {
+ var proxiedSend = window.XMLHttpRequest.prototype.send;
+ window.XMLHttpRequest.prototype.send = function () {
+ var headerItems = document.querySelectorAll('.custom-headers .headers-list .header-item');
+ if (headerItems) {
+ Array.prototype.forEach.call(headerItems, function (header) {
+ var headerName = header.querySelector('.header-name').value;
+ var headerValue = header.querySelector('.header-value').value;
+ if (headerName && headerValue) {
+ this.setRequestHeader(headerName, headerValue);
+ }
+ }, this);
+ }
+ return proxiedSend.apply(this, Array.prototype.slice.call(arguments));
+ };
+ })();
+
+ //Proxy requests - END
+
+</script>
+
+<div data-uxf-point="nfv-header" class="nfv-header">
+ <div class="header-content-wrapper">
+ <div data-uxf-point="nfv-logo" class="nfv-logo"><a href="../ncso/landingpage.html">VENDOR</a></div>
+ <div data-uxf-point="header-title" class="header-title">
+ <div data-uxf-point="main-title" class="main-title"></div>
+ <div data-uxf-point="version-controller" class="version-select"></div>
+ <div data-uxf-point="sub-title" class="sub-title"></div>
+ </div>
+ </div>
+</div>
+
+<div class="custom-headers">
+ <style>
+ .custom-headers {
+ margin-left: 124px;
+ width: 500px;
+ border: 1px solid #419EF1;
+ }
+
+ .custom-headers .headers-title {
+ background-color: #0F6AB4;
+ height: 24px;
+ color: white;
+ text-align: center;
+ font-size: 1.2em;
+ }
+
+ .custom-headers .headers-list .header-item {
+ display: flex;
+ justify-content: space-around;
+ padding: 10px 5px 0 5px;
+ }
+
+ .custom-headers .headers-list .header-item.default-item .header-col.header-delete {
+ visibility: hidden;
+ }
+
+ .custom-headers .headers-list .header-item.default-item .header-col.header-name {
+ pointer-events: none;
+ }
+
+ .custom-headers .headers-list .header-item .header-col.header-delete {
+ cursor: pointer;
+ align-self: center;
+ }
+
+ .custom-headers .add-header {
+ text-align: right;
+ padding: 5px;
+ border-top: 1px solid #0F6AB4;
+ margin-top: 10px;
+ background-color: #E7F6EC;
+ }
+
+ .custom-headers .add-header .add-header-button, .custom-headers .add-header .reset-header-button {
+
+ text-decoration: none;
+ color: white;
+ display: inline-block;
+ width: 50px;
+ font-size: 0.9em;
+ text-align: center;
+ padding: 7px 0 4px;
+ -moz-border-radius: 2px;
+ -webkit-border-radius: 2px;
+ -o-border-radius: 2px;
+ -ms-border-radius: 2px;
+ -khtml-border-radius: 2px;
+ border-radius: 2px;
+ background-color: #0f6ab4;
+ cursor: pointer;
+ }
+
+ .custom-headers .add-header .reset-header-button {
+
+ }
+ </style>
+ <div class="headers-title">Custom Headers</div>
+ <div class="headers-list">
+ <!--Dynamically add headers using addHeaderItem function-->
+ </div>
+ <div class="add-header">
+ <span class="reset-header-button" onclick="resetHeaderItems();">Reset</span>
+ <span class="add-header-button" onclick="addHeaderItem();">Add</span>
+ </div>
+ <script>
+ function addHeaderItem(defaultName, defaultValue) {
+
+ var headerItemName = document.createElement('input');
+ headerItemName.type = 'text';
+ headerItemName.value = defaultName || '';
+ headerItemName.classList.add('header-col', 'header-name');
+
+ var headerItemValue = document.createElement('input');
+ headerItemValue.type = 'text';
+ headerItemValue.value = defaultValue || '';
+ headerItemValue.classList.add('header-col', 'header-value');
+
+ var headerItemDelete = document.createElement('div');
+ headerItemDelete.innerHTML = '&#10006;';
+ headerItemDelete.classList.add('header-col', 'header-delete');
+
+ var headerItem = document.createElement('div');
+ headerItem.classList.add('header-item');
+ headerItem.appendChild(headerItemName);
+ headerItem.appendChild(headerItemValue);
+ headerItem.appendChild(headerItemDelete);
+
+ headerItemDelete.onclick = function () {
+ headersList.removeChild(headerItem);
+ };
+
+ var headersList = document.querySelector('.custom-headers .headers-list');
+ headersList.appendChild(headerItem);
+
+ return headerItem;
+ }
+ function resetHeaderItems() {
+ var headersList = document.querySelector('.custom-headers .headers-list');
+ while (headersList.firstChild) {
+ headersList.removeChild(headersList.firstChild);
+ }
+ var defaultHeaderItem = addHeaderItem('USER_ID');
+ defaultHeaderItem.classList.add('default-item');
+ }
+ resetHeaderItems();
+ </script>
+</div>
+<div id="message-bar" class="swagger-ui-wrap" data-sw-translate>&nbsp;</div>
+<div id="swagger-ui-container" class="swagger-ui-wrap"></div>
+</body>
+</html>
diff --git a/openecomp-be/tools/swagger-ui/lang/en.js b/openecomp-be/tools/swagger-ui/lang/en.js
new file mode 100644
index 0000000000..9ed12ccffb
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/lang/en.js
@@ -0,0 +1,73 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+'use strict';
+
+/* jshint quotmark: double */
+window.SwaggerTranslator.learn({
+ "Warning: Deprecated":"Warning: Deprecated",
+ "Implementation Notes":"Implementation Notes",
+ "Response Class":"Response Class",
+ "Status":"Status",
+ "Parameters":"Parameters",
+ "Parameter":"Parameter",
+ "Value":"Value",
+ "Description":"Description",
+ "Parameter Type":"Parameter Type",
+ "Data Type":"Data Type",
+ "Response Messages":"Response Messages",
+ "HTTP Status Code":"HTTP Status Code",
+ "Reason":"Reason",
+ "Response Model":"Response Model",
+ "Request URL":"Request URL",
+ "Response Body":"Response Body",
+ "Response Code":"Response Code",
+ "Response Headers":"Response Headers",
+ "Hide Response":"Hide Response",
+ "Headers":"Headers",
+ "Try it out!":"Try it out!",
+ "Show/Hide":"Show/Hide",
+ "List Operations":"List Operations",
+ "Expand Operations":"Expand Operations",
+ "Raw":"Raw",
+ "can't parse JSON. Raw result":"can't parse JSON. Raw result",
+ "Model Schema":"Model Schema",
+ "Model":"Model",
+ "apply":"apply",
+ "Username":"Username",
+ "Password":"Password",
+ "Terms of service":"Terms of service",
+ "Created by":"Created by",
+ "See more at":"See more at",
+ "Contact the developer":"Contact the developer",
+ "api version":"api version",
+ "Response Content Type":"Response Content Type",
+ "fetching resource":"fetching resource",
+ "fetching resource list":"fetching resource list",
+ "Explore":"Explore",
+ "Show Swagger Petstore Example Apis":"Show Swagger Petstore Example Apis",
+ "Can't read from server. It may not have the appropriate access-control-origin settings.":"Can't read from server. It may not have the appropriate access-control-origin settings.",
+ "Please specify the protocol for":"Please specify the protocol for",
+ "Can't read swagger JSON from":"Can't read swagger JSON from",
+ "Finished Loading Resource Information. Rendering Swagger UI":"Finished Loading Resource Information. Rendering Swagger UI",
+ "Unable to read api":"Unable to read api",
+ "from path":"from path",
+ "server returned":"server returned"
+});
diff --git a/openecomp-be/tools/swagger-ui/lang/es.js b/openecomp-be/tools/swagger-ui/lang/es.js
new file mode 100644
index 0000000000..bd948fc27b
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/lang/es.js
@@ -0,0 +1,72 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+'use strict';
+
+/* jshint quotmark: double */
+window.SwaggerTranslator.learn({
+ "Warning: Deprecated":"Advertencia: Obsoleto",
+ "Implementation Notes":"Notas de implementación",
+ "Response Class":"Clase de la Respuesta",
+ "Status":"Status",
+ "Parameters":"Parámetros",
+ "Parameter":"Parámetro",
+ "Value":"Valor",
+ "Description":"Descripción",
+ "Parameter Type":"Tipo del Parámetro",
+ "Data Type":"Tipo del Dato",
+ "Response Messages":"Mensajes de la Respuesta",
+ "HTTP Status Code":"Código de Status HTTP",
+ "Reason":"Razón",
+ "Response Model":"Modelo de la Respuesta",
+ "Request URL":"URL de la Solicitud",
+ "Response Body":"Cuerpo de la Respuesta",
+ "Response Code":"Código de la Respuesta",
+ "Response Headers":"Encabezados de la Respuesta",
+ "Hide Response":"Ocultar Respuesta",
+ "Try it out!":"Pruébalo!",
+ "Show/Hide":"Mostrar/Ocultar",
+ "List Operations":"Listar Operaciones",
+ "Expand Operations":"Expandir Operaciones",
+ "Raw":"Crudo",
+ "can't parse JSON. Raw result":"no puede parsear el JSON. Resultado crudo",
+ "Model Schema":"Esquema del Modelo",
+ "Model":"Modelo",
+ "apply":"aplicar",
+ "Username":"Nombre de usuario",
+ "Password":"Contraseña",
+ "Terms of service":"Términos de Servicio",
+ "Created by":"Creado por",
+ "See more at":"Ver más en",
+ "Contact the developer":"Contactar al desarrollador",
+ "api version":"versión de la api",
+ "Response Content Type":"Tipo de Contenido (Content Type) de la Respuesta",
+ "fetching resource":"buscando recurso",
+ "fetching resource list":"buscando lista del recurso",
+ "Explore":"Explorar",
+ "Show Swagger Petstore Example Apis":"Mostrar Api Ejemplo de Swagger Petstore",
+ "Can't read from server. It may not have the appropriate access-control-origin settings.":"No se puede leer del servidor. Tal vez no tiene la configuración de control de acceso de origen (access-control-origin) apropiado.",
+ "Please specify the protocol for":"Por favor, especificar el protocola para",
+ "Can't read swagger JSON from":"No se puede leer el JSON de swagger desde",
+ "Finished Loading Resource Information. Rendering Swagger UI":"Finalizada la carga del recurso de Información. Mostrando Swagger UI",
+ "Unable to read api":"No se puede leer la api",
+ "from path":"desde ruta",
+ "server returned":"el servidor retornó"
+});
diff --git a/openecomp-be/tools/swagger-ui/lang/ja.js b/openecomp-be/tools/swagger-ui/lang/ja.js
new file mode 100644
index 0000000000..895353c525
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/lang/ja.js
@@ -0,0 +1,73 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+'use strict';
+
+/* jshint quotmark: double */
+window.SwaggerTranslator.learn({
+ "Warning: Deprecated":"警告: 廃止予定",
+ "Implementation Notes":"実装メモ",
+ "Response Class":"レス�?ンスクラス",
+ "Status":"ステータス",
+ "Parameters":"パラメータ群",
+ "Parameter":"パラメータ",
+ "Value":"値",
+ "Description":"説明",
+ "Parameter Type":"パラメータタイプ",
+ "Data Type":"データタイプ",
+ "Response Messages":"レス�?ンスメッセージ",
+ "HTTP Status Code":"HTTPステータスコード",
+ "Reason":"�?�由",
+ "Response Model":"レス�?ンスモデル",
+ "Request URL":"リクエストURL",
+ "Response Body":"レス�?ンスボディ",
+ "Response Code":"レス�?ンスコード",
+ "Response Headers":"レス�?ンスヘッダ",
+ "Hide Response":"レス�?ンスを隠�?�",
+ "Headers":"ヘッダ",
+ "Try it out!":"実際�?�実行!",
+ "Show/Hide":"表示/�?�表示",
+ "List Operations":"�?作一覧",
+ "Expand Operations":"�?作�?�展開",
+ "Raw":"Raw",
+ "can't parse JSON. Raw result":"JSON�?�解釈�?��??�?��?�ん. 未加工�?��?果",
+ "Model Schema":"モデルスキーマ",
+ "Model":"モデル",
+ "apply":"実行",
+ "Username":"ユーザ�??",
+ "Password":"パスワード",
+ "Terms of service":"サービス利用�?約",
+ "Created by":"Created by",
+ "See more at":"See more at",
+ "Contact the developer":"開発者�?�連絡",
+ "api version":"API�?ージョン",
+ "Response Content Type":"レス�?ンス コンテンツタイプ",
+ "fetching resource":"リソース�?��?�得",
+ "fetching resource list":"リソース一覧�?��?�得",
+ "Explore":"Explore",
+ "Show Swagger Petstore Example Apis":"SwaggerペットストアAPI�?�表示",
+ "Can't read from server. It may not have the appropriate access-control-origin settings.":"サー�?�?�ら読�?�込�?�?��?�ん. �?�切�?�access-control-origin設定を�?�?��?��?��?��?��?�能性�?��?�り�?��?�.",
+ "Please specify the protocol for":"プロトコルを指定�?��?��??�?��?��?�",
+ "Can't read swagger JSON from":"次�?�らswagger JSONを読�?�込�?�?��?�ん",
+ "Finished Loading Resource Information. Rendering Swagger UI":"リソース情報�?�読�?�込�?��?�完了�?��?��?��?�. Swagger UIを�??画�?��?��?��?��?�",
+ "Unable to read api":"APIを読�?�込�?�?��?�ん",
+ "from path":"次�?�パス�?�ら",
+ "server returned":"サー�?�?�ら�?�返答"
+});
diff --git a/openecomp-be/tools/swagger-ui/lang/pt.js b/openecomp-be/tools/swagger-ui/lang/pt.js
new file mode 100644
index 0000000000..a74b4a3d01
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/lang/pt.js
@@ -0,0 +1,73 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+'use strict';
+
+/* jshint quotmark: double */
+window.SwaggerTranslator.learn({
+ "Warning: Deprecated":"Aviso: Depreciado",
+ "Implementation Notes":"Notas de Implementação",
+ "Response Class":"Classe de resposta",
+ "Status":"Status",
+ "Parameters":"Parâmetros",
+ "Parameter":"Parâmetro",
+ "Value":"Valor",
+ "Description":"Descrição",
+ "Parameter Type":"Tipo de parâmetro",
+ "Data Type":"Tipo de dados",
+ "Response Messages":"Mensagens de resposta",
+ "HTTP Status Code":"Código de status HTTP",
+ "Reason":"Razão",
+ "Response Model":"Modelo resposta",
+ "Request URL":"URL requisição",
+ "Response Body":"Corpo da resposta",
+ "Response Code":"Código da resposta",
+ "Response Headers":"Cabeçalho da resposta",
+ "Headers":"Cabeçalhos",
+ "Hide Response":"Esconder resposta",
+ "Try it out!":"Tente agora!",
+ "Show/Hide":"Mostrar/Esconder",
+ "List Operations":"Listar operações",
+ "Expand Operations":"Expandir operações",
+ "Raw":"Cru",
+ "can't parse JSON. Raw result":"Falha ao analisar JSON. Resulto cru",
+ "Model Schema":"Modelo esquema",
+ "Model":"Modelo",
+ "apply":"Aplicar",
+ "Username":"Usuário",
+ "Password":"Senha",
+ "Terms of service":"Termos do serviço",
+ "Created by":"Criado por",
+ "See more at":"Veja mais em",
+ "Contact the developer":"Contate o desenvolvedor",
+ "api version":"Versão api",
+ "Response Content Type":"Tipo de conteúdo da resposta",
+ "fetching resource":"busca recurso",
+ "fetching resource list":"buscando lista de recursos",
+ "Explore":"Explorar",
+ "Show Swagger Petstore Example Apis":"Show Swagger Petstore Example Apis",
+ "Can't read from server. It may not have the appropriate access-control-origin settings.":"Não é possível ler do servidor. Pode não ter as apropriadas configurações access-control-origin",
+ "Please specify the protocol for":"Por favor especifique o protocolo",
+ "Can't read swagger JSON from":"Não é possível ler o JSON Swagger de",
+ "Finished Loading Resource Information. Rendering Swagger UI":"Carregar informação de recurso finalizada. Renderizando Swagger UI",
+ "Unable to read api":"Não foi possível ler api",
+ "from path":"do caminho",
+ "server returned":"servidor retornou"
+});
diff --git a/openecomp-be/tools/swagger-ui/lang/ru.js b/openecomp-be/tools/swagger-ui/lang/ru.js
new file mode 100644
index 0000000000..ce117fd84e
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/lang/ru.js
@@ -0,0 +1,72 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+'use strict';
+
+/* jshint quotmark: double */
+window.SwaggerTranslator.learn({
+ "Warning: Deprecated":"Ворнинг: Депрекейтед",
+ "Implementation Notes":"Заметки",
+ "Response Class":"Пример ответа",
+ "Status":"Стату�?",
+ "Parameters":"Параметры",
+ "Parameter":"Параметр",
+ "Value":"Значение",
+ "Description":"Опи�?ание",
+ "Parameter Type":"Тип параметра",
+ "Data Type":"Тип данных",
+ "HTTP Status Code":"HTTP код",
+ "Reason":"Причина",
+ "Response Model":"Структура ответа",
+ "Request URL":"URL запро�?а",
+ "Response Body":"Тело ответа",
+ "Response Code":"HTTP код ответа",
+ "Response Headers":"Заголовки ответа",
+ "Hide Response":"Спр�?тать ответ",
+ "Response Messages":"Что может прийти в ответ",
+ "Try it out!":"Попробовать!",
+ "Show/Hide":"Показать/Скрыть",
+ "List Operations":"Операции кратко",
+ "Expand Operations":"Операции подробно",
+ "Raw":"В �?ыром виде",
+ "can't parse JSON. Raw result":"�?е удает�?�? ра�?пар�?ить ответ:",
+ "Model Schema":"Структура",
+ "Model":"Опи�?ание",
+ "apply":"применить",
+ "Username":"Им�? пользовател�?",
+ "Password":"Пароль",
+ "Terms of service":"У�?лови�? и�?пользовани�?",
+ "Created by":"Разработано",
+ "See more at":"Еще тут",
+ "Contact the developer":"Св�?зать�?�? �? разработчиком",
+ "api version":"Вер�?и�? API",
+ "Response Content Type":"Content Type ответа",
+ "fetching resource":"Получение ре�?ур�?а",
+ "fetching resource list":"Получение ре�?ур�?ов",
+ "Explore":"Поехали",
+ "Show Swagger Petstore Example Apis":"Показать примеры �?ПИ",
+ "Can't read from server. It may not have the appropriate access-control-origin settings.":"�?е удает�?�? получить ответ от �?ервера. Возможно, кака�?-то лажа �? на�?тройками до�?тупа",
+ "Please specify the protocol for":"Пожалуй�?та, укажите протогол дл�?",
+ "Can't read swagger JSON from":"�?е получает�?�? прочитать swagger json из",
+ "Finished Loading Resource Information. Rendering Swagger UI":"Загрузка информации о ре�?ур�?ах завершена. Рендерим",
+ "Unable to read api":"�?е удало�?ь прочитать api",
+ "from path":"по адре�?у",
+ "server returned":"�?ервер �?казал"
+});
diff --git a/openecomp-be/tools/swagger-ui/lang/tr.js b/openecomp-be/tools/swagger-ui/lang/tr.js
new file mode 100644
index 0000000000..359583e4b4
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/lang/tr.js
@@ -0,0 +1,73 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+'use strict';
+
+/* jshint quotmark: double */
+window.SwaggerTranslator.learn({
+ "Warning: Deprecated":"Uyarı: Deprecated",
+ "Implementation Notes":"Gerçekleştirim Notları",
+ "Response Class":"Dönen Sınıf",
+ "Status":"Statü",
+ "Parameters":"Parametreler",
+ "Parameter":"Parametre",
+ "Value":"DeÄŸer",
+ "Description":"Açıklama",
+ "Parameter Type":"Parametre Tipi",
+ "Data Type":"Veri Tipi",
+ "Response Messages":"Dönüş Mesajı",
+ "HTTP Status Code":"HTTP Statü Kodu",
+ "Reason":"Gerekçe",
+ "Response Model":"Dönüş Modeli",
+ "Request URL":"Ä°stek URL",
+ "Response Body":"Dönüş İçeriği",
+ "Response Code":"Dönüş Kodu",
+ "Response Headers":"Dönüş Üst Bilgileri",
+ "Hide Response":"Dönüşü Gizle",
+ "Headers":"Ãœst Bilgiler",
+ "Try it out!":"Dene!",
+ "Show/Hide":"Göster/Gizle",
+ "List Operations":"Operasyonları Listele",
+ "Expand Operations":"Operasyonları Aç",
+ "Raw":"Ham",
+ "can't parse JSON. Raw result":"JSON çözümlenemiyor. Ham sonuç",
+ "Model Schema":"Model Åžema",
+ "Model":"Model",
+ "apply":"uygula",
+ "Username":"Kullanıcı Adı",
+ "Password":"Parola",
+ "Terms of service":"Servis şartları",
+ "Created by":"OluÅŸturan",
+ "See more at":"Daha fazlası için",
+ "Contact the developer":"Geliştirici ile İletişime Geçin",
+ "api version":"api versiyon",
+ "Response Content Type":"Dönüş İçerik Tipi",
+ "fetching resource":"kaynak getiriliyor",
+ "fetching resource list":"kaynak listesi getiriliyor",
+ "Explore":"KeÅŸfet",
+ "Show Swagger Petstore Example Apis":"Swagger Petstore Örnek Api'yi Gör",
+ "Can't read from server. It may not have the appropriate access-control-origin settings.":"Sunucudan okuma yapılamıyor. Sunucu access-control-origin ayarlarınızı kontrol edin.",
+ "Please specify the protocol for":"Lütfen istenen adres için protokol belirtiniz",
+ "Can't read swagger JSON from":"Swagger JSON bu kaynaktan okunamıyor",
+ "Finished Loading Resource Information. Rendering Swagger UI":"Kaynak baglantısı tamamlandı. Swagger UI gösterime hazırlanıyor",
+ "Unable to read api":"api okunamadı",
+ "from path":"yoldan",
+ "server returned":"sunucuya dönüldü"
+});
diff --git a/openecomp-be/tools/swagger-ui/lang/translator.js b/openecomp-be/tools/swagger-ui/lang/translator.js
new file mode 100644
index 0000000000..9232ac18a6
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/lang/translator.js
@@ -0,0 +1,59 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+'use strict';
+
+/**
+ * Translator for documentation pages.
+ *
+ * To enable translation you should include one of language-files in your index.html
+ * after <script src='lang/translator.js' type='text/javascript'></script>.
+ * For example - <script src='lang/ru.js' type='text/javascript'></script>
+ *
+ * If you wish to translate some new texsts you should do two things:
+ * 1. Add a new phrase pair ("New Phrase": "New Translation") into your language file (for example lang/ru.js). It will be great if you add it in other language files too.
+ * 2. Mark that text it templates this way <anyHtmlTag data-sw-translate>New Phrase</anyHtmlTag> or <anyHtmlTag data-sw-translate value='New Phrase'/>.
+ * The main thing here is attribute data-sw-translate. Only inner html, title-attribute and value-attribute are going to translate.
+ *
+ */
+window.SwaggerTranslator = {
+
+ _words:[],
+
+ translate: function(sel) {
+ var $this = this;
+ sel = sel || '[data-sw-translate]';
+
+ $(sel).each(function() {
+ $(this).html($this._tryTranslate($(this).html()));
+
+ $(this).val($this._tryTranslate($(this).val()));
+ $(this).attr('title', $this._tryTranslate($(this).attr('title')));
+ });
+ },
+
+ _tryTranslate: function(word) {
+ return this._words[$.trim(word)] !== undefined ? this._words[$.trim(word)] : word;
+ },
+
+ learn: function(wordsMap) {
+ this._words = wordsMap;
+ }
+};
diff --git a/openecomp-be/tools/swagger-ui/lang/zh-cn.js b/openecomp-be/tools/swagger-ui/lang/zh-cn.js
new file mode 100644
index 0000000000..e1fde6e7cc
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/lang/zh-cn.js
@@ -0,0 +1,73 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+'use strict';
+
+/* jshint quotmark: double */
+window.SwaggerTranslator.learn({
+ "Warning: Deprecated":"警告:已过时",
+ "Implementation Notes":"实现备注",
+ "Response Class":"�?应类",
+ "Status":"状�?",
+ "Parameters":"�?�数",
+ "Parameter":"�?�数",
+ "Value":"值",
+ "Description":"�??述",
+ "Parameter Type":"�?�数类型",
+ "Data Type":"数�?�类型",
+ "Response Messages":"�?应消�?�",
+ "HTTP Status Code":"HTTP状�?�?",
+ "Reason":"原因",
+ "Response Model":"�?应模型",
+ "Request URL":"请求URL",
+ "Response Body":"�?应体",
+ "Response Code":"�?应�?",
+ "Response Headers":"�?应头",
+ "Hide Response":"�?�?�?应",
+ "Headers":"头",
+ "Try it out!":"试一下�?",
+ "Show/Hide":"显示/�?�?",
+ "List Operations":"显示�?作",
+ "Expand Operations":"展开�?作",
+ "Raw":"原始",
+ "can't parse JSON. Raw result":"无法解�?JSON. 原始结果",
+ "Model Schema":"模型架构",
+ "Model":"模型",
+ "apply":"应用",
+ "Username":"用户�??",
+ "Password":"密�?",
+ "Terms of service":"�?务�?�款",
+ "Created by":"创建者",
+ "See more at":"查看更多:",
+ "Contact the developer":"�?�系开�?�者",
+ "api version":"api版本",
+ "Response Content Type":"�?应Content Type",
+ "fetching resource":"正在获�?�资�?",
+ "fetching resource list":"正在获�?�资�?列表",
+ "Explore":"�?览",
+ "Show Swagger Petstore Example Apis":"显示 Swagger Petstore 示例 Apis",
+ "Can't read from server. It may not have the appropriate access-control-origin settings.":"无法从�?务器读�?�。�?�能没有正确设置access-control-origin。",
+ "Please specify the protocol for":"请指定�??议:",
+ "Can't read swagger JSON from":"无法读�?�swagger JSON于",
+ "Finished Loading Resource Information. Rendering Swagger UI":"已加载资�?信�?�。正在渲染Swagger UI",
+ "Unable to read api":"无法读�?�api",
+ "from path":"从路径",
+ "server returned":"�?务器返回"
+});
diff --git a/openecomp-be/tools/swagger-ui/lib/backbone-min.js b/openecomp-be/tools/swagger-ui/lib/backbone-min.js
new file mode 100644
index 0000000000..f082fcffca
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/lib/backbone-min.js
@@ -0,0 +1,35 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+// Backbone.js 1.1.2
+
+(function(t,e){if(typeof define==="function"&&define.amd){define(["underscore","jquery","exports"],function(i,r,s){t.Backbone=e(t,s,i,r)})}else if(typeof exports!=="undefined"){var i=require("underscore");e(t,exports,i)}else{t.Backbone=e(t,{},t._,t.jQuery||t.Zepto||t.ender||t.$)}})(this,function(t,e,i,r){var s=t.Backbone;var n=[];var a=n.push;var o=n.slice;var h=n.splice;e.VERSION="1.1.2";e.$=r;e.noConflict=function(){t.Backbone=s;return this};e.emulateHTTP=false;e.emulateJSON=false;var u=e.Events={on:function(t,e,i){if(!c(this,"on",t,[e,i])||!e)return this;this._events||(this._events={});var r=this._events[t]||(this._events[t]=[]);r.push({callback:e,context:i,ctx:i||this});return this},once:function(t,e,r){if(!c(this,"once",t,[e,r])||!e)return this;var s=this;var n=i.once(function(){s.off(t,n);e.apply(this,arguments)});n._callback=e;return this.on(t,n,r)},off:function(t,e,r){var s,n,a,o,h,u,l,f;if(!this._events||!c(this,"off",t,[e,r]))return this;if(!t&&!e&&!r){this._events=void 0;return this}o=t?[t]:i.keys(this._events);for(h=0,u=o.length;h<u;h++){t=o[h];if(a=this._events[t]){this._events[t]=s=[];if(e||r){for(l=0,f=a.length;l<f;l++){n=a[l];if(e&&e!==n.callback&&e!==n.callback._callback||r&&r!==n.context){s.push(n)}}}if(!s.length)delete this._events[t]}}return this},trigger:function(t){if(!this._events)return this;var e=o.call(arguments,1);if(!c(this,"trigger",t,e))return this;var i=this._events[t];var r=this._events.all;if(i)f(i,e);if(r)f(r,arguments);return this},stopListening:function(t,e,r){var s=this._listeningTo;if(!s)return this;var n=!e&&!r;if(!r&&typeof e==="object")r=this;if(t)(s={})[t._listenId]=t;for(var a in s){t=s[a];t.off(e,r,this);if(n||i.isEmpty(t._events))delete this._listeningTo[a]}return this}};var l=/\s+/;var c=function(t,e,i,r){if(!i)return true;if(typeof i==="object"){for(var s in i){t[e].apply(t,[s,i[s]].concat(r))}return false}if(l.test(i)){var n=i.split(l);for(var a=0,o=n.length;a<o;a++){t[e].apply(t,[n[a]].concat(r))}return false}return true};var f=function(t,e){var i,r=-1,s=t.length,n=e[0],a=e[1],o=e[2];switch(e.length){case 0:while(++r<s)(i=t[r]).callback.call(i.ctx);return;case 1:while(++r<s)(i=t[r]).callback.call(i.ctx,n);return;case 2:while(++r<s)(i=t[r]).callback.call(i.ctx,n,a);return;case 3:while(++r<s)(i=t[r]).callback.call(i.ctx,n,a,o);return;default:while(++r<s)(i=t[r]).callback.apply(i.ctx,e);return}};var d={listenTo:"on",listenToOnce:"once"};i.each(d,function(t,e){u[e]=function(e,r,s){var n=this._listeningTo||(this._listeningTo={});var a=e._listenId||(e._listenId=i.uniqueId("l"));n[a]=e;if(!s&&typeof r==="object")s=this;e[t](r,s,this);return this}});u.bind=u.on;u.unbind=u.off;i.extend(e,u);var p=e.Model=function(t,e){var r=t||{};e||(e={});this.cid=i.uniqueId("c");this.attributes={};if(e.collection)this.collection=e.collection;if(e.parse)r=this.parse(r,e)||{};r=i.defaults({},r,i.result(this,"defaults"));this.set(r,e);this.changed={};this.initialize.apply(this,arguments)};i.extend(p.prototype,u,{changed:null,validationError:null,idAttribute:"id",initialize:function(){},toJSON:function(t){return i.clone(this.attributes)},sync:function(){return e.sync.apply(this,arguments)},get:function(t){return this.attributes[t]},escape:function(t){return i.escape(this.get(t))},has:function(t){return this.get(t)!=null},set:function(t,e,r){var s,n,a,o,h,u,l,c;if(t==null)return this;if(typeof t==="object"){n=t;r=e}else{(n={})[t]=e}r||(r={});if(!this._validate(n,r))return false;a=r.unset;h=r.silent;o=[];u=this._changing;this._changing=true;if(!u){this._previousAttributes=i.clone(this.attributes);this.changed={}}c=this.attributes,l=this._previousAttributes;if(this.idAttribute in n)this.id=n[this.idAttribute];for(s in n){e=n[s];if(!i.isEqual(c[s],e))o.push(s);if(!i.isEqual(l[s],e)){this.changed[s]=e}else{delete this.changed[s]}a?delete c[s]:c[s]=e}if(!h){if(o.length)this._pending=r;for(var f=0,d=o.length;f<d;f++){this.trigger("change:"+o[f],this,c[o[f]],r)}}if(u)return this;if(!h){while(this._pending){r=this._pending;this._pending=false;this.trigger("change",this,r)}}this._pending=false;this._changing=false;return this},unset:function(t,e){return this.set(t,void 0,i.extend({},e,{unset:true}))},clear:function(t){var e={};for(var r in this.attributes)e[r]=void 0;return this.set(e,i.extend({},t,{unset:true}))},hasChanged:function(t){if(t==null)return!i.isEmpty(this.changed);return i.has(this.changed,t)},changedAttributes:function(t){if(!t)return this.hasChanged()?i.clone(this.changed):false;var e,r=false;var s=this._changing?this._previousAttributes:this.attributes;for(var n in t){if(i.isEqual(s[n],e=t[n]))continue;(r||(r={}))[n]=e}return r},previous:function(t){if(t==null||!this._previousAttributes)return null;return this._previousAttributes[t]},previousAttributes:function(){return i.clone(this._previousAttributes)},fetch:function(t){t=t?i.clone(t):{};if(t.parse===void 0)t.parse=true;var e=this;var r=t.success;t.success=function(i){if(!e.set(e.parse(i,t),t))return false;if(r)r(e,i,t);e.trigger("sync",e,i,t)};q(this,t);return this.sync("read",this,t)},save:function(t,e,r){var s,n,a,o=this.attributes;if(t==null||typeof t==="object"){s=t;r=e}else{(s={})[t]=e}r=i.extend({validate:true},r);if(s&&!r.wait){if(!this.set(s,r))return false}else{if(!this._validate(s,r))return false}if(s&&r.wait){this.attributes=i.extend({},o,s)}if(r.parse===void 0)r.parse=true;var h=this;var u=r.success;r.success=function(t){h.attributes=o;var e=h.parse(t,r);if(r.wait)e=i.extend(s||{},e);if(i.isObject(e)&&!h.set(e,r)){return false}if(u)u(h,t,r);h.trigger("sync",h,t,r)};q(this,r);n=this.isNew()?"create":r.patch?"patch":"update";if(n==="patch")r.attrs=s;a=this.sync(n,this,r);if(s&&r.wait)this.attributes=o;return a},destroy:function(t){t=t?i.clone(t):{};var e=this;var r=t.success;var s=function(){e.trigger("destroy",e,e.collection,t)};t.success=function(i){if(t.wait||e.isNew())s();if(r)r(e,i,t);if(!e.isNew())e.trigger("sync",e,i,t)};if(this.isNew()){t.success();return false}q(this,t);var n=this.sync("delete",this,t);if(!t.wait)s();return n},url:function(){var t=i.result(this,"urlRoot")||i.result(this.collection,"url")||M();if(this.isNew())return t;return t.replace(/([^\/])$/,"$1/")+encodeURIComponent(this.id)},parse:function(t,e){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(t){return this._validate({},i.extend(t||{},{validate:true}))},_validate:function(t,e){if(!e.validate||!this.validate)return true;t=i.extend({},this.attributes,t);var r=this.validationError=this.validate(t,e)||null;if(!r)return true;this.trigger("invalid",this,r,i.extend(e,{validationError:r}));return false}});var v=["keys","values","pairs","invert","pick","omit"];i.each(v,function(t){p.prototype[t]=function(){var e=o.call(arguments);e.unshift(this.attributes);return i[t].apply(i,e)}});var g=e.Collection=function(t,e){e||(e={});if(e.model)this.model=e.model;if(e.comparator!==void 0)this.comparator=e.comparator;this._reset();this.initialize.apply(this,arguments);if(t)this.reset(t,i.extend({silent:true},e))};var m={add:true,remove:true,merge:true};var y={add:true,remove:false};i.extend(g.prototype,u,{model:p,initialize:function(){},toJSON:function(t){return this.map(function(e){return e.toJSON(t)})},sync:function(){return e.sync.apply(this,arguments)},add:function(t,e){return this.set(t,i.extend({merge:false},e,y))},remove:function(t,e){var r=!i.isArray(t);t=r?[t]:i.clone(t);e||(e={});var s,n,a,o;for(s=0,n=t.length;s<n;s++){o=t[s]=this.get(t[s]);if(!o)continue;delete this._byId[o.id];delete this._byId[o.cid];a=this.indexOf(o);this.models.splice(a,1);this.length--;if(!e.silent){e.index=a;o.trigger("remove",o,this,e)}this._removeReference(o,e)}return r?t[0]:t},set:function(t,e){e=i.defaults({},e,m);if(e.parse)t=this.parse(t,e);var r=!i.isArray(t);t=r?t?[t]:[]:i.clone(t);var s,n,a,o,h,u,l;var c=e.at;var f=this.model;var d=this.comparator&&c==null&&e.sort!==false;var v=i.isString(this.comparator)?this.comparator:null;var g=[],y=[],_={};var b=e.add,w=e.merge,x=e.remove;var E=!d&&b&&x?[]:false;for(s=0,n=t.length;s<n;s++){h=t[s]||{};if(h instanceof p){a=o=h}else{a=h[f.prototype.idAttribute||"id"]}if(u=this.get(a)){if(x)_[u.cid]=true;if(w){h=h===o?o.attributes:h;if(e.parse)h=u.parse(h,e);u.set(h,e);if(d&&!l&&u.hasChanged(v))l=true}t[s]=u}else if(b){o=t[s]=this._prepareModel(h,e);if(!o)continue;g.push(o);this._addReference(o,e)}o=u||o;if(E&&(o.isNew()||!_[o.id]))E.push(o);_[o.id]=true}if(x){for(s=0,n=this.length;s<n;++s){if(!_[(o=this.models[s]).cid])y.push(o)}if(y.length)this.remove(y,e)}if(g.length||E&&E.length){if(d)l=true;this.length+=g.length;if(c!=null){for(s=0,n=g.length;s<n;s++){this.models.splice(c+s,0,g[s])}}else{if(E)this.models.length=0;var k=E||g;for(s=0,n=k.length;s<n;s++){this.models.push(k[s])}}}if(l)this.sort({silent:true});if(!e.silent){for(s=0,n=g.length;s<n;s++){(o=g[s]).trigger("add",o,this,e)}if(l||E&&E.length)this.trigger("sort",this,e)}return r?t[0]:t},reset:function(t,e){e||(e={});for(var r=0,s=this.models.length;r<s;r++){this._removeReference(this.models[r],e)}e.previousModels=this.models;this._reset();t=this.add(t,i.extend({silent:true},e));if(!e.silent)this.trigger("reset",this,e);return t},push:function(t,e){return this.add(t,i.extend({at:this.length},e))},pop:function(t){var e=this.at(this.length-1);this.remove(e,t);return e},unshift:function(t,e){return this.add(t,i.extend({at:0},e))},shift:function(t){var e=this.at(0);this.remove(e,t);return e},slice:function(){return o.apply(this.models,arguments)},get:function(t){if(t==null)return void 0;return this._byId[t]||this._byId[t.id]||this._byId[t.cid]},at:function(t){return this.models[t]},where:function(t,e){if(i.isEmpty(t))return e?void 0:[];return this[e?"find":"filter"](function(e){for(var i in t){if(t[i]!==e.get(i))return false}return true})},findWhere:function(t){return this.where(t,true)},sort:function(t){if(!this.comparator)throw new Error("Cannot sort a set without a comparator");t||(t={});if(i.isString(this.comparator)||this.comparator.length===1){this.models=this.sortBy(this.comparator,this)}else{this.models.sort(i.bind(this.comparator,this))}if(!t.silent)this.trigger("sort",this,t);return this},pluck:function(t){return i.invoke(this.models,"get",t)},fetch:function(t){t=t?i.clone(t):{};if(t.parse===void 0)t.parse=true;var e=t.success;var r=this;t.success=function(i){var s=t.reset?"reset":"set";r[s](i,t);if(e)e(r,i,t);r.trigger("sync",r,i,t)};q(this,t);return this.sync("read",this,t)},create:function(t,e){e=e?i.clone(e):{};if(!(t=this._prepareModel(t,e)))return false;if(!e.wait)this.add(t,e);var r=this;var s=e.success;e.success=function(t,i){if(e.wait)r.add(t,e);if(s)s(t,i,e)};t.save(null,e);return t},parse:function(t,e){return t},clone:function(){return new this.constructor(this.models)},_reset:function(){this.length=0;this.models=[];this._byId={}},_prepareModel:function(t,e){if(t instanceof p)return t;e=e?i.clone(e):{};e.collection=this;var r=new this.model(t,e);if(!r.validationError)return r;this.trigger("invalid",this,r.validationError,e);return false},_addReference:function(t,e){this._byId[t.cid]=t;if(t.id!=null)this._byId[t.id]=t;if(!t.collection)t.collection=this;t.on("all",this._onModelEvent,this)},_removeReference:function(t,e){if(this===t.collection)delete t.collection;t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,i,r){if((t==="add"||t==="remove")&&i!==this)return;if(t==="destroy")this.remove(e,r);if(e&&t==="change:"+e.idAttribute){delete this._byId[e.previous(e.idAttribute)];if(e.id!=null)this._byId[e.id]=e}this.trigger.apply(this,arguments)}});var _=["forEach","each","map","collect","reduce","foldl","inject","reduceRight","foldr","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","toArray","size","first","head","take","initial","rest","tail","drop","last","without","difference","indexOf","shuffle","lastIndexOf","isEmpty","chain","sample"];i.each(_,function(t){g.prototype[t]=function(){var e=o.call(arguments);e.unshift(this.models);return i[t].apply(i,e)}});var b=["groupBy","countBy","sortBy","indexBy"];i.each(b,function(t){g.prototype[t]=function(e,r){var s=i.isFunction(e)?e:function(t){return t.get(e)};return i[t](this.models,s,r)}});var w=e.View=function(t){this.cid=i.uniqueId("view");t||(t={});i.extend(this,i.pick(t,E));this._ensureElement();this.initialize.apply(this,arguments);this.delegateEvents()};var x=/^(\S+)\s*(.*)$/;var E=["model","collection","el","id","attributes","className","tagName","events"];i.extend(w.prototype,u,{tagName:"div",$:function(t){return this.$el.find(t)},initialize:function(){},render:function(){return this},remove:function(){this.$el.remove();this.stopListening();return this},setElement:function(t,i){if(this.$el)this.undelegateEvents();this.$el=t instanceof e.$?t:e.$(t);this.el=this.$el[0];if(i!==false)this.delegateEvents();return this},delegateEvents:function(t){if(!(t||(t=i.result(this,"events"))))return this;this.undelegateEvents();for(var e in t){var r=t[e];if(!i.isFunction(r))r=this[t[e]];if(!r)continue;var s=e.match(x);var n=s[1],a=s[2];r=i.bind(r,this);n+=".delegateEvents"+this.cid;if(a===""){this.$el.on(n,r)}else{this.$el.on(n,a,r)}}return this},undelegateEvents:function(){this.$el.off(".delegateEvents"+this.cid);return this},_ensureElement:function(){if(!this.el){var t=i.extend({},i.result(this,"attributes"));if(this.id)t.id=i.result(this,"id");if(this.className)t["class"]=i.result(this,"className");var r=e.$("<"+i.result(this,"tagName")+">").attr(t);this.setElement(r,false)}else{this.setElement(i.result(this,"el"),false)}}});e.sync=function(t,r,s){var n=T[t];i.defaults(s||(s={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var a={type:n,dataType:"json"};if(!s.url){a.url=i.result(r,"url")||M()}if(s.data==null&&r&&(t==="create"||t==="update"||t==="patch")){a.contentType="application/json";a.data=JSON.stringify(s.attrs||r.toJSON(s))}if(s.emulateJSON){a.contentType="application/x-www-form-urlencoded";a.data=a.data?{model:a.data}:{}}if(s.emulateHTTP&&(n==="PUT"||n==="DELETE"||n==="PATCH")){a.type="POST";if(s.emulateJSON)a.data._method=n;var o=s.beforeSend;s.beforeSend=function(t){t.setRequestHeader("X-HTTP-Method-Override",n);if(o)return o.apply(this,arguments)}}if(a.type!=="GET"&&!s.emulateJSON){a.processData=false}if(a.type==="PATCH"&&k){a.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")}}var h=s.xhr=e.ajax(i.extend(a,s));r.trigger("request",r,h,s);return h};var k=typeof window!=="undefined"&&!!window.ActiveXObject&&!(window.XMLHttpRequest&&(new XMLHttpRequest).dispatchEvent);var T={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var $=e.Router=function(t){t||(t={});if(t.routes)this.routes=t.routes;this._bindRoutes();this.initialize.apply(this,arguments)};var S=/\((.*?)\)/g;var H=/(\(\?)?:\w+/g;var A=/\*\w+/g;var I=/[\-{}\[\]+?.,\\\^$|#\s]/g;i.extend($.prototype,u,{initialize:function(){},route:function(t,r,s){if(!i.isRegExp(t))t=this._routeToRegExp(t);if(i.isFunction(r)){s=r;r=""}if(!s)s=this[r];var n=this;e.history.route(t,function(i){var a=n._extractParameters(t,i);n.execute(s,a);n.trigger.apply(n,["route:"+r].concat(a));n.trigger("route",r,a);e.history.trigger("route",n,r,a)});return this},execute:function(t,e){if(t)t.apply(this,e)},navigate:function(t,i){e.history.navigate(t,i);return this},_bindRoutes:function(){if(!this.routes)return;this.routes=i.result(this,"routes");var t,e=i.keys(this.routes);while((t=e.pop())!=null){this.route(t,this.routes[t])}},_routeToRegExp:function(t){t=t.replace(I,"\\$&").replace(S,"(?:$1)?").replace(H,function(t,e){return e?t:"([^/?]+)"}).replace(A,"([^?]*?)");return new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var r=t.exec(e).slice(1);return i.map(r,function(t,e){if(e===r.length-1)return t||null;return t?decodeURIComponent(t):null})}});var N=e.History=function(){this.handlers=[];i.bindAll(this,"checkUrl");if(typeof window!=="undefined"){this.location=window.location;this.history=window.history}};var R=/^[#\/]|\s+$/g;var O=/^\/+|\/+$/g;var P=/msie [\w.]+/;var C=/\/$/;var j=/#.*$/;N.started=false;i.extend(N.prototype,u,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root},getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getFragment:function(t,e){if(t==null){if(this._hasPushState||!this._wantsHashChange||e){t=decodeURI(this.location.pathname+this.location.search);var i=this.root.replace(C,"");if(!t.indexOf(i))t=t.slice(i.length)}else{t=this.getHash()}}return t.replace(R,"")},start:function(t){if(N.started)throw new Error("Backbone.history has already been started");N.started=true;this.options=i.extend({root:"/"},this.options,t);this.root=this.options.root;this._wantsHashChange=this.options.hashChange!==false;this._wantsPushState=!!this.options.pushState;this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var r=this.getFragment();var s=document.documentMode;var n=P.exec(navigator.userAgent.toLowerCase())&&(!s||s<=7);this.root=("/"+this.root+"/").replace(O,"/");if(n&&this._wantsHashChange){var a=e.$('<iframe src="javascript:0" tabindex="-1">');this.iframe=a.hide().appendTo("body")[0].contentWindow;this.navigate(r)}if(this._hasPushState){e.$(window).on("popstate",this.checkUrl)}else if(this._wantsHashChange&&"onhashchange"in window&&!n){e.$(window).on("hashchange",this.checkUrl)}else if(this._wantsHashChange){this._checkUrlInterval=setInterval(this.checkUrl,this.interval)}this.fragment=r;var o=this.location;if(this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){this.fragment=this.getFragment(null,true);this.location.replace(this.root+"#"+this.fragment);return true}else if(this._hasPushState&&this.atRoot()&&o.hash){this.fragment=this.getHash().replace(R,"");this.history.replaceState({},document.title,this.root+this.fragment)}}if(!this.options.silent)return this.loadUrl()},stop:function(){e.$(window).off("popstate",this.checkUrl).off("hashchange",this.checkUrl);if(this._checkUrlInterval)clearInterval(this._checkUrlInterval);N.started=false},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();if(e===this.fragment&&this.iframe){e=this.getFragment(this.getHash(this.iframe))}if(e===this.fragment)return false;if(this.iframe)this.navigate(e);this.loadUrl()},loadUrl:function(t){t=this.fragment=this.getFragment(t);return i.any(this.handlers,function(e){if(e.route.test(t)){e.callback(t);return true}})},navigate:function(t,e){if(!N.started)return false;if(!e||e===true)e={trigger:!!e};var i=this.root+(t=this.getFragment(t||""));t=t.replace(j,"");if(this.fragment===t)return;this.fragment=t;if(t===""&&i!=="/")i=i.slice(0,-1);if(this._hasPushState){this.history[e.replace?"replaceState":"pushState"]({},document.title,i)}else if(this._wantsHashChange){this._updateHash(this.location,t,e.replace);if(this.iframe&&t!==this.getFragment(this.getHash(this.iframe))){if(!e.replace)this.iframe.document.open().close();this._updateHash(this.iframe.location,t,e.replace)}}else{return this.location.assign(i)}if(e.trigger)return this.loadUrl(t)},_updateHash:function(t,e,i){if(i){var r=t.href.replace(/(javascript:|#).*$/,"");t.replace(r+"#"+e)}else{t.hash="#"+e}}});e.history=new N;var U=function(t,e){var r=this;var s;if(t&&i.has(t,"constructor")){s=t.constructor}else{s=function(){return r.apply(this,arguments)}}i.extend(s,r,e);var n=function(){this.constructor=s};n.prototype=r.prototype;s.prototype=new n;if(t)i.extend(s.prototype,t);s.__super__=r.prototype;return s};p.extend=g.extend=$.extend=w.extend=N.extend=U;var M=function(){throw new Error('A "url" property or function must be specified')};var q=function(t,e){var i=e.error;e.error=function(r){if(i)i(t,r,e);t.trigger("error",t,r,e)}};return e});
+
+// From http://stackoverflow.com/a/19431552
+// Compatibility override - Backbone 1.1 got rid of the 'options' binding
+// automatically to views in the constructor - we need to keep that.
+Backbone.View = (function(View) {
+ return View.extend({
+ constructor: function(options) {
+ this.options = options || {};
+ View.apply(this, arguments);
+ }
+ });
+})(Backbone.View);
diff --git a/openecomp-be/tools/swagger-ui/lib/handlebars-2.0.0.js b/openecomp-be/tools/swagger-ui/lib/handlebars-2.0.0.js
new file mode 100644
index 0000000000..0abd7a6149
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/lib/handlebars-2.0.0.js
@@ -0,0 +1,48 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+/*!
+
+ handlebars v2.0.0
+
+Copyright (C) 2011-2014 by Yehuda Katz
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+@license
+*/
+!function(a,b){"function"==typeof define&&define.amd?define([],b):"object"==typeof exports?module.exports=b():a.Handlebars=a.Handlebars||b()}(this,function(){var a=function(){"use strict";function a(a){this.string=a}var b;return a.prototype.toString=function(){return""+this.string},b=a}(),b=function(a){"use strict";function b(a){return i[a]}function c(a){for(var b=1;b<arguments.length;b++)for(var c in arguments[b])Object.prototype.hasOwnProperty.call(arguments[b],c)&&(a[c]=arguments[b][c]);return a}function d(a){return a instanceof h?a.toString():null==a?"":a?(a=""+a,k.test(a)?a.replace(j,b):a):a+""}function e(a){return a||0===a?n(a)&&0===a.length?!0:!1:!0}function f(a,b){return(a?a+".":"")+b}var g={},h=a,i={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},j=/[&<>"'`]/g,k=/[&<>"'`]/;g.extend=c;var l=Object.prototype.toString;g.toString=l;var m=function(a){return"function"==typeof a};m(/x/)&&(m=function(a){return"function"==typeof a&&"[object Function]"===l.call(a)});var m;g.isFunction=m;var n=Array.isArray||function(a){return a&&"object"==typeof a?"[object Array]"===l.call(a):!1};return g.isArray=n,g.escapeExpression=d,g.isEmpty=e,g.appendContextPath=f,g}(a),c=function(){"use strict";function a(a,b){var d;b&&b.firstLine&&(d=b.firstLine,a+=" - "+d+":"+b.firstColumn);for(var e=Error.prototype.constructor.call(this,a),f=0;f<c.length;f++)this[c[f]]=e[c[f]];d&&(this.lineNumber=d,this.column=b.firstColumn)}var b,c=["description","fileName","lineNumber","message","name","number","stack"];return a.prototype=new Error,b=a}(),d=function(a,b){"use strict";function c(a,b){this.helpers=a||{},this.partials=b||{},d(this)}function d(a){a.registerHelper("helperMissing",function(){if(1===arguments.length)return void 0;throw new g("Missing helper: '"+arguments[arguments.length-1].name+"'")}),a.registerHelper("blockHelperMissing",function(b,c){var d=c.inverse,e=c.fn;if(b===!0)return e(this);if(b===!1||null==b)return d(this);if(k(b))return b.length>0?(c.ids&&(c.ids=[c.name]),a.helpers.each(b,c)):d(this);if(c.data&&c.ids){var g=q(c.data);g.contextPath=f.appendContextPath(c.data.contextPath,c.name),c={data:g}}return e(b,c)}),a.registerHelper("each",function(a,b){if(!b)throw new g("Must pass iterator to #each");var c,d,e=b.fn,h=b.inverse,i=0,j="";if(b.data&&b.ids&&(d=f.appendContextPath(b.data.contextPath,b.ids[0])+"."),l(a)&&(a=a.call(this)),b.data&&(c=q(b.data)),a&&"object"==typeof a)if(k(a))for(var m=a.length;m>i;i++)c&&(c.index=i,c.first=0===i,c.last=i===a.length-1,d&&(c.contextPath=d+i)),j+=e(a[i],{data:c});else for(var n in a)a.hasOwnProperty(n)&&(c&&(c.key=n,c.index=i,c.first=0===i,d&&(c.contextPath=d+n)),j+=e(a[n],{data:c}),i++);return 0===i&&(j=h(this)),j}),a.registerHelper("if",function(a,b){return l(a)&&(a=a.call(this)),!b.hash.includeZero&&!a||f.isEmpty(a)?b.inverse(this):b.fn(this)}),a.registerHelper("unless",function(b,c){return a.helpers["if"].call(this,b,{fn:c.inverse,inverse:c.fn,hash:c.hash})}),a.registerHelper("with",function(a,b){l(a)&&(a=a.call(this));var c=b.fn;if(f.isEmpty(a))return b.inverse(this);if(b.data&&b.ids){var d=q(b.data);d.contextPath=f.appendContextPath(b.data.contextPath,b.ids[0]),b={data:d}}return c(a,b)}),a.registerHelper("log",function(b,c){var d=c.data&&null!=c.data.level?parseInt(c.data.level,10):1;a.log(d,b)}),a.registerHelper("lookup",function(a,b){return a&&a[b]})}var e={},f=a,g=b,h="2.0.0";e.VERSION=h;var i=6;e.COMPILER_REVISION=i;var j={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1"};e.REVISION_CHANGES=j;var k=f.isArray,l=f.isFunction,m=f.toString,n="[object Object]";e.HandlebarsEnvironment=c,c.prototype={constructor:c,logger:o,log:p,registerHelper:function(a,b){if(m.call(a)===n){if(b)throw new g("Arg not supported with multiple helpers");f.extend(this.helpers,a)}else this.helpers[a]=b},unregisterHelper:function(a){delete this.helpers[a]},registerPartial:function(a,b){m.call(a)===n?f.extend(this.partials,a):this.partials[a]=b},unregisterPartial:function(a){delete this.partials[a]}};var o={methodMap:{0:"debug",1:"info",2:"warn",3:"error"},DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(a,b){if(o.level<=a){var c=o.methodMap[a];"undefined"!=typeof console&&console[c]&&console[c].call(console,b)}}};e.logger=o;var p=o.log;e.log=p;var q=function(a){var b=f.extend({},a);return b._parent=a,b};return e.createFrame=q,e}(b,c),e=function(a,b,c){"use strict";function d(a){var b=a&&a[0]||1,c=m;if(b!==c){if(c>b){var d=n[c],e=n[b];throw new l("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+d+") or downgrade your runtime to an older version ("+e+").")}throw new l("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+a[1]+").")}}function e(a,b){if(!b)throw new l("No environment passed to template");if(!a||!a.main)throw new l("Unknown template object: "+typeof a);b.VM.checkRevision(a.compiler);var c=function(c,d,e,f,g,h,i,j,m){g&&(f=k.extend({},f,g));var n=b.VM.invokePartial.call(this,c,e,f,h,i,j,m);if(null==n&&b.compile){var o={helpers:h,partials:i,data:j,depths:m};i[e]=b.compile(c,{data:void 0!==j,compat:a.compat},b),n=i[e](f,o)}if(null!=n){if(d){for(var p=n.split("\n"),q=0,r=p.length;r>q&&(p[q]||q+1!==r);q++)p[q]=d+p[q];n=p.join("\n")}return n}throw new l("The partial "+e+" could not be compiled when running in runtime-only mode")},d={lookup:function(a,b){for(var c=a.length,d=0;c>d;d++)if(a[d]&&null!=a[d][b])return a[d][b]},lambda:function(a,b){return"function"==typeof a?a.call(b):a},escapeExpression:k.escapeExpression,invokePartial:c,fn:function(b){return a[b]},programs:[],program:function(a,b,c){var d=this.programs[a],e=this.fn(a);return b||c?d=f(this,a,e,b,c):d||(d=this.programs[a]=f(this,a,e)),d},data:function(a,b){for(;a&&b--;)a=a._parent;return a},merge:function(a,b){var c=a||b;return a&&b&&a!==b&&(c=k.extend({},b,a)),c},noop:b.VM.noop,compilerInfo:a.compiler},e=function(b,c){c=c||{};var f=c.data;e._setup(c),!c.partial&&a.useData&&(f=i(b,f));var g;return a.useDepths&&(g=c.depths?[b].concat(c.depths):[b]),a.main.call(d,b,d.helpers,d.partials,f,g)};return e.isTop=!0,e._setup=function(c){c.partial?(d.helpers=c.helpers,d.partials=c.partials):(d.helpers=d.merge(c.helpers,b.helpers),a.usePartial&&(d.partials=d.merge(c.partials,b.partials)))},e._child=function(b,c,e){if(a.useDepths&&!e)throw new l("must pass parent depths");return f(d,b,a[b],c,e)},e}function f(a,b,c,d,e){var f=function(b,f){return f=f||{},c.call(a,b,a.helpers,a.partials,f.data||d,e&&[b].concat(e))};return f.program=b,f.depth=e?e.length:0,f}function g(a,b,c,d,e,f,g){var h={partial:!0,helpers:d,partials:e,data:f,depths:g};if(void 0===a)throw new l("The partial "+b+" could not be found");return a instanceof Function?a(c,h):void 0}function h(){return""}function i(a,b){return b&&"root"in b||(b=b?o(b):{},b.root=a),b}var j={},k=a,l=b,m=c.COMPILER_REVISION,n=c.REVISION_CHANGES,o=c.createFrame;return j.checkRevision=d,j.template=e,j.program=f,j.invokePartial=g,j.noop=h,j}(b,c,d),f=function(a,b,c,d,e){"use strict";var f,g=a,h=b,i=c,j=d,k=e,l=function(){var a=new g.HandlebarsEnvironment;return j.extend(a,g),a.SafeString=h,a.Exception=i,a.Utils=j,a.escapeExpression=j.escapeExpression,a.VM=k,a.template=function(b){return k.template(b,a)},a},m=l();return m.create=l,m["default"]=m,f=m}(d,a,c,b,e),g=function(a){"use strict";function b(a){a=a||{},this.firstLine=a.first_line,this.firstColumn=a.first_column,this.lastColumn=a.last_column,this.lastLine=a.last_line}var c,d=a,e={ProgramNode:function(a,c,d){b.call(this,d),this.type="program",this.statements=a,this.strip=c},MustacheNode:function(a,c,d,f,g){if(b.call(this,g),this.type="mustache",this.strip=f,null!=d&&d.charAt){var h=d.charAt(3)||d.charAt(2);this.escaped="{"!==h&&"&"!==h}else this.escaped=!!d;this.sexpr=a instanceof e.SexprNode?a:new e.SexprNode(a,c),this.id=this.sexpr.id,this.params=this.sexpr.params,this.hash=this.sexpr.hash,this.eligibleHelper=this.sexpr.eligibleHelper,this.isHelper=this.sexpr.isHelper},SexprNode:function(a,c,d){b.call(this,d),this.type="sexpr",this.hash=c;var e=this.id=a[0],f=this.params=a.slice(1);this.isHelper=!(!f.length&&!c),this.eligibleHelper=this.isHelper||e.isSimple},PartialNode:function(a,c,d,e,f){b.call(this,f),this.type="partial",this.partialName=a,this.context=c,this.hash=d,this.strip=e,this.strip.inlineStandalone=!0},BlockNode:function(a,c,d,e,f){b.call(this,f),this.type="block",this.mustache=a,this.program=c,this.inverse=d,this.strip=e,d&&!c&&(this.isInverse=!0)},RawBlockNode:function(a,c,f,g){if(b.call(this,g),a.sexpr.id.original!==f)throw new d(a.sexpr.id.original+" doesn't match "+f,this);c=new e.ContentNode(c,g),this.type="block",this.mustache=a,this.program=new e.ProgramNode([c],{},g)},ContentNode:function(a,c){b.call(this,c),this.type="content",this.original=this.string=a},HashNode:function(a,c){b.call(this,c),this.type="hash",this.pairs=a},IdNode:function(a,c){b.call(this,c),this.type="ID";for(var e="",f=[],g=0,h="",i=0,j=a.length;j>i;i++){var k=a[i].part;if(e+=(a[i].separator||"")+k,".."===k||"."===k||"this"===k){if(f.length>0)throw new d("Invalid path: "+e,this);".."===k?(g++,h+="../"):this.isScoped=!0}else f.push(k)}this.original=e,this.parts=f,this.string=f.join("."),this.depth=g,this.idName=h+this.string,this.isSimple=1===a.length&&!this.isScoped&&0===g,this.stringModeValue=this.string},PartialNameNode:function(a,c){b.call(this,c),this.type="PARTIAL_NAME",this.name=a.original},DataNode:function(a,c){b.call(this,c),this.type="DATA",this.id=a,this.stringModeValue=a.stringModeValue,this.idName="@"+a.stringModeValue},StringNode:function(a,c){b.call(this,c),this.type="STRING",this.original=this.string=this.stringModeValue=a},NumberNode:function(a,c){b.call(this,c),this.type="NUMBER",this.original=this.number=a,this.stringModeValue=Number(a)},BooleanNode:function(a,c){b.call(this,c),this.type="BOOLEAN",this.bool=a,this.stringModeValue="true"===a},CommentNode:function(a,c){b.call(this,c),this.type="comment",this.comment=a,this.strip={inlineStandalone:!0}}};return c=e}(c),h=function(){"use strict";var a,b=function(){function a(){this.yy={}}var b={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,CONTENT:12,COMMENT:13,openRawBlock:14,END_RAW_BLOCK:15,OPEN_RAW_BLOCK:16,sexpr:17,CLOSE_RAW_BLOCK:18,openBlock:19,block_option0:20,closeBlock:21,openInverse:22,block_option1:23,OPEN_BLOCK:24,CLOSE:25,OPEN_INVERSE:26,inverseAndProgram:27,INVERSE:28,OPEN_ENDBLOCK:29,path:30,OPEN:31,OPEN_UNESCAPED:32,CLOSE_UNESCAPED:33,OPEN_PARTIAL:34,partialName:35,param:36,partial_option0:37,partial_option1:38,sexpr_repetition0:39,sexpr_option0:40,dataName:41,STRING:42,NUMBER:43,BOOLEAN:44,OPEN_SEXPR:45,CLOSE_SEXPR:46,hash:47,hash_repetition_plus0:48,hashSegment:49,ID:50,EQUALS:51,DATA:52,pathSegments:53,SEP:54,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",12:"CONTENT",13:"COMMENT",15:"END_RAW_BLOCK",16:"OPEN_RAW_BLOCK",18:"CLOSE_RAW_BLOCK",24:"OPEN_BLOCK",25:"CLOSE",26:"OPEN_INVERSE",28:"INVERSE",29:"OPEN_ENDBLOCK",31:"OPEN",32:"OPEN_UNESCAPED",33:"CLOSE_UNESCAPED",34:"OPEN_PARTIAL",42:"STRING",43:"NUMBER",44:"BOOLEAN",45:"OPEN_SEXPR",46:"CLOSE_SEXPR",50:"ID",51:"EQUALS",52:"DATA",54:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[10,3],[14,3],[9,4],[9,4],[19,3],[22,3],[27,2],[21,3],[8,3],[8,3],[11,5],[11,4],[17,3],[17,1],[36,1],[36,1],[36,1],[36,1],[36,1],[36,3],[47,1],[49,3],[35,1],[35,1],[35,1],[41,2],[30,1],[53,3],[53,1],[6,0],[6,2],[20,0],[20,1],[23,0],[23,1],[37,0],[37,1],[38,0],[38,1],[39,0],[39,2],[40,0],[40,1],[48,1],[48,2]],performAction:function(a,b,c,d,e,f){var g=f.length-1;switch(e){case 1:return d.prepareProgram(f[g-1].statements,!0),f[g-1];case 2:this.$=new d.ProgramNode(d.prepareProgram(f[g]),{},this._$);break;case 3:this.$=f[g];break;case 4:this.$=f[g];break;case 5:this.$=f[g];break;case 6:this.$=f[g];break;case 7:this.$=new d.ContentNode(f[g],this._$);break;case 8:this.$=new d.CommentNode(f[g],this._$);break;case 9:this.$=new d.RawBlockNode(f[g-2],f[g-1],f[g],this._$);break;case 10:this.$=new d.MustacheNode(f[g-1],null,"","",this._$);break;case 11:this.$=d.prepareBlock(f[g-3],f[g-2],f[g-1],f[g],!1,this._$);break;case 12:this.$=d.prepareBlock(f[g-3],f[g-2],f[g-1],f[g],!0,this._$);break;case 13:this.$=new d.MustacheNode(f[g-1],null,f[g-2],d.stripFlags(f[g-2],f[g]),this._$);break;case 14:this.$=new d.MustacheNode(f[g-1],null,f[g-2],d.stripFlags(f[g-2],f[g]),this._$);break;case 15:this.$={strip:d.stripFlags(f[g-1],f[g-1]),program:f[g]};break;case 16:this.$={path:f[g-1],strip:d.stripFlags(f[g-2],f[g])};break;case 17:this.$=new d.MustacheNode(f[g-1],null,f[g-2],d.stripFlags(f[g-2],f[g]),this._$);break;case 18:this.$=new d.MustacheNode(f[g-1],null,f[g-2],d.stripFlags(f[g-2],f[g]),this._$);break;case 19:this.$=new d.PartialNode(f[g-3],f[g-2],f[g-1],d.stripFlags(f[g-4],f[g]),this._$);break;case 20:this.$=new d.PartialNode(f[g-2],void 0,f[g-1],d.stripFlags(f[g-3],f[g]),this._$);break;case 21:this.$=new d.SexprNode([f[g-2]].concat(f[g-1]),f[g],this._$);break;case 22:this.$=new d.SexprNode([f[g]],null,this._$);break;case 23:this.$=f[g];break;case 24:this.$=new d.StringNode(f[g],this._$);break;case 25:this.$=new d.NumberNode(f[g],this._$);break;case 26:this.$=new d.BooleanNode(f[g],this._$);break;case 27:this.$=f[g];break;case 28:f[g-1].isHelper=!0,this.$=f[g-1];break;case 29:this.$=new d.HashNode(f[g],this._$);break;case 30:this.$=[f[g-2],f[g]];break;case 31:this.$=new d.PartialNameNode(f[g],this._$);break;case 32:this.$=new d.PartialNameNode(new d.StringNode(f[g],this._$),this._$);break;case 33:this.$=new d.PartialNameNode(new d.NumberNode(f[g],this._$));break;case 34:this.$=new d.DataNode(f[g],this._$);break;case 35:this.$=new d.IdNode(f[g],this._$);break;case 36:f[g-2].push({part:f[g],separator:f[g-1]}),this.$=f[g-2];break;case 37:this.$=[{part:f[g]}];break;case 38:this.$=[];break;case 39:f[g-1].push(f[g]);break;case 48:this.$=[];break;case 49:f[g-1].push(f[g]);break;case 52:this.$=[f[g]];break;case 53:f[g-1].push(f[g])}},table:[{3:1,4:2,5:[2,38],6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],31:[2,38],32:[2,38],34:[2,38]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:[1,10],13:[1,11],14:16,16:[1,20],19:14,22:15,24:[1,18],26:[1,19],28:[2,2],29:[2,2],31:[1,12],32:[1,13],34:[1,17]},{1:[2,1]},{5:[2,39],12:[2,39],13:[2,39],16:[2,39],24:[2,39],26:[2,39],28:[2,39],29:[2,39],31:[2,39],32:[2,39],34:[2,39]},{5:[2,3],12:[2,3],13:[2,3],16:[2,3],24:[2,3],26:[2,3],28:[2,3],29:[2,3],31:[2,3],32:[2,3],34:[2,3]},{5:[2,4],12:[2,4],13:[2,4],16:[2,4],24:[2,4],26:[2,4],28:[2,4],29:[2,4],31:[2,4],32:[2,4],34:[2,4]},{5:[2,5],12:[2,5],13:[2,5],16:[2,5],24:[2,5],26:[2,5],28:[2,5],29:[2,5],31:[2,5],32:[2,5],34:[2,5]},{5:[2,6],12:[2,6],13:[2,6],16:[2,6],24:[2,6],26:[2,6],28:[2,6],29:[2,6],31:[2,6],32:[2,6],34:[2,6]},{5:[2,7],12:[2,7],13:[2,7],16:[2,7],24:[2,7],26:[2,7],28:[2,7],29:[2,7],31:[2,7],32:[2,7],34:[2,7]},{5:[2,8],12:[2,8],13:[2,8],16:[2,8],24:[2,8],26:[2,8],28:[2,8],29:[2,8],31:[2,8],32:[2,8],34:[2,8]},{17:21,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:27,30:22,41:23,50:[1,26],52:[1,25],53:24},{4:28,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],28:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{4:29,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],28:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{12:[1,30]},{30:32,35:31,42:[1,33],43:[1,34],50:[1,26],53:24},{17:35,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:36,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:37,30:22,41:23,50:[1,26],52:[1,25],53:24},{25:[1,38]},{18:[2,48],25:[2,48],33:[2,48],39:39,42:[2,48],43:[2,48],44:[2,48],45:[2,48],46:[2,48],50:[2,48],52:[2,48]},{18:[2,22],25:[2,22],33:[2,22],46:[2,22]},{18:[2,35],25:[2,35],33:[2,35],42:[2,35],43:[2,35],44:[2,35],45:[2,35],46:[2,35],50:[2,35],52:[2,35],54:[1,40]},{30:41,50:[1,26],53:24},{18:[2,37],25:[2,37],33:[2,37],42:[2,37],43:[2,37],44:[2,37],45:[2,37],46:[2,37],50:[2,37],52:[2,37],54:[2,37]},{33:[1,42]},{20:43,27:44,28:[1,45],29:[2,40]},{23:46,27:47,28:[1,45],29:[2,42]},{15:[1,48]},{25:[2,46],30:51,36:49,38:50,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],47:57,48:58,49:60,50:[1,59],52:[1,25],53:24},{25:[2,31],42:[2,31],43:[2,31],44:[2,31],45:[2,31],50:[2,31],52:[2,31]},{25:[2,32],42:[2,32],43:[2,32],44:[2,32],45:[2,32],50:[2,32],52:[2,32]},{25:[2,33],42:[2,33],43:[2,33],44:[2,33],45:[2,33],50:[2,33],52:[2,33]},{25:[1,61]},{25:[1,62]},{18:[1,63]},{5:[2,17],12:[2,17],13:[2,17],16:[2,17],24:[2,17],26:[2,17],28:[2,17],29:[2,17],31:[2,17],32:[2,17],34:[2,17]},{18:[2,50],25:[2,50],30:51,33:[2,50],36:65,40:64,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],46:[2,50],47:66,48:58,49:60,50:[1,59],52:[1,25],53:24},{50:[1,67]},{18:[2,34],25:[2,34],33:[2,34],42:[2,34],43:[2,34],44:[2,34],45:[2,34],46:[2,34],50:[2,34],52:[2,34]},{5:[2,18],12:[2,18],13:[2,18],16:[2,18],24:[2,18],26:[2,18],28:[2,18],29:[2,18],31:[2,18],32:[2,18],34:[2,18]},{21:68,29:[1,69]},{29:[2,41]},{4:70,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{21:71,29:[1,69]},{29:[2,43]},{5:[2,9],12:[2,9],13:[2,9],16:[2,9],24:[2,9],26:[2,9],28:[2,9],29:[2,9],31:[2,9],32:[2,9],34:[2,9]},{25:[2,44],37:72,47:73,48:58,49:60,50:[1,74]},{25:[1,75]},{18:[2,23],25:[2,23],33:[2,23],42:[2,23],43:[2,23],44:[2,23],45:[2,23],46:[2,23],50:[2,23],52:[2,23]},{18:[2,24],25:[2,24],33:[2,24],42:[2,24],43:[2,24],44:[2,24],45:[2,24],46:[2,24],50:[2,24],52:[2,24]},{18:[2,25],25:[2,25],33:[2,25],42:[2,25],43:[2,25],44:[2,25],45:[2,25],46:[2,25],50:[2,25],52:[2,25]},{18:[2,26],25:[2,26],33:[2,26],42:[2,26],43:[2,26],44:[2,26],45:[2,26],46:[2,26],50:[2,26],52:[2,26]},{18:[2,27],25:[2,27],33:[2,27],42:[2,27],43:[2,27],44:[2,27],45:[2,27],46:[2,27],50:[2,27],52:[2,27]},{17:76,30:22,41:23,50:[1,26],52:[1,25],53:24},{25:[2,47]},{18:[2,29],25:[2,29],33:[2,29],46:[2,29],49:77,50:[1,74]},{18:[2,37],25:[2,37],33:[2,37],42:[2,37],43:[2,37],44:[2,37],45:[2,37],46:[2,37],50:[2,37],51:[1,78],52:[2,37],54:[2,37]},{18:[2,52],25:[2,52],33:[2,52],46:[2,52],50:[2,52]},{12:[2,13],13:[2,13],16:[2,13],24:[2,13],26:[2,13],28:[2,13],29:[2,13],31:[2,13],32:[2,13],34:[2,13]},{12:[2,14],13:[2,14],16:[2,14],24:[2,14],26:[2,14],28:[2,14],29:[2,14],31:[2,14],32:[2,14],34:[2,14]},{12:[2,10]},{18:[2,21],25:[2,21],33:[2,21],46:[2,21]},{18:[2,49],25:[2,49],33:[2,49],42:[2,49],43:[2,49],44:[2,49],45:[2,49],46:[2,49],50:[2,49],52:[2,49]},{18:[2,51],25:[2,51],33:[2,51],46:[2,51]},{18:[2,36],25:[2,36],33:[2,36],42:[2,36],43:[2,36],44:[2,36],45:[2,36],46:[2,36],50:[2,36],52:[2,36],54:[2,36]},{5:[2,11],12:[2,11],13:[2,11],16:[2,11],24:[2,11],26:[2,11],28:[2,11],29:[2,11],31:[2,11],32:[2,11],34:[2,11]},{30:79,50:[1,26],53:24},{29:[2,15]},{5:[2,12],12:[2,12],13:[2,12],16:[2,12],24:[2,12],26:[2,12],28:[2,12],29:[2,12],31:[2,12],32:[2,12],34:[2,12]},{25:[1,80]},{25:[2,45]},{51:[1,78]},{5:[2,20],12:[2,20],13:[2,20],16:[2,20],24:[2,20],26:[2,20],28:[2,20],29:[2,20],31:[2,20],32:[2,20],34:[2,20]},{46:[1,81]},{18:[2,53],25:[2,53],33:[2,53],46:[2,53],50:[2,53]},{30:51,36:82,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],50:[1,26],52:[1,25],53:24},{25:[1,83]},{5:[2,19],12:[2,19],13:[2,19],16:[2,19],24:[2,19],26:[2,19],28:[2,19],29:[2,19],31:[2,19],32:[2,19],34:[2,19]},{18:[2,28],25:[2,28],33:[2,28],42:[2,28],43:[2,28],44:[2,28],45:[2,28],46:[2,28],50:[2,28],52:[2,28]},{18:[2,30],25:[2,30],33:[2,30],46:[2,30],50:[2,30]},{5:[2,16],12:[2,16],13:[2,16],16:[2,16],24:[2,16],26:[2,16],28:[2,16],29:[2,16],31:[2,16],32:[2,16],34:[2,16]}],defaultActions:{4:[2,1],44:[2,41],47:[2,43],57:[2,47],63:[2,10],70:[2,15],73:[2,45]},parseError:function(a){throw new Error(a)},parse:function(a){function b(){var a;return a=c.lexer.lex()||1,"number"!=typeof a&&(a=c.symbols_[a]||a),a}var c=this,d=[0],e=[null],f=[],g=this.table,h="",i=0,j=0,k=0;this.lexer.setInput(a),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,"undefined"==typeof this.lexer.yylloc&&(this.lexer.yylloc={});var l=this.lexer.yylloc;f.push(l);var m=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var n,o,p,q,r,s,t,u,v,w={};;){if(p=d[d.length-1],this.defaultActions[p]?q=this.defaultActions[p]:((null===n||"undefined"==typeof n)&&(n=b()),q=g[p]&&g[p][n]),"undefined"==typeof q||!q.length||!q[0]){var x="";if(!k){v=[];for(s in g[p])this.terminals_[s]&&s>2&&v.push("'"+this.terminals_[s]+"'");x=this.lexer.showPosition?"Parse error on line "+(i+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[n]||n)+"'":"Parse error on line "+(i+1)+": Unexpected "+(1==n?"end of input":"'"+(this.terminals_[n]||n)+"'"),this.parseError(x,{text:this.lexer.match,token:this.terminals_[n]||n,line:this.lexer.yylineno,loc:l,expected:v})}}if(q[0]instanceof Array&&q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+p+", token: "+n);switch(q[0]){case 1:d.push(n),e.push(this.lexer.yytext),f.push(this.lexer.yylloc),d.push(q[1]),n=null,o?(n=o,o=null):(j=this.lexer.yyleng,h=this.lexer.yytext,i=this.lexer.yylineno,l=this.lexer.yylloc,k>0&&k--);break;case 2:if(t=this.productions_[q[1]][1],w.$=e[e.length-t],w._$={first_line:f[f.length-(t||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(t||1)].first_column,last_column:f[f.length-1].last_column},m&&(w._$.range=[f[f.length-(t||1)].range[0],f[f.length-1].range[1]]),r=this.performAction.call(w,h,j,i,this.yy,q[1],e,f),"undefined"!=typeof r)return r;t&&(d=d.slice(0,-1*t*2),e=e.slice(0,-1*t),f=f.slice(0,-1*t)),d.push(this.productions_[q[1]][0]),e.push(w.$),f.push(w._$),u=g[d[d.length-2]][d[d.length-1]],d.push(u);break;case 3:return!0}}return!0}},c=function(){var a={EOF:1,parseError:function(a,b){if(!this.yy.parser)throw new Error(a);this.yy.parser.parseError(a,b)},setInput:function(a){return this._input=a,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var b=a.match(/(?:\r\n?|\n).*/g);return b?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},unput:function(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b-1),this.offset-=b;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var e=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this},more:function(){return this._more=!0,this},less:function(a){this.unput(this.match.slice(a))},pastInput:function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var a=this.pastInput(),b=new Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,b,c,d,e;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),g=0;g<f.length&&(c=this._input.match(this.rules[f[g]]),!c||b&&!(c[0].length>b[0].length)||(b=c,d=g,this.options.flex));g++);return b?(e=b[0].match(/(?:\r\n?|\n).*/g),e&&(this.yylineno+=e.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:e?e[e.length-1].length-e[e.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],a=this.performAction.call(this,this.yy,this,f[d],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a?a:void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var a=this.next();return"undefined"!=typeof a?a:this.lex()},begin:function(a){this.conditionStack.push(a)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(a){this.begin(a)}};return a.options={},a.performAction=function(a,b,c,d){function e(a,c){return b.yytext=b.yytext.substr(a,b.yyleng-c)}switch(c){case 0:if("\\\\"===b.yytext.slice(-2)?(e(0,1),this.begin("mu")):"\\"===b.yytext.slice(-1)?(e(0,1),this.begin("emu")):this.begin("mu"),b.yytext)return 12;break;case 1:return 12;case 2:return this.popState(),12;case 3:return b.yytext=b.yytext.substr(5,b.yyleng-9),this.popState(),15;case 4:return 12;case 5:return e(0,4),this.popState(),13;case 6:return 45;case 7:return 46;case 8:return 16;case 9:return this.popState(),this.begin("raw"),18;case 10:return 34;case 11:return 24;case 12:return 29;case 13:return this.popState(),28;case 14:return this.popState(),28;case 15:return 26;case 16:return 26;case 17:return 32;case 18:return 31;case 19:this.popState(),this.begin("com");break;case 20:return e(3,5),this.popState(),13;case 21:return 31;case 22:return 51;case 23:return 50;case 24:return 50;case 25:return 54;case 26:break;case 27:return this.popState(),33;case 28:return this.popState(),25;case 29:return b.yytext=e(1,2).replace(/\\"/g,'"'),42;case 30:return b.yytext=e(1,2).replace(/\\'/g,"'"),42;case 31:return 52;case 32:return 44;case 33:return 44;case 34:return 43;case 35:return 50;case 36:return b.yytext=e(1,2),50;case 37:return"INVALID";case 38:return 5}},a.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]*?(?=(\{\{\{\{\/)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{(~)?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)]))))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/],a.conditions={mu:{rules:[6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[5],inclusive:!1},raw:{rules:[3,4],inclusive:!1},INITIAL:{rules:[0,1,38],inclusive:!0}},a}();return b.lexer=c,a.prototype=b,b.Parser=a,new a}();return a=b}(),i=function(a){"use strict";function b(a,b){return{left:"~"===a.charAt(2),right:"~"===b.charAt(b.length-3)}}function c(a,b,c,d,i,k){if(a.sexpr.id.original!==d.path.original)throw new j(a.sexpr.id.original+" doesn't match "+d.path.original,a);var l=c&&c.program,m={left:a.strip.left,right:d.strip.right,openStandalone:f(b.statements),closeStandalone:e((l||b).statements)};if(a.strip.right&&g(b.statements,null,!0),l){var n=c.strip;n.left&&h(b.statements,null,!0),n.right&&g(l.statements,null,!0),d.strip.left&&h(l.statements,null,!0),e(b.statements)&&f(l.statements)&&(h(b.statements),g(l.statements))}else d.strip.left&&h(b.statements,null,!0);return i?new this.BlockNode(a,l,b,m,k):new this.BlockNode(a,b,l,m,k)}function d(a,b){for(var c=0,d=a.length;d>c;c++){var i=a[c],j=i.strip;if(j){var k=e(a,c,b,"partial"===i.type),l=f(a,c,b),m=j.openStandalone&&k,n=j.closeStandalone&&l,o=j.inlineStandalone&&k&&l;j.right&&g(a,c,!0),j.left&&h(a,c,!0),o&&(g(a,c),h(a,c)&&"partial"===i.type&&(i.indent=/([ \t]+$)/.exec(a[c-1].original)?RegExp.$1:"")),m&&(g((i.program||i.inverse).statements),h(a,c)),n&&(g(a,c),h((i.inverse||i.program).statements))}}return a}function e(a,b,c){void 0===b&&(b=a.length);var d=a[b-1],e=a[b-2];return d?"content"===d.type?(e||!c?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(d.original):void 0:c}function f(a,b,c){void 0===b&&(b=-1);var d=a[b+1],e=a[b+2];return d?"content"===d.type?(e||!c?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(d.original):void 0:c}function g(a,b,c){var d=a[null==b?0:b+1];if(d&&"content"===d.type&&(c||!d.rightStripped)){var e=d.string;d.string=d.string.replace(c?/^\s+/:/^[ \t]*\r?\n?/,""),d.rightStripped=d.string!==e}}function h(a,b,c){var d=a[null==b?a.length-1:b-1];if(d&&"content"===d.type&&(c||!d.leftStripped)){var e=d.string;return d.string=d.string.replace(c?/\s+$/:/[ \t]+$/,""),d.leftStripped=d.string!==e,d.leftStripped}}var i={},j=a;return i.stripFlags=b,i.prepareBlock=c,i.prepareProgram=d,i}(c),j=function(a,b,c,d){"use strict";function e(a){return a.constructor===h.ProgramNode?a:(g.yy=k,g.parse(a))}var f={},g=a,h=b,i=c,j=d.extend;f.parser=g;var k={};return j(k,i,h),f.parse=e,f}(h,g,i,b),k=function(a,b){"use strict";function c(){}function d(a,b,c){if(null==a||"string"!=typeof a&&a.constructor!==c.AST.ProgramNode)throw new h("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+a);b=b||{},"data"in b||(b.data=!0),b.compat&&(b.useDepths=!0);var d=c.parse(a),e=(new c.Compiler).compile(d,b);return(new c.JavaScriptCompiler).compile(e,b)}function e(a,b,c){function d(){var d=c.parse(a),e=(new c.Compiler).compile(d,b),f=(new c.JavaScriptCompiler).compile(e,b,void 0,!0);return c.template(f)}if(null==a||"string"!=typeof a&&a.constructor!==c.AST.ProgramNode)throw new h("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+a);b=b||{},"data"in b||(b.data=!0),b.compat&&(b.useDepths=!0);var e,f=function(a,b){return e||(e=d()),e.call(this,a,b)};return f._setup=function(a){return e||(e=d()),e._setup(a)},f._child=function(a,b,c){return e||(e=d()),e._child(a,b,c)},f}function f(a,b){if(a===b)return!0;if(i(a)&&i(b)&&a.length===b.length){for(var c=0;c<a.length;c++)if(!f(a[c],b[c]))return!1;return!0}}var g={},h=a,i=b.isArray,j=[].slice;return g.Compiler=c,c.prototype={compiler:c,equals:function(a){var b=this.opcodes.length;if(a.opcodes.length!==b)return!1;for(var c=0;b>c;c++){var d=this.opcodes[c],e=a.opcodes[c];if(d.opcode!==e.opcode||!f(d.args,e.args))return!1}for(b=this.children.length,c=0;b>c;c++)if(!this.children[c].equals(a.children[c]))return!1;return!0},guid:0,compile:function(a,b){this.opcodes=[],this.children=[],this.depths={list:[]},this.options=b,this.stringParams=b.stringParams,this.trackIds=b.trackIds;var c=this.options.knownHelpers;if(this.options.knownHelpers={helperMissing:!0,blockHelperMissing:!0,each:!0,"if":!0,unless:!0,"with":!0,log:!0,lookup:!0},c)for(var d in c)this.options.knownHelpers[d]=c[d];return this.accept(a)},accept:function(a){return this[a.type](a)},program:function(a){for(var b=a.statements,c=0,d=b.length;d>c;c++)this.accept(b[c]);return this.isSimple=1===d,this.depths.list=this.depths.list.sort(function(a,b){return a-b}),this},compileProgram:function(a){var b,c=(new this.compiler).compile(a,this.options),d=this.guid++;
+this.usePartial=this.usePartial||c.usePartial,this.children[d]=c;for(var e=0,f=c.depths.list.length;f>e;e++)b=c.depths.list[e],2>b||this.addDepth(b-1);return d},block:function(a){var b=a.mustache,c=a.program,d=a.inverse;c&&(c=this.compileProgram(c)),d&&(d=this.compileProgram(d));var e=b.sexpr,f=this.classifySexpr(e);"helper"===f?this.helperSexpr(e,c,d):"simple"===f?(this.simpleSexpr(e),this.opcode("pushProgram",c),this.opcode("pushProgram",d),this.opcode("emptyHash"),this.opcode("blockValue",e.id.original)):(this.ambiguousSexpr(e,c,d),this.opcode("pushProgram",c),this.opcode("pushProgram",d),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},hash:function(a){var b,c,d=a.pairs;for(this.opcode("pushHash"),b=0,c=d.length;c>b;b++)this.pushParam(d[b][1]);for(;b--;)this.opcode("assignToHash",d[b][0]);this.opcode("popHash")},partial:function(a){var b=a.partialName;this.usePartial=!0,a.hash?this.accept(a.hash):this.opcode("push","undefined"),a.context?this.accept(a.context):(this.opcode("getContext",0),this.opcode("pushContext")),this.opcode("invokePartial",b.name,a.indent||""),this.opcode("append")},content:function(a){a.string&&this.opcode("appendContent",a.string)},mustache:function(a){this.sexpr(a.sexpr),a.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},ambiguousSexpr:function(a,b,c){var d=a.id,e=d.parts[0],f=null!=b||null!=c;this.opcode("getContext",d.depth),this.opcode("pushProgram",b),this.opcode("pushProgram",c),this.ID(d),this.opcode("invokeAmbiguous",e,f)},simpleSexpr:function(a){var b=a.id;"DATA"===b.type?this.DATA(b):b.parts.length?this.ID(b):(this.addDepth(b.depth),this.opcode("getContext",b.depth),this.opcode("pushContext")),this.opcode("resolvePossibleLambda")},helperSexpr:function(a,b,c){var d=this.setupFullMustacheParams(a,b,c),e=a.id,f=e.parts[0];if(this.options.knownHelpers[f])this.opcode("invokeKnownHelper",d.length,f);else{if(this.options.knownHelpersOnly)throw new h("You specified knownHelpersOnly, but used the unknown helper "+f,a);e.falsy=!0,this.ID(e),this.opcode("invokeHelper",d.length,e.original,e.isSimple)}},sexpr:function(a){var b=this.classifySexpr(a);"simple"===b?this.simpleSexpr(a):"helper"===b?this.helperSexpr(a):this.ambiguousSexpr(a)},ID:function(a){this.addDepth(a.depth),this.opcode("getContext",a.depth);var b=a.parts[0];b?this.opcode("lookupOnContext",a.parts,a.falsy,a.isScoped):this.opcode("pushContext")},DATA:function(a){this.options.data=!0,this.opcode("lookupData",a.id.depth,a.id.parts)},STRING:function(a){this.opcode("pushString",a.string)},NUMBER:function(a){this.opcode("pushLiteral",a.number)},BOOLEAN:function(a){this.opcode("pushLiteral",a.bool)},comment:function(){},opcode:function(a){this.opcodes.push({opcode:a,args:j.call(arguments,1)})},addDepth:function(a){0!==a&&(this.depths[a]||(this.depths[a]=!0,this.depths.list.push(a)))},classifySexpr:function(a){var b=a.isHelper,c=a.eligibleHelper,d=this.options;if(c&&!b){var e=a.id.parts[0];d.knownHelpers[e]?b=!0:d.knownHelpersOnly&&(c=!1)}return b?"helper":c?"ambiguous":"simple"},pushParams:function(a){for(var b=0,c=a.length;c>b;b++)this.pushParam(a[b])},pushParam:function(a){this.stringParams?(a.depth&&this.addDepth(a.depth),this.opcode("getContext",a.depth||0),this.opcode("pushStringParam",a.stringModeValue,a.type),"sexpr"===a.type&&this.sexpr(a)):(this.trackIds&&this.opcode("pushId",a.type,a.idName||a.stringModeValue),this.accept(a))},setupFullMustacheParams:function(a,b,c){var d=a.params;return this.pushParams(d),this.opcode("pushProgram",b),this.opcode("pushProgram",c),a.hash?this.hash(a.hash):this.opcode("emptyHash"),d}},g.precompile=d,g.compile=e,g}(c,b),l=function(a,b){"use strict";function c(a){this.value=a}function d(){}var e,f=a.COMPILER_REVISION,g=a.REVISION_CHANGES,h=b;d.prototype={nameLookup:function(a,b){return d.isValidJavaScriptVariableName(b)?a+"."+b:a+"['"+b+"']"},depthedLookup:function(a){return this.aliases.lookup="this.lookup",'lookup(depths, "'+a+'")'},compilerInfo:function(){var a=f,b=g[a];return[a,b]},appendToBuffer:function(a){return this.environment.isSimple?"return "+a+";":{appendToBuffer:!0,content:a,toString:function(){return"buffer += "+a+";"}}},initializeBuffer:function(){return this.quotedString("")},namespace:"Handlebars",compile:function(a,b,c,d){this.environment=a,this.options=b,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!d,this.name=this.environment.name,this.isChild=!!c,this.context=c||{programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.compileChildren(a,b),this.useDepths=this.useDepths||a.depths.list.length||this.options.compat;var e,f,g,i=a.opcodes;for(f=0,g=i.length;g>f;f++)e=i[f],this[e.opcode].apply(this,e.args);if(this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new h("Compile completed with content left on stack");var j=this.createFunctionContext(d);if(this.isChild)return j;var k={compiler:this.compilerInfo(),main:j},l=this.context.programs;for(f=0,g=l.length;g>f;f++)l[f]&&(k[f]=l[f]);return this.environment.usePartial&&(k.usePartial=!0),this.options.data&&(k.useData=!0),this.useDepths&&(k.useDepths=!0),this.options.compat&&(k.compat=!0),d||(k.compiler=JSON.stringify(k.compiler),k=this.objectLiteral(k)),k},preamble:function(){this.lastContext=0,this.source=[]},createFunctionContext:function(a){var b="",c=this.stackVars.concat(this.registers.list);c.length>0&&(b+=", "+c.join(", "));for(var d in this.aliases)this.aliases.hasOwnProperty(d)&&(b+=", "+d+"="+this.aliases[d]);var e=["depth0","helpers","partials","data"];this.useDepths&&e.push("depths");var f=this.mergeSource(b);return a?(e.push(f),Function.apply(this,e)):"function("+e.join(",")+") {\n "+f+"}"},mergeSource:function(a){for(var b,c,d="",e=!this.forceBuffer,f=0,g=this.source.length;g>f;f++){var h=this.source[f];h.appendToBuffer?b=b?b+"\n + "+h.content:h.content:(b&&(d?d+="buffer += "+b+";\n ":(c=!0,d=b+";\n "),b=void 0),d+=h+"\n ",this.environment.isSimple||(e=!1))}return e?(b||!d)&&(d+="return "+(b||'""')+";\n"):(a+=", buffer = "+(c?"":this.initializeBuffer()),d+=b?"return buffer + "+b+";\n":"return buffer;\n"),a&&(d="var "+a.substring(2)+(c?"":";\n ")+d),d},blockValue:function(a){this.aliases.blockHelperMissing="helpers.blockHelperMissing";var b=[this.contextName(0)];this.setupParams(a,0,b);var c=this.popStack();b.splice(1,0,c),this.push("blockHelperMissing.call("+b.join(", ")+")")},ambiguousBlockValue:function(){this.aliases.blockHelperMissing="helpers.blockHelperMissing";var a=[this.contextName(0)];this.setupParams("",0,a,!0),this.flushInline();var b=this.topStack();a.splice(1,0,b),this.pushSource("if (!"+this.lastHelper+") { "+b+" = blockHelperMissing.call("+a.join(", ")+"); }")},appendContent:function(a){this.pendingContent&&(a=this.pendingContent+a),this.pendingContent=a},append:function(){this.flushInline();var a=this.popStack();this.pushSource("if ("+a+" != null) { "+this.appendToBuffer(a)+" }"),this.environment.isSimple&&this.pushSource("else { "+this.appendToBuffer("''")+" }")},appendEscaped:function(){this.aliases.escapeExpression="this.escapeExpression",this.pushSource(this.appendToBuffer("escapeExpression("+this.popStack()+")"))},getContext:function(a){this.lastContext=a},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(a,b,c){var d=0,e=a.length;for(c||!this.options.compat||this.lastContext?this.pushContext():this.push(this.depthedLookup(a[d++]));e>d;d++)this.replaceStack(function(c){var e=this.nameLookup(c,a[d],"context");return b?" && "+e:" != null ? "+e+" : "+c})},lookupData:function(a,b){a?this.pushStackLiteral("this.data(data, "+a+")"):this.pushStackLiteral("data");for(var c=b.length,d=0;c>d;d++)this.replaceStack(function(a){return" && "+this.nameLookup(a,b[d],"data")})},resolvePossibleLambda:function(){this.aliases.lambda="this.lambda",this.push("lambda("+this.popStack()+", "+this.contextName(0)+")")},pushStringParam:function(a,b){this.pushContext(),this.pushString(b),"sexpr"!==b&&("string"==typeof a?this.pushString(a):this.pushStackLiteral(a))},emptyHash:function(){this.pushStackLiteral("{}"),this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}"))},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:[],types:[],contexts:[],ids:[]}},popHash:function(){var a=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push("{"+a.ids.join(",")+"}"),this.stringParams&&(this.push("{"+a.contexts.join(",")+"}"),this.push("{"+a.types.join(",")+"}")),this.push("{\n "+a.values.join(",\n ")+"\n }")},pushString:function(a){this.pushStackLiteral(this.quotedString(a))},push:function(a){return this.inlineStack.push(a),a},pushLiteral:function(a){this.pushStackLiteral(a)},pushProgram:function(a){null!=a?this.pushStackLiteral(this.programExpression(a)):this.pushStackLiteral(null)},invokeHelper:function(a,b,c){this.aliases.helperMissing="helpers.helperMissing";var d=this.popStack(),e=this.setupHelper(a,b),f=(c?e.name+" || ":"")+d+" || helperMissing";this.push("(("+f+").call("+e.callParams+"))")},invokeKnownHelper:function(a,b){var c=this.setupHelper(a,b);this.push(c.name+".call("+c.callParams+")")},invokeAmbiguous:function(a,b){this.aliases.functionType='"function"',this.aliases.helperMissing="helpers.helperMissing",this.useRegister("helper");var c=this.popStack();this.emptyHash();var d=this.setupHelper(0,a,b),e=this.lastHelper=this.nameLookup("helpers",a,"helper");this.push("((helper = (helper = "+e+" || "+c+") != null ? helper : helperMissing"+(d.paramsInit?"),("+d.paramsInit:"")+"),(typeof helper === functionType ? helper.call("+d.callParams+") : helper))")},invokePartial:function(a,b){var c=[this.nameLookup("partials",a,"partial"),"'"+b+"'","'"+a+"'",this.popStack(),this.popStack(),"helpers","partials"];this.options.data?c.push("data"):this.options.compat&&c.push("undefined"),this.options.compat&&c.push("depths"),this.push("this.invokePartial("+c.join(", ")+")")},assignToHash:function(a){var b,c,d,e=this.popStack();this.trackIds&&(d=this.popStack()),this.stringParams&&(c=this.popStack(),b=this.popStack());var f=this.hash;b&&f.contexts.push("'"+a+"': "+b),c&&f.types.push("'"+a+"': "+c),d&&f.ids.push("'"+a+"': "+d),f.values.push("'"+a+"': ("+e+")")},pushId:function(a,b){"ID"===a||"DATA"===a?this.pushString(b):"sexpr"===a?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:d,compileChildren:function(a,b){for(var c,d,e=a.children,f=0,g=e.length;g>f;f++){c=e[f],d=new this.compiler;var h=this.matchExistingProgram(c);null==h?(this.context.programs.push(""),h=this.context.programs.length,c.index=h,c.name="program"+h,this.context.programs[h]=d.compile(c,b,this.context,!this.precompile),this.context.environments[h]=c,this.useDepths=this.useDepths||d.useDepths):(c.index=h,c.name="program"+h)}},matchExistingProgram:function(a){for(var b=0,c=this.context.environments.length;c>b;b++){var d=this.context.environments[b];if(d&&d.equals(a))return b}},programExpression:function(a){var b=this.environment.children[a],c=(b.depths.list,this.useDepths),d=[b.index,"data"];return c&&d.push("depths"),"this.program("+d.join(", ")+")"},useRegister:function(a){this.registers[a]||(this.registers[a]=!0,this.registers.list.push(a))},pushStackLiteral:function(a){return this.push(new c(a))},pushSource:function(a){this.pendingContent&&(this.source.push(this.appendToBuffer(this.quotedString(this.pendingContent))),this.pendingContent=void 0),a&&this.source.push(a)},pushStack:function(a){this.flushInline();var b=this.incrStack();return this.pushSource(b+" = "+a+";"),this.compileStack.push(b),b},replaceStack:function(a){{var b,d,e,f="";this.isInline()}if(!this.isInline())throw new h("replaceStack on non-inline");var g=this.popStack(!0);if(g instanceof c)f=b=g.value,e=!0;else{d=!this.stackSlot;var i=d?this.incrStack():this.topStackName();f="("+this.push(i)+" = "+g+")",b=this.topStack()}var j=a.call(this,b);e||this.popStack(),d&&this.stackSlot--,this.push("("+f+j+")")},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var a=this.inlineStack;if(a.length){this.inlineStack=[];for(var b=0,d=a.length;d>b;b++){var e=a[b];e instanceof c?this.compileStack.push(e):this.pushStack(e)}}},isInline:function(){return this.inlineStack.length},popStack:function(a){var b=this.isInline(),d=(b?this.inlineStack:this.compileStack).pop();if(!a&&d instanceof c)return d.value;if(!b){if(!this.stackSlot)throw new h("Invalid stack pop");this.stackSlot--}return d},topStack:function(){var a=this.isInline()?this.inlineStack:this.compileStack,b=a[a.length-1];return b instanceof c?b.value:b},contextName:function(a){return this.useDepths&&a?"depths["+a+"]":"depth"+a},quotedString:function(a){return'"'+a.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function(a){var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(this.quotedString(c)+":"+a[c]);return"{"+b.join(",")+"}"},setupHelper:function(a,b,c){var d=[],e=this.setupParams(b,a,d,c),f=this.nameLookup("helpers",b,"helper");return{params:d,paramsInit:e,name:f,callParams:[this.contextName(0)].concat(d).join(", ")}},setupOptions:function(a,b,c){var d,e,f,g={},h=[],i=[],j=[];g.name=this.quotedString(a),g.hash=this.popStack(),this.trackIds&&(g.hashIds=this.popStack()),this.stringParams&&(g.hashTypes=this.popStack(),g.hashContexts=this.popStack()),e=this.popStack(),f=this.popStack(),(f||e)&&(f||(f="this.noop"),e||(e="this.noop"),g.fn=f,g.inverse=e);for(var k=b;k--;)d=this.popStack(),c[k]=d,this.trackIds&&(j[k]=this.popStack()),this.stringParams&&(i[k]=this.popStack(),h[k]=this.popStack());return this.trackIds&&(g.ids="["+j.join(",")+"]"),this.stringParams&&(g.types="["+i.join(",")+"]",g.contexts="["+h.join(",")+"]"),this.options.data&&(g.data="data"),g},setupParams:function(a,b,c,d){var e=this.objectLiteral(this.setupOptions(a,b,c));return d?(this.useRegister("options"),c.push("options"),"options="+e):(c.push(e),"")}};for(var i="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield".split(" "),j=d.RESERVED_WORDS={},k=0,l=i.length;l>k;k++)j[i[k]]=!0;return d.isValidJavaScriptVariableName=function(a){return!d.RESERVED_WORDS[a]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(a)},e=d}(d,c),m=function(a,b,c,d,e){"use strict";var f,g=a,h=b,i=c.parser,j=c.parse,k=d.Compiler,l=d.compile,m=d.precompile,n=e,o=g.create,p=function(){var a=o();return a.compile=function(b,c){return l(b,c,a)},a.precompile=function(b,c){return m(b,c,a)},a.AST=h,a.Compiler=k,a.JavaScriptCompiler=n,a.Parser=i,a.parse=j,a};return g=p(),g.create=p,g["default"]=g,f=g}(f,g,j,k,l);return m});
diff --git a/openecomp-be/tools/swagger-ui/lib/highlight.7.3.pack.js b/openecomp-be/tools/swagger-ui/lib/highlight.7.3.pack.js
new file mode 100644
index 0000000000..a61ad222c2
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/lib/highlight.7.3.pack.js
@@ -0,0 +1,21 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+var hljs=new function(){function l(o){return o.replace(/&/gm,"&amp;").replace(/</gm,"&lt;").replace(/>/gm,"&gt;")}function b(p){for(var o=p.firstChild;o;o=o.nextSibling){if(o.nodeName=="CODE"){return o}if(!(o.nodeType==3&&o.nodeValue.match(/\s+/))){break}}}function h(p,o){return Array.prototype.map.call(p.childNodes,function(q){if(q.nodeType==3){return o?q.nodeValue.replace(/\n/g,""):q.nodeValue}if(q.nodeName=="BR"){return"\n"}return h(q,o)}).join("")}function a(q){var p=(q.className+" "+q.parentNode.className).split(/\s+/);p=p.map(function(r){return r.replace(/^language-/,"")});for(var o=0;o<p.length;o++){if(e[p[o]]||p[o]=="no-highlight"){return p[o]}}}function c(q){var o=[];(function p(r,s){for(var t=r.firstChild;t;t=t.nextSibling){if(t.nodeType==3){s+=t.nodeValue.length}else{if(t.nodeName=="BR"){s+=1}else{if(t.nodeType==1){o.push({event:"start",offset:s,node:t});s=p(t,s);o.push({event:"stop",offset:s,node:t})}}}}return s})(q,0);return o}function j(x,v,w){var p=0;var y="";var r=[];function t(){if(x.length&&v.length){if(x[0].offset!=v[0].offset){return(x[0].offset<v[0].offset)?x:v}else{return v[0].event=="start"?x:v}}else{return x.length?x:v}}function s(A){function z(B){return" "+B.nodeName+'="'+l(B.value)+'"'}return"<"+A.nodeName+Array.prototype.map.call(A.attributes,z).join("")+">"}while(x.length||v.length){var u=t().splice(0,1)[0];y+=l(w.substr(p,u.offset-p));p=u.offset;if(u.event=="start"){y+=s(u.node);r.push(u.node)}else{if(u.event=="stop"){var o,q=r.length;do{q--;o=r[q];y+=("</"+o.nodeName.toLowerCase()+">")}while(o!=u.node);r.splice(q,1);while(q<r.length){y+=s(r[q]);q++}}}}return y+l(w.substr(p))}function f(q){function o(s,r){return RegExp(s,"m"+(q.cI?"i":"")+(r?"g":""))}function p(y,w){if(y.compiled){return}y.compiled=true;var s=[];if(y.k){var r={};function z(A,t){t.split(" ").forEach(function(B){var C=B.split("|");r[C[0]]=[A,C[1]?Number(C[1]):1];s.push(C[0])})}y.lR=o(y.l||hljs.IR,true);if(typeof y.k=="string"){z("keyword",y.k)}else{for(var x in y.k){if(!y.k.hasOwnProperty(x)){continue}z(x,y.k[x])}}y.k=r}if(w){if(y.bWK){y.b="\\b("+s.join("|")+")\\s"}y.bR=o(y.b?y.b:"\\B|\\b");if(!y.e&&!y.eW){y.e="\\B|\\b"}if(y.e){y.eR=o(y.e)}y.tE=y.e||"";if(y.eW&&w.tE){y.tE+=(y.e?"|":"")+w.tE}}if(y.i){y.iR=o(y.i)}if(y.r===undefined){y.r=1}if(!y.c){y.c=[]}for(var v=0;v<y.c.length;v++){if(y.c[v]=="self"){y.c[v]=y}p(y.c[v],y)}if(y.starts){p(y.starts,w)}var u=[];for(var v=0;v<y.c.length;v++){u.push(y.c[v].b)}if(y.tE){u.push(y.tE)}if(y.i){u.push(y.i)}y.t=u.length?o(u.join("|"),true):{exec:function(t){return null}}}p(q)}function d(D,E){function o(r,M){for(var L=0;L<M.c.length;L++){var K=M.c[L].bR.exec(r);if(K&&K.index==0){return M.c[L]}}}function s(K,r){if(K.e&&K.eR.test(r)){return K}if(K.eW){return s(K.parent,r)}}function t(r,K){return K.i&&K.iR.test(r)}function y(L,r){var K=F.cI?r[0].toLowerCase():r[0];return L.k.hasOwnProperty(K)&&L.k[K]}function G(){var K=l(w);if(!A.k){return K}var r="";var N=0;A.lR.lastIndex=0;var L=A.lR.exec(K);while(L){r+=K.substr(N,L.index-N);var M=y(A,L);if(M){v+=M[1];r+='<span class="'+M[0]+'">'+L[0]+"</span>"}else{r+=L[0]}N=A.lR.lastIndex;L=A.lR.exec(K)}return r+K.substr(N)}function z(){if(A.sL&&!e[A.sL]){return l(w)}var r=A.sL?d(A.sL,w):g(w);if(A.r>0){v+=r.keyword_count;B+=r.r}return'<span class="'+r.language+'">'+r.value+"</span>"}function J(){return A.sL!==undefined?z():G()}function I(L,r){var K=L.cN?'<span class="'+L.cN+'">':"";if(L.rB){x+=K;w=""}else{if(L.eB){x+=l(r)+K;w=""}else{x+=K;w=r}}A=Object.create(L,{parent:{value:A}});B+=L.r}function C(K,r){w+=K;if(r===undefined){x+=J();return 0}var L=o(r,A);if(L){x+=J();I(L,r);return L.rB?0:r.length}var M=s(A,r);if(M){if(!(M.rE||M.eE)){w+=r}x+=J();do{if(A.cN){x+="</span>"}A=A.parent}while(A!=M.parent);if(M.eE){x+=l(r)}w="";if(M.starts){I(M.starts,"")}return M.rE?0:r.length}if(t(r,A)){throw"Illegal"}w+=r;return r.length||1}var F=e[D];f(F);var A=F;var w="";var B=0;var v=0;var x="";try{var u,q,p=0;while(true){A.t.lastIndex=p;u=A.t.exec(E);if(!u){break}q=C(E.substr(p,u.index-p),u[0]);p=u.index+q}C(E.substr(p));return{r:B,keyword_count:v,value:x,language:D}}catch(H){if(H=="Illegal"){return{r:0,keyword_count:0,value:l(E)}}else{throw H}}}function g(s){var o={keyword_count:0,r:0,value:l(s)};var q=o;for(var p in e){if(!e.hasOwnProperty(p)){continue}var r=d(p,s);r.language=p;if(r.keyword_count+r.r>q.keyword_count+q.r){q=r}if(r.keyword_count+r.r>o.keyword_count+o.r){q=o;o=r}}if(q.language){o.second_best=q}return o}function i(q,p,o){if(p){q=q.replace(/^((<[^>]+>|\t)+)/gm,function(r,v,u,t){return v.replace(/\t/g,p)})}if(o){q=q.replace(/\n/g,"<br>")}return q}function m(r,u,p){var v=h(r,p);var t=a(r);if(t=="no-highlight"){return}var w=t?d(t,v):g(v);t=w.language;var o=c(r);if(o.length){var q=document.createElement("pre");q.innerHTML=w.value;w.value=j(o,c(q),v)}w.value=i(w.value,u,p);var s=r.className;if(!s.match("(\\s|^)(language-)?"+t+"(\\s|$)")){s=s?(s+" "+t):t}r.innerHTML=w.value;r.className=s;r.result={language:t,kw:w.keyword_count,re:w.r};if(w.second_best){r.second_best={language:w.second_best.language,kw:w.second_best.keyword_count,re:w.second_best.r}}}function n(){if(n.called){return}n.called=true;Array.prototype.map.call(document.getElementsByTagName("pre"),b).filter(Boolean).forEach(function(o){m(o,hljs.tabReplace)})}function k(){window.addEventListener("DOMContentLoaded",n,false);window.addEventListener("load",n,false)}var e={};this.LANGUAGES=e;this.highlight=d;this.highlightAuto=g;this.fixMarkup=i;this.highlightBlock=m;this.initHighlighting=n;this.initHighlightingOnLoad=k;this.IR="[a-zA-Z][a-zA-Z0-9_]*";this.UIR="[a-zA-Z_][a-zA-Z0-9_]*";this.NR="\\b\\d+(\\.\\d+)?";this.CNR="(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)";this.BNR="\\b(0b[01]+)";this.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|\\.|-|-=|/|/=|:|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";this.BE={b:"\\\\[\\s\\S]",r:0};this.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[this.BE],r:0};this.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[this.BE],r:0};this.CLCM={cN:"comment",b:"//",e:"$"};this.CBLCLM={cN:"comment",b:"/\\*",e:"\\*/"};this.HCM={cN:"comment",b:"#",e:"$"};this.NM={cN:"number",b:this.NR,r:0};this.CNM={cN:"number",b:this.CNR,r:0};this.BNM={cN:"number",b:this.BNR,r:0};this.inherit=function(q,r){var o={};for(var p in q){o[p]=q[p]}if(r){for(var p in r){o[p]=r[p]}}return o}}();hljs.LANGUAGES.xml=function(a){var c="[A-Za-z0-9\\._:-]+";var b={eW:true,c:[{cN:"attribute",b:c,r:0},{b:'="',rB:true,e:'"',c:[{cN:"value",b:'"',eW:true}]},{b:"='",rB:true,e:"'",c:[{cN:"value",b:"'",eW:true}]},{b:"=",c:[{cN:"value",b:"[^\\s/>]+"}]}]};return{cI:true,c:[{cN:"pi",b:"<\\?",e:"\\?>",r:10},{cN:"doctype",b:"<!DOCTYPE",e:">",r:10,c:[{b:"\\[",e:"\\]"}]},{cN:"comment",b:"<!--",e:"-->",r:10},{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"tag",b:"<style(?=\\s|>|$)",e:">",k:{title:"style"},c:[b],starts:{e:"</style>",rE:true,sL:"css"}},{cN:"tag",b:"<script(?=\\s|>|$)",e:">",k:{title:"script"},c:[b],starts:{e:"<\/script>",rE:true,sL:"javascript"}},{b:"<%",e:"%>",sL:"vbscript"},{cN:"tag",b:"</?",e:"/?>",c:[{cN:"title",b:"[^ />]+"},b]}]}}(hljs);hljs.LANGUAGES.json=function(a){var e={literal:"true false null"};var d=[a.QSM,a.CNM];var c={cN:"value",e:",",eW:true,eE:true,c:d,k:e};var b={b:"{",e:"}",c:[{cN:"attribute",b:'\\s*"',e:'"\\s*:\\s*',eB:true,eE:true,c:[a.BE],i:"\\n",starts:c}],i:"\\S"};var f={b:"\\[",e:"\\]",c:[a.inherit(c,{cN:null})],i:"\\S"};d.splice(d.length,0,b,f);return{c:d,k:e,i:"\\S"}}(hljs);
diff --git a/openecomp-be/tools/swagger-ui/lib/jquery-1.8.0.min.js b/openecomp-be/tools/swagger-ui/lib/jquery-1.8.0.min.js
new file mode 100644
index 0000000000..2ebc792d3a
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/lib/jquery-1.8.0.min.js
@@ -0,0 +1,22 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+/*! jQuery v@1.8.0 jquery.com | jquery.org/license */
+(function(a,b){function G(a){var b=F[a]={};return p.each(a.split(s),function(a,c){b[c]=!0}),b}function J(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(I,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:+d+""===d?+d:H.test(d)?p.parseJSON(d):d}catch(f){}p.data(a,c,d)}else d=b}return d}function K(a){var b;for(b in a){if(b==="data"&&p.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function ba(){return!1}function bb(){return!0}function bh(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function bi(a,b){do a=a[b];while(a&&a.nodeType!==1);return a}function bj(a,b,c){b=b||0;if(p.isFunction(b))return p.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return p.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=p.grep(a,function(a){return a.nodeType===1});if(be.test(b))return p.filter(b,d,!c);b=p.filter(b,d)}return p.grep(a,function(a,d){return p.inArray(a,b)>=0===c})}function bk(a){var b=bl.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function bC(a,b){return a.getElementsByTagName(b)[0]||a.appendChild(a.ownerDocument.createElement(b))}function bD(a,b){if(b.nodeType!==1||!p.hasData(a))return;var c,d,e,f=p._data(a),g=p._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;d<e;d++)p.event.add(b,c,h[c][d])}g.data&&(g.data=p.extend({},g.data))}function bE(a,b){var c;if(b.nodeType!==1)return;b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),c==="object"?(b.parentNode&&(b.outerHTML=a.outerHTML),p.support.html5Clone&&a.innerHTML&&!p.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):c==="input"&&bv.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):c==="option"?b.selected=a.defaultSelected:c==="input"||c==="textarea"?b.defaultValue=a.defaultValue:c==="script"&&b.text!==a.text&&(b.text=a.text),b.removeAttribute(p.expando)}function bF(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bG(a){bv.test(a.type)&&(a.defaultChecked=a.checked)}function bX(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=bV.length;while(e--){b=bV[e]+c;if(b in a)return b}return d}function bY(a,b){return a=b||a,p.css(a,"display")==="none"||!p.contains(a.ownerDocument,a)}function bZ(a,b){var c,d,e=[],f=0,g=a.length;for(;f<g;f++){c=a[f];if(!c.style)continue;e[f]=p._data(c,"olddisplay"),b?(!e[f]&&c.style.display==="none"&&(c.style.display=""),c.style.display===""&&bY(c)&&(e[f]=p._data(c,"olddisplay",cb(c.nodeName)))):(d=bH(c,"display"),!e[f]&&d!=="none"&&p._data(c,"olddisplay",d))}for(f=0;f<g;f++){c=a[f];if(!c.style)continue;if(!b||c.style.display==="none"||c.style.display==="")c.style.display=b?e[f]||"":"none"}return a}function b$(a,b,c){var d=bO.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function b_(a,b,c,d){var e=c===(d?"border":"content")?4:b==="width"?1:0,f=0;for(;e<4;e+=2)c==="margin"&&(f+=p.css(a,c+bU[e],!0)),d?(c==="content"&&(f-=parseFloat(bH(a,"padding"+bU[e]))||0),c!=="margin"&&(f-=parseFloat(bH(a,"border"+bU[e]+"Width"))||0)):(f+=parseFloat(bH(a,"padding"+bU[e]))||0,c!=="padding"&&(f+=parseFloat(bH(a,"border"+bU[e]+"Width"))||0));return f}function ca(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=!0,f=p.support.boxSizing&&p.css(a,"boxSizing")==="border-box";if(d<=0){d=bH(a,b);if(d<0||d==null)d=a.style[b];if(bP.test(d))return d;e=f&&(p.support.boxSizingReliable||d===a.style[b]),d=parseFloat(d)||0}return d+b_(a,b,c||(f?"border":"content"),e)+"px"}function cb(a){if(bR[a])return bR[a];var b=p("<"+a+">").appendTo(e.body),c=b.css("display");b.remove();if(c==="none"||c===""){bI=e.body.appendChild(bI||p.extend(e.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!bJ||!bI.createElement)bJ=(bI.contentWindow||bI.contentDocument).document,bJ.write("<!doctype html><html><body>"),bJ.close();b=bJ.body.appendChild(bJ.createElement(a)),c=bH(b,"display"),e.body.removeChild(bI)}return bR[a]=c,c}function ch(a,b,c,d){var e;if(p.isArray(b))p.each(b,function(b,e){c||cd.test(a)?d(a,e):ch(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&p.type(b)==="object")for(e in b)ch(a+"["+e+"]",b[e],c,d);else d(a,b)}function cy(a){return function(b,c){typeof b!="string"&&(c=b,b="*");var d,e,f,g=b.toLowerCase().split(s),h=0,i=g.length;if(p.isFunction(c))for(;h<i;h++)d=g[h],f=/^\+/.test(d),f&&(d=d.substr(1)||"*"),e=a[d]=a[d]||[],e[f?"unshift":"push"](c)}}function cz(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h,i=a[f],j=0,k=i?i.length:0,l=a===cu;for(;j<k&&(l||!h);j++)h=i[j](c,d,e),typeof h=="string"&&(!l||g[h]?h=b:(c.dataTypes.unshift(h),h=cz(a,c,d,e,h,g)));return(l||!h)&&!g["*"]&&(h=cz(a,c,d,e,"*",g)),h}function cA(a,c){var d,e,f=p.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((f[d]?a:e||(e={}))[d]=c[d]);e&&p.extend(!0,a,e)}function cB(a,c,d){var e,f,g,h,i=a.contents,j=a.dataTypes,k=a.responseFields;for(f in k)f in d&&(c[k[f]]=d[f]);while(j[0]==="*")j.shift(),e===b&&(e=a.mimeType||c.getResponseHeader("content-type"));if(e)for(f in i)if(i[f]&&i[f].test(e)){j.unshift(f);break}if(j[0]in d)g=j[0];else{for(f in d){if(!j[0]||a.converters[f+" "+j[0]]){g=f;break}h||(h=f)}g=g||h}if(g)return g!==j[0]&&j.unshift(g),d[g]}function cC(a,b){var c,d,e,f,g=a.dataTypes.slice(),h=g[0],i={},j=0;a.dataFilter&&(b=a.dataFilter(b,a.dataType));if(g[1])for(c in a.converters)i[c.toLowerCase()]=a.converters[c];for(;e=g[++j];)if(e!=="*"){if(h!=="*"&&h!==e){c=i[h+" "+e]||i["* "+e];if(!c)for(d in i){f=d.split(" ");if(f[1]===e){c=i[h+" "+f[0]]||i["* "+f[0]];if(c){c===!0?c=i[d]:i[d]!==!0&&(e=f[0],g.splice(j--,0,e));break}}}if(c!==!0)if(c&&a["throws"])b=c(b);else try{b=c(b)}catch(k){return{state:"parsererror",error:c?k:"No conversion from "+h+" to "+e}}}h=e}return{state:"success",data:b}}function cK(){try{return new a.XMLHttpRequest}catch(b){}}function cL(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function cT(){return setTimeout(function(){cM=b},0),cM=p.now()}function cU(a,b){p.each(b,function(b,c){var d=(cS[b]||[]).concat(cS["*"]),e=0,f=d.length;for(;e<f;e++)if(d[e].call(a,b,c))return})}function cV(a,b,c){var d,e=0,f=0,g=cR.length,h=p.Deferred().always(function(){delete i.elem}),i=function(){var b=cM||cT(),c=Math.max(0,j.startTime+j.duration-b),d=1-(c/j.duration||0),e=0,f=j.tweens.length;for(;e<f;e++)j.tweens[e].run(d);return h.notifyWith(a,[j,d,c]),d<1&&f?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:p.extend({},b),opts:p.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:cM||cT(),duration:c.duration,tweens:[],createTween:function(b,c,d){var e=p.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(e),e},stop:function(b){var c=0,d=b?j.tweens.length:0;for(;c<d;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;cW(k,j.opts.specialEasing);for(;e<g;e++){d=cR[e].call(j,a,k,j.opts);if(d)return d}return cU(j,k),p.isFunction(j.opts.start)&&j.opts.start.call(a,j),p.fx.timer(p.extend(i,{anim:j,queue:j.opts.queue,elem:a})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}function cW(a,b){var c,d,e,f,g;for(c in a){d=p.camelCase(c),e=b[d],f=a[c],p.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=p.cssHooks[d];if(g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}}function cX(a,b,c){var d,e,f,g,h,i,j,k,l=this,m=a.style,n={},o=[],q=a.nodeType&&bY(a);c.queue||(j=p._queueHooks(a,"fx"),j.unqueued==null&&(j.unqueued=0,k=j.empty.fire,j.empty.fire=function(){j.unqueued||k()}),j.unqueued++,l.always(function(){l.always(function(){j.unqueued--,p.queue(a,"fx").length||j.empty.fire()})})),a.nodeType===1&&("height"in b||"width"in b)&&(c.overflow=[m.overflow,m.overflowX,m.overflowY],p.css(a,"display")==="inline"&&p.css(a,"float")==="none"&&(!p.support.inlineBlockNeedsLayout||cb(a.nodeName)==="inline"?m.display="inline-block":m.zoom=1)),c.overflow&&(m.overflow="hidden",p.support.shrinkWrapBlocks||l.done(function(){m.overflow=c.overflow[0],m.overflowX=c.overflow[1],m.overflowY=c.overflow[2]}));for(d in b){f=b[d];if(cO.exec(f)){delete b[d];if(f===(q?"hide":"show"))continue;o.push(d)}}g=o.length;if(g){h=p._data(a,"fxshow")||p._data(a,"fxshow",{}),q?p(a).show():l.done(function(){p(a).hide()}),l.done(function(){var b;p.removeData(a,"fxshow",!0);for(b in n)p.style(a,b,n[b])});for(d=0;d<g;d++)e=o[d],i=l.createTween(e,q?h[e]:0),n[e]=h[e]||p.style(a,e),e in h||(h[e]=i.start,q&&(i.end=i.start,i.start=e==="width"||e==="height"?1:0))}}function cY(a,b,c,d,e){return new cY.prototype.init(a,b,c,d,e)}function cZ(a,b){var c,d={height:a},e=0;for(;e<4;e+=2-b)c=bU[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function c_(a){return p.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}var c,d,e=a.document,f=a.location,g=a.navigator,h=a.jQuery,i=a.$,j=Array.prototype.push,k=Array.prototype.slice,l=Array.prototype.indexOf,m=Object.prototype.toString,n=Object.prototype.hasOwnProperty,o=String.prototype.trim,p=function(a,b){return new p.fn.init(a,b,c)},q=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,r=/\S/,s=/\s+/,t=r.test(" ")?/^[\s\xA0]+|[\s\xA0]+$/g:/^\s+|\s+$/g,u=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,y=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,z=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,A=/^-ms-/,B=/-([\da-z])/gi,C=function(a,b){return(b+"").toUpperCase()},D=function(){e.addEventListener?(e.removeEventListener("DOMContentLoaded",D,!1),p.ready()):e.readyState==="complete"&&(e.detachEvent("onreadystatechange",D),p.ready())},E={};p.fn=p.prototype={constructor:p,init:function(a,c,d){var f,g,h,i;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if(typeof a=="string"){a.charAt(0)==="<"&&a.charAt(a.length-1)===">"&&a.length>=3?f=[null,a,null]:f=u.exec(a);if(f&&(f[1]||!c)){if(f[1])return c=c instanceof p?c[0]:c,i=c&&c.nodeType?c.ownerDocument||c:e,a=p.parseHTML(f[1],i,!0),v.test(f[1])&&p.isPlainObject(c)&&this.attr.call(a,c,!0),p.merge(this,a);g=e.getElementById(f[2]);if(g&&g.parentNode){if(g.id!==f[2])return d.find(a);this.length=1,this[0]=g}return this.context=e,this.selector=a,this}return!c||c.jquery?(c||d).find(a):this.constructor(c).find(a)}return p.isFunction(a)?d.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),p.makeArray(a,this))},selector:"",jquery:"1.8.0",length:0,size:function(){return this.length},toArray:function(){return k.call(this)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=p.merge(this.constructor(),a);return d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},each:function(a,b){return p.each(this,a,b)},ready:function(a){return p.ready.promise().done(a),this},eq:function(a){return a=+a,a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(k.apply(this,arguments),"slice",k.call(arguments).join(","))},map:function(a){return this.pushStack(p.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:j,sort:[].sort,splice:[].splice},p.fn.init.prototype=p.fn,p.extend=p.fn.extend=function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;typeof h=="boolean"&&(k=h,h=arguments[1]||{},i=2),typeof h!="object"&&!p.isFunction(h)&&(h={}),j===i&&(h=this,--i);for(;i<j;i++)if((a=arguments[i])!=null)for(c in a){d=h[c],e=a[c];if(h===e)continue;k&&e&&(p.isPlainObject(e)||(f=p.isArray(e)))?(f?(f=!1,g=d&&p.isArray(d)?d:[]):g=d&&p.isPlainObject(d)?d:{},h[c]=p.extend(k,g,e)):e!==b&&(h[c]=e)}return h},p.extend({noConflict:function(b){return a.$===p&&(a.$=i),b&&a.jQuery===p&&(a.jQuery=h),p},isReady:!1,readyWait:1,holdReady:function(a){a?p.readyWait++:p.ready(!0)},ready:function(a){if(a===!0?--p.readyWait:p.isReady)return;if(!e.body)return setTimeout(p.ready,1);p.isReady=!0;if(a!==!0&&--p.readyWait>0)return;d.resolveWith(e,[p]),p.fn.trigger&&p(e).trigger("ready").off("ready")},isFunction:function(a){return p.type(a)==="function"},isArray:Array.isArray||function(a){return p.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):E[m.call(a)]||"object"},isPlainObject:function(a){if(!a||p.type(a)!=="object"||a.nodeType||p.isWindow(a))return!1;try{if(a.constructor&&!n.call(a,"constructor")&&!n.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||n.call(a,d)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},error:function(a){throw new Error(a)},parseHTML:function(a,b,c){var d;return!a||typeof a!="string"?null:(typeof b=="boolean"&&(c=b,b=0),b=b||e,(d=v.exec(a))?[b.createElement(d[1])]:(d=p.buildFragment([a],b,c?null:[]),p.merge([],(d.cacheable?p.clone(d.fragment):d.fragment).childNodes)))},parseJSON:function(b){if(!b||typeof b!="string")return null;b=p.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(w.test(b.replace(y,"@").replace(z,"]").replace(x,"")))return(new Function("return "+b))();p.error("Invalid JSON: "+b)},parseXML:function(c){var d,e;if(!c||typeof c!="string")return null;try{a.DOMParser?(e=new DOMParser,d=e.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(f){d=b}return(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&p.error("Invalid XML: "+c),d},noop:function(){},globalEval:function(b){b&&r.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(A,"ms-").replace(B,C)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var e,f=0,g=a.length,h=g===b||p.isFunction(a);if(d){if(h){for(e in a)if(c.apply(a[e],d)===!1)break}else for(;f<g;)if(c.apply(a[f++],d)===!1)break}else if(h){for(e in a)if(c.call(a[e],e,a[e])===!1)break}else for(;f<g;)if(c.call(a[f],f,a[f++])===!1)break;return a},trim:o?function(a){return a==null?"":o.call(a)}:function(a){return a==null?"":a.toString().replace(t,"")},makeArray:function(a,b){var c,d=b||[];return a!=null&&(c=p.type(a),a.length==null||c==="string"||c==="function"||c==="regexp"||p.isWindow(a)?j.call(d,a):p.merge(d,a)),d},inArray:function(a,b,c){var d;if(b){if(l)return l.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=c.length,e=a.length,f=0;if(typeof d=="number")for(;f<d;f++)a[e++]=c[f];else while(c[f]!==b)a[e++]=c[f++];return a.length=e,a},grep:function(a,b,c){var d,e=[],f=0,g=a.length;c=!!c;for(;f<g;f++)d=!!b(a[f],f),c!==d&&e.push(a[f]);return e},map:function(a,c,d){var e,f,g=[],h=0,i=a.length,j=a instanceof p||i!==b&&typeof i=="number"&&(i>0&&a[0]&&a[i-1]||i===0||p.isArray(a));if(j)for(;h<i;h++)e=c(a[h],h,d),e!=null&&(g[g.length]=e);else for(f in a)e=c(a[f],f,d),e!=null&&(g[g.length]=e);return g.concat.apply([],g)},guid:1,proxy:function(a,c){var d,e,f;return typeof c=="string"&&(d=a[c],c=a,a=d),p.isFunction(a)?(e=k.call(arguments,2),f=function(){return a.apply(c,e.concat(k.call(arguments)))},f.guid=a.guid=a.guid||f.guid||p.guid++,f):b},access:function(a,c,d,e,f,g,h){var i,j=d==null,k=0,l=a.length;if(d&&typeof d=="object"){for(k in d)p.access(a,c,k,d[k],1,g,e);f=1}else if(e!==b){i=h===b&&p.isFunction(e),j&&(i?(i=c,c=function(a,b,c){return i.call(p(a),c)}):(c.call(a,e),c=null));if(c)for(;k<l;k++)c(a[k],d,i?e.call(a[k],k,c(a[k],d)):e,h);f=1}return f?a:j?c.call(a):l?c(a[0],d):g},now:function(){return(new Date).getTime()}}),p.ready.promise=function(b){if(!d){d=p.Deferred();if(e.readyState==="complete"||e.readyState!=="loading"&&e.addEventListener)setTimeout(p.ready,1);else if(e.addEventListener)e.addEventListener("DOMContentLoaded",D,!1),a.addEventListener("load",p.ready,!1);else{e.attachEvent("onreadystatechange",D),a.attachEvent("onload",p.ready);var c=!1;try{c=a.frameElement==null&&e.documentElement}catch(f){}c&&c.doScroll&&function g(){if(!p.isReady){try{c.doScroll("left")}catch(a){return setTimeout(g,50)}p.ready()}}()}}return d.promise(b)},p.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){E["[object "+b+"]"]=b.toLowerCase()}),c=p(e);var F={};p.Callbacks=function(a){a=typeof a=="string"?F[a]||G(a):p.extend({},a);var c,d,e,f,g,h,i=[],j=!a.once&&[],k=function(b){c=a.memory&&b,d=!0,h=f||0,f=0,g=i.length,e=!0;for(;i&&h<g;h++)if(i[h].apply(b[0],b[1])===!1&&a.stopOnFalse){c=!1;break}e=!1,i&&(j?j.length&&k(j.shift()):c?i=[]:l.disable())},l={add:function(){if(i){var b=i.length;(function d(b){p.each(b,function(b,c){p.isFunction(c)&&(!a.unique||!l.has(c))?i.push(c):c&&c.length&&d(c)})})(arguments),e?g=i.length:c&&(f=b,k(c))}return this},remove:function(){return i&&p.each(arguments,function(a,b){var c;while((c=p.inArray(b,i,c))>-1)i.splice(c,1),e&&(c<=g&&g--,c<=h&&h--)}),this},has:function(a){return p.inArray(a,i)>-1},empty:function(){return i=[],this},disable:function(){return i=j=c=b,this},disabled:function(){return!i},lock:function(){return j=b,c||l.disable(),this},locked:function(){return!j},fireWith:function(a,b){return b=b||[],b=[a,b.slice?b.slice():b],i&&(!d||j)&&(e?j.push(b):k(b)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!d}};return l},p.extend({Deferred:function(a){var b=[["resolve","done",p.Callbacks("once memory"),"resolved"],["reject","fail",p.Callbacks("once memory"),"rejected"],["notify","progress",p.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return p.Deferred(function(c){p.each(b,function(b,d){var f=d[0],g=a[b];e[d[1]](p.isFunction(g)?function(){var a=g.apply(this,arguments);a&&p.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f+"With"](this===e?c:this,[a])}:c[f])}),a=null}).promise()},promise:function(a){return typeof a=="object"?p.extend(a,d):d}},e={};return d.pipe=d.then,p.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[a^1][2].disable,b[2][2].lock),e[f[0]]=g.fire,e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=k.call(arguments),d=c.length,e=d!==1||a&&p.isFunction(a.promise)?d:0,f=e===1?a:p.Deferred(),g=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?k.call(arguments):d,c===h?f.notifyWith(b,c):--e||f.resolveWith(b,c)}},h,i,j;if(d>1){h=new Array(d),i=new Array(d),j=new Array(d);for(;b<d;b++)c[b]&&p.isFunction(c[b].promise)?c[b].promise().done(g(b,j,c)).fail(f.reject).progress(g(b,i,h)):--e}return e||f.resolveWith(j,c),f.promise()}}),p.support=function(){var b,c,d,f,g,h,i,j,k,l,m,n=e.createElement("div");n.setAttribute("className","t"),n.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",c=n.getElementsByTagName("*"),d=n.getElementsByTagName("a")[0],d.style.cssText="top:1px;float:left;opacity:.5";if(!c||!c.length||!d)return{};f=e.createElement("select"),g=f.appendChild(e.createElement("option")),h=n.getElementsByTagName("input")[0],b={leadingWhitespace:n.firstChild.nodeType===3,tbody:!n.getElementsByTagName("tbody").length,htmlSerialize:!!n.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:d.getAttribute("href")==="/a",opacity:/^0.5/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:n.className!=="t",enctype:!!e.createElement("form").enctype,html5Clone:e.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",boxModel:e.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},h.checked=!0,b.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,b.optDisabled=!g.disabled;try{delete n.test}catch(o){b.deleteExpando=!1}!n.addEventListener&&n.attachEvent&&n.fireEvent&&(n.attachEvent("onclick",m=function(){b.noCloneEvent=!1}),n.cloneNode(!0).fireEvent("onclick"),n.detachEvent("onclick",m)),h=e.createElement("input"),h.value="t",h.setAttribute("type","radio"),b.radioValue=h.value==="t",h.setAttribute("checked","checked"),h.setAttribute("name","t"),n.appendChild(h),i=e.createDocumentFragment(),i.appendChild(n.lastChild),b.checkClone=i.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=h.checked,i.removeChild(h),i.appendChild(n);if(n.attachEvent)for(k in{submit:!0,change:!0,focusin:!0})j="on"+k,l=j in n,l||(n.setAttribute(j,"return;"),l=typeof n[j]=="function"),b[k+"Bubbles"]=l;return p(function(){var c,d,f,g,h="padding:0;margin:0;border:0;display:block;overflow:hidden;",i=e.getElementsByTagName("body")[0];if(!i)return;c=e.createElement("div"),c.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",i.insertBefore(c,i.firstChild),d=e.createElement("div"),c.appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",f=d.getElementsByTagName("td"),f[0].style.cssText="padding:0;margin:0;border:0;display:none",l=f[0].offsetHeight===0,f[0].style.display="",f[1].style.display="none",b.reliableHiddenOffsets=l&&f[0].offsetHeight===0,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",b.boxSizing=d.offsetWidth===4,b.doesNotIncludeMarginInBodyOffset=i.offsetTop!==1,a.getComputedStyle&&(b.pixelPosition=(a.getComputedStyle(d,null)||{}).top!=="1%",b.boxSizingReliable=(a.getComputedStyle(d,null)||{width:"4px"}).width==="4px",g=e.createElement("div"),g.style.cssText=d.style.cssText=h,g.style.marginRight=g.style.width="0",d.style.width="1px",d.appendChild(g),b.reliableMarginRight=!parseFloat((a.getComputedStyle(g,null)||{}).marginRight)),typeof d.style.zoom!="undefined"&&(d.innerHTML="",d.style.cssText=h+"width:1px;padding:1px;display:inline;zoom:1",b.inlineBlockNeedsLayout=d.offsetWidth===3,d.style.display="block",d.style.overflow="visible",d.innerHTML="<div></div>",d.firstChild.style.width="5px",b.shrinkWrapBlocks=d.offsetWidth!==3,c.style.zoom=1),i.removeChild(c),c=d=f=g=null}),i.removeChild(n),c=d=f=g=h=i=n=null,b}();var H=/^(?:\{.*\}|\[.*\])$/,I=/([A-Z])/g;p.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(p.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?p.cache[a[p.expando]]:a[p.expando],!!a&&!K(a)},data:function(a,c,d,e){if(!p.acceptData(a))return;var f,g,h=p.expando,i=typeof c=="string",j=a.nodeType,k=j?p.cache:a,l=j?a[h]:a[h]&&h;if((!l||!k[l]||!e&&!k[l].data)&&i&&d===b)return;l||(j?a[h]=l=p.deletedIds.pop()||++p.uuid:l=h),k[l]||(k[l]={},j||(k[l].toJSON=p.noop));if(typeof c=="object"||typeof c=="function")e?k[l]=p.extend(k[l],c):k[l].data=p.extend(k[l].data,c);return f=k[l],e||(f.data||(f.data={}),f=f.data),d!==b&&(f[p.camelCase(c)]=d),i?(g=f[c],g==null&&(g=f[p.camelCase(c)])):g=f,g},removeData:function(a,b,c){if(!p.acceptData(a))return;var d,e,f,g=a.nodeType,h=g?p.cache:a,i=g?a[p.expando]:p.expando;if(!h[i])return;if(b){d=c?h[i]:h[i].data;if(d){p.isArray(b)||(b in d?b=[b]:(b=p.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,f=b.length;e<f;e++)delete d[b[e]];if(!(c?K:p.isEmptyObject)(d))return}}if(!c){delete h[i].data;if(!K(h[i]))return}g?p.cleanData([a],!0):p.support.deleteExpando||h!=h.window?delete h[i]:h[i]=null},_data:function(a,b,c){return p.data(a,b,c,!0)},acceptData:function(a){var b=a.nodeName&&p.noData[a.nodeName.toLowerCase()];return!b||b!==!0&&a.getAttribute("classid")===b}}),p.fn.extend({data:function(a,c){var d,e,f,g,h,i=this[0],j=0,k=null;if(a===b){if(this.length){k=p.data(i);if(i.nodeType===1&&!p._data(i,"parsedAttrs")){f=i.attributes;for(h=f.length;j<h;j++)g=f[j].name,g.indexOf("data-")===0&&(g=p.camelCase(g.substring(5)),J(i,g,k[g]));p._data(i,"parsedAttrs",!0)}}return k}return typeof a=="object"?this.each(function(){p.data(this,a)}):(d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!",p.access(this,function(c){if(c===b)return k=this.triggerHandler("getData"+e,[d[0]]),k===b&&i&&(k=p.data(i,a),k=J(i,a,k)),k===b&&d[1]?this.data(d[0]):k;d[1]=c,this.each(function(){var b=p(this);b.triggerHandler("setData"+e,d),p.data(this,a,c),b.triggerHandler("changeData"+e,d)})},null,c,arguments.length>1,null,!1))},removeData:function(a){return this.each(function(){p.removeData(this,a)})}}),p.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=p._data(a,b),c&&(!d||p.isArray(c)?d=p._data(a,b,p.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=p.queue(a,b),d=c.shift(),e=p._queueHooks(a,b),f=function(){p.dequeue(a,b)};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),delete e.stop,d.call(a,f,e)),!c.length&&e&&e.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return p._data(a,c)||p._data(a,c,{empty:p.Callbacks("once memory").add(function(){p.removeData(a,b+"queue",!0),p.removeData(a,c,!0)})})}}),p.fn.extend({queue:function(a,c){var d=2;return typeof a!="string"&&(c=a,a="fx",d--),arguments.length<d?p.queue(this[0],a):c===b?this:this.each(function(){var b=p.queue(this,a,c);p._queueHooks(this,a),a==="fx"&&b[0]!=="inprogress"&&p.dequeue(this,a)})},dequeue:function(a){return this.each(function(){p.dequeue(this,a)})},delay:function(a,b){return a=p.fx?p.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){var d,e=1,f=p.Deferred(),g=this,h=this.length,i=function(){--e||f.resolveWith(g,[g])};typeof a!="string"&&(c=a,a=b),a=a||"fx";while(h--)(d=p._data(g[h],a+"queueHooks"))&&d.empty&&(e++,d.empty.add(i));return i(),f.promise(c)}});var L,M,N,O=/[\t\r\n]/g,P=/\r/g,Q=/^(?:button|input)$/i,R=/^(?:button|input|object|select|textarea)$/i,S=/^a(?:rea|)$/i,T=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,U=p.support.getSetAttribute;p.fn.extend({attr:function(a,b){return p.access(this,p.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){p.removeAttr(this,a)})},prop:function(a,b){return p.access(this,p.prop,a,b,arguments.length>1)},removeProp:function(a){return a=p.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,h;if(p.isFunction(a))return this.each(function(b){p(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(s);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{f=" "+e.className+" ";for(g=0,h=b.length;g<h;g++)~f.indexOf(" "+b[g]+" ")||(f+=b[g]+" ");e.className=p.trim(f)}}}return this},removeClass:function(a){var c,d,e,f,g,h,i;if(p.isFunction(a))return this.each(function(b){p(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(s);for(h=0,i=this.length;h<i;h++){e=this[h];if(e.nodeType===1&&e.className){d=(" "+e.className+" ").replace(O," ");for(f=0,g=c.length;f<g;f++)while(d.indexOf(" "+c[f]+" ")>-1)d=d.replace(" "+c[f]+" "," ");e.className=a?p.trim(d):""}}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";return p.isFunction(a)?this.each(function(c){p(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if(c==="string"){var e,f=0,g=p(this),h=b,i=a.split(s);while(e=i[f++])h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&p._data(this,"__className__",this.className),this.className=this.className||a===!1?"":p._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(O," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,f=this[0];if(!arguments.length){if(f)return c=p.valHooks[f.type]||p.valHooks[f.nodeName.toLowerCase()],c&&"get"in c&&(d=c.get(f,"value"))!==b?d:(d=f.value,typeof d=="string"?d.replace(P,""):d==null?"":d);return}return e=p.isFunction(a),this.each(function(d){var f,g=p(this);if(this.nodeType!==1)return;e?f=a.call(this,d,g.val()):f=a,f==null?f="":typeof f=="number"?f+="":p.isArray(f)&&(f=p.map(f,function(a){return a==null?"":a+""})),c=p.valHooks[this.type]||p.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,f,"value")===b)this.value=f})}}),p.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,f=a.selectedIndex,g=[],h=a.options,i=a.type==="select-one";if(f<0)return null;c=i?f:0,d=i?f+1:h.length;for(;c<d;c++){e=h[c];if(e.selected&&(p.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!p.nodeName(e.parentNode,"optgroup"))){b=p(e).val();if(i)return b;g.push(b)}}return i&&!g.length&&h.length?p(h[f]).val():g},set:function(a,b){var c=p.makeArray(b);return p(a).find("option").each(function(){this.selected=p.inArray(p(this).val(),c)>=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{},attr:function(a,c,d,e){var f,g,h,i=a.nodeType;if(!a||i===3||i===8||i===2)return;if(e&&p.isFunction(p.fn[c]))return p(a)[c](d);if(typeof a.getAttribute=="undefined")return p.prop(a,c,d);h=i!==1||!p.isXMLDoc(a),h&&(c=c.toLowerCase(),g=p.attrHooks[c]||(T.test(c)?M:L));if(d!==b){if(d===null){p.removeAttr(a,c);return}return g&&"set"in g&&h&&(f=g.set(a,d,c))!==b?f:(a.setAttribute(c,""+d),d)}return g&&"get"in g&&h&&(f=g.get(a,c))!==null?f:(f=a.getAttribute(c),f===null?b:f)},removeAttr:function(a,b){var c,d,e,f,g=0;if(b&&a.nodeType===1){d=b.split(s);for(;g<d.length;g++)e=d[g],e&&(c=p.propFix[e]||e,f=T.test(e),f||p.attr(a,e,""),a.removeAttribute(U?e:c),f&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(Q.test(a.nodeName)&&a.parentNode)p.error("type property can't be changed");else if(!p.support.radioValue&&b==="radio"&&p.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}},value:{get:function(a,b){return L&&p.nodeName(a,"button")?L.get(a,b):b in a?a.value:null},set:function(a,b,c){if(L&&p.nodeName(a,"button"))return L.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,f,g,h=a.nodeType;if(!a||h===3||h===8||h===2)return;return g=h!==1||!p.isXMLDoc(a),g&&(c=p.propFix[c]||c,f=p.propHooks[c]),d!==b?f&&"set"in f&&(e=f.set(a,d,c))!==b?e:a[c]=d:f&&"get"in f&&(e=f.get(a,c))!==null?e:a[c]},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):R.test(a.nodeName)||S.test(a.nodeName)&&a.href?0:b}}}}),M={get:function(a,c){var d,e=p.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;return b===!1?p.removeAttr(a,c):(d=p.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase())),c}},U||(N={name:!0,id:!0,coords:!0},L=p.valHooks.button={get:function(a,c){var d;return d=a.getAttributeNode(c),d&&(N[c]?d.value!=="":d.specified)?d.value:b},set:function(a,b,c){var d=a.getAttributeNode(c);return d||(d=e.createAttribute(c),a.setAttributeNode(d)),d.value=b+""}},p.each(["width","height"],function(a,b){p.attrHooks[b]=p.extend(p.attrHooks[b],{set:function(a,c){if(c==="")return a.setAttribute(b,"auto"),c}})}),p.attrHooks.contenteditable={get:L.get,set:function(a,b,c){b===""&&(b="false"),L.set(a,b,c)}}),p.support.hrefNormalized||p.each(["href","src","width","height"],function(a,c){p.attrHooks[c]=p.extend(p.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),p.support.style||(p.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),p.support.optSelected||(p.propHooks.selected=p.extend(p.propHooks.selected,{get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}})),p.support.enctype||(p.propFix.enctype="encoding"),p.support.checkOn||p.each(["radio","checkbox"],function(){p.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),p.each(["radio","checkbox"],function(){p.valHooks[this]=p.extend(p.valHooks[this],{set:function(a,b){if(p.isArray(b))return a.checked=p.inArray(p(a).val(),b)>=0}})});var V=/^(?:textarea|input|select)$/i,W=/^([^\.]*|)(?:\.(.+)|)$/,X=/(?:^|\s)hover(\.\S+|)\b/,Y=/^key/,Z=/^(?:mouse|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=function(a){return p.event.special.hover?a:a.replace(X,"mouseenter$1 mouseleave$1")};p.event={add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,q,r;if(a.nodeType===3||a.nodeType===8||!c||!d||!(g=p._data(a)))return;d.handler&&(o=d,d=o.handler,f=o.selector),d.guid||(d.guid=p.guid++),i=g.events,i||(g.events=i={}),h=g.handle,h||(g.handle=h=function(a){return typeof p!="undefined"&&(!a||p.event.triggered!==a.type)?p.event.dispatch.apply(h.elem,arguments):b},h.elem=a),c=p.trim(_(c)).split(" ");for(j=0;j<c.length;j++){k=W.exec(c[j])||[],l=k[1],m=(k[2]||"").split(".").sort(),r=p.event.special[l]||{},l=(f?r.delegateType:r.bindType)||l,r=p.event.special[l]||{},n=p.extend({type:l,origType:k[1],data:e,handler:d,guid:d.guid,selector:f,namespace:m.join(".")},o),q=i[l];if(!q){q=i[l]=[],q.delegateCount=0;if(!r.setup||r.setup.call(a,e,m,h)===!1)a.addEventListener?a.addEventListener(l,h,!1):a.attachEvent&&a.attachEvent("on"+l,h)}r.add&&(r.add.call(a,n),n.handler.guid||(n.handler.guid=d.guid)),f?q.splice(q.delegateCount++,0,n):q.push(n),p.event.global[l]=!0}a=null},global:{},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,q,r=p.hasData(a)&&p._data(a);if(!r||!(m=r.events))return;b=p.trim(_(b||"")).split(" ");for(f=0;f<b.length;f++){g=W.exec(b[f])||[],h=i=g[1],j=g[2];if(!h){for(h in m)p.event.remove(a,h+b[f],c,d,!0);continue}n=p.event.special[h]||{},h=(d?n.delegateType:n.bindType)||h,o=m[h]||[],k=o.length,j=j?new RegExp("(^|\\.)"+j.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null;for(l=0;l<o.length;l++)q=o[l],(e||i===q.origType)&&(!c||c.guid===q.guid)&&(!j||j.test(q.namespace))&&(!d||d===q.selector||d==="**"&&q.selector)&&(o.splice(l--,1),q.selector&&o.delegateCount--,n.remove&&n.remove.call(a,q));o.length===0&&k!==o.length&&((!n.teardown||n.teardown.call(a,j,r.handle)===!1)&&p.removeEvent(a,h,r.handle),delete m[h])}p.isEmptyObject(m)&&(delete r.handle,p.removeData(a,"events",!0))},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,f,g){if(!f||f.nodeType!==3&&f.nodeType!==8){var h,i,j,k,l,m,n,o,q,r,s=c.type||c,t=[];if($.test(s+p.event.triggered))return;s.indexOf("!")>=0&&(s=s.slice(0,-1),i=!0),s.indexOf(".")>=0&&(t=s.split("."),s=t.shift(),t.sort());if((!f||p.event.customEvent[s])&&!p.event.global[s])return;c=typeof c=="object"?c[p.expando]?c:new p.Event(s,c):new p.Event(s),c.type=s,c.isTrigger=!0,c.exclusive=i,c.namespace=t.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+t.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,m=s.indexOf(":")<0?"on"+s:"";if(!f){h=p.cache;for(j in h)h[j].events&&h[j].events[s]&&p.event.trigger(c,d,h[j].handle.elem,!0);return}c.result=b,c.target||(c.target=f),d=d!=null?p.makeArray(d):[],d.unshift(c),n=p.event.special[s]||{};if(n.trigger&&n.trigger.apply(f,d)===!1)return;q=[[f,n.bindType||s]];if(!g&&!n.noBubble&&!p.isWindow(f)){r=n.delegateType||s,k=$.test(r+s)?f:f.parentNode;for(l=f;k;k=k.parentNode)q.push([k,r]),l=k;l===(f.ownerDocument||e)&&q.push([l.defaultView||l.parentWindow||a,r])}for(j=0;j<q.length&&!c.isPropagationStopped();j++)k=q[j][0],c.type=q[j][1],o=(p._data(k,"events")||{})[c.type]&&p._data(k,"handle"),o&&o.apply(k,d),o=m&&k[m],o&&p.acceptData(k)&&o.apply(k,d)===!1&&c.preventDefault();return c.type=s,!g&&!c.isDefaultPrevented()&&(!n._default||n._default.apply(f.ownerDocument,d)===!1)&&(s!=="click"||!p.nodeName(f,"a"))&&p.acceptData(f)&&m&&f[s]&&(s!=="focus"&&s!=="blur"||c.target.offsetWidth!==0)&&!p.isWindow(f)&&(l=f[m],l&&(f[m]=null),p.event.triggered=s,f[s](),p.event.triggered=b,l&&(f[m]=l)),c.result}return},dispatch:function(c){c=p.event.fix(c||a.event);var d,e,f,g,h,i,j,k,l,m,n,o=(p._data(this,"events")||{})[c.type]||[],q=o.delegateCount,r=[].slice.call(arguments),s=!c.exclusive&&!c.namespace,t=p.event.special[c.type]||{},u=[];r[0]=c,c.delegateTarget=this;if(t.preDispatch&&t.preDispatch.call(this,c)===!1)return;if(q&&(!c.button||c.type!=="click")){g=p(this),g.context=this;for(f=c.target;f!=this;f=f.parentNode||this)if(f.disabled!==!0||c.type!=="click"){i={},k=[],g[0]=f;for(d=0;d<q;d++)l=o[d],m=l.selector,i[m]===b&&(i[m]=g.is(m)),i[m]&&k.push(l);k.length&&u.push({elem:f,matches:k})}}o.length>q&&u.push({elem:this,matches:o.slice(q)});for(d=0;d<u.length&&!c.isPropagationStopped();d++){j=u[d],c.currentTarget=j.elem;for(e=0;e<j.matches.length&&!c.isImmediatePropagationStopped();e++){l=j.matches[e];if(s||!c.namespace&&!l.namespace||c.namespace_re&&c.namespace_re.test(l.namespace))c.data=l.data,c.handleObj=l,h=((p.event.special[l.origType]||{}).handle||l.handler).apply(j.elem,r),h!==b&&(c.result=h,h===!1&&(c.preventDefault(),c.stopPropagation()))}}return t.postDispatch&&t.postDispatch.call(this,c),c.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,c){var d,f,g,h=c.button,i=c.fromElement;return a.pageX==null&&c.clientX!=null&&(d=a.target.ownerDocument||e,f=d.documentElement,g=d.body,a.pageX=c.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=c.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?c.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0),a}},fix:function(a){if(a[p.expando])return a;var b,c,d=a,f=p.event.fixHooks[a.type]||{},g=f.props?this.props.concat(f.props):this.props;a=p.Event(d);for(b=g.length;b;)c=g[--b],a[c]=d[c];return a.target||(a.target=d.srcElement||e),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,f.filter?f.filter(a,d):a},special:{ready:{setup:p.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){p.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=p.extend(new p.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?p.event.trigger(e,null,b):p.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},p.event.handle=p.event.dispatch,p.removeEvent=e.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]=="undefined"&&(a[d]=null),a.detachEvent(d,c))},p.Event=function(a,b){if(this instanceof p.Event)a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?bb:ba):this.type=a,b&&p.extend(this,b),this.timeStamp=a&&a.timeStamp||p.now(),this[p.expando]=!0;else return new p.Event(a,b)},p.Event.prototype={preventDefault:function(){this.isDefaultPrevented=bb;var a=this.originalEvent;if(!a)return;a.preventDefault?a.preventDefault():a.returnValue=!1},stopPropagation:function(){this.isPropagationStopped=bb;var a=this.originalEvent;if(!a)return;a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=bb,this.stopPropagation()},isDefaultPrevented:ba,isPropagationStopped:ba,isImmediatePropagationStopped:ba},p.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){p.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj,g=f.selector;if(!e||e!==d&&!p.contains(d,e))a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b;return c}}}),p.support.submitBubbles||(p.event.special.submit={setup:function(){if(p.nodeName(this,"form"))return!1;p.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=p.nodeName(c,"input")||p.nodeName(c,"button")?c.form:b;d&&!p._data(d,"_submit_attached")&&(p.event.add(d,"submit._submit",function(a){a._submit_bubble=!0}),p._data(d,"_submit_attached",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&p.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(p.nodeName(this,"form"))return!1;p.event.remove(this,"._submit")}}),p.support.changeBubbles||(p.event.special.change={setup:function(){if(V.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")p.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),p.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),p.event.simulate("change",this,a,!0)});return!1}p.event.add(this,"beforeactivate._change",function(a){var b=a.target;V.test(b.nodeName)&&!p._data(b,"_change_attached")&&(p.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&p.event.simulate("change",this.parentNode,a,!0)}),p._data(b,"_change_attached",!0))})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){return p.event.remove(this,"._change"),V.test(this.nodeName)}}),p.support.focusinBubbles||p.each({focus:"focusin",blur:"focusout"},function(a,b){var c=0,d=function(a){p.event.simulate(b,a.target,p.event.fix(a),!0)};p.event.special[b]={setup:function(){c++===0&&e.addEventListener(a,d,!0)},teardown:function(){--c===0&&e.removeEventListener(a,d,!0)}}}),p.fn.extend({on:function(a,c,d,e,f){var g,h;if(typeof a=="object"){typeof c!="string"&&(d=d||c,c=b);for(h in a)this.on(h,c,d,a[h],f);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=ba;else if(!e)return this;return f===1&&(g=e,e=function(a){return p().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=p.guid++)),this.each(function(){p.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){var e,f;if(a&&a.preventDefault&&a.handleObj)return e=a.handleObj,p(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler),this;if(typeof a=="object"){for(f in a)this.off(f,c,a[f]);return this}if(c===!1||typeof c=="function")d=c,c=b;return d===!1&&(d=ba),this.each(function(){p.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){return p(this.context).on(a,this.selector,b,c),this},die:function(a,b){return p(this.context).off(a,this.selector||"**",b),this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a||"**",c)},trigger:function(a,b){return this.each(function(){p.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return p.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||p.guid++,d=0,e=function(c){var e=(p._data(this,"lastToggle"+a.guid)||0)%d;return p._data(this,"lastToggle"+a.guid,e+1),c.preventDefault(),b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),p.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){p.fn[b]=function(a,c){return c==null&&(c=a,a=null),arguments.length>0?this.on(b,null,a,c):this.trigger(b)},Y.test(b)&&(p.event.fixHooks[b]=p.event.keyHooks),Z.test(b)&&(p.event.fixHooks[b]=p.event.mouseHooks)}),function(a,b){function bd(a,b,c,d){var e=0,f=b.length;for(;e<f;e++)Z(a,b[e],c,d)}function be(a,b,c,d,e,f){var g,h=$.setFilters[b.toLowerCase()];return h||Z.error(b),(a||!(g=e))&&bd(a||"*",d,g=[],e),g.length>0?h(g,c,f):[]}function bf(a,c,d,e,f){var g,h,i,j,k,l,m,n,p=0,q=f.length,s=L.POS,t=new RegExp("^"+s.source+"(?!"+r+")","i"),u=function(){var a=1,c=arguments.length-2;for(;a<c;a++)arguments[a]===b&&(g[a]=b)};for(;p<q;p++){s.exec(""),a=f[p],j=[],i=0,k=e;while(g=s.exec(a)){n=s.lastIndex=g.index+g[0].length;if(n>i){m=a.slice(i,g.index),i=n,l=[c],B.test(m)&&(k&&(l=k),k=e);if(h=H.test(m))m=m.slice(0,-5).replace(B,"$&*");g.length>1&&g[0].replace(t,u),k=be(m,g[1],g[2],l,k,h)}}k?(j=j.concat(k),(m=a.slice(i))&&m!==")"?B.test(m)?bd(m,j,d,e):Z(m,c,d,e?e.concat(k):k):o.apply(d,j)):Z(a,c,d,e)}return q===1?d:Z.uniqueSort(d)}function bg(a,b,c){var d,e,f,g=[],i=0,j=D.exec(a),k=!j.pop()&&!j.pop(),l=k&&a.match(C)||[""],m=$.preFilter,n=$.filter,o=!c&&b!==h;for(;(e=l[i])!=null&&k;i++){g.push(d=[]),o&&(e=" "+e);while(e){k=!1;if(j=B.exec(e))e=e.slice(j[0].length),k=d.push({part:j.pop().replace(A," "),captures:j});for(f in n)(j=L[f].exec(e))&&(!m[f]||(j=m[f](j,b,c)))&&(e=e.slice(j.shift().length),k=d.push({part:f,captures:j}));if(!k)break}}return k||Z.error(a),g}function bh(a,b,e){var f=b.dir,g=m++;return a||(a=function(a){return a===e}),b.first?function(b,c){while(b=b[f])if(b.nodeType===1)return a(b,c)&&b}:function(b,e){var h,i=g+"."+d,j=i+"."+c;while(b=b[f])if(b.nodeType===1){if((h=b[q])===j)return b.sizset;if(typeof h=="string"&&h.indexOf(i)===0){if(b.sizset)return b}else{b[q]=j;if(a(b,e))return b.sizset=!0,b;b.sizset=!1}}}}function bi(a,b){return a?function(c,d){var e=b(c,d);return e&&a(e===!0?c:e,d)}:b}function bj(a,b,c){var d,e,f=0;for(;d=a[f];f++)$.relative[d.part]?e=bh(e,$.relative[d.part],b):(d.captures.push(b,c),e=bi(e,$.filter[d.part].apply(null,d.captures)));return e}function bk(a){return function(b,c){var d,e=0;for(;d=a[e];e++)if(d(b,c))return!0;return!1}}var c,d,e,f,g,h=a.document,i=h.documentElement,j="undefined",k=!1,l=!0,m=0,n=[].slice,o=[].push,q=("sizcache"+Math.random()).replace(".",""),r="[\\x20\\t\\r\\n\\f]",s="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",t=s.replace("w","w#"),u="([*^$|!~]?=)",v="\\["+r+"*("+s+")"+r+"*(?:"+u+r+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+t+")|)|)"+r+"*\\]",w=":("+s+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|((?:[^,]|\\\\,|(?:,(?=[^\\[]*\\]))|(?:,(?=[^\\(]*\\))))*))\\)|)",x=":(nth|eq|gt|lt|first|last|even|odd)(?:\\((\\d*)\\)|)(?=[^-]|$)",y=r+"*([\\x20\\t\\r\\n\\f>+~])"+r+"*",z="(?=[^\\x20\\t\\r\\n\\f])(?:\\\\.|"+v+"|"+w.replace(2,7)+"|[^\\\\(),])+",A=new RegExp("^"+r+"+|((?:^|[^\\\\])(?:\\\\.)*)"+r+"+$","g"),B=new RegExp("^"+y),C=new RegExp(z+"?(?="+r+"*,|$)","g"),D=new RegExp("^(?:(?!,)(?:(?:^|,)"+r+"*"+z+")*?|"+r+"*(.*?))(\\)|$)"),E=new RegExp(z.slice(19,-6)+"\\x20\\t\\r\\n\\f>+~])+|"+y,"g"),F=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,G=/[\x20\t\r\n\f]*[+~]/,H=/:not\($/,I=/h\d/i,J=/input|select|textarea|button/i,K=/\\(?!\\)/g,L={ID:new RegExp("^#("+s+")"),CLASS:new RegExp("^\\.("+s+")"),NAME:new RegExp("^\\[name=['\"]?("+s+")['\"]?\\]"),TAG:new RegExp("^("+s.replace("[-","[-\\*")+")"),ATTR:new RegExp("^"+v),PSEUDO:new RegExp("^"+w),CHILD:new RegExp("^:(only|nth|last|first)-child(?:\\("+r+"*(even|odd|(([+-]|)(\\d*)n|)"+r+"*(?:([+-]|)"+r+"*(\\d+)|))"+r+"*\\)|)","i"),POS:new RegExp(x,"ig"),needsContext:new RegExp("^"+r+"*[>+~]|"+x,"i")},M={},N=[],O={},P=[],Q=function(a){return a.sizzleFilter=!0,a},R=function(a){return function(b){return b.nodeName.toLowerCase()==="input"&&b.type===a}},S=function(a){return function(b){var c=b.nodeName.toLowerCase();return(c==="input"||c==="button")&&b.type===a}},T=function(a){var b=!1,c=h.createElement("div");try{b=a(c)}catch(d){}return c=null,b},U=T(function(a){a.innerHTML="<select></select>";var b=typeof a.lastChild.getAttribute("multiple");return b!=="boolean"&&b!=="string"}),V=T(function(a){a.id=q+0,a.innerHTML="<a name='"+q+"'></a><div name='"+q+"'></div>",i.insertBefore(a,i.firstChild);var b=h.getElementsByName&&h.getElementsByName(q).length===2+h.getElementsByName(q+0).length;return g=!h.getElementById(q),i.removeChild(a),b}),W=T(function(a){return a.appendChild(h.createComment("")),a.getElementsByTagName("*").length===0}),X=T(function(a){return a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!==j&&a.firstChild.getAttribute("href")==="#"}),Y=T(function(a){return a.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",!a.getElementsByClassName||a.getElementsByClassName("e").length===0?!1:(a.lastChild.className="e",a.getElementsByClassName("e").length!==1)}),Z=function(a,b,c,d){c=c||[],b=b||h;var e,f,g,i,j=b.nodeType;if(j!==1&&j!==9)return[];if(!a||typeof a!="string")return c;g=ba(b);if(!g&&!d)if(e=F.exec(a))if(i=e[1]){if(j===9){f=b.getElementById(i);if(!f||!f.parentNode)return c;if(f.id===i)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(i))&&bb(b,f)&&f.id===i)return c.push(f),c}else{if(e[2])return o.apply(c,n.call(b.getElementsByTagName(a),0)),c;if((i=e[3])&&Y&&b.getElementsByClassName)return o.apply(c,n.call(b.getElementsByClassName(i),0)),c}return bm(a,b,c,d,g)},$=Z.selectors={cacheLength:50,match:L,order:["ID","TAG"],attrHandle:{},createPseudo:Q,find:{ID:g?function(a,b,c){if(typeof b.getElementById!==j&&!c){var d=b.getElementById(a);return d&&d.parentNode?[d]:[]}}:function(a,c,d){if(typeof c.getElementById!==j&&!d){var e=c.getElementById(a);return e?e.id===a||typeof e.getAttributeNode!==j&&e.getAttributeNode("id").value===a?[e]:b:[]}},TAG:W?function(a,b){if(typeof b.getElementsByTagName!==j)return b.getElementsByTagName(a)}:function(a,b){var c=b.getElementsByTagName(a);if(a==="*"){var d,e=[],f=0;for(;d=c[f];f++)d.nodeType===1&&e.push(d);return e}return c}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(K,""),a[3]=(a[4]||a[5]||"").replace(K,""),a[2]==="~="&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),a[1]==="nth"?(a[2]||Z.error(a[0]),a[3]=+(a[3]?a[4]+(a[5]||1):2*(a[2]==="even"||a[2]==="odd")),a[4]=+(a[6]+a[7]||a[2]==="odd")):a[2]&&Z.error(a[0]),a},PSEUDO:function(a){var b,c=a[4];return L.CHILD.test(a[0])?null:(c&&(b=D.exec(c))&&b.pop()&&(a[0]=a[0].slice(0,b[0].length-c.length-1),c=b[0].slice(0,-1)),a.splice(2,3,c||a[3]),a)}},filter:{ID:g?function(a){return a=a.replace(K,""),function(b){return b.getAttribute("id")===a}}:function(a){return a=a.replace(K,""),function(b){var c=typeof b.getAttributeNode!==j&&b.getAttributeNode("id");return c&&c.value===a}},TAG:function(a){return a==="*"?function(){return!0}:(a=a.replace(K,"").toLowerCase(),function(b){return b.nodeName&&b.nodeName.toLowerCase()===a})},CLASS:function(a){var b=M[a];return b||(b=M[a]=new RegExp("(^|"+r+")"+a+"("+r+"|$)"),N.push(a),N.length>$.cacheLength&&delete M[N.shift()]),function(a){return b.test(a.className||typeof a.getAttribute!==j&&a.getAttribute("class")||"")}},ATTR:function(a,b,c){return b?function(d){var e=Z.attr(d,a),f=e+"";if(e==null)return b==="!=";switch(b){case"=":return f===c;case"!=":return f!==c;case"^=":return c&&f.indexOf(c)===0;case"*=":return c&&f.indexOf(c)>-1;case"$=":return c&&f.substr(f.length-c.length)===c;case"~=":return(" "+f+" ").indexOf(c)>-1;case"|=":return f===c||f.substr(0,c.length+1)===c+"-"}}:function(b){return Z.attr(b,a)!=null}},CHILD:function(a,b,c,d){if(a==="nth"){var e=m++;return function(a){var b,f,g=0,h=a;if(c===1&&d===0)return!0;b=a.parentNode;if(b&&(b[q]!==e||!a.sizset)){for(h=b.firstChild;h;h=h.nextSibling)if(h.nodeType===1){h.sizset=++g;if(h===a)break}b[q]=e}return f=a.sizset-d,c===0?f===0:f%c===0&&f/c>=0}}return function(b){var c=b;switch(a){case"only":case"first":while(c=c.previousSibling)if(c.nodeType===1)return!1;if(a==="first")return!0;c=b;case"last":while(c=c.nextSibling)if(c.nodeType===1)return!1;return!0}}},PSEUDO:function(a,b,c,d){var e=$.pseudos[a]||$.pseudos[a.toLowerCase()];return e||Z.error("unsupported pseudo: "+a),e.sizzleFilter?e(b,c,d):e}},pseudos:{not:Q(function(a,b,c){var d=bl(a.replace(A,"$1"),b,c);return function(a){return!d(a)}}),enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&!!a.checked||b==="option"&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!$.pseudos.empty(a)},empty:function(a){var b;a=a.firstChild;while(a){if(a.nodeName>"@"||(b=a.nodeType)===3||b===4)return!1;a=a.nextSibling}return!0},contains:Q(function(a){return function(b){return(b.textContent||b.innerText||bc(b)).indexOf(a)>-1}}),has:Q(function(a){return function(b){return Z(a,b).length>0}}),header:function(a){return I.test(a.nodeName)},text:function(a){var b,c;return a.nodeName.toLowerCase()==="input"&&(b=a.type)==="text"&&((c=a.getAttribute("type"))==null||c.toLowerCase()===b)},radio:R("radio"),checkbox:R("checkbox"),file:R("file"),password:R("password"),image:R("image"),submit:S("submit"),reset:S("reset"),button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&a.type==="button"||b==="button"},input:function(a){return J.test(a.nodeName)},focus:function(a){var b=a.ownerDocument;return a===b.activeElement&&(!b.hasFocus||b.hasFocus())&&(!!a.type||!!a.href)},active:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b,c){return c?a.slice(1):[a[0]]},last:function(a,b,c){var d=a.pop();return c?a:[d]},even:function(a,b,c){var d=[],e=c?1:0,f=a.length;for(;e<f;e=e+2)d.push(a[e]);return d},odd:function(a,b,c){var d=[],e=c?0:1,f=a.length;for(;e<f;e=e+2)d.push(a[e]);return d},lt:function(a,b,c){return c?a.slice(+b):a.slice(0,+b)},gt:function(a,b,c){return c?a.slice(0,+b+1):a.slice(+b+1)},eq:function(a,b,c){var d=a.splice(+b,1);return c?a:d}}};$.setFilters.nth=$.setFilters.eq,$.filters=$.pseudos,X||($.attrHandle={href:function(a){return a.getAttribute("href",2)},type:function(a){return a.getAttribute("type")}}),V&&($.order.push("NAME"),$.find.NAME=function(a,b){if(typeof b.getElementsByName!==j)return b.getElementsByName(a)}),Y&&($.order.splice(1,0,"CLASS"),$.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!==j&&!c)return b.getElementsByClassName(a)});try{n.call(i.childNodes,0)[0].nodeType}catch(_){n=function(a){var b,c=[];for(;b=this[a];a++)c.push(b);return c}}var ba=Z.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?b.nodeName!=="HTML":!1},bb=Z.contains=i.compareDocumentPosition?function(a,b){return!!(a.compareDocumentPosition(b)&16)}:i.contains?function(a,b){var c=a.nodeType===9?a.documentElement:a,d=b.parentNode;return a===d||!!(d&&d.nodeType===1&&c.contains&&c.contains(d))}:function(a,b){while(b=b.parentNode)if(b===a)return!0;return!1},bc=Z.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(e===1||e===9||e===11){if(typeof a.textContent=="string")return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=bc(a)}else if(e===3||e===4)return a.nodeValue}else for(;b=a[d];d++)c+=bc(b);return c};Z.attr=function(a,b){var c,d=ba(a);return d||(b=b.toLowerCase()),$.attrHandle[b]?$.attrHandle[b](a):U||d?a.getAttribute(b):(c=a.getAttributeNode(b),c?typeof a[b]=="boolean"?a[b]?b:null:c.specified?c.value:null:null)},Z.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},[0,0].sort(function(){return l=0}),i.compareDocumentPosition?e=function(a,b){return a===b?(k=!0,0):(!a.compareDocumentPosition||!b.compareDocumentPosition?a.compareDocumentPosition:a.compareDocumentPosition(b)&4)?-1:1}:(e=function(a,b){if(a===b)return k=!0,0;if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],g=[],h=a.parentNode,i=b.parentNode,j=h;if(h===i)return f(a,b);if(!h)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)g.unshift(j),j=j.parentNode;c=e.length,d=g.length;for(var l=0;l<c&&l<d;l++)if(e[l]!==g[l])return f(e[l],g[l]);return l===c?f(a,g[l],-1):f(e[l],b,1)},f=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),Z.uniqueSort=function(a){var b,c=1;if(e){k=l,a.sort(e);if(k)for(;b=a[c];c++)b===a[c-1]&&a.splice(c--,1)}return a};var bl=Z.compile=function(a,b,c){var d,e,f,g=O[a];if(g&&g.context===b)return g;e=bg(a,b,c);for(f=0;d=e[f];f++)e[f]=bj(d,b,c);return g=O[a]=bk(e),g.context=b,g.runs=g.dirruns=0,P.push(a),P.length>$.cacheLength&&delete O[P.shift()],g};Z.matches=function(a,b){return Z(a,null,null,b)},Z.matchesSelector=function(a,b){return Z(b,null,null,[a]).length>0};var bm=function(a,b,e,f,g){a=a.replace(A,"$1");var h,i,j,k,l,m,p,q,r,s=a.match(C),t=a.match(E),u=b.nodeType;if(L.POS.test(a))return bf(a,b,e,f,s);if(f)h=n.call(f,0);else if(s&&s.length===1){if(t.length>1&&u===9&&!g&&(s=L.ID.exec(t[0]))){b=$.find.ID(s[1],b,g)[0];if(!b)return e;a=a.slice(t.shift().length)}q=(s=G.exec(t[0]))&&!s.index&&b.parentNode||b,r=t.pop(),m=r.split(":not")[0];for(j=0,k=$.order.length;j<k;j++){p=$.order[j];if(s=L[p].exec(m)){h=$.find[p]((s[1]||"").replace(K,""),q,g);if(h==null)continue;m===r&&(a=a.slice(0,a.length-r.length)+m.replace(L[p],""),a||o.apply(e,n.call(h,0)));break}}}if(a){i=bl(a,b,g),d=i.dirruns++,h==null&&(h=$.find.TAG("*",G.test(a)&&b.parentNode||b));for(j=0;l=h[j];j++)c=i.runs++,i(l,b)&&e.push(l)}return e};h.querySelectorAll&&function(){var a,b=bm,c=/'|\\/g,d=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,e=[],f=[":active"],g=i.matchesSelector||i.mozMatchesSelector||i.webkitMatchesSelector||i.oMatchesSelector||i.msMatchesSelector;T(function(a){a.innerHTML="<select><option selected></option></select>",a.querySelectorAll("[selected]").length||e.push("\\["+r+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),a.querySelectorAll(":checked").length||e.push(":checked")}),T(function(a){a.innerHTML="<p test=''></p>",a.querySelectorAll("[test^='']").length&&e.push("[*^$]="+r+"*(?:\"\"|'')"),a.innerHTML="<input type='hidden'>",a.querySelectorAll(":enabled").length||e.push(":enabled",":disabled")}),e=e.length&&new RegExp(e.join("|")),bm=function(a,d,f,g,h){if(!g&&!h&&(!e||!e.test(a)))if(d.nodeType===9)try{return o.apply(f,n.call(d.querySelectorAll(a),0)),f}catch(i){}else if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){var j=d.getAttribute("id"),k=j||q,l=G.test(a)&&d.parentNode||d;j?k=k.replace(c,"\\$&"):d.setAttribute("id",k);try{return o.apply(f,n.call(l.querySelectorAll(a.replace(C,"[id='"+k+"'] $&")),0)),f}catch(i){}finally{j||d.removeAttribute("id")}}return b(a,d,f,g,h)},g&&(T(function(b){a=g.call(b,"div");try{g.call(b,"[test!='']:sizzle"),f.push($.match.PSEUDO)}catch(c){}}),f=new RegExp(f.join("|")),Z.matchesSelector=function(b,c){c=c.replace(d,"='$1']");if(!ba(b)&&!f.test(c)&&(!e||!e.test(c)))try{var h=g.call(b,c);if(h||a||b.document&&b.document.nodeType!==11)return h}catch(i){}return Z(c,null,null,[b]).length>0})}(),Z.attr=p.attr,p.find=Z,p.expr=Z.selectors,p.expr[":"]=p.expr.pseudos,p.unique=Z.uniqueSort,p.text=Z.getText,p.isXMLDoc=Z.isXML,p.contains=Z.contains}(a);var bc=/Until$/,bd=/^(?:parents|prev(?:Until|All))/,be=/^.[^:#\[\.,]*$/,bf=p.expr.match.needsContext,bg={children:!0,contents:!0,next:!0,prev:!0};p.fn.extend({find:function(a){var b,c,d,e,f,g,h=this;if(typeof a!="string")return p(a).filter(function(){for(b=0,c=h.length;b<c;b++)if(p.contains(h[b],this))return!0});g=this.pushStack("","find",a);for(b=0,c=this.length;b<c;b++){d=g.length,p.find(a,this[b],g);if(b>0)for(e=d;e<g.length;e++)for(f=0;f<d;f++)if(g[f]===g[e]){g.splice(e--,1);break}}return g},has:function(a){var b,c=p(a,this),d=c.length;return this.filter(function(){for(b=0;b<d;b++)if(p.contains(this,c[b]))return!0})},not:function(a){return this.pushStack(bj(this,a,!1),"not",a)},filter:function(a){return this.pushStack(bj(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?bf.test(a)?p(a,this.context).index(this[0])>=0:p.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c,d=0,e=this.length,f=[],g=bf.test(a)||typeof a!="string"?p(a,b||this.context):0;for(;d<e;d++){c=this[d];while(c&&c.ownerDocument&&c!==b&&c.nodeType!==11){if(g?g.index(c)>-1:p.find.matchesSelector(c,a)){f.push(c);break}c=c.parentNode}}return f=f.length>1?p.unique(f):f,this.pushStack(f,"closest",a)},index:function(a){return a?typeof a=="string"?p.inArray(this[0],p(a)):p.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c=typeof a=="string"?p(a,b):p.makeArray(a&&a.nodeType?[a]:a),d=p.merge(this.get(),c);return this.pushStack(bh(c[0])||bh(d[0])?d:p.unique(d))},addBack:function(a){return this.add(a==null?this.prevObject:this.prevObject.filter(a))}}),p.fn.andSelf=p.fn.addBack,p.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return p.dir(a,"parentNode")},parentsUntil:function(a,b,c){return p.dir(a,"parentNode",c)},next:function(a){return bi(a,"nextSibling")},prev:function(a){return bi(a,"previousSibling")},nextAll:function(a){return p.dir(a,"nextSibling")},prevAll:function(a){return p.dir(a,"previousSibling")},nextUntil:function(a,b,c){return p.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return p.dir(a,"previousSibling",c)},siblings:function(a){return p.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return p.sibling(a.firstChild)},contents:function(a){return p.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:p.merge([],a.childNodes)}},function(a,b){p.fn[a]=function(c,d){var e=p.map(this,b,c);return bc.test(a)||(d=c),d&&typeof d=="string"&&(e=p.filter(d,e)),e=this.length>1&&!bg[a]?p.unique(e):e,this.length>1&&bd.test(a)&&(e=e.reverse()),this.pushStack(e,a,k.call(arguments).join(","))}}),p.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),b.length===1?p.find.matchesSelector(b[0],a)?[b[0]]:[]:p.find.matches(a,b)},dir:function(a,c,d){var e=[],f=a[c];while(f&&f.nodeType!==9&&(d===b||f.nodeType!==1||!p(f).is(d)))f.nodeType===1&&e.push(f),f=f[c];return e},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var bl="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",bm=/ jQuery\d+="(?:null|\d+)"/g,bn=/^\s+/,bo=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bp=/<([\w:]+)/,bq=/<tbody/i,br=/<|&#?\w+;/,bs=/<(?:script|style|link)/i,bt=/<(?:script|object|embed|option|style)/i,bu=new RegExp("<(?:"+bl+")[\\s/>]","i"),bv=/^(?:checkbox|radio)$/,bw=/checked\s*(?:[^=]|=\s*.checked.)/i,bx=/\/(java|ecma)script/i,by=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,bz={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bA=bk(e),bB=bA.appendChild(e.createElement("div"));bz.optgroup=bz.option,bz.tbody=bz.tfoot=bz.colgroup=bz.caption=bz.thead,bz.th=bz.td,p.support.htmlSerialize||(bz._default=[1,"X<div>","</div>"]),p.fn.extend({text:function(a){return p.access(this,function(a){return a===b?p.text(this):this.empty().append((this[0]&&this[0].ownerDocument||e).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(p.isFunction(a))return this.each(function(b){p(this).wrapAll(a.call(this,b))});if(this[0]){var b=p(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return p.isFunction(a)?this.each(function(b){p(this).wrapInner(a.call(this,b))}):this.each(function(){var b=p(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=p.isFunction(a);return this.each(function(c){p(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){p.nodeName(this,"body")||p(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(a,this.firstChild)})},before:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(a,this),"before",this.selector)}},after:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(this,a),"after",this.selector)}},remove:function(a,b){var c,d=0;for(;(c=this[d])!=null;d++)if(!a||p.filter(a,[c]).length)!b&&c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),p.cleanData([c])),c.parentNode&&c.parentNode.removeChild(c);return this},empty:function(){var a,b=0;for(;(a=this[b])!=null;b++){a.nodeType===1&&p.cleanData(a.getElementsByTagName("*"));while(a.firstChild)a.removeChild(a.firstChild)}return this},clone:function(a,b){return a=a==null?!1:a,b=b==null?a:b,this.map(function(){return p.clone(this,a,b)})},html:function(a){return p.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(bm,""):b;if(typeof a=="string"&&!bs.test(a)&&(p.support.htmlSerialize||!bu.test(a))&&(p.support.leadingWhitespace||!bn.test(a))&&!bz[(bp.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(bo,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(f){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){return bh(this[0])?this.length?this.pushStack(p(p.isFunction(a)?a():a),"replaceWith",a):this:p.isFunction(a)?this.each(function(b){var c=p(this),d=c.html();c.replaceWith(a.call(this,b,d))}):(typeof a!="string"&&(a=p(a).detach()),this.each(function(){var b=this.nextSibling,c=this.parentNode;p(this).remove(),b?p(b).before(a):p(c).append(a)}))},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){a=[].concat.apply([],a);var e,f,g,h,i=0,j=a[0],k=[],l=this.length;if(!p.support.checkClone&&l>1&&typeof j=="string"&&bw.test(j))return this.each(function(){p(this).domManip(a,c,d)});if(p.isFunction(j))return this.each(function(e){var f=p(this);a[0]=j.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){e=p.buildFragment(a,this,k),g=e.fragment,f=g.firstChild,g.childNodes.length===1&&(g=f);if(f){c=c&&p.nodeName(f,"tr");for(h=e.cacheable||l-1;i<l;i++)d.call(c&&p.nodeName(this[i],"table")?bC(this[i],"tbody"):this[i],i===h?g:p.clone(g,!0,!0))}g=f=null,k.length&&p.each(k,function(a,b){b.src?p.ajax?p.ajax({url:b.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):p.error("no ajax"):p.globalEval((b.text||b.textContent||b.innerHTML||"").replace(by,"")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),p.buildFragment=function(a,c,d){var f,g,h,i=a[0];return c=c||e,c=(c[0]||c).ownerDocument||c[0]||c,typeof c.createDocumentFragment=="undefined"&&(c=e),a.length===1&&typeof i=="string"&&i.length<512&&c===e&&i.charAt(0)==="<"&&!bt.test(i)&&(p.support.checkClone||!bw.test(i))&&(p.support.html5Clone||!bu.test(i))&&(g=!0,f=p.fragments[i],h=f!==b),f||(f=c.createDocumentFragment(),p.clean(a,c,f,d),g&&(p.fragments[i]=h&&f)),{fragment:f,cacheable:g}},p.fragments={},p.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){p.fn[a]=function(c){var d,e=0,f=[],g=p(c),h=g.length,i=this.length===1&&this[0].parentNode;if((i==null||i&&i.nodeType===11&&i.childNodes.length===1)&&h===1)return g[b](this[0]),this;for(;e<h;e++)d=(e>0?this.clone(!0):this).get(),p(g[e])[b](d),f=f.concat(d);return this.pushStack(f,a,g.selector)}}),p.extend({clone:function(a,b,c){var d,e,f,g;p.support.html5Clone||p.isXMLDoc(a)||!bu.test("<"+a.nodeName+">")?g=a.cloneNode(!0):(bB.innerHTML=a.outerHTML,bB.removeChild(g=bB.firstChild));if((!p.support.noCloneEvent||!p.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!p.isXMLDoc(a)){bE(a,g),d=bF(a),e=bF(g);for(f=0;d[f];++f)e[f]&&bE(d[f],e[f])}if(b){bD(a,g);if(c){d=bF(a),e=bF(g);for(f=0;d[f];++f)bD(d[f],e[f])}}return d=e=null,g},clean:function(a,b,c,d){var f,g,h,i,j,k,l,m,n,o,q,r,s=0,t=[];if(!b||typeof b.createDocumentFragment=="undefined")b=e;for(g=b===e&&bA;(h=a[s])!=null;s++){typeof h=="number"&&(h+="");if(!h)continue;if(typeof h=="string")if(!br.test(h))h=b.createTextNode(h);else{g=g||bk(b),l=l||g.appendChild(b.createElement("div")),h=h.replace(bo,"<$1></$2>"),i=(bp.exec(h)||["",""])[1].toLowerCase(),j=bz[i]||bz._default,k=j[0],l.innerHTML=j[1]+h+j[2];while(k--)l=l.lastChild;if(!p.support.tbody){m=bq.test(h),n=i==="table"&&!m?l.firstChild&&l.firstChild.childNodes:j[1]==="<table>"&&!m?l.childNodes:[];for(f=n.length-1;f>=0;--f)p.nodeName(n[f],"tbody")&&!n[f].childNodes.length&&n[f].parentNode.removeChild(n[f])}!p.support.leadingWhitespace&&bn.test(h)&&l.insertBefore(b.createTextNode(bn.exec(h)[0]),l.firstChild),h=l.childNodes,l=g.lastChild}h.nodeType?t.push(h):t=p.merge(t,h)}l&&(g.removeChild(l),h=l=g=null);if(!p.support.appendChecked)for(s=0;(h=t[s])!=null;s++)p.nodeName(h,"input")?bG(h):typeof h.getElementsByTagName!="undefined"&&p.grep(h.getElementsByTagName("input"),bG);if(c){q=function(a){if(!a.type||bx.test(a.type))return d?d.push(a.parentNode?a.parentNode.removeChild(a):a):c.appendChild(a)};for(s=0;(h=t[s])!=null;s++)if(!p.nodeName(h,"script")||!q(h))c.appendChild(h),typeof h.getElementsByTagName!="undefined"&&(r=p.grep(p.merge([],h.getElementsByTagName("script")),q),t.splice.apply(t,[s+1,0].concat(r)),s+=r.length)}return t},cleanData:function(a,b){var c,d,e,f,g=0,h=p.expando,i=p.cache,j=p.support.deleteExpando,k=p.event.special;for(;(e=a[g])!=null;g++)if(b||p.acceptData(e)){d=e[h],c=d&&i[d];if(c){if(c.events)for(f in c.events)k[f]?p.event.remove(e,f):p.removeEvent(e,f,c.handle);i[d]&&(delete i[d],j?delete e[h]:e.removeAttribute?e.removeAttribute(h):e[h]=null,p.deletedIds.push(d))}}}}),function(){var a,b;p.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a=p.uaMatch(g.userAgent),b={},a.browser&&(b[a.browser]=!0,b.version=a.version),b.webkit&&(b.safari=!0),p.browser=b,p.sub=function(){function a(b,c){return new a.fn.init(b,c)}p.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function c(c,d){return d&&d instanceof p&&!(d instanceof a)&&(d=a(d)),p.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(e);return a}}();var bH,bI,bJ,bK=/alpha\([^)]*\)/i,bL=/opacity=([^)]*)/,bM=/^(top|right|bottom|left)$/,bN=/^margin/,bO=new RegExp("^("+q+")(.*)$","i"),bP=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),bQ=new RegExp("^([-+])=("+q+")","i"),bR={},bS={position:"absolute",visibility:"hidden",display:"block"},bT={letterSpacing:0,fontWeight:400,lineHeight:1},bU=["Top","Right","Bottom","Left"],bV=["Webkit","O","Moz","ms"],bW=p.fn.toggle;p.fn.extend({css:function(a,c){return p.access(this,function(a,c,d){return d!==b?p.style(a,c,d):p.css(a,c)},a,c,arguments.length>1)},show:function(){return bZ(this,!0)},hide:function(){return bZ(this)},toggle:function(a,b){var c=typeof a=="boolean";return p.isFunction(a)&&p.isFunction(b)?bW.apply(this,arguments):this.each(function(){(c?a:bY(this))?p(this).show():p(this).hide()})}}),p.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bH(a,"opacity");return c===""?"1":c}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":p.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!a||a.nodeType===3||a.nodeType===8||!a.style)return;var f,g,h,i=p.camelCase(c),j=a.style;c=p.cssProps[i]||(p.cssProps[i]=bX(j,i)),h=p.cssHooks[c]||p.cssHooks[i];if(d===b)return h&&"get"in h&&(f=h.get(a,!1,e))!==b?f:j[c];g=typeof d,g==="string"&&(f=bQ.exec(d))&&(d=(f[1]+1)*f[2]+parseFloat(p.css(a,c)),g="number");if(d==null||g==="number"&&isNaN(d))return;g==="number"&&!p.cssNumber[i]&&(d+="px");if(!h||!("set"in h)||(d=h.set(a,d,e))!==b)try{j[c]=d}catch(k){}},css:function(a,c,d,e){var f,g,h,i=p.camelCase(c);return c=p.cssProps[i]||(p.cssProps[i]=bX(a.style,i)),h=p.cssHooks[c]||p.cssHooks[i],h&&"get"in h&&(f=h.get(a,!0,e)),f===b&&(f=bH(a,c)),f==="normal"&&c in bT&&(f=bT[c]),d||e!==b?(g=parseFloat(f),d||p.isNumeric(g)?g||0:f):f},swap:function(a,b,c){var d,e,f={};for(e in b)f[e]=a.style[e],a.style[e]=b[e];d=c.call(a);for(e in b)a.style[e]=f[e];return d}}),a.getComputedStyle?bH=function(a,b){var c,d,e,f,g=getComputedStyle(a,null),h=a.style;return g&&(c=g[b],c===""&&!p.contains(a.ownerDocument.documentElement,a)&&(c=p.style(a,b)),bP.test(c)&&bN.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=c,c=g.width,h.width=d,h.minWidth=e,h.maxWidth=f)),c}:e.documentElement.currentStyle&&(bH=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],f=a.style;return e==null&&f&&f[b]&&(e=f[b]),bP.test(e)&&!bM.test(b)&&(c=f.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":e,e=f.pixelLeft+"px",f.left=c,d&&(a.runtimeStyle.left=d)),e===""?"auto":e}),p.each(["height","width"],function(a,b){p.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0||bH(a,"display")!=="none"?ca(a,b,d):p.swap(a,bS,function(){return ca(a,b,d)})},set:function(a,c,d){return b$(a,c,d?b_(a,b,d,p.support.boxSizing&&p.css(a,"boxSizing")==="border-box"):0)}}}),p.support.opacity||(p.cssHooks.opacity={get:function(a,b){return bL.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=p.isNumeric(b)?"alpha(opacity="+b*100+")":"",f=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&p.trim(f.replace(bK,""))===""&&c.removeAttribute){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bK.test(f)?f.replace(bK,e):f+" "+e}}),p(function(){p.support.reliableMarginRight||(p.cssHooks.marginRight={get:function(a,b){return p.swap(a,{display:"inline-block"},function(){if(b)return bH(a,"marginRight")})}}),!p.support.pixelPosition&&p.fn.position&&p.each(["top","left"],function(a,b){p.cssHooks[b]={get:function(a,c){if(c){var d=bH(a,b);return bP.test(d)?p(a).position()[b]+"px":d}}}})}),p.expr&&p.expr.filters&&(p.expr.filters.hidden=function(a){return a.offsetWidth===0&&a.offsetHeight===0||!p.support.reliableHiddenOffsets&&(a.style&&a.style.display||bH(a,"display"))==="none"},p.expr.filters.visible=function(a){return!p.expr.filters.hidden(a)}),p.each({margin:"",padding:"",border:"Width"},function(a,b){p.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bU[d]+b]=e[d]||e[d-2]||e[0];return f}},bN.test(a)||(p.cssHooks[a+b].set=b$)});var cc=/%20/g,cd=/\[\]$/,ce=/\r?\n/g,cf=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,cg=/^(?:select|textarea)/i;p.fn.extend({serialize:function(){return p.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?p.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||cg.test(this.nodeName)||cf.test(this.type))}).map(function(a,b){var c=p(this).val();return c==null?null:p.isArray(c)?p.map(c,function(a,c){return{name:b.name,value:a.replace(ce,"\r\n")}}):{name:b.name,value:c.replace(ce,"\r\n")}}).get()}}),p.param=function(a,c){var d,e=[],f=function(a,b){b=p.isFunction(b)?b():b==null?"":b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=p.ajaxSettings&&p.ajaxSettings.traditional);if(p.isArray(a)||a.jquery&&!p.isPlainObject(a))p.each(a,function(){f(this.name,this.value)});else for(d in a)ch(d,a[d],c,f);return e.join("&").replace(cc,"+")};var ci,cj,ck=/#.*$/,cl=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,cm=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,cn=/^(?:GET|HEAD)$/,co=/^\/\//,cp=/\?/,cq=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,cr=/([?&])_=[^&]*/,cs=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,ct=p.fn.load,cu={},cv={},cw=["*/"]+["*"];try{ci=f.href}catch(cx){ci=e.createElement("a"),ci.href="",ci=ci.href}cj=cs.exec(ci.toLowerCase())||[],p.fn.load=function(a,c,d){if(typeof a!="string"&&ct)return ct.apply(this,arguments);if(!this.length)return this;var e,f,g,h=this,i=a.indexOf(" ");return i>=0&&(e=a.slice(i,a.length),a=a.slice(0,i)),p.isFunction(c)?(d=c,c=b):typeof c=="object"&&(f="POST"),p.ajax({url:a,type:f,dataType:"html",data:c,complete:function(a,b){d&&h.each(d,g||[a.responseText,b,a])}}).done(function(a){g=arguments,h.html(e?p("<div>").append(a.replace(cq,"")).find(e):a)}),this},p.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){p.fn[b]=function(a){return this.on(b,a)}}),p.each(["get","post"],function(a,c){p[c]=function(a,d,e,f){return p.isFunction(d)&&(f=f||e,e=d,d=b),p.ajax({type:c,url:a,data:d,success:e,dataType:f})}}),p.extend({getScript:function(a,c){return p.get(a,b,c,"script")},getJSON:function(a,b,c){return p.get(a,b,c,"json")},ajaxSetup:function(a,b){return b?cA(a,p.ajaxSettings):(b=a,a=p.ajaxSettings),cA(a,b),a},ajaxSettings:{url:ci,isLocal:cm.test(cj[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":cw},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":p.parseJSON,"text xml":p.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:cy(cu),ajaxTransport:cy(cv),ajax:function(a,c){function y(a,c,f,i){var k,s,t,u,w,y=c;if(v===2)return;v=2,h&&clearTimeout(h),g=b,e=i||"",x.readyState=a>0?4:0,f&&(u=cB(l,x,f));if(a>=200&&a<300||a===304)l.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(p.lastModified[d]=w),w=x.getResponseHeader("Etag"),w&&(p.etag[d]=w)),a===304?(y="notmodified",k=!0):(k=cC(l,u),y=k.state,s=k.data,t=k.error,k=!t);else{t=y;if(!y||a)y="error",a<0&&(a=0)}x.status=a,x.statusText=""+(c||y),k?o.resolveWith(m,[s,y,x]):o.rejectWith(m,[x,y,t]),x.statusCode(r),r=b,j&&n.trigger("ajax"+(k?"Success":"Error"),[x,l,k?s:t]),q.fireWith(m,[x,y]),j&&(n.trigger("ajaxComplete",[x,l]),--p.active||p.event.trigger("ajaxStop"))}typeof a=="object"&&(c=a,a=b),c=c||{};var d,e,f,g,h,i,j,k,l=p.ajaxSetup({},c),m=l.context||l,n=m!==l&&(m.nodeType||m instanceof p)?p(m):p.event,o=p.Deferred(),q=p.Callbacks("once memory"),r=l.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,setRequestHeader:function(a,b){if(!v){var c=a.toLowerCase();a=u[c]=u[c]||a,t[a]=b}return this},getAllResponseHeaders:function(){return v===2?e:null},getResponseHeader:function(a){var c;if(v===2){if(!f){f={};while(c=cl.exec(e))f[c[1].toLowerCase()]=c[2]}c=f[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){return v||(l.mimeType=a),this},abort:function(a){return a=a||w,g&&g.abort(a),y(0,a),this}};o.promise(x),x.success=x.done,x.error=x.fail,x.complete=q.add,x.statusCode=function(a){if(a){var b;if(v<2)for(b in a)r[b]=[r[b],a[b]];else b=a[x.status],x.always(b)}return this},l.url=((a||l.url)+"").replace(ck,"").replace(co,cj[1]+"//"),l.dataTypes=p.trim(l.dataType||"*").toLowerCase().split(s),l.crossDomain==null&&(i=cs.exec(l.url.toLowerCase()),l.crossDomain=!(!i||i[1]==cj[1]&&i[2]==cj[2]&&(i[3]||(i[1]==="http:"?80:443))==(cj[3]||(cj[1]==="http:"?80:443)))),l.data&&l.processData&&typeof l.data!="string"&&(l.data=p.param(l.data,l.traditional)),cz(cu,l,c,x);if(v===2)return x;j=l.global,l.type=l.type.toUpperCase(),l.hasContent=!cn.test(l.type),j&&p.active++===0&&p.event.trigger("ajaxStart");if(!l.hasContent){l.data&&(l.url+=(cp.test(l.url)?"&":"?")+l.data,delete l.data),d=l.url;if(l.cache===!1){var z=p.now(),A=l.url.replace(cr,"$1_="+z);l.url=A+(A===l.url?(cp.test(l.url)?"&":"?")+"_="+z:"")}}(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",l.contentType),l.ifModified&&(d=d||l.url,p.lastModified[d]&&x.setRequestHeader("If-Modified-Since",p.lastModified[d]),p.etag[d]&&x.setRequestHeader("If-None-Match",p.etag[d])),x.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+(l.dataTypes[0]!=="*"?", "+cw+"; q=0.01":""):l.accepts["*"]);for(k in l.headers)x.setRequestHeader(k,l.headers[k]);if(!l.beforeSend||l.beforeSend.call(m,x,l)!==!1&&v!==2){w="abort";for(k in{success:1,error:1,complete:1})x[k](l[k]);g=cz(cv,l,c,x);if(!g)y(-1,"No Transport");else{x.readyState=1,j&&n.trigger("ajaxSend",[x,l]),l.async&&l.timeout>0&&(h=setTimeout(function(){x.abort("timeout")},l.timeout));try{v=1,g.send(t,y)}catch(B){if(v<2)y(-1,B);else throw B}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var cD=[],cE=/\?/,cF=/(=)\?(?=&|$)|\?\?/,cG=p.now();p.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=cD.pop()||p.expando+"_"+cG++;return this[a]=!0,a}}),p.ajaxPrefilter("json jsonp",function(c,d,e){var f,g,h,i=c.data,j=c.url,k=c.jsonp!==!1,l=k&&cF.test(j),m=k&&!l&&typeof i=="string"&&!(c.contentType||"").indexOf("application/x-www-form-urlencoded")&&cF.test(i);if(c.dataTypes[0]==="jsonp"||l||m)return f=c.jsonpCallback=p.isFunction(c.jsonpCallback)?c.jsonpCallback():c.jsonpCallback,g=a[f],l?c.url=j.replace(cF,"$1"+f):m?c.data=i.replace(cF,"$1"+f):k&&(c.url+=(cE.test(j)?"&":"?")+c.jsonp+"="+f),c.converters["script json"]=function(){return h||p.error(f+" was not called"),h[0]},c.dataTypes[0]="json",a[f]=function(){h=arguments},e.always(function(){a[f]=g,c[f]&&(c.jsonpCallback=d.jsonpCallback,cD.push(f)),h&&p.isFunction(g)&&g(h[0]),h=g=b}),"script"}),p.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){return p.globalEval(a),a}}}),p.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),p.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=e.head||e.getElementsByTagName("head")[0]||e.documentElement;return{send:function(f,g){c=e.createElement("script"),c.async="async",a.scriptCharset&&(c.charset=a.scriptCharset),c.src=a.url,c.onload=c.onreadystatechange=function(a,e){if(e||!c.readyState||/loaded|complete/.test(c.readyState))c.onload=c.onreadystatechange=null,d&&c.parentNode&&d.removeChild(c),c=b,e||g(200,"success")},d.insertBefore(c,d.firstChild)},abort:function(){c&&c.onload(0,1)}}}});var cH,cI=a.ActiveXObject?function(){for(var a in cH)cH[a](0,1)}:!1,cJ=0;p.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&cK()||cL()}:cK,function(a){p.extend(p.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(p.ajaxSettings.xhr()),p.support.ajax&&p.ajaxTransport(function(c){if(!c.crossDomain||p.support.cors){var d;return{send:function(e,f){var g,h,i=c.xhr();c.username?i.open(c.type,c.url,c.async,c.username,c.password):i.open(c.type,c.url,c.async);if(c.xhrFields)for(h in c.xhrFields)i[h]=c.xhrFields[h];c.mimeType&&i.overrideMimeType&&i.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(h in e)i.setRequestHeader(h,e[h])}catch(j){}i.send(c.hasContent&&c.data||null),d=function(a,e){var h,j,k,l,m;try{if(d&&(e||i.readyState===4)){d=b,g&&(i.onreadystatechange=p.noop,cI&&delete cH[g]);if(e)i.readyState!==4&&i.abort();else{h=i.status,k=i.getAllResponseHeaders(),l={},m=i.responseXML,m&&m.documentElement&&(l.xml=m);try{l.text=i.responseText}catch(a){}try{j=i.statusText}catch(n){j=""}!h&&c.isLocal&&!c.crossDomain?h=l.text?200:404:h===1223&&(h=204)}}}catch(o){e||f(-1,o)}l&&f(h,j,l,k)},c.async?i.readyState===4?setTimeout(d,0):(g=++cJ,cI&&(cH||(cH={},p(a).unload(cI)),cH[g]=d),i.onreadystatechange=d):d()},abort:function(){d&&d(0,1)}}}});var cM,cN,cO=/^(?:toggle|show|hide)$/,cP=new RegExp("^(?:([-+])=|)("+q+")([a-z%]*)$","i"),cQ=/queueHooks$/,cR=[cX],cS={"*":[function(a,b){var c,d,e,f=this.createTween(a,b),g=cP.exec(b),h=f.cur(),i=+h||0,j=1;if(g){c=+g[2],d=g[3]||(p.cssNumber[a]?"":"px");if(d!=="px"&&i){i=p.css(f.elem,a,!0)||c||1;do e=j=j||".5",i=i/j,p.style(f.elem,a,i+d),j=f.cur()/h;while(j!==1&&j!==e)}f.unit=d,f.start=i,f.end=g[1]?i+(g[1]+1)*c:c}return f}]};p.Animation=p.extend(cV,{tweener:function(a,b){p.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");var c,d=0,e=a.length;for(;d<e;d++)c=a[d],cS[c]=cS[c]||[],cS[c].unshift(b)},prefilter:function(a,b){b?cR.unshift(a):cR.push(a)}}),p.Tween=cY,cY.prototype={constructor:cY,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(p.cssNumber[c]?"":"px")},cur:function(){var a=cY.propHooks[this.prop];return a&&a.get?a.get(this):cY.propHooks._default.get(this)},run:function(a){var b,c=cY.propHooks[this.prop];return this.pos=b=p.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration),this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):cY.propHooks._default.set(this),this}},cY.prototype.init.prototype=cY.prototype,cY.propHooks={_default:{get:function(a){var b;return a.elem[a.prop]==null||!!a.elem.style&&a.elem.style[a.prop]!=null?(b=p.css(a.elem,a.prop,!1,""),!b||b==="auto"?0:b):a.elem[a.prop]},set:function(a){p.fx.step[a.prop]?p.fx.step[a.prop](a):a.elem.style&&(a.elem.style[p.cssProps[a.prop]]!=null||p.cssHooks[a.prop])?p.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},cY.propHooks.scrollTop=cY.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},p.each(["toggle","show","hide"],function(a,b){var c=p.fn[b];p.fn[b]=function(d,e,f){return d==null||typeof d=="boolean"||!a&&p.isFunction(d)&&p.isFunction(e)?c.apply(this,arguments):this.animate(cZ(b,!0),d,e,f)}}),p.fn.extend({fadeTo:function(a,b,c,d){return this.filter(bY).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=p.isEmptyObject(a),f=p.speed(b,c,d),g=function(){var b=cV(this,p.extend({},a),f);e&&b.stop(!0)};return e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,c,d){var e=function(a){var b=a.stop;delete a.stop,b(d)};return typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,c=a!=null&&a+"queueHooks",f=p.timers,g=p._data(this);if(c)g[c]&&g[c].stop&&e(g[c]);else for(c in g)g[c]&&g[c].stop&&cQ.test(c)&&e(g[c]);for(c=f.length;c--;)f[c].elem===this&&(a==null||f[c].queue===a)&&(f[c].anim.stop(d),b=!1,f.splice(c,1));(b||!d)&&p.dequeue(this,a)})}}),p.each({slideDown:cZ("show"),slideUp:cZ("hide"),slideToggle:cZ("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){p.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),p.speed=function(a,b,c){var d=a&&typeof a=="object"?p.extend({},a):{complete:c||!c&&b||p.isFunction(a)&&a,duration:a,easing:c&&b||b&&!p.isFunction(b)&&b};d.duration=p.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in p.fx.speeds?p.fx.speeds[d.duration]:p.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";return d.old=d.complete,d.complete=function(){p.isFunction(d.old)&&d.old.call(this),d.queue&&p.dequeue(this,d.queue)},d},p.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},p.timers=[],p.fx=cY.prototype.init,p.fx.tick=function(){var a,b=p.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||p.fx.stop()},p.fx.timer=function(a){a()&&p.timers.push(a)&&!cN&&(cN=setInterval(p.fx.tick,p.fx.interval))},p.fx.interval=13,p.fx.stop=function(){clearInterval(cN),cN=null},p.fx.speeds={slow:600,fast:200,_default:400},p.fx.step={},p.expr&&p.expr.filters&&(p.expr.filters.animated=function(a){return p.grep(p.timers,function(b){return a===b.elem}).length});var c$=/^(?:body|html)$/i;p.fn.offset=function(a){if(arguments.length)return a===b?this:this.each(function(b){p.offset.setOffset(this,a,b)});var c,d,e,f,g,h,i,j,k,l,m=this[0],n=m&&m.ownerDocument;if(!n)return;return(e=n.body)===m?p.offset.bodyOffset(m):(d=n.documentElement,p.contains(d,m)?(c=m.getBoundingClientRect(),f=c_(n),g=d.clientTop||e.clientTop||0,h=d.clientLeft||e.clientLeft||0,i=f.pageYOffset||d.scrollTop,j=f.pageXOffset||d.scrollLeft,k=c.top+i-g,l=c.left+j-h,{top:k,left:l}):{top:0,left:0})},p.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;return p.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(p.css(a,"marginTop"))||0,c+=parseFloat(p.css(a,"marginLeft"))||0),{top:b,left:c}},setOffset:function(a,b,c){var d=p.css(a,"position");d==="static"&&(a.style.position="relative");var e=p(a),f=e.offset(),g=p.css(a,"top"),h=p.css(a,"left"),i=(d==="absolute"||d==="fixed")&&p.inArray("auto",[g,h])>-1,j={},k={},l,m;i?(k=e.position(),l=k.top,m=k.left):(l=parseFloat(g)||0,m=parseFloat(h)||0),p.isFunction(b)&&(b=b.call(a,c,f)),b.top!=null&&(j.top=b.top-f.top+l),b.left!=null&&(j.left=b.left-f.left+m),"using"in b?b.using.call(a,j):e.css(j)}},p.fn.extend({position:function(){if(!this[0])return;var a=this[0],b=this.offsetParent(),c=this.offset(),d=c$.test(b[0].nodeName)?{top:0,left:0}:b.offset();return c.top-=parseFloat(p.css(a,"marginTop"))||0,c.left-=parseFloat(p.css(a,"marginLeft"))||0,d.top+=parseFloat(p.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(p.css(b[0],"borderLeftWidth"))||0,{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||e.body;while(a&&!c$.test(a.nodeName)&&p.css(a,"position")==="static")a=a.offsetParent;return a||e.body})}}),p.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);p.fn[a]=function(e){return p.access(this,function(a,e,f){var g=c_(a);if(f===b)return g?c in g?g[c]:g.document.documentElement[e]:a[e];g?g.scrollTo(d?p(g).scrollLeft():f,d?f:p(g).scrollTop()):a[e]=f},a,e,arguments.length,null)}}),p.each({Height:"height",Width:"width"},function(a,c){p.each({padding:"inner"+a,content:c,"":"outer"+a},function(d,e){p.fn[e]=function(e,f){var g=arguments.length&&(d||typeof e!="boolean"),h=d||(e===!0||f===!0?"margin":"border");return p.access(this,function(c,d,e){var f;return p.isWindow(c)?c.document.documentElement["client"+a]:c.nodeType===9?(f=c.documentElement,Math.max(c.body["scroll"+a],f["scroll"+a],c.body["offset"+a],f["offset"+a],f["client"+a])):e===b?p.css(c,d,e,h):p.style(c,d,e,h)},c,g?e:b,g)}})}),a.jQuery=a.$=p,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return p})})(window);
diff --git a/openecomp-be/tools/swagger-ui/lib/jquery.ba-bbq.min.js b/openecomp-be/tools/swagger-ui/lib/jquery.ba-bbq.min.js
new file mode 100644
index 0000000000..0bcdb66da5
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/lib/jquery.ba-bbq.min.js
@@ -0,0 +1,38 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+/*
+ * jQuery BBQ: Back Button & Query Library - v1.2.1 - 2/17/2010
+ * http://benalman.com/projects/jquery-bbq-plugin/
+ *
+ * Copyright (c) 2010 "Cowboy" Ben Alman
+ * Dual licensed under the MIT and GPL licenses.
+ * http://benalman.com/about/license/
+ */
+(function($,p){var i,m=Array.prototype.slice,r=decodeURIComponent,a=$.param,c,l,v,b=$.bbq=$.bbq||{},q,u,j,e=$.event.special,d="hashchange",A="querystring",D="fragment",y="elemUrlAttr",g="location",k="href",t="src",x=/^.*\?|#.*$/g,w=/^.*\#/,h,C={};function E(F){return typeof F==="string"}function B(G){var F=m.call(arguments,1);return function(){return G.apply(this,F.concat(m.call(arguments)))}}function n(F){return F.replace(/^[^#]*#?(.*)$/,"$1")}function o(F){return F.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")}function f(H,M,F,I,G){var O,L,K,N,J;if(I!==i){K=F.match(H?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/);J=K[3]||"";if(G===2&&E(I)){L=I.replace(H?w:x,"")}else{N=l(K[2]);I=E(I)?l[H?D:A](I):I;L=G===2?I:G===1?$.extend({},I,N):$.extend({},N,I);L=a(L);if(H){L=L.replace(h,r)}}O=K[1]+(H?"#":L||!K[1]?"?":"")+L+J}else{O=M(F!==i?F:p[g][k])}return O}a[A]=B(f,0,o);a[D]=c=B(f,1,n);c.noEscape=function(G){G=G||"";var F=$.map(G.split(""),encodeURIComponent);h=new RegExp(F.join("|"),"g")};c.noEscape(",/");$.deparam=l=function(I,F){var H={},G={"true":!0,"false":!1,"null":null};$.each(I.replace(/\+/g," ").split("&"),function(L,Q){var K=Q.split("="),P=r(K[0]),J,O=H,M=0,R=P.split("]["),N=R.length-1;if(/\[/.test(R[0])&&/\]$/.test(R[N])){R[N]=R[N].replace(/\]$/,"");R=R.shift().split("[").concat(R);N=R.length-1}else{N=0}if(K.length===2){J=r(K[1]);if(F){J=J&&!isNaN(J)?+J:J==="undefined"?i:G[J]!==i?G[J]:J}if(N){for(;M<=N;M++){P=R[M]===""?O.length:R[M];O=O[P]=M<N?O[P]||(R[M+1]&&isNaN(R[M+1])?{}:[]):J}}else{if($.isArray(H[P])){H[P].push(J)}else{if(H[P]!==i){H[P]=[H[P],J]}else{H[P]=J}}}}else{if(P){H[P]=F?i:""}}});return H};function z(H,F,G){if(F===i||typeof F==="boolean"){G=F;F=a[H?D:A]()}else{F=E(F)?F.replace(H?w:x,""):F}return l(F,G)}l[A]=B(z,0);l[D]=v=B(z,1);$[y]||($[y]=function(F){return $.extend(C,F)})({a:k,base:k,iframe:t,img:t,input:t,form:"action",link:k,script:t});j=$[y];function s(I,G,H,F){if(!E(H)&&typeof H!=="object"){F=H;H=G;G=i}return this.each(function(){var L=$(this),J=G||j()[(this.nodeName||"").toLowerCase()]||"",K=J&&L.attr(J)||"";L.attr(J,a[I](K,H,F))})}$.fn[A]=B(s,A);$.fn[D]=B(s,D);b.pushState=q=function(I,F){if(E(I)&&/^#/.test(I)&&F===i){F=2}var H=I!==i,G=c(p[g][k],H?I:{},H?F:2);p[g][k]=G+(/#/.test(G)?"":"#")};b.getState=u=function(F,G){return F===i||typeof F==="boolean"?v(F):v(G)[F]};b.removeState=function(F){var G={};if(F!==i){G=u();$.each($.isArray(F)?F:arguments,function(I,H){delete G[H]})}q(G,2)};e[d]=$.extend(e[d],{add:function(F){var H;function G(J){var I=J[D]=c();J.getState=function(K,L){return K===i||typeof K==="boolean"?l(I,K):l(I,L)[K]};H.apply(this,arguments)}if($.isFunction(F)){H=F;return G}else{H=F.handler;F.handler=G}}})})(jQuery,this);
+/*
+ * jQuery hashchange event - v1.2 - 2/11/2010
+ * http://benalman.com/projects/jquery-hashchange-plugin/
+ *
+ * Copyright (c) 2010 "Cowboy" Ben Alman
+ * Dual licensed under the MIT and GPL licenses.
+ * http://benalman.com/about/license/
+ */
+(function($,i,b){var j,k=$.event.special,c="location",d="hashchange",l="href",f=$.browser,g=document.documentMode,h=f.msie&&(g===b||g<8),e="on"+d in i&&!h;function a(m){m=m||i[c][l];return m.replace(/^[^#]*#?(.*)$/,"$1")}$[d+"Delay"]=100;k[d]=$.extend(k[d],{setup:function(){if(e){return false}$(j.start)},teardown:function(){if(e){return false}$(j.stop)}});j=(function(){var m={},r,n,o,q;function p(){o=q=function(s){return s};if(h){n=$('<iframe src="javascript:0"/>').hide().insertAfter("body")[0].contentWindow;q=function(){return a(n.document[c][l])};o=function(u,s){if(u!==s){var t=n.document;t.open().close();t[c].hash="#"+u}};o(a())}}m.start=function(){if(r){return}var t=a();o||p();(function s(){var v=a(),u=q(t);if(v!==t){o(t=v,u);$(i).trigger(d)}else{if(u!==t){i[c][l]=i[c][l].replace(/#.*/,"")+"#"+u}}r=setTimeout(s,$[d+"Delay"])})()};m.stop=function(){if(!n){r&&clearTimeout(r);r=0}};return m})()})(jQuery,this);
diff --git a/openecomp-be/tools/swagger-ui/lib/jquery.slideto.min.js b/openecomp-be/tools/swagger-ui/lib/jquery.slideto.min.js
new file mode 100644
index 0000000000..df80c45ae6
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/lib/jquery.slideto.min.js
@@ -0,0 +1,21 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+(function(b){b.fn.slideto=function(a){a=b.extend({slide_duration:"slow",highlight_duration:3E3,highlight:true,highlight_color:"#FFFF99"},a);return this.each(function(){obj=b(this);b("body").animate({scrollTop:obj.offset().top},a.slide_duration,function(){a.highlight&&b.ui.version&&obj.effect("highlight",{color:a.highlight_color},a.highlight_duration)})})}})(jQuery);
diff --git a/openecomp-be/tools/swagger-ui/lib/jquery.wiggle.min.js b/openecomp-be/tools/swagger-ui/lib/jquery.wiggle.min.js
new file mode 100644
index 0000000000..0bdb2b2fd3
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/lib/jquery.wiggle.min.js
@@ -0,0 +1,28 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+/*
+jQuery Wiggle
+Author: WonderGroup, Jordan Thomas
+URL: http://labs.wondergroup.com/demos/mini-ui/index.html
+License: MIT (http://en.wikipedia.org/wiki/MIT_License)
+*/
+jQuery.fn.wiggle=function(o){var d={speed:50,wiggles:3,travel:5,callback:null};var o=jQuery.extend(d,o);return this.each(function(){var cache=this;var wrap=jQuery(this).wrap('<div class="wiggle-wrap"></div>').css("position","relative");var calls=0;for(i=1;i<=o.wiggles;i++){jQuery(this).animate({left:"-="+o.travel},o.speed).animate({left:"+="+o.travel*2},o.speed*2).animate({left:"-="+o.travel},o.speed,function(){calls++;if(jQuery(cache).parent().hasClass('wiggle-wrap')){jQuery(cache).parent().replaceWith(cache);}
+if(calls==o.wiggles&&jQuery.isFunction(o.callback)){o.callback();}});}});};
diff --git a/openecomp-be/tools/swagger-ui/lib/marked.js b/openecomp-be/tools/swagger-ui/lib/marked.js
new file mode 100644
index 0000000000..cfa182fe4d
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/lib/marked.js
@@ -0,0 +1,1292 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * marked - a markdown parser
+ * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed)
+ * https://github.com/chjj/marked
+ */
+
+;(function() {
+
+/**
+ * Block-Level Grammar
+ */
+
+var block = {
+ newline: /^\n+/,
+ code: /^( {4}[^\n]+\n*)+/,
+ fences: noop,
+ hr: /^( *[-*_]){3,} *(?:\n+|$)/,
+ heading: /^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,
+ nptable: noop,
+ lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,
+ blockquote: /^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,
+ list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,
+ html: /^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,
+ def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,
+ table: noop,
+ paragraph: /^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,
+ text: /^[^\n]+/
+};
+
+block.bullet = /(?:[*+-]|\d+\.)/;
+block.item = /^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;
+block.item = replace(block.item, 'gm')
+ (/bull/g, block.bullet)
+ ();
+
+block.list = replace(block.list)
+ (/bull/g, block.bullet)
+ ('hr', '\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))')
+ ('def', '\\n+(?=' + block.def.source + ')')
+ ();
+
+block.blockquote = replace(block.blockquote)
+ ('def', block.def)
+ ();
+
+block._tag = '(?!(?:'
+ + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code'
+ + '|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo'
+ + '|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b';
+
+block.html = replace(block.html)
+ ('comment', /<!--[\s\S]*?-->/)
+ ('closed', /<(tag)[\s\S]+?<\/\1>/)
+ ('closing', /<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)
+ (/tag/g, block._tag)
+ ();
+
+block.paragraph = replace(block.paragraph)
+ ('hr', block.hr)
+ ('heading', block.heading)
+ ('lheading', block.lheading)
+ ('blockquote', block.blockquote)
+ ('tag', '<' + block._tag)
+ ('def', block.def)
+ ();
+
+/**
+ * Normal Block Grammar
+ */
+
+block.normal = merge({}, block);
+
+/**
+ * GFM Block Grammar
+ */
+
+block.gfm = merge({}, block.normal, {
+ fences: /^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,
+ paragraph: /^/
+});
+
+block.gfm.paragraph = replace(block.paragraph)
+ ('(?!', '(?!'
+ + block.gfm.fences.source.replace('\\1', '\\2') + '|'
+ + block.list.source.replace('\\1', '\\3') + '|')
+ ();
+
+/**
+ * GFM + Tables Block Grammar
+ */
+
+block.tables = merge({}, block.gfm, {
+ nptable: /^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,
+ table: /^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/
+});
+
+/**
+ * Block Lexer
+ */
+
+function Lexer(options) {
+ this.tokens = [];
+ this.tokens.links = {};
+ this.options = options || marked.defaults;
+ this.rules = block.normal;
+
+ if (this.options.gfm) {
+ if (this.options.tables) {
+ this.rules = block.tables;
+ } else {
+ this.rules = block.gfm;
+ }
+ }
+}
+
+/**
+ * Expose Block Rules
+ */
+
+Lexer.rules = block;
+
+/**
+ * Static Lex Method
+ */
+
+Lexer.lex = function(src, options) {
+ var lexer = new Lexer(options);
+ return lexer.lex(src);
+};
+
+/**
+ * Preprocessing
+ */
+
+Lexer.prototype.lex = function(src) {
+ src = src
+ .replace(/\r\n|\r/g, '\n')
+ .replace(/\t/g, ' ')
+ .replace(/\u00a0/g, ' ')
+ .replace(/\u2424/g, '\n');
+
+ return this.token(src, true);
+};
+
+/**
+ * Lexing
+ */
+
+Lexer.prototype.token = function(src, top, bq) {
+ var src = src.replace(/^ +$/gm, '')
+ , next
+ , loose
+ , cap
+ , bull
+ , b
+ , item
+ , space
+ , i
+ , l;
+
+ while (src) {
+ // newline
+ if (cap = this.rules.newline.exec(src)) {
+ src = src.substring(cap[0].length);
+ if (cap[0].length > 1) {
+ this.tokens.push({
+ type: 'space'
+ });
+ }
+ }
+
+ // code
+ if (cap = this.rules.code.exec(src)) {
+ src = src.substring(cap[0].length);
+ cap = cap[0].replace(/^ {4}/gm, '');
+ this.tokens.push({
+ type: 'code',
+ text: !this.options.pedantic
+ ? cap.replace(/\n+$/, '')
+ : cap
+ });
+ continue;
+ }
+
+ // fences (gfm)
+ if (cap = this.rules.fences.exec(src)) {
+ src = src.substring(cap[0].length);
+ this.tokens.push({
+ type: 'code',
+ lang: cap[2],
+ text: cap[3]
+ });
+ continue;
+ }
+
+ // heading
+ if (cap = this.rules.heading.exec(src)) {
+ src = src.substring(cap[0].length);
+ this.tokens.push({
+ type: 'heading',
+ depth: cap[1].length,
+ text: cap[2]
+ });
+ continue;
+ }
+
+ // table no leading pipe (gfm)
+ if (top && (cap = this.rules.nptable.exec(src))) {
+ src = src.substring(cap[0].length);
+
+ item = {
+ type: 'table',
+ header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */),
+ align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
+ cells: cap[3].replace(/\n$/, '').split('\n')
+ };
+
+ for (i = 0; i < item.align.length; i++) {
+ if (/^ *-+: *$/.test(item.align[i])) {
+ item.align[i] = 'right';
+ } else if (/^ *:-+: *$/.test(item.align[i])) {
+ item.align[i] = 'center';
+ } else if (/^ *:-+ *$/.test(item.align[i])) {
+ item.align[i] = 'left';
+ } else {
+ item.align[i] = null;
+ }
+ }
+
+ for (i = 0; i < item.cells.length; i++) {
+ item.cells[i] = item.cells[i].split(/ *\| */);
+ }
+
+ this.tokens.push(item);
+
+ continue;
+ }
+
+ // lheading
+ if (cap = this.rules.lheading.exec(src)) {
+ src = src.substring(cap[0].length);
+ this.tokens.push({
+ type: 'heading',
+ depth: cap[2] === '=' ? 1 : 2,
+ text: cap[1]
+ });
+ continue;
+ }
+
+ // hr
+ if (cap = this.rules.hr.exec(src)) {
+ src = src.substring(cap[0].length);
+ this.tokens.push({
+ type: 'hr'
+ });
+ continue;
+ }
+
+ // blockquote
+ if (cap = this.rules.blockquote.exec(src)) {
+ src = src.substring(cap[0].length);
+
+ this.tokens.push({
+ type: 'blockquote_start'
+ });
+
+ cap = cap[0].replace(/^ *> ?/gm, '');
+
+ // Pass `top` to keep the current
+ // "toplevel" state. This is exactly
+ // how markdown.pl works.
+ this.token(cap, top, true);
+
+ this.tokens.push({
+ type: 'blockquote_end'
+ });
+
+ continue;
+ }
+
+ // list
+ if (cap = this.rules.list.exec(src)) {
+ src = src.substring(cap[0].length);
+ bull = cap[2];
+
+ this.tokens.push({
+ type: 'list_start',
+ ordered: bull.length > 1
+ });
+
+ // Get each top-level item.
+ cap = cap[0].match(this.rules.item);
+
+ next = false;
+ l = cap.length;
+ i = 0;
+
+ for (; i < l; i++) {
+ item = cap[i];
+
+ // Remove the list item's bullet
+ // so it is seen as the next token.
+ space = item.length;
+ item = item.replace(/^ *([*+-]|\d+\.) +/, '');
+
+ // Outdent whatever the
+ // list item contains. Hacky.
+ if (~item.indexOf('\n ')) {
+ space -= item.length;
+ item = !this.options.pedantic
+ ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '')
+ : item.replace(/^ {1,4}/gm, '');
+ }
+
+ // Determine whether the next list item belongs here.
+ // Backpedal if it does not belong in this list.
+ if (this.options.smartLists && i !== l - 1) {
+ b = block.bullet.exec(cap[i + 1])[0];
+ if (bull !== b && !(bull.length > 1 && b.length > 1)) {
+ src = cap.slice(i + 1).join('\n') + src;
+ i = l - 1;
+ }
+ }
+
+ // Determine whether item is loose or not.
+ // Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/
+ // for discount behavior.
+ loose = next || /\n\n(?!\s*$)/.test(item);
+ if (i !== l - 1) {
+ next = item.charAt(item.length - 1) === '\n';
+ if (!loose) loose = next;
+ }
+
+ this.tokens.push({
+ type: loose
+ ? 'loose_item_start'
+ : 'list_item_start'
+ });
+
+ // Recurse.
+ this.token(item, false, bq);
+
+ this.tokens.push({
+ type: 'list_item_end'
+ });
+ }
+
+ this.tokens.push({
+ type: 'list_end'
+ });
+
+ continue;
+ }
+
+ // html
+ if (cap = this.rules.html.exec(src)) {
+ src = src.substring(cap[0].length);
+ this.tokens.push({
+ type: this.options.sanitize
+ ? 'paragraph'
+ : 'html',
+ pre: cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style',
+ text: cap[0]
+ });
+ continue;
+ }
+
+ // def
+ if ((!bq && top) && (cap = this.rules.def.exec(src))) {
+ src = src.substring(cap[0].length);
+ this.tokens.links[cap[1].toLowerCase()] = {
+ href: cap[2],
+ title: cap[3]
+ };
+ continue;
+ }
+
+ // table (gfm)
+ if (top && (cap = this.rules.table.exec(src))) {
+ src = src.substring(cap[0].length);
+
+ item = {
+ type: 'table',
+ header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */),
+ align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
+ cells: cap[3].replace(/(?: *\| *)?\n$/, '').split('\n')
+ };
+
+ for (i = 0; i < item.align.length; i++) {
+ if (/^ *-+: *$/.test(item.align[i])) {
+ item.align[i] = 'right';
+ } else if (/^ *:-+: *$/.test(item.align[i])) {
+ item.align[i] = 'center';
+ } else if (/^ *:-+ *$/.test(item.align[i])) {
+ item.align[i] = 'left';
+ } else {
+ item.align[i] = null;
+ }
+ }
+
+ for (i = 0; i < item.cells.length; i++) {
+ item.cells[i] = item.cells[i]
+ .replace(/^ *\| *| *\| *$/g, '')
+ .split(/ *\| */);
+ }
+
+ this.tokens.push(item);
+
+ continue;
+ }
+
+ // top-level paragraph
+ if (top && (cap = this.rules.paragraph.exec(src))) {
+ src = src.substring(cap[0].length);
+ this.tokens.push({
+ type: 'paragraph',
+ text: cap[1].charAt(cap[1].length - 1) === '\n'
+ ? cap[1].slice(0, -1)
+ : cap[1]
+ });
+ continue;
+ }
+
+ // text
+ if (cap = this.rules.text.exec(src)) {
+ // Top-level should never reach here.
+ src = src.substring(cap[0].length);
+ this.tokens.push({
+ type: 'text',
+ text: cap[0]
+ });
+ continue;
+ }
+
+ if (src) {
+ throw new
+ Error('Infinite loop on byte: ' + src.charCodeAt(0));
+ }
+ }
+
+ return this.tokens;
+};
+
+/**
+ * Inline-Level Grammar
+ */
+
+var inline = {
+ escape: /^\\([\\`*{}\[\]()#+\-.!_>])/,
+ autolink: /^<([^ >]+(@|:\/)[^ >]+)>/,
+ url: noop,
+ tag: /^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,
+ link: /^!?\[(inside)\]\(href\)/,
+ reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/,
+ nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,
+ strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,
+ em: /^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,
+ code: /^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,
+ br: /^ {2,}\n(?!\s*$)/,
+ del: noop,
+ text: /^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/
+};
+
+inline._inside = /(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/;
+inline._href = /\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/;
+
+inline.link = replace(inline.link)
+ ('inside', inline._inside)
+ ('href', inline._href)
+ ();
+
+inline.reflink = replace(inline.reflink)
+ ('inside', inline._inside)
+ ();
+
+/**
+ * Normal Inline Grammar
+ */
+
+inline.normal = merge({}, inline);
+
+/**
+ * Pedantic Inline Grammar
+ */
+
+inline.pedantic = merge({}, inline.normal, {
+ strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,
+ em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/
+});
+
+/**
+ * GFM Inline Grammar
+ */
+
+inline.gfm = merge({}, inline.normal, {
+ escape: replace(inline.escape)('])', '~|])')(),
+ url: /^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,
+ del: /^~~(?=\S)([\s\S]*?\S)~~/,
+ text: replace(inline.text)
+ (']|', '~]|')
+ ('|', '|https?://|')
+ ()
+});
+
+/**
+ * GFM + Line Breaks Inline Grammar
+ */
+
+inline.breaks = merge({}, inline.gfm, {
+ br: replace(inline.br)('{2,}', '*')(),
+ text: replace(inline.gfm.text)('{2,}', '*')()
+});
+
+/**
+ * Inline Lexer & Compiler
+ */
+
+function InlineLexer(links, options) {
+ this.options = options || marked.defaults;
+ this.links = links;
+ this.rules = inline.normal;
+ this.renderer = this.options.renderer || new Renderer;
+ this.renderer.options = this.options;
+
+ if (!this.links) {
+ throw new
+ Error('Tokens array requires a `links` property.');
+ }
+
+ if (this.options.gfm) {
+ if (this.options.breaks) {
+ this.rules = inline.breaks;
+ } else {
+ this.rules = inline.gfm;
+ }
+ } else if (this.options.pedantic) {
+ this.rules = inline.pedantic;
+ }
+}
+
+/**
+ * Expose Inline Rules
+ */
+
+InlineLexer.rules = inline;
+
+/**
+ * Static Lexing/Compiling Method
+ */
+
+InlineLexer.output = function(src, links, options) {
+ var inline = new InlineLexer(links, options);
+ return inline.output(src);
+};
+
+/**
+ * Lexing/Compiling
+ */
+
+InlineLexer.prototype.output = function(src) {
+ var out = ''
+ , link
+ , text
+ , href
+ , cap;
+
+ while (src) {
+ // escape
+ if (cap = this.rules.escape.exec(src)) {
+ src = src.substring(cap[0].length);
+ out += cap[1];
+ continue;
+ }
+
+ // autolink
+ if (cap = this.rules.autolink.exec(src)) {
+ src = src.substring(cap[0].length);
+ if (cap[2] === '@') {
+ text = cap[1].charAt(6) === ':'
+ ? this.mangle(cap[1].substring(7))
+ : this.mangle(cap[1]);
+ href = this.mangle('mailto:') + text;
+ } else {
+ text = escape(cap[1]);
+ href = text;
+ }
+ out += this.renderer.link(href, null, text);
+ continue;
+ }
+
+ // url (gfm)
+ if (!this.inLink && (cap = this.rules.url.exec(src))) {
+ src = src.substring(cap[0].length);
+ text = escape(cap[1]);
+ href = text;
+ out += this.renderer.link(href, null, text);
+ continue;
+ }
+
+ // tag
+ if (cap = this.rules.tag.exec(src)) {
+ if (!this.inLink && /^<a /i.test(cap[0])) {
+ this.inLink = true;
+ } else if (this.inLink && /^<\/a>/i.test(cap[0])) {
+ this.inLink = false;
+ }
+ src = src.substring(cap[0].length);
+ out += this.options.sanitize
+ ? escape(cap[0])
+ : cap[0];
+ continue;
+ }
+
+ // link
+ if (cap = this.rules.link.exec(src)) {
+ src = src.substring(cap[0].length);
+ this.inLink = true;
+ out += this.outputLink(cap, {
+ href: cap[2],
+ title: cap[3]
+ });
+ this.inLink = false;
+ continue;
+ }
+
+ // reflink, nolink
+ if ((cap = this.rules.reflink.exec(src))
+ || (cap = this.rules.nolink.exec(src))) {
+ src = src.substring(cap[0].length);
+ link = (cap[2] || cap[1]).replace(/\s+/g, ' ');
+ link = this.links[link.toLowerCase()];
+ if (!link || !link.href) {
+ out += cap[0].charAt(0);
+ src = cap[0].substring(1) + src;
+ continue;
+ }
+ this.inLink = true;
+ out += this.outputLink(cap, link);
+ this.inLink = false;
+ continue;
+ }
+
+ // strong
+ if (cap = this.rules.strong.exec(src)) {
+ src = src.substring(cap[0].length);
+ out += this.renderer.strong(this.output(cap[2] || cap[1]));
+ continue;
+ }
+
+ // em
+ if (cap = this.rules.em.exec(src)) {
+ src = src.substring(cap[0].length);
+ out += this.renderer.em(this.output(cap[2] || cap[1]));
+ continue;
+ }
+
+ // code
+ if (cap = this.rules.code.exec(src)) {
+ src = src.substring(cap[0].length);
+ out += this.renderer.codespan(escape(cap[2], true));
+ continue;
+ }
+
+ // br
+ if (cap = this.rules.br.exec(src)) {
+ src = src.substring(cap[0].length);
+ out += this.renderer.br();
+ continue;
+ }
+
+ // del (gfm)
+ if (cap = this.rules.del.exec(src)) {
+ src = src.substring(cap[0].length);
+ out += this.renderer.del(this.output(cap[1]));
+ continue;
+ }
+
+ // text
+ if (cap = this.rules.text.exec(src)) {
+ src = src.substring(cap[0].length);
+ out += escape(this.smartypants(cap[0]));
+ continue;
+ }
+
+ if (src) {
+ throw new
+ Error('Infinite loop on byte: ' + src.charCodeAt(0));
+ }
+ }
+
+ return out;
+};
+
+/**
+ * Compile Link
+ */
+
+InlineLexer.prototype.outputLink = function(cap, link) {
+ var href = escape(link.href)
+ , title = link.title ? escape(link.title) : null;
+
+ return cap[0].charAt(0) !== '!'
+ ? this.renderer.link(href, title, this.output(cap[1]))
+ : this.renderer.image(href, title, escape(cap[1]));
+};
+
+/**
+ * Smartypants Transformations
+ */
+
+InlineLexer.prototype.smartypants = function(text) {
+ if (!this.options.smartypants) return text;
+ return text
+ // em-dashes
+ .replace(/--/g, '\u2014')
+ // opening singles
+ .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018')
+ // closing singles & apostrophes
+ .replace(/'/g, '\u2019')
+ // opening doubles
+ .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c')
+ // closing doubles
+ .replace(/"/g, '\u201d')
+ // ellipses
+ .replace(/\.{3}/g, '\u2026');
+};
+
+/**
+ * Mangle Links
+ */
+
+InlineLexer.prototype.mangle = function(text) {
+ var out = ''
+ , l = text.length
+ , i = 0
+ , ch;
+
+ for (; i < l; i++) {
+ ch = text.charCodeAt(i);
+ if (Math.random() > 0.5) {
+ ch = 'x' + ch.toString(16);
+ }
+ out += '&#' + ch + ';';
+ }
+
+ return out;
+};
+
+/**
+ * Renderer
+ */
+
+function Renderer(options) {
+ this.options = options || {};
+}
+
+Renderer.prototype.code = function(code, lang, escaped) {
+ if (this.options.highlight) {
+ var out = this.options.highlight(code, lang);
+ if (out != null && out !== code) {
+ escaped = true;
+ code = out;
+ }
+ }
+
+ if (!lang) {
+ return '<pre><code>'
+ + (escaped ? code : escape(code, true))
+ + '\n</code></pre>';
+ }
+
+ return '<pre><code class="'
+ + this.options.langPrefix
+ + escape(lang, true)
+ + '">'
+ + (escaped ? code : escape(code, true))
+ + '\n</code></pre>\n';
+};
+
+Renderer.prototype.blockquote = function(quote) {
+ return '<blockquote>\n' + quote + '</blockquote>\n';
+};
+
+Renderer.prototype.html = function(html) {
+ return html;
+};
+
+Renderer.prototype.heading = function(text, level, raw) {
+ return '<h'
+ + level
+ + ' id="'
+ + this.options.headerPrefix
+ + raw.toLowerCase().replace(/[^\w]+/g, '-')
+ + '">'
+ + text
+ + '</h'
+ + level
+ + '>\n';
+};
+
+Renderer.prototype.hr = function() {
+ return this.options.xhtml ? '<hr/>\n' : '<hr>\n';
+};
+
+Renderer.prototype.list = function(body, ordered) {
+ var type = ordered ? 'ol' : 'ul';
+ return '<' + type + '>\n' + body + '</' + type + '>\n';
+};
+
+Renderer.prototype.listitem = function(text) {
+ return '<li>' + text + '</li>\n';
+};
+
+Renderer.prototype.paragraph = function(text) {
+ return '<p>' + text + '</p>\n';
+};
+
+Renderer.prototype.table = function(header, body) {
+ return '<table>\n'
+ + '<thead>\n'
+ + header
+ + '</thead>\n'
+ + '<tbody>\n'
+ + body
+ + '</tbody>\n'
+ + '</table>\n';
+};
+
+Renderer.prototype.tablerow = function(content) {
+ return '<tr>\n' + content + '</tr>\n';
+};
+
+Renderer.prototype.tablecell = function(content, flags) {
+ var type = flags.header ? 'th' : 'td';
+ var tag = flags.align
+ ? '<' + type + ' style="text-align:' + flags.align + '">'
+ : '<' + type + '>';
+ return tag + content + '</' + type + '>\n';
+};
+
+// span level renderer
+Renderer.prototype.strong = function(text) {
+ return '<strong>' + text + '</strong>';
+};
+
+Renderer.prototype.em = function(text) {
+ return '<em>' + text + '</em>';
+};
+
+Renderer.prototype.codespan = function(text) {
+ return '<code>' + text + '</code>';
+};
+
+Renderer.prototype.br = function() {
+ return this.options.xhtml ? '<br/>' : '<br>';
+};
+
+Renderer.prototype.del = function(text) {
+ return '<del>' + text + '</del>';
+};
+
+Renderer.prototype.link = function(href, title, text) {
+ if (this.options.sanitize) {
+ try {
+ var prot = decodeURIComponent(unescape(href))
+ .replace(/[^\w:]/g, '')
+ .toLowerCase();
+ } catch (e) {
+ return '';
+ }
+ if (prot.indexOf('javascript:') === 0) {
+ return '';
+ }
+ }
+ var out = '<a href="' + href + '"';
+ if (title) {
+ out += ' title="' + title + '"';
+ }
+ out += '>' + text + '</a>';
+ return out;
+};
+
+Renderer.prototype.image = function(href, title, text) {
+ var out = '<img src="' + href + '" alt="' + text + '"';
+ if (title) {
+ out += ' title="' + title + '"';
+ }
+ out += this.options.xhtml ? '/>' : '>';
+ return out;
+};
+
+/**
+ * Parsing & Compiling
+ */
+
+function Parser(options) {
+ this.tokens = [];
+ this.token = null;
+ this.options = options || marked.defaults;
+ this.options.renderer = this.options.renderer || new Renderer;
+ this.renderer = this.options.renderer;
+ this.renderer.options = this.options;
+}
+
+/**
+ * Static Parse Method
+ */
+
+Parser.parse = function(src, options, renderer) {
+ var parser = new Parser(options, renderer);
+ return parser.parse(src);
+};
+
+/**
+ * Parse Loop
+ */
+
+Parser.prototype.parse = function(src) {
+ this.inline = new InlineLexer(src.links, this.options, this.renderer);
+ this.tokens = src.reverse();
+
+ var out = '';
+ while (this.next()) {
+ out += this.tok();
+ }
+
+ return out;
+};
+
+/**
+ * Next Token
+ */
+
+Parser.prototype.next = function() {
+ return this.token = this.tokens.pop();
+};
+
+/**
+ * Preview Next Token
+ */
+
+Parser.prototype.peek = function() {
+ return this.tokens[this.tokens.length - 1] || 0;
+};
+
+/**
+ * Parse Text Tokens
+ */
+
+Parser.prototype.parseText = function() {
+ var body = this.token.text;
+
+ while (this.peek().type === 'text') {
+ body += '\n' + this.next().text;
+ }
+
+ return this.inline.output(body);
+};
+
+/**
+ * Parse Current Token
+ */
+
+Parser.prototype.tok = function() {
+ switch (this.token.type) {
+ case 'space': {
+ return '';
+ }
+ case 'hr': {
+ return this.renderer.hr();
+ }
+ case 'heading': {
+ return this.renderer.heading(
+ this.inline.output(this.token.text),
+ this.token.depth,
+ this.token.text);
+ }
+ case 'code': {
+ return this.renderer.code(this.token.text,
+ this.token.lang,
+ this.token.escaped);
+ }
+ case 'table': {
+ var header = ''
+ , body = ''
+ , i
+ , row
+ , cell
+ , flags
+ , j;
+
+ // header
+ cell = '';
+ for (i = 0; i < this.token.header.length; i++) {
+ flags = { header: true, align: this.token.align[i] };
+ cell += this.renderer.tablecell(
+ this.inline.output(this.token.header[i]),
+ { header: true, align: this.token.align[i] }
+ );
+ }
+ header += this.renderer.tablerow(cell);
+
+ for (i = 0; i < this.token.cells.length; i++) {
+ row = this.token.cells[i];
+
+ cell = '';
+ for (j = 0; j < row.length; j++) {
+ cell += this.renderer.tablecell(
+ this.inline.output(row[j]),
+ { header: false, align: this.token.align[j] }
+ );
+ }
+
+ body += this.renderer.tablerow(cell);
+ }
+ return this.renderer.table(header, body);
+ }
+ case 'blockquote_start': {
+ var body = '';
+
+ while (this.next().type !== 'blockquote_end') {
+ body += this.tok();
+ }
+
+ return this.renderer.blockquote(body);
+ }
+ case 'list_start': {
+ var body = ''
+ , ordered = this.token.ordered;
+
+ while (this.next().type !== 'list_end') {
+ body += this.tok();
+ }
+
+ return this.renderer.list(body, ordered);
+ }
+ case 'list_item_start': {
+ var body = '';
+
+ while (this.next().type !== 'list_item_end') {
+ body += this.token.type === 'text'
+ ? this.parseText()
+ : this.tok();
+ }
+
+ return this.renderer.listitem(body);
+ }
+ case 'loose_item_start': {
+ var body = '';
+
+ while (this.next().type !== 'list_item_end') {
+ body += this.tok();
+ }
+
+ return this.renderer.listitem(body);
+ }
+ case 'html': {
+ var html = !this.token.pre && !this.options.pedantic
+ ? this.inline.output(this.token.text)
+ : this.token.text;
+ return this.renderer.html(html);
+ }
+ case 'paragraph': {
+ return this.renderer.paragraph(this.inline.output(this.token.text));
+ }
+ case 'text': {
+ return this.renderer.paragraph(this.parseText());
+ }
+ }
+};
+
+/**
+ * Helpers
+ */
+
+function escape(html, encode) {
+ return html
+ .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&amp;')
+ .replace(/</g, '&lt;')
+ .replace(/>/g, '&gt;')
+ .replace(/"/g, '&quot;')
+ .replace(/'/g, '&#39;');
+}
+
+function unescape(html) {
+ return html.replace(/&([#\w]+);/g, function(_, n) {
+ n = n.toLowerCase();
+ if (n === 'colon') return ':';
+ if (n.charAt(0) === '#') {
+ return n.charAt(1) === 'x'
+ ? String.fromCharCode(parseInt(n.substring(2), 16))
+ : String.fromCharCode(+n.substring(1));
+ }
+ return '';
+ });
+}
+
+function replace(regex, opt) {
+ regex = regex.source;
+ opt = opt || '';
+ return function self(name, val) {
+ if (!name) return new RegExp(regex, opt);
+ val = val.source || val;
+ val = val.replace(/(^|[^\[])\^/g, '$1');
+ regex = regex.replace(name, val);
+ return self;
+ };
+}
+
+function noop() {}
+noop.exec = noop;
+
+function merge(obj) {
+ var i = 1
+ , target
+ , key;
+
+ for (; i < arguments.length; i++) {
+ target = arguments[i];
+ for (key in target) {
+ if (Object.prototype.hasOwnProperty.call(target, key)) {
+ obj[key] = target[key];
+ }
+ }
+ }
+
+ return obj;
+}
+
+
+/**
+ * Marked
+ */
+
+function marked(src, opt, callback) {
+ if (callback || typeof opt === 'function') {
+ if (!callback) {
+ callback = opt;
+ opt = null;
+ }
+
+ opt = merge({}, marked.defaults, opt || {});
+
+ var highlight = opt.highlight
+ , tokens
+ , pending
+ , i = 0;
+
+ try {
+ tokens = Lexer.lex(src, opt)
+ } catch (e) {
+ return callback(e);
+ }
+
+ pending = tokens.length;
+
+ var done = function(err) {
+ if (err) {
+ opt.highlight = highlight;
+ return callback(err);
+ }
+
+ var out;
+
+ try {
+ out = Parser.parse(tokens, opt);
+ } catch (e) {
+ err = e;
+ }
+
+ opt.highlight = highlight;
+
+ return err
+ ? callback(err)
+ : callback(null, out);
+ };
+
+ if (!highlight || highlight.length < 3) {
+ return done();
+ }
+
+ delete opt.highlight;
+
+ if (!pending) return done();
+
+ for (; i < tokens.length; i++) {
+ (function(token) {
+ if (token.type !== 'code') {
+ return --pending || done();
+ }
+ return highlight(token.text, token.lang, function(err, code) {
+ if (err) return done(err);
+ if (code == null || code === token.text) {
+ return --pending || done();
+ }
+ token.text = code;
+ token.escaped = true;
+ --pending || done();
+ });
+ })(tokens[i]);
+ }
+
+ return;
+ }
+ try {
+ if (opt) opt = merge({}, marked.defaults, opt);
+ return Parser.parse(Lexer.lex(src, opt), opt);
+ } catch (e) {
+ e.message += '\nPlease report this to https://github.com/chjj/marked.';
+ if ((opt || marked.defaults).silent) {
+ return '<p>An error occured:</p><pre>'
+ + escape(e.message + '', true)
+ + '</pre>';
+ }
+ throw e;
+ }
+}
+
+/**
+ * Options
+ */
+
+marked.options =
+marked.setOptions = function(opt) {
+ merge(marked.defaults, opt);
+ return marked;
+};
+
+marked.defaults = {
+ gfm: true,
+ tables: true,
+ breaks: false,
+ pedantic: false,
+ sanitize: false,
+ smartLists: false,
+ silent: false,
+ highlight: null,
+ langPrefix: 'lang-',
+ smartypants: false,
+ headerPrefix: '',
+ renderer: new Renderer,
+ xhtml: false
+};
+
+/**
+ * Expose
+ */
+
+marked.Parser = Parser;
+marked.parser = Parser.parse;
+
+marked.Renderer = Renderer;
+
+marked.Lexer = Lexer;
+marked.lexer = Lexer.lex;
+
+marked.InlineLexer = InlineLexer;
+marked.inlineLexer = InlineLexer.output;
+
+marked.parse = marked;
+
+if (typeof module !== 'undefined' && typeof exports === 'object') {
+ module.exports = marked;
+} else if (typeof define === 'function' && define.amd) {
+ define(function() { return marked; });
+} else {
+ this.marked = marked;
+}
+
+}).call(function() {
+ return this || (typeof window !== 'undefined' ? window : global);
+}());
diff --git a/openecomp-be/tools/swagger-ui/lib/swagger-oauth.js b/openecomp-be/tools/swagger-ui/lib/swagger-oauth.js
new file mode 100644
index 0000000000..bec846740a
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/lib/swagger-oauth.js
@@ -0,0 +1,310 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+var appName;
+var popupMask;
+var popupDialog;
+var clientId;
+var realm;
+var oauth2KeyName;
+var redirect_uri;
+var clientSecret;
+var scopeSeparator;
+
+function handleLogin() {
+ var scopes = [];
+
+ var auths = window.swaggerUi.api.authSchemes || window.swaggerUi.api.securityDefinitions;
+ if(auths) {
+ var key;
+ var defs = auths;
+ for(key in defs) {
+ var auth = defs[key];
+ if(auth.type === 'oauth2' && auth.scopes) {
+ oauth2KeyName = key;
+ var scope;
+ if(Array.isArray(auth.scopes)) {
+ // 1.2 support
+ var i;
+ for(i = 0; i < auth.scopes.length; i++) {
+ scopes.push(auth.scopes[i]);
+ }
+ }
+ else {
+ // 2.0 support
+ for(scope in auth.scopes) {
+ scopes.push({scope: scope, description: auth.scopes[scope]});
+ }
+ }
+ }
+ }
+ }
+
+ if(window.swaggerUi.api
+ && window.swaggerUi.api.info) {
+ appName = window.swaggerUi.api.info.title;
+ }
+
+ $('.api-popup-dialog').remove();
+ popupDialog = $(
+ [
+ '<div class="api-popup-dialog">',
+ '<div class="api-popup-title">Select OAuth2.0 Scopes</div>',
+ '<div class="api-popup-content">',
+ '<p>Scopes are used to grant an application different levels of access to data on behalf of the end user. Each API may declare one or more scopes.',
+ '<a href="#">Learn how to use</a>',
+ '</p>',
+ '<p><strong>' + appName + '</strong> API requires the following scopes. Select which ones you want to grant to Swagger UI.</p>',
+ '<ul class="api-popup-scopes">',
+ '</ul>',
+ '<p class="error-msg"></p>',
+ '<div class="api-popup-actions"><button class="api-popup-authbtn api-button green" type="button">Authorize</button><button class="api-popup-cancel api-button gray" type="button">Cancel</button></div>',
+ '</div>',
+ '</div>'].join(''));
+ $(document.body).append(popupDialog);
+
+ popup = popupDialog.find('ul.api-popup-scopes').empty();
+ for (i = 0; i < scopes.length; i ++) {
+ scope = scopes[i];
+ str = '<li><input type="checkbox" id="scope_' + i + '" scope="' + scope.scope + '"/>' + '<label for="scope_' + i + '">' + scope.scope;
+ if (scope.description) {
+ str += '<br/><span class="api-scope-desc">' + scope.description + '</span>';
+ }
+ str += '</label></li>';
+ popup.append(str);
+ }
+
+ var $win = $(window),
+ dw = $win.width(),
+ dh = $win.height(),
+ st = $win.scrollTop(),
+ dlgWd = popupDialog.outerWidth(),
+ dlgHt = popupDialog.outerHeight(),
+ top = (dh -dlgHt)/2 + st,
+ left = (dw - dlgWd)/2;
+
+ popupDialog.css({
+ top: (top < 0? 0 : top) + 'px',
+ left: (left < 0? 0 : left) + 'px'
+ });
+
+ popupDialog.find('button.api-popup-cancel').click(function() {
+ popupMask.hide();
+ popupDialog.hide();
+ popupDialog.empty();
+ popupDialog = [];
+ });
+
+ $('button.api-popup-authbtn').unbind();
+ popupDialog.find('button.api-popup-authbtn').click(function() {
+ popupMask.hide();
+ popupDialog.hide();
+
+ var authSchemes = window.swaggerUi.api.authSchemes;
+ var host = window.location;
+ var pathname = location.pathname.substring(0, location.pathname.lastIndexOf("/"));
+ var defaultRedirectUrl = host.protocol + '//' + host.host + pathname + '/o2c.html';
+ var redirectUrl = window.oAuthRedirectUrl || defaultRedirectUrl;
+ var url = null;
+
+ for (var key in authSchemes) {
+ if (authSchemes.hasOwnProperty(key)) {
+ var flow = authSchemes[key].flow;
+
+ if(authSchemes[key].type === 'oauth2' && flow && (flow === 'implicit' || flow === 'accessCode')) {
+ var dets = authSchemes[key];
+ url = dets.authorizationUrl + '?response_type=' + (flow === 'implicit' ? 'token' : 'code');
+ window.swaggerUi.tokenName = dets.tokenName || 'access_token';
+ window.swaggerUi.tokenUrl = (flow === 'accessCode' ? dets.tokenUrl : null);
+ }
+ else if(authSchemes[key].grantTypes) {
+ // 1.2 support
+ var o = authSchemes[key].grantTypes;
+ for(var t in o) {
+ if(o.hasOwnProperty(t) && t === 'implicit') {
+ var dets = o[t];
+ var ep = dets.loginEndpoint.url;
+ url = dets.loginEndpoint.url + '?response_type=token';
+ window.swaggerUi.tokenName = dets.tokenName;
+ }
+ else if (o.hasOwnProperty(t) && t === 'accessCode') {
+ var dets = o[t];
+ var ep = dets.tokenRequestEndpoint.url;
+ url = dets.tokenRequestEndpoint.url + '?response_type=code';
+ window.swaggerUi.tokenName = dets.tokenName;
+ }
+ }
+ }
+ }
+ }
+ var scopes = []
+ var o = $('.api-popup-scopes').find('input:checked');
+
+ for(k =0; k < o.length; k++) {
+ var scope = $(o[k]).attr('scope');
+
+ if (scopes.indexOf(scope) === -1)
+ scopes.push(scope);
+ }
+
+ // Implicit auth recommends a state parameter.
+ var state = Math.random ();
+
+ window.enabledScopes=scopes;
+
+ redirect_uri = redirectUrl;
+
+ url += '&redirect_uri=' + encodeURIComponent(redirectUrl);
+ url += '&realm=' + encodeURIComponent(realm);
+ url += '&client_id=' + encodeURIComponent(clientId);
+ url += '&scope=' + encodeURIComponent(scopes.join(scopeSeparator));
+ url += '&state=' + encodeURIComponent(state);
+
+ window.open(url);
+ });
+
+ popupMask.show();
+ popupDialog.show();
+ return;
+}
+
+
+function handleLogout() {
+ for(key in window.swaggerUi.api.clientAuthorizations.authz){
+ window.swaggerUi.api.clientAuthorizations.remove(key)
+ }
+ window.enabledScopes = null;
+ $('.api-ic.ic-on').addClass('ic-off');
+ $('.api-ic.ic-on').removeClass('ic-on');
+
+ // set the info box
+ $('.api-ic.ic-warning').addClass('ic-error');
+ $('.api-ic.ic-warning').removeClass('ic-warning');
+}
+
+function initOAuth(opts) {
+ var o = (opts||{});
+ var errors = [];
+
+ appName = (o.appName||errors.push('missing appName'));
+ popupMask = (o.popupMask||$('#api-common-mask'));
+ popupDialog = (o.popupDialog||$('.api-popup-dialog'));
+ clientId = (o.clientId||errors.push('missing client id'));
+ clientSecret = (o.clientSecret||errors.push('missing client secret'));
+ realm = (o.realm||errors.push('missing realm'));
+ scopeSeparator = (o.scopeSeparator||' ');
+
+ if(errors.length > 0){
+ log('auth unable initialize oauth: ' + errors);
+ return;
+ }
+
+ $('pre code').each(function(i, e) {hljs.highlightBlock(e)});
+ $('.api-ic').unbind();
+ $('.api-ic').click(function(s) {
+ if($(s.target).hasClass('ic-off'))
+ handleLogin();
+ else {
+ handleLogout();
+ }
+ false;
+ });
+}
+
+window.processOAuthCode = function processOAuthCode(data) {
+ var params = {
+ 'client_id': clientId,
+ 'client_secret': clientSecret,
+ 'code': data.code,
+ 'grant_type': 'authorization_code',
+ 'redirect_uri': redirect_uri
+ }
+ $.ajax(
+ {
+ url : window.swaggerUi.tokenUrl,
+ type: "POST",
+ data: params,
+ success:function(data, textStatus, jqXHR)
+ {
+ onOAuthComplete(data);
+ },
+ error: function(jqXHR, textStatus, errorThrown)
+ {
+ onOAuthComplete("");
+ }
+ });
+}
+
+window.onOAuthComplete = function onOAuthComplete(token) {
+ if(token) {
+ if(token.error) {
+ var checkbox = $('input[type=checkbox],.secured')
+ checkbox.each(function(pos){
+ checkbox[pos].checked = false;
+ });
+ alert(token.error);
+ }
+ else {
+ var b = token[window.swaggerUi.tokenName];
+ if(b){
+ // if all roles are satisfied
+ var o = null;
+ $.each($('.auth .api-ic .api_information_panel'), function(k, v) {
+ var children = v;
+ if(children && children.childNodes) {
+ var requiredScopes = [];
+ $.each((children.childNodes), function (k1, v1){
+ var inner = v1.innerHTML;
+ if(inner)
+ requiredScopes.push(inner);
+ });
+ var diff = [];
+ for(var i=0; i < requiredScopes.length; i++) {
+ var s = requiredScopes[i];
+ if(window.enabledScopes && window.enabledScopes.indexOf(s) == -1) {
+ diff.push(s);
+ }
+ }
+ if(diff.length > 0){
+ o = v.parentNode.parentNode;
+ $(o.parentNode).find('.api-ic.ic-on').addClass('ic-off');
+ $(o.parentNode).find('.api-ic.ic-on').removeClass('ic-on');
+
+ // sorry, not all scopes are satisfied
+ $(o).find('.api-ic').addClass('ic-warning');
+ $(o).find('.api-ic').removeClass('ic-error');
+ }
+ else {
+ o = v.parentNode.parentNode;
+ $(o.parentNode).find('.api-ic.ic-off').addClass('ic-on');
+ $(o.parentNode).find('.api-ic.ic-off').removeClass('ic-off');
+
+ // all scopes are satisfied
+ $(o).find('.api-ic').addClass('ic-info');
+ $(o).find('.api-ic').removeClass('ic-warning');
+ $(o).find('.api-ic').removeClass('ic-error');
+ }
+ }
+ });
+ window.swaggerUi.api.clientAuthorizations.add(oauth2KeyName, new SwaggerClient.ApiKeyAuthorization('Authorization', 'Bearer ' + b, 'header'));
+ }
+ }
+ }
+}
diff --git a/openecomp-be/tools/swagger-ui/lib/underscore-min.js b/openecomp-be/tools/swagger-ui/lib/underscore-min.js
new file mode 100644
index 0000000000..56cf7330d2
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/lib/underscore-min.js
@@ -0,0 +1,26 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+// Underscore.js 1.7.0
+// http://underscorejs.org
+// (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+// Underscore may be freely distributed under the MIT license.
+(function(){var n=this,t=n._,r=Array.prototype,e=Object.prototype,u=Function.prototype,i=r.push,a=r.slice,o=r.concat,l=e.toString,c=e.hasOwnProperty,f=Array.isArray,s=Object.keys,p=u.bind,h=function(n){return n instanceof h?n:this instanceof h?void(this._wrapped=n):new h(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=h),exports._=h):n._=h,h.VERSION="1.7.0";var g=function(n,t,r){if(t===void 0)return n;switch(null==r?3:r){case 1:return function(r){return n.call(t,r)};case 2:return function(r,e){return n.call(t,r,e)};case 3:return function(r,e,u){return n.call(t,r,e,u)};case 4:return function(r,e,u,i){return n.call(t,r,e,u,i)}}return function(){return n.apply(t,arguments)}};h.iteratee=function(n,t,r){return null==n?h.identity:h.isFunction(n)?g(n,t,r):h.isObject(n)?h.matches(n):h.property(n)},h.each=h.forEach=function(n,t,r){if(null==n)return n;t=g(t,r);var e,u=n.length;if(u===+u)for(e=0;u>e;e++)t(n[e],e,n);else{var i=h.keys(n);for(e=0,u=i.length;u>e;e++)t(n[i[e]],i[e],n)}return n},h.map=h.collect=function(n,t,r){if(null==n)return[];t=h.iteratee(t,r);for(var e,u=n.length!==+n.length&&h.keys(n),i=(u||n).length,a=Array(i),o=0;i>o;o++)e=u?u[o]:o,a[o]=t(n[e],e,n);return a};var v="Reduce of empty array with no initial value";h.reduce=h.foldl=h.inject=function(n,t,r,e){null==n&&(n=[]),t=g(t,e,4);var u,i=n.length!==+n.length&&h.keys(n),a=(i||n).length,o=0;if(arguments.length<3){if(!a)throw new TypeError(v);r=n[i?i[o++]:o++]}for(;a>o;o++)u=i?i[o]:o,r=t(r,n[u],u,n);return r},h.reduceRight=h.foldr=function(n,t,r,e){null==n&&(n=[]),t=g(t,e,4);var u,i=n.length!==+n.length&&h.keys(n),a=(i||n).length;if(arguments.length<3){if(!a)throw new TypeError(v);r=n[i?i[--a]:--a]}for(;a--;)u=i?i[a]:a,r=t(r,n[u],u,n);return r},h.find=h.detect=function(n,t,r){var e;return t=h.iteratee(t,r),h.some(n,function(n,r,u){return t(n,r,u)?(e=n,!0):void 0}),e},h.filter=h.select=function(n,t,r){var e=[];return null==n?e:(t=h.iteratee(t,r),h.each(n,function(n,r,u){t(n,r,u)&&e.push(n)}),e)},h.reject=function(n,t,r){return h.filter(n,h.negate(h.iteratee(t)),r)},h.every=h.all=function(n,t,r){if(null==n)return!0;t=h.iteratee(t,r);var e,u,i=n.length!==+n.length&&h.keys(n),a=(i||n).length;for(e=0;a>e;e++)if(u=i?i[e]:e,!t(n[u],u,n))return!1;return!0},h.some=h.any=function(n,t,r){if(null==n)return!1;t=h.iteratee(t,r);var e,u,i=n.length!==+n.length&&h.keys(n),a=(i||n).length;for(e=0;a>e;e++)if(u=i?i[e]:e,t(n[u],u,n))return!0;return!1},h.contains=h.include=function(n,t){return null==n?!1:(n.length!==+n.length&&(n=h.values(n)),h.indexOf(n,t)>=0)},h.invoke=function(n,t){var r=a.call(arguments,2),e=h.isFunction(t);return h.map(n,function(n){return(e?t:n[t]).apply(n,r)})},h.pluck=function(n,t){return h.map(n,h.property(t))},h.where=function(n,t){return h.filter(n,h.matches(t))},h.findWhere=function(n,t){return h.find(n,h.matches(t))},h.max=function(n,t,r){var e,u,i=-1/0,a=-1/0;if(null==t&&null!=n){n=n.length===+n.length?n:h.values(n);for(var o=0,l=n.length;l>o;o++)e=n[o],e>i&&(i=e)}else t=h.iteratee(t,r),h.each(n,function(n,r,e){u=t(n,r,e),(u>a||u===-1/0&&i===-1/0)&&(i=n,a=u)});return i},h.min=function(n,t,r){var e,u,i=1/0,a=1/0;if(null==t&&null!=n){n=n.length===+n.length?n:h.values(n);for(var o=0,l=n.length;l>o;o++)e=n[o],i>e&&(i=e)}else t=h.iteratee(t,r),h.each(n,function(n,r,e){u=t(n,r,e),(a>u||1/0===u&&1/0===i)&&(i=n,a=u)});return i},h.shuffle=function(n){for(var t,r=n&&n.length===+n.length?n:h.values(n),e=r.length,u=Array(e),i=0;e>i;i++)t=h.random(0,i),t!==i&&(u[i]=u[t]),u[t]=r[i];return u},h.sample=function(n,t,r){return null==t||r?(n.length!==+n.length&&(n=h.values(n)),n[h.random(n.length-1)]):h.shuffle(n).slice(0,Math.max(0,t))},h.sortBy=function(n,t,r){return t=h.iteratee(t,r),h.pluck(h.map(n,function(n,r,e){return{value:n,index:r,criteria:t(n,r,e)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index-t.index}),"value")};var m=function(n){return function(t,r,e){var u={};return r=h.iteratee(r,e),h.each(t,function(e,i){var a=r(e,i,t);n(u,e,a)}),u}};h.groupBy=m(function(n,t,r){h.has(n,r)?n[r].push(t):n[r]=[t]}),h.indexBy=m(function(n,t,r){n[r]=t}),h.countBy=m(function(n,t,r){h.has(n,r)?n[r]++:n[r]=1}),h.sortedIndex=function(n,t,r,e){r=h.iteratee(r,e,1);for(var u=r(t),i=0,a=n.length;a>i;){var o=i+a>>>1;r(n[o])<u?i=o+1:a=o}return i},h.toArray=function(n){return n?h.isArray(n)?a.call(n):n.length===+n.length?h.map(n,h.identity):h.values(n):[]},h.size=function(n){return null==n?0:n.length===+n.length?n.length:h.keys(n).length},h.partition=function(n,t,r){t=h.iteratee(t,r);var e=[],u=[];return h.each(n,function(n,r,i){(t(n,r,i)?e:u).push(n)}),[e,u]},h.first=h.head=h.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:0>t?[]:a.call(n,0,t)},h.initial=function(n,t,r){return a.call(n,0,Math.max(0,n.length-(null==t||r?1:t)))},h.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:a.call(n,Math.max(n.length-t,0))},h.rest=h.tail=h.drop=function(n,t,r){return a.call(n,null==t||r?1:t)},h.compact=function(n){return h.filter(n,h.identity)};var y=function(n,t,r,e){if(t&&h.every(n,h.isArray))return o.apply(e,n);for(var u=0,a=n.length;a>u;u++){var l=n[u];h.isArray(l)||h.isArguments(l)?t?i.apply(e,l):y(l,t,r,e):r||e.push(l)}return e};h.flatten=function(n,t){return y(n,t,!1,[])},h.without=function(n){return h.difference(n,a.call(arguments,1))},h.uniq=h.unique=function(n,t,r,e){if(null==n)return[];h.isBoolean(t)||(e=r,r=t,t=!1),null!=r&&(r=h.iteratee(r,e));for(var u=[],i=[],a=0,o=n.length;o>a;a++){var l=n[a];if(t)a&&i===l||u.push(l),i=l;else if(r){var c=r(l,a,n);h.indexOf(i,c)<0&&(i.push(c),u.push(l))}else h.indexOf(u,l)<0&&u.push(l)}return u},h.union=function(){return h.uniq(y(arguments,!0,!0,[]))},h.intersection=function(n){if(null==n)return[];for(var t=[],r=arguments.length,e=0,u=n.length;u>e;e++){var i=n[e];if(!h.contains(t,i)){for(var a=1;r>a&&h.contains(arguments[a],i);a++);a===r&&t.push(i)}}return t},h.difference=function(n){var t=y(a.call(arguments,1),!0,!0,[]);return h.filter(n,function(n){return!h.contains(t,n)})},h.zip=function(n){if(null==n)return[];for(var t=h.max(arguments,"length").length,r=Array(t),e=0;t>e;e++)r[e]=h.pluck(arguments,e);return r},h.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},h.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=h.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}for(;u>e;e++)if(n[e]===t)return e;return-1},h.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=n.length;for("number"==typeof r&&(e=0>r?e+r+1:Math.min(e,r+1));--e>=0;)if(n[e]===t)return e;return-1},h.range=function(n,t,r){arguments.length<=1&&(t=n||0,n=0),r=r||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=Array(e),i=0;e>i;i++,n+=r)u[i]=n;return u};var d=function(){};h.bind=function(n,t){var r,e;if(p&&n.bind===p)return p.apply(n,a.call(arguments,1));if(!h.isFunction(n))throw new TypeError("Bind must be called on a function");return r=a.call(arguments,2),e=function(){if(!(this instanceof e))return n.apply(t,r.concat(a.call(arguments)));d.prototype=n.prototype;var u=new d;d.prototype=null;var i=n.apply(u,r.concat(a.call(arguments)));return h.isObject(i)?i:u}},h.partial=function(n){var t=a.call(arguments,1);return function(){for(var r=0,e=t.slice(),u=0,i=e.length;i>u;u++)e[u]===h&&(e[u]=arguments[r++]);for(;r<arguments.length;)e.push(arguments[r++]);return n.apply(this,e)}},h.bindAll=function(n){var t,r,e=arguments.length;if(1>=e)throw new Error("bindAll must be passed function names");for(t=1;e>t;t++)r=arguments[t],n[r]=h.bind(n[r],n);return n},h.memoize=function(n,t){var r=function(e){var u=r.cache,i=t?t.apply(this,arguments):e;return h.has(u,i)||(u[i]=n.apply(this,arguments)),u[i]};return r.cache={},r},h.delay=function(n,t){var r=a.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},h.defer=function(n){return h.delay.apply(h,[n,1].concat(a.call(arguments,1)))},h.throttle=function(n,t,r){var e,u,i,a=null,o=0;r||(r={});var l=function(){o=r.leading===!1?0:h.now(),a=null,i=n.apply(e,u),a||(e=u=null)};return function(){var c=h.now();o||r.leading!==!1||(o=c);var f=t-(c-o);return e=this,u=arguments,0>=f||f>t?(clearTimeout(a),a=null,o=c,i=n.apply(e,u),a||(e=u=null)):a||r.trailing===!1||(a=setTimeout(l,f)),i}},h.debounce=function(n,t,r){var e,u,i,a,o,l=function(){var c=h.now()-a;t>c&&c>0?e=setTimeout(l,t-c):(e=null,r||(o=n.apply(i,u),e||(i=u=null)))};return function(){i=this,u=arguments,a=h.now();var c=r&&!e;return e||(e=setTimeout(l,t)),c&&(o=n.apply(i,u),i=u=null),o}},h.wrap=function(n,t){return h.partial(t,n)},h.negate=function(n){return function(){return!n.apply(this,arguments)}},h.compose=function(){var n=arguments,t=n.length-1;return function(){for(var r=t,e=n[t].apply(this,arguments);r--;)e=n[r].call(this,e);return e}},h.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},h.before=function(n,t){var r;return function(){return--n>0?r=t.apply(this,arguments):t=null,r}},h.once=h.partial(h.before,2),h.keys=function(n){if(!h.isObject(n))return[];if(s)return s(n);var t=[];for(var r in n)h.has(n,r)&&t.push(r);return t},h.values=function(n){for(var t=h.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},h.pairs=function(n){for(var t=h.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},h.invert=function(n){for(var t={},r=h.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},h.functions=h.methods=function(n){var t=[];for(var r in n)h.isFunction(n[r])&&t.push(r);return t.sort()},h.extend=function(n){if(!h.isObject(n))return n;for(var t,r,e=1,u=arguments.length;u>e;e++){t=arguments[e];for(r in t)c.call(t,r)&&(n[r]=t[r])}return n},h.pick=function(n,t,r){var e,u={};if(null==n)return u;if(h.isFunction(t)){t=g(t,r);for(e in n){var i=n[e];t(i,e,n)&&(u[e]=i)}}else{var l=o.apply([],a.call(arguments,1));n=new Object(n);for(var c=0,f=l.length;f>c;c++)e=l[c],e in n&&(u[e]=n[e])}return u},h.omit=function(n,t,r){if(h.isFunction(t))t=h.negate(t);else{var e=h.map(o.apply([],a.call(arguments,1)),String);t=function(n,t){return!h.contains(e,t)}}return h.pick(n,t,r)},h.defaults=function(n){if(!h.isObject(n))return n;for(var t=1,r=arguments.length;r>t;t++){var e=arguments[t];for(var u in e)n[u]===void 0&&(n[u]=e[u])}return n},h.clone=function(n){return h.isObject(n)?h.isArray(n)?n.slice():h.extend({},n):n},h.tap=function(n,t){return t(n),n};var b=function(n,t,r,e){if(n===t)return 0!==n||1/n===1/t;if(null==n||null==t)return n===t;n instanceof h&&(n=n._wrapped),t instanceof h&&(t=t._wrapped);var u=l.call(n);if(u!==l.call(t))return!1;switch(u){case"[object RegExp]":case"[object String]":return""+n==""+t;case"[object Number]":return+n!==+n?+t!==+t:0===+n?1/+n===1/t:+n===+t;case"[object Date]":case"[object Boolean]":return+n===+t}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(r[i]===n)return e[i]===t;var a=n.constructor,o=t.constructor;if(a!==o&&"constructor"in n&&"constructor"in t&&!(h.isFunction(a)&&a instanceof a&&h.isFunction(o)&&o instanceof o))return!1;r.push(n),e.push(t);var c,f;if("[object Array]"===u){if(c=n.length,f=c===t.length)for(;c--&&(f=b(n[c],t[c],r,e)););}else{var s,p=h.keys(n);if(c=p.length,f=h.keys(t).length===c)for(;c--&&(s=p[c],f=h.has(t,s)&&b(n[s],t[s],r,e)););}return r.pop(),e.pop(),f};h.isEqual=function(n,t){return b(n,t,[],[])},h.isEmpty=function(n){if(null==n)return!0;if(h.isArray(n)||h.isString(n)||h.isArguments(n))return 0===n.length;for(var t in n)if(h.has(n,t))return!1;return!0},h.isElement=function(n){return!(!n||1!==n.nodeType)},h.isArray=f||function(n){return"[object Array]"===l.call(n)},h.isObject=function(n){var t=typeof n;return"function"===t||"object"===t&&!!n},h.each(["Arguments","Function","String","Number","Date","RegExp"],function(n){h["is"+n]=function(t){return l.call(t)==="[object "+n+"]"}}),h.isArguments(arguments)||(h.isArguments=function(n){return h.has(n,"callee")}),"function"!=typeof/./&&(h.isFunction=function(n){return"function"==typeof n||!1}),h.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},h.isNaN=function(n){return h.isNumber(n)&&n!==+n},h.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"===l.call(n)},h.isNull=function(n){return null===n},h.isUndefined=function(n){return n===void 0},h.has=function(n,t){return null!=n&&c.call(n,t)},h.noConflict=function(){return n._=t,this},h.identity=function(n){return n},h.constant=function(n){return function(){return n}},h.noop=function(){},h.property=function(n){return function(t){return t[n]}},h.matches=function(n){var t=h.pairs(n),r=t.length;return function(n){if(null==n)return!r;n=new Object(n);for(var e=0;r>e;e++){var u=t[e],i=u[0];if(u[1]!==n[i]||!(i in n))return!1}return!0}},h.times=function(n,t,r){var e=Array(Math.max(0,n));t=g(t,r,1);for(var u=0;n>u;u++)e[u]=t(u);return e},h.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))},h.now=Date.now||function(){return(new Date).getTime()};var _={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},w=h.invert(_),j=function(n){var t=function(t){return n[t]},r="(?:"+h.keys(n).join("|")+")",e=RegExp(r),u=RegExp(r,"g");return function(n){return n=null==n?"":""+n,e.test(n)?n.replace(u,t):n}};h.escape=j(_),h.unescape=j(w),h.result=function(n,t){if(null==n)return void 0;var r=n[t];return h.isFunction(r)?n[t]():r};var x=0;h.uniqueId=function(n){var t=++x+"";return n?n+t:t},h.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var A=/(.)^/,k={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},O=/\\|'|\r|\n|\u2028|\u2029/g,F=function(n){return"\\"+k[n]};h.template=function(n,t,r){!t&&r&&(t=r),t=h.defaults({},t,h.templateSettings);var e=RegExp([(t.escape||A).source,(t.interpolate||A).source,(t.evaluate||A).source].join("|")+"|$","g"),u=0,i="__p+='";n.replace(e,function(t,r,e,a,o){return i+=n.slice(u,o).replace(O,F),u=o+t.length,r?i+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":e?i+="'+\n((__t=("+e+"))==null?'':__t)+\n'":a&&(i+="';\n"+a+"\n__p+='"),t}),i+="';\n",t.variable||(i="with(obj||{}){\n"+i+"}\n"),i="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{var a=new Function(t.variable||"obj","_",i)}catch(o){throw o.source=i,o}var l=function(n){return a.call(this,n,h)},c=t.variable||"obj";return l.source="function("+c+"){\n"+i+"}",l},h.chain=function(n){var t=h(n);return t._chain=!0,t};var E=function(n){return this._chain?h(n).chain():n};h.mixin=function(n){h.each(h.functions(n),function(t){var r=h[t]=n[t];h.prototype[t]=function(){var n=[this._wrapped];return i.apply(n,arguments),E.call(this,r.apply(h,n))}})},h.mixin(h),h.each(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=r[n];h.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!==n&&"splice"!==n||0!==r.length||delete r[0],E.call(this,r)}}),h.each(["concat","join","slice"],function(n){var t=r[n];h.prototype[n]=function(){return E.call(this,t.apply(this._wrapped,arguments))}}),h.prototype.value=function(){return this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return h})}).call(this);
+//# sourceMappingURL=underscore-min.map
diff --git a/openecomp-be/tools/swagger-ui/lib/underscore-min.map b/openecomp-be/tools/swagger-ui/lib/underscore-min.map
new file mode 100644
index 0000000000..00c883bf1f
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/lib/underscore-min.map
@@ -0,0 +1 @@
+{"version":3,"file":"underscore-min.js","sources":["underscore.js"],"names":["createReduce","dir","iterator","obj","iteratee","memo","keys","index","length","currentKey","context","optimizeCb","isArrayLike","_","arguments","createIndexFinder","array","predicate","cb","collectNonEnumProps","nonEnumIdx","nonEnumerableProps","constructor","proto","isFunction","prototype","ObjProto","prop","has","contains","push","root","this","previousUnderscore","ArrayProto","Array","Object","FuncProto","Function","slice","toString","hasOwnProperty","nativeIsArray","isArray","nativeKeys","nativeBind","bind","nativeCreate","create","Ctor","_wrapped","exports","module","VERSION","func","argCount","value","call","other","collection","accumulator","apply","identity","isObject","matcher","property","Infinity","createAssigner","keysFunc","undefinedOnly","source","l","i","key","baseCreate","result","MAX_ARRAY_INDEX","Math","pow","each","forEach","map","collect","results","reduce","foldl","inject","reduceRight","foldr","find","detect","findIndex","findKey","filter","select","list","reject","negate","every","all","some","any","includes","include","target","fromIndex","values","indexOf","invoke","method","args","isFunc","pluck","where","attrs","findWhere","max","computed","lastComputed","min","shuffle","rand","set","shuffled","random","sample","n","guard","sortBy","criteria","sort","left","right","a","b","group","behavior","groupBy","indexBy","countBy","toArray","size","partition","pass","fail","first","head","take","initial","last","rest","tail","drop","compact","flatten","input","shallow","strict","startIndex","output","idx","isArguments","j","len","without","difference","uniq","unique","isSorted","isBoolean","seen","union","intersection","argsLength","item","zip","unzip","object","sortedIndex","isNaN","lastIndexOf","from","findLastIndex","low","high","mid","floor","range","start","stop","step","ceil","executeBound","sourceFunc","boundFunc","callingContext","self","TypeError","bound","concat","partial","boundArgs","position","bindAll","Error","memoize","hasher","cache","address","delay","wait","setTimeout","defer","throttle","options","timeout","previous","later","leading","now","remaining","clearTimeout","trailing","debounce","immediate","timestamp","callNow","wrap","wrapper","compose","after","times","before","once","hasEnumBug","propertyIsEnumerable","allKeys","mapObject","pairs","invert","functions","methods","names","extend","extendOwn","assign","pick","oiteratee","omit","String","defaults","clone","tap","interceptor","isMatch","eq","aStack","bStack","className","areArrays","aCtor","bCtor","pop","isEqual","isEmpty","isString","isElement","nodeType","type","name","Int8Array","isFinite","parseFloat","isNumber","isNull","isUndefined","noConflict","constant","noop","propertyOf","matches","accum","Date","getTime","escapeMap","&","<",">","\"","'","`","unescapeMap","createEscaper","escaper","match","join","testRegexp","RegExp","replaceRegexp","string","test","replace","escape","unescape","fallback","idCounter","uniqueId","prefix","id","templateSettings","evaluate","interpolate","noMatch","escapes","\\","\r","\n","
","
","escapeChar","template","text","settings","oldSettings","offset","variable","render","e","data","argument","chain","instance","_chain","mixin","valueOf","toJSON","define","amd"],"mappings":";;;;CAKC,WAoKC,QAASA,GAAaC,GAGpB,QAASC,GAASC,EAAKC,EAAUC,EAAMC,EAAMC,EAAOC,GAClD,KAAOD,GAAS,GAAaC,EAARD,EAAgBA,GAASN,EAAK,CACjD,GAAIQ,GAAaH,EAAOA,EAAKC,GAASA,CACtCF,GAAOD,EAASC,EAAMF,EAAIM,GAAaA,EAAYN,GAErD,MAAOE,GAGT,MAAO,UAASF,EAAKC,EAAUC,EAAMK,GACnCN,EAAWO,EAAWP,EAAUM,EAAS,EACzC,IAAIJ,IAAQM,EAAYT,IAAQU,EAAEP,KAAKH,GACnCK,GAAUF,GAAQH,GAAKK,OACvBD,EAAQN,EAAM,EAAI,EAAIO,EAAS,CAMnC,OAJIM,WAAUN,OAAS,IACrBH,EAAOF,EAAIG,EAAOA,EAAKC,GAASA,GAChCA,GAASN,GAEJC,EAASC,EAAKC,EAAUC,EAAMC,EAAMC,EAAOC,IA+btD,QAASO,GAAkBd,GACzB,MAAO,UAASe,EAAOC,EAAWP,GAChCO,EAAYC,EAAGD,EAAWP,EAG1B,KAFA,GAAIF,GAAkB,MAATQ,GAAiBA,EAAMR,OAChCD,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rEwE,EAAO3C,KAAM7B,MAKxBU,EAAEkE,MAAM,SAAU,OAAQ,SAAU,SAAS8L,GAC3C,GAAIhK,GAAS3E,EAAW2O,EACxBhQ,GAAEY,UAAUoP,GAAQ,WAClB,MAAOlM,GAAO3C,KAAM6E,EAAOhD,MAAM7B,KAAKkB,SAAUpC,eAKpDD,EAAEY,UAAU+B,MAAQ,WAClB,MAAOxB,MAAKkB,UAKdrC,EAAEY,UAAUqT,QAAUjU,EAAEY,UAAUsT,OAASlU,EAAEY,UAAU+B,MAEvD3C,EAAEY,UAAUe,SAAW,WACrB,MAAO,GAAKR,KAAKkB,UAUG,kBAAX8R,SAAyBA,OAAOC,KACzCD,OAAO,gBAAkB,WACvB,MAAOnU,OAGX4C,KAAKzB"} \ No newline at end of file
diff --git a/openecomp-be/tools/swagger-ui/o2c.html b/openecomp-be/tools/swagger-ui/o2c.html
new file mode 100644
index 0000000000..88e8bf114b
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/o2c.html
@@ -0,0 +1,20 @@
+<script>
+var qp = null;
+if(window.location.hash) {
+ qp = location.hash.substring(1);
+}
+else {
+ qp = location.search.substring(1);
+}
+qp = qp ? JSON.parse('{"' + qp.replace(/&/g, '","').replace(/=/g,'":"') + '"}',
+ function(key, value) {
+ return key===""?value:decodeURIComponent(value) }
+ ):{}
+
+if (window.opener.swaggerUi.tokenUrl)
+ window.opener.processOAuthCode(qp);
+else
+ window.opener.onOAuthComplete(qp);
+
+window.close();
+</script> \ No newline at end of file
diff --git a/openecomp-be/tools/swagger-ui/pom.xml b/openecomp-be/tools/swagger-ui/pom.xml
new file mode 100644
index 0000000000..26b315a445
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/pom.xml
@@ -0,0 +1,77 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>api-docs</artifactId>
+ <groupId>org.openecomp.sdc.onboarding</groupId>
+ <version>1.0-SNAPSHOT</version>
+
+ <properties>
+ <plugin.name>api-docs</plugin.name>
+ <package.dir>${basedir}/${plugin.name}</package.dir>
+ <rest.api.dir>${basedir}/../../api/openecomp-sdc-rest-webapp/onboarding-rest-war</rest.api.dir>
+ <api.json.file>api.json</api.json.file>
+ <api.html.file>api.html</api.html.file>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <version>2.4</version>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.4</version>
+ <executions>
+ <execution>
+ <id>default-jar</id>
+ <phase>none</phase>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy</id>
+ <phase>package</phase>
+ <configuration>
+ <tasks>
+ <echo message="Copy api json files"/>
+ <copy file="${rest.api.dir}/target/generated/swagger-ui/swagger.json" tofile="${basedir}/target/${api.json.file}"/>
+ <copy file="${rest.api.dir}/target/generated/swagger-ui/swagger.json" tofile="${package.dir}/${api.json.file}"/>
+ <copy file="${rest.api.dir}/target/generated/${api.html.file}" tofile="${package.dir}/${api.html.file}"/>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <descriptor>assembly/swagger.xml</descriptor>
+ <finalName>${plugin.name}</finalName>
+ <outputDirectory>${package.dir}</outputDirectory>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project> \ No newline at end of file
diff --git a/openecomp-be/tools/swagger-ui/swagger-ui.js b/openecomp-be/tools/swagger-ui/swagger-ui.js
new file mode 100644
index 0000000000..ec96773e55
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/swagger-ui.js
@@ -0,0 +1,32311 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * swagger-ui - Swagger UI is a dependency-free collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API
+ * @version v2.1.4
+ * @link http://swagger.io
+ * @license Apache-2.0
+ */
+(function(){this["Handlebars"] = this["Handlebars"] || {};
+this["Handlebars"]["templates"] = this["Handlebars"]["templates"] || {};
+this["Handlebars"]["templates"]["apikey_button_view"] = Handlebars.template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
+ var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
+ return "<!--div class='auth_button' id='apikey_button'><img class='auth_icon' alt='apply api key' src='images/apikey.jpeg'></div-->\n<div class='auth_container' id='apikey_container'>\n <div class='key_input_container'>\n <div class='auth_label'><label for='input_apiKey_entry'>"
+ + escapeExpression(((helper = (helper = helpers.keyName || (depth0 != null ? depth0.keyName : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"keyName","hash":{},"data":data}) : helper)))
+ + "</label></div>\n <input placeholder='api_key' class='auth_input' id='input_apiKey_entry' name='apiKey' type='text'/>\n <div class='auth_submit'><a class='auth_submit_button' id='apply_api_key' href='#' data-sw-translate>apply</a></div>\n </div>\n</div>\n";
+},"useData":true});
+this["Handlebars"]["templates"]["basic_auth_button_view"] = Handlebars.template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
+ return "<div class='auth_button' id='basic_auth_button'><img class='auth_icon' src='images/password.jpeg'></div>\n<div class='auth_container' id='basic_auth_container'>\n <div class='key_input_container'>\n <div class=\"auth_label\"><label for=\"input_username\" data-sw-translate>Username</label></div>\n <input placeholder=\"username\" class=\"auth_input\" id=\"input_username\" name=\"username\" type=\"text\"/>\n <div class=\"auth_label\"><label for=\"password\" data-sw-translate>Password</label></div>\n <input placeholder=\"password\" class=\"auth_input\" id=\"input_password\" name=\"password\" type=\"password\"/>\n <div class='auth_submit'><a class='auth_submit_button' id=\"apply_basic_auth\" href=\"#\">apply</a></div>\n </div>\n</div>\n\n";
+ },"useData":true});
+this["Handlebars"]["templates"]["content_type"] = Handlebars.template({"1":function(depth0,helpers,partials,data) {
+ var stack1, buffer = "";
+ stack1 = helpers.each.call(depth0, (depth0 != null ? depth0.produces : depth0), {"name":"each","hash":{},"fn":this.program(2, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer;
+},"2":function(depth0,helpers,partials,data) {
+ var stack1, lambda=this.lambda, buffer = " <option value=\"";
+ stack1 = lambda(depth0, depth0);
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "\">";
+ stack1 = lambda(depth0, depth0);
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + "</option>\n";
+},"4":function(depth0,helpers,partials,data) {
+ return " <option value=\"application/json\">application/json</option>\n";
+ },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
+ var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<label data-sw-translate for=\""
+ + escapeExpression(((helper = (helper = helpers.contentTypeId || (depth0 != null ? depth0.contentTypeId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"contentTypeId","hash":{},"data":data}) : helper)))
+ + "\">Response Content Type</label>\n<select name=\"contentType\" id=\""
+ + escapeExpression(((helper = (helper = helpers.contentTypeId || (depth0 != null ? depth0.contentTypeId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"contentTypeId","hash":{},"data":data}) : helper)))
+ + "\">\n";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.produces : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.program(4, data),"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + "</select>\n";
+},"useData":true});
+'use strict';
+
+
+$(function() {
+
+ // Helper function for vertically aligning DOM elements
+ // http://www.seodenver.com/simple-vertical-align-plugin-for-jquery/
+ $.fn.vAlign = function() {
+ return this.each(function(){
+ var ah = $(this).height();
+ var ph = $(this).parent().height();
+ var mh = (ph - ah) / 2;
+ $(this).css('margin-top', mh);
+ });
+ };
+
+ $.fn.stretchFormtasticInputWidthToParent = function() {
+ return this.each(function(){
+ var p_width = $(this).closest("form").innerWidth();
+ var p_padding = parseInt($(this).closest("form").css('padding-left') ,10) + parseInt($(this).closest('form').css('padding-right'), 10);
+ var this_padding = parseInt($(this).css('padding-left'), 10) + parseInt($(this).css('padding-right'), 10);
+ $(this).css('width', p_width - p_padding - this_padding);
+ });
+ };
+
+ $('form.formtastic li.string input, form.formtastic textarea').stretchFormtasticInputWidthToParent();
+
+ // Vertically center these paragraphs
+ // Parent may need a min-height for this to work..
+ $('ul.downplayed li div.content p').vAlign();
+
+ // When a sandbox form is submitted..
+ $("form.sandbox").submit(function(){
+
+ var error_free = true;
+
+ // Cycle through the forms required inputs
+ $(this).find("input.required").each(function() {
+
+ // Remove any existing error styles from the input
+ $(this).removeClass('error');
+
+ // Tack the error style on if the input is empty..
+ if ($(this).val() === '') {
+ $(this).addClass('error');
+ $(this).wiggle();
+ error_free = false;
+ }
+
+ });
+
+ return error_free;
+ });
+
+});
+
+function clippyCopiedCallback() {
+ $('#api_key_copied').fadeIn().delay(1000).fadeOut();
+
+ // var b = $("#clippy_tooltip_" + a);
+ // b.length != 0 && (b.attr("title", "copied!").trigger("tipsy.reload"), setTimeout(function() {
+ // b.attr("title", "copy to clipboard")
+ // },
+ // 500))
+}
+
+// Logging function that accounts for browsers that don't have window.console
+function log(){
+ log.history = log.history || [];
+ log.history.push(arguments);
+ if(this.console){
+ console.log( Array.prototype.slice.call(arguments)[0] );
+ }
+}
+
+// Handle browsers that do console incorrectly (IE9 and below, see http://stackoverflow.com/a/5539378/7913)
+if (Function.prototype.bind && console && typeof console.log === "object") {
+ [
+ "log","info","warn","error","assert","dir","clear","profile","profileEnd"
+ ].forEach(function (method) {
+ console[method] = this.bind(console[method], console);
+ }, Function.prototype.call);
+}
+
+window.Docs = {
+
+ shebang: function() {
+
+ // If shebang has an operation nickname in it..
+ // e.g. /docs/#!/words/get_search
+ var fragments = $.param.fragment().split('/');
+ fragments.shift(); // get rid of the bang
+
+ switch (fragments.length) {
+ case 1:
+ if (fragments[0].length > 0) { // prevent matching "#/"
+ // Expand all operations for the resource and scroll to it
+ var dom_id = 'resource_' + fragments[0];
+
+ Docs.expandEndpointListForResource(fragments[0]);
+ $("#"+dom_id).slideto({highlight: false});
+ }
+ break;
+ case 2:
+ // Refer to the endpoint DOM element, e.g. #words_get_search
+
+ // Expand Resource
+ Docs.expandEndpointListForResource(fragments[0]);
+ $("#"+dom_id).slideto({highlight: false});
+
+ // Expand operation
+ var li_dom_id = fragments.join('_');
+ var li_content_dom_id = li_dom_id + "_content";
+
+
+ Docs.expandOperation($('#'+li_content_dom_id));
+ $('#'+li_dom_id).slideto({highlight: false});
+ break;
+ }
+
+ },
+
+ toggleEndpointListForResource: function(resource) {
+ var elem = $('li#resource_' + Docs.escapeResourceName(resource) + ' ul.endpoints');
+ if (elem.is(':visible')) {
+ Docs.collapseEndpointListForResource(resource);
+ } else {
+ Docs.expandEndpointListForResource(resource);
+ }
+ },
+
+ // Expand resource
+ expandEndpointListForResource: function(resource) {
+ var resource = Docs.escapeResourceName(resource);
+ if (resource == '') {
+ $('.resource ul.endpoints').slideDown();
+ return;
+ }
+
+ $('li#resource_' + resource).addClass('active');
+
+ var elem = $('li#resource_' + resource + ' ul.endpoints');
+ elem.slideDown();
+ },
+
+ // Collapse resource and mark as explicitly closed
+ collapseEndpointListForResource: function(resource) {
+ var resource = Docs.escapeResourceName(resource);
+ if (resource == '') {
+ $('.resource ul.endpoints').slideUp();
+ return;
+ }
+
+ $('li#resource_' + resource).removeClass('active');
+
+ var elem = $('li#resource_' + resource + ' ul.endpoints');
+ elem.slideUp();
+ },
+
+ expandOperationsForResource: function(resource) {
+ // Make sure the resource container is open..
+ Docs.expandEndpointListForResource(resource);
+
+ if (resource == '') {
+ $('.resource ul.endpoints li.operation div.content').slideDown();
+ return;
+ }
+
+ $('li#resource_' + Docs.escapeResourceName(resource) + ' li.operation div.content').each(function() {
+ Docs.expandOperation($(this));
+ });
+ },
+
+ collapseOperationsForResource: function(resource) {
+ // Make sure the resource container is open..
+ Docs.expandEndpointListForResource(resource);
+
+ if (resource == '') {
+ $('.resource ul.endpoints li.operation div.content').slideUp();
+ return;
+ }
+
+ $('li#resource_' + Docs.escapeResourceName(resource) + ' li.operation div.content').each(function() {
+ Docs.collapseOperation($(this));
+ });
+ },
+
+ escapeResourceName: function(resource) {
+ return resource.replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]\^`{|}~]/g, "\\$&");
+ },
+
+ expandOperation: function(elem) {
+ elem.slideDown();
+ },
+
+ collapseOperation: function(elem) {
+ elem.slideUp();
+ }
+};
+
+'use strict';
+
+Handlebars.registerHelper('sanitize', function(html) {
+ // Strip the script tags from the html, and return it as a Handlebars.SafeString
+ html = html.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, '');
+ return new Handlebars.SafeString(html);
+});
+
+Handlebars.registerHelper('renderTextParam', function(param) {
+ var result, type = 'text', idAtt = '';
+ var isArray = param.type.toLowerCase() === 'array' || param.allowMultiple;
+ var defaultValue = isArray && Array.isArray(param.default) ? param.default.join('\n') : param.default;
+
+ var dataVendorExtensions = Object.keys(param).filter(function(property) {
+ // filter X-data- properties
+ return property.match(/^X-data-/i) !== null;
+ }).reduce(function(result, property) {
+ // remove X- from property name, so it results in html attributes like data-foo='bar'
+ return result += ' ' + property.substring(2, property.length) + '=\'' + param[property] + '\'';
+ }, '');
+
+ if (typeof defaultValue === 'undefined') {
+ defaultValue = '';
+ }
+
+ if(param.format && param.format === 'password') {
+ type = 'password';
+ }
+
+ if(param.valueId) {
+ idAtt = ' id=\'' + param.valueId + '\'';
+ }
+
+ if(isArray) {
+ result = '<textarea class=\'body-textarea' + (param.required ? ' required' : '') + '\' name=\'' + param.name + '\'' + idAtt + dataVendorExtensions;
+ result += ' placeholder=\'Provide multiple values in new lines' + (param.required ? ' (at least one required).' : '.') + '\'>';
+ result += defaultValue + '</textarea>';
+ } else {
+ var parameterClass = 'parameter';
+ if(param.required) {
+ parameterClass += ' required';
+ }
+ result = '<input class=\'' + parameterClass + '\' minlength=\'' + (param.required ? 1 : 0) + '\'';
+ result += ' name=\'' + param.name +'\' placeholder=\'' + (param.required ? '(required)' : '') + '\'' + idAtt + dataVendorExtensions;
+ result += ' type=\'' + type + '\' value=\'' + defaultValue + '\'/>';
+ }
+ return new Handlebars.SafeString(result);
+});
+
+this["Handlebars"]["templates"]["main"] = Handlebars.template({"1":function(depth0,helpers,partials,data) {
+ var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression, buffer = " <div class=\"info_title\">"
+ + escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.title : stack1), depth0))
+ + "</div>\n <div class=\"info_description markdown\">";
+ stack1 = lambda(((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.description : stack1), depth0);
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "</div>\n";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.externalDocs : depth0), {"name":"if","hash":{},"fn":this.program(2, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += " ";
+ stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.termsOfServiceUrl : stack1), {"name":"if","hash":{},"fn":this.program(4, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "\n ";
+ stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.name : stack1), {"name":"if","hash":{},"fn":this.program(6, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "\n ";
+ stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.url : stack1), {"name":"if","hash":{},"fn":this.program(8, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "\n ";
+ stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.email : stack1), {"name":"if","hash":{},"fn":this.program(10, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "\n ";
+ stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.license : stack1), {"name":"if","hash":{},"fn":this.program(12, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + "\n";
+},"2":function(depth0,helpers,partials,data) {
+ var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression;
+ return " <p>"
+ + escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.externalDocs : depth0)) != null ? stack1.description : stack1), depth0))
+ + "</p>\n <a href=\""
+ + escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.externalDocs : depth0)) != null ? stack1.url : stack1), depth0))
+ + "\" target=\"_blank\">"
+ + escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.externalDocs : depth0)) != null ? stack1.url : stack1), depth0))
+ + "</a>\n";
+},"4":function(depth0,helpers,partials,data) {
+ var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression;
+ return "<div class=\"info_tos\"><a href=\""
+ + escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.termsOfServiceUrl : stack1), depth0))
+ + "\" data-sw-translate>Terms of service</a></div>";
+},"6":function(depth0,helpers,partials,data) {
+ var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression;
+ return "<div class='info_name' data-sw-translate>Created by "
+ + escapeExpression(lambda(((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.name : stack1), depth0))
+ + "</div>";
+},"8":function(depth0,helpers,partials,data) {
+ var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression;
+ return "<div class='info_url' data-sw-translate>See more at <a href=\""
+ + escapeExpression(lambda(((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.url : stack1), depth0))
+ + "\">"
+ + escapeExpression(lambda(((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.url : stack1), depth0))
+ + "</a></div>";
+},"10":function(depth0,helpers,partials,data) {
+ var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression;
+ return "<div class='info_email'><a href=\"mailto:"
+ + escapeExpression(lambda(((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.email : stack1), depth0))
+ + "?subject="
+ + escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.title : stack1), depth0))
+ + "\" data-sw-translate>Contact the developer</a></div>";
+},"12":function(depth0,helpers,partials,data) {
+ var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression;
+ return "<div class='info_license'><a href='"
+ + escapeExpression(lambda(((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.license : stack1)) != null ? stack1.url : stack1), depth0))
+ + "'>"
+ + escapeExpression(lambda(((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.license : stack1)) != null ? stack1.name : stack1), depth0))
+ + "</a></div>";
+},"14":function(depth0,helpers,partials,data) {
+ var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression;
+ return " , <span style=\"font-variant: small-caps\" data-sw-translate>api version</span>: "
+ + escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.version : stack1), depth0))
+ + "\n ";
+},"16":function(depth0,helpers,partials,data) {
+ var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
+ return " <span style=\"float:right\"><a href=\""
+ + escapeExpression(((helper = (helper = helpers.validatorUrl || (depth0 != null ? depth0.validatorUrl : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"validatorUrl","hash":{},"data":data}) : helper)))
+ + "/debug?url="
+ + escapeExpression(((helper = (helper = helpers.url || (depth0 != null ? depth0.url : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"url","hash":{},"data":data}) : helper)))
+ + "\"><img id=\"validator\" src=\""
+ + escapeExpression(((helper = (helper = helpers.validatorUrl || (depth0 != null ? depth0.validatorUrl : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"validatorUrl","hash":{},"data":data}) : helper)))
+ + "?url="
+ + escapeExpression(((helper = (helper = helpers.url || (depth0 != null ? depth0.url : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"url","hash":{},"data":data}) : helper)))
+ + "\"></a>\n </span>\n";
+},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
+ var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<div class='info' id='api_info'>\n";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.info : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "</div>\n<div class='container' id='resources_container'>\n <ul id='resources'></ul>\n\n <div class=\"footer\">\n <h4 style=\"color: #999\">[ <span style=\"font-variant: small-caps\">base url</span>: "
+ + escapeExpression(((helper = (helper = helpers.basePath || (depth0 != null ? depth0.basePath : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"basePath","hash":{},"data":data}) : helper)))
+ + "\n";
+ stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.version : stack1), {"name":"if","hash":{},"fn":this.program(14, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "]\n";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.validatorUrl : depth0), {"name":"if","hash":{},"fn":this.program(16, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + " </h4>\n </div>\n</div>\n";
+},"useData":true});
+this["Handlebars"]["templates"]["operation"] = Handlebars.template({"1":function(depth0,helpers,partials,data) {
+ return "deprecated";
+ },"3":function(depth0,helpers,partials,data) {
+ return " <h4>Warning: Deprecated</h4>\n";
+ },"5":function(depth0,helpers,partials,data) {
+ var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, buffer = " <h4>Implementation Notes</h4>\n <div class=\"markdown\">";
+ stack1 = ((helper = (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"description","hash":{},"data":data}) : helper));
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + "</div>\n";
+},"7":function(depth0,helpers,partials,data) {
+ return " <div class=\"auth\">\n <span class=\"api-ic ic-error\">";
+ },"9":function(depth0,helpers,partials,data) {
+ var stack1, buffer = " <div class=\"api_information_panel\">\n";
+ stack1 = helpers.each.call(depth0, depth0, {"name":"each","hash":{},"fn":this.program(10, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + " </div>\n";
+},"10":function(depth0,helpers,partials,data) {
+ var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression, buffer = " <div title='";
+ stack1 = lambda((depth0 != null ? depth0.description : depth0), depth0);
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + "'>"
+ + escapeExpression(lambda((depth0 != null ? depth0.scope : depth0), depth0))
+ + "</div>\n";
+},"12":function(depth0,helpers,partials,data) {
+ return "</span></div>";
+ },"14":function(depth0,helpers,partials,data) {
+ return " <div class='access'>\n <span class=\"api-ic ic-off\" title=\"click to authenticate\"></span>\n </div>\n";
+ },"16":function(depth0,helpers,partials,data) {
+ var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
+ return " <h4><span data-sw-translate>Response Class</span> (<span data-sw-translate>Status</span> "
+ + escapeExpression(((helper = (helper = helpers.successCode || (depth0 != null ? depth0.successCode : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"successCode","hash":{},"data":data}) : helper)))
+ + ")</h4>\n <p><span class=\"model-signature\" /></p>\n <br/>\n <div class=\"response-content-type\" />\n";
+},"18":function(depth0,helpers,partials,data) {
+ return " <h4 data-sw-translate>Parameters</h4>\n <table class='fullwidth'>\n <thead>\n <tr>\n <th style=\"width: 100px; max-width: 100px\" data-sw-translate>Parameter</th>\n <th style=\"width: 310px; max-width: 310px\" data-sw-translate>Value</th>\n <th style=\"width: 200px; max-width: 200px\" data-sw-translate>Description</th>\n <th style=\"width: 100px; max-width: 100px\" data-sw-translate>Parameter Type</th>\n <th style=\"width: 220px; max-width: 230px\" data-sw-translate>Data Type</th>\n </tr>\n </thead>\n <tbody class=\"operation-params\">\n\n </tbody>\n </table>\n";
+ },"20":function(depth0,helpers,partials,data) {
+ return " <div style='margin:0;padding:0;display:inline'></div>\n <h4 data-sw-translate>Response Messages</h4>\n <table class='fullwidth'>\n <thead>\n <tr>\n <th data-sw-translate>HTTP Status Code</th>\n <th data-sw-translate>Reason</th>\n <th data-sw-translate>Response Model</th>\n <th data-sw-translate>Headers</th>\n </tr>\n </thead>\n <tbody class=\"operation-status\">\n\n </tbody>\n </table>\n";
+ },"22":function(depth0,helpers,partials,data) {
+ return "";
+},"24":function(depth0,helpers,partials,data) {
+ return " <div class='sandbox_header'>\n <input class='submit' type='button' value='Try it out!' data-sw-translate/>\n <a href='#' class='response_hider' style='display:none' data-sw-translate>Hide Response</a>\n <span class='response_throbber' style='display:none'></span>\n </div>\n";
+ },"26":function(depth0,helpers,partials,data) {
+ return " <h4 data-sw-translate>Request Headers</h4>\n <div class='block request_headers'></div>\n";
+ },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
+ var stack1, helper, options, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, blockHelperMissing=helpers.blockHelperMissing, buffer = "\n <ul class='operations' >\n <li class='"
+ + escapeExpression(((helper = (helper = helpers.method || (depth0 != null ? depth0.method : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"method","hash":{},"data":data}) : helper)))
+ + " operation' id='"
+ + escapeExpression(((helper = (helper = helpers.parentId || (depth0 != null ? depth0.parentId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"parentId","hash":{},"data":data}) : helper)))
+ + "_"
+ + escapeExpression(((helper = (helper = helpers.nickname || (depth0 != null ? depth0.nickname : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"nickname","hash":{},"data":data}) : helper)))
+ + "'>\n <div class='heading'>\n <h3>\n <span class='http_method'>\n <a href='#!/"
+ + escapeExpression(((helper = (helper = helpers.encodedParentId || (depth0 != null ? depth0.encodedParentId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"encodedParentId","hash":{},"data":data}) : helper)))
+ + "/"
+ + escapeExpression(((helper = (helper = helpers.nickname || (depth0 != null ? depth0.nickname : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"nickname","hash":{},"data":data}) : helper)))
+ + "' class=\"toggleOperation\">"
+ + escapeExpression(((helper = (helper = helpers.method || (depth0 != null ? depth0.method : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"method","hash":{},"data":data}) : helper)))
+ + "</a>\n </span>\n <span class='path'>\n <a href='#!/"
+ + escapeExpression(((helper = (helper = helpers.encodedParentId || (depth0 != null ? depth0.encodedParentId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"encodedParentId","hash":{},"data":data}) : helper)))
+ + "/"
+ + escapeExpression(((helper = (helper = helpers.nickname || (depth0 != null ? depth0.nickname : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"nickname","hash":{},"data":data}) : helper)))
+ + "' class=\"toggleOperation ";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.deprecated : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "\">"
+ + escapeExpression(((helper = (helper = helpers.path || (depth0 != null ? depth0.path : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"path","hash":{},"data":data}) : helper)))
+ + "</a>\n </span>\n </h3>\n <ul class='options'>\n <li>\n <a href='#!/"
+ + escapeExpression(((helper = (helper = helpers.encodedParentId || (depth0 != null ? depth0.encodedParentId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"encodedParentId","hash":{},"data":data}) : helper)))
+ + "/"
+ + escapeExpression(((helper = (helper = helpers.nickname || (depth0 != null ? depth0.nickname : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"nickname","hash":{},"data":data}) : helper)))
+ + "' class=\"toggleOperation\">";
+ stack1 = ((helper = (helper = helpers.summary || (depth0 != null ? depth0.summary : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"summary","hash":{},"data":data}) : helper));
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "</a>\n </li>\n </ul>\n </div>\n <div class='content' id='"
+ + escapeExpression(((helper = (helper = helpers.parentId || (depth0 != null ? depth0.parentId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"parentId","hash":{},"data":data}) : helper)))
+ + "_"
+ + escapeExpression(((helper = (helper = helpers.nickname || (depth0 != null ? depth0.nickname : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"nickname","hash":{},"data":data}) : helper)))
+ + "_content' style='display:none'>\n";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.deprecated : depth0), {"name":"if","hash":{},"fn":this.program(3, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.description : depth0), {"name":"if","hash":{},"fn":this.program(5, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ stack1 = ((helper = (helper = helpers.oauth || (depth0 != null ? depth0.oauth : depth0)) != null ? helper : helperMissing),(options={"name":"oauth","hash":{},"fn":this.program(7, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper));
+ if (!helpers.oauth) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "\n";
+ stack1 = helpers.each.call(depth0, (depth0 != null ? depth0.oauth : depth0), {"name":"each","hash":{},"fn":this.program(9, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += " ";
+ stack1 = ((helper = (helper = helpers.oauth || (depth0 != null ? depth0.oauth : depth0)) != null ? helper : helperMissing),(options={"name":"oauth","hash":{},"fn":this.program(12, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper));
+ if (!helpers.oauth) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "\n";
+ stack1 = ((helper = (helper = helpers.oauth || (depth0 != null ? depth0.oauth : depth0)) != null ? helper : helperMissing),(options={"name":"oauth","hash":{},"fn":this.program(14, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper));
+ if (!helpers.oauth) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
+ if (stack1 != null) { buffer += stack1; }
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.type : depth0), {"name":"if","hash":{},"fn":this.program(16, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += " <form accept-charset='UTF-8' class='sandbox'>\n <div style='margin:0;padding:0;display:inline'></div>\n";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.parameters : depth0), {"name":"if","hash":{},"fn":this.program(18, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.responseMessages : depth0), {"name":"if","hash":{},"fn":this.program(20, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isReadOnly : depth0), {"name":"if","hash":{},"fn":this.program(22, data),"inverse":this.program(24, data),"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += " </form>\n <div class='response' style='display:none'>\n <h4>Curl</h4>\n <div class='block curl'></div>\n <h4 data-sw-translate>Request URL</h4>\n <div class='block request_url'></div>\n";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.showRequestHeaders : depth0), {"name":"if","hash":{},"fn":this.program(26, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + " <h4 data-sw-translate>Response Body</h4>\n <div class='block response_body'></div>\n <h4 data-sw-translate>Response Code</h4>\n <div class='block response_code'></div>\n <h4 data-sw-translate>Response Headers</h4>\n <div class='block response_headers'></div>\n </div>\n </div>\n </li>\n </ul>\n";
+},"useData":true});
+this["Handlebars"]["templates"]["param_list"] = Handlebars.template({"1":function(depth0,helpers,partials,data) {
+ return " required";
+ },"3":function(depth0,helpers,partials,data) {
+ return " multiple=\"multiple\"";
+ },"5":function(depth0,helpers,partials,data) {
+ return " required ";
+ },"7":function(depth0,helpers,partials,data) {
+ var stack1, buffer = " <option ";
+ stack1 = helpers.unless.call(depth0, (depth0 != null ? depth0.hasDefault : depth0), {"name":"unless","hash":{},"fn":this.program(8, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + " value=''></option>\n";
+},"8":function(depth0,helpers,partials,data) {
+ return " selected=\"\" ";
+ },"10":function(depth0,helpers,partials,data) {
+ var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "\n <option ";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isDefault : depth0), {"name":"if","hash":{},"fn":this.program(11, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += " value='"
+ + escapeExpression(((helper = (helper = helpers.value || (depth0 != null ? depth0.value : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"value","hash":{},"data":data}) : helper)))
+ + "'> "
+ + escapeExpression(((helper = (helper = helpers.value || (depth0 != null ? depth0.value : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"value","hash":{},"data":data}) : helper)))
+ + " ";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isDefault : depth0), {"name":"if","hash":{},"fn":this.program(13, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + " </option>\n\n";
+},"11":function(depth0,helpers,partials,data) {
+ return " selected=\"\" ";
+ },"13":function(depth0,helpers,partials,data) {
+ return " (default) ";
+ },"15":function(depth0,helpers,partials,data) {
+ return "<strong>";
+ },"17":function(depth0,helpers,partials,data) {
+ return "</strong>";
+ },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
+ var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<td class='code";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.required : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "'><label for='"
+ + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper)))
+ + "'>"
+ + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
+ + "</label></td>\n<td>\n <select ";
+ stack1 = ((helpers.isArray || (depth0 && depth0.isArray) || helperMissing).call(depth0, depth0, {"name":"isArray","hash":{},"fn":this.program(3, data),"inverse":this.noop,"data":data}));
+ if (stack1 != null) { buffer += stack1; }
+ buffer += " class=\"parameter ";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.required : depth0), {"name":"if","hash":{},"fn":this.program(5, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "\" name=\""
+ + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
+ + "\" id=\""
+ + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper)))
+ + "\">\n\n";
+ stack1 = helpers.unless.call(depth0, (depth0 != null ? depth0.required : depth0), {"name":"unless","hash":{},"fn":this.program(7, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "\n";
+ stack1 = helpers.each.call(depth0, ((stack1 = (depth0 != null ? depth0.allowableValues : depth0)) != null ? stack1.descriptiveValues : stack1), {"name":"each","hash":{},"fn":this.program(10, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "\n </select>\n</td>\n<td class=\"markdown\">";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.required : depth0), {"name":"if","hash":{},"fn":this.program(15, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ stack1 = ((helper = (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"description","hash":{},"data":data}) : helper));
+ if (stack1 != null) { buffer += stack1; }
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.required : depth0), {"name":"if","hash":{},"fn":this.program(17, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "</td>\n<td>";
+ stack1 = ((helper = (helper = helpers.paramType || (depth0 != null ? depth0.paramType : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"paramType","hash":{},"data":data}) : helper));
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + "</td>\n<td><span class=\"model-signature\"></span></td>\n";
+},"useData":true});
+this["Handlebars"]["templates"]["param_readonly_required"] = Handlebars.template({"1":function(depth0,helpers,partials,data) {
+ var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
+ return " <textarea class='body-textarea' readonly='readonly' placeholder='(required)' name='"
+ + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
+ + "' id='"
+ + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper)))
+ + "'>"
+ + escapeExpression(((helper = (helper = helpers['default'] || (depth0 != null ? depth0['default'] : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"default","hash":{},"data":data}) : helper)))
+ + "</textarea>\n";
+},"3":function(depth0,helpers,partials,data) {
+ var stack1, buffer = "";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0['default'] : depth0), {"name":"if","hash":{},"fn":this.program(4, data),"inverse":this.program(6, data),"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer;
+},"4":function(depth0,helpers,partials,data) {
+ var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
+ return " "
+ + escapeExpression(((helper = (helper = helpers['default'] || (depth0 != null ? depth0['default'] : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"default","hash":{},"data":data}) : helper)))
+ + "\n";
+},"6":function(depth0,helpers,partials,data) {
+ return " (empty)\n";
+ },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
+ var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<td class='code required'><label for='"
+ + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper)))
+ + "'>"
+ + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
+ + "</label></td>\n<td>\n";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isBody : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.program(3, data),"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "</td>\n<td class=\"markdown\">";
+ stack1 = ((helper = (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"description","hash":{},"data":data}) : helper));
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "</td>\n<td>";
+ stack1 = ((helper = (helper = helpers.paramType || (depth0 != null ? depth0.paramType : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"paramType","hash":{},"data":data}) : helper));
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + "</td>\n<td><span class=\"model-signature\"></span></td>\n";
+},"useData":true});
+this["Handlebars"]["templates"]["param_readonly"] = Handlebars.template({"1":function(depth0,helpers,partials,data) {
+ var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
+ return " <textarea class='body-textarea' readonly='readonly' name='"
+ + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
+ + "' id='"
+ + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper)))
+ + "'>"
+ + escapeExpression(((helper = (helper = helpers['default'] || (depth0 != null ? depth0['default'] : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"default","hash":{},"data":data}) : helper)))
+ + "</textarea>\n";
+},"3":function(depth0,helpers,partials,data) {
+ var stack1, buffer = "";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0['default'] : depth0), {"name":"if","hash":{},"fn":this.program(4, data),"inverse":this.program(6, data),"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer;
+},"4":function(depth0,helpers,partials,data) {
+ var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
+ return " "
+ + escapeExpression(((helper = (helper = helpers['default'] || (depth0 != null ? depth0['default'] : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"default","hash":{},"data":data}) : helper)))
+ + "\n";
+},"6":function(depth0,helpers,partials,data) {
+ return " (empty)\n";
+ },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
+ var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<td class='code'><label for='"
+ + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper)))
+ + "'>"
+ + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
+ + "</label></td>\n<td>\n";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isBody : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.program(3, data),"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "</td>\n<td class=\"markdown\">";
+ stack1 = ((helper = (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"description","hash":{},"data":data}) : helper));
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "</td>\n<td>";
+ stack1 = ((helper = (helper = helpers.paramType || (depth0 != null ? depth0.paramType : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"paramType","hash":{},"data":data}) : helper));
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + "</td>\n<td><span class=\"model-signature\"></span></td>\n";
+},"useData":true});
+this["Handlebars"]["templates"]["param_required"] = Handlebars.template({"1":function(depth0,helpers,partials,data) {
+ var stack1, buffer = "";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isFile : depth0), {"name":"if","hash":{},"fn":this.program(2, data),"inverse":this.program(4, data),"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer;
+},"2":function(depth0,helpers,partials,data) {
+ var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
+ return " <input type=\"file\" name='"
+ + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
+ + "' id='"
+ + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper)))
+ + "'/>\n";
+},"4":function(depth0,helpers,partials,data) {
+ var stack1, buffer = "";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0['default'] : depth0), {"name":"if","hash":{},"fn":this.program(5, data),"inverse":this.program(7, data),"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer;
+},"5":function(depth0,helpers,partials,data) {
+ var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
+ return " <textarea class='body-textarea required' placeholder='(required)' name='"
+ + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
+ + "' id=\""
+ + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper)))
+ + "\">"
+ + escapeExpression(((helper = (helper = helpers['default'] || (depth0 != null ? depth0['default'] : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"default","hash":{},"data":data}) : helper)))
+ + "</textarea>\n <br />\n <div class=\"parameter-content-type\" />\n";
+},"7":function(depth0,helpers,partials,data) {
+ var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
+ return " <textarea class='body-textarea required' placeholder='(required)' name='"
+ + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
+ + "' id='"
+ + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper)))
+ + "'></textarea>\n <br />\n <div class=\"parameter-content-type\" />\n";
+},"9":function(depth0,helpers,partials,data) {
+ var stack1, buffer = "";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isFile : depth0), {"name":"if","hash":{},"fn":this.program(10, data),"inverse":this.program(12, data),"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer;
+},"10":function(depth0,helpers,partials,data) {
+ var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
+ return " <input class='parameter' class='required' type='file' name='"
+ + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
+ + "' id='"
+ + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper)))
+ + "'/>\n";
+},"12":function(depth0,helpers,partials,data) {
+ var stack1, helperMissing=helpers.helperMissing, buffer = "";
+ stack1 = ((helpers.renderTextParam || (depth0 && depth0.renderTextParam) || helperMissing).call(depth0, depth0, {"name":"renderTextParam","hash":{},"fn":this.program(13, data),"inverse":this.noop,"data":data}));
+ if (stack1 != null) { buffer += stack1; }
+ return buffer;
+},"13":function(depth0,helpers,partials,data) {
+ return "";
+},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
+ var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<td class='code required'><label for='"
+ + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper)))
+ + "'>"
+ + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
+ + "</label></td>\n<td>\n";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isBody : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.program(9, data),"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "</td>\n<td>\n <strong><span class=\"markdown\">";
+ stack1 = ((helper = (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"description","hash":{},"data":data}) : helper));
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "</span></strong>\n</td>\n<td>";
+ stack1 = ((helper = (helper = helpers.paramType || (depth0 != null ? depth0.paramType : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"paramType","hash":{},"data":data}) : helper));
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + "</td>\n<td><span class=\"model-signature\"></span></td>\n";
+},"useData":true});
+this["Handlebars"]["templates"]["param"] = Handlebars.template({"1":function(depth0,helpers,partials,data) {
+ var stack1, buffer = "";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isFile : depth0), {"name":"if","hash":{},"fn":this.program(2, data),"inverse":this.program(4, data),"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer;
+},"2":function(depth0,helpers,partials,data) {
+ var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
+ return " <input type=\"file\" name='"
+ + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
+ + "' id='"
+ + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper)))
+ + "'/>\n <div class=\"parameter-content-type\" />\n";
+},"4":function(depth0,helpers,partials,data) {
+ var stack1, buffer = "";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0['default'] : depth0), {"name":"if","hash":{},"fn":this.program(5, data),"inverse":this.program(7, data),"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer;
+},"5":function(depth0,helpers,partials,data) {
+ var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
+ return " <textarea class='body-textarea' name='"
+ + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
+ + "' id='"
+ + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper)))
+ + "'>"
+ + escapeExpression(((helper = (helper = helpers['default'] || (depth0 != null ? depth0['default'] : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"default","hash":{},"data":data}) : helper)))
+ + "</textarea>\n <br />\n <div class=\"parameter-content-type\" />\n";
+},"7":function(depth0,helpers,partials,data) {
+ var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
+ return " <textarea class='body-textarea' name='"
+ + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
+ + "' id='"
+ + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper)))
+ + "'></textarea>\n <br />\n <div class=\"parameter-content-type\" />\n";
+},"9":function(depth0,helpers,partials,data) {
+ var stack1, buffer = "";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isFile : depth0), {"name":"if","hash":{},"fn":this.program(2, data),"inverse":this.program(10, data),"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer;
+},"10":function(depth0,helpers,partials,data) {
+ var stack1, helperMissing=helpers.helperMissing, buffer = "";
+ stack1 = ((helpers.renderTextParam || (depth0 && depth0.renderTextParam) || helperMissing).call(depth0, depth0, {"name":"renderTextParam","hash":{},"fn":this.program(11, data),"inverse":this.noop,"data":data}));
+ if (stack1 != null) { buffer += stack1; }
+ return buffer;
+},"11":function(depth0,helpers,partials,data) {
+ return "";
+},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
+ var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<td class='code'><label for='"
+ + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper)))
+ + "'>"
+ + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
+ + "</label></td>\n<td>\n\n";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isBody : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.program(9, data),"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "\n</td>\n<td class=\"markdown\">";
+ stack1 = ((helper = (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"description","hash":{},"data":data}) : helper));
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "</td>\n<td>";
+ stack1 = ((helper = (helper = helpers.paramType || (depth0 != null ? depth0.paramType : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"paramType","hash":{},"data":data}) : helper));
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + "</td>\n<td>\n <span class=\"model-signature\"></span>\n</td>\n";
+},"useData":true});
+this["Handlebars"]["templates"]["parameter_content_type"] = Handlebars.template({"1":function(depth0,helpers,partials,data) {
+ var stack1, buffer = "";
+ stack1 = helpers.each.call(depth0, (depth0 != null ? depth0.consumes : depth0), {"name":"each","hash":{},"fn":this.program(2, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer;
+},"2":function(depth0,helpers,partials,data) {
+ var stack1, lambda=this.lambda, buffer = " <option value=\"";
+ stack1 = lambda(depth0, depth0);
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "\">";
+ stack1 = lambda(depth0, depth0);
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + "</option>\n";
+},"4":function(depth0,helpers,partials,data) {
+ return " <option value=\"application/json\">application/json</option>\n";
+ },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
+ var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<label for=\""
+ + escapeExpression(((helper = (helper = helpers.parameterContentTypeId || (depth0 != null ? depth0.parameterContentTypeId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"parameterContentTypeId","hash":{},"data":data}) : helper)))
+ + "\">Parameter content type:</label>\n<select name=\"parameterContentType\" id=\""
+ + escapeExpression(((helper = (helper = helpers.parameterContentTypeId || (depth0 != null ? depth0.parameterContentTypeId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"parameterContentTypeId","hash":{},"data":data}) : helper)))
+ + "\">\n";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.consumes : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.program(4, data),"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + "</select>\n";
+},"useData":true});
+this["Handlebars"]["templates"]["resource"] = Handlebars.template({"1":function(depth0,helpers,partials,data) {
+ return " : ";
+ },"3":function(depth0,helpers,partials,data) {
+ var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
+ return " <li>\n <a href='"
+ + escapeExpression(((helper = (helper = helpers.url || (depth0 != null ? depth0.url : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"url","hash":{},"data":data}) : helper)))
+ + "' data-sw-translate>Raw</a>\n </li>\n";
+},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
+ var stack1, helper, options, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, blockHelperMissing=helpers.blockHelperMissing, buffer = "<div class='heading'>\n <h2>\n <a href='#!/"
+ + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper)))
+ + "' class=\"toggleEndpointList\" data-id=\""
+ + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper)))
+ + "\">"
+ + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
+ + "</a> ";
+ stack1 = ((helper = (helper = helpers.summary || (depth0 != null ? depth0.summary : depth0)) != null ? helper : helperMissing),(options={"name":"summary","hash":{},"fn":this.program(1, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper));
+ if (!helpers.summary) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
+ if (stack1 != null) { buffer += stack1; }
+ stack1 = ((helper = (helper = helpers.summary || (depth0 != null ? depth0.summary : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"summary","hash":{},"data":data}) : helper));
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "\n </h2>\n <ul class='options'>\n <li>\n <a href='#!/"
+ + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper)))
+ + "' id='endpointListTogger_"
+ + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper)))
+ + "' class=\"toggleEndpointList\" data-id=\""
+ + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper)))
+ + "\" data-sw-translate>Show/Hide</a>\n </li>\n <li>\n <a href='#' class=\"collapseResource\" data-id=\""
+ + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper)))
+ + "\" data-sw-translate>\n List Operations\n </a>\n </li>\n <li>\n <a href='#' class=\"expandResource\" data-id=\""
+ + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper)))
+ + "\" data-sw-translate>\n Expand Operations\n </a>\n </li>\n";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.url : depth0), {"name":"if","hash":{},"fn":this.program(3, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + " </ul>\n</div>\n<ul class='endpoints' id='"
+ + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper)))
+ + "_endpoint_list' style='display:none'>\n\n</ul>\n";
+},"useData":true});
+this["Handlebars"]["templates"]["response_content_type"] = Handlebars.template({"1":function(depth0,helpers,partials,data) {
+ var stack1, buffer = "";
+ stack1 = helpers.each.call(depth0, (depth0 != null ? depth0.produces : depth0), {"name":"each","hash":{},"fn":this.program(2, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer;
+},"2":function(depth0,helpers,partials,data) {
+ var stack1, lambda=this.lambda, buffer = " <option value=\"";
+ stack1 = lambda(depth0, depth0);
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "\">";
+ stack1 = lambda(depth0, depth0);
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + "</option>\n";
+},"4":function(depth0,helpers,partials,data) {
+ return " <option value=\"application/json\">application/json</option>\n";
+ },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
+ var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<label data-sw-translate for=\""
+ + escapeExpression(((helper = (helper = helpers.responseContentTypeId || (depth0 != null ? depth0.responseContentTypeId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"responseContentTypeId","hash":{},"data":data}) : helper)))
+ + "\">Response Content Type</label>\n<select name=\"responseContentType\" id=\""
+ + escapeExpression(((helper = (helper = helpers.responseContentTypeId || (depth0 != null ? depth0.responseContentTypeId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"responseContentTypeId","hash":{},"data":data}) : helper)))
+ + "\">\n";
+ stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.produces : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.program(4, data),"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + "</select>\n";
+},"useData":true});
+this["Handlebars"]["templates"]["signature"] = Handlebars.template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
+ var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<div>\n<ul class=\"signature-nav\">\n <li><a class=\"description-link\" href=\"#\" data-sw-translate>Model</a></li>\n <li><a class=\"snippet-link\" href=\"#\" data-sw-translate>Model Schema</a></li>\n</ul>\n<div>\n\n<div class=\"signature-container\">\n <div class=\"description\">\n ";
+ stack1 = ((helper = (helper = helpers.signature || (depth0 != null ? depth0.signature : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"signature","hash":{},"data":data}) : helper));
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + "\n </div>\n\n <div class=\"snippet\">\n <pre><code>"
+ + escapeExpression(((helper = (helper = helpers.sampleJSON || (depth0 != null ? depth0.sampleJSON : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"sampleJSON","hash":{},"data":data}) : helper)))
+ + "</code></pre>\n <small class=\"notice\"></small>\n </div>\n</div>\n\n";
+},"useData":true});
+this["Handlebars"]["templates"]["status_code"] = Handlebars.template({"1":function(depth0,helpers,partials,data) {
+ var lambda=this.lambda, escapeExpression=this.escapeExpression;
+ return " <tr>\n <td>"
+ + escapeExpression(lambda((data && data.key), depth0))
+ + "</td>\n <td>"
+ + escapeExpression(lambda((depth0 != null ? depth0.description : depth0), depth0))
+ + "</td>\n <td>"
+ + escapeExpression(lambda((depth0 != null ? depth0.type : depth0), depth0))
+ + "</td>\n </tr>\n";
+},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
+ var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<td width='15%' class='code'>"
+ + escapeExpression(((helper = (helper = helpers.code || (depth0 != null ? depth0.code : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"code","hash":{},"data":data}) : helper)))
+ + "</td>\n<td class=\"markdown\">";
+ stack1 = ((helper = (helper = helpers.message || (depth0 != null ? depth0.message : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"message","hash":{},"data":data}) : helper));
+ if (stack1 != null) { buffer += stack1; }
+ buffer += "</td>\n<td width='50%'><span class=\"model-signature\" /></td>\n<td class=\"headers\">\n <table>\n <tbody>\n";
+ stack1 = helpers.each.call(depth0, (depth0 != null ? depth0.headers : depth0), {"name":"each","hash":{},"fn":this.program(1, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + " </tbody>\n </table>\n</td>";
+},"useData":true});
+/**
+ * swagger-client - swagger-client is a javascript client for use with swaggering APIs.
+ * @version v2.1.6
+ * @link http://swagger.io
+ * @license Apache-2.0
+ */
+(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.SwaggerClient = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
+'use strict';
+
+var auth = require('./lib/auth');
+var helpers = require('./lib/helpers');
+var SwaggerClient = require('./lib/client');
+var deprecationWrapper = function (url, options) {
+ helpers.log('This is deprecated, use "new SwaggerClient" instead.');
+
+ return new SwaggerClient(url, options);
+};
+
+/* Here for IE8 Support */
+if (!Array.prototype.indexOf) {
+ Array.prototype.indexOf = function(obj, start) {
+ for (var i = (start || 0), j = this.length; i < j; i++) {
+ if (this[i] === obj) { return i; }
+ }
+ return -1;
+ };
+}
+
+/* Here for IE8 Support */
+if (!String.prototype.trim) {
+ String.prototype.trim = function () {
+ return this.replace(/^\s+|\s+$/g, '');
+ };
+}
+
+/* Here for node 10.x support */
+if (!String.prototype.endsWith) {
+ String.prototype.endsWith = function(suffix) {
+ return this.indexOf(suffix, this.length - suffix.length) !== -1;
+ };
+}
+
+module.exports = SwaggerClient;
+
+SwaggerClient.ApiKeyAuthorization = auth.ApiKeyAuthorization;
+SwaggerClient.PasswordAuthorization = auth.PasswordAuthorization;
+SwaggerClient.CookieAuthorization = auth.CookieAuthorization;
+SwaggerClient.SwaggerApi = deprecationWrapper;
+SwaggerClient.SwaggerClient = deprecationWrapper;
+SwaggerClient.SchemaMarkup = require('./lib/schema-markup');
+
+},{"./lib/auth":2,"./lib/client":3,"./lib/helpers":4,"./lib/schema-markup":7}],2:[function(require,module,exports){
+'use strict';
+
+var helpers = require('./helpers');
+var btoa = require('btoa'); // jshint ignore:line
+var CookieJar = require('cookiejar');
+var _ = {
+ each: require('lodash-compat/collection/each'),
+ includes: require('lodash-compat/collection/includes'),
+ isObject: require('lodash-compat/lang/isObject'),
+ isArray: require('lodash-compat/lang/isArray')
+};
+
+/**
+ * SwaggerAuthorizations applys the correct authorization to an operation being executed
+ */
+var SwaggerAuthorizations = module.exports.SwaggerAuthorizations = function (authz) {
+ this.authz = authz || {};
+};
+
+/**
+ * Add auths to the hash
+ * Will overwrite any existing
+ *
+ */
+SwaggerAuthorizations.prototype.add = function (name, auth) {
+ if(_.isObject(name)) {
+ for (var key in name) {
+ this.authz[key] = name[key];
+ }
+ } else if(typeof name === 'string' ){
+ this.authz[name] = auth;
+ }
+
+ return auth;
+};
+
+SwaggerAuthorizations.prototype.remove = function (name) {
+ return delete this.authz[name];
+};
+
+SwaggerAuthorizations.prototype.apply = function (obj, securities) {
+ var status = true;
+ var applyAll = !securities;
+ var flattenedSecurities = [];
+
+ // Securities could be [ {} ]
+ _.each(securities, function (obj, key) {
+
+ // Make sure we account for securities being [ str ]
+ if(typeof key === 'string') {
+ flattenedSecurities.push(key);
+ }
+
+ // Flatten keys in to our array
+ _.each(obj, function (val, key) {
+ flattenedSecurities.push(key);
+ });
+ });
+
+ _.each(this.authz, function (auth, authName) {
+ if(applyAll || _.includes(flattenedSecurities, authName)) {
+ var newStatus = auth.apply(obj);
+ status = status && !!newStatus; // logical ORs regarding status
+ }
+ });
+
+ return status;
+};
+
+/**
+ * ApiKeyAuthorization allows a query param or header to be injected
+ */
+var ApiKeyAuthorization = module.exports.ApiKeyAuthorization = function (name, value, type) {
+ this.name = name;
+ this.value = value;
+ this.type = type;
+};
+
+ApiKeyAuthorization.prototype.apply = function (obj) {
+ if (this.type === 'query') {
+ if (obj.url.indexOf('?') > 0) {
+ obj.url = obj.url + '&' + this.name + '=' + this.value;
+ } else {
+ obj.url = obj.url + '?' + this.name + '=' + this.value;
+ }
+
+ return true;
+ } else if (this.type === 'header') {
+ if(typeof obj.headers[this.name] === 'undefined') {
+ obj.headers[this.name] = this.value;
+ }
+
+ return true;
+ }
+};
+
+var CookieAuthorization = module.exports.CookieAuthorization = function (cookie) {
+ this.cookie = cookie;
+};
+
+CookieAuthorization.prototype.apply = function (obj) {
+ obj.cookieJar = obj.cookieJar || new CookieJar();
+ obj.cookieJar.setCookie(this.cookie);
+
+ return true;
+};
+
+/**
+ * Password Authorization is a basic auth implementation
+ */
+var PasswordAuthorization = module.exports.PasswordAuthorization = function (username, password) {
+ if (arguments.length === 3) {
+ helpers.log('PasswordAuthorization: the \'name\' argument has been removed, pass only username and password');
+ username = arguments[1];
+ password = arguments[2];
+ }
+ this.username = username;
+ this.password = password;
+};
+
+PasswordAuthorization.prototype.apply = function (obj) {
+ if(typeof obj.headers.Authorization === 'undefined') {
+ obj.headers.Authorization = 'Basic ' + btoa(this.username + ':' + this.password);
+ }
+
+ return true;
+};
+
+},{"./helpers":4,"btoa":18,"cookiejar":19,"lodash-compat/collection/each":55,"lodash-compat/collection/includes":58,"lodash-compat/lang/isArray":143,"lodash-compat/lang/isObject":147}],3:[function(require,module,exports){
+'use strict';
+
+var _ = {
+ bind: require('lodash-compat/function/bind'),
+ cloneDeep: require('lodash-compat/lang/cloneDeep'),
+ find: require('lodash-compat/collection/find'),
+ forEach: require('lodash-compat/collection/forEach'),
+ indexOf: require('lodash-compat/array/indexOf'),
+ isArray: require('lodash-compat/lang/isArray'),
+ isObject: require('lodash-compat/lang/isObject'),
+ isFunction: require('lodash-compat/lang/isFunction'),
+ isPlainObject: require('lodash-compat/lang/isPlainObject'),
+ isUndefined: require('lodash-compat/lang/isUndefined')
+};
+var auth = require('./auth');
+var helpers = require('./helpers');
+var Model = require('./types/model');
+var Operation = require('./types/operation');
+var OperationGroup = require('./types/operationGroup');
+var Resolver = require('./resolver');
+var SwaggerHttp = require('./http');
+var SwaggerSpecConverter = require('./spec-converter');
+
+// We have to keep track of the function/property names to avoid collisions for tag names which are used to allow the
+// following usage: 'client.{tagName}'
+var reservedClientTags = [
+ 'apis',
+ 'authorizationScheme',
+ 'authorizations',
+ 'basePath',
+ 'build',
+ 'buildFrom1_1Spec',
+ 'buildFrom1_2Spec',
+ 'buildFromSpec',
+ 'clientAuthorizations',
+ 'convertInfo',
+ 'debug',
+ 'defaultErrorCallback',
+ 'defaultSuccessCallback',
+ 'fail',
+ 'failure',
+ 'finish',
+ 'help',
+ 'idFromOp',
+ 'info',
+ 'initialize',
+ 'isBuilt',
+ 'isValid',
+ 'modelPropertyMacro',
+ 'models',
+ 'modelsArray',
+ 'options',
+ 'parameterMacro',
+ 'parseUri',
+ 'progress',
+ 'resourceCount',
+ 'sampleModels',
+ 'selfReflect',
+ 'setConsolidatedModels',
+ 'spec',
+ 'supportedSubmitMethods',
+ 'swaggerRequestHeaders',
+ 'tagFromLabel',
+ 'title',
+ 'url',
+ 'useJQuery'
+];
+// We have to keep track of the function/property names to avoid collisions for tag names which are used to allow the
+// following usage: 'client.apis.{tagName}'
+var reservedApiTags = [
+ 'apis',
+ 'asCurl',
+ 'description',
+ 'externalDocs',
+ 'help',
+ 'label',
+ 'name',
+ 'operation',
+ 'operations',
+ 'operationsArray',
+ 'path',
+ 'tag'
+];
+var supportedOperationMethods = ['delete', 'get', 'head', 'options', 'patch', 'post', 'put'];
+var SwaggerClient = module.exports = function (url, options) {
+ this.authorizations = null;
+ this.authorizationScheme = null;
+ this.basePath = null;
+ this.debug = false;
+ this.info = null;
+ this.isBuilt = false;
+ this.isValid = false;
+ this.modelsArray = [];
+ this.resourceCount = 0;
+ this.url = null;
+ this.useJQuery = false;
+ this.swaggerObject = {};
+
+ this.clientAuthorizations = new auth.SwaggerAuthorizations();
+
+ if (typeof url !== 'undefined') {
+ return this.initialize(url, options);
+ } else {
+ return this;
+ }
+};
+
+SwaggerClient.prototype.initialize = function (url, options) {
+ this.models = {};
+ this.sampleModels = {};
+
+ if (typeof url === 'string') {
+ this.url = url;
+ } else if (_.isObject(url)) {
+ options = url;
+ this.url = options.url;
+ }
+
+ options = options || {};
+ this.clientAuthorizations.add(options.authorizations);
+ this.swaggerRequestHeaders = options.swaggerRequestHeaders || 'application/json;charset=utf-8,*/*';
+ this.defaultSuccessCallback = options.defaultSuccessCallback || null;
+ this.defaultErrorCallback = options.defaultErrorCallback || null;
+ this.modelPropertyMacro = options.modelPropertyMacro || null;
+ this.parameterMacro = options.parameterMacro || null;
+
+ if (typeof options.success === 'function') {
+ this.success = options.success;
+ }
+
+ if (options.useJQuery) {
+ this.useJQuery = options.useJQuery;
+ }
+
+ this.options = options || {};
+
+ this.supportedSubmitMethods = options.supportedSubmitMethods || [];
+ this.failure = options.failure || function () {};
+ this.progress = options.progress || function () {};
+ this.spec = _.cloneDeep(options.spec); // Clone so we do not alter the provided document
+
+ if (options.scheme) {
+ this.scheme = options.scheme;
+ }
+
+ if (typeof options.success === 'function') {
+ this.ready = true;
+ this.build();
+ }
+};
+
+SwaggerClient.prototype.build = function (mock) {
+ if (this.isBuilt) {
+ return this;
+ }
+
+ var self = this;
+
+ this.progress('fetching resource list: ' + this.url + '; Please wait.');
+
+ var obj = {
+ useJQuery: this.useJQuery,
+ url: this.url,
+ method: 'get',
+ headers: {
+ accept: this.swaggerRequestHeaders
+ },
+ on: {
+ error: function (response) {
+ if (self.url.substring(0, 4) !== 'http') {
+ return self.fail('Please specify the protocol for ' + self.url);
+ } else if (response.status === 0) {
+ return self.fail('Can\'t read from server. It may not have the appropriate access-control-origin settings.');
+ } else if (response.status === 404) {
+ return self.fail('Can\'t read swagger JSON from ' + self.url);
+ } else {
+ return self.fail(response.status + ' : ' + response.statusText + ' ' + self.url);
+ }
+ },
+ response: function (resp) {
+
+ var responseObj = resp.obj;
+ if(!responseObj) {
+ return self.fail('failed to parse JSON/YAML response');
+ }
+
+ self.swaggerVersion = responseObj.swaggerVersion;
+ self.swaggerObject = responseObj;
+
+ if (responseObj.swagger && parseInt(responseObj.swagger) === 2) {
+ self.swaggerVersion = responseObj.swagger;
+
+ new Resolver().resolve(responseObj, self.url, self.buildFromSpec, self);
+
+ self.isValid = true;
+ } else {
+ var converter = new SwaggerSpecConverter();
+ self.oldSwaggerObject = self.swaggerObject;
+
+ converter.setDocumentationLocation(self.url);
+ converter.convert(responseObj, self.clientAuthorizations, function(spec) {
+ self.swaggerObject = spec;
+ new Resolver().resolve(spec, self.url, self.buildFromSpec, self);
+ self.isValid = true;
+ });
+ }
+ }
+ }
+ };
+
+ if (this.spec) {
+ self.swaggerObject = this.spec;
+ setTimeout(function () {
+ new Resolver().resolve(self.spec, self.buildFromSpec, self);
+ }, 10);
+ } else {
+ this.clientAuthorizations.apply(obj);
+
+ if (mock) {
+ return obj;
+ }
+
+ new SwaggerHttp().execute(obj, this.options);
+ }
+
+ return this;
+};
+
+SwaggerClient.prototype.buildFromSpec = function (response) {
+ if (this.isBuilt) {
+ return this;
+ }
+
+ this.apis = {};
+ this.apisArray = [];
+ this.basePath = response.basePath || '';
+ this.consumes = response.consumes;
+ this.host = response.host || '';
+ this.info = response.info || {};
+ this.produces = response.produces;
+ this.schemes = response.schemes || [];
+ this.securityDefinitions = response.securityDefinitions;
+ this.title = response.title || '';
+
+ if (response.externalDocs) {
+ this.externalDocs = response.externalDocs;
+ }
+
+ // legacy support
+ this.authSchemes = response.securityDefinitions;
+
+ var definedTags = {};
+ var k;
+
+ if (Array.isArray(response.tags)) {
+ definedTags = {};
+
+ for (k = 0; k < response.tags.length; k++) {
+ var t = response.tags[k];
+ definedTags[t.name] = t;
+ }
+ }
+
+ var location;
+
+ if (typeof this.url === 'string') {
+ location = this.parseUri(this.url);
+ if (typeof this.scheme === 'undefined' && typeof this.schemes === 'undefined' || this.schemes.length === 0) {
+ this.scheme = location.scheme || 'http';
+ } else if (typeof this.scheme === 'undefined') {
+ this.scheme = this.schemes[0];
+ }
+
+ if (typeof this.host === 'undefined' || this.host === '') {
+ this.host = location.host;
+
+ if (location.port) {
+ this.host = this.host + ':' + location.port;
+ }
+ }
+ }
+ else {
+ if (typeof this.schemes === 'undefined' || this.schemes.length === 0) {
+ this.scheme = 'http';
+ }
+ else if (typeof this.scheme === 'undefined') {
+ this.scheme = this.schemes[0];
+ }
+ }
+
+ this.definitions = response.definitions;
+
+ var key;
+
+ for (key in this.definitions) {
+ var model = new Model(key, this.definitions[key], this.models, this.modelPropertyMacro);
+
+ if (model) {
+ this.models[key] = model;
+ }
+ }
+
+ // get paths, create functions for each operationId
+ var self = this;
+
+ // Bind help to 'client.apis'
+ self.apis.help = _.bind(self.help, self);
+
+ _.forEach(response.paths, function (pathObj, path) {
+ // Only process a path if it's an object
+ if (!_.isPlainObject(pathObj)) {
+ return;
+ }
+
+ _.forEach(supportedOperationMethods, function (method) {
+ var operation = pathObj[method];
+
+ if (_.isUndefined(operation)) {
+ // Operation does not exist
+ return;
+ } else if (!_.isPlainObject(operation)) {
+ // Operation exists but it is not an Operation Object. Since this is invalid, log it.
+ helpers.log('The \'' + method + '\' operation for \'' + path + '\' path is not an Operation Object');
+
+ return;
+ }
+
+ var tags = operation.tags;
+
+ if (_.isUndefined(tags) || !_.isArray(tags) || tags.length === 0) {
+ tags = operation.tags = [ 'default' ];
+ }
+
+ var operationId = self.idFromOp(path, method, operation);
+ var operationObject = new Operation(self,
+ operation.scheme,
+ operationId,
+ method,
+ path,
+ operation,
+ self.definitions,
+ self.models,
+ self.clientAuthorizations);
+
+ // bind self operation's execute command to the api
+ _.forEach(tags, function (tag) {
+ var clientProperty = _.indexOf(reservedClientTags, tag) > -1 ? '_' + tag : tag;
+ var apiProperty = _.indexOf(reservedApiTags, tag) > -1 ? '_' + tag : tag;
+ var operationGroup = self[clientProperty];
+
+ if (clientProperty !== tag) {
+ helpers.log('The \'' + tag + '\' tag conflicts with a SwaggerClient function/property name. Use \'client.' +
+ clientProperty + '\' or \'client.apis.' + tag + '\' instead of \'client.' + tag + '\'.');
+ }
+
+ if (apiProperty !== tag) {
+ helpers.log('The \'' + tag + '\' tag conflicts with a SwaggerClient operation function/property name. Use ' +
+ '\'client.apis.' + apiProperty + '\' instead of \'client.apis.' + tag + '\'.');
+ }
+
+ if (_.indexOf(reservedApiTags, operationId) > -1) {
+ helpers.log('The \'' + operationId + '\' operationId conflicts with a SwaggerClient operation ' +
+ 'function/property name. Use \'client.apis.' + apiProperty + '._' + operationId +
+ '\' instead of \'client.apis.' + apiProperty + '.' + operationId + '\'.');
+
+ operationId = '_' + operationId;
+ operationObject.nickname = operationId; // So 'client.apis.[tag].operationId.help() works properly
+ }
+
+ if (_.isUndefined(operationGroup)) {
+ operationGroup = self[clientProperty] = self.apis[apiProperty] = {};
+
+ operationGroup.operations = {};
+ operationGroup.label = apiProperty;
+ operationGroup.apis = {};
+
+ var tagDef = definedTags[tag];
+
+ if (!_.isUndefined(tagDef)) {
+ operationGroup.description = tagDef.description;
+ operationGroup.externalDocs = tagDef.externalDocs;
+ }
+
+ self[clientProperty].help = _.bind(self.help, operationGroup);
+ self.apisArray.push(new OperationGroup(tag, operationGroup.description, operationGroup.externalDocs, operationObject));
+ }
+
+ // Bind tag help
+ if (!_.isFunction(operationGroup.help)) {
+ operationGroup.help = _.bind(self.help, operationGroup);
+ }
+
+ // bind to the apis object
+ self.apis[apiProperty][operationId] = operationGroup[operationId] = _.bind(operationObject.execute,
+ operationObject);
+ self.apis[apiProperty][operationId].help = operationGroup[operationId].help = _.bind(operationObject.help,
+ operationObject);
+ self.apis[apiProperty][operationId].asCurl = operationGroup[operationId].asCurl = _.bind(operationObject.asCurl,
+ operationObject);
+
+ operationGroup.apis[operationId] = operationGroup.operations[operationId] = operationObject;
+
+ // legacy UI feature
+ var api = _.find(self.apisArray, function (api) {
+ return api.tag === tag;
+ });
+
+ if (api) {
+ api.operationsArray.push(operationObject);
+ }
+ });
+ });
+ });
+
+ this.isBuilt = true;
+
+ if (this.success) {
+ this.isValid = true;
+ this.isBuilt = true;
+ this.success();
+ }
+
+ return this;
+};
+
+SwaggerClient.prototype.parseUri = function (uri) {
+ var urlParseRE = /^(((([^:\/#\?]+:)?(?:(\/\/)((?:(([^:@\/#\?]+)(?:\:([^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((\/?(?:[^\/\?#]+\/+)*)([^\?#]*)))?(\?[^#]+)?)(#.*)?/;
+ var parts = urlParseRE.exec(uri);
+
+ return {
+ scheme: parts[4].replace(':',''),
+ host: parts[11],
+ port: parts[12],
+ path: parts[15]
+ };
+};
+
+SwaggerClient.prototype.help = function (dontPrint) {
+ var output = '';
+
+ if (this instanceof SwaggerClient) {
+ _.forEach(this.apis, function (api, name) {
+ if (_.isPlainObject(api)) {
+ output += 'operations for the \'' + name + '\' tag\n';
+
+ _.forEach(api.operations, function (operation, name) {
+ output += ' * ' + name + ': ' + operation.summary + '\n';
+ });
+ }
+ });
+ } else if (this instanceof OperationGroup || _.isPlainObject(this)) {
+ output += 'operations for the \'' + this.label + '\' tag\n';
+
+ _.forEach(this.apis, function (operation, name) {
+ output += ' * ' + name + ': ' + operation.summary + '\n';
+ });
+ }
+
+ if (dontPrint) {
+ return output;
+ } else {
+ helpers.log(output);
+
+ return output;
+ }
+};
+
+SwaggerClient.prototype.tagFromLabel = function (label) {
+ return label;
+};
+
+SwaggerClient.prototype.idFromOp = function (path, httpMethod, op) {
+ if(!op || !op.operationId) {
+ op = op || {};
+ op.operationId = httpMethod + '_' + path;
+ }
+ var opId = op.operationId.replace(/[\s!@#$%^&*()_+=\[{\]};:<>|.\/?,\\'""-]/g, '_') || (path.substring(1) + '_' + httpMethod);
+
+ opId = opId.replace(/((_){2,})/g, '_');
+ opId = opId.replace(/^(_)*/g, '');
+ opId = opId.replace(/([_])*$/g, '');
+ return opId;
+};
+
+SwaggerClient.prototype.setHost = function (host) {
+ this.host = host;
+
+ if(this.apis) {
+ _.forEach(this.apis, function(api) {
+ if(api.operations) {
+ _.forEach(api.operations, function(operation) {
+ operation.host = host;
+ });
+ }
+ });
+ }
+};
+
+SwaggerClient.prototype.setBasePath = function (basePath) {
+ this.basePath = basePath;
+
+ if(this.apis) {
+ _.forEach(this.apis, function(api) {
+ if(api.operations) {
+ _.forEach(api.operations, function(operation) {
+ operation.basePath = basePath;
+ });
+ }
+ });
+ }
+};
+
+SwaggerClient.prototype.fail = function (message) {
+ this.failure(message);
+
+ throw message;
+};
+
+},{"./auth":2,"./helpers":4,"./http":5,"./resolver":6,"./spec-converter":8,"./types/model":9,"./types/operation":10,"./types/operationGroup":11,"lodash-compat/array/indexOf":52,"lodash-compat/collection/find":56,"lodash-compat/collection/forEach":57,"lodash-compat/function/bind":61,"lodash-compat/lang/cloneDeep":141,"lodash-compat/lang/isArray":143,"lodash-compat/lang/isFunction":145,"lodash-compat/lang/isObject":147,"lodash-compat/lang/isPlainObject":148,"lodash-compat/lang/isUndefined":151}],4:[function(require,module,exports){
+(function (process){
+'use strict';
+
+var _ = {
+ isPlainObject: require('lodash-compat/lang/isPlainObject'),
+ indexOf: require('lodash-compat/array/indexOf')
+};
+
+module.exports.__bind = function (fn, me) {
+ return function(){
+ return fn.apply(me, arguments);
+ };
+};
+
+var log = module.exports.log = function() {
+ // Only log if available and we're not testing
+ if (console && process.env.NODE_ENV !== 'test') {
+ console.log(Array.prototype.slice.call(arguments)[0]);
+ }
+};
+
+module.exports.fail = function (message) {
+ log(message);
+};
+
+var optionHtml = module.exports.optionHtml = function (label, value) {
+ return '<tr><td class="optionName">' + label + ':</td><td>' + value + '</td></tr>';
+};
+
+var resolveSchema = module.exports.resolveSchema = function (schema) {
+ if (_.isPlainObject(schema.schema)) {
+ schema = resolveSchema(schema.schema);
+ }
+
+ return schema;
+};
+
+var simpleRef = module.exports.simpleRef = function (name) {
+ if (typeof name === 'undefined') {
+ return null;
+ }
+
+ if (name.indexOf('#/definitions/') === 0) {
+ return name.substring('#/definitions/'.length);
+ } else {
+ return name;
+ }
+};
+
+
+}).call(this,require('_process'))
+//# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxpYi9oZWxwZXJzLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFB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W9kdWxlLmV4cG9ydHMuZmFpbCA9IGZ1bmN0aW9uIChtZXNzYWdlKSB7XG4gIGxvZyhtZXNzYWdlKTtcbn07XG5cbnZhciBvcHRpb25IdG1sID0gbW9kdWxlLmV4cG9ydHMub3B0aW9uSHRtbCA9IGZ1bmN0aW9uIChsYWJlbCwgdmFsdWUpIHtcbiAgcmV0dXJuICc8dHI+PHRkIGNsYXNzPVwib3B0aW9uTmFtZVwiPicgKyBsYWJlbCArICc6PC90ZD48dGQ+JyArIHZhbHVlICsgJzwvdGQ+PC90cj4nO1xufTtcblxudmFyIHJlc29sdmVTY2hlbWEgPSBtb2R1bGUuZXhwb3J0cy5yZXNvbHZlU2NoZW1hID0gZnVuY3Rpb24gKHNjaGVtYSkge1xuICBpZiAoXy5pc1BsYWluT2JqZWN0KHNjaGVtYS5zY2hlbWEpKSB7XG4gICAgc2NoZW1hID0gcmVzb2x2ZVNjaGVtYShzY2hlbWEuc2NoZW1hKTtcbiAgfVxuXG4gIHJldHVybiBzY2hlbWE7XG59O1xuXG52YXIgc2ltcGxlUmVmID0gbW9kdWxlLmV4cG9ydHMuc2ltcGxlUmVmID0gZnVuY3Rpb24gKG5hbWUpIHtcbiAgaWYgKHR5cGVvZiBuYW1lID09PSAndW5kZWZpbmVkJykge1xuICAgIHJldHVybiBudWxsO1xuICB9XG5cbiAgaWYgKG5hbWUuaW5kZXhPZignIy9kZWZpbml0aW9ucy8nKSA9PT0gMCkge1xuICAgIHJldHVybiBuYW1lLnN1YnN0cmluZygnIy9kZWZpbml0aW9ucy8nLmxlbmd0aCk7XG4gIH0gZWxzZSB7XG4gICAgcmV0dXJuIG5hbWU7XG4gIH1cbn07XG5cbiJdfQ==
+},{"_process":17,"lodash-compat/array/indexOf":52,"lodash-compat/lang/isPlainObject":148}],5:[function(require,module,exports){
+'use strict';
+
+var helpers = require('./helpers');
+var jQuery = require('jquery');
+var request = require('superagent');
+var jsyaml = require('js-yaml');
+var _ = {
+ isObject: require('lodash-compat/lang/isObject')
+};
+
+/*
+ * JQueryHttpClient is a light-weight, node or browser HTTP client
+ */
+var JQueryHttpClient = function () {};
+
+/*
+ * SuperagentHttpClient is a light-weight, node or browser HTTP client
+ */
+var SuperagentHttpClient = function () {};
+
+/**
+ * SwaggerHttp is a wrapper for executing requests
+ */
+var SwaggerHttp = module.exports = function () {};
+
+SwaggerHttp.prototype.execute = function (obj, opts) {
+ var client;
+
+ if(opts && opts.client) {
+ client = opts.client;
+ }
+ else {
+ client = new SuperagentHttpClient(opts);
+ }
+
+ // legacy support
+ if ((obj && obj.useJQuery === true) || this.isInternetExplorer()) {
+ client = new JQueryHttpClient(opts);
+ }
+
+ var success = obj.on.response;
+
+ var responseInterceptor = function(data) {
+ if(opts && opts.responseInterceptor) {
+ data = opts.responseInterceptor.apply(data);
+ }
+ success(data);
+ };
+
+ obj.on.response = function(data) {
+ responseInterceptor(data);
+ };
+
+
+ if (_.isObject(obj) && _.isObject(obj.body)) {
+ // special processing for file uploads via jquery
+ if (obj.body.type && obj.body.type === 'formData'){
+ obj.contentType = false;
+ obj.processData = false;
+
+ delete obj.headers['Content-Type'];
+ } else {
+ obj.body = JSON.stringify(obj.body);
+ }
+ }
+ client.execute(obj);
+};
+
+SwaggerHttp.prototype.isInternetExplorer = function () {
+ var detectedIE = false;
+
+ if (typeof navigator !== 'undefined' && navigator.userAgent) {
+ var nav = navigator.userAgent.toLowerCase();
+
+ if (nav.indexOf('msie') !== -1) {
+ var version = parseInt(nav.split('msie')[1]);
+
+ if (version <= 8) {
+ detectedIE = true;
+ }
+ }
+ }
+
+ return detectedIE;
+};
+
+JQueryHttpClient.prototype.execute = function (obj) {
+ var cb = obj.on;
+ var request = obj;
+
+ obj.type = obj.method;
+ obj.cache = false;
+ delete obj.useJQuery;
+
+ /*
+ obj.beforeSend = function (xhr) {
+ var key, results;
+ if (obj.headers) {
+ results = [];
+ for (key in obj.headers) {
+ if (key.toLowerCase() === 'content-type') {
+ results.push(obj.contentType = obj.headers[key]);
+ } else if (key.toLowerCase() === 'accept') {
+ results.push(obj.accepts = obj.headers[key]);
+ } else {
+ results.push(xhr.setRequestHeader(key, obj.headers[key]));
+ }
+ }
+ return results;
+ }
+ };*/
+
+ obj.data = obj.body;
+
+ delete obj.body;
+
+ obj.complete = function (response) {
+ var headers = {};
+ var headerArray = response.getAllResponseHeaders().split('\n');
+
+ for (var i = 0; i < headerArray.length; i++) {
+ var toSplit = headerArray[i].trim();
+
+ if (toSplit.length === 0) {
+ continue;
+ }
+
+ var separator = toSplit.indexOf(':');
+
+ if (separator === -1) {
+ // Name but no value in the header
+ headers[toSplit] = null;
+
+ continue;
+ }
+
+ var name = toSplit.substring(0, separator).trim();
+ var value = toSplit.substring(separator + 1).trim();
+
+ headers[name] = value;
+ }
+
+ var out = {
+ url: request.url,
+ method: request.method,
+ status: response.status,
+ statusText: response.statusText,
+ data: response.responseText,
+ headers: headers
+ };
+
+ try {
+ var possibleObj = response.responseJSON || jsyaml.safeLoad(response.responseText);
+ out.obj = (typeof possibleObj === 'string') ? {} : possibleObj;
+ } catch (ex) {
+ // do not set out.obj
+ helpers.log('unable to parse JSON/YAML content');
+ }
+
+ // I can throw, or parse null?
+ out.obj = out.obj || null;
+
+ if (response.status >= 200 && response.status < 300) {
+ cb.response(out);
+ } else if (response.status === 0 || (response.status >= 400 && response.status < 599)) {
+ cb.error(out);
+ } else {
+ return cb.response(out);
+ }
+ };
+
+ jQuery.support.cors = true;
+
+ return jQuery.ajax(obj);
+};
+
+SuperagentHttpClient.prototype.execute = function (obj) {
+ var method = obj.method.toLowerCase();
+
+ if (method === 'delete') {
+ method = 'del';
+ }
+ var headers = obj.headers || {};
+ var r = request[method](obj.url);
+ var name;
+ for (name in headers) {
+ r.set(name, headers[name]);
+ }
+
+ if (obj.body) {
+ r.send(obj.body);
+ }
+
+ if(typeof r.buffer === 'function') {
+ r.buffer(); // force superagent to populate res.text with the raw response data
+ }
+
+ r.end(function (err, res) {
+ res = res || {
+ status: 0,
+ headers: {error: 'no response from server'}
+ };
+ var response = {
+ url: obj.url,
+ method: obj.method,
+ headers: res.headers
+ };
+ var cb;
+
+ if (!err && res.error) {
+ err = res.error;
+ }
+
+ if (err && obj.on && obj.on.error) {
+ response.obj = err;
+ response.status = res ? res.status : 500;
+ response.statusText = res ? res.text : err.message;
+ cb = obj.on.error;
+ } else if (res && obj.on && obj.on.response) {
+ var possibleObj;
+
+ // Already parsed by by superagent?
+ if(res.body && Object.keys(res.body).length > 0) {
+ possibleObj = res.body;
+ } else {
+ try {
+ possibleObj = jsyaml.safeLoad(res.text);
+ // can parse into a string... which we don't need running around in the system
+ possibleObj = (typeof possibleObj === 'string') ? null : possibleObj;
+ } catch(e) {
+ helpers.log('cannot parse JSON/YAML content');
+ }
+ }
+
+ // null means we can't parse into object
+ response.obj = possibleObj || null;
+
+ response.status = res.status;
+ response.statusText = res.text;
+ cb = obj.on.response;
+ }
+ response.data = response.statusText;
+
+ if (cb) {
+ cb(response);
+ }
+ });
+};
+
+},{"./helpers":4,"jquery":20,"js-yaml":21,"lodash-compat/lang/isObject":147,"superagent":160}],6:[function(require,module,exports){
+'use strict';
+
+var SwaggerHttp = require('./http');
+var _ = {
+ isObject: require('lodash-compat/lang/isObject'),
+ isArray: require('lodash-compat/lang/isArray')
+};
+
+
+/**
+ * Resolves a spec's remote references
+ */
+var Resolver = module.exports = function () {};
+
+Resolver.prototype.processAllOf = function(name, definition, resolutionTable, unresolvedRefs, spec) {
+ var i, location, property;
+
+ definition['x-resolved-from'] = [ '#/definitions/' + name ];
+ var allOf = definition.allOf;
+ // the refs go first
+ allOf.sort(function(a, b) {
+ if(a.$ref && b.$ref) { return 0; }
+ else if(a.$ref) { return -1; }
+ else { return 1; }
+ });
+ for (i = 0; i < allOf.length; i++) {
+ property = allOf[i];
+ location = '/definitions/' + name + '/allOf';
+ this.resolveInline(null, spec, property, resolutionTable, unresolvedRefs, location);
+ }
+};
+
+Resolver.prototype.resolve = function (spec, arg1, arg2, arg3) {
+ var root = arg1, callback = arg2, scope = arg3, location, i;
+ if(typeof arg1 === 'function') {
+ root = null;
+ callback = arg1;
+ scope = arg2;
+ }
+ var _root = root;
+ this.scope = (scope || this);
+ this.iteration = this.iteration || 0;
+
+ var name, path, property, propertyName;
+ var processedCalls = 0, resolvedRefs = {}, unresolvedRefs = {};
+ var resolutionTable = []; // store objects for dereferencing
+
+ // definitions
+ for (name in spec.definitions) {
+ var definition = spec.definitions[name];
+ for (propertyName in definition.properties) {
+ property = definition.properties[propertyName];
+ if(_.isArray(property.allOf)) {
+ this.processAllOf(name, property, resolutionTable, unresolvedRefs, spec);
+ }
+ else {
+ this.resolveTo(root, property, resolutionTable, '/definitions');
+ }
+ }
+
+ if(definition.allOf) {
+ this.processAllOf(name, definition, resolutionTable, unresolvedRefs, spec);
+ }
+ }
+
+ // operations
+ for (name in spec.paths) {
+ var method, operation, responseCode;
+ path = spec.paths[name];
+
+ for (method in path) {
+ // operation reference
+ if(method === '$ref') {
+ // location = path[method];
+ location = '/paths' + name;
+ this.resolveInline(root, spec, path, resolutionTable, unresolvedRefs, location);
+ }
+ else {
+ operation = path[method];
+
+ var parameters = operation.parameters;
+ for (i in parameters) {
+ var parameter = parameters[i];
+ location = '/paths' + name + '/' + method + '/parameters';
+
+ if (parameter.in === 'body' && parameter.schema) {
+ this.resolveTo(root, parameter.schema, resolutionTable, location);
+ }
+
+ if (parameter.$ref) {
+ // parameter reference
+ this.resolveInline(root, spec, parameter, resolutionTable, unresolvedRefs, parameter.$ref);
+ }
+ }
+
+ for (responseCode in operation.responses) {
+ var response = operation.responses[responseCode];
+ location = '/paths' + name + '/' + method + '/responses/' + responseCode;
+
+ if(_.isObject(response)) {
+ if(response.$ref) {
+ // response reference
+ this.resolveInline(root, spec, response, resolutionTable, unresolvedRefs, location);
+ }
+ if (response.schema) {
+ this.resolveTo(root, response.schema, resolutionTable, location);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ var expectedCalls = 0, toResolve = [];
+ // if the root is same as obj[i].root we can resolve locally
+ var all = resolutionTable;
+
+ var parts;
+ for(i = 0; i < all.length; i++) {
+ var a = all[i];
+ if(root === a.root) {
+ if(a.resolveAs === 'ref') {
+ // resolve any path walking
+ var joined = ((a.root || '') + '/' + a.key).split('/');
+ var normalized = [];
+ var url = '';
+ var k;
+
+ if(a.key.indexOf('../') >= 0) {
+ for(var j = 0; j < joined.length; j++) {
+ if(joined[j] === '..') {
+ normalized = normalized.slice(0, normalized.length-1);
+ }
+ else {
+ normalized.push(joined[j]);
+ }
+ }
+ for(k = 0; k < normalized.length; k ++) {
+ if(k > 0) {
+ url += '/';
+ }
+ url += normalized[k];
+ }
+ // we now have to remote resolve this because the path has changed
+ a.root = url;
+ toResolve.push(a);
+ }
+ else {
+ parts = a.key.split('#');
+ if(parts.length === 2) {
+ if(parts[0].indexOf('http://') === 0 || parts[0].indexOf('https://') === 0) {
+ a.root = parts[0];
+ }
+ location = parts[1].split('/');
+ var r;
+ var s = spec;
+ for(k = 0; k < location.length; k++) {
+ var part = location[k];
+ if(part !== '') {
+ s = s[part];
+ if(typeof s !== 'undefined') {
+ r = s;
+ }
+ else {
+ r = null;
+ break;
+ }
+ }
+ }
+ if(r === null) {
+ // must resolve this too
+ toResolve.push(a);
+ }
+ }
+ }
+ }
+ else {
+ if (a.resolveAs === 'inline') {
+ if(a.key && a.key.indexOf('#') === -1 && a.key.charAt(0) !== '/') {
+ // handle relative schema
+ parts = a.root.split('/');
+ location = '';
+ for(i = 0; i < parts.length - 1; i++) {
+ location += parts[i] + '/';
+ }
+ location += a.key;
+ a.root = location;
+ a.location = '';
+ }
+ toResolve.push(a);
+ }
+ }
+ }
+ else {
+ toResolve.push(a);
+ }
+ }
+ expectedCalls = toResolve.length;
+
+ // resolve anything that is local
+ for(var ii = 0; ii < toResolve.length; ii++) {
+ (function(item, self) {
+ if(item.root === null || item.root === root) {
+ // local resolve
+ self.resolveItem(spec, _root, resolutionTable, resolvedRefs, unresolvedRefs, item);
+ processedCalls += 1;
+
+ if(processedCalls === expectedCalls) {
+ self.finish(spec, root, resolutionTable, resolvedRefs, unresolvedRefs, callback);
+ }
+ }
+ else {
+ var obj = {
+ useJQuery: false, // TODO
+ url: item.root,
+ method: 'get',
+ headers: {
+ accept: self.scope.swaggerRequestHeaders || 'application/json'
+ },
+ on: {
+ error: function () {
+ processedCalls += 1;
+ unresolvedRefs[item.key] = {
+ root: item.root,
+ location: item.location
+ };
+
+ if (processedCalls === expectedCalls) {
+ self.finish(spec, _root, resolutionTable, resolvedRefs, unresolvedRefs, callback);
+ }
+ }, // jshint ignore:line
+ response: function (response) {
+ var swagger = response.obj;
+ self.resolveItem(swagger, item.root, resolutionTable, resolvedRefs, unresolvedRefs, item);
+ processedCalls += 1;
+
+ if (processedCalls === expectedCalls) {
+ self.finish(spec, _root, resolutionTable, resolvedRefs, unresolvedRefs, callback);
+ }
+ }
+ } // jshint ignore:line
+ };
+
+ if (scope && scope.clientAuthorizations) {
+ scope.clientAuthorizations.apply(obj);
+ }
+ new SwaggerHttp().execute(obj);
+ }
+ }(toResolve[ii], this));
+ }
+
+ if (Object.keys(toResolve).length === 0) {
+ this.finish(spec, _root, resolutionTable, resolvedRefs, unresolvedRefs, callback);
+ }
+};
+
+Resolver.prototype.resolveItem = function(spec, root, resolutionTable, resolvedRefs, unresolvedRefs, item) {
+ var path = item.location;
+ var location = spec, parts = path.split('/');
+ if(path !== '') {
+ for (var j = 0; j < parts.length; j++) {
+ var segment = parts[j];
+ if (segment.indexOf('~1') !== -1) {
+ segment = parts[j].replace(/~0/g, '~').replace(/~1/g, '/');
+ if (segment.charAt(0) !== '/') {
+ segment = '/' + segment;
+ }
+ }
+ if (typeof location === 'undefined' || location === null) {
+ break;
+ }
+ if (segment === '' && j === (parts.length - 1) && parts.length > 1) {
+ location = null;
+ break;
+ }
+ if (segment.length > 0) {
+ location = location[segment];
+ }
+ }
+ }
+ var resolved = item.key;
+ parts = item.key.split('/');
+ var resolvedName = parts[parts.length-1];
+
+ if(resolvedName.indexOf('#') >= 0) {
+ resolvedName = resolvedName.split('#')[1];
+ }
+
+ if (location !== null && typeof location !== 'undefined') {
+ resolvedRefs[resolved] = {
+ name: resolvedName,
+ obj: location,
+ key: item.key,
+ root: item.root
+ };
+ } else {
+ unresolvedRefs[resolved] = {
+ root: item.root,
+ location: item.location
+ };
+ }
+};
+
+Resolver.prototype.finish = function (spec, root, resolutionTable, resolvedRefs, unresolvedRefs, callback) {
+ // walk resolution table and replace with resolved refs
+ var ref;
+ for (ref in resolutionTable) {
+ var item = resolutionTable[ref];
+
+ var key = item.key;
+ var resolvedTo = resolvedRefs[key];
+ if (resolvedTo) {
+ spec.definitions = spec.definitions || {};
+ if (item.resolveAs === 'ref') {
+ for (key in resolvedTo.obj) {
+ var abs = this.retainRoot(resolvedTo.obj[key], item.root);
+ }
+ spec.definitions[resolvedTo.name] = resolvedTo.obj;
+ item.obj.$ref = '#/definitions/' + resolvedTo.name;
+ } else if (item.resolveAs === 'inline') {
+ var targetObj = item.obj;
+ targetObj['x-resolved-from'] = [ item.key ];
+ delete targetObj.$ref;
+
+ for (key in resolvedTo.obj) {
+ var abs = this.retainRoot(resolvedTo.obj[key], item.root);
+ targetObj[key] = abs;
+ }
+ }
+ }
+ }
+ var existingUnresolved = this.countUnresolvedRefs(spec);
+
+ if(existingUnresolved.length === 0 || this.iteration > 5) {
+ this.resolveAllOf(spec.definitions);
+ callback.call(this.scope, spec, unresolvedRefs);
+ }
+ else {
+ this.iteration += 1;
+ this.resolve(spec, root, callback, this.scope);
+ }
+};
+
+Resolver.prototype.countUnresolvedRefs = function(spec) {
+ var i;
+ var refs = this.getRefs(spec);
+ var keys = [];
+ var unresolvedKeys = [];
+ for(i in refs) {
+ if(i.indexOf('#') === 0) {
+ keys.push(i.substring(1));
+ }
+ else {
+ unresolvedKeys.push(i);
+ }
+ }
+
+ // verify possible keys
+ for (i = 0; i < keys.length; i++) {
+ var part = keys[i];
+ var parts = part.split('/');
+ var obj = spec;
+
+ for (var k = 0; k < parts.length; k++) {
+ var key = parts[k];
+ if(key !== '') {
+ obj = obj[key];
+ if(typeof obj === 'undefined') {
+ unresolvedKeys.push(part);
+ break;
+ }
+ }
+ }
+ }
+ return unresolvedKeys.length;
+};
+
+Resolver.prototype.getRefs = function(spec, obj) {
+ obj = obj || spec;
+ var output = {};
+ for(var key in obj) {
+ if (!obj.hasOwnProperty(key)) {
+ continue;
+ }
+ var item = obj[key];
+ if(key === '$ref' && typeof item === 'string') {
+ output[item] = null;
+ }
+ else if(_.isObject(item)) {
+ var o = this.getRefs(item);
+ for(var k in o) {
+ output[k] = null;
+ }
+ }
+ }
+ return output;
+};
+
+Resolver.prototype.retainRoot = function(obj, root) {
+ // walk object and look for relative $refs
+ for(var key in obj) {
+ var item = obj[key];
+ if(key === '$ref' && typeof item === 'string') {
+ // stop and inspect
+ if(item.indexOf('http://') !== 0 && item.indexOf('https://') !== 0) {
+ if(item.indexOf('#') !== 0) {
+ item = '#' + item;
+ }
+ item = (root || '') + item;
+ obj[key] = item;
+ }
+ }
+ else if(_.isObject(item)) {
+ this.retainRoot(item, root);
+ }
+ }
+ return obj;
+};
+
+/**
+ * immediately in-lines local refs, queues remote refs
+ * for inline resolution
+ */
+Resolver.prototype.resolveInline = function (root, spec, property, resolutionTable, unresolvedRefs, location) {
+ var key = property.$ref, ref = property.$ref, i, p, p2, rs;
+ var rootTrimmed = false;
+ if (ref) {
+ if(ref.indexOf('../') === 0) {
+ // reset root
+ p = ref.split('../');
+ p2 = root.split('/');
+ ref = '';
+ for(i = 0; i < p.length; i++) {
+ if(p[i] === '') {
+ p2 = p2.slice(0, p2.length-1);
+ }
+ else {
+ ref += p[i];
+ }
+ }
+ root = '';
+ for(i = 0; i < p2.length - 1; i++) {
+ if(i > 0) { root += '/'; }
+ root += p2[i];
+ }
+ rootTrimmed = true;
+ }
+ if(ref.indexOf('#') >= 0) {
+ if(ref.indexOf('/') === 0) {
+ rs = ref.split('#');
+ p = root.split('//');
+ p2 = p[1].split('/');
+ root = p[0] + '//' + p2[0] + rs[0];
+ location = rs[1];
+ }
+ else {
+ rs = ref.split('#');
+ if(rs[0] !== '') {
+ p2 = root.split('/');
+ p2 = p2.slice(0, p2.length - 1);
+ if(!rootTrimmed) {
+ root = '';
+ for (var k = 0; k < p2.length; k++) {
+ if(k > 0) { root += '/'; }
+ root += p2[k];
+ }
+ }
+ root += '/' + ref.split('#')[0];
+ }
+ location = rs[1];
+ }
+ }
+ if (ref.indexOf('http') === 0) {
+ if(ref.indexOf('#') >= 0) {
+ root = ref.split('#')[0];
+ location = ref.split('#')[1];
+ }
+ else {
+ root = ref;
+ location = '';
+ }
+ resolutionTable.push({obj: property, resolveAs: 'inline', root: root, key: key, location: location});
+ } else if (ref.indexOf('#') === 0) {
+ location = ref.split('#')[1];
+ resolutionTable.push({obj: property, resolveAs: 'inline', root: root, key: key, location: location});
+ }
+ else {
+ resolutionTable.push({obj: property, resolveAs: 'inline', root: root, key: key, location: location});
+ }
+ } else if (property.type === 'array') {
+ this.resolveTo(root, property.items, resolutionTable, location);
+ }
+};
+
+Resolver.prototype.resolveTo = function (root, property, resolutionTable, location) {
+ var sp, i;
+ var ref = property.$ref;
+ var lroot = root;
+ if (typeof ref !== 'undefined') {
+ if(ref.indexOf('#') >= 0) {
+ var parts = ref.split('#');
+
+ // #/definitions/foo
+ // foo.json#/bar
+ if(parts[0] && ref.indexOf('/') === 0) {
+
+ }
+ else if(parts[0] && parts[0].indexOf('http') === 0) {
+ lroot = parts[0];
+ ref = parts[1];
+ }
+ else if(parts[0] && parts[0].length > 0) {
+ // relative file
+ sp = root.split('/');
+ lroot = '';
+ for(i = 0; i < sp.length - 1; i++) {
+ lroot += sp[i] + '/';
+ }
+ lroot += parts[0];
+ }
+ else {
+
+ }
+
+ location = parts[1];
+ }
+ else if (ref.indexOf('http://') === 0 || ref.indexOf('https://') === 0) {
+ lroot = ref;
+ location = '';
+ }
+ else {
+ // relative file
+ sp = root.split('/');
+ lroot = '';
+ for(i = 0; i < sp.length - 1; i++) {
+ lroot += sp[i] + '/';
+ }
+ lroot += ref;
+ location = '';
+ }
+ resolutionTable.push({
+ obj: property, resolveAs: 'ref', root: lroot, key: ref, location: location
+ });
+ } else if (property.type === 'array') {
+ var items = property.items;
+ this.resolveTo(root, items, resolutionTable, location);
+ }
+};
+
+Resolver.prototype.resolveAllOf = function(spec, obj, depth) {
+ depth = depth || 0;
+ obj = obj || spec;
+ var name;
+ for(var key in obj) {
+ if (!obj.hasOwnProperty(key)) {
+ continue;
+ }
+ var item = obj[key];
+ if(item === null) {
+ throw new TypeError('Swagger 2.0 does not support null types (' + obj + '). See https://github.com/swagger-api/swagger-spec/issues/229.');
+ }
+ if(typeof item === 'object') {
+ this.resolveAllOf(spec, item, depth + 1);
+ }
+ if(item && typeof item.allOf !== 'undefined') {
+ var allOf = item.allOf;
+ if(_.isArray(allOf)) {
+ var output = {};
+ output['x-composed'] = true;
+ if (typeof item['x-resolved-from'] !== 'undefined') {
+ output['x-resolved-from'] = item['x-resolved-from'];
+ }
+ output.properties = {};
+ if ( item.example ){
+ output.example = item.example;
+ }
+ for(var i = 0; i < allOf.length; i++) {
+ var component = allOf[i];
+ var source = 'self';
+ if(typeof component['x-resolved-from'] !== 'undefined') {
+ source = component['x-resolved-from'][0];
+ }
+
+ for(var part in component) {
+ if(!output.hasOwnProperty(part)) {
+ output[part] = JSON.parse(JSON.stringify(component[part]));
+ if(part === 'properties') {
+ for(name in output[part]) {
+ output[part][name]['x-resolved-from'] = source;
+ }
+ }
+ }
+ else {
+ if(part === 'properties') {
+ var properties = component[part];
+ for(name in properties) {
+ output.properties[name] = JSON.parse(JSON.stringify(properties[name]));
+ var resolvedFrom = properties[name]['x-resolved-from'];
+ if (typeof resolvedFrom === 'undefined' || resolvedFrom === 'self') {
+ resolvedFrom = source;
+ }
+ output.properties[name]['x-resolved-from'] = resolvedFrom;
+ }
+ }
+ else if(part === 'required') {
+ // merge & dedup the required array
+ var a = output.required.concat(component[part]);
+ for(var k = 0; k < a.length; ++k) {
+ for(var j = k + 1; j < a.length; ++j) {
+ if(a[k] === a[j]) { a.splice(j--, 1); }
+ }
+ }
+ output.required = a;
+ }
+ else if(part === 'x-resolved-from') {
+ output['x-resolved-from'].push(source);
+ }
+ else {
+ // TODO: need to merge this property
+ // console.log('what to do with ' + part)
+ }
+ }
+ }
+ }
+ obj[key] = output;
+ }
+ }
+ if(_.isObject(item)) {
+ this.resolveAllOf(spec, item, depth + 1);
+ }
+ }
+};
+
+},{"./http":5,"lodash-compat/lang/isArray":143,"lodash-compat/lang/isObject":147}],7:[function(require,module,exports){
+'use strict';
+
+var Helpers = require('./helpers');
+
+var _ = {
+ isPlainObject: require('lodash-compat/lang/isPlainObject'),
+ isUndefined: require('lodash-compat/lang/isUndefined'),
+ isArray: require('lodash-compat/lang/isArray'),
+ isObject: require('lodash-compat/lang/isObject'),
+ isEmpty: require('lodash-compat/lang/isEmpty'),
+ map: require('lodash-compat/collection/map'),
+ indexOf: require('lodash-compat/array/indexOf'),
+ cloneDeep: require('lodash-compat/lang/cloneDeep'),
+ keys: require('lodash-compat/object/keys'),
+ forEach: require('lodash-compat/collection/forEach')
+};
+
+module.exports.optionHtml = optionHtml;
+module.exports.typeFromJsonSchema = typeFromJsonSchema;
+module.exports.getStringSignature = getStringSignature;
+module.exports.schemaToHTML = schemaToHTML;
+module.exports.schemaToJSON = schemaToJSON;
+
+function optionHtml(label, value) {
+ return '<tr><td class="optionName">' + label + ':</td><td>' + value + '</td></tr>';
+}
+
+function typeFromJsonSchema(type, format) {
+ var str;
+
+ if (type === 'integer' && format === 'int32') {
+ str = 'integer';
+ } else if (type === 'integer' && format === 'int64') {
+ str = 'long';
+ } else if (type === 'integer' && typeof format === 'undefined') {
+ str = 'long';
+ } else if (type === 'string' && format === 'date-time') {
+ str = 'date-time';
+ } else if (type === 'string' && format === 'date') {
+ str = 'date';
+ } else if (type === 'number' && format === 'float') {
+ str = 'float';
+ } else if (type === 'number' && format === 'double') {
+ str = 'double';
+ } else if (type === 'number' && typeof format === 'undefined') {
+ str = 'double';
+ } else if (type === 'boolean') {
+ str = 'boolean';
+ } else if (type === 'string') {
+ str = 'string';
+ }
+
+ return str;
+}
+
+function getStringSignature(obj, baseComponent) {
+ var str = '';
+
+ if (typeof obj.$ref !== 'undefined') {
+ str += Helpers.simpleRef(obj.$ref);
+ } else if (typeof obj.type === 'undefined') {
+ str += 'object';
+ } else if (obj.type === 'array') {
+ if (baseComponent) {
+ str += getStringSignature((obj.items || obj.$ref || {}));
+ } else {
+ str += 'Array[';
+ str += getStringSignature((obj.items || obj.$ref || {}));
+ str += ']';
+ }
+ } else if (obj.type === 'integer' && obj.format === 'int32') {
+ str += 'integer';
+ } else if (obj.type === 'integer' && obj.format === 'int64') {
+ str += 'long';
+ } else if (obj.type === 'integer' && typeof obj.format === 'undefined') {
+ str += 'long';
+ } else if (obj.type === 'string' && obj.format === 'date-time') {
+ str += 'date-time';
+ } else if (obj.type === 'string' && obj.format === 'date') {
+ str += 'date';
+ } else if (obj.type === 'string' && typeof obj.format === 'undefined') {
+ str += 'string';
+ } else if (obj.type === 'number' && obj.format === 'float') {
+ str += 'float';
+ } else if (obj.type === 'number' && obj.format === 'double') {
+ str += 'double';
+ } else if (obj.type === 'number' && typeof obj.format === 'undefined') {
+ str += 'double';
+ } else if (obj.type === 'boolean') {
+ str += 'boolean';
+ } else if (obj.$ref) {
+ str += Helpers.simpleRef(obj.$ref);
+ } else {
+ str += obj.type;
+ }
+
+ return str;
+}
+
+function schemaToJSON(schema, models, modelsToIgnore, modelPropertyMacro) {
+ // Resolve the schema (Handle nested schemas)
+ schema = Helpers.resolveSchema(schema);
+
+ if(typeof modelPropertyMacro !== 'function') {
+ modelPropertyMacro = function(prop){
+ return (prop || {}).default;
+ };
+ }
+
+ modelsToIgnore= modelsToIgnore || {};
+
+ var type = schema.type || 'object';
+ var format = schema.format;
+ var model;
+ var output;
+
+ if (!_.isUndefined(schema.example)) {
+ output = schema.example;
+ } else if (_.isUndefined(schema.items) && _.isArray(schema.enum)) {
+ output = schema.enum[0];
+ }
+
+ if (_.isUndefined(output)) {
+ if (schema.$ref) {
+ model = models[Helpers.simpleRef(schema.$ref)];
+
+ if (!_.isUndefined(model)) {
+ if (_.isUndefined(modelsToIgnore[model.name])) {
+ modelsToIgnore[model.name] = model;
+ output = schemaToJSON(model.definition, models, modelsToIgnore, modelPropertyMacro);
+ delete modelsToIgnore[model.name];
+ } else {
+ if (model.type === 'array') {
+ output = [];
+ } else {
+ output = {};
+ }
+ }
+ }
+ } else if (!_.isUndefined(schema.default)) {
+ output = schema.default;
+ } else if (type === 'string') {
+ if (format === 'date-time') {
+ output = new Date().toISOString();
+ } else if (format === 'date') {
+ output = new Date().toISOString().split('T')[0];
+ } else {
+ output = 'string';
+ }
+ } else if (type === 'integer') {
+ output = 0;
+ } else if (type === 'number') {
+ output = 0.0;
+ } else if (type === 'boolean') {
+ output = true;
+ } else if (type === 'object') {
+ output = {};
+
+ _.forEach(schema.properties, function (property, name) {
+ var cProperty = _.cloneDeep(property);
+
+ // Allow macro to set the default value
+ cProperty.default = modelPropertyMacro(property);
+
+ output[name] = schemaToJSON(cProperty, models, modelsToIgnore, modelPropertyMacro);
+ });
+ } else if (type === 'array') {
+ output = [];
+
+ if (_.isArray(schema.items)) {
+ _.forEach(schema.items, function (item) {
+ output.push(schemaToJSON(item, models, modelsToIgnore, modelPropertyMacro));
+ });
+ } else if (_.isPlainObject(schema.items)) {
+ output.push(schemaToJSON(schema.items, models, modelsToIgnore, modelPropertyMacro));
+ } else if (_.isUndefined(schema.items)) {
+ output.push({});
+ } else {
+ Helpers.log('Array type\'s \'items\' property is not an array or an object, cannot process');
+ }
+ }
+ }
+
+ return output;
+}
+
+function schemaToHTML(name, schema, models, modelPropertyMacro) {
+
+ var strongOpen = '<span class="strong">';
+ var strongClose = '</span>';
+
+ // Allow for ignoring the 'name' argument.... shifting the rest
+ if(_.isObject(arguments[0])) {
+ name = void 0;
+ schema = arguments[0];
+ models = arguments[1];
+ modelPropertyMacro = arguments[2];
+ }
+
+ models = models || {};
+
+ // Resolve the schema (Handle nested schemas)
+ schema = Helpers.resolveSchema(schema);
+
+ // Return for empty object
+ if(_.isEmpty(schema)) {
+ return strongOpen + 'Empty' + strongClose;
+ }
+
+ // Dereference $ref from 'models'
+ if(typeof schema.$ref === 'string') {
+ name = Helpers.simpleRef(schema.$ref);
+ schema = models[name];
+ if(typeof schema === 'undefined')
+ {
+ return strongOpen + name + ' is not defined!' + strongClose;
+ }
+ }
+
+ if(typeof name !== 'string') {
+ name = schema.title || 'Inline Model';
+ }
+
+ // If we are a Model object... adjust accordingly
+ if(schema.definition) {
+ schema = schema.definition;
+ }
+
+ if(typeof modelPropertyMacro !== 'function') {
+ modelPropertyMacro = function(prop){
+ return (prop || {}).default;
+ };
+ }
+
+ var references = {};
+ var seenModels = [];
+ var inlineModels = 0;
+
+
+
+ // Generate current HTML
+ var html = processModel(schema, name);
+
+ // Generate references HTML
+ while (_.keys(references).length > 0) {
+ /* jshint ignore:start */
+ _.forEach(references, function (schema, name) {
+ var seenModel = _.indexOf(seenModels, name) > -1;
+
+ delete references[name];
+
+ if (!seenModel) {
+ seenModels.push(name);
+
+ html += '<br />' + processModel(schema, name);
+ }
+ });
+ /* jshint ignore:end */
+ }
+
+ return html;
+
+ /////////////////////////////////
+
+ function addReference(schema, name, skipRef) {
+ var modelName = name;
+ var model;
+
+ if (schema.$ref) {
+ modelName = schema.title || Helpers.simpleRef(schema.$ref);
+ model = models[modelName];
+ } else if (_.isUndefined(name)) {
+ modelName = schema.title || 'Inline Model ' + (++inlineModels);
+ model = {definition: schema};
+ }
+
+ if (skipRef !== true) {
+ references[modelName] = _.isUndefined(model) ? {} : model.definition;
+ }
+
+ return modelName;
+ }
+
+ function primitiveToHTML(schema) {
+ var html = '<span class="propType">';
+ var type = schema.type || 'object';
+
+ if (schema.$ref) {
+ html += addReference(schema, Helpers.simpleRef(schema.$ref));
+ } else if (type === 'object') {
+ if (!_.isUndefined(schema.properties)) {
+ html += addReference(schema);
+ } else {
+ html += 'object';
+ }
+ } else if (type === 'array') {
+ html += 'Array[';
+
+ if (_.isArray(schema.items)) {
+ html += _.map(schema.items, addReference).join(',');
+ } else if (_.isPlainObject(schema.items)) {
+ if (_.isUndefined(schema.items.$ref)) {
+ if (!_.isUndefined(schema.items.type) && _.indexOf(['array', 'object'], schema.items.type) === -1) {
+ html += schema.items.type;
+ } else {
+ html += addReference(schema.items);
+ }
+ } else {
+ html += addReference(schema.items, Helpers.simpleRef(schema.items.$ref));
+ }
+ } else {
+ Helpers.log('Array type\'s \'items\' schema is not an array or an object, cannot process');
+ html += 'object';
+ }
+
+ html += ']';
+ } else {
+ html += schema.type;
+ }
+
+ html += '</span>';
+
+ return html;
+ }
+
+ function primitiveToOptionsHTML(schema, html) {
+ var options = '';
+ var type = schema.type || 'object';
+ var isArray = type === 'array';
+
+ if (isArray) {
+ if (_.isPlainObject(schema.items) && !_.isUndefined(schema.items.type)) {
+ type = schema.items.type;
+ } else {
+ type = 'object';
+ }
+ }
+
+ if (!_.isUndefined(schema.default)) {
+ options += optionHtml('Default', schema.default);
+ }
+
+ switch (type) {
+ case 'string':
+ if (schema.minLength) {
+ options += optionHtml('Min. Length', schema.minLength);
+ }
+
+ if (schema.maxLength) {
+ options += optionHtml('Max. Length', schema.maxLength);
+ }
+
+ if (schema.pattern) {
+ options += optionHtml('Reg. Exp.', schema.pattern);
+ }
+ break;
+ case 'integer':
+ case 'number':
+ if (schema.minimum) {
+ options += optionHtml('Min. Value', schema.minimum);
+ }
+
+ if (schema.exclusiveMinimum) {
+ options += optionHtml('Exclusive Min.', 'true');
+ }
+
+ if (schema.maximum) {
+ options += optionHtml('Max. Value', schema.maximum);
+ }
+
+ if (schema.exclusiveMaximum) {
+ options += optionHtml('Exclusive Max.', 'true');
+ }
+
+ if (schema.multipleOf) {
+ options += optionHtml('Multiple Of', schema.multipleOf);
+ }
+
+ break;
+ }
+
+ if (isArray) {
+ if (schema.minItems) {
+ options += optionHtml('Min. Items', schema.minItems);
+ }
+
+ if (schema.maxItems) {
+ options += optionHtml('Max. Items', schema.maxItems);
+ }
+
+ if (schema.uniqueItems) {
+ options += optionHtml('Unique Items', 'true');
+ }
+
+ if (schema.collectionFormat) {
+ options += optionHtml('Coll. Format', schema.collectionFormat);
+ }
+ }
+
+ if (_.isUndefined(schema.items)) {
+ if (_.isArray(schema.enum)) {
+ var enumString;
+
+ if (type === 'number' || type === 'integer') {
+ enumString = schema.enum.join(', ');
+ } else {
+ enumString = '"' + schema.enum.join('", "') + '"';
+ }
+
+ options += optionHtml('Enum', enumString);
+ }
+ }
+
+ if (options.length > 0) {
+ html = '<span class="propWrap">' + html + '<table class="optionsWrapper"><tr><th colspan="2">' + type + '</th></tr>' + options + '</table></span>';
+ }
+
+ return html;
+ }
+
+ function processModel(schema, name) {
+ var type = schema.type || 'object';
+ var isArray = schema.type === 'array';
+ var html = strongOpen + name + ' ' + (isArray ? '[' : '{') + strongClose;
+
+ if (name) {
+ seenModels.push(name);
+ }
+
+ if (isArray) {
+ if (_.isArray(schema.items)) {
+ html += '<div>' + _.map(schema.items, function (item) {
+ var type = item.type || 'object';
+
+ if (_.isUndefined(item.$ref)) {
+ if (_.indexOf(['array', 'object'], type) > -1) {
+ if (type === 'object' && _.isUndefined(item.properties)) {
+ return 'object';
+ } else {
+ return addReference(item);
+ }
+ } else {
+ return primitiveToOptionsHTML(item, type);
+ }
+ } else {
+ return addReference(item, Helpers.simpleRef(item.$ref));
+ }
+ }).join(',</div><div>');
+ } else if (_.isPlainObject(schema.items)) {
+ if (_.isUndefined(schema.items.$ref)) {
+ if (_.indexOf(['array', 'object'], schema.items.type || 'object') > -1) {
+ if ((_.isUndefined(schema.items.type) || schema.items.type === 'object') && _.isUndefined(schema.items.properties)) {
+ html += '<div>object</div>';
+ } else {
+ html += '<div>' + addReference(schema.items) + '</div>';
+ }
+ } else {
+ html += '<div>' + primitiveToOptionsHTML(schema.items, schema.items.type) + '</div>';
+ }
+ } else {
+ html += '<div>' + addReference(schema.items, Helpers.simpleRef(schema.items.$ref)) + '</div>';
+ }
+ } else {
+ Helpers.log('Array type\'s \'items\' property is not an array or an object, cannot process');
+ html += '<div>object</div>';
+ }
+ } else {
+ if (schema.$ref) {
+ html += '<div>' + addReference(schema, name) + '</div>';
+ } else if (type === 'object') {
+ html += '<div>';
+
+ if (_.isPlainObject(schema.properties)) {
+ html += _.map(schema.properties, function (property, name) {
+ var propertyIsRequired = (_.indexOf(schema.required, name) >= 0);
+ var cProperty = _.cloneDeep(property);
+
+ var requiredClass = propertyIsRequired ? 'required' : '';
+ var html = '<span class="propName ' + requiredClass + '">' + name + '</span> (';
+ var model;
+
+ // Allow macro to set the default value
+ cProperty.default = modelPropertyMacro(cProperty);
+
+ // Resolve the schema (Handle nested schemas)
+ cProperty = Helpers.resolveSchema(cProperty);
+
+ // We need to handle property references to primitives (Issue 339)
+ if (!_.isUndefined(cProperty.$ref)) {
+ model = models[Helpers.simpleRef(cProperty.$ref)];
+
+ if (!_.isUndefined(model) && _.indexOf([undefined, 'array', 'object'], model.definition.type) === -1) {
+ // Use referenced schema
+ cProperty = Helpers.resolveSchema(model.definition);
+ }
+ }
+
+ html += primitiveToHTML(cProperty);
+
+ if(!propertyIsRequired) {
+ html += ', <span class="propOptKey">optional</span>';
+ }
+
+ html += ')';
+
+ if (!_.isUndefined(cProperty.description)) {
+ html += ': ' + '<span class="propDesc">' + cProperty.description + '</span>';
+ }
+
+ if (cProperty.enum) {
+ html += ' = <span class="propVals">[\'' + cProperty.enum.join('\', \'') + '\']</span>';
+ }
+
+ return primitiveToOptionsHTML(cProperty, html);
+ }).join(',</div><div>');
+ }
+
+ html += '</div>';
+ } else {
+ html += '<div>' + primitiveToOptionsHTML(schema, type) + '</div>';
+ }
+ }
+
+ return html + strongOpen + (isArray ? ']' : '}') + strongClose;
+ }
+}
+
+},{"./helpers":4,"lodash-compat/array/indexOf":52,"lodash-compat/collection/forEach":57,"lodash-compat/collection/map":59,"lodash-compat/lang/cloneDeep":141,"lodash-compat/lang/isArray":143,"lodash-compat/lang/isEmpty":144,"lodash-compat/lang/isObject":147,"lodash-compat/lang/isPlainObject":148,"lodash-compat/lang/isUndefined":151,"lodash-compat/object/keys":152}],8:[function(require,module,exports){
+'use strict';
+
+var SwaggerHttp = require('./http');
+var _ = {
+ isObject: require('lodash-compat/lang/isObject')
+};
+
+var SwaggerSpecConverter = module.exports = function () {
+ this.errors = [];
+ this.warnings = [];
+ this.modelMap = {};
+};
+
+SwaggerSpecConverter.prototype.setDocumentationLocation = function (location) {
+ this.docLocation = location;
+};
+
+/**
+ * converts a resource listing OR api declaration
+ **/
+SwaggerSpecConverter.prototype.convert = function (obj, clientAuthorizations, callback) {
+ // not a valid spec
+ if(!obj || !Array.isArray(obj.apis)) {
+ return this.finish(callback, null);
+ }
+ this.clientAuthorizations = clientAuthorizations;
+
+ // create a new swagger object to return
+ var swagger = { swagger: '2.0' };
+
+ swagger.originalVersion = obj.swaggerVersion;
+
+ // add the info
+ this.apiInfo(obj, swagger);
+
+ // add security definitions
+ this.securityDefinitions(obj, swagger);
+
+ // take basePath into account
+ if (obj.basePath) {
+ this.setDocumentationLocation(obj.basePath);
+ }
+
+ // see if this is a single-file swagger definition
+ var isSingleFileSwagger = false;
+ var i;
+ for(i = 0; i < obj.apis.length; i++) {
+ var api = obj.apis[i];
+ if(Array.isArray(api.operations)) {
+ isSingleFileSwagger = true;
+ }
+ }
+ if(isSingleFileSwagger) {
+ this.declaration(obj, swagger);
+ this.finish(callback, swagger);
+ }
+ else {
+ this.resourceListing(obj, swagger, callback);
+ }
+};
+
+SwaggerSpecConverter.prototype.declaration = function(obj, swagger) {
+ var name, i, p, pos;
+ if(!obj.apis) {
+ return;
+ }
+
+ if (obj.basePath.indexOf('http://') === 0) {
+ p = obj.basePath.substring('http://'.length);
+ pos = p.indexOf('/');
+ if (pos > 0) {
+ swagger.host = p.substring(0, pos);
+ swagger.basePath = p.substring(pos);
+ }
+ else {
+ swagger.host = p;
+ swagger.basePath = '/';
+ }
+ } else if (obj.basePath.indexOf('https://') === 0) {
+ p = obj.basePath.substring('https://'.length);
+ pos = p.indexOf('/');
+ if (pos > 0) {
+ swagger.host = p.substring(0, pos);
+ swagger.basePath = p.substring(pos);
+ }
+ else {
+ swagger.host = p;
+ swagger.basePath = '/';
+ }
+ } else {
+ swagger.basePath = obj.basePath;
+ }
+
+ var resourceLevelAuth;
+ if(obj.authorizations) {
+ resourceLevelAuth = obj.authorizations;
+ }
+ if(obj.consumes) {
+ swagger.consumes = obj.consumes;
+ }
+ if(obj.produces) {
+ swagger.produces = obj.produces;
+ }
+
+ // build a mapping of id to name for 1.0 model resolutions
+ if(_.isObject(obj)) {
+ for(name in obj.models) {
+ var existingModel = obj.models[name];
+ var key = (existingModel.id || name);
+ this.modelMap[key] = name;
+ }
+ }
+
+ for(i = 0; i < obj.apis.length; i++) {
+ var api = obj.apis[i];
+ var path = api.path;
+ var operations = api.operations;
+ this.operations(path, obj.resourcePath, operations, resourceLevelAuth, swagger);
+ }
+
+ var models = obj.models || {};
+ this.models(models, swagger);
+};
+
+SwaggerSpecConverter.prototype.models = function(obj, swagger) {
+ if(!_.isObject(obj)) {
+ return;
+ }
+ var name;
+
+ swagger.definitions = swagger.definitions || {};
+ for(name in obj) {
+ var existingModel = obj[name];
+ var _enum = [];
+ var schema = { properties: {}};
+ var propertyName;
+ for(propertyName in existingModel.properties) {
+ var existingProperty = existingModel.properties[propertyName];
+ var property = {};
+ this.dataType(existingProperty, property);
+ if(existingProperty.description) {
+ property.description = existingProperty.description;
+ }
+ if(existingProperty['enum']) {
+ property['enum'] = existingProperty['enum'];
+ }
+ if(typeof existingProperty.required === 'boolean' && existingProperty.required === true) {
+ _enum.push(propertyName);
+ }
+ if(typeof existingProperty.required === 'string' && existingProperty.required === 'true') {
+ _enum.push(propertyName);
+ }
+ schema.properties[propertyName] = property;
+ }
+ if(_enum.length > 0) {
+ schema['enum'] = _enum;
+ }
+
+ schema.required = existingModel.required;
+ swagger.definitions[name] = schema;
+ }
+};
+
+SwaggerSpecConverter.prototype.extractTag = function(resourcePath) {
+ var pathString = resourcePath || 'default';
+ if(pathString.indexOf('http:') === 0 || pathString.indexOf('https:') === 0) {
+ pathString = pathString.split(['/']);
+ pathString = pathString[pathString.length -1].substring();
+ }
+ if(pathString.endsWith('.json')) {
+ pathString = pathString.substring(0, pathString.length - '.json'.length);
+ }
+ return pathString.replace('/','');
+};
+
+SwaggerSpecConverter.prototype.operations = function(path, resourcePath, obj, resourceLevelAuth, swagger) {
+ if(!Array.isArray(obj)) {
+ return;
+ }
+ var i;
+
+ if(!swagger.paths) {
+ swagger.paths = {};
+ }
+
+ var pathObj = swagger.paths[path] || {};
+ var tag = this.extractTag(resourcePath);
+ swagger.tags = swagger.tags || [];
+ var matched = false;
+ for(i = 0; i < swagger.tags.length; i++) {
+ var tagObject = swagger.tags[i];
+ if(tagObject.name === tag) {
+ matched = true;
+ }
+ }
+ if(!matched) {
+ swagger.tags.push({name: tag});
+ }
+
+ for(i = 0; i < obj.length; i++) {
+ var existingOperation = obj[i];
+ var method = (existingOperation.method || existingOperation.httpMethod).toLowerCase();
+ var operation = {tags: [tag]};
+ var existingAuthorizations = existingOperation.authorizations;
+
+ if(existingAuthorizations && Object.keys(existingAuthorizations).length === 0) {
+ existingAuthorizations = resourceLevelAuth;
+ }
+
+ if(typeof existingAuthorizations !== 'undefined') {
+ var scopesObject;
+ for(var key in existingAuthorizations) {
+ operation.security = operation.security || [];
+ var scopes = existingAuthorizations[key];
+ if(scopes) {
+ var securityScopes = [];
+ for(var j in scopes) {
+ securityScopes.push(scopes[j].scope);
+ }
+ scopesObject = {};
+ scopesObject[key] = securityScopes;
+ operation.security.push(scopesObject);
+ }
+ else {
+ scopesObject = {};
+ scopesObject[key] = [];
+ operation.security.push(scopesObject);
+ }
+ }
+ }
+
+ if(existingOperation.consumes) {
+ operation.consumes = existingOperation.consumes;
+ }
+ else if(swagger.consumes) {
+ operation.consumes = swagger.consumes;
+ }
+ if(existingOperation.produces) {
+ operation.produces = existingOperation.produces;
+ }
+ else if(swagger.produces) {
+ operation.produces = swagger.produces;
+ }
+ if(existingOperation.summary) {
+ operation.summary = existingOperation.summary;
+ }
+ if(existingOperation.notes) {
+ operation.description = existingOperation.notes;
+ }
+ if(existingOperation.nickname) {
+ operation.operationId = existingOperation.nickname;
+ }
+ if(existingOperation.deprecated) {
+ operation.deprecated = existingOperation.deprecated;
+ }
+
+ this.authorizations(existingAuthorizations, swagger);
+ this.parameters(operation, existingOperation.parameters, swagger);
+ this.responseMessages(operation, existingOperation, swagger);
+
+ pathObj[method] = operation;
+ }
+
+ swagger.paths[path] = pathObj;
+};
+
+SwaggerSpecConverter.prototype.responseMessages = function(operation, existingOperation) {
+ if(!_.isObject(existingOperation)) {
+ return;
+ }
+ // build default response from the operation (1.x)
+ var defaultResponse = {};
+ this.dataType(existingOperation, defaultResponse);
+ // TODO: look into the real problem of rendering responses in swagger-ui
+ // ....should reponseType have an implicit schema?
+ if(!defaultResponse.schema && defaultResponse.type) {
+ defaultResponse = {schema: defaultResponse};
+ }
+
+ operation.responses = operation.responses || {};
+
+ // grab from responseMessages (1.2)
+ var has200 = false;
+ if(Array.isArray(existingOperation.responseMessages)) {
+ var i;
+ var existingResponses = existingOperation.responseMessages;
+ for(i = 0; i < existingResponses.length; i++) {
+ var existingResponse = existingResponses[i];
+ var response = { description: existingResponse.message };
+ if(existingResponse.code === 200) {
+ has200 = true;
+ }
+ // Convert responseModel -> schema{$ref: responseModel}
+ if(existingResponse.responseModel) {
+ response.schema = {'$ref': existingResponse.responseModel};
+ }
+ operation.responses['' + existingResponse.code] = response;
+ }
+ }
+
+ if(has200) {
+ operation.responses['default'] = defaultResponse;
+ }
+ else {
+ operation.responses['200'] = defaultResponse;
+ }
+};
+
+SwaggerSpecConverter.prototype.authorizations = function(obj) {
+ // TODO
+ if(!_.isObject(obj)) {
+ return;
+ }
+};
+
+SwaggerSpecConverter.prototype.parameters = function(operation, obj) {
+ if(!Array.isArray(obj)) {
+ return;
+ }
+ var i;
+ for(i = 0; i < obj.length; i++) {
+ var existingParameter = obj[i];
+ var parameter = {};
+ parameter.name = existingParameter.name;
+ parameter.description = existingParameter.description;
+ parameter.required = existingParameter.required;
+ parameter.in = existingParameter.paramType;
+
+ // per #168
+ if(parameter.in === 'body') {
+ parameter.name = 'body';
+ }
+ if(parameter.in === 'form') {
+ parameter.in = 'formData';
+ }
+
+ if(existingParameter.enum) {
+ parameter.enum = existingParameter.enum;
+ }
+
+ if(existingParameter.allowMultiple === true || existingParameter.allowMultiple === 'true') {
+ var innerType = {};
+ this.dataType(existingParameter, innerType);
+ parameter.type = 'array';
+ parameter.items = innerType;
+
+ if(existingParameter.allowableValues) {
+ var av = existingParameter.allowableValues;
+ if(av.valueType === 'LIST') {
+ parameter['enum'] = av.values;
+ }
+ }
+ }
+ else {
+ this.dataType(existingParameter, parameter);
+ }
+ if(typeof existingParameter.defaultValue !== 'undefined') {
+ parameter.default = existingParameter.defaultValue;
+ }
+
+ operation.parameters = operation.parameters || [];
+ operation.parameters.push(parameter);
+ }
+};
+
+SwaggerSpecConverter.prototype.dataType = function(source, target) {
+ if(!_.isObject(source)) {
+ return;
+ }
+
+ if(source.minimum) {
+ target.minimum = source.minimum;
+ }
+ if(source.maximum) {
+ target.maximum = source.maximum;
+ }
+ if (source.format) {
+ target.format = source.format;
+ }
+
+ // default can be 'false'
+ if(typeof source.defaultValue !== 'undefined') {
+ target.default = source.defaultValue;
+ }
+
+ var jsonSchemaType = this.toJsonSchema(source);
+ if(jsonSchemaType) {
+ target = target || {};
+ if(jsonSchemaType.type) {
+ target.type = jsonSchemaType.type;
+ }
+ if(jsonSchemaType.format) {
+ target.format = jsonSchemaType.format;
+ }
+ if(jsonSchemaType.$ref) {
+ target.schema = {$ref: jsonSchemaType.$ref};
+ }
+ if(jsonSchemaType.items) {
+ target.items = jsonSchemaType.items;
+ }
+ }
+};
+
+SwaggerSpecConverter.prototype.toJsonSchema = function(source) {
+ if(!source) {
+ return 'object';
+ }
+ var detectedType = (source.type || source.dataType || source.responseClass || '');
+ var lcType = detectedType.toLowerCase();
+ var format = (source.format || '').toLowerCase();
+
+ if(lcType.indexOf('list[') === 0) {
+ var innerType = detectedType.substring(5, detectedType.length - 1);
+ var jsonType = this.toJsonSchema({type: innerType});
+ return {type: 'array', items: jsonType};
+ }
+ else if(lcType === 'int' || (lcType === 'integer' && format === 'int32'))
+ {return {type: 'integer', format: 'int32'};}
+ else if(lcType === 'long' || (lcType === 'integer' && format === 'int64'))
+ {return {type: 'integer', format: 'int64'};}
+ else if(lcType === 'integer')
+ {return {type: 'integer', format: 'int64'};}
+ else if(lcType === 'float' || (lcType === 'number' && format === 'float'))
+ {return {type: 'number', format: 'float'};}
+ else if(lcType === 'double' || (lcType === 'number' && format === 'double'))
+ {return {type: 'number', format: 'double'};}
+ else if((lcType === 'string' && format === 'date-time') || (lcType === 'date'))
+ {return {type: 'string', format: 'date-time'};}
+ else if(lcType === 'string')
+ {return {type: 'string'};}
+ else if(lcType === 'file')
+ {return {type: 'file'};}
+ else if(lcType === 'boolean')
+ {return {type: 'boolean'};}
+ else if(lcType === 'array' || lcType === 'list') {
+ if(source.items) {
+ var it = this.toJsonSchema(source.items);
+ return {type: 'array', items: it};
+ }
+ else {
+ return {type: 'array', items: {type: 'object'}};
+ }
+ }
+ else if(source.$ref) {
+ return {$ref: '#/definitions/' + this.modelMap[source.$ref] || source.$ref};
+ }
+ else if(lcType === 'void' || lcType === '')
+ {return {};}
+ else {
+ return {$ref: '#/definitions/' + this.modelMap[source.type] || source.type};
+ }
+};
+
+SwaggerSpecConverter.prototype.resourceListing = function(obj, swagger, callback) {
+ var i;
+ var processedCount = 0; // jshint ignore:line
+ var self = this; // jshint ignore:line
+ var expectedCount = obj.apis.length;
+ var _swagger = swagger; // jshint ignore:line
+
+ if(expectedCount === 0) {
+ this.finish(callback, swagger);
+ }
+
+ for(i = 0; i < expectedCount; i++) {
+ var api = obj.apis[i];
+ var path = api.path;
+ var absolutePath = this.getAbsolutePath(obj.swaggerVersion, this.docLocation, path);
+
+ if(api.description) {
+ swagger.tags = swagger.tags || [];
+ swagger.tags.push({
+ name : this.extractTag(api.path),
+ description : api.description || ''
+ });
+ }
+ var http = {
+ url: absolutePath,
+ headers: {accept: 'application/json'},
+ on: {},
+ method: 'get'
+ };
+ /* jshint ignore:start */
+ http.on.response = function(data) {
+ processedCount += 1;
+ var obj = data.obj;
+ if(obj) {
+ self.declaration(obj, _swagger);
+ }
+ if(processedCount === expectedCount) {
+ self.finish(callback, _swagger);
+ }
+ };
+ http.on.error = function(data) {
+ console.error(data);
+ processedCount += 1;
+ if(processedCount === expectedCount) {
+ self.finish(callback, _swagger);
+ }
+ };
+ /* jshint ignore:end */
+
+ if(this.clientAuthorizations && typeof this.clientAuthorizations.apply === 'function') {
+ this.clientAuthorizations.apply(http);
+ }
+
+ new SwaggerHttp().execute(http);
+ }
+};
+
+SwaggerSpecConverter.prototype.getAbsolutePath = function(version, docLocation, path) {
+ if(version === '1.0') {
+ if(docLocation.endsWith('.json')) {
+ // get root path
+ var pos = docLocation.lastIndexOf('/');
+ if(pos > 0) {
+ docLocation = docLocation.substring(0, pos);
+ }
+ }
+ }
+
+ var location = docLocation;
+ if(path.indexOf('http://') === 0 || path.indexOf('https://') === 0) {
+ location = path;
+ }
+ else {
+ if(docLocation.endsWith('/')) {
+ location = docLocation.substring(0, docLocation.length - 1);
+ }
+ location += path;
+ }
+ location = location.replace('{format}', 'json');
+ return location;
+};
+
+SwaggerSpecConverter.prototype.securityDefinitions = function(obj, swagger) {
+ if(obj.authorizations) {
+ var name;
+ for(name in obj.authorizations) {
+ var isValid = false;
+ var securityDefinition = {};
+ var definition = obj.authorizations[name];
+ if(definition.type === 'apiKey') {
+ securityDefinition.type = 'apiKey';
+ securityDefinition.in = definition.passAs;
+ securityDefinition.name = definition.keyname || name;
+ isValid = true;
+ }
+ else if(definition.type === 'oauth2') {
+ var existingScopes = definition.scopes || [];
+ var scopes = {};
+ var i;
+ for(i in existingScopes) {
+ var scope = existingScopes[i];
+ scopes[scope.scope] = scope.description;
+ }
+ securityDefinition.type = 'oauth2';
+ if(i > 0) {
+ securityDefinition.scopes = scopes;
+ }
+ if(definition.grantTypes) {
+ if(definition.grantTypes.implicit) {
+ var implicit = definition.grantTypes.implicit;
+ securityDefinition.flow = 'implicit';
+ securityDefinition.authorizationUrl = implicit.loginEndpoint;
+ isValid = true;
+ }
+ /* jshint ignore:start */
+ if(definition.grantTypes['authorization_code']) {
+ if(!securityDefinition.flow) {
+ // cannot set if flow is already defined
+ var authCode = definition.grantTypes['authorization_code'];
+ securityDefinition.flow = 'accessCode';
+ securityDefinition.authorizationUrl = authCode.tokenRequestEndpoint.url;
+ securityDefinition.tokenUrl = authCode.tokenEndpoint.url;
+ isValid = true;
+ }
+ }
+ /* jshint ignore:end */
+ }
+ }
+ if(isValid) {
+ swagger.securityDefinitions = swagger.securityDefinitions || {};
+ swagger.securityDefinitions[name] = securityDefinition;
+ }
+ }
+ }
+};
+
+SwaggerSpecConverter.prototype.apiInfo = function(obj, swagger) {
+ // info section
+ if(obj.info) {
+ var info = obj.info;
+ swagger.info = {};
+
+ if(info.contact) {
+ swagger.info.contact = {};
+ swagger.info.contact.email = info.contact;
+ }
+ if(info.description) {
+ swagger.info.description = info.description;
+ }
+ if(info.title) {
+ swagger.info.title = info.title;
+ }
+ if(info.termsOfServiceUrl) {
+ swagger.info.termsOfService = info.termsOfServiceUrl;
+ }
+ if(info.license || info.licenseUrl) {
+ swagger.license = {};
+ if(info.license) {
+ swagger.license.name = info.license;
+ }
+ if(info.licenseUrl) {
+ swagger.license.url = info.licenseUrl;
+ }
+ }
+ }
+ else {
+ this.warnings.push('missing info section');
+ }
+};
+
+SwaggerSpecConverter.prototype.finish = function (callback, obj) {
+ callback(obj);
+};
+
+},{"./http":5,"lodash-compat/lang/isObject":147}],9:[function(require,module,exports){
+'use strict';
+
+var _ = {
+ isPlainObject: require('lodash-compat/lang/isPlainObject'),
+ isString: require('lodash-compat/lang/isString'),
+};
+
+var SchemaMarkup = require('../schema-markup.js');
+var jsyaml = require('js-yaml');
+
+var Model = module.exports = function (name, definition, models, modelPropertyMacro) {
+ this.definition = definition || {};
+ this.isArray = definition.type === 'array';
+ this.models = models || {};
+ this.name = definition.title || name || 'Inline Model';
+ this.modelPropertyMacro = modelPropertyMacro || function (property) {
+ return property.default;
+ };
+
+ return this;
+};
+
+Model.prototype.createJSONSample = Model.prototype.getSampleValue = function (modelsToIgnore) {
+ modelsToIgnore = modelsToIgnore || {};
+
+ modelsToIgnore[this.name] = this;
+
+ // Response support
+ if (this.examples && _.isPlainObject(this.examples) && this.examples['application/json']) {
+ this.definition.example = this.examples['application/json'];
+
+ if (_.isString(this.definition.example)) {
+ this.definition.example = jsyaml.safeLoad(this.definition.example);
+ }
+ } else if (!this.definition.example) {
+ this.definition.example = this.examples;
+ }
+
+ return SchemaMarkup.schemaToJSON(this.definition, this.models, modelsToIgnore, this.modelPropertyMacro);
+};
+
+Model.prototype.getMockSignature = function () {
+ return SchemaMarkup.schemaToHTML(this.name, this.definition, this.models, this.modelPropertyMacro);
+};
+
+},{"../schema-markup.js":7,"js-yaml":21,"lodash-compat/lang/isPlainObject":148,"lodash-compat/lang/isString":149}],10:[function(require,module,exports){
+'use strict';
+
+var _ = {
+ cloneDeep: require('lodash-compat/lang/cloneDeep'),
+ isUndefined: require('lodash-compat/lang/isUndefined'),
+ isEmpty: require('lodash-compat/lang/isEmpty'),
+ isObject: require('lodash-compat/lang/isObject')
+};
+var helpers = require('../helpers');
+var Model = require('./model');
+var SwaggerHttp = require('../http');
+
+var Operation = module.exports = function (parent, scheme, operationId, httpMethod, path, args, definitions, models, clientAuthorizations) {
+ var errors = [];
+
+ parent = parent || {};
+ args = args || {};
+
+ if(parent && parent.options) {
+ this.client = parent.options.client || null;
+ this.responseInterceptor = parent.options.responseInterceptor || null;
+ }
+ this.authorizations = args.security;
+ this.basePath = parent.basePath || '/';
+ this.clientAuthorizations = clientAuthorizations;
+ this.consumes = args.consumes || parent.consumes || ['application/json'];
+ this.produces = args.produces || parent.produces || ['application/json'];
+ this.deprecated = args.deprecated;
+ this.description = args.description;
+ this.host = parent.host || 'localhost';
+ this.method = (httpMethod || errors.push('Operation ' + operationId + ' is missing method.'));
+ this.models = models || {};
+ this.nickname = (operationId || errors.push('Operations must have a nickname.'));
+ this.operation = args;
+ this.operations = {};
+ this.parameters = args !== null ? (args.parameters || []) : {};
+ this.parent = parent;
+ this.path = (path || errors.push('Operation ' + this.nickname + ' is missing path.'));
+ this.responses = (args.responses || {});
+ this.scheme = scheme || parent.scheme || 'http';
+ this.schemes = args.schemes || parent.schemes;
+ this.security = args.security;
+ this.summary = args.summary || '';
+ this.type = null;
+ this.useJQuery = parent.useJQuery;
+ this.parameterMacro = parent.parameterMacro || function (operation, parameter) {
+ return parameter.default;
+ };
+
+ this.inlineModels = [];
+
+ if (typeof this.deprecated === 'string') {
+ switch(this.deprecated.toLowerCase()) {
+ case 'true': case 'yes': case '1': {
+ this.deprecated = true;
+ break;
+ }
+
+ case 'false': case 'no': case '0': case null: {
+ this.deprecated = false;
+ break;
+ }
+
+ default: this.deprecated = Boolean(this.deprecated);
+ }
+ }
+
+ var i, model;
+
+ if (definitions) {
+ // add to global models
+ var key;
+
+ for (key in definitions) {
+ model = new Model(key, definitions[key], this.models, parent.modelPropertyMacro);
+
+ if (model) {
+ this.models[key] = model;
+ }
+ }
+ }
+ else {
+ definitions = {};
+ }
+
+ for (i = 0; i < this.parameters.length; i++) {
+ var param = this.parameters[i];
+
+ // Allow macro to set the default value
+ param.default = this.parameterMacro(this, param);
+
+ if (param.type === 'array') {
+ param.isList = true;
+ param.allowMultiple = true;
+ // the enum can be defined at the items level
+ if (param.items && param.items.enum) {
+ param['enum'] = param.items.enum;
+ }
+ }
+
+ var innerType = this.getType(param);
+
+ if (innerType && innerType.toString().toLowerCase() === 'boolean') {
+ param.allowableValues = {};
+ param.isList = true;
+ param['enum'] = [true, false]; // use actual primitives
+ }
+
+ if(param['x-examples']) {
+ var d = param['x-examples'].default;
+ if(typeof d !== 'undefined') {
+ param.default = d;
+ }
+ }
+
+ if (typeof param['enum'] !== 'undefined') {
+ var id;
+
+ param.allowableValues = {};
+ param.allowableValues.values = [];
+ param.allowableValues.descriptiveValues = [];
+
+ for (id = 0; id < param['enum'].length; id++) {
+ var value = param['enum'][id];
+ var isDefault = (value === param.default || value+'' === param.default);
+
+ param.allowableValues.values.push(value);
+ // Always have string for descriptive values....
+ param.allowableValues.descriptiveValues.push({value : value+'', isDefault: isDefault});
+ }
+ }
+
+ if (param.type === 'array') {
+ innerType = [innerType];
+
+ if (typeof param.allowableValues === 'undefined') {
+ // can't show as a list if no values to select from
+ delete param.isList;
+ delete param.allowMultiple;
+ }
+ }
+
+ param.signature = this.getModelSignature(innerType, this.models).toString();
+ param.sampleJSON = this.getModelSampleJSON(innerType, this.models);
+ param.responseClassSignature = param.signature;
+ }
+
+ var defaultResponseCode, response, responses = this.responses;
+
+ if (responses['200']) {
+ response = responses['200'];
+ defaultResponseCode = '200';
+ } else if (responses['201']) {
+ response = responses['201'];
+ defaultResponseCode = '201';
+ } else if (responses['202']) {
+ response = responses['202'];
+ defaultResponseCode = '202';
+ } else if (responses['203']) {
+ response = responses['203'];
+ defaultResponseCode = '203';
+ } else if (responses['204']) {
+ response = responses['204'];
+ defaultResponseCode = '204';
+ } else if (responses['205']) {
+ response = responses['205'];
+ defaultResponseCode = '205';
+ } else if (responses['206']) {
+ response = responses['206'];
+ defaultResponseCode = '206';
+ } else if (responses['default']) {
+ response = responses['default'];
+ defaultResponseCode = 'default';
+ }
+
+ if (response && response.schema) {
+ var resolvedModel = this.resolveModel(response.schema, definitions);
+ var successResponse;
+
+ delete responses[defaultResponseCode];
+
+ if (resolvedModel) {
+ this.successResponse = {};
+ successResponse = this.successResponse[defaultResponseCode] = resolvedModel;
+ } else if (!response.schema.type || response.schema.type === 'object' || response.schema.type === 'array') {
+ // Inline model
+ this.successResponse = {};
+ successResponse = this.successResponse[defaultResponseCode] = new Model(undefined, response.schema || {}, this.models, parent.modelPropertyMacro);
+ } else {
+ // Primitive
+ this.successResponse = {};
+ successResponse = this.successResponse[defaultResponseCode] = response.schema;
+ }
+
+ if (successResponse) {
+ // Attach response properties
+ if (response.description) {
+ successResponse.description = response.description;
+ }
+
+ if (response.examples) {
+ successResponse.examples = response.examples;
+ }
+
+ if (response.headers) {
+ successResponse.headers = response.headers;
+ }
+ }
+
+ this.type = response;
+ }
+
+ if (errors.length > 0) {
+ if (this.resource && this.resource.api && this.resource.api.fail) {
+ this.resource.api.fail(errors);
+ }
+ }
+
+ return this;
+};
+
+Operation.prototype.isDefaultArrayItemValue = function(value, param) {
+ if (param.default && Array.isArray(param.default)) {
+ return param.default.indexOf(value) !== -1;
+ }
+ return value === param.default;
+};
+
+Operation.prototype.getType = function (param) {
+ var type = param.type;
+ var format = param.format;
+ var isArray = false;
+ var str;
+
+ if (type === 'integer' && format === 'int32') {
+ str = 'integer';
+ } else if (type === 'integer' && format === 'int64') {
+ str = 'long';
+ } else if (type === 'integer') {
+ str = 'integer';
+ } else if (type === 'string') {
+ if (format === 'date-time') {
+ str = 'date-time';
+ } else if (format === 'date') {
+ str = 'date';
+ } else {
+ str = 'string';
+ }
+ } else if (type === 'number' && format === 'float') {
+ str = 'float';
+ } else if (type === 'number' && format === 'double') {
+ str = 'double';
+ } else if (type === 'number') {
+ str = 'double';
+ } else if (type === 'boolean') {
+ str = 'boolean';
+ } else if (type === 'array') {
+ isArray = true;
+
+ if (param.items) {
+ str = this.getType(param.items);
+ }
+ }
+
+ if (param.$ref) {
+ str = helpers.simpleRef(param.$ref);
+ }
+
+ var schema = param.schema;
+
+ if (schema) {
+ var ref = schema.$ref;
+
+ if (ref) {
+ ref = helpers.simpleRef(ref);
+
+ if (isArray) {
+ return [ ref ];
+ } else {
+ return ref;
+ }
+ } else {
+ // If inline schema, we add it our interal hash -> which gives us it's ID (int)
+ if(schema.type === 'object') {
+ return this.addInlineModel(schema);
+ }
+ return this.getType(schema);
+ }
+ }
+ if (isArray) {
+ return [ str ];
+ } else {
+ return str;
+ }
+};
+
+/**
+ * adds an inline schema (model) to a hash, where we can ref it later
+ * @param {object} schema a schema
+ * @return {number} the ID of the schema being added, or null
+ **/
+Operation.prototype.addInlineModel = function (schema) {
+ var len = this.inlineModels.length;
+ var model = this.resolveModel(schema, {});
+ if(model) {
+ this.inlineModels.push(model);
+ return 'Inline Model '+len; // return string ref of the inline model (used with #getInlineModel)
+ }
+ return null; // report errors?
+};
+
+/**
+ * gets the internal ref to an inline model
+ * @param {string} inline_str a string reference to an inline model
+ * @return {Model} the model being referenced. Or null
+ **/
+Operation.prototype.getInlineModel = function(inlineStr) {
+ if(/^Inline Model \d+$/.test(inlineStr)) {
+ var id = parseInt(inlineStr.substr('Inline Model'.length).trim(),10); //
+ var model = this.inlineModels[id];
+ return model;
+ }
+ // I'm returning null here, should I rather throw an error?
+ return null;
+};
+
+Operation.prototype.resolveModel = function (schema, definitions) {
+ if (typeof schema.$ref !== 'undefined') {
+ var ref = schema.$ref;
+
+ if (ref.indexOf('#/definitions/') === 0) {
+ ref = ref.substring('#/definitions/'.length);
+ }
+
+ if (definitions[ref]) {
+ return new Model(ref, definitions[ref], this.models, this.parent.modelPropertyMacro);
+ }
+ // schema must at least be an object to get resolved to an inline Model
+ } else if (schema && typeof schema === 'object' &&
+ (schema.type === 'object' || _.isUndefined(schema.type))) {
+ return new Model(undefined, schema, this.models, this.parent.modelPropertyMacro);
+ }
+
+ return null;
+};
+
+Operation.prototype.help = function (dontPrint) {
+ var out = this.nickname + ': ' + this.summary + '\n';
+
+ for (var i = 0; i < this.parameters.length; i++) {
+ var param = this.parameters[i];
+ var typeInfo = param.signature;
+
+ out += '\n * ' + param.name + ' (' + typeInfo + '): ' + param.description;
+ }
+
+ if (typeof dontPrint === 'undefined') {
+ helpers.log(out);
+ }
+
+ return out;
+};
+
+Operation.prototype.getModelSignature = function (type, definitions) {
+ var isPrimitive, listType;
+
+ if (type instanceof Array) {
+ listType = true;
+ type = type[0];
+ }
+
+ // Convert undefined to string of 'undefined'
+ if (typeof type === 'undefined') {
+ type = 'undefined';
+ isPrimitive = true;
+
+ } else if (definitions[type]){
+ // a model def exists?
+ type = definitions[type]; /* Model */
+ isPrimitive = false;
+
+ } else if (this.getInlineModel(type)) {
+ type = this.getInlineModel(type); /* Model */
+ isPrimitive = false;
+
+ } else {
+ // We default to primitive
+ isPrimitive = true;
+ }
+
+ if (isPrimitive) {
+ if (listType) {
+ return 'Array[' + type + ']';
+ } else {
+ return type.toString();
+ }
+ } else {
+ if (listType) {
+ return 'Array[' + type.getMockSignature() + ']';
+ } else {
+ return type.getMockSignature();
+ }
+ }
+};
+
+Operation.prototype.supportHeaderParams = function () {
+ return true;
+};
+
+Operation.prototype.supportedSubmitMethods = function () {
+ return this.parent.supportedSubmitMethods;
+};
+
+Operation.prototype.getHeaderParams = function (args) {
+ var headers = this.setContentTypes(args, {});
+
+ for (var i = 0; i < this.parameters.length; i++) {
+ var param = this.parameters[i];
+
+ if (typeof args[param.name] !== 'undefined') {
+ if (param.in === 'header') {
+ var value = args[param.name];
+
+ if (Array.isArray(value)) {
+ value = value.toString();
+ }
+
+ headers[param.name] = value;
+ }
+ }
+ }
+
+ return headers;
+};
+
+Operation.prototype.urlify = function (args) {
+ var formParams = {};
+ var requestUrl = this.path;
+ var querystring = ''; // grab params from the args, build the querystring along the way
+
+ for (var i = 0; i < this.parameters.length; i++) {
+ var param = this.parameters[i];
+
+ if (typeof args[param.name] !== 'undefined') {
+ if (param.in === 'path') {
+ var reg = new RegExp('\{' + param.name + '\}', 'gi');
+ var value = args[param.name];
+
+ if (Array.isArray(value)) {
+ value = this.encodePathCollection(param.collectionFormat, param.name, value);
+ } else {
+ value = this.encodePathParam(value);
+ }
+
+ requestUrl = requestUrl.replace(reg, value);
+ } else if (param.in === 'query' && typeof args[param.name] !== 'undefined') {
+ if (querystring === '') {
+ querystring += '?';
+ } else {
+ querystring += '&';
+ }
+
+ if (typeof param.collectionFormat !== 'undefined') {
+ var qp = args[param.name];
+
+ if (Array.isArray(qp)) {
+ querystring += this.encodeQueryCollection(param.collectionFormat, param.name, qp);
+ } else {
+ querystring += this.encodeQueryParam(param.name) + '=' + this.encodeQueryParam(args[param.name]);
+ }
+ } else {
+ querystring += this.encodeQueryParam(param.name) + '=' + this.encodeQueryParam(args[param.name]);
+ }
+ } else if (param.in === 'formData') {
+ formParams[param.name] = args[param.name];
+ }
+ }
+ }
+ var url = this.scheme + '://' + this.host;
+
+ if (this.basePath !== '/') {
+ url += this.basePath;
+ }
+ return url + requestUrl + querystring;
+};
+
+Operation.prototype.getMissingParams = function (args) {
+ var missingParams = []; // check required params, track the ones that are missing
+ var i;
+
+ for (i = 0; i < this.parameters.length; i++) {
+ var param = this.parameters[i];
+
+ if (param.required === true) {
+ if (typeof args[param.name] === 'undefined') {
+ missingParams = param.name;
+ }
+ }
+ }
+
+ return missingParams;
+};
+
+Operation.prototype.getBody = function (headers, args, opts) {
+ var formParams = {}, body, key, value, hasBody = false;
+
+ for (var i = 0; i < this.parameters.length; i++) {
+ var param = this.parameters[i];
+
+ if (typeof args[param.name] !== 'undefined') {
+ if (param.in === 'body') {
+ body = args[param.name];
+ } else if (param.in === 'formData') {
+ formParams[param.name] = args[param.name];
+ }
+ }
+ else {
+ if(param.in === 'body') {
+ hasBody = true;
+ }
+ }
+ }
+
+ // if body is null and hasBody is true, AND a JSON body is requested, send empty {}
+ if(hasBody && typeof body === 'undefined') {
+ var contentType = headers['Content-Type'];
+ if(contentType && contentType.indexOf('application/json') === 0) {
+ body = '{}';
+ }
+ }
+
+ // handle form params
+ if (headers['Content-Type'] === 'application/x-www-form-urlencoded' && param.in === 'formData') {
+ var encoded = '';
+
+ for (key in formParams) {
+ value = formParams[key];
+
+ if (typeof value !== 'undefined') {
+ if (encoded !== '') {
+ encoded += '&';
+ }
+
+ encoded += encodeURIComponent(key) + '=' + encodeURIComponent(value);
+ }
+ }
+
+ body = encoded;
+ } else if (headers['Content-Type'] && headers['Content-Type'].indexOf('multipart/form-data') >= 0) {
+ if (opts.useJQuery) {
+ var bodyParam = new FormData();
+
+ bodyParam.type = 'formData';
+
+ for (key in formParams) {
+ value = args[key];
+
+ if (typeof value !== 'undefined') {
+ // required for jquery file upload
+ if (value.type === 'file' && value.value) {
+ delete headers['Content-Type'];
+
+ bodyParam.append(key, value.value);
+ } else {
+ bodyParam.append(key, value);
+ }
+ }
+ }
+
+ body = bodyParam;
+ }
+ }
+
+ return body;
+};
+
+/**
+ * gets sample response for a single operation
+ **/
+Operation.prototype.getModelSampleJSON = function (type, models) {
+ var listType, sampleJson, innerType;
+ models = models || {};
+
+ listType = (type instanceof Array);
+ innerType = listType ? type[0] : type;
+
+ if(models[innerType]) {
+ sampleJson = models[innerType].createJSONSample();
+ } else if (this.getInlineModel(innerType)){
+ sampleJson = this.getInlineModel(innerType).createJSONSample(); // may return null, if type isn't correct
+ }
+
+
+ if (sampleJson) {
+ sampleJson = listType ? [sampleJson] : sampleJson;
+
+ if (typeof sampleJson === 'string') {
+ return sampleJson;
+ } else if (_.isObject(sampleJson)) {
+ var t = sampleJson;
+
+ if (sampleJson instanceof Array && sampleJson.length > 0) {
+ t = sampleJson[0];
+ }
+
+ if (t.nodeName) {
+ var xmlString = new XMLSerializer().serializeToString(t);
+
+ return this.formatXml(xmlString);
+ } else {
+ return JSON.stringify(sampleJson, null, 2);
+ }
+ } else {
+ return sampleJson;
+ }
+ }
+};
+
+/**
+ * legacy binding
+ **/
+Operation.prototype.do = function (args, opts, callback, error, parent) {
+ return this.execute(args, opts, callback, error, parent);
+};
+
+/**
+ * executes an operation
+ **/
+Operation.prototype.execute = function (arg1, arg2, arg3, arg4, parent) {
+ var args = arg1 || {};
+ var opts = {}, success, error;
+
+ if (_.isObject(arg2)) {
+ opts = arg2;
+ success = arg3;
+ error = arg4;
+ }
+
+ if(this.client) {
+ opts.client = this.client;
+ }
+ if(this.responseInterceptor) {
+ opts.responseInterceptor = this.responseInterceptor;
+ }
+
+
+ if (typeof arg2 === 'function') {
+ success = arg2;
+ error = arg3;
+ }
+
+ success = (success || this.parent.defaultSuccessCallback || helpers.log);
+ error = (error || this.parent.defaultErrorCallback || helpers.log);
+
+
+ if (typeof opts.useJQuery === 'undefined') {
+ opts.useJQuery = this.useJQuery;
+ }
+ var missingParams = this.getMissingParams(args);
+
+ if (missingParams.length > 0) {
+ var message = 'missing required params: ' + missingParams;
+
+ helpers.fail(message);
+ error(message);
+
+ return;
+ }
+
+ var allHeaders = this.getHeaderParams(args);
+ var contentTypeHeaders = this.setContentTypes(args, opts);
+ var headers = {}, attrname;
+
+ for (attrname in allHeaders) { headers[attrname] = allHeaders[attrname]; }
+ for (attrname in contentTypeHeaders) { headers[attrname] = contentTypeHeaders[attrname]; }
+
+ var body = this.getBody(contentTypeHeaders, args, opts);
+ var url = this.urlify(args);
+
+ if(url.indexOf('.{format}') > 0) {
+ if(headers) {
+ var format = headers.Accept || headers.accept;
+ if(format && format.indexOf('json') > 0) {
+ url = url.replace('.{format}', '.json');
+ }
+ else if(format && format.indexOf('xml') > 0) {
+ url = url.replace('.{format}', '.xml');
+ }
+ }
+ }
+
+ var obj = {
+ url: url,
+ method: this.method.toUpperCase(),
+ body: body,
+ useJQuery: opts.useJQuery,
+ headers: headers,
+ on: {
+ response: function (response) {
+ return success(response, parent);
+ },
+ error: function (response) {
+ return error(response, parent);
+ }
+ }
+ };
+
+ this.clientAuthorizations.apply(obj, this.operation.security);
+ if (opts.mock === true) {
+ return obj;
+ } else {
+ new SwaggerHttp().execute(obj, opts);
+ }
+};
+
+function itemByPriority(col, itemPriority) {
+
+ // No priorities? return first...
+ if(_.isEmpty(itemPriority)) {
+ return col[0];
+ }
+
+ for (var i = 0, len = itemPriority.length; i < len; i++) {
+ if(col.indexOf(itemPriority[i]) > -1) {
+ return itemPriority[i];
+ }
+ }
+
+ // Otherwise return first
+ return col[0];
+}
+
+Operation.prototype.setContentTypes = function (args, opts) {
+ // default type
+ var allDefinedParams = this.parameters;
+ var body;
+ var consumes = args.parameterContentType || itemByPriority(this.consumes, ['application/json', 'application/yaml']);
+ var accepts = opts.responseContentType || itemByPriority(this.produces, ['application/json', 'application/yaml']);
+ var definedFileParams = [];
+ var definedFormParams = [];
+ var headers = {};
+ var i;
+
+ // get params from the operation and set them in definedFileParams, definedFormParams, headers
+ for (i = 0; i < allDefinedParams.length; i++) {
+ var param = allDefinedParams[i];
+
+ if (param.in === 'formData') {
+ if (param.type === 'file') {
+ definedFileParams.push(param);
+ } else {
+ definedFormParams.push(param);
+ }
+ } else if (param.in === 'header' && opts) {
+ var key = param.name;
+ var headerValue = opts[param.name];
+
+ if (typeof opts[param.name] !== 'undefined') {
+ headers[key] = headerValue;
+ }
+ } else if (param.in === 'body' && typeof args[param.name] !== 'undefined') {
+ body = args[param.name];
+ }
+ }
+
+ // if there's a body, need to set the consumes header via requestContentType
+ if (this.method === 'post' || this.method === 'put' || this.method === 'patch' ||
+ (this.method === 'delete' && body) ) {
+ if (opts.requestContentType) {
+ consumes = opts.requestContentType;
+ }
+ // if any form params, content type must be set
+ if (definedFormParams.length > 0) {
+ if (opts.requestContentType) { // override if set
+ consumes = opts.requestContentType;
+ } else if (definedFileParams.length > 0) { // if a file, must be multipart/form-data
+ consumes = 'multipart/form-data';
+ } else { // default to x-www-from-urlencoded
+ consumes = 'application/x-www-form-urlencoded';
+ }
+ }
+ }
+ else {
+ consumes = null;
+ }
+
+ if (consumes && this.consumes) {
+ if (this.consumes.indexOf(consumes) === -1) {
+ helpers.log('server doesn\'t consume ' + consumes + ', try ' + JSON.stringify(this.consumes));
+ }
+ }
+
+ if (!this.matchesAccept(accepts)) {
+ helpers.log('server can\'t produce ' + accepts);
+ }
+
+ if ((consumes && body !== '') || (consumes === 'application/x-www-form-urlencoded')) {
+ headers['Content-Type'] = consumes;
+ }
+
+ if (accepts) {
+ headers.Accept = accepts;
+ }
+
+ return headers;
+};
+
+/**
+ * Returns true if the request accepts header matches anything in this.produces.
+ * If this.produces contains * / *, ignore the accept header.
+ * @param {string=} accepts The client request accept header.
+ * @return {boolean}
+ */
+Operation.prototype.matchesAccept = function(accepts) {
+ // no accepts or produces, no problem!
+ if (!accepts || !this.produces) {
+ return true;
+ }
+ return this.produces.indexOf(accepts) !== -1 || this.produces.indexOf('*/*') !== -1;
+};
+
+Operation.prototype.asCurl = function (args1, args2) {
+ var opts = {mock: true};
+ if (typeof args2 === 'object') {
+ for (var argKey in args2) {
+ opts[argKey] = args2[argKey];
+ }
+ }
+ var obj = this.execute(args1, opts);
+
+ this.clientAuthorizations.apply(obj, this.operation.security);
+
+ var results = [];
+
+ results.push('-X ' + this.method.toUpperCase());
+
+ if (obj.headers) {
+ var key;
+
+ for (key in obj.headers) {
+ var value = obj.headers[key];
+ if(typeof value === 'string'){
+ value = value.replace(/"/g, '\\"');
+ }
+ results.push('--header "' + key + ': ' + value + '"');
+ }
+ }
+
+ if (obj.body) {
+ var body;
+
+ if (_.isObject(obj.body)) {
+ body = JSON.stringify(obj.body);
+ } else {
+ body = obj.body;
+ }
+
+ results.push('-d "' + body.replace(/"/g, '\\"') + '"');
+ }
+
+ return 'curl ' + (results.join(' ')) + ' "' + obj.url + '"';
+};
+
+Operation.prototype.encodePathCollection = function (type, name, value) {
+ var encoded = '';
+ var i;
+ var separator = '';
+
+ if (type === 'ssv') {
+ separator = '%20';
+ } else if (type === 'tsv') {
+ separator = '\\t';
+ } else if (type === 'pipes') {
+ separator = '|';
+ } else {
+ separator = ',';
+ }
+
+ for (i = 0; i < value.length; i++) {
+ if (i === 0) {
+ encoded = this.encodeQueryParam(value[i]);
+ } else {
+ encoded += separator + this.encodeQueryParam(value[i]);
+ }
+ }
+
+ return encoded;
+};
+
+Operation.prototype.encodeQueryCollection = function (type, name, value) {
+ var encoded = '';
+ var i;
+
+ if (type === 'default' || type === 'multi') {
+ for (i = 0; i < value.length; i++) {
+ if (i > 0) {encoded += '&';}
+
+ encoded += this.encodeQueryParam(name) + '=' + this.encodeQueryParam(value[i]);
+ }
+ } else {
+ var separator = '';
+
+ if (type === 'csv') {
+ separator = ',';
+ } else if (type === 'ssv') {
+ separator = '%20';
+ } else if (type === 'tsv') {
+ separator = '\\t';
+ } else if (type === 'pipes') {
+ separator = '|';
+ } else if (type === 'brackets') {
+ for (i = 0; i < value.length; i++) {
+ if (i !== 0) {
+ encoded += '&';
+ }
+
+ encoded += this.encodeQueryParam(name) + '[]=' + this.encodeQueryParam(value[i]);
+ }
+ }
+
+ if (separator !== '') {
+ for (i = 0; i < value.length; i++) {
+ if (i === 0) {
+ encoded = this.encodeQueryParam(name) + '=' + this.encodeQueryParam(value[i]);
+ } else {
+ encoded += separator + this.encodeQueryParam(value[i]);
+ }
+ }
+ }
+ }
+
+ return encoded;
+};
+
+Operation.prototype.encodeQueryParam = function (arg) {
+ return encodeURIComponent(arg);
+};
+
+/**
+ * TODO revisit, might not want to leave '/'
+ **/
+Operation.prototype.encodePathParam = function (pathParam) {
+ return encodeURIComponent(pathParam);
+};
+
+},{"../helpers":4,"../http":5,"./model":9,"lodash-compat/lang/cloneDeep":141,"lodash-compat/lang/isEmpty":144,"lodash-compat/lang/isObject":147,"lodash-compat/lang/isUndefined":151}],11:[function(require,module,exports){
+'use strict';
+
+var OperationGroup = module.exports = function (tag, description, externalDocs, operation) {
+ this.description = description;
+ this.externalDocs = externalDocs;
+ this.name = tag;
+ this.operation = operation;
+ this.operationsArray = [];
+ this.path = tag;
+ this.tag = tag;
+};
+
+OperationGroup.prototype.sort = function () {
+
+};
+
+
+},{}],12:[function(require,module,exports){
+
+},{}],13:[function(require,module,exports){
+/*!
+ * The buffer module from node.js, for the browser.
+ *
+ * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
+ * @license MIT
+ */
+
+var base64 = require('base64-js')
+var ieee754 = require('ieee754')
+var isArray = require('is-array')
+
+exports.Buffer = Buffer
+exports.SlowBuffer = SlowBuffer
+exports.INSPECT_MAX_BYTES = 50
+Buffer.poolSize = 8192 // not used by this implementation
+
+var rootParent = {}
+
+/**
+ * If `Buffer.TYPED_ARRAY_SUPPORT`:
+ * === true Use Uint8Array implementation (fastest)
+ * === false Use Object implementation (most compatible, even IE6)
+ *
+ * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
+ * Opera 11.6+, iOS 4.2+.
+ *
+ * Note:
+ *
+ * - Implementation must support adding new properties to `Uint8Array` instances.
+ * Firefox 4-29 lacked support, fixed in Firefox 30+.
+ * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
+ *
+ * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
+ *
+ * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
+ * incorrect length in some situations.
+ *
+ * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they will
+ * get the Object implementation, which is slower but will work correctly.
+ */
+Buffer.TYPED_ARRAY_SUPPORT = (function () {
+ function Foo () {}
+ try {
+ var buf = new ArrayBuffer(0)
+ var arr = new Uint8Array(buf)
+ arr.foo = function () { return 42 }
+ arr.constructor = Foo
+ return arr.foo() === 42 && // typed array instances can be augmented
+ arr.constructor === Foo && // constructor can be set
+ typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
+ new Uint8Array(1).subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
+ } catch (e) {
+ return false
+ }
+})()
+
+function kMaxLength () {
+ return Buffer.TYPED_ARRAY_SUPPORT
+ ? 0x7fffffff
+ : 0x3fffffff
+}
+
+/**
+ * Class: Buffer
+ * =============
+ *
+ * The Buffer constructor returns instances of `Uint8Array` that are augmented
+ * with function properties for all the node `Buffer` API functions. We use
+ * `Uint8Array` so that square bracket notation works as expected -- it returns
+ * a single octet.
+ *
+ * By augmenting the instances, we can avoid modifying the `Uint8Array`
+ * prototype.
+ */
+function Buffer (arg) {
+ if (!(this instanceof Buffer)) {
+ // Avoid going through an ArgumentsAdaptorTrampoline in the common case.
+ if (arguments.length > 1) return new Buffer(arg, arguments[1])
+ return new Buffer(arg)
+ }
+
+ this.length = 0
+ this.parent = undefined
+
+ // Common case.
+ if (typeof arg === 'number') {
+ return fromNumber(this, arg)
+ }
+
+ // Slightly less common case.
+ if (typeof arg === 'string') {
+ return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')
+ }
+
+ // Unusual.
+ return fromObject(this, arg)
+}
+
+function fromNumber (that, length) {
+ that = allocate(that, length < 0 ? 0 : checked(length) | 0)
+ if (!Buffer.TYPED_ARRAY_SUPPORT) {
+ for (var i = 0; i < length; i++) {
+ that[i] = 0
+ }
+ }
+ return that
+}
+
+function fromString (that, string, encoding) {
+ if (typeof encoding !== 'string' || encoding === '') encoding = 'utf8'
+
+ // Assumption: byteLength() return value is always < kMaxLength.
+ var length = byteLength(string, encoding) | 0
+ that = allocate(that, length)
+
+ that.write(string, encoding)
+ return that
+}
+
+function fromObject (that, object) {
+ if (Buffer.isBuffer(object)) return fromBuffer(that, object)
+
+ if (isArray(object)) return fromArray(that, object)
+
+ if (object == null) {
+ throw new TypeError('must start with number, buffer, array or string')
+ }
+
+ if (typeof ArrayBuffer !== 'undefined' && object.buffer instanceof ArrayBuffer) {
+ return fromTypedArray(that, object)
+ }
+
+ if (object.length) return fromArrayLike(that, object)
+
+ return fromJsonObject(that, object)
+}
+
+function fromBuffer (that, buffer) {
+ var length = checked(buffer.length) | 0
+ that = allocate(that, length)
+ buffer.copy(that, 0, 0, length)
+ return that
+}
+
+function fromArray (that, array) {
+ var length = checked(array.length) | 0
+ that = allocate(that, length)
+ for (var i = 0; i < length; i += 1) {
+ that[i] = array[i] & 255
+ }
+ return that
+}
+
+// Duplicate of fromArray() to keep fromArray() monomorphic.
+function fromTypedArray (that, array) {
+ var length = checked(array.length) | 0
+ that = allocate(that, length)
+ // Truncating the elements is probably not what people expect from typed
+ // arrays with BYTES_PER_ELEMENT > 1 but it's compatible with the behavior
+ // of the old Buffer constructor.
+ for (var i = 0; i < length; i += 1) {
+ that[i] = array[i] & 255
+ }
+ return that
+}
+
+function fromArrayLike (that, array) {
+ var length = checked(array.length) | 0
+ that = allocate(that, length)
+ for (var i = 0; i < length; i += 1) {
+ that[i] = array[i] & 255
+ }
+ return that
+}
+
+// Deserialize { type: 'Buffer', data: [1,2,3,...] } into a Buffer object.
+// Returns a zero-length buffer for inputs that don't conform to the spec.
+function fromJsonObject (that, object) {
+ var array
+ var length = 0
+
+ if (object.type === 'Buffer' && isArray(object.data)) {
+ array = object.data
+ length = checked(array.length) | 0
+ }
+ that = allocate(that, length)
+
+ for (var i = 0; i < length; i += 1) {
+ that[i] = array[i] & 255
+ }
+ return that
+}
+
+function allocate (that, length) {
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ // Return an augmented `Uint8Array` instance, for best performance
+ that = Buffer._augment(new Uint8Array(length))
+ } else {
+ // Fallback: Return an object instance of the Buffer class
+ that.length = length
+ that._isBuffer = true
+ }
+
+ var fromPool = length !== 0 && length <= Buffer.poolSize >>> 1
+ if (fromPool) that.parent = rootParent
+
+ return that
+}
+
+function checked (length) {
+ // Note: cannot use `length < kMaxLength` here because that fails when
+ // length is NaN (which is otherwise coerced to zero.)
+ if (length >= kMaxLength()) {
+ throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
+ 'size: 0x' + kMaxLength().toString(16) + ' bytes')
+ }
+ return length | 0
+}
+
+function SlowBuffer (subject, encoding) {
+ if (!(this instanceof SlowBuffer)) return new SlowBuffer(subject, encoding)
+
+ var buf = new Buffer(subject, encoding)
+ delete buf.parent
+ return buf
+}
+
+Buffer.isBuffer = function isBuffer (b) {
+ return !!(b != null && b._isBuffer)
+}
+
+Buffer.compare = function compare (a, b) {
+ if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
+ throw new TypeError('Arguments must be Buffers')
+ }
+
+ if (a === b) return 0
+
+ var x = a.length
+ var y = b.length
+
+ var i = 0
+ var len = Math.min(x, y)
+ while (i < len) {
+ if (a[i] !== b[i]) break
+
+ ++i
+ }
+
+ if (i !== len) {
+ x = a[i]
+ y = b[i]
+ }
+
+ if (x < y) return -1
+ if (y < x) return 1
+ return 0
+}
+
+Buffer.isEncoding = function isEncoding (encoding) {
+ switch (String(encoding).toLowerCase()) {
+ case 'hex':
+ case 'utf8':
+ case 'utf-8':
+ case 'ascii':
+ case 'binary':
+ case 'base64':
+ case 'raw':
+ case 'ucs2':
+ case 'ucs-2':
+ case 'utf16le':
+ case 'utf-16le':
+ return true
+ default:
+ return false
+ }
+}
+
+Buffer.concat = function concat (list, length) {
+ if (!isArray(list)) throw new TypeError('list argument must be an Array of Buffers.')
+
+ if (list.length === 0) {
+ return new Buffer(0)
+ } else if (list.length === 1) {
+ return list[0]
+ }
+
+ var i
+ if (length === undefined) {
+ length = 0
+ for (i = 0; i < list.length; i++) {
+ length += list[i].length
+ }
+ }
+
+ var buf = new Buffer(length)
+ var pos = 0
+ for (i = 0; i < list.length; i++) {
+ var item = list[i]
+ item.copy(buf, pos)
+ pos += item.length
+ }
+ return buf
+}
+
+function byteLength (string, encoding) {
+ if (typeof string !== 'string') string = '' + string
+
+ var len = string.length
+ if (len === 0) return 0
+
+ // Use a for loop to avoid recursion
+ var loweredCase = false
+ for (;;) {
+ switch (encoding) {
+ case 'ascii':
+ case 'binary':
+ // Deprecated
+ case 'raw':
+ case 'raws':
+ return len
+ case 'utf8':
+ case 'utf-8':
+ return utf8ToBytes(string).length
+ case 'ucs2':
+ case 'ucs-2':
+ case 'utf16le':
+ case 'utf-16le':
+ return len * 2
+ case 'hex':
+ return len >>> 1
+ case 'base64':
+ return base64ToBytes(string).length
+ default:
+ if (loweredCase) return utf8ToBytes(string).length // assume utf8
+ encoding = ('' + encoding).toLowerCase()
+ loweredCase = true
+ }
+ }
+}
+Buffer.byteLength = byteLength
+
+// pre-set for values that may exist in the future
+Buffer.prototype.length = undefined
+Buffer.prototype.parent = undefined
+
+function slowToString (encoding, start, end) {
+ var loweredCase = false
+
+ start = start | 0
+ end = end === undefined || end === Infinity ? this.length : end | 0
+
+ if (!encoding) encoding = 'utf8'
+ if (start < 0) start = 0
+ if (end > this.length) end = this.length
+ if (end <= start) return ''
+
+ while (true) {
+ switch (encoding) {
+ case 'hex':
+ return hexSlice(this, start, end)
+
+ case 'utf8':
+ case 'utf-8':
+ return utf8Slice(this, start, end)
+
+ case 'ascii':
+ return asciiSlice(this, start, end)
+
+ case 'binary':
+ return binarySlice(this, start, end)
+
+ case 'base64':
+ return base64Slice(this, start, end)
+
+ case 'ucs2':
+ case 'ucs-2':
+ case 'utf16le':
+ case 'utf-16le':
+ return utf16leSlice(this, start, end)
+
+ default:
+ if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
+ encoding = (encoding + '').toLowerCase()
+ loweredCase = true
+ }
+ }
+}
+
+Buffer.prototype.toString = function toString () {
+ var length = this.length | 0
+ if (length === 0) return ''
+ if (arguments.length === 0) return utf8Slice(this, 0, length)
+ return slowToString.apply(this, arguments)
+}
+
+Buffer.prototype.equals = function equals (b) {
+ if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
+ if (this === b) return true
+ return Buffer.compare(this, b) === 0
+}
+
+Buffer.prototype.inspect = function inspect () {
+ var str = ''
+ var max = exports.INSPECT_MAX_BYTES
+ if (this.length > 0) {
+ str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
+ if (this.length > max) str += ' ... '
+ }
+ return '<Buffer ' + str + '>'
+}
+
+Buffer.prototype.compare = function compare (b) {
+ if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
+ if (this === b) return 0
+ return Buffer.compare(this, b)
+}
+
+Buffer.prototype.indexOf = function indexOf (val, byteOffset) {
+ if (byteOffset > 0x7fffffff) byteOffset = 0x7fffffff
+ else if (byteOffset < -0x80000000) byteOffset = -0x80000000
+ byteOffset >>= 0
+
+ if (this.length === 0) return -1
+ if (byteOffset >= this.length) return -1
+
+ // Negative offsets start from the end of the buffer
+ if (byteOffset < 0) byteOffset = Math.max(this.length + byteOffset, 0)
+
+ if (typeof val === 'string') {
+ if (val.length === 0) return -1 // special case: looking for empty string always fails
+ return String.prototype.indexOf.call(this, val, byteOffset)
+ }
+ if (Buffer.isBuffer(val)) {
+ return arrayIndexOf(this, val, byteOffset)
+ }
+ if (typeof val === 'number') {
+ if (Buffer.TYPED_ARRAY_SUPPORT && Uint8Array.prototype.indexOf === 'function') {
+ return Uint8Array.prototype.indexOf.call(this, val, byteOffset)
+ }
+ return arrayIndexOf(this, [ val ], byteOffset)
+ }
+
+ function arrayIndexOf (arr, val, byteOffset) {
+ var foundIndex = -1
+ for (var i = 0; byteOffset + i < arr.length; i++) {
+ if (arr[byteOffset + i] === val[foundIndex === -1 ? 0 : i - foundIndex]) {
+ if (foundIndex === -1) foundIndex = i
+ if (i - foundIndex + 1 === val.length) return byteOffset + foundIndex
+ } else {
+ foundIndex = -1
+ }
+ }
+ return -1
+ }
+
+ throw new TypeError('val must be string, number or Buffer')
+}
+
+// `get` will be removed in Node 0.13+
+Buffer.prototype.get = function get (offset) {
+ console.log('.get() is deprecated. Access using array indexes instead.')
+ return this.readUInt8(offset)
+}
+
+// `set` will be removed in Node 0.13+
+Buffer.prototype.set = function set (v, offset) {
+ console.log('.set() is deprecated. Access using array indexes instead.')
+ return this.writeUInt8(v, offset)
+}
+
+function hexWrite (buf, string, offset, length) {
+ offset = Number(offset) || 0
+ var remaining = buf.length - offset
+ if (!length) {
+ length = remaining
+ } else {
+ length = Number(length)
+ if (length > remaining) {
+ length = remaining
+ }
+ }
+
+ // must be an even number of digits
+ var strLen = string.length
+ if (strLen % 2 !== 0) throw new Error('Invalid hex string')
+
+ if (length > strLen / 2) {
+ length = strLen / 2
+ }
+ for (var i = 0; i < length; i++) {
+ var parsed = parseInt(string.substr(i * 2, 2), 16)
+ if (isNaN(parsed)) throw new Error('Invalid hex string')
+ buf[offset + i] = parsed
+ }
+ return i
+}
+
+function utf8Write (buf, string, offset, length) {
+ return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
+}
+
+function asciiWrite (buf, string, offset, length) {
+ return blitBuffer(asciiToBytes(string), buf, offset, length)
+}
+
+function binaryWrite (buf, string, offset, length) {
+ return asciiWrite(buf, string, offset, length)
+}
+
+function base64Write (buf, string, offset, length) {
+ return blitBuffer(base64ToBytes(string), buf, offset, length)
+}
+
+function ucs2Write (buf, string, offset, length) {
+ return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
+}
+
+Buffer.prototype.write = function write (string, offset, length, encoding) {
+ // Buffer#write(string)
+ if (offset === undefined) {
+ encoding = 'utf8'
+ length = this.length
+ offset = 0
+ // Buffer#write(string, encoding)
+ } else if (length === undefined && typeof offset === 'string') {
+ encoding = offset
+ length = this.length
+ offset = 0
+ // Buffer#write(string, offset[, length][, encoding])
+ } else if (isFinite(offset)) {
+ offset = offset | 0
+ if (isFinite(length)) {
+ length = length | 0
+ if (encoding === undefined) encoding = 'utf8'
+ } else {
+ encoding = length
+ length = undefined
+ }
+ // legacy write(string, encoding, offset, length) - remove in v0.13
+ } else {
+ var swap = encoding
+ encoding = offset
+ offset = length | 0
+ length = swap
+ }
+
+ var remaining = this.length - offset
+ if (length === undefined || length > remaining) length = remaining
+
+ if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
+ throw new RangeError('attempt to write outside buffer bounds')
+ }
+
+ if (!encoding) encoding = 'utf8'
+
+ var loweredCase = false
+ for (;;) {
+ switch (encoding) {
+ case 'hex':
+ return hexWrite(this, string, offset, length)
+
+ case 'utf8':
+ case 'utf-8':
+ return utf8Write(this, string, offset, length)
+
+ case 'ascii':
+ return asciiWrite(this, string, offset, length)
+
+ case 'binary':
+ return binaryWrite(this, string, offset, length)
+
+ case 'base64':
+ // Warning: maxLength not taken into account in base64Write
+ return base64Write(this, string, offset, length)
+
+ case 'ucs2':
+ case 'ucs-2':
+ case 'utf16le':
+ case 'utf-16le':
+ return ucs2Write(this, string, offset, length)
+
+ default:
+ if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
+ encoding = ('' + encoding).toLowerCase()
+ loweredCase = true
+ }
+ }
+}
+
+Buffer.prototype.toJSON = function toJSON () {
+ return {
+ type: 'Buffer',
+ data: Array.prototype.slice.call(this._arr || this, 0)
+ }
+}
+
+function base64Slice (buf, start, end) {
+ if (start === 0 && end === buf.length) {
+ return base64.fromByteArray(buf)
+ } else {
+ return base64.fromByteArray(buf.slice(start, end))
+ }
+}
+
+function utf8Slice (buf, start, end) {
+ var res = ''
+ var tmp = ''
+ end = Math.min(buf.length, end)
+
+ for (var i = start; i < end; i++) {
+ if (buf[i] <= 0x7F) {
+ res += decodeUtf8Char(tmp) + String.fromCharCode(buf[i])
+ tmp = ''
+ } else {
+ tmp += '%' + buf[i].toString(16)
+ }
+ }
+
+ return res + decodeUtf8Char(tmp)
+}
+
+function asciiSlice (buf, start, end) {
+ var ret = ''
+ end = Math.min(buf.length, end)
+
+ for (var i = start; i < end; i++) {
+ ret += String.fromCharCode(buf[i] & 0x7F)
+ }
+ return ret
+}
+
+function binarySlice (buf, start, end) {
+ var ret = ''
+ end = Math.min(buf.length, end)
+
+ for (var i = start; i < end; i++) {
+ ret += String.fromCharCode(buf[i])
+ }
+ return ret
+}
+
+function hexSlice (buf, start, end) {
+ var len = buf.length
+
+ if (!start || start < 0) start = 0
+ if (!end || end < 0 || end > len) end = len
+
+ var out = ''
+ for (var i = start; i < end; i++) {
+ out += toHex(buf[i])
+ }
+ return out
+}
+
+function utf16leSlice (buf, start, end) {
+ var bytes = buf.slice(start, end)
+ var res = ''
+ for (var i = 0; i < bytes.length; i += 2) {
+ res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
+ }
+ return res
+}
+
+Buffer.prototype.slice = function slice (start, end) {
+ var len = this.length
+ start = ~~start
+ end = end === undefined ? len : ~~end
+
+ if (start < 0) {
+ start += len
+ if (start < 0) start = 0
+ } else if (start > len) {
+ start = len
+ }
+
+ if (end < 0) {
+ end += len
+ if (end < 0) end = 0
+ } else if (end > len) {
+ end = len
+ }
+
+ if (end < start) end = start
+
+ var newBuf
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ newBuf = Buffer._augment(this.subarray(start, end))
+ } else {
+ var sliceLen = end - start
+ newBuf = new Buffer(sliceLen, undefined)
+ for (var i = 0; i < sliceLen; i++) {
+ newBuf[i] = this[i + start]
+ }
+ }
+
+ if (newBuf.length) newBuf.parent = this.parent || this
+
+ return newBuf
+}
+
+/*
+ * Need to make sure that buffer isn't trying to write out of bounds.
+ */
+function checkOffset (offset, ext, length) {
+ if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
+ if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
+}
+
+Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
+ offset = offset | 0
+ byteLength = byteLength | 0
+ if (!noAssert) checkOffset(offset, byteLength, this.length)
+
+ var val = this[offset]
+ var mul = 1
+ var i = 0
+ while (++i < byteLength && (mul *= 0x100)) {
+ val += this[offset + i] * mul
+ }
+
+ return val
+}
+
+Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
+ offset = offset | 0
+ byteLength = byteLength | 0
+ if (!noAssert) {
+ checkOffset(offset, byteLength, this.length)
+ }
+
+ var val = this[offset + --byteLength]
+ var mul = 1
+ while (byteLength > 0 && (mul *= 0x100)) {
+ val += this[offset + --byteLength] * mul
+ }
+
+ return val
+}
+
+Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 1, this.length)
+ return this[offset]
+}
+
+Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 2, this.length)
+ return this[offset] | (this[offset + 1] << 8)
+}
+
+Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 2, this.length)
+ return (this[offset] << 8) | this[offset + 1]
+}
+
+Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 4, this.length)
+
+ return ((this[offset]) |
+ (this[offset + 1] << 8) |
+ (this[offset + 2] << 16)) +
+ (this[offset + 3] * 0x1000000)
+}
+
+Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 4, this.length)
+
+ return (this[offset] * 0x1000000) +
+ ((this[offset + 1] << 16) |
+ (this[offset + 2] << 8) |
+ this[offset + 3])
+}
+
+Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
+ offset = offset | 0
+ byteLength = byteLength | 0
+ if (!noAssert) checkOffset(offset, byteLength, this.length)
+
+ var val = this[offset]
+ var mul = 1
+ var i = 0
+ while (++i < byteLength && (mul *= 0x100)) {
+ val += this[offset + i] * mul
+ }
+ mul *= 0x80
+
+ if (val >= mul) val -= Math.pow(2, 8 * byteLength)
+
+ return val
+}
+
+Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
+ offset = offset | 0
+ byteLength = byteLength | 0
+ if (!noAssert) checkOffset(offset, byteLength, this.length)
+
+ var i = byteLength
+ var mul = 1
+ var val = this[offset + --i]
+ while (i > 0 && (mul *= 0x100)) {
+ val += this[offset + --i] * mul
+ }
+ mul *= 0x80
+
+ if (val >= mul) val -= Math.pow(2, 8 * byteLength)
+
+ return val
+}
+
+Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 1, this.length)
+ if (!(this[offset] & 0x80)) return (this[offset])
+ return ((0xff - this[offset] + 1) * -1)
+}
+
+Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 2, this.length)
+ var val = this[offset] | (this[offset + 1] << 8)
+ return (val & 0x8000) ? val | 0xFFFF0000 : val
+}
+
+Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 2, this.length)
+ var val = this[offset + 1] | (this[offset] << 8)
+ return (val & 0x8000) ? val | 0xFFFF0000 : val
+}
+
+Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 4, this.length)
+
+ return (this[offset]) |
+ (this[offset + 1] << 8) |
+ (this[offset + 2] << 16) |
+ (this[offset + 3] << 24)
+}
+
+Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 4, this.length)
+
+ return (this[offset] << 24) |
+ (this[offset + 1] << 16) |
+ (this[offset + 2] << 8) |
+ (this[offset + 3])
+}
+
+Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 4, this.length)
+ return ieee754.read(this, offset, true, 23, 4)
+}
+
+Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 4, this.length)
+ return ieee754.read(this, offset, false, 23, 4)
+}
+
+Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 8, this.length)
+ return ieee754.read(this, offset, true, 52, 8)
+}
+
+Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 8, this.length)
+ return ieee754.read(this, offset, false, 52, 8)
+}
+
+function checkInt (buf, value, offset, ext, max, min) {
+ if (!Buffer.isBuffer(buf)) throw new TypeError('buffer must be a Buffer instance')
+ if (value > max || value < min) throw new RangeError('value is out of bounds')
+ if (offset + ext > buf.length) throw new RangeError('index out of range')
+}
+
+Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
+ value = +value
+ offset = offset | 0
+ byteLength = byteLength | 0
+ if (!noAssert) checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0)
+
+ var mul = 1
+ var i = 0
+ this[offset] = value & 0xFF
+ while (++i < byteLength && (mul *= 0x100)) {
+ this[offset + i] = (value / mul) & 0xFF
+ }
+
+ return offset + byteLength
+}
+
+Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
+ value = +value
+ offset = offset | 0
+ byteLength = byteLength | 0
+ if (!noAssert) checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0)
+
+ var i = byteLength - 1
+ var mul = 1
+ this[offset + i] = value & 0xFF
+ while (--i >= 0 && (mul *= 0x100)) {
+ this[offset + i] = (value / mul) & 0xFF
+ }
+
+ return offset + byteLength
+}
+
+Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
+ value = +value
+ offset = offset | 0
+ if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
+ if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
+ this[offset] = value
+ return offset + 1
+}
+
+function objectWriteUInt16 (buf, value, offset, littleEndian) {
+ if (value < 0) value = 0xffff + value + 1
+ for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; i++) {
+ buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
+ (littleEndian ? i : 1 - i) * 8
+ }
+}
+
+Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
+ value = +value
+ offset = offset | 0
+ if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ this[offset] = value
+ this[offset + 1] = (value >>> 8)
+ } else {
+ objectWriteUInt16(this, value, offset, true)
+ }
+ return offset + 2
+}
+
+Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
+ value = +value
+ offset = offset | 0
+ if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ this[offset] = (value >>> 8)
+ this[offset + 1] = value
+ } else {
+ objectWriteUInt16(this, value, offset, false)
+ }
+ return offset + 2
+}
+
+function objectWriteUInt32 (buf, value, offset, littleEndian) {
+ if (value < 0) value = 0xffffffff + value + 1
+ for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; i++) {
+ buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
+ }
+}
+
+Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
+ value = +value
+ offset = offset | 0
+ if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ this[offset + 3] = (value >>> 24)
+ this[offset + 2] = (value >>> 16)
+ this[offset + 1] = (value >>> 8)
+ this[offset] = value
+ } else {
+ objectWriteUInt32(this, value, offset, true)
+ }
+ return offset + 4
+}
+
+Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
+ value = +value
+ offset = offset | 0
+ if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ this[offset] = (value >>> 24)
+ this[offset + 1] = (value >>> 16)
+ this[offset + 2] = (value >>> 8)
+ this[offset + 3] = value
+ } else {
+ objectWriteUInt32(this, value, offset, false)
+ }
+ return offset + 4
+}
+
+Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
+ value = +value
+ offset = offset | 0
+ if (!noAssert) {
+ var limit = Math.pow(2, 8 * byteLength - 1)
+
+ checkInt(this, value, offset, byteLength, limit - 1, -limit)
+ }
+
+ var i = 0
+ var mul = 1
+ var sub = value < 0 ? 1 : 0
+ this[offset] = value & 0xFF
+ while (++i < byteLength && (mul *= 0x100)) {
+ this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
+ }
+
+ return offset + byteLength
+}
+
+Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
+ value = +value
+ offset = offset | 0
+ if (!noAssert) {
+ var limit = Math.pow(2, 8 * byteLength - 1)
+
+ checkInt(this, value, offset, byteLength, limit - 1, -limit)
+ }
+
+ var i = byteLength - 1
+ var mul = 1
+ var sub = value < 0 ? 1 : 0
+ this[offset + i] = value & 0xFF
+ while (--i >= 0 && (mul *= 0x100)) {
+ this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
+ }
+
+ return offset + byteLength
+}
+
+Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
+ value = +value
+ offset = offset | 0
+ if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
+ if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
+ if (value < 0) value = 0xff + value + 1
+ this[offset] = value
+ return offset + 1
+}
+
+Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
+ value = +value
+ offset = offset | 0
+ if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ this[offset] = value
+ this[offset + 1] = (value >>> 8)
+ } else {
+ objectWriteUInt16(this, value, offset, true)
+ }
+ return offset + 2
+}
+
+Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
+ value = +value
+ offset = offset | 0
+ if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ this[offset] = (value >>> 8)
+ this[offset + 1] = value
+ } else {
+ objectWriteUInt16(this, value, offset, false)
+ }
+ return offset + 2
+}
+
+Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
+ value = +value
+ offset = offset | 0
+ if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ this[offset] = value
+ this[offset + 1] = (value >>> 8)
+ this[offset + 2] = (value >>> 16)
+ this[offset + 3] = (value >>> 24)
+ } else {
+ objectWriteUInt32(this, value, offset, true)
+ }
+ return offset + 4
+}
+
+Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
+ value = +value
+ offset = offset | 0
+ if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
+ if (value < 0) value = 0xffffffff + value + 1
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ this[offset] = (value >>> 24)
+ this[offset + 1] = (value >>> 16)
+ this[offset + 2] = (value >>> 8)
+ this[offset + 3] = value
+ } else {
+ objectWriteUInt32(this, value, offset, false)
+ }
+ return offset + 4
+}
+
+function checkIEEE754 (buf, value, offset, ext, max, min) {
+ if (value > max || value < min) throw new RangeError('value is out of bounds')
+ if (offset + ext > buf.length) throw new RangeError('index out of range')
+ if (offset < 0) throw new RangeError('index out of range')
+}
+
+function writeFloat (buf, value, offset, littleEndian, noAssert) {
+ if (!noAssert) {
+ checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
+ }
+ ieee754.write(buf, value, offset, littleEndian, 23, 4)
+ return offset + 4
+}
+
+Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
+ return writeFloat(this, value, offset, true, noAssert)
+}
+
+Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
+ return writeFloat(this, value, offset, false, noAssert)
+}
+
+function writeDouble (buf, value, offset, littleEndian, noAssert) {
+ if (!noAssert) {
+ checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
+ }
+ ieee754.write(buf, value, offset, littleEndian, 52, 8)
+ return offset + 8
+}
+
+Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
+ return writeDouble(this, value, offset, true, noAssert)
+}
+
+Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
+ return writeDouble(this, value, offset, false, noAssert)
+}
+
+// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
+Buffer.prototype.copy = function copy (target, targetStart, start, end) {
+ if (!start) start = 0
+ if (!end && end !== 0) end = this.length
+ if (targetStart >= target.length) targetStart = target.length
+ if (!targetStart) targetStart = 0
+ if (end > 0 && end < start) end = start
+
+ // Copy 0 bytes; we're done
+ if (end === start) return 0
+ if (target.length === 0 || this.length === 0) return 0
+
+ // Fatal error conditions
+ if (targetStart < 0) {
+ throw new RangeError('targetStart out of bounds')
+ }
+ if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
+ if (end < 0) throw new RangeError('sourceEnd out of bounds')
+
+ // Are we oob?
+ if (end > this.length) end = this.length
+ if (target.length - targetStart < end - start) {
+ end = target.length - targetStart + start
+ }
+
+ var len = end - start
+
+ if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
+ for (var i = 0; i < len; i++) {
+ target[i + targetStart] = this[i + start]
+ }
+ } else {
+ target._set(this.subarray(start, start + len), targetStart)
+ }
+
+ return len
+}
+
+// fill(value, start=0, end=buffer.length)
+Buffer.prototype.fill = function fill (value, start, end) {
+ if (!value) value = 0
+ if (!start) start = 0
+ if (!end) end = this.length
+
+ if (end < start) throw new RangeError('end < start')
+
+ // Fill 0 bytes; we're done
+ if (end === start) return
+ if (this.length === 0) return
+
+ if (start < 0 || start >= this.length) throw new RangeError('start out of bounds')
+ if (end < 0 || end > this.length) throw new RangeError('end out of bounds')
+
+ var i
+ if (typeof value === 'number') {
+ for (i = start; i < end; i++) {
+ this[i] = value
+ }
+ } else {
+ var bytes = utf8ToBytes(value.toString())
+ var len = bytes.length
+ for (i = start; i < end; i++) {
+ this[i] = bytes[i % len]
+ }
+ }
+
+ return this
+}
+
+/**
+ * Creates a new `ArrayBuffer` with the *copied* memory of the buffer instance.
+ * Added in Node 0.12. Only available in browsers that support ArrayBuffer.
+ */
+Buffer.prototype.toArrayBuffer = function toArrayBuffer () {
+ if (typeof Uint8Array !== 'undefined') {
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ return (new Buffer(this)).buffer
+ } else {
+ var buf = new Uint8Array(this.length)
+ for (var i = 0, len = buf.length; i < len; i += 1) {
+ buf[i] = this[i]
+ }
+ return buf.buffer
+ }
+ } else {
+ throw new TypeError('Buffer.toArrayBuffer not supported in this browser')
+ }
+}
+
+// HELPER FUNCTIONS
+// ================
+
+var BP = Buffer.prototype
+
+/**
+ * Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods
+ */
+Buffer._augment = function _augment (arr) {
+ arr.constructor = Buffer
+ arr._isBuffer = true
+
+ // save reference to original Uint8Array set method before overwriting
+ arr._set = arr.set
+
+ // deprecated, will be removed in node 0.13+
+ arr.get = BP.get
+ arr.set = BP.set
+
+ arr.write = BP.write
+ arr.toString = BP.toString
+ arr.toLocaleString = BP.toString
+ arr.toJSON = BP.toJSON
+ arr.equals = BP.equals
+ arr.compare = BP.compare
+ arr.indexOf = BP.indexOf
+ arr.copy = BP.copy
+ arr.slice = BP.slice
+ arr.readUIntLE = BP.readUIntLE
+ arr.readUIntBE = BP.readUIntBE
+ arr.readUInt8 = BP.readUInt8
+ arr.readUInt16LE = BP.readUInt16LE
+ arr.readUInt16BE = BP.readUInt16BE
+ arr.readUInt32LE = BP.readUInt32LE
+ arr.readUInt32BE = BP.readUInt32BE
+ arr.readIntLE = BP.readIntLE
+ arr.readIntBE = BP.readIntBE
+ arr.readInt8 = BP.readInt8
+ arr.readInt16LE = BP.readInt16LE
+ arr.readInt16BE = BP.readInt16BE
+ arr.readInt32LE = BP.readInt32LE
+ arr.readInt32BE = BP.readInt32BE
+ arr.readFloatLE = BP.readFloatLE
+ arr.readFloatBE = BP.readFloatBE
+ arr.readDoubleLE = BP.readDoubleLE
+ arr.readDoubleBE = BP.readDoubleBE
+ arr.writeUInt8 = BP.writeUInt8
+ arr.writeUIntLE = BP.writeUIntLE
+ arr.writeUIntBE = BP.writeUIntBE
+ arr.writeUInt16LE = BP.writeUInt16LE
+ arr.writeUInt16BE = BP.writeUInt16BE
+ arr.writeUInt32LE = BP.writeUInt32LE
+ arr.writeUInt32BE = BP.writeUInt32BE
+ arr.writeIntLE = BP.writeIntLE
+ arr.writeIntBE = BP.writeIntBE
+ arr.writeInt8 = BP.writeInt8
+ arr.writeInt16LE = BP.writeInt16LE
+ arr.writeInt16BE = BP.writeInt16BE
+ arr.writeInt32LE = BP.writeInt32LE
+ arr.writeInt32BE = BP.writeInt32BE
+ arr.writeFloatLE = BP.writeFloatLE
+ arr.writeFloatBE = BP.writeFloatBE
+ arr.writeDoubleLE = BP.writeDoubleLE
+ arr.writeDoubleBE = BP.writeDoubleBE
+ arr.fill = BP.fill
+ arr.inspect = BP.inspect
+ arr.toArrayBuffer = BP.toArrayBuffer
+
+ return arr
+}
+
+var INVALID_BASE64_RE = /[^+\/0-9A-z\-]/g
+
+function base64clean (str) {
+ // Node strips out invalid characters like \n and \t from the string, base64-js does not
+ str = stringtrim(str).replace(INVALID_BASE64_RE, '')
+ // Node converts strings with length < 2 to ''
+ if (str.length < 2) return ''
+ // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
+ while (str.length % 4 !== 0) {
+ str = str + '='
+ }
+ return str
+}
+
+function stringtrim (str) {
+ if (str.trim) return str.trim()
+ return str.replace(/^\s+|\s+$/g, '')
+}
+
+function toHex (n) {
+ if (n < 16) return '0' + n.toString(16)
+ return n.toString(16)
+}
+
+function utf8ToBytes (string, units) {
+ units = units || Infinity
+ var codePoint
+ var length = string.length
+ var leadSurrogate = null
+ var bytes = []
+ var i = 0
+
+ for (; i < length; i++) {
+ codePoint = string.charCodeAt(i)
+
+ // is surrogate component
+ if (codePoint > 0xD7FF && codePoint < 0xE000) {
+ // last char was a lead
+ if (leadSurrogate) {
+ // 2 leads in a row
+ if (codePoint < 0xDC00) {
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
+ leadSurrogate = codePoint
+ continue
+ } else {
+ // valid surrogate pair
+ codePoint = leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00 | 0x10000
+ leadSurrogate = null
+ }
+ } else {
+ // no lead yet
+
+ if (codePoint > 0xDBFF) {
+ // unexpected trail
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
+ continue
+ } else if (i + 1 === length) {
+ // unpaired lead
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
+ continue
+ } else {
+ // valid lead
+ leadSurrogate = codePoint
+ continue
+ }
+ }
+ } else if (leadSurrogate) {
+ // valid bmp char, but last char was a lead
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
+ leadSurrogate = null
+ }
+
+ // encode utf8
+ if (codePoint < 0x80) {
+ if ((units -= 1) < 0) break
+ bytes.push(codePoint)
+ } else if (codePoint < 0x800) {
+ if ((units -= 2) < 0) break
+ bytes.push(
+ codePoint >> 0x6 | 0xC0,
+ codePoint & 0x3F | 0x80
+ )
+ } else if (codePoint < 0x10000) {
+ if ((units -= 3) < 0) break
+ bytes.push(
+ codePoint >> 0xC | 0xE0,
+ codePoint >> 0x6 & 0x3F | 0x80,
+ codePoint & 0x3F | 0x80
+ )
+ } else if (codePoint < 0x200000) {
+ if ((units -= 4) < 0) break
+ bytes.push(
+ codePoint >> 0x12 | 0xF0,
+ codePoint >> 0xC & 0x3F | 0x80,
+ codePoint >> 0x6 & 0x3F | 0x80,
+ codePoint & 0x3F | 0x80
+ )
+ } else {
+ throw new Error('Invalid code point')
+ }
+ }
+
+ return bytes
+}
+
+function asciiToBytes (str) {
+ var byteArray = []
+ for (var i = 0; i < str.length; i++) {
+ // Node's code seems to be doing this and not & 0x7F..
+ byteArray.push(str.charCodeAt(i) & 0xFF)
+ }
+ return byteArray
+}
+
+function utf16leToBytes (str, units) {
+ var c, hi, lo
+ var byteArray = []
+ for (var i = 0; i < str.length; i++) {
+ if ((units -= 2) < 0) break
+
+ c = str.charCodeAt(i)
+ hi = c >> 8
+ lo = c % 256
+ byteArray.push(lo)
+ byteArray.push(hi)
+ }
+
+ return byteArray
+}
+
+function base64ToBytes (str) {
+ return base64.toByteArray(base64clean(str))
+}
+
+function blitBuffer (src, dst, offset, length) {
+ for (var i = 0; i < length; i++) {
+ if ((i + offset >= dst.length) || (i >= src.length)) break
+ dst[i + offset] = src[i]
+ }
+ return i
+}
+
+function decodeUtf8Char (str) {
+ try {
+ return decodeURIComponent(str)
+ } catch (err) {
+ return String.fromCharCode(0xFFFD) // UTF 8 invalid char
+ }
+}
+
+},{"base64-js":14,"ieee754":15,"is-array":16}],14:[function(require,module,exports){
+var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
+
+;(function (exports) {
+ 'use strict';
+
+ var Arr = (typeof Uint8Array !== 'undefined')
+ ? Uint8Array
+ : Array
+
+ var PLUS = '+'.charCodeAt(0)
+ var SLASH = '/'.charCodeAt(0)
+ var NUMBER = '0'.charCodeAt(0)
+ var LOWER = 'a'.charCodeAt(0)
+ var UPPER = 'A'.charCodeAt(0)
+ var PLUS_URL_SAFE = '-'.charCodeAt(0)
+ var SLASH_URL_SAFE = '_'.charCodeAt(0)
+
+ function decode (elt) {
+ var code = elt.charCodeAt(0)
+ if (code === PLUS ||
+ code === PLUS_URL_SAFE)
+ return 62 // '+'
+ if (code === SLASH ||
+ code === SLASH_URL_SAFE)
+ return 63 // '/'
+ if (code < NUMBER)
+ return -1 //no match
+ if (code < NUMBER + 10)
+ return code - NUMBER + 26 + 26
+ if (code < UPPER + 26)
+ return code - UPPER
+ if (code < LOWER + 26)
+ return code - LOWER + 26
+ }
+
+ function b64ToByteArray (b64) {
+ var i, j, l, tmp, placeHolders, arr
+
+ if (b64.length % 4 > 0) {
+ throw new Error('Invalid string. Length must be a multiple of 4')
+ }
+
+ // the number of equal signs (place holders)
+ // if there are two placeholders, than the two characters before it
+ // represent one byte
+ // if there is only one, then the three characters before it represent 2 bytes
+ // this is just a cheap hack to not do indexOf twice
+ var len = b64.length
+ placeHolders = '=' === b64.charAt(len - 2) ? 2 : '=' === b64.charAt(len - 1) ? 1 : 0
+
+ // base64 is 4/3 + up to two characters of the original data
+ arr = new Arr(b64.length * 3 / 4 - placeHolders)
+
+ // if there are placeholders, only get up to the last complete 4 chars
+ l = placeHolders > 0 ? b64.length - 4 : b64.length
+
+ var L = 0
+
+ function push (v) {
+ arr[L++] = v
+ }
+
+ for (i = 0, j = 0; i < l; i += 4, j += 3) {
+ tmp = (decode(b64.charAt(i)) << 18) | (decode(b64.charAt(i + 1)) << 12) | (decode(b64.charAt(i + 2)) << 6) | decode(b64.charAt(i + 3))
+ push((tmp & 0xFF0000) >> 16)
+ push((tmp & 0xFF00) >> 8)
+ push(tmp & 0xFF)
+ }
+
+ if (placeHolders === 2) {
+ tmp = (decode(b64.charAt(i)) << 2) | (decode(b64.charAt(i + 1)) >> 4)
+ push(tmp & 0xFF)
+ } else if (placeHolders === 1) {
+ tmp = (decode(b64.charAt(i)) << 10) | (decode(b64.charAt(i + 1)) << 4) | (decode(b64.charAt(i + 2)) >> 2)
+ push((tmp >> 8) & 0xFF)
+ push(tmp & 0xFF)
+ }
+
+ return arr
+ }
+
+ function uint8ToBase64 (uint8) {
+ var i,
+ extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes
+ output = "",
+ temp, length
+
+ function encode (num) {
+ return lookup.charAt(num)
+ }
+
+ function tripletToBase64 (num) {
+ return encode(num >> 18 & 0x3F) + encode(num >> 12 & 0x3F) + encode(num >> 6 & 0x3F) + encode(num & 0x3F)
+ }
+
+ // go through the array every three bytes, we'll deal with trailing stuff later
+ for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) {
+ temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])
+ output += tripletToBase64(temp)
+ }
+
+ // pad the end with zeros, but make sure to not forget the extra bytes
+ switch (extraBytes) {
+ case 1:
+ temp = uint8[uint8.length - 1]
+ output += encode(temp >> 2)
+ output += encode((temp << 4) & 0x3F)
+ output += '=='
+ break
+ case 2:
+ temp = (uint8[uint8.length - 2] << 8) + (uint8[uint8.length - 1])
+ output += encode(temp >> 10)
+ output += encode((temp >> 4) & 0x3F)
+ output += encode((temp << 2) & 0x3F)
+ output += '='
+ break
+ }
+
+ return output
+ }
+
+ exports.toByteArray = b64ToByteArray
+ exports.fromByteArray = uint8ToBase64
+}(typeof exports === 'undefined' ? (this.base64js = {}) : exports))
+
+},{}],15:[function(require,module,exports){
+exports.read = function (buffer, offset, isLE, mLen, nBytes) {
+ var e, m
+ var eLen = nBytes * 8 - mLen - 1
+ var eMax = (1 << eLen) - 1
+ var eBias = eMax >> 1
+ var nBits = -7
+ var i = isLE ? (nBytes - 1) : 0
+ var d = isLE ? -1 : 1
+ var s = buffer[offset + i]
+
+ i += d
+
+ e = s & ((1 << (-nBits)) - 1)
+ s >>= (-nBits)
+ nBits += eLen
+ for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
+
+ m = e & ((1 << (-nBits)) - 1)
+ e >>= (-nBits)
+ nBits += mLen
+ for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
+
+ if (e === 0) {
+ e = 1 - eBias
+ } else if (e === eMax) {
+ return m ? NaN : ((s ? -1 : 1) * Infinity)
+ } else {
+ m = m + Math.pow(2, mLen)
+ e = e - eBias
+ }
+ return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
+}
+
+exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
+ var e, m, c
+ var eLen = nBytes * 8 - mLen - 1
+ var eMax = (1 << eLen) - 1
+ var eBias = eMax >> 1
+ var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
+ var i = isLE ? 0 : (nBytes - 1)
+ var d = isLE ? 1 : -1
+ var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
+
+ value = Math.abs(value)
+
+ if (isNaN(value) || value === Infinity) {
+ m = isNaN(value) ? 1 : 0
+ e = eMax
+ } else {
+ e = Math.floor(Math.log(value) / Math.LN2)
+ if (value * (c = Math.pow(2, -e)) < 1) {
+ e--
+ c *= 2
+ }
+ if (e + eBias >= 1) {
+ value += rt / c
+ } else {
+ value += rt * Math.pow(2, 1 - eBias)
+ }
+ if (value * c >= 2) {
+ e++
+ c /= 2
+ }
+
+ if (e + eBias >= eMax) {
+ m = 0
+ e = eMax
+ } else if (e + eBias >= 1) {
+ m = (value * c - 1) * Math.pow(2, mLen)
+ e = e + eBias
+ } else {
+ m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
+ e = 0
+ }
+ }
+
+ for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
+
+ e = (e << mLen) | m
+ eLen += mLen
+ for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
+
+ buffer[offset + i - d] |= s * 128
+}
+
+},{}],16:[function(require,module,exports){
+
+/**
+ * isArray
+ */
+
+var isArray = Array.isArray;
+
+/**
+ * toString
+ */
+
+var str = Object.prototype.toString;
+
+/**
+ * Whether or not the given `val`
+ * is an array.
+ *
+ * example:
+ *
+ * isArray([]);
+ * // > true
+ * isArray(arguments);
+ * // > false
+ * isArray('');
+ * // > false
+ *
+ * @param {mixed} val
+ * @return {bool}
+ */
+
+module.exports = isArray || function (val) {
+ return !! val && '[object Array]' == str.call(val);
+};
+
+},{}],17:[function(require,module,exports){
+// shim for using process in browser
+
+var process = module.exports = {};
+var queue = [];
+var draining = false;
+
+function drainQueue() {
+ if (draining) {
+ return;
+ }
+ draining = true;
+ var currentQueue;
+ var len = queue.length;
+ while(len) {
+ currentQueue = queue;
+ queue = [];
+ var i = -1;
+ while (++i < len) {
+ currentQueue[i]();
+ }
+ len = queue.length;
+ }
+ draining = false;
+}
+process.nextTick = function (fun) {
+ queue.push(fun);
+ if (!draining) {
+ setTimeout(drainQueue, 0);
+ }
+};
+
+process.title = 'browser';
+process.browser = true;
+process.env = {};
+process.argv = [];
+process.version = ''; // empty string to avoid regexp issues
+process.versions = {};
+
+function noop() {}
+
+process.on = noop;
+process.addListener = noop;
+process.once = noop;
+process.off = noop;
+process.removeListener = noop;
+process.removeAllListeners = noop;
+process.emit = noop;
+
+process.binding = function (name) {
+ throw new Error('process.binding is not supported');
+};
+
+// TODO(shtylman)
+process.cwd = function () { return '/' };
+process.chdir = function (dir) {
+ throw new Error('process.chdir is not supported');
+};
+process.umask = function() { return 0; };
+
+},{}],18:[function(require,module,exports){
+(function (Buffer){
+(function () {
+ "use strict";
+
+ function btoa(str) {
+ var buffer
+ ;
+
+ if (str instanceof Buffer) {
+ buffer = str;
+ } else {
+ buffer = new Buffer(str.toString(), 'binary');
+ }
+
+ return buffer.toString('base64');
+ }
+
+ module.exports = btoa;
+}());
+
+}).call(this,require("buffer").Buffer)
+//# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9idG9hL2luZGV4LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsImZpbGUiOiJnZW5lcmF0ZWQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlc0NvbnRlbnQiOlsiKGZ1bmN0aW9uICgpIHtcbiAgXCJ1c2Ugc3RyaWN0XCI7XG5cbiAgZnVuY3Rpb24gYnRvYShzdHIpIHtcbiAgICB2YXIgYnVmZmVyXG4gICAgICA7XG5cbiAgICBpZiAoc3RyIGluc3RhbmNlb2YgQnVmZmVyKSB7XG4gICAgICBidWZmZXIgPSBzdHI7XG4gICAgfSBlbHNlIHtcbiAgICAgIGJ1ZmZlciA9IG5ldyBCdWZmZXIoc3RyLnRvU3RyaW5nKCksICdiaW5hcnknKTtcbiAgICB9XG5cbiAgICByZXR1cm4gYnVmZmVyLnRvU3RyaW5nKCdiYXNlNjQnKTtcbiAgfVxuXG4gIG1vZHVsZS5leHBvcnRzID0gYnRvYTtcbn0oKSk7XG4iXX0=
+},{"buffer":13}],19:[function(require,module,exports){
+/* jshint node: true */
+(function () {
+ "use strict";
+
+ function CookieAccessInfo(domain, path, secure, script) {
+ if (this instanceof CookieAccessInfo) {
+ this.domain = domain || undefined;
+ this.path = path || "/";
+ this.secure = !!secure;
+ this.script = !!script;
+ return this;
+ }
+ return new CookieAccessInfo(domain, path, secure, script);
+ }
+ exports.CookieAccessInfo = CookieAccessInfo;
+
+ function Cookie(cookiestr, request_domain, request_path) {
+ if (cookiestr instanceof Cookie) {
+ return cookiestr;
+ }
+ if (this instanceof Cookie) {
+ this.name = null;
+ this.value = null;
+ this.expiration_date = Infinity;
+ this.path = String(request_path || "/");
+ this.explicit_path = false;
+ this.domain = request_domain || null;
+ this.explicit_domain = false;
+ this.secure = false; //how to define default?
+ this.noscript = false; //httponly
+ if (cookiestr) {
+ this.parse(cookiestr, request_domain, request_path);
+ }
+ return this;
+ }
+ return new Cookie(cookiestr);
+ }
+ exports.Cookie = Cookie;
+
+ Cookie.prototype.toString = function toString() {
+ var str = [this.name + "=" + this.value];
+ if (this.expiration_date !== Infinity) {
+ str.push("expires=" + (new Date(this.expiration_date)).toGMTString());
+ }
+ if (this.domain) {
+ str.push("domain=" + this.domain);
+ }
+ if (this.path) {
+ str.push("path=" + this.path);
+ }
+ if (this.secure) {
+ str.push("secure");
+ }
+ if (this.noscript) {
+ str.push("httponly");
+ }
+ return str.join("; ");
+ };
+
+ Cookie.prototype.toValueString = function toValueString() {
+ return this.name + "=" + this.value;
+ };
+
+ var cookie_str_splitter = /[:](?=\s*[a-zA-Z0-9_\-]+\s*[=])/g;
+ Cookie.prototype.parse = function parse(str, request_domain, request_path) {
+ if (this instanceof Cookie) {
+ var parts = str.split(";").filter(function (value) {
+ return !!value;
+ }),
+ pair = parts[0].match(/([^=]+)=([\s\S]*)/),
+ key = pair[1],
+ value = pair[2],
+ i;
+ this.name = key;
+ this.value = value;
+
+ for (i = 1; i < parts.length; i += 1) {
+ pair = parts[i].match(/([^=]+)(?:=([\s\S]*))?/);
+ key = pair[1].trim().toLowerCase();
+ value = pair[2];
+ switch (key) {
+ case "httponly":
+ this.noscript = true;
+ break;
+ case "expires":
+ this.expiration_date = value ?
+ Number(Date.parse(value)) :
+ Infinity;
+ break;
+ case "path":
+ this.path = value ?
+ value.trim() :
+ "";
+ this.explicit_path = true;
+ break;
+ case "domain":
+ this.domain = value ?
+ value.trim() :
+ "";
+ this.explicit_domain = !!this.domain;
+ break;
+ case "secure":
+ this.secure = true;
+ break;
+ }
+ }
+
+ if (!this.explicit_path) {
+ this.path = request_path || "/";
+ }
+ if (!this.explicit_domain) {
+ this.domain = request_domain;
+ }
+
+ return this;
+ }
+ return new Cookie().parse(str, request_domain, request_path);
+ };
+
+ Cookie.prototype.matches = function matches(access_info) {
+ if (this.noscript && access_info.script ||
+ this.secure && !access_info.secure ||
+ !this.collidesWith(access_info)) {
+ return false;
+ }
+ return true;
+ };
+
+ Cookie.prototype.collidesWith = function collidesWith(access_info) {
+ if ((this.path && !access_info.path) || (this.domain && !access_info.domain)) {
+ return false;
+ }
+ if (this.path && access_info.path.indexOf(this.path) !== 0) {
+ return false;
+ }
+ if (!this.explicit_path) {
+ if (this.path !== access_info.path) {
+ return false;
+ }
+ }
+ var access_domain = access_info.domain && access_info.domain.replace(/^[\.]/,'');
+ var cookie_domain = this.domain && this.domain.replace(/^[\.]/,'');
+ if (cookie_domain === access_domain) {
+ return true;
+ }
+ if (cookie_domain) {
+ if (!this.explicit_domain) {
+ return false; // we already checked if the domains were exactly the same
+ }
+ var wildcard = access_domain.indexOf(cookie_domain);
+ if (wildcard === -1 || wildcard !== access_domain.length - cookie_domain.length) {
+ return false;
+ }
+ return true;
+ }
+ return true;
+ };
+
+ function CookieJar() {
+ var cookies, cookies_list, collidable_cookie;
+ if (this instanceof CookieJar) {
+ cookies = Object.create(null); //name: [Cookie]
+
+ this.setCookie = function setCookie(cookie, request_domain, request_path) {
+ var remove, i;
+ cookie = new Cookie(cookie, request_domain, request_path);
+ //Delete the cookie if the set is past the current time
+ remove = cookie.expiration_date <= Date.now();
+ if (cookies[cookie.name] !== undefined) {
+ cookies_list = cookies[cookie.name];
+ for (i = 0; i < cookies_list.length; i += 1) {
+ collidable_cookie = cookies_list[i];
+ if (collidable_cookie.collidesWith(cookie)) {
+ if (remove) {
+ cookies_list.splice(i, 1);
+ if (cookies_list.length === 0) {
+ delete cookies[cookie.name];
+ }
+ return false;
+ }
+ cookies_list[i] = cookie;
+ return cookie;
+ }
+ }
+ if (remove) {
+ return false;
+ }
+ cookies_list.push(cookie);
+ return cookie;
+ }
+ if (remove) {
+ return false;
+ }
+ cookies[cookie.name] = [cookie];
+ return cookies[cookie.name];
+ };
+ //returns a cookie
+ this.getCookie = function getCookie(cookie_name, access_info) {
+ var cookie, i;
+ cookies_list = cookies[cookie_name];
+ if (!cookies_list) {
+ return;
+ }
+ for (i = 0; i < cookies_list.length; i += 1) {
+ cookie = cookies_list[i];
+ if (cookie.expiration_date <= Date.now()) {
+ if (cookies_list.length === 0) {
+ delete cookies[cookie.name];
+ }
+ continue;
+ }
+ if (cookie.matches(access_info)) {
+ return cookie;
+ }
+ }
+ };
+ //returns a list of cookies
+ this.getCookies = function getCookies(access_info) {
+ var matches = [], cookie_name, cookie;
+ for (cookie_name in cookies) {
+ cookie = this.getCookie(cookie_name, access_info);
+ if (cookie) {
+ matches.push(cookie);
+ }
+ }
+ matches.toString = function toString() {
+ return matches.join(":");
+ };
+ matches.toValueString = function toValueString() {
+ return matches.map(function (c) {
+ return c.toValueString();
+ }).join(';');
+ };
+ return matches;
+ };
+
+ return this;
+ }
+ return new CookieJar();
+ }
+ exports.CookieJar = CookieJar;
+
+ //returns list of cookies that were set correctly. Cookies that are expired and removed are not returned.
+ CookieJar.prototype.setCookies = function setCookies(cookies, request_domain, request_path) {
+ cookies = Array.isArray(cookies) ?
+ cookies :
+ cookies.split(cookie_str_splitter);
+ var successful = [],
+ i,
+ cookie;
+ cookies = cookies.map(Cookie);
+ for (i = 0; i < cookies.length; i += 1) {
+ cookie = cookies[i];
+ if (this.setCookie(cookie, request_domain, request_path)) {
+ successful.push(cookie);
+ }
+ }
+ return successful;
+ };
+}());
+
+},{}],20:[function(require,module,exports){
+/*!
+ * jQuery JavaScript Library v2.1.4
+ * http://jquery.com/
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ *
+ * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
+ * Released under the MIT license
+ * http://jquery.org/license
+ *
+ * Date: 2015-04-28T16:01Z
+ */
+
+(function( global, factory ) {
+
+ if ( typeof module === "object" && typeof module.exports === "object" ) {
+ // For CommonJS and CommonJS-like environments where a proper `window`
+ // is present, execute the factory and get jQuery.
+ // For environments that do not have a `window` with a `document`
+ // (such as Node.js), expose a factory as module.exports.
+ // This accentuates the need for the creation of a real `window`.
+ // e.g. var jQuery = require("jquery")(window);
+ // See ticket #14549 for more info.
+ module.exports = global.document ?
+ factory( global, true ) :
+ function( w ) {
+ if ( !w.document ) {
+ throw new Error( "jQuery requires a window with a document" );
+ }
+ return factory( w );
+ };
+ } else {
+ factory( global );
+ }
+
+// Pass this if window is not defined yet
+}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
+
+// Support: Firefox 18+
+// Can't be in strict mode, several libs including ASP.NET trace
+// the stack via arguments.caller.callee and Firefox dies if
+// you try to trace through "use strict" call chains. (#13335)
+//
+
+var arr = [];
+
+var slice = arr.slice;
+
+var concat = arr.concat;
+
+var push = arr.push;
+
+var indexOf = arr.indexOf;
+
+var class2type = {};
+
+var toString = class2type.toString;
+
+var hasOwn = class2type.hasOwnProperty;
+
+var support = {};
+
+
+
+var
+ // Use the correct document accordingly with window argument (sandbox)
+ document = window.document,
+
+ version = "2.1.4",
+
+ // Define a local copy of jQuery
+ jQuery = function( selector, context ) {
+ // The jQuery object is actually just the init constructor 'enhanced'
+ // Need init if jQuery is called (just allow error to be thrown if not included)
+ return new jQuery.fn.init( selector, context );
+ },
+
+ // Support: Android<4.1
+ // Make sure we trim BOM and NBSP
+ rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
+
+ // Matches dashed string for camelizing
+ rmsPrefix = /^-ms-/,
+ rdashAlpha = /-([\da-z])/gi,
+
+ // Used by jQuery.camelCase as callback to replace()
+ fcamelCase = function( all, letter ) {
+ return letter.toUpperCase();
+ };
+
+jQuery.fn = jQuery.prototype = {
+ // The current version of jQuery being used
+ jquery: version,
+
+ constructor: jQuery,
+
+ // Start with an empty selector
+ selector: "",
+
+ // The default length of a jQuery object is 0
+ length: 0,
+
+ toArray: function() {
+ return slice.call( this );
+ },
+
+ // Get the Nth element in the matched element set OR
+ // Get the whole matched element set as a clean array
+ get: function( num ) {
+ return num != null ?
+
+ // Return just the one element from the set
+ ( num < 0 ? this[ num + this.length ] : this[ num ] ) :
+
+ // Return all the elements in a clean array
+ slice.call( this );
+ },
+
+ // Take an array of elements and push it onto the stack
+ // (returning the new matched element set)
+ pushStack: function( elems ) {
+
+ // Build a new jQuery matched element set
+ var ret = jQuery.merge( this.constructor(), elems );
+
+ // Add the old object onto the stack (as a reference)
+ ret.prevObject = this;
+ ret.context = this.context;
+
+ // Return the newly-formed element set
+ return ret;
+ },
+
+ // Execute a callback for every element in the matched set.
+ // (You can seed the arguments with an array of args, but this is
+ // only used internally.)
+ each: function( callback, args ) {
+ return jQuery.each( this, callback, args );
+ },
+
+ map: function( callback ) {
+ return this.pushStack( jQuery.map(this, function( elem, i ) {
+ return callback.call( elem, i, elem );
+ }));
+ },
+
+ slice: function() {
+ return this.pushStack( slice.apply( this, arguments ) );
+ },
+
+ first: function() {
+ return this.eq( 0 );
+ },
+
+ last: function() {
+ return this.eq( -1 );
+ },
+
+ eq: function( i ) {
+ var len = this.length,
+ j = +i + ( i < 0 ? len : 0 );
+ return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
+ },
+
+ end: function() {
+ return this.prevObject || this.constructor(null);
+ },
+
+ // For internal use only.
+ // Behaves like an Array's method, not like a jQuery method.
+ push: push,
+ sort: arr.sort,
+ splice: arr.splice
+};
+
+jQuery.extend = jQuery.fn.extend = function() {
+ var options, name, src, copy, copyIsArray, clone,
+ target = arguments[0] || {},
+ i = 1,
+ length = arguments.length,
+ deep = false;
+
+ // Handle a deep copy situation
+ if ( typeof target === "boolean" ) {
+ deep = target;
+
+ // Skip the boolean and the target
+ target = arguments[ i ] || {};
+ i++;
+ }
+
+ // Handle case when target is a string or something (possible in deep copy)
+ if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
+ target = {};
+ }
+
+ // Extend jQuery itself if only one argument is passed
+ if ( i === length ) {
+ target = this;
+ i--;
+ }
+
+ for ( ; i < length; i++ ) {
+ // Only deal with non-null/undefined values
+ if ( (options = arguments[ i ]) != null ) {
+ // Extend the base object
+ for ( name in options ) {
+ src = target[ name ];
+ copy = options[ name ];
+
+ // Prevent never-ending loop
+ if ( target === copy ) {
+ continue;
+ }
+
+ // Recurse if we're merging plain objects or arrays
+ if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
+ if ( copyIsArray ) {
+ copyIsArray = false;
+ clone = src && jQuery.isArray(src) ? src : [];
+
+ } else {
+ clone = src && jQuery.isPlainObject(src) ? src : {};
+ }
+
+ // Never move original objects, clone them
+ target[ name ] = jQuery.extend( deep, clone, copy );
+
+ // Don't bring in undefined values
+ } else if ( copy !== undefined ) {
+ target[ name ] = copy;
+ }
+ }
+ }
+ }
+
+ // Return the modified object
+ return target;
+};
+
+jQuery.extend({
+ // Unique for each copy of jQuery on the page
+ expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
+
+ // Assume jQuery is ready without the ready module
+ isReady: true,
+
+ error: function( msg ) {
+ throw new Error( msg );
+ },
+
+ noop: function() {},
+
+ isFunction: function( obj ) {
+ return jQuery.type(obj) === "function";
+ },
+
+ isArray: Array.isArray,
+
+ isWindow: function( obj ) {
+ return obj != null && obj === obj.window;
+ },
+
+ isNumeric: function( obj ) {
+ // parseFloat NaNs numeric-cast false positives (null|true|false|"")
+ // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
+ // subtraction forces infinities to NaN
+ // adding 1 corrects loss of precision from parseFloat (#15100)
+ return !jQuery.isArray( obj ) && (obj - parseFloat( obj ) + 1) >= 0;
+ },
+
+ isPlainObject: function( obj ) {
+ // Not plain objects:
+ // - Any object or value whose internal [[Class]] property is not "[object Object]"
+ // - DOM nodes
+ // - window
+ if ( jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
+ return false;
+ }
+
+ if ( obj.constructor &&
+ !hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) {
+ return false;
+ }
+
+ // If the function hasn't returned already, we're confident that
+ // |obj| is a plain object, created by {} or constructed with new Object
+ return true;
+ },
+
+ isEmptyObject: function( obj ) {
+ var name;
+ for ( name in obj ) {
+ return false;
+ }
+ return true;
+ },
+
+ type: function( obj ) {
+ if ( obj == null ) {
+ return obj + "";
+ }
+ // Support: Android<4.0, iOS<6 (functionish RegExp)
+ return typeof obj === "object" || typeof obj === "function" ?
+ class2type[ toString.call(obj) ] || "object" :
+ typeof obj;
+ },
+
+ // Evaluates a script in a global context
+ globalEval: function( code ) {
+ var script,
+ indirect = eval;
+
+ code = jQuery.trim( code );
+
+ if ( code ) {
+ // If the code includes a valid, prologue position
+ // strict mode pragma, execute code by injecting a
+ // script tag into the document.
+ if ( code.indexOf("use strict") === 1 ) {
+ script = document.createElement("script");
+ script.text = code;
+ document.head.appendChild( script ).parentNode.removeChild( script );
+ } else {
+ // Otherwise, avoid the DOM node creation, insertion
+ // and removal by using an indirect global eval
+ indirect( code );
+ }
+ }
+ },
+
+ // Convert dashed to camelCase; used by the css and data modules
+ // Support: IE9-11+
+ // Microsoft forgot to hump their vendor prefix (#9572)
+ camelCase: function( string ) {
+ return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
+ },
+
+ nodeName: function( elem, name ) {
+ return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
+ },
+
+ // args is for internal usage only
+ each: function( obj, callback, args ) {
+ var value,
+ i = 0,
+ length = obj.length,
+ isArray = isArraylike( obj );
+
+ if ( args ) {
+ if ( isArray ) {
+ for ( ; i < length; i++ ) {
+ value = callback.apply( obj[ i ], args );
+
+ if ( value === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( i in obj ) {
+ value = callback.apply( obj[ i ], args );
+
+ if ( value === false ) {
+ break;
+ }
+ }
+ }
+
+ // A special, fast, case for the most common use of each
+ } else {
+ if ( isArray ) {
+ for ( ; i < length; i++ ) {
+ value = callback.call( obj[ i ], i, obj[ i ] );
+
+ if ( value === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( i in obj ) {
+ value = callback.call( obj[ i ], i, obj[ i ] );
+
+ if ( value === false ) {
+ break;
+ }
+ }
+ }
+ }
+
+ return obj;
+ },
+
+ // Support: Android<4.1
+ trim: function( text ) {
+ return text == null ?
+ "" :
+ ( text + "" ).replace( rtrim, "" );
+ },
+
+ // results is for internal usage only
+ makeArray: function( arr, results ) {
+ var ret = results || [];
+
+ if ( arr != null ) {
+ if ( isArraylike( Object(arr) ) ) {
+ jQuery.merge( ret,
+ typeof arr === "string" ?
+ [ arr ] : arr
+ );
+ } else {
+ push.call( ret, arr );
+ }
+ }
+
+ return ret;
+ },
+
+ inArray: function( elem, arr, i ) {
+ return arr == null ? -1 : indexOf.call( arr, elem, i );
+ },
+
+ merge: function( first, second ) {
+ var len = +second.length,
+ j = 0,
+ i = first.length;
+
+ for ( ; j < len; j++ ) {
+ first[ i++ ] = second[ j ];
+ }
+
+ first.length = i;
+
+ return first;
+ },
+
+ grep: function( elems, callback, invert ) {
+ var callbackInverse,
+ matches = [],
+ i = 0,
+ length = elems.length,
+ callbackExpect = !invert;
+
+ // Go through the array, only saving the items
+ // that pass the validator function
+ for ( ; i < length; i++ ) {
+ callbackInverse = !callback( elems[ i ], i );
+ if ( callbackInverse !== callbackExpect ) {
+ matches.push( elems[ i ] );
+ }
+ }
+
+ return matches;
+ },
+
+ // arg is for internal usage only
+ map: function( elems, callback, arg ) {
+ var value,
+ i = 0,
+ length = elems.length,
+ isArray = isArraylike( elems ),
+ ret = [];
+
+ // Go through the array, translating each of the items to their new values
+ if ( isArray ) {
+ for ( ; i < length; i++ ) {
+ value = callback( elems[ i ], i, arg );
+
+ if ( value != null ) {
+ ret.push( value );
+ }
+ }
+
+ // Go through every key on the object,
+ } else {
+ for ( i in elems ) {
+ value = callback( elems[ i ], i, arg );
+
+ if ( value != null ) {
+ ret.push( value );
+ }
+ }
+ }
+
+ // Flatten any nested arrays
+ return concat.apply( [], ret );
+ },
+
+ // A global GUID counter for objects
+ guid: 1,
+
+ // Bind a function to a context, optionally partially applying any
+ // arguments.
+ proxy: function( fn, context ) {
+ var tmp, args, proxy;
+
+ if ( typeof context === "string" ) {
+ tmp = fn[ context ];
+ context = fn;
+ fn = tmp;
+ }
+
+ // Quick check to determine if target is callable, in the spec
+ // this throws a TypeError, but we will just return undefined.
+ if ( !jQuery.isFunction( fn ) ) {
+ return undefined;
+ }
+
+ // Simulated bind
+ args = slice.call( arguments, 2 );
+ proxy = function() {
+ return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
+ };
+
+ // Set the guid of unique handler to the same of original handler, so it can be removed
+ proxy.guid = fn.guid = fn.guid || jQuery.guid++;
+
+ return proxy;
+ },
+
+ now: Date.now,
+
+ // jQuery.support is not used in Core but other projects attach their
+ // properties to it so it needs to exist.
+ support: support
+});
+
+// Populate the class2type map
+jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
+ class2type[ "[object " + name + "]" ] = name.toLowerCase();
+});
+
+function isArraylike( obj ) {
+
+ // Support: iOS 8.2 (not reproducible in simulator)
+ // `in` check used to prevent JIT error (gh-2145)
+ // hasOwn isn't used here due to false negatives
+ // regarding Nodelist length in IE
+ var length = "length" in obj && obj.length,
+ type = jQuery.type( obj );
+
+ if ( type === "function" || jQuery.isWindow( obj ) ) {
+ return false;
+ }
+
+ if ( obj.nodeType === 1 && length ) {
+ return true;
+ }
+
+ return type === "array" || length === 0 ||
+ typeof length === "number" && length > 0 && ( length - 1 ) in obj;
+}
+var Sizzle =
+/*!
+ * Sizzle CSS Selector Engine v2.2.0-pre
+ * http://sizzlejs.com/
+ *
+ * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors
+ * Released under the MIT license
+ * http://jquery.org/license
+ *
+ * Date: 2014-12-16
+ */
+(function( window ) {
+
+var i,
+ support,
+ Expr,
+ getText,
+ isXML,
+ tokenize,
+ compile,
+ select,
+ outermostContext,
+ sortInput,
+ hasDuplicate,
+
+ // Local document vars
+ setDocument,
+ document,
+ docElem,
+ documentIsHTML,
+ rbuggyQSA,
+ rbuggyMatches,
+ matches,
+ contains,
+
+ // Instance-specific data
+ expando = "sizzle" + 1 * new Date(),
+ preferredDoc = window.document,
+ dirruns = 0,
+ done = 0,
+ classCache = createCache(),
+ tokenCache = createCache(),
+ compilerCache = createCache(),
+ sortOrder = function( a, b ) {
+ if ( a === b ) {
+ hasDuplicate = true;
+ }
+ return 0;
+ },
+
+ // General-purpose constants
+ MAX_NEGATIVE = 1 << 31,
+
+ // Instance methods
+ hasOwn = ({}).hasOwnProperty,
+ arr = [],
+ pop = arr.pop,
+ push_native = arr.push,
+ push = arr.push,
+ slice = arr.slice,
+ // Use a stripped-down indexOf as it's faster than native
+ // http://jsperf.com/thor-indexof-vs-for/5
+ indexOf = function( list, elem ) {
+ var i = 0,
+ len = list.length;
+ for ( ; i < len; i++ ) {
+ if ( list[i] === elem ) {
+ return i;
+ }
+ }
+ return -1;
+ },
+
+ booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
+
+ // Regular expressions
+
+ // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
+ whitespace = "[\\x20\\t\\r\\n\\f]",
+ // http://www.w3.org/TR/css3-syntax/#characters
+ characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
+
+ // Loosely modeled on CSS identifier characters
+ // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
+ // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
+ identifier = characterEncoding.replace( "w", "w#" ),
+
+ // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
+ attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace +
+ // Operator (capture 2)
+ "*([*^$|!~]?=)" + whitespace +
+ // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
+ "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
+ "*\\]",
+
+ pseudos = ":(" + characterEncoding + ")(?:\\((" +
+ // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
+ // 1. quoted (capture 3; capture 4 or capture 5)
+ "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
+ // 2. simple (capture 6)
+ "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
+ // 3. anything else (capture 2)
+ ".*" +
+ ")\\)|)",
+
+ // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
+ rwhitespace = new RegExp( whitespace + "+", "g" ),
+ rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
+
+ rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
+ rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
+
+ rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
+
+ rpseudo = new RegExp( pseudos ),
+ ridentifier = new RegExp( "^" + identifier + "$" ),
+
+ matchExpr = {
+ "ID": new RegExp( "^#(" + characterEncoding + ")" ),
+ "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
+ "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
+ "ATTR": new RegExp( "^" + attributes ),
+ "PSEUDO": new RegExp( "^" + pseudos ),
+ "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
+ "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
+ "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
+ "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
+ // For use in libraries implementing .is()
+ // We use this for POS matching in `select`
+ "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
+ whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
+ },
+
+ rinputs = /^(?:input|select|textarea|button)$/i,
+ rheader = /^h\d$/i,
+
+ rnative = /^[^{]+\{\s*\[native \w/,
+
+ // Easily-parseable/retrievable ID or TAG or CLASS selectors
+ rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
+
+ rsibling = /[+~]/,
+ rescape = /'|\\/g,
+
+ // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
+ runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
+ funescape = function( _, escaped, escapedWhitespace ) {
+ var high = "0x" + escaped - 0x10000;
+ // NaN means non-codepoint
+ // Support: Firefox<24
+ // Workaround erroneous numeric interpretation of +"0x"
+ return high !== high || escapedWhitespace ?
+ escaped :
+ high < 0 ?
+ // BMP codepoint
+ String.fromCharCode( high + 0x10000 ) :
+ // Supplemental Plane codepoint (surrogate pair)
+ String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
+ },
+
+ // Used for iframes
+ // See setDocument()
+ // Removing the function wrapper causes a "Permission Denied"
+ // error in IE
+ unloadHandler = function() {
+ setDocument();
+ };
+
+// Optimize for push.apply( _, NodeList )
+try {
+ push.apply(
+ (arr = slice.call( preferredDoc.childNodes )),
+ preferredDoc.childNodes
+ );
+ // Support: Android<4.0
+ // Detect silently failing push.apply
+ arr[ preferredDoc.childNodes.length ].nodeType;
+} catch ( e ) {
+ push = { apply: arr.length ?
+
+ // Leverage slice if possible
+ function( target, els ) {
+ push_native.apply( target, slice.call(els) );
+ } :
+
+ // Support: IE<9
+ // Otherwise append directly
+ function( target, els ) {
+ var j = target.length,
+ i = 0;
+ // Can't trust NodeList.length
+ while ( (target[j++] = els[i++]) ) {}
+ target.length = j - 1;
+ }
+ };
+}
+
+function Sizzle( selector, context, results, seed ) {
+ var match, elem, m, nodeType,
+ // QSA vars
+ i, groups, old, nid, newContext, newSelector;
+
+ if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
+ setDocument( context );
+ }
+
+ context = context || document;
+ results = results || [];
+ nodeType = context.nodeType;
+
+ if ( typeof selector !== "string" || !selector ||
+ nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
+
+ return results;
+ }
+
+ if ( !seed && documentIsHTML ) {
+
+ // Try to shortcut find operations when possible (e.g., not under DocumentFragment)
+ if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
+ // Speed-up: Sizzle("#ID")
+ if ( (m = match[1]) ) {
+ if ( nodeType === 9 ) {
+ elem = context.getElementById( m );
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document (jQuery #6963)
+ if ( elem && elem.parentNode ) {
+ // Handle the case where IE, Opera, and Webkit return items
+ // by name instead of ID
+ if ( elem.id === m ) {
+ results.push( elem );
+ return results;
+ }
+ } else {
+ return results;
+ }
+ } else {
+ // Context is not a document
+ if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
+ contains( context, elem ) && elem.id === m ) {
+ results.push( elem );
+ return results;
+ }
+ }
+
+ // Speed-up: Sizzle("TAG")
+ } else if ( match[2] ) {
+ push.apply( results, context.getElementsByTagName( selector ) );
+ return results;
+
+ // Speed-up: Sizzle(".CLASS")
+ } else if ( (m = match[3]) && support.getElementsByClassName ) {
+ push.apply( results, context.getElementsByClassName( m ) );
+ return results;
+ }
+ }
+
+ // QSA path
+ if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
+ nid = old = expando;
+ newContext = context;
+ newSelector = nodeType !== 1 && selector;
+
+ // qSA works strangely on Element-rooted queries
+ // We can work around this by specifying an extra ID on the root
+ // and working up from there (Thanks to Andrew Dupont for the technique)
+ // IE 8 doesn't work on object elements
+ if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
+ groups = tokenize( selector );
+
+ if ( (old = context.getAttribute("id")) ) {
+ nid = old.replace( rescape, "\\$&" );
+ } else {
+ context.setAttribute( "id", nid );
+ }
+ nid = "[id='" + nid + "'] ";
+
+ i = groups.length;
+ while ( i-- ) {
+ groups[i] = nid + toSelector( groups[i] );
+ }
+ newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context;
+ newSelector = groups.join(",");
+ }
+
+ if ( newSelector ) {
+ try {
+ push.apply( results,
+ newContext.querySelectorAll( newSelector )
+ );
+ return results;
+ } catch(qsaError) {
+ } finally {
+ if ( !old ) {
+ context.removeAttribute("id");
+ }
+ }
+ }
+ }
+ }
+
+ // All others
+ return select( selector.replace( rtrim, "$1" ), context, results, seed );
+}
+
+/**
+ * Create key-value caches of limited size
+ * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
+ * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
+ * deleting the oldest entry
+ */
+function createCache() {
+ var keys = [];
+
+ function cache( key, value ) {
+ // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
+ if ( keys.push( key + " " ) > Expr.cacheLength ) {
+ // Only keep the most recent entries
+ delete cache[ keys.shift() ];
+ }
+ return (cache[ key + " " ] = value);
+ }
+ return cache;
+}
+
+/**
+ * Mark a function for special use by Sizzle
+ * @param {Function} fn The function to mark
+ */
+function markFunction( fn ) {
+ fn[ expando ] = true;
+ return fn;
+}
+
+/**
+ * Support testing using an element
+ * @param {Function} fn Passed the created div and expects a boolean result
+ */
+function assert( fn ) {
+ var div = document.createElement("div");
+
+ try {
+ return !!fn( div );
+ } catch (e) {
+ return false;
+ } finally {
+ // Remove from its parent by default
+ if ( div.parentNode ) {
+ div.parentNode.removeChild( div );
+ }
+ // release memory in IE
+ div = null;
+ }
+}
+
+/**
+ * Adds the same handler for all of the specified attrs
+ * @param {String} attrs Pipe-separated list of attributes
+ * @param {Function} handler The method that will be applied
+ */
+function addHandle( attrs, handler ) {
+ var arr = attrs.split("|"),
+ i = attrs.length;
+
+ while ( i-- ) {
+ Expr.attrHandle[ arr[i] ] = handler;
+ }
+}
+
+/**
+ * Checks document order of two siblings
+ * @param {Element} a
+ * @param {Element} b
+ * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
+ */
+function siblingCheck( a, b ) {
+ var cur = b && a,
+ diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
+ ( ~b.sourceIndex || MAX_NEGATIVE ) -
+ ( ~a.sourceIndex || MAX_NEGATIVE );
+
+ // Use IE sourceIndex if available on both nodes
+ if ( diff ) {
+ return diff;
+ }
+
+ // Check if b follows a
+ if ( cur ) {
+ while ( (cur = cur.nextSibling) ) {
+ if ( cur === b ) {
+ return -1;
+ }
+ }
+ }
+
+ return a ? 1 : -1;
+}
+
+/**
+ * Returns a function to use in pseudos for input types
+ * @param {String} type
+ */
+function createInputPseudo( type ) {
+ return function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return name === "input" && elem.type === type;
+ };
+}
+
+/**
+ * Returns a function to use in pseudos for buttons
+ * @param {String} type
+ */
+function createButtonPseudo( type ) {
+ return function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return (name === "input" || name === "button") && elem.type === type;
+ };
+}
+
+/**
+ * Returns a function to use in pseudos for positionals
+ * @param {Function} fn
+ */
+function createPositionalPseudo( fn ) {
+ return markFunction(function( argument ) {
+ argument = +argument;
+ return markFunction(function( seed, matches ) {
+ var j,
+ matchIndexes = fn( [], seed.length, argument ),
+ i = matchIndexes.length;
+
+ // Match elements found at the specified indexes
+ while ( i-- ) {
+ if ( seed[ (j = matchIndexes[i]) ] ) {
+ seed[j] = !(matches[j] = seed[j]);
+ }
+ }
+ });
+ });
+}
+
+/**
+ * Checks a node for validity as a Sizzle context
+ * @param {Element|Object=} context
+ * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
+ */
+function testContext( context ) {
+ return context && typeof context.getElementsByTagName !== "undefined" && context;
+}
+
+// Expose support vars for convenience
+support = Sizzle.support = {};
+
+/**
+ * Detects XML nodes
+ * @param {Element|Object} elem An element or a document
+ * @returns {Boolean} True iff elem is a non-HTML XML node
+ */
+isXML = Sizzle.isXML = function( elem ) {
+ // documentElement is verified for cases where it doesn't yet exist
+ // (such as loading iframes in IE - #4833)
+ var documentElement = elem && (elem.ownerDocument || elem).documentElement;
+ return documentElement ? documentElement.nodeName !== "HTML" : false;
+};
+
+/**
+ * Sets document-related variables once based on the current document
+ * @param {Element|Object} [doc] An element or document object to use to set the document
+ * @returns {Object} Returns the current document
+ */
+setDocument = Sizzle.setDocument = function( node ) {
+ var hasCompare, parent,
+ doc = node ? node.ownerDocument || node : preferredDoc;
+
+ // If no document and documentElement is available, return
+ if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
+ return document;
+ }
+
+ // Set our document
+ document = doc;
+ docElem = doc.documentElement;
+ parent = doc.defaultView;
+
+ // Support: IE>8
+ // If iframe document is assigned to "document" variable and if iframe has been reloaded,
+ // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936
+ // IE6-8 do not support the defaultView property so parent will be undefined
+ if ( parent && parent !== parent.top ) {
+ // IE11 does not have attachEvent, so all must suffer
+ if ( parent.addEventListener ) {
+ parent.addEventListener( "unload", unloadHandler, false );
+ } else if ( parent.attachEvent ) {
+ parent.attachEvent( "onunload", unloadHandler );
+ }
+ }
+
+ /* Support tests
+ ---------------------------------------------------------------------- */
+ documentIsHTML = !isXML( doc );
+
+ /* Attributes
+ ---------------------------------------------------------------------- */
+
+ // Support: IE<8
+ // Verify that getAttribute really returns attributes and not properties
+ // (excepting IE8 booleans)
+ support.attributes = assert(function( div ) {
+ div.className = "i";
+ return !div.getAttribute("className");
+ });
+
+ /* getElement(s)By*
+ ---------------------------------------------------------------------- */
+
+ // Check if getElementsByTagName("*") returns only elements
+ support.getElementsByTagName = assert(function( div ) {
+ div.appendChild( doc.createComment("") );
+ return !div.getElementsByTagName("*").length;
+ });
+
+ // Support: IE<9
+ support.getElementsByClassName = rnative.test( doc.getElementsByClassName );
+
+ // Support: IE<10
+ // Check if getElementById returns elements by name
+ // The broken getElementById methods don't pick up programatically-set names,
+ // so use a roundabout getElementsByName test
+ support.getById = assert(function( div ) {
+ docElem.appendChild( div ).id = expando;
+ return !doc.getElementsByName || !doc.getElementsByName( expando ).length;
+ });
+
+ // ID find and filter
+ if ( support.getById ) {
+ Expr.find["ID"] = function( id, context ) {
+ if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
+ var m = context.getElementById( id );
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ return m && m.parentNode ? [ m ] : [];
+ }
+ };
+ Expr.filter["ID"] = function( id ) {
+ var attrId = id.replace( runescape, funescape );
+ return function( elem ) {
+ return elem.getAttribute("id") === attrId;
+ };
+ };
+ } else {
+ // Support: IE6/7
+ // getElementById is not reliable as a find shortcut
+ delete Expr.find["ID"];
+
+ Expr.filter["ID"] = function( id ) {
+ var attrId = id.replace( runescape, funescape );
+ return function( elem ) {
+ var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
+ return node && node.value === attrId;
+ };
+ };
+ }
+
+ // Tag
+ Expr.find["TAG"] = support.getElementsByTagName ?
+ function( tag, context ) {
+ if ( typeof context.getElementsByTagName !== "undefined" ) {
+ return context.getElementsByTagName( tag );
+
+ // DocumentFragment nodes don't have gEBTN
+ } else if ( support.qsa ) {
+ return context.querySelectorAll( tag );
+ }
+ } :
+
+ function( tag, context ) {
+ var elem,
+ tmp = [],
+ i = 0,
+ // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
+ results = context.getElementsByTagName( tag );
+
+ // Filter out possible comments
+ if ( tag === "*" ) {
+ while ( (elem = results[i++]) ) {
+ if ( elem.nodeType === 1 ) {
+ tmp.push( elem );
+ }
+ }
+
+ return tmp;
+ }
+ return results;
+ };
+
+ // Class
+ Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
+ if ( documentIsHTML ) {
+ return context.getElementsByClassName( className );
+ }
+ };
+
+ /* QSA/matchesSelector
+ ---------------------------------------------------------------------- */
+
+ // QSA and matchesSelector support
+
+ // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
+ rbuggyMatches = [];
+
+ // qSa(:focus) reports false when true (Chrome 21)
+ // We allow this because of a bug in IE8/9 that throws an error
+ // whenever `document.activeElement` is accessed on an iframe
+ // So, we allow :focus to pass through QSA all the time to avoid the IE error
+ // See http://bugs.jquery.com/ticket/13378
+ rbuggyQSA = [];
+
+ if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {
+ // Build QSA regex
+ // Regex strategy adopted from Diego Perini
+ assert(function( div ) {
+ // Select is set to empty string on purpose
+ // This is to test IE's treatment of not explicitly
+ // setting a boolean content attribute,
+ // since its presence should be enough
+ // http://bugs.jquery.com/ticket/12359
+ docElem.appendChild( div ).innerHTML = "<a id='" + expando + "'></a>" +
+ "<select id='" + expando + "-\f]' msallowcapture=''>" +
+ "<option selected=''></option></select>";
+
+ // Support: IE8, Opera 11-12.16
+ // Nothing should be selected when empty strings follow ^= or $= or *=
+ // The test attribute must be unknown in Opera but "safe" for WinRT
+ // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
+ if ( div.querySelectorAll("[msallowcapture^='']").length ) {
+ rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
+ }
+
+ // Support: IE8
+ // Boolean attributes and "value" are not treated correctly
+ if ( !div.querySelectorAll("[selected]").length ) {
+ rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
+ }
+
+ // Support: Chrome<29, Android<4.2+, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.7+
+ if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
+ rbuggyQSA.push("~=");
+ }
+
+ // Webkit/Opera - :checked should return selected option elements
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
+ // IE8 throws error here and will not see later tests
+ if ( !div.querySelectorAll(":checked").length ) {
+ rbuggyQSA.push(":checked");
+ }
+
+ // Support: Safari 8+, iOS 8+
+ // https://bugs.webkit.org/show_bug.cgi?id=136851
+ // In-page `selector#id sibing-combinator selector` fails
+ if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) {
+ rbuggyQSA.push(".#.+[+~]");
+ }
+ });
+
+ assert(function( div ) {
+ // Support: Windows 8 Native Apps
+ // The type and name attributes are restricted during .innerHTML assignment
+ var input = doc.createElement("input");
+ input.setAttribute( "type", "hidden" );
+ div.appendChild( input ).setAttribute( "name", "D" );
+
+ // Support: IE8
+ // Enforce case-sensitivity of name attribute
+ if ( div.querySelectorAll("[name=d]").length ) {
+ rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
+ }
+
+ // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
+ // IE8 throws error here and will not see later tests
+ if ( !div.querySelectorAll(":enabled").length ) {
+ rbuggyQSA.push( ":enabled", ":disabled" );
+ }
+
+ // Opera 10-11 does not throw on post-comma invalid pseudos
+ div.querySelectorAll("*,:x");
+ rbuggyQSA.push(",.*:");
+ });
+ }
+
+ if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
+ docElem.webkitMatchesSelector ||
+ docElem.mozMatchesSelector ||
+ docElem.oMatchesSelector ||
+ docElem.msMatchesSelector) )) ) {
+
+ assert(function( div ) {
+ // Check to see if it's possible to do matchesSelector
+ // on a disconnected node (IE 9)
+ support.disconnectedMatch = matches.call( div, "div" );
+
+ // This should fail with an exception
+ // Gecko does not error, returns false instead
+ matches.call( div, "[s!='']:x" );
+ rbuggyMatches.push( "!=", pseudos );
+ });
+ }
+
+ rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
+ rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
+
+ /* Contains
+ ---------------------------------------------------------------------- */
+ hasCompare = rnative.test( docElem.compareDocumentPosition );
+
+ // Element contains another
+ // Purposefully does not implement inclusive descendent
+ // As in, an element does not contain itself
+ contains = hasCompare || rnative.test( docElem.contains ) ?
+ function( a, b ) {
+ var adown = a.nodeType === 9 ? a.documentElement : a,
+ bup = b && b.parentNode;
+ return a === bup || !!( bup && bup.nodeType === 1 && (
+ adown.contains ?
+ adown.contains( bup ) :
+ a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
+ ));
+ } :
+ function( a, b ) {
+ if ( b ) {
+ while ( (b = b.parentNode) ) {
+ if ( b === a ) {
+ return true;
+ }
+ }
+ }
+ return false;
+ };
+
+ /* Sorting
+ ---------------------------------------------------------------------- */
+
+ // Document order sorting
+ sortOrder = hasCompare ?
+ function( a, b ) {
+
+ // Flag for duplicate removal
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+ }
+
+ // Sort on method existence if only one input has compareDocumentPosition
+ var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
+ if ( compare ) {
+ return compare;
+ }
+
+ // Calculate position if both inputs belong to the same document
+ compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
+ a.compareDocumentPosition( b ) :
+
+ // Otherwise we know they are disconnected
+ 1;
+
+ // Disconnected nodes
+ if ( compare & 1 ||
+ (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
+
+ // Choose the first element that is related to our preferred document
+ if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
+ return -1;
+ }
+ if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
+ return 1;
+ }
+
+ // Maintain original order
+ return sortInput ?
+ ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
+ 0;
+ }
+
+ return compare & 4 ? -1 : 1;
+ } :
+ function( a, b ) {
+ // Exit early if the nodes are identical
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+ }
+
+ var cur,
+ i = 0,
+ aup = a.parentNode,
+ bup = b.parentNode,
+ ap = [ a ],
+ bp = [ b ];
+
+ // Parentless nodes are either documents or disconnected
+ if ( !aup || !bup ) {
+ return a === doc ? -1 :
+ b === doc ? 1 :
+ aup ? -1 :
+ bup ? 1 :
+ sortInput ?
+ ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
+ 0;
+
+ // If the nodes are siblings, we can do a quick check
+ } else if ( aup === bup ) {
+ return siblingCheck( a, b );
+ }
+
+ // Otherwise we need full lists of their ancestors for comparison
+ cur = a;
+ while ( (cur = cur.parentNode) ) {
+ ap.unshift( cur );
+ }
+ cur = b;
+ while ( (cur = cur.parentNode) ) {
+ bp.unshift( cur );
+ }
+
+ // Walk down the tree looking for a discrepancy
+ while ( ap[i] === bp[i] ) {
+ i++;
+ }
+
+ return i ?
+ // Do a sibling check if the nodes have a common ancestor
+ siblingCheck( ap[i], bp[i] ) :
+
+ // Otherwise nodes in our document sort first
+ ap[i] === preferredDoc ? -1 :
+ bp[i] === preferredDoc ? 1 :
+ 0;
+ };
+
+ return doc;
+};
+
+Sizzle.matches = function( expr, elements ) {
+ return Sizzle( expr, null, null, elements );
+};
+
+Sizzle.matchesSelector = function( elem, expr ) {
+ // Set document vars if needed
+ if ( ( elem.ownerDocument || elem ) !== document ) {
+ setDocument( elem );
+ }
+
+ // Make sure that attribute selectors are quoted
+ expr = expr.replace( rattributeQuotes, "='$1']" );
+
+ if ( support.matchesSelector && documentIsHTML &&
+ ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
+ ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
+
+ try {
+ var ret = matches.call( elem, expr );
+
+ // IE 9's matchesSelector returns false on disconnected nodes
+ if ( ret || support.disconnectedMatch ||
+ // As well, disconnected nodes are said to be in a document
+ // fragment in IE 9
+ elem.document && elem.document.nodeType !== 11 ) {
+ return ret;
+ }
+ } catch (e) {}
+ }
+
+ return Sizzle( expr, document, null, [ elem ] ).length > 0;
+};
+
+Sizzle.contains = function( context, elem ) {
+ // Set document vars if needed
+ if ( ( context.ownerDocument || context ) !== document ) {
+ setDocument( context );
+ }
+ return contains( context, elem );
+};
+
+Sizzle.attr = function( elem, name ) {
+ // Set document vars if needed
+ if ( ( elem.ownerDocument || elem ) !== document ) {
+ setDocument( elem );
+ }
+
+ var fn = Expr.attrHandle[ name.toLowerCase() ],
+ // Don't get fooled by Object.prototype properties (jQuery #13807)
+ val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
+ fn( elem, name, !documentIsHTML ) :
+ undefined;
+
+ return val !== undefined ?
+ val :
+ support.attributes || !documentIsHTML ?
+ elem.getAttribute( name ) :
+ (val = elem.getAttributeNode(name)) && val.specified ?
+ val.value :
+ null;
+};
+
+Sizzle.error = function( msg ) {
+ throw new Error( "Syntax error, unrecognized expression: " + msg );
+};
+
+/**
+ * Document sorting and removing duplicates
+ * @param {ArrayLike} results
+ */
+Sizzle.uniqueSort = function( results ) {
+ var elem,
+ duplicates = [],
+ j = 0,
+ i = 0;
+
+ // Unless we *know* we can detect duplicates, assume their presence
+ hasDuplicate = !support.detectDuplicates;
+ sortInput = !support.sortStable && results.slice( 0 );
+ results.sort( sortOrder );
+
+ if ( hasDuplicate ) {
+ while ( (elem = results[i++]) ) {
+ if ( elem === results[ i ] ) {
+ j = duplicates.push( i );
+ }
+ }
+ while ( j-- ) {
+ results.splice( duplicates[ j ], 1 );
+ }
+ }
+
+ // Clear input after sorting to release objects
+ // See https://github.com/jquery/sizzle/pull/225
+ sortInput = null;
+
+ return results;
+};
+
+/**
+ * Utility function for retrieving the text value of an array of DOM nodes
+ * @param {Array|Element} elem
+ */
+getText = Sizzle.getText = function( elem ) {
+ var node,
+ ret = "",
+ i = 0,
+ nodeType = elem.nodeType;
+
+ if ( !nodeType ) {
+ // If no nodeType, this is expected to be an array
+ while ( (node = elem[i++]) ) {
+ // Do not traverse comment nodes
+ ret += getText( node );
+ }
+ } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
+ // Use textContent for elements
+ // innerText usage removed for consistency of new lines (jQuery #11153)
+ if ( typeof elem.textContent === "string" ) {
+ return elem.textContent;
+ } else {
+ // Traverse its children
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
+ ret += getText( elem );
+ }
+ }
+ } else if ( nodeType === 3 || nodeType === 4 ) {
+ return elem.nodeValue;
+ }
+ // Do not include comment or processing instruction nodes
+
+ return ret;
+};
+
+Expr = Sizzle.selectors = {
+
+ // Can be adjusted by the user
+ cacheLength: 50,
+
+ createPseudo: markFunction,
+
+ match: matchExpr,
+
+ attrHandle: {},
+
+ find: {},
+
+ relative: {
+ ">": { dir: "parentNode", first: true },
+ " ": { dir: "parentNode" },
+ "+": { dir: "previousSibling", first: true },
+ "~": { dir: "previousSibling" }
+ },
+
+ preFilter: {
+ "ATTR": function( match ) {
+ match[1] = match[1].replace( runescape, funescape );
+
+ // Move the given value to match[3] whether quoted or unquoted
+ match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
+
+ if ( match[2] === "~=" ) {
+ match[3] = " " + match[3] + " ";
+ }
+
+ return match.slice( 0, 4 );
+ },
+
+ "CHILD": function( match ) {
+ /* matches from matchExpr["CHILD"]
+ 1 type (only|nth|...)
+ 2 what (child|of-type)
+ 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
+ 4 xn-component of xn+y argument ([+-]?\d*n|)
+ 5 sign of xn-component
+ 6 x of xn-component
+ 7 sign of y-component
+ 8 y of y-component
+ */
+ match[1] = match[1].toLowerCase();
+
+ if ( match[1].slice( 0, 3 ) === "nth" ) {
+ // nth-* requires argument
+ if ( !match[3] ) {
+ Sizzle.error( match[0] );
+ }
+
+ // numeric x and y parameters for Expr.filter.CHILD
+ // remember that false/true cast respectively to 0/1
+ match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
+ match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
+
+ // other types prohibit arguments
+ } else if ( match[3] ) {
+ Sizzle.error( match[0] );
+ }
+
+ return match;
+ },
+
+ "PSEUDO": function( match ) {
+ var excess,
+ unquoted = !match[6] && match[2];
+
+ if ( matchExpr["CHILD"].test( match[0] ) ) {
+ return null;
+ }
+
+ // Accept quoted arguments as-is
+ if ( match[3] ) {
+ match[2] = match[4] || match[5] || "";
+
+ // Strip excess characters from unquoted arguments
+ } else if ( unquoted && rpseudo.test( unquoted ) &&
+ // Get excess from tokenize (recursively)
+ (excess = tokenize( unquoted, true )) &&
+ // advance to the next closing parenthesis
+ (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
+
+ // excess is a negative index
+ match[0] = match[0].slice( 0, excess );
+ match[2] = unquoted.slice( 0, excess );
+ }
+
+ // Return only captures needed by the pseudo filter method (type and argument)
+ return match.slice( 0, 3 );
+ }
+ },
+
+ filter: {
+
+ "TAG": function( nodeNameSelector ) {
+ var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
+ return nodeNameSelector === "*" ?
+ function() { return true; } :
+ function( elem ) {
+ return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
+ };
+ },
+
+ "CLASS": function( className ) {
+ var pattern = classCache[ className + " " ];
+
+ return pattern ||
+ (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
+ classCache( className, function( elem ) {
+ return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
+ });
+ },
+
+ "ATTR": function( name, operator, check ) {
+ return function( elem ) {
+ var result = Sizzle.attr( elem, name );
+
+ if ( result == null ) {
+ return operator === "!=";
+ }
+ if ( !operator ) {
+ return true;
+ }
+
+ result += "";
+
+ return operator === "=" ? result === check :
+ operator === "!=" ? result !== check :
+ operator === "^=" ? check && result.indexOf( check ) === 0 :
+ operator === "*=" ? check && result.indexOf( check ) > -1 :
+ operator === "$=" ? check && result.slice( -check.length ) === check :
+ operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
+ operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
+ false;
+ };
+ },
+
+ "CHILD": function( type, what, argument, first, last ) {
+ var simple = type.slice( 0, 3 ) !== "nth",
+ forward = type.slice( -4 ) !== "last",
+ ofType = what === "of-type";
+
+ return first === 1 && last === 0 ?
+
+ // Shortcut for :nth-*(n)
+ function( elem ) {
+ return !!elem.parentNode;
+ } :
+
+ function( elem, context, xml ) {
+ var cache, outerCache, node, diff, nodeIndex, start,
+ dir = simple !== forward ? "nextSibling" : "previousSibling",
+ parent = elem.parentNode,
+ name = ofType && elem.nodeName.toLowerCase(),
+ useCache = !xml && !ofType;
+
+ if ( parent ) {
+
+ // :(first|last|only)-(child|of-type)
+ if ( simple ) {
+ while ( dir ) {
+ node = elem;
+ while ( (node = node[ dir ]) ) {
+ if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
+ return false;
+ }
+ }
+ // Reverse direction for :only-* (if we haven't yet done so)
+ start = dir = type === "only" && !start && "nextSibling";
+ }
+ return true;
+ }
+
+ start = [ forward ? parent.firstChild : parent.lastChild ];
+
+ // non-xml :nth-child(...) stores cache data on `parent`
+ if ( forward && useCache ) {
+ // Seek `elem` from a previously-cached index
+ outerCache = parent[ expando ] || (parent[ expando ] = {});
+ cache = outerCache[ type ] || [];
+ nodeIndex = cache[0] === dirruns && cache[1];
+ diff = cache[0] === dirruns && cache[2];
+ node = nodeIndex && parent.childNodes[ nodeIndex ];
+
+ while ( (node = ++nodeIndex && node && node[ dir ] ||
+
+ // Fallback to seeking `elem` from the start
+ (diff = nodeIndex = 0) || start.pop()) ) {
+
+ // When found, cache indexes on `parent` and break
+ if ( node.nodeType === 1 && ++diff && node === elem ) {
+ outerCache[ type ] = [ dirruns, nodeIndex, diff ];
+ break;
+ }
+ }
+
+ // Use previously-cached element index if available
+ } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
+ diff = cache[1];
+
+ // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
+ } else {
+ // Use the same loop as above to seek `elem` from the start
+ while ( (node = ++nodeIndex && node && node[ dir ] ||
+ (diff = nodeIndex = 0) || start.pop()) ) {
+
+ if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
+ // Cache the index of each encountered element
+ if ( useCache ) {
+ (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
+ }
+
+ if ( node === elem ) {
+ break;
+ }
+ }
+ }
+ }
+
+ // Incorporate the offset, then check against cycle size
+ diff -= last;
+ return diff === first || ( diff % first === 0 && diff / first >= 0 );
+ }
+ };
+ },
+
+ "PSEUDO": function( pseudo, argument ) {
+ // pseudo-class names are case-insensitive
+ // http://www.w3.org/TR/selectors/#pseudo-classes
+ // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
+ // Remember that setFilters inherits from pseudos
+ var args,
+ fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
+ Sizzle.error( "unsupported pseudo: " + pseudo );
+
+ // The user may use createPseudo to indicate that
+ // arguments are needed to create the filter function
+ // just as Sizzle does
+ if ( fn[ expando ] ) {
+ return fn( argument );
+ }
+
+ // But maintain support for old signatures
+ if ( fn.length > 1 ) {
+ args = [ pseudo, pseudo, "", argument ];
+ return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
+ markFunction(function( seed, matches ) {
+ var idx,
+ matched = fn( seed, argument ),
+ i = matched.length;
+ while ( i-- ) {
+ idx = indexOf( seed, matched[i] );
+ seed[ idx ] = !( matches[ idx ] = matched[i] );
+ }
+ }) :
+ function( elem ) {
+ return fn( elem, 0, args );
+ };
+ }
+
+ return fn;
+ }
+ },
+
+ pseudos: {
+ // Potentially complex pseudos
+ "not": markFunction(function( selector ) {
+ // Trim the selector passed to compile
+ // to avoid treating leading and trailing
+ // spaces as combinators
+ var input = [],
+ results = [],
+ matcher = compile( selector.replace( rtrim, "$1" ) );
+
+ return matcher[ expando ] ?
+ markFunction(function( seed, matches, context, xml ) {
+ var elem,
+ unmatched = matcher( seed, null, xml, [] ),
+ i = seed.length;
+
+ // Match elements unmatched by `matcher`
+ while ( i-- ) {
+ if ( (elem = unmatched[i]) ) {
+ seed[i] = !(matches[i] = elem);
+ }
+ }
+ }) :
+ function( elem, context, xml ) {
+ input[0] = elem;
+ matcher( input, null, xml, results );
+ // Don't keep the element (issue #299)
+ input[0] = null;
+ return !results.pop();
+ };
+ }),
+
+ "has": markFunction(function( selector ) {
+ return function( elem ) {
+ return Sizzle( selector, elem ).length > 0;
+ };
+ }),
+
+ "contains": markFunction(function( text ) {
+ text = text.replace( runescape, funescape );
+ return function( elem ) {
+ return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
+ };
+ }),
+
+ // "Whether an element is represented by a :lang() selector
+ // is based solely on the element's language value
+ // being equal to the identifier C,
+ // or beginning with the identifier C immediately followed by "-".
+ // The matching of C against the element's language value is performed case-insensitively.
+ // The identifier C does not have to be a valid language name."
+ // http://www.w3.org/TR/selectors/#lang-pseudo
+ "lang": markFunction( function( lang ) {
+ // lang value must be a valid identifier
+ if ( !ridentifier.test(lang || "") ) {
+ Sizzle.error( "unsupported lang: " + lang );
+ }
+ lang = lang.replace( runescape, funescape ).toLowerCase();
+ return function( elem ) {
+ var elemLang;
+ do {
+ if ( (elemLang = documentIsHTML ?
+ elem.lang :
+ elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
+
+ elemLang = elemLang.toLowerCase();
+ return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
+ }
+ } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
+ return false;
+ };
+ }),
+
+ // Miscellaneous
+ "target": function( elem ) {
+ var hash = window.location && window.location.hash;
+ return hash && hash.slice( 1 ) === elem.id;
+ },
+
+ "root": function( elem ) {
+ return elem === docElem;
+ },
+
+ "focus": function( elem ) {
+ return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
+ },
+
+ // Boolean properties
+ "enabled": function( elem ) {
+ return elem.disabled === false;
+ },
+
+ "disabled": function( elem ) {
+ return elem.disabled === true;
+ },
+
+ "checked": function( elem ) {
+ // In CSS3, :checked should return both checked and selected elements
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
+ var nodeName = elem.nodeName.toLowerCase();
+ return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
+ },
+
+ "selected": function( elem ) {
+ // Accessing this property makes selected-by-default
+ // options in Safari work properly
+ if ( elem.parentNode ) {
+ elem.parentNode.selectedIndex;
+ }
+
+ return elem.selected === true;
+ },
+
+ // Contents
+ "empty": function( elem ) {
+ // http://www.w3.org/TR/selectors/#empty-pseudo
+ // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
+ // but not by others (comment: 8; processing instruction: 7; etc.)
+ // nodeType < 6 works because attributes (2) do not appear as children
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
+ if ( elem.nodeType < 6 ) {
+ return false;
+ }
+ }
+ return true;
+ },
+
+ "parent": function( elem ) {
+ return !Expr.pseudos["empty"]( elem );
+ },
+
+ // Element/input types
+ "header": function( elem ) {
+ return rheader.test( elem.nodeName );
+ },
+
+ "input": function( elem ) {
+ return rinputs.test( elem.nodeName );
+ },
+
+ "button": function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return name === "input" && elem.type === "button" || name === "button";
+ },
+
+ "text": function( elem ) {
+ var attr;
+ return elem.nodeName.toLowerCase() === "input" &&
+ elem.type === "text" &&
+
+ // Support: IE<8
+ // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
+ ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
+ },
+
+ // Position-in-collection
+ "first": createPositionalPseudo(function() {
+ return [ 0 ];
+ }),
+
+ "last": createPositionalPseudo(function( matchIndexes, length ) {
+ return [ length - 1 ];
+ }),
+
+ "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ return [ argument < 0 ? argument + length : argument ];
+ }),
+
+ "even": createPositionalPseudo(function( matchIndexes, length ) {
+ var i = 0;
+ for ( ; i < length; i += 2 ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "odd": createPositionalPseudo(function( matchIndexes, length ) {
+ var i = 1;
+ for ( ; i < length; i += 2 ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ var i = argument < 0 ? argument + length : argument;
+ for ( ; --i >= 0; ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ var i = argument < 0 ? argument + length : argument;
+ for ( ; ++i < length; ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ })
+ }
+};
+
+Expr.pseudos["nth"] = Expr.pseudos["eq"];
+
+// Add button/input type pseudos
+for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
+ Expr.pseudos[ i ] = createInputPseudo( i );
+}
+for ( i in { submit: true, reset: true } ) {
+ Expr.pseudos[ i ] = createButtonPseudo( i );
+}
+
+// Easy API for creating new setFilters
+function setFilters() {}
+setFilters.prototype = Expr.filters = Expr.pseudos;
+Expr.setFilters = new setFilters();
+
+tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
+ var matched, match, tokens, type,
+ soFar, groups, preFilters,
+ cached = tokenCache[ selector + " " ];
+
+ if ( cached ) {
+ return parseOnly ? 0 : cached.slice( 0 );
+ }
+
+ soFar = selector;
+ groups = [];
+ preFilters = Expr.preFilter;
+
+ while ( soFar ) {
+
+ // Comma and first run
+ if ( !matched || (match = rcomma.exec( soFar )) ) {
+ if ( match ) {
+ // Don't consume trailing commas as valid
+ soFar = soFar.slice( match[0].length ) || soFar;
+ }
+ groups.push( (tokens = []) );
+ }
+
+ matched = false;
+
+ // Combinators
+ if ( (match = rcombinators.exec( soFar )) ) {
+ matched = match.shift();
+ tokens.push({
+ value: matched,
+ // Cast descendant combinators to space
+ type: match[0].replace( rtrim, " " )
+ });
+ soFar = soFar.slice( matched.length );
+ }
+
+ // Filters
+ for ( type in Expr.filter ) {
+ if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
+ (match = preFilters[ type ]( match ))) ) {
+ matched = match.shift();
+ tokens.push({
+ value: matched,
+ type: type,
+ matches: match
+ });
+ soFar = soFar.slice( matched.length );
+ }
+ }
+
+ if ( !matched ) {
+ break;
+ }
+ }
+
+ // Return the length of the invalid excess
+ // if we're just parsing
+ // Otherwise, throw an error or return tokens
+ return parseOnly ?
+ soFar.length :
+ soFar ?
+ Sizzle.error( selector ) :
+ // Cache the tokens
+ tokenCache( selector, groups ).slice( 0 );
+};
+
+function toSelector( tokens ) {
+ var i = 0,
+ len = tokens.length,
+ selector = "";
+ for ( ; i < len; i++ ) {
+ selector += tokens[i].value;
+ }
+ return selector;
+}
+
+function addCombinator( matcher, combinator, base ) {
+ var dir = combinator.dir,
+ checkNonElements = base && dir === "parentNode",
+ doneName = done++;
+
+ return combinator.first ?
+ // Check against closest ancestor/preceding element
+ function( elem, context, xml ) {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ return matcher( elem, context, xml );
+ }
+ }
+ } :
+
+ // Check against all ancestor/preceding elements
+ function( elem, context, xml ) {
+ var oldCache, outerCache,
+ newCache = [ dirruns, doneName ];
+
+ // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
+ if ( xml ) {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ if ( matcher( elem, context, xml ) ) {
+ return true;
+ }
+ }
+ }
+ } else {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ outerCache = elem[ expando ] || (elem[ expando ] = {});
+ if ( (oldCache = outerCache[ dir ]) &&
+ oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
+
+ // Assign to newCache so results back-propagate to previous elements
+ return (newCache[ 2 ] = oldCache[ 2 ]);
+ } else {
+ // Reuse newcache so results back-propagate to previous elements
+ outerCache[ dir ] = newCache;
+
+ // A match means we're done; a fail means we have to keep checking
+ if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
+ return true;
+ }
+ }
+ }
+ }
+ }
+ };
+}
+
+function elementMatcher( matchers ) {
+ return matchers.length > 1 ?
+ function( elem, context, xml ) {
+ var i = matchers.length;
+ while ( i-- ) {
+ if ( !matchers[i]( elem, context, xml ) ) {
+ return false;
+ }
+ }
+ return true;
+ } :
+ matchers[0];
+}
+
+function multipleContexts( selector, contexts, results ) {
+ var i = 0,
+ len = contexts.length;
+ for ( ; i < len; i++ ) {
+ Sizzle( selector, contexts[i], results );
+ }
+ return results;
+}
+
+function condense( unmatched, map, filter, context, xml ) {
+ var elem,
+ newUnmatched = [],
+ i = 0,
+ len = unmatched.length,
+ mapped = map != null;
+
+ for ( ; i < len; i++ ) {
+ if ( (elem = unmatched[i]) ) {
+ if ( !filter || filter( elem, context, xml ) ) {
+ newUnmatched.push( elem );
+ if ( mapped ) {
+ map.push( i );
+ }
+ }
+ }
+ }
+
+ return newUnmatched;
+}
+
+function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
+ if ( postFilter && !postFilter[ expando ] ) {
+ postFilter = setMatcher( postFilter );
+ }
+ if ( postFinder && !postFinder[ expando ] ) {
+ postFinder = setMatcher( postFinder, postSelector );
+ }
+ return markFunction(function( seed, results, context, xml ) {
+ var temp, i, elem,
+ preMap = [],
+ postMap = [],
+ preexisting = results.length,
+
+ // Get initial elements from seed or context
+ elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
+
+ // Prefilter to get matcher input, preserving a map for seed-results synchronization
+ matcherIn = preFilter && ( seed || !selector ) ?
+ condense( elems, preMap, preFilter, context, xml ) :
+ elems,
+
+ matcherOut = matcher ?
+ // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
+ postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
+
+ // ...intermediate processing is necessary
+ [] :
+
+ // ...otherwise use results directly
+ results :
+ matcherIn;
+
+ // Find primary matches
+ if ( matcher ) {
+ matcher( matcherIn, matcherOut, context, xml );
+ }
+
+ // Apply postFilter
+ if ( postFilter ) {
+ temp = condense( matcherOut, postMap );
+ postFilter( temp, [], context, xml );
+
+ // Un-match failing elements by moving them back to matcherIn
+ i = temp.length;
+ while ( i-- ) {
+ if ( (elem = temp[i]) ) {
+ matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
+ }
+ }
+ }
+
+ if ( seed ) {
+ if ( postFinder || preFilter ) {
+ if ( postFinder ) {
+ // Get the final matcherOut by condensing this intermediate into postFinder contexts
+ temp = [];
+ i = matcherOut.length;
+ while ( i-- ) {
+ if ( (elem = matcherOut[i]) ) {
+ // Restore matcherIn since elem is not yet a final match
+ temp.push( (matcherIn[i] = elem) );
+ }
+ }
+ postFinder( null, (matcherOut = []), temp, xml );
+ }
+
+ // Move matched elements from seed to results to keep them synchronized
+ i = matcherOut.length;
+ while ( i-- ) {
+ if ( (elem = matcherOut[i]) &&
+ (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
+
+ seed[temp] = !(results[temp] = elem);
+ }
+ }
+ }
+
+ // Add elements to results, through postFinder if defined
+ } else {
+ matcherOut = condense(
+ matcherOut === results ?
+ matcherOut.splice( preexisting, matcherOut.length ) :
+ matcherOut
+ );
+ if ( postFinder ) {
+ postFinder( null, results, matcherOut, xml );
+ } else {
+ push.apply( results, matcherOut );
+ }
+ }
+ });
+}
+
+function matcherFromTokens( tokens ) {
+ var checkContext, matcher, j,
+ len = tokens.length,
+ leadingRelative = Expr.relative[ tokens[0].type ],
+ implicitRelative = leadingRelative || Expr.relative[" "],
+ i = leadingRelative ? 1 : 0,
+
+ // The foundational matcher ensures that elements are reachable from top-level context(s)
+ matchContext = addCombinator( function( elem ) {
+ return elem === checkContext;
+ }, implicitRelative, true ),
+ matchAnyContext = addCombinator( function( elem ) {
+ return indexOf( checkContext, elem ) > -1;
+ }, implicitRelative, true ),
+ matchers = [ function( elem, context, xml ) {
+ var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
+ (checkContext = context).nodeType ?
+ matchContext( elem, context, xml ) :
+ matchAnyContext( elem, context, xml ) );
+ // Avoid hanging onto element (issue #299)
+ checkContext = null;
+ return ret;
+ } ];
+
+ for ( ; i < len; i++ ) {
+ if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
+ matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
+ } else {
+ matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
+
+ // Return special upon seeing a positional matcher
+ if ( matcher[ expando ] ) {
+ // Find the next relative operator (if any) for proper handling
+ j = ++i;
+ for ( ; j < len; j++ ) {
+ if ( Expr.relative[ tokens[j].type ] ) {
+ break;
+ }
+ }
+ return setMatcher(
+ i > 1 && elementMatcher( matchers ),
+ i > 1 && toSelector(
+ // If the preceding token was a descendant combinator, insert an implicit any-element `*`
+ tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
+ ).replace( rtrim, "$1" ),
+ matcher,
+ i < j && matcherFromTokens( tokens.slice( i, j ) ),
+ j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
+ j < len && toSelector( tokens )
+ );
+ }
+ matchers.push( matcher );
+ }
+ }
+
+ return elementMatcher( matchers );
+}
+
+function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
+ var bySet = setMatchers.length > 0,
+ byElement = elementMatchers.length > 0,
+ superMatcher = function( seed, context, xml, results, outermost ) {
+ var elem, j, matcher,
+ matchedCount = 0,
+ i = "0",
+ unmatched = seed && [],
+ setMatched = [],
+ contextBackup = outermostContext,
+ // We must always have either seed elements or outermost context
+ elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
+ // Use integer dirruns iff this is the outermost matcher
+ dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
+ len = elems.length;
+
+ if ( outermost ) {
+ outermostContext = context !== document && context;
+ }
+
+ // Add elements passing elementMatchers directly to results
+ // Keep `i` a string if there are no elements so `matchedCount` will be "00" below
+ // Support: IE<9, Safari
+ // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
+ for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
+ if ( byElement && elem ) {
+ j = 0;
+ while ( (matcher = elementMatchers[j++]) ) {
+ if ( matcher( elem, context, xml ) ) {
+ results.push( elem );
+ break;
+ }
+ }
+ if ( outermost ) {
+ dirruns = dirrunsUnique;
+ }
+ }
+
+ // Track unmatched elements for set filters
+ if ( bySet ) {
+ // They will have gone through all possible matchers
+ if ( (elem = !matcher && elem) ) {
+ matchedCount--;
+ }
+
+ // Lengthen the array for every element, matched or not
+ if ( seed ) {
+ unmatched.push( elem );
+ }
+ }
+ }
+
+ // Apply set filters to unmatched elements
+ matchedCount += i;
+ if ( bySet && i !== matchedCount ) {
+ j = 0;
+ while ( (matcher = setMatchers[j++]) ) {
+ matcher( unmatched, setMatched, context, xml );
+ }
+
+ if ( seed ) {
+ // Reintegrate element matches to eliminate the need for sorting
+ if ( matchedCount > 0 ) {
+ while ( i-- ) {
+ if ( !(unmatched[i] || setMatched[i]) ) {
+ setMatched[i] = pop.call( results );
+ }
+ }
+ }
+
+ // Discard index placeholder values to get only actual matches
+ setMatched = condense( setMatched );
+ }
+
+ // Add matches to results
+ push.apply( results, setMatched );
+
+ // Seedless set matches succeeding multiple successful matchers stipulate sorting
+ if ( outermost && !seed && setMatched.length > 0 &&
+ ( matchedCount + setMatchers.length ) > 1 ) {
+
+ Sizzle.uniqueSort( results );
+ }
+ }
+
+ // Override manipulation of globals by nested matchers
+ if ( outermost ) {
+ dirruns = dirrunsUnique;
+ outermostContext = contextBackup;
+ }
+
+ return unmatched;
+ };
+
+ return bySet ?
+ markFunction( superMatcher ) :
+ superMatcher;
+}
+
+compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
+ var i,
+ setMatchers = [],
+ elementMatchers = [],
+ cached = compilerCache[ selector + " " ];
+
+ if ( !cached ) {
+ // Generate a function of recursive functions that can be used to check each element
+ if ( !match ) {
+ match = tokenize( selector );
+ }
+ i = match.length;
+ while ( i-- ) {
+ cached = matcherFromTokens( match[i] );
+ if ( cached[ expando ] ) {
+ setMatchers.push( cached );
+ } else {
+ elementMatchers.push( cached );
+ }
+ }
+
+ // Cache the compiled function
+ cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
+
+ // Save selector and tokenization
+ cached.selector = selector;
+ }
+ return cached;
+};
+
+/**
+ * A low-level selection function that works with Sizzle's compiled
+ * selector functions
+ * @param {String|Function} selector A selector or a pre-compiled
+ * selector function built with Sizzle.compile
+ * @param {Element} context
+ * @param {Array} [results]
+ * @param {Array} [seed] A set of elements to match against
+ */
+select = Sizzle.select = function( selector, context, results, seed ) {
+ var i, tokens, token, type, find,
+ compiled = typeof selector === "function" && selector,
+ match = !seed && tokenize( (selector = compiled.selector || selector) );
+
+ results = results || [];
+
+ // Try to minimize operations if there is no seed and only one group
+ if ( match.length === 1 ) {
+
+ // Take a shortcut and set the context if the root selector is an ID
+ tokens = match[0] = match[0].slice( 0 );
+ if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
+ support.getById && context.nodeType === 9 && documentIsHTML &&
+ Expr.relative[ tokens[1].type ] ) {
+
+ context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
+ if ( !context ) {
+ return results;
+
+ // Precompiled matchers will still verify ancestry, so step up a level
+ } else if ( compiled ) {
+ context = context.parentNode;
+ }
+
+ selector = selector.slice( tokens.shift().value.length );
+ }
+
+ // Fetch a seed set for right-to-left matching
+ i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
+ while ( i-- ) {
+ token = tokens[i];
+
+ // Abort if we hit a combinator
+ if ( Expr.relative[ (type = token.type) ] ) {
+ break;
+ }
+ if ( (find = Expr.find[ type ]) ) {
+ // Search, expanding context for leading sibling combinators
+ if ( (seed = find(
+ token.matches[0].replace( runescape, funescape ),
+ rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
+ )) ) {
+
+ // If seed is empty or no tokens remain, we can return early
+ tokens.splice( i, 1 );
+ selector = seed.length && toSelector( tokens );
+ if ( !selector ) {
+ push.apply( results, seed );
+ return results;
+ }
+
+ break;
+ }
+ }
+ }
+ }
+
+ // Compile and execute a filtering function if one is not provided
+ // Provide `match` to avoid retokenization if we modified the selector above
+ ( compiled || compile( selector, match ) )(
+ seed,
+ context,
+ !documentIsHTML,
+ results,
+ rsibling.test( selector ) && testContext( context.parentNode ) || context
+ );
+ return results;
+};
+
+// One-time assignments
+
+// Sort stability
+support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
+
+// Support: Chrome 14-35+
+// Always assume duplicates if they aren't passed to the comparison function
+support.detectDuplicates = !!hasDuplicate;
+
+// Initialize against the default document
+setDocument();
+
+// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
+// Detached nodes confoundingly follow *each other*
+support.sortDetached = assert(function( div1 ) {
+ // Should return 1, but returns 4 (following)
+ return div1.compareDocumentPosition( document.createElement("div") ) & 1;
+});
+
+// Support: IE<8
+// Prevent attribute/property "interpolation"
+// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
+if ( !assert(function( div ) {
+ div.innerHTML = "<a href='#'></a>";
+ return div.firstChild.getAttribute("href") === "#" ;
+}) ) {
+ addHandle( "type|href|height|width", function( elem, name, isXML ) {
+ if ( !isXML ) {
+ return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
+ }
+ });
+}
+
+// Support: IE<9
+// Use defaultValue in place of getAttribute("value")
+if ( !support.attributes || !assert(function( div ) {
+ div.innerHTML = "<input/>";
+ div.firstChild.setAttribute( "value", "" );
+ return div.firstChild.getAttribute( "value" ) === "";
+}) ) {
+ addHandle( "value", function( elem, name, isXML ) {
+ if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
+ return elem.defaultValue;
+ }
+ });
+}
+
+// Support: IE<9
+// Use getAttributeNode to fetch booleans when getAttribute lies
+if ( !assert(function( div ) {
+ return div.getAttribute("disabled") == null;
+}) ) {
+ addHandle( booleans, function( elem, name, isXML ) {
+ var val;
+ if ( !isXML ) {
+ return elem[ name ] === true ? name.toLowerCase() :
+ (val = elem.getAttributeNode( name )) && val.specified ?
+ val.value :
+ null;
+ }
+ });
+}
+
+return Sizzle;
+
+})( window );
+
+
+
+jQuery.find = Sizzle;
+jQuery.expr = Sizzle.selectors;
+jQuery.expr[":"] = jQuery.expr.pseudos;
+jQuery.unique = Sizzle.uniqueSort;
+jQuery.text = Sizzle.getText;
+jQuery.isXMLDoc = Sizzle.isXML;
+jQuery.contains = Sizzle.contains;
+
+
+
+var rneedsContext = jQuery.expr.match.needsContext;
+
+var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/);
+
+
+
+var risSimple = /^.[^:#\[\.,]*$/;
+
+// Implement the identical functionality for filter and not
+function winnow( elements, qualifier, not ) {
+ if ( jQuery.isFunction( qualifier ) ) {
+ return jQuery.grep( elements, function( elem, i ) {
+ /* jshint -W018 */
+ return !!qualifier.call( elem, i, elem ) !== not;
+ });
+
+ }
+
+ if ( qualifier.nodeType ) {
+ return jQuery.grep( elements, function( elem ) {
+ return ( elem === qualifier ) !== not;
+ });
+
+ }
+
+ if ( typeof qualifier === "string" ) {
+ if ( risSimple.test( qualifier ) ) {
+ return jQuery.filter( qualifier, elements, not );
+ }
+
+ qualifier = jQuery.filter( qualifier, elements );
+ }
+
+ return jQuery.grep( elements, function( elem ) {
+ return ( indexOf.call( qualifier, elem ) >= 0 ) !== not;
+ });
+}
+
+jQuery.filter = function( expr, elems, not ) {
+ var elem = elems[ 0 ];
+
+ if ( not ) {
+ expr = ":not(" + expr + ")";
+ }
+
+ return elems.length === 1 && elem.nodeType === 1 ?
+ jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
+ jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
+ return elem.nodeType === 1;
+ }));
+};
+
+jQuery.fn.extend({
+ find: function( selector ) {
+ var i,
+ len = this.length,
+ ret = [],
+ self = this;
+
+ if ( typeof selector !== "string" ) {
+ return this.pushStack( jQuery( selector ).filter(function() {
+ for ( i = 0; i < len; i++ ) {
+ if ( jQuery.contains( self[ i ], this ) ) {
+ return true;
+ }
+ }
+ }) );
+ }
+
+ for ( i = 0; i < len; i++ ) {
+ jQuery.find( selector, self[ i ], ret );
+ }
+
+ // Needed because $( selector, context ) becomes $( context ).find( selector )
+ ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
+ ret.selector = this.selector ? this.selector + " " + selector : selector;
+ return ret;
+ },
+ filter: function( selector ) {
+ return this.pushStack( winnow(this, selector || [], false) );
+ },
+ not: function( selector ) {
+ return this.pushStack( winnow(this, selector || [], true) );
+ },
+ is: function( selector ) {
+ return !!winnow(
+ this,
+
+ // If this is a positional/relative selector, check membership in the returned set
+ // so $("p:first").is("p:last") won't return true for a doc with two "p".
+ typeof selector === "string" && rneedsContext.test( selector ) ?
+ jQuery( selector ) :
+ selector || [],
+ false
+ ).length;
+ }
+});
+
+
+// Initialize a jQuery object
+
+
+// A central reference to the root jQuery(document)
+var rootjQuery,
+
+ // A simple way to check for HTML strings
+ // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
+ // Strict HTML recognition (#11290: must start with <)
+ rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
+
+ init = jQuery.fn.init = function( selector, context ) {
+ var match, elem;
+
+ // HANDLE: $(""), $(null), $(undefined), $(false)
+ if ( !selector ) {
+ return this;
+ }
+
+ // Handle HTML strings
+ if ( typeof selector === "string" ) {
+ if ( selector[0] === "<" && selector[ selector.length - 1 ] === ">" && selector.length >= 3 ) {
+ // Assume that strings that start and end with <> are HTML and skip the regex check
+ match = [ null, selector, null ];
+
+ } else {
+ match = rquickExpr.exec( selector );
+ }
+
+ // Match html or make sure no context is specified for #id
+ if ( match && (match[1] || !context) ) {
+
+ // HANDLE: $(html) -> $(array)
+ if ( match[1] ) {
+ context = context instanceof jQuery ? context[0] : context;
+
+ // Option to run scripts is true for back-compat
+ // Intentionally let the error be thrown if parseHTML is not present
+ jQuery.merge( this, jQuery.parseHTML(
+ match[1],
+ context && context.nodeType ? context.ownerDocument || context : document,
+ true
+ ) );
+
+ // HANDLE: $(html, props)
+ if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
+ for ( match in context ) {
+ // Properties of context are called as methods if possible
+ if ( jQuery.isFunction( this[ match ] ) ) {
+ this[ match ]( context[ match ] );
+
+ // ...and otherwise set as attributes
+ } else {
+ this.attr( match, context[ match ] );
+ }
+ }
+ }
+
+ return this;
+
+ // HANDLE: $(#id)
+ } else {
+ elem = document.getElementById( match[2] );
+
+ // Support: Blackberry 4.6
+ // gEBID returns nodes no longer in the document (#6963)
+ if ( elem && elem.parentNode ) {
+ // Inject the element directly into the jQuery object
+ this.length = 1;
+ this[0] = elem;
+ }
+
+ this.context = document;
+ this.selector = selector;
+ return this;
+ }
+
+ // HANDLE: $(expr, $(...))
+ } else if ( !context || context.jquery ) {
+ return ( context || rootjQuery ).find( selector );
+
+ // HANDLE: $(expr, context)
+ // (which is just equivalent to: $(context).find(expr)
+ } else {
+ return this.constructor( context ).find( selector );
+ }
+
+ // HANDLE: $(DOMElement)
+ } else if ( selector.nodeType ) {
+ this.context = this[0] = selector;
+ this.length = 1;
+ return this;
+
+ // HANDLE: $(function)
+ // Shortcut for document ready
+ } else if ( jQuery.isFunction( selector ) ) {
+ return typeof rootjQuery.ready !== "undefined" ?
+ rootjQuery.ready( selector ) :
+ // Execute immediately if ready is not present
+ selector( jQuery );
+ }
+
+ if ( selector.selector !== undefined ) {
+ this.selector = selector.selector;
+ this.context = selector.context;
+ }
+
+ return jQuery.makeArray( selector, this );
+ };
+
+// Give the init function the jQuery prototype for later instantiation
+init.prototype = jQuery.fn;
+
+// Initialize central reference
+rootjQuery = jQuery( document );
+
+
+var rparentsprev = /^(?:parents|prev(?:Until|All))/,
+ // Methods guaranteed to produce a unique set when starting from a unique set
+ guaranteedUnique = {
+ children: true,
+ contents: true,
+ next: true,
+ prev: true
+ };
+
+jQuery.extend({
+ dir: function( elem, dir, until ) {
+ var matched = [],
+ truncate = until !== undefined;
+
+ while ( (elem = elem[ dir ]) && elem.nodeType !== 9 ) {
+ if ( elem.nodeType === 1 ) {
+ if ( truncate && jQuery( elem ).is( until ) ) {
+ break;
+ }
+ matched.push( elem );
+ }
+ }
+ return matched;
+ },
+
+ sibling: function( n, elem ) {
+ var matched = [];
+
+ for ( ; n; n = n.nextSibling ) {
+ if ( n.nodeType === 1 && n !== elem ) {
+ matched.push( n );
+ }
+ }
+
+ return matched;
+ }
+});
+
+jQuery.fn.extend({
+ has: function( target ) {
+ var targets = jQuery( target, this ),
+ l = targets.length;
+
+ return this.filter(function() {
+ var i = 0;
+ for ( ; i < l; i++ ) {
+ if ( jQuery.contains( this, targets[i] ) ) {
+ return true;
+ }
+ }
+ });
+ },
+
+ closest: function( selectors, context ) {
+ var cur,
+ i = 0,
+ l = this.length,
+ matched = [],
+ pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
+ jQuery( selectors, context || this.context ) :
+ 0;
+
+ for ( ; i < l; i++ ) {
+ for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {
+ // Always skip document fragments
+ if ( cur.nodeType < 11 && (pos ?
+ pos.index(cur) > -1 :
+
+ // Don't pass non-elements to Sizzle
+ cur.nodeType === 1 &&
+ jQuery.find.matchesSelector(cur, selectors)) ) {
+
+ matched.push( cur );
+ break;
+ }
+ }
+ }
+
+ return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched );
+ },
+
+ // Determine the position of an element within the set
+ index: function( elem ) {
+
+ // No argument, return index in parent
+ if ( !elem ) {
+ return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
+ }
+
+ // Index in selector
+ if ( typeof elem === "string" ) {
+ return indexOf.call( jQuery( elem ), this[ 0 ] );
+ }
+
+ // Locate the position of the desired element
+ return indexOf.call( this,
+
+ // If it receives a jQuery object, the first element is used
+ elem.jquery ? elem[ 0 ] : elem
+ );
+ },
+
+ add: function( selector, context ) {
+ return this.pushStack(
+ jQuery.unique(
+ jQuery.merge( this.get(), jQuery( selector, context ) )
+ )
+ );
+ },
+
+ addBack: function( selector ) {
+ return this.add( selector == null ?
+ this.prevObject : this.prevObject.filter(selector)
+ );
+ }
+});
+
+function sibling( cur, dir ) {
+ while ( (cur = cur[dir]) && cur.nodeType !== 1 ) {}
+ return cur;
+}
+
+jQuery.each({
+ parent: function( elem ) {
+ var parent = elem.parentNode;
+ return parent && parent.nodeType !== 11 ? parent : null;
+ },
+ parents: function( elem ) {
+ return jQuery.dir( elem, "parentNode" );
+ },
+ parentsUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "parentNode", until );
+ },
+ next: function( elem ) {
+ return sibling( elem, "nextSibling" );
+ },
+ prev: function( elem ) {
+ return sibling( elem, "previousSibling" );
+ },
+ nextAll: function( elem ) {
+ return jQuery.dir( elem, "nextSibling" );
+ },
+ prevAll: function( elem ) {
+ return jQuery.dir( elem, "previousSibling" );
+ },
+ nextUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "nextSibling", until );
+ },
+ prevUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "previousSibling", until );
+ },
+ siblings: function( elem ) {
+ return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
+ },
+ children: function( elem ) {
+ return jQuery.sibling( elem.firstChild );
+ },
+ contents: function( elem ) {
+ return elem.contentDocument || jQuery.merge( [], elem.childNodes );
+ }
+}, function( name, fn ) {
+ jQuery.fn[ name ] = function( until, selector ) {
+ var matched = jQuery.map( this, fn, until );
+
+ if ( name.slice( -5 ) !== "Until" ) {
+ selector = until;
+ }
+
+ if ( selector && typeof selector === "string" ) {
+ matched = jQuery.filter( selector, matched );
+ }
+
+ if ( this.length > 1 ) {
+ // Remove duplicates
+ if ( !guaranteedUnique[ name ] ) {
+ jQuery.unique( matched );
+ }
+
+ // Reverse order for parents* and prev-derivatives
+ if ( rparentsprev.test( name ) ) {
+ matched.reverse();
+ }
+ }
+
+ return this.pushStack( matched );
+ };
+});
+var rnotwhite = (/\S+/g);
+
+
+
+// String to Object options format cache
+var optionsCache = {};
+
+// Convert String-formatted options into Object-formatted ones and store in cache
+function createOptions( options ) {
+ var object = optionsCache[ options ] = {};
+ jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
+ object[ flag ] = true;
+ });
+ return object;
+}
+
+/*
+ * Create a callback list using the following parameters:
+ *
+ * options: an optional list of space-separated options that will change how
+ * the callback list behaves or a more traditional option object
+ *
+ * By default a callback list will act like an event callback list and can be
+ * "fired" multiple times.
+ *
+ * Possible options:
+ *
+ * once: will ensure the callback list can only be fired once (like a Deferred)
+ *
+ * memory: will keep track of previous values and will call any callback added
+ * after the list has been fired right away with the latest "memorized"
+ * values (like a Deferred)
+ *
+ * unique: will ensure a callback can only be added once (no duplicate in the list)
+ *
+ * stopOnFalse: interrupt callings when a callback returns false
+ *
+ */
+jQuery.Callbacks = function( options ) {
+
+ // Convert options from String-formatted to Object-formatted if needed
+ // (we check in cache first)
+ options = typeof options === "string" ?
+ ( optionsCache[ options ] || createOptions( options ) ) :
+ jQuery.extend( {}, options );
+
+ var // Last fire value (for non-forgettable lists)
+ memory,
+ // Flag to know if list was already fired
+ fired,
+ // Flag to know if list is currently firing
+ firing,
+ // First callback to fire (used internally by add and fireWith)
+ firingStart,
+ // End of the loop when firing
+ firingLength,
+ // Index of currently firing callback (modified by remove if needed)
+ firingIndex,
+ // Actual callback list
+ list = [],
+ // Stack of fire calls for repeatable lists
+ stack = !options.once && [],
+ // Fire callbacks
+ fire = function( data ) {
+ memory = options.memory && data;
+ fired = true;
+ firingIndex = firingStart || 0;
+ firingStart = 0;
+ firingLength = list.length;
+ firing = true;
+ for ( ; list && firingIndex < firingLength; firingIndex++ ) {
+ if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
+ memory = false; // To prevent further calls using add
+ break;
+ }
+ }
+ firing = false;
+ if ( list ) {
+ if ( stack ) {
+ if ( stack.length ) {
+ fire( stack.shift() );
+ }
+ } else if ( memory ) {
+ list = [];
+ } else {
+ self.disable();
+ }
+ }
+ },
+ // Actual Callbacks object
+ self = {
+ // Add a callback or a collection of callbacks to the list
+ add: function() {
+ if ( list ) {
+ // First, we save the current length
+ var start = list.length;
+ (function add( args ) {
+ jQuery.each( args, function( _, arg ) {
+ var type = jQuery.type( arg );
+ if ( type === "function" ) {
+ if ( !options.unique || !self.has( arg ) ) {
+ list.push( arg );
+ }
+ } else if ( arg && arg.length && type !== "string" ) {
+ // Inspect recursively
+ add( arg );
+ }
+ });
+ })( arguments );
+ // Do we need to add the callbacks to the
+ // current firing batch?
+ if ( firing ) {
+ firingLength = list.length;
+ // With memory, if we're not firing then
+ // we should call right away
+ } else if ( memory ) {
+ firingStart = start;
+ fire( memory );
+ }
+ }
+ return this;
+ },
+ // Remove a callback from the list
+ remove: function() {
+ if ( list ) {
+ jQuery.each( arguments, function( _, arg ) {
+ var index;
+ while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
+ list.splice( index, 1 );
+ // Handle firing indexes
+ if ( firing ) {
+ if ( index <= firingLength ) {
+ firingLength--;
+ }
+ if ( index <= firingIndex ) {
+ firingIndex--;
+ }
+ }
+ }
+ });
+ }
+ return this;
+ },
+ // Check if a given callback is in the list.
+ // If no argument is given, return whether or not list has callbacks attached.
+ has: function( fn ) {
+ return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
+ },
+ // Remove all callbacks from the list
+ empty: function() {
+ list = [];
+ firingLength = 0;
+ return this;
+ },
+ // Have the list do nothing anymore
+ disable: function() {
+ list = stack = memory = undefined;
+ return this;
+ },
+ // Is it disabled?
+ disabled: function() {
+ return !list;
+ },
+ // Lock the list in its current state
+ lock: function() {
+ stack = undefined;
+ if ( !memory ) {
+ self.disable();
+ }
+ return this;
+ },
+ // Is it locked?
+ locked: function() {
+ return !stack;
+ },
+ // Call all callbacks with the given context and arguments
+ fireWith: function( context, args ) {
+ if ( list && ( !fired || stack ) ) {
+ args = args || [];
+ args = [ context, args.slice ? args.slice() : args ];
+ if ( firing ) {
+ stack.push( args );
+ } else {
+ fire( args );
+ }
+ }
+ return this;
+ },
+ // Call all the callbacks with the given arguments
+ fire: function() {
+ self.fireWith( this, arguments );
+ return this;
+ },
+ // To know if the callbacks have already been called at least once
+ fired: function() {
+ return !!fired;
+ }
+ };
+
+ return self;
+};
+
+
+jQuery.extend({
+
+ Deferred: function( func ) {
+ var tuples = [
+ // action, add listener, listener list, final state
+ [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
+ [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
+ [ "notify", "progress", jQuery.Callbacks("memory") ]
+ ],
+ state = "pending",
+ promise = {
+ state: function() {
+ return state;
+ },
+ always: function() {
+ deferred.done( arguments ).fail( arguments );
+ return this;
+ },
+ then: function( /* fnDone, fnFail, fnProgress */ ) {
+ var fns = arguments;
+ return jQuery.Deferred(function( newDefer ) {
+ jQuery.each( tuples, function( i, tuple ) {
+ var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
+ // deferred[ done | fail | progress ] for forwarding actions to newDefer
+ deferred[ tuple[1] ](function() {
+ var returned = fn && fn.apply( this, arguments );
+ if ( returned && jQuery.isFunction( returned.promise ) ) {
+ returned.promise()
+ .done( newDefer.resolve )
+ .fail( newDefer.reject )
+ .progress( newDefer.notify );
+ } else {
+ newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
+ }
+ });
+ });
+ fns = null;
+ }).promise();
+ },
+ // Get a promise for this deferred
+ // If obj is provided, the promise aspect is added to the object
+ promise: function( obj ) {
+ return obj != null ? jQuery.extend( obj, promise ) : promise;
+ }
+ },
+ deferred = {};
+
+ // Keep pipe for back-compat
+ promise.pipe = promise.then;
+
+ // Add list-specific methods
+ jQuery.each( tuples, function( i, tuple ) {
+ var list = tuple[ 2 ],
+ stateString = tuple[ 3 ];
+
+ // promise[ done | fail | progress ] = list.add
+ promise[ tuple[1] ] = list.add;
+
+ // Handle state
+ if ( stateString ) {
+ list.add(function() {
+ // state = [ resolved | rejected ]
+ state = stateString;
+
+ // [ reject_list | resolve_list ].disable; progress_list.lock
+ }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
+ }
+
+ // deferred[ resolve | reject | notify ]
+ deferred[ tuple[0] ] = function() {
+ deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
+ return this;
+ };
+ deferred[ tuple[0] + "With" ] = list.fireWith;
+ });
+
+ // Make the deferred a promise
+ promise.promise( deferred );
+
+ // Call given func if any
+ if ( func ) {
+ func.call( deferred, deferred );
+ }
+
+ // All done!
+ return deferred;
+ },
+
+ // Deferred helper
+ when: function( subordinate /* , ..., subordinateN */ ) {
+ var i = 0,
+ resolveValues = slice.call( arguments ),
+ length = resolveValues.length,
+
+ // the count of uncompleted subordinates
+ remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
+
+ // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
+ deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
+
+ // Update function for both resolve and progress values
+ updateFunc = function( i, contexts, values ) {
+ return function( value ) {
+ contexts[ i ] = this;
+ values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
+ if ( values === progressValues ) {
+ deferred.notifyWith( contexts, values );
+ } else if ( !( --remaining ) ) {
+ deferred.resolveWith( contexts, values );
+ }
+ };
+ },
+
+ progressValues, progressContexts, resolveContexts;
+
+ // Add listeners to Deferred subordinates; treat others as resolved
+ if ( length > 1 ) {
+ progressValues = new Array( length );
+ progressContexts = new Array( length );
+ resolveContexts = new Array( length );
+ for ( ; i < length; i++ ) {
+ if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
+ resolveValues[ i ].promise()
+ .done( updateFunc( i, resolveContexts, resolveValues ) )
+ .fail( deferred.reject )
+ .progress( updateFunc( i, progressContexts, progressValues ) );
+ } else {
+ --remaining;
+ }
+ }
+ }
+
+ // If we're not waiting on anything, resolve the master
+ if ( !remaining ) {
+ deferred.resolveWith( resolveContexts, resolveValues );
+ }
+
+ return deferred.promise();
+ }
+});
+
+
+// The deferred used on DOM ready
+var readyList;
+
+jQuery.fn.ready = function( fn ) {
+ // Add the callback
+ jQuery.ready.promise().done( fn );
+
+ return this;
+};
+
+jQuery.extend({
+ // Is the DOM ready to be used? Set to true once it occurs.
+ isReady: false,
+
+ // A counter to track how many items to wait for before
+ // the ready event fires. See #6781
+ readyWait: 1,
+
+ // Hold (or release) the ready event
+ holdReady: function( hold ) {
+ if ( hold ) {
+ jQuery.readyWait++;
+ } else {
+ jQuery.ready( true );
+ }
+ },
+
+ // Handle when the DOM is ready
+ ready: function( wait ) {
+
+ // Abort if there are pending holds or we're already ready
+ if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
+ return;
+ }
+
+ // Remember that the DOM is ready
+ jQuery.isReady = true;
+
+ // If a normal DOM Ready event fired, decrement, and wait if need be
+ if ( wait !== true && --jQuery.readyWait > 0 ) {
+ return;
+ }
+
+ // If there are functions bound, to execute
+ readyList.resolveWith( document, [ jQuery ] );
+
+ // Trigger any bound ready events
+ if ( jQuery.fn.triggerHandler ) {
+ jQuery( document ).triggerHandler( "ready" );
+ jQuery( document ).off( "ready" );
+ }
+ }
+});
+
+/**
+ * The ready event handler and self cleanup method
+ */
+function completed() {
+ document.removeEventListener( "DOMContentLoaded", completed, false );
+ window.removeEventListener( "load", completed, false );
+ jQuery.ready();
+}
+
+jQuery.ready.promise = function( obj ) {
+ if ( !readyList ) {
+
+ readyList = jQuery.Deferred();
+
+ // Catch cases where $(document).ready() is called after the browser event has already occurred.
+ // We once tried to use readyState "interactive" here, but it caused issues like the one
+ // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
+ if ( document.readyState === "complete" ) {
+ // Handle it asynchronously to allow scripts the opportunity to delay ready
+ setTimeout( jQuery.ready );
+
+ } else {
+
+ // Use the handy event callback
+ document.addEventListener( "DOMContentLoaded", completed, false );
+
+ // A fallback to window.onload, that will always work
+ window.addEventListener( "load", completed, false );
+ }
+ }
+ return readyList.promise( obj );
+};
+
+// Kick off the DOM ready check even if the user does not
+jQuery.ready.promise();
+
+
+
+
+// Multifunctional method to get and set values of a collection
+// The value/s can optionally be executed if it's a function
+var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
+ var i = 0,
+ len = elems.length,
+ bulk = key == null;
+
+ // Sets many values
+ if ( jQuery.type( key ) === "object" ) {
+ chainable = true;
+ for ( i in key ) {
+ jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
+ }
+
+ // Sets one value
+ } else if ( value !== undefined ) {
+ chainable = true;
+
+ if ( !jQuery.isFunction( value ) ) {
+ raw = true;
+ }
+
+ if ( bulk ) {
+ // Bulk operations run against the entire set
+ if ( raw ) {
+ fn.call( elems, value );
+ fn = null;
+
+ // ...except when executing function values
+ } else {
+ bulk = fn;
+ fn = function( elem, key, value ) {
+ return bulk.call( jQuery( elem ), value );
+ };
+ }
+ }
+
+ if ( fn ) {
+ for ( ; i < len; i++ ) {
+ fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
+ }
+ }
+ }
+
+ return chainable ?
+ elems :
+
+ // Gets
+ bulk ?
+ fn.call( elems ) :
+ len ? fn( elems[0], key ) : emptyGet;
+};
+
+
+/**
+ * Determines whether an object can have data
+ */
+jQuery.acceptData = function( owner ) {
+ // Accepts only:
+ // - Node
+ // - Node.ELEMENT_NODE
+ // - Node.DOCUMENT_NODE
+ // - Object
+ // - Any
+ /* jshint -W018 */
+ return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
+};
+
+
+function Data() {
+ // Support: Android<4,
+ // Old WebKit does not have Object.preventExtensions/freeze method,
+ // return new empty object instead with no [[set]] accessor
+ Object.defineProperty( this.cache = {}, 0, {
+ get: function() {
+ return {};
+ }
+ });
+
+ this.expando = jQuery.expando + Data.uid++;
+}
+
+Data.uid = 1;
+Data.accepts = jQuery.acceptData;
+
+Data.prototype = {
+ key: function( owner ) {
+ // We can accept data for non-element nodes in modern browsers,
+ // but we should not, see #8335.
+ // Always return the key for a frozen object.
+ if ( !Data.accepts( owner ) ) {
+ return 0;
+ }
+
+ var descriptor = {},
+ // Check if the owner object already has a cache key
+ unlock = owner[ this.expando ];
+
+ // If not, create one
+ if ( !unlock ) {
+ unlock = Data.uid++;
+
+ // Secure it in a non-enumerable, non-writable property
+ try {
+ descriptor[ this.expando ] = { value: unlock };
+ Object.defineProperties( owner, descriptor );
+
+ // Support: Android<4
+ // Fallback to a less secure definition
+ } catch ( e ) {
+ descriptor[ this.expando ] = unlock;
+ jQuery.extend( owner, descriptor );
+ }
+ }
+
+ // Ensure the cache object
+ if ( !this.cache[ unlock ] ) {
+ this.cache[ unlock ] = {};
+ }
+
+ return unlock;
+ },
+ set: function( owner, data, value ) {
+ var prop,
+ // There may be an unlock assigned to this node,
+ // if there is no entry for this "owner", create one inline
+ // and set the unlock as though an owner entry had always existed
+ unlock = this.key( owner ),
+ cache = this.cache[ unlock ];
+
+ // Handle: [ owner, key, value ] args
+ if ( typeof data === "string" ) {
+ cache[ data ] = value;
+
+ // Handle: [ owner, { properties } ] args
+ } else {
+ // Fresh assignments by object are shallow copied
+ if ( jQuery.isEmptyObject( cache ) ) {
+ jQuery.extend( this.cache[ unlock ], data );
+ // Otherwise, copy the properties one-by-one to the cache object
+ } else {
+ for ( prop in data ) {
+ cache[ prop ] = data[ prop ];
+ }
+ }
+ }
+ return cache;
+ },
+ get: function( owner, key ) {
+ // Either a valid cache is found, or will be created.
+ // New caches will be created and the unlock returned,
+ // allowing direct access to the newly created
+ // empty data object. A valid owner object must be provided.
+ var cache = this.cache[ this.key( owner ) ];
+
+ return key === undefined ?
+ cache : cache[ key ];
+ },
+ access: function( owner, key, value ) {
+ var stored;
+ // In cases where either:
+ //
+ // 1. No key was specified
+ // 2. A string key was specified, but no value provided
+ //
+ // Take the "read" path and allow the get method to determine
+ // which value to return, respectively either:
+ //
+ // 1. The entire cache object
+ // 2. The data stored at the key
+ //
+ if ( key === undefined ||
+ ((key && typeof key === "string") && value === undefined) ) {
+
+ stored = this.get( owner, key );
+
+ return stored !== undefined ?
+ stored : this.get( owner, jQuery.camelCase(key) );
+ }
+
+ // [*]When the key is not a string, or both a key and value
+ // are specified, set or extend (existing objects) with either:
+ //
+ // 1. An object of properties
+ // 2. A key and value
+ //
+ this.set( owner, key, value );
+
+ // Since the "set" path can have two possible entry points
+ // return the expected data based on which path was taken[*]
+ return value !== undefined ? value : key;
+ },
+ remove: function( owner, key ) {
+ var i, name, camel,
+ unlock = this.key( owner ),
+ cache = this.cache[ unlock ];
+
+ if ( key === undefined ) {
+ this.cache[ unlock ] = {};
+
+ } else {
+ // Support array or space separated string of keys
+ if ( jQuery.isArray( key ) ) {
+ // If "name" is an array of keys...
+ // When data is initially created, via ("key", "val") signature,
+ // keys will be converted to camelCase.
+ // Since there is no way to tell _how_ a key was added, remove
+ // both plain key and camelCase key. #12786
+ // This will only penalize the array argument path.
+ name = key.concat( key.map( jQuery.camelCase ) );
+ } else {
+ camel = jQuery.camelCase( key );
+ // Try the string as a key before any manipulation
+ if ( key in cache ) {
+ name = [ key, camel ];
+ } else {
+ // If a key with the spaces exists, use it.
+ // Otherwise, create an array by matching non-whitespace
+ name = camel;
+ name = name in cache ?
+ [ name ] : ( name.match( rnotwhite ) || [] );
+ }
+ }
+
+ i = name.length;
+ while ( i-- ) {
+ delete cache[ name[ i ] ];
+ }
+ }
+ },
+ hasData: function( owner ) {
+ return !jQuery.isEmptyObject(
+ this.cache[ owner[ this.expando ] ] || {}
+ );
+ },
+ discard: function( owner ) {
+ if ( owner[ this.expando ] ) {
+ delete this.cache[ owner[ this.expando ] ];
+ }
+ }
+};
+var data_priv = new Data();
+
+var data_user = new Data();
+
+
+
+// Implementation Summary
+//
+// 1. Enforce API surface and semantic compatibility with 1.9.x branch
+// 2. Improve the module's maintainability by reducing the storage
+// paths to a single mechanism.
+// 3. Use the same single mechanism to support "private" and "user" data.
+// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
+// 5. Avoid exposing implementation details on user objects (eg. expando properties)
+// 6. Provide a clear path for implementation upgrade to WeakMap in 2014
+
+var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
+ rmultiDash = /([A-Z])/g;
+
+function dataAttr( elem, key, data ) {
+ var name;
+
+ // If nothing was found internally, try to fetch any
+ // data from the HTML5 data-* attribute
+ if ( data === undefined && elem.nodeType === 1 ) {
+ name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
+ data = elem.getAttribute( name );
+
+ if ( typeof data === "string" ) {
+ try {
+ data = data === "true" ? true :
+ data === "false" ? false :
+ data === "null" ? null :
+ // Only convert to a number if it doesn't change the string
+ +data + "" === data ? +data :
+ rbrace.test( data ) ? jQuery.parseJSON( data ) :
+ data;
+ } catch( e ) {}
+
+ // Make sure we set the data so it isn't changed later
+ data_user.set( elem, key, data );
+ } else {
+ data = undefined;
+ }
+ }
+ return data;
+}
+
+jQuery.extend({
+ hasData: function( elem ) {
+ return data_user.hasData( elem ) || data_priv.hasData( elem );
+ },
+
+ data: function( elem, name, data ) {
+ return data_user.access( elem, name, data );
+ },
+
+ removeData: function( elem, name ) {
+ data_user.remove( elem, name );
+ },
+
+ // TODO: Now that all calls to _data and _removeData have been replaced
+ // with direct calls to data_priv methods, these can be deprecated.
+ _data: function( elem, name, data ) {
+ return data_priv.access( elem, name, data );
+ },
+
+ _removeData: function( elem, name ) {
+ data_priv.remove( elem, name );
+ }
+});
+
+jQuery.fn.extend({
+ data: function( key, value ) {
+ var i, name, data,
+ elem = this[ 0 ],
+ attrs = elem && elem.attributes;
+
+ // Gets all values
+ if ( key === undefined ) {
+ if ( this.length ) {
+ data = data_user.get( elem );
+
+ if ( elem.nodeType === 1 && !data_priv.get( elem, "hasDataAttrs" ) ) {
+ i = attrs.length;
+ while ( i-- ) {
+
+ // Support: IE11+
+ // The attrs elements can be null (#14894)
+ if ( attrs[ i ] ) {
+ name = attrs[ i ].name;
+ if ( name.indexOf( "data-" ) === 0 ) {
+ name = jQuery.camelCase( name.slice(5) );
+ dataAttr( elem, name, data[ name ] );
+ }
+ }
+ }
+ data_priv.set( elem, "hasDataAttrs", true );
+ }
+ }
+
+ return data;
+ }
+
+ // Sets multiple values
+ if ( typeof key === "object" ) {
+ return this.each(function() {
+ data_user.set( this, key );
+ });
+ }
+
+ return access( this, function( value ) {
+ var data,
+ camelKey = jQuery.camelCase( key );
+
+ // The calling jQuery object (element matches) is not empty
+ // (and therefore has an element appears at this[ 0 ]) and the
+ // `value` parameter was not undefined. An empty jQuery object
+ // will result in `undefined` for elem = this[ 0 ] which will
+ // throw an exception if an attempt to read a data cache is made.
+ if ( elem && value === undefined ) {
+ // Attempt to get data from the cache
+ // with the key as-is
+ data = data_user.get( elem, key );
+ if ( data !== undefined ) {
+ return data;
+ }
+
+ // Attempt to get data from the cache
+ // with the key camelized
+ data = data_user.get( elem, camelKey );
+ if ( data !== undefined ) {
+ return data;
+ }
+
+ // Attempt to "discover" the data in
+ // HTML5 custom data-* attrs
+ data = dataAttr( elem, camelKey, undefined );
+ if ( data !== undefined ) {
+ return data;
+ }
+
+ // We tried really hard, but the data doesn't exist.
+ return;
+ }
+
+ // Set the data...
+ this.each(function() {
+ // First, attempt to store a copy or reference of any
+ // data that might've been store with a camelCased key.
+ var data = data_user.get( this, camelKey );
+
+ // For HTML5 data-* attribute interop, we have to
+ // store property names with dashes in a camelCase form.
+ // This might not apply to all properties...*
+ data_user.set( this, camelKey, value );
+
+ // *... In the case of properties that might _actually_
+ // have dashes, we need to also store a copy of that
+ // unchanged property.
+ if ( key.indexOf("-") !== -1 && data !== undefined ) {
+ data_user.set( this, key, value );
+ }
+ });
+ }, null, value, arguments.length > 1, null, true );
+ },
+
+ removeData: function( key ) {
+ return this.each(function() {
+ data_user.remove( this, key );
+ });
+ }
+});
+
+
+jQuery.extend({
+ queue: function( elem, type, data ) {
+ var queue;
+
+ if ( elem ) {
+ type = ( type || "fx" ) + "queue";
+ queue = data_priv.get( elem, type );
+
+ // Speed up dequeue by getting out quickly if this is just a lookup
+ if ( data ) {
+ if ( !queue || jQuery.isArray( data ) ) {
+ queue = data_priv.access( elem, type, jQuery.makeArray(data) );
+ } else {
+ queue.push( data );
+ }
+ }
+ return queue || [];
+ }
+ },
+
+ dequeue: function( elem, type ) {
+ type = type || "fx";
+
+ var queue = jQuery.queue( elem, type ),
+ startLength = queue.length,
+ fn = queue.shift(),
+ hooks = jQuery._queueHooks( elem, type ),
+ next = function() {
+ jQuery.dequeue( elem, type );
+ };
+
+ // If the fx queue is dequeued, always remove the progress sentinel
+ if ( fn === "inprogress" ) {
+ fn = queue.shift();
+ startLength--;
+ }
+
+ if ( fn ) {
+
+ // Add a progress sentinel to prevent the fx queue from being
+ // automatically dequeued
+ if ( type === "fx" ) {
+ queue.unshift( "inprogress" );
+ }
+
+ // Clear up the last queue stop function
+ delete hooks.stop;
+ fn.call( elem, next, hooks );
+ }
+
+ if ( !startLength && hooks ) {
+ hooks.empty.fire();
+ }
+ },
+
+ // Not public - generate a queueHooks object, or return the current one
+ _queueHooks: function( elem, type ) {
+ var key = type + "queueHooks";
+ return data_priv.get( elem, key ) || data_priv.access( elem, key, {
+ empty: jQuery.Callbacks("once memory").add(function() {
+ data_priv.remove( elem, [ type + "queue", key ] );
+ })
+ });
+ }
+});
+
+jQuery.fn.extend({
+ queue: function( type, data ) {
+ var setter = 2;
+
+ if ( typeof type !== "string" ) {
+ data = type;
+ type = "fx";
+ setter--;
+ }
+
+ if ( arguments.length < setter ) {
+ return jQuery.queue( this[0], type );
+ }
+
+ return data === undefined ?
+ this :
+ this.each(function() {
+ var queue = jQuery.queue( this, type, data );
+
+ // Ensure a hooks for this queue
+ jQuery._queueHooks( this, type );
+
+ if ( type === "fx" && queue[0] !== "inprogress" ) {
+ jQuery.dequeue( this, type );
+ }
+ });
+ },
+ dequeue: function( type ) {
+ return this.each(function() {
+ jQuery.dequeue( this, type );
+ });
+ },
+ clearQueue: function( type ) {
+ return this.queue( type || "fx", [] );
+ },
+ // Get a promise resolved when queues of a certain type
+ // are emptied (fx is the type by default)
+ promise: function( type, obj ) {
+ var tmp,
+ count = 1,
+ defer = jQuery.Deferred(),
+ elements = this,
+ i = this.length,
+ resolve = function() {
+ if ( !( --count ) ) {
+ defer.resolveWith( elements, [ elements ] );
+ }
+ };
+
+ if ( typeof type !== "string" ) {
+ obj = type;
+ type = undefined;
+ }
+ type = type || "fx";
+
+ while ( i-- ) {
+ tmp = data_priv.get( elements[ i ], type + "queueHooks" );
+ if ( tmp && tmp.empty ) {
+ count++;
+ tmp.empty.add( resolve );
+ }
+ }
+ resolve();
+ return defer.promise( obj );
+ }
+});
+var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;
+
+var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
+
+var isHidden = function( elem, el ) {
+ // isHidden might be called from jQuery#filter function;
+ // in that case, element will be second argument
+ elem = el || elem;
+ return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
+ };
+
+var rcheckableType = (/^(?:checkbox|radio)$/i);
+
+
+
+(function() {
+ var fragment = document.createDocumentFragment(),
+ div = fragment.appendChild( document.createElement( "div" ) ),
+ input = document.createElement( "input" );
+
+ // Support: Safari<=5.1
+ // Check state lost if the name is set (#11217)
+ // Support: Windows Web Apps (WWA)
+ // `name` and `type` must use .setAttribute for WWA (#14901)
+ input.setAttribute( "type", "radio" );
+ input.setAttribute( "checked", "checked" );
+ input.setAttribute( "name", "t" );
+
+ div.appendChild( input );
+
+ // Support: Safari<=5.1, Android<4.2
+ // Older WebKit doesn't clone checked state correctly in fragments
+ support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
+
+ // Support: IE<=11+
+ // Make sure textarea (and checkbox) defaultValue is properly cloned
+ div.innerHTML = "<textarea>x</textarea>";
+ support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
+})();
+var strundefined = typeof undefined;
+
+
+
+support.focusinBubbles = "onfocusin" in window;
+
+
+var
+ rkeyEvent = /^key/,
+ rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/,
+ rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
+ rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
+
+function returnTrue() {
+ return true;
+}
+
+function returnFalse() {
+ return false;
+}
+
+function safeActiveElement() {
+ try {
+ return document.activeElement;
+ } catch ( err ) { }
+}
+
+/*
+ * Helper functions for managing events -- not part of the public interface.
+ * Props to Dean Edwards' addEvent library for many of the ideas.
+ */
+jQuery.event = {
+
+ global: {},
+
+ add: function( elem, types, handler, data, selector ) {
+
+ var handleObjIn, eventHandle, tmp,
+ events, t, handleObj,
+ special, handlers, type, namespaces, origType,
+ elemData = data_priv.get( elem );
+
+ // Don't attach events to noData or text/comment nodes (but allow plain objects)
+ if ( !elemData ) {
+ return;
+ }
+
+ // Caller can pass in an object of custom data in lieu of the handler
+ if ( handler.handler ) {
+ handleObjIn = handler;
+ handler = handleObjIn.handler;
+ selector = handleObjIn.selector;
+ }
+
+ // Make sure that the handler has a unique ID, used to find/remove it later
+ if ( !handler.guid ) {
+ handler.guid = jQuery.guid++;
+ }
+
+ // Init the element's event structure and main handler, if this is the first
+ if ( !(events = elemData.events) ) {
+ events = elemData.events = {};
+ }
+ if ( !(eventHandle = elemData.handle) ) {
+ eventHandle = elemData.handle = function( e ) {
+ // Discard the second event of a jQuery.event.trigger() and
+ // when an event is called after a page has unloaded
+ return typeof jQuery !== strundefined && jQuery.event.triggered !== e.type ?
+ jQuery.event.dispatch.apply( elem, arguments ) : undefined;
+ };
+ }
+
+ // Handle multiple events separated by a space
+ types = ( types || "" ).match( rnotwhite ) || [ "" ];
+ t = types.length;
+ while ( t-- ) {
+ tmp = rtypenamespace.exec( types[t] ) || [];
+ type = origType = tmp[1];
+ namespaces = ( tmp[2] || "" ).split( "." ).sort();
+
+ // There *must* be a type, no attaching namespace-only handlers
+ if ( !type ) {
+ continue;
+ }
+
+ // If event changes its type, use the special event handlers for the changed type
+ special = jQuery.event.special[ type ] || {};
+
+ // If selector defined, determine special event api type, otherwise given type
+ type = ( selector ? special.delegateType : special.bindType ) || type;
+
+ // Update special based on newly reset type
+ special = jQuery.event.special[ type ] || {};
+
+ // handleObj is passed to all event handlers
+ handleObj = jQuery.extend({
+ type: type,
+ origType: origType,
+ data: data,
+ handler: handler,
+ guid: handler.guid,
+ selector: selector,
+ needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
+ namespace: namespaces.join(".")
+ }, handleObjIn );
+
+ // Init the event handler queue if we're the first
+ if ( !(handlers = events[ type ]) ) {
+ handlers = events[ type ] = [];
+ handlers.delegateCount = 0;
+
+ // Only use addEventListener if the special events handler returns false
+ if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
+ if ( elem.addEventListener ) {
+ elem.addEventListener( type, eventHandle, false );
+ }
+ }
+ }
+
+ if ( special.add ) {
+ special.add.call( elem, handleObj );
+
+ if ( !handleObj.handler.guid ) {
+ handleObj.handler.guid = handler.guid;
+ }
+ }
+
+ // Add to the element's handler list, delegates in front
+ if ( selector ) {
+ handlers.splice( handlers.delegateCount++, 0, handleObj );
+ } else {
+ handlers.push( handleObj );
+ }
+
+ // Keep track of which events have ever been used, for event optimization
+ jQuery.event.global[ type ] = true;
+ }
+
+ },
+
+ // Detach an event or set of events from an element
+ remove: function( elem, types, handler, selector, mappedTypes ) {
+
+ var j, origCount, tmp,
+ events, t, handleObj,
+ special, handlers, type, namespaces, origType,
+ elemData = data_priv.hasData( elem ) && data_priv.get( elem );
+
+ if ( !elemData || !(events = elemData.events) ) {
+ return;
+ }
+
+ // Once for each type.namespace in types; type may be omitted
+ types = ( types || "" ).match( rnotwhite ) || [ "" ];
+ t = types.length;
+ while ( t-- ) {
+ tmp = rtypenamespace.exec( types[t] ) || [];
+ type = origType = tmp[1];
+ namespaces = ( tmp[2] || "" ).split( "." ).sort();
+
+ // Unbind all events (on this namespace, if provided) for the element
+ if ( !type ) {
+ for ( type in events ) {
+ jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
+ }
+ continue;
+ }
+
+ special = jQuery.event.special[ type ] || {};
+ type = ( selector ? special.delegateType : special.bindType ) || type;
+ handlers = events[ type ] || [];
+ tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
+
+ // Remove matching events
+ origCount = j = handlers.length;
+ while ( j-- ) {
+ handleObj = handlers[ j ];
+
+ if ( ( mappedTypes || origType === handleObj.origType ) &&
+ ( !handler || handler.guid === handleObj.guid ) &&
+ ( !tmp || tmp.test( handleObj.namespace ) ) &&
+ ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
+ handlers.splice( j, 1 );
+
+ if ( handleObj.selector ) {
+ handlers.delegateCount--;
+ }
+ if ( special.remove ) {
+ special.remove.call( elem, handleObj );
+ }
+ }
+ }
+
+ // Remove generic event handler if we removed something and no more handlers exist
+ // (avoids potential for endless recursion during removal of special event handlers)
+ if ( origCount && !handlers.length ) {
+ if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
+ jQuery.removeEvent( elem, type, elemData.handle );
+ }
+
+ delete events[ type ];
+ }
+ }
+
+ // Remove the expando if it's no longer used
+ if ( jQuery.isEmptyObject( events ) ) {
+ delete elemData.handle;
+ data_priv.remove( elem, "events" );
+ }
+ },
+
+ trigger: function( event, data, elem, onlyHandlers ) {
+
+ var i, cur, tmp, bubbleType, ontype, handle, special,
+ eventPath = [ elem || document ],
+ type = hasOwn.call( event, "type" ) ? event.type : event,
+ namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
+
+ cur = tmp = elem = elem || document;
+
+ // Don't do events on text and comment nodes
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return;
+ }
+
+ // focus/blur morphs to focusin/out; ensure we're not firing them right now
+ if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
+ return;
+ }
+
+ if ( type.indexOf(".") >= 0 ) {
+ // Namespaced trigger; create a regexp to match event type in handle()
+ namespaces = type.split(".");
+ type = namespaces.shift();
+ namespaces.sort();
+ }
+ ontype = type.indexOf(":") < 0 && "on" + type;
+
+ // Caller can pass in a jQuery.Event object, Object, or just an event type string
+ event = event[ jQuery.expando ] ?
+ event :
+ new jQuery.Event( type, typeof event === "object" && event );
+
+ // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
+ event.isTrigger = onlyHandlers ? 2 : 3;
+ event.namespace = namespaces.join(".");
+ event.namespace_re = event.namespace ?
+ new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
+ null;
+
+ // Clean up the event in case it is being reused
+ event.result = undefined;
+ if ( !event.target ) {
+ event.target = elem;
+ }
+
+ // Clone any incoming data and prepend the event, creating the handler arg list
+ data = data == null ?
+ [ event ] :
+ jQuery.makeArray( data, [ event ] );
+
+ // Allow special events to draw outside the lines
+ special = jQuery.event.special[ type ] || {};
+ if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
+ return;
+ }
+
+ // Determine event propagation path in advance, per W3C events spec (#9951)
+ // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
+ if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
+
+ bubbleType = special.delegateType || type;
+ if ( !rfocusMorph.test( bubbleType + type ) ) {
+ cur = cur.parentNode;
+ }
+ for ( ; cur; cur = cur.parentNode ) {
+ eventPath.push( cur );
+ tmp = cur;
+ }
+
+ // Only add window if we got to document (e.g., not plain obj or detached DOM)
+ if ( tmp === (elem.ownerDocument || document) ) {
+ eventPath.push( tmp.defaultView || tmp.parentWindow || window );
+ }
+ }
+
+ // Fire handlers on the event path
+ i = 0;
+ while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
+
+ event.type = i > 1 ?
+ bubbleType :
+ special.bindType || type;
+
+ // jQuery handler
+ handle = ( data_priv.get( cur, "events" ) || {} )[ event.type ] && data_priv.get( cur, "handle" );
+ if ( handle ) {
+ handle.apply( cur, data );
+ }
+
+ // Native handler
+ handle = ontype && cur[ ontype ];
+ if ( handle && handle.apply && jQuery.acceptData( cur ) ) {
+ event.result = handle.apply( cur, data );
+ if ( event.result === false ) {
+ event.preventDefault();
+ }
+ }
+ }
+ event.type = type;
+
+ // If nobody prevented the default action, do it now
+ if ( !onlyHandlers && !event.isDefaultPrevented() ) {
+
+ if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&
+ jQuery.acceptData( elem ) ) {
+
+ // Call a native DOM method on the target with the same name name as the event.
+ // Don't do default actions on window, that's where global variables be (#6170)
+ if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) {
+
+ // Don't re-trigger an onFOO event when we call its FOO() method
+ tmp = elem[ ontype ];
+
+ if ( tmp ) {
+ elem[ ontype ] = null;
+ }
+
+ // Prevent re-triggering of the same event, since we already bubbled it above
+ jQuery.event.triggered = type;
+ elem[ type ]();
+ jQuery.event.triggered = undefined;
+
+ if ( tmp ) {
+ elem[ ontype ] = tmp;
+ }
+ }
+ }
+ }
+
+ return event.result;
+ },
+
+ dispatch: function( event ) {
+
+ // Make a writable jQuery.Event from the native event object
+ event = jQuery.event.fix( event );
+
+ var i, j, ret, matched, handleObj,
+ handlerQueue = [],
+ args = slice.call( arguments ),
+ handlers = ( data_priv.get( this, "events" ) || {} )[ event.type ] || [],
+ special = jQuery.event.special[ event.type ] || {};
+
+ // Use the fix-ed jQuery.Event rather than the (read-only) native event
+ args[0] = event;
+ event.delegateTarget = this;
+
+ // Call the preDispatch hook for the mapped type, and let it bail if desired
+ if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
+ return;
+ }
+
+ // Determine handlers
+ handlerQueue = jQuery.event.handlers.call( this, event, handlers );
+
+ // Run delegates first; they may want to stop propagation beneath us
+ i = 0;
+ while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
+ event.currentTarget = matched.elem;
+
+ j = 0;
+ while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
+
+ // Triggered event must either 1) have no namespace, or 2) have namespace(s)
+ // a subset or equal to those in the bound event (both can have no namespace).
+ if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
+
+ event.handleObj = handleObj;
+ event.data = handleObj.data;
+
+ ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
+ .apply( matched.elem, args );
+
+ if ( ret !== undefined ) {
+ if ( (event.result = ret) === false ) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ }
+ }
+ }
+ }
+
+ // Call the postDispatch hook for the mapped type
+ if ( special.postDispatch ) {
+ special.postDispatch.call( this, event );
+ }
+
+ return event.result;
+ },
+
+ handlers: function( event, handlers ) {
+ var i, matches, sel, handleObj,
+ handlerQueue = [],
+ delegateCount = handlers.delegateCount,
+ cur = event.target;
+
+ // Find delegate handlers
+ // Black-hole SVG <use> instance trees (#13180)
+ // Avoid non-left-click bubbling in Firefox (#3861)
+ if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
+
+ for ( ; cur !== this; cur = cur.parentNode || this ) {
+
+ // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
+ if ( cur.disabled !== true || event.type !== "click" ) {
+ matches = [];
+ for ( i = 0; i < delegateCount; i++ ) {
+ handleObj = handlers[ i ];
+
+ // Don't conflict with Object.prototype properties (#13203)
+ sel = handleObj.selector + " ";
+
+ if ( matches[ sel ] === undefined ) {
+ matches[ sel ] = handleObj.needsContext ?
+ jQuery( sel, this ).index( cur ) >= 0 :
+ jQuery.find( sel, this, null, [ cur ] ).length;
+ }
+ if ( matches[ sel ] ) {
+ matches.push( handleObj );
+ }
+ }
+ if ( matches.length ) {
+ handlerQueue.push({ elem: cur, handlers: matches });
+ }
+ }
+ }
+ }
+
+ // Add the remaining (directly-bound) handlers
+ if ( delegateCount < handlers.length ) {
+ handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
+ }
+
+ return handlerQueue;
+ },
+
+ // Includes some event props shared by KeyEvent and MouseEvent
+ props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
+
+ fixHooks: {},
+
+ keyHooks: {
+ props: "char charCode key keyCode".split(" "),
+ filter: function( event, original ) {
+
+ // Add which for key events
+ if ( event.which == null ) {
+ event.which = original.charCode != null ? original.charCode : original.keyCode;
+ }
+
+ return event;
+ }
+ },
+
+ mouseHooks: {
+ props: "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
+ filter: function( event, original ) {
+ var eventDoc, doc, body,
+ button = original.button;
+
+ // Calculate pageX/Y if missing and clientX/Y available
+ if ( event.pageX == null && original.clientX != null ) {
+ eventDoc = event.target.ownerDocument || document;
+ doc = eventDoc.documentElement;
+ body = eventDoc.body;
+
+ event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
+ event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
+ }
+
+ // Add which for click: 1 === left; 2 === middle; 3 === right
+ // Note: button is not normalized, so don't use it
+ if ( !event.which && button !== undefined ) {
+ event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
+ }
+
+ return event;
+ }
+ },
+
+ fix: function( event ) {
+ if ( event[ jQuery.expando ] ) {
+ return event;
+ }
+
+ // Create a writable copy of the event object and normalize some properties
+ var i, prop, copy,
+ type = event.type,
+ originalEvent = event,
+ fixHook = this.fixHooks[ type ];
+
+ if ( !fixHook ) {
+ this.fixHooks[ type ] = fixHook =
+ rmouseEvent.test( type ) ? this.mouseHooks :
+ rkeyEvent.test( type ) ? this.keyHooks :
+ {};
+ }
+ copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
+
+ event = new jQuery.Event( originalEvent );
+
+ i = copy.length;
+ while ( i-- ) {
+ prop = copy[ i ];
+ event[ prop ] = originalEvent[ prop ];
+ }
+
+ // Support: Cordova 2.5 (WebKit) (#13255)
+ // All events should have a target; Cordova deviceready doesn't
+ if ( !event.target ) {
+ event.target = document;
+ }
+
+ // Support: Safari 6.0+, Chrome<28
+ // Target should not be a text node (#504, #13143)
+ if ( event.target.nodeType === 3 ) {
+ event.target = event.target.parentNode;
+ }
+
+ return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
+ },
+
+ special: {
+ load: {
+ // Prevent triggered image.load events from bubbling to window.load
+ noBubble: true
+ },
+ focus: {
+ // Fire native event if possible so blur/focus sequence is correct
+ trigger: function() {
+ if ( this !== safeActiveElement() && this.focus ) {
+ this.focus();
+ return false;
+ }
+ },
+ delegateType: "focusin"
+ },
+ blur: {
+ trigger: function() {
+ if ( this === safeActiveElement() && this.blur ) {
+ this.blur();
+ return false;
+ }
+ },
+ delegateType: "focusout"
+ },
+ click: {
+ // For checkbox, fire native event so checked state will be right
+ trigger: function() {
+ if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) {
+ this.click();
+ return false;
+ }
+ },
+
+ // For cross-browser consistency, don't fire native .click() on links
+ _default: function( event ) {
+ return jQuery.nodeName( event.target, "a" );
+ }
+ },
+
+ beforeunload: {
+ postDispatch: function( event ) {
+
+ // Support: Firefox 20+
+ // Firefox doesn't alert if the returnValue field is not set.
+ if ( event.result !== undefined && event.originalEvent ) {
+ event.originalEvent.returnValue = event.result;
+ }
+ }
+ }
+ },
+
+ simulate: function( type, elem, event, bubble ) {
+ // Piggyback on a donor event to simulate a different one.
+ // Fake originalEvent to avoid donor's stopPropagation, but if the
+ // simulated event prevents default then we do the same on the donor.
+ var e = jQuery.extend(
+ new jQuery.Event(),
+ event,
+ {
+ type: type,
+ isSimulated: true,
+ originalEvent: {}
+ }
+ );
+ if ( bubble ) {
+ jQuery.event.trigger( e, null, elem );
+ } else {
+ jQuery.event.dispatch.call( elem, e );
+ }
+ if ( e.isDefaultPrevented() ) {
+ event.preventDefault();
+ }
+ }
+};
+
+jQuery.removeEvent = function( elem, type, handle ) {
+ if ( elem.removeEventListener ) {
+ elem.removeEventListener( type, handle, false );
+ }
+};
+
+jQuery.Event = function( src, props ) {
+ // Allow instantiation without the 'new' keyword
+ if ( !(this instanceof jQuery.Event) ) {
+ return new jQuery.Event( src, props );
+ }
+
+ // Event object
+ if ( src && src.type ) {
+ this.originalEvent = src;
+ this.type = src.type;
+
+ // Events bubbling up the document may have been marked as prevented
+ // by a handler lower down the tree; reflect the correct value.
+ this.isDefaultPrevented = src.defaultPrevented ||
+ src.defaultPrevented === undefined &&
+ // Support: Android<4.0
+ src.returnValue === false ?
+ returnTrue :
+ returnFalse;
+
+ // Event type
+ } else {
+ this.type = src;
+ }
+
+ // Put explicitly provided properties onto the event object
+ if ( props ) {
+ jQuery.extend( this, props );
+ }
+
+ // Create a timestamp if incoming event doesn't have one
+ this.timeStamp = src && src.timeStamp || jQuery.now();
+
+ // Mark it as fixed
+ this[ jQuery.expando ] = true;
+};
+
+// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
+// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
+jQuery.Event.prototype = {
+ isDefaultPrevented: returnFalse,
+ isPropagationStopped: returnFalse,
+ isImmediatePropagationStopped: returnFalse,
+
+ preventDefault: function() {
+ var e = this.originalEvent;
+
+ this.isDefaultPrevented = returnTrue;
+
+ if ( e && e.preventDefault ) {
+ e.preventDefault();
+ }
+ },
+ stopPropagation: function() {
+ var e = this.originalEvent;
+
+ this.isPropagationStopped = returnTrue;
+
+ if ( e && e.stopPropagation ) {
+ e.stopPropagation();
+ }
+ },
+ stopImmediatePropagation: function() {
+ var e = this.originalEvent;
+
+ this.isImmediatePropagationStopped = returnTrue;
+
+ if ( e && e.stopImmediatePropagation ) {
+ e.stopImmediatePropagation();
+ }
+
+ this.stopPropagation();
+ }
+};
+
+// Create mouseenter/leave events using mouseover/out and event-time checks
+// Support: Chrome 15+
+jQuery.each({
+ mouseenter: "mouseover",
+ mouseleave: "mouseout",
+ pointerenter: "pointerover",
+ pointerleave: "pointerout"
+}, function( orig, fix ) {
+ jQuery.event.special[ orig ] = {
+ delegateType: fix,
+ bindType: fix,
+
+ handle: function( event ) {
+ var ret,
+ target = this,
+ related = event.relatedTarget,
+ handleObj = event.handleObj;
+
+ // For mousenter/leave call the handler if related is outside the target.
+ // NB: No relatedTarget if the mouse left/entered the browser window
+ if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
+ event.type = handleObj.origType;
+ ret = handleObj.handler.apply( this, arguments );
+ event.type = fix;
+ }
+ return ret;
+ }
+ };
+});
+
+// Support: Firefox, Chrome, Safari
+// Create "bubbling" focus and blur events
+if ( !support.focusinBubbles ) {
+ jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
+
+ // Attach a single capturing handler on the document while someone wants focusin/focusout
+ var handler = function( event ) {
+ jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
+ };
+
+ jQuery.event.special[ fix ] = {
+ setup: function() {
+ var doc = this.ownerDocument || this,
+ attaches = data_priv.access( doc, fix );
+
+ if ( !attaches ) {
+ doc.addEventListener( orig, handler, true );
+ }
+ data_priv.access( doc, fix, ( attaches || 0 ) + 1 );
+ },
+ teardown: function() {
+ var doc = this.ownerDocument || this,
+ attaches = data_priv.access( doc, fix ) - 1;
+
+ if ( !attaches ) {
+ doc.removeEventListener( orig, handler, true );
+ data_priv.remove( doc, fix );
+
+ } else {
+ data_priv.access( doc, fix, attaches );
+ }
+ }
+ };
+ });
+}
+
+jQuery.fn.extend({
+
+ on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
+ var origFn, type;
+
+ // Types can be a map of types/handlers
+ if ( typeof types === "object" ) {
+ // ( types-Object, selector, data )
+ if ( typeof selector !== "string" ) {
+ // ( types-Object, data )
+ data = data || selector;
+ selector = undefined;
+ }
+ for ( type in types ) {
+ this.on( type, selector, data, types[ type ], one );
+ }
+ return this;
+ }
+
+ if ( data == null && fn == null ) {
+ // ( types, fn )
+ fn = selector;
+ data = selector = undefined;
+ } else if ( fn == null ) {
+ if ( typeof selector === "string" ) {
+ // ( types, selector, fn )
+ fn = data;
+ data = undefined;
+ } else {
+ // ( types, data, fn )
+ fn = data;
+ data = selector;
+ selector = undefined;
+ }
+ }
+ if ( fn === false ) {
+ fn = returnFalse;
+ } else if ( !fn ) {
+ return this;
+ }
+
+ if ( one === 1 ) {
+ origFn = fn;
+ fn = function( event ) {
+ // Can use an empty set, since event contains the info
+ jQuery().off( event );
+ return origFn.apply( this, arguments );
+ };
+ // Use same guid so caller can remove using origFn
+ fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
+ }
+ return this.each( function() {
+ jQuery.event.add( this, types, fn, data, selector );
+ });
+ },
+ one: function( types, selector, data, fn ) {
+ return this.on( types, selector, data, fn, 1 );
+ },
+ off: function( types, selector, fn ) {
+ var handleObj, type;
+ if ( types && types.preventDefault && types.handleObj ) {
+ // ( event ) dispatched jQuery.Event
+ handleObj = types.handleObj;
+ jQuery( types.delegateTarget ).off(
+ handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
+ handleObj.selector,
+ handleObj.handler
+ );
+ return this;
+ }
+ if ( typeof types === "object" ) {
+ // ( types-object [, selector] )
+ for ( type in types ) {
+ this.off( type, selector, types[ type ] );
+ }
+ return this;
+ }
+ if ( selector === false || typeof selector === "function" ) {
+ // ( types [, fn] )
+ fn = selector;
+ selector = undefined;
+ }
+ if ( fn === false ) {
+ fn = returnFalse;
+ }
+ return this.each(function() {
+ jQuery.event.remove( this, types, fn, selector );
+ });
+ },
+
+ trigger: function( type, data ) {
+ return this.each(function() {
+ jQuery.event.trigger( type, data, this );
+ });
+ },
+ triggerHandler: function( type, data ) {
+ var elem = this[0];
+ if ( elem ) {
+ return jQuery.event.trigger( type, data, elem, true );
+ }
+ }
+});
+
+
+var
+ rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
+ rtagName = /<([\w:]+)/,
+ rhtml = /<|&#?\w+;/,
+ rnoInnerhtml = /<(?:script|style|link)/i,
+ // checked="checked" or checked
+ rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
+ rscriptType = /^$|\/(?:java|ecma)script/i,
+ rscriptTypeMasked = /^true\/(.*)/,
+ rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
+
+ // We have to close these tags to support XHTML (#13200)
+ wrapMap = {
+
+ // Support: IE9
+ option: [ 1, "<select multiple='multiple'>", "</select>" ],
+
+ thead: [ 1, "<table>", "</table>" ],
+ col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
+ tr: [ 2, "<table><tbody>", "</tbody></table>" ],
+ td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
+
+ _default: [ 0, "", "" ]
+ };
+
+// Support: IE9
+wrapMap.optgroup = wrapMap.option;
+
+wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
+wrapMap.th = wrapMap.td;
+
+// Support: 1.x compatibility
+// Manipulating tables requires a tbody
+function manipulationTarget( elem, content ) {
+ return jQuery.nodeName( elem, "table" ) &&
+ jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ?
+
+ elem.getElementsByTagName("tbody")[0] ||
+ elem.appendChild( elem.ownerDocument.createElement("tbody") ) :
+ elem;
+}
+
+// Replace/restore the type attribute of script elements for safe DOM manipulation
+function disableScript( elem ) {
+ elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type;
+ return elem;
+}
+function restoreScript( elem ) {
+ var match = rscriptTypeMasked.exec( elem.type );
+
+ if ( match ) {
+ elem.type = match[ 1 ];
+ } else {
+ elem.removeAttribute("type");
+ }
+
+ return elem;
+}
+
+// Mark scripts as having already been evaluated
+function setGlobalEval( elems, refElements ) {
+ var i = 0,
+ l = elems.length;
+
+ for ( ; i < l; i++ ) {
+ data_priv.set(
+ elems[ i ], "globalEval", !refElements || data_priv.get( refElements[ i ], "globalEval" )
+ );
+ }
+}
+
+function cloneCopyEvent( src, dest ) {
+ var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
+
+ if ( dest.nodeType !== 1 ) {
+ return;
+ }
+
+ // 1. Copy private data: events, handlers, etc.
+ if ( data_priv.hasData( src ) ) {
+ pdataOld = data_priv.access( src );
+ pdataCur = data_priv.set( dest, pdataOld );
+ events = pdataOld.events;
+
+ if ( events ) {
+ delete pdataCur.handle;
+ pdataCur.events = {};
+
+ for ( type in events ) {
+ for ( i = 0, l = events[ type ].length; i < l; i++ ) {
+ jQuery.event.add( dest, type, events[ type ][ i ] );
+ }
+ }
+ }
+ }
+
+ // 2. Copy user data
+ if ( data_user.hasData( src ) ) {
+ udataOld = data_user.access( src );
+ udataCur = jQuery.extend( {}, udataOld );
+
+ data_user.set( dest, udataCur );
+ }
+}
+
+function getAll( context, tag ) {
+ var ret = context.getElementsByTagName ? context.getElementsByTagName( tag || "*" ) :
+ context.querySelectorAll ? context.querySelectorAll( tag || "*" ) :
+ [];
+
+ return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
+ jQuery.merge( [ context ], ret ) :
+ ret;
+}
+
+// Fix IE bugs, see support tests
+function fixInput( src, dest ) {
+ var nodeName = dest.nodeName.toLowerCase();
+
+ // Fails to persist the checked state of a cloned checkbox or radio button.
+ if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
+ dest.checked = src.checked;
+
+ // Fails to return the selected option to the default selected state when cloning options
+ } else if ( nodeName === "input" || nodeName === "textarea" ) {
+ dest.defaultValue = src.defaultValue;
+ }
+}
+
+jQuery.extend({
+ clone: function( elem, dataAndEvents, deepDataAndEvents ) {
+ var i, l, srcElements, destElements,
+ clone = elem.cloneNode( true ),
+ inPage = jQuery.contains( elem.ownerDocument, elem );
+
+ // Fix IE cloning issues
+ if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
+ !jQuery.isXMLDoc( elem ) ) {
+
+ // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
+ destElements = getAll( clone );
+ srcElements = getAll( elem );
+
+ for ( i = 0, l = srcElements.length; i < l; i++ ) {
+ fixInput( srcElements[ i ], destElements[ i ] );
+ }
+ }
+
+ // Copy the events from the original to the clone
+ if ( dataAndEvents ) {
+ if ( deepDataAndEvents ) {
+ srcElements = srcElements || getAll( elem );
+ destElements = destElements || getAll( clone );
+
+ for ( i = 0, l = srcElements.length; i < l; i++ ) {
+ cloneCopyEvent( srcElements[ i ], destElements[ i ] );
+ }
+ } else {
+ cloneCopyEvent( elem, clone );
+ }
+ }
+
+ // Preserve script evaluation history
+ destElements = getAll( clone, "script" );
+ if ( destElements.length > 0 ) {
+ setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
+ }
+
+ // Return the cloned set
+ return clone;
+ },
+
+ buildFragment: function( elems, context, scripts, selection ) {
+ var elem, tmp, tag, wrap, contains, j,
+ fragment = context.createDocumentFragment(),
+ nodes = [],
+ i = 0,
+ l = elems.length;
+
+ for ( ; i < l; i++ ) {
+ elem = elems[ i ];
+
+ if ( elem || elem === 0 ) {
+
+ // Add nodes directly
+ if ( jQuery.type( elem ) === "object" ) {
+ // Support: QtWebKit, PhantomJS
+ // push.apply(_, arraylike) throws on ancient WebKit
+ jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
+
+ // Convert non-html into a text node
+ } else if ( !rhtml.test( elem ) ) {
+ nodes.push( context.createTextNode( elem ) );
+
+ // Convert html into DOM nodes
+ } else {
+ tmp = tmp || fragment.appendChild( context.createElement("div") );
+
+ // Deserialize a standard representation
+ tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
+ wrap = wrapMap[ tag ] || wrapMap._default;
+ tmp.innerHTML = wrap[ 1 ] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[ 2 ];
+
+ // Descend through wrappers to the right content
+ j = wrap[ 0 ];
+ while ( j-- ) {
+ tmp = tmp.lastChild;
+ }
+
+ // Support: QtWebKit, PhantomJS
+ // push.apply(_, arraylike) throws on ancient WebKit
+ jQuery.merge( nodes, tmp.childNodes );
+
+ // Remember the top-level container
+ tmp = fragment.firstChild;
+
+ // Ensure the created nodes are orphaned (#12392)
+ tmp.textContent = "";
+ }
+ }
+ }
+
+ // Remove wrapper from fragment
+ fragment.textContent = "";
+
+ i = 0;
+ while ( (elem = nodes[ i++ ]) ) {
+
+ // #4087 - If origin and destination elements are the same, and this is
+ // that element, do not do anything
+ if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
+ continue;
+ }
+
+ contains = jQuery.contains( elem.ownerDocument, elem );
+
+ // Append to fragment
+ tmp = getAll( fragment.appendChild( elem ), "script" );
+
+ // Preserve script evaluation history
+ if ( contains ) {
+ setGlobalEval( tmp );
+ }
+
+ // Capture executables
+ if ( scripts ) {
+ j = 0;
+ while ( (elem = tmp[ j++ ]) ) {
+ if ( rscriptType.test( elem.type || "" ) ) {
+ scripts.push( elem );
+ }
+ }
+ }
+ }
+
+ return fragment;
+ },
+
+ cleanData: function( elems ) {
+ var data, elem, type, key,
+ special = jQuery.event.special,
+ i = 0;
+
+ for ( ; (elem = elems[ i ]) !== undefined; i++ ) {
+ if ( jQuery.acceptData( elem ) ) {
+ key = elem[ data_priv.expando ];
+
+ if ( key && (data = data_priv.cache[ key ]) ) {
+ if ( data.events ) {
+ for ( type in data.events ) {
+ if ( special[ type ] ) {
+ jQuery.event.remove( elem, type );
+
+ // This is a shortcut to avoid jQuery.event.remove's overhead
+ } else {
+ jQuery.removeEvent( elem, type, data.handle );
+ }
+ }
+ }
+ if ( data_priv.cache[ key ] ) {
+ // Discard any remaining `private` data
+ delete data_priv.cache[ key ];
+ }
+ }
+ }
+ // Discard any remaining `user` data
+ delete data_user.cache[ elem[ data_user.expando ] ];
+ }
+ }
+});
+
+jQuery.fn.extend({
+ text: function( value ) {
+ return access( this, function( value ) {
+ return value === undefined ?
+ jQuery.text( this ) :
+ this.empty().each(function() {
+ if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
+ this.textContent = value;
+ }
+ });
+ }, null, value, arguments.length );
+ },
+
+ append: function() {
+ return this.domManip( arguments, function( elem ) {
+ if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
+ var target = manipulationTarget( this, elem );
+ target.appendChild( elem );
+ }
+ });
+ },
+
+ prepend: function() {
+ return this.domManip( arguments, function( elem ) {
+ if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
+ var target = manipulationTarget( this, elem );
+ target.insertBefore( elem, target.firstChild );
+ }
+ });
+ },
+
+ before: function() {
+ return this.domManip( arguments, function( elem ) {
+ if ( this.parentNode ) {
+ this.parentNode.insertBefore( elem, this );
+ }
+ });
+ },
+
+ after: function() {
+ return this.domManip( arguments, function( elem ) {
+ if ( this.parentNode ) {
+ this.parentNode.insertBefore( elem, this.nextSibling );
+ }
+ });
+ },
+
+ remove: function( selector, keepData /* Internal Use Only */ ) {
+ var elem,
+ elems = selector ? jQuery.filter( selector, this ) : this,
+ i = 0;
+
+ for ( ; (elem = elems[i]) != null; i++ ) {
+ if ( !keepData && elem.nodeType === 1 ) {
+ jQuery.cleanData( getAll( elem ) );
+ }
+
+ if ( elem.parentNode ) {
+ if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
+ setGlobalEval( getAll( elem, "script" ) );
+ }
+ elem.parentNode.removeChild( elem );
+ }
+ }
+
+ return this;
+ },
+
+ empty: function() {
+ var elem,
+ i = 0;
+
+ for ( ; (elem = this[i]) != null; i++ ) {
+ if ( elem.nodeType === 1 ) {
+
+ // Prevent memory leaks
+ jQuery.cleanData( getAll( elem, false ) );
+
+ // Remove any remaining nodes
+ elem.textContent = "";
+ }
+ }
+
+ return this;
+ },
+
+ clone: function( dataAndEvents, deepDataAndEvents ) {
+ dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
+ deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
+
+ return this.map(function() {
+ return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
+ });
+ },
+
+ html: function( value ) {
+ return access( this, function( value ) {
+ var elem = this[ 0 ] || {},
+ i = 0,
+ l = this.length;
+
+ if ( value === undefined && elem.nodeType === 1 ) {
+ return elem.innerHTML;
+ }
+
+ // See if we can take a shortcut and just use innerHTML
+ if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
+ !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
+
+ value = value.replace( rxhtmlTag, "<$1></$2>" );
+
+ try {
+ for ( ; i < l; i++ ) {
+ elem = this[ i ] || {};
+
+ // Remove element nodes and prevent memory leaks
+ if ( elem.nodeType === 1 ) {
+ jQuery.cleanData( getAll( elem, false ) );
+ elem.innerHTML = value;
+ }
+ }
+
+ elem = 0;
+
+ // If using innerHTML throws an exception, use the fallback method
+ } catch( e ) {}
+ }
+
+ if ( elem ) {
+ this.empty().append( value );
+ }
+ }, null, value, arguments.length );
+ },
+
+ replaceWith: function() {
+ var arg = arguments[ 0 ];
+
+ // Make the changes, replacing each context element with the new content
+ this.domManip( arguments, function( elem ) {
+ arg = this.parentNode;
+
+ jQuery.cleanData( getAll( this ) );
+
+ if ( arg ) {
+ arg.replaceChild( elem, this );
+ }
+ });
+
+ // Force removal if there was no new content (e.g., from empty arguments)
+ return arg && (arg.length || arg.nodeType) ? this : this.remove();
+ },
+
+ detach: function( selector ) {
+ return this.remove( selector, true );
+ },
+
+ domManip: function( args, callback ) {
+
+ // Flatten any nested arrays
+ args = concat.apply( [], args );
+
+ var fragment, first, scripts, hasScripts, node, doc,
+ i = 0,
+ l = this.length,
+ set = this,
+ iNoClone = l - 1,
+ value = args[ 0 ],
+ isFunction = jQuery.isFunction( value );
+
+ // We can't cloneNode fragments that contain checked, in WebKit
+ if ( isFunction ||
+ ( l > 1 && typeof value === "string" &&
+ !support.checkClone && rchecked.test( value ) ) ) {
+ return this.each(function( index ) {
+ var self = set.eq( index );
+ if ( isFunction ) {
+ args[ 0 ] = value.call( this, index, self.html() );
+ }
+ self.domManip( args, callback );
+ });
+ }
+
+ if ( l ) {
+ fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );
+ first = fragment.firstChild;
+
+ if ( fragment.childNodes.length === 1 ) {
+ fragment = first;
+ }
+
+ if ( first ) {
+ scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
+ hasScripts = scripts.length;
+
+ // Use the original fragment for the last item instead of the first because it can end up
+ // being emptied incorrectly in certain situations (#8070).
+ for ( ; i < l; i++ ) {
+ node = fragment;
+
+ if ( i !== iNoClone ) {
+ node = jQuery.clone( node, true, true );
+
+ // Keep references to cloned scripts for later restoration
+ if ( hasScripts ) {
+ // Support: QtWebKit
+ // jQuery.merge because push.apply(_, arraylike) throws
+ jQuery.merge( scripts, getAll( node, "script" ) );
+ }
+ }
+
+ callback.call( this[ i ], node, i );
+ }
+
+ if ( hasScripts ) {
+ doc = scripts[ scripts.length - 1 ].ownerDocument;
+
+ // Reenable scripts
+ jQuery.map( scripts, restoreScript );
+
+ // Evaluate executable scripts on first document insertion
+ for ( i = 0; i < hasScripts; i++ ) {
+ node = scripts[ i ];
+ if ( rscriptType.test( node.type || "" ) &&
+ !data_priv.access( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
+
+ if ( node.src ) {
+ // Optional AJAX dependency, but won't run scripts if not present
+ if ( jQuery._evalUrl ) {
+ jQuery._evalUrl( node.src );
+ }
+ } else {
+ jQuery.globalEval( node.textContent.replace( rcleanScript, "" ) );
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return this;
+ }
+});
+
+jQuery.each({
+ appendTo: "append",
+ prependTo: "prepend",
+ insertBefore: "before",
+ insertAfter: "after",
+ replaceAll: "replaceWith"
+}, function( name, original ) {
+ jQuery.fn[ name ] = function( selector ) {
+ var elems,
+ ret = [],
+ insert = jQuery( selector ),
+ last = insert.length - 1,
+ i = 0;
+
+ for ( ; i <= last; i++ ) {
+ elems = i === last ? this : this.clone( true );
+ jQuery( insert[ i ] )[ original ]( elems );
+
+ // Support: QtWebKit
+ // .get() because push.apply(_, arraylike) throws
+ push.apply( ret, elems.get() );
+ }
+
+ return this.pushStack( ret );
+ };
+});
+
+
+var iframe,
+ elemdisplay = {};
+
+/**
+ * Retrieve the actual display of a element
+ * @param {String} name nodeName of the element
+ * @param {Object} doc Document object
+ */
+// Called only from within defaultDisplay
+function actualDisplay( name, doc ) {
+ var style,
+ elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
+
+ // getDefaultComputedStyle might be reliably used only on attached element
+ display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ?
+
+ // Use of this method is a temporary fix (more like optimization) until something better comes along,
+ // since it was removed from specification and supported only in FF
+ style.display : jQuery.css( elem[ 0 ], "display" );
+
+ // We don't have any data stored on the element,
+ // so use "detach" method as fast way to get rid of the element
+ elem.detach();
+
+ return display;
+}
+
+/**
+ * Try to determine the default display value of an element
+ * @param {String} nodeName
+ */
+function defaultDisplay( nodeName ) {
+ var doc = document,
+ display = elemdisplay[ nodeName ];
+
+ if ( !display ) {
+ display = actualDisplay( nodeName, doc );
+
+ // If the simple way fails, read from inside an iframe
+ if ( display === "none" || !display ) {
+
+ // Use the already-created iframe if possible
+ iframe = (iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" )).appendTo( doc.documentElement );
+
+ // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
+ doc = iframe[ 0 ].contentDocument;
+
+ // Support: IE
+ doc.write();
+ doc.close();
+
+ display = actualDisplay( nodeName, doc );
+ iframe.detach();
+ }
+
+ // Store the correct default display
+ elemdisplay[ nodeName ] = display;
+ }
+
+ return display;
+}
+var rmargin = (/^margin/);
+
+var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
+
+var getStyles = function( elem ) {
+ // Support: IE<=11+, Firefox<=30+ (#15098, #14150)
+ // IE throws on elements created in popups
+ // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
+ if ( elem.ownerDocument.defaultView.opener ) {
+ return elem.ownerDocument.defaultView.getComputedStyle( elem, null );
+ }
+
+ return window.getComputedStyle( elem, null );
+ };
+
+
+
+function curCSS( elem, name, computed ) {
+ var width, minWidth, maxWidth, ret,
+ style = elem.style;
+
+ computed = computed || getStyles( elem );
+
+ // Support: IE9
+ // getPropertyValue is only needed for .css('filter') (#12537)
+ if ( computed ) {
+ ret = computed.getPropertyValue( name ) || computed[ name ];
+ }
+
+ if ( computed ) {
+
+ if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
+ ret = jQuery.style( elem, name );
+ }
+
+ // Support: iOS < 6
+ // A tribute to the "awesome hack by Dean Edwards"
+ // iOS < 6 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
+ // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
+ if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
+
+ // Remember the original values
+ width = style.width;
+ minWidth = style.minWidth;
+ maxWidth = style.maxWidth;
+
+ // Put in the new values to get a computed value out
+ style.minWidth = style.maxWidth = style.width = ret;
+ ret = computed.width;
+
+ // Revert the changed values
+ style.width = width;
+ style.minWidth = minWidth;
+ style.maxWidth = maxWidth;
+ }
+ }
+
+ return ret !== undefined ?
+ // Support: IE
+ // IE returns zIndex value as an integer.
+ ret + "" :
+ ret;
+}
+
+
+function addGetHookIf( conditionFn, hookFn ) {
+ // Define the hook, we'll check on the first run if it's really needed.
+ return {
+ get: function() {
+ if ( conditionFn() ) {
+ // Hook not needed (or it's not possible to use it due
+ // to missing dependency), remove it.
+ delete this.get;
+ return;
+ }
+
+ // Hook needed; redefine it so that the support test is not executed again.
+ return (this.get = hookFn).apply( this, arguments );
+ }
+ };
+}
+
+
+(function() {
+ var pixelPositionVal, boxSizingReliableVal,
+ docElem = document.documentElement,
+ container = document.createElement( "div" ),
+ div = document.createElement( "div" );
+
+ if ( !div.style ) {
+ return;
+ }
+
+ // Support: IE9-11+
+ // Style of cloned element affects source element cloned (#8908)
+ div.style.backgroundClip = "content-box";
+ div.cloneNode( true ).style.backgroundClip = "";
+ support.clearCloneStyle = div.style.backgroundClip === "content-box";
+
+ container.style.cssText = "border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;" +
+ "position:absolute";
+ container.appendChild( div );
+
+ // Executing both pixelPosition & boxSizingReliable tests require only one layout
+ // so they're executed at the same time to save the second computation.
+ function computePixelPositionAndBoxSizingReliable() {
+ div.style.cssText =
+ // Support: Firefox<29, Android 2.3
+ // Vendor-prefix box-sizing
+ "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" +
+ "box-sizing:border-box;display:block;margin-top:1%;top:1%;" +
+ "border:1px;padding:1px;width:4px;position:absolute";
+ div.innerHTML = "";
+ docElem.appendChild( container );
+
+ var divStyle = window.getComputedStyle( div, null );
+ pixelPositionVal = divStyle.top !== "1%";
+ boxSizingReliableVal = divStyle.width === "4px";
+
+ docElem.removeChild( container );
+ }
+
+ // Support: node.js jsdom
+ // Don't assume that getComputedStyle is a property of the global object
+ if ( window.getComputedStyle ) {
+ jQuery.extend( support, {
+ pixelPosition: function() {
+
+ // This test is executed only once but we still do memoizing
+ // since we can use the boxSizingReliable pre-computing.
+ // No need to check if the test was already performed, though.
+ computePixelPositionAndBoxSizingReliable();
+ return pixelPositionVal;
+ },
+ boxSizingReliable: function() {
+ if ( boxSizingReliableVal == null ) {
+ computePixelPositionAndBoxSizingReliable();
+ }
+ return boxSizingReliableVal;
+ },
+ reliableMarginRight: function() {
+
+ // Support: Android 2.3
+ // Check if div with explicit width and no margin-right incorrectly
+ // gets computed margin-right based on width of container. (#3333)
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+ // This support function is only executed once so no memoizing is needed.
+ var ret,
+ marginDiv = div.appendChild( document.createElement( "div" ) );
+
+ // Reset CSS: box-sizing; display; margin; border; padding
+ marginDiv.style.cssText = div.style.cssText =
+ // Support: Firefox<29, Android 2.3
+ // Vendor-prefix box-sizing
+ "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
+ "box-sizing:content-box;display:block;margin:0;border:0;padding:0";
+ marginDiv.style.marginRight = marginDiv.style.width = "0";
+ div.style.width = "1px";
+ docElem.appendChild( container );
+
+ ret = !parseFloat( window.getComputedStyle( marginDiv, null ).marginRight );
+
+ docElem.removeChild( container );
+ div.removeChild( marginDiv );
+
+ return ret;
+ }
+ });
+ }
+})();
+
+
+// A method for quickly swapping in/out CSS properties to get correct calculations.
+jQuery.swap = function( elem, options, callback, args ) {
+ var ret, name,
+ old = {};
+
+ // Remember the old values, and insert the new ones
+ for ( name in options ) {
+ old[ name ] = elem.style[ name ];
+ elem.style[ name ] = options[ name ];
+ }
+
+ ret = callback.apply( elem, args || [] );
+
+ // Revert the old values
+ for ( name in options ) {
+ elem.style[ name ] = old[ name ];
+ }
+
+ return ret;
+};
+
+
+var
+ // Swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
+ // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
+ rdisplayswap = /^(none|table(?!-c[ea]).+)/,
+ rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ),
+ rrelNum = new RegExp( "^([+-])=(" + pnum + ")", "i" ),
+
+ cssShow = { position: "absolute", visibility: "hidden", display: "block" },
+ cssNormalTransform = {
+ letterSpacing: "0",
+ fontWeight: "400"
+ },
+
+ cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
+
+// Return a css property mapped to a potentially vendor prefixed property
+function vendorPropName( style, name ) {
+
+ // Shortcut for names that are not vendor prefixed
+ if ( name in style ) {
+ return name;
+ }
+
+ // Check for vendor prefixed names
+ var capName = name[0].toUpperCase() + name.slice(1),
+ origName = name,
+ i = cssPrefixes.length;
+
+ while ( i-- ) {
+ name = cssPrefixes[ i ] + capName;
+ if ( name in style ) {
+ return name;
+ }
+ }
+
+ return origName;
+}
+
+function setPositiveNumber( elem, value, subtract ) {
+ var matches = rnumsplit.exec( value );
+ return matches ?
+ // Guard against undefined "subtract", e.g., when used as in cssHooks
+ Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
+ value;
+}
+
+function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
+ var i = extra === ( isBorderBox ? "border" : "content" ) ?
+ // If we already have the right measurement, avoid augmentation
+ 4 :
+ // Otherwise initialize for horizontal or vertical properties
+ name === "width" ? 1 : 0,
+
+ val = 0;
+
+ for ( ; i < 4; i += 2 ) {
+ // Both box models exclude margin, so add it if we want it
+ if ( extra === "margin" ) {
+ val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
+ }
+
+ if ( isBorderBox ) {
+ // border-box includes padding, so remove it if we want content
+ if ( extra === "content" ) {
+ val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
+ }
+
+ // At this point, extra isn't border nor margin, so remove border
+ if ( extra !== "margin" ) {
+ val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
+ }
+ } else {
+ // At this point, extra isn't content, so add padding
+ val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
+
+ // At this point, extra isn't content nor padding, so add border
+ if ( extra !== "padding" ) {
+ val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
+ }
+ }
+ }
+
+ return val;
+}
+
+function getWidthOrHeight( elem, name, extra ) {
+
+ // Start with offset property, which is equivalent to the border-box value
+ var valueIsBorderBox = true,
+ val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
+ styles = getStyles( elem ),
+ isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
+
+ // Some non-html elements return undefined for offsetWidth, so check for null/undefined
+ // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
+ // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
+ if ( val <= 0 || val == null ) {
+ // Fall back to computed then uncomputed css if necessary
+ val = curCSS( elem, name, styles );
+ if ( val < 0 || val == null ) {
+ val = elem.style[ name ];
+ }
+
+ // Computed unit is not pixels. Stop here and return.
+ if ( rnumnonpx.test(val) ) {
+ return val;
+ }
+
+ // Check for style in case a browser which returns unreliable values
+ // for getComputedStyle silently falls back to the reliable elem.style
+ valueIsBorderBox = isBorderBox &&
+ ( support.boxSizingReliable() || val === elem.style[ name ] );
+
+ // Normalize "", auto, and prepare for extra
+ val = parseFloat( val ) || 0;
+ }
+
+ // Use the active box-sizing model to add/subtract irrelevant styles
+ return ( val +
+ augmentWidthOrHeight(
+ elem,
+ name,
+ extra || ( isBorderBox ? "border" : "content" ),
+ valueIsBorderBox,
+ styles
+ )
+ ) + "px";
+}
+
+function showHide( elements, show ) {
+ var display, elem, hidden,
+ values = [],
+ index = 0,
+ length = elements.length;
+
+ for ( ; index < length; index++ ) {
+ elem = elements[ index ];
+ if ( !elem.style ) {
+ continue;
+ }
+
+ values[ index ] = data_priv.get( elem, "olddisplay" );
+ display = elem.style.display;
+ if ( show ) {
+ // Reset the inline display of this element to learn if it is
+ // being hidden by cascaded rules or not
+ if ( !values[ index ] && display === "none" ) {
+ elem.style.display = "";
+ }
+
+ // Set elements which have been overridden with display: none
+ // in a stylesheet to whatever the default browser style is
+ // for such an element
+ if ( elem.style.display === "" && isHidden( elem ) ) {
+ values[ index ] = data_priv.access( elem, "olddisplay", defaultDisplay(elem.nodeName) );
+ }
+ } else {
+ hidden = isHidden( elem );
+
+ if ( display !== "none" || !hidden ) {
+ data_priv.set( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );
+ }
+ }
+ }
+
+ // Set the display of most of the elements in a second loop
+ // to avoid the constant reflow
+ for ( index = 0; index < length; index++ ) {
+ elem = elements[ index ];
+ if ( !elem.style ) {
+ continue;
+ }
+ if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
+ elem.style.display = show ? values[ index ] || "" : "none";
+ }
+ }
+
+ return elements;
+}
+
+jQuery.extend({
+
+ // Add in style property hooks for overriding the default
+ // behavior of getting and setting a style property
+ cssHooks: {
+ opacity: {
+ get: function( elem, computed ) {
+ if ( computed ) {
+
+ // We should always get a number back from opacity
+ var ret = curCSS( elem, "opacity" );
+ return ret === "" ? "1" : ret;
+ }
+ }
+ }
+ },
+
+ // Don't automatically add "px" to these possibly-unitless properties
+ cssNumber: {
+ "columnCount": true,
+ "fillOpacity": true,
+ "flexGrow": true,
+ "flexShrink": true,
+ "fontWeight": true,
+ "lineHeight": true,
+ "opacity": true,
+ "order": true,
+ "orphans": true,
+ "widows": true,
+ "zIndex": true,
+ "zoom": true
+ },
+
+ // Add in properties whose names you wish to fix before
+ // setting or getting the value
+ cssProps: {
+ "float": "cssFloat"
+ },
+
+ // Get and set the style property on a DOM Node
+ style: function( elem, name, value, extra ) {
+
+ // Don't set styles on text and comment nodes
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
+ return;
+ }
+
+ // Make sure that we're working with the right name
+ var ret, type, hooks,
+ origName = jQuery.camelCase( name ),
+ style = elem.style;
+
+ name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
+
+ // Gets hook for the prefixed version, then unprefixed version
+ hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
+
+ // Check if we're setting a value
+ if ( value !== undefined ) {
+ type = typeof value;
+
+ // Convert "+=" or "-=" to relative numbers (#7345)
+ if ( type === "string" && (ret = rrelNum.exec( value )) ) {
+ value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
+ // Fixes bug #9237
+ type = "number";
+ }
+
+ // Make sure that null and NaN values aren't set (#7116)
+ if ( value == null || value !== value ) {
+ return;
+ }
+
+ // If a number, add 'px' to the (except for certain CSS properties)
+ if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
+ value += "px";
+ }
+
+ // Support: IE9-11+
+ // background-* props affect original clone's values
+ if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
+ style[ name ] = "inherit";
+ }
+
+ // If a hook was provided, use that value, otherwise just set the specified value
+ if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
+ style[ name ] = value;
+ }
+
+ } else {
+ // If a hook was provided get the non-computed value from there
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
+ return ret;
+ }
+
+ // Otherwise just get the value from the style object
+ return style[ name ];
+ }
+ },
+
+ css: function( elem, name, extra, styles ) {
+ var val, num, hooks,
+ origName = jQuery.camelCase( name );
+
+ // Make sure that we're working with the right name
+ name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
+
+ // Try prefixed name followed by the unprefixed name
+ hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
+
+ // If a hook was provided get the computed value from there
+ if ( hooks && "get" in hooks ) {
+ val = hooks.get( elem, true, extra );
+ }
+
+ // Otherwise, if a way to get the computed value exists, use that
+ if ( val === undefined ) {
+ val = curCSS( elem, name, styles );
+ }
+
+ // Convert "normal" to computed value
+ if ( val === "normal" && name in cssNormalTransform ) {
+ val = cssNormalTransform[ name ];
+ }
+
+ // Make numeric if forced or a qualifier was provided and val looks numeric
+ if ( extra === "" || extra ) {
+ num = parseFloat( val );
+ return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
+ }
+ return val;
+ }
+});
+
+jQuery.each([ "height", "width" ], function( i, name ) {
+ jQuery.cssHooks[ name ] = {
+ get: function( elem, computed, extra ) {
+ if ( computed ) {
+
+ // Certain elements can have dimension info if we invisibly show them
+ // but it must have a current display style that would benefit
+ return rdisplayswap.test( jQuery.css( elem, "display" ) ) && elem.offsetWidth === 0 ?
+ jQuery.swap( elem, cssShow, function() {
+ return getWidthOrHeight( elem, name, extra );
+ }) :
+ getWidthOrHeight( elem, name, extra );
+ }
+ },
+
+ set: function( elem, value, extra ) {
+ var styles = extra && getStyles( elem );
+ return setPositiveNumber( elem, value, extra ?
+ augmentWidthOrHeight(
+ elem,
+ name,
+ extra,
+ jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
+ styles
+ ) : 0
+ );
+ }
+ };
+});
+
+// Support: Android 2.3
+jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,
+ function( elem, computed ) {
+ if ( computed ) {
+ return jQuery.swap( elem, { "display": "inline-block" },
+ curCSS, [ elem, "marginRight" ] );
+ }
+ }
+);
+
+// These hooks are used by animate to expand properties
+jQuery.each({
+ margin: "",
+ padding: "",
+ border: "Width"
+}, function( prefix, suffix ) {
+ jQuery.cssHooks[ prefix + suffix ] = {
+ expand: function( value ) {
+ var i = 0,
+ expanded = {},
+
+ // Assumes a single number if not a string
+ parts = typeof value === "string" ? value.split(" ") : [ value ];
+
+ for ( ; i < 4; i++ ) {
+ expanded[ prefix + cssExpand[ i ] + suffix ] =
+ parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
+ }
+
+ return expanded;
+ }
+ };
+
+ if ( !rmargin.test( prefix ) ) {
+ jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
+ }
+});
+
+jQuery.fn.extend({
+ css: function( name, value ) {
+ return access( this, function( elem, name, value ) {
+ var styles, len,
+ map = {},
+ i = 0;
+
+ if ( jQuery.isArray( name ) ) {
+ styles = getStyles( elem );
+ len = name.length;
+
+ for ( ; i < len; i++ ) {
+ map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
+ }
+
+ return map;
+ }
+
+ return value !== undefined ?
+ jQuery.style( elem, name, value ) :
+ jQuery.css( elem, name );
+ }, name, value, arguments.length > 1 );
+ },
+ show: function() {
+ return showHide( this, true );
+ },
+ hide: function() {
+ return showHide( this );
+ },
+ toggle: function( state ) {
+ if ( typeof state === "boolean" ) {
+ return state ? this.show() : this.hide();
+ }
+
+ return this.each(function() {
+ if ( isHidden( this ) ) {
+ jQuery( this ).show();
+ } else {
+ jQuery( this ).hide();
+ }
+ });
+ }
+});
+
+
+function Tween( elem, options, prop, end, easing ) {
+ return new Tween.prototype.init( elem, options, prop, end, easing );
+}
+jQuery.Tween = Tween;
+
+Tween.prototype = {
+ constructor: Tween,
+ init: function( elem, options, prop, end, easing, unit ) {
+ this.elem = elem;
+ this.prop = prop;
+ this.easing = easing || "swing";
+ this.options = options;
+ this.start = this.now = this.cur();
+ this.end = end;
+ this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
+ },
+ cur: function() {
+ var hooks = Tween.propHooks[ this.prop ];
+
+ return hooks && hooks.get ?
+ hooks.get( this ) :
+ Tween.propHooks._default.get( this );
+ },
+ run: function( percent ) {
+ var eased,
+ hooks = Tween.propHooks[ this.prop ];
+
+ if ( this.options.duration ) {
+ this.pos = eased = jQuery.easing[ this.easing ](
+ percent, this.options.duration * percent, 0, 1, this.options.duration
+ );
+ } else {
+ this.pos = eased = percent;
+ }
+ this.now = ( this.end - this.start ) * eased + this.start;
+
+ if ( this.options.step ) {
+ this.options.step.call( this.elem, this.now, this );
+ }
+
+ if ( hooks && hooks.set ) {
+ hooks.set( this );
+ } else {
+ Tween.propHooks._default.set( this );
+ }
+ return this;
+ }
+};
+
+Tween.prototype.init.prototype = Tween.prototype;
+
+Tween.propHooks = {
+ _default: {
+ get: function( tween ) {
+ var result;
+
+ if ( tween.elem[ tween.prop ] != null &&
+ (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
+ return tween.elem[ tween.prop ];
+ }
+
+ // Passing an empty string as a 3rd parameter to .css will automatically
+ // attempt a parseFloat and fallback to a string if the parse fails.
+ // Simple values such as "10px" are parsed to Float;
+ // complex values such as "rotate(1rad)" are returned as-is.
+ result = jQuery.css( tween.elem, tween.prop, "" );
+ // Empty strings, null, undefined and "auto" are converted to 0.
+ return !result || result === "auto" ? 0 : result;
+ },
+ set: function( tween ) {
+ // Use step hook for back compat.
+ // Use cssHook if its there.
+ // Use .style if available and use plain properties where available.
+ if ( jQuery.fx.step[ tween.prop ] ) {
+ jQuery.fx.step[ tween.prop ]( tween );
+ } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
+ jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
+ } else {
+ tween.elem[ tween.prop ] = tween.now;
+ }
+ }
+ }
+};
+
+// Support: IE9
+// Panic based approach to setting things on disconnected nodes
+Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
+ set: function( tween ) {
+ if ( tween.elem.nodeType && tween.elem.parentNode ) {
+ tween.elem[ tween.prop ] = tween.now;
+ }
+ }
+};
+
+jQuery.easing = {
+ linear: function( p ) {
+ return p;
+ },
+ swing: function( p ) {
+ return 0.5 - Math.cos( p * Math.PI ) / 2;
+ }
+};
+
+jQuery.fx = Tween.prototype.init;
+
+// Back Compat <1.8 extension point
+jQuery.fx.step = {};
+
+
+
+
+var
+ fxNow, timerId,
+ rfxtypes = /^(?:toggle|show|hide)$/,
+ rfxnum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ),
+ rrun = /queueHooks$/,
+ animationPrefilters = [ defaultPrefilter ],
+ tweeners = {
+ "*": [ function( prop, value ) {
+ var tween = this.createTween( prop, value ),
+ target = tween.cur(),
+ parts = rfxnum.exec( value ),
+ unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
+
+ // Starting value computation is required for potential unit mismatches
+ start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) &&
+ rfxnum.exec( jQuery.css( tween.elem, prop ) ),
+ scale = 1,
+ maxIterations = 20;
+
+ if ( start && start[ 3 ] !== unit ) {
+ // Trust units reported by jQuery.css
+ unit = unit || start[ 3 ];
+
+ // Make sure we update the tween properties later on
+ parts = parts || [];
+
+ // Iteratively approximate from a nonzero starting point
+ start = +target || 1;
+
+ do {
+ // If previous iteration zeroed out, double until we get *something*.
+ // Use string for doubling so we don't accidentally see scale as unchanged below
+ scale = scale || ".5";
+
+ // Adjust and apply
+ start = start / scale;
+ jQuery.style( tween.elem, prop, start + unit );
+
+ // Update scale, tolerating zero or NaN from tween.cur(),
+ // break the loop if scale is unchanged or perfect, or if we've just had enough
+ } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
+ }
+
+ // Update tween properties
+ if ( parts ) {
+ start = tween.start = +start || +target || 0;
+ tween.unit = unit;
+ // If a +=/-= token was provided, we're doing a relative animation
+ tween.end = parts[ 1 ] ?
+ start + ( parts[ 1 ] + 1 ) * parts[ 2 ] :
+ +parts[ 2 ];
+ }
+
+ return tween;
+ } ]
+ };
+
+// Animations created synchronously will run synchronously
+function createFxNow() {
+ setTimeout(function() {
+ fxNow = undefined;
+ });
+ return ( fxNow = jQuery.now() );
+}
+
+// Generate parameters to create a standard animation
+function genFx( type, includeWidth ) {
+ var which,
+ i = 0,
+ attrs = { height: type };
+
+ // If we include width, step value is 1 to do all cssExpand values,
+ // otherwise step value is 2 to skip over Left and Right
+ includeWidth = includeWidth ? 1 : 0;
+ for ( ; i < 4 ; i += 2 - includeWidth ) {
+ which = cssExpand[ i ];
+ attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
+ }
+
+ if ( includeWidth ) {
+ attrs.opacity = attrs.width = type;
+ }
+
+ return attrs;
+}
+
+function createTween( value, prop, animation ) {
+ var tween,
+ collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
+ index = 0,
+ length = collection.length;
+ for ( ; index < length; index++ ) {
+ if ( (tween = collection[ index ].call( animation, prop, value )) ) {
+
+ // We're done with this property
+ return tween;
+ }
+ }
+}
+
+function defaultPrefilter( elem, props, opts ) {
+ /* jshint validthis: true */
+ var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
+ anim = this,
+ orig = {},
+ style = elem.style,
+ hidden = elem.nodeType && isHidden( elem ),
+ dataShow = data_priv.get( elem, "fxshow" );
+
+ // Handle queue: false promises
+ if ( !opts.queue ) {
+ hooks = jQuery._queueHooks( elem, "fx" );
+ if ( hooks.unqueued == null ) {
+ hooks.unqueued = 0;
+ oldfire = hooks.empty.fire;
+ hooks.empty.fire = function() {
+ if ( !hooks.unqueued ) {
+ oldfire();
+ }
+ };
+ }
+ hooks.unqueued++;
+
+ anim.always(function() {
+ // Ensure the complete handler is called before this completes
+ anim.always(function() {
+ hooks.unqueued--;
+ if ( !jQuery.queue( elem, "fx" ).length ) {
+ hooks.empty.fire();
+ }
+ });
+ });
+ }
+
+ // Height/width overflow pass
+ if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
+ // Make sure that nothing sneaks out
+ // Record all 3 overflow attributes because IE9-10 do not
+ // change the overflow attribute when overflowX and
+ // overflowY are set to the same value
+ opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
+
+ // Set display property to inline-block for height/width
+ // animations on inline elements that are having width/height animated
+ display = jQuery.css( elem, "display" );
+
+ // Test default display if display is currently "none"
+ checkDisplay = display === "none" ?
+ data_priv.get( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display;
+
+ if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) {
+ style.display = "inline-block";
+ }
+ }
+
+ if ( opts.overflow ) {
+ style.overflow = "hidden";
+ anim.always(function() {
+ style.overflow = opts.overflow[ 0 ];
+ style.overflowX = opts.overflow[ 1 ];
+ style.overflowY = opts.overflow[ 2 ];
+ });
+ }
+
+ // show/hide pass
+ for ( prop in props ) {
+ value = props[ prop ];
+ if ( rfxtypes.exec( value ) ) {
+ delete props[ prop ];
+ toggle = toggle || value === "toggle";
+ if ( value === ( hidden ? "hide" : "show" ) ) {
+
+ // If there is dataShow left over from a stopped hide or show and we are going to proceed with show, we should pretend to be hidden
+ if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
+ hidden = true;
+ } else {
+ continue;
+ }
+ }
+ orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
+
+ // Any non-fx value stops us from restoring the original display value
+ } else {
+ display = undefined;
+ }
+ }
+
+ if ( !jQuery.isEmptyObject( orig ) ) {
+ if ( dataShow ) {
+ if ( "hidden" in dataShow ) {
+ hidden = dataShow.hidden;
+ }
+ } else {
+ dataShow = data_priv.access( elem, "fxshow", {} );
+ }
+
+ // Store state if its toggle - enables .stop().toggle() to "reverse"
+ if ( toggle ) {
+ dataShow.hidden = !hidden;
+ }
+ if ( hidden ) {
+ jQuery( elem ).show();
+ } else {
+ anim.done(function() {
+ jQuery( elem ).hide();
+ });
+ }
+ anim.done(function() {
+ var prop;
+
+ data_priv.remove( elem, "fxshow" );
+ for ( prop in orig ) {
+ jQuery.style( elem, prop, orig[ prop ] );
+ }
+ });
+ for ( prop in orig ) {
+ tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
+
+ if ( !( prop in dataShow ) ) {
+ dataShow[ prop ] = tween.start;
+ if ( hidden ) {
+ tween.end = tween.start;
+ tween.start = prop === "width" || prop === "height" ? 1 : 0;
+ }
+ }
+ }
+
+ // If this is a noop like .hide().hide(), restore an overwritten display value
+ } else if ( (display === "none" ? defaultDisplay( elem.nodeName ) : display) === "inline" ) {
+ style.display = display;
+ }
+}
+
+function propFilter( props, specialEasing ) {
+ var index, name, easing, value, hooks;
+
+ // camelCase, specialEasing and expand cssHook pass
+ for ( index in props ) {
+ name = jQuery.camelCase( index );
+ easing = specialEasing[ name ];
+ value = props[ index ];
+ if ( jQuery.isArray( value ) ) {
+ easing = value[ 1 ];
+ value = props[ index ] = value[ 0 ];
+ }
+
+ if ( index !== name ) {
+ props[ name ] = value;
+ delete props[ index ];
+ }
+
+ hooks = jQuery.cssHooks[ name ];
+ if ( hooks && "expand" in hooks ) {
+ value = hooks.expand( value );
+ delete props[ name ];
+
+ // Not quite $.extend, this won't overwrite existing keys.
+ // Reusing 'index' because we have the correct "name"
+ for ( index in value ) {
+ if ( !( index in props ) ) {
+ props[ index ] = value[ index ];
+ specialEasing[ index ] = easing;
+ }
+ }
+ } else {
+ specialEasing[ name ] = easing;
+ }
+ }
+}
+
+function Animation( elem, properties, options ) {
+ var result,
+ stopped,
+ index = 0,
+ length = animationPrefilters.length,
+ deferred = jQuery.Deferred().always( function() {
+ // Don't match elem in the :animated selector
+ delete tick.elem;
+ }),
+ tick = function() {
+ if ( stopped ) {
+ return false;
+ }
+ var currentTime = fxNow || createFxNow(),
+ remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
+ // Support: Android 2.3
+ // Arch crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
+ temp = remaining / animation.duration || 0,
+ percent = 1 - temp,
+ index = 0,
+ length = animation.tweens.length;
+
+ for ( ; index < length ; index++ ) {
+ animation.tweens[ index ].run( percent );
+ }
+
+ deferred.notifyWith( elem, [ animation, percent, remaining ]);
+
+ if ( percent < 1 && length ) {
+ return remaining;
+ } else {
+ deferred.resolveWith( elem, [ animation ] );
+ return false;
+ }
+ },
+ animation = deferred.promise({
+ elem: elem,
+ props: jQuery.extend( {}, properties ),
+ opts: jQuery.extend( true, { specialEasing: {} }, options ),
+ originalProperties: properties,
+ originalOptions: options,
+ startTime: fxNow || createFxNow(),
+ duration: options.duration,
+ tweens: [],
+ createTween: function( prop, end ) {
+ var tween = jQuery.Tween( elem, animation.opts, prop, end,
+ animation.opts.specialEasing[ prop ] || animation.opts.easing );
+ animation.tweens.push( tween );
+ return tween;
+ },
+ stop: function( gotoEnd ) {
+ var index = 0,
+ // If we are going to the end, we want to run all the tweens
+ // otherwise we skip this part
+ length = gotoEnd ? animation.tweens.length : 0;
+ if ( stopped ) {
+ return this;
+ }
+ stopped = true;
+ for ( ; index < length ; index++ ) {
+ animation.tweens[ index ].run( 1 );
+ }
+
+ // Resolve when we played the last frame; otherwise, reject
+ if ( gotoEnd ) {
+ deferred.resolveWith( elem, [ animation, gotoEnd ] );
+ } else {
+ deferred.rejectWith( elem, [ animation, gotoEnd ] );
+ }
+ return this;
+ }
+ }),
+ props = animation.props;
+
+ propFilter( props, animation.opts.specialEasing );
+
+ for ( ; index < length ; index++ ) {
+ result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
+ if ( result ) {
+ return result;
+ }
+ }
+
+ jQuery.map( props, createTween, animation );
+
+ if ( jQuery.isFunction( animation.opts.start ) ) {
+ animation.opts.start.call( elem, animation );
+ }
+
+ jQuery.fx.timer(
+ jQuery.extend( tick, {
+ elem: elem,
+ anim: animation,
+ queue: animation.opts.queue
+ })
+ );
+
+ // attach callbacks from options
+ return animation.progress( animation.opts.progress )
+ .done( animation.opts.done, animation.opts.complete )
+ .fail( animation.opts.fail )
+ .always( animation.opts.always );
+}
+
+jQuery.Animation = jQuery.extend( Animation, {
+
+ tweener: function( props, callback ) {
+ if ( jQuery.isFunction( props ) ) {
+ callback = props;
+ props = [ "*" ];
+ } else {
+ props = props.split(" ");
+ }
+
+ var prop,
+ index = 0,
+ length = props.length;
+
+ for ( ; index < length ; index++ ) {
+ prop = props[ index ];
+ tweeners[ prop ] = tweeners[ prop ] || [];
+ tweeners[ prop ].unshift( callback );
+ }
+ },
+
+ prefilter: function( callback, prepend ) {
+ if ( prepend ) {
+ animationPrefilters.unshift( callback );
+ } else {
+ animationPrefilters.push( callback );
+ }
+ }
+});
+
+jQuery.speed = function( speed, easing, fn ) {
+ var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
+ complete: fn || !fn && easing ||
+ jQuery.isFunction( speed ) && speed,
+ duration: speed,
+ easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
+ };
+
+ opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
+ opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
+
+ // Normalize opt.queue - true/undefined/null -> "fx"
+ if ( opt.queue == null || opt.queue === true ) {
+ opt.queue = "fx";
+ }
+
+ // Queueing
+ opt.old = opt.complete;
+
+ opt.complete = function() {
+ if ( jQuery.isFunction( opt.old ) ) {
+ opt.old.call( this );
+ }
+
+ if ( opt.queue ) {
+ jQuery.dequeue( this, opt.queue );
+ }
+ };
+
+ return opt;
+};
+
+jQuery.fn.extend({
+ fadeTo: function( speed, to, easing, callback ) {
+
+ // Show any hidden elements after setting opacity to 0
+ return this.filter( isHidden ).css( "opacity", 0 ).show()
+
+ // Animate to the value specified
+ .end().animate({ opacity: to }, speed, easing, callback );
+ },
+ animate: function( prop, speed, easing, callback ) {
+ var empty = jQuery.isEmptyObject( prop ),
+ optall = jQuery.speed( speed, easing, callback ),
+ doAnimation = function() {
+ // Operate on a copy of prop so per-property easing won't be lost
+ var anim = Animation( this, jQuery.extend( {}, prop ), optall );
+
+ // Empty animations, or finishing resolves immediately
+ if ( empty || data_priv.get( this, "finish" ) ) {
+ anim.stop( true );
+ }
+ };
+ doAnimation.finish = doAnimation;
+
+ return empty || optall.queue === false ?
+ this.each( doAnimation ) :
+ this.queue( optall.queue, doAnimation );
+ },
+ stop: function( type, clearQueue, gotoEnd ) {
+ var stopQueue = function( hooks ) {
+ var stop = hooks.stop;
+ delete hooks.stop;
+ stop( gotoEnd );
+ };
+
+ if ( typeof type !== "string" ) {
+ gotoEnd = clearQueue;
+ clearQueue = type;
+ type = undefined;
+ }
+ if ( clearQueue && type !== false ) {
+ this.queue( type || "fx", [] );
+ }
+
+ return this.each(function() {
+ var dequeue = true,
+ index = type != null && type + "queueHooks",
+ timers = jQuery.timers,
+ data = data_priv.get( this );
+
+ if ( index ) {
+ if ( data[ index ] && data[ index ].stop ) {
+ stopQueue( data[ index ] );
+ }
+ } else {
+ for ( index in data ) {
+ if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
+ stopQueue( data[ index ] );
+ }
+ }
+ }
+
+ for ( index = timers.length; index--; ) {
+ if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
+ timers[ index ].anim.stop( gotoEnd );
+ dequeue = false;
+ timers.splice( index, 1 );
+ }
+ }
+
+ // Start the next in the queue if the last step wasn't forced.
+ // Timers currently will call their complete callbacks, which
+ // will dequeue but only if they were gotoEnd.
+ if ( dequeue || !gotoEnd ) {
+ jQuery.dequeue( this, type );
+ }
+ });
+ },
+ finish: function( type ) {
+ if ( type !== false ) {
+ type = type || "fx";
+ }
+ return this.each(function() {
+ var index,
+ data = data_priv.get( this ),
+ queue = data[ type + "queue" ],
+ hooks = data[ type + "queueHooks" ],
+ timers = jQuery.timers,
+ length = queue ? queue.length : 0;
+
+ // Enable finishing flag on private data
+ data.finish = true;
+
+ // Empty the queue first
+ jQuery.queue( this, type, [] );
+
+ if ( hooks && hooks.stop ) {
+ hooks.stop.call( this, true );
+ }
+
+ // Look for any active animations, and finish them
+ for ( index = timers.length; index--; ) {
+ if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
+ timers[ index ].anim.stop( true );
+ timers.splice( index, 1 );
+ }
+ }
+
+ // Look for any animations in the old queue and finish them
+ for ( index = 0; index < length; index++ ) {
+ if ( queue[ index ] && queue[ index ].finish ) {
+ queue[ index ].finish.call( this );
+ }
+ }
+
+ // Turn off finishing flag
+ delete data.finish;
+ });
+ }
+});
+
+jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
+ var cssFn = jQuery.fn[ name ];
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
+ return speed == null || typeof speed === "boolean" ?
+ cssFn.apply( this, arguments ) :
+ this.animate( genFx( name, true ), speed, easing, callback );
+ };
+});
+
+// Generate shortcuts for custom animations
+jQuery.each({
+ slideDown: genFx("show"),
+ slideUp: genFx("hide"),
+ slideToggle: genFx("toggle"),
+ fadeIn: { opacity: "show" },
+ fadeOut: { opacity: "hide" },
+ fadeToggle: { opacity: "toggle" }
+}, function( name, props ) {
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
+ return this.animate( props, speed, easing, callback );
+ };
+});
+
+jQuery.timers = [];
+jQuery.fx.tick = function() {
+ var timer,
+ i = 0,
+ timers = jQuery.timers;
+
+ fxNow = jQuery.now();
+
+ for ( ; i < timers.length; i++ ) {
+ timer = timers[ i ];
+ // Checks the timer has not already been removed
+ if ( !timer() && timers[ i ] === timer ) {
+ timers.splice( i--, 1 );
+ }
+ }
+
+ if ( !timers.length ) {
+ jQuery.fx.stop();
+ }
+ fxNow = undefined;
+};
+
+jQuery.fx.timer = function( timer ) {
+ jQuery.timers.push( timer );
+ if ( timer() ) {
+ jQuery.fx.start();
+ } else {
+ jQuery.timers.pop();
+ }
+};
+
+jQuery.fx.interval = 13;
+
+jQuery.fx.start = function() {
+ if ( !timerId ) {
+ timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
+ }
+};
+
+jQuery.fx.stop = function() {
+ clearInterval( timerId );
+ timerId = null;
+};
+
+jQuery.fx.speeds = {
+ slow: 600,
+ fast: 200,
+ // Default speed
+ _default: 400
+};
+
+
+// Based off of the plugin by Clint Helfers, with permission.
+// http://blindsignals.com/index.php/2009/07/jquery-delay/
+jQuery.fn.delay = function( time, type ) {
+ time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
+ type = type || "fx";
+
+ return this.queue( type, function( next, hooks ) {
+ var timeout = setTimeout( next, time );
+ hooks.stop = function() {
+ clearTimeout( timeout );
+ };
+ });
+};
+
+
+(function() {
+ var input = document.createElement( "input" ),
+ select = document.createElement( "select" ),
+ opt = select.appendChild( document.createElement( "option" ) );
+
+ input.type = "checkbox";
+
+ // Support: iOS<=5.1, Android<=4.2+
+ // Default value for a checkbox should be "on"
+ support.checkOn = input.value !== "";
+
+ // Support: IE<=11+
+ // Must access selectedIndex to make default options select
+ support.optSelected = opt.selected;
+
+ // Support: Android<=2.3
+ // Options inside disabled selects are incorrectly marked as disabled
+ select.disabled = true;
+ support.optDisabled = !opt.disabled;
+
+ // Support: IE<=11+
+ // An input loses its value after becoming a radio
+ input = document.createElement( "input" );
+ input.value = "t";
+ input.type = "radio";
+ support.radioValue = input.value === "t";
+})();
+
+
+var nodeHook, boolHook,
+ attrHandle = jQuery.expr.attrHandle;
+
+jQuery.fn.extend({
+ attr: function( name, value ) {
+ return access( this, jQuery.attr, name, value, arguments.length > 1 );
+ },
+
+ removeAttr: function( name ) {
+ return this.each(function() {
+ jQuery.removeAttr( this, name );
+ });
+ }
+});
+
+jQuery.extend({
+ attr: function( elem, name, value ) {
+ var hooks, ret,
+ nType = elem.nodeType;
+
+ // don't get/set attributes on text, comment and attribute nodes
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+ return;
+ }
+
+ // Fallback to prop when attributes are not supported
+ if ( typeof elem.getAttribute === strundefined ) {
+ return jQuery.prop( elem, name, value );
+ }
+
+ // All attributes are lowercase
+ // Grab necessary hook if one is defined
+ if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
+ name = name.toLowerCase();
+ hooks = jQuery.attrHooks[ name ] ||
+ ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
+ }
+
+ if ( value !== undefined ) {
+
+ if ( value === null ) {
+ jQuery.removeAttr( elem, name );
+
+ } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
+ return ret;
+
+ } else {
+ elem.setAttribute( name, value + "" );
+ return value;
+ }
+
+ } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
+ return ret;
+
+ } else {
+ ret = jQuery.find.attr( elem, name );
+
+ // Non-existent attributes return null, we normalize to undefined
+ return ret == null ?
+ undefined :
+ ret;
+ }
+ },
+
+ removeAttr: function( elem, value ) {
+ var name, propName,
+ i = 0,
+ attrNames = value && value.match( rnotwhite );
+
+ if ( attrNames && elem.nodeType === 1 ) {
+ while ( (name = attrNames[i++]) ) {
+ propName = jQuery.propFix[ name ] || name;
+
+ // Boolean attributes get special treatment (#10870)
+ if ( jQuery.expr.match.bool.test( name ) ) {
+ // Set corresponding property to false
+ elem[ propName ] = false;
+ }
+
+ elem.removeAttribute( name );
+ }
+ }
+ },
+
+ attrHooks: {
+ type: {
+ set: function( elem, value ) {
+ if ( !support.radioValue && value === "radio" &&
+ jQuery.nodeName( elem, "input" ) ) {
+ var val = elem.value;
+ elem.setAttribute( "type", value );
+ if ( val ) {
+ elem.value = val;
+ }
+ return value;
+ }
+ }
+ }
+ }
+});
+
+// Hooks for boolean attributes
+boolHook = {
+ set: function( elem, value, name ) {
+ if ( value === false ) {
+ // Remove boolean attributes when set to false
+ jQuery.removeAttr( elem, name );
+ } else {
+ elem.setAttribute( name, name );
+ }
+ return name;
+ }
+};
+jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
+ var getter = attrHandle[ name ] || jQuery.find.attr;
+
+ attrHandle[ name ] = function( elem, name, isXML ) {
+ var ret, handle;
+ if ( !isXML ) {
+ // Avoid an infinite loop by temporarily removing this function from the getter
+ handle = attrHandle[ name ];
+ attrHandle[ name ] = ret;
+ ret = getter( elem, name, isXML ) != null ?
+ name.toLowerCase() :
+ null;
+ attrHandle[ name ] = handle;
+ }
+ return ret;
+ };
+});
+
+
+
+
+var rfocusable = /^(?:input|select|textarea|button)$/i;
+
+jQuery.fn.extend({
+ prop: function( name, value ) {
+ return access( this, jQuery.prop, name, value, arguments.length > 1 );
+ },
+
+ removeProp: function( name ) {
+ return this.each(function() {
+ delete this[ jQuery.propFix[ name ] || name ];
+ });
+ }
+});
+
+jQuery.extend({
+ propFix: {
+ "for": "htmlFor",
+ "class": "className"
+ },
+
+ prop: function( elem, name, value ) {
+ var ret, hooks, notxml,
+ nType = elem.nodeType;
+
+ // Don't get/set properties on text, comment and attribute nodes
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+ return;
+ }
+
+ notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
+
+ if ( notxml ) {
+ // Fix name and attach hooks
+ name = jQuery.propFix[ name ] || name;
+ hooks = jQuery.propHooks[ name ];
+ }
+
+ if ( value !== undefined ) {
+ return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?
+ ret :
+ ( elem[ name ] = value );
+
+ } else {
+ return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?
+ ret :
+ elem[ name ];
+ }
+ },
+
+ propHooks: {
+ tabIndex: {
+ get: function( elem ) {
+ return elem.hasAttribute( "tabindex" ) || rfocusable.test( elem.nodeName ) || elem.href ?
+ elem.tabIndex :
+ -1;
+ }
+ }
+ }
+});
+
+if ( !support.optSelected ) {
+ jQuery.propHooks.selected = {
+ get: function( elem ) {
+ var parent = elem.parentNode;
+ if ( parent && parent.parentNode ) {
+ parent.parentNode.selectedIndex;
+ }
+ return null;
+ }
+ };
+}
+
+jQuery.each([
+ "tabIndex",
+ "readOnly",
+ "maxLength",
+ "cellSpacing",
+ "cellPadding",
+ "rowSpan",
+ "colSpan",
+ "useMap",
+ "frameBorder",
+ "contentEditable"
+], function() {
+ jQuery.propFix[ this.toLowerCase() ] = this;
+});
+
+
+
+
+var rclass = /[\t\r\n\f]/g;
+
+jQuery.fn.extend({
+ addClass: function( value ) {
+ var classes, elem, cur, clazz, j, finalValue,
+ proceed = typeof value === "string" && value,
+ i = 0,
+ len = this.length;
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( j ) {
+ jQuery( this ).addClass( value.call( this, j, this.className ) );
+ });
+ }
+
+ if ( proceed ) {
+ // The disjunction here is for better compressibility (see removeClass)
+ classes = ( value || "" ).match( rnotwhite ) || [];
+
+ for ( ; i < len; i++ ) {
+ elem = this[ i ];
+ cur = elem.nodeType === 1 && ( elem.className ?
+ ( " " + elem.className + " " ).replace( rclass, " " ) :
+ " "
+ );
+
+ if ( cur ) {
+ j = 0;
+ while ( (clazz = classes[j++]) ) {
+ if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
+ cur += clazz + " ";
+ }
+ }
+
+ // only assign if different to avoid unneeded rendering.
+ finalValue = jQuery.trim( cur );
+ if ( elem.className !== finalValue ) {
+ elem.className = finalValue;
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ removeClass: function( value ) {
+ var classes, elem, cur, clazz, j, finalValue,
+ proceed = arguments.length === 0 || typeof value === "string" && value,
+ i = 0,
+ len = this.length;
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( j ) {
+ jQuery( this ).removeClass( value.call( this, j, this.className ) );
+ });
+ }
+ if ( proceed ) {
+ classes = ( value || "" ).match( rnotwhite ) || [];
+
+ for ( ; i < len; i++ ) {
+ elem = this[ i ];
+ // This expression is here for better compressibility (see addClass)
+ cur = elem.nodeType === 1 && ( elem.className ?
+ ( " " + elem.className + " " ).replace( rclass, " " ) :
+ ""
+ );
+
+ if ( cur ) {
+ j = 0;
+ while ( (clazz = classes[j++]) ) {
+ // Remove *all* instances
+ while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
+ cur = cur.replace( " " + clazz + " ", " " );
+ }
+ }
+
+ // Only assign if different to avoid unneeded rendering.
+ finalValue = value ? jQuery.trim( cur ) : "";
+ if ( elem.className !== finalValue ) {
+ elem.className = finalValue;
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ toggleClass: function( value, stateVal ) {
+ var type = typeof value;
+
+ if ( typeof stateVal === "boolean" && type === "string" ) {
+ return stateVal ? this.addClass( value ) : this.removeClass( value );
+ }
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( i ) {
+ jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
+ });
+ }
+
+ return this.each(function() {
+ if ( type === "string" ) {
+ // Toggle individual class names
+ var className,
+ i = 0,
+ self = jQuery( this ),
+ classNames = value.match( rnotwhite ) || [];
+
+ while ( (className = classNames[ i++ ]) ) {
+ // Check each className given, space separated list
+ if ( self.hasClass( className ) ) {
+ self.removeClass( className );
+ } else {
+ self.addClass( className );
+ }
+ }
+
+ // Toggle whole class name
+ } else if ( type === strundefined || type === "boolean" ) {
+ if ( this.className ) {
+ // store className if set
+ data_priv.set( this, "__className__", this.className );
+ }
+
+ // If the element has a class name or if we're passed `false`,
+ // then remove the whole classname (if there was one, the above saved it).
+ // Otherwise bring back whatever was previously saved (if anything),
+ // falling back to the empty string if nothing was stored.
+ this.className = this.className || value === false ? "" : data_priv.get( this, "__className__" ) || "";
+ }
+ });
+ },
+
+ hasClass: function( selector ) {
+ var className = " " + selector + " ",
+ i = 0,
+ l = this.length;
+ for ( ; i < l; i++ ) {
+ if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+});
+
+
+
+
+var rreturn = /\r/g;
+
+jQuery.fn.extend({
+ val: function( value ) {
+ var hooks, ret, isFunction,
+ elem = this[0];
+
+ if ( !arguments.length ) {
+ if ( elem ) {
+ hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
+
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
+ return ret;
+ }
+
+ ret = elem.value;
+
+ return typeof ret === "string" ?
+ // Handle most common string cases
+ ret.replace(rreturn, "") :
+ // Handle cases where value is null/undef or number
+ ret == null ? "" : ret;
+ }
+
+ return;
+ }
+
+ isFunction = jQuery.isFunction( value );
+
+ return this.each(function( i ) {
+ var val;
+
+ if ( this.nodeType !== 1 ) {
+ return;
+ }
+
+ if ( isFunction ) {
+ val = value.call( this, i, jQuery( this ).val() );
+ } else {
+ val = value;
+ }
+
+ // Treat null/undefined as ""; convert numbers to string
+ if ( val == null ) {
+ val = "";
+
+ } else if ( typeof val === "number" ) {
+ val += "";
+
+ } else if ( jQuery.isArray( val ) ) {
+ val = jQuery.map( val, function( value ) {
+ return value == null ? "" : value + "";
+ });
+ }
+
+ hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
+
+ // If set returns undefined, fall back to normal setting
+ if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
+ this.value = val;
+ }
+ });
+ }
+});
+
+jQuery.extend({
+ valHooks: {
+ option: {
+ get: function( elem ) {
+ var val = jQuery.find.attr( elem, "value" );
+ return val != null ?
+ val :
+ // Support: IE10-11+
+ // option.text throws exceptions (#14686, #14858)
+ jQuery.trim( jQuery.text( elem ) );
+ }
+ },
+ select: {
+ get: function( elem ) {
+ var value, option,
+ options = elem.options,
+ index = elem.selectedIndex,
+ one = elem.type === "select-one" || index < 0,
+ values = one ? null : [],
+ max = one ? index + 1 : options.length,
+ i = index < 0 ?
+ max :
+ one ? index : 0;
+
+ // Loop through all the selected options
+ for ( ; i < max; i++ ) {
+ option = options[ i ];
+
+ // IE6-9 doesn't update selected after form reset (#2551)
+ if ( ( option.selected || i === index ) &&
+ // Don't return options that are disabled or in a disabled optgroup
+ ( support.optDisabled ? !option.disabled : option.getAttribute( "disabled" ) === null ) &&
+ ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
+
+ // Get the specific value for the option
+ value = jQuery( option ).val();
+
+ // We don't need an array for one selects
+ if ( one ) {
+ return value;
+ }
+
+ // Multi-Selects return an array
+ values.push( value );
+ }
+ }
+
+ return values;
+ },
+
+ set: function( elem, value ) {
+ var optionSet, option,
+ options = elem.options,
+ values = jQuery.makeArray( value ),
+ i = options.length;
+
+ while ( i-- ) {
+ option = options[ i ];
+ if ( (option.selected = jQuery.inArray( option.value, values ) >= 0) ) {
+ optionSet = true;
+ }
+ }
+
+ // Force browsers to behave consistently when non-matching value is set
+ if ( !optionSet ) {
+ elem.selectedIndex = -1;
+ }
+ return values;
+ }
+ }
+ }
+});
+
+// Radios and checkboxes getter/setter
+jQuery.each([ "radio", "checkbox" ], function() {
+ jQuery.valHooks[ this ] = {
+ set: function( elem, value ) {
+ if ( jQuery.isArray( value ) ) {
+ return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
+ }
+ }
+ };
+ if ( !support.checkOn ) {
+ jQuery.valHooks[ this ].get = function( elem ) {
+ return elem.getAttribute("value") === null ? "on" : elem.value;
+ };
+ }
+});
+
+
+
+
+// Return jQuery for attributes-only inclusion
+
+
+jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
+ "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
+ "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
+
+ // Handle event binding
+ jQuery.fn[ name ] = function( data, fn ) {
+ return arguments.length > 0 ?
+ this.on( name, null, data, fn ) :
+ this.trigger( name );
+ };
+});
+
+jQuery.fn.extend({
+ hover: function( fnOver, fnOut ) {
+ return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
+ },
+
+ bind: function( types, data, fn ) {
+ return this.on( types, null, data, fn );
+ },
+ unbind: function( types, fn ) {
+ return this.off( types, null, fn );
+ },
+
+ delegate: function( selector, types, data, fn ) {
+ return this.on( types, selector, data, fn );
+ },
+ undelegate: function( selector, types, fn ) {
+ // ( namespace ) or ( selector, types [, fn] )
+ return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
+ }
+});
+
+
+var nonce = jQuery.now();
+
+var rquery = (/\?/);
+
+
+
+// Support: Android 2.3
+// Workaround failure to string-cast null input
+jQuery.parseJSON = function( data ) {
+ return JSON.parse( data + "" );
+};
+
+
+// Cross-browser xml parsing
+jQuery.parseXML = function( data ) {
+ var xml, tmp;
+ if ( !data || typeof data !== "string" ) {
+ return null;
+ }
+
+ // Support: IE9
+ try {
+ tmp = new DOMParser();
+ xml = tmp.parseFromString( data, "text/xml" );
+ } catch ( e ) {
+ xml = undefined;
+ }
+
+ if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
+ jQuery.error( "Invalid XML: " + data );
+ }
+ return xml;
+};
+
+
+var
+ rhash = /#.*$/,
+ rts = /([?&])_=[^&]*/,
+ rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
+ // #7653, #8125, #8152: local protocol detection
+ rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
+ rnoContent = /^(?:GET|HEAD)$/,
+ rprotocol = /^\/\//,
+ rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
+
+ /* Prefilters
+ * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
+ * 2) These are called:
+ * - BEFORE asking for a transport
+ * - AFTER param serialization (s.data is a string if s.processData is true)
+ * 3) key is the dataType
+ * 4) the catchall symbol "*" can be used
+ * 5) execution will start with transport dataType and THEN continue down to "*" if needed
+ */
+ prefilters = {},
+
+ /* Transports bindings
+ * 1) key is the dataType
+ * 2) the catchall symbol "*" can be used
+ * 3) selection will start with transport dataType and THEN go to "*" if needed
+ */
+ transports = {},
+
+ // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
+ allTypes = "*/".concat( "*" ),
+
+ // Document location
+ ajaxLocation = window.location.href,
+
+ // Segment location into parts
+ ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
+
+// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
+function addToPrefiltersOrTransports( structure ) {
+
+ // dataTypeExpression is optional and defaults to "*"
+ return function( dataTypeExpression, func ) {
+
+ if ( typeof dataTypeExpression !== "string" ) {
+ func = dataTypeExpression;
+ dataTypeExpression = "*";
+ }
+
+ var dataType,
+ i = 0,
+ dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];
+
+ if ( jQuery.isFunction( func ) ) {
+ // For each dataType in the dataTypeExpression
+ while ( (dataType = dataTypes[i++]) ) {
+ // Prepend if requested
+ if ( dataType[0] === "+" ) {
+ dataType = dataType.slice( 1 ) || "*";
+ (structure[ dataType ] = structure[ dataType ] || []).unshift( func );
+
+ // Otherwise append
+ } else {
+ (structure[ dataType ] = structure[ dataType ] || []).push( func );
+ }
+ }
+ }
+ };
+}
+
+// Base inspection function for prefilters and transports
+function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
+
+ var inspected = {},
+ seekingTransport = ( structure === transports );
+
+ function inspect( dataType ) {
+ var selected;
+ inspected[ dataType ] = true;
+ jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
+ var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
+ if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
+ options.dataTypes.unshift( dataTypeOrTransport );
+ inspect( dataTypeOrTransport );
+ return false;
+ } else if ( seekingTransport ) {
+ return !( selected = dataTypeOrTransport );
+ }
+ });
+ return selected;
+ }
+
+ return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
+}
+
+// A special extend for ajax options
+// that takes "flat" options (not to be deep extended)
+// Fixes #9887
+function ajaxExtend( target, src ) {
+ var key, deep,
+ flatOptions = jQuery.ajaxSettings.flatOptions || {};
+
+ for ( key in src ) {
+ if ( src[ key ] !== undefined ) {
+ ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
+ }
+ }
+ if ( deep ) {
+ jQuery.extend( true, target, deep );
+ }
+
+ return target;
+}
+
+/* Handles responses to an ajax request:
+ * - finds the right dataType (mediates between content-type and expected dataType)
+ * - returns the corresponding response
+ */
+function ajaxHandleResponses( s, jqXHR, responses ) {
+
+ var ct, type, finalDataType, firstDataType,
+ contents = s.contents,
+ dataTypes = s.dataTypes;
+
+ // Remove auto dataType and get content-type in the process
+ while ( dataTypes[ 0 ] === "*" ) {
+ dataTypes.shift();
+ if ( ct === undefined ) {
+ ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
+ }
+ }
+
+ // Check if we're dealing with a known content-type
+ if ( ct ) {
+ for ( type in contents ) {
+ if ( contents[ type ] && contents[ type ].test( ct ) ) {
+ dataTypes.unshift( type );
+ break;
+ }
+ }
+ }
+
+ // Check to see if we have a response for the expected dataType
+ if ( dataTypes[ 0 ] in responses ) {
+ finalDataType = dataTypes[ 0 ];
+ } else {
+ // Try convertible dataTypes
+ for ( type in responses ) {
+ if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
+ finalDataType = type;
+ break;
+ }
+ if ( !firstDataType ) {
+ firstDataType = type;
+ }
+ }
+ // Or just use first one
+ finalDataType = finalDataType || firstDataType;
+ }
+
+ // If we found a dataType
+ // We add the dataType to the list if needed
+ // and return the corresponding response
+ if ( finalDataType ) {
+ if ( finalDataType !== dataTypes[ 0 ] ) {
+ dataTypes.unshift( finalDataType );
+ }
+ return responses[ finalDataType ];
+ }
+}
+
+/* Chain conversions given the request and the original response
+ * Also sets the responseXXX fields on the jqXHR instance
+ */
+function ajaxConvert( s, response, jqXHR, isSuccess ) {
+ var conv2, current, conv, tmp, prev,
+ converters = {},
+ // Work with a copy of dataTypes in case we need to modify it for conversion
+ dataTypes = s.dataTypes.slice();
+
+ // Create converters map with lowercased keys
+ if ( dataTypes[ 1 ] ) {
+ for ( conv in s.converters ) {
+ converters[ conv.toLowerCase() ] = s.converters[ conv ];
+ }
+ }
+
+ current = dataTypes.shift();
+
+ // Convert to each sequential dataType
+ while ( current ) {
+
+ if ( s.responseFields[ current ] ) {
+ jqXHR[ s.responseFields[ current ] ] = response;
+ }
+
+ // Apply the dataFilter if provided
+ if ( !prev && isSuccess && s.dataFilter ) {
+ response = s.dataFilter( response, s.dataType );
+ }
+
+ prev = current;
+ current = dataTypes.shift();
+
+ if ( current ) {
+
+ // There's only work to do if current dataType is non-auto
+ if ( current === "*" ) {
+
+ current = prev;
+
+ // Convert response if prev dataType is non-auto and differs from current
+ } else if ( prev !== "*" && prev !== current ) {
+
+ // Seek a direct converter
+ conv = converters[ prev + " " + current ] || converters[ "* " + current ];
+
+ // If none found, seek a pair
+ if ( !conv ) {
+ for ( conv2 in converters ) {
+
+ // If conv2 outputs current
+ tmp = conv2.split( " " );
+ if ( tmp[ 1 ] === current ) {
+
+ // If prev can be converted to accepted input
+ conv = converters[ prev + " " + tmp[ 0 ] ] ||
+ converters[ "* " + tmp[ 0 ] ];
+ if ( conv ) {
+ // Condense equivalence converters
+ if ( conv === true ) {
+ conv = converters[ conv2 ];
+
+ // Otherwise, insert the intermediate dataType
+ } else if ( converters[ conv2 ] !== true ) {
+ current = tmp[ 0 ];
+ dataTypes.unshift( tmp[ 1 ] );
+ }
+ break;
+ }
+ }
+ }
+ }
+
+ // Apply converter (if not an equivalence)
+ if ( conv !== true ) {
+
+ // Unless errors are allowed to bubble, catch and return them
+ if ( conv && s[ "throws" ] ) {
+ response = conv( response );
+ } else {
+ try {
+ response = conv( response );
+ } catch ( e ) {
+ return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return { state: "success", data: response };
+}
+
+jQuery.extend({
+
+ // Counter for holding the number of active queries
+ active: 0,
+
+ // Last-Modified header cache for next request
+ lastModified: {},
+ etag: {},
+
+ ajaxSettings: {
+ url: ajaxLocation,
+ type: "GET",
+ isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
+ global: true,
+ processData: true,
+ async: true,
+ contentType: "application/x-www-form-urlencoded; charset=UTF-8",
+ /*
+ timeout: 0,
+ data: null,
+ dataType: null,
+ username: null,
+ password: null,
+ cache: null,
+ throws: false,
+ traditional: false,
+ headers: {},
+ */
+
+ accepts: {
+ "*": allTypes,
+ text: "text/plain",
+ html: "text/html",
+ xml: "application/xml, text/xml",
+ json: "application/json, text/javascript"
+ },
+
+ contents: {
+ xml: /xml/,
+ html: /html/,
+ json: /json/
+ },
+
+ responseFields: {
+ xml: "responseXML",
+ text: "responseText",
+ json: "responseJSON"
+ },
+
+ // Data converters
+ // Keys separate source (or catchall "*") and destination types with a single space
+ converters: {
+
+ // Convert anything to text
+ "* text": String,
+
+ // Text to html (true = no transformation)
+ "text html": true,
+
+ // Evaluate text as a json expression
+ "text json": jQuery.parseJSON,
+
+ // Parse text as xml
+ "text xml": jQuery.parseXML
+ },
+
+ // For options that shouldn't be deep extended:
+ // you can add your own custom options here if
+ // and when you create one that shouldn't be
+ // deep extended (see ajaxExtend)
+ flatOptions: {
+ url: true,
+ context: true
+ }
+ },
+
+ // Creates a full fledged settings object into target
+ // with both ajaxSettings and settings fields.
+ // If target is omitted, writes into ajaxSettings.
+ ajaxSetup: function( target, settings ) {
+ return settings ?
+
+ // Building a settings object
+ ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
+
+ // Extending ajaxSettings
+ ajaxExtend( jQuery.ajaxSettings, target );
+ },
+
+ ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
+ ajaxTransport: addToPrefiltersOrTransports( transports ),
+
+ // Main method
+ ajax: function( url, options ) {
+
+ // If url is an object, simulate pre-1.5 signature
+ if ( typeof url === "object" ) {
+ options = url;
+ url = undefined;
+ }
+
+ // Force options to be an object
+ options = options || {};
+
+ var transport,
+ // URL without anti-cache param
+ cacheURL,
+ // Response headers
+ responseHeadersString,
+ responseHeaders,
+ // timeout handle
+ timeoutTimer,
+ // Cross-domain detection vars
+ parts,
+ // To know if global events are to be dispatched
+ fireGlobals,
+ // Loop variable
+ i,
+ // Create the final options object
+ s = jQuery.ajaxSetup( {}, options ),
+ // Callbacks context
+ callbackContext = s.context || s,
+ // Context for global events is callbackContext if it is a DOM node or jQuery collection
+ globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
+ jQuery( callbackContext ) :
+ jQuery.event,
+ // Deferreds
+ deferred = jQuery.Deferred(),
+ completeDeferred = jQuery.Callbacks("once memory"),
+ // Status-dependent callbacks
+ statusCode = s.statusCode || {},
+ // Headers (they are sent all at once)
+ requestHeaders = {},
+ requestHeadersNames = {},
+ // The jqXHR state
+ state = 0,
+ // Default abort message
+ strAbort = "canceled",
+ // Fake xhr
+ jqXHR = {
+ readyState: 0,
+
+ // Builds headers hashtable if needed
+ getResponseHeader: function( key ) {
+ var match;
+ if ( state === 2 ) {
+ if ( !responseHeaders ) {
+ responseHeaders = {};
+ while ( (match = rheaders.exec( responseHeadersString )) ) {
+ responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
+ }
+ }
+ match = responseHeaders[ key.toLowerCase() ];
+ }
+ return match == null ? null : match;
+ },
+
+ // Raw string
+ getAllResponseHeaders: function() {
+ return state === 2 ? responseHeadersString : null;
+ },
+
+ // Caches the header
+ setRequestHeader: function( name, value ) {
+ var lname = name.toLowerCase();
+ if ( !state ) {
+ name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
+ requestHeaders[ name ] = value;
+ }
+ return this;
+ },
+
+ // Overrides response content-type header
+ overrideMimeType: function( type ) {
+ if ( !state ) {
+ s.mimeType = type;
+ }
+ return this;
+ },
+
+ // Status-dependent callbacks
+ statusCode: function( map ) {
+ var code;
+ if ( map ) {
+ if ( state < 2 ) {
+ for ( code in map ) {
+ // Lazy-add the new callback in a way that preserves old ones
+ statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
+ }
+ } else {
+ // Execute the appropriate callbacks
+ jqXHR.always( map[ jqXHR.status ] );
+ }
+ }
+ return this;
+ },
+
+ // Cancel the request
+ abort: function( statusText ) {
+ var finalText = statusText || strAbort;
+ if ( transport ) {
+ transport.abort( finalText );
+ }
+ done( 0, finalText );
+ return this;
+ }
+ };
+
+ // Attach deferreds
+ deferred.promise( jqXHR ).complete = completeDeferred.add;
+ jqXHR.success = jqXHR.done;
+ jqXHR.error = jqXHR.fail;
+
+ // Remove hash character (#7531: and string promotion)
+ // Add protocol if not provided (prefilters might expect it)
+ // Handle falsy url in the settings object (#10093: consistency with old signature)
+ // We also use the url parameter if available
+ s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" )
+ .replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
+
+ // Alias method option to type as per ticket #12004
+ s.type = options.method || options.type || s.method || s.type;
+
+ // Extract dataTypes list
+ s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
+
+ // A cross-domain request is in order when we have a protocol:host:port mismatch
+ if ( s.crossDomain == null ) {
+ parts = rurl.exec( s.url.toLowerCase() );
+ s.crossDomain = !!( parts &&
+ ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
+ ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
+ ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
+ );
+ }
+
+ // Convert data if not already a string
+ if ( s.data && s.processData && typeof s.data !== "string" ) {
+ s.data = jQuery.param( s.data, s.traditional );
+ }
+
+ // Apply prefilters
+ inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
+
+ // If request was aborted inside a prefilter, stop there
+ if ( state === 2 ) {
+ return jqXHR;
+ }
+
+ // We can fire global events as of now if asked to
+ // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
+ fireGlobals = jQuery.event && s.global;
+
+ // Watch for a new set of requests
+ if ( fireGlobals && jQuery.active++ === 0 ) {
+ jQuery.event.trigger("ajaxStart");
+ }
+
+ // Uppercase the type
+ s.type = s.type.toUpperCase();
+
+ // Determine if request has content
+ s.hasContent = !rnoContent.test( s.type );
+
+ // Save the URL in case we're toying with the If-Modified-Since
+ // and/or If-None-Match header later on
+ cacheURL = s.url;
+
+ // More options handling for requests with no content
+ if ( !s.hasContent ) {
+
+ // If data is available, append data to url
+ if ( s.data ) {
+ cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
+ // #9682: remove data so that it's not used in an eventual retry
+ delete s.data;
+ }
+
+ // Add anti-cache in url if needed
+ if ( s.cache === false ) {
+ s.url = rts.test( cacheURL ) ?
+
+ // If there is already a '_' parameter, set its value
+ cacheURL.replace( rts, "$1_=" + nonce++ ) :
+
+ // Otherwise add one to the end
+ cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++;
+ }
+ }
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+ if ( jQuery.lastModified[ cacheURL ] ) {
+ jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
+ }
+ if ( jQuery.etag[ cacheURL ] ) {
+ jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
+ }
+ }
+
+ // Set the correct header, if data is being sent
+ if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
+ jqXHR.setRequestHeader( "Content-Type", s.contentType );
+ }
+
+ // Set the Accepts header for the server, depending on the dataType
+ jqXHR.setRequestHeader(
+ "Accept",
+ s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
+ s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
+ s.accepts[ "*" ]
+ );
+
+ // Check for headers option
+ for ( i in s.headers ) {
+ jqXHR.setRequestHeader( i, s.headers[ i ] );
+ }
+
+ // Allow custom headers/mimetypes and early abort
+ if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
+ // Abort if not done already and return
+ return jqXHR.abort();
+ }
+
+ // Aborting is no longer a cancellation
+ strAbort = "abort";
+
+ // Install callbacks on deferreds
+ for ( i in { success: 1, error: 1, complete: 1 } ) {
+ jqXHR[ i ]( s[ i ] );
+ }
+
+ // Get transport
+ transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
+
+ // If no transport, we auto-abort
+ if ( !transport ) {
+ done( -1, "No Transport" );
+ } else {
+ jqXHR.readyState = 1;
+
+ // Send global event
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
+ }
+ // Timeout
+ if ( s.async && s.timeout > 0 ) {
+ timeoutTimer = setTimeout(function() {
+ jqXHR.abort("timeout");
+ }, s.timeout );
+ }
+
+ try {
+ state = 1;
+ transport.send( requestHeaders, done );
+ } catch ( e ) {
+ // Propagate exception as error if not done
+ if ( state < 2 ) {
+ done( -1, e );
+ // Simply rethrow otherwise
+ } else {
+ throw e;
+ }
+ }
+ }
+
+ // Callback for when everything is done
+ function done( status, nativeStatusText, responses, headers ) {
+ var isSuccess, success, error, response, modified,
+ statusText = nativeStatusText;
+
+ // Called once
+ if ( state === 2 ) {
+ return;
+ }
+
+ // State is "done" now
+ state = 2;
+
+ // Clear timeout if it exists
+ if ( timeoutTimer ) {
+ clearTimeout( timeoutTimer );
+ }
+
+ // Dereference transport for early garbage collection
+ // (no matter how long the jqXHR object will be used)
+ transport = undefined;
+
+ // Cache response headers
+ responseHeadersString = headers || "";
+
+ // Set readyState
+ jqXHR.readyState = status > 0 ? 4 : 0;
+
+ // Determine if successful
+ isSuccess = status >= 200 && status < 300 || status === 304;
+
+ // Get response data
+ if ( responses ) {
+ response = ajaxHandleResponses( s, jqXHR, responses );
+ }
+
+ // Convert no matter what (that way responseXXX fields are always set)
+ response = ajaxConvert( s, response, jqXHR, isSuccess );
+
+ // If successful, handle type chaining
+ if ( isSuccess ) {
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+ modified = jqXHR.getResponseHeader("Last-Modified");
+ if ( modified ) {
+ jQuery.lastModified[ cacheURL ] = modified;
+ }
+ modified = jqXHR.getResponseHeader("etag");
+ if ( modified ) {
+ jQuery.etag[ cacheURL ] = modified;
+ }
+ }
+
+ // if no content
+ if ( status === 204 || s.type === "HEAD" ) {
+ statusText = "nocontent";
+
+ // if not modified
+ } else if ( status === 304 ) {
+ statusText = "notmodified";
+
+ // If we have data, let's convert it
+ } else {
+ statusText = response.state;
+ success = response.data;
+ error = response.error;
+ isSuccess = !error;
+ }
+ } else {
+ // Extract error from statusText and normalize for non-aborts
+ error = statusText;
+ if ( status || !statusText ) {
+ statusText = "error";
+ if ( status < 0 ) {
+ status = 0;
+ }
+ }
+ }
+
+ // Set data for the fake xhr object
+ jqXHR.status = status;
+ jqXHR.statusText = ( nativeStatusText || statusText ) + "";
+
+ // Success/Error
+ if ( isSuccess ) {
+ deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
+ } else {
+ deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
+ }
+
+ // Status-dependent callbacks
+ jqXHR.statusCode( statusCode );
+ statusCode = undefined;
+
+ if ( fireGlobals ) {
+ globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
+ [ jqXHR, s, isSuccess ? success : error ] );
+ }
+
+ // Complete
+ completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
+
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
+ // Handle the global AJAX counter
+ if ( !( --jQuery.active ) ) {
+ jQuery.event.trigger("ajaxStop");
+ }
+ }
+ }
+
+ return jqXHR;
+ },
+
+ getJSON: function( url, data, callback ) {
+ return jQuery.get( url, data, callback, "json" );
+ },
+
+ getScript: function( url, callback ) {
+ return jQuery.get( url, undefined, callback, "script" );
+ }
+});
+
+jQuery.each( [ "get", "post" ], function( i, method ) {
+ jQuery[ method ] = function( url, data, callback, type ) {
+ // Shift arguments if data argument was omitted
+ if ( jQuery.isFunction( data ) ) {
+ type = type || callback;
+ callback = data;
+ data = undefined;
+ }
+
+ return jQuery.ajax({
+ url: url,
+ type: method,
+ dataType: type,
+ data: data,
+ success: callback
+ });
+ };
+});
+
+
+jQuery._evalUrl = function( url ) {
+ return jQuery.ajax({
+ url: url,
+ type: "GET",
+ dataType: "script",
+ async: false,
+ global: false,
+ "throws": true
+ });
+};
+
+
+jQuery.fn.extend({
+ wrapAll: function( html ) {
+ var wrap;
+
+ if ( jQuery.isFunction( html ) ) {
+ return this.each(function( i ) {
+ jQuery( this ).wrapAll( html.call(this, i) );
+ });
+ }
+
+ if ( this[ 0 ] ) {
+
+ // The elements to wrap the target around
+ wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
+
+ if ( this[ 0 ].parentNode ) {
+ wrap.insertBefore( this[ 0 ] );
+ }
+
+ wrap.map(function() {
+ var elem = this;
+
+ while ( elem.firstElementChild ) {
+ elem = elem.firstElementChild;
+ }
+
+ return elem;
+ }).append( this );
+ }
+
+ return this;
+ },
+
+ wrapInner: function( html ) {
+ if ( jQuery.isFunction( html ) ) {
+ return this.each(function( i ) {
+ jQuery( this ).wrapInner( html.call(this, i) );
+ });
+ }
+
+ return this.each(function() {
+ var self = jQuery( this ),
+ contents = self.contents();
+
+ if ( contents.length ) {
+ contents.wrapAll( html );
+
+ } else {
+ self.append( html );
+ }
+ });
+ },
+
+ wrap: function( html ) {
+ var isFunction = jQuery.isFunction( html );
+
+ return this.each(function( i ) {
+ jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
+ });
+ },
+
+ unwrap: function() {
+ return this.parent().each(function() {
+ if ( !jQuery.nodeName( this, "body" ) ) {
+ jQuery( this ).replaceWith( this.childNodes );
+ }
+ }).end();
+ }
+});
+
+
+jQuery.expr.filters.hidden = function( elem ) {
+ // Support: Opera <= 12.12
+ // Opera reports offsetWidths and offsetHeights less than zero on some elements
+ return elem.offsetWidth <= 0 && elem.offsetHeight <= 0;
+};
+jQuery.expr.filters.visible = function( elem ) {
+ return !jQuery.expr.filters.hidden( elem );
+};
+
+
+
+
+var r20 = /%20/g,
+ rbracket = /\[\]$/,
+ rCRLF = /\r?\n/g,
+ rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
+ rsubmittable = /^(?:input|select|textarea|keygen)/i;
+
+function buildParams( prefix, obj, traditional, add ) {
+ var name;
+
+ if ( jQuery.isArray( obj ) ) {
+ // Serialize array item.
+ jQuery.each( obj, function( i, v ) {
+ if ( traditional || rbracket.test( prefix ) ) {
+ // Treat each array item as a scalar.
+ add( prefix, v );
+
+ } else {
+ // Item is non-scalar (array or object), encode its numeric index.
+ buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
+ }
+ });
+
+ } else if ( !traditional && jQuery.type( obj ) === "object" ) {
+ // Serialize object item.
+ for ( name in obj ) {
+ buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
+ }
+
+ } else {
+ // Serialize scalar item.
+ add( prefix, obj );
+ }
+}
+
+// Serialize an array of form elements or a set of
+// key/values into a query string
+jQuery.param = function( a, traditional ) {
+ var prefix,
+ s = [],
+ add = function( key, value ) {
+ // If value is a function, invoke it and return its value
+ value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
+ s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
+ };
+
+ // Set traditional to true for jQuery <= 1.3.2 behavior.
+ if ( traditional === undefined ) {
+ traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
+ }
+
+ // If an array was passed in, assume that it is an array of form elements.
+ if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
+ // Serialize the form elements
+ jQuery.each( a, function() {
+ add( this.name, this.value );
+ });
+
+ } else {
+ // If traditional, encode the "old" way (the way 1.3.2 or older
+ // did it), otherwise encode params recursively.
+ for ( prefix in a ) {
+ buildParams( prefix, a[ prefix ], traditional, add );
+ }
+ }
+
+ // Return the resulting serialization
+ return s.join( "&" ).replace( r20, "+" );
+};
+
+jQuery.fn.extend({
+ serialize: function() {
+ return jQuery.param( this.serializeArray() );
+ },
+ serializeArray: function() {
+ return this.map(function() {
+ // Can add propHook for "elements" to filter or add form elements
+ var elements = jQuery.prop( this, "elements" );
+ return elements ? jQuery.makeArray( elements ) : this;
+ })
+ .filter(function() {
+ var type = this.type;
+
+ // Use .is( ":disabled" ) so that fieldset[disabled] works
+ return this.name && !jQuery( this ).is( ":disabled" ) &&
+ rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
+ ( this.checked || !rcheckableType.test( type ) );
+ })
+ .map(function( i, elem ) {
+ var val = jQuery( this ).val();
+
+ return val == null ?
+ null :
+ jQuery.isArray( val ) ?
+ jQuery.map( val, function( val ) {
+ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+ }) :
+ { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+ }).get();
+ }
+});
+
+
+jQuery.ajaxSettings.xhr = function() {
+ try {
+ return new XMLHttpRequest();
+ } catch( e ) {}
+};
+
+var xhrId = 0,
+ xhrCallbacks = {},
+ xhrSuccessStatus = {
+ // file protocol always yields status code 0, assume 200
+ 0: 200,
+ // Support: IE9
+ // #1450: sometimes IE returns 1223 when it should be 204
+ 1223: 204
+ },
+ xhrSupported = jQuery.ajaxSettings.xhr();
+
+// Support: IE9
+// Open requests must be manually aborted on unload (#5280)
+// See https://support.microsoft.com/kb/2856746 for more info
+if ( window.attachEvent ) {
+ window.attachEvent( "onunload", function() {
+ for ( var key in xhrCallbacks ) {
+ xhrCallbacks[ key ]();
+ }
+ });
+}
+
+support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
+support.ajax = xhrSupported = !!xhrSupported;
+
+jQuery.ajaxTransport(function( options ) {
+ var callback;
+
+ // Cross domain only allowed if supported through XMLHttpRequest
+ if ( support.cors || xhrSupported && !options.crossDomain ) {
+ return {
+ send: function( headers, complete ) {
+ var i,
+ xhr = options.xhr(),
+ id = ++xhrId;
+
+ xhr.open( options.type, options.url, options.async, options.username, options.password );
+
+ // Apply custom fields if provided
+ if ( options.xhrFields ) {
+ for ( i in options.xhrFields ) {
+ xhr[ i ] = options.xhrFields[ i ];
+ }
+ }
+
+ // Override mime type if needed
+ if ( options.mimeType && xhr.overrideMimeType ) {
+ xhr.overrideMimeType( options.mimeType );
+ }
+
+ // X-Requested-With header
+ // For cross-domain requests, seeing as conditions for a preflight are
+ // akin to a jigsaw puzzle, we simply never set it to be sure.
+ // (it can always be set on a per-request basis or even using ajaxSetup)
+ // For same-domain requests, won't change header if already provided.
+ if ( !options.crossDomain && !headers["X-Requested-With"] ) {
+ headers["X-Requested-With"] = "XMLHttpRequest";
+ }
+
+ // Set headers
+ for ( i in headers ) {
+ xhr.setRequestHeader( i, headers[ i ] );
+ }
+
+ // Callback
+ callback = function( type ) {
+ return function() {
+ if ( callback ) {
+ delete xhrCallbacks[ id ];
+ callback = xhr.onload = xhr.onerror = null;
+
+ if ( type === "abort" ) {
+ xhr.abort();
+ } else if ( type === "error" ) {
+ complete(
+ // file: protocol always yields status 0; see #8605, #14207
+ xhr.status,
+ xhr.statusText
+ );
+ } else {
+ complete(
+ xhrSuccessStatus[ xhr.status ] || xhr.status,
+ xhr.statusText,
+ // Support: IE9
+ // Accessing binary-data responseText throws an exception
+ // (#11426)
+ typeof xhr.responseText === "string" ? {
+ text: xhr.responseText
+ } : undefined,
+ xhr.getAllResponseHeaders()
+ );
+ }
+ }
+ };
+ };
+
+ // Listen to events
+ xhr.onload = callback();
+ xhr.onerror = callback("error");
+
+ // Create the abort callback
+ callback = xhrCallbacks[ id ] = callback("abort");
+
+ try {
+ // Do send the request (this may raise an exception)
+ xhr.send( options.hasContent && options.data || null );
+ } catch ( e ) {
+ // #14683: Only rethrow if this hasn't been notified as an error yet
+ if ( callback ) {
+ throw e;
+ }
+ }
+ },
+
+ abort: function() {
+ if ( callback ) {
+ callback();
+ }
+ }
+ };
+ }
+});
+
+
+
+
+// Install script dataType
+jQuery.ajaxSetup({
+ accepts: {
+ script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
+ },
+ contents: {
+ script: /(?:java|ecma)script/
+ },
+ converters: {
+ "text script": function( text ) {
+ jQuery.globalEval( text );
+ return text;
+ }
+ }
+});
+
+// Handle cache's special case and crossDomain
+jQuery.ajaxPrefilter( "script", function( s ) {
+ if ( s.cache === undefined ) {
+ s.cache = false;
+ }
+ if ( s.crossDomain ) {
+ s.type = "GET";
+ }
+});
+
+// Bind script tag hack transport
+jQuery.ajaxTransport( "script", function( s ) {
+ // This transport only deals with cross domain requests
+ if ( s.crossDomain ) {
+ var script, callback;
+ return {
+ send: function( _, complete ) {
+ script = jQuery("<script>").prop({
+ async: true,
+ charset: s.scriptCharset,
+ src: s.url
+ }).on(
+ "load error",
+ callback = function( evt ) {
+ script.remove();
+ callback = null;
+ if ( evt ) {
+ complete( evt.type === "error" ? 404 : 200, evt.type );
+ }
+ }
+ );
+ document.head.appendChild( script[ 0 ] );
+ },
+ abort: function() {
+ if ( callback ) {
+ callback();
+ }
+ }
+ };
+ }
+});
+
+
+
+
+var oldCallbacks = [],
+ rjsonp = /(=)\?(?=&|$)|\?\?/;
+
+// Default jsonp settings
+jQuery.ajaxSetup({
+ jsonp: "callback",
+ jsonpCallback: function() {
+ var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
+ this[ callback ] = true;
+ return callback;
+ }
+});
+
+// Detect, normalize options and install callbacks for jsonp requests
+jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
+
+ var callbackName, overwritten, responseContainer,
+ jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
+ "url" :
+ typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
+ );
+
+ // Handle iff the expected data type is "jsonp" or we have a parameter to set
+ if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
+
+ // Get callback name, remembering preexisting value associated with it
+ callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
+ s.jsonpCallback() :
+ s.jsonpCallback;
+
+ // Insert callback into url or form data
+ if ( jsonProp ) {
+ s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
+ } else if ( s.jsonp !== false ) {
+ s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
+ }
+
+ // Use data converter to retrieve json after script execution
+ s.converters["script json"] = function() {
+ if ( !responseContainer ) {
+ jQuery.error( callbackName + " was not called" );
+ }
+ return responseContainer[ 0 ];
+ };
+
+ // force json dataType
+ s.dataTypes[ 0 ] = "json";
+
+ // Install callback
+ overwritten = window[ callbackName ];
+ window[ callbackName ] = function() {
+ responseContainer = arguments;
+ };
+
+ // Clean-up function (fires after converters)
+ jqXHR.always(function() {
+ // Restore preexisting value
+ window[ callbackName ] = overwritten;
+
+ // Save back as free
+ if ( s[ callbackName ] ) {
+ // make sure that re-using the options doesn't screw things around
+ s.jsonpCallback = originalSettings.jsonpCallback;
+
+ // save the callback name for future use
+ oldCallbacks.push( callbackName );
+ }
+
+ // Call if it was a function and we have a response
+ if ( responseContainer && jQuery.isFunction( overwritten ) ) {
+ overwritten( responseContainer[ 0 ] );
+ }
+
+ responseContainer = overwritten = undefined;
+ });
+
+ // Delegate to script
+ return "script";
+ }
+});
+
+
+
+
+// data: string of html
+// context (optional): If specified, the fragment will be created in this context, defaults to document
+// keepScripts (optional): If true, will include scripts passed in the html string
+jQuery.parseHTML = function( data, context, keepScripts ) {
+ if ( !data || typeof data !== "string" ) {
+ return null;
+ }
+ if ( typeof context === "boolean" ) {
+ keepScripts = context;
+ context = false;
+ }
+ context = context || document;
+
+ var parsed = rsingleTag.exec( data ),
+ scripts = !keepScripts && [];
+
+ // Single tag
+ if ( parsed ) {
+ return [ context.createElement( parsed[1] ) ];
+ }
+
+ parsed = jQuery.buildFragment( [ data ], context, scripts );
+
+ if ( scripts && scripts.length ) {
+ jQuery( scripts ).remove();
+ }
+
+ return jQuery.merge( [], parsed.childNodes );
+};
+
+
+// Keep a copy of the old load method
+var _load = jQuery.fn.load;
+
+/**
+ * Load a url into a page
+ */
+jQuery.fn.load = function( url, params, callback ) {
+ if ( typeof url !== "string" && _load ) {
+ return _load.apply( this, arguments );
+ }
+
+ var selector, type, response,
+ self = this,
+ off = url.indexOf(" ");
+
+ if ( off >= 0 ) {
+ selector = jQuery.trim( url.slice( off ) );
+ url = url.slice( 0, off );
+ }
+
+ // If it's a function
+ if ( jQuery.isFunction( params ) ) {
+
+ // We assume that it's the callback
+ callback = params;
+ params = undefined;
+
+ // Otherwise, build a param string
+ } else if ( params && typeof params === "object" ) {
+ type = "POST";
+ }
+
+ // If we have elements to modify, make the request
+ if ( self.length > 0 ) {
+ jQuery.ajax({
+ url: url,
+
+ // if "type" variable is undefined, then "GET" method will be used
+ type: type,
+ dataType: "html",
+ data: params
+ }).done(function( responseText ) {
+
+ // Save response for use in complete callback
+ response = arguments;
+
+ self.html( selector ?
+
+ // If a selector was specified, locate the right elements in a dummy div
+ // Exclude scripts to avoid IE 'Permission Denied' errors
+ jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
+
+ // Otherwise use the full result
+ responseText );
+
+ }).complete( callback && function( jqXHR, status ) {
+ self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
+ });
+ }
+
+ return this;
+};
+
+
+
+
+// Attach a bunch of functions for handling common AJAX events
+jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) {
+ jQuery.fn[ type ] = function( fn ) {
+ return this.on( type, fn );
+ };
+});
+
+
+
+
+jQuery.expr.filters.animated = function( elem ) {
+ return jQuery.grep(jQuery.timers, function( fn ) {
+ return elem === fn.elem;
+ }).length;
+};
+
+
+
+
+var docElem = window.document.documentElement;
+
+/**
+ * Gets a window from an element
+ */
+function getWindow( elem ) {
+ return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;
+}
+
+jQuery.offset = {
+ setOffset: function( elem, options, i ) {
+ var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
+ position = jQuery.css( elem, "position" ),
+ curElem = jQuery( elem ),
+ props = {};
+
+ // Set position first, in-case top/left are set even on static elem
+ if ( position === "static" ) {
+ elem.style.position = "relative";
+ }
+
+ curOffset = curElem.offset();
+ curCSSTop = jQuery.css( elem, "top" );
+ curCSSLeft = jQuery.css( elem, "left" );
+ calculatePosition = ( position === "absolute" || position === "fixed" ) &&
+ ( curCSSTop + curCSSLeft ).indexOf("auto") > -1;
+
+ // Need to be able to calculate position if either
+ // top or left is auto and position is either absolute or fixed
+ if ( calculatePosition ) {
+ curPosition = curElem.position();
+ curTop = curPosition.top;
+ curLeft = curPosition.left;
+
+ } else {
+ curTop = parseFloat( curCSSTop ) || 0;
+ curLeft = parseFloat( curCSSLeft ) || 0;
+ }
+
+ if ( jQuery.isFunction( options ) ) {
+ options = options.call( elem, i, curOffset );
+ }
+
+ if ( options.top != null ) {
+ props.top = ( options.top - curOffset.top ) + curTop;
+ }
+ if ( options.left != null ) {
+ props.left = ( options.left - curOffset.left ) + curLeft;
+ }
+
+ if ( "using" in options ) {
+ options.using.call( elem, props );
+
+ } else {
+ curElem.css( props );
+ }
+ }
+};
+
+jQuery.fn.extend({
+ offset: function( options ) {
+ if ( arguments.length ) {
+ return options === undefined ?
+ this :
+ this.each(function( i ) {
+ jQuery.offset.setOffset( this, options, i );
+ });
+ }
+
+ var docElem, win,
+ elem = this[ 0 ],
+ box = { top: 0, left: 0 },
+ doc = elem && elem.ownerDocument;
+
+ if ( !doc ) {
+ return;
+ }
+
+ docElem = doc.documentElement;
+
+ // Make sure it's not a disconnected DOM node
+ if ( !jQuery.contains( docElem, elem ) ) {
+ return box;
+ }
+
+ // Support: BlackBerry 5, iOS 3 (original iPhone)
+ // If we don't have gBCR, just use 0,0 rather than error
+ if ( typeof elem.getBoundingClientRect !== strundefined ) {
+ box = elem.getBoundingClientRect();
+ }
+ win = getWindow( doc );
+ return {
+ top: box.top + win.pageYOffset - docElem.clientTop,
+ left: box.left + win.pageXOffset - docElem.clientLeft
+ };
+ },
+
+ position: function() {
+ if ( !this[ 0 ] ) {
+ return;
+ }
+
+ var offsetParent, offset,
+ elem = this[ 0 ],
+ parentOffset = { top: 0, left: 0 };
+
+ // Fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent
+ if ( jQuery.css( elem, "position" ) === "fixed" ) {
+ // Assume getBoundingClientRect is there when computed position is fixed
+ offset = elem.getBoundingClientRect();
+
+ } else {
+ // Get *real* offsetParent
+ offsetParent = this.offsetParent();
+
+ // Get correct offsets
+ offset = this.offset();
+ if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
+ parentOffset = offsetParent.offset();
+ }
+
+ // Add offsetParent borders
+ parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
+ parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
+ }
+
+ // Subtract parent offsets and element margins
+ return {
+ top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
+ left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
+ };
+ },
+
+ offsetParent: function() {
+ return this.map(function() {
+ var offsetParent = this.offsetParent || docElem;
+
+ while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position" ) === "static" ) ) {
+ offsetParent = offsetParent.offsetParent;
+ }
+
+ return offsetParent || docElem;
+ });
+ }
+});
+
+// Create scrollLeft and scrollTop methods
+jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
+ var top = "pageYOffset" === prop;
+
+ jQuery.fn[ method ] = function( val ) {
+ return access( this, function( elem, method, val ) {
+ var win = getWindow( elem );
+
+ if ( val === undefined ) {
+ return win ? win[ prop ] : elem[ method ];
+ }
+
+ if ( win ) {
+ win.scrollTo(
+ !top ? val : window.pageXOffset,
+ top ? val : window.pageYOffset
+ );
+
+ } else {
+ elem[ method ] = val;
+ }
+ }, method, val, arguments.length, null );
+ };
+});
+
+// Support: Safari<7+, Chrome<37+
+// Add the top/left cssHooks using jQuery.fn.position
+// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
+// Blink bug: https://code.google.com/p/chromium/issues/detail?id=229280
+// getComputedStyle returns percent when specified for top/left/bottom/right;
+// rather than make the css module depend on the offset module, just check for it here
+jQuery.each( [ "top", "left" ], function( i, prop ) {
+ jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
+ function( elem, computed ) {
+ if ( computed ) {
+ computed = curCSS( elem, prop );
+ // If curCSS returns percentage, fallback to offset
+ return rnumnonpx.test( computed ) ?
+ jQuery( elem ).position()[ prop ] + "px" :
+ computed;
+ }
+ }
+ );
+});
+
+
+// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
+jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
+ jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
+ // Margin is only for outerHeight, outerWidth
+ jQuery.fn[ funcName ] = function( margin, value ) {
+ var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
+ extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
+
+ return access( this, function( elem, type, value ) {
+ var doc;
+
+ if ( jQuery.isWindow( elem ) ) {
+ // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
+ // isn't a whole lot we can do. See pull request at this URL for discussion:
+ // https://github.com/jquery/jquery/pull/764
+ return elem.document.documentElement[ "client" + name ];
+ }
+
+ // Get document width or height
+ if ( elem.nodeType === 9 ) {
+ doc = elem.documentElement;
+
+ // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
+ // whichever is greatest
+ return Math.max(
+ elem.body[ "scroll" + name ], doc[ "scroll" + name ],
+ elem.body[ "offset" + name ], doc[ "offset" + name ],
+ doc[ "client" + name ]
+ );
+ }
+
+ return value === undefined ?
+ // Get width or height on the element, requesting but not forcing parseFloat
+ jQuery.css( elem, type, extra ) :
+
+ // Set width or height on the element
+ jQuery.style( elem, type, value, extra );
+ }, type, chainable ? margin : undefined, chainable, null );
+ };
+ });
+});
+
+
+// The number of elements contained in the matched element set
+jQuery.fn.size = function() {
+ return this.length;
+};
+
+jQuery.fn.andSelf = jQuery.fn.addBack;
+
+
+
+
+// Register as a named AMD module, since jQuery can be concatenated with other
+// files that may use define, but not via a proper concatenation script that
+// understands anonymous AMD modules. A named AMD is safest and most robust
+// way to register. Lowercase jquery is used because AMD module names are
+// derived from file names, and jQuery is normally delivered in a lowercase
+// file name. Do this after creating the global so that if an AMD module wants
+// to call noConflict to hide this version of jQuery, it will work.
+
+// Note that for maximum portability, libraries that are not jQuery should
+// declare themselves as anonymous modules, and avoid setting a global if an
+// AMD loader is present. jQuery is a special case. For more information, see
+// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
+
+if ( typeof define === "function" && define.amd ) {
+ define( "jquery", [], function() {
+ return jQuery;
+ });
+}
+
+
+
+
+var
+ // Map over jQuery in case of overwrite
+ _jQuery = window.jQuery,
+
+ // Map over the $ in case of overwrite
+ _$ = window.$;
+
+jQuery.noConflict = function( deep ) {
+ if ( window.$ === jQuery ) {
+ window.$ = _$;
+ }
+
+ if ( deep && window.jQuery === jQuery ) {
+ window.jQuery = _jQuery;
+ }
+
+ return jQuery;
+};
+
+// Expose jQuery and $ identifiers, even in AMD
+// (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
+// and CommonJS for browser emulators (#13566)
+if ( typeof noGlobal === strundefined ) {
+ window.jQuery = window.$ = jQuery;
+}
+
+
+
+
+return jQuery;
+
+}));
+
+},{}],21:[function(require,module,exports){
+'use strict';
+
+
+var yaml = require('./lib/js-yaml.js');
+
+
+module.exports = yaml;
+
+},{"./lib/js-yaml.js":22}],22:[function(require,module,exports){
+'use strict';
+
+
+var loader = require('./js-yaml/loader');
+var dumper = require('./js-yaml/dumper');
+
+
+function deprecated(name) {
+ return function () {
+ throw new Error('Function ' + name + ' is deprecated and cannot be used.');
+ };
+}
+
+
+module.exports.Type = require('./js-yaml/type');
+module.exports.Schema = require('./js-yaml/schema');
+module.exports.FAILSAFE_SCHEMA = require('./js-yaml/schema/failsafe');
+module.exports.JSON_SCHEMA = require('./js-yaml/schema/json');
+module.exports.CORE_SCHEMA = require('./js-yaml/schema/core');
+module.exports.DEFAULT_SAFE_SCHEMA = require('./js-yaml/schema/default_safe');
+module.exports.DEFAULT_FULL_SCHEMA = require('./js-yaml/schema/default_full');
+module.exports.load = loader.load;
+module.exports.loadAll = loader.loadAll;
+module.exports.safeLoad = loader.safeLoad;
+module.exports.safeLoadAll = loader.safeLoadAll;
+module.exports.dump = dumper.dump;
+module.exports.safeDump = dumper.safeDump;
+module.exports.YAMLException = require('./js-yaml/exception');
+
+// Deprecared schema names from JS-YAML 2.0.x
+module.exports.MINIMAL_SCHEMA = require('./js-yaml/schema/failsafe');
+module.exports.SAFE_SCHEMA = require('./js-yaml/schema/default_safe');
+module.exports.DEFAULT_SCHEMA = require('./js-yaml/schema/default_full');
+
+// Deprecated functions from JS-YAML 1.x.x
+module.exports.scan = deprecated('scan');
+module.exports.parse = deprecated('parse');
+module.exports.compose = deprecated('compose');
+module.exports.addConstructor = deprecated('addConstructor');
+
+},{"./js-yaml/dumper":24,"./js-yaml/exception":25,"./js-yaml/loader":26,"./js-yaml/schema":28,"./js-yaml/schema/core":29,"./js-yaml/schema/default_full":30,"./js-yaml/schema/default_safe":31,"./js-yaml/schema/failsafe":32,"./js-yaml/schema/json":33,"./js-yaml/type":34}],23:[function(require,module,exports){
+'use strict';
+
+
+function isNothing(subject) {
+ return (typeof subject === 'undefined') || (null === subject);
+}
+
+
+function isObject(subject) {
+ return (typeof subject === 'object') && (null !== subject);
+}
+
+
+function toArray(sequence) {
+ if (Array.isArray(sequence)) {
+ return sequence;
+ } else if (isNothing(sequence)) {
+ return [];
+ }
+ return [ sequence ];
+}
+
+
+function extend(target, source) {
+ var index, length, key, sourceKeys;
+
+ if (source) {
+ sourceKeys = Object.keys(source);
+
+ for (index = 0, length = sourceKeys.length; index < length; index += 1) {
+ key = sourceKeys[index];
+ target[key] = source[key];
+ }
+ }
+
+ return target;
+}
+
+
+function repeat(string, count) {
+ var result = '', cycle;
+
+ for (cycle = 0; cycle < count; cycle += 1) {
+ result += string;
+ }
+
+ return result;
+}
+
+
+function isNegativeZero(number) {
+ return (0 === number) && (Number.NEGATIVE_INFINITY === 1 / number);
+}
+
+
+module.exports.isNothing = isNothing;
+module.exports.isObject = isObject;
+module.exports.toArray = toArray;
+module.exports.repeat = repeat;
+module.exports.isNegativeZero = isNegativeZero;
+module.exports.extend = extend;
+
+},{}],24:[function(require,module,exports){
+'use strict';
+
+/*eslint-disable no-use-before-define*/
+
+var common = require('./common');
+var YAMLException = require('./exception');
+var DEFAULT_FULL_SCHEMA = require('./schema/default_full');
+var DEFAULT_SAFE_SCHEMA = require('./schema/default_safe');
+
+var _toString = Object.prototype.toString;
+var _hasOwnProperty = Object.prototype.hasOwnProperty;
+
+var CHAR_TAB = 0x09; /* Tab */
+var CHAR_LINE_FEED = 0x0A; /* LF */
+var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */
+var CHAR_SPACE = 0x20; /* Space */
+var CHAR_EXCLAMATION = 0x21; /* ! */
+var CHAR_DOUBLE_QUOTE = 0x22; /* " */
+var CHAR_SHARP = 0x23; /* # */
+var CHAR_PERCENT = 0x25; /* % */
+var CHAR_AMPERSAND = 0x26; /* & */
+var CHAR_SINGLE_QUOTE = 0x27; /* ' */
+var CHAR_ASTERISK = 0x2A; /* * */
+var CHAR_COMMA = 0x2C; /* , */
+var CHAR_MINUS = 0x2D; /* - */
+var CHAR_COLON = 0x3A; /* : */
+var CHAR_GREATER_THAN = 0x3E; /* > */
+var CHAR_QUESTION = 0x3F; /* ? */
+var CHAR_COMMERCIAL_AT = 0x40; /* @ */
+var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */
+var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */
+var CHAR_GRAVE_ACCENT = 0x60; /* ` */
+var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */
+var CHAR_VERTICAL_LINE = 0x7C; /* | */
+var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */
+
+var ESCAPE_SEQUENCES = {};
+
+ESCAPE_SEQUENCES[0x00] = '\\0';
+ESCAPE_SEQUENCES[0x07] = '\\a';
+ESCAPE_SEQUENCES[0x08] = '\\b';
+ESCAPE_SEQUENCES[0x09] = '\\t';
+ESCAPE_SEQUENCES[0x0A] = '\\n';
+ESCAPE_SEQUENCES[0x0B] = '\\v';
+ESCAPE_SEQUENCES[0x0C] = '\\f';
+ESCAPE_SEQUENCES[0x0D] = '\\r';
+ESCAPE_SEQUENCES[0x1B] = '\\e';
+ESCAPE_SEQUENCES[0x22] = '\\"';
+ESCAPE_SEQUENCES[0x5C] = '\\\\';
+ESCAPE_SEQUENCES[0x85] = '\\N';
+ESCAPE_SEQUENCES[0xA0] = '\\_';
+ESCAPE_SEQUENCES[0x2028] = '\\L';
+ESCAPE_SEQUENCES[0x2029] = '\\P';
+
+var DEPRECATED_BOOLEANS_SYNTAX = [
+ 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON',
+ 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF'
+];
+
+function compileStyleMap(schema, map) {
+ var result, keys, index, length, tag, style, type;
+
+ if (null === map) {
+ return {};
+ }
+
+ result = {};
+ keys = Object.keys(map);
+
+ for (index = 0, length = keys.length; index < length; index += 1) {
+ tag = keys[index];
+ style = String(map[tag]);
+
+ if ('!!' === tag.slice(0, 2)) {
+ tag = 'tag:yaml.org,2002:' + tag.slice(2);
+ }
+
+ type = schema.compiledTypeMap[tag];
+
+ if (type && _hasOwnProperty.call(type.styleAliases, style)) {
+ style = type.styleAliases[style];
+ }
+
+ result[tag] = style;
+ }
+
+ return result;
+}
+
+function encodeHex(character) {
+ var string, handle, length;
+
+ string = character.toString(16).toUpperCase();
+
+ if (character <= 0xFF) {
+ handle = 'x';
+ length = 2;
+ } else if (character <= 0xFFFF) {
+ handle = 'u';
+ length = 4;
+ } else if (character <= 0xFFFFFFFF) {
+ handle = 'U';
+ length = 8;
+ } else {
+ throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF');
+ }
+
+ return '\\' + handle + common.repeat('0', length - string.length) + string;
+}
+
+function State(options) {
+ this.schema = options['schema'] || DEFAULT_FULL_SCHEMA;
+ this.indent = Math.max(1, (options['indent'] || 2));
+ this.skipInvalid = options['skipInvalid'] || false;
+ this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']);
+ this.styleMap = compileStyleMap(this.schema, options['styles'] || null);
+ this.sortKeys = options['sortKeys'] || false;
+
+ this.implicitTypes = this.schema.compiledImplicit;
+ this.explicitTypes = this.schema.compiledExplicit;
+
+ this.tag = null;
+ this.result = '';
+
+ this.duplicates = [];
+ this.usedDuplicates = null;
+}
+
+function indentString(string, spaces) {
+ var ind = common.repeat(' ', spaces),
+ position = 0,
+ next = -1,
+ result = '',
+ line,
+ length = string.length;
+
+ while (position < length) {
+ next = string.indexOf('\n', position);
+ if (next === -1) {
+ line = string.slice(position);
+ position = length;
+ } else {
+ line = string.slice(position, next + 1);
+ position = next + 1;
+ }
+ if (line.length && line !== '\n') {
+ result += ind;
+ }
+ result += line;
+ }
+
+ return result;
+}
+
+function generateNextLine(state, level) {
+ return '\n' + common.repeat(' ', state.indent * level);
+}
+
+function testImplicitResolving(state, str) {
+ var index, length, type;
+
+ for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {
+ type = state.implicitTypes[index];
+
+ if (type.resolve(str)) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+function StringBuilder(source) {
+ this.source = source;
+ this.result = '';
+ this.checkpoint = 0;
+}
+
+StringBuilder.prototype.takeUpTo = function (position) {
+ var er;
+
+ if (position < this.checkpoint) {
+ er = new Error('position should be > checkpoint');
+ er.position = position;
+ er.checkpoint = this.checkpoint;
+ throw er;
+ }
+
+ this.result += this.source.slice(this.checkpoint, position);
+ this.checkpoint = position;
+ return this;
+};
+
+StringBuilder.prototype.escapeChar = function () {
+ var character, esc;
+
+ character = this.source.charCodeAt(this.checkpoint);
+ esc = ESCAPE_SEQUENCES[character] || encodeHex(character);
+ this.result += esc;
+ this.checkpoint += 1;
+
+ return this;
+};
+
+StringBuilder.prototype.finish = function () {
+ if (this.source.length > this.checkpoint) {
+ this.takeUpTo(this.source.length);
+ }
+};
+
+function writeScalar(state, object, level) {
+ var simple, first, spaceWrap, folded, literal, single, double,
+ sawLineFeed, linePosition, longestLine, indent, max, character,
+ position, escapeSeq, hexEsc, previous, lineLength, modifier,
+ trailingLineBreaks, result;
+
+ if (0 === object.length) {
+ state.dump = "''";
+ return;
+ }
+
+ if (-1 !== DEPRECATED_BOOLEANS_SYNTAX.indexOf(object)) {
+ state.dump = "'" + object + "'";
+ return;
+ }
+
+ simple = true;
+ first = object.length ? object.charCodeAt(0) : 0;
+ spaceWrap = (CHAR_SPACE === first ||
+ CHAR_SPACE === object.charCodeAt(object.length - 1));
+
+ // Simplified check for restricted first characters
+ // http://www.yaml.org/spec/1.2/spec.html#ns-plain-first%28c%29
+ if (CHAR_MINUS === first ||
+ CHAR_QUESTION === first ||
+ CHAR_COMMERCIAL_AT === first ||
+ CHAR_GRAVE_ACCENT === first) {
+ simple = false;
+ }
+
+ // can only use > and | if not wrapped in spaces.
+ if (spaceWrap) {
+ simple = false;
+ folded = false;
+ literal = false;
+ } else {
+ folded = true;
+ literal = true;
+ }
+
+ single = true;
+ double = new StringBuilder(object);
+
+ sawLineFeed = false;
+ linePosition = 0;
+ longestLine = 0;
+
+ indent = state.indent * level;
+ max = 80;
+ if (indent < 40) {
+ max -= indent;
+ } else {
+ max = 40;
+ }
+
+ for (position = 0; position < object.length; position++) {
+ character = object.charCodeAt(position);
+ if (simple) {
+ // Characters that can never appear in the simple scalar
+ if (!simpleChar(character)) {
+ simple = false;
+ } else {
+ // Still simple. If we make it all the way through like
+ // this, then we can just dump the string as-is.
+ continue;
+ }
+ }
+
+ if (single && character === CHAR_SINGLE_QUOTE) {
+ single = false;
+ }
+
+ escapeSeq = ESCAPE_SEQUENCES[character];
+ hexEsc = needsHexEscape(character);
+
+ if (!escapeSeq && !hexEsc) {
+ continue;
+ }
+
+ if (character !== CHAR_LINE_FEED &&
+ character !== CHAR_DOUBLE_QUOTE &&
+ character !== CHAR_SINGLE_QUOTE) {
+ folded = false;
+ literal = false;
+ } else if (character === CHAR_LINE_FEED) {
+ sawLineFeed = true;
+ single = false;
+ if (position > 0) {
+ previous = object.charCodeAt(position - 1);
+ if (previous === CHAR_SPACE) {
+ literal = false;
+ folded = false;
+ }
+ }
+ if (folded) {
+ lineLength = position - linePosition;
+ linePosition = position;
+ if (lineLength > longestLine) {
+ longestLine = lineLength;
+ }
+ }
+ }
+
+ if (character !== CHAR_DOUBLE_QUOTE) {
+ single = false;
+ }
+
+ double.takeUpTo(position);
+ double.escapeChar();
+ }
+
+ if (simple && testImplicitResolving(state, object)) {
+ simple = false;
+ }
+
+ modifier = '';
+ if (folded || literal) {
+ trailingLineBreaks = 0;
+ if (object.charCodeAt(object.length - 1) === CHAR_LINE_FEED) {
+ trailingLineBreaks += 1;
+ if (object.charCodeAt(object.length - 2) === CHAR_LINE_FEED) {
+ trailingLineBreaks += 1;
+ }
+ }
+
+ if (trailingLineBreaks === 0) {
+ modifier = '-';
+ } else if (trailingLineBreaks === 2) {
+ modifier = '+';
+ }
+ }
+
+ if (literal && longestLine < max) {
+ folded = false;
+ }
+
+ // If it's literally one line, then don't bother with the literal.
+ // We may still want to do a fold, though, if it's a super long line.
+ if (!sawLineFeed) {
+ literal = false;
+ }
+
+ if (simple) {
+ state.dump = object;
+ } else if (single) {
+ state.dump = '\'' + object + '\'';
+ } else if (folded) {
+ result = fold(object, max);
+ state.dump = '>' + modifier + '\n' + indentString(result, indent);
+ } else if (literal) {
+ if (!modifier) {
+ object = object.replace(/\n$/, '');
+ }
+ state.dump = '|' + modifier + '\n' + indentString(object, indent);
+ } else if (double) {
+ double.finish();
+ state.dump = '"' + double.result + '"';
+ } else {
+ throw new Error('Failed to dump scalar value');
+ }
+
+ return;
+}
+
+// The `trailing` var is a regexp match of any trailing `\n` characters.
+//
+// There are three cases we care about:
+//
+// 1. One trailing `\n` on the string. Just use `|` or `>`.
+// This is the assumed default. (trailing = null)
+// 2. No trailing `\n` on the string. Use `|-` or `>-` to "chomp" the end.
+// 3. More than one trailing `\n` on the string. Use `|+` or `>+`.
+//
+// In the case of `>+`, these line breaks are *not* doubled (like the line
+// breaks within the string), so it's important to only end with the exact
+// same number as we started.
+function fold(object, max) {
+ var result = '',
+ position = 0,
+ length = object.length,
+ trailing = /\n+$/.exec(object),
+ newLine;
+
+ if (trailing) {
+ length = trailing.index + 1;
+ }
+
+ while (position < length) {
+ newLine = object.indexOf('\n', position);
+ if (newLine > length || newLine === -1) {
+ if (result) {
+ result += '\n\n';
+ }
+ result += foldLine(object.slice(position, length), max);
+ position = length;
+ } else {
+ if (result) {
+ result += '\n\n';
+ }
+ result += foldLine(object.slice(position, newLine), max);
+ position = newLine + 1;
+ }
+ }
+ if (trailing && trailing[0] !== '\n') {
+ result += trailing[0];
+ }
+
+ return result;
+}
+
+function foldLine(line, max) {
+ if (line === '') {
+ return line;
+ }
+
+ var foldRe = /[^\s] [^\s]/g,
+ result = '',
+ prevMatch = 0,
+ foldStart = 0,
+ match = foldRe.exec(line),
+ index,
+ foldEnd,
+ folded;
+
+ while (match) {
+ index = match.index;
+
+ // when we cross the max len, if the previous match would've
+ // been ok, use that one, and carry on. If there was no previous
+ // match on this fold section, then just have a long line.
+ if (index - foldStart > max) {
+ if (prevMatch !== foldStart) {
+ foldEnd = prevMatch;
+ } else {
+ foldEnd = index;
+ }
+
+ if (result) {
+ result += '\n';
+ }
+ folded = line.slice(foldStart, foldEnd);
+ result += folded;
+ foldStart = foldEnd + 1;
+ }
+ prevMatch = index + 1;
+ match = foldRe.exec(line);
+ }
+
+ if (result) {
+ result += '\n';
+ }
+
+ // if we end up with one last word at the end, then the last bit might
+ // be slightly bigger than we wanted, because we exited out of the loop.
+ if (foldStart !== prevMatch && line.length - foldStart > max) {
+ result += line.slice(foldStart, prevMatch) + '\n' +
+ line.slice(prevMatch + 1);
+ } else {
+ result += line.slice(foldStart);
+ }
+
+ return result;
+}
+
+// Returns true if character can be found in a simple scalar
+function simpleChar(character) {
+ return CHAR_TAB !== character &&
+ CHAR_LINE_FEED !== character &&
+ CHAR_CARRIAGE_RETURN !== character &&
+ CHAR_COMMA !== character &&
+ CHAR_LEFT_SQUARE_BRACKET !== character &&
+ CHAR_RIGHT_SQUARE_BRACKET !== character &&
+ CHAR_LEFT_CURLY_BRACKET !== character &&
+ CHAR_RIGHT_CURLY_BRACKET !== character &&
+ CHAR_SHARP !== character &&
+ CHAR_AMPERSAND !== character &&
+ CHAR_ASTERISK !== character &&
+ CHAR_EXCLAMATION !== character &&
+ CHAR_VERTICAL_LINE !== character &&
+ CHAR_GREATER_THAN !== character &&
+ CHAR_SINGLE_QUOTE !== character &&
+ CHAR_DOUBLE_QUOTE !== character &&
+ CHAR_PERCENT !== character &&
+ CHAR_COLON !== character &&
+ !ESCAPE_SEQUENCES[character] &&
+ !needsHexEscape(character);
+}
+
+// Returns true if the character code needs to be escaped.
+function needsHexEscape(character) {
+ return !((0x00020 <= character && character <= 0x00007E) ||
+ (0x00085 === character) ||
+ (0x000A0 <= character && character <= 0x00D7FF) ||
+ (0x0E000 <= character && character <= 0x00FFFD) ||
+ (0x10000 <= character && character <= 0x10FFFF));
+}
+
+function writeFlowSequence(state, level, object) {
+ var _result = '',
+ _tag = state.tag,
+ index,
+ length;
+
+ for (index = 0, length = object.length; index < length; index += 1) {
+ // Write only valid elements.
+ if (writeNode(state, level, object[index], false, false)) {
+ if (0 !== index) {
+ _result += ', ';
+ }
+ _result += state.dump;
+ }
+ }
+
+ state.tag = _tag;
+ state.dump = '[' + _result + ']';
+}
+
+function writeBlockSequence(state, level, object, compact) {
+ var _result = '',
+ _tag = state.tag,
+ index,
+ length;
+
+ for (index = 0, length = object.length; index < length; index += 1) {
+ // Write only valid elements.
+ if (writeNode(state, level + 1, object[index], true, true)) {
+ if (!compact || 0 !== index) {
+ _result += generateNextLine(state, level);
+ }
+ _result += '- ' + state.dump;
+ }
+ }
+
+ state.tag = _tag;
+ state.dump = _result || '[]'; // Empty sequence if no valid values.
+}
+
+function writeFlowMapping(state, level, object) {
+ var _result = '',
+ _tag = state.tag,
+ objectKeyList = Object.keys(object),
+ index,
+ length,
+ objectKey,
+ objectValue,
+ pairBuffer;
+
+ for (index = 0, length = objectKeyList.length; index < length; index += 1) {
+ pairBuffer = '';
+
+ if (0 !== index) {
+ pairBuffer += ', ';
+ }
+
+ objectKey = objectKeyList[index];
+ objectValue = object[objectKey];
+
+ if (!writeNode(state, level, objectKey, false, false)) {
+ continue; // Skip this pair because of invalid key;
+ }
+
+ if (state.dump.length > 1024) {
+ pairBuffer += '? ';
+ }
+
+ pairBuffer += state.dump + ': ';
+
+ if (!writeNode(state, level, objectValue, false, false)) {
+ continue; // Skip this pair because of invalid value.
+ }
+
+ pairBuffer += state.dump;
+
+ // Both key and value are valid.
+ _result += pairBuffer;
+ }
+
+ state.tag = _tag;
+ state.dump = '{' + _result + '}';
+}
+
+function writeBlockMapping(state, level, object, compact) {
+ var _result = '',
+ _tag = state.tag,
+ objectKeyList = Object.keys(object),
+ index,
+ length,
+ objectKey,
+ objectValue,
+ explicitPair,
+ pairBuffer;
+
+ // Allow sorting keys so that the output file is deterministic
+ if (state.sortKeys === true) {
+ // Default sorting
+ objectKeyList.sort();
+ } else if (typeof state.sortKeys === 'function') {
+ // Custom sort function
+ objectKeyList.sort(state.sortKeys);
+ } else if (state.sortKeys) {
+ // Something is wrong
+ throw new YAMLException('sortKeys must be a boolean or a function');
+ }
+
+ for (index = 0, length = objectKeyList.length; index < length; index += 1) {
+ pairBuffer = '';
+
+ if (!compact || 0 !== index) {
+ pairBuffer += generateNextLine(state, level);
+ }
+
+ objectKey = objectKeyList[index];
+ objectValue = object[objectKey];
+
+ if (!writeNode(state, level + 1, objectKey, true, true)) {
+ continue; // Skip this pair because of invalid key.
+ }
+
+ explicitPair = (null !== state.tag && '?' !== state.tag) ||
+ (state.dump && state.dump.length > 1024);
+
+ if (explicitPair) {
+ if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
+ pairBuffer += '?';
+ } else {
+ pairBuffer += '? ';
+ }
+ }
+
+ pairBuffer += state.dump;
+
+ if (explicitPair) {
+ pairBuffer += generateNextLine(state, level);
+ }
+
+ if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {
+ continue; // Skip this pair because of invalid value.
+ }
+
+ if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
+ pairBuffer += ':';
+ } else {
+ pairBuffer += ': ';
+ }
+
+ pairBuffer += state.dump;
+
+ // Both key and value are valid.
+ _result += pairBuffer;
+ }
+
+ state.tag = _tag;
+ state.dump = _result || '{}'; // Empty mapping if no valid pairs.
+}
+
+function detectType(state, object, explicit) {
+ var _result, typeList, index, length, type, style;
+
+ typeList = explicit ? state.explicitTypes : state.implicitTypes;
+
+ for (index = 0, length = typeList.length; index < length; index += 1) {
+ type = typeList[index];
+
+ if ((type.instanceOf || type.predicate) &&
+ (!type.instanceOf || (('object' === typeof object) && (object instanceof type.instanceOf))) &&
+ (!type.predicate || type.predicate(object))) {
+
+ state.tag = explicit ? type.tag : '?';
+
+ if (type.represent) {
+ style = state.styleMap[type.tag] || type.defaultStyle;
+
+ if ('[object Function]' === _toString.call(type.represent)) {
+ _result = type.represent(object, style);
+ } else if (_hasOwnProperty.call(type.represent, style)) {
+ _result = type.represent[style](object, style);
+ } else {
+ throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style');
+ }
+
+ state.dump = _result;
+ }
+
+ return true;
+ }
+ }
+
+ return false;
+}
+
+// Serializes `object` and writes it to global `result`.
+// Returns true on success, or false on invalid object.
+//
+function writeNode(state, level, object, block, compact) {
+ state.tag = null;
+ state.dump = object;
+
+ if (!detectType(state, object, false)) {
+ detectType(state, object, true);
+ }
+
+ var type = _toString.call(state.dump);
+
+ if (block) {
+ block = (0 > state.flowLevel || state.flowLevel > level);
+ }
+
+ if ((null !== state.tag && '?' !== state.tag) || (2 !== state.indent && level > 0)) {
+ compact = false;
+ }
+
+ var objectOrArray = '[object Object]' === type || '[object Array]' === type,
+ duplicateIndex,
+ duplicate;
+
+ if (objectOrArray) {
+ duplicateIndex = state.duplicates.indexOf(object);
+ duplicate = duplicateIndex !== -1;
+ }
+
+ if (duplicate && state.usedDuplicates[duplicateIndex]) {
+ state.dump = '*ref_' + duplicateIndex;
+ } else {
+ if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {
+ state.usedDuplicates[duplicateIndex] = true;
+ }
+ if ('[object Object]' === type) {
+ if (block && (0 !== Object.keys(state.dump).length)) {
+ writeBlockMapping(state, level, state.dump, compact);
+ if (duplicate) {
+ state.dump = '&ref_' + duplicateIndex + (0 === level ? '\n' : '') + state.dump;
+ }
+ } else {
+ writeFlowMapping(state, level, state.dump);
+ if (duplicate) {
+ state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
+ }
+ }
+ } else if ('[object Array]' === type) {
+ if (block && (0 !== state.dump.length)) {
+ writeBlockSequence(state, level, state.dump, compact);
+ if (duplicate) {
+ state.dump = '&ref_' + duplicateIndex + (0 === level ? '\n' : '') + state.dump;
+ }
+ } else {
+ writeFlowSequence(state, level, state.dump);
+ if (duplicate) {
+ state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
+ }
+ }
+ } else if ('[object String]' === type) {
+ if ('?' !== state.tag) {
+ writeScalar(state, state.dump, level);
+ }
+ } else {
+ if (state.skipInvalid) {
+ return false;
+ }
+ throw new YAMLException('unacceptable kind of an object to dump ' + type);
+ }
+
+ if (null !== state.tag && '?' !== state.tag) {
+ state.dump = '!<' + state.tag + '> ' + state.dump;
+ }
+ }
+
+ return true;
+}
+
+function getDuplicateReferences(object, state) {
+ var objects = [],
+ duplicatesIndexes = [],
+ index,
+ length;
+
+ inspectNode(object, objects, duplicatesIndexes);
+
+ for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) {
+ state.duplicates.push(objects[duplicatesIndexes[index]]);
+ }
+ state.usedDuplicates = new Array(length);
+}
+
+function inspectNode(object, objects, duplicatesIndexes) {
+ var type = _toString.call(object),
+ objectKeyList,
+ index,
+ length;
+
+ if (null !== object && 'object' === typeof object) {
+ index = objects.indexOf(object);
+ if (-1 !== index) {
+ if (-1 === duplicatesIndexes.indexOf(index)) {
+ duplicatesIndexes.push(index);
+ }
+ } else {
+ objects.push(object);
+
+ if (Array.isArray(object)) {
+ for (index = 0, length = object.length; index < length; index += 1) {
+ inspectNode(object[index], objects, duplicatesIndexes);
+ }
+ } else {
+ objectKeyList = Object.keys(object);
+
+ for (index = 0, length = objectKeyList.length; index < length; index += 1) {
+ inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);
+ }
+ }
+ }
+ }
+}
+
+function dump(input, options) {
+ options = options || {};
+
+ var state = new State(options);
+
+ getDuplicateReferences(input, state);
+
+ if (writeNode(state, 0, input, true, true)) {
+ return state.dump + '\n';
+ }
+ return '';
+}
+
+function safeDump(input, options) {
+ return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
+}
+
+module.exports.dump = dump;
+module.exports.safeDump = safeDump;
+
+},{"./common":23,"./exception":25,"./schema/default_full":30,"./schema/default_safe":31}],25:[function(require,module,exports){
+'use strict';
+
+
+function YAMLException(reason, mark) {
+ this.name = 'YAMLException';
+ this.reason = reason;
+ this.mark = mark;
+ this.message = this.toString(false);
+}
+
+
+YAMLException.prototype.toString = function toString(compact) {
+ var result;
+
+ result = 'JS-YAML: ' + (this.reason || '(unknown reason)');
+
+ if (!compact && this.mark) {
+ result += ' ' + this.mark.toString();
+ }
+
+ return result;
+};
+
+
+module.exports = YAMLException;
+
+},{}],26:[function(require,module,exports){
+'use strict';
+
+/*eslint-disable max-len,no-use-before-define*/
+
+var common = require('./common');
+var YAMLException = require('./exception');
+var Mark = require('./mark');
+var DEFAULT_SAFE_SCHEMA = require('./schema/default_safe');
+var DEFAULT_FULL_SCHEMA = require('./schema/default_full');
+
+
+var _hasOwnProperty = Object.prototype.hasOwnProperty;
+
+
+var CONTEXT_FLOW_IN = 1;
+var CONTEXT_FLOW_OUT = 2;
+var CONTEXT_BLOCK_IN = 3;
+var CONTEXT_BLOCK_OUT = 4;
+
+
+var CHOMPING_CLIP = 1;
+var CHOMPING_STRIP = 2;
+var CHOMPING_KEEP = 3;
+
+
+var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
+var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
+var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
+var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
+var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
+
+
+function is_EOL(c) {
+ return (c === 0x0A/* LF */) || (c === 0x0D/* CR */);
+}
+
+function is_WHITE_SPACE(c) {
+ return (c === 0x09/* Tab */) || (c === 0x20/* Space */);
+}
+
+function is_WS_OR_EOL(c) {
+ return (c === 0x09/* Tab */) ||
+ (c === 0x20/* Space */) ||
+ (c === 0x0A/* LF */) ||
+ (c === 0x0D/* CR */);
+}
+
+function is_FLOW_INDICATOR(c) {
+ return 0x2C/* , */ === c ||
+ 0x5B/* [ */ === c ||
+ 0x5D/* ] */ === c ||
+ 0x7B/* { */ === c ||
+ 0x7D/* } */ === c;
+}
+
+function fromHexCode(c) {
+ var lc;
+
+ if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
+ return c - 0x30;
+ }
+
+ /*eslint-disable no-bitwise*/
+ lc = c | 0x20;
+
+ if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) {
+ return lc - 0x61 + 10;
+ }
+
+ return -1;
+}
+
+function escapedHexLen(c) {
+ if (c === 0x78/* x */) { return 2; }
+ if (c === 0x75/* u */) { return 4; }
+ if (c === 0x55/* U */) { return 8; }
+ return 0;
+}
+
+function fromDecimalCode(c) {
+ if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
+ return c - 0x30;
+ }
+
+ return -1;
+}
+
+function simpleEscapeSequence(c) {
+ return (c === 0x30/* 0 */) ? '\x00' :
+ (c === 0x61/* a */) ? '\x07' :
+ (c === 0x62/* b */) ? '\x08' :
+ (c === 0x74/* t */) ? '\x09' :
+ (c === 0x09/* Tab */) ? '\x09' :
+ (c === 0x6E/* n */) ? '\x0A' :
+ (c === 0x76/* v */) ? '\x0B' :
+ (c === 0x66/* f */) ? '\x0C' :
+ (c === 0x72/* r */) ? '\x0D' :
+ (c === 0x65/* e */) ? '\x1B' :
+ (c === 0x20/* Space */) ? ' ' :
+ (c === 0x22/* " */) ? '\x22' :
+ (c === 0x2F/* / */) ? '/' :
+ (c === 0x5C/* \ */) ? '\x5C' :
+ (c === 0x4E/* N */) ? '\x85' :
+ (c === 0x5F/* _ */) ? '\xA0' :
+ (c === 0x4C/* L */) ? '\u2028' :
+ (c === 0x50/* P */) ? '\u2029' : '';
+}
+
+function charFromCodepoint(c) {
+ if (c <= 0xFFFF) {
+ return String.fromCharCode(c);
+ }
+ // Encode UTF-16 surrogate pair
+ // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF
+ return String.fromCharCode(((c - 0x010000) >> 10) + 0xD800,
+ ((c - 0x010000) & 0x03FF) + 0xDC00);
+}
+
+var simpleEscapeCheck = new Array(256); // integer, for fast access
+var simpleEscapeMap = new Array(256);
+for (var i = 0; i < 256; i++) {
+ simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
+ simpleEscapeMap[i] = simpleEscapeSequence(i);
+}
+
+
+function State(input, options) {
+ this.input = input;
+
+ this.filename = options['filename'] || null;
+ this.schema = options['schema'] || DEFAULT_FULL_SCHEMA;
+ this.onWarning = options['onWarning'] || null;
+ this.legacy = options['legacy'] || false;
+
+ this.implicitTypes = this.schema.compiledImplicit;
+ this.typeMap = this.schema.compiledTypeMap;
+
+ this.length = input.length;
+ this.position = 0;
+ this.line = 0;
+ this.lineStart = 0;
+ this.lineIndent = 0;
+
+ this.documents = [];
+
+ /*
+ this.version;
+ this.checkLineBreaks;
+ this.tagMap;
+ this.anchorMap;
+ this.tag;
+ this.anchor;
+ this.kind;
+ this.result;*/
+
+}
+
+
+function generateError(state, message) {
+ return new YAMLException(
+ message,
+ new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart)));
+}
+
+function throwError(state, message) {
+ throw generateError(state, message);
+}
+
+function throwWarning(state, message) {
+ var error = generateError(state, message);
+
+ if (state.onWarning) {
+ state.onWarning.call(null, error);
+ } else {
+ throw error;
+ }
+}
+
+
+var directiveHandlers = {
+
+ YAML: function handleYamlDirective(state, name, args) {
+
+ var match, major, minor;
+
+ if (null !== state.version) {
+ throwError(state, 'duplication of %YAML directive');
+ }
+
+ if (1 !== args.length) {
+ throwError(state, 'YAML directive accepts exactly one argument');
+ }
+
+ match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
+
+ if (null === match) {
+ throwError(state, 'ill-formed argument of the YAML directive');
+ }
+
+ major = parseInt(match[1], 10);
+ minor = parseInt(match[2], 10);
+
+ if (1 !== major) {
+ throwError(state, 'unacceptable YAML version of the document');
+ }
+
+ state.version = args[0];
+ state.checkLineBreaks = (minor < 2);
+
+ if (1 !== minor && 2 !== minor) {
+ throwWarning(state, 'unsupported YAML version of the document');
+ }
+ },
+
+ TAG: function handleTagDirective(state, name, args) {
+
+ var handle, prefix;
+
+ if (2 !== args.length) {
+ throwError(state, 'TAG directive accepts exactly two arguments');
+ }
+
+ handle = args[0];
+ prefix = args[1];
+
+ if (!PATTERN_TAG_HANDLE.test(handle)) {
+ throwError(state, 'ill-formed tag handle (first argument) of the TAG directive');
+ }
+
+ if (_hasOwnProperty.call(state.tagMap, handle)) {
+ throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
+ }
+
+ if (!PATTERN_TAG_URI.test(prefix)) {
+ throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive');
+ }
+
+ state.tagMap[handle] = prefix;
+ }
+};
+
+
+function captureSegment(state, start, end, checkJson) {
+ var _position, _length, _character, _result;
+
+ if (start < end) {
+ _result = state.input.slice(start, end);
+
+ if (checkJson) {
+ for (_position = 0, _length = _result.length;
+ _position < _length;
+ _position += 1) {
+ _character = _result.charCodeAt(_position);
+ if (!(0x09 === _character ||
+ 0x20 <= _character && _character <= 0x10FFFF)) {
+ throwError(state, 'expected valid JSON character');
+ }
+ }
+ }
+
+ state.result += _result;
+ }
+}
+
+function mergeMappings(state, destination, source) {
+ var sourceKeys, key, index, quantity;
+
+ if (!common.isObject(source)) {
+ throwError(state, 'cannot merge mappings; the provided source object is unacceptable');
+ }
+
+ sourceKeys = Object.keys(source);
+
+ for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
+ key = sourceKeys[index];
+
+ if (!_hasOwnProperty.call(destination, key)) {
+ destination[key] = source[key];
+ }
+ }
+}
+
+function storeMappingPair(state, _result, keyTag, keyNode, valueNode) {
+ var index, quantity;
+
+ keyNode = String(keyNode);
+
+ if (null === _result) {
+ _result = {};
+ }
+
+ if ('tag:yaml.org,2002:merge' === keyTag) {
+ if (Array.isArray(valueNode)) {
+ for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {
+ mergeMappings(state, _result, valueNode[index]);
+ }
+ } else {
+ mergeMappings(state, _result, valueNode);
+ }
+ } else {
+ _result[keyNode] = valueNode;
+ }
+
+ return _result;
+}
+
+function readLineBreak(state) {
+ var ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (0x0A/* LF */ === ch) {
+ state.position++;
+ } else if (0x0D/* CR */ === ch) {
+ state.position++;
+ if (0x0A/* LF */ === state.input.charCodeAt(state.position)) {
+ state.position++;
+ }
+ } else {
+ throwError(state, 'a line break is expected');
+ }
+
+ state.line += 1;
+ state.lineStart = state.position;
+}
+
+function skipSeparationSpace(state, allowComments, checkIndent) {
+ var lineBreaks = 0,
+ ch = state.input.charCodeAt(state.position);
+
+ while (0 !== ch) {
+ while (is_WHITE_SPACE(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (allowComments && 0x23/* # */ === ch) {
+ do {
+ ch = state.input.charCodeAt(++state.position);
+ } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && 0 !== ch);
+ }
+
+ if (is_EOL(ch)) {
+ readLineBreak(state);
+
+ ch = state.input.charCodeAt(state.position);
+ lineBreaks++;
+ state.lineIndent = 0;
+
+ while (0x20/* Space */ === ch) {
+ state.lineIndent++;
+ ch = state.input.charCodeAt(++state.position);
+ }
+ } else {
+ break;
+ }
+ }
+
+ if (-1 !== checkIndent && 0 !== lineBreaks && state.lineIndent < checkIndent) {
+ throwWarning(state, 'deficient indentation');
+ }
+
+ return lineBreaks;
+}
+
+function testDocumentSeparator(state) {
+ var _position = state.position,
+ ch;
+
+ ch = state.input.charCodeAt(_position);
+
+ // Condition state.position === state.lineStart is tested
+ // in parent on each call, for efficiency. No needs to test here again.
+ if ((0x2D/* - */ === ch || 0x2E/* . */ === ch) &&
+ state.input.charCodeAt(_position + 1) === ch &&
+ state.input.charCodeAt(_position + 2) === ch) {
+
+ _position += 3;
+
+ ch = state.input.charCodeAt(_position);
+
+ if (ch === 0 || is_WS_OR_EOL(ch)) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+function writeFoldedLines(state, count) {
+ if (1 === count) {
+ state.result += ' ';
+ } else if (count > 1) {
+ state.result += common.repeat('\n', count - 1);
+ }
+}
+
+
+function readPlainScalar(state, nodeIndent, withinFlowCollection) {
+ var preceding,
+ following,
+ captureStart,
+ captureEnd,
+ hasPendingContent,
+ _line,
+ _lineStart,
+ _lineIndent,
+ _kind = state.kind,
+ _result = state.result,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (is_WS_OR_EOL(ch) ||
+ is_FLOW_INDICATOR(ch) ||
+ 0x23/* # */ === ch ||
+ 0x26/* & */ === ch ||
+ 0x2A/* * */ === ch ||
+ 0x21/* ! */ === ch ||
+ 0x7C/* | */ === ch ||
+ 0x3E/* > */ === ch ||
+ 0x27/* ' */ === ch ||
+ 0x22/* " */ === ch ||
+ 0x25/* % */ === ch ||
+ 0x40/* @ */ === ch ||
+ 0x60/* ` */ === ch) {
+ return false;
+ }
+
+ if (0x3F/* ? */ === ch || 0x2D/* - */ === ch) {
+ following = state.input.charCodeAt(state.position + 1);
+
+ if (is_WS_OR_EOL(following) ||
+ withinFlowCollection && is_FLOW_INDICATOR(following)) {
+ return false;
+ }
+ }
+
+ state.kind = 'scalar';
+ state.result = '';
+ captureStart = captureEnd = state.position;
+ hasPendingContent = false;
+
+ while (0 !== ch) {
+ if (0x3A/* : */ === ch) {
+ following = state.input.charCodeAt(state.position + 1);
+
+ if (is_WS_OR_EOL(following) ||
+ withinFlowCollection && is_FLOW_INDICATOR(following)) {
+ break;
+ }
+
+ } else if (0x23/* # */ === ch) {
+ preceding = state.input.charCodeAt(state.position - 1);
+
+ if (is_WS_OR_EOL(preceding)) {
+ break;
+ }
+
+ } else if ((state.position === state.lineStart && testDocumentSeparator(state)) ||
+ withinFlowCollection && is_FLOW_INDICATOR(ch)) {
+ break;
+
+ } else if (is_EOL(ch)) {
+ _line = state.line;
+ _lineStart = state.lineStart;
+ _lineIndent = state.lineIndent;
+ skipSeparationSpace(state, false, -1);
+
+ if (state.lineIndent >= nodeIndent) {
+ hasPendingContent = true;
+ ch = state.input.charCodeAt(state.position);
+ continue;
+ } else {
+ state.position = captureEnd;
+ state.line = _line;
+ state.lineStart = _lineStart;
+ state.lineIndent = _lineIndent;
+ break;
+ }
+ }
+
+ if (hasPendingContent) {
+ captureSegment(state, captureStart, captureEnd, false);
+ writeFoldedLines(state, state.line - _line);
+ captureStart = captureEnd = state.position;
+ hasPendingContent = false;
+ }
+
+ if (!is_WHITE_SPACE(ch)) {
+ captureEnd = state.position + 1;
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ captureSegment(state, captureStart, captureEnd, false);
+
+ if (state.result) {
+ return true;
+ }
+
+ state.kind = _kind;
+ state.result = _result;
+ return false;
+}
+
+function readSingleQuotedScalar(state, nodeIndent) {
+ var ch,
+ captureStart, captureEnd;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (0x27/* ' */ !== ch) {
+ return false;
+ }
+
+ state.kind = 'scalar';
+ state.result = '';
+ state.position++;
+ captureStart = captureEnd = state.position;
+
+ while (0 !== (ch = state.input.charCodeAt(state.position))) {
+ if (0x27/* ' */ === ch) {
+ captureSegment(state, captureStart, state.position, true);
+ ch = state.input.charCodeAt(++state.position);
+
+ if (0x27/* ' */ === ch) {
+ captureStart = captureEnd = state.position;
+ state.position++;
+ } else {
+ return true;
+ }
+
+ } else if (is_EOL(ch)) {
+ captureSegment(state, captureStart, captureEnd, true);
+ writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
+ captureStart = captureEnd = state.position;
+
+ } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
+ throwError(state, 'unexpected end of the document within a single quoted scalar');
+
+ } else {
+ state.position++;
+ captureEnd = state.position;
+ }
+ }
+
+ throwError(state, 'unexpected end of the stream within a single quoted scalar');
+}
+
+function readDoubleQuotedScalar(state, nodeIndent) {
+ var captureStart,
+ captureEnd,
+ hexLength,
+ hexResult,
+ tmp, tmpEsc,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (0x22/* " */ !== ch) {
+ return false;
+ }
+
+ state.kind = 'scalar';
+ state.result = '';
+ state.position++;
+ captureStart = captureEnd = state.position;
+
+ while (0 !== (ch = state.input.charCodeAt(state.position))) {
+ if (0x22/* " */ === ch) {
+ captureSegment(state, captureStart, state.position, true);
+ state.position++;
+ return true;
+
+ } else if (0x5C/* \ */ === ch) {
+ captureSegment(state, captureStart, state.position, true);
+ ch = state.input.charCodeAt(++state.position);
+
+ if (is_EOL(ch)) {
+ skipSeparationSpace(state, false, nodeIndent);
+
+ // TODO: rework to inline fn with no type cast?
+ } else if (ch < 256 && simpleEscapeCheck[ch]) {
+ state.result += simpleEscapeMap[ch];
+ state.position++;
+
+ } else if ((tmp = escapedHexLen(ch)) > 0) {
+ hexLength = tmp;
+ hexResult = 0;
+
+ for (; hexLength > 0; hexLength--) {
+ ch = state.input.charCodeAt(++state.position);
+
+ if ((tmp = fromHexCode(ch)) >= 0) {
+ hexResult = (hexResult << 4) + tmp;
+
+ } else {
+ throwError(state, 'expected hexadecimal character');
+ }
+ }
+
+ state.result += charFromCodepoint(hexResult);
+
+ state.position++;
+
+ } else {
+ throwError(state, 'unknown escape sequence');
+ }
+
+ captureStart = captureEnd = state.position;
+
+ } else if (is_EOL(ch)) {
+ captureSegment(state, captureStart, captureEnd, true);
+ writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
+ captureStart = captureEnd = state.position;
+
+ } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
+ throwError(state, 'unexpected end of the document within a double quoted scalar');
+
+ } else {
+ state.position++;
+ captureEnd = state.position;
+ }
+ }
+
+ throwError(state, 'unexpected end of the stream within a double quoted scalar');
+}
+
+function readFlowCollection(state, nodeIndent) {
+ var readNext = true,
+ _line,
+ _tag = state.tag,
+ _result,
+ _anchor = state.anchor,
+ following,
+ terminator,
+ isPair,
+ isExplicitPair,
+ isMapping,
+ keyNode,
+ keyTag,
+ valueNode,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch === 0x5B/* [ */) {
+ terminator = 0x5D;/* ] */
+ isMapping = false;
+ _result = [];
+ } else if (ch === 0x7B/* { */) {
+ terminator = 0x7D;/* } */
+ isMapping = true;
+ _result = {};
+ } else {
+ return false;
+ }
+
+ if (null !== state.anchor) {
+ state.anchorMap[state.anchor] = _result;
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+
+ while (0 !== ch) {
+ skipSeparationSpace(state, true, nodeIndent);
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch === terminator) {
+ state.position++;
+ state.tag = _tag;
+ state.anchor = _anchor;
+ state.kind = isMapping ? 'mapping' : 'sequence';
+ state.result = _result;
+ return true;
+ } else if (!readNext) {
+ throwError(state, 'missed comma between flow collection entries');
+ }
+
+ keyTag = keyNode = valueNode = null;
+ isPair = isExplicitPair = false;
+
+ if (0x3F/* ? */ === ch) {
+ following = state.input.charCodeAt(state.position + 1);
+
+ if (is_WS_OR_EOL(following)) {
+ isPair = isExplicitPair = true;
+ state.position++;
+ skipSeparationSpace(state, true, nodeIndent);
+ }
+ }
+
+ _line = state.line;
+ composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
+ keyTag = state.tag;
+ keyNode = state.result;
+ skipSeparationSpace(state, true, nodeIndent);
+
+ ch = state.input.charCodeAt(state.position);
+
+ if ((isExplicitPair || state.line === _line) && 0x3A/* : */ === ch) {
+ isPair = true;
+ ch = state.input.charCodeAt(++state.position);
+ skipSeparationSpace(state, true, nodeIndent);
+ composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
+ valueNode = state.result;
+ }
+
+ if (isMapping) {
+ storeMappingPair(state, _result, keyTag, keyNode, valueNode);
+ } else if (isPair) {
+ _result.push(storeMappingPair(state, null, keyTag, keyNode, valueNode));
+ } else {
+ _result.push(keyNode);
+ }
+
+ skipSeparationSpace(state, true, nodeIndent);
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (0x2C/* , */ === ch) {
+ readNext = true;
+ ch = state.input.charCodeAt(++state.position);
+ } else {
+ readNext = false;
+ }
+ }
+
+ throwError(state, 'unexpected end of the stream within a flow collection');
+}
+
+function readBlockScalar(state, nodeIndent) {
+ var captureStart,
+ folding,
+ chomping = CHOMPING_CLIP,
+ detectedIndent = false,
+ textIndent = nodeIndent,
+ emptyLines = 0,
+ atMoreIndented = false,
+ tmp,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch === 0x7C/* | */) {
+ folding = false;
+ } else if (ch === 0x3E/* > */) {
+ folding = true;
+ } else {
+ return false;
+ }
+
+ state.kind = 'scalar';
+ state.result = '';
+
+ while (0 !== ch) {
+ ch = state.input.charCodeAt(++state.position);
+
+ if (0x2B/* + */ === ch || 0x2D/* - */ === ch) {
+ if (CHOMPING_CLIP === chomping) {
+ chomping = (0x2B/* + */ === ch) ? CHOMPING_KEEP : CHOMPING_STRIP;
+ } else {
+ throwError(state, 'repeat of a chomping mode identifier');
+ }
+
+ } else if ((tmp = fromDecimalCode(ch)) >= 0) {
+ if (tmp === 0) {
+ throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one');
+ } else if (!detectedIndent) {
+ textIndent = nodeIndent + tmp - 1;
+ detectedIndent = true;
+ } else {
+ throwError(state, 'repeat of an indentation width identifier');
+ }
+
+ } else {
+ break;
+ }
+ }
+
+ if (is_WHITE_SPACE(ch)) {
+ do { ch = state.input.charCodeAt(++state.position); }
+ while (is_WHITE_SPACE(ch));
+
+ if (0x23/* # */ === ch) {
+ do { ch = state.input.charCodeAt(++state.position); }
+ while (!is_EOL(ch) && (0 !== ch));
+ }
+ }
+
+ while (0 !== ch) {
+ readLineBreak(state);
+ state.lineIndent = 0;
+
+ ch = state.input.charCodeAt(state.position);
+
+ while ((!detectedIndent || state.lineIndent < textIndent) &&
+ (0x20/* Space */ === ch)) {
+ state.lineIndent++;
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (!detectedIndent && state.lineIndent > textIndent) {
+ textIndent = state.lineIndent;
+ }
+
+ if (is_EOL(ch)) {
+ emptyLines++;
+ continue;
+ }
+
+ // End of the scalar.
+ if (state.lineIndent < textIndent) {
+
+ // Perform the chomping.
+ if (chomping === CHOMPING_KEEP) {
+ state.result += common.repeat('\n', emptyLines);
+ } else if (chomping === CHOMPING_CLIP) {
+ if (detectedIndent) { // i.e. only if the scalar is not empty.
+ state.result += '\n';
+ }
+ }
+
+ // Break this `while` cycle and go to the funciton's epilogue.
+ break;
+ }
+
+ // Folded style: use fancy rules to handle line breaks.
+ if (folding) {
+
+ // Lines starting with white space characters (more-indented lines) are not folded.
+ if (is_WHITE_SPACE(ch)) {
+ atMoreIndented = true;
+ state.result += common.repeat('\n', emptyLines + 1);
+
+ // End of more-indented block.
+ } else if (atMoreIndented) {
+ atMoreIndented = false;
+ state.result += common.repeat('\n', emptyLines + 1);
+
+ // Just one line break - perceive as the same line.
+ } else if (0 === emptyLines) {
+ if (detectedIndent) { // i.e. only if we have already read some scalar content.
+ state.result += ' ';
+ }
+
+ // Several line breaks - perceive as different lines.
+ } else {
+ state.result += common.repeat('\n', emptyLines);
+ }
+
+ // Literal style: just add exact number of line breaks between content lines.
+ } else if (detectedIndent) {
+ // If current line isn't the first one - count line break from the last content line.
+ state.result += common.repeat('\n', emptyLines + 1);
+ } else {
+ // In case of the first content line - count only empty lines.
+ }
+
+ detectedIndent = true;
+ emptyLines = 0;
+ captureStart = state.position;
+
+ while (!is_EOL(ch) && (0 !== ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ captureSegment(state, captureStart, state.position, false);
+ }
+
+ return true;
+}
+
+function readBlockSequence(state, nodeIndent) {
+ var _line,
+ _tag = state.tag,
+ _anchor = state.anchor,
+ _result = [],
+ following,
+ detected = false,
+ ch;
+
+ if (null !== state.anchor) {
+ state.anchorMap[state.anchor] = _result;
+ }
+
+ ch = state.input.charCodeAt(state.position);
+
+ while (0 !== ch) {
+
+ if (0x2D/* - */ !== ch) {
+ break;
+ }
+
+ following = state.input.charCodeAt(state.position + 1);
+
+ if (!is_WS_OR_EOL(following)) {
+ break;
+ }
+
+ detected = true;
+ state.position++;
+
+ if (skipSeparationSpace(state, true, -1)) {
+ if (state.lineIndent <= nodeIndent) {
+ _result.push(null);
+ ch = state.input.charCodeAt(state.position);
+ continue;
+ }
+ }
+
+ _line = state.line;
+ composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
+ _result.push(state.result);
+ skipSeparationSpace(state, true, -1);
+
+ ch = state.input.charCodeAt(state.position);
+
+ if ((state.line === _line || state.lineIndent > nodeIndent) && (0 !== ch)) {
+ throwError(state, 'bad indentation of a sequence entry');
+ } else if (state.lineIndent < nodeIndent) {
+ break;
+ }
+ }
+
+ if (detected) {
+ state.tag = _tag;
+ state.anchor = _anchor;
+ state.kind = 'sequence';
+ state.result = _result;
+ return true;
+ }
+ return false;
+}
+
+function readBlockMapping(state, nodeIndent, flowIndent) {
+ var following,
+ allowCompact,
+ _line,
+ _tag = state.tag,
+ _anchor = state.anchor,
+ _result = {},
+ keyTag = null,
+ keyNode = null,
+ valueNode = null,
+ atExplicitKey = false,
+ detected = false,
+ ch;
+
+ if (null !== state.anchor) {
+ state.anchorMap[state.anchor] = _result;
+ }
+
+ ch = state.input.charCodeAt(state.position);
+
+ while (0 !== ch) {
+ following = state.input.charCodeAt(state.position + 1);
+ _line = state.line; // Save the current line.
+
+ //
+ // Explicit notation case. There are two separate blocks:
+ // first for the key (denoted by "?") and second for the value (denoted by ":")
+ //
+ if ((0x3F/* ? */ === ch || 0x3A/* : */ === ch) && is_WS_OR_EOL(following)) {
+
+ if (0x3F/* ? */ === ch) {
+ if (atExplicitKey) {
+ storeMappingPair(state, _result, keyTag, keyNode, null);
+ keyTag = keyNode = valueNode = null;
+ }
+
+ detected = true;
+ atExplicitKey = true;
+ allowCompact = true;
+
+ } else if (atExplicitKey) {
+ // i.e. 0x3A/* : */ === character after the explicit key.
+ atExplicitKey = false;
+ allowCompact = true;
+
+ } else {
+ throwError(state, 'incomplete explicit mapping pair; a key node is missed');
+ }
+
+ state.position += 1;
+ ch = following;
+
+ //
+ // Implicit notation case. Flow-style node as the key first, then ":", and the value.
+ //
+ } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
+
+ if (state.line === _line) {
+ ch = state.input.charCodeAt(state.position);
+
+ while (is_WHITE_SPACE(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (0x3A/* : */ === ch) {
+ ch = state.input.charCodeAt(++state.position);
+
+ if (!is_WS_OR_EOL(ch)) {
+ throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping');
+ }
+
+ if (atExplicitKey) {
+ storeMappingPair(state, _result, keyTag, keyNode, null);
+ keyTag = keyNode = valueNode = null;
+ }
+
+ detected = true;
+ atExplicitKey = false;
+ allowCompact = false;
+ keyTag = state.tag;
+ keyNode = state.result;
+
+ } else if (detected) {
+ throwError(state, 'can not read an implicit mapping pair; a colon is missed');
+
+ } else {
+ state.tag = _tag;
+ state.anchor = _anchor;
+ return true; // Keep the result of `composeNode`.
+ }
+
+ } else if (detected) {
+ throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key');
+
+ } else {
+ state.tag = _tag;
+ state.anchor = _anchor;
+ return true; // Keep the result of `composeNode`.
+ }
+
+ } else {
+ break; // Reading is done. Go to the epilogue.
+ }
+
+ //
+ // Common reading code for both explicit and implicit notations.
+ //
+ if (state.line === _line || state.lineIndent > nodeIndent) {
+ if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
+ if (atExplicitKey) {
+ keyNode = state.result;
+ } else {
+ valueNode = state.result;
+ }
+ }
+
+ if (!atExplicitKey) {
+ storeMappingPair(state, _result, keyTag, keyNode, valueNode);
+ keyTag = keyNode = valueNode = null;
+ }
+
+ skipSeparationSpace(state, true, -1);
+ ch = state.input.charCodeAt(state.position);
+ }
+
+ if (state.lineIndent > nodeIndent && (0 !== ch)) {
+ throwError(state, 'bad indentation of a mapping entry');
+ } else if (state.lineIndent < nodeIndent) {
+ break;
+ }
+ }
+
+ //
+ // Epilogue.
+ //
+
+ // Special case: last mapping's node contains only the key in explicit notation.
+ if (atExplicitKey) {
+ storeMappingPair(state, _result, keyTag, keyNode, null);
+ }
+
+ // Expose the resulting mapping.
+ if (detected) {
+ state.tag = _tag;
+ state.anchor = _anchor;
+ state.kind = 'mapping';
+ state.result = _result;
+ }
+
+ return detected;
+}
+
+function readTagProperty(state) {
+ var _position,
+ isVerbatim = false,
+ isNamed = false,
+ tagHandle,
+ tagName,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (0x21/* ! */ !== ch) {
+ return false;
+ }
+
+ if (null !== state.tag) {
+ throwError(state, 'duplication of a tag property');
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+
+ if (0x3C/* < */ === ch) {
+ isVerbatim = true;
+ ch = state.input.charCodeAt(++state.position);
+
+ } else if (0x21/* ! */ === ch) {
+ isNamed = true;
+ tagHandle = '!!';
+ ch = state.input.charCodeAt(++state.position);
+
+ } else {
+ tagHandle = '!';
+ }
+
+ _position = state.position;
+
+ if (isVerbatim) {
+ do { ch = state.input.charCodeAt(++state.position); }
+ while (0 !== ch && 0x3E/* > */ !== ch);
+
+ if (state.position < state.length) {
+ tagName = state.input.slice(_position, state.position);
+ ch = state.input.charCodeAt(++state.position);
+ } else {
+ throwError(state, 'unexpected end of the stream within a verbatim tag');
+ }
+ } else {
+ while (0 !== ch && !is_WS_OR_EOL(ch)) {
+
+ if (0x21/* ! */ === ch) {
+ if (!isNamed) {
+ tagHandle = state.input.slice(_position - 1, state.position + 1);
+
+ if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
+ throwError(state, 'named tag handle cannot contain such characters');
+ }
+
+ isNamed = true;
+ _position = state.position + 1;
+ } else {
+ throwError(state, 'tag suffix cannot contain exclamation marks');
+ }
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ tagName = state.input.slice(_position, state.position);
+
+ if (PATTERN_FLOW_INDICATORS.test(tagName)) {
+ throwError(state, 'tag suffix cannot contain flow indicator characters');
+ }
+ }
+
+ if (tagName && !PATTERN_TAG_URI.test(tagName)) {
+ throwError(state, 'tag name cannot contain such characters: ' + tagName);
+ }
+
+ if (isVerbatim) {
+ state.tag = tagName;
+
+ } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) {
+ state.tag = state.tagMap[tagHandle] + tagName;
+
+ } else if ('!' === tagHandle) {
+ state.tag = '!' + tagName;
+
+ } else if ('!!' === tagHandle) {
+ state.tag = 'tag:yaml.org,2002:' + tagName;
+
+ } else {
+ throwError(state, 'undeclared tag handle "' + tagHandle + '"');
+ }
+
+ return true;
+}
+
+function readAnchorProperty(state) {
+ var _position,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (0x26/* & */ !== ch) {
+ return false;
+ }
+
+ if (null !== state.anchor) {
+ throwError(state, 'duplication of an anchor property');
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+ _position = state.position;
+
+ while (0 !== ch && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (state.position === _position) {
+ throwError(state, 'name of an anchor node must contain at least one character');
+ }
+
+ state.anchor = state.input.slice(_position, state.position);
+ return true;
+}
+
+function readAlias(state) {
+ var _position, alias,
+ len = state.length,
+ input = state.input,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (0x2A/* * */ !== ch) {
+ return false;
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+ _position = state.position;
+
+ while (0 !== ch && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (state.position === _position) {
+ throwError(state, 'name of an alias node must contain at least one character');
+ }
+
+ alias = state.input.slice(_position, state.position);
+
+ if (!state.anchorMap.hasOwnProperty(alias)) {
+ throwError(state, 'unidentified alias "' + alias + '"');
+ }
+
+ state.result = state.anchorMap[alias];
+ skipSeparationSpace(state, true, -1);
+ return true;
+}
+
+function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
+ var allowBlockStyles,
+ allowBlockScalars,
+ allowBlockCollections,
+ indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this<parent
+ atNewLine = false,
+ hasContent = false,
+ typeIndex,
+ typeQuantity,
+ type,
+ flowIndent,
+ blockIndent,
+ _result;
+
+ state.tag = null;
+ state.anchor = null;
+ state.kind = null;
+ state.result = null;
+
+ allowBlockStyles = allowBlockScalars = allowBlockCollections =
+ CONTEXT_BLOCK_OUT === nodeContext ||
+ CONTEXT_BLOCK_IN === nodeContext;
+
+ if (allowToSeek) {
+ if (skipSeparationSpace(state, true, -1)) {
+ atNewLine = true;
+
+ if (state.lineIndent > parentIndent) {
+ indentStatus = 1;
+ } else if (state.lineIndent === parentIndent) {
+ indentStatus = 0;
+ } else if (state.lineIndent < parentIndent) {
+ indentStatus = -1;
+ }
+ }
+ }
+
+ if (1 === indentStatus) {
+ while (readTagProperty(state) || readAnchorProperty(state)) {
+ if (skipSeparationSpace(state, true, -1)) {
+ atNewLine = true;
+ allowBlockCollections = allowBlockStyles;
+
+ if (state.lineIndent > parentIndent) {
+ indentStatus = 1;
+ } else if (state.lineIndent === parentIndent) {
+ indentStatus = 0;
+ } else if (state.lineIndent < parentIndent) {
+ indentStatus = -1;
+ }
+ } else {
+ allowBlockCollections = false;
+ }
+ }
+ }
+
+ if (allowBlockCollections) {
+ allowBlockCollections = atNewLine || allowCompact;
+ }
+
+ if (1 === indentStatus || CONTEXT_BLOCK_OUT === nodeContext) {
+ if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
+ flowIndent = parentIndent;
+ } else {
+ flowIndent = parentIndent + 1;
+ }
+
+ blockIndent = state.position - state.lineStart;
+
+ if (1 === indentStatus) {
+ if (allowBlockCollections &&
+ (readBlockSequence(state, blockIndent) ||
+ readBlockMapping(state, blockIndent, flowIndent)) ||
+ readFlowCollection(state, flowIndent)) {
+ hasContent = true;
+ } else {
+ if ((allowBlockScalars && readBlockScalar(state, flowIndent)) ||
+ readSingleQuotedScalar(state, flowIndent) ||
+ readDoubleQuotedScalar(state, flowIndent)) {
+ hasContent = true;
+
+ } else if (readAlias(state)) {
+ hasContent = true;
+
+ if (null !== state.tag || null !== state.anchor) {
+ throwError(state, 'alias node should not have any properties');
+ }
+
+ } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
+ hasContent = true;
+
+ if (null === state.tag) {
+ state.tag = '?';
+ }
+ }
+
+ if (null !== state.anchor) {
+ state.anchorMap[state.anchor] = state.result;
+ }
+ }
+ } else if (0 === indentStatus) {
+ // Special case: block sequences are allowed to have same indentation level as the parent.
+ // http://www.yaml.org/spec/1.2/spec.html#id2799784
+ hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
+ }
+ }
+
+ if (null !== state.tag && '!' !== state.tag) {
+ if ('?' === state.tag) {
+ for (typeIndex = 0, typeQuantity = state.implicitTypes.length;
+ typeIndex < typeQuantity;
+ typeIndex += 1) {
+ type = state.implicitTypes[typeIndex];
+
+ // Implicit resolving is not allowed for non-scalar types, and '?'
+ // non-specific tag is only assigned to plain scalars. So, it isn't
+ // needed to check for 'kind' conformity.
+
+ if (type.resolve(state.result)) { // `state.result` updated in resolver if matched
+ state.result = type.construct(state.result);
+ state.tag = type.tag;
+ if (null !== state.anchor) {
+ state.anchorMap[state.anchor] = state.result;
+ }
+ break;
+ }
+ }
+ } else if (_hasOwnProperty.call(state.typeMap, state.tag)) {
+ type = state.typeMap[state.tag];
+
+ if (null !== state.result && type.kind !== state.kind) {
+ throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"');
+ }
+
+ if (!type.resolve(state.result)) { // `state.result` updated in resolver if matched
+ throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag');
+ } else {
+ state.result = type.construct(state.result);
+ if (null !== state.anchor) {
+ state.anchorMap[state.anchor] = state.result;
+ }
+ }
+ } else {
+ throwWarning(state, 'unknown tag !<' + state.tag + '>');
+ }
+ }
+
+ return null !== state.tag || null !== state.anchor || hasContent;
+}
+
+function readDocument(state) {
+ var documentStart = state.position,
+ _position,
+ directiveName,
+ directiveArgs,
+ hasDirectives = false,
+ ch;
+
+ state.version = null;
+ state.checkLineBreaks = state.legacy;
+ state.tagMap = {};
+ state.anchorMap = {};
+
+ while (0 !== (ch = state.input.charCodeAt(state.position))) {
+ skipSeparationSpace(state, true, -1);
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (state.lineIndent > 0 || 0x25/* % */ !== ch) {
+ break;
+ }
+
+ hasDirectives = true;
+ ch = state.input.charCodeAt(++state.position);
+ _position = state.position;
+
+ while (0 !== ch && !is_WS_OR_EOL(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ directiveName = state.input.slice(_position, state.position);
+ directiveArgs = [];
+
+ if (directiveName.length < 1) {
+ throwError(state, 'directive name must not be less than one character in length');
+ }
+
+ while (0 !== ch) {
+ while (is_WHITE_SPACE(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (0x23/* # */ === ch) {
+ do { ch = state.input.charCodeAt(++state.position); }
+ while (0 !== ch && !is_EOL(ch));
+ break;
+ }
+
+ if (is_EOL(ch)) {
+ break;
+ }
+
+ _position = state.position;
+
+ while (0 !== ch && !is_WS_OR_EOL(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ directiveArgs.push(state.input.slice(_position, state.position));
+ }
+
+ if (0 !== ch) {
+ readLineBreak(state);
+ }
+
+ if (_hasOwnProperty.call(directiveHandlers, directiveName)) {
+ directiveHandlers[directiveName](state, directiveName, directiveArgs);
+ } else {
+ throwWarning(state, 'unknown document directive "' + directiveName + '"');
+ }
+ }
+
+ skipSeparationSpace(state, true, -1);
+
+ if (0 === state.lineIndent &&
+ 0x2D/* - */ === state.input.charCodeAt(state.position) &&
+ 0x2D/* - */ === state.input.charCodeAt(state.position + 1) &&
+ 0x2D/* - */ === state.input.charCodeAt(state.position + 2)) {
+ state.position += 3;
+ skipSeparationSpace(state, true, -1);
+
+ } else if (hasDirectives) {
+ throwError(state, 'directives end mark is expected');
+ }
+
+ composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
+ skipSeparationSpace(state, true, -1);
+
+ if (state.checkLineBreaks &&
+ PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {
+ throwWarning(state, 'non-ASCII line breaks are interpreted as content');
+ }
+
+ state.documents.push(state.result);
+
+ if (state.position === state.lineStart && testDocumentSeparator(state)) {
+
+ if (0x2E/* . */ === state.input.charCodeAt(state.position)) {
+ state.position += 3;
+ skipSeparationSpace(state, true, -1);
+ }
+ return;
+ }
+
+ if (state.position < (state.length - 1)) {
+ throwError(state, 'end of the stream or a document separator is expected');
+ } else {
+ return;
+ }
+}
+
+
+function loadDocuments(input, options) {
+ input = String(input);
+ options = options || {};
+
+ if (input.length !== 0) {
+
+ // Add tailing `\n` if not exists
+ if (0x0A/* LF */ !== input.charCodeAt(input.length - 1) &&
+ 0x0D/* CR */ !== input.charCodeAt(input.length - 1)) {
+ input += '\n';
+ }
+
+ // Strip BOM
+ if (input.charCodeAt(0) === 0xFEFF) {
+ input = input.slice(1);
+ }
+ }
+
+ var state = new State(input, options);
+
+ if (PATTERN_NON_PRINTABLE.test(state.input)) {
+ throwError(state, 'the stream contains non-printable characters');
+ }
+
+ // Use 0 as string terminator. That significantly simplifies bounds check.
+ state.input += '\0';
+
+ while (0x20/* Space */ === state.input.charCodeAt(state.position)) {
+ state.lineIndent += 1;
+ state.position += 1;
+ }
+
+ while (state.position < (state.length - 1)) {
+ readDocument(state);
+ }
+
+ return state.documents;
+}
+
+
+function loadAll(input, iterator, options) {
+ var documents = loadDocuments(input, options), index, length;
+
+ for (index = 0, length = documents.length; index < length; index += 1) {
+ iterator(documents[index]);
+ }
+}
+
+
+function load(input, options) {
+ var documents = loadDocuments(input, options), index, length;
+
+ if (0 === documents.length) {
+ /*eslint-disable no-undefined*/
+ return undefined;
+ } else if (1 === documents.length) {
+ return documents[0];
+ }
+ throw new YAMLException('expected a single document in the stream, but found more');
+}
+
+
+function safeLoadAll(input, output, options) {
+ loadAll(input, output, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
+}
+
+
+function safeLoad(input, options) {
+ return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
+}
+
+
+module.exports.loadAll = loadAll;
+module.exports.load = load;
+module.exports.safeLoadAll = safeLoadAll;
+module.exports.safeLoad = safeLoad;
+
+},{"./common":23,"./exception":25,"./mark":27,"./schema/default_full":30,"./schema/default_safe":31}],27:[function(require,module,exports){
+'use strict';
+
+
+var common = require('./common');
+
+
+function Mark(name, buffer, position, line, column) {
+ this.name = name;
+ this.buffer = buffer;
+ this.position = position;
+ this.line = line;
+ this.column = column;
+}
+
+
+Mark.prototype.getSnippet = function getSnippet(indent, maxLength) {
+ var head, start, tail, end, snippet;
+
+ if (!this.buffer) {
+ return null;
+ }
+
+ indent = indent || 4;
+ maxLength = maxLength || 75;
+
+ head = '';
+ start = this.position;
+
+ while (start > 0 && -1 === '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1))) {
+ start -= 1;
+ if (this.position - start > (maxLength / 2 - 1)) {
+ head = ' ... ';
+ start += 5;
+ break;
+ }
+ }
+
+ tail = '';
+ end = this.position;
+
+ while (end < this.buffer.length && -1 === '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end))) {
+ end += 1;
+ if (end - this.position > (maxLength / 2 - 1)) {
+ tail = ' ... ';
+ end -= 5;
+ break;
+ }
+ }
+
+ snippet = this.buffer.slice(start, end);
+
+ return common.repeat(' ', indent) + head + snippet + tail + '\n' +
+ common.repeat(' ', indent + this.position - start + head.length) + '^';
+};
+
+
+Mark.prototype.toString = function toString(compact) {
+ var snippet, where = '';
+
+ if (this.name) {
+ where += 'in "' + this.name + '" ';
+ }
+
+ where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1);
+
+ if (!compact) {
+ snippet = this.getSnippet();
+
+ if (snippet) {
+ where += ':\n' + snippet;
+ }
+ }
+
+ return where;
+};
+
+
+module.exports = Mark;
+
+},{"./common":23}],28:[function(require,module,exports){
+'use strict';
+
+/*eslint-disable max-len*/
+
+var common = require('./common');
+var YAMLException = require('./exception');
+var Type = require('./type');
+
+
+function compileList(schema, name, result) {
+ var exclude = [];
+
+ schema.include.forEach(function (includedSchema) {
+ result = compileList(includedSchema, name, result);
+ });
+
+ schema[name].forEach(function (currentType) {
+ result.forEach(function (previousType, previousIndex) {
+ if (previousType.tag === currentType.tag) {
+ exclude.push(previousIndex);
+ }
+ });
+
+ result.push(currentType);
+ });
+
+ return result.filter(function (type, index) {
+ return -1 === exclude.indexOf(index);
+ });
+}
+
+
+function compileMap(/* lists... */) {
+ var result = {}, index, length;
+
+ function collectType(type) {
+ result[type.tag] = type;
+ }
+
+ for (index = 0, length = arguments.length; index < length; index += 1) {
+ arguments[index].forEach(collectType);
+ }
+
+ return result;
+}
+
+
+function Schema(definition) {
+ this.include = definition.include || [];
+ this.implicit = definition.implicit || [];
+ this.explicit = definition.explicit || [];
+
+ this.implicit.forEach(function (type) {
+ if (type.loadKind && 'scalar' !== type.loadKind) {
+ throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.');
+ }
+ });
+
+ this.compiledImplicit = compileList(this, 'implicit', []);
+ this.compiledExplicit = compileList(this, 'explicit', []);
+ this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit);
+}
+
+
+Schema.DEFAULT = null;
+
+
+Schema.create = function createSchema() {
+ var schemas, types;
+
+ switch (arguments.length) {
+ case 1:
+ schemas = Schema.DEFAULT;
+ types = arguments[0];
+ break;
+
+ case 2:
+ schemas = arguments[0];
+ types = arguments[1];
+ break;
+
+ default:
+ throw new YAMLException('Wrong number of arguments for Schema.create function');
+ }
+
+ schemas = common.toArray(schemas);
+ types = common.toArray(types);
+
+ if (!schemas.every(function (schema) { return schema instanceof Schema; })) {
+ throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.');
+ }
+
+ if (!types.every(function (type) { return type instanceof Type; })) {
+ throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.');
+ }
+
+ return new Schema({
+ include: schemas,
+ explicit: types
+ });
+};
+
+
+module.exports = Schema;
+
+},{"./common":23,"./exception":25,"./type":34}],29:[function(require,module,exports){
+// Standard YAML's Core schema.
+// http://www.yaml.org/spec/1.2/spec.html#id2804923
+//
+// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.
+// So, Core schema has no distinctions from JSON schema is JS-YAML.
+
+
+'use strict';
+
+
+var Schema = require('../schema');
+
+
+module.exports = new Schema({
+ include: [
+ require('./json')
+ ]
+});
+
+},{"../schema":28,"./json":33}],30:[function(require,module,exports){
+// JS-YAML's default schema for `load` function.
+// It is not described in the YAML specification.
+//
+// This schema is based on JS-YAML's default safe schema and includes
+// JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function.
+//
+// Also this schema is used as default base schema at `Schema.create` function.
+
+
+'use strict';
+
+
+var Schema = require('../schema');
+
+
+module.exports = Schema.DEFAULT = new Schema({
+ include: [
+ require('./default_safe')
+ ],
+ explicit: [
+ require('../type/js/undefined'),
+ require('../type/js/regexp'),
+ require('../type/js/function')
+ ]
+});
+
+},{"../schema":28,"../type/js/function":39,"../type/js/regexp":40,"../type/js/undefined":41,"./default_safe":31}],31:[function(require,module,exports){
+// JS-YAML's default schema for `safeLoad` function.
+// It is not described in the YAML specification.
+//
+// This schema is based on standard YAML's Core schema and includes most of
+// extra types described at YAML tag repository. (http://yaml.org/type/)
+
+
+'use strict';
+
+
+var Schema = require('../schema');
+
+
+module.exports = new Schema({
+ include: [
+ require('./core')
+ ],
+ implicit: [
+ require('../type/timestamp'),
+ require('../type/merge')
+ ],
+ explicit: [
+ require('../type/binary'),
+ require('../type/omap'),
+ require('../type/pairs'),
+ require('../type/set')
+ ]
+});
+
+},{"../schema":28,"../type/binary":35,"../type/merge":43,"../type/omap":45,"../type/pairs":46,"../type/set":48,"../type/timestamp":50,"./core":29}],32:[function(require,module,exports){
+// Standard YAML's Failsafe schema.
+// http://www.yaml.org/spec/1.2/spec.html#id2802346
+
+
+'use strict';
+
+
+var Schema = require('../schema');
+
+
+module.exports = new Schema({
+ explicit: [
+ require('../type/str'),
+ require('../type/seq'),
+ require('../type/map')
+ ]
+});
+
+},{"../schema":28,"../type/map":42,"../type/seq":47,"../type/str":49}],33:[function(require,module,exports){
+// Standard YAML's JSON schema.
+// http://www.yaml.org/spec/1.2/spec.html#id2803231
+//
+// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.
+// So, this schema is not such strict as defined in the YAML specification.
+// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc.
+
+
+'use strict';
+
+
+var Schema = require('../schema');
+
+
+module.exports = new Schema({
+ include: [
+ require('./failsafe')
+ ],
+ implicit: [
+ require('../type/null'),
+ require('../type/bool'),
+ require('../type/int'),
+ require('../type/float')
+ ]
+});
+
+},{"../schema":28,"../type/bool":36,"../type/float":37,"../type/int":38,"../type/null":44,"./failsafe":32}],34:[function(require,module,exports){
+'use strict';
+
+var YAMLException = require('./exception');
+
+var TYPE_CONSTRUCTOR_OPTIONS = [
+ 'kind',
+ 'resolve',
+ 'construct',
+ 'instanceOf',
+ 'predicate',
+ 'represent',
+ 'defaultStyle',
+ 'styleAliases'
+];
+
+var YAML_NODE_KINDS = [
+ 'scalar',
+ 'sequence',
+ 'mapping'
+];
+
+function compileStyleAliases(map) {
+ var result = {};
+
+ if (null !== map) {
+ Object.keys(map).forEach(function (style) {
+ map[style].forEach(function (alias) {
+ result[String(alias)] = style;
+ });
+ });
+ }
+
+ return result;
+}
+
+function Type(tag, options) {
+ options = options || {};
+
+ Object.keys(options).forEach(function (name) {
+ if (-1 === TYPE_CONSTRUCTOR_OPTIONS.indexOf(name)) {
+ throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
+ }
+ });
+
+ // TODO: Add tag format check.
+ this.tag = tag;
+ this.kind = options['kind'] || null;
+ this.resolve = options['resolve'] || function () { return true; };
+ this.construct = options['construct'] || function (data) { return data; };
+ this.instanceOf = options['instanceOf'] || null;
+ this.predicate = options['predicate'] || null;
+ this.represent = options['represent'] || null;
+ this.defaultStyle = options['defaultStyle'] || null;
+ this.styleAliases = compileStyleAliases(options['styleAliases'] || null);
+
+ if (-1 === YAML_NODE_KINDS.indexOf(this.kind)) {
+ throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
+ }
+}
+
+module.exports = Type;
+
+},{"./exception":25}],35:[function(require,module,exports){
+'use strict';
+
+/*eslint-disable no-bitwise*/
+
+// A trick for browserified version.
+// Since we make browserifier to ignore `buffer` module, NodeBuffer will be undefined
+var NodeBuffer = require('buffer').Buffer;
+var Type = require('../type');
+
+
+// [ 64, 65, 66 ] -> [ padding, CR, LF ]
+var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r';
+
+
+function resolveYamlBinary(data) {
+ if (null === data) {
+ return false;
+ }
+
+ var code, idx, bitlen = 0, len = 0, max = data.length, map = BASE64_MAP;
+
+ // Convert one by one.
+ for (idx = 0; idx < max; idx++) {
+ code = map.indexOf(data.charAt(idx));
+
+ // Skip CR/LF
+ if (code > 64) { continue; }
+
+ // Fail on illegal characters
+ if (code < 0) { return false; }
+
+ bitlen += 6;
+ }
+
+ // If there are any bits left, source was corrupted
+ return (bitlen % 8) === 0;
+}
+
+function constructYamlBinary(data) {
+ var code, idx, tailbits,
+ input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan
+ max = input.length,
+ map = BASE64_MAP,
+ bits = 0,
+ result = [];
+
+ // Collect by 6*4 bits (3 bytes)
+
+ for (idx = 0; idx < max; idx++) {
+ if ((idx % 4 === 0) && idx) {
+ result.push((bits >> 16) & 0xFF);
+ result.push((bits >> 8) & 0xFF);
+ result.push(bits & 0xFF);
+ }
+
+ bits = (bits << 6) | map.indexOf(input.charAt(idx));
+ }
+
+ // Dump tail
+
+ tailbits = (max % 4) * 6;
+
+ if (tailbits === 0) {
+ result.push((bits >> 16) & 0xFF);
+ result.push((bits >> 8) & 0xFF);
+ result.push(bits & 0xFF);
+ } else if (tailbits === 18) {
+ result.push((bits >> 10) & 0xFF);
+ result.push((bits >> 2) & 0xFF);
+ } else if (tailbits === 12) {
+ result.push((bits >> 4) & 0xFF);
+ }
+
+ // Wrap into Buffer for NodeJS and leave Array for browser
+ if (NodeBuffer) {
+ return new NodeBuffer(result);
+ }
+
+ return result;
+}
+
+function representYamlBinary(object /*, style*/) {
+ var result = '', bits = 0, idx, tail,
+ max = object.length,
+ map = BASE64_MAP;
+
+ // Convert every three bytes to 4 ASCII characters.
+
+ for (idx = 0; idx < max; idx++) {
+ if ((idx % 3 === 0) && idx) {
+ result += map[(bits >> 18) & 0x3F];
+ result += map[(bits >> 12) & 0x3F];
+ result += map[(bits >> 6) & 0x3F];
+ result += map[bits & 0x3F];
+ }
+
+ bits = (bits << 8) + object[idx];
+ }
+
+ // Dump tail
+
+ tail = max % 3;
+
+ if (tail === 0) {
+ result += map[(bits >> 18) & 0x3F];
+ result += map[(bits >> 12) & 0x3F];
+ result += map[(bits >> 6) & 0x3F];
+ result += map[bits & 0x3F];
+ } else if (tail === 2) {
+ result += map[(bits >> 10) & 0x3F];
+ result += map[(bits >> 4) & 0x3F];
+ result += map[(bits << 2) & 0x3F];
+ result += map[64];
+ } else if (tail === 1) {
+ result += map[(bits >> 2) & 0x3F];
+ result += map[(bits << 4) & 0x3F];
+ result += map[64];
+ result += map[64];
+ }
+
+ return result;
+}
+
+function isBinary(object) {
+ return NodeBuffer && NodeBuffer.isBuffer(object);
+}
+
+module.exports = new Type('tag:yaml.org,2002:binary', {
+ kind: 'scalar',
+ resolve: resolveYamlBinary,
+ construct: constructYamlBinary,
+ predicate: isBinary,
+ represent: representYamlBinary
+});
+
+},{"../type":34,"buffer":12}],36:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+function resolveYamlBoolean(data) {
+ if (null === data) {
+ return false;
+ }
+
+ var max = data.length;
+
+ return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) ||
+ (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE'));
+}
+
+function constructYamlBoolean(data) {
+ return data === 'true' ||
+ data === 'True' ||
+ data === 'TRUE';
+}
+
+function isBoolean(object) {
+ return '[object Boolean]' === Object.prototype.toString.call(object);
+}
+
+module.exports = new Type('tag:yaml.org,2002:bool', {
+ kind: 'scalar',
+ resolve: resolveYamlBoolean,
+ construct: constructYamlBoolean,
+ predicate: isBoolean,
+ represent: {
+ lowercase: function (object) { return object ? 'true' : 'false'; },
+ uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; },
+ camelcase: function (object) { return object ? 'True' : 'False'; }
+ },
+ defaultStyle: 'lowercase'
+});
+
+},{"../type":34}],37:[function(require,module,exports){
+'use strict';
+
+var common = require('../common');
+var Type = require('../type');
+
+var YAML_FLOAT_PATTERN = new RegExp(
+ '^(?:[-+]?(?:[0-9][0-9_]*)\\.[0-9_]*(?:[eE][-+][0-9]+)?' +
+ '|\\.[0-9_]+(?:[eE][-+][0-9]+)?' +
+ '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' +
+ '|[-+]?\\.(?:inf|Inf|INF)' +
+ '|\\.(?:nan|NaN|NAN))$');
+
+function resolveYamlFloat(data) {
+ if (null === data) {
+ return false;
+ }
+
+ var value, sign, base, digits;
+
+ if (!YAML_FLOAT_PATTERN.test(data)) {
+ return false;
+ }
+ return true;
+}
+
+function constructYamlFloat(data) {
+ var value, sign, base, digits;
+
+ value = data.replace(/_/g, '').toLowerCase();
+ sign = '-' === value[0] ? -1 : 1;
+ digits = [];
+
+ if (0 <= '+-'.indexOf(value[0])) {
+ value = value.slice(1);
+ }
+
+ if ('.inf' === value) {
+ return (1 === sign) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
+
+ } else if ('.nan' === value) {
+ return NaN;
+
+ } else if (0 <= value.indexOf(':')) {
+ value.split(':').forEach(function (v) {
+ digits.unshift(parseFloat(v, 10));
+ });
+
+ value = 0.0;
+ base = 1;
+
+ digits.forEach(function (d) {
+ value += d * base;
+ base *= 60;
+ });
+
+ return sign * value;
+
+ }
+ return sign * parseFloat(value, 10);
+}
+
+function representYamlFloat(object, style) {
+ if (isNaN(object)) {
+ switch (style) {
+ case 'lowercase':
+ return '.nan';
+ case 'uppercase':
+ return '.NAN';
+ case 'camelcase':
+ return '.NaN';
+ }
+ } else if (Number.POSITIVE_INFINITY === object) {
+ switch (style) {
+ case 'lowercase':
+ return '.inf';
+ case 'uppercase':
+ return '.INF';
+ case 'camelcase':
+ return '.Inf';
+ }
+ } else if (Number.NEGATIVE_INFINITY === object) {
+ switch (style) {
+ case 'lowercase':
+ return '-.inf';
+ case 'uppercase':
+ return '-.INF';
+ case 'camelcase':
+ return '-.Inf';
+ }
+ } else if (common.isNegativeZero(object)) {
+ return '-0.0';
+ }
+ return object.toString(10);
+}
+
+function isFloat(object) {
+ return ('[object Number]' === Object.prototype.toString.call(object)) &&
+ (0 !== object % 1 || common.isNegativeZero(object));
+}
+
+module.exports = new Type('tag:yaml.org,2002:float', {
+ kind: 'scalar',
+ resolve: resolveYamlFloat,
+ construct: constructYamlFloat,
+ predicate: isFloat,
+ represent: representYamlFloat,
+ defaultStyle: 'lowercase'
+});
+
+},{"../common":23,"../type":34}],38:[function(require,module,exports){
+'use strict';
+
+var common = require('../common');
+var Type = require('../type');
+
+function isHexCode(c) {
+ return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) ||
+ ((0x41/* A */ <= c) && (c <= 0x46/* F */)) ||
+ ((0x61/* a */ <= c) && (c <= 0x66/* f */));
+}
+
+function isOctCode(c) {
+ return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */));
+}
+
+function isDecCode(c) {
+ return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */));
+}
+
+function resolveYamlInteger(data) {
+ if (null === data) {
+ return false;
+ }
+
+ var max = data.length,
+ index = 0,
+ hasDigits = false,
+ ch;
+
+ if (!max) { return false; }
+
+ ch = data[index];
+
+ // sign
+ if (ch === '-' || ch === '+') {
+ ch = data[++index];
+ }
+
+ if (ch === '0') {
+ // 0
+ if (index + 1 === max) { return true; }
+ ch = data[++index];
+
+ // base 2, base 8, base 16
+
+ if (ch === 'b') {
+ // base 2
+ index++;
+
+ for (; index < max; index++) {
+ ch = data[index];
+ if (ch === '_') { continue; }
+ if (ch !== '0' && ch !== '1') {
+ return false;
+ }
+ hasDigits = true;
+ }
+ return hasDigits;
+ }
+
+
+ if (ch === 'x') {
+ // base 16
+ index++;
+
+ for (; index < max; index++) {
+ ch = data[index];
+ if (ch === '_') { continue; }
+ if (!isHexCode(data.charCodeAt(index))) {
+ return false;
+ }
+ hasDigits = true;
+ }
+ return hasDigits;
+ }
+
+ // base 8
+ for (; index < max; index++) {
+ ch = data[index];
+ if (ch === '_') { continue; }
+ if (!isOctCode(data.charCodeAt(index))) {
+ return false;
+ }
+ hasDigits = true;
+ }
+ return hasDigits;
+ }
+
+ // base 10 (except 0) or base 60
+
+ for (; index < max; index++) {
+ ch = data[index];
+ if (ch === '_') { continue; }
+ if (ch === ':') { break; }
+ if (!isDecCode(data.charCodeAt(index))) {
+ return false;
+ }
+ hasDigits = true;
+ }
+
+ if (!hasDigits) { return false; }
+
+ // if !base60 - done;
+ if (ch !== ':') { return true; }
+
+ // base60 almost not used, no needs to optimize
+ return /^(:[0-5]?[0-9])+$/.test(data.slice(index));
+}
+
+function constructYamlInteger(data) {
+ var value = data, sign = 1, ch, base, digits = [];
+
+ if (value.indexOf('_') !== -1) {
+ value = value.replace(/_/g, '');
+ }
+
+ ch = value[0];
+
+ if (ch === '-' || ch === '+') {
+ if (ch === '-') { sign = -1; }
+ value = value.slice(1);
+ ch = value[0];
+ }
+
+ if ('0' === value) {
+ return 0;
+ }
+
+ if (ch === '0') {
+ if (value[1] === 'b') {
+ return sign * parseInt(value.slice(2), 2);
+ }
+ if (value[1] === 'x') {
+ return sign * parseInt(value, 16);
+ }
+ return sign * parseInt(value, 8);
+
+ }
+
+ if (value.indexOf(':') !== -1) {
+ value.split(':').forEach(function (v) {
+ digits.unshift(parseInt(v, 10));
+ });
+
+ value = 0;
+ base = 1;
+
+ digits.forEach(function (d) {
+ value += (d * base);
+ base *= 60;
+ });
+
+ return sign * value;
+
+ }
+
+ return sign * parseInt(value, 10);
+}
+
+function isInteger(object) {
+ return ('[object Number]' === Object.prototype.toString.call(object)) &&
+ (0 === object % 1 && !common.isNegativeZero(object));
+}
+
+module.exports = new Type('tag:yaml.org,2002:int', {
+ kind: 'scalar',
+ resolve: resolveYamlInteger,
+ construct: constructYamlInteger,
+ predicate: isInteger,
+ represent: {
+ binary: function (object) { return '0b' + object.toString(2); },
+ octal: function (object) { return '0' + object.toString(8); },
+ decimal: function (object) { return object.toString(10); },
+ hexadecimal: function (object) { return '0x' + object.toString(16).toUpperCase(); }
+ },
+ defaultStyle: 'decimal',
+ styleAliases: {
+ binary: [ 2, 'bin' ],
+ octal: [ 8, 'oct' ],
+ decimal: [ 10, 'dec' ],
+ hexadecimal: [ 16, 'hex' ]
+ }
+});
+
+},{"../common":23,"../type":34}],39:[function(require,module,exports){
+'use strict';
+
+var esprima;
+
+// Browserified version does not have esprima
+//
+// 1. For node.js just require module as deps
+// 2. For browser try to require mudule via external AMD system.
+// If not found - try to fallback to window.esprima. If not
+// found too - then fail to parse.
+//
+try {
+ esprima = require('esprima');
+} catch (_) {
+ /*global window */
+ if (typeof window !== 'undefined') { esprima = window.esprima; }
+}
+
+var Type = require('../../type');
+
+function resolveJavascriptFunction(data) {
+ if (null === data) {
+ return false;
+ }
+
+ try {
+ var source = '(' + data + ')',
+ ast = esprima.parse(source, { range: true }),
+ params = [],
+ body;
+
+ if ('Program' !== ast.type ||
+ 1 !== ast.body.length ||
+ 'ExpressionStatement' !== ast.body[0].type ||
+ 'FunctionExpression' !== ast.body[0].expression.type) {
+ return false;
+ }
+
+ return true;
+ } catch (err) {
+ return false;
+ }
+}
+
+function constructJavascriptFunction(data) {
+ /*jslint evil:true*/
+
+ var source = '(' + data + ')',
+ ast = esprima.parse(source, { range: true }),
+ params = [],
+ body;
+
+ if ('Program' !== ast.type ||
+ 1 !== ast.body.length ||
+ 'ExpressionStatement' !== ast.body[0].type ||
+ 'FunctionExpression' !== ast.body[0].expression.type) {
+ throw new Error('Failed to resolve function');
+ }
+
+ ast.body[0].expression.params.forEach(function (param) {
+ params.push(param.name);
+ });
+
+ body = ast.body[0].expression.body.range;
+
+ // Esprima's ranges include the first '{' and the last '}' characters on
+ // function expressions. So cut them out.
+ /*eslint-disable no-new-func*/
+ return new Function(params, source.slice(body[0] + 1, body[1] - 1));
+}
+
+function representJavascriptFunction(object /*, style*/) {
+ return object.toString();
+}
+
+function isFunction(object) {
+ return '[object Function]' === Object.prototype.toString.call(object);
+}
+
+module.exports = new Type('tag:yaml.org,2002:js/function', {
+ kind: 'scalar',
+ resolve: resolveJavascriptFunction,
+ construct: constructJavascriptFunction,
+ predicate: isFunction,
+ represent: representJavascriptFunction
+});
+
+},{"../../type":34,"esprima":51}],40:[function(require,module,exports){
+'use strict';
+
+var Type = require('../../type');
+
+function resolveJavascriptRegExp(data) {
+ if (null === data) {
+ return false;
+ }
+
+ if (0 === data.length) {
+ return false;
+ }
+
+ var regexp = data,
+ tail = /\/([gim]*)$/.exec(data),
+ modifiers = '';
+
+ // if regexp starts with '/' it can have modifiers and must be properly closed
+ // `/foo/gim` - modifiers tail can be maximum 3 chars
+ if ('/' === regexp[0]) {
+ if (tail) {
+ modifiers = tail[1];
+ }
+
+ if (modifiers.length > 3) { return false; }
+ // if expression starts with /, is should be properly terminated
+ if (regexp[regexp.length - modifiers.length - 1] !== '/') { return false; }
+
+ regexp = regexp.slice(1, regexp.length - modifiers.length - 1);
+ }
+
+ try {
+ var dummy = new RegExp(regexp, modifiers);
+ return true;
+ } catch (error) {
+ return false;
+ }
+}
+
+function constructJavascriptRegExp(data) {
+ var regexp = data,
+ tail = /\/([gim]*)$/.exec(data),
+ modifiers = '';
+
+ // `/foo/gim` - tail can be maximum 4 chars
+ if ('/' === regexp[0]) {
+ if (tail) {
+ modifiers = tail[1];
+ }
+ regexp = regexp.slice(1, regexp.length - modifiers.length - 1);
+ }
+
+ return new RegExp(regexp, modifiers);
+}
+
+function representJavascriptRegExp(object /*, style*/) {
+ var result = '/' + object.source + '/';
+
+ if (object.global) {
+ result += 'g';
+ }
+
+ if (object.multiline) {
+ result += 'm';
+ }
+
+ if (object.ignoreCase) {
+ result += 'i';
+ }
+
+ return result;
+}
+
+function isRegExp(object) {
+ return '[object RegExp]' === Object.prototype.toString.call(object);
+}
+
+module.exports = new Type('tag:yaml.org,2002:js/regexp', {
+ kind: 'scalar',
+ resolve: resolveJavascriptRegExp,
+ construct: constructJavascriptRegExp,
+ predicate: isRegExp,
+ represent: representJavascriptRegExp
+});
+
+},{"../../type":34}],41:[function(require,module,exports){
+'use strict';
+
+var Type = require('../../type');
+
+function resolveJavascriptUndefined() {
+ return true;
+}
+
+function constructJavascriptUndefined() {
+ /*eslint-disable no-undefined*/
+ return undefined;
+}
+
+function representJavascriptUndefined() {
+ return '';
+}
+
+function isUndefined(object) {
+ return 'undefined' === typeof object;
+}
+
+module.exports = new Type('tag:yaml.org,2002:js/undefined', {
+ kind: 'scalar',
+ resolve: resolveJavascriptUndefined,
+ construct: constructJavascriptUndefined,
+ predicate: isUndefined,
+ represent: representJavascriptUndefined
+});
+
+},{"../../type":34}],42:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+module.exports = new Type('tag:yaml.org,2002:map', {
+ kind: 'mapping',
+ construct: function (data) { return null !== data ? data : {}; }
+});
+
+},{"../type":34}],43:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+function resolveYamlMerge(data) {
+ return '<<' === data || null === data;
+}
+
+module.exports = new Type('tag:yaml.org,2002:merge', {
+ kind: 'scalar',
+ resolve: resolveYamlMerge
+});
+
+},{"../type":34}],44:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+function resolveYamlNull(data) {
+ if (null === data) {
+ return true;
+ }
+
+ var max = data.length;
+
+ return (max === 1 && data === '~') ||
+ (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL'));
+}
+
+function constructYamlNull() {
+ return null;
+}
+
+function isNull(object) {
+ return null === object;
+}
+
+module.exports = new Type('tag:yaml.org,2002:null', {
+ kind: 'scalar',
+ resolve: resolveYamlNull,
+ construct: constructYamlNull,
+ predicate: isNull,
+ represent: {
+ canonical: function () { return '~'; },
+ lowercase: function () { return 'null'; },
+ uppercase: function () { return 'NULL'; },
+ camelcase: function () { return 'Null'; }
+ },
+ defaultStyle: 'lowercase'
+});
+
+},{"../type":34}],45:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+var _hasOwnProperty = Object.prototype.hasOwnProperty;
+var _toString = Object.prototype.toString;
+
+function resolveYamlOmap(data) {
+ if (null === data) {
+ return true;
+ }
+
+ var objectKeys = [], index, length, pair, pairKey, pairHasKey,
+ object = data;
+
+ for (index = 0, length = object.length; index < length; index += 1) {
+ pair = object[index];
+ pairHasKey = false;
+
+ if ('[object Object]' !== _toString.call(pair)) {
+ return false;
+ }
+
+ for (pairKey in pair) {
+ if (_hasOwnProperty.call(pair, pairKey)) {
+ if (!pairHasKey) {
+ pairHasKey = true;
+ } else {
+ return false;
+ }
+ }
+ }
+
+ if (!pairHasKey) {
+ return false;
+ }
+
+ if (-1 === objectKeys.indexOf(pairKey)) {
+ objectKeys.push(pairKey);
+ } else {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+function constructYamlOmap(data) {
+ return null !== data ? data : [];
+}
+
+module.exports = new Type('tag:yaml.org,2002:omap', {
+ kind: 'sequence',
+ resolve: resolveYamlOmap,
+ construct: constructYamlOmap
+});
+
+},{"../type":34}],46:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+var _toString = Object.prototype.toString;
+
+function resolveYamlPairs(data) {
+ if (null === data) {
+ return true;
+ }
+
+ var index, length, pair, keys, result,
+ object = data;
+
+ result = new Array(object.length);
+
+ for (index = 0, length = object.length; index < length; index += 1) {
+ pair = object[index];
+
+ if ('[object Object]' !== _toString.call(pair)) {
+ return false;
+ }
+
+ keys = Object.keys(pair);
+
+ if (1 !== keys.length) {
+ return false;
+ }
+
+ result[index] = [ keys[0], pair[keys[0]] ];
+ }
+
+ return true;
+}
+
+function constructYamlPairs(data) {
+ if (null === data) {
+ return [];
+ }
+
+ var index, length, pair, keys, result,
+ object = data;
+
+ result = new Array(object.length);
+
+ for (index = 0, length = object.length; index < length; index += 1) {
+ pair = object[index];
+
+ keys = Object.keys(pair);
+
+ result[index] = [ keys[0], pair[keys[0]] ];
+ }
+
+ return result;
+}
+
+module.exports = new Type('tag:yaml.org,2002:pairs', {
+ kind: 'sequence',
+ resolve: resolveYamlPairs,
+ construct: constructYamlPairs
+});
+
+},{"../type":34}],47:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+module.exports = new Type('tag:yaml.org,2002:seq', {
+ kind: 'sequence',
+ construct: function (data) { return null !== data ? data : []; }
+});
+
+},{"../type":34}],48:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+var _hasOwnProperty = Object.prototype.hasOwnProperty;
+
+function resolveYamlSet(data) {
+ if (null === data) {
+ return true;
+ }
+
+ var key, object = data;
+
+ for (key in object) {
+ if (_hasOwnProperty.call(object, key)) {
+ if (null !== object[key]) {
+ return false;
+ }
+ }
+ }
+
+ return true;
+}
+
+function constructYamlSet(data) {
+ return null !== data ? data : {};
+}
+
+module.exports = new Type('tag:yaml.org,2002:set', {
+ kind: 'mapping',
+ resolve: resolveYamlSet,
+ construct: constructYamlSet
+});
+
+},{"../type":34}],49:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+module.exports = new Type('tag:yaml.org,2002:str', {
+ kind: 'scalar',
+ construct: function (data) { return null !== data ? data : ''; }
+});
+
+},{"../type":34}],50:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+var YAML_TIMESTAMP_REGEXP = new RegExp(
+ '^([0-9][0-9][0-9][0-9])' + // [1] year
+ '-([0-9][0-9]?)' + // [2] month
+ '-([0-9][0-9]?)' + // [3] day
+ '(?:(?:[Tt]|[ \\t]+)' + // ...
+ '([0-9][0-9]?)' + // [4] hour
+ ':([0-9][0-9])' + // [5] minute
+ ':([0-9][0-9])' + // [6] second
+ '(?:\\.([0-9]*))?' + // [7] fraction
+ '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour
+ '(?::([0-9][0-9]))?))?)?$'); // [11] tz_minute
+
+function resolveYamlTimestamp(data) {
+ if (null === data) {
+ return false;
+ }
+
+ var match, year, month, day, hour, minute, second, fraction = 0,
+ delta = null, tz_hour, tz_minute, date;
+
+ match = YAML_TIMESTAMP_REGEXP.exec(data);
+
+ if (null === match) {
+ return false;
+ }
+
+ return true;
+}
+
+function constructYamlTimestamp(data) {
+ var match, year, month, day, hour, minute, second, fraction = 0,
+ delta = null, tz_hour, tz_minute, date;
+
+ match = YAML_TIMESTAMP_REGEXP.exec(data);
+
+ if (null === match) {
+ throw new Error('Date resolve error');
+ }
+
+ // match: [1] year [2] month [3] day
+
+ year = +(match[1]);
+ month = +(match[2]) - 1; // JS month starts with 0
+ day = +(match[3]);
+
+ if (!match[4]) { // no hour
+ return new Date(Date.UTC(year, month, day));
+ }
+
+ // match: [4] hour [5] minute [6] second [7] fraction
+
+ hour = +(match[4]);
+ minute = +(match[5]);
+ second = +(match[6]);
+
+ if (match[7]) {
+ fraction = match[7].slice(0, 3);
+ while (fraction.length < 3) { // milli-seconds
+ fraction += '0';
+ }
+ fraction = +fraction;
+ }
+
+ // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute
+
+ if (match[9]) {
+ tz_hour = +(match[10]);
+ tz_minute = +(match[11] || 0);
+ delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds
+ if ('-' === match[9]) {
+ delta = -delta;
+ }
+ }
+
+ date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
+
+ if (delta) {
+ date.setTime(date.getTime() - delta);
+ }
+
+ return date;
+}
+
+function representYamlTimestamp(object /*, style*/) {
+ return object.toISOString();
+}
+
+module.exports = new Type('tag:yaml.org,2002:timestamp', {
+ kind: 'scalar',
+ resolve: resolveYamlTimestamp,
+ construct: constructYamlTimestamp,
+ instanceOf: Date,
+ represent: representYamlTimestamp
+});
+
+},{"../type":34}],51:[function(require,module,exports){
+/*
+ Copyright (C) 2013 Ariya Hidayat <ariya.hidayat@gmail.com>
+ Copyright (C) 2013 Thaddee Tyl <thaddee.tyl@gmail.com>
+ Copyright (C) 2013 Mathias Bynens <mathias@qiwi.be>
+ Copyright (C) 2012 Ariya Hidayat <ariya.hidayat@gmail.com>
+ Copyright (C) 2012 Mathias Bynens <mathias@qiwi.be>
+ Copyright (C) 2012 Joost-Wim Boekesteijn <joost-wim@boekesteijn.nl>
+ Copyright (C) 2012 Kris Kowal <kris.kowal@cixar.com>
+ Copyright (C) 2012 Yusuke Suzuki <utatane.tea@gmail.com>
+ Copyright (C) 2012 Arpad Borsos <arpad.borsos@googlemail.com>
+ Copyright (C) 2011 Ariya Hidayat <ariya.hidayat@gmail.com>
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+(function (root, factory) {
+ 'use strict';
+
+ // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js,
+ // Rhino, and plain browser loading.
+
+ /* istanbul ignore next */
+ if (typeof define === 'function' && define.amd) {
+ define(['exports'], factory);
+ } else if (typeof exports !== 'undefined') {
+ factory(exports);
+ } else {
+ factory((root.esprima = {}));
+ }
+}(this, function (exports) {
+ 'use strict';
+
+ var Token,
+ TokenName,
+ FnExprTokens,
+ Syntax,
+ PlaceHolders,
+ Messages,
+ Regex,
+ source,
+ strict,
+ sourceType,
+ index,
+ lineNumber,
+ lineStart,
+ hasLineTerminator,
+ lastIndex,
+ lastLineNumber,
+ lastLineStart,
+ startIndex,
+ startLineNumber,
+ startLineStart,
+ scanning,
+ length,
+ lookahead,
+ state,
+ extra,
+ isBindingElement,
+ isAssignmentTarget,
+ firstCoverInitializedNameError;
+
+ Token = {
+ BooleanLiteral: 1,
+ EOF: 2,
+ Identifier: 3,
+ Keyword: 4,
+ NullLiteral: 5,
+ NumericLiteral: 6,
+ Punctuator: 7,
+ StringLiteral: 8,
+ RegularExpression: 9,
+ Template: 10
+ };
+
+ TokenName = {};
+ TokenName[Token.BooleanLiteral] = 'Boolean';
+ TokenName[Token.EOF] = '<end>';
+ TokenName[Token.Identifier] = 'Identifier';
+ TokenName[Token.Keyword] = 'Keyword';
+ TokenName[Token.NullLiteral] = 'Null';
+ TokenName[Token.NumericLiteral] = 'Numeric';
+ TokenName[Token.Punctuator] = 'Punctuator';
+ TokenName[Token.StringLiteral] = 'String';
+ TokenName[Token.RegularExpression] = 'RegularExpression';
+ TokenName[Token.Template] = 'Template';
+
+ // A function following one of those tokens is an expression.
+ FnExprTokens = ['(', '{', '[', 'in', 'typeof', 'instanceof', 'new',
+ 'return', 'case', 'delete', 'throw', 'void',
+ // assignment operators
+ '=', '+=', '-=', '*=', '/=', '%=', '<<=', '>>=', '>>>=',
+ '&=', '|=', '^=', ',',
+ // binary/unary operators
+ '+', '-', '*', '/', '%', '++', '--', '<<', '>>', '>>>', '&',
+ '|', '^', '!', '~', '&&', '||', '?', ':', '===', '==', '>=',
+ '<=', '<', '>', '!=', '!=='];
+
+ Syntax = {
+ AssignmentExpression: 'AssignmentExpression',
+ AssignmentPattern: 'AssignmentPattern',
+ ArrayExpression: 'ArrayExpression',
+ ArrayPattern: 'ArrayPattern',
+ ArrowFunctionExpression: 'ArrowFunctionExpression',
+ BlockStatement: 'BlockStatement',
+ BinaryExpression: 'BinaryExpression',
+ BreakStatement: 'BreakStatement',
+ CallExpression: 'CallExpression',
+ CatchClause: 'CatchClause',
+ ClassBody: 'ClassBody',
+ ClassDeclaration: 'ClassDeclaration',
+ ClassExpression: 'ClassExpression',
+ ConditionalExpression: 'ConditionalExpression',
+ ContinueStatement: 'ContinueStatement',
+ DoWhileStatement: 'DoWhileStatement',
+ DebuggerStatement: 'DebuggerStatement',
+ EmptyStatement: 'EmptyStatement',
+ ExportAllDeclaration: 'ExportAllDeclaration',
+ ExportDefaultDeclaration: 'ExportDefaultDeclaration',
+ ExportNamedDeclaration: 'ExportNamedDeclaration',
+ ExportSpecifier: 'ExportSpecifier',
+ ExpressionStatement: 'ExpressionStatement',
+ ForStatement: 'ForStatement',
+ ForInStatement: 'ForInStatement',
+ FunctionDeclaration: 'FunctionDeclaration',
+ FunctionExpression: 'FunctionExpression',
+ Identifier: 'Identifier',
+ IfStatement: 'IfStatement',
+ ImportDeclaration: 'ImportDeclaration',
+ ImportDefaultSpecifier: 'ImportDefaultSpecifier',
+ ImportNamespaceSpecifier: 'ImportNamespaceSpecifier',
+ ImportSpecifier: 'ImportSpecifier',
+ Literal: 'Literal',
+ LabeledStatement: 'LabeledStatement',
+ LogicalExpression: 'LogicalExpression',
+ MemberExpression: 'MemberExpression',
+ MethodDefinition: 'MethodDefinition',
+ NewExpression: 'NewExpression',
+ ObjectExpression: 'ObjectExpression',
+ ObjectPattern: 'ObjectPattern',
+ Program: 'Program',
+ Property: 'Property',
+ RestElement: 'RestElement',
+ ReturnStatement: 'ReturnStatement',
+ SequenceExpression: 'SequenceExpression',
+ SpreadElement: 'SpreadElement',
+ Super: 'Super',
+ SwitchCase: 'SwitchCase',
+ SwitchStatement: 'SwitchStatement',
+ TaggedTemplateExpression: 'TaggedTemplateExpression',
+ TemplateElement: 'TemplateElement',
+ TemplateLiteral: 'TemplateLiteral',
+ ThisExpression: 'ThisExpression',
+ ThrowStatement: 'ThrowStatement',
+ TryStatement: 'TryStatement',
+ UnaryExpression: 'UnaryExpression',
+ UpdateExpression: 'UpdateExpression',
+ VariableDeclaration: 'VariableDeclaration',
+ VariableDeclarator: 'VariableDeclarator',
+ WhileStatement: 'WhileStatement',
+ WithStatement: 'WithStatement'
+ };
+
+ PlaceHolders = {
+ ArrowParameterPlaceHolder: 'ArrowParameterPlaceHolder'
+ };
+
+ // Error messages should be identical to V8.
+ Messages = {
+ UnexpectedToken: 'Unexpected token %0',
+ UnexpectedNumber: 'Unexpected number',
+ UnexpectedString: 'Unexpected string',
+ UnexpectedIdentifier: 'Unexpected identifier',
+ UnexpectedReserved: 'Unexpected reserved word',
+ UnexpectedTemplate: 'Unexpected quasi %0',
+ UnexpectedEOS: 'Unexpected end of input',
+ NewlineAfterThrow: 'Illegal newline after throw',
+ InvalidRegExp: 'Invalid regular expression',
+ UnterminatedRegExp: 'Invalid regular expression: missing /',
+ InvalidLHSInAssignment: 'Invalid left-hand side in assignment',
+ InvalidLHSInForIn: 'Invalid left-hand side in for-in',
+ MultipleDefaultsInSwitch: 'More than one default clause in switch statement',
+ NoCatchOrFinally: 'Missing catch or finally after try',
+ UnknownLabel: 'Undefined label \'%0\'',
+ Redeclaration: '%0 \'%1\' has already been declared',
+ IllegalContinue: 'Illegal continue statement',
+ IllegalBreak: 'Illegal break statement',
+ IllegalReturn: 'Illegal return statement',
+ StrictModeWith: 'Strict mode code may not include a with statement',
+ StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode',
+ StrictVarName: 'Variable name may not be eval or arguments in strict mode',
+ StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode',
+ StrictParamDupe: 'Strict mode function may not have duplicate parameter names',
+ StrictFunctionName: 'Function name may not be eval or arguments in strict mode',
+ StrictOctalLiteral: 'Octal literals are not allowed in strict mode.',
+ StrictDelete: 'Delete of an unqualified identifier in strict mode.',
+ StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode',
+ StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode',
+ StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode',
+ StrictReservedWord: 'Use of future reserved word in strict mode',
+ TemplateOctalLiteral: 'Octal literals are not allowed in template strings.',
+ ParameterAfterRestParameter: 'Rest parameter must be last formal parameter',
+ DefaultRestParameter: 'Unexpected token =',
+ ObjectPatternAsRestParameter: 'Unexpected token {',
+ DuplicateProtoProperty: 'Duplicate __proto__ fields are not allowed in object literals',
+ ConstructorSpecialMethod: 'Class constructor may not be an accessor',
+ DuplicateConstructor: 'A class may only have one constructor',
+ StaticPrototype: 'Classes may not have static property named prototype',
+ MissingFromClause: 'Unexpected token',
+ NoAsAfterImportNamespace: 'Unexpected token',
+ InvalidModuleSpecifier: 'Unexpected token',
+ IllegalImportDeclaration: 'Unexpected token',
+ IllegalExportDeclaration: 'Unexpected token'
+ };
+
+ // See also tools/generate-unicode-regex.py.
+ Regex = {
+ NonAsciiIdentifierStart: new RegExp('[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]'),
+ NonAsciiIdentifierPart: new RegExp('[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]')
+ };
+
+ // Ensure the condition is true, otherwise throw an error.
+ // This is only to have a better contract semantic, i.e. another safety net
+ // to catch a logic error. The condition shall be fulfilled in normal case.
+ // Do NOT use this to enforce a certain condition on any user input.
+
+ function assert(condition, message) {
+ /* istanbul ignore if */
+ if (!condition) {
+ throw new Error('ASSERT: ' + message);
+ }
+ }
+
+ function isDecimalDigit(ch) {
+ return (ch >= 0x30 && ch <= 0x39); // 0..9
+ }
+
+ function isHexDigit(ch) {
+ return '0123456789abcdefABCDEF'.indexOf(ch) >= 0;
+ }
+
+ function isOctalDigit(ch) {
+ return '01234567'.indexOf(ch) >= 0;
+ }
+
+ function octalToDecimal(ch) {
+ // \0 is not octal escape sequence
+ var octal = (ch !== '0'), code = '01234567'.indexOf(ch);
+
+ if (index < length && isOctalDigit(source[index])) {
+ octal = true;
+ code = code * 8 + '01234567'.indexOf(source[index++]);
+
+ // 3 digits are only allowed when string starts
+ // with 0, 1, 2, 3
+ if ('0123'.indexOf(ch) >= 0 &&
+ index < length &&
+ isOctalDigit(source[index])) {
+ code = code * 8 + '01234567'.indexOf(source[index++]);
+ }
+ }
+
+ return {
+ code: code,
+ octal: octal
+ };
+ }
+
+ // 7.2 White Space
+
+ function isWhiteSpace(ch) {
+ return (ch === 0x20) || (ch === 0x09) || (ch === 0x0B) || (ch === 0x0C) || (ch === 0xA0) ||
+ (ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(ch) >= 0);
+ }
+
+ // 7.3 Line Terminators
+
+ function isLineTerminator(ch) {
+ return (ch === 0x0A) || (ch === 0x0D) || (ch === 0x2028) || (ch === 0x2029);
+ }
+
+ // 7.6 Identifier Names and Identifiers
+
+ function isIdentifierStart(ch) {
+ return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)
+ (ch >= 0x41 && ch <= 0x5A) || // A..Z
+ (ch >= 0x61 && ch <= 0x7A) || // a..z
+ (ch === 0x5C) || // \ (backslash)
+ ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch)));
+ }
+
+ function isIdentifierPart(ch) {
+ return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)
+ (ch >= 0x41 && ch <= 0x5A) || // A..Z
+ (ch >= 0x61 && ch <= 0x7A) || // a..z
+ (ch >= 0x30 && ch <= 0x39) || // 0..9
+ (ch === 0x5C) || // \ (backslash)
+ ((ch >= 0x80) && Regex.NonAsciiIdentifierPart.test(String.fromCharCode(ch)));
+ }
+
+ // 7.6.1.2 Future Reserved Words
+
+ function isFutureReservedWord(id) {
+ switch (id) {
+ case 'enum':
+ case 'export':
+ case 'import':
+ case 'super':
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ // 11.6.2.2 Future Reserved Words
+
+ function isStrictModeReservedWord(id) {
+ switch (id) {
+ case 'implements':
+ case 'interface':
+ case 'package':
+ case 'private':
+ case 'protected':
+ case 'public':
+ case 'static':
+ case 'yield':
+ case 'let':
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ function isRestrictedWord(id) {
+ return id === 'eval' || id === 'arguments';
+ }
+
+ // 7.6.1.1 Keywords
+
+ function isKeyword(id) {
+
+ // 'const' is specialized as Keyword in V8.
+ // 'yield' and 'let' are for compatibility with SpiderMonkey and ES.next.
+ // Some others are from future reserved words.
+
+ switch (id.length) {
+ case 2:
+ return (id === 'if') || (id === 'in') || (id === 'do');
+ case 3:
+ return (id === 'var') || (id === 'for') || (id === 'new') ||
+ (id === 'try') || (id === 'let');
+ case 4:
+ return (id === 'this') || (id === 'else') || (id === 'case') ||
+ (id === 'void') || (id === 'with') || (id === 'enum');
+ case 5:
+ return (id === 'while') || (id === 'break') || (id === 'catch') ||
+ (id === 'throw') || (id === 'const') || (id === 'yield') ||
+ (id === 'class') || (id === 'super');
+ case 6:
+ return (id === 'return') || (id === 'typeof') || (id === 'delete') ||
+ (id === 'switch') || (id === 'export') || (id === 'import');
+ case 7:
+ return (id === 'default') || (id === 'finally') || (id === 'extends');
+ case 8:
+ return (id === 'function') || (id === 'continue') || (id === 'debugger');
+ case 10:
+ return (id === 'instanceof');
+ default:
+ return false;
+ }
+ }
+
+ // 7.4 Comments
+
+ function addComment(type, value, start, end, loc) {
+ var comment;
+
+ assert(typeof start === 'number', 'Comment must have valid position');
+
+ state.lastCommentStart = start;
+
+ comment = {
+ type: type,
+ value: value
+ };
+ if (extra.range) {
+ comment.range = [start, end];
+ }
+ if (extra.loc) {
+ comment.loc = loc;
+ }
+ extra.comments.push(comment);
+ if (extra.attachComment) {
+ extra.leadingComments.push(comment);
+ extra.trailingComments.push(comment);
+ }
+ }
+
+ function skipSingleLineComment(offset) {
+ var start, loc, ch, comment;
+
+ start = index - offset;
+ loc = {
+ start: {
+ line: lineNumber,
+ column: index - lineStart - offset
+ }
+ };
+
+ while (index < length) {
+ ch = source.charCodeAt(index);
+ ++index;
+ if (isLineTerminator(ch)) {
+ hasLineTerminator = true;
+ if (extra.comments) {
+ comment = source.slice(start + offset, index - 1);
+ loc.end = {
+ line: lineNumber,
+ column: index - lineStart - 1
+ };
+ addComment('Line', comment, start, index - 1, loc);
+ }
+ if (ch === 13 && source.charCodeAt(index) === 10) {
+ ++index;
+ }
+ ++lineNumber;
+ lineStart = index;
+ return;
+ }
+ }
+
+ if (extra.comments) {
+ comment = source.slice(start + offset, index);
+ loc.end = {
+ line: lineNumber,
+ column: index - lineStart
+ };
+ addComment('Line', comment, start, index, loc);
+ }
+ }
+
+ function skipMultiLineComment() {
+ var start, loc, ch, comment;
+
+ if (extra.comments) {
+ start = index - 2;
+ loc = {
+ start: {
+ line: lineNumber,
+ column: index - lineStart - 2
+ }
+ };
+ }
+
+ while (index < length) {
+ ch = source.charCodeAt(index);
+ if (isLineTerminator(ch)) {
+ if (ch === 0x0D && source.charCodeAt(index + 1) === 0x0A) {
+ ++index;
+ }
+ hasLineTerminator = true;
+ ++lineNumber;
+ ++index;
+ lineStart = index;
+ } else if (ch === 0x2A) {
+ // Block comment ends with '*/'.
+ if (source.charCodeAt(index + 1) === 0x2F) {
+ ++index;
+ ++index;
+ if (extra.comments) {
+ comment = source.slice(start + 2, index - 2);
+ loc.end = {
+ line: lineNumber,
+ column: index - lineStart
+ };
+ addComment('Block', comment, start, index, loc);
+ }
+ return;
+ }
+ ++index;
+ } else {
+ ++index;
+ }
+ }
+
+ // Ran off the end of the file - the whole thing is a comment
+ if (extra.comments) {
+ loc.end = {
+ line: lineNumber,
+ column: index - lineStart
+ };
+ comment = source.slice(start + 2, index);
+ addComment('Block', comment, start, index, loc);
+ }
+ tolerateUnexpectedToken();
+ }
+
+ function skipComment() {
+ var ch, start;
+ hasLineTerminator = false;
+
+ start = (index === 0);
+ while (index < length) {
+ ch = source.charCodeAt(index);
+
+ if (isWhiteSpace(ch)) {
+ ++index;
+ } else if (isLineTerminator(ch)) {
+ hasLineTerminator = true;
+ ++index;
+ if (ch === 0x0D && source.charCodeAt(index) === 0x0A) {
+ ++index;
+ }
+ ++lineNumber;
+ lineStart = index;
+ start = true;
+ } else if (ch === 0x2F) { // U+002F is '/'
+ ch = source.charCodeAt(index + 1);
+ if (ch === 0x2F) {
+ ++index;
+ ++index;
+ skipSingleLineComment(2);
+ start = true;
+ } else if (ch === 0x2A) { // U+002A is '*'
+ ++index;
+ ++index;
+ skipMultiLineComment();
+ } else {
+ break;
+ }
+ } else if (start && ch === 0x2D) { // U+002D is '-'
+ // U+003E is '>'
+ if ((source.charCodeAt(index + 1) === 0x2D) && (source.charCodeAt(index + 2) === 0x3E)) {
+ // '-->' is a single-line comment
+ index += 3;
+ skipSingleLineComment(3);
+ } else {
+ break;
+ }
+ } else if (ch === 0x3C) { // U+003C is '<'
+ if (source.slice(index + 1, index + 4) === '!--') {
+ ++index; // `<`
+ ++index; // `!`
+ ++index; // `-`
+ ++index; // `-`
+ skipSingleLineComment(4);
+ } else {
+ break;
+ }
+ } else {
+ break;
+ }
+ }
+ }
+
+ function scanHexEscape(prefix) {
+ var i, len, ch, code = 0;
+
+ len = (prefix === 'u') ? 4 : 2;
+ for (i = 0; i < len; ++i) {
+ if (index < length && isHexDigit(source[index])) {
+ ch = source[index++];
+ code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());
+ } else {
+ return '';
+ }
+ }
+ return String.fromCharCode(code);
+ }
+
+ function scanUnicodeCodePointEscape() {
+ var ch, code, cu1, cu2;
+
+ ch = source[index];
+ code = 0;
+
+ // At least, one hex digit is required.
+ if (ch === '}') {
+ throwUnexpectedToken();
+ }
+
+ while (index < length) {
+ ch = source[index++];
+ if (!isHexDigit(ch)) {
+ break;
+ }
+ code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());
+ }
+
+ if (code > 0x10FFFF || ch !== '}') {
+ throwUnexpectedToken();
+ }
+
+ // UTF-16 Encoding
+ if (code <= 0xFFFF) {
+ return String.fromCharCode(code);
+ }
+ cu1 = ((code - 0x10000) >> 10) + 0xD800;
+ cu2 = ((code - 0x10000) & 1023) + 0xDC00;
+ return String.fromCharCode(cu1, cu2);
+ }
+
+ function getEscapedIdentifier() {
+ var ch, id;
+
+ ch = source.charCodeAt(index++);
+ id = String.fromCharCode(ch);
+
+ // '\u' (U+005C, U+0075) denotes an escaped character.
+ if (ch === 0x5C) {
+ if (source.charCodeAt(index) !== 0x75) {
+ throwUnexpectedToken();
+ }
+ ++index;
+ ch = scanHexEscape('u');
+ if (!ch || ch === '\\' || !isIdentifierStart(ch.charCodeAt(0))) {
+ throwUnexpectedToken();
+ }
+ id = ch;
+ }
+
+ while (index < length) {
+ ch = source.charCodeAt(index);
+ if (!isIdentifierPart(ch)) {
+ break;
+ }
+ ++index;
+ id += String.fromCharCode(ch);
+
+ // '\u' (U+005C, U+0075) denotes an escaped character.
+ if (ch === 0x5C) {
+ id = id.substr(0, id.length - 1);
+ if (source.charCodeAt(index) !== 0x75) {
+ throwUnexpectedToken();
+ }
+ ++index;
+ ch = scanHexEscape('u');
+ if (!ch || ch === '\\' || !isIdentifierPart(ch.charCodeAt(0))) {
+ throwUnexpectedToken();
+ }
+ id += ch;
+ }
+ }
+
+ return id;
+ }
+
+ function getIdentifier() {
+ var start, ch;
+
+ start = index++;
+ while (index < length) {
+ ch = source.charCodeAt(index);
+ if (ch === 0x5C) {
+ // Blackslash (U+005C) marks Unicode escape sequence.
+ index = start;
+ return getEscapedIdentifier();
+ }
+ if (isIdentifierPart(ch)) {
+ ++index;
+ } else {
+ break;
+ }
+ }
+
+ return source.slice(start, index);
+ }
+
+ function scanIdentifier() {
+ var start, id, type;
+
+ start = index;
+
+ // Backslash (U+005C) starts an escaped character.
+ id = (source.charCodeAt(index) === 0x5C) ? getEscapedIdentifier() : getIdentifier();
+
+ // There is no keyword or literal with only one character.
+ // Thus, it must be an identifier.
+ if (id.length === 1) {
+ type = Token.Identifier;
+ } else if (isKeyword(id)) {
+ type = Token.Keyword;
+ } else if (id === 'null') {
+ type = Token.NullLiteral;
+ } else if (id === 'true' || id === 'false') {
+ type = Token.BooleanLiteral;
+ } else {
+ type = Token.Identifier;
+ }
+
+ return {
+ type: type,
+ value: id,
+ lineNumber: lineNumber,
+ lineStart: lineStart,
+ start: start,
+ end: index
+ };
+ }
+
+
+ // 7.7 Punctuators
+
+ function scanPunctuator() {
+ var token, str;
+
+ token = {
+ type: Token.Punctuator,
+ value: '',
+ lineNumber: lineNumber,
+ lineStart: lineStart,
+ start: index,
+ end: index
+ };
+
+ // Check for most common single-character punctuators.
+ str = source[index];
+ switch (str) {
+
+ case '(':
+ if (extra.tokenize) {
+ extra.openParenToken = extra.tokens.length;
+ }
+ ++index;
+ break;
+
+ case '{':
+ if (extra.tokenize) {
+ extra.openCurlyToken = extra.tokens.length;
+ }
+ state.curlyStack.push('{');
+ ++index;
+ break;
+
+ case '.':
+ ++index;
+ if (source[index] === '.' && source[index + 1] === '.') {
+ // Spread operator: ...
+ index += 2;
+ str = '...';
+ }
+ break;
+
+ case '}':
+ ++index;
+ state.curlyStack.pop();
+ break;
+ case ')':
+ case ';':
+ case ',':
+ case '[':
+ case ']':
+ case ':':
+ case '?':
+ case '~':
+ ++index;
+ break;
+
+ default:
+ // 4-character punctuator.
+ str = source.substr(index, 4);
+ if (str === '>>>=') {
+ index += 4;
+ } else {
+
+ // 3-character punctuators.
+ str = str.substr(0, 3);
+ if (str === '===' || str === '!==' || str === '>>>' ||
+ str === '<<=' || str === '>>=') {
+ index += 3;
+ } else {
+
+ // 2-character punctuators.
+ str = str.substr(0, 2);
+ if (str === '&&' || str === '||' || str === '==' || str === '!=' ||
+ str === '+=' || str === '-=' || str === '*=' || str === '/=' ||
+ str === '++' || str === '--' || str === '<<' || str === '>>' ||
+ str === '&=' || str === '|=' || str === '^=' || str === '%=' ||
+ str === '<=' || str === '>=' || str === '=>') {
+ index += 2;
+ } else {
+
+ // 1-character punctuators.
+ str = source[index];
+ if ('<>=!+-*%&|^/'.indexOf(str) >= 0) {
+ ++index;
+ }
+ }
+ }
+ }
+ }
+
+ if (index === token.start) {
+ throwUnexpectedToken();
+ }
+
+ token.end = index;
+ token.value = str;
+ return token;
+ }
+
+ // 7.8.3 Numeric Literals
+
+ function scanHexLiteral(start) {
+ var number = '';
+
+ while (index < length) {
+ if (!isHexDigit(source[index])) {
+ break;
+ }
+ number += source[index++];
+ }
+
+ if (number.length === 0) {
+ throwUnexpectedToken();
+ }
+
+ if (isIdentifierStart(source.charCodeAt(index))) {
+ throwUnexpectedToken();
+ }
+
+ return {
+ type: Token.NumericLiteral,
+ value: parseInt('0x' + number, 16),
+ lineNumber: lineNumber,
+ lineStart: lineStart,
+ start: start,
+ end: index
+ };
+ }
+
+ function scanBinaryLiteral(start) {
+ var ch, number;
+
+ number = '';
+
+ while (index < length) {
+ ch = source[index];
+ if (ch !== '0' && ch !== '1') {
+ break;
+ }
+ number += source[index++];
+ }
+
+ if (number.length === 0) {
+ // only 0b or 0B
+ throwUnexpectedToken();
+ }
+
+ if (index < length) {
+ ch = source.charCodeAt(index);
+ /* istanbul ignore else */
+ if (isIdentifierStart(ch) || isDecimalDigit(ch)) {
+ throwUnexpectedToken();
+ }
+ }
+
+ return {
+ type: Token.NumericLiteral,
+ value: parseInt(number, 2),
+ lineNumber: lineNumber,
+ lineStart: lineStart,
+ start: start,
+ end: index
+ };
+ }
+
+ function scanOctalLiteral(prefix, start) {
+ var number, octal;
+
+ if (isOctalDigit(prefix)) {
+ octal = true;
+ number = '0' + source[index++];
+ } else {
+ octal = false;
+ ++index;
+ number = '';
+ }
+
+ while (index < length) {
+ if (!isOctalDigit(source[index])) {
+ break;
+ }
+ number += source[index++];
+ }
+
+ if (!octal && number.length === 0) {
+ // only 0o or 0O
+ throwUnexpectedToken();
+ }
+
+ if (isIdentifierStart(source.charCodeAt(index)) || isDecimalDigit(source.charCodeAt(index))) {
+ throwUnexpectedToken();
+ }
+
+ return {
+ type: Token.NumericLiteral,
+ value: parseInt(number, 8),
+ octal: octal,
+ lineNumber: lineNumber,
+ lineStart: lineStart,
+ start: start,
+ end: index
+ };
+ }
+
+ function isImplicitOctalLiteral() {
+ var i, ch;
+
+ // Implicit octal, unless there is a non-octal digit.
+ // (Annex B.1.1 on Numeric Literals)
+ for (i = index + 1; i < length; ++i) {
+ ch = source[i];
+ if (ch === '8' || ch === '9') {
+ return false;
+ }
+ if (!isOctalDigit(ch)) {
+ return true;
+ }
+ }
+
+ return true;
+ }
+
+ function scanNumericLiteral() {
+ var number, start, ch;
+
+ ch = source[index];
+ assert(isDecimalDigit(ch.charCodeAt(0)) || (ch === '.'),
+ 'Numeric literal must start with a decimal digit or a decimal point');
+
+ start = index;
+ number = '';
+ if (ch !== '.') {
+ number = source[index++];
+ ch = source[index];
+
+ // Hex number starts with '0x'.
+ // Octal number starts with '0'.
+ // Octal number in ES6 starts with '0o'.
+ // Binary number in ES6 starts with '0b'.
+ if (number === '0') {
+ if (ch === 'x' || ch === 'X') {
+ ++index;
+ return scanHexLiteral(start);
+ }
+ if (ch === 'b' || ch === 'B') {
+ ++index;
+ return scanBinaryLiteral(start);
+ }
+ if (ch === 'o' || ch === 'O') {
+ return scanOctalLiteral(ch, start);
+ }
+
+ if (isOctalDigit(ch)) {
+ if (isImplicitOctalLiteral()) {
+ return scanOctalLiteral(ch, start);
+ }
+ }
+ }
+
+ while (isDecimalDigit(source.charCodeAt(index))) {
+ number += source[index++];
+ }
+ ch = source[index];
+ }
+
+ if (ch === '.') {
+ number += source[index++];
+ while (isDecimalDigit(source.charCodeAt(index))) {
+ number += source[index++];
+ }
+ ch = source[index];
+ }
+
+ if (ch === 'e' || ch === 'E') {
+ number += source[index++];
+
+ ch = source[index];
+ if (ch === '+' || ch === '-') {
+ number += source[index++];
+ }
+ if (isDecimalDigit(source.charCodeAt(index))) {
+ while (isDecimalDigit(source.charCodeAt(index))) {
+ number += source[index++];
+ }
+ } else {
+ throwUnexpectedToken();
+ }
+ }
+
+ if (isIdentifierStart(source.charCodeAt(index))) {
+ throwUnexpectedToken();
+ }
+
+ return {
+ type: Token.NumericLiteral,
+ value: parseFloat(number),
+ lineNumber: lineNumber,
+ lineStart: lineStart,
+ start: start,
+ end: index
+ };
+ }
+
+ // 7.8.4 String Literals
+
+ function scanStringLiteral() {
+ var str = '', quote, start, ch, unescaped, octToDec, octal = false;
+
+ quote = source[index];
+ assert((quote === '\'' || quote === '"'),
+ 'String literal must starts with a quote');
+
+ start = index;
+ ++index;
+
+ while (index < length) {
+ ch = source[index++];
+
+ if (ch === quote) {
+ quote = '';
+ break;
+ } else if (ch === '\\') {
+ ch = source[index++];
+ if (!ch || !isLineTerminator(ch.charCodeAt(0))) {
+ switch (ch) {
+ case 'u':
+ case 'x':
+ if (source[index] === '{') {
+ ++index;
+ str += scanUnicodeCodePointEscape();
+ } else {
+ unescaped = scanHexEscape(ch);
+ if (!unescaped) {
+ throw throwUnexpectedToken();
+ }
+ str += unescaped;
+ }
+ break;
+ case 'n':
+ str += '\n';
+ break;
+ case 'r':
+ str += '\r';
+ break;
+ case 't':
+ str += '\t';
+ break;
+ case 'b':
+ str += '\b';
+ break;
+ case 'f':
+ str += '\f';
+ break;
+ case 'v':
+ str += '\x0B';
+ break;
+ case '8':
+ case '9':
+ throw throwUnexpectedToken();
+
+ default:
+ if (isOctalDigit(ch)) {
+ octToDec = octalToDecimal(ch);
+
+ octal = octToDec.octal || octal;
+ str += String.fromCharCode(octToDec.code);
+ } else {
+ str += ch;
+ }
+ break;
+ }
+ } else {
+ ++lineNumber;
+ if (ch === '\r' && source[index] === '\n') {
+ ++index;
+ }
+ lineStart = index;
+ }
+ } else if (isLineTerminator(ch.charCodeAt(0))) {
+ break;
+ } else {
+ str += ch;
+ }
+ }
+
+ if (quote !== '') {
+ throwUnexpectedToken();
+ }
+
+ return {
+ type: Token.StringLiteral,
+ value: str,
+ octal: octal,
+ lineNumber: startLineNumber,
+ lineStart: startLineStart,
+ start: start,
+ end: index
+ };
+ }
+
+ function scanTemplate() {
+ var cooked = '', ch, start, rawOffset, terminated, head, tail, restore, unescaped;
+
+ terminated = false;
+ tail = false;
+ start = index;
+ head = (source[index] === '`');
+ rawOffset = 2;
+
+ ++index;
+
+ while (index < length) {
+ ch = source[index++];
+ if (ch === '`') {
+ rawOffset = 1;
+ tail = true;
+ terminated = true;
+ break;
+ } else if (ch === '$') {
+ if (source[index] === '{') {
+ state.curlyStack.push('${');
+ ++index;
+ terminated = true;
+ break;
+ }
+ cooked += ch;
+ } else if (ch === '\\') {
+ ch = source[index++];
+ if (!isLineTerminator(ch.charCodeAt(0))) {
+ switch (ch) {
+ case 'n':
+ cooked += '\n';
+ break;
+ case 'r':
+ cooked += '\r';
+ break;
+ case 't':
+ cooked += '\t';
+ break;
+ case 'u':
+ case 'x':
+ if (source[index] === '{') {
+ ++index;
+ cooked += scanUnicodeCodePointEscape();
+ } else {
+ restore = index;
+ unescaped = scanHexEscape(ch);
+ if (unescaped) {
+ cooked += unescaped;
+ } else {
+ index = restore;
+ cooked += ch;
+ }
+ }
+ break;
+ case 'b':
+ cooked += '\b';
+ break;
+ case 'f':
+ cooked += '\f';
+ break;
+ case 'v':
+ cooked += '\v';
+ break;
+
+ default:
+ if (ch === '0') {
+ if (isDecimalDigit(source.charCodeAt(index))) {
+ // Illegal: \01 \02 and so on
+ throwError(Messages.TemplateOctalLiteral);
+ }
+ cooked += '\0';
+ } else if (isOctalDigit(ch)) {
+ // Illegal: \1 \2
+ throwError(Messages.TemplateOctalLiteral);
+ } else {
+ cooked += ch;
+ }
+ break;
+ }
+ } else {
+ ++lineNumber;
+ if (ch === '\r' && source[index] === '\n') {
+ ++index;
+ }
+ lineStart = index;
+ }
+ } else if (isLineTerminator(ch.charCodeAt(0))) {
+ ++lineNumber;
+ if (ch === '\r' && source[index] === '\n') {
+ ++index;
+ }
+ lineStart = index;
+ cooked += '\n';
+ } else {
+ cooked += ch;
+ }
+ }
+
+ if (!terminated) {
+ throwUnexpectedToken();
+ }
+
+ if (!head) {
+ state.curlyStack.pop();
+ }
+
+ return {
+ type: Token.Template,
+ value: {
+ cooked: cooked,
+ raw: source.slice(start + 1, index - rawOffset)
+ },
+ head: head,
+ tail: tail,
+ lineNumber: lineNumber,
+ lineStart: lineStart,
+ start: start,
+ end: index
+ };
+ }
+
+ function testRegExp(pattern, flags) {
+ var tmp = pattern;
+
+ if (flags.indexOf('u') >= 0) {
+ // Replace each astral symbol and every Unicode escape sequence
+ // that possibly represents an astral symbol or a paired surrogate
+ // with a single ASCII symbol to avoid throwing on regular
+ // expressions that are only valid in combination with the `/u`
+ // flag.
+ // Note: replacing with the ASCII symbol `x` might cause false
+ // negatives in unlikely scenarios. For example, `[\u{61}-b]` is a
+ // perfectly valid pattern that is equivalent to `[a-b]`, but it
+ // would be replaced by `[x-b]` which throws an error.
+ tmp = tmp
+ .replace(/\\u\{([0-9a-fA-F]+)\}/g, function ($0, $1) {
+ if (parseInt($1, 16) <= 0x10FFFF) {
+ return 'x';
+ }
+ throwUnexpectedToken(null, Messages.InvalidRegExp);
+ })
+ .replace(
+ /\\u([a-fA-F0-9]{4})|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,
+ 'x'
+ );
+ }
+
+ // First, detect invalid regular expressions.
+ try {
+ RegExp(tmp);
+ } catch (e) {
+ throwUnexpectedToken(null, Messages.InvalidRegExp);
+ }
+
+ // Return a regular expression object for this pattern-flag pair, or
+ // `null` in case the current environment doesn't support the flags it
+ // uses.
+ try {
+ return new RegExp(pattern, flags);
+ } catch (exception) {
+ return null;
+ }
+ }
+
+ function scanRegExpBody() {
+ var ch, str, classMarker, terminated, body;
+
+ ch = source[index];
+ assert(ch === '/', 'Regular expression literal must start with a slash');
+ str = source[index++];
+
+ classMarker = false;
+ terminated = false;
+ while (index < length) {
+ ch = source[index++];
+ str += ch;
+ if (ch === '\\') {
+ ch = source[index++];
+ // ECMA-262 7.8.5
+ if (isLineTerminator(ch.charCodeAt(0))) {
+ throwUnexpectedToken(null, Messages.UnterminatedRegExp);
+ }
+ str += ch;
+ } else if (isLineTerminator(ch.charCodeAt(0))) {
+ throwUnexpectedToken(null, Messages.UnterminatedRegExp);
+ } else if (classMarker) {
+ if (ch === ']') {
+ classMarker = false;
+ }
+ } else {
+ if (ch === '/') {
+ terminated = true;
+ break;
+ } else if (ch === '[') {
+ classMarker = true;
+ }
+ }
+ }
+
+ if (!terminated) {
+ throwUnexpectedToken(null, Messages.UnterminatedRegExp);
+ }
+
+ // Exclude leading and trailing slash.
+ body = str.substr(1, str.length - 2);
+ return {
+ value: body,
+ literal: str
+ };
+ }
+
+ function scanRegExpFlags() {
+ var ch, str, flags, restore;
+
+ str = '';
+ flags = '';
+ while (index < length) {
+ ch = source[index];
+ if (!isIdentifierPart(ch.charCodeAt(0))) {
+ break;
+ }
+
+ ++index;
+ if (ch === '\\' && index < length) {
+ ch = source[index];
+ if (ch === 'u') {
+ ++index;
+ restore = index;
+ ch = scanHexEscape('u');
+ if (ch) {
+ flags += ch;
+ for (str += '\\u'; restore < index; ++restore) {
+ str += source[restore];
+ }
+ } else {
+ index = restore;
+ flags += 'u';
+ str += '\\u';
+ }
+ tolerateUnexpectedToken();
+ } else {
+ str += '\\';
+ tolerateUnexpectedToken();
+ }
+ } else {
+ flags += ch;
+ str += ch;
+ }
+ }
+
+ return {
+ value: flags,
+ literal: str
+ };
+ }
+
+ function scanRegExp() {
+ scanning = true;
+ var start, body, flags, value;
+
+ lookahead = null;
+ skipComment();
+ start = index;
+
+ body = scanRegExpBody();
+ flags = scanRegExpFlags();
+ value = testRegExp(body.value, flags.value);
+ scanning = false;
+ if (extra.tokenize) {
+ return {
+ type: Token.RegularExpression,
+ value: value,
+ regex: {
+ pattern: body.value,
+ flags: flags.value
+ },
+ lineNumber: lineNumber,
+ lineStart: lineStart,
+ start: start,
+ end: index
+ };
+ }
+
+ return {
+ literal: body.literal + flags.literal,
+ value: value,
+ regex: {
+ pattern: body.value,
+ flags: flags.value
+ },
+ start: start,
+ end: index
+ };
+ }
+
+ function collectRegex() {
+ var pos, loc, regex, token;
+
+ skipComment();
+
+ pos = index;
+ loc = {
+ start: {
+ line: lineNumber,
+ column: index - lineStart
+ }
+ };
+
+ regex = scanRegExp();
+
+ loc.end = {
+ line: lineNumber,
+ column: index - lineStart
+ };
+
+ /* istanbul ignore next */
+ if (!extra.tokenize) {
+ // Pop the previous token, which is likely '/' or '/='
+ if (extra.tokens.length > 0) {
+ token = extra.tokens[extra.tokens.length - 1];
+ if (token.range[0] === pos && token.type === 'Punctuator') {
+ if (token.value === '/' || token.value === '/=') {
+ extra.tokens.pop();
+ }
+ }
+ }
+
+ extra.tokens.push({
+ type: 'RegularExpression',
+ value: regex.literal,
+ regex: regex.regex,
+ range: [pos, index],
+ loc: loc
+ });
+ }
+
+ return regex;
+ }
+
+ function isIdentifierName(token) {
+ return token.type === Token.Identifier ||
+ token.type === Token.Keyword ||
+ token.type === Token.BooleanLiteral ||
+ token.type === Token.NullLiteral;
+ }
+
+ function advanceSlash() {
+ var prevToken,
+ checkToken;
+ // Using the following algorithm:
+ // https://github.com/mozilla/sweet.js/wiki/design
+ prevToken = extra.tokens[extra.tokens.length - 1];
+ if (!prevToken) {
+ // Nothing before that: it cannot be a division.
+ return collectRegex();
+ }
+ if (prevToken.type === 'Punctuator') {
+ if (prevToken.value === ']') {
+ return scanPunctuator();
+ }
+ if (prevToken.value === ')') {
+ checkToken = extra.tokens[extra.openParenToken - 1];
+ if (checkToken &&
+ checkToken.type === 'Keyword' &&
+ (checkToken.value === 'if' ||
+ checkToken.value === 'while' ||
+ checkToken.value === 'for' ||
+ checkToken.value === 'with')) {
+ return collectRegex();
+ }
+ return scanPunctuator();
+ }
+ if (prevToken.value === '}') {
+ // Dividing a function by anything makes little sense,
+ // but we have to check for that.
+ if (extra.tokens[extra.openCurlyToken - 3] &&
+ extra.tokens[extra.openCurlyToken - 3].type === 'Keyword') {
+ // Anonymous function.
+ checkToken = extra.tokens[extra.openCurlyToken - 4];
+ if (!checkToken) {
+ return scanPunctuator();
+ }
+ } else if (extra.tokens[extra.openCurlyToken - 4] &&
+ extra.tokens[extra.openCurlyToken - 4].type === 'Keyword') {
+ // Named function.
+ checkToken = extra.tokens[extra.openCurlyToken - 5];
+ if (!checkToken) {
+ return collectRegex();
+ }
+ } else {
+ return scanPunctuator();
+ }
+ // checkToken determines whether the function is
+ // a declaration or an expression.
+ if (FnExprTokens.indexOf(checkToken.value) >= 0) {
+ // It is an expression.
+ return scanPunctuator();
+ }
+ // It is a declaration.
+ return collectRegex();
+ }
+ return collectRegex();
+ }
+ if (prevToken.type === 'Keyword' && prevToken.value !== 'this') {
+ return collectRegex();
+ }
+ return scanPunctuator();
+ }
+
+ function advance() {
+ var ch, token;
+
+ if (index >= length) {
+ return {
+ type: Token.EOF,
+ lineNumber: lineNumber,
+ lineStart: lineStart,
+ start: index,
+ end: index
+ };
+ }
+
+ ch = source.charCodeAt(index);
+
+ if (isIdentifierStart(ch)) {
+ token = scanIdentifier();
+ if (strict && isStrictModeReservedWord(token.value)) {
+ token.type = Token.Keyword;
+ }
+ return token;
+ }
+
+ // Very common: ( and ) and ;
+ if (ch === 0x28 || ch === 0x29 || ch === 0x3B) {
+ return scanPunctuator();
+ }
+
+ // String literal starts with single quote (U+0027) or double quote (U+0022).
+ if (ch === 0x27 || ch === 0x22) {
+ return scanStringLiteral();
+ }
+
+ // Dot (.) U+002E can also start a floating-point number, hence the need
+ // to check the next character.
+ if (ch === 0x2E) {
+ if (isDecimalDigit(source.charCodeAt(index + 1))) {
+ return scanNumericLiteral();
+ }
+ return scanPunctuator();
+ }
+
+ if (isDecimalDigit(ch)) {
+ return scanNumericLiteral();
+ }
+
+ // Slash (/) U+002F can also start a regex.
+ if (extra.tokenize && ch === 0x2F) {
+ return advanceSlash();
+ }
+
+ // Template literals start with ` (U+0060) for template head
+ // or } (U+007D) for template middle or template tail.
+ if (ch === 0x60 || (ch === 0x7D && state.curlyStack[state.curlyStack.length - 1] === '${')) {
+ return scanTemplate();
+ }
+
+ return scanPunctuator();
+ }
+
+ function collectToken() {
+ var loc, token, value, entry;
+
+ loc = {
+ start: {
+ line: lineNumber,
+ column: index - lineStart
+ }
+ };
+
+ token = advance();
+ loc.end = {
+ line: lineNumber,
+ column: index - lineStart
+ };
+
+ if (token.type !== Token.EOF) {
+ value = source.slice(token.start, token.end);
+ entry = {
+ type: TokenName[token.type],
+ value: value,
+ range: [token.start, token.end],
+ loc: loc
+ };
+ if (token.regex) {
+ entry.regex = {
+ pattern: token.regex.pattern,
+ flags: token.regex.flags
+ };
+ }
+ extra.tokens.push(entry);
+ }
+
+ return token;
+ }
+
+ function lex() {
+ var token;
+ scanning = true;
+
+ lastIndex = index;
+ lastLineNumber = lineNumber;
+ lastLineStart = lineStart;
+
+ skipComment();
+
+ token = lookahead;
+
+ startIndex = index;
+ startLineNumber = lineNumber;
+ startLineStart = lineStart;
+
+ lookahead = (typeof extra.tokens !== 'undefined') ? collectToken() : advance();
+ scanning = false;
+ return token;
+ }
+
+ function peek() {
+ scanning = true;
+
+ skipComment();
+
+ lastIndex = index;
+ lastLineNumber = lineNumber;
+ lastLineStart = lineStart;
+
+ startIndex = index;
+ startLineNumber = lineNumber;
+ startLineStart = lineStart;
+
+ lookahead = (typeof extra.tokens !== 'undefined') ? collectToken() : advance();
+ scanning = false;
+ }
+
+ function Position() {
+ this.line = startLineNumber;
+ this.column = startIndex - startLineStart;
+ }
+
+ function SourceLocation() {
+ this.start = new Position();
+ this.end = null;
+ }
+
+ function WrappingSourceLocation(startToken) {
+ this.start = {
+ line: startToken.lineNumber,
+ column: startToken.start - startToken.lineStart
+ };
+ this.end = null;
+ }
+
+ function Node() {
+ if (extra.range) {
+ this.range = [startIndex, 0];
+ }
+ if (extra.loc) {
+ this.loc = new SourceLocation();
+ }
+ }
+
+ function WrappingNode(startToken) {
+ if (extra.range) {
+ this.range = [startToken.start, 0];
+ }
+ if (extra.loc) {
+ this.loc = new WrappingSourceLocation(startToken);
+ }
+ }
+
+ WrappingNode.prototype = Node.prototype = {
+
+ processComment: function () {
+ var lastChild,
+ leadingComments,
+ trailingComments,
+ bottomRight = extra.bottomRightStack,
+ i,
+ comment,
+ last = bottomRight[bottomRight.length - 1];
+
+ if (this.type === Syntax.Program) {
+ if (this.body.length > 0) {
+ return;
+ }
+ }
+
+ if (extra.trailingComments.length > 0) {
+ trailingComments = [];
+ for (i = extra.trailingComments.length - 1; i >= 0; --i) {
+ comment = extra.trailingComments[i];
+ if (comment.range[0] >= this.range[1]) {
+ trailingComments.unshift(comment);
+ extra.trailingComments.splice(i, 1);
+ }
+ }
+ extra.trailingComments = [];
+ } else {
+ if (last && last.trailingComments && last.trailingComments[0].range[0] >= this.range[1]) {
+ trailingComments = last.trailingComments;
+ delete last.trailingComments;
+ }
+ }
+
+ // Eating the stack.
+ if (last) {
+ while (last && last.range[0] >= this.range[0]) {
+ lastChild = last;
+ last = bottomRight.pop();
+ }
+ }
+
+ if (lastChild) {
+ if (lastChild.leadingComments && lastChild.leadingComments[lastChild.leadingComments.length - 1].range[1] <= this.range[0]) {
+ this.leadingComments = lastChild.leadingComments;
+ lastChild.leadingComments = undefined;
+ }
+ } else if (extra.leadingComments.length > 0) {
+ leadingComments = [];
+ for (i = extra.leadingComments.length - 1; i >= 0; --i) {
+ comment = extra.leadingComments[i];
+ if (comment.range[1] <= this.range[0]) {
+ leadingComments.unshift(comment);
+ extra.leadingComments.splice(i, 1);
+ }
+ }
+ }
+
+
+ if (leadingComments && leadingComments.length > 0) {
+ this.leadingComments = leadingComments;
+ }
+ if (trailingComments && trailingComments.length > 0) {
+ this.trailingComments = trailingComments;
+ }
+
+ bottomRight.push(this);
+ },
+
+ finish: function () {
+ if (extra.range) {
+ this.range[1] = lastIndex;
+ }
+ if (extra.loc) {
+ this.loc.end = {
+ line: lastLineNumber,
+ column: lastIndex - lastLineStart
+ };
+ if (extra.source) {
+ this.loc.source = extra.source;
+ }
+ }
+
+ if (extra.attachComment) {
+ this.processComment();
+ }
+ },
+
+ finishArrayExpression: function (elements) {
+ this.type = Syntax.ArrayExpression;
+ this.elements = elements;
+ this.finish();
+ return this;
+ },
+
+ finishArrayPattern: function (elements) {
+ this.type = Syntax.ArrayPattern;
+ this.elements = elements;
+ this.finish();
+ return this;
+ },
+
+ finishArrowFunctionExpression: function (params, defaults, body, expression) {
+ this.type = Syntax.ArrowFunctionExpression;
+ this.id = null;
+ this.params = params;
+ this.defaults = defaults;
+ this.body = body;
+ this.generator = false;
+ this.expression = expression;
+ this.finish();
+ return this;
+ },
+
+ finishAssignmentExpression: function (operator, left, right) {
+ this.type = Syntax.AssignmentExpression;
+ this.operator = operator;
+ this.left = left;
+ this.right = right;
+ this.finish();
+ return this;
+ },
+
+ finishAssignmentPattern: function (left, right) {
+ this.type = Syntax.AssignmentPattern;
+ this.left = left;
+ this.right = right;
+ this.finish();
+ return this;
+ },
+
+ finishBinaryExpression: function (operator, left, right) {
+ this.type = (operator === '||' || operator === '&&') ? Syntax.LogicalExpression : Syntax.BinaryExpression;
+ this.operator = operator;
+ this.left = left;
+ this.right = right;
+ this.finish();
+ return this;
+ },
+
+ finishBlockStatement: function (body) {
+ this.type = Syntax.BlockStatement;
+ this.body = body;
+ this.finish();
+ return this;
+ },
+
+ finishBreakStatement: function (label) {
+ this.type = Syntax.BreakStatement;
+ this.label = label;
+ this.finish();
+ return this;
+ },
+
+ finishCallExpression: function (callee, args) {
+ this.type = Syntax.CallExpression;
+ this.callee = callee;
+ this.arguments = args;
+ this.finish();
+ return this;
+ },
+
+ finishCatchClause: function (param, body) {
+ this.type = Syntax.CatchClause;
+ this.param = param;
+ this.body = body;
+ this.finish();
+ return this;
+ },
+
+ finishClassBody: function (body) {
+ this.type = Syntax.ClassBody;
+ this.body = body;
+ this.finish();
+ return this;
+ },
+
+ finishClassDeclaration: function (id, superClass, body) {
+ this.type = Syntax.ClassDeclaration;
+ this.id = id;
+ this.superClass = superClass;
+ this.body = body;
+ this.finish();
+ return this;
+ },
+
+ finishClassExpression: function (id, superClass, body) {
+ this.type = Syntax.ClassExpression;
+ this.id = id;
+ this.superClass = superClass;
+ this.body = body;
+ this.finish();
+ return this;
+ },
+
+ finishConditionalExpression: function (test, consequent, alternate) {
+ this.type = Syntax.ConditionalExpression;
+ this.test = test;
+ this.consequent = consequent;
+ this.alternate = alternate;
+ this.finish();
+ return this;
+ },
+
+ finishContinueStatement: function (label) {
+ this.type = Syntax.ContinueStatement;
+ this.label = label;
+ this.finish();
+ return this;
+ },
+
+ finishDebuggerStatement: function () {
+ this.type = Syntax.DebuggerStatement;
+ this.finish();
+ return this;
+ },
+
+ finishDoWhileStatement: function (body, test) {
+ this.type = Syntax.DoWhileStatement;
+ this.body = body;
+ this.test = test;
+ this.finish();
+ return this;
+ },
+
+ finishEmptyStatement: function () {
+ this.type = Syntax.EmptyStatement;
+ this.finish();
+ return this;
+ },
+
+ finishExpressionStatement: function (expression) {
+ this.type = Syntax.ExpressionStatement;
+ this.expression = expression;
+ this.finish();
+ return this;
+ },
+
+ finishForStatement: function (init, test, update, body) {
+ this.type = Syntax.ForStatement;
+ this.init = init;
+ this.test = test;
+ this.update = update;
+ this.body = body;
+ this.finish();
+ return this;
+ },
+
+ finishForInStatement: function (left, right, body) {
+ this.type = Syntax.ForInStatement;
+ this.left = left;
+ this.right = right;
+ this.body = body;
+ this.each = false;
+ this.finish();
+ return this;
+ },
+
+ finishFunctionDeclaration: function (id, params, defaults, body) {
+ this.type = Syntax.FunctionDeclaration;
+ this.id = id;
+ this.params = params;
+ this.defaults = defaults;
+ this.body = body;
+ this.generator = false;
+ this.expression = false;
+ this.finish();
+ return this;
+ },
+
+ finishFunctionExpression: function (id, params, defaults, body) {
+ this.type = Syntax.FunctionExpression;
+ this.id = id;
+ this.params = params;
+ this.defaults = defaults;
+ this.body = body;
+ this.generator = false;
+ this.expression = false;
+ this.finish();
+ return this;
+ },
+
+ finishIdentifier: function (name) {
+ this.type = Syntax.Identifier;
+ this.name = name;
+ this.finish();
+ return this;
+ },
+
+ finishIfStatement: function (test, consequent, alternate) {
+ this.type = Syntax.IfStatement;
+ this.test = test;
+ this.consequent = consequent;
+ this.alternate = alternate;
+ this.finish();
+ return this;
+ },
+
+ finishLabeledStatement: function (label, body) {
+ this.type = Syntax.LabeledStatement;
+ this.label = label;
+ this.body = body;
+ this.finish();
+ return this;
+ },
+
+ finishLiteral: function (token) {
+ this.type = Syntax.Literal;
+ this.value = token.value;
+ this.raw = source.slice(token.start, token.end);
+ if (token.regex) {
+ this.regex = token.regex;
+ }
+ this.finish();
+ return this;
+ },
+
+ finishMemberExpression: function (accessor, object, property) {
+ this.type = Syntax.MemberExpression;
+ this.computed = accessor === '[';
+ this.object = object;
+ this.property = property;
+ this.finish();
+ return this;
+ },
+
+ finishNewExpression: function (callee, args) {
+ this.type = Syntax.NewExpression;
+ this.callee = callee;
+ this.arguments = args;
+ this.finish();
+ return this;
+ },
+
+ finishObjectExpression: function (properties) {
+ this.type = Syntax.ObjectExpression;
+ this.properties = properties;
+ this.finish();
+ return this;
+ },
+
+ finishObjectPattern: function (properties) {
+ this.type = Syntax.ObjectPattern;
+ this.properties = properties;
+ this.finish();
+ return this;
+ },
+
+ finishPostfixExpression: function (operator, argument) {
+ this.type = Syntax.UpdateExpression;
+ this.operator = operator;
+ this.argument = argument;
+ this.prefix = false;
+ this.finish();
+ return this;
+ },
+
+ finishProgram: function (body) {
+ this.type = Syntax.Program;
+ this.body = body;
+ if (sourceType === 'module') {
+ // very restrictive for now
+ this.sourceType = sourceType;
+ }
+ this.finish();
+ return this;
+ },
+
+ finishProperty: function (kind, key, computed, value, method, shorthand) {
+ this.type = Syntax.Property;
+ this.key = key;
+ this.computed = computed;
+ this.value = value;
+ this.kind = kind;
+ this.method = method;
+ this.shorthand = shorthand;
+ this.finish();
+ return this;
+ },
+
+ finishRestElement: function (argument) {
+ this.type = Syntax.RestElement;
+ this.argument = argument;
+ this.finish();
+ return this;
+ },
+
+ finishReturnStatement: function (argument) {
+ this.type = Syntax.ReturnStatement;
+ this.argument = argument;
+ this.finish();
+ return this;
+ },
+
+ finishSequenceExpression: function (expressions) {
+ this.type = Syntax.SequenceExpression;
+ this.expressions = expressions;
+ this.finish();
+ return this;
+ },
+
+ finishSpreadElement: function (argument) {
+ this.type = Syntax.SpreadElement;
+ this.argument = argument;
+ this.finish();
+ return this;
+ },
+
+ finishSwitchCase: function (test, consequent) {
+ this.type = Syntax.SwitchCase;
+ this.test = test;
+ this.consequent = consequent;
+ this.finish();
+ return this;
+ },
+
+ finishSuper: function () {
+ this.type = Syntax.Super;
+ this.finish();
+ return this;
+ },
+
+ finishSwitchStatement: function (discriminant, cases) {
+ this.type = Syntax.SwitchStatement;
+ this.discriminant = discriminant;
+ this.cases = cases;
+ this.finish();
+ return this;
+ },
+
+ finishTaggedTemplateExpression: function (tag, quasi) {
+ this.type = Syntax.TaggedTemplateExpression;
+ this.tag = tag;
+ this.quasi = quasi;
+ this.finish();
+ return this;
+ },
+
+ finishTemplateElement: function (value, tail) {
+ this.type = Syntax.TemplateElement;
+ this.value = value;
+ this.tail = tail;
+ this.finish();
+ return this;
+ },
+
+ finishTemplateLiteral: function (quasis, expressions) {
+ this.type = Syntax.TemplateLiteral;
+ this.quasis = quasis;
+ this.expressions = expressions;
+ this.finish();
+ return this;
+ },
+
+ finishThisExpression: function () {
+ this.type = Syntax.ThisExpression;
+ this.finish();
+ return this;
+ },
+
+ finishThrowStatement: function (argument) {
+ this.type = Syntax.ThrowStatement;
+ this.argument = argument;
+ this.finish();
+ return this;
+ },
+
+ finishTryStatement: function (block, handler, finalizer) {
+ this.type = Syntax.TryStatement;
+ this.block = block;
+ this.guardedHandlers = [];
+ this.handlers = handler ? [ handler ] : [];
+ this.handler = handler;
+ this.finalizer = finalizer;
+ this.finish();
+ return this;
+ },
+
+ finishUnaryExpression: function (operator, argument) {
+ this.type = (operator === '++' || operator === '--') ? Syntax.UpdateExpression : Syntax.UnaryExpression;
+ this.operator = operator;
+ this.argument = argument;
+ this.prefix = true;
+ this.finish();
+ return this;
+ },
+
+ finishVariableDeclaration: function (declarations) {
+ this.type = Syntax.VariableDeclaration;
+ this.declarations = declarations;
+ this.kind = 'var';
+ this.finish();
+ return this;
+ },
+
+ finishLexicalDeclaration: function (declarations, kind) {
+ this.type = Syntax.VariableDeclaration;
+ this.declarations = declarations;
+ this.kind = kind;
+ this.finish();
+ return this;
+ },
+
+ finishVariableDeclarator: function (id, init) {
+ this.type = Syntax.VariableDeclarator;
+ this.id = id;
+ this.init = init;
+ this.finish();
+ return this;
+ },
+
+ finishWhileStatement: function (test, body) {
+ this.type = Syntax.WhileStatement;
+ this.test = test;
+ this.body = body;
+ this.finish();
+ return this;
+ },
+
+ finishWithStatement: function (object, body) {
+ this.type = Syntax.WithStatement;
+ this.object = object;
+ this.body = body;
+ this.finish();
+ return this;
+ },
+
+ finishExportSpecifier: function (local, exported) {
+ this.type = Syntax.ExportSpecifier;
+ this.exported = exported || local;
+ this.local = local;
+ this.finish();
+ return this;
+ },
+
+ finishImportDefaultSpecifier: function (local) {
+ this.type = Syntax.ImportDefaultSpecifier;
+ this.local = local;
+ this.finish();
+ return this;
+ },
+
+ finishImportNamespaceSpecifier: function (local) {
+ this.type = Syntax.ImportNamespaceSpecifier;
+ this.local = local;
+ this.finish();
+ return this;
+ },
+
+ finishExportNamedDeclaration: function (declaration, specifiers, src) {
+ this.type = Syntax.ExportNamedDeclaration;
+ this.declaration = declaration;
+ this.specifiers = specifiers;
+ this.source = src;
+ this.finish();
+ return this;
+ },
+
+ finishExportDefaultDeclaration: function (declaration) {
+ this.type = Syntax.ExportDefaultDeclaration;
+ this.declaration = declaration;
+ this.finish();
+ return this;
+ },
+
+ finishExportAllDeclaration: function (src) {
+ this.type = Syntax.ExportAllDeclaration;
+ this.source = src;
+ this.finish();
+ return this;
+ },
+
+ finishImportSpecifier: function (local, imported) {
+ this.type = Syntax.ImportSpecifier;
+ this.local = local || imported;
+ this.imported = imported;
+ this.finish();
+ return this;
+ },
+
+ finishImportDeclaration: function (specifiers, src) {
+ this.type = Syntax.ImportDeclaration;
+ this.specifiers = specifiers;
+ this.source = src;
+ this.finish();
+ return this;
+ }
+ };
+
+
+ function recordError(error) {
+ var e, existing;
+
+ for (e = 0; e < extra.errors.length; e++) {
+ existing = extra.errors[e];
+ // Prevent duplicated error.
+ /* istanbul ignore next */
+ if (existing.index === error.index && existing.message === error.message) {
+ return;
+ }
+ }
+
+ extra.errors.push(error);
+ }
+
+ function createError(line, pos, description) {
+ var error = new Error('Line ' + line + ': ' + description);
+ error.index = pos;
+ error.lineNumber = line;
+ error.column = pos - (scanning ? lineStart : lastLineStart) + 1;
+ error.description = description;
+ return error;
+ }
+
+ // Throw an exception
+
+ function throwError(messageFormat) {
+ var args, msg;
+
+ args = Array.prototype.slice.call(arguments, 1);
+ msg = messageFormat.replace(/%(\d)/g,
+ function (whole, idx) {
+ assert(idx < args.length, 'Message reference must be in range');
+ return args[idx];
+ }
+ );
+
+ throw createError(lastLineNumber, lastIndex, msg);
+ }
+
+ function tolerateError(messageFormat) {
+ var args, msg, error;
+
+ args = Array.prototype.slice.call(arguments, 1);
+ /* istanbul ignore next */
+ msg = messageFormat.replace(/%(\d)/g,
+ function (whole, idx) {
+ assert(idx < args.length, 'Message reference must be in range');
+ return args[idx];
+ }
+ );
+
+ error = createError(lineNumber, lastIndex, msg);
+ if (extra.errors) {
+ recordError(error);
+ } else {
+ throw error;
+ }
+ }
+
+ // Throw an exception because of the token.
+
+ function unexpectedTokenError(token, message) {
+ var value, msg = message || Messages.UnexpectedToken;
+
+ if (token) {
+ if (!message) {
+ msg = (token.type === Token.EOF) ? Messages.UnexpectedEOS :
+ (token.type === Token.Identifier) ? Messages.UnexpectedIdentifier :
+ (token.type === Token.NumericLiteral) ? Messages.UnexpectedNumber :
+ (token.type === Token.StringLiteral) ? Messages.UnexpectedString :
+ (token.type === Token.Template) ? Messages.UnexpectedTemplate :
+ Messages.UnexpectedToken;
+
+ if (token.type === Token.Keyword) {
+ if (isFutureReservedWord(token.value)) {
+ msg = Messages.UnexpectedReserved;
+ } else if (strict && isStrictModeReservedWord(token.value)) {
+ msg = Messages.StrictReservedWord;
+ }
+ }
+ }
+
+ value = (token.type === Token.Template) ? token.value.raw : token.value;
+ } else {
+ value = 'ILLEGAL';
+ }
+
+ msg = msg.replace('%0', value);
+
+ return (token && typeof token.lineNumber === 'number') ?
+ createError(token.lineNumber, token.start, msg) :
+ createError(scanning ? lineNumber : lastLineNumber, scanning ? index : lastIndex, msg);
+ }
+
+ function throwUnexpectedToken(token, message) {
+ throw unexpectedTokenError(token, message);
+ }
+
+ function tolerateUnexpectedToken(token, message) {
+ var error = unexpectedTokenError(token, message);
+ if (extra.errors) {
+ recordError(error);
+ } else {
+ throw error;
+ }
+ }
+
+ // Expect the next token to match the specified punctuator.
+ // If not, an exception will be thrown.
+
+ function expect(value) {
+ var token = lex();
+ if (token.type !== Token.Punctuator || token.value !== value) {
+ throwUnexpectedToken(token);
+ }
+ }
+
+ /**
+ * @name expectCommaSeparator
+ * @description Quietly expect a comma when in tolerant mode, otherwise delegates
+ * to <code>expect(value)</code>
+ * @since 2.0
+ */
+ function expectCommaSeparator() {
+ var token;
+
+ if (extra.errors) {
+ token = lookahead;
+ if (token.type === Token.Punctuator && token.value === ',') {
+ lex();
+ } else if (token.type === Token.Punctuator && token.value === ';') {
+ lex();
+ tolerateUnexpectedToken(token);
+ } else {
+ tolerateUnexpectedToken(token, Messages.UnexpectedToken);
+ }
+ } else {
+ expect(',');
+ }
+ }
+
+ // Expect the next token to match the specified keyword.
+ // If not, an exception will be thrown.
+
+ function expectKeyword(keyword) {
+ var token = lex();
+ if (token.type !== Token.Keyword || token.value !== keyword) {
+ throwUnexpectedToken(token);
+ }
+ }
+
+ // Return true if the next token matches the specified punctuator.
+
+ function match(value) {
+ return lookahead.type === Token.Punctuator && lookahead.value === value;
+ }
+
+ // Return true if the next token matches the specified keyword
+
+ function matchKeyword(keyword) {
+ return lookahead.type === Token.Keyword && lookahead.value === keyword;
+ }
+
+ // Return true if the next token matches the specified contextual keyword
+ // (where an identifier is sometimes a keyword depending on the context)
+
+ function matchContextualKeyword(keyword) {
+ return lookahead.type === Token.Identifier && lookahead.value === keyword;
+ }
+
+ // Return true if the next token is an assignment operator
+
+ function matchAssign() {
+ var op;
+
+ if (lookahead.type !== Token.Punctuator) {
+ return false;
+ }
+ op = lookahead.value;
+ return op === '=' ||
+ op === '*=' ||
+ op === '/=' ||
+ op === '%=' ||
+ op === '+=' ||
+ op === '-=' ||
+ op === '<<=' ||
+ op === '>>=' ||
+ op === '>>>=' ||
+ op === '&=' ||
+ op === '^=' ||
+ op === '|=';
+ }
+
+ function consumeSemicolon() {
+ // Catch the very common case first: immediately a semicolon (U+003B).
+ if (source.charCodeAt(startIndex) === 0x3B || match(';')) {
+ lex();
+ return;
+ }
+
+ if (hasLineTerminator) {
+ return;
+ }
+
+ // FIXME(ikarienator): this is seemingly an issue in the previous location info convention.
+ lastIndex = startIndex;
+ lastLineNumber = startLineNumber;
+ lastLineStart = startLineStart;
+
+ if (lookahead.type !== Token.EOF && !match('}')) {
+ throwUnexpectedToken(lookahead);
+ }
+ }
+
+ // Cover grammar support.
+ //
+ // When an assignment expression position starts with an left parenthesis, the determination of the type
+ // of the syntax is to be deferred arbitrarily long until the end of the parentheses pair (plus a lookahead)
+ // or the first comma. This situation also defers the determination of all the expressions nested in the pair.
+ //
+ // There are three productions that can be parsed in a parentheses pair that needs to be determined
+ // after the outermost pair is closed. They are:
+ //
+ // 1. AssignmentExpression
+ // 2. BindingElements
+ // 3. AssignmentTargets
+ //
+ // In order to avoid exponential backtracking, we use two flags to denote if the production can be
+ // binding element or assignment target.
+ //
+ // The three productions have the relationship:
+ //
+ // BindingElements ⊆ AssignmentTargets ⊆ AssignmentExpression
+ //
+ // with a single exception that CoverInitializedName when used directly in an Expression, generates
+ // an early error. Therefore, we need the third state, firstCoverInitializedNameError, to track the
+ // first usage of CoverInitializedName and report it when we reached the end of the parentheses pair.
+ //
+ // isolateCoverGrammar function runs the given parser function with a new cover grammar context, and it does not
+ // effect the current flags. This means the production the parser parses is only used as an expression. Therefore
+ // the CoverInitializedName check is conducted.
+ //
+ // inheritCoverGrammar function runs the given parse function with a new cover grammar context, and it propagates
+ // the flags outside of the parser. This means the production the parser parses is used as a part of a potential
+ // pattern. The CoverInitializedName check is deferred.
+ function isolateCoverGrammar(parser) {
+ var oldIsBindingElement = isBindingElement,
+ oldIsAssignmentTarget = isAssignmentTarget,
+ oldFirstCoverInitializedNameError = firstCoverInitializedNameError,
+ result;
+ isBindingElement = true;
+ isAssignmentTarget = true;
+ firstCoverInitializedNameError = null;
+ result = parser();
+ if (firstCoverInitializedNameError !== null) {
+ throwUnexpectedToken(firstCoverInitializedNameError);
+ }
+ isBindingElement = oldIsBindingElement;
+ isAssignmentTarget = oldIsAssignmentTarget;
+ firstCoverInitializedNameError = oldFirstCoverInitializedNameError;
+ return result;
+ }
+
+ function inheritCoverGrammar(parser) {
+ var oldIsBindingElement = isBindingElement,
+ oldIsAssignmentTarget = isAssignmentTarget,
+ oldFirstCoverInitializedNameError = firstCoverInitializedNameError,
+ result;
+ isBindingElement = true;
+ isAssignmentTarget = true;
+ firstCoverInitializedNameError = null;
+ result = parser();
+ isBindingElement = isBindingElement && oldIsBindingElement;
+ isAssignmentTarget = isAssignmentTarget && oldIsAssignmentTarget;
+ firstCoverInitializedNameError = oldFirstCoverInitializedNameError || firstCoverInitializedNameError;
+ return result;
+ }
+
+ function parseArrayPattern() {
+ var node = new Node(), elements = [], rest, restNode;
+ expect('[');
+
+ while (!match(']')) {
+ if (match(',')) {
+ lex();
+ elements.push(null);
+ } else {
+ if (match('...')) {
+ restNode = new Node();
+ lex();
+ rest = parseVariableIdentifier();
+ elements.push(restNode.finishRestElement(rest));
+ break;
+ } else {
+ elements.push(parsePatternWithDefault());
+ }
+ if (!match(']')) {
+ expect(',');
+ }
+ }
+
+ }
+
+ expect(']');
+
+ return node.finishArrayPattern(elements);
+ }
+
+ function parsePropertyPattern() {
+ var node = new Node(), key, computed = match('['), init;
+ if (lookahead.type === Token.Identifier) {
+ key = parseVariableIdentifier();
+ if (match('=')) {
+ lex();
+ init = parseAssignmentExpression();
+ return node.finishProperty(
+ 'init', key, false,
+ new WrappingNode(key).finishAssignmentPattern(key, init), false, false);
+ } else if (!match(':')) {
+ return node.finishProperty('init', key, false, key, false, true);
+ }
+ } else {
+ key = parseObjectPropertyKey();
+ }
+ expect(':');
+ init = parsePatternWithDefault();
+ return node.finishProperty('init', key, computed, init, false, false);
+ }
+
+ function parseObjectPattern() {
+ var node = new Node(), properties = [];
+
+ expect('{');
+
+ while (!match('}')) {
+ properties.push(parsePropertyPattern());
+ if (!match('}')) {
+ expect(',');
+ }
+ }
+
+ lex();
+
+ return node.finishObjectPattern(properties);
+ }
+
+ function parsePattern() {
+ if (lookahead.type === Token.Identifier) {
+ return parseVariableIdentifier();
+ } else if (match('[')) {
+ return parseArrayPattern();
+ } else if (match('{')) {
+ return parseObjectPattern();
+ }
+ throwUnexpectedToken(lookahead);
+ }
+
+ function parsePatternWithDefault() {
+ var startToken = lookahead, pattern, right;
+ pattern = parsePattern();
+ if (match('=')) {
+ lex();
+ right = isolateCoverGrammar(parseAssignmentExpression);
+ pattern = new WrappingNode(startToken).finishAssignmentPattern(pattern, right);
+ }
+ return pattern;
+ }
+
+ // 11.1.4 Array Initialiser
+
+ function parseArrayInitialiser() {
+ var elements = [], node = new Node(), restSpread;
+
+ expect('[');
+
+ while (!match(']')) {
+ if (match(',')) {
+ lex();
+ elements.push(null);
+ } else if (match('...')) {
+ restSpread = new Node();
+ lex();
+ restSpread.finishSpreadElement(inheritCoverGrammar(parseAssignmentExpression));
+
+ if (!match(']')) {
+ isAssignmentTarget = isBindingElement = false;
+ expect(',');
+ }
+ elements.push(restSpread);
+ } else {
+ elements.push(inheritCoverGrammar(parseAssignmentExpression));
+
+ if (!match(']')) {
+ expect(',');
+ }
+ }
+ }
+
+ lex();
+
+ return node.finishArrayExpression(elements);
+ }
+
+ // 11.1.5 Object Initialiser
+
+ function parsePropertyFunction(node, paramInfo) {
+ var previousStrict, body;
+
+ isAssignmentTarget = isBindingElement = false;
+
+ previousStrict = strict;
+ body = isolateCoverGrammar(parseFunctionSourceElements);
+
+ if (strict && paramInfo.firstRestricted) {
+ tolerateUnexpectedToken(paramInfo.firstRestricted, paramInfo.message);
+ }
+ if (strict && paramInfo.stricted) {
+ tolerateUnexpectedToken(paramInfo.stricted, paramInfo.message);
+ }
+
+ strict = previousStrict;
+ return node.finishFunctionExpression(null, paramInfo.params, paramInfo.defaults, body);
+ }
+
+ function parsePropertyMethodFunction() {
+ var params, method, node = new Node();
+
+ params = parseParams();
+ method = parsePropertyFunction(node, params);
+
+ return method;
+ }
+
+ function parseObjectPropertyKey() {
+ var token, node = new Node(), expr;
+
+ token = lex();
+
+ // Note: This function is called only from parseObjectProperty(), where
+ // EOF and Punctuator tokens are already filtered out.
+
+ switch (token.type) {
+ case Token.StringLiteral:
+ case Token.NumericLiteral:
+ if (strict && token.octal) {
+ tolerateUnexpectedToken(token, Messages.StrictOctalLiteral);
+ }
+ return node.finishLiteral(token);
+ case Token.Identifier:
+ case Token.BooleanLiteral:
+ case Token.NullLiteral:
+ case Token.Keyword:
+ return node.finishIdentifier(token.value);
+ case Token.Punctuator:
+ if (token.value === '[') {
+ expr = isolateCoverGrammar(parseAssignmentExpression);
+ expect(']');
+ return expr;
+ }
+ break;
+ }
+ throwUnexpectedToken(token);
+ }
+
+ function lookaheadPropertyName() {
+ switch (lookahead.type) {
+ case Token.Identifier:
+ case Token.StringLiteral:
+ case Token.BooleanLiteral:
+ case Token.NullLiteral:
+ case Token.NumericLiteral:
+ case Token.Keyword:
+ return true;
+ case Token.Punctuator:
+ return lookahead.value === '[';
+ }
+ return false;
+ }
+
+ // This function is to try to parse a MethodDefinition as defined in 14.3. But in the case of object literals,
+ // it might be called at a position where there is in fact a short hand identifier pattern or a data property.
+ // This can only be determined after we consumed up to the left parentheses.
+ //
+ // In order to avoid back tracking, it returns `null` if the position is not a MethodDefinition and the caller
+ // is responsible to visit other options.
+ function tryParseMethodDefinition(token, key, computed, node) {
+ var value, options, methodNode;
+
+ if (token.type === Token.Identifier) {
+ // check for `get` and `set`;
+
+ if (token.value === 'get' && lookaheadPropertyName()) {
+ computed = match('[');
+ key = parseObjectPropertyKey();
+ methodNode = new Node();
+ expect('(');
+ expect(')');
+ value = parsePropertyFunction(methodNode, {
+ params: [],
+ defaults: [],
+ stricted: null,
+ firstRestricted: null,
+ message: null
+ });
+ return node.finishProperty('get', key, computed, value, false, false);
+ } else if (token.value === 'set' && lookaheadPropertyName()) {
+ computed = match('[');
+ key = parseObjectPropertyKey();
+ methodNode = new Node();
+ expect('(');
+
+ options = {
+ params: [],
+ defaultCount: 0,
+ defaults: [],
+ firstRestricted: null,
+ paramSet: {}
+ };
+ if (match(')')) {
+ tolerateUnexpectedToken(lookahead);
+ } else {
+ parseParam(options);
+ if (options.defaultCount === 0) {
+ options.defaults = [];
+ }
+ }
+ expect(')');
+
+ value = parsePropertyFunction(methodNode, options);
+ return node.finishProperty('set', key, computed, value, false, false);
+ }
+ }
+
+ if (match('(')) {
+ value = parsePropertyMethodFunction();
+ return node.finishProperty('init', key, computed, value, true, false);
+ }
+
+ // Not a MethodDefinition.
+ return null;
+ }
+
+ function checkProto(key, computed, hasProto) {
+ if (computed === false && (key.type === Syntax.Identifier && key.name === '__proto__' ||
+ key.type === Syntax.Literal && key.value === '__proto__')) {
+ if (hasProto.value) {
+ tolerateError(Messages.DuplicateProtoProperty);
+ } else {
+ hasProto.value = true;
+ }
+ }
+ }
+
+ function parseObjectProperty(hasProto) {
+ var token = lookahead, node = new Node(), computed, key, maybeMethod, value;
+
+ computed = match('[');
+ key = parseObjectPropertyKey();
+ maybeMethod = tryParseMethodDefinition(token, key, computed, node);
+
+ if (maybeMethod) {
+ checkProto(maybeMethod.key, maybeMethod.computed, hasProto);
+ // finished
+ return maybeMethod;
+ }
+
+ // init property or short hand property.
+ checkProto(key, computed, hasProto);
+
+ if (match(':')) {
+ lex();
+ value = inheritCoverGrammar(parseAssignmentExpression);
+ return node.finishProperty('init', key, computed, value, false, false);
+ }
+
+ if (token.type === Token.Identifier) {
+ if (match('=')) {
+ firstCoverInitializedNameError = lookahead;
+ lex();
+ value = isolateCoverGrammar(parseAssignmentExpression);
+ return node.finishProperty('init', key, computed,
+ new WrappingNode(token).finishAssignmentPattern(key, value), false, true);
+ }
+ return node.finishProperty('init', key, computed, key, false, true);
+ }
+
+ throwUnexpectedToken(lookahead);
+ }
+
+ function parseObjectInitialiser() {
+ var properties = [], hasProto = {value: false}, node = new Node();
+
+ expect('{');
+
+ while (!match('}')) {
+ properties.push(parseObjectProperty(hasProto));
+
+ if (!match('}')) {
+ expectCommaSeparator();
+ }
+ }
+
+ expect('}');
+
+ return node.finishObjectExpression(properties);
+ }
+
+ function reinterpretExpressionAsPattern(expr) {
+ var i;
+ switch (expr.type) {
+ case Syntax.Identifier:
+ case Syntax.MemberExpression:
+ case Syntax.RestElement:
+ case Syntax.AssignmentPattern:
+ break;
+ case Syntax.SpreadElement:
+ expr.type = Syntax.RestElement;
+ reinterpretExpressionAsPattern(expr.argument);
+ break;
+ case Syntax.ArrayExpression:
+ expr.type = Syntax.ArrayPattern;
+ for (i = 0; i < expr.elements.length; i++) {
+ if (expr.elements[i] !== null) {
+ reinterpretExpressionAsPattern(expr.elements[i]);
+ }
+ }
+ break;
+ case Syntax.ObjectExpression:
+ expr.type = Syntax.ObjectPattern;
+ for (i = 0; i < expr.properties.length; i++) {
+ reinterpretExpressionAsPattern(expr.properties[i].value);
+ }
+ break;
+ case Syntax.AssignmentExpression:
+ expr.type = Syntax.AssignmentPattern;
+ reinterpretExpressionAsPattern(expr.left);
+ break;
+ default:
+ // Allow other node type for tolerant parsing.
+ break;
+ }
+ }
+
+ function parseTemplateElement(option) {
+ var node, token;
+
+ if (lookahead.type !== Token.Template || (option.head && !lookahead.head)) {
+ throwUnexpectedToken();
+ }
+
+ node = new Node();
+ token = lex();
+
+ return node.finishTemplateElement({ raw: token.value.raw, cooked: token.value.cooked }, token.tail);
+ }
+
+ function parseTemplateLiteral() {
+ var quasi, quasis, expressions, node = new Node();
+
+ quasi = parseTemplateElement({ head: true });
+ quasis = [ quasi ];
+ expressions = [];
+
+ while (!quasi.tail) {
+ expressions.push(parseExpression());
+ quasi = parseTemplateElement({ head: false });
+ quasis.push(quasi);
+ }
+
+ return node.finishTemplateLiteral(quasis, expressions);
+ }
+
+ // 11.1.6 The Grouping Operator
+
+ function parseGroupExpression() {
+ var expr, expressions, startToken, i;
+
+ expect('(');
+
+ if (match(')')) {
+ lex();
+ if (!match('=>')) {
+ expect('=>');
+ }
+ return {
+ type: PlaceHolders.ArrowParameterPlaceHolder,
+ params: []
+ };
+ }
+
+ startToken = lookahead;
+ if (match('...')) {
+ expr = parseRestElement();
+ expect(')');
+ if (!match('=>')) {
+ expect('=>');
+ }
+ return {
+ type: PlaceHolders.ArrowParameterPlaceHolder,
+ params: [expr]
+ };
+ }
+
+ isBindingElement = true;
+ expr = inheritCoverGrammar(parseAssignmentExpression);
+
+ if (match(',')) {
+ isAssignmentTarget = false;
+ expressions = [expr];
+
+ while (startIndex < length) {
+ if (!match(',')) {
+ break;
+ }
+ lex();
+
+ if (match('...')) {
+ if (!isBindingElement) {
+ throwUnexpectedToken(lookahead);
+ }
+ expressions.push(parseRestElement());
+ expect(')');
+ if (!match('=>')) {
+ expect('=>');
+ }
+ isBindingElement = false;
+ for (i = 0; i < expressions.length; i++) {
+ reinterpretExpressionAsPattern(expressions[i]);
+ }
+ return {
+ type: PlaceHolders.ArrowParameterPlaceHolder,
+ params: expressions
+ };
+ }
+
+ expressions.push(inheritCoverGrammar(parseAssignmentExpression));
+ }
+
+ expr = new WrappingNode(startToken).finishSequenceExpression(expressions);
+ }
+
+
+ expect(')');
+
+ if (match('=>')) {
+ if (!isBindingElement) {
+ throwUnexpectedToken(lookahead);
+ }
+
+ if (expr.type === Syntax.SequenceExpression) {
+ for (i = 0; i < expr.expressions.length; i++) {
+ reinterpretExpressionAsPattern(expr.expressions[i]);
+ }
+ } else {
+ reinterpretExpressionAsPattern(expr);
+ }
+
+ expr = {
+ type: PlaceHolders.ArrowParameterPlaceHolder,
+ params: expr.type === Syntax.SequenceExpression ? expr.expressions : [expr]
+ };
+ }
+ isBindingElement = false;
+ return expr;
+ }
+
+
+ // 11.1 Primary Expressions
+
+ function parsePrimaryExpression() {
+ var type, token, expr, node;
+
+ if (match('(')) {
+ isBindingElement = false;
+ return inheritCoverGrammar(parseGroupExpression);
+ }
+
+ if (match('[')) {
+ return inheritCoverGrammar(parseArrayInitialiser);
+ }
+
+ if (match('{')) {
+ return inheritCoverGrammar(parseObjectInitialiser);
+ }
+
+ type = lookahead.type;
+ node = new Node();
+
+ if (type === Token.Identifier) {
+ expr = node.finishIdentifier(lex().value);
+ } else if (type === Token.StringLiteral || type === Token.NumericLiteral) {
+ isAssignmentTarget = isBindingElement = false;
+ if (strict && lookahead.octal) {
+ tolerateUnexpectedToken(lookahead, Messages.StrictOctalLiteral);
+ }
+ expr = node.finishLiteral(lex());
+ } else if (type === Token.Keyword) {
+ isAssignmentTarget = isBindingElement = false;
+ if (matchKeyword('function')) {
+ return parseFunctionExpression();
+ }
+ if (matchKeyword('this')) {
+ lex();
+ return node.finishThisExpression();
+ }
+ if (matchKeyword('class')) {
+ return parseClassExpression();
+ }
+ throwUnexpectedToken(lex());
+ } else if (type === Token.BooleanLiteral) {
+ isAssignmentTarget = isBindingElement = false;
+ token = lex();
+ token.value = (token.value === 'true');
+ expr = node.finishLiteral(token);
+ } else if (type === Token.NullLiteral) {
+ isAssignmentTarget = isBindingElement = false;
+ token = lex();
+ token.value = null;
+ expr = node.finishLiteral(token);
+ } else if (match('/') || match('/=')) {
+ isAssignmentTarget = isBindingElement = false;
+ index = startIndex;
+
+ if (typeof extra.tokens !== 'undefined') {
+ token = collectRegex();
+ } else {
+ token = scanRegExp();
+ }
+ lex();
+ expr = node.finishLiteral(token);
+ } else if (type === Token.Template) {
+ expr = parseTemplateLiteral();
+ } else {
+ throwUnexpectedToken(lex());
+ }
+
+ return expr;
+ }
+
+ // 11.2 Left-Hand-Side Expressions
+
+ function parseArguments() {
+ var args = [];
+
+ expect('(');
+
+ if (!match(')')) {
+ while (startIndex < length) {
+ args.push(isolateCoverGrammar(parseAssignmentExpression));
+ if (match(')')) {
+ break;
+ }
+ expectCommaSeparator();
+ }
+ }
+
+ expect(')');
+
+ return args;
+ }
+
+ function parseNonComputedProperty() {
+ var token, node = new Node();
+
+ token = lex();
+
+ if (!isIdentifierName(token)) {
+ throwUnexpectedToken(token);
+ }
+
+ return node.finishIdentifier(token.value);
+ }
+
+ function parseNonComputedMember() {
+ expect('.');
+
+ return parseNonComputedProperty();
+ }
+
+ function parseComputedMember() {
+ var expr;
+
+ expect('[');
+
+ expr = isolateCoverGrammar(parseExpression);
+
+ expect(']');
+
+ return expr;
+ }
+
+ function parseNewExpression() {
+ var callee, args, node = new Node();
+
+ expectKeyword('new');
+ callee = isolateCoverGrammar(parseLeftHandSideExpression);
+ args = match('(') ? parseArguments() : [];
+
+ isAssignmentTarget = isBindingElement = false;
+
+ return node.finishNewExpression(callee, args);
+ }
+
+ function parseLeftHandSideExpressionAllowCall() {
+ var quasi, expr, args, property, startToken, previousAllowIn = state.allowIn;
+
+ startToken = lookahead;
+ state.allowIn = true;
+
+ if (matchKeyword('super') && state.inFunctionBody) {
+ expr = new Node();
+ lex();
+ expr = expr.finishSuper();
+ if (!match('(') && !match('.') && !match('[')) {
+ throwUnexpectedToken(lookahead);
+ }
+ } else {
+ expr = inheritCoverGrammar(matchKeyword('new') ? parseNewExpression : parsePrimaryExpression);
+ }
+
+ for (;;) {
+ if (match('.')) {
+ isBindingElement = false;
+ isAssignmentTarget = true;
+ property = parseNonComputedMember();
+ expr = new WrappingNode(startToken).finishMemberExpression('.', expr, property);
+ } else if (match('(')) {
+ isBindingElement = false;
+ isAssignmentTarget = false;
+ args = parseArguments();
+ expr = new WrappingNode(startToken).finishCallExpression(expr, args);
+ } else if (match('[')) {
+ isBindingElement = false;
+ isAssignmentTarget = true;
+ property = parseComputedMember();
+ expr = new WrappingNode(startToken).finishMemberExpression('[', expr, property);
+ } else if (lookahead.type === Token.Template && lookahead.head) {
+ quasi = parseTemplateLiteral();
+ expr = new WrappingNode(startToken).finishTaggedTemplateExpression(expr, quasi);
+ } else {
+ break;
+ }
+ }
+ state.allowIn = previousAllowIn;
+
+ return expr;
+ }
+
+ function parseLeftHandSideExpression() {
+ var quasi, expr, property, startToken;
+ assert(state.allowIn, 'callee of new expression always allow in keyword.');
+
+ startToken = lookahead;
+
+ if (matchKeyword('super') && state.inFunctionBody) {
+ expr = new Node();
+ lex();
+ expr = expr.finishSuper();
+ if (!match('[') && !match('.')) {
+ throwUnexpectedToken(lookahead);
+ }
+ } else {
+ expr = inheritCoverGrammar(matchKeyword('new') ? parseNewExpression : parsePrimaryExpression);
+ }
+
+ for (;;) {
+ if (match('[')) {
+ isBindingElement = false;
+ isAssignmentTarget = true;
+ property = parseComputedMember();
+ expr = new WrappingNode(startToken).finishMemberExpression('[', expr, property);
+ } else if (match('.')) {
+ isBindingElement = false;
+ isAssignmentTarget = true;
+ property = parseNonComputedMember();
+ expr = new WrappingNode(startToken).finishMemberExpression('.', expr, property);
+ } else if (lookahead.type === Token.Template && lookahead.head) {
+ quasi = parseTemplateLiteral();
+ expr = new WrappingNode(startToken).finishTaggedTemplateExpression(expr, quasi);
+ } else {
+ break;
+ }
+ }
+ return expr;
+ }
+
+ // 11.3 Postfix Expressions
+
+ function parsePostfixExpression() {
+ var expr, token, startToken = lookahead;
+
+ expr = inheritCoverGrammar(parseLeftHandSideExpressionAllowCall);
+
+ if (!hasLineTerminator && lookahead.type === Token.Punctuator) {
+ if (match('++') || match('--')) {
+ // 11.3.1, 11.3.2
+ if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {
+ tolerateError(Messages.StrictLHSPostfix);
+ }
+
+ if (!isAssignmentTarget) {
+ tolerateError(Messages.InvalidLHSInAssignment);
+ }
+
+ isAssignmentTarget = isBindingElement = false;
+
+ token = lex();
+ expr = new WrappingNode(startToken).finishPostfixExpression(token.value, expr);
+ }
+ }
+
+ return expr;
+ }
+
+ // 11.4 Unary Operators
+
+ function parseUnaryExpression() {
+ var token, expr, startToken;
+
+ if (lookahead.type !== Token.Punctuator && lookahead.type !== Token.Keyword) {
+ expr = parsePostfixExpression();
+ } else if (match('++') || match('--')) {
+ startToken = lookahead;
+ token = lex();
+ expr = inheritCoverGrammar(parseUnaryExpression);
+ // 11.4.4, 11.4.5
+ if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {
+ tolerateError(Messages.StrictLHSPrefix);
+ }
+
+ if (!isAssignmentTarget) {
+ tolerateError(Messages.InvalidLHSInAssignment);
+ }
+ expr = new WrappingNode(startToken).finishUnaryExpression(token.value, expr);
+ isAssignmentTarget = isBindingElement = false;
+ } else if (match('+') || match('-') || match('~') || match('!')) {
+ startToken = lookahead;
+ token = lex();
+ expr = inheritCoverGrammar(parseUnaryExpression);
+ expr = new WrappingNode(startToken).finishUnaryExpression(token.value, expr);
+ isAssignmentTarget = isBindingElement = false;
+ } else if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) {
+ startToken = lookahead;
+ token = lex();
+ expr = inheritCoverGrammar(parseUnaryExpression);
+ expr = new WrappingNode(startToken).finishUnaryExpression(token.value, expr);
+ if (strict && expr.operator === 'delete' && expr.argument.type === Syntax.Identifier) {
+ tolerateError(Messages.StrictDelete);
+ }
+ isAssignmentTarget = isBindingElement = false;
+ } else {
+ expr = parsePostfixExpression();
+ }
+
+ return expr;
+ }
+
+ function binaryPrecedence(token, allowIn) {
+ var prec = 0;
+
+ if (token.type !== Token.Punctuator && token.type !== Token.Keyword) {
+ return 0;
+ }
+
+ switch (token.value) {
+ case '||':
+ prec = 1;
+ break;
+
+ case '&&':
+ prec = 2;
+ break;
+
+ case '|':
+ prec = 3;
+ break;
+
+ case '^':
+ prec = 4;
+ break;
+
+ case '&':
+ prec = 5;
+ break;
+
+ case '==':
+ case '!=':
+ case '===':
+ case '!==':
+ prec = 6;
+ break;
+
+ case '<':
+ case '>':
+ case '<=':
+ case '>=':
+ case 'instanceof':
+ prec = 7;
+ break;
+
+ case 'in':
+ prec = allowIn ? 7 : 0;
+ break;
+
+ case '<<':
+ case '>>':
+ case '>>>':
+ prec = 8;
+ break;
+
+ case '+':
+ case '-':
+ prec = 9;
+ break;
+
+ case '*':
+ case '/':
+ case '%':
+ prec = 11;
+ break;
+
+ default:
+ break;
+ }
+
+ return prec;
+ }
+
+ // 11.5 Multiplicative Operators
+ // 11.6 Additive Operators
+ // 11.7 Bitwise Shift Operators
+ // 11.8 Relational Operators
+ // 11.9 Equality Operators
+ // 11.10 Binary Bitwise Operators
+ // 11.11 Binary Logical Operators
+
+ function parseBinaryExpression() {
+ var marker, markers, expr, token, prec, stack, right, operator, left, i;
+
+ marker = lookahead;
+ left = inheritCoverGrammar(parseUnaryExpression);
+
+ token = lookahead;
+ prec = binaryPrecedence(token, state.allowIn);
+ if (prec === 0) {
+ return left;
+ }
+ isAssignmentTarget = isBindingElement = false;
+ token.prec = prec;
+ lex();
+
+ markers = [marker, lookahead];
+ right = isolateCoverGrammar(parseUnaryExpression);
+
+ stack = [left, token, right];
+
+ while ((prec = binaryPrecedence(lookahead, state.allowIn)) > 0) {
+
+ // Reduce: make a binary expression from the three topmost entries.
+ while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {
+ right = stack.pop();
+ operator = stack.pop().value;
+ left = stack.pop();
+ markers.pop();
+ expr = new WrappingNode(markers[markers.length - 1]).finishBinaryExpression(operator, left, right);
+ stack.push(expr);
+ }
+
+ // Shift.
+ token = lex();
+ token.prec = prec;
+ stack.push(token);
+ markers.push(lookahead);
+ expr = isolateCoverGrammar(parseUnaryExpression);
+ stack.push(expr);
+ }
+
+ // Final reduce to clean-up the stack.
+ i = stack.length - 1;
+ expr = stack[i];
+ markers.pop();
+ while (i > 1) {
+ expr = new WrappingNode(markers.pop()).finishBinaryExpression(stack[i - 1].value, stack[i - 2], expr);
+ i -= 2;
+ }
+
+ return expr;
+ }
+
+
+ // 11.12 Conditional Operator
+
+ function parseConditionalExpression() {
+ var expr, previousAllowIn, consequent, alternate, startToken;
+
+ startToken = lookahead;
+
+ expr = inheritCoverGrammar(parseBinaryExpression);
+ if (match('?')) {
+ lex();
+ previousAllowIn = state.allowIn;
+ state.allowIn = true;
+ consequent = isolateCoverGrammar(parseAssignmentExpression);
+ state.allowIn = previousAllowIn;
+ expect(':');
+ alternate = isolateCoverGrammar(parseAssignmentExpression);
+
+ expr = new WrappingNode(startToken).finishConditionalExpression(expr, consequent, alternate);
+ isAssignmentTarget = isBindingElement = false;
+ }
+
+ return expr;
+ }
+
+ // [ES6] 14.2 Arrow Function
+
+ function parseConciseBody() {
+ if (match('{')) {
+ return parseFunctionSourceElements();
+ }
+ return isolateCoverGrammar(parseAssignmentExpression);
+ }
+
+ function checkPatternParam(options, param) {
+ var i;
+ switch (param.type) {
+ case Syntax.Identifier:
+ validateParam(options, param, param.name);
+ break;
+ case Syntax.RestElement:
+ checkPatternParam(options, param.argument);
+ break;
+ case Syntax.AssignmentPattern:
+ checkPatternParam(options, param.left);
+ break;
+ case Syntax.ArrayPattern:
+ for (i = 0; i < param.elements.length; i++) {
+ if (param.elements[i] !== null) {
+ checkPatternParam(options, param.elements[i]);
+ }
+ }
+ break;
+ default:
+ assert(param.type === Syntax.ObjectPattern, 'Invalid type');
+ for (i = 0; i < param.properties.length; i++) {
+ checkPatternParam(options, param.properties[i].value);
+ }
+ break;
+ }
+ }
+ function reinterpretAsCoverFormalsList(expr) {
+ var i, len, param, params, defaults, defaultCount, options, token;
+
+ defaults = [];
+ defaultCount = 0;
+ params = [expr];
+
+ switch (expr.type) {
+ case Syntax.Identifier:
+ break;
+ case PlaceHolders.ArrowParameterPlaceHolder:
+ params = expr.params;
+ break;
+ default:
+ return null;
+ }
+
+ options = {
+ paramSet: {}
+ };
+
+ for (i = 0, len = params.length; i < len; i += 1) {
+ param = params[i];
+ switch (param.type) {
+ case Syntax.AssignmentPattern:
+ params[i] = param.left;
+ defaults.push(param.right);
+ ++defaultCount;
+ checkPatternParam(options, param.left);
+ break;
+ default:
+ checkPatternParam(options, param);
+ params[i] = param;
+ defaults.push(null);
+ break;
+ }
+ }
+
+ if (options.message === Messages.StrictParamDupe) {
+ token = strict ? options.stricted : options.firstRestricted;
+ throwUnexpectedToken(token, options.message);
+ }
+
+ if (defaultCount === 0) {
+ defaults = [];
+ }
+
+ return {
+ params: params,
+ defaults: defaults,
+ stricted: options.stricted,
+ firstRestricted: options.firstRestricted,
+ message: options.message
+ };
+ }
+
+ function parseArrowFunctionExpression(options, node) {
+ var previousStrict, body;
+
+ if (hasLineTerminator) {
+ tolerateUnexpectedToken(lookahead);
+ }
+ expect('=>');
+ previousStrict = strict;
+
+ body = parseConciseBody();
+
+ if (strict && options.firstRestricted) {
+ throwUnexpectedToken(options.firstRestricted, options.message);
+ }
+ if (strict && options.stricted) {
+ tolerateUnexpectedToken(options.stricted, options.message);
+ }
+
+ strict = previousStrict;
+
+ return node.finishArrowFunctionExpression(options.params, options.defaults, body, body.type !== Syntax.BlockStatement);
+ }
+
+ // 11.13 Assignment Operators
+
+ function parseAssignmentExpression() {
+ var token, expr, right, list, startToken;
+
+ startToken = lookahead;
+ token = lookahead;
+
+ expr = parseConditionalExpression();
+
+ if (expr.type === PlaceHolders.ArrowParameterPlaceHolder || match('=>')) {
+ isAssignmentTarget = isBindingElement = false;
+ list = reinterpretAsCoverFormalsList(expr);
+
+ if (list) {
+ firstCoverInitializedNameError = null;
+ return parseArrowFunctionExpression(list, new WrappingNode(startToken));
+ }
+
+ return expr;
+ }
+
+ if (matchAssign()) {
+ if (!isAssignmentTarget) {
+ tolerateError(Messages.InvalidLHSInAssignment);
+ }
+
+ // 11.13.1
+ if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {
+ tolerateUnexpectedToken(token, Messages.StrictLHSAssignment);
+ }
+
+ if (!match('=')) {
+ isAssignmentTarget = isBindingElement = false;
+ } else {
+ reinterpretExpressionAsPattern(expr);
+ }
+
+ token = lex();
+ right = isolateCoverGrammar(parseAssignmentExpression);
+ expr = new WrappingNode(startToken).finishAssignmentExpression(token.value, expr, right);
+ firstCoverInitializedNameError = null;
+ }
+
+ return expr;
+ }
+
+ // 11.14 Comma Operator
+
+ function parseExpression() {
+ var expr, startToken = lookahead, expressions;
+
+ expr = isolateCoverGrammar(parseAssignmentExpression);
+
+ if (match(',')) {
+ expressions = [expr];
+
+ while (startIndex < length) {
+ if (!match(',')) {
+ break;
+ }
+ lex();
+ expressions.push(isolateCoverGrammar(parseAssignmentExpression));
+ }
+
+ expr = new WrappingNode(startToken).finishSequenceExpression(expressions);
+ }
+
+ return expr;
+ }
+
+ // 12.1 Block
+
+ function parseStatementListItem() {
+ if (lookahead.type === Token.Keyword) {
+ switch (lookahead.value) {
+ case 'export':
+ if (sourceType !== 'module') {
+ tolerateUnexpectedToken(lookahead, Messages.IllegalExportDeclaration);
+ }
+ return parseExportDeclaration();
+ case 'import':
+ if (sourceType !== 'module') {
+ tolerateUnexpectedToken(lookahead, Messages.IllegalImportDeclaration);
+ }
+ return parseImportDeclaration();
+ case 'const':
+ case 'let':
+ return parseLexicalDeclaration({inFor: false});
+ case 'function':
+ return parseFunctionDeclaration(new Node());
+ case 'class':
+ return parseClassDeclaration();
+ }
+ }
+
+ return parseStatement();
+ }
+
+ function parseStatementList() {
+ var list = [];
+ while (startIndex < length) {
+ if (match('}')) {
+ break;
+ }
+ list.push(parseStatementListItem());
+ }
+
+ return list;
+ }
+
+ function parseBlock() {
+ var block, node = new Node();
+
+ expect('{');
+
+ block = parseStatementList();
+
+ expect('}');
+
+ return node.finishBlockStatement(block);
+ }
+
+ // 12.2 Variable Statement
+
+ function parseVariableIdentifier() {
+ var token, node = new Node();
+
+ token = lex();
+
+ if (token.type !== Token.Identifier) {
+ if (strict && token.type === Token.Keyword && isStrictModeReservedWord(token.value)) {
+ tolerateUnexpectedToken(token, Messages.StrictReservedWord);
+ } else {
+ throwUnexpectedToken(token);
+ }
+ }
+
+ return node.finishIdentifier(token.value);
+ }
+
+ function parseVariableDeclaration() {
+ var init = null, id, node = new Node();
+
+ id = parsePattern();
+
+ // 12.2.1
+ if (strict && isRestrictedWord(id.name)) {
+ tolerateError(Messages.StrictVarName);
+ }
+
+ if (match('=')) {
+ lex();
+ init = isolateCoverGrammar(parseAssignmentExpression);
+ } else if (id.type !== Syntax.Identifier) {
+ expect('=');
+ }
+
+ return node.finishVariableDeclarator(id, init);
+ }
+
+ function parseVariableDeclarationList() {
+ var list = [];
+
+ do {
+ list.push(parseVariableDeclaration());
+ if (!match(',')) {
+ break;
+ }
+ lex();
+ } while (startIndex < length);
+
+ return list;
+ }
+
+ function parseVariableStatement(node) {
+ var declarations;
+
+ expectKeyword('var');
+
+ declarations = parseVariableDeclarationList();
+
+ consumeSemicolon();
+
+ return node.finishVariableDeclaration(declarations);
+ }
+
+ function parseLexicalBinding(kind, options) {
+ var init = null, id, node = new Node();
+
+ id = parsePattern();
+
+ // 12.2.1
+ if (strict && id.type === Syntax.Identifier && isRestrictedWord(id.name)) {
+ tolerateError(Messages.StrictVarName);
+ }
+
+ if (kind === 'const') {
+ if (!matchKeyword('in')) {
+ expect('=');
+ init = isolateCoverGrammar(parseAssignmentExpression);
+ }
+ } else if ((!options.inFor && id.type !== Syntax.Identifier) || match('=')) {
+ expect('=');
+ init = isolateCoverGrammar(parseAssignmentExpression);
+ }
+
+ return node.finishVariableDeclarator(id, init);
+ }
+
+ function parseBindingList(kind, options) {
+ var list = [];
+
+ do {
+ list.push(parseLexicalBinding(kind, options));
+ if (!match(',')) {
+ break;
+ }
+ lex();
+ } while (startIndex < length);
+
+ return list;
+ }
+
+ function parseLexicalDeclaration(options) {
+ var kind, declarations, node = new Node();
+
+ kind = lex().value;
+ assert(kind === 'let' || kind === 'const', 'Lexical declaration must be either let or const');
+
+ declarations = parseBindingList(kind, options);
+
+ consumeSemicolon();
+
+ return node.finishLexicalDeclaration(declarations, kind);
+ }
+
+ function parseRestElement() {
+ var param, node = new Node();
+
+ lex();
+
+ if (match('{')) {
+ throwError(Messages.ObjectPatternAsRestParameter);
+ }
+
+ param = parseVariableIdentifier();
+
+ if (match('=')) {
+ throwError(Messages.DefaultRestParameter);
+ }
+
+ if (!match(')')) {
+ throwError(Messages.ParameterAfterRestParameter);
+ }
+
+ return node.finishRestElement(param);
+ }
+
+ // 12.3 Empty Statement
+
+ function parseEmptyStatement(node) {
+ expect(';');
+ return node.finishEmptyStatement();
+ }
+
+ // 12.4 Expression Statement
+
+ function parseExpressionStatement(node) {
+ var expr = parseExpression();
+ consumeSemicolon();
+ return node.finishExpressionStatement(expr);
+ }
+
+ // 12.5 If statement
+
+ function parseIfStatement(node) {
+ var test, consequent, alternate;
+
+ expectKeyword('if');
+
+ expect('(');
+
+ test = parseExpression();
+
+ expect(')');
+
+ consequent = parseStatement();
+
+ if (matchKeyword('else')) {
+ lex();
+ alternate = parseStatement();
+ } else {
+ alternate = null;
+ }
+
+ return node.finishIfStatement(test, consequent, alternate);
+ }
+
+ // 12.6 Iteration Statements
+
+ function parseDoWhileStatement(node) {
+ var body, test, oldInIteration;
+
+ expectKeyword('do');
+
+ oldInIteration = state.inIteration;
+ state.inIteration = true;
+
+ body = parseStatement();
+
+ state.inIteration = oldInIteration;
+
+ expectKeyword('while');
+
+ expect('(');
+
+ test = parseExpression();
+
+ expect(')');
+
+ if (match(';')) {
+ lex();
+ }
+
+ return node.finishDoWhileStatement(body, test);
+ }
+
+ function parseWhileStatement(node) {
+ var test, body, oldInIteration;
+
+ expectKeyword('while');
+
+ expect('(');
+
+ test = parseExpression();
+
+ expect(')');
+
+ oldInIteration = state.inIteration;
+ state.inIteration = true;
+
+ body = parseStatement();
+
+ state.inIteration = oldInIteration;
+
+ return node.finishWhileStatement(test, body);
+ }
+
+ function parseForStatement(node) {
+ var init, initSeq, initStartToken, test, update, left, right, kind, declarations,
+ body, oldInIteration, previousAllowIn = state.allowIn;
+
+ init = test = update = null;
+
+ expectKeyword('for');
+
+ expect('(');
+
+ if (match(';')) {
+ lex();
+ } else {
+ if (matchKeyword('var')) {
+ init = new Node();
+ lex();
+
+ state.allowIn = false;
+ init = init.finishVariableDeclaration(parseVariableDeclarationList());
+ state.allowIn = previousAllowIn;
+
+ if (init.declarations.length === 1 && matchKeyword('in')) {
+ lex();
+ left = init;
+ right = parseExpression();
+ init = null;
+ } else {
+ expect(';');
+ }
+ } else if (matchKeyword('const') || matchKeyword('let')) {
+ init = new Node();
+ kind = lex().value;
+
+ state.allowIn = false;
+ declarations = parseBindingList(kind, {inFor: true});
+ state.allowIn = previousAllowIn;
+
+ if (declarations.length === 1 && declarations[0].init === null && matchKeyword('in')) {
+ init = init.finishLexicalDeclaration(declarations, kind);
+ lex();
+ left = init;
+ right = parseExpression();
+ init = null;
+ } else {
+ consumeSemicolon();
+ init = init.finishLexicalDeclaration(declarations, kind);
+ }
+ } else {
+ initStartToken = lookahead;
+ state.allowIn = false;
+ init = inheritCoverGrammar(parseAssignmentExpression);
+ state.allowIn = previousAllowIn;
+
+ if (matchKeyword('in')) {
+ if (!isAssignmentTarget) {
+ tolerateError(Messages.InvalidLHSInForIn);
+ }
+
+ lex();
+ reinterpretExpressionAsPattern(init);
+ left = init;
+ right = parseExpression();
+ init = null;
+ } else {
+ if (match(',')) {
+ initSeq = [init];
+ while (match(',')) {
+ lex();
+ initSeq.push(isolateCoverGrammar(parseAssignmentExpression));
+ }
+ init = new WrappingNode(initStartToken).finishSequenceExpression(initSeq);
+ }
+ expect(';');
+ }
+ }
+ }
+
+ if (typeof left === 'undefined') {
+
+ if (!match(';')) {
+ test = parseExpression();
+ }
+ expect(';');
+
+ if (!match(')')) {
+ update = parseExpression();
+ }
+ }
+
+ expect(')');
+
+ oldInIteration = state.inIteration;
+ state.inIteration = true;
+
+ body = isolateCoverGrammar(parseStatement);
+
+ state.inIteration = oldInIteration;
+
+ return (typeof left === 'undefined') ?
+ node.finishForStatement(init, test, update, body) :
+ node.finishForInStatement(left, right, body);
+ }
+
+ // 12.7 The continue statement
+
+ function parseContinueStatement(node) {
+ var label = null, key;
+
+ expectKeyword('continue');
+
+ // Optimize the most common form: 'continue;'.
+ if (source.charCodeAt(startIndex) === 0x3B) {
+ lex();
+
+ if (!state.inIteration) {
+ throwError(Messages.IllegalContinue);
+ }
+
+ return node.finishContinueStatement(null);
+ }
+
+ if (hasLineTerminator) {
+ if (!state.inIteration) {
+ throwError(Messages.IllegalContinue);
+ }
+
+ return node.finishContinueStatement(null);
+ }
+
+ if (lookahead.type === Token.Identifier) {
+ label = parseVariableIdentifier();
+
+ key = '$' + label.name;
+ if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) {
+ throwError(Messages.UnknownLabel, label.name);
+ }
+ }
+
+ consumeSemicolon();
+
+ if (label === null && !state.inIteration) {
+ throwError(Messages.IllegalContinue);
+ }
+
+ return node.finishContinueStatement(label);
+ }
+
+ // 12.8 The break statement
+
+ function parseBreakStatement(node) {
+ var label = null, key;
+
+ expectKeyword('break');
+
+ // Catch the very common case first: immediately a semicolon (U+003B).
+ if (source.charCodeAt(lastIndex) === 0x3B) {
+ lex();
+
+ if (!(state.inIteration || state.inSwitch)) {
+ throwError(Messages.IllegalBreak);
+ }
+
+ return node.finishBreakStatement(null);
+ }
+
+ if (hasLineTerminator) {
+ if (!(state.inIteration || state.inSwitch)) {
+ throwError(Messages.IllegalBreak);
+ }
+
+ return node.finishBreakStatement(null);
+ }
+
+ if (lookahead.type === Token.Identifier) {
+ label = parseVariableIdentifier();
+
+ key = '$' + label.name;
+ if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) {
+ throwError(Messages.UnknownLabel, label.name);
+ }
+ }
+
+ consumeSemicolon();
+
+ if (label === null && !(state.inIteration || state.inSwitch)) {
+ throwError(Messages.IllegalBreak);
+ }
+
+ return node.finishBreakStatement(label);
+ }
+
+ // 12.9 The return statement
+
+ function parseReturnStatement(node) {
+ var argument = null;
+
+ expectKeyword('return');
+
+ if (!state.inFunctionBody) {
+ tolerateError(Messages.IllegalReturn);
+ }
+
+ // 'return' followed by a space and an identifier is very common.
+ if (source.charCodeAt(lastIndex) === 0x20) {
+ if (isIdentifierStart(source.charCodeAt(lastIndex + 1))) {
+ argument = parseExpression();
+ consumeSemicolon();
+ return node.finishReturnStatement(argument);
+ }
+ }
+
+ if (hasLineTerminator) {
+ // HACK
+ return node.finishReturnStatement(null);
+ }
+
+ if (!match(';')) {
+ if (!match('}') && lookahead.type !== Token.EOF) {
+ argument = parseExpression();
+ }
+ }
+
+ consumeSemicolon();
+
+ return node.finishReturnStatement(argument);
+ }
+
+ // 12.10 The with statement
+
+ function parseWithStatement(node) {
+ var object, body;
+
+ if (strict) {
+ tolerateError(Messages.StrictModeWith);
+ }
+
+ expectKeyword('with');
+
+ expect('(');
+
+ object = parseExpression();
+
+ expect(')');
+
+ body = parseStatement();
+
+ return node.finishWithStatement(object, body);
+ }
+
+ // 12.10 The swith statement
+
+ function parseSwitchCase() {
+ var test, consequent = [], statement, node = new Node();
+
+ if (matchKeyword('default')) {
+ lex();
+ test = null;
+ } else {
+ expectKeyword('case');
+ test = parseExpression();
+ }
+ expect(':');
+
+ while (startIndex < length) {
+ if (match('}') || matchKeyword('default') || matchKeyword('case')) {
+ break;
+ }
+ statement = parseStatementListItem();
+ consequent.push(statement);
+ }
+
+ return node.finishSwitchCase(test, consequent);
+ }
+
+ function parseSwitchStatement(node) {
+ var discriminant, cases, clause, oldInSwitch, defaultFound;
+
+ expectKeyword('switch');
+
+ expect('(');
+
+ discriminant = parseExpression();
+
+ expect(')');
+
+ expect('{');
+
+ cases = [];
+
+ if (match('}')) {
+ lex();
+ return node.finishSwitchStatement(discriminant, cases);
+ }
+
+ oldInSwitch = state.inSwitch;
+ state.inSwitch = true;
+ defaultFound = false;
+
+ while (startIndex < length) {
+ if (match('}')) {
+ break;
+ }
+ clause = parseSwitchCase();
+ if (clause.test === null) {
+ if (defaultFound) {
+ throwError(Messages.MultipleDefaultsInSwitch);
+ }
+ defaultFound = true;
+ }
+ cases.push(clause);
+ }
+
+ state.inSwitch = oldInSwitch;
+
+ expect('}');
+
+ return node.finishSwitchStatement(discriminant, cases);
+ }
+
+ // 12.13 The throw statement
+
+ function parseThrowStatement(node) {
+ var argument;
+
+ expectKeyword('throw');
+
+ if (hasLineTerminator) {
+ throwError(Messages.NewlineAfterThrow);
+ }
+
+ argument = parseExpression();
+
+ consumeSemicolon();
+
+ return node.finishThrowStatement(argument);
+ }
+
+ // 12.14 The try statement
+
+ function parseCatchClause() {
+ var param, body, node = new Node();
+
+ expectKeyword('catch');
+
+ expect('(');
+ if (match(')')) {
+ throwUnexpectedToken(lookahead);
+ }
+
+ param = parsePattern();
+
+ // 12.14.1
+ if (strict && isRestrictedWord(param.name)) {
+ tolerateError(Messages.StrictCatchVariable);
+ }
+
+ expect(')');
+ body = parseBlock();
+ return node.finishCatchClause(param, body);
+ }
+
+ function parseTryStatement(node) {
+ var block, handler = null, finalizer = null;
+
+ expectKeyword('try');
+
+ block = parseBlock();
+
+ if (matchKeyword('catch')) {
+ handler = parseCatchClause();
+ }
+
+ if (matchKeyword('finally')) {
+ lex();
+ finalizer = parseBlock();
+ }
+
+ if (!handler && !finalizer) {
+ throwError(Messages.NoCatchOrFinally);
+ }
+
+ return node.finishTryStatement(block, handler, finalizer);
+ }
+
+ // 12.15 The debugger statement
+
+ function parseDebuggerStatement(node) {
+ expectKeyword('debugger');
+
+ consumeSemicolon();
+
+ return node.finishDebuggerStatement();
+ }
+
+ // 12 Statements
+
+ function parseStatement() {
+ var type = lookahead.type,
+ expr,
+ labeledBody,
+ key,
+ node;
+
+ if (type === Token.EOF) {
+ throwUnexpectedToken(lookahead);
+ }
+
+ if (type === Token.Punctuator && lookahead.value === '{') {
+ return parseBlock();
+ }
+ isAssignmentTarget = isBindingElement = true;
+ node = new Node();
+
+ if (type === Token.Punctuator) {
+ switch (lookahead.value) {
+ case ';':
+ return parseEmptyStatement(node);
+ case '(':
+ return parseExpressionStatement(node);
+ default:
+ break;
+ }
+ } else if (type === Token.Keyword) {
+ switch (lookahead.value) {
+ case 'break':
+ return parseBreakStatement(node);
+ case 'continue':
+ return parseContinueStatement(node);
+ case 'debugger':
+ return parseDebuggerStatement(node);
+ case 'do':
+ return parseDoWhileStatement(node);
+ case 'for':
+ return parseForStatement(node);
+ case 'function':
+ return parseFunctionDeclaration(node);
+ case 'if':
+ return parseIfStatement(node);
+ case 'return':
+ return parseReturnStatement(node);
+ case 'switch':
+ return parseSwitchStatement(node);
+ case 'throw':
+ return parseThrowStatement(node);
+ case 'try':
+ return parseTryStatement(node);
+ case 'var':
+ return parseVariableStatement(node);
+ case 'while':
+ return parseWhileStatement(node);
+ case 'with':
+ return parseWithStatement(node);
+ default:
+ break;
+ }
+ }
+
+ expr = parseExpression();
+
+ // 12.12 Labelled Statements
+ if ((expr.type === Syntax.Identifier) && match(':')) {
+ lex();
+
+ key = '$' + expr.name;
+ if (Object.prototype.hasOwnProperty.call(state.labelSet, key)) {
+ throwError(Messages.Redeclaration, 'Label', expr.name);
+ }
+
+ state.labelSet[key] = true;
+ labeledBody = parseStatement();
+ delete state.labelSet[key];
+ return node.finishLabeledStatement(expr, labeledBody);
+ }
+
+ consumeSemicolon();
+
+ return node.finishExpressionStatement(expr);
+ }
+
+ // 13 Function Definition
+
+ function parseFunctionSourceElements() {
+ var statement, body = [], token, directive, firstRestricted,
+ oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody, oldParenthesisCount,
+ node = new Node();
+
+ expect('{');
+
+ while (startIndex < length) {
+ if (lookahead.type !== Token.StringLiteral) {
+ break;
+ }
+ token = lookahead;
+
+ statement = parseStatementListItem();
+ body.push(statement);
+ if (statement.expression.type !== Syntax.Literal) {
+ // this is not directive
+ break;
+ }
+ directive = source.slice(token.start + 1, token.end - 1);
+ if (directive === 'use strict') {
+ strict = true;
+ if (firstRestricted) {
+ tolerateUnexpectedToken(firstRestricted, Messages.StrictOctalLiteral);
+ }
+ } else {
+ if (!firstRestricted && token.octal) {
+ firstRestricted = token;
+ }
+ }
+ }
+
+ oldLabelSet = state.labelSet;
+ oldInIteration = state.inIteration;
+ oldInSwitch = state.inSwitch;
+ oldInFunctionBody = state.inFunctionBody;
+ oldParenthesisCount = state.parenthesizedCount;
+
+ state.labelSet = {};
+ state.inIteration = false;
+ state.inSwitch = false;
+ state.inFunctionBody = true;
+ state.parenthesizedCount = 0;
+
+ while (startIndex < length) {
+ if (match('}')) {
+ break;
+ }
+ body.push(parseStatementListItem());
+ }
+
+ expect('}');
+
+ state.labelSet = oldLabelSet;
+ state.inIteration = oldInIteration;
+ state.inSwitch = oldInSwitch;
+ state.inFunctionBody = oldInFunctionBody;
+ state.parenthesizedCount = oldParenthesisCount;
+
+ return node.finishBlockStatement(body);
+ }
+
+ function validateParam(options, param, name) {
+ var key = '$' + name;
+ if (strict) {
+ if (isRestrictedWord(name)) {
+ options.stricted = param;
+ options.message = Messages.StrictParamName;
+ }
+ if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) {
+ options.stricted = param;
+ options.message = Messages.StrictParamDupe;
+ }
+ } else if (!options.firstRestricted) {
+ if (isRestrictedWord(name)) {
+ options.firstRestricted = param;
+ options.message = Messages.StrictParamName;
+ } else if (isStrictModeReservedWord(name)) {
+ options.firstRestricted = param;
+ options.message = Messages.StrictReservedWord;
+ } else if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) {
+ options.firstRestricted = param;
+ options.message = Messages.StrictParamDupe;
+ }
+ }
+ options.paramSet[key] = true;
+ }
+
+ function parseParam(options) {
+ var token, param, def;
+
+ token = lookahead;
+ if (token.value === '...') {
+ param = parseRestElement();
+ validateParam(options, param.argument, param.argument.name);
+ options.params.push(param);
+ options.defaults.push(null);
+ return false;
+ }
+
+ param = parsePatternWithDefault();
+ validateParam(options, token, token.value);
+
+ if (param.type === Syntax.AssignmentPattern) {
+ def = param.right;
+ param = param.left;
+ ++options.defaultCount;
+ }
+
+ options.params.push(param);
+ options.defaults.push(def);
+
+ return !match(')');
+ }
+
+ function parseParams(firstRestricted) {
+ var options;
+
+ options = {
+ params: [],
+ defaultCount: 0,
+ defaults: [],
+ firstRestricted: firstRestricted
+ };
+
+ expect('(');
+
+ if (!match(')')) {
+ options.paramSet = {};
+ while (startIndex < length) {
+ if (!parseParam(options)) {
+ break;
+ }
+ expect(',');
+ }
+ }
+
+ expect(')');
+
+ if (options.defaultCount === 0) {
+ options.defaults = [];
+ }
+
+ return {
+ params: options.params,
+ defaults: options.defaults,
+ stricted: options.stricted,
+ firstRestricted: options.firstRestricted,
+ message: options.message
+ };
+ }
+
+ function parseFunctionDeclaration(node, identifierIsOptional) {
+ var id = null, params = [], defaults = [], body, token, stricted, tmp, firstRestricted, message, previousStrict;
+
+ expectKeyword('function');
+ if (!identifierIsOptional || !match('(')) {
+ token = lookahead;
+ id = parseVariableIdentifier();
+ if (strict) {
+ if (isRestrictedWord(token.value)) {
+ tolerateUnexpectedToken(token, Messages.StrictFunctionName);
+ }
+ } else {
+ if (isRestrictedWord(token.value)) {
+ firstRestricted = token;
+ message = Messages.StrictFunctionName;
+ } else if (isStrictModeReservedWord(token.value)) {
+ firstRestricted = token;
+ message = Messages.StrictReservedWord;
+ }
+ }
+ }
+
+ tmp = parseParams(firstRestricted);
+ params = tmp.params;
+ defaults = tmp.defaults;
+ stricted = tmp.stricted;
+ firstRestricted = tmp.firstRestricted;
+ if (tmp.message) {
+ message = tmp.message;
+ }
+
+ previousStrict = strict;
+ body = parseFunctionSourceElements();
+ if (strict && firstRestricted) {
+ throwUnexpectedToken(firstRestricted, message);
+ }
+ if (strict && stricted) {
+ tolerateUnexpectedToken(stricted, message);
+ }
+ strict = previousStrict;
+
+ return node.finishFunctionDeclaration(id, params, defaults, body);
+ }
+
+ function parseFunctionExpression() {
+ var token, id = null, stricted, firstRestricted, message, tmp,
+ params = [], defaults = [], body, previousStrict, node = new Node();
+
+ expectKeyword('function');
+
+ if (!match('(')) {
+ token = lookahead;
+ id = parseVariableIdentifier();
+ if (strict) {
+ if (isRestrictedWord(token.value)) {
+ tolerateUnexpectedToken(token, Messages.StrictFunctionName);
+ }
+ } else {
+ if (isRestrictedWord(token.value)) {
+ firstRestricted = token;
+ message = Messages.StrictFunctionName;
+ } else if (isStrictModeReservedWord(token.value)) {
+ firstRestricted = token;
+ message = Messages.StrictReservedWord;
+ }
+ }
+ }
+
+ tmp = parseParams(firstRestricted);
+ params = tmp.params;
+ defaults = tmp.defaults;
+ stricted = tmp.stricted;
+ firstRestricted = tmp.firstRestricted;
+ if (tmp.message) {
+ message = tmp.message;
+ }
+
+ previousStrict = strict;
+ body = parseFunctionSourceElements();
+ if (strict && firstRestricted) {
+ throwUnexpectedToken(firstRestricted, message);
+ }
+ if (strict && stricted) {
+ tolerateUnexpectedToken(stricted, message);
+ }
+ strict = previousStrict;
+
+ return node.finishFunctionExpression(id, params, defaults, body);
+ }
+
+
+ function parseClassBody() {
+ var classBody, token, isStatic, hasConstructor = false, body, method, computed, key;
+
+ classBody = new Node();
+
+ expect('{');
+ body = [];
+ while (!match('}')) {
+ if (match(';')) {
+ lex();
+ } else {
+ method = new Node();
+ token = lookahead;
+ isStatic = false;
+ computed = match('[');
+ key = parseObjectPropertyKey();
+ if (key.name === 'static' && lookaheadPropertyName()) {
+ token = lookahead;
+ isStatic = true;
+ computed = match('[');
+ key = parseObjectPropertyKey();
+ }
+ method = tryParseMethodDefinition(token, key, computed, method);
+ if (method) {
+ method['static'] = isStatic;
+ if (method.kind === 'init') {
+ method.kind = 'method';
+ }
+ if (!isStatic) {
+ if (!method.computed && (method.key.name || method.key.value.toString()) === 'constructor') {
+ if (method.kind !== 'method' || !method.method || method.value.generator) {
+ throwUnexpectedToken(token, Messages.ConstructorSpecialMethod);
+ }
+ if (hasConstructor) {
+ throwUnexpectedToken(token, Messages.DuplicateConstructor);
+ } else {
+ hasConstructor = true;
+ }
+ method.kind = 'constructor';
+ }
+ } else {
+ if (!method.computed && (method.key.name || method.key.value.toString()) === 'prototype') {
+ throwUnexpectedToken(token, Messages.StaticPrototype);
+ }
+ }
+ method.type = Syntax.MethodDefinition;
+ delete method.method;
+ delete method.shorthand;
+ body.push(method);
+ } else {
+ throwUnexpectedToken(lookahead);
+ }
+ }
+ }
+ lex();
+ return classBody.finishClassBody(body);
+ }
+
+ function parseClassDeclaration(identifierIsOptional) {
+ var id = null, superClass = null, classNode = new Node(), classBody, previousStrict = strict;
+ strict = true;
+
+ expectKeyword('class');
+
+ if (!identifierIsOptional || lookahead.type === Token.Identifier) {
+ id = parseVariableIdentifier();
+ }
+
+ if (matchKeyword('extends')) {
+ lex();
+ superClass = isolateCoverGrammar(parseLeftHandSideExpressionAllowCall);
+ }
+ classBody = parseClassBody();
+ strict = previousStrict;
+
+ return classNode.finishClassDeclaration(id, superClass, classBody);
+ }
+
+ function parseClassExpression() {
+ var id = null, superClass = null, classNode = new Node(), classBody, previousStrict = strict;
+ strict = true;
+
+ expectKeyword('class');
+
+ if (lookahead.type === Token.Identifier) {
+ id = parseVariableIdentifier();
+ }
+
+ if (matchKeyword('extends')) {
+ lex();
+ superClass = isolateCoverGrammar(parseLeftHandSideExpressionAllowCall);
+ }
+ classBody = parseClassBody();
+ strict = previousStrict;
+
+ return classNode.finishClassExpression(id, superClass, classBody);
+ }
+
+ // Modules grammar from:
+ // people.mozilla.org/~jorendorff/es6-draft.html
+
+ function parseModuleSpecifier() {
+ var node = new Node();
+
+ if (lookahead.type !== Token.StringLiteral) {
+ throwError(Messages.InvalidModuleSpecifier);
+ }
+ return node.finishLiteral(lex());
+ }
+
+ function parseExportSpecifier() {
+ var exported, local, node = new Node(), def;
+ if (matchKeyword('default')) {
+ // export {default} from 'something';
+ def = new Node();
+ lex();
+ local = def.finishIdentifier('default');
+ } else {
+ local = parseVariableIdentifier();
+ }
+ if (matchContextualKeyword('as')) {
+ lex();
+ exported = parseNonComputedProperty();
+ }
+ return node.finishExportSpecifier(local, exported);
+ }
+
+ function parseExportNamedDeclaration(node) {
+ var declaration = null,
+ isExportFromIdentifier,
+ src = null, specifiers = [];
+
+ // non-default export
+ if (lookahead.type === Token.Keyword) {
+ // covers:
+ // export var f = 1;
+ switch (lookahead.value) {
+ case 'let':
+ case 'const':
+ case 'var':
+ case 'class':
+ case 'function':
+ declaration = parseStatementListItem();
+ return node.finishExportNamedDeclaration(declaration, specifiers, null);
+ }
+ }
+
+ expect('{');
+ if (!match('}')) {
+ do {
+ isExportFromIdentifier = isExportFromIdentifier || matchKeyword('default');
+ specifiers.push(parseExportSpecifier());
+ } while (match(',') && lex());
+ }
+ expect('}');
+
+ if (matchContextualKeyword('from')) {
+ // covering:
+ // export {default} from 'foo';
+ // export {foo} from 'foo';
+ lex();
+ src = parseModuleSpecifier();
+ consumeSemicolon();
+ } else if (isExportFromIdentifier) {
+ // covering:
+ // export {default}; // missing fromClause
+ throwError(lookahead.value ?
+ Messages.UnexpectedToken : Messages.MissingFromClause, lookahead.value);
+ } else {
+ // cover
+ // export {foo};
+ consumeSemicolon();
+ }
+ return node.finishExportNamedDeclaration(declaration, specifiers, src);
+ }
+
+ function parseExportDefaultDeclaration(node) {
+ var declaration = null,
+ expression = null;
+
+ // covers:
+ // export default ...
+ expectKeyword('default');
+
+ if (matchKeyword('function')) {
+ // covers:
+ // export default function foo () {}
+ // export default function () {}
+ declaration = parseFunctionDeclaration(new Node(), true);
+ return node.finishExportDefaultDeclaration(declaration);
+ }
+ if (matchKeyword('class')) {
+ declaration = parseClassDeclaration(true);
+ return node.finishExportDefaultDeclaration(declaration);
+ }
+
+ if (matchContextualKeyword('from')) {
+ throwError(Messages.UnexpectedToken, lookahead.value);
+ }
+
+ // covers:
+ // export default {};
+ // export default [];
+ // export default (1 + 2);
+ if (match('{')) {
+ expression = parseObjectInitialiser();
+ } else if (match('[')) {
+ expression = parseArrayInitialiser();
+ } else {
+ expression = parseAssignmentExpression();
+ }
+ consumeSemicolon();
+ return node.finishExportDefaultDeclaration(expression);
+ }
+
+ function parseExportAllDeclaration(node) {
+ var src;
+
+ // covers:
+ // export * from 'foo';
+ expect('*');
+ if (!matchContextualKeyword('from')) {
+ throwError(lookahead.value ?
+ Messages.UnexpectedToken : Messages.MissingFromClause, lookahead.value);
+ }
+ lex();
+ src = parseModuleSpecifier();
+ consumeSemicolon();
+
+ return node.finishExportAllDeclaration(src);
+ }
+
+ function parseExportDeclaration() {
+ var node = new Node();
+ if (state.inFunctionBody) {
+ throwError(Messages.IllegalExportDeclaration);
+ }
+
+ expectKeyword('export');
+
+ if (matchKeyword('default')) {
+ return parseExportDefaultDeclaration(node);
+ }
+ if (match('*')) {
+ return parseExportAllDeclaration(node);
+ }
+ return parseExportNamedDeclaration(node);
+ }
+
+ function parseImportSpecifier() {
+ // import {<foo as bar>} ...;
+ var local, imported, node = new Node();
+
+ imported = parseNonComputedProperty();
+ if (matchContextualKeyword('as')) {
+ lex();
+ local = parseVariableIdentifier();
+ }
+
+ return node.finishImportSpecifier(local, imported);
+ }
+
+ function parseNamedImports() {
+ var specifiers = [];
+ // {foo, bar as bas}
+ expect('{');
+ if (!match('}')) {
+ do {
+ specifiers.push(parseImportSpecifier());
+ } while (match(',') && lex());
+ }
+ expect('}');
+ return specifiers;
+ }
+
+ function parseImportDefaultSpecifier() {
+ // import <foo> ...;
+ var local, node = new Node();
+
+ local = parseNonComputedProperty();
+
+ return node.finishImportDefaultSpecifier(local);
+ }
+
+ function parseImportNamespaceSpecifier() {
+ // import <* as foo> ...;
+ var local, node = new Node();
+
+ expect('*');
+ if (!matchContextualKeyword('as')) {
+ throwError(Messages.NoAsAfterImportNamespace);
+ }
+ lex();
+ local = parseNonComputedProperty();
+
+ return node.finishImportNamespaceSpecifier(local);
+ }
+
+ function parseImportDeclaration() {
+ var specifiers, src, node = new Node();
+
+ if (state.inFunctionBody) {
+ throwError(Messages.IllegalImportDeclaration);
+ }
+
+ expectKeyword('import');
+ specifiers = [];
+
+ if (lookahead.type === Token.StringLiteral) {
+ // covers:
+ // import 'foo';
+ src = parseModuleSpecifier();
+ consumeSemicolon();
+ return node.finishImportDeclaration(specifiers, src);
+ }
+
+ if (!matchKeyword('default') && isIdentifierName(lookahead)) {
+ // covers:
+ // import foo
+ // import foo, ...
+ specifiers.push(parseImportDefaultSpecifier());
+ if (match(',')) {
+ lex();
+ }
+ }
+ if (match('*')) {
+ // covers:
+ // import foo, * as foo
+ // import * as foo
+ specifiers.push(parseImportNamespaceSpecifier());
+ } else if (match('{')) {
+ // covers:
+ // import foo, {bar}
+ // import {bar}
+ specifiers = specifiers.concat(parseNamedImports());
+ }
+
+ if (!matchContextualKeyword('from')) {
+ throwError(lookahead.value ?
+ Messages.UnexpectedToken : Messages.MissingFromClause, lookahead.value);
+ }
+ lex();
+ src = parseModuleSpecifier();
+ consumeSemicolon();
+
+ return node.finishImportDeclaration(specifiers, src);
+ }
+
+ // 14 Program
+
+ function parseScriptBody() {
+ var statement, body = [], token, directive, firstRestricted;
+
+ while (startIndex < length) {
+ token = lookahead;
+ if (token.type !== Token.StringLiteral) {
+ break;
+ }
+
+ statement = parseStatementListItem();
+ body.push(statement);
+ if (statement.expression.type !== Syntax.Literal) {
+ // this is not directive
+ break;
+ }
+ directive = source.slice(token.start + 1, token.end - 1);
+ if (directive === 'use strict') {
+ strict = true;
+ if (firstRestricted) {
+ tolerateUnexpectedToken(firstRestricted, Messages.StrictOctalLiteral);
+ }
+ } else {
+ if (!firstRestricted && token.octal) {
+ firstRestricted = token;
+ }
+ }
+ }
+
+ while (startIndex < length) {
+ statement = parseStatementListItem();
+ /* istanbul ignore if */
+ if (typeof statement === 'undefined') {
+ break;
+ }
+ body.push(statement);
+ }
+ return body;
+ }
+
+ function parseProgram() {
+ var body, node;
+
+ peek();
+ node = new Node();
+
+ body = parseScriptBody();
+ return node.finishProgram(body);
+ }
+
+ function filterTokenLocation() {
+ var i, entry, token, tokens = [];
+
+ for (i = 0; i < extra.tokens.length; ++i) {
+ entry = extra.tokens[i];
+ token = {
+ type: entry.type,
+ value: entry.value
+ };
+ if (entry.regex) {
+ token.regex = {
+ pattern: entry.regex.pattern,
+ flags: entry.regex.flags
+ };
+ }
+ if (extra.range) {
+ token.range = entry.range;
+ }
+ if (extra.loc) {
+ token.loc = entry.loc;
+ }
+ tokens.push(token);
+ }
+
+ extra.tokens = tokens;
+ }
+
+ function tokenize(code, options) {
+ var toString,
+ tokens;
+
+ toString = String;
+ if (typeof code !== 'string' && !(code instanceof String)) {
+ code = toString(code);
+ }
+
+ source = code;
+ index = 0;
+ lineNumber = (source.length > 0) ? 1 : 0;
+ lineStart = 0;
+ startIndex = index;
+ startLineNumber = lineNumber;
+ startLineStart = lineStart;
+ length = source.length;
+ lookahead = null;
+ state = {
+ allowIn: true,
+ labelSet: {},
+ inFunctionBody: false,
+ inIteration: false,
+ inSwitch: false,
+ lastCommentStart: -1,
+ curlyStack: []
+ };
+
+ extra = {};
+
+ // Options matching.
+ options = options || {};
+
+ // Of course we collect tokens here.
+ options.tokens = true;
+ extra.tokens = [];
+ extra.tokenize = true;
+ // The following two fields are necessary to compute the Regex tokens.
+ extra.openParenToken = -1;
+ extra.openCurlyToken = -1;
+
+ extra.range = (typeof options.range === 'boolean') && options.range;
+ extra.loc = (typeof options.loc === 'boolean') && options.loc;
+
+ if (typeof options.comment === 'boolean' && options.comment) {
+ extra.comments = [];
+ }
+ if (typeof options.tolerant === 'boolean' && options.tolerant) {
+ extra.errors = [];
+ }
+
+ try {
+ peek();
+ if (lookahead.type === Token.EOF) {
+ return extra.tokens;
+ }
+
+ lex();
+ while (lookahead.type !== Token.EOF) {
+ try {
+ lex();
+ } catch (lexError) {
+ if (extra.errors) {
+ recordError(lexError);
+ // We have to break on the first error
+ // to avoid infinite loops.
+ break;
+ } else {
+ throw lexError;
+ }
+ }
+ }
+
+ filterTokenLocation();
+ tokens = extra.tokens;
+ if (typeof extra.comments !== 'undefined') {
+ tokens.comments = extra.comments;
+ }
+ if (typeof extra.errors !== 'undefined') {
+ tokens.errors = extra.errors;
+ }
+ } catch (e) {
+ throw e;
+ } finally {
+ extra = {};
+ }
+ return tokens;
+ }
+
+ function parse(code, options) {
+ var program, toString;
+
+ toString = String;
+ if (typeof code !== 'string' && !(code instanceof String)) {
+ code = toString(code);
+ }
+
+ source = code;
+ index = 0;
+ lineNumber = (source.length > 0) ? 1 : 0;
+ lineStart = 0;
+ startIndex = index;
+ startLineNumber = lineNumber;
+ startLineStart = lineStart;
+ length = source.length;
+ lookahead = null;
+ state = {
+ allowIn: true,
+ labelSet: {},
+ inFunctionBody: false,
+ inIteration: false,
+ inSwitch: false,
+ lastCommentStart: -1,
+ curlyStack: []
+ };
+ sourceType = 'script';
+ strict = false;
+
+ extra = {};
+ if (typeof options !== 'undefined') {
+ extra.range = (typeof options.range === 'boolean') && options.range;
+ extra.loc = (typeof options.loc === 'boolean') && options.loc;
+ extra.attachComment = (typeof options.attachComment === 'boolean') && options.attachComment;
+
+ if (extra.loc && options.source !== null && options.source !== undefined) {
+ extra.source = toString(options.source);
+ }
+
+ if (typeof options.tokens === 'boolean' && options.tokens) {
+ extra.tokens = [];
+ }
+ if (typeof options.comment === 'boolean' && options.comment) {
+ extra.comments = [];
+ }
+ if (typeof options.tolerant === 'boolean' && options.tolerant) {
+ extra.errors = [];
+ }
+ if (extra.attachComment) {
+ extra.range = true;
+ extra.comments = [];
+ extra.bottomRightStack = [];
+ extra.trailingComments = [];
+ extra.leadingComments = [];
+ }
+ if (options.sourceType === 'module') {
+ // very restrictive condition for now
+ sourceType = options.sourceType;
+ strict = true;
+ }
+ }
+
+ try {
+ program = parseProgram();
+ if (typeof extra.comments !== 'undefined') {
+ program.comments = extra.comments;
+ }
+ if (typeof extra.tokens !== 'undefined') {
+ filterTokenLocation();
+ program.tokens = extra.tokens;
+ }
+ if (typeof extra.errors !== 'undefined') {
+ program.errors = extra.errors;
+ }
+ } catch (e) {
+ throw e;
+ } finally {
+ extra = {};
+ }
+
+ return program;
+ }
+
+ // Sync with *.json manifests.
+ exports.version = '2.2.0';
+
+ exports.tokenize = tokenize;
+
+ exports.parse = parse;
+
+ // Deep copy.
+ /* istanbul ignore next */
+ exports.Syntax = (function () {
+ var name, types = {};
+
+ if (typeof Object.create === 'function') {
+ types = Object.create(null);
+ }
+
+ for (name in Syntax) {
+ if (Syntax.hasOwnProperty(name)) {
+ types[name] = Syntax[name];
+ }
+ }
+
+ if (typeof Object.freeze === 'function') {
+ Object.freeze(types);
+ }
+
+ return types;
+ }());
+
+}));
+/* vim: set sw=4 ts=4 et tw=80 : */
+
+},{}],52:[function(require,module,exports){
+var baseIndexOf = require('../internal/baseIndexOf'),
+ binaryIndex = require('../internal/binaryIndex');
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * Gets the index at which the first occurrence of `value` is found in `array`
+ * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
+ * for equality comparisons. If `fromIndex` is negative, it is used as the offset
+ * from the end of `array`. If `array` is sorted providing `true` for `fromIndex`
+ * performs a faster binary search.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to search.
+ * @param {*} value The value to search for.
+ * @param {boolean|number} [fromIndex=0] The index to search from or `true`
+ * to perform a binary search on a sorted array.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ * @example
+ *
+ * _.indexOf([1, 2, 1, 2], 2);
+ * // => 1
+ *
+ * // using `fromIndex`
+ * _.indexOf([1, 2, 1, 2], 2, 2);
+ * // => 3
+ *
+ * // performing a binary search
+ * _.indexOf([1, 1, 2, 2], 2, true);
+ * // => 2
+ */
+function indexOf(array, value, fromIndex) {
+ var length = array ? array.length : 0;
+ if (!length) {
+ return -1;
+ }
+ if (typeof fromIndex == 'number') {
+ fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex;
+ } else if (fromIndex) {
+ var index = binaryIndex(array, value);
+ if (index < length &&
+ (value === value ? (value === array[index]) : (array[index] !== array[index]))) {
+ return index;
+ }
+ return -1;
+ }
+ return baseIndexOf(array, value, fromIndex || 0);
+}
+
+module.exports = indexOf;
+
+},{"../internal/baseIndexOf":81,"../internal/binaryIndex":95}],53:[function(require,module,exports){
+/**
+ * Gets the last element of `array`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to query.
+ * @returns {*} Returns the last element of `array`.
+ * @example
+ *
+ * _.last([1, 2, 3]);
+ * // => 3
+ */
+function last(array) {
+ var length = array ? array.length : 0;
+ return length ? array[length - 1] : undefined;
+}
+
+module.exports = last;
+
+},{}],54:[function(require,module,exports){
+var LazyWrapper = require('../internal/LazyWrapper'),
+ LodashWrapper = require('../internal/LodashWrapper'),
+ baseLodash = require('../internal/baseLodash'),
+ isArray = require('../lang/isArray'),
+ isObjectLike = require('../internal/isObjectLike'),
+ wrapperClone = require('../internal/wrapperClone');
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Creates a `lodash` object which wraps `value` to enable implicit chaining.
+ * Methods that operate on and return arrays, collections, and functions can
+ * be chained together. Methods that retrieve a single value or may return a
+ * primitive value will automatically end the chain returning the unwrapped
+ * value. Explicit chaining may be enabled using `_.chain`. The execution of
+ * chained methods is lazy, that is, execution is deferred until `_#value`
+ * is implicitly or explicitly called.
+ *
+ * Lazy evaluation allows several methods to support shortcut fusion. Shortcut
+ * fusion is an optimization strategy which merge iteratee calls; this can help
+ * to avoid the creation of intermediate data structures and greatly reduce the
+ * number of iteratee executions.
+ *
+ * Chaining is supported in custom builds as long as the `_#value` method is
+ * directly or indirectly included in the build.
+ *
+ * In addition to lodash methods, wrappers have `Array` and `String` methods.
+ *
+ * The wrapper `Array` methods are:
+ * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`,
+ * `splice`, and `unshift`
+ *
+ * The wrapper `String` methods are:
+ * `replace` and `split`
+ *
+ * The wrapper methods that support shortcut fusion are:
+ * `compact`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `filter`,
+ * `first`, `initial`, `last`, `map`, `pluck`, `reject`, `rest`, `reverse`,
+ * `slice`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `toArray`,
+ * and `where`
+ *
+ * The chainable wrapper methods are:
+ * `after`, `ary`, `assign`, `at`, `before`, `bind`, `bindAll`, `bindKey`,
+ * `callback`, `chain`, `chunk`, `commit`, `compact`, `concat`, `constant`,
+ * `countBy`, `create`, `curry`, `debounce`, `defaults`, `defaultsDeep`,
+ * `defer`, `delay`, `difference`, `drop`, `dropRight`, `dropRightWhile`,
+ * `dropWhile`, `fill`, `filter`, `flatten`, `flattenDeep`, `flow`, `flowRight`,
+ * `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`,
+ * `functions`, `groupBy`, `indexBy`, `initial`, `intersection`, `invert`,
+ * `invoke`, `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`,
+ * `matchesProperty`, `memoize`, `merge`, `method`, `methodOf`, `mixin`,
+ * `modArgs`, `negate`, `omit`, `once`, `pairs`, `partial`, `partialRight`,
+ * `partition`, `pick`, `plant`, `pluck`, `property`, `propertyOf`, `pull`,
+ * `pullAt`, `push`, `range`, `rearg`, `reject`, `remove`, `rest`, `restParam`,
+ * `reverse`, `set`, `shuffle`, `slice`, `sort`, `sortBy`, `sortByAll`,
+ * `sortByOrder`, `splice`, `spread`, `take`, `takeRight`, `takeRightWhile`,
+ * `takeWhile`, `tap`, `throttle`, `thru`, `times`, `toArray`, `toPlainObject`,
+ * `transform`, `union`, `uniq`, `unshift`, `unzip`, `unzipWith`, `values`,
+ * `valuesIn`, `where`, `without`, `wrap`, `xor`, `zip`, `zipObject`, `zipWith`
+ *
+ * The wrapper methods that are **not** chainable by default are:
+ * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clone`, `cloneDeep`,
+ * `deburr`, `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`,
+ * `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`,
+ * `floor`, `get`, `gt`, `gte`, `has`, `identity`, `includes`, `indexOf`,
+ * `inRange`, `isArguments`, `isArray`, `isBoolean`, `isDate`, `isElement`,
+ * `isEmpty`, `isEqual`, `isError`, `isFinite` `isFunction`, `isMatch`,
+ * `isNative`, `isNaN`, `isNull`, `isNumber`, `isObject`, `isPlainObject`,
+ * `isRegExp`, `isString`, `isUndefined`, `isTypedArray`, `join`, `kebabCase`,
+ * `last`, `lastIndexOf`, `lt`, `lte`, `max`, `min`, `noConflict`, `noop`,
+ * `now`, `pad`, `padLeft`, `padRight`, `parseInt`, `pop`, `random`, `reduce`,
+ * `reduceRight`, `repeat`, `result`, `round`, `runInContext`, `shift`, `size`,
+ * `snakeCase`, `some`, `sortedIndex`, `sortedLastIndex`, `startCase`,
+ * `startsWith`, `sum`, `template`, `trim`, `trimLeft`, `trimRight`, `trunc`,
+ * `unescape`, `uniqueId`, `value`, and `words`
+ *
+ * The wrapper method `sample` will return a wrapped value when `n` is provided,
+ * otherwise an unwrapped value is returned.
+ *
+ * @name _
+ * @constructor
+ * @category Chain
+ * @param {*} value The value to wrap in a `lodash` instance.
+ * @returns {Object} Returns the new `lodash` wrapper instance.
+ * @example
+ *
+ * var wrapped = _([1, 2, 3]);
+ *
+ * // returns an unwrapped value
+ * wrapped.reduce(function(total, n) {
+ * return total + n;
+ * });
+ * // => 6
+ *
+ * // returns a wrapped value
+ * var squares = wrapped.map(function(n) {
+ * return n * n;
+ * });
+ *
+ * _.isArray(squares);
+ * // => false
+ *
+ * _.isArray(squares.value());
+ * // => true
+ */
+function lodash(value) {
+ if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
+ if (value instanceof LodashWrapper) {
+ return value;
+ }
+ if (hasOwnProperty.call(value, '__chain__') && hasOwnProperty.call(value, '__wrapped__')) {
+ return wrapperClone(value);
+ }
+ }
+ return new LodashWrapper(value);
+}
+
+// Ensure wrappers are instances of `baseLodash`.
+lodash.prototype = baseLodash.prototype;
+
+module.exports = lodash;
+
+},{"../internal/LazyWrapper":63,"../internal/LodashWrapper":64,"../internal/baseLodash":85,"../internal/isObjectLike":129,"../internal/wrapperClone":140,"../lang/isArray":143}],55:[function(require,module,exports){
+module.exports = require('./forEach');
+
+},{"./forEach":57}],56:[function(require,module,exports){
+var baseEach = require('../internal/baseEach'),
+ createFind = require('../internal/createFind');
+
+/**
+ * Iterates over elements of `collection`, returning the first element
+ * `predicate` returns truthy for. The predicate is bound to `thisArg` and
+ * invoked with three arguments: (value, index|key, collection).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @alias detect
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to search.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {*} Returns the matched element, else `undefined`.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36, 'active': true },
+ * { 'user': 'fred', 'age': 40, 'active': false },
+ * { 'user': 'pebbles', 'age': 1, 'active': true }
+ * ];
+ *
+ * _.result(_.find(users, function(chr) {
+ * return chr.age < 40;
+ * }), 'user');
+ * // => 'barney'
+ *
+ * // using the `_.matches` callback shorthand
+ * _.result(_.find(users, { 'age': 1, 'active': true }), 'user');
+ * // => 'pebbles'
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.result(_.find(users, 'active', false), 'user');
+ * // => 'fred'
+ *
+ * // using the `_.property` callback shorthand
+ * _.result(_.find(users, 'active'), 'user');
+ * // => 'barney'
+ */
+var find = createFind(baseEach);
+
+module.exports = find;
+
+},{"../internal/baseEach":74,"../internal/createFind":105}],57:[function(require,module,exports){
+var arrayEach = require('../internal/arrayEach'),
+ baseEach = require('../internal/baseEach'),
+ createForEach = require('../internal/createForEach');
+
+/**
+ * Iterates over elements of `collection` invoking `iteratee` for each element.
+ * The `iteratee` is bound to `thisArg` and invoked with three arguments:
+ * (value, index|key, collection). Iteratee functions may exit iteration early
+ * by explicitly returning `false`.
+ *
+ * **Note:** As with other "Collections" methods, objects with a "length" property
+ * are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn`
+ * may be used for object iteration.
+ *
+ * @static
+ * @memberOf _
+ * @alias each
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Array|Object|string} Returns `collection`.
+ * @example
+ *
+ * _([1, 2]).forEach(function(n) {
+ * console.log(n);
+ * }).value();
+ * // => logs each value from left to right and returns the array
+ *
+ * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) {
+ * console.log(n, key);
+ * });
+ * // => logs each value-key pair and returns the object (iteration order is not guaranteed)
+ */
+var forEach = createForEach(arrayEach, baseEach);
+
+module.exports = forEach;
+
+},{"../internal/arrayEach":66,"../internal/baseEach":74,"../internal/createForEach":106}],58:[function(require,module,exports){
+var baseIndexOf = require('../internal/baseIndexOf'),
+ getLength = require('../internal/getLength'),
+ isArray = require('../lang/isArray'),
+ isIterateeCall = require('../internal/isIterateeCall'),
+ isLength = require('../internal/isLength'),
+ isString = require('../lang/isString'),
+ values = require('../object/values');
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * Checks if `value` is in `collection` using
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
+ * for equality comparisons. If `fromIndex` is negative, it is used as the offset
+ * from the end of `collection`.
+ *
+ * @static
+ * @memberOf _
+ * @alias contains, include
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to search.
+ * @param {*} target The value to search for.
+ * @param {number} [fromIndex=0] The index to search from.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`.
+ * @returns {boolean} Returns `true` if a matching element is found, else `false`.
+ * @example
+ *
+ * _.includes([1, 2, 3], 1);
+ * // => true
+ *
+ * _.includes([1, 2, 3], 1, 2);
+ * // => false
+ *
+ * _.includes({ 'user': 'fred', 'age': 40 }, 'fred');
+ * // => true
+ *
+ * _.includes('pebbles', 'eb');
+ * // => true
+ */
+function includes(collection, target, fromIndex, guard) {
+ var length = collection ? getLength(collection) : 0;
+ if (!isLength(length)) {
+ collection = values(collection);
+ length = collection.length;
+ }
+ if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) {
+ fromIndex = 0;
+ } else {
+ fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0);
+ }
+ return (typeof collection == 'string' || !isArray(collection) && isString(collection))
+ ? (fromIndex <= length && collection.indexOf(target, fromIndex) > -1)
+ : (!!length && baseIndexOf(collection, target, fromIndex) > -1);
+}
+
+module.exports = includes;
+
+},{"../internal/baseIndexOf":81,"../internal/getLength":115,"../internal/isIterateeCall":125,"../internal/isLength":128,"../lang/isArray":143,"../lang/isString":149,"../object/values":155}],59:[function(require,module,exports){
+var arrayMap = require('../internal/arrayMap'),
+ baseCallback = require('../internal/baseCallback'),
+ baseMap = require('../internal/baseMap'),
+ isArray = require('../lang/isArray');
+
+/**
+ * Creates an array of values by running each element in `collection` through
+ * `iteratee`. The `iteratee` is bound to `thisArg` and invoked with three
+ * arguments: (value, index|key, collection).
+ *
+ * If a property name is provided for `iteratee` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `iteratee` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * Many lodash methods are guarded to work as iteratees for methods like
+ * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
+ *
+ * The guarded methods are:
+ * `ary`, `callback`, `chunk`, `clone`, `create`, `curry`, `curryRight`,
+ * `drop`, `dropRight`, `every`, `fill`, `flatten`, `invert`, `max`, `min`,
+ * `parseInt`, `slice`, `sortBy`, `take`, `takeRight`, `template`, `trim`,
+ * `trimLeft`, `trimRight`, `trunc`, `random`, `range`, `sample`, `some`,
+ * `sum`, `uniq`, and `words`
+ *
+ * @static
+ * @memberOf _
+ * @alias collect
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Array} Returns the new mapped array.
+ * @example
+ *
+ * function timesThree(n) {
+ * return n * 3;
+ * }
+ *
+ * _.map([1, 2], timesThree);
+ * // => [3, 6]
+ *
+ * _.map({ 'a': 1, 'b': 2 }, timesThree);
+ * // => [3, 6] (iteration order is not guaranteed)
+ *
+ * var users = [
+ * { 'user': 'barney' },
+ * { 'user': 'fred' }
+ * ];
+ *
+ * // using the `_.property` callback shorthand
+ * _.map(users, 'user');
+ * // => ['barney', 'fred']
+ */
+function map(collection, iteratee, thisArg) {
+ var func = isArray(collection) ? arrayMap : baseMap;
+ iteratee = baseCallback(iteratee, thisArg, 3);
+ return func(collection, iteratee);
+}
+
+module.exports = map;
+
+},{"../internal/arrayMap":67,"../internal/baseCallback":70,"../internal/baseMap":86,"../lang/isArray":143}],60:[function(require,module,exports){
+var getNative = require('../internal/getNative');
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeNow = getNative(Date, 'now');
+
+/**
+ * Gets the number of milliseconds that have elapsed since the Unix epoch
+ * (1 January 1970 00:00:00 UTC).
+ *
+ * @static
+ * @memberOf _
+ * @category Date
+ * @example
+ *
+ * _.defer(function(stamp) {
+ * console.log(_.now() - stamp);
+ * }, _.now());
+ * // => logs the number of milliseconds it took for the deferred function to be invoked
+ */
+var now = nativeNow || function() {
+ return new Date().getTime();
+};
+
+module.exports = now;
+
+},{"../internal/getNative":117}],61:[function(require,module,exports){
+var createWrapper = require('../internal/createWrapper'),
+ replaceHolders = require('../internal/replaceHolders'),
+ restParam = require('./restParam');
+
+/** Used to compose bitmasks for wrapper metadata. */
+var BIND_FLAG = 1,
+ PARTIAL_FLAG = 32;
+
+/**
+ * Creates a function that invokes `func` with the `this` binding of `thisArg`
+ * and prepends any additional `_.bind` arguments to those provided to the
+ * bound function.
+ *
+ * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
+ * may be used as a placeholder for partially applied arguments.
+ *
+ * **Note:** Unlike native `Function#bind` this method does not set the "length"
+ * property of bound functions.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to bind.
+ * @param {*} thisArg The `this` binding of `func`.
+ * @param {...*} [partials] The arguments to be partially applied.
+ * @returns {Function} Returns the new bound function.
+ * @example
+ *
+ * var greet = function(greeting, punctuation) {
+ * return greeting + ' ' + this.user + punctuation;
+ * };
+ *
+ * var object = { 'user': 'fred' };
+ *
+ * var bound = _.bind(greet, object, 'hi');
+ * bound('!');
+ * // => 'hi fred!'
+ *
+ * // using placeholders
+ * var bound = _.bind(greet, object, _, '!');
+ * bound('hi');
+ * // => 'hi fred!'
+ */
+var bind = restParam(function(func, thisArg, partials) {
+ var bitmask = BIND_FLAG;
+ if (partials.length) {
+ var holders = replaceHolders(partials, bind.placeholder);
+ bitmask |= PARTIAL_FLAG;
+ }
+ return createWrapper(func, bitmask, thisArg, partials, holders);
+});
+
+// Assign default placeholders.
+bind.placeholder = {};
+
+module.exports = bind;
+
+},{"../internal/createWrapper":109,"../internal/replaceHolders":135,"./restParam":62}],62:[function(require,module,exports){
+/** Used as the `TypeError` message for "Functions" methods. */
+var FUNC_ERROR_TEXT = 'Expected a function';
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * Creates a function that invokes `func` with the `this` binding of the
+ * created function and arguments from `start` and beyond provided as an array.
+ *
+ * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters).
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to apply a rest parameter to.
+ * @param {number} [start=func.length-1] The start position of the rest parameter.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var say = _.restParam(function(what, names) {
+ * return what + ' ' + _.initial(names).join(', ') +
+ * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
+ * });
+ *
+ * say('hello', 'fred', 'barney', 'pebbles');
+ * // => 'hello fred, barney, & pebbles'
+ */
+function restParam(func, start) {
+ if (typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0);
+ return function() {
+ var args = arguments,
+ index = -1,
+ length = nativeMax(args.length - start, 0),
+ rest = Array(length);
+
+ while (++index < length) {
+ rest[index] = args[start + index];
+ }
+ switch (start) {
+ case 0: return func.call(this, rest);
+ case 1: return func.call(this, args[0], rest);
+ case 2: return func.call(this, args[0], args[1], rest);
+ }
+ var otherArgs = Array(start + 1);
+ index = -1;
+ while (++index < start) {
+ otherArgs[index] = args[index];
+ }
+ otherArgs[start] = rest;
+ return func.apply(this, otherArgs);
+ };
+}
+
+module.exports = restParam;
+
+},{}],63:[function(require,module,exports){
+var baseCreate = require('./baseCreate'),
+ baseLodash = require('./baseLodash');
+
+/** Used as references for `-Infinity` and `Infinity`. */
+var POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
+
+/**
+ * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
+ *
+ * @private
+ * @param {*} value The value to wrap.
+ */
+function LazyWrapper(value) {
+ this.__wrapped__ = value;
+ this.__actions__ = [];
+ this.__dir__ = 1;
+ this.__filtered__ = false;
+ this.__iteratees__ = [];
+ this.__takeCount__ = POSITIVE_INFINITY;
+ this.__views__ = [];
+}
+
+LazyWrapper.prototype = baseCreate(baseLodash.prototype);
+LazyWrapper.prototype.constructor = LazyWrapper;
+
+module.exports = LazyWrapper;
+
+},{"./baseCreate":73,"./baseLodash":85}],64:[function(require,module,exports){
+var baseCreate = require('./baseCreate'),
+ baseLodash = require('./baseLodash');
+
+/**
+ * The base constructor for creating `lodash` wrapper objects.
+ *
+ * @private
+ * @param {*} value The value to wrap.
+ * @param {boolean} [chainAll] Enable chaining for all wrapper methods.
+ * @param {Array} [actions=[]] Actions to peform to resolve the unwrapped value.
+ */
+function LodashWrapper(value, chainAll, actions) {
+ this.__wrapped__ = value;
+ this.__actions__ = actions || [];
+ this.__chain__ = !!chainAll;
+}
+
+LodashWrapper.prototype = baseCreate(baseLodash.prototype);
+LodashWrapper.prototype.constructor = LodashWrapper;
+
+module.exports = LodashWrapper;
+
+},{"./baseCreate":73,"./baseLodash":85}],65:[function(require,module,exports){
+/**
+ * Copies the values of `source` to `array`.
+ *
+ * @private
+ * @param {Array} source The array to copy values from.
+ * @param {Array} [array=[]] The array to copy values to.
+ * @returns {Array} Returns `array`.
+ */
+function arrayCopy(source, array) {
+ var index = -1,
+ length = source.length;
+
+ array || (array = Array(length));
+ while (++index < length) {
+ array[index] = source[index];
+ }
+ return array;
+}
+
+module.exports = arrayCopy;
+
+},{}],66:[function(require,module,exports){
+/**
+ * A specialized version of `_.forEach` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns `array`.
+ */
+function arrayEach(array, iteratee) {
+ var index = -1,
+ length = array.length;
+
+ while (++index < length) {
+ if (iteratee(array[index], index, array) === false) {
+ break;
+ }
+ }
+ return array;
+}
+
+module.exports = arrayEach;
+
+},{}],67:[function(require,module,exports){
+/**
+ * A specialized version of `_.map` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns the new mapped array.
+ */
+function arrayMap(array, iteratee) {
+ var index = -1,
+ length = array.length,
+ result = Array(length);
+
+ while (++index < length) {
+ result[index] = iteratee(array[index], index, array);
+ }
+ return result;
+}
+
+module.exports = arrayMap;
+
+},{}],68:[function(require,module,exports){
+/**
+ * A specialized version of `_.some` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {boolean} Returns `true` if any element passes the predicate check,
+ * else `false`.
+ */
+function arraySome(array, predicate) {
+ var index = -1,
+ length = array.length;
+
+ while (++index < length) {
+ if (predicate(array[index], index, array)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+module.exports = arraySome;
+
+},{}],69:[function(require,module,exports){
+var baseCopy = require('./baseCopy'),
+ keys = require('../object/keys');
+
+/**
+ * The base implementation of `_.assign` without support for argument juggling,
+ * multiple sources, and `customizer` functions.
+ *
+ * @private
+ * @param {Object} object The destination object.
+ * @param {Object} source The source object.
+ * @returns {Object} Returns `object`.
+ */
+function baseAssign(object, source) {
+ return source == null
+ ? object
+ : baseCopy(source, keys(source), object);
+}
+
+module.exports = baseAssign;
+
+},{"../object/keys":152,"./baseCopy":72}],70:[function(require,module,exports){
+var baseMatches = require('./baseMatches'),
+ baseMatchesProperty = require('./baseMatchesProperty'),
+ bindCallback = require('./bindCallback'),
+ identity = require('../utility/identity'),
+ property = require('../utility/property');
+
+/**
+ * The base implementation of `_.callback` which supports specifying the
+ * number of arguments to provide to `func`.
+ *
+ * @private
+ * @param {*} [func=_.identity] The value to convert to a callback.
+ * @param {*} [thisArg] The `this` binding of `func`.
+ * @param {number} [argCount] The number of arguments to provide to `func`.
+ * @returns {Function} Returns the callback.
+ */
+function baseCallback(func, thisArg, argCount) {
+ var type = typeof func;
+ if (type == 'function') {
+ return thisArg === undefined
+ ? func
+ : bindCallback(func, thisArg, argCount);
+ }
+ if (func == null) {
+ return identity;
+ }
+ if (type == 'object') {
+ return baseMatches(func);
+ }
+ return thisArg === undefined
+ ? property(func)
+ : baseMatchesProperty(func, thisArg);
+}
+
+module.exports = baseCallback;
+
+},{"../utility/identity":157,"../utility/property":159,"./baseMatches":87,"./baseMatchesProperty":88,"./bindCallback":97}],71:[function(require,module,exports){
+var arrayCopy = require('./arrayCopy'),
+ arrayEach = require('./arrayEach'),
+ baseAssign = require('./baseAssign'),
+ baseForOwn = require('./baseForOwn'),
+ initCloneArray = require('./initCloneArray'),
+ initCloneByTag = require('./initCloneByTag'),
+ initCloneObject = require('./initCloneObject'),
+ isArray = require('../lang/isArray'),
+ isHostObject = require('./isHostObject'),
+ isObject = require('../lang/isObject');
+
+/** `Object#toString` result references. */
+var argsTag = '[object Arguments]',
+ arrayTag = '[object Array]',
+ boolTag = '[object Boolean]',
+ dateTag = '[object Date]',
+ errorTag = '[object Error]',
+ funcTag = '[object Function]',
+ mapTag = '[object Map]',
+ numberTag = '[object Number]',
+ objectTag = '[object Object]',
+ regexpTag = '[object RegExp]',
+ setTag = '[object Set]',
+ stringTag = '[object String]',
+ weakMapTag = '[object WeakMap]';
+
+var arrayBufferTag = '[object ArrayBuffer]',
+ float32Tag = '[object Float32Array]',
+ float64Tag = '[object Float64Array]',
+ int8Tag = '[object Int8Array]',
+ int16Tag = '[object Int16Array]',
+ int32Tag = '[object Int32Array]',
+ uint8Tag = '[object Uint8Array]',
+ uint8ClampedTag = '[object Uint8ClampedArray]',
+ uint16Tag = '[object Uint16Array]',
+ uint32Tag = '[object Uint32Array]';
+
+/** Used to identify `toStringTag` values supported by `_.clone`. */
+var cloneableTags = {};
+cloneableTags[argsTag] = cloneableTags[arrayTag] =
+cloneableTags[arrayBufferTag] = cloneableTags[boolTag] =
+cloneableTags[dateTag] = cloneableTags[float32Tag] =
+cloneableTags[float64Tag] = cloneableTags[int8Tag] =
+cloneableTags[int16Tag] = cloneableTags[int32Tag] =
+cloneableTags[numberTag] = cloneableTags[objectTag] =
+cloneableTags[regexpTag] = cloneableTags[stringTag] =
+cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
+cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
+cloneableTags[errorTag] = cloneableTags[funcTag] =
+cloneableTags[mapTag] = cloneableTags[setTag] =
+cloneableTags[weakMapTag] = false;
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * The base implementation of `_.clone` without support for argument juggling
+ * and `this` binding `customizer` functions.
+ *
+ * @private
+ * @param {*} value The value to clone.
+ * @param {boolean} [isDeep] Specify a deep clone.
+ * @param {Function} [customizer] The function to customize cloning values.
+ * @param {string} [key] The key of `value`.
+ * @param {Object} [object] The object `value` belongs to.
+ * @param {Array} [stackA=[]] Tracks traversed source objects.
+ * @param {Array} [stackB=[]] Associates clones with source counterparts.
+ * @returns {*} Returns the cloned value.
+ */
+function baseClone(value, isDeep, customizer, key, object, stackA, stackB) {
+ var result;
+ if (customizer) {
+ result = object ? customizer(value, key, object) : customizer(value);
+ }
+ if (result !== undefined) {
+ return result;
+ }
+ if (!isObject(value)) {
+ return value;
+ }
+ var isArr = isArray(value);
+ if (isArr) {
+ result = initCloneArray(value);
+ if (!isDeep) {
+ return arrayCopy(value, result);
+ }
+ } else {
+ var tag = objToString.call(value),
+ isFunc = tag == funcTag;
+
+ if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
+ if (isHostObject(value)) {
+ return object ? value : {};
+ }
+ result = initCloneObject(isFunc ? {} : value);
+ if (!isDeep) {
+ return baseAssign(result, value);
+ }
+ } else {
+ return cloneableTags[tag]
+ ? initCloneByTag(value, tag, isDeep)
+ : (object ? value : {});
+ }
+ }
+ // Check for circular references and return its corresponding clone.
+ stackA || (stackA = []);
+ stackB || (stackB = []);
+
+ var length = stackA.length;
+ while (length--) {
+ if (stackA[length] == value) {
+ return stackB[length];
+ }
+ }
+ // Add the source value to the stack of traversed objects and associate it with its clone.
+ stackA.push(value);
+ stackB.push(result);
+
+ // Recursively populate clone (susceptible to call stack limits).
+ (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) {
+ result[key] = baseClone(subValue, isDeep, customizer, key, value, stackA, stackB);
+ });
+ return result;
+}
+
+module.exports = baseClone;
+
+},{"../lang/isArray":143,"../lang/isObject":147,"./arrayCopy":65,"./arrayEach":66,"./baseAssign":69,"./baseForOwn":79,"./initCloneArray":119,"./initCloneByTag":120,"./initCloneObject":121,"./isHostObject":123}],72:[function(require,module,exports){
+/**
+ * Copies properties of `source` to `object`.
+ *
+ * @private
+ * @param {Object} source The object to copy properties from.
+ * @param {Array} props The property names to copy.
+ * @param {Object} [object={}] The object to copy properties to.
+ * @returns {Object} Returns `object`.
+ */
+function baseCopy(source, props, object) {
+ object || (object = {});
+
+ var index = -1,
+ length = props.length;
+
+ while (++index < length) {
+ var key = props[index];
+ object[key] = source[key];
+ }
+ return object;
+}
+
+module.exports = baseCopy;
+
+},{}],73:[function(require,module,exports){
+var isObject = require('../lang/isObject');
+
+/**
+ * The base implementation of `_.create` without support for assigning
+ * properties to the created object.
+ *
+ * @private
+ * @param {Object} prototype The object to inherit from.
+ * @returns {Object} Returns the new object.
+ */
+var baseCreate = (function() {
+ function object() {}
+ return function(prototype) {
+ if (isObject(prototype)) {
+ object.prototype = prototype;
+ var result = new object;
+ object.prototype = undefined;
+ }
+ return result || {};
+ };
+}());
+
+module.exports = baseCreate;
+
+},{"../lang/isObject":147}],74:[function(require,module,exports){
+var baseForOwn = require('./baseForOwn'),
+ createBaseEach = require('./createBaseEach');
+
+/**
+ * The base implementation of `_.forEach` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array|Object|string} Returns `collection`.
+ */
+var baseEach = createBaseEach(baseForOwn);
+
+module.exports = baseEach;
+
+},{"./baseForOwn":79,"./createBaseEach":101}],75:[function(require,module,exports){
+/**
+ * The base implementation of `_.find`, `_.findLast`, `_.findKey`, and `_.findLastKey`,
+ * without support for callback shorthands and `this` binding, which iterates
+ * over `collection` using the provided `eachFunc`.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to search.
+ * @param {Function} predicate The function invoked per iteration.
+ * @param {Function} eachFunc The function to iterate over `collection`.
+ * @param {boolean} [retKey] Specify returning the key of the found element
+ * instead of the element itself.
+ * @returns {*} Returns the found element or its key, else `undefined`.
+ */
+function baseFind(collection, predicate, eachFunc, retKey) {
+ var result;
+ eachFunc(collection, function(value, key, collection) {
+ if (predicate(value, key, collection)) {
+ result = retKey ? key : value;
+ return false;
+ }
+ });
+ return result;
+}
+
+module.exports = baseFind;
+
+},{}],76:[function(require,module,exports){
+/**
+ * The base implementation of `_.findIndex` and `_.findLastIndex` without
+ * support for callback shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to search.
+ * @param {Function} predicate The function invoked per iteration.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ */
+function baseFindIndex(array, predicate, fromRight) {
+ var length = array.length,
+ index = fromRight ? length : -1;
+
+ while ((fromRight ? index-- : ++index < length)) {
+ if (predicate(array[index], index, array)) {
+ return index;
+ }
+ }
+ return -1;
+}
+
+module.exports = baseFindIndex;
+
+},{}],77:[function(require,module,exports){
+var createBaseFor = require('./createBaseFor');
+
+/**
+ * The base implementation of `baseForIn` and `baseForOwn` which iterates
+ * over `object` properties returned by `keysFunc` invoking `iteratee` for
+ * each property. Iteratee functions may exit iteration early by explicitly
+ * returning `false`.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {Function} keysFunc The function to get the keys of `object`.
+ * @returns {Object} Returns `object`.
+ */
+var baseFor = createBaseFor();
+
+module.exports = baseFor;
+
+},{"./createBaseFor":102}],78:[function(require,module,exports){
+var baseFor = require('./baseFor'),
+ keysIn = require('../object/keysIn');
+
+/**
+ * The base implementation of `_.forIn` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Object} Returns `object`.
+ */
+function baseForIn(object, iteratee) {
+ return baseFor(object, iteratee, keysIn);
+}
+
+module.exports = baseForIn;
+
+},{"../object/keysIn":153,"./baseFor":77}],79:[function(require,module,exports){
+var baseFor = require('./baseFor'),
+ keys = require('../object/keys');
+
+/**
+ * The base implementation of `_.forOwn` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Object} Returns `object`.
+ */
+function baseForOwn(object, iteratee) {
+ return baseFor(object, iteratee, keys);
+}
+
+module.exports = baseForOwn;
+
+},{"../object/keys":152,"./baseFor":77}],80:[function(require,module,exports){
+var toObject = require('./toObject');
+
+/**
+ * The base implementation of `get` without support for string paths
+ * and default values.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Array} path The path of the property to get.
+ * @param {string} [pathKey] The key representation of path.
+ * @returns {*} Returns the resolved value.
+ */
+function baseGet(object, path, pathKey) {
+ if (object == null) {
+ return;
+ }
+ object = toObject(object);
+ if (pathKey !== undefined && pathKey in object) {
+ path = [pathKey];
+ }
+ var index = 0,
+ length = path.length;
+
+ while (object != null && index < length) {
+ object = toObject(object)[path[index++]];
+ }
+ return (index && index == length) ? object : undefined;
+}
+
+module.exports = baseGet;
+
+},{"./toObject":138}],81:[function(require,module,exports){
+var indexOfNaN = require('./indexOfNaN');
+
+/**
+ * The base implementation of `_.indexOf` without support for binary searches.
+ *
+ * @private
+ * @param {Array} array The array to search.
+ * @param {*} value The value to search for.
+ * @param {number} fromIndex The index to search from.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ */
+function baseIndexOf(array, value, fromIndex) {
+ if (value !== value) {
+ return indexOfNaN(array, fromIndex);
+ }
+ var index = fromIndex - 1,
+ length = array.length;
+
+ while (++index < length) {
+ if (array[index] === value) {
+ return index;
+ }
+ }
+ return -1;
+}
+
+module.exports = baseIndexOf;
+
+},{"./indexOfNaN":118}],82:[function(require,module,exports){
+var baseIsEqualDeep = require('./baseIsEqualDeep'),
+ isObject = require('../lang/isObject'),
+ isObjectLike = require('./isObjectLike');
+
+/**
+ * The base implementation of `_.isEqual` without support for `this` binding
+ * `customizer` functions.
+ *
+ * @private
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @param {Function} [customizer] The function to customize comparing values.
+ * @param {boolean} [isLoose] Specify performing partial comparisons.
+ * @param {Array} [stackA] Tracks traversed `value` objects.
+ * @param {Array} [stackB] Tracks traversed `other` objects.
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
+ */
+function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) {
+ if (value === other) {
+ return true;
+ }
+ if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {
+ return value !== value && other !== other;
+ }
+ return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB);
+}
+
+module.exports = baseIsEqual;
+
+},{"../lang/isObject":147,"./baseIsEqualDeep":83,"./isObjectLike":129}],83:[function(require,module,exports){
+var equalArrays = require('./equalArrays'),
+ equalByTag = require('./equalByTag'),
+ equalObjects = require('./equalObjects'),
+ isArray = require('../lang/isArray'),
+ isHostObject = require('./isHostObject'),
+ isTypedArray = require('../lang/isTypedArray');
+
+/** `Object#toString` result references. */
+var argsTag = '[object Arguments]',
+ arrayTag = '[object Array]',
+ objectTag = '[object Object]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * A specialized version of `baseIsEqual` for arrays and objects which performs
+ * deep comparisons and tracks traversed objects enabling objects with circular
+ * references to be compared.
+ *
+ * @private
+ * @param {Object} object The object to compare.
+ * @param {Object} other The other object to compare.
+ * @param {Function} equalFunc The function to determine equivalents of values.
+ * @param {Function} [customizer] The function to customize comparing objects.
+ * @param {boolean} [isLoose] Specify performing partial comparisons.
+ * @param {Array} [stackA=[]] Tracks traversed `value` objects.
+ * @param {Array} [stackB=[]] Tracks traversed `other` objects.
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+ */
+function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
+ var objIsArr = isArray(object),
+ othIsArr = isArray(other),
+ objTag = arrayTag,
+ othTag = arrayTag;
+
+ if (!objIsArr) {
+ objTag = objToString.call(object);
+ if (objTag == argsTag) {
+ objTag = objectTag;
+ } else if (objTag != objectTag) {
+ objIsArr = isTypedArray(object);
+ }
+ }
+ if (!othIsArr) {
+ othTag = objToString.call(other);
+ if (othTag == argsTag) {
+ othTag = objectTag;
+ } else if (othTag != objectTag) {
+ othIsArr = isTypedArray(other);
+ }
+ }
+ var objIsObj = objTag == objectTag && !isHostObject(object),
+ othIsObj = othTag == objectTag && !isHostObject(other),
+ isSameTag = objTag == othTag;
+
+ if (isSameTag && !(objIsArr || objIsObj)) {
+ return equalByTag(object, other, objTag);
+ }
+ if (!isLoose) {
+ var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
+ othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
+
+ if (objIsWrapped || othIsWrapped) {
+ return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, isLoose, stackA, stackB);
+ }
+ }
+ if (!isSameTag) {
+ return false;
+ }
+ // Assume cyclic values are equal.
+ // For more information on detecting circular references see https://es5.github.io/#JO.
+ stackA || (stackA = []);
+ stackB || (stackB = []);
+
+ var length = stackA.length;
+ while (length--) {
+ if (stackA[length] == object) {
+ return stackB[length] == other;
+ }
+ }
+ // Add `object` and `other` to the stack of traversed objects.
+ stackA.push(object);
+ stackB.push(other);
+
+ var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB);
+
+ stackA.pop();
+ stackB.pop();
+
+ return result;
+}
+
+module.exports = baseIsEqualDeep;
+
+},{"../lang/isArray":143,"../lang/isTypedArray":150,"./equalArrays":110,"./equalByTag":111,"./equalObjects":112,"./isHostObject":123}],84:[function(require,module,exports){
+var baseIsEqual = require('./baseIsEqual'),
+ toObject = require('./toObject');
+
+/**
+ * The base implementation of `_.isMatch` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Object} object The object to inspect.
+ * @param {Array} matchData The propery names, values, and compare flags to match.
+ * @param {Function} [customizer] The function to customize comparing objects.
+ * @returns {boolean} Returns `true` if `object` is a match, else `false`.
+ */
+function baseIsMatch(object, matchData, customizer) {
+ var index = matchData.length,
+ length = index,
+ noCustomizer = !customizer;
+
+ if (object == null) {
+ return !length;
+ }
+ object = toObject(object);
+ while (index--) {
+ var data = matchData[index];
+ if ((noCustomizer && data[2])
+ ? data[1] !== object[data[0]]
+ : !(data[0] in object)
+ ) {
+ return false;
+ }
+ }
+ while (++index < length) {
+ data = matchData[index];
+ var key = data[0],
+ objValue = object[key],
+ srcValue = data[1];
+
+ if (noCustomizer && data[2]) {
+ if (objValue === undefined && !(key in object)) {
+ return false;
+ }
+ } else {
+ var result = customizer ? customizer(objValue, srcValue, key) : undefined;
+ if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, true) : result)) {
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
+module.exports = baseIsMatch;
+
+},{"./baseIsEqual":82,"./toObject":138}],85:[function(require,module,exports){
+/**
+ * The function whose prototype all chaining wrappers inherit from.
+ *
+ * @private
+ */
+function baseLodash() {
+ // No operation performed.
+}
+
+module.exports = baseLodash;
+
+},{}],86:[function(require,module,exports){
+var baseEach = require('./baseEach'),
+ isArrayLike = require('./isArrayLike');
+
+/**
+ * The base implementation of `_.map` without support for callback shorthands
+ * and `this` binding.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns the new mapped array.
+ */
+function baseMap(collection, iteratee) {
+ var index = -1,
+ result = isArrayLike(collection) ? Array(collection.length) : [];
+
+ baseEach(collection, function(value, key, collection) {
+ result[++index] = iteratee(value, key, collection);
+ });
+ return result;
+}
+
+module.exports = baseMap;
+
+},{"./baseEach":74,"./isArrayLike":122}],87:[function(require,module,exports){
+var baseIsMatch = require('./baseIsMatch'),
+ getMatchData = require('./getMatchData'),
+ toObject = require('./toObject');
+
+/**
+ * The base implementation of `_.matches` which does not clone `source`.
+ *
+ * @private
+ * @param {Object} source The object of property values to match.
+ * @returns {Function} Returns the new function.
+ */
+function baseMatches(source) {
+ var matchData = getMatchData(source);
+ if (matchData.length == 1 && matchData[0][2]) {
+ var key = matchData[0][0],
+ value = matchData[0][1];
+
+ return function(object) {
+ if (object == null) {
+ return false;
+ }
+ object = toObject(object);
+ return object[key] === value && (value !== undefined || (key in object));
+ };
+ }
+ return function(object) {
+ return baseIsMatch(object, matchData);
+ };
+}
+
+module.exports = baseMatches;
+
+},{"./baseIsMatch":84,"./getMatchData":116,"./toObject":138}],88:[function(require,module,exports){
+var baseGet = require('./baseGet'),
+ baseIsEqual = require('./baseIsEqual'),
+ baseSlice = require('./baseSlice'),
+ isArray = require('../lang/isArray'),
+ isKey = require('./isKey'),
+ isStrictComparable = require('./isStrictComparable'),
+ last = require('../array/last'),
+ toObject = require('./toObject'),
+ toPath = require('./toPath');
+
+/**
+ * The base implementation of `_.matchesProperty` which does not clone `srcValue`.
+ *
+ * @private
+ * @param {string} path The path of the property to get.
+ * @param {*} srcValue The value to compare.
+ * @returns {Function} Returns the new function.
+ */
+function baseMatchesProperty(path, srcValue) {
+ var isArr = isArray(path),
+ isCommon = isKey(path) && isStrictComparable(srcValue),
+ pathKey = (path + '');
+
+ path = toPath(path);
+ return function(object) {
+ if (object == null) {
+ return false;
+ }
+ var key = pathKey;
+ object = toObject(object);
+ if ((isArr || !isCommon) && !(key in object)) {
+ object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
+ if (object == null) {
+ return false;
+ }
+ key = last(path);
+ object = toObject(object);
+ }
+ return object[key] === srcValue
+ ? (srcValue !== undefined || (key in object))
+ : baseIsEqual(srcValue, object[key], undefined, true);
+ };
+}
+
+module.exports = baseMatchesProperty;
+
+},{"../array/last":53,"../lang/isArray":143,"./baseGet":80,"./baseIsEqual":82,"./baseSlice":92,"./isKey":126,"./isStrictComparable":130,"./toObject":138,"./toPath":139}],89:[function(require,module,exports){
+var toObject = require('./toObject');
+
+/**
+ * The base implementation of `_.property` without support for deep paths.
+ *
+ * @private
+ * @param {string} key The key of the property to get.
+ * @returns {Function} Returns the new function.
+ */
+function baseProperty(key) {
+ return function(object) {
+ return object == null ? undefined : toObject(object)[key];
+ };
+}
+
+module.exports = baseProperty;
+
+},{"./toObject":138}],90:[function(require,module,exports){
+var baseGet = require('./baseGet'),
+ toPath = require('./toPath');
+
+/**
+ * A specialized version of `baseProperty` which supports deep paths.
+ *
+ * @private
+ * @param {Array|string} path The path of the property to get.
+ * @returns {Function} Returns the new function.
+ */
+function basePropertyDeep(path) {
+ var pathKey = (path + '');
+ path = toPath(path);
+ return function(object) {
+ return baseGet(object, path, pathKey);
+ };
+}
+
+module.exports = basePropertyDeep;
+
+},{"./baseGet":80,"./toPath":139}],91:[function(require,module,exports){
+var identity = require('../utility/identity'),
+ metaMap = require('./metaMap');
+
+/**
+ * The base implementation of `setData` without support for hot loop detection.
+ *
+ * @private
+ * @param {Function} func The function to associate metadata with.
+ * @param {*} data The metadata.
+ * @returns {Function} Returns `func`.
+ */
+var baseSetData = !metaMap ? identity : function(func, data) {
+ metaMap.set(func, data);
+ return func;
+};
+
+module.exports = baseSetData;
+
+},{"../utility/identity":157,"./metaMap":132}],92:[function(require,module,exports){
+/**
+ * The base implementation of `_.slice` without an iteratee call guard.
+ *
+ * @private
+ * @param {Array} array The array to slice.
+ * @param {number} [start=0] The start position.
+ * @param {number} [end=array.length] The end position.
+ * @returns {Array} Returns the slice of `array`.
+ */
+function baseSlice(array, start, end) {
+ var index = -1,
+ length = array.length;
+
+ start = start == null ? 0 : (+start || 0);
+ if (start < 0) {
+ start = -start > length ? 0 : (length + start);
+ }
+ end = (end === undefined || end > length) ? length : (+end || 0);
+ if (end < 0) {
+ end += length;
+ }
+ length = start > end ? 0 : ((end - start) >>> 0);
+ start >>>= 0;
+
+ var result = Array(length);
+ while (++index < length) {
+ result[index] = array[index + start];
+ }
+ return result;
+}
+
+module.exports = baseSlice;
+
+},{}],93:[function(require,module,exports){
+/**
+ * Converts `value` to a string if it's not one. An empty string is returned
+ * for `null` or `undefined` values.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {string} Returns the string.
+ */
+function baseToString(value) {
+ return value == null ? '' : (value + '');
+}
+
+module.exports = baseToString;
+
+},{}],94:[function(require,module,exports){
+/**
+ * The base implementation of `_.values` and `_.valuesIn` which creates an
+ * array of `object` property values corresponding to the property names
+ * of `props`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Array} props The property names to get values for.
+ * @returns {Object} Returns the array of property values.
+ */
+function baseValues(object, props) {
+ var index = -1,
+ length = props.length,
+ result = Array(length);
+
+ while (++index < length) {
+ result[index] = object[props[index]];
+ }
+ return result;
+}
+
+module.exports = baseValues;
+
+},{}],95:[function(require,module,exports){
+var binaryIndexBy = require('./binaryIndexBy'),
+ identity = require('../utility/identity');
+
+/** Used as references for the maximum length and index of an array. */
+var MAX_ARRAY_LENGTH = 4294967295,
+ HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
+
+/**
+ * Performs a binary search of `array` to determine the index at which `value`
+ * should be inserted into `array` in order to maintain its sort order.
+ *
+ * @private
+ * @param {Array} array The sorted array to inspect.
+ * @param {*} value The value to evaluate.
+ * @param {boolean} [retHighest] Specify returning the highest qualified index.
+ * @returns {number} Returns the index at which `value` should be inserted
+ * into `array`.
+ */
+function binaryIndex(array, value, retHighest) {
+ var low = 0,
+ high = array ? array.length : low;
+
+ if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
+ while (low < high) {
+ var mid = (low + high) >>> 1,
+ computed = array[mid];
+
+ if ((retHighest ? (computed <= value) : (computed < value)) && computed !== null) {
+ low = mid + 1;
+ } else {
+ high = mid;
+ }
+ }
+ return high;
+ }
+ return binaryIndexBy(array, value, identity, retHighest);
+}
+
+module.exports = binaryIndex;
+
+},{"../utility/identity":157,"./binaryIndexBy":96}],96:[function(require,module,exports){
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeFloor = Math.floor,
+ nativeMin = Math.min;
+
+/** Used as references for the maximum length and index of an array. */
+var MAX_ARRAY_LENGTH = 4294967295,
+ MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1;
+
+/**
+ * This function is like `binaryIndex` except that it invokes `iteratee` for
+ * `value` and each element of `array` to compute their sort ranking. The
+ * iteratee is invoked with one argument; (value).
+ *
+ * @private
+ * @param {Array} array The sorted array to inspect.
+ * @param {*} value The value to evaluate.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {boolean} [retHighest] Specify returning the highest qualified index.
+ * @returns {number} Returns the index at which `value` should be inserted
+ * into `array`.
+ */
+function binaryIndexBy(array, value, iteratee, retHighest) {
+ value = iteratee(value);
+
+ var low = 0,
+ high = array ? array.length : 0,
+ valIsNaN = value !== value,
+ valIsNull = value === null,
+ valIsUndef = value === undefined;
+
+ while (low < high) {
+ var mid = nativeFloor((low + high) / 2),
+ computed = iteratee(array[mid]),
+ isDef = computed !== undefined,
+ isReflexive = computed === computed;
+
+ if (valIsNaN) {
+ var setLow = isReflexive || retHighest;
+ } else if (valIsNull) {
+ setLow = isReflexive && isDef && (retHighest || computed != null);
+ } else if (valIsUndef) {
+ setLow = isReflexive && (retHighest || isDef);
+ } else if (computed == null) {
+ setLow = false;
+ } else {
+ setLow = retHighest ? (computed <= value) : (computed < value);
+ }
+ if (setLow) {
+ low = mid + 1;
+ } else {
+ high = mid;
+ }
+ }
+ return nativeMin(high, MAX_ARRAY_INDEX);
+}
+
+module.exports = binaryIndexBy;
+
+},{}],97:[function(require,module,exports){
+var identity = require('../utility/identity');
+
+/**
+ * A specialized version of `baseCallback` which only supports `this` binding
+ * and specifying the number of arguments to provide to `func`.
+ *
+ * @private
+ * @param {Function} func The function to bind.
+ * @param {*} thisArg The `this` binding of `func`.
+ * @param {number} [argCount] The number of arguments to provide to `func`.
+ * @returns {Function} Returns the callback.
+ */
+function bindCallback(func, thisArg, argCount) {
+ if (typeof func != 'function') {
+ return identity;
+ }
+ if (thisArg === undefined) {
+ return func;
+ }
+ switch (argCount) {
+ case 1: return function(value) {
+ return func.call(thisArg, value);
+ };
+ case 3: return function(value, index, collection) {
+ return func.call(thisArg, value, index, collection);
+ };
+ case 4: return function(accumulator, value, index, collection) {
+ return func.call(thisArg, accumulator, value, index, collection);
+ };
+ case 5: return function(value, other, key, object, source) {
+ return func.call(thisArg, value, other, key, object, source);
+ };
+ }
+ return function() {
+ return func.apply(thisArg, arguments);
+ };
+}
+
+module.exports = bindCallback;
+
+},{"../utility/identity":157}],98:[function(require,module,exports){
+(function (global){
+/** Native method references. */
+var ArrayBuffer = global.ArrayBuffer,
+ Uint8Array = global.Uint8Array;
+
+/**
+ * Creates a clone of the given array buffer.
+ *
+ * @private
+ * @param {ArrayBuffer} buffer The array buffer to clone.
+ * @returns {ArrayBuffer} Returns the cloned array buffer.
+ */
+function bufferClone(buffer) {
+ var result = new ArrayBuffer(buffer.byteLength),
+ view = new Uint8Array(result);
+
+ view.set(new Uint8Array(buffer));
+ return result;
+}
+
+module.exports = bufferClone;
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+//# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9sb2Rhc2gtY29tcGF0L2ludGVybmFsL2J1ZmZlckNsb25lLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJmaWxlIjoiZ2VuZXJhdGVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBOYXRpdmUgbWV0aG9kIHJlZmVyZW5jZXMuICovXG52YXIgQXJyYXlCdWZmZXIgPSBnbG9iYWwuQXJyYXlCdWZmZXIsXG4gICAgVWludDhBcnJheSA9IGdsb2JhbC5VaW50OEFycmF5O1xuXG4vKipcbiAqIENyZWF0ZXMgYSBjbG9uZSBvZiB0aGUgZ2l2ZW4gYXJyYXkgYnVmZmVyLlxuICpcbiAqIEBwcml2YXRlXG4gKiBAcGFyYW0ge0FycmF5QnVmZmVyfSBidWZmZXIgVGhlIGFycmF5IGJ1ZmZlciB0byBjbG9uZS5cbiAqIEByZXR1cm5zIHtBcnJheUJ1ZmZlcn0gUmV0dXJucyB0aGUgY2xvbmVkIGFycmF5IGJ1ZmZlci5cbiAqL1xuZnVuY3Rpb24gYnVmZmVyQ2xvbmUoYnVmZmVyKSB7XG4gIHZhciByZXN1bHQgPSBuZXcgQXJyYXlCdWZmZXIoYnVmZmVyLmJ5dGVMZW5ndGgpLFxuICAgICAgdmlldyA9IG5ldyBVaW50OEFycmF5KHJlc3VsdCk7XG5cbiAgdmlldy5zZXQobmV3IFVpbnQ4QXJyYXkoYnVmZmVyKSk7XG4gIHJldHVybiByZXN1bHQ7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gYnVmZmVyQ2xvbmU7XG4iXX0=
+},{}],99:[function(require,module,exports){
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * Creates an array that is the composition of partially applied arguments,
+ * placeholders, and provided arguments into a single array of arguments.
+ *
+ * @private
+ * @param {Array|Object} args The provided arguments.
+ * @param {Array} partials The arguments to prepend to those provided.
+ * @param {Array} holders The `partials` placeholder indexes.
+ * @returns {Array} Returns the new array of composed arguments.
+ */
+function composeArgs(args, partials, holders) {
+ var holdersLength = holders.length,
+ argsIndex = -1,
+ argsLength = nativeMax(args.length - holdersLength, 0),
+ leftIndex = -1,
+ leftLength = partials.length,
+ result = Array(leftLength + argsLength);
+
+ while (++leftIndex < leftLength) {
+ result[leftIndex] = partials[leftIndex];
+ }
+ while (++argsIndex < holdersLength) {
+ result[holders[argsIndex]] = args[argsIndex];
+ }
+ while (argsLength--) {
+ result[leftIndex++] = args[argsIndex++];
+ }
+ return result;
+}
+
+module.exports = composeArgs;
+
+},{}],100:[function(require,module,exports){
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * This function is like `composeArgs` except that the arguments composition
+ * is tailored for `_.partialRight`.
+ *
+ * @private
+ * @param {Array|Object} args The provided arguments.
+ * @param {Array} partials The arguments to append to those provided.
+ * @param {Array} holders The `partials` placeholder indexes.
+ * @returns {Array} Returns the new array of composed arguments.
+ */
+function composeArgsRight(args, partials, holders) {
+ var holdersIndex = -1,
+ holdersLength = holders.length,
+ argsIndex = -1,
+ argsLength = nativeMax(args.length - holdersLength, 0),
+ rightIndex = -1,
+ rightLength = partials.length,
+ result = Array(argsLength + rightLength);
+
+ while (++argsIndex < argsLength) {
+ result[argsIndex] = args[argsIndex];
+ }
+ var offset = argsIndex;
+ while (++rightIndex < rightLength) {
+ result[offset + rightIndex] = partials[rightIndex];
+ }
+ while (++holdersIndex < holdersLength) {
+ result[offset + holders[holdersIndex]] = args[argsIndex++];
+ }
+ return result;
+}
+
+module.exports = composeArgsRight;
+
+},{}],101:[function(require,module,exports){
+var getLength = require('./getLength'),
+ isLength = require('./isLength'),
+ toObject = require('./toObject');
+
+/**
+ * Creates a `baseEach` or `baseEachRight` function.
+ *
+ * @private
+ * @param {Function} eachFunc The function to iterate over a collection.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new base function.
+ */
+function createBaseEach(eachFunc, fromRight) {
+ return function(collection, iteratee) {
+ var length = collection ? getLength(collection) : 0;
+ if (!isLength(length)) {
+ return eachFunc(collection, iteratee);
+ }
+ var index = fromRight ? length : -1,
+ iterable = toObject(collection);
+
+ while ((fromRight ? index-- : ++index < length)) {
+ if (iteratee(iterable[index], index, iterable) === false) {
+ break;
+ }
+ }
+ return collection;
+ };
+}
+
+module.exports = createBaseEach;
+
+},{"./getLength":115,"./isLength":128,"./toObject":138}],102:[function(require,module,exports){
+var toObject = require('./toObject');
+
+/**
+ * Creates a base function for `_.forIn` or `_.forInRight`.
+ *
+ * @private
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new base function.
+ */
+function createBaseFor(fromRight) {
+ return function(object, iteratee, keysFunc) {
+ var iterable = toObject(object),
+ props = keysFunc(object),
+ length = props.length,
+ index = fromRight ? length : -1;
+
+ while ((fromRight ? index-- : ++index < length)) {
+ var key = props[index];
+ if (iteratee(iterable[key], key, iterable) === false) {
+ break;
+ }
+ }
+ return object;
+ };
+}
+
+module.exports = createBaseFor;
+
+},{"./toObject":138}],103:[function(require,module,exports){
+(function (global){
+var createCtorWrapper = require('./createCtorWrapper');
+
+/**
+ * Creates a function that wraps `func` and invokes it with the `this`
+ * binding of `thisArg`.
+ *
+ * @private
+ * @param {Function} func The function to bind.
+ * @param {*} [thisArg] The `this` binding of `func`.
+ * @returns {Function} Returns the new bound function.
+ */
+function createBindWrapper(func, thisArg) {
+ var Ctor = createCtorWrapper(func);
+
+ function wrapper() {
+ var fn = (this && this !== global && this instanceof wrapper) ? Ctor : func;
+ return fn.apply(thisArg, arguments);
+ }
+ return wrapper;
+}
+
+module.exports = createBindWrapper;
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+//# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9sb2Rhc2gtY29tcGF0L2ludGVybmFsL2NyZWF0ZUJpbmRXcmFwcGVyLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwiZmlsZSI6ImdlbmVyYXRlZC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgY3JlYXRlQ3RvcldyYXBwZXIgPSByZXF1aXJlKCcuL2NyZWF0ZUN0b3JXcmFwcGVyJyk7XG5cbi8qKlxuICogQ3JlYXRlcyBhIGZ1bmN0aW9uIHRoYXQgd3JhcHMgYGZ1bmNgIGFuZCBpbnZva2VzIGl0IHdpdGggdGhlIGB0aGlzYFxuICogYmluZGluZyBvZiBgdGhpc0FyZ2AuXG4gKlxuICogQHByaXZhdGVcbiAqIEBwYXJhbSB7RnVuY3Rpb259IGZ1bmMgVGhlIGZ1bmN0aW9uIHRvIGJpbmQuXG4gKiBAcGFyYW0geyp9IFt0aGlzQXJnXSBUaGUgYHRoaXNgIGJpbmRpbmcgb2YgYGZ1bmNgLlxuICogQHJldHVybnMge0Z1bmN0aW9ufSBSZXR1cm5zIHRoZSBuZXcgYm91bmQgZnVuY3Rpb24uXG4gKi9cbmZ1bmN0aW9uIGNyZWF0ZUJpbmRXcmFwcGVyKGZ1bmMsIHRoaXNBcmcpIHtcbiAgdmFyIEN0b3IgPSBjcmVhdGVDdG9yV3JhcHBlcihmdW5jKTtcblxuICBmdW5jdGlvbiB3cmFwcGVyKCkge1xuICAgIHZhciBmbiA9ICh0aGlzICYmIHRoaXMgIT09IGdsb2JhbCAmJiB0aGlzIGluc3RhbmNlb2Ygd3JhcHBlcikgPyBDdG9yIDogZnVuYztcbiAgICByZXR1cm4gZm4uYXBwbHkodGhpc0FyZywgYXJndW1lbnRzKTtcbiAgfVxuICByZXR1cm4gd3JhcHBlcjtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBjcmVhdGVCaW5kV3JhcHBlcjtcbiJdfQ==
+},{"./createCtorWrapper":104}],104:[function(require,module,exports){
+var baseCreate = require('./baseCreate'),
+ isObject = require('../lang/isObject');
+
+/**
+ * Creates a function that produces an instance of `Ctor` regardless of
+ * whether it was invoked as part of a `new` expression or by `call` or `apply`.
+ *
+ * @private
+ * @param {Function} Ctor The constructor to wrap.
+ * @returns {Function} Returns the new wrapped function.
+ */
+function createCtorWrapper(Ctor) {
+ return function() {
+ // Use a `switch` statement to work with class constructors.
+ // See http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
+ // for more details.
+ var args = arguments;
+ switch (args.length) {
+ case 0: return new Ctor;
+ case 1: return new Ctor(args[0]);
+ case 2: return new Ctor(args[0], args[1]);
+ case 3: return new Ctor(args[0], args[1], args[2]);
+ case 4: return new Ctor(args[0], args[1], args[2], args[3]);
+ case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
+ case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
+ case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
+ }
+ var thisBinding = baseCreate(Ctor.prototype),
+ result = Ctor.apply(thisBinding, args);
+
+ // Mimic the constructor's `return` behavior.
+ // See https://es5.github.io/#x13.2.2 for more details.
+ return isObject(result) ? result : thisBinding;
+ };
+}
+
+module.exports = createCtorWrapper;
+
+},{"../lang/isObject":147,"./baseCreate":73}],105:[function(require,module,exports){
+var baseCallback = require('./baseCallback'),
+ baseFind = require('./baseFind'),
+ baseFindIndex = require('./baseFindIndex'),
+ isArray = require('../lang/isArray');
+
+/**
+ * Creates a `_.find` or `_.findLast` function.
+ *
+ * @private
+ * @param {Function} eachFunc The function to iterate over a collection.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new find function.
+ */
+function createFind(eachFunc, fromRight) {
+ return function(collection, predicate, thisArg) {
+ predicate = baseCallback(predicate, thisArg, 3);
+ if (isArray(collection)) {
+ var index = baseFindIndex(collection, predicate, fromRight);
+ return index > -1 ? collection[index] : undefined;
+ }
+ return baseFind(collection, predicate, eachFunc);
+ };
+}
+
+module.exports = createFind;
+
+},{"../lang/isArray":143,"./baseCallback":70,"./baseFind":75,"./baseFindIndex":76}],106:[function(require,module,exports){
+var bindCallback = require('./bindCallback'),
+ isArray = require('../lang/isArray');
+
+/**
+ * Creates a function for `_.forEach` or `_.forEachRight`.
+ *
+ * @private
+ * @param {Function} arrayFunc The function to iterate over an array.
+ * @param {Function} eachFunc The function to iterate over a collection.
+ * @returns {Function} Returns the new each function.
+ */
+function createForEach(arrayFunc, eachFunc) {
+ return function(collection, iteratee, thisArg) {
+ return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection))
+ ? arrayFunc(collection, iteratee)
+ : eachFunc(collection, bindCallback(iteratee, thisArg, 3));
+ };
+}
+
+module.exports = createForEach;
+
+},{"../lang/isArray":143,"./bindCallback":97}],107:[function(require,module,exports){
+(function (global){
+var arrayCopy = require('./arrayCopy'),
+ composeArgs = require('./composeArgs'),
+ composeArgsRight = require('./composeArgsRight'),
+ createCtorWrapper = require('./createCtorWrapper'),
+ isLaziable = require('./isLaziable'),
+ reorder = require('./reorder'),
+ replaceHolders = require('./replaceHolders'),
+ setData = require('./setData');
+
+/** Used to compose bitmasks for wrapper metadata. */
+var BIND_FLAG = 1,
+ BIND_KEY_FLAG = 2,
+ CURRY_BOUND_FLAG = 4,
+ CURRY_FLAG = 8,
+ CURRY_RIGHT_FLAG = 16,
+ PARTIAL_FLAG = 32,
+ PARTIAL_RIGHT_FLAG = 64,
+ ARY_FLAG = 128;
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * Creates a function that wraps `func` and invokes it with optional `this`
+ * binding of, partial application, and currying.
+ *
+ * @private
+ * @param {Function|string} func The function or method name to reference.
+ * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details.
+ * @param {*} [thisArg] The `this` binding of `func`.
+ * @param {Array} [partials] The arguments to prepend to those provided to the new function.
+ * @param {Array} [holders] The `partials` placeholder indexes.
+ * @param {Array} [partialsRight] The arguments to append to those provided to the new function.
+ * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
+ * @param {Array} [argPos] The argument positions of the new function.
+ * @param {number} [ary] The arity cap of `func`.
+ * @param {number} [arity] The arity of `func`.
+ * @returns {Function} Returns the new wrapped function.
+ */
+function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
+ var isAry = bitmask & ARY_FLAG,
+ isBind = bitmask & BIND_FLAG,
+ isBindKey = bitmask & BIND_KEY_FLAG,
+ isCurry = bitmask & CURRY_FLAG,
+ isCurryBound = bitmask & CURRY_BOUND_FLAG,
+ isCurryRight = bitmask & CURRY_RIGHT_FLAG,
+ Ctor = isBindKey ? undefined : createCtorWrapper(func);
+
+ function wrapper() {
+ // Avoid `arguments` object use disqualifying optimizations by
+ // converting it to an array before providing it to other functions.
+ var length = arguments.length,
+ index = length,
+ args = Array(length);
+
+ while (index--) {
+ args[index] = arguments[index];
+ }
+ if (partials) {
+ args = composeArgs(args, partials, holders);
+ }
+ if (partialsRight) {
+ args = composeArgsRight(args, partialsRight, holdersRight);
+ }
+ if (isCurry || isCurryRight) {
+ var placeholder = wrapper.placeholder,
+ argsHolders = replaceHolders(args, placeholder);
+
+ length -= argsHolders.length;
+ if (length < arity) {
+ var newArgPos = argPos ? arrayCopy(argPos) : undefined,
+ newArity = nativeMax(arity - length, 0),
+ newsHolders = isCurry ? argsHolders : undefined,
+ newHoldersRight = isCurry ? undefined : argsHolders,
+ newPartials = isCurry ? args : undefined,
+ newPartialsRight = isCurry ? undefined : args;
+
+ bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG);
+ bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG);
+
+ if (!isCurryBound) {
+ bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG);
+ }
+ var newData = [func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, newArity],
+ result = createHybridWrapper.apply(undefined, newData);
+
+ if (isLaziable(func)) {
+ setData(result, newData);
+ }
+ result.placeholder = placeholder;
+ return result;
+ }
+ }
+ var thisBinding = isBind ? thisArg : this,
+ fn = isBindKey ? thisBinding[func] : func;
+
+ if (argPos) {
+ args = reorder(args, argPos);
+ }
+ if (isAry && ary < args.length) {
+ args.length = ary;
+ }
+ if (this && this !== global && this instanceof wrapper) {
+ fn = Ctor || createCtorWrapper(func);
+ }
+ return fn.apply(thisBinding, args);
+ }
+ return wrapper;
+}
+
+module.exports = createHyb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GFyeSA8IGFyZ3MubGVuZ3RoKSB7XG4gICAgICBhcmdzLmxlbmd0aCA9IGFyeTtcbiAgICB9XG4gICAgaWYgKHRoaXMgJiYgdGhpcyAhPT0gZ2xvYmFsICYmIHRoaXMgaW5zdGFuY2VvZiB3cmFwcGVyKSB7XG4gICAgICBmbiA9IEN0b3IgfHwgY3JlYXRlQ3RvcldyYXBwZXIoZnVuYyk7XG4gICAgfVxuICAgIHJldHVybiBmbi5hcHBseSh0aGlzQmluZGluZywgYXJncyk7XG4gIH1cbiAgcmV0dXJuIHdyYXBwZXI7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gY3JlYXRlSHlicmlkV3JhcHBlcjtcbiJdfQ==
+},{"./arrayCopy":65,"./composeArgs":99,"./composeArgsRight":100,"./createCtorWrapper":104,"./isLaziable":127,"./reorder":134,"./replaceHolders":135,"./setData":136}],108:[function(require,module,exports){
+(function (global){
+var createCtorWrapper = require('./createCtorWrapper');
+
+/** Used to compose bitmasks for wrapper metadata. */
+var BIND_FLAG = 1;
+
+/**
+ * Creates a function that wraps `func` and invokes it with the optional `this`
+ * binding of `thisArg` and the `partials` prepended to those provided to
+ * the wrapper.
+ *
+ * @private
+ * @param {Function} func The function to partially apply arguments to.
+ * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details.
+ * @param {*} thisArg The `this` binding of `func`.
+ * @param {Array} partials The arguments to prepend to those provided to the new function.
+ * @returns {Function} Returns the new bound function.
+ */
+function createPartialWrapper(func, bitmask, thisArg, partials) {
+ var isBind = bitmask & BIND_FLAG,
+ Ctor = createCtorWrapper(func);
+
+ function wrapper() {
+ // Avoid `arguments` object use disqualifying optimizations by
+ // converting it to an array before providing it `func`.
+ var argsIndex = -1,
+ argsLength = arguments.length,
+ leftIndex = -1,
+ leftLength = partials.length,
+ args = Array(leftLength + argsLength);
+
+ while (++leftIndex < leftLength) {
+ args[leftIndex] = partials[leftIndex];
+ }
+ while (argsLength--) {
+ args[leftIndex++] = arguments[++argsIndex];
+ }
+ var fn = (this && this !== global && this instanceof wrapper) ? Ctor : func;
+ return fn.apply(isBind ? thisArg : this, args);
+ }
+ return wrapper;
+}
+
+module.exports = createPartialWrapper;
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+//# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9sb2Rhc2gtY29tcGF0L2ludGVybmFsL2NyZWF0ZVBhcnRpYWxXcmFwcGVyLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwiZmlsZSI6ImdlbmVyYXRlZC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgY3JlYXRlQ3RvcldyYXBwZXIgPSByZXF1aXJlKCcuL2NyZWF0ZUN0b3JXcmFwcGVyJyk7XG5cbi8qKiBVc2VkIHRvIGNvbXBvc2UgYml0bWFza3MgZm9yIHdyYXBwZXIgbWV0YWRhdGEuICovXG52YXIgQklORF9GTEFHID0gMTtcblxuLyoqXG4gKiBDcmVhdGVzIGEgZnVuY3Rpb24gdGhhdCB3cmFwcyBgZnVuY2AgYW5kIGludm9rZXMgaXQgd2l0aCB0aGUgb3B0aW9uYWwgYHRoaXNgXG4gKiBiaW5kaW5nIG9mIGB0aGlzQXJ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AgYXJnc0xlbmd0aCA9IGFyZ3VtZW50cy5sZW5ndGgsXG4gICAgICAgIGxlZnRJbmRleCA9IC0xLFxuICAgICAgICBsZWZ0TGVuZ3RoID0gcGFydGlhbHMubGVuZ3RoLFxuICAgICAgICBhcmdzID0gQXJyYXkobGVmdExlbmd0aCArIGFyZ3NMZW5ndGgpO1xuXG4gICAgd2hpbGUgKCsrbGVmdEluZGV4IDwgbGVmdExlbmd0aCkge1xuICAgICAgYXJnc1tsZWZ0SW5kZXhdID0gcGFydGlhbHNbbGVmdEluZGV4XTtcbiAgICB9XG4gICAgd2hpbGUgKGFyZ3NMZW5ndGgtLSkge1xuICAgICAgYXJnc1tsZWZ0SW5kZXgrK10gPSBhcmd1bWVudHNbKythcmdzSW5kZXhdO1xuICAgIH1cbiAgICB2YXIgZm4gPSAodGhpcyAmJiB0aGlzICE9PSBnbG9iYWwgJiYgdGhpcyBpbnN0YW5jZW9mIHdyYXBwZXIpID8gQ3RvciA6IGZ1bmM7XG4gICAgcmV0dXJuIGZuLmFwcGx5KGlzQmluZCA/IHRoaXNBcmcgOiB0aGlzLCBhcmdzKTtcbiAgfVxuICByZXR1cm4gd3JhcHBlcjtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBjcmVhdGVQYXJ0aWFsV3JhcHBlcjtcbiJdfQ==
+},{"./createCtorWrapper":104}],109:[function(require,module,exports){
+var baseSetData = require('./baseSetData'),
+ createBindWrapper = require('./createBindWrapper'),
+ createHybridWrapper = require('./createHybridWrapper'),
+ createPartialWrapper = require('./createPartialWrapper'),
+ getData = require('./getData'),
+ mergeData = require('./mergeData'),
+ setData = require('./setData');
+
+/** Used to compose bitmasks for wrapper metadata. */
+var BIND_FLAG = 1,
+ BIND_KEY_FLAG = 2,
+ PARTIAL_FLAG = 32,
+ PARTIAL_RIGHT_FLAG = 64;
+
+/** Used as the `TypeError` message for "Functions" methods. */
+var FUNC_ERROR_TEXT = 'Expected a function';
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * Creates a function that either curries or invokes `func` with optional
+ * `this` binding and partially applied arguments.
+ *
+ * @private
+ * @param {Function|string} func The function or method name to reference.
+ * @param {number} bitmask The bitmask of flags.
+ * The bitmask may be composed of the following flags:
+ * 1 - `_.bind`
+ * 2 - `_.bindKey`
+ * 4 - `_.curry` or `_.curryRight` of a bound function
+ * 8 - `_.curry`
+ * 16 - `_.curryRight`
+ * 32 - `_.partial`
+ * 64 - `_.partialRight`
+ * 128 - `_.rearg`
+ * 256 - `_.ary`
+ * @param {*} [thisArg] The `this` binding of `func`.
+ * @param {Array} [partials] The arguments to be partially applied.
+ * @param {Array} [holders] The `partials` placeholder indexes.
+ * @param {Array} [argPos] The argument positions of the new function.
+ * @param {number} [ary] The arity cap of `func`.
+ * @param {number} [arity] The arity of `func`.
+ * @returns {Function} Returns the new wrapped function.
+ */
+function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
+ var isBindKey = bitmask & BIND_KEY_FLAG;
+ if (!isBindKey && typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ var length = partials ? partials.length : 0;
+ if (!length) {
+ bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG);
+ partials = holders = undefined;
+ }
+ length -= (holders ? holders.length : 0);
+ if (bitmask & PARTIAL_RIGHT_FLAG) {
+ var partialsRight = partials,
+ holdersRight = holders;
+
+ partials = holders = undefined;
+ }
+ var data = isBindKey ? undefined : getData(func),
+ newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity];
+
+ if (data) {
+ mergeData(newData, data);
+ bitmask = newData[1];
+ arity = newData[9];
+ }
+ newData[9] = arity == null
+ ? (isBindKey ? 0 : func.length)
+ : (nativeMax(arity - length, 0) || 0);
+
+ if (bitmask == BIND_FLAG) {
+ var result = createBindWrapper(newData[0], newData[2]);
+ } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !newData[4].length) {
+ result = createPartialWrapper.apply(undefined, newData);
+ } else {
+ result = createHybridWrapper.apply(undefined, newData);
+ }
+ var setter = data ? baseSetData : setData;
+ return setter(result, newData);
+}
+
+module.exports = createWrapper;
+
+},{"./baseSetData":91,"./createBindWrapper":103,"./createHybridWrapper":107,"./createPartialWrapper":108,"./getData":113,"./mergeData":131,"./setData":136}],110:[function(require,module,exports){
+var arraySome = require('./arraySome');
+
+/**
+ * A specialized version of `baseIsEqualDeep` for arrays with support for
+ * partial deep comparisons.
+ *
+ * @private
+ * @param {Array} array The array to compare.
+ * @param {Array} other The other array to compare.
+ * @param {Function} equalFunc The function to determine equivalents of values.
+ * @param {Function} [customizer] The function to customize comparing arrays.
+ * @param {boolean} [isLoose] Specify performing partial comparisons.
+ * @param {Array} [stackA] Tracks traversed `value` objects.
+ * @param {Array} [stackB] Tracks traversed `other` objects.
+ * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
+ */
+function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) {
+ var index = -1,
+ arrLength = array.length,
+ othLength = other.length;
+
+ if (arrLength != othLength && !(isLoose && othLength > arrLength)) {
+ return false;
+ }
+ // Ignore non-index properties.
+ while (++index < arrLength) {
+ var arrValue = array[index],
+ othValue = other[index],
+ result = customizer ? customizer(isLoose ? othValue : arrValue, isLoose ? arrValue : othValue, index) : undefined;
+
+ if (result !== undefined) {
+ if (result) {
+ continue;
+ }
+ return false;
+ }
+ // Recursively compare arrays (susceptible to call stack limits).
+ if (isLoose) {
+ if (!arraySome(other, function(othValue) {
+ return arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);
+ })) {
+ return false;
+ }
+ } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB))) {
+ return false;
+ }
+ }
+ return true;
+}
+
+module.exports = equalArrays;
+
+},{"./arraySome":68}],111:[function(require,module,exports){
+/** `Object#toString` result references. */
+var boolTag = '[object Boolean]',
+ dateTag = '[object Date]',
+ errorTag = '[object Error]',
+ numberTag = '[object Number]',
+ regexpTag = '[object RegExp]',
+ stringTag = '[object String]';
+
+/**
+ * A specialized version of `baseIsEqualDeep` for comparing objects of
+ * the same `toStringTag`.
+ *
+ * **Note:** This function only supports comparing values with tags of
+ * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
+ *
+ * @private
+ * @param {Object} object The object to compare.
+ * @param {Object} other The other object to compare.
+ * @param {string} tag The `toStringTag` of the objects to compare.
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+ */
+function equalByTag(object, other, tag) {
+ switch (tag) {
+ case boolTag:
+ case dateTag:
+ // Coerce dates and booleans to numbers, dates to milliseconds and booleans
+ // to `1` or `0` treating invalid dates coerced to `NaN` as not equal.
+ return +object == +other;
+
+ case errorTag:
+ return object.name == other.name && object.message == other.message;
+
+ case numberTag:
+ // Treat `NaN` vs. `NaN` as equal.
+ return (object != +object)
+ ? other != +other
+ : object == +other;
+
+ case regexpTag:
+ case stringTag:
+ // Coerce regexes to strings and treat strings primitives and string
+ // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details.
+ return object == (other + '');
+ }
+ return false;
+}
+
+module.exports = equalByTag;
+
+},{}],112:[function(require,module,exports){
+var keys = require('../object/keys');
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * A specialized version of `baseIsEqualDeep` for objects with support for
+ * partial deep comparisons.
+ *
+ * @private
+ * @param {Object} object The object to compare.
+ * @param {Object} other The other object to compare.
+ * @param {Function} equalFunc The function to determine equivalents of values.
+ * @param {Function} [customizer] The function to customize comparing values.
+ * @param {boolean} [isLoose] Specify performing partial comparisons.
+ * @param {Array} [stackA] Tracks traversed `value` objects.
+ * @param {Array} [stackB] Tracks traversed `other` objects.
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+ */
+function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
+ var objProps = keys(object),
+ objLength = objProps.length,
+ othProps = keys(other),
+ othLength = othProps.length;
+
+ if (objLength != othLength && !isLoose) {
+ return false;
+ }
+ var index = objLength;
+ while (index--) {
+ var key = objProps[index];
+ if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) {
+ return false;
+ }
+ }
+ var skipCtor = isLoose;
+ while (++index < objLength) {
+ key = objProps[index];
+ var objValue = object[key],
+ othValue = other[key],
+ result = customizer ? customizer(isLoose ? othValue : objValue, isLoose? objValue : othValue, key) : undefined;
+
+ // Recursively compare objects (susceptible to call stack limits).
+ if (!(result === undefined ? equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB) : result)) {
+ return false;
+ }
+ skipCtor || (skipCtor = key == 'constructor');
+ }
+ if (!skipCtor) {
+ var objCtor = object.constructor,
+ othCtor = other.constructor;
+
+ // Non `Object` object instances with different constructors are not equal.
+ if (objCtor != othCtor &&
+ ('constructor' in object && 'constructor' in other) &&
+ !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
+ typeof othCtor == 'function' && othCtor instanceof othCtor)) {
+ return false;
+ }
+ }
+ return true;
+}
+
+module.exports = equalObjects;
+
+},{"../object/keys":152}],113:[function(require,module,exports){
+var metaMap = require('./metaMap'),
+ noop = require('../utility/noop');
+
+/**
+ * Gets metadata for `func`.
+ *
+ * @private
+ * @param {Function} func The function to query.
+ * @returns {*} Returns the metadata for `func`.
+ */
+var getData = !metaMap ? noop : function(func) {
+ return metaMap.get(func);
+};
+
+module.exports = getData;
+
+},{"../utility/noop":158,"./metaMap":132}],114:[function(require,module,exports){
+var realNames = require('./realNames');
+
+/**
+ * Gets the name of `func`.
+ *
+ * @private
+ * @param {Function} func The function to query.
+ * @returns {string} Returns the function name.
+ */
+function getFuncName(func) {
+ var result = func.name,
+ array = realNames[result],
+ length = array ? array.length : 0;
+
+ while (length--) {
+ var data = array[length],
+ otherFunc = data.func;
+ if (otherFunc == null || otherFunc == func) {
+ return data.name;
+ }
+ }
+ return result;
+}
+
+module.exports = getFuncName;
+
+},{"./realNames":133}],115:[function(require,module,exports){
+var baseProperty = require('./baseProperty');
+
+/**
+ * Gets the "length" property value of `object`.
+ *
+ * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
+ * that affects Safari on at least iOS 8.1-8.3 ARM64.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {*} Returns the "length" value.
+ */
+var getLength = baseProperty('length');
+
+module.exports = getLength;
+
+},{"./baseProperty":89}],116:[function(require,module,exports){
+var isStrictComparable = require('./isStrictComparable'),
+ pairs = require('../object/pairs');
+
+/**
+ * Gets the propery names, values, and compare flags of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the match data of `object`.
+ */
+function getMatchData(object) {
+ var result = pairs(object),
+ length = result.length;
+
+ while (length--) {
+ result[length][2] = isStrictComparable(result[length][1]);
+ }
+ return result;
+}
+
+module.exports = getMatchData;
+
+},{"../object/pairs":154,"./isStrictComparable":130}],117:[function(require,module,exports){
+var isNative = require('../lang/isNative');
+
+/**
+ * Gets the native function at `key` of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {string} key The key of the method to get.
+ * @returns {*} Returns the function if it's native, else `undefined`.
+ */
+function getNative(object, key) {
+ var value = object == null ? undefined : object[key];
+ return isNative(value) ? value : undefined;
+}
+
+module.exports = getNative;
+
+},{"../lang/isNative":146}],118:[function(require,module,exports){
+/**
+ * Gets the index at which the first occurrence of `NaN` is found in `array`.
+ *
+ * @private
+ * @param {Array} array The array to search.
+ * @param {number} fromIndex The index to search from.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {number} Returns the index of the matched `NaN`, else `-1`.
+ */
+function indexOfNaN(array, fromIndex, fromRight) {
+ var length = array.length,
+ index = fromIndex + (fromRight ? 0 : -1);
+
+ while ((fromRight ? index-- : ++index < length)) {
+ var other = array[index];
+ if (other !== other) {
+ return index;
+ }
+ }
+ return -1;
+}
+
+module.exports = indexOfNaN;
+
+},{}],119:[function(require,module,exports){
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Initializes an array clone.
+ *
+ * @private
+ * @param {Array} array The array to clone.
+ * @returns {Array} Returns the initialized clone.
+ */
+function initCloneArray(array) {
+ var length = array.length,
+ result = new array.constructor(length);
+
+ // Add array properties assigned by `RegExp#exec`.
+ if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
+ result.index = array.index;
+ result.input = array.input;
+ }
+ return result;
+}
+
+module.exports = initCloneArray;
+
+},{}],120:[function(require,module,exports){
+(function (global){
+var bufferClone = require('./bufferClone');
+
+/** `Object#toString` result references. */
+var boolTag = '[object Boolean]',
+ dateTag = '[object Date]',
+ numberTag = '[object Number]',
+ regexpTag = '[object RegExp]',
+ stringTag = '[object String]';
+
+var arrayBufferTag = '[object ArrayBuffer]',
+ float32Tag = '[object Float32Array]',
+ float64Tag = '[object Float64Array]',
+ int8Tag = '[object Int8Array]',
+ int16Tag = '[object Int16Array]',
+ int32Tag = '[object Int32Array]',
+ uint8Tag = '[object Uint8Array]',
+ uint8ClampedTag = '[object Uint8ClampedArray]',
+ uint16Tag = '[object Uint16Array]',
+ uint32Tag = '[object Uint32Array]';
+
+/** Used to match `RegExp` flags from their coerced string values. */
+var reFlags = /\w*$/;
+
+/** Native method references. */
+var Uint8Array = global.Uint8Array;
+
+/** Used to lookup a type array constructors by `toStringTag`. */
+var ctorByTag = {};
+ctorByTag[float32Tag] = global.Float32Array;
+ctorByTag[float64Tag] = global.Float64Array;
+ctorByTag[int8Tag] = global.Int8Array;
+ctorByTag[int16Tag] = global.Int16Array;
+ctorByTag[int32Tag] = global.Int32Array;
+ctorByTag[uint8Tag] = Uint8Array;
+ctorByTag[uint8ClampedTag] = global.Uint8ClampedArray;
+ctorByTag[uint16Tag] = global.Uint16Array;
+ctorByTag[uint32Tag] = global.Uint32Array;
+
+/**
+ * Initializes an object clone based on its `toStringTag`.
+ *
+ * **Note:** This function only supports cloning values with tags of
+ * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
+ *
+ * @private
+ * @param {Object} object The object to clone.
+ * @param {string} tag The `toStringTag` of the object to clone.
+ * @param {boolean} [isDeep] Specify a deep clone.
+ * @returns {Object} Returns the initialized clone.
+ */
+function initCloneByTag(object, tag, isDeep) {
+ var Ctor = object.constructor;
+ switch (tag) {
+ case arrayBufferTag:
+ return bufferClone(object);
+
+ case boolTag:
+ case dateTag:
+ return new Ctor(+object);
+
+ case float32Tag: case float64Tag:
+ case int8Tag: case int16Tag: case int32Tag:
+ case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
+ // Safari 5 mobile incorrectly has `Object` as the constructor of typed arrays.
+ if (Ctor instanceof Ctor) {
+ Ctor = ctorByTag[tag];
+ }
+ var buffer = object.buffer;
+ return new Ctor(isDeep ? bufferClone(buffer) : buffer, object.byteOffset, object.length);
+
+ case numberTag:
+ case stringTag:
+ return new Ctor(object);
+
+ case regexpTag:
+ var result = new Ctor(object.source, reFlags.exec(object));
+ result.lastIndex = object.lastIndex;
+ }
+ return result;
+}
+
+module.exports = initCloneByTag;
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+//# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9sb2Rhc2gtY29tcGF0L2ludGVybmFsL2luaXRDbG9uZUJ5VGFnLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQ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mplY3QpO1xuXG4gICAgY2FzZSBmbG9hdDMyVGFnOiBjYXNlIGZsb2F0NjRUYWc6XG4gICAgY2FzZSBpbnQ4VGFnOiBjYXNlIGludDE2VGFnOiBjYXNlIGludDMyVGFnOlxuICAgIGNhc2UgdWludDhUYWc6IGNhc2UgdWludDhDbGFtcGVkVGFnOiBjYXNlIHVpbnQxNlRhZzogY2FzZSB1aW50MzJUYWc6XG4gICAgICAvLyBTYWZhcmkgNSBtb2JpbGUgaW5jb3JyZWN0bHkgaGFzIGBPYmplY3RgIGFzIHRoZSBjb25zdHJ1Y3RvciBvZiB0eXBlZCBhcnJheXMuXG4gICAgICBpZiAoQ3RvciBpbnN0YW5jZW9mIEN0b3IpIHtcbiAgICAgICAgQ3RvciA9IGN0b3JCeVRhZ1t0YWddO1xuICAgICAgfVxuICAgICAgdmFyIGJ1ZmZlciA9IG9iamVjdC5idWZmZXI7XG4gICAgICByZXR1cm4gbmV3IEN0b3IoaXNEZWVwID8gYnVmZmVyQ2xvbmUoYnVmZmVyKSA6IGJ1ZmZlciwgb2JqZWN0LmJ5dGVPZmZzZXQsIG9iamVjdC5sZW5ndGgpO1xuXG4gICAgY2FzZSBudW1iZXJUYWc6XG4gICAgY2FzZSBzdHJpbmdUYWc6XG4gICAgICByZXR1cm4gbmV3IEN0b3Iob2JqZWN0KTtcblxuICAgIGNhc2UgcmVnZXhwVGFnOlxuICAgICAgdmFyIHJlc3VsdCA9IG5ldyBDdG9yKG9iamVjdC5zb3VyY2UsIHJlRmxhZ3MuZXhlYyhvYmplY3QpKTtcbiAgICAgIHJlc3VsdC5sYXN0SW5kZXggPSBvYmplY3QubGFzdEluZGV4O1xuICB9XG4gIHJldHVybiByZXN1bHQ7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gaW5pdENsb25lQnlUYWc7XG4iXX0=
+},{"./bufferClone":98}],121:[function(require,module,exports){
+/**
+ * Initializes an object clone.
+ *
+ * @private
+ * @param {Object} object The object to clone.
+ * @returns {Object} Returns the initialized clone.
+ */
+function initCloneObject(object) {
+ var Ctor = object.constructor;
+ if (!(typeof Ctor == 'function' && Ctor instanceof Ctor)) {
+ Ctor = Object;
+ }
+ return new Ctor;
+}
+
+module.exports = initCloneObject;
+
+},{}],122:[function(require,module,exports){
+var getLength = require('./getLength'),
+ isLength = require('./isLength');
+
+/**
+ * Checks if `value` is array-like.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
+ */
+function isArrayLike(value) {
+ return value != null && isLength(getLength(value));
+}
+
+module.exports = isArrayLike;
+
+},{"./getLength":115,"./isLength":128}],123:[function(require,module,exports){
+/**
+ * Checks if `value` is a host object in IE < 9.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
+ */
+var isHostObject = (function() {
+ try {
+ Object({ 'toString': 0 } + '');
+ } catch(e) {
+ return function() { return false; };
+ }
+ return function(value) {
+ // IE < 9 presents many host objects as `Object` objects that can coerce
+ // to strings despite having improperly defined `toString` methods.
+ return typeof value.toString != 'function' && typeof (value + '') == 'string';
+ };
+}());
+
+module.exports = isHostObject;
+
+},{}],124:[function(require,module,exports){
+/** Used to detect unsigned integer values. */
+var reIsUint = /^\d+$/;
+
+/**
+ * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
+ * of an array-like value.
+ */
+var MAX_SAFE_INTEGER = 9007199254740991;
+
+/**
+ * Checks if `value` is a valid array-like index.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
+ */
+function isIndex(value, length) {
+ value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
+ length = length == null ? MAX_SAFE_INTEGER : length;
+ return value > -1 && value % 1 == 0 && value < length;
+}
+
+module.exports = isIndex;
+
+},{}],125:[function(require,module,exports){
+var isArrayLike = require('./isArrayLike'),
+ isIndex = require('./isIndex'),
+ isObject = require('../lang/isObject');
+
+/**
+ * Checks if the provided arguments are from an iteratee call.
+ *
+ * @private
+ * @param {*} value The potential iteratee value argument.
+ * @param {*} index The potential iteratee index or key argument.
+ * @param {*} object The potential iteratee object argument.
+ * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.
+ */
+function isIterateeCall(value, index, object) {
+ if (!isObject(object)) {
+ return false;
+ }
+ var type = typeof index;
+ if (type == 'number'
+ ? (isArrayLike(object) && isIndex(index, object.length))
+ : (type == 'string' && index in object)) {
+ var other = object[index];
+ return value === value ? (value === other) : (other !== other);
+ }
+ return false;
+}
+
+module.exports = isIterateeCall;
+
+},{"../lang/isObject":147,"./isArrayLike":122,"./isIndex":124}],126:[function(require,module,exports){
+var isArray = require('../lang/isArray'),
+ toObject = require('./toObject');
+
+/** Used to match property names within property paths. */
+var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,
+ reIsPlainProp = /^\w*$/;
+
+/**
+ * Checks if `value` is a property name and not a property path.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @param {Object} [object] The object to query keys on.
+ * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
+ */
+function isKey(value, object) {
+ var type = typeof value;
+ if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') {
+ return true;
+ }
+ if (isArray(value)) {
+ return false;
+ }
+ var result = !reIsDeepProp.test(value);
+ return result || (object != null && value in toObject(object));
+}
+
+module.exports = isKey;
+
+},{"../lang/isArray":143,"./toObject":138}],127:[function(require,module,exports){
+var LazyWrapper = require('./LazyWrapper'),
+ getData = require('./getData'),
+ getFuncName = require('./getFuncName'),
+ lodash = require('../chain/lodash');
+
+/**
+ * Checks if `func` has a lazy counterpart.
+ *
+ * @private
+ * @param {Function} func The function to check.
+ * @returns {boolean} Returns `true` if `func` has a lazy counterpart, else `false`.
+ */
+function isLaziable(func) {
+ var funcName = getFuncName(func);
+ if (!(funcName in LazyWrapper.prototype)) {
+ return false;
+ }
+ var other = lodash[funcName];
+ if (func === other) {
+ return true;
+ }
+ var data = getData(other);
+ return !!data && func === data[0];
+}
+
+module.exports = isLaziable;
+
+},{"../chain/lodash":54,"./LazyWrapper":63,"./getData":113,"./getFuncName":114}],128:[function(require,module,exports){
+/**
+ * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
+ * of an array-like value.
+ */
+var MAX_SAFE_INTEGER = 9007199254740991;
+
+/**
+ * Checks if `value` is a valid array-like length.
+ *
+ * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
+ */
+function isLength(value) {
+ return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
+}
+
+module.exports = isLength;
+
+},{}],129:[function(require,module,exports){
+/**
+ * Checks if `value` is object-like.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
+ */
+function isObjectLike(value) {
+ return !!value && typeof value == 'object';
+}
+
+module.exports = isObjectLike;
+
+},{}],130:[function(require,module,exports){
+var isObject = require('../lang/isObject');
+
+/**
+ * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` if suitable for strict
+ * equality comparisons, else `false`.
+ */
+function isStrictComparable(value) {
+ return value === value && !isObject(value);
+}
+
+module.exports = isStrictComparable;
+
+},{"../lang/isObject":147}],131:[function(require,module,exports){
+var arrayCopy = require('./arrayCopy'),
+ composeArgs = require('./composeArgs'),
+ composeArgsRight = require('./composeArgsRight'),
+ replaceHolders = require('./replaceHolders');
+
+/** Used to compose bitmasks for wrapper metadata. */
+var BIND_FLAG = 1,
+ CURRY_BOUND_FLAG = 4,
+ CURRY_FLAG = 8,
+ ARY_FLAG = 128,
+ REARG_FLAG = 256;
+
+/** Used as the internal argument placeholder. */
+var PLACEHOLDER = '__lodash_placeholder__';
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMin = Math.min;
+
+/**
+ * Merges the function metadata of `source` into `data`.
+ *
+ * Merging metadata reduces the number of wrappers required to invoke a function.
+ * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
+ * may be applied regardless of execution order. Methods like `_.ary` and `_.rearg`
+ * augment function arguments, making the order in which they are executed important,
+ * preventing the merging of metadata. However, we make an exception for a safe
+ * common case where curried functions have `_.ary` and or `_.rearg` applied.
+ *
+ * @private
+ * @param {Array} data The destination metadata.
+ * @param {Array} source The source metadata.
+ * @returns {Array} Returns `data`.
+ */
+function mergeData(data, source) {
+ var bitmask = data[1],
+ srcBitmask = source[1],
+ newBitmask = bitmask | srcBitmask,
+ isCommon = newBitmask < ARY_FLAG;
+
+ var isCombo =
+ (srcBitmask == ARY_FLAG && bitmask == CURRY_FLAG) ||
+ (srcBitmask == ARY_FLAG && bitmask == REARG_FLAG && data[7].length <= source[8]) ||
+ (srcBitmask == (ARY_FLAG | REARG_FLAG) && bitmask == CURRY_FLAG);
+
+ // Exit early if metadata can't be merged.
+ if (!(isCommon || isCombo)) {
+ return data;
+ }
+ // Use source `thisArg` if available.
+ if (srcBitmask & BIND_FLAG) {
+ data[2] = source[2];
+ // Set when currying a bound function.
+ newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG;
+ }
+ // Compose partial arguments.
+ var value = source[3];
+ if (value) {
+ var partials = data[3];
+ data[3] = partials ? composeArgs(partials, value, source[4]) : arrayCopy(value);
+ data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : arrayCopy(source[4]);
+ }
+ // Compose partial right arguments.
+ value = source[5];
+ if (value) {
+ partials = data[5];
+ data[5] = partials ? composeArgsRight(partials, value, source[6]) : arrayCopy(value);
+ data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : arrayCopy(source[6]);
+ }
+ // Use source `argPos` if available.
+ value = source[7];
+ if (value) {
+ data[7] = arrayCopy(value);
+ }
+ // Use source `ary` if it's smaller.
+ if (srcBitmask & ARY_FLAG) {
+ data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
+ }
+ // Use source `arity` if one is not provided.
+ if (data[9] == null) {
+ data[9] = source[9];
+ }
+ // Use source `func` and merge bitmasks.
+ data[0] = source[0];
+ data[1] = newBitmask;
+
+ return data;
+}
+
+module.exports = mergeData;
+
+},{"./arrayCopy":65,"./composeArgs":99,"./composeArgsRight":100,"./replaceHolders":135}],132:[function(require,module,exports){
+(function (global){
+var getNative = require('./getNative');
+
+/** Native method references. */
+var WeakMap = getNative(global, 'WeakMap');
+
+/** Used to store function metadata. */
+var metaMap = WeakMap && new WeakMap;
+
+module.exports = metaMap;
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+//# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9sb2Rhc2gtY29tcGF0L2ludGVybmFsL21ldGFNYXAuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwiZmlsZSI6ImdlbmVyYXRlZC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgZ2V0TmF0aXZlID0gcmVxdWlyZSgnLi9nZXROYXRpdmUnKTtcblxuLyoqIE5hdGl2ZSBtZXRob2QgcmVmZXJlbmNlcy4gKi9cbnZhciBXZWFrTWFwID0gZ2V0TmF0aXZlKGdsb2JhbCwgJ1dlYWtNYXAnKTtcblxuLyoqIFVzZWQgdG8gc3RvcmUgZnVuY3Rpb24gbWV0YWRhdGEuICovXG52YXIgbWV0YU1hcCA9IFdlYWtNYXAgJiYgbmV3IFdlYWtNYXA7XG5cbm1vZHVsZS5leHBvcnRzID0gbWV0YU1hcDtcbiJdfQ==
+},{"./getNative":117}],133:[function(require,module,exports){
+/** Used to lookup unminified function names. */
+var realNames = {};
+
+module.exports = realNames;
+
+},{}],134:[function(require,module,exports){
+var arrayCopy = require('./arrayCopy'),
+ isIndex = require('./isIndex');
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMin = Math.min;
+
+/**
+ * Reorder `array` according to the specified indexes where the element at
+ * the first index is assigned as the first element, the element at
+ * the second index is assigned as the second element, and so on.
+ *
+ * @private
+ * @param {Array} array The array to reorder.
+ * @param {Array} indexes The arranged array indexes.
+ * @returns {Array} Returns `array`.
+ */
+function reorder(array, indexes) {
+ var arrLength = array.length,
+ length = nativeMin(indexes.length, arrLength),
+ oldArray = arrayCopy(array);
+
+ while (length--) {
+ var index = indexes[length];
+ array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
+ }
+ return array;
+}
+
+module.exports = reorder;
+
+},{"./arrayCopy":65,"./isIndex":124}],135:[function(require,module,exports){
+/** Used as the internal argument placeholder. */
+var PLACEHOLDER = '__lodash_placeholder__';
+
+/**
+ * Replaces all `placeholder` elements in `array` with an internal placeholder
+ * and returns an array of their indexes.
+ *
+ * @private
+ * @param {Array} array The array to modify.
+ * @param {*} placeholder The placeholder to replace.
+ * @returns {Array} Returns the new array of placeholder indexes.
+ */
+function replaceHolders(array, placeholder) {
+ var index = -1,
+ length = array.length,
+ resIndex = -1,
+ result = [];
+
+ while (++index < length) {
+ if (array[index] === placeholder) {
+ array[index] = PLACEHOLDER;
+ result[++resIndex] = index;
+ }
+ }
+ return result;
+}
+
+module.exports = replaceHolders;
+
+},{}],136:[function(require,module,exports){
+var baseSetData = require('./baseSetData'),
+ now = require('../date/now');
+
+/** Used to detect when a function becomes hot. */
+var HOT_COUNT = 150,
+ HOT_SPAN = 16;
+
+/**
+ * Sets metadata for `func`.
+ *
+ * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
+ * period of time, it will trip its breaker and transition to an identity function
+ * to avoid garbage collection pauses in V8. See [V8 issue 2070](https://code.google.com/p/v8/issues/detail?id=2070)
+ * for more details.
+ *
+ * @private
+ * @param {Function} func The function to associate metadata with.
+ * @param {*} data The metadata.
+ * @returns {Function} Returns `func`.
+ */
+var setData = (function() {
+ var count = 0,
+ lastCalled = 0;
+
+ return function(key, value) {
+ var stamp = now(),
+ remaining = HOT_SPAN - (stamp - lastCalled);
+
+ lastCalled = stamp;
+ if (remaining > 0) {
+ if (++count >= HOT_COUNT) {
+ return key;
+ }
+ } else {
+ count = 0;
+ }
+ return baseSetData(key, value);
+ };
+}());
+
+module.exports = setData;
+
+},{"../date/now":60,"./baseSetData":91}],137:[function(require,module,exports){
+var isArguments = require('../lang/isArguments'),
+ isArray = require('../lang/isArray'),
+ isIndex = require('./isIndex'),
+ isLength = require('./isLength'),
+ isString = require('../lang/isString'),
+ keysIn = require('../object/keysIn');
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * A fallback implementation of `Object.keys` which creates an array of the
+ * own enumerable property names of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ */
+function shimKeys(object) {
+ var props = keysIn(object),
+ propsLength = props.length,
+ length = propsLength && object.length;
+
+ var allowIndexes = !!length && isLength(length) &&
+ (isArray(object) || isArguments(object) || isString(object));
+
+ var index = -1,
+ result = [];
+
+ while (++index < propsLength) {
+ var key = props[index];
+ if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {
+ result.push(key);
+ }
+ }
+ return result;
+}
+
+module.exports = shimKeys;
+
+},{"../lang/isArguments":142,"../lang/isArray":143,"../lang/isString":149,"../object/keysIn":153,"./isIndex":124,"./isLength":128}],138:[function(require,module,exports){
+var isObject = require('../lang/isObject'),
+ isString = require('../lang/isString'),
+ support = require('../support');
+
+/**
+ * Converts `value` to an object if it's not one.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {Object} Returns the object.
+ */
+function toObject(value) {
+ if (support.unindexedChars && isString(value)) {
+ var index = -1,
+ length = value.length,
+ result = Object(value);
+
+ while (++index < length) {
+ result[index] = value.charAt(index);
+ }
+ return result;
+ }
+ return isObject(value) ? value : Object(value);
+}
+
+module.exports = toObject;
+
+},{"../lang/isObject":147,"../lang/isString":149,"../support":156}],139:[function(require,module,exports){
+var baseToString = require('./baseToString'),
+ isArray = require('../lang/isArray');
+
+/** Used to match property names within property paths. */
+var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g;
+
+/** Used to match backslashes in property paths. */
+var reEscapeChar = /\\(\\)?/g;
+
+/**
+ * Converts `value` to property path array if it's not one.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {Array} Returns the property path array.
+ */
+function toPath(value) {
+ if (isArray(value)) {
+ return value;
+ }
+ var result = [];
+ baseToString(value).replace(rePropName, function(match, number, quote, string) {
+ result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
+ });
+ return result;
+}
+
+module.exports = toPath;
+
+},{"../lang/isArray":143,"./baseToString":93}],140:[function(require,module,exports){
+var LazyWrapper = require('./LazyWrapper'),
+ LodashWrapper = require('./LodashWrapper'),
+ arrayCopy = require('./arrayCopy');
+
+/**
+ * Creates a clone of `wrapper`.
+ *
+ * @private
+ * @param {Object} wrapper The wrapper to clone.
+ * @returns {Object} Returns the cloned wrapper.
+ */
+function wrapperClone(wrapper) {
+ return wrapper instanceof LazyWrapper
+ ? wrapper.clone()
+ : new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__, arrayCopy(wrapper.__actions__));
+}
+
+module.exports = wrapperClone;
+
+},{"./LazyWrapper":63,"./LodashWrapper":64,"./arrayCopy":65}],141:[function(require,module,exports){
+var baseClone = require('../internal/baseClone'),
+ bindCallback = require('../internal/bindCallback');
+
+/**
+ * Creates a deep clone of `value`. If `customizer` is provided it is invoked
+ * to produce the cloned values. If `customizer` returns `undefined` cloning
+ * is handled by the method instead. The `customizer` is bound to `thisArg`
+ * and invoked with two argument; (value [, index|key, object]).
+ *
+ * **Note:** This method is loosely based on the
+ * [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm).
+ * The enumerable properties of `arguments` objects and objects created by
+ * constructors other than `Object` are cloned to plain `Object` objects. An
+ * empty object is returned for uncloneable values such as functions, DOM nodes,
+ * Maps, Sets, and WeakMaps.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to deep clone.
+ * @param {Function} [customizer] The function to customize cloning values.
+ * @param {*} [thisArg] The `this` binding of `customizer`.
+ * @returns {*} Returns the deep cloned value.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney' },
+ * { 'user': 'fred' }
+ * ];
+ *
+ * var deep = _.cloneDeep(users);
+ * deep[0] === users[0];
+ * // => false
+ *
+ * // using a customizer callback
+ * var el = _.cloneDeep(document.body, function(value) {
+ * if (_.isElement(value)) {
+ * return value.cloneNode(true);
+ * }
+ * });
+ *
+ * el === document.body
+ * // => false
+ * el.nodeName
+ * // => BODY
+ * el.childNodes.length;
+ * // => 20
+ */
+function cloneDeep(value, customizer, thisArg) {
+ return typeof customizer == 'function'
+ ? baseClone(value, true, bindCallback(customizer, thisArg, 1))
+ : baseClone(value, true);
+}
+
+module.exports = cloneDeep;
+
+},{"../internal/baseClone":71,"../internal/bindCallback":97}],142:[function(require,module,exports){
+var isArrayLike = require('../internal/isArrayLike'),
+ isObjectLike = require('../internal/isObjectLike');
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/** Native method references. */
+var propertyIsEnumerable = objectProto.propertyIsEnumerable;
+
+/**
+ * Checks if `value` is classified as an `arguments` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isArguments(function() { return arguments; }());
+ * // => true
+ *
+ * _.isArguments([1, 2, 3]);
+ * // => false
+ */
+function isArguments(value) {
+ return isObjectLike(value) && isArrayLike(value) &&
+ hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
+}
+
+module.exports = isArguments;
+
+},{"../internal/isArrayLike":122,"../internal/isObjectLike":129}],143:[function(require,module,exports){
+var getNative = require('../internal/getNative'),
+ isLength = require('../internal/isLength'),
+ isObjectLike = require('../internal/isObjectLike');
+
+/** `Object#toString` result references. */
+var arrayTag = '[object Array]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeIsArray = getNative(Array, 'isArray');
+
+/**
+ * Checks if `value` is classified as an `Array` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isArray([1, 2, 3]);
+ * // => true
+ *
+ * _.isArray(function() { return arguments; }());
+ * // => false
+ */
+var isArray = nativeIsArray || function(value) {
+ return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;
+};
+
+module.exports = isArray;
+
+},{"../internal/getNative":117,"../internal/isLength":128,"../internal/isObjectLike":129}],144:[function(require,module,exports){
+var isArguments = require('./isArguments'),
+ isArray = require('./isArray'),
+ isArrayLike = require('../internal/isArrayLike'),
+ isFunction = require('./isFunction'),
+ isObjectLike = require('../internal/isObjectLike'),
+ isString = require('./isString'),
+ keys = require('../object/keys');
+
+/**
+ * Checks if `value` is empty. A value is considered empty unless it is an
+ * `arguments` object, array, string, or jQuery-like collection with a length
+ * greater than `0` or an object with own enumerable properties.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {Array|Object|string} value The value to inspect.
+ * @returns {boolean} Returns `true` if `value` is empty, else `false`.
+ * @example
+ *
+ * _.isEmpty(null);
+ * // => true
+ *
+ * _.isEmpty(true);
+ * // => true
+ *
+ * _.isEmpty(1);
+ * // => true
+ *
+ * _.isEmpty([1, 2, 3]);
+ * // => false
+ *
+ * _.isEmpty({ 'a': 1 });
+ * // => false
+ */
+function isEmpty(value) {
+ if (value == null) {
+ return true;
+ }
+ if (isArrayLike(value) && (isArray(value) || isString(value) || isArguments(value) ||
+ (isObjectLike(value) && isFunction(value.splice)))) {
+ return !value.length;
+ }
+ return !keys(value).length;
+}
+
+module.exports = isEmpty;
+
+},{"../internal/isArrayLike":122,"../internal/isObjectLike":129,"../object/keys":152,"./isArguments":142,"./isArray":143,"./isFunction":145,"./isString":149}],145:[function(require,module,exports){
+var isObject = require('./isObject');
+
+/** `Object#toString` result references. */
+var funcTag = '[object Function]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * Checks if `value` is classified as a `Function` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isFunction(_);
+ * // => true
+ *
+ * _.isFunction(/abc/);
+ * // => false
+ */
+function isFunction(value) {
+ // The use of `Object#toString` avoids issues with the `typeof` operator
+ // in older versions of Chrome and Safari which return 'function' for regexes
+ // and Safari 8 equivalents which return 'object' for typed array constructors.
+ return isObject(value) && objToString.call(value) == funcTag;
+}
+
+module.exports = isFunction;
+
+},{"./isObject":147}],146:[function(require,module,exports){
+var isFunction = require('./isFunction'),
+ isHostObject = require('../internal/isHostObject'),
+ isObjectLike = require('../internal/isObjectLike');
+
+/** Used to detect host constructors (Safari > 5). */
+var reIsHostCtor = /^\[object .+?Constructor\]$/;
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to resolve the decompiled source of functions. */
+var fnToString = Function.prototype.toString;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/** Used to detect if a method is native. */
+var reIsNative = RegExp('^' +
+ fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
+);
+
+/**
+ * Checks if `value` is a native function.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a native function, else `false`.
+ * @example
+ *
+ * _.isNative(Array.prototype.push);
+ * // => true
+ *
+ * _.isNative(_);
+ * // => false
+ */
+function isNative(value) {
+ if (value == null) {
+ return false;
+ }
+ if (isFunction(value)) {
+ return reIsNative.test(fnToString.call(value));
+ }
+ return isObjectLike(value) && (isHostObject(value) ? reIsNative : reIsHostCtor).test(value);
+}
+
+module.exports = isNative;
+
+},{"../internal/isHostObject":123,"../internal/isObjectLike":129,"./isFunction":145}],147:[function(require,module,exports){
+/**
+ * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
+ * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
+ * @example
+ *
+ * _.isObject({});
+ * // => true
+ *
+ * _.isObject([1, 2, 3]);
+ * // => true
+ *
+ * _.isObject(1);
+ * // => false
+ */
+function isObject(value) {
+ // Avoid a V8 JIT bug in Chrome 19-20.
+ // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
+ var type = typeof value;
+ return !!value && (type == 'object' || type == 'function');
+}
+
+module.exports = isObject;
+
+},{}],148:[function(require,module,exports){
+var baseForIn = require('../internal/baseForIn'),
+ isArguments = require('./isArguments'),
+ isHostObject = require('../internal/isHostObject'),
+ isObjectLike = require('../internal/isObjectLike'),
+ support = require('../support');
+
+/** `Object#toString` result references. */
+var objectTag = '[object Object]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * Checks if `value` is a plain object, that is, an object created by the
+ * `Object` constructor or one with a `[[Prototype]]` of `null`.
+ *
+ * **Note:** This method assumes objects created by the `Object` constructor
+ * have no inherited enumerable properties.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * }
+ *
+ * _.isPlainObject(new Foo);
+ * // => false
+ *
+ * _.isPlainObject([1, 2, 3]);
+ * // => false
+ *
+ * _.isPlainObject({ 'x': 0, 'y': 0 });
+ * // => true
+ *
+ * _.isPlainObject(Object.create(null));
+ * // => true
+ */
+function isPlainObject(value) {
+ var Ctor;
+
+ // Exit early for non `Object` objects.
+ if (!(isObjectLike(value) && objToString.call(value) == objectTag && !isHostObject(value) && !isArguments(value)) ||
+ (!hasOwnProperty.call(value, 'constructor') && (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) {
+ return false;
+ }
+ // IE < 9 iterates inherited properties before own properties. If the first
+ // iterated property is an object's own property then there are no inherited
+ // enumerable properties.
+ var result;
+ if (support.ownLast) {
+ baseForIn(value, function(subValue, key, object) {
+ result = hasOwnProperty.call(object, key);
+ return false;
+ });
+ return result !== false;
+ }
+ // In most environments an object's own properties are iterated before
+ // its inherited properties. If the last iterated property is an object's
+ // own property then there are no inherited enumerable properties.
+ baseForIn(value, function(subValue, key) {
+ result = key;
+ });
+ return result === undefined || hasOwnProperty.call(value, result);
+}
+
+module.exports = isPlainObject;
+
+},{"../internal/baseForIn":78,"../internal/isHostObject":123,"../internal/isObjectLike":129,"../support":156,"./isArguments":142}],149:[function(require,module,exports){
+var isObjectLike = require('../internal/isObjectLike');
+
+/** `Object#toString` result references. */
+var stringTag = '[object String]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * Checks if `value` is classified as a `String` primitive or object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isString('abc');
+ * // => true
+ *
+ * _.isString(1);
+ * // => false
+ */
+function isString(value) {
+ return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag);
+}
+
+module.exports = isString;
+
+},{"../internal/isObjectLike":129}],150:[function(require,module,exports){
+var isLength = require('../internal/isLength'),
+ isObjectLike = require('../internal/isObjectLike');
+
+/** `Object#toString` result references. */
+var argsTag = '[object Arguments]',
+ arrayTag = '[object Array]',
+ boolTag = '[object Boolean]',
+ dateTag = '[object Date]',
+ errorTag = '[object Error]',
+ funcTag = '[object Function]',
+ mapTag = '[object Map]',
+ numberTag = '[object Number]',
+ objectTag = '[object Object]',
+ regexpTag = '[object RegExp]',
+ setTag = '[object Set]',
+ stringTag = '[object String]',
+ weakMapTag = '[object WeakMap]';
+
+var arrayBufferTag = '[object ArrayBuffer]',
+ float32Tag = '[object Float32Array]',
+ float64Tag = '[object Float64Array]',
+ int8Tag = '[object Int8Array]',
+ int16Tag = '[object Int16Array]',
+ int32Tag = '[object Int32Array]',
+ uint8Tag = '[object Uint8Array]',
+ uint8ClampedTag = '[object Uint8ClampedArray]',
+ uint16Tag = '[object Uint16Array]',
+ uint32Tag = '[object Uint32Array]';
+
+/** Used to identify `toStringTag` values of typed arrays. */
+var typedArrayTags = {};
+typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
+typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
+typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
+typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
+typedArrayTags[uint32Tag] = true;
+typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
+typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
+typedArrayTags[dateTag] = typedArrayTags[errorTag] =
+typedArrayTags[funcTag] = typedArrayTags[mapTag] =
+typedArrayTags[numberTag] = typedArrayTags[objectTag] =
+typedArrayTags[regexpTag] = typedArrayTags[setTag] =
+typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * Checks if `value` is classified as a typed array.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isTypedArray(new Uint8Array);
+ * // => true
+ *
+ * _.isTypedArray([]);
+ * // => false
+ */
+function isTypedArray(value) {
+ return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)];
+}
+
+module.exports = isTypedArray;
+
+},{"../internal/isLength":128,"../internal/isObjectLike":129}],151:[function(require,module,exports){
+/**
+ * Checks if `value` is `undefined`.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
+ * @example
+ *
+ * _.isUndefined(void 0);
+ * // => true
+ *
+ * _.isUndefined(null);
+ * // => false
+ */
+function isUndefined(value) {
+ return value === undefined;
+}
+
+module.exports = isUndefined;
+
+},{}],152:[function(require,module,exports){
+var getNative = require('../internal/getNative'),
+ isArrayLike = require('../internal/isArrayLike'),
+ isObject = require('../lang/isObject'),
+ shimKeys = require('../internal/shimKeys'),
+ support = require('../support');
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeKeys = getNative(Object, 'keys');
+
+/**
+ * Creates an array of the own enumerable property names of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects. See the
+ * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)
+ * for more details.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.keys(new Foo);
+ * // => ['a', 'b'] (iteration order is not guaranteed)
+ *
+ * _.keys('hi');
+ * // => ['0', '1']
+ */
+var keys = !nativeKeys ? shimKeys : function(object) {
+ var Ctor = object == null ? undefined : object.constructor;
+ if ((typeof Ctor == 'function' && Ctor.prototype === object) ||
+ (typeof object == 'function' ? support.enumPrototypes : isArrayLike(object))) {
+ return shimKeys(object);
+ }
+ return isObject(object) ? nativeKeys(object) : [];
+};
+
+module.exports = keys;
+
+},{"../internal/getNative":117,"../internal/isArrayLike":122,"../internal/shimKeys":137,"../lang/isObject":147,"../support":156}],153:[function(require,module,exports){
+var arrayEach = require('../internal/arrayEach'),
+ isArguments = require('../lang/isArguments'),
+ isArray = require('../lang/isArray'),
+ isFunction = require('../lang/isFunction'),
+ isIndex = require('../internal/isIndex'),
+ isLength = require('../internal/isLength'),
+ isObject = require('../lang/isObject'),
+ isString = require('../lang/isString'),
+ support = require('../support');
+
+/** `Object#toString` result references. */
+var arrayTag = '[object Array]',
+ boolTag = '[object Boolean]',
+ dateTag = '[object Date]',
+ errorTag = '[object Error]',
+ funcTag = '[object Function]',
+ numberTag = '[object Number]',
+ objectTag = '[object Object]',
+ regexpTag = '[object RegExp]',
+ stringTag = '[object String]';
+
+/** Used to fix the JScript `[[DontEnum]]` bug. */
+var shadowProps = [
+ 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable',
+ 'toLocaleString', 'toString', 'valueOf'
+];
+
+/** Used for native method references. */
+var errorProto = Error.prototype,
+ objectProto = Object.prototype,
+ stringProto = String.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/** Used to avoid iterating over non-enumerable properties in IE < 9. */
+var nonEnumProps = {};
+nonEnumProps[arrayTag] = nonEnumProps[dateTag] = nonEnumProps[numberTag] = { 'constructor': true, 'toLocaleString': true, 'toString': true, 'valueOf': true };
+nonEnumProps[boolTag] = nonEnumProps[stringTag] = { 'constructor': true, 'toString': true, 'valueOf': true };
+nonEnumProps[errorTag] = nonEnumProps[funcTag] = nonEnumProps[regexpTag] = { 'constructor': true, 'toString': true };
+nonEnumProps[objectTag] = { 'constructor': true };
+
+arrayEach(shadowProps, function(key) {
+ for (var tag in nonEnumProps) {
+ if (hasOwnProperty.call(nonEnumProps, tag)) {
+ var props = nonEnumProps[tag];
+ props[key] = hasOwnProperty.call(props, key);
+ }
+ }
+});
+
+/**
+ * Creates an array of the own and inherited enumerable property names of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.keysIn(new Foo);
+ * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
+ */
+function keysIn(object) {
+ if (object == null) {
+ return [];
+ }
+ if (!isObject(object)) {
+ object = Object(object);
+ }
+ var length = object.length;
+
+ length = (length && isLength(length) &&
+ (isArray(object) || isArguments(object) || isString(object)) && length) || 0;
+
+ var Ctor = object.constructor,
+ index = -1,
+ proto = (isFunction(Ctor) && Ctor.prototype) || objectProto,
+ isProto = proto === object,
+ result = Array(length),
+ skipIndexes = length > 0,
+ skipErrorProps = support.enumErrorProps && (object === errorProto || object instanceof Error),
+ skipProto = support.enumPrototypes && isFunction(object);
+
+ while (++index < length) {
+ result[index] = (index + '');
+ }
+ // lodash skips the `constructor` property when it infers it is iterating
+ // over a `prototype` object because IE < 9 can't set the `[[Enumerable]]`
+ // attribute of an existing property and the `constructor` property of a
+ // prototype defaults to non-enumerable.
+ for (var key in object) {
+ if (!(skipProto && key == 'prototype') &&
+ !(skipErrorProps && (key == 'message' || key == 'name')) &&
+ !(skipIndexes && isIndex(key, length)) &&
+ !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
+ result.push(key);
+ }
+ }
+ if (support.nonEnumShadows && object !== objectProto) {
+ var tag = object === stringProto ? stringTag : (object === errorProto ? errorTag : objToString.call(object)),
+ nonEnums = nonEnumProps[tag] || nonEnumProps[objectTag];
+
+ if (tag == objectTag) {
+ proto = objectProto;
+ }
+ length = shadowProps.length;
+ while (length--) {
+ key = shadowProps[length];
+ var nonEnum = nonEnums[key];
+ if (!(isProto && nonEnum) &&
+ (nonEnum ? hasOwnProperty.call(object, key) : object[key] !== proto[key])) {
+ result.push(key);
+ }
+ }
+ }
+ return result;
+}
+
+module.exports = keysIn;
+
+},{"../internal/arrayEach":66,"../internal/isIndex":124,"../internal/isLength":128,"../lang/isArguments":142,"../lang/isArray":143,"../lang/isFunction":145,"../lang/isObject":147,"../lang/isString":149,"../support":156}],154:[function(require,module,exports){
+var keys = require('./keys'),
+ toObject = require('../internal/toObject');
+
+/**
+ * Creates a two dimensional array of the key-value pairs for `object`,
+ * e.g. `[[key1, value1], [key2, value2]]`.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the new array of key-value pairs.
+ * @example
+ *
+ * _.pairs({ 'barney': 36, 'fred': 40 });
+ * // => [['barney', 36], ['fred', 40]] (iteration order is not guaranteed)
+ */
+function pairs(object) {
+ object = toObject(object);
+
+ var index = -1,
+ props = keys(object),
+ length = props.length,
+ result = Array(length);
+
+ while (++index < length) {
+ var key = props[index];
+ result[index] = [key, object[key]];
+ }
+ return result;
+}
+
+module.exports = pairs;
+
+},{"../internal/toObject":138,"./keys":152}],155:[function(require,module,exports){
+var baseValues = require('../internal/baseValues'),
+ keys = require('./keys');
+
+/**
+ * Creates an array of the own enumerable property values of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property values.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.values(new Foo);
+ * // => [1, 2] (iteration order is not guaranteed)
+ *
+ * _.values('hi');
+ * // => ['h', 'i']
+ */
+function values(object) {
+ return baseValues(object, keys(object));
+}
+
+module.exports = values;
+
+},{"../internal/baseValues":94,"./keys":152}],156:[function(require,module,exports){
+/** Used for native method references. */
+var arrayProto = Array.prototype,
+ errorProto = Error.prototype,
+ objectProto = Object.prototype;
+
+/** Native method references. */
+var propertyIsEnumerable = objectProto.propertyIsEnumerable,
+ splice = arrayProto.splice;
+
+/**
+ * An object environment feature flags.
+ *
+ * @static
+ * @memberOf _
+ * @type Object
+ */
+var support = {};
+
+(function(x) {
+ var Ctor = function() { this.x = x; },
+ object = { '0': x, 'length': x },
+ props = [];
+
+ Ctor.prototype = { 'valueOf': x, 'y': x };
+ for (var key in new Ctor) { props.push(key); }
+
+ /**
+ * Detect if `name` or `message` properties of `Error.prototype` are
+ * enumerable by default (IE < 9, Safari < 5.1).
+ *
+ * @memberOf _.support
+ * @type boolean
+ */
+ support.enumErrorProps = propertyIsEnumerable.call(errorProto, 'message') ||
+ propertyIsEnumerable.call(errorProto, 'name');
+
+ /**
+ * Detect if `prototype` properties are enumerable by default.
+ *
+ * Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1
+ * (if the prototype or a property on the prototype has been set)
+ * incorrectly set the `[[Enumerable]]` value of a function's `prototype`
+ * property to `true`.
+ *
+ * @memberOf _.support
+ * @type boolean
+ */
+ support.enumPrototypes = propertyIsEnumerable.call(Ctor, 'prototype');
+
+ /**
+ * Detect if properties shadowing those on `Object.prototype` are non-enumerable.
+ *
+ * In IE < 9 an object's own properties, shadowing non-enumerable ones,
+ * are made non-enumerable as well (a.k.a the JScript `[[DontEnum]]` bug).
+ *
+ * @memberOf _.support
+ * @type boolean
+ */
+ support.nonEnumShadows = !/valueOf/.test(props);
+
+ /**
+ * Detect if own properties are iterated after inherited properties (IE < 9).
+ *
+ * @memberOf _.support
+ * @type boolean
+ */
+ support.ownLast = props[0] != 'x';
+
+ /**
+ * Detect if `Array#shift` and `Array#splice` augment array-like objects
+ * correctly.
+ *
+ * Firefox < 10, compatibility modes of IE 8, and IE < 9 have buggy Array
+ * `shift()` and `splice()` functions that fail to remove the last element,
+ * `value[0]`, of array-like objects even though the "length" property is
+ * set to `0`. The `shift()` method is buggy in compatibility modes of IE 8,
+ * while `splice()` is buggy regardless of mode in IE < 9.
+ *
+ * @memberOf _.support
+ * @type boolean
+ */
+ support.spliceObjects = (splice.call(object, 0, 1), !object[0]);
+
+ /**
+ * Detect lack of support for accessing string characters by index.
+ *
+ * IE < 8 can't access characters by index. IE 8 can only access characters
+ * by index on string literals, not string objects.
+ *
+ * @memberOf _.support
+ * @type boolean
+ */
+ support.unindexedChars = ('x'[0] + Object('x')[0]) != 'xx';
+}(1, 0));
+
+module.exports = support;
+
+},{}],157:[function(require,module,exports){
+/**
+ * This method returns the first argument provided to it.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {*} value Any value.
+ * @returns {*} Returns `value`.
+ * @example
+ *
+ * var object = { 'user': 'fred' };
+ *
+ * _.identity(object) === object;
+ * // => true
+ */
+function identity(value) {
+ return value;
+}
+
+module.exports = identity;
+
+},{}],158:[function(require,module,exports){
+/**
+ * A no-operation function that returns `undefined` regardless of the
+ * arguments it receives.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @example
+ *
+ * var object = { 'user': 'fred' };
+ *
+ * _.noop(object) === undefined;
+ * // => true
+ */
+function noop() {
+ // No operation performed.
+}
+
+module.exports = noop;
+
+},{}],159:[function(require,module,exports){
+var baseProperty = require('../internal/baseProperty'),
+ basePropertyDeep = require('../internal/basePropertyDeep'),
+ isKey = require('../internal/isKey');
+
+/**
+ * Creates a function that returns the property value at `path` on a
+ * given object.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {Array|string} path The path of the property to get.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var objects = [
+ * { 'a': { 'b': { 'c': 2 } } },
+ * { 'a': { 'b': { 'c': 1 } } }
+ * ];
+ *
+ * _.map(objects, _.property('a.b.c'));
+ * // => [2, 1]
+ *
+ * _.pluck(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c');
+ * // => [1, 2]
+ */
+function property(path) {
+ return isKey(path) ? baseProperty(path) : basePropertyDeep(path);
+}
+
+module.exports = property;
+
+},{"../internal/baseProperty":89,"../internal/basePropertyDeep":90,"../internal/isKey":126}],160:[function(require,module,exports){
+/**
+ * Module dependencies.
+ */
+
+var Emitter = require('emitter');
+var reduce = require('reduce');
+
+/**
+ * Root reference for iframes.
+ */
+
+var root = 'undefined' == typeof window
+ ? (this || self)
+ : window;
+
+/**
+ * Noop.
+ */
+
+function noop(){};
+
+/**
+ * Check if `obj` is a host object,
+ * we don't want to serialize these :)
+ *
+ * TODO: future proof, move to compoent land
+ *
+ * @param {Object} obj
+ * @return {Boolean}
+ * @api private
+ */
+
+function isHost(obj) {
+ var str = {}.toString.call(obj);
+
+ switch (str) {
+ case '[object File]':
+ case '[object Blob]':
+ case '[object FormData]':
+ return true;
+ default:
+ return false;
+ }
+}
+
+/**
+ * Determine XHR.
+ */
+
+request.getXHR = function () {
+ if (root.XMLHttpRequest
+ && (!root.location || 'file:' != root.location.protocol
+ || !root.ActiveXObject)) {
+ return new XMLHttpRequest;
+ } else {
+ try { return new ActiveXObject('Microsoft.XMLHTTP'); } catch(e) {}
+ try { return new ActiveXObject('Msxml2.XMLHTTP.6.0'); } catch(e) {}
+ try { return new ActiveXObject('Msxml2.XMLHTTP.3.0'); } catch(e) {}
+ try { return new ActiveXObject('Msxml2.XMLHTTP'); } catch(e) {}
+ }
+ return false;
+};
+
+/**
+ * Removes leading and trailing whitespace, added to support IE.
+ *
+ * @param {String} s
+ * @return {String}
+ * @api private
+ */
+
+var trim = ''.trim
+ ? function(s) { return s.trim(); }
+ : function(s) { return s.replace(/(^\s*|\s*$)/g, ''); };
+
+/**
+ * Check if `obj` is an object.
+ *
+ * @param {Object} obj
+ * @return {Boolean}
+ * @api private
+ */
+
+function isObject(obj) {
+ return obj === Object(obj);
+}
+
+/**
+ * Serialize the given `obj`.
+ *
+ * @param {Object} obj
+ * @return {String}
+ * @api private
+ */
+
+function serialize(obj) {
+ if (!isObject(obj)) return obj;
+ var pairs = [];
+ for (var key in obj) {
+ if (null != obj[key]) {
+ pairs.push(encodeURIComponent(key)
+ + '=' + encodeURIComponent(obj[key]));
+ }
+ }
+ return pairs.join('&');
+}
+
+/**
+ * Expose serialization method.
+ */
+
+ request.serializeObject = serialize;
+
+ /**
+ * Parse the given x-www-form-urlencoded `str`.
+ *
+ * @param {String} str
+ * @return {Object}
+ * @api private
+ */
+
+function parseString(str) {
+ var obj = {};
+ var pairs = str.split('&');
+ var parts;
+ var pair;
+
+ for (var i = 0, len = pairs.length; i < len; ++i) {
+ pair = pairs[i];
+ parts = pair.split('=');
+ obj[decodeURIComponent(parts[0])] = decodeURIComponent(parts[1]);
+ }
+
+ return obj;
+}
+
+/**
+ * Expose parser.
+ */
+
+request.parseString = parseString;
+
+/**
+ * Default MIME type map.
+ *
+ * superagent.types.xml = 'application/xml';
+ *
+ */
+
+request.types = {
+ html: 'text/html',
+ json: 'application/json',
+ xml: 'application/xml',
+ urlencoded: 'application/x-www-form-urlencoded',
+ 'form': 'application/x-www-form-urlencoded',
+ 'form-data': 'application/x-www-form-urlencoded'
+};
+
+/**
+ * Default serialization map.
+ *
+ * superagent.serialize['application/xml'] = function(obj){
+ * return 'generated xml here';
+ * };
+ *
+ */
+
+ request.serialize = {
+ 'application/x-www-form-urlencoded': serialize,
+ 'application/json': JSON.stringify
+ };
+
+ /**
+ * Default parsers.
+ *
+ * superagent.parse['application/xml'] = function(str){
+ * return { object parsed from str };
+ * };
+ *
+ */
+
+request.parse = {
+ 'application/x-www-form-urlencoded': parseString,
+ 'application/json': JSON.parse
+};
+
+/**
+ * Parse the given header `str` into
+ * an object containing the mapped fields.
+ *
+ * @param {String} str
+ * @return {Object}
+ * @api private
+ */
+
+function parseHeader(str) {
+ var lines = str.split(/\r?\n/);
+ var fields = {};
+ var index;
+ var line;
+ var field;
+ var val;
+
+ lines.pop(); // trailing CRLF
+
+ for (var i = 0, len = lines.length; i < len; ++i) {
+ line = lines[i];
+ index = line.indexOf(':');
+ field = line.slice(0, index).toLowerCase();
+ val = trim(line.slice(index + 1));
+ fields[field] = val;
+ }
+
+ return fields;
+}
+
+/**
+ * Return the mime type for the given `str`.
+ *
+ * @param {String} str
+ * @return {String}
+ * @api private
+ */
+
+function type(str){
+ return str.split(/ *; */).shift();
+};
+
+/**
+ * Return header field parameters.
+ *
+ * @param {String} str
+ * @return {Object}
+ * @api private
+ */
+
+function params(str){
+ return reduce(str.split(/ *; */), function(obj, str){
+ var parts = str.split(/ *= */)
+ , key = parts.shift()
+ , val = parts.shift();
+
+ if (key && val) obj[key] = val;
+ return obj;
+ }, {});
+};
+
+/**
+ * Initialize a new `Response` with the given `xhr`.
+ *
+ * - set flags (.ok, .error, etc)
+ * - parse header
+ *
+ * Examples:
+ *
+ * Aliasing `superagent` as `request` is nice:
+ *
+ * request = superagent;
+ *
+ * We can use the promise-like API, or pass callbacks:
+ *
+ * request.get('/').end(function(res){});
+ * request.get('/', function(res){});
+ *
+ * Sending data can be chained:
+ *
+ * request
+ * .post('/user')
+ * .send({ name: 'tj' })
+ * .end(function(res){});
+ *
+ * Or passed to `.send()`:
+ *
+ * request
+ * .post('/user')
+ * .send({ name: 'tj' }, function(res){});
+ *
+ * Or passed to `.post()`:
+ *
+ * request
+ * .post('/user', { name: 'tj' })
+ * .end(function(res){});
+ *
+ * Or further reduced to a single call for simple cases:
+ *
+ * request
+ * .post('/user', { name: 'tj' }, function(res){});
+ *
+ * @param {XMLHTTPRequest} xhr
+ * @param {Object} options
+ * @api private
+ */
+
+function Response(req, options) {
+ options = options || {};
+ this.req = req;
+ this.xhr = this.req.xhr;
+ // responseText is accessible only if responseType is '' or 'text' and on older browsers
+ this.text = ((this.req.method !='HEAD' && (this.xhr.responseType === '' || this.xhr.responseType === 'text')) || typeof this.xhr.responseType === 'undefined')
+ ? this.xhr.responseText
+ : null;
+ this.statusText = this.req.xhr.statusText;
+ this.setStatusProperties(this.xhr.status);
+ this.header = this.headers = parseHeader(this.xhr.getAllResponseHeaders());
+ // getAllResponseHeaders sometimes falsely returns "" for CORS requests, but
+ // getResponseHeader still works. so we get content-type even if getting
+ // other headers fails.
+ this.header['content-type'] = this.xhr.getResponseHeader('content-type');
+ this.setHeaderProperties(this.header);
+ this.body = this.req.method != 'HEAD'
+ ? this.parseBody(this.text ? this.text : this.xhr.response)
+ : null;
+}
+
+/**
+ * Get case-insensitive `field` value.
+ *
+ * @param {String} field
+ * @return {String}
+ * @api public
+ */
+
+Response.prototype.get = function(field){
+ return this.header[field.toLowerCase()];
+};
+
+/**
+ * Set header related properties:
+ *
+ * - `.type` the content type without params
+ *
+ * A response of "Content-Type: text/plain; charset=utf-8"
+ * will provide you with a `.type` of "text/plain".
+ *
+ * @param {Object} header
+ * @api private
+ */
+
+Response.prototype.setHeaderProperties = function(header){
+ // content-type
+ var ct = this.header['content-type'] || '';
+ this.type = type(ct);
+
+ // params
+ var obj = params(ct);
+ for (var key in obj) this[key] = obj[key];
+};
+
+/**
+ * Parse the given body `str`.
+ *
+ * Used for auto-parsing of bodies. Parsers
+ * are defined on the `superagent.parse` object.
+ *
+ * @param {String} str
+ * @return {Mixed}
+ * @api private
+ */
+
+Response.prototype.parseBody = function(str){
+ var parse = request.parse[this.type];
+ return parse && str && (str.length || str instanceof Object)
+ ? parse(str)
+ : null;
+};
+
+/**
+ * Set flags such as `.ok` based on `status`.
+ *
+ * For example a 2xx response will give you a `.ok` of __true__
+ * whereas 5xx will be __false__ and `.error` will be __true__. The
+ * `.clientError` and `.serverError` are also available to be more
+ * specific, and `.statusType` is the class of error ranging from 1..5
+ * sometimes useful for mapping respond colors etc.
+ *
+ * "sugar" properties are also defined for common cases. Currently providing:
+ *
+ * - .noContent
+ * - .badRequest
+ * - .unauthorized
+ * - .notAcceptable
+ * - .notFound
+ *
+ * @param {Number} status
+ * @api private
+ */
+
+Response.prototype.setStatusProperties = function(status){
+ // handle IE9 bug: http://stackoverflow.com/questions/10046972/msie-returns-status-code-of-1223-for-ajax-request
+ if (status === 1223) {
+ status = 204;
+ }
+
+ var type = status / 100 | 0;
+
+ // status / class
+ this.status = status;
+ this.statusType = type;
+
+ // basics
+ this.info = 1 == type;
+ this.ok = 2 == type;
+ this.clientError = 4 == type;
+ this.serverError = 5 == type;
+ this.error = (4 == type || 5 == type)
+ ? this.toError()
+ : false;
+
+ // sugar
+ this.accepted = 202 == status;
+ this.noContent = 204 == status;
+ this.badRequest = 400 == status;
+ this.unauthorized = 401 == status;
+ this.notAcceptable = 406 == status;
+ this.notFound = 404 == status;
+ this.forbidden = 403 == status;
+};
+
+/**
+ * Return an `Error` representative of this response.
+ *
+ * @return {Error}
+ * @api public
+ */
+
+Response.prototype.toError = function(){
+ var req = this.req;
+ var method = req.method;
+ var url = req.url;
+
+ var msg = 'cannot ' + method + ' ' + url + ' (' + this.status + ')';
+ var err = new Error(msg);
+ err.status = this.status;
+ err.method = method;
+ err.url = url;
+
+ return err;
+};
+
+/**
+ * Expose `Response`.
+ */
+
+request.Response = Response;
+
+/**
+ * Initialize a new `Request` with the given `method` and `url`.
+ *
+ * @param {String} method
+ * @param {String} url
+ * @api public
+ */
+
+function Request(method, url) {
+ var self = this;
+ Emitter.call(this);
+ this._query = this._query || [];
+ this.method = method;
+ this.url = url;
+ this.header = {};
+ this._header = {};
+ this.on('end', function(){
+ var err = null;
+ var res = null;
+
+ try {
+ res = new Response(self);
+ } catch(e) {
+ err = new Error('Parser is unable to parse the response');
+ err.parse = true;
+ err.original = e;
+ return self.callback(err);
+ }
+
+ self.emit('response', res);
+
+ if (err) {
+ return self.callback(err, res);
+ }
+
+ if (res.status >= 200 && res.status < 300) {
+ return self.callback(err, res);
+ }
+
+ var new_err = new Error(res.statusText || 'Unsuccessful HTTP response');
+ new_err.original = err;
+ new_err.response = res;
+ new_err.status = res.status;
+
+ self.callback(err || new_err, res);
+ });
+}
+
+/**
+ * Mixin `Emitter`.
+ */
+
+Emitter(Request.prototype);
+
+/**
+ * Allow for extension
+ */
+
+Request.prototype.use = function(fn) {
+ fn(this);
+ return this;
+}
+
+/**
+ * Set timeout to `ms`.
+ *
+ * @param {Number} ms
+ * @return {Request} for chaining
+ * @api public
+ */
+
+Request.prototype.timeout = function(ms){
+ this._timeout = ms;
+ return this;
+};
+
+/**
+ * Clear previous timeout.
+ *
+ * @return {Request} for chaining
+ * @api public
+ */
+
+Request.prototype.clearTimeout = function(){
+ this._timeout = 0;
+ clearTimeout(this._timer);
+ return this;
+};
+
+/**
+ * Abort the request, and clear potential timeout.
+ *
+ * @return {Request}
+ * @api public
+ */
+
+Request.prototype.abort = function(){
+ if (this.aborted) return;
+ this.aborted = true;
+ this.xhr.abort();
+ this.clearTimeout();
+ this.emit('abort');
+ return this;
+};
+
+/**
+ * Set header `field` to `val`, or multiple fields with one object.
+ *
+ * Examples:
+ *
+ * req.get('/')
+ * .set('Accept', 'application/json')
+ * .set('X-API-Key', 'foobar')
+ * .end(callback);
+ *
+ * req.get('/')
+ * .set({ Accept: 'application/json', 'X-API-Key': 'foobar' })
+ * .end(callback);
+ *
+ * @param {String|Object} field
+ * @param {String} val
+ * @return {Request} for chaining
+ * @api public
+ */
+
+Request.prototype.set = function(field, val){
+ if (isObject(field)) {
+ for (var key in field) {
+ this.set(key, field[key]);
+ }
+ return this;
+ }
+ this._header[field.toLowerCase()] = val;
+ this.header[field] = val;
+ return this;
+};
+
+/**
+ * Remove header `field`.
+ *
+ * Example:
+ *
+ * req.get('/')
+ * .unset('User-Agent')
+ * .end(callback);
+ *
+ * @param {String} field
+ * @return {Request} for chaining
+ * @api public
+ */
+
+Request.prototype.unset = function(field){
+ delete this._header[field.toLowerCase()];
+ delete this.header[field];
+ return this;
+};
+
+/**
+ * Get case-insensitive header `field` value.
+ *
+ * @param {String} field
+ * @return {String}
+ * @api private
+ */
+
+Request.prototype.getHeader = function(field){
+ return this._header[field.toLowerCase()];
+};
+
+/**
+ * Set Content-Type to `type`, mapping values from `request.types`.
+ *
+ * Examples:
+ *
+ * superagent.types.xml = 'application/xml';
+ *
+ * request.post('/')
+ * .type('xml')
+ * .send(xmlstring)
+ * .end(callback);
+ *
+ * request.post('/')
+ * .type('application/xml')
+ * .send(xmlstring)
+ * .end(callback);
+ *
+ * @param {String} type
+ * @return {Request} for chaining
+ * @api public
+ */
+
+Request.prototype.type = function(type){
+ this.set('Content-Type', request.types[type] || type);
+ return this;
+};
+
+/**
+ * Set Accept to `type`, mapping values from `request.types`.
+ *
+ * Examples:
+ *
+ * superagent.types.json = 'application/json';
+ *
+ * request.get('/agent')
+ * .accept('json')
+ * .end(callback);
+ *
+ * request.get('/agent')
+ * .accept('application/json')
+ * .end(callback);
+ *
+ * @param {String} accept
+ * @return {Request} for chaining
+ * @api public
+ */
+
+Request.prototype.accept = function(type){
+ this.set('Accept', request.types[type] || type);
+ return this;
+};
+
+/**
+ * Set Authorization field value with `user` and `pass`.
+ *
+ * @param {String} user
+ * @param {String} pass
+ * @return {Request} for chaining
+ * @api public
+ */
+
+Request.prototype.auth = function(user, pass){
+ var str = btoa(user + ':' + pass);
+ this.set('Authorization', 'Basic ' + str);
+ return this;
+};
+
+/**
+* Add query-string `val`.
+*
+* Examples:
+*
+* request.get('/shoes')
+* .query('size=10')
+* .query({ color: 'blue' })
+*
+* @param {Object|String} val
+* @return {Request} for chaining
+* @api public
+*/
+
+Request.prototype.query = function(val){
+ if ('string' != typeof val) val = serialize(val);
+ if (val) this._query.push(val);
+ return this;
+};
+
+/**
+ * Write the field `name` and `val` for "multipart/form-data"
+ * request bodies.
+ *
+ * ``` js
+ * request.post('/upload')
+ * .field('foo', 'bar')
+ * .end(callback);
+ * ```
+ *
+ * @param {String} name
+ * @param {String|Blob|File} val
+ * @return {Request} for chaining
+ * @api public
+ */
+
+Request.prototype.field = function(name, val){
+ if (!this._formData) this._formData = new root.FormData();
+ this._formData.append(name, val);
+ return this;
+};
+
+/**
+ * Queue the given `file` as an attachment to the specified `field`,
+ * with optional `filename`.
+ *
+ * ``` js
+ * request.post('/upload')
+ * .attach(new Blob(['<a id="a"><b id="b">hey!</b></a>'], { type: "text/html"}))
+ * .end(callback);
+ * ```
+ *
+ * @param {String} field
+ * @param {Blob|File} file
+ * @param {String} filename
+ * @return {Request} for chaining
+ * @api public
+ */
+
+Request.prototype.attach = function(field, file, filename){
+ if (!this._formData) this._formData = new root.FormData();
+ this._formData.append(field, file, filename);
+ return this;
+};
+
+/**
+ * Send `data`, defaulting the `.type()` to "json" when
+ * an object is given.
+ *
+ * Examples:
+ *
+ * // querystring
+ * request.get('/search')
+ * .end(callback)
+ *
+ * // multiple data "writes"
+ * request.get('/search')
+ * .send({ search: 'query' })
+ * .send({ range: '1..5' })
+ * .send({ order: 'desc' })
+ * .end(callback)
+ *
+ * // manual json
+ * request.post('/user')
+ * .type('json')
+ * .send('{"name":"tj"})
+ * .end(callback)
+ *
+ * // auto json
+ * request.post('/user')
+ * .send({ name: 'tj' })
+ * .end(callback)
+ *
+ * // manual x-www-form-urlencoded
+ * request.post('/user')
+ * .type('form')
+ * .send('name=tj')
+ * .end(callback)
+ *
+ * // auto x-www-form-urlencoded
+ * request.post('/user')
+ * .type('form')
+ * .send({ name: 'tj' })
+ * .end(callback)
+ *
+ * // defaults to x-www-form-urlencoded
+ * request.post('/user')
+ * .send('name=tobi')
+ * .send('species=ferret')
+ * .end(callback)
+ *
+ * @param {String|Object} data
+ * @return {Request} for chaining
+ * @api public
+ */
+
+Request.prototype.send = function(data){
+ var obj = isObject(data);
+ var type = this.getHeader('Content-Type');
+
+ // merge
+ if (obj && isObject(this._data)) {
+ for (var key in data) {
+ this._data[key] = data[key];
+ }
+ } else if ('string' == typeof data) {
+ if (!type) this.type('form');
+ type = this.getHeader('Content-Type');
+ if ('application/x-www-form-urlencoded' == type) {
+ this._data = this._data
+ ? this._data + '&' + data
+ : data;
+ } else {
+ this._data = (this._data || '') + data;
+ }
+ } else {
+ this._data = data;
+ }
+
+ if (!obj || isHost(data)) return this;
+ if (!type) this.type('json');
+ return this;
+};
+
+/**
+ * Invoke the callback with `err` and `res`
+ * and handle arity check.
+ *
+ * @param {Error} err
+ * @param {Response} res
+ * @api private
+ */
+
+Request.prototype.callback = function(err, res){
+ var fn = this._callback;
+ this.clearTimeout();
+ fn(err, res);
+};
+
+/**
+ * Invoke callback with x-domain error.
+ *
+ * @api private
+ */
+
+Request.prototype.crossDomainError = function(){
+ var err = new Error('Origin is not allowed by Access-Control-Allow-Origin');
+ err.crossDomain = true;
+ this.callback(err);
+};
+
+/**
+ * Invoke callback with timeout error.
+ *
+ * @api private
+ */
+
+Request.prototype.timeoutError = function(){
+ var timeout = this._timeout;
+ var err = new Error('timeout of ' + timeout + 'ms exceeded');
+ err.timeout = timeout;
+ this.callback(err);
+};
+
+/**
+ * Enable transmission of cookies with x-domain requests.
+ *
+ * Note that for this to work the origin must not be
+ * using "Access-Control-Allow-Origin" with a wildcard,
+ * and also must set "Access-Control-Allow-Credentials"
+ * to "true".
+ *
+ * @api public
+ */
+
+Request.prototype.withCredentials = function(){
+ this._withCredentials = true;
+ return this;
+};
+
+/**
+ * Initiate request, invoking callback `fn(res)`
+ * with an instanceof `Response`.
+ *
+ * @param {Function} fn
+ * @return {Request} for chaining
+ * @api public
+ */
+
+Request.prototype.end = function(fn){
+ var self = this;
+ var xhr = this.xhr = request.getXHR();
+ var query = this._query.join('&');
+ var timeout = this._timeout;
+ var data = this._formData || this._data;
+
+ // store callback
+ this._callback = fn || noop;
+
+ // state change
+ xhr.onreadystatechange = function(){
+ if (4 != xhr.readyState) return;
+
+ // In IE9, reads to any property (e.g. status) off of an aborted XHR will
+ // result in the error "Could not complete the operation due to error c00c023f"
+ var status;
+ try { status = xhr.status } catch(e) { status = 0; }
+
+ if (0 == status) {
+ if (self.timedout) return self.timeoutError();
+ if (self.aborted) return;
+ return self.crossDomainError();
+ }
+ self.emit('end');
+ };
+
+ // progress
+ var handleProgress = function(e){
+ if (e.total > 0) {
+ e.percent = e.loaded / e.total * 100;
+ }
+ self.emit('progress', e);
+ };
+ if (this.hasListeners('progress')) {
+ xhr.onprogress = handleProgress;
+ }
+ try {
+ if (xhr.upload && this.hasListeners('progress')) {
+ xhr.upload.onprogress = handleProgress;
+ }
+ } catch(e) {
+ // Accessing xhr.upload fails in IE from a web worker, so just pretend it doesn't exist.
+ // Reported here:
+ // https://connect.microsoft.com/IE/feedback/details/837245/xmlhttprequest-upload-throws-invalid-argument-when-used-from-web-worker-context
+ }
+
+ // timeout
+ if (timeout && !this._timer) {
+ this._timer = setTimeout(function(){
+ self.timedout = true;
+ self.abort();
+ }, timeout);
+ }
+
+ // querystring
+ if (query) {
+ query = request.serializeObject(query);
+ this.url += ~this.url.indexOf('?')
+ ? '&' + query
+ : '?' + query;
+ }
+
+ // initiate request
+ xhr.open(this.method, this.url, true);
+
+ // CORS
+ if (this._withCredentials) xhr.withCredentials = true;
+
+ // body
+ if ('GET' != this.method && 'HEAD' != this.method && 'string' != typeof data && !isHost(data)) {
+ // serialize stuff
+ var serialize = request.serialize[this.getHeader('Content-Type')];
+ if (serialize) data = serialize(data);
+ }
+
+ // set header fields
+ for (var field in this.header) {
+ if (null == this.header[field]) continue;
+ xhr.setRequestHeader(field, this.header[field]);
+ }
+
+ // send stuff
+ this.emit('request', this);
+ xhr.send(data);
+ return this;
+};
+
+/**
+ * Expose `Request`.
+ */
+
+request.Request = Request;
+
+/**
+ * Issue a request:
+ *
+ * Examples:
+ *
+ * request('GET', '/users').end(callback)
+ * request('/users').end(callback)
+ * request('/users', callback)
+ *
+ * @param {String} method
+ * @param {String|Function} url or callback
+ * @return {Request}
+ * @api public
+ */
+
+function request(method, url) {
+ // callback
+ if ('function' == typeof url) {
+ return new Request('GET', method).end(url);
+ }
+
+ // url first
+ if (1 == arguments.length) {
+ return new Request('GET', method);
+ }
+
+ return new Request(method, url);
+}
+
+/**
+ * GET `url` with optional callback `fn(res)`.
+ *
+ * @param {String} url
+ * @param {Mixed|Function} data or fn
+ * @param {Function} fn
+ * @return {Request}
+ * @api public
+ */
+
+request.get = function(url, data, fn){
+ var req = request('GET', url);
+ if ('function' == typeof data) fn = data, data = null;
+ if (data) req.query(data);
+ if (fn) req.end(fn);
+ return req;
+};
+
+/**
+ * HEAD `url` with optional callback `fn(res)`.
+ *
+ * @param {String} url
+ * @param {Mixed|Function} data or fn
+ * @param {Function} fn
+ * @return {Request}
+ * @api public
+ */
+
+request.head = function(url, data, fn){
+ var req = request('HEAD', url);
+ if ('function' == typeof data) fn = data, data = null;
+ if (data) req.send(data);
+ if (fn) req.end(fn);
+ return req;
+};
+
+/**
+ * DELETE `url` with optional callback `fn(res)`.
+ *
+ * @param {String} url
+ * @param {Function} fn
+ * @return {Request}
+ * @api public
+ */
+
+request.del = function(url, fn){
+ var req = request('DELETE', url);
+ if (fn) req.end(fn);
+ return req;
+};
+
+/**
+ * PATCH `url` with optional `data` and callback `fn(res)`.
+ *
+ * @param {String} url
+ * @param {Mixed} data
+ * @param {Function} fn
+ * @return {Request}
+ * @api public
+ */
+
+request.patch = function(url, data, fn){
+ var req = request('PATCH', url);
+ if ('function' == typeof data) fn = data, data = null;
+ if (data) req.send(data);
+ if (fn) req.end(fn);
+ return req;
+};
+
+/**
+ * POST `url` with optional `data` and callback `fn(res)`.
+ *
+ * @param {String} url
+ * @param {Mixed} data
+ * @param {Function} fn
+ * @return {Request}
+ * @api public
+ */
+
+request.post = function(url, data, fn){
+ var req = request('POST', url);
+ if ('function' == typeof data) fn = data, data = null;
+ if (data) req.send(data);
+ if (fn) req.end(fn);
+ return req;
+};
+
+/**
+ * PUT `url` with optional `data` and callback `fn(res)`.
+ *
+ * @param {String} url
+ * @param {Mixed|Function} data or fn
+ * @param {Function} fn
+ * @return {Request}
+ * @api public
+ */
+
+request.put = function(url, data, fn){
+ var req = request('PUT', url);
+ if ('function' == typeof data) fn = data, data = null;
+ if (data) req.send(data);
+ if (fn) req.end(fn);
+ return req;
+};
+
+/**
+ * Expose `request`.
+ */
+
+module.exports = request;
+
+},{"emitter":161,"reduce":162}],161:[function(require,module,exports){
+
+/**
+ * Expose `Emitter`.
+ */
+
+module.exports = Emitter;
+
+/**
+ * Initialize a new `Emitter`.
+ *
+ * @api public
+ */
+
+function Emitter(obj) {
+ if (obj) return mixin(obj);
+};
+
+/**
+ * Mixin the emitter properties.
+ *
+ * @param {Object} obj
+ * @return {Object}
+ * @api private
+ */
+
+function mixin(obj) {
+ for (var key in Emitter.prototype) {
+ obj[key] = Emitter.prototype[key];
+ }
+ return obj;
+}
+
+/**
+ * Listen on the given `event` with `fn`.
+ *
+ * @param {String} event
+ * @param {Function} fn
+ * @return {Emitter}
+ * @api public
+ */
+
+Emitter.prototype.on =
+Emitter.prototype.addEventListener = function(event, fn){
+ this._callbacks = this._callbacks || {};
+ (this._callbacks[event] = this._callbacks[event] || [])
+ .push(fn);
+ return this;
+};
+
+/**
+ * Adds an `event` listener that will be invoked a single
+ * time then automatically removed.
+ *
+ * @param {String} event
+ * @param {Function} fn
+ * @return {Emitter}
+ * @api public
+ */
+
+Emitter.prototype.once = function(event, fn){
+ var self = this;
+ this._callbacks = this._callbacks || {};
+
+ function on() {
+ self.off(event, on);
+ fn.apply(this, arguments);
+ }
+
+ on.fn = fn;
+ this.on(event, on);
+ return this;
+};
+
+/**
+ * Remove the given callback for `event` or all
+ * registered callbacks.
+ *
+ * @param {String} event
+ * @param {Function} fn
+ * @return {Emitter}
+ * @api public
+ */
+
+Emitter.prototype.off =
+Emitter.prototype.removeListener =
+Emitter.prototype.removeAllListeners =
+Emitter.prototype.removeEventListener = function(event, fn){
+ this._callbacks = this._callbacks || {};
+
+ // all
+ if (0 == arguments.length) {
+ this._callbacks = {};
+ return this;
+ }
+
+ // specific event
+ var callbacks = this._callbacks[event];
+ if (!callbacks) return this;
+
+ // remove all handlers
+ if (1 == arguments.length) {
+ delete this._callbacks[event];
+ return this;
+ }
+
+ // remove specific handler
+ var cb;
+ for (var i = 0; i < callbacks.length; i++) {
+ cb = callbacks[i];
+ if (cb === fn || cb.fn === fn) {
+ callbacks.splice(i, 1);
+ break;
+ }
+ }
+ return this;
+};
+
+/**
+ * Emit `event` with the given args.
+ *
+ * @param {String} event
+ * @param {Mixed} ...
+ * @return {Emitter}
+ */
+
+Emitter.prototype.emit = function(event){
+ this._callbacks = this._callbacks || {};
+ var args = [].slice.call(arguments, 1)
+ , callbacks = this._callbacks[event];
+
+ if (callbacks) {
+ callbacks = callbacks.slice(0);
+ for (var i = 0, len = callbacks.length; i < len; ++i) {
+ callbacks[i].apply(this, args);
+ }
+ }
+
+ return this;
+};
+
+/**
+ * Return array of callbacks for `event`.
+ *
+ * @param {String} event
+ * @return {Array}
+ * @api public
+ */
+
+Emitter.prototype.listeners = function(event){
+ this._callbacks = this._callbacks || {};
+ return this._callbacks[event] || [];
+};
+
+/**
+ * Check if this emitter has `event` handlers.
+ *
+ * @param {String} event
+ * @return {Boolean}
+ * @api public
+ */
+
+Emitter.prototype.hasListeners = function(event){
+ return !! this.listeners(event).length;
+};
+
+},{}],162:[function(require,module,exports){
+
+/**
+ * Reduce `arr` with `fn`.
+ *
+ * @param {Array} arr
+ * @param {Function} fn
+ * @param {Mixed} initial
+ *
+ * TODO: combatible error handling?
+ */
+
+module.exports = function(arr, fn, initial){
+ var idx = 0;
+ var len = arr.length;
+ var curr = arguments.length == 3
+ ? initial
+ : arr[idx++];
+
+ while (idx < len) {
+ curr = fn.call(null, curr, arr[idx], ++idx, arr);
+ }
+
+ return curr;
+};
+},{}]},{},[1])(1)
+});
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyaWZ5L25vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJpbmRleC5qcyIsImxpYi9hdXRoLmpzIiwibGliL2NsaWVudC5qcyIsImxpYi9oZWxwZXJzLmpzIiwibGliL2h0dHAuanMiLCJsaWIvcmVzb2x2ZXIuanMiLCJsaWIvc2NoZW1hLW1hcmt1cC5qcyIsImxpYi9zcGVjLWNvbnZlcnRlci5qcyIsImxpYi90eXBlcy9tb2RlbC5qcyIsImxpYi90eXBlcy9vcGVyYXRpb24uanMiLCJsaWIvdHlwZXMvb3BlcmF0aW9uR3JvdXAuanMiLCJub2RlX21vZHVsZXMvYnJvd3NlcmlmeS9ub2RlX21vZHVsZXMvYnJvd3Nlci1yZXNvbHZlL2VtcHR5LmpzIiwibm9kZV9tb2R1bGVzL2Jyb3dzZXJpZnkvbm9kZV9tb2R1bGVzL2J1ZmZlci9pbmRleC5qcyIsIm5vZGVfbW9kdWxlcy9icm93c2VyaWZ5L25vZGVfbW9kdWxlcy9idWZmZXIvbm9kZV9tb2R1bGVzL2Jhc2U2NC1qcy9saWIvYjY0LmpzIiwibm9kZV9tb2R1bGVz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AgICAgIHNlbGYuYXBpc1thcGlQcm9wZXJ0eV1bb3BlcmF0aW9uSWRdLmhlbHAgPSBvcGVyYXRpb25Hcm91cFtvcGVyYXRpb25JZF0uaGVscCA9IF8uYmluZChvcGVyYXRpb25PYmplY3QuaGVscCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wZXJhdGlvbk9iamVjdCk7XG4gICAgICAgIHNlbGYuYXBpc1thcGlQcm9wZXJ0eV1bb3BlcmF0aW9uSWRdLmFzQ3VybCA9IG9wZXJhdGlvbkdyb3VwW29wZXJhdGlvbklkXS5hc0N1cmwgPSBfLmJpbmQob3BlcmF0aW9uT2JqZWN0LmFzQ3VybCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcGVyYXRpb25PYmplY3QpO1xuXG4gICAgICAgIG9wZXJhdGlvbkdyb3VwLmFwaXNbb3BlcmF0aW9uSWRdID0gb3BlcmF0aW9uR3JvdXAub3BlcmF0aW9uc1tvcGVyYXRpb25JZF0gPSBvcGVyYXRpb25PYmplY3Q7XG5cbiAgICAgICAgLy8gbGVnYWN5IFVJIGZlYXR1cmVcbiAgICAgICAgdmFyIGFwaSA9IF8uZmluZChzZWxmLmFwaXNBcnJheSwgZnVuY3Rpb24gKGFwaSkge1xuICAgICAgICAgIHJldHVybiBhcGkudGFnID09PSB0YWc7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIGlmIChhcGkpIHtcbiAgICAgICAgICBhcGkub3BlcmF0aW9uc0FycmF5LnB1c2gob3BlcmF0aW9uT2JqZWN0KTtcbiAgICAgICAgfVxuICAgICAgfSk7XG4gICAgfSk7XG4gIH0pO1xuXG4gIHRoaXMuaXNCdWlsdCA9IHRydWU7XG5cbiAgaWYgKHRo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2F0aW9uKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChyZXNwb25zZS5zY2hlbWEpIHtcbiAgICAgICAgICAgICAgdGhpcy5yZXNvbHZlVG8ocm9vdCwgcmVzcG9uc2Uuc2NoZW1hLCByZXNvbHV0aW9uVGFibGUsIGxvY2F0aW9uKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG4gIH1cblxuICB2YXIgZXhwZWN0ZWRDYWxscyA9IDAsIHRvUmVzb2x2ZSA9IFtdO1xuICAvLyBpZiB0aGUgcm9vdCBpcyBzYW1lIGFzIG9ialtpXS5yb290IHdlIGNhbiByZXNvbHZlIGxvY2FsbHlcbiAgdmFyIGFsbCA9IHJlc29sdXRpb25UYWJsZTtcblxuICB2YXIgcGFydHM7XG4gIGZvcihpID0gMDsgaSA8IGFsbC5sZW5ndGg7IGkrKykge1xuICAgIHZhciBhID0gYWxsW2ldO1xuICAgIGlmKHJvb3QgPT09IGEucm9vdCkge1xuICAgICAgaWYoYS5yZXNvbHZlQXMgPT09ICdyZWYnKSB7XG4gICAgICAgIC8vIHJlc29sdmUgYW55IHBhdGggd2Fsa2luZ1xuICAgICAgICB2YXIgam9pbmVkID0gKChhLnJvb3QgfHwgJycpICsgJy8nICsgYS5rZXkpLnNwbGl0KCcvJyk7XG4gICAgICAgIHZhciBub3JtYWxpemVkID0gW107XG4gICAgICAgIHZhciB1cmwgPSAnJztcbiAgICAgICAgdmFyIGs7XG5cbiAgICAgICAgaWYoYS5rZXkuaW5kZXhPZignLi4vJykgPj0gMCkge1xuICAgICAgICAgIGZvcih2YXIgaiA9IDA7IGogPCBqb2luZWQubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgIGlmKGpvaW5lZFtqXSA9PT0gJy4uJykge1xuICAgICAgICAgICAgICBub3JtYWxpemVkID0gbm9ybWFsaXplZC5zbGljZSgwLCBub3JtYWxpemVkLmxlbmd0aC0xKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICBub3JtYWxpemVkLnB1c2goam9pbmVkW2pdKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgZm9yKGsgPSAwOyBrIDwgbm9ybWFsaXplZC5sZW5ndGg7IGsgKyspIHtcbiAgICAgICAgICAgIGlmKGsgPiAwKSB7XG4gICAgICAgICAgICAgIHVybCArPSAnLyc7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB1cmwgKz0gbm9ybWFsaXplZFtrXTtcbiAgICAgICAgICB9XG4gICAgICAgICAgLy8gd2Ugbm93IGhhdmUgdG8gcmVtb3RlIHJlc29sdmUgdGhpcyBiZWNhdXNlIHRoZSBwYXRoIGhhcyBjaGFuZ2VkXG4gICAgICAgICAgYS5yb290ID0gdXJsO1xuICAgICAgICAgIHRvUmVzb2x2ZS5wdXNoKGEpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgIHBhcnRzID0gYS5rZXkuc3BsaXQoJyMnKTtcbiAgICAgICAgICBpZihwYXJ0cy5sZW5ndGggPT09IDIpIHtcbiAgICAgICAgICAgIGlmKHBhcnRzWzBdLmluZGV4T2YoJ2h0dHA6Ly8nKSA9PT0gMCB8fCBwYXJ0c1swXS5pbmRleE9mKCdodHRwczovLycpID09PSAwKSB7XG4gICAgICAgICAgICAgIGEucm9vdCA9IHBhcnRzWzBdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbG9jYXRpb24gPSBwYXJ0c1sxXS5zcGxpdCgnLycpO1xuICAgICAgICAgICAgdmFyIHI7XG4gICAgICAgICAgICB2YXIgcyA9IHNwZWM7XG4gICAgICAgICAgICBmb3IoayA9IDA7IGsgPCBsb2NhdGlvbi5sZW5ndGg7IGsrKykge1xuICAgICAgICAgICAgICB2YXIgcGFydCA9IGxvY2F0aW9uW2tdO1xuICAgICAgICAgICAgICBpZihwYXJ0ICE9PSAnJykge1xuICAgICAgICAgICAgICAgIHMgPSBzW3BhcnRdO1xuICAgICAgICAgICAgICAgIGlmKHR5cGVvZiBzICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgICAgciA9IHM7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgciA9IG51bGw7XG4gICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmKHIgPT09IG51bGwpIHtcbiAgICAgICAgICAgICAgLy8gbXVzdCByZXNvbHZlIHRoaXMgdG9vXG4gICAgICAgICAgICAgIHRvUmVzb2x2ZS5wdXNoKGEpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZWxzZSB7XG4gICAgICAgIGlmIChhLnJlc29sdmVBcyA9PT0gJ2lubGluZScpIHtcbiAgICAgICAgICBpZihhLmtleSAmJiBhLmtleS5pbmRleE9mKCcjJykgPT09IC0xICYmIGEua2V5LmNoYXJBdCgwKSAhPT0gJy8nKSB7XG4gICAgICAgICAgICAvLyBoYW5kbGUgcmVsYXRpdmUgc2NoZW1hXG4gICAgICAgICAgICBwYXJ0cyA9IGEucm9vdC5zcGxpdCgnLycpO1xuICAgICAgICAgICAgbG9jYXRpb24gPSAnJztcbiAgICAgICAgICAgIGZvcihpID0gMDsgaSA8IHBhcnRzLmxlbmd0aCAtIDE7IGkrKykge1xuICAgICAgICAgICAgICBsb2NhdGlvbiArPSBwYXJ0c1tpXSArICcvJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxvY2F0aW9uICs9IGEua2V5O1xuICAgICAgICAgICAgYS5yb290ID0gbG9jYXRpb247XG4gICAgICAgICAgICBhLmxvY2F0aW9uID0gJyc7XG4gICAgICAgICAgfVxuICAgICAgICAgIHRvUmVzb2x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WNhdGlvbi9qc29uJ1xuICAgICAgICAgIH0sXG4gICAgICAgICAgb246IHtcbiAgICAgICAgICAgIGVycm9yOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgIHByb2Nlc3NlZENhbGxzICs9IDE7XG4gICAgICAgICAgICAgIHVucmVzb2x2ZWRSZWZzW2l0ZW0ua2V5XSA9IHtcbiAgICAgICAgICAgICAgICByb290OiBpdGVtLnJvb3QsXG4gICAgICAgICAgICAgICAgbG9jYXRpb246IGl0ZW0ubG9jYXRpb25cbiAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICBpZiAocHJvY2Vzc2VkQ2FsbHMgPT09IGV4cGVjdGVkQ2FsbHMpIHtcbiAgICAgICAgICAgICAgICBzZWxmLmZpbmlzaChzcGVjLCBfcm9vdCwgcmVzb2x1dGlvblRhYmxlLCByZXNvbHZlZFJlZnMsIHVucmVzb2x2ZWRSZWZzLCBjYWxsYmFjayk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sICAvLyBqc2hpbnQgaWdub3JlOmxpbmVcbiAgICAgICAgICAgIHJlc3BvbnNlOiBmdW5jdGlvbiAocmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgdmFyIHN3YWdnZXIgPSByZXNwb25zZS5vYmo7XG4gICAgICAgICAgICAgIHNlbGYucmVzb2x2ZUl0ZW0oc3dhZ2dlciwgaXRlbS5yb290LCByZXNvbHV0aW9uVGFibGUsIHJlc29sdmVkUmVmcywgdW5yZXNvbHZlZFJlZnMsIGl0ZW0pO1xuICAgICAgICAgICAgICBwcm9jZXNzZWRDYWxscyArPSAxO1xuXG4gICAgICAgICAgICAgIGlmIChwcm9jZXNzZWRDYWxscyA9PT0gZXhwZWN0ZWRDYWxscykge1xuICAgICAgICAgICAgICAgIHNlbGYuZmluaXNoKHNwZWMsIF9yb290LCByZXNvbHV0aW9uVGFibGUsIHJlc29sdmVkUmVmcywgdW5yZXNvbHZlZFJlZnMsIGNhbGxiYWNrK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G4gICAgICAgIHJvb3QgPSBwWzBdICsgJy8vJyArIHAyWzBdICsgcnNbMF07XG4gICAgICAgIGxvY2F0aW9uID0gcnNbMV07XG4gICAgICB9XG4gICAgICBlbHNlIHtcbiAgICAgICAgcnMgPSByZWYuc3BsaXQoJyMnKTtcbiAgICAgICAgaWYocnNbMF0gIT09ICcnKSB7XG4gICAgICAgICAgcDIgPSByb290LnNwbGl0KCcvJyk7XG4gICAgICAgICAgcDIgPSBwMi5zbGljZSgwLCBwMi5sZW5ndGggLSAxKTtcbiAgICAgICAgICBpZighcm9vdFRyaW1tZWQpIHtcbiAgICAgICAgICAgIHJvb3QgPSAnJztcbiAgICAgICAgICAgIGZvciAodmFyIGsgPSAwOyBrIDwgcDIubGVuZ3RoOyBrKyspIHtcbiAgICAgICAgICAgICAgaWYoayA+IDApIHsgcm9vdCArPSAnLyc7IH1cbiAgICAgICAgICAgICAgcm9vdCArPSBwMltrXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgcm9vdCArPSAnLycgKyByZWYuc3BsaXQoJyMnKVswXTtcbiAgICAgICAgfVxuICAgICAgICBsb2NhdGlvbiA9IHJzWzFdO1xuICAgICAgfVxuICAgIH1cbiAgICBpZiAocmVmLmluZGV4T2YoJ2h0dHAnKSA9PT0gMCkge1xuICAgICAgaWYocmVmLmluZGV4T2YoJyMnKSA+PSAwKSB7XG4gICAgICAgIHJvb3QgPSByZWYuc3BsaXQoJyMnKVswXTtcbiAgICAgICAgbG9jYXRpb24gPSByZWYuc3BsaXQoJyMnKVsxXTtcbiAgICAgIH1cbiAgICAgIGVsc2Uge1xuICAgICAgICByb290ID0gcmVmO1xuICAgICAgICBsb2NhdGlvbiA9ICcnO1xuICAgICAgfVxuICAgICAgcmVzb2x1dGlvblRhYmxlLnB1c2goe29iajogcHJvcGVydHksIHJlc29sdmVBczogJ2lubGluZScsIHJvb3Q6IHJvb3QsIGtleToga2V5LCBsb2NhdGlvbjogbG9jYXRpb259K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0XVtuYW1lXVsneC1yZXNvbHZlZC1mcm9tJ10gPSBzb3VyY2U7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgaWYocGFydCA9PT0gJ3Byb3BlcnRpZXMnKSB7XG4gICAgICAgICAgICAgICAgdmFyIHByb3BlcnRpZXMgPSBjb21wb25lbnRbcGFydF07XG4gICAgICAgICAgICAgICAgZm9yKG5hbWUgaW4gcHJvcGVydGllcykge1xuICAgICAgICAgICAgICAgICAgb3V0cHV0LnByb3BlcnRpZXNbbmFtZV0gPSBKU09OLnBhcnNlKEpTT04uc3RyaW5naWZ5KHByb3BlcnRpZXNbbmFtZV0pKTtcbiAgICAgICAgICAgICAgICAgIHZhciByZXNvbHZlZEZyb20gPSBwcm9wZXJ0aWVzW25hbWVdWyd4LXJlc29sdmVkLWZyb20nXTtcbiAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcmVzb2x2ZWRGcm9tID09PSAndW5kZWZpbmVkJyB8fCByZXNvbHZlZEZyb20gPT09ICdzZWxmJykge1xuICAgICAgICAgICAgICAgICAgICByZXNvbHZlZEZyb20gPSBzb3VyY2U7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICBvdXRwdXQucHJvcGVydGllc1tuYW1lXVsneC1yZXNvbHZlZC1mcm9tJ10gPSByZXNvbHZlZEZyb207XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGVsc2UgaWYocGFydCA9PT0gJ3JlcXVpcmVkJykge1xuICAgICAgICAgICAgICAgIC8vIG1lcmdlICYgZGVkdXAgdGhlIHJlcXVpcmVkIGFycmF5XG4gICAgICAgICAgICAgICAgdmFyIGEgPSBvdXRwdXQucmVxdWlyZWQuY29uY2F0KGNvbXBvbmVudFtwYXJ0XSk7XG4gICAgICAgICAgICAgICAgZm9yKHZhciBrID0gMDsgayA8IGEubGVuZ3RoOyArK2spIHtcbiAgICAgICAgICAgICAgICAgIGZvcih2YXIgaiA9IGsgKyAxOyBqIDwgYS5sZW5ndGg7ICsraikge1xuICAgICAgICAgICAgICAgICAgICBpZihhW2tdID09PSBhW2pdKSB7IGEuc3BsaWNlKGotLSwgMSk7IH1cbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgb3V0cHV0LnJlcXVpcmVkID0gYTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBlbHNlIGlmKHBhcnQgPT09ICd4LXJlc29sdmVkLWZyb20nKSB7XG4gICAgICAgICAgICAgICAgb3V0cHV0Wyd4LXJlc29sdmVkLWZyb20nXS5wdXNoKHNvdXJjZSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgLy8gVE9ETzogbmVlZCB0byBtZXJnZSB0aGlzIHByb3BlcnR5XG4gICAgICAgICAgICAgICAgLy8gY29uc29sZS5sb2coJ3doYXQgdG8gZG8gd2l0aCAnICsgcGFydClcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBvYmpba2V5XSA9IG91dHB1dDtcbiAgICAgIH1cbiAgICB9XG4gICAgaWYoXy5pc09iamVjdChpdGVtKSkge1xuICAgICAgdGhpcy5yZXNvbHZlQWxsT2Yoc3BlYywgaXRlbSwgZGVwdGggKyAxKTtcbiAgICB9XG4gIH1cbn07XG4iLCIndXNlIHN0cmljdCc7XG5cbnZhciBIZWxwZXJzID0gcmVxdWlyZSgnLi9oZWxwZXJzJyk7XG5cbnZhciBfID0ge1xuICBpc1BsYWluT2JqZWN0OiByZXF1aXJlKCdsb2Rhc2gtY29tcGF0L2xhbmcvaXNQbGFpbk9iamVjdCcpLFxuICBpc1VuZGVmaW5lZDogcmVxdWlyZSgnbG9kYXNoLWNvbX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HMucHVzaChuYW1lKTtcbiAgICB9XG5cbiAgICBpZiAoaXNBcnJheSkge1xuICAgICAgaWYgKF8uaXNBcnJheShzY2hlbWEuaXRlbXMpKSB7XG4gICAgICAgIGh0bWwgKz0gJzxkaXY+JyArIF8ubWFwKHNjaGVtYS5pdGVtcywgZnVuY3Rpb24gKGl0ZW0pIHtcbiAgICAgICAgICB2YXIgdHlwZSA9IGl0ZW0udHlwZSB8fCAnb2JqZWN0JztcblxuICAgICAgICAgIGlmIChfLmlzVW5kZWZpbmVkKGl0ZW0uJHJlZikpIHtcbiAgICAgICAgICAgIGlmIChfLmluZGV4T2YoWydhcnJheScsICdvYmplY3QnXSwgdHlwZSkgPiAtMSkge1xuICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gJ29iamVjdCcgJiYgXy5pc1VuZGVmaW5lZChpdGVtLnByb3BlcnRpZXMpKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICdvYmplY3QnO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiBhZGRSZWZlcmVuY2UoaXRlbSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHJldHVybiBwcmltaXRpdmVUb09wdGlvbnNIVE1MKGl0ZW0sIHR5cGUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gYWRkUmVmZXJlbmNlKGl0ZW0sIEhlbHBlcnMuc2ltcGxlUmVmKGl0ZW0uJHJlZikpO1xuICAgICAgICAgIH1cbiAgICAgICAgfSkuam9pbignLDwvZGl2PjxkaXY+Jyk7XG4gICAgICB9IGVsc2UgaWYgKF8uaXNQbGFpbk9iamVjdChzY2hlbWEuaXRlbXMpKSB7XG4gICAgICAgIGlmIChfLmlzVW5kZWZpbmVkKHNjaGVtYS5pdGVtcy4kcmVmKSkge1xuICAgICAgICAgIGlmIChfLmluZGV4T2Y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AgICAgIC8vIFdlIG5lZWQgdG8gaGFuZGxlIHByb3BlcnR5IHJlZmVyZW5jZXMgdG8gcHJpbWl0aXZlcyAoSXNzdWUgMzM5KVxuICAgICAgICAgICAgaWYgKCFfLmlzVW5kZWZpbmVkKGNQcm9wZXJ0eS4kcmVmKSkge1xuICAgICAgICAgICAgICBtb2RlbCA9IG1vZGVsc1tIZWxwZXJzLnNpbXBsZVJlZihjUHJvcGVydHkuJHJlZildO1xuXG4gICAgICAgICAgICAgIGlmICghXy5pc1VuZGVmaW5lZChtb2RlbCkgJiYgXy5pbmRleE9mKFt1bmRlZmluZWQsICdhcnJheScsICdvYmplY3QnXSwgbW9kZWwuZGVmaW5pdGlvbi50eXBlKSA9PT0gLTEpIHtcbiAgICAgICAgICAgICAgICAvLyBVc2UgcmVmZXJlbmNlZCBzY2hlbWFcbiAgICAgICAgICAgICAgICBjUHJvcGVydHkgPSBIZWxwZXJzLnJlc29sdmVTY2hlbWEobW9kZWwuZGVmaW5pdGlvbik7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaHRtbCArPSBwcmltaXRpdmVUb0hUTUwoY1Byb3BlcnR5KTtcblxuICAgICAgICAgICAgaWYoIXByb3BlcnR5SXNSZXF1aXJlZCkge1xuICAgICAgICAgICAgICBodG1sICs9ICcsIDxzcGFuIGNsYXNzPVwicHJvcE9wdEtleVwiPm9wdGlvbmFsPC9zcGFuPic7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGh0bWwgKz0gJyknO1xuXG4gICAgICAgICAgICBpZiAoIV8uaXNVbmRlZmluZWQoY1Byb3BlcnR5LmRlc2NyaXB0aW9uKSkge1xuICAgICAgICAgICAgICBodG1sICs9ICc6ICcgKyAnPHNwYW4gY2xhc3M9XCJwcm9wRGVzY1wiPicgKyBjUHJvcGVydHkuZGVzY3JpcHRpb24gKyAnPC9zcGFuPic7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmI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pZihvYmouYXV0aG9yaXphdGlvbnMpIHtcbiAgICB2YXIgbmFtZTtcbiAgICBmb3IobmFtZSBpbiBvYmouYXV0aG9yaXphdGlvbnMpIHtcbiAgICAgIHZhciBpc1ZhbGlkID0gZmFsc2U7XG4gICAgICB2YXIgc2VjdXJpdHlEZWZpbml0aW9uID0ge307XG4gICAgICB2YXIgZGVmaW5pdGlvbiA9IG9iai5hdXRob3JpemF0aW9uc1tuYW1lXTtcbiAgICAgIGlmKGRlZmluaXRpb24udHlwZSA9PT0gJ2FwaUtleScpIHtcbiAgICAgICAgc2VjdXJpdHlEZWZpbml0aW9uLnR5cGUgPSAnYXBpS2V5JztcbiAgICAgICAgc2VjdXJpdHlEZWZpbml0aW9uLmluID0gZGVmaW5pdGlvbi5wYXNzQXM7XG4gICAgICAgIHNlY3VyaXR5RGVmaW5pdGlvbi5uYW1lID0gZGVmaW5pdGlvbi5rZXluYW1lIHx8IG5hbWU7XG4gICAgICAgIGlzVmFsaWQgPSB0cnVlO1xuICAgICAgfVxuICAgICAgZWxzZSBpZihkZWZpbml0aW9uLnR5cGUgPT09ICdvYXV0aDInKSB7XG4gICAgICAgIHZhciBleGlzdGluZ1Njb3BlcyA9IGRlZmluaXRpb24uc2NvcGVzIHx8IFtdO1xuICAgICAgICB2YXIgc2NvcGVzID0ge307XG4gICAgICAgIHZhciBpO1xuICAgICAgICBmb3IoaSBpbiBleGlzdGluZ1Njb3Blcykge1xuICAgICAgICAgIHZhciBzY29wZSA9IGV4aXN0aW5nU2NvcGVzW2ldO1xuICAgICAgICAgIHNjb3Blc1tzY29wZS5zY29wZV0gPSBzY29wZS5kZXNjcmlwdGlvbjtcbiAgICAgICAgfVxuICAgICAgICBzZWN1cml0eURlZmluaXRpb24udHlwZSA9ICdvYXV0aDInO1xuICAgICAgICBpZihpID4gMCkge1xuICAgICAgICAgIHNlY3VyaXR5RGVmaW5pdGlvbi5zY29wZXMgPSBzY29wZXM7XG4gICAgICAgIH1cbiAgICAgICAgaWYoZGVmaW5pdGlvbi5ncmFudFR5cGVzKSB7XG4gICAgICAgICAgaWYoZGVmaW5pdGlvbi5ncmFudFR5cGVzLmltcGxpY2l0KSB7XG4gICAgICAgICAgICB2YXIgaW1wbGljaXQgPSBkZWZpbml0aW9uLmdyYW50VHlwZXMuaW1wbGljaXQ7XG4gICAgICAgICAgICBzZWN1cml0eURlZmluaXRpb24uZmxvdyA9ICdpbXBsaWNpdCc7XG4gICAgICAgICAgICBzZWN1cml0eURlZmluaXRpb24uYXV0aG9yaXphdGlvblVybCA9IGltcGxpY2l0LmxvZ2luRW5kcG9pbnQ7XG4gICAgICAgICAgICBpc1ZhbGlkID0gdHJ1ZTtcbiAgICAgICAgICB9XG4gICAgICAgICAgLyoganNoaW50IGlnbm9yZTpzdGFydCAqL1xuICAgICAgICAgIGlmKGRlZmluaXRpb24uZ3JhbnRUeXBlc1snYXV0aG9yaXphdGlvbl9jb2RlJ10pIHtcbiAgICAgICAgICAgIGlmKCFzZWN1cml0eURlZmluaXRpb24uZmxvdykge1xuICAgICAgICAgICAgICAvLyBjYW5ub3Qgc2V0IGlmIGZsb3cgaXMgYWxyZWFkeSBkZWZpbmVkXG4gICAgICAgICAgICAgIHZhciBhdXRoQ29kZSA9IGRlZmluaXRpb24uZ3JhbnRUeXBlc1snYXV0aG9yaXphdGlvbl9jb2RlJ107XG4gICAgICAgICAgICAgIHNlY3VyaXR5RGVmaW5pdGlvbi5mbG93ID0gJ2FjY2Vzc0NvZGUnO1xuICAgICAgICAgICAgICBzZWN1cml0eURlZmluaXRpb24uYXV0aG9yaXphdGlvblVybCA9IGF1dGhDb2RlLnRva2VuUmVxdWVzdEVuZHBvaW50LnVybDtcbiAgICAgICAgICAgICAgc2VjdXJpdHlEZWZpbml0aW9uLnRva2VuVXJsID0gYXV0aENvZGUudG9rZW5FbmRwb2ludC51cmw7XG4gICAgICAgICAgICAgIGlzVmFsaWQgPSB0cnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbi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pzaGludCBub2RlOiB0cnVlICovXG4oZnVuY3Rpb24gKCkge1xuICAgIFwidXNlIHN0cmljdFwiO1xuXG4gICAgZnVuY3Rpb24gQ29va2llQWNjZXNzSW5mbyhkb21haW4sIHBhdGgsIHNlY3VyZSwgc2NyaXB0KSB7XG4gICAgICAgIGlmICh0aGlzIGluc3RhbmNlb2YgQ29va2llQWNjZXNzSW5mbykge1xuICAgICAgICAgICAgdGhpcy5kb21haW4gPSBkb21haW4gfHwgdW5kZWZpbmVkO1xuICAgICAgICAgICAgdGhpcy5wYXRoID0gcGF0aCB8fCBcIi9cIjtcbiAgICAgICAgICAgIHRoaXMuc2VjdXJlID0gISFzZWN1cmU7XG4gICAgICAgICAgICB0aGlzLnNjcmlwdCA9ICEhc2NyaXB0O1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG5ldyBDb29raWVBY2Nlc3NJbmZvKGRvbWFpbiwgcGF0aCwgc2VjdXJlLCBzY3JpcHQpO1xuICAgIH1cbiAgICBleHBvcnRzLkNvb2tpZUFjY2Vzc0luZm8gPSBDb29raWVBY2Nlc3NJbmZvO1xuXG4gICAgZnVuY3Rpb24gQ29va2llKGNvb2tpZXN0ciwgcmVxdWVzdF9kb21haW4sIHJlcXVlc3RfcGF0aCkge1xuICAgICAgICBpZiAoY29va2llc3RyIGluc3RhbmNlb2YgQ29va2llKSB7XG4gICAgICAgICAgICByZXR1cm4gY29va2llc3RyO1xuICAgICAgICB9XG4gICAgICAgIGlmICh0aGlzIGluc3RhbmNlb2YgQ29va2llKSB7XG4gICAgICAgICAgICB0aGlzLm5hbWUgPSBudWxsO1xuICAgICAgICAgICAgdGhpcy52YWx1ZSA9IG51bGw7XG4gICAgICAgICAgICB0aGlzLmV4cGlyYXRpb25fZGF0ZSA9IEluZmluaXR5O1xuICAgICAgICAgICAgdGhpcy5wYXRoID0gU3RyaW5nKHJlcXVlc3RfcGF0aCB8fCBcIi9cIik7XG4gICAgICAgICAgICB0aGlzLmV4cGxpY2l0X3BhdGggPSBmYWxzZTtcbiAgICAgICAgICAgIHRoaXMuZG9tYWluID0gcmVxdWVzdF9kb21haW4gfHwgbnVsbDtcbiAgICAgICAgICAgIHRoaXMuZXhwbGljaXRfZG9tYWluID0gZmFsc2U7XG4gICAgICAgICAgICB0aGlzLnNlY3VyZSA9IGZhbHNlOyAvL2hvdyB0byBkZWZpbmUgZGVmYXVsdD9cbiAgICAgICAgICAgIHRoaXMubm9zY3JpcHQgPSBmYWxzZTsgLy9odHRwb25seVxuICAgICAgICAgICAgaWYgKGNvb2tpZXN0cikge1xuICAgICAgICAgICAgICAgIHRoaXMucGFyc2UoY29va2llc3RyLCByZXF1ZXN0X2RvbWFpbiwgcmVxdWVzdF9wYXRoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBuZXcgQ29va2llKGNvb2tpZXN0cik7XG4gICAgfVxuICAgIGV4cG9ydHMuQ29va2llID0gQ29va2llO1xuXG4gICAgQ29va2llLnByb3RvdHlwZS50b1N0cmluZyA9IGZ1bmN0aW9uIHRvU3RyaW5nKCkge1xuICAgICAgICB2YXIgc3RyID0gW3RoaXMubmFtZSArIFwiPVwiICsgdGhpcy52YWx1ZV07XG4gICAgICAgIGlmICh0aGlzLmV4cGlyYXRpb25fZGF0ZSAhPT0gSW5maW5pdHkpIHtcbiAgICAgICAgICAgIHN0ci5wdXNoKFwiZXhwaXJlcz1cIiArIChuZXcgRGF0ZSh0aGlzLmV4cGlyYXRpb25fZGF0ZSkpLnRvR01UU3RyaW5nKCkpO1xuICAgICAgICB9XG4gICAgICAgIGlmICh0aGlzLmRvbWFpbikge1xuICAgICAgICAgICAgc3RyLnB1c2goXCJkb21haW49XCIgKyB0aGlzLmRvbWFpbik7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHRoaXMucGF0aCkge1xuICAgICAgICAgICAgc3RyLnB1c2goXCJwYXRoPVwiICsgdGhpcy5wYXRoKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodGhpcy5zZWN1cmUpIHtcbiAgICAgICAgICAgIHN0ci5wdXNoKFwic2VjdXJlXCIpO1xuICAgICAgICB9XG4gICAgICAgIGlmICh0aGlzLm5vc2NyaXB0KSB7XG4gICAgICAgICAgICBzdHIucHVzaChcImh0dHBvbmx5XCIpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBzdHIuam9pbihcIjsgXCIpO1xuICAgIH07XG5cbiAgICBDb29raWUucHJvdG90eXBlLnRvVmFsdWVTdHJpbmcgPSBmdW5jdGlvbiB0b1ZhbHVlU3RyaW5nKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5uYW1lICsgXCI9XCIgKyB0aGlzLnZhbHVlO1xuICAgIH07XG5cbiAgICB2YXIgY29va2llX3N0cl9zcGxpdHRlciA9IC9bOl0oPz1cXHMqW2EtekEtWjAtOV9cXC1dK1xccypbPV0pL2c7XG4gICAgQ29va2llLnByb3RvdHlwZS5wYXJzZSA9IGZ1bmN0aW9uIHBhcnNlKHN0ciwgcmVxdWVzdF9kb21haW4sIHJlcXVlc3RfcGF0aCkge1xuICAgICAgICBpZiAodGhpcyBpbnN0YW5jZW9mIENvb2tpZSkge1xuICAgICAgICAgICAgdmFyIHBhcnRzID0gc3RyLnNwbGl0KFwiO1wiKS5maWx0ZXIoZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAhIXZhbHVlO1xuICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgIHBhaXIgPSBwYXJ0c1swXS5tYXRjaCgvKFtePV0rKT0oW1xcc1xcU10qKS8pLFxuICAgICAgICAgICAgICAgIGtleSA9IHBhaXJbMV0sXG4gICAgICAgICAgICAgICAgdmFsdWUgPSBwYWlyWzJdLFxuICAgICAgICAgICAgICAgIGk7XG4gICAgICAgICAgICB0aGlzLm5hbWUgPSBrZXk7XG4gICAgICAgICAgICB0aGlzLnZhbHVlID0gdmFsdWU7XG5cbiAgICAgICAgICAgIGZvciAoaSA9IDE7IGkgPCBwYXJ0cy5sZW5ndGg7IGkgKz0gMSkge1xuICAgICAgICAgICAgICAgIHBhaXIgPSBwYXJ0c1tpXS5tYXRjaCgvKFtePV0rKSg/Oj0oW1xcc1xcU10qKSk/Lyk7XG4gICAgICAgICAgICAgICAga2V5ID0gcGFpclsxXS50cmltKCkudG9Mb3dlckNhc2UoKTtcbiAgICAgICAgICAgICAgICB2YWx1ZSA9IHBhaXJbMl07XG4gICAgICAgICAgICAgICAgc3dpdGNoIChrZXkpIHtcbiAgICAgICAgICAgICAgICBjYXNlIFwiaHR0cG9ubHlcIjpcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5ub3NjcmlwdCA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgXCJleHBpcmVzXCI6XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZXhwaXJhdGlvbl9kYXRlID0gdmFsdWUgP1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIE51bWJlcihEYXRlLnBhcnNlKHZhbHVlKSkgOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEluZmluaXR5O1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIFwicGF0aFwiOlxuICAgICAgICAgICAgICAgICAgICB0aGlzLnBhdGggPSB2YWx1ZSA/XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWUudHJpbSgpIDpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcIlwiO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmV4cGxpY2l0X3BhdGggPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIFwiZG9tYWluXCI6XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZG9tYWluID0gdmFsdWUgP1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlLnRyaW0oKSA6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJcIjtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5leHBsaWNpdF9kb21haW4gPSAhIXRoaXMuZG9tYWluO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIFwic2VjdXJlXCI6XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2VjdXJlID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoIXRoaXMuZXhwbGljaXRfcGF0aCkge1xuICAgICAgICAgICAgICAgdGhpcy5wYXRoID0gcmVxdWVzdF9wYXRoIHx8IFwiL1wiO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCF0aGlzLmV4cGxpY2l0X2RvbWFpbikge1xuICAgICAgICAgICAgICAgdGhpcy5kb21haW4gPSByZXF1ZXN0X2RvbWFpbjtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG5ldyBDb29raWUoKS5wYXJzZShzdHIsIHJlcXVlc3RfZG9tYWluLCByZXF1ZXN0X3BhdGgpO1xuICAgIH07XG5cbiAgICBDb29raWUucHJvdG90eXBlLm1hdGNoZXMgPSBmdW5jdGlvbiBtYXRjaGVzKGFjY2Vzc19pbmZvKSB7XG4gICAgICAgIGlmICh0aGlzLm5vc2NyaXB0ICYmIGFjY2Vzc19pbmZvLnNjcmlwdCB8fFxuICAgICAgICAgICAgICAgIHRoaXMuc2VjdXJlICYmICFhY2Nlc3NfaW5mby5zZWN1cmUgfHxcbiAgICAgICAgICAgICAgICAhdGhpcy5jb2xsaWRlc1dpdGgoYWNjZXNzX2luZm8pKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgfTtcblxuICAgIENvb2tpZS5wcm90b3R5cGUuY29sbGlkZXNXaXRoID0gZnVuY3Rpb24gY29sbGlkZXNXaXRoKGFjY2Vzc19pbmZvKSB7XG4gICAgICAgIGlmICgodGhpcy5wYXRoICYmICFhY2Nlc3NfaW5mby5wYXRoKSB8fCAodGhpcy5kb21haW4gJiYgIWFjY2Vzc19pbmZvLmRvbWFpbikpIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodGhpcy5wYXRoICYmIGFjY2Vzc19pbmZvLnBhdGguaW5kZXhPZih0aGlzLnBhdGgpICE9PSAwKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCF0aGlzLmV4cGxpY2l0X3BhdGgpIHtcbiAgICAgICAgICAgaWYgKHRoaXMucGF0aCAhPT0gYWNjZXNzX2luZm8ucGF0aCkge1xuICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgdmFyIGFjY2Vzc19kb21haW4gPSBhY2Nlc3NfaW5mby5kb21haW4gJiYgYWNjZXNzX2luZm8uZG9tYWluLnJlcGxhY2UoL15bXFwuXS8sJycpO1xuICAgICAgICB2YXIgY29va2llX2RvbWFpbiA9IHRoaXMuZG9tYWluICYmIHRoaXMuZG9tYWluLnJlcGxhY2UoL15bXFwuXS8sJycpO1xuICAgICAgICBpZiAoY29va2llX2RvbWFpbiA9PT0gYWNjZXNzX2RvbWFpbikge1xuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGNvb2tpZV9kb21haW4pIHtcbiAgICAgICAgICAgIGlmICghdGhpcy5leHBsaWNpdF9kb21haW4pIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7IC8vIHdlIGFscmVhZHkgY2hlY2tlZCBpZiB0aGUgZG9tYWlucyB3ZXJlIGV4YWN0bHkgdGhlIHNhbWVcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciB3aWxkY2FyZCA9IGFjY2Vzc19kb21haW4uaW5kZXhPZihjb29raWVfZG9tYWluKTtcbiAgICAgICAgICAgIGlmICh3aWxkY2FyZCA9PT0gLTEgfHwgd2lsZGNhcmQgIT09IGFjY2Vzc19kb21haW4ubGVuZ3RoIC0gY29va2llX2RvbWFpbi5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICB9O1xuXG4gICAgZnVuY3Rpb24gQ29va2llSmFyKCkge1xuICAgICAgICB2YXIgY29va2llcywgY29va2llc19saXN0LCBjb2xsaWRhYmxlX2Nvb2tpZTtcbiAgICAgICAgaWYgKHRoaXMgaW5zdGFuY2VvZiBDb29raWVKYXIpIHtcbiAgICAgICAgICAgIGNvb2tpZXMgPSBPYmplY3QuY3JlYXRlKG51bGwpOyAvL25hbWU6IFtDb29raWVdXG5cbiAgICAgICAgICAgIHRoaXMuc2V0Q29va2llID0gZnVuY3Rpb24gc2V0Q29va2llKGNvb2tpZSwgcmVxdWVzdF9kb21haW4sIHJlcXVlc3RfcGF0aCkge1xuICAgICAgICAgICAgICAgIHZhciByZW1vdmUsIGk7XG4gICAgICAgICAgICAgICAgY29va2llID0gbmV3IENvb2tpZShjb29raWUsIHJlcXVlc3RfZG9tYWluLCByZXF1ZXN0X3BhdGgpO1xuICAgICAgICAgICAgICAgIC8vRGVsZXRlIHRoZSBjb29raWUgaWYgdGhlIHNldCBpcyBwYXN0IHRoZSBjdXJyZW50IHRpbWVcbiAgICAgICAgICAgICAgICByZW1vdmUgPSBjb29raWUuZXhwaXJhdGlvbl9kYXRlIDw9IERhdGUubm93KCk7XG4gICAgICAgICAgICAgICAgaWYgKGNvb2tpZXNbY29va2llLm5hbWVdICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgY29va2llc19saXN0ID0gY29va2llc1tjb29raWUubmFtZV07XG4gICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBjb29raWVzX2xpc3QubGVuZ3RoOyBpICs9IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbGxpZGFibGVfY29va2llID0gY29va2llc19saXN0W2ldO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbGxpZGFibGVfY29va2llLmNvbGxpZGVzV2l0aChjb29raWUpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlbW92ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb29raWVzX2xpc3Quc3BsaWNlKGksIDEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29va2llc19saXN0Lmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlIGNvb2tpZXNbY29va2llLm5hbWVdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29va2llc19saXN0W2ldID0gY29va2llO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBjb29raWU7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKHJlbW92ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGNvb2tpZXNfbGlzdC5wdXNoKGNvb2tpZSk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBjb29raWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChyZW1vdmUpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjb29raWVzW2Nvb2tpZS5uYW1lXSA9IFtjb29raWVdO1xuICAgICAgICAgICAgICAgIHJldHVybiBjb29raWVzW2Nvb2tpZS5uYW1lXTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICAvL3JldHVybnMgYSBjb29raWVcbiAgICAgICAgICAgIHRoaXMuZ2V0Q29va2llID0gZnVuY3Rpb24gZ2V0Q29va2llKGNvb2tpZV9uYW1lLCBhY2Nlc3NfaW5mbykge1xuICAgICAgICAgICAgICAgIHZhciBjb29raWUsIGk7XG4gICAgICAgICAgICAgICAgY29va2llc19saXN0ID0gY29va2llc1tjb29raWVfbmFtZV07XG4gICAgICAgICAgICAgICAgaWYgKCFjb29raWVzX2xpc3QpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgY29va2llc19saXN0Lmxlbmd0aDsgaSArPSAxKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvb2tpZSA9IGNvb2tpZXNfbGlzdFtpXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNvb2tpZS5leHBpcmF0aW9uX2RhdGUgPD0gRGF0ZS5ub3coKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvb2tpZXNfbGlzdC5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWxldGUgY29va2llc1tjb29raWUubmFtZV07XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoY29va2llLm1hdGNoZXMoYWNjZXNzX2luZm8pKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gY29va2llO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIC8vcmV0dXJucyBhIGxpc3Qgb2YgY29va2llc1xuICAgICAgICAgICAgdGhpcy5nZXRDb29raWVzID0gZnVuY3Rpb24gZ2V0Q29va2llcyhhY2Nlc3NfaW5mbykge1xuICAgICAgICAgICAgICAgIHZhciBtYXRjaGVzID0gW10sIGNvb2tpZV9uYW1lLCBjb29raWU7XG4gICAgICAgICAgICAgICAgZm9yIChjb29raWVfbmFtZSBpbiBjb29raWVzKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvb2tpZSA9IHRoaXMuZ2V0Q29va2llKGNvb2tpZV9uYW1lLCBhY2Nlc3NfaW5mbyk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChjb29raWUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG1hdGNoZXMucHVzaChjb29raWUpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIG1hdGNoZXMudG9TdHJpbmcgPSBmdW5jdGlvbiB0b1N0cmluZygpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG1hdGNoZXMuam9pbihcIjpcIik7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBtYXRjaGVzLnRvVmFsdWVTdHJpbmcgPSBmdW5jdGlvbiB0b1ZhbHVlU3RyaW5nKCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbWF0Y2hlcy5tYXAoZnVuY3Rpb24gKGMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBjLnRvVmFsdWVTdHJpbmcoKTtcbiAgICAgICAgICAgICAgICAgICAgfSkuam9pbignOycpO1xuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgcmV0dXJuIG1hdGNoZXM7XG4gICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gbmV3IENvb2tpZUphcigpO1xuICAgIH1cbiAgICBleHBvcnRzLkNvb2tpZUphciA9IENvb2tpZUphcjtcblxuICAgIC8vcmV0dXJucyBsaXN0IG9mIGNvb2tpZXMgdGhhdCB3ZXJlIHNldCBjb3JyZWN0bHkuIENvb2tpZXMgdGhhdCBhcmUgZXhwaXJlZCBhbmQgcmVtb3ZlZCBhcmUgbm90IHJldHVybmVkLlxuICAgIENvb2tpZUphci5wcm90b3R5cGUuc2V0Q29va2llcyA9IGZ1bmN0aW9uIHNldENvb2tpZXMoY29va2llcywgcmVxdWVzdF9kb21haW4sIHJlcXVlc3RfcGF0aCkge1xuICAgICAgICBjb29raWVzID0gQXJyYXkuaXNBcnJheShjb29raWVzKSA/XG4gICAgICAgICAgICAgICAgY29va2llcyA6XG4gICAgICAgICAgICAgICAgY29va2llcy5zcGxpdChjb29raWVfc3RyX3NwbGl0dGVyKTtcbiAgICAgICAgdmFyIHN1Y2Nlc3NmdWwgPSBbXSxcbiAgICAgICAgICAgIGksXG4gICAgICAgICAgICBjb29raWU7XG4gICAgICAgIGNvb2tpZXMgPSBjb29raWVzLm1hcChDb29raWUpO1xuICAgICAgICBmb3IgKGkgPSAwOyBpIDwgY29va2llcy5sZW5ndGg7IGkgKz0gMSkge1xuICAgICAgICAgICAgY29va2llID0gY29va2llc1tpXTtcbiAgICAgICAgICAgIGlmICh0aGlzLnNldENvb2tpZShjb29raWUsIHJlcXVlc3RfZG9tYWluLCByZXF1ZXN0X3BhdGgpKSB7XG4gICAgICAgICAgICAgICAgc3Vj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QVJfTElORV9GRUVEICAgICAgICAgICAgPSAweDBBOyAvKiBMRiAqL1xudmFyIENIQVJfQ0FSUklBR0VfUkVUVVJOICAgICAgPSAweDBEOyAvKiBDUiAqL1xudmFyIENIQVJfU1BBQ0UgICAgICAgICAgICAgICAgPSAweDIwOyAvKiBTcGFjZSAqL1xudmFyIENIQVJfRVhDTEFNQVRJT04gICAgICAgICAgPSAweDIxOyAvKiAhICovXG52YXIgQ0hBUl9ET1VCTEVfUVVPVEUgICAgICAgICA9IDB4MjI7IC8qIFwiICovXG52YXIgQ0hBUl9TSEFSUCAgICAgICAgICAgICAgICA9IDB4MjM7IC8qICMgKi9cbnZhciBDSEFSX1BFUkNFTlQgICAgICAgICAgICAgID0gMHgyNTsgLyogJSAqL1xudmFyIENIQVJfQU1QRVJTQU5EICAgICAgICAgICAgPSAweDI2OyAvKiAmICovXG52YXIgQ0hBUl9TSU5HTEVfUVVPVEUgICAgICAgICA9IDB4Mjc7IC8qICcgKi9cbnZhciBDSEFSX0FTVEVSSVNLICAgICAgICAgICAgID0gMHgyQTsgLyogKiAqL1xudmFyIENIQVJfQ09NTUEgICAgICAgICAgICAgICAgPSAweDJDOyAvKiAsICovXG52YXIgQ0hBUl9NSU5VUyAgICAgICAgICAgICAgICA9IDB4MkQ7IC8qIC0gKi9cbnZhciBDSEFSX0NPTE9OICAgICAgICAgICAgICAgID0gMHgzQTsgLyogOiAqL1xudmFyIENIQVJfR1JFQVRFUl9USEFOICAgICAgICAgPSAweDNFOyAvKiA+ICovXG52YXIgQ0hBUl9RVUVTVElPTiAgICAgICAgICAgICA9IDB4M0Y7IC8qID8gKi9cbnZhciBDSEFSX0NPTU1FUkNJQUxfQVQgICAgICAgID0gMHg0MDsgLyogQCAqL1xudmFyIENIQVJfTEVGVF9TUVVBUkVfQlJBQ0tFVCAgPSAweDVCOyAvKiBbICovXG52YXIgQ0hBUl9SSUdIVF9TUVVBUkVfQlJBQ0tFVCA9IDB4NUQ7IC8qIF0gKi9cbnZ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fbGluZVN0YXJ0LFxuICAgICAgX2xpbmVJbmRlbnQsXG4gICAgICBfa2luZCA9IHN0YXRlLmtpbmQsXG4gICAgICBfcmVzdWx0ID0gc3RhdGUucmVzdWx0LFxuICAgICAgY2g7XG5cbiAgY2ggPSBzdGF0ZS5pbnB1dC5jaGFyQ29kZUF0KHN0YXRlLnBvc2l0aW9uKTtcblxuICBpZiAoaXNfV1NfT1JfRU9MKGNoKSAgICAgICAgICAgICB8fFxuICAgICAgaXNfRkxPV19JTkRJQ0FUT1IoY2gpICAgICAgICB8fFxuICAgICAgMHgyMy8qICMgKi8gICAgICAgICAgID09PSBjaCB8fFxuICAgICAgMHgyNi8qICYgKi8gICAgICAgICAgID09PSBjaCB8fFxuICAgICAgMHgyQS8qICogKi8gICAgICAgICAgID09PSBjaCB8fFxuICAgICAgMHgyMS8qICEgKi8gICAgICAgICAgID09PSBjaCB8fFxuICAgICAgMHg3Qy8qIHwgKi8gICAgICAgICAgID09PSBjaCB8fFxuICAgICAgMHgzRS8qID4gKi8gICAgICAgICAgID09PSBjaCB8fFxuICAgICAgMHgyNy8qICcgKi8gICAgICAgICAgID09PSBjaCB8fFxuICAgICAgMHgyMi8qIFwiICovICAgICAgICAgICA9PT0gY2ggfHxcbiAgICAgIDB4MjUvKiAlICovICAgICAgICAgICA9PT0gY2ggfHxcbiAgICAgIDB4NDAvKiBovICAgICAgICAgICA9PT0gY2ggfHxcbiAgICAgIDB4NjAvKiBgICovICAgICAgICAgICA9PT0gY2gpIHtcbiAgICByZXR1cm4gZmFsc2U7XG4gIH1cblxuICBpZiAoMHgzRi8qID8gKi8gPT09IGNoIHx8IDB4MkQvKiAtICovID09PSBjaCkge1xuICAgIGZvbGxvd2luZyA9IHN0YXRlLmlucHV0LmNoYXJDb2RlQXQoc3RhdGUucG9zaXRpb24gKyAxKTtcblxuICAgIGlmIChpc19XU19PUl9FT0woZm9sbG93aW5nKSB8fFxuICAgICAgICB3aXRoaW5GbG93Q29sbGVjdGlvbiAm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ybiBmYWxzZTsgfVxuXG4gIGNoID0gZGF0YVtpbmRleF07XG5cbiAgLy8gc2lnblxuICBpZiAoY2ggPT09ICctJyB8fCBjaCA9PT0gJysnKSB7XG4gICAgY2ggPSBkYXRhWysraW5kZXhdO1xuICB9XG5cbiAgaWYgKGNoID09PSAnMCcpIHtcbiAgICAvLyAwXG4gICAgaWYgKGluZGV4ICsgMSA9PT0gbWF4KSB7IHJldHVybiB0cnVlOyB9XG4gICAgY2ggPSBkYXRhWysraW5kZXhdO1xuXG4gICAgLy8gYmFzZSAyLCBiYXNlIDgsIGJhc2UgMTZcblxuICAgIGlmIChjaCA9PT0gJ2InKSB7XG4gICAgICAvLyBiYXNlIDJcbiAgICAgIGluZGV4Kys7XG5cbiAgICAgIGZvciAoOyBpbmRleCA8IG1heDsgaW5kZXgrKykge1xuICAgICAgICBjaCA9IGRhdGFbaW5kZXhdO1xuICAgICAgICBpZiAoY2ggPT09ICdfJykgeyBjb250aW51ZTsgfVxuICAgICAgICBpZiAoY2ggIT09ICcwJyAmJiBjaCAhPT0gJzEnKSB7XG4gICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgICAgIGhhc0RpZ2l0cyA9IHRydWU7XG4gICAgICB9XG4gICAgICByZXR1cm4gaGFzRGlnaXRzO1xuICAgIH1cblxuXG4gICAgaWYgKGNoID09PSAneCcpIHtcbiAgICAgIC8vIGJhc2UgMTZcbiAgICAgIGluZGV4Kys7XG5cbiAgICAgIGZvciAoOyBpbmRleCA8IG1heDsgaW5kZXgrKykge1xuICAgICAgICBjaCA9IGRhdGFbaW5kZXhdO1xuICAgICAgICBpZiAoY2ggPT09ICdfJykgeyBjb250aW51ZTsgfVxuICAgICAgICBpZiAoIWlzSGV4Q29kZShkYXRhLmNoYXJDb2RlQXQoaW5kZXgpKSkge1xuICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgICBoYXNEaWdpdHMgPSB0cnVlO1xuICAgICAgf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AgICAgICAgICAgICAgICAgKyAvLyBbMl0gbW9udGhcbiAgJy0oWzAtOV1bMC05XT8pJyAgICAgICAgICAgICAgICAgICArIC8vIFszXSBkYXlcbiAgJyg/Oig/OltUdF18WyBcXFxcdF0rKScgICAgICAgICAgICAgICsgLy8gLi4uXG4gICcoWzAtOV1bMC05XT8pJyAgICAgICAgICAgICAgICAgICAgKyAvLyBbNF0gaG91clxuICAnOihbMC05XVswLTldKScgICAgICAgICAgICAgICAgICAgICsgLy8gWzVdIG1pbnV0ZVxuICAnOihbMC05XVswLTldKScgICAgICAgICAgICAgICAgICAgICsgLy8gWzZdIHNlY29uZFxuICAnKD86XFxcXC4oWzAtOV0qKSk/JyAgICAgICAgICAgICAgICAgKyAvLyBbN10gZnJhY3Rpb25cbiAgJyg/OlsgXFxcXHRdKihafChbLStdKShbMC05XVswLTldPyknICsgLy8gWzhdIHR6IFs5XSB0el9zaWduIFsxMF0gdHpfaG91clxuICAnKD86OihbMC05XVswLTldKSk/KSk/KT8kJyk7ICAgICAgICAgLy8gWzExXSB0el9taW51dGVcblxuZnVuY3Rpb24gcmVzb2x2ZVlhbWxUaW1lc3RhbXAoZGF0YSkge1xuICBpZiAobnVsbCA9PT0gZGF0YSkge1xuICAgIHJldHVybiBmYWxzZTtcbiAgfVxuXG4gIHZhciBtYXRjaCwgeWVhciwgbW9udGgsIGRheSwgaG91ciwgbWludXRlLCBzZWNvbmQsIGZyYWN0aW9uID0gMCxcbiAgICAgIGRlbHRhID0gbnVsbCwgdHpfaG91ciwgdHpfbWludXRlLCBkYXRlO1xuXG4gIG1hdGNoID0gWUFNTF9USU1FU1RBTVBfUkVHRVhQLmV4ZWMoZGF0YSk7XG5cbiAgaWYgKG51bGwgPT09IG1hdGNoKSB7XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9XG5cbiAgcmV0dXJuIHRydWU7XG59XG5cbmZ1bmN0aW9uIGNvbnN0cnVjdFlhbWxUaW1lc3RhbXAoZGF0YSkge1xuICB2YXI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AgICAgICAgICAgICAgICcrJywgJy0nLCAnKicsICcvJywgJyUnLCAnKysnLCAnLS0nLCAnPDwnLCAnPj4nLCAnPj4+JywgJyYnLFxuICAgICAgICAgICAgICAgICAgICAnfCcsICdeJywgJyEnLCAnficsICcmJicsICd8fCcsICc/JywgJzonLCAnPT09JywgJz09JywgJz49JyxcbiAgICAgICAgICAgICAgICAgICAgJzw9JywgJzwnLCAnPicsICchPScsICchPT0nXTtcblxuICAgIFN5bnRheCA9IHtcbiAgICAgICAgQXNzaWdubWVudEV4cHJlc3Npb246ICdBc3NpZ25tZW50RXhwcmVzc2lvbicsXG4gICAgICAgIEFzc2lnbm1lbnRQYXR0ZXJuOiAnQXNzaWdubWVudFBhdHRlcm4nLFxuICAgICAgICBBcnJheUV4cHJlc3Npb246ICdBcnJheUV4cHJlc3Npb24nLFxuICAgICAgICBBcnJheVBhdHRlcm46ICdBcnJheVBhdHRlcm4nLFxuICAgICAgICBBcnJvd0Z1bmN0aW9uRXhwcmVzc2lvbjogJ0Fycm93RnVuY3Rpb25FeHByZXNzaW9uJyxcbiAgICAgICAgQmxvY2tTdGF0ZW1lbnQ6ICdCbG9ja1N0YXRlbWVudCcsXG4gICAgICAgIEJpbmFyeUV4cHJlc3Npb246ICdCaW5hcnlFeHByZXNzaW9uJyxcbiAgICAgICAgQnJlYWtTdGF0ZW1lbnQ6ICdCcmVha1N0YXRlbWVudCcsXG4gICAgICAgIENhbGxFeHByZXNzaW9uOiAnQ2FsbEV4cHJlc3Npb24nLFxuICAgICAgICBDYXRjaENsYXVzZTogJ0NhdGNoQ2xhdXNlJyxcbiAgICAgICAgQ2xhc3NCb2R5OiAnQ2xhc3NCb2R5JyxcbiAgICAgICAgQ2xhc3NEZWNsYXJhdGlvbjogJ0NsYXNzRGVjbGFyYXRpb24nLFxuICAgICAgICBDbGFzc0V4cHJlc3Npb246ICdDbGFzc0V4cHJlc3Npb24nLFxuICAgICAgICBDb25kaXRpb25hbEV4cHJlc3Npb246ICdDb25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RleCA8IGxlbmd0aCAmJiBpc09jdGFsRGlnaXQoc291cmNlW2luZGV4XSkpIHtcbiAgICAgICAgICAgIG9jdGFsID0gdHJ1ZTtcbiAgICAgICAgICAgIGNvZGUgPSBjb2RlICogOCArICcwMTIzNDU2NycuaW5kZXhPZihzb3VyY2VbaW5kZXgrK10pO1xuXG4gICAgICAgICAgICAvLyAzIGRpZ2l0cyBhcmUgb25seSBhbGxvd2VkIHdoZW4gc3RyaW5nIHN0YXJ0c1xuICAgICAgICAgICAgLy8gd2l0aCAwLCAxLCAyLCAzXG4gICAgICAgICAgICBpZiAoJzAxMjMnLmluZGV4T2YoY2gpID49IDAgJiZcbiAgICAgICAgICAgICAgICAgICAgaW5kZXggPCBsZW5ndGggJiZcbiAgICAgICAgICAgICAgICAgICAgaXNPY3RhbERpZ2l0KHNvdXJjZVtpbmRleF0pKSB7XG4gICAgICAgICAgICAgICAgY29kZSA9IGNvZGUgKiA4ICsgJzAxMjM0NTY3Jy5pbmRleE9mKHNvdXJjZVtpbmRleCsrXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgY29kZTogY29kZSxcbiAgICAgICAgICAgIG9jdGFsOiBvY3RhbFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIC8vIDcuMiBXaGl0ZSBTcGFjZVxuXG4gICAgZnVuY3Rpb24gaXNXaGl0ZVNwYWNlKGNoKSB7XG4gICAgICAgIHJldHVybiAoY2ggPT09IDB4MjApIHx8IChjaCA9PT0gMHgwOSkgfHwgKGNoID09PSAweDBCKSB8fCAoY2ggPT09IDB4MEMpIHx8IChjaCA9PT0gMHhBMCkgfHxcbiAgICAgICAgICAgIChjaCA+PSAweDE2ODAgJiYgWzB4MTY4MCwgMHgxODBFLCAweDIwMDAsIDB4MjAwMSwgMHgyMDAyLCAweDIwMDMsIDB4MjAwNCwgMHgyMDA1LCAweDIwMDYsIDB4MjAwNywgMHgyMDA4LCAweDIwM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ZCA9PT0gJ3RoaXMnKSB8fCAoaWQgPT09ICdlbHNlJykgfHwgKGlkID09PSAnY2FzZScpIHx8XG4gICAgICAgICAgICAgICAgKGlkID09PSAndm9pZCcpIHx8IChpZCA9PT0gJ3dpdGgnKSB8fCAoaWQgPT09ICdlbnVtJyk7XG4gICAgICAgIGNhc2UgNTpcbiAgICAgICAgICAgIHJldHVybiAoaWQgPT09ICd3aGlsZScpIHx8IChpZCA9PT0gJ2JyZWFrJykgfHwgKGlkID09PSAnY2F0Y2gnKSB8fFxuICAgICAgICAgICAgICAgIChpZCA9PT0gJ3Rocm93JykgfHwgKGlkID09PSAnY29uc3QnKSB8fCAoaWQgPT09ICd5aWVsZCcpIHx8XG4gICAgICAgICAgICAgICAgKGlkID09PSAnY2xhc3MnKSB8fCAoaWQgPT09ICdzdXBlcicpO1xuICAgICAgICBjYXNlIDY6XG4gICAgICAgICAgICByZXR1cm4gKGlkID09PSAncmV0dXJuJykgfHwgKGlkID09PSAndHlwZW9mJykgfHwgKGlkID09PSAnZGVsZXRlJykgfHxcbiAgICAgICAgICAgICAgICAoaWQgPT09ICdzd2l0Y2gnKSB8fCAoaWQgPT09ICdleHBvcnQnKSB8fCAoaWQgPT09ICdpbXBvcnQnKTtcbiAgICAgICAgY2FzZSA3OlxuICAgICAgICAgICAgcmV0dXJuIChpZCA9PT0gJ2RlZmF1bHQnKSB8fCAoaWQgPT09ICdmaW5hbGx5JykgfHwgKGlkID09PSAnZXh0ZW5kcycpO1xuICAgICAgICBjYXNlIDg6XG4gICAgICAgICAgICByZXR1cm4gKGlkID09PSAnZnVuY3Rpb24nKSB8fCAoaWQgPT09ICdjb250aW51ZScpIHx8IChpZCA9PT0gJ2RlYnVnZ2VyJyk7XG4gICAgICAgIGNhc2UgMTA6XG4gICAgICAgICAgICByZXR1cm4gKGlkID09PSAnaW5zdGFuY2VvZicpO1xuICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgLy8gNy40IENvbW1lbnRzXG5cbiAgICBmdW5jdGlvbiBhZGRDb21tZW50KHR5cGUsIHZhbHVlLCBzdGFydCwgZW5kLCBsb2MpIHtcbiAgICAgICAgdmFyIGNvbW1lbnQ7XG5cbiAgICAgICAgYXNzZXJ0KHR5cGVvZiBzdGFydCA9PT0gJ251bWJlcicsICdDb21tZW50IG11c3QgaGF2ZSB2YWxpZCBwb3NpdGlvbicpO1xuXG4gICAgICAgIHN0YXRlLmxhc3RDb21tZW50U3RhcnQgPSBzdGFydDtcblxuICAgICAgICBjb21tZW50ID0ge1xuICAgICAgICAgICAgdHlwZTogdHlwZSxcbiAgICAgICAgICAgIHZhbHVlOiB2YWx1ZVxuICAgICAgICB9O1xuICAgICAgICBpZiAoZXh0cmEucmFuZ2UpIHtcbiAgICAgICAgICAgIGNvbW1lbnQucmFuZ2UgPSBbc3RhcnQsIGVuZF07XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGV4dHJhLmxvYykge1xuICAgICAgICAgICAgY29tbWVudC5sb2MgPSBsb2M7XG4gICAgICAgIH1cbiAgICAgICAgZXh0cmEuY29tbWVudHMucHVzaChjb21tZW50KTtcbiAgICAgICAgaWYgKGV4dHJhLmF0dGFjaENvbW1lbnQpIHtcbiAgICAgICAgICAgIGV4dHJhLmxlYWRpbmdDb21tZW50cy5wdXNoKGNvbW1lbnQpO1xuICAgICAgICAgICAgZXh0cmEudHJhaWxpbmdDb21tZW50cy5wdXNoKGNvbW1lbnQpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gc2tpcFNpbmdsZUxpbmVDb21tZW50KG9mZnNldCkge1xuICAgICAgICB2YXIgc3RhcnQsIGxvYywgY2gsIGNvbW1lbnQ7XG5cbiAgICAgICAgc3RhcnQgPSBpbmRleCAtIG9mZnNldDtcbiAgICAgICAgbG9jID0ge1xuICAgICAgICAgICAgc3RhcnQ6IHtcbiAgICAgICAgICAgICAgICBsaW5lOiBsaW5lTnVtYmVyLFxuICAgICAgICAgICAgICAgIGNvbHVtbjogaW5kZXggLSBsaW5lU3RhcnQgLSBvZmZzZXRcbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcblxuICAgICAgICB3aGlsZSAoaW5kZXggPCBsZW5ndGgpIHtcbiAgICAgICAgICAgIGNoID0gc291cmNlLmNoYXJDb2RlQXQoaW5kZXgpO1xuICAgICAgICAgICAgKytpbmRleDtcbiAgICAgICAgICAgIGlmIChpc0xpbmVUZXJtaW5hdG9yKGNoKSkge1xuICAgICAgICAgICAgICAgIGhhc0xpbmVUZXJtaW5hdG9yID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBpZiAoZXh0cmEuY29tbWVudHMpIHtcbiAgICAgICAgICAgICAgICAgICAgY29tbWVudCA9IHNvdXJjZS5zbGljZShzdGFydCArIG9mZnNldCwgaW5kZXggLSAxKTtcbiAgICAgICAgICAgICAgICAgICAgbG9jLmVuZCA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmU6IGxpbmVOdW1iZXIsXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2x1bW46IGluZGV4IC0gbGluZVN0YXJ0IC0gMVxuICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICBhZGRDb21tZW50KCdMaW5lJywgY29tbWVudCwgc3RhcnQsIGluZGV4IC0gMSwgbG9jKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGNoID09PSAxMyAmJiBzb3VyY2UuY2hhckNvZGVBdChpbmRleCkgPT09IDEwKSB7XG4gICAgICAgICAgICAgICAgICAgICsraW5kZXg7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICsrbGluZU51bWJlcjtcbiAgICAgICAgICAgICAgICBsaW5lU3RhcnQgPSBpbmRleDtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoZXh0cmEuY29tbWVudHMpIHtcbiAgICAgICAgICAgIGNvbW1lbnQgPSBzb3VyY2Uuc2xpY2Uoc3RhcnQgKyBvZmZzZXQsIGluZGV4KTtcbiAgICAgICAgICAgIGxvYy5lbmQgPSB7XG4gICAgICAgICAgICAgICAgbGluZTogbGluZU51bWJlcixcbiAgICAgICAgICAgICAgICBjb2x1bW46IGluZGV4IC0gbGluZVN0YXJ0XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYWRkQ29tbWVudCgnTGluZScsIGNvbW1lbnQsIHN0YXJ0LCBpbmRleCwgbG9jKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIHNraXBNdWx0aUxpbmVDb21tZW50KCkge1xuICAgICAgICB2YXIgc3RhcnQsIGxvYywgY2gsIGNvbW1lbnQ7XG5cbiAgICAgICAgaWYgKGV4dHJhLmNvbW1lbnRzKSB7XG4gICAgICAgICAgICBzdGFydCA9IGluZGV4IC0gMjtcbiAgICAgICAgICAgIGxvYyA9IHtcbiAgICAgICAgICAgICAgICBzdGFydDoge1xuICAgICAgICAgICAgICAgICAgICBsaW5lOiBsaW5lTnVtYmVyLFxuICAgICAgICAgICAgICAgICAgICBjb2x1bW46IGluZGV4IC0gbGluZVN0YXJ0IC0gMlxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cblxuICAgICAgICB3aGlsZSAoaW5kZXggPCBsZW5ndGgpIHtcbiAgICAgICAgICAgIGNoID0gc291cmNlLmNoYXJDb2RlQXQoaW5kZXgpO1xuICAgICAgICAgICAgaWYgKGlzTGluZVRlcm1pbmF0b3IoY2gpKSB7XG4gICAgICAgICAgICAgICAgaWYgKGNoID09PSAweDBEICYmIHNvdXJjZS5jaGFyQ29kZUF0KGluZGV4ICsgMSkgPT09IDB4MEEpIHtcbiAgICAgICAgICAgICAgICAgICAgKytpbmRleDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaGFzTGluZVRlcm1pbmF0b3IgPSB0cnVlO1xuICAgICAgICAgICAgICAgICsrbGluZU51bWJlcjtcbiAgICAgICAgICAgICAgICArK2luZGV4O1xuICAgICAgICAgICAgICAgIGxpbmVTdGFydCA9IGluZGV4O1xuICAgICAgICAgICAgfSBlbHNlIGlmIChjaCA9PT0gMHgyQSkge1xuICAgICAgICAgICAgICAgIC8vIEJsb2NrIGNvbW1lbnQgZW5kcyB3aXRoICcqLycuXG4gICAgICAgICAgICAgICAgaWYgKHNvdXJjZS5jaGFyQ29kZUF0KGluZGV4ICsgMSkgPT09IDB4MkYpIHtcbiAgICAgICAgICAgICAgICAgICAgKytpbmRleDtcbiAgICAgICAgICAgICAgICAgICAgKytpbmRleDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGV4dHJhLmNvbW1lbnRzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb21tZW50ID0gc291cmNlLnNsaWNlKHN0YXJ0ICsgMiwgaW5kZXggLSAyKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxvYy5lbmQgPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZTogbGluZU51bWJlcixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2x1bW46IGluZGV4IC0gbGluZVN0YXJ0XG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICAgICAgYWRkQ29tbWVudCgnQmxvY2snLCBjb21tZW50LCBzdGFydCwgaW5kZXgsIGxvYyk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICArK2luZGV4O1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICArK2luZGV4O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgLy8gUmFuIG9mZiB0aGUgZW5kIG9mIHRoZSBmaWxlIC0gdGhlIHdob2xlIHRoaW5nIGlzIGEgY29tbWVudFxuICAgICAgICBpZiAoZXh0cmEuY29tbWVudHMpIHtcbiAgICAgICAgICAgIGxvYy5lbmQgPSB7XG4gICAgICAgICAgICAgICAgbGluZTogbGluZU51bWJlcixcbiAgICAgICAgICAgICAgICBjb2x1bW46IGluZGV4IC0gbGluZVN0YXJ0XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgY29tbWVudCA9IHNvdXJjZS5zbGljZShzdGFydCArIDIsIGluZGV4KTtcbiAgICAgICAgICAgIGFkZENvbW1lbnQoJ0Jsb2NrJywgY29tbWVudCwgc3RhcnQsIGluZGV4LCBsb2MpO1xuICAgICAgICB9XG4gICAgICAgIHRvbGVyYXRlVW5leHBlY3RlZFRva2VuKCk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gc2tpcENvbW1lbnQoKSB7XG4gICAgICAgIHZhciBjaCwgc3RhcnQ7XG4gICAgICAgIGhhc0xpbmVUZXJtaW5hdG9yID0gZmFsc2U7XG5cbiAgICAgICAgc3RhcnQgPSAoaW5kZXggPT09IDApO1xuICAgICAgICB3aGlsZSAoaW5kZXggPCBsZW5ndGgpIHtcbiAgICAgICAgICAgIGNoID0gc291cmNlLmNoYXJDb2RlQXQoaW5kZXgpO1xuXG4gICAgICAgICAgICBpZiAoaXNXaGl0ZVNwYWNlKGNoKSkge1xuICAgICAgICAgICAgICAgICsraW5kZXg7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGlzTGluZVRlcm1pbmF0b3IoY2gpKSB7XG4gICAgICAgICAgICAgICAgaGFzTGluZVRlcm1pbmF0b3IgPSB0cnVlO1xuICAgICAgICAgICAgICAgICsraW5kZXg7XG4gICAgICAgICAgICAgICAgaWYgKGNoID09PSAweDBEICYmIHNvdXJjZS5jaGFyQ29kZUF0KGluZGV4KSA9PT0gMHgwQSkge1xuICAgICAgICAgICAgICAgICAgICArK2luZGV4O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICArK2xpbmVOdW1iZXI7XG4gICAgICAgICAgICAgICAgbGluZVN0YXJ0ID0gaW5kZXg7XG4gICAgICAgICAgICAgICAgc3RhcnQgPSB0cnVlO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChjaCA9PT0gMHgyRikgeyAvLyBVKzAwMkYgaXMgJy8nXG4gICAgICAgICAgICAgICAgY2ggPSBzb3VyY2UuY2hhckNvZGVBdChpbmRleCArIDEpO1xuICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gMHgyRikge1xuICAgICAgICAgICAgICAgICAgICArK2luZGV4O1xuICAgICAgICAgICAgICAgICAgICArK2luZGV4O1xuICAgICAgICAgICAgICAgICAgICBza2lwU2luZ2xlTGluZUNvbW1lbnQoMik7XG4gICAgICAgICAgICAgICAgICAgIHN0YXJ0ID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGNoID09PSAweDJBKSB7ICAvLyBVKzAwMkEgaXMgJyonXG4gICAgICAgICAgICAgICAgICAgICsraW5kZXg7XG4gICAgICAgICAgICAgICAgICAgICsraW5kZXg7XG4gICAgICAgICAgICAgICAgICAgIHNraXBNdWx0aUxpbmVDb21tZW50KCk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIGlmIChzdGFydCAmJiBjaCA9PT0gMHgyRCkgeyAvLyBVKzAwMkQgaXMgJy0nXG4gICAgICAgICAgICAgICAgLy8gVSswMDNFIGlzICc+J1xuICAgICAgICAgICAgICAgIGlmICgoc291cmNlLmNoYXJDb2RlQXQoaW5kZXggKyAxKSA9PT0gMHgyRCkgJiYgKHNvdXJjZS5jaGFyQ29kZUF0KGluZGV4ICsgMikgPT09IDB4M0UpKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vICctLT4nIGlzIGEgc2luZ2xlLWxpbmUgY29tbWVudFxuICAgICAgICAgICAgICAgICAgICBpbmRleCArPSAzO1xuICAgICAgICAgICAgICAgICAgICBza2lwU2luZ2xlTGluZUNvbW1lbnQoMyk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIGlmIChjaCA9PT0gMHgzQykgeyAvLyBVKzAwM0MgaXMgJzwnXG4gICAgICAgICAgICAgICAgaWYgKHNvdXJjZS5zbGljZShpbmRleCArIDEsIGluZGV4ICsgNCkgPT09ICchLS0nKSB7XG4gICAgICAgICAgICAgICAgICAgICsraW5kZXg7IC8vIGA8YFxuICAgICAgICAgICAgICAgICAgICArK2luZGV4OyAvLyBgIWBcbiAgICAgICAgICAgICAgICAgICAgKytpbmRleDsgLy8gYC1gXG4gICAgICAgICAgICAgICAgICAgICsraW5kZXg7IC8vIGAtYFxuICAgICAgICAgICAgICAgICAgICBza2lwU2luZ2xlTGluZUNvbW1lbnQoNCk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIHNjYW5IZXhFc2NhcGUocHJlZml4KSB7XG4gICAgICAgIHZhciBpLCBsZW4sIGNoLCBjb2RlID0gMDtcblxuICAgICAgICBsZW4gPSAocHJlZml4ID09PSAndScpID8gNCA6IDI7XG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47ICsraSkge1xuICAgICAgICAgICAgaWYgKGluZGV4IDwgbGVuZ3RoICYmIGlzSGV4RGlnaXQoc291cmNlW2luZGV4XSkpIHtcbiAgICAgICAgICAgICAgICBjaCA9IHNvdXJjZVtpbmRleCsrXTtcbiAgICAgICAgICAgICAgICBjb2RlID0gY29kZSAqIDE2ICsgJzAxMjM0NTY3ODlhYmNkZWYnLmluZGV4T2YoY2gudG9Mb3dlckNhc2UoKSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiAnJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gU3RyaW5nLmZyb21DaGFyQ29kZShjb2RlKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBzY2FuVW5pY29kZUNvZGVQb2ludEVzY2FwZSgpIHtcbiAgICAgICAgdmFyIGNoLCBjb2RlLCBjdTEsIGN1MjtcblxuICAgICAgICBjaCA9IHNvdXJjZVtpbmRleF07XG4gICAgICAgIGNvZGUgPSAwO1xuXG4gICAgICAgIC8vIEF0IGxlYXN0LCBvbmUgaGV4IGRpZ2l0IGlzIHJlcXVpcmVkLlxuICAgICAgICBpZiAoY2ggPT09ICd9Jykge1xuICAgICAgICAgICAgdGhyb3dVbmV4cGVjdGVkVG9rZW4oKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHdoaWxlIChpbmRleCA8IGxlbmd0aCkge1xuICAgICAgICAgICAgY2ggPSBzb3VyY2VbaW5kZXgrK107XG4gICAgICAgICAgICBpZiAoIWlzSGV4RGlnaXQoY2gpKSB7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjb2RlID0gY29kZSAqIDE2ICsgJzAxMjM0NTY3ODlhYmNkZWYnLmluZGV4T2YoY2gudG9Mb3dlckNhc2UoKSk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoY29kZSA+IDB4MTBGRkZGIHx8IGNoICE9PSAnfScpIHtcbiAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKCk7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBVVEYtMTYgRW5jb2RpbmdcbiAgICAgICAgaWYgKGNvZGUgPD0gMHhGRkZGKSB7XG4gICAgICAgICAgICByZXR1cm4gU3RyaW5nLmZyb21DaGFyQ29kZShjb2RlKTtcbiAgICAgICAgfVxuICAgICAgICBjdTEgPSAoKGNvZGUgLSAweDEwMDAwKSA+PiAxMCkgKyAweEQ4MDA7XG4gICAgICAgIGN1MiA9ICgoY29kZSAtIDB4MTAwMDApICYgMTAyMykgKyAweERDMDA7XG4gICAgICAgIHJldHVybiBTdHJpbmcuZnJvbUNoYXJDb2RlKGN1MSwgY3UyKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBnZXRFc2NhcGVkSWRlbnRpZmllcigpIHtcbiAgICAgICAgdmFyIGNoLCBpZDtcblxuICAgICAgICBjaCA9IHNvdXJjZS5jaGFyQ29kZUF0KGluZGV4KyspO1xuICAgICAgICBpZCA9IFN0cmluZy5mcm9tQ2hhckNvZGUoY2gpO1xuXG4gICAgICAgIC8vICdcXHUnIChVKzAwNUMsIFUrMDA3NSkgZGVub3RlcyBhbiBlc2NhcGVkIGNoYXJhY3Rlci5cbiAgICAgICAgaWYgKGNoID09PSAweDVDKSB7XG4gICAgICAgICAgICBpZiAoc291cmNlLmNoYXJDb2RlQXQoaW5kZXgpICE9PSAweDc1KSB7XG4gICAgICAgICAgICAgICAgdGhyb3dVbmV4cGVjdGVkVG9rZW4oKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgICsraW5kZXg7XG4gICAgICAgICAgICBjaCA9IHNjYW5IZXhFc2NhcGUoJ3UnKTtcbiAgICAgICAgICAgIGlmICghY2ggfHwgY2ggPT09ICdcXFxcJyB8fCAhaXNJZGVudGlmaWVyU3RhcnQoY2guY2hhckNvZGVBdCgwKSkpIHtcbiAgICAgICAgICAgICAgICB0aHJvd1VuZXhwZWN0ZWRUb2tlbigpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWQgPSBjaDtcbiAgICAgICAgfVxuXG4gICAgICAgIHdoaWxlIChpbmRleCA8IGxlbmd0aCkge1xuICAgICAgICAgICAgY2ggPSBzb3VyY2UuY2hhckNvZGVBdChpbmRleCk7XG4gICAgICAgICAgICBpZiAoIWlzSWRlbnRpZmllclBhcnQoY2gpKSB7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICArK2luZGV4O1xuICAgICAgICAgICAgaWQgKz0gU3RyaW5nLmZyb21DaGFyQ29kZShjaCk7XG5cbiAgICAgICAgICAgIC8vICdcXHUnIChVKzAwNUMsIFUrMDA3NSkgZGVub3RlcyBhbiBlc2NhcGVkIGNoYXJhY3Rlci5cbiAgICAgICAgICAgIGlmIChjaCA9PT0gMHg1Qykge1xuICAgICAgICAgICAgICAgIGlkID0gaWQuc3Vic3RyKDAsIGlkLmxlbmd0aCAtIDEpO1xuICAgICAgICAgICAgICAgIGlmIChzb3VyY2UuY2hhckNvZGVBdChpbmRleCkgIT09IDB4NzUpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3dVbmV4cGVjdGVkVG9rZW4oKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgKytpbmRleDtcbiAgICAgICAgICAgICAgICBjaCA9IHNjYW5IZXhFc2NhcGUoJ3UnKTtcbiAgICAgICAgICAgICAgICBpZiAoIWNoIHx8IGNoID09PSAnXFxcXCcgfHwgIWlzSWRlbnRpZmllclBhcnQoY2guY2hhckNvZGVBdCgwKSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3dVbmV4cGVjdGVkVG9rZW4oKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWQgKz0gY2g7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gaWQ7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gZ2V0SWRlbnRpZmllcigpIHtcbiAgICAgICAgdmFyIHN0YXJ0LCBjaDtcblxuICAgICAgICBzdGFydCA9IGluZGV4Kys7XG4gICAgICAgIHdoaWxlIChpbmRleCA8IGxlbmd0aCkge1xuICAgICAgICAgICAgY2ggPSBzb3VyY2UuY2hhckNvZGVBdChpbmRleCk7XG4gICAgICAgICAgICBpZiAoY2ggPT09IDB4NUMpIHtcbiAgICAgICAgICAgICAgICAvLyBCbGFja3NsYXNoIChVKzAwNUMpIG1hcmtzIFVuaWNvZGUgZXNjYXBlIHNlcXVlbmNlLlxuICAgICAgICAgICAgICAgIGluZGV4ID0gc3RhcnQ7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGdldEVzY2FwZWRJZGVudGlmaWVyKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoaXNJZGVudGlmaWVyUGFydChjaCkpIHtcbiAgICAgICAgICAgICAgICArK2luZGV4O1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBzb3VyY2Uuc2xpY2Uoc3RhcnQsIGluZGV4KTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBzY2FuSWRlbnRpZmllcigpIHtcbiAgICAgICAgdmFyIHN0YXJ0LCBpZCwgdHlwZTtcblxuICAgICAgICBzdGFydCA9IGluZGV4O1xuXG4gICAgICAgIC8vIEJhY2tzbGFzaCAoVSswMDVDKSBzdGFydHMgYW4gZXNjYXBlZCBjaGFyYWN0ZXIuXG4gICAgICAgIGlkID0gKHNvdXJjZS5jaGFyQ29kZUF0KGluZGV4KSA9PT0gMHg1QykgPyBnZXRFc2NhcGVkSWRlbnRpZmllcigpIDogZ2V0SWRlbnRpZmllcigpO1xuXG4gICAgICAgIC8vIFRoZXJlIGlzIG5vIGtleXdvcmQgb3IgbGl0ZXJhbCB3aXRoIG9ubHkgb25lIGNoYXJhY3Rlci5cbiAgICAgICAgLy8gVGh1cywgaXQgbXVzdCBiZSBhbiBpZGVudGlmaWVyLlxuICAgICAgICBpZiAoaWQubGVuZ3RoID09PSAxKSB7XG4gICAgICAgICAgICB0eXBlID0gVG9rZW4uSWRlbnRpZmllcjtcbiAgICAgICAgfSBlbHNlIGlmIChpc0tleXdvcmQoaWQpKSB7XG4gICAgICAgICAgICB0eXBlID0gVG9rZW4uS2V5d29yZDtcbiAgICAgICAgfSBlbHNlIGlmIChpZCA9PT0gJ251bGwnKSB7XG4gICAgICAgICAgICB0eXBlID0gVG9rZW4uTnVsbExpdGVyYWw7XG4gICAgICAgIH0gZWxzZSBpZiAoaWQgPT09ICd0cnVlJyB8fCBpZCA9PT0gJ2ZhbHNlJykge1xuICAgICAgICAgICAgdHlwZSA9IFRva2VuLkJvb2xlYW5MaXRlcmFsO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdHlwZSA9IFRva2VuLklkZW50aWZpZXI7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgdHlwZTogdHlwZSxcbiAgICAgICAgICAgIHZhbHVlOiBpZCxcbiAgICAgICAgICAgIGxpbmVOdW1iZXI6IGxpbmVOdW1iZXIsXG4gICAgICAgICAgICBsaW5lU3RhcnQ6IGxpbmVTdGFydCxcbiAgICAgICAgICAgIHN0YXJ0OiBzdGFydCxcbiAgICAgICAgICAgIGVuZDogaW5kZXhcbiAgICAgICAgfTtcbiAgICB9XG5cblxuICAgIC8vIDcuNyBQdW5jdHVhdG9yc1xuXG4gICAgZnVuY3Rpb24gc2NhblB1bmN0dWF0b3IoKSB7XG4gICAgICAgIHZhciB0b2tlbiwgc3RyO1xuXG4gICAgICAgIHRva2VuID0ge1xuICAgICAgICAgICAgdHlwZTogVG9rZW4uUHVuY3R1YXRvcixcbiAgICAgICAgICAgIHZhbHVlOiAnJyxcbiAgICAgICAgICAgIGxpbmVOdW1iZXI6IGxpbmVOdW1iZXIsXG4gICAgICAgICAgICBsaW5lU3RhcnQ6IGxpbmVTdGFydCxcbiAgICAgICAgICAgIHN0YXJ0OiBpbmRleCxcbiAgICAgICAgICAgIGVuZDogaW5kZXhcbiAgICAgICAgfTtcblxuICAgICAgICAvLyBDaGVjayBmb3IgbW9zdCBjb21tb24gc2luZ2xlLWNoYXJhY3RlciBwdW5jdHVhdG9ycy5cbiAgICAgICAgc3RyID0gc291cmNlW2luZGV4XTtcbiAgICAgICAgc3dpdGNoIChzdHIpIHtcblxuICAgICAgICBjYXNlICcoJzpcbiAgICAgICAgICAgIGlmIChleHRyYS50b2tlbml6ZSkge1xuICAgICAgICAgICAgICAgIGV4dHJhLm9wZW5QYXJlblRva2VuID0gZXh0cmEudG9rZW5zLmxlbmd0aDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgICsraW5kZXg7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlICd7JzpcbiAgICAgICAgICAgIGlmIChleHRyYS50b2tlbml6ZSkge1xuICAgICAgICAgICAgICAgIGV4dHJhLm9wZW5DdXJseVRva2VuID0gZXh0cmEudG9rZW5zLmxlbmd0aDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHN0YXRlLmN1cmx5U3RhY2sucHVzaCgneycpO1xuICAgICAgICAgICAgKytpbmRleDtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgJy4nOlxuICAgICAgICAgICAgKytpbmRleDtcbiAgICAgICAgICAgIGlmIChzb3VyY2VbaW5kZXhdID09PSAnLicgJiYgc291cmNlW2luZGV4ICsgMV0gPT09ICcuJykge1xuICAgICAgICAgICAgICAgIC8vIFNwcmVhZCBvcGVyYXRvcjogLi4uXG4gICAgICAgICAgICAgICAgaW5kZXggKz0gMjtcbiAgICAgICAgICAgICAgICBzdHIgPSAnLi4uJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgJ30nOlxuICAgICAgICAgICAgKytpbmRleDtcbiAgICAgICAgICAgIHN0YXRlLmN1cmx5U3RhY2sucG9wKCk7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAnKSc6XG4gICAgICAgIGNhc2UgJzsnOlxuICAgICAgICBjYXNlICcsJzpcbiAgICAgICAgY2FzZSAnWyc6XG4gICAgICAgIGNhc2UgJ10nOlxuICAgICAgICBjYXNlICc6JzpcbiAgICAgICAgY2FzZSAnPyc6XG4gICAgICAgIGNhc2UgJ34nOlxuICAgICAgICAgICAgKytpbmRleDtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAvLyA0LWNoYXJhY3RlciBwdW5jdHVhdG9yLlxuICAgICAgICAgICAgc3RyID0gc291cmNlLnN1YnN0cihpbmRleCwgNCk7XG4gICAgICAgICAgICBpZiAoc3RyID09PSAnPj4+PScpIHtcbiAgICAgICAgICAgICAgICBpbmRleCArPSA0O1xuICAgICAgICAgICAgfSBlbHNlIHtcblxuICAgICAgICAgICAgICAgIC8vIDMtY2hhcmFjdGVyIHB1bmN0dWF0b3JzLlxuICAgICAgICAgICAgICAgIHN0ciA9IHN0ci5zdWJzdHIoMCwgMyk7XG4gICAgICAgICAgICAgICAgaWYgKHN0ciA9PT0gJz09PScgfHwgc3RyID09PSAnIT09JyB8fCBzdHIgPT09ICc+Pj4nIHx8XG4gICAgICAgICAgICAgICAgICAgIHN0ciA9PT0gJzw8PScgfHwgc3RyID09PSAnPj49Jykge1xuICAgICAgICAgICAgICAgICAgICBpbmRleCArPSAzO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG5cbiAgICAgICAgICAgICAgICAgICAgLy8gMi1jaGFyYWN0ZXIgcHVuY3R1YXRvcnMuXG4gICAgICAgICAgICAgICAgICAgIHN0ciA9IHN0ci5zdWJzdHIoMCwgMik7XG4gICAgICAgICAgICAgICAgICAgIGlmIChzdHIgPT09ICcmJicgfHwgc3RyID09PSAnfHwnIHx8IHN0ciA9PT0gJz09JyB8fCBzdHIgPT09ICchPScgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0ciA9PT0gJys9JyB8fCBzdHIgPT09ICctPScgfHwgc3RyID09PSAnKj0nIHx8IHN0ciA9PT0gJy89JyB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgc3RyID09PSAnKysnIHx8IHN0ciA9PT0gJy0tJyB8fCBzdHIgPT09ICc8PCcgfHwgc3RyID09PSAnPj4nIHx8XG4gICAgICAgICAgICAgICAgICAgICAgICBzdHIgPT09ICcmPScgfHwgc3RyID09PSAnfD0nIHx8IHN0ciA9PT0gJ149JyB8fCBzdHIgPT09ICclPScgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0ciA9PT0gJzw9JyB8fCBzdHIgPT09ICc+PScgfHwgc3RyID09PSAnPT4nKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpbmRleCArPSAyO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyAxLWNoYXJhY3RlciBwdW5jdHVhdG9ycy5cbiAgICAgICAgICAgICAgICAgICAgICAgIHN0ciA9IHNvdXJjZVtpbmRleF07XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoJzw+PSErLSolJnxeLycuaW5kZXhPZihzdHIpID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICArK2luZGV4O1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGluZGV4ID09PSB0b2tlbi5zdGFydCkge1xuICAgICAgICAgICAgdGhyb3dVbmV4cGVjdGVkVG9rZW4oKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHRva2VuLmVuZCA9IGluZGV4O1xuICAgICAgICB0b2tlbi52YWx1ZSA9IHN0cjtcbiAgICAgICAgcmV0dXJuIHRva2VuO1xuICAgIH1cblxuICAgIC8vIDcuOC4zIE51bWVyaWMgTGl0ZXJhbHNcblxuICAgIGZ1bmN0aW9uIHNjYW5IZXhMaXRlcmFsKHN0YXJ0KSB7XG4gICAgICAgIHZhciBudW1iZXIgPSAnJztcblxuICAgICAgICB3aGlsZSAoaW5kZXggPCBsZW5ndGgpIHtcbiAgICAgICAgICAgIGlmICghaXNIZXhEaWdpdChzb3VyY2VbaW5kZXhdKSkge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbnVtYmVyICs9IHNvdXJjZVtpbmRleCsrXTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChudW1iZXIubGVuZ3RoID09PSAwKSB7XG4gICAgICAgICAgICB0aHJvd1VuZXhwZWN0ZWRUb2tlbigpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGlzSWRlbnRpZmllclN0YXJ0KHNvdXJjZS5jaGFyQ29kZUF0KGluZGV4KSkpIHtcbiAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKCk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgdHlwZTogVG9rZW4uTnVtZXJpY0xpdGVyYWwsXG4gICAgICAgICAgICB2YWx1ZTogcGFyc2VJbnQoJzB4JyArIG51bWJlciwgMTYpLFxuICAgICAgICAgICAgbGluZU51bWJlcjogbGluZU51bWJlcixcbiAgICAgICAgICAgIGxpbmVTdGFydDogbGluZVN0YXJ0LFxuICAgICAgICAgICAgc3RhcnQ6IHN0YXJ0LFxuICAgICAgICAgICAgZW5kOiBpbmRleFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHNjYW5CaW5hcnlMaXRlcmFsKHN0YXJ0KSB7XG4gICAgICAgIHZhciBjaCwgbnVtYmVyO1xuXG4gICAgICAgIG51bWJlciA9ICcnO1xuXG4gICAgICAgIHdoaWxlIChpbmRleCA8IGxlbmd0aCkge1xuICAgICAgICAgICAgY2ggPSBzb3VyY2VbaW5kZXhdO1xuICAgICAgICAgICAgaWYgKGNoICE9PSAnMCcgJiYgY2ggIT09ICcxJykge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbnVtYmVyICs9IHNvdXJjZVtpbmRleCsrXTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChudW1iZXIubGVuZ3RoID09PSAwKSB7XG4gICAgICAgICAgICAvLyBvbmx5IDBiIG9yIDBCXG4gICAgICAgICAgICB0aHJvd1VuZXhwZWN0ZWRUb2tlbigpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGluZGV4IDwgbGVuZ3RoKSB7XG4gICAgICAgICAgICBjaCA9IHNvdXJjZS5jaGFyQ29kZUF0KGluZGV4KTtcbiAgICAgICAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBlbHNlICovXG4gICAgICAgICAgICBpZiAoaXNJZGVudGlmaWVyU3RhcnQoY2gpIHx8IGlzRGVjaW1hbERpZ2l0KGNoKSkge1xuICAgICAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgdHlwZTogVG9rZW4uTnVtZXJpY0xpdGVyYWwsXG4gICAgICAgICAgICB2YWx1ZTogcGFyc2VJbnQobnVtYmVyLCAyKSxcbiAgICAgICAgICAgIGxpbmVOdW1iZXI6IGxpbmVOdW1iZXIsXG4gICAgICAgICAgICBsaW5lU3RhcnQ6IGxpbmVTdGFydCxcbiAgICAgICAgICAgIHN0YXJ0OiBzdGFydCxcbiAgICAgICAgICAgIGVuZDogaW5kZXhcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBzY2FuT2N0YWxMaXRlcmFsKHByZWZpeCwgc3RhcnQpIHtcbiAgICAgICAgdmFyIG51bWJlciwgb2N0YWw7XG5cbiAgICAgICAgaWYgKGlzT2N0YWxEaWdpdChwcmVmaXgpKSB7XG4gICAgICAgICAgICBvY3RhbCA9IHRydWU7XG4gICAgICAgICAgICBudW1iZXIgPSAnMCcgKyBzb3VyY2VbaW5kZXgrK107XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBvY3RhbCA9IGZhbHNlO1xuICAgICAgICAgICAgKytpbmRleDtcbiAgICAgICAgICAgIG51bWJlciA9ICcnO1xuICAgICAgICB9XG5cbiAgICAgICAgd2hpbGUgKGluZGV4IDwgbGVuZ3RoKSB7XG4gICAgICAgICAgICBpZiAoIWlzT2N0YWxEaWdpdChzb3VyY2VbaW5kZXhdKSkge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbnVtYmVyICs9IHNvdXJjZVtpbmRleCsrXTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghb2N0YWwgJiYgbnVtYmVyLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgLy8gb25seSAwbyBvciAwT1xuICAgICAgICAgICAgdGhyb3dVbmV4cGVjdGVkVG9rZW4oKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChpc0lkZW50aWZpZXJTdGFydChzb3VyY2UuY2hhckNvZGVBdChpbmRleCkpIHx8IGlzRGVjaW1hbERpZ2l0KHNvdXJjZS5jaGFyQ29kZUF0KGluZGV4KSkpIHtcbiAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKCk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgdHlwZTogVG9rZW4uTnVtZXJpY0xpdGVyYWwsXG4gICAgICAgICAgICB2YWx1ZTogcGFyc2VJbnQobnVtYmVyLCA4KSxcbiAgICAgICAgICAgIG9jdGFsOiBvY3RhbCxcbiAgICAgICAgICAgIGxpbmVOdW1iZXI6IGxpbmVOdW1iZXIsXG4gICAgICAgICAgICBsaW5lU3RhcnQ6IGxpbmVTdGFydCxcbiAgICAgICAgICAgIHN0YXJ0OiBzdGFydCxcbiAgICAgICAgICAgIGVuZDogaW5kZXhcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBpc0ltcGxpY2l0T2N0YWxMaXRlcmFsKCkge1xuICAgICAgICB2YXIgaSwgY2g7XG5cbiAgICAgICAgLy8gSW1wbGljaXQgb2N0YWwsIHVubGVzcyB0aGVyZSBpcyBhIG5vbi1vY3RhbCBkaWdpdC5cbiAgICAgICAgLy8gKEFubmV4IEIuMS4xIG9uIE51bWVyaWMgTGl0ZXJhbHMpXG4gICAgICAgIGZvciAoaSA9IGluZGV4ICsgMTsgaSA8IGxlbmd0aDsgKytpKSB7XG4gICAgICAgICAgICBjaCA9IHNvdXJjZVtpXTtcbiAgICAgICAgICAgIGlmIChjaCA9PT0gJzgnIHx8IGNoID09PSAnOScpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoIWlzT2N0YWxEaWdpdChjaCkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHNjYW5OdW1lcmljTGl0ZXJhbCgpIHtcbiAgICAgICAgdmFyIG51bWJlciwgc3RhcnQsIGNoO1xuXG4gICAgICAgIGNoID0gc291cmNlW2luZGV4XTtcbiAgICAgICAgYXNzZXJ0KGlzRGVjaW1hbERpZ2l0KGNoLmNoYXJDb2RlQXQoMCkpIHx8IChjaCA9PT0gJy4nKSxcbiAgICAgICAgICAgICdOdW1lcmljIGxpdGVyYWwgbXVzdCBzdGFydCB3aXRoIGEgZGVjaW1hbCBkaWdpdCBvciBhIGRlY2ltYWwgcG9pbnQnKTtcblxuICAgICAgICBzdGFydCA9IGluZGV4O1xuICAgICAgICBudW1iZXIgPSAnJztcbiAgICAgICAgaWYgKGNoICE9PSAnLicpIHtcbiAgICAgICAgICAgIG51bWJlciA9IHNvdXJjZVtpbmRleCsrXTtcbiAgICAgICAgICAgIGNoID0gc291cmNlW2luZGV4XTtcblxuICAgICAgICAgICAgLy8gSGV4IG51bWJlciBzdGFydHMgd2l0aCAnMHgnLlxuICAgICAgICAgICAgLy8gT2N0YWwgbnVtYmVyIHN0YXJ0cyB3aXRoICcwJy5cbiAgICAgICAgICAgIC8vIE9jdGFsIG51bWJlciBpbiBFUzYgc3RhcnRzIHdpdGggJzBvJy5cbiAgICAgICAgICAgIC8vIEJpbmFyeSBudW1iZXIgaW4gRVM2IHN0YXJ0cyB3aXRoICcwYicuXG4gICAgICAgICAgICBpZiAobnVtYmVyID09PSAnMCcpIHtcbiAgICAgICAgICAgICAgICBpZiAoY2ggPT09ICd4JyB8fCBjaCA9PT0gJ1gnKSB7XG4gICAgICAgICAgICAgICAgICAgICsraW5kZXg7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBzY2FuSGV4TGl0ZXJhbChzdGFydCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gJ2InIHx8IGNoID09PSAnQicpIHtcbiAgICAgICAgICAgICAgICAgICAgKytpbmRleDtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNjYW5CaW5hcnlMaXRlcmFsKHN0YXJ0KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGNoID09PSAnbycgfHwgY2ggPT09ICdPJykge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2Nhbk9jdGFsTGl0ZXJhbChjaCwgc3RhcnQpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmIChpc09jdGFsRGlnaXQoY2gpKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChpc0ltcGxpY2l0T2N0YWxMaXRlcmFsKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzY2FuT2N0YWxMaXRlcmFsKGNoLCBzdGFydCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHdoaWxlIChpc0RlY2ltYWxEaWdpdChzb3VyY2UuY2hhckNvZGVBdChpbmRleCkpKSB7XG4gICAgICAgICAgICAgICAgbnVtYmVyICs9IHNvdXJjZVtpbmRleCsrXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNoID0gc291cmNlW2luZGV4XTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChjaCA9PT0gJy4nKSB7XG4gICAgICAgICAgICBudW1iZXIgKz0gc291cmNlW2luZGV4KytdO1xuICAgICAgICAgICAgd2hpbGUgKGlzRGVjaW1hbERpZ2l0KHNvdXJjZS5jaGFyQ29kZUF0KGluZGV4KSkpIHtcbiAgICAgICAgICAgICAgICBudW1iZXIgKz0gc291cmNlW2luZGV4KytdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY2ggPSBzb3VyY2VbaW5kZXhdO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGNoID09PSAnZScgfHwgY2ggPT09ICdFJykge1xuICAgICAgICAgICAgbnVtYmVyICs9IHNvdXJjZVtpbmRleCsrXTtcblxuICAgICAgICAgICAgY2ggPSBzb3VyY2VbaW5kZXhdO1xuICAgICAgICAgICAgaWYgKGNoID09PSAnKycgfHwgY2ggPT09ICctJykge1xuICAgICAgICAgICAgICAgIG51bWJlciArPSBzb3VyY2VbaW5kZXgrK107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoaXNEZWNpbWFsRGlnaXQoc291cmNlLmNoYXJDb2RlQXQoaW5kZXgpKSkge1xuICAgICAgICAgICAgICAgIHdoaWxlIChpc0RlY2ltYWxEaWdpdChzb3VyY2UuY2hhckNvZGVBdChpbmRleCkpKSB7XG4gICAgICAgICAgICAgICAgICAgIG51bWJlciArPSBzb3VyY2VbaW5kZXgrK107XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aHJvd1VuZXhwZWN0ZWRUb2tlbigpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGlzSWRlbnRpZmllclN0YXJ0KHNvdXJjZS5jaGFyQ29kZUF0KGluZGV4KSkpIHtcbiAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKCk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgdHlwZTogVG9rZW4uTnVtZXJpY0xpdGVyYWwsXG4gICAgICAgICAgICB2YWx1ZTogcGFyc2VGbG9hdChudW1iZXIpLFxuICAgICAgICAgICAgbGluZU51bWJlcjogbGluZU51bWJlcixcbiAgICAgICAgICAgIGxpbmVTdGFydDogbGluZVN0YXJ0LFxuICAgICAgICAgICAgc3RhcnQ6IHN0YXJ0LFxuICAgICAgICAgICAgZW5kOiBpbmRleFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIC8vIDcuOC40IFN0cmluZyBMaXRlcmFsc1xuXG4gICAgZnVuY3Rpb24gc2NhblN0cmluZ0xpdGVyYWwoKSB7XG4gICAgICAgIHZhciBzdHIgPSAnJywgcXVvdGUsIHN0YXJ0LCBjaCwgdW5lc2NhcGVkLCBvY3RUb0RlYywgb2N0YWwgPSBmYWxzZTtcblxuICAgICAgICBxdW90ZSA9IHNvdXJjZVtpbmRleF07XG4gICAgICAgIGFzc2VydCgocXVvdGUgPT09ICdcXCcnIHx8IHF1b3RlID09PSAnXCInKSxcbiAgICAgICAgICAgICdTdHJpbmcgbGl0ZXJhbCBtdXN0IHN0YXJ0cyB3aXRoIGEgcXVvdGUnKTtcblxuICAgICAgICBzdGFydCA9IGluZGV4O1xuICAgICAgICArK2luZGV4O1xuXG4gICAgICAgIHdoaWxlIChpbmRleCA8IGxlbmd0aCkge1xuICAgICAgICAgICAgY2ggPSBzb3VyY2VbaW5kZXgrK107XG5cbiAgICAgICAgICAgIGlmIChjaCA9PT0gcXVvdGUpIHtcbiAgICAgICAgICAgICAgICBxdW90ZSA9ICcnO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChjaCA9PT0gJ1xcXFwnKSB7XG4gICAgICAgICAgICAgICAgY2ggPSBzb3VyY2VbaW5kZXgrK107XG4gICAgICAgICAgICAgICAgaWYgKCFjaCB8fCAhaXNMaW5lVGVybWluYXRvcihjaC5jaGFyQ29kZUF0KDApKSkge1xuICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKGNoKSB7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ3UnOlxuICAgICAgICAgICAgICAgICAgICBjYXNlICd4JzpcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzb3VyY2VbaW5kZXhdID09PSAneycpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICArK2luZGV4O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0ciArPSBzY2FuVW5pY29kZUNvZGVQb2ludEVzY2FwZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bmVzY2FwZWQgPSBzY2FuSGV4RXNjYXBlKGNoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXVuZXNjYXBlZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyB0aHJvd1VuZXhwZWN0ZWRUb2tlbigpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHIgKz0gdW5lc2NhcGVkO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ24nOlxuICAgICAgICAgICAgICAgICAgICAgICAgc3RyICs9ICdcXG4nO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ3InOlxuICAgICAgICAgICAgICAgICAgICAgICAgc3RyICs9ICdcXHInO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ3QnOlxuICAgICAgICAgICAgICAgICAgICAgICAgc3RyICs9ICdcXHQnO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ2InOlxuICAgICAgICAgICAgICAgICAgICAgICAgc3RyICs9ICdcXGInO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ2YnOlxuICAgICAgICAgICAgICAgICAgICAgICAgc3RyICs9ICdcXGYnO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ3YnOlxuICAgICAgICAgICAgICAgICAgICAgICAgc3RyICs9ICdcXHgwQic7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnOCc6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJzknOlxuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgdGhyb3dVbmV4cGVjdGVkVG9rZW4oKTtcblxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzT2N0YWxEaWdpdChjaCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvY3RUb0RlYyA9IG9jdGFsVG9EZWNpbWFsKGNoKTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9jdGFsID0gb2N0VG9EZWMub2N0YWwgfHwgb2N0YWw7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyICs9IFN0cmluZy5mcm9tQ2hhckNvZGUob2N0VG9EZWMuY29kZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0ciArPSBjaDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgKytsaW5lTnVtYmVyO1xuICAgICAgICAgICAgICAgICAgICBpZiAoY2ggPT09ICdcXHInICYmIHNvdXJjZVtpbmRleF0gPT09ICdcXG4nKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICArK2luZGV4O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGxpbmVTdGFydCA9IGluZGV4O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaXNMaW5lVGVybWluYXRvcihjaC5jaGFyQ29kZUF0KDApKSkge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBzdHIgKz0gY2g7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAocXVvdGUgIT09ICcnKSB7XG4gICAgICAgICAgICB0aHJvd1VuZXhwZWN0ZWRUb2tlbigpO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIHR5cGU6IFRva2VuLlN0cmluZ0xpdGVyYWwsXG4gICAgICAgICAgICB2YWx1ZTogc3RyLFxuICAgICAgICAgICAgb2N0YWw6IG9jdGFsLFxuICAgICAgICAgICAgbGluZU51bWJlcjogc3RhcnRMaW5lTnVtYmVyLFxuICAgICAgICAgICAgbGluZVN0YXJ0OiBzdGFydExpbmVTdGFydCxcbiAgICAgICAgICAgIHN0YXJ0OiBzdGFydCxcbiAgICAgICAgICAgIGVuZDogaW5kZXhcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBzY2FuVGVtcGxhdGUoKSB7XG4gICAgICAgIHZhciBjb29rZWQgPSAnJywgY2gsIHN0YXJ0LCByYXdPZmZzZXQsIHRlcm1pbmF0ZWQsIGhlYWQsIHRhaWwsIHJlc3RvcmUsIHVuZXNjYXBlZDtcblxuICAgICAgICB0ZXJtaW5hdGVkID0gZmFsc2U7XG4gICAgICAgIHRhaWwgPSBmYWxzZTtcbiAgICAgICAgc3RhcnQgPSBpbmRleDtcbiAgICAgICAgaGVhZCA9IChzb3VyY2VbaW5kZXhdID09PSAnYCcpO1xuICAgICAgICByYXdPZmZzZXQgPSAyO1xuXG4gICAgICAgICsraW5kZXg7XG5cbiAgICAgICAgd2hpbGUgKGluZGV4IDwgbGVuZ3RoKSB7XG4gICAgICAgICAgICBjaCA9IHNvdXJjZVtpbmRleCsrXTtcbiAgICAgICAgICAgIGlmIChjaCA9PT0gJ2AnKSB7XG4gICAgICAgICAgICAgICAgcmF3T2Zmc2V0ID0gMTtcbiAgICAgICAgICAgICAgICB0YWlsID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICB0ZXJtaW5hdGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoY2ggPT09ICckJykge1xuICAgICAgICAgICAgICAgIGlmIChzb3VyY2VbaW5kZXhdID09PSAneycpIHtcbiAgICAgICAgICAgICAgICAgICAgc3RhdGUuY3VybHlTdGFjay5wdXNoKCckeycpO1xuICAgICAgICAgICAgICAgICAgICArK2luZGV4O1xuICAgICAgICAgICAgICAgICAgICB0ZXJtaW5hdGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNvb2tlZCArPSBjaDtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoY2ggPT09ICdcXFxcJykge1xuICAgICAgICAgICAgICAgIGNoID0gc291cmNlW2luZGV4KytdO1xuICAgICAgICAgICAgICAgIGlmICghaXNMaW5lVGVybWluYXRvcihjaC5jaGFyQ29kZUF0KDApKSkge1xuICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKGNoKSB7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ24nOlxuICAgICAgICAgICAgICAgICAgICAgICAgY29va2VkICs9ICdcXG4nO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ3InOlxuICAgICAgICAgICAgICAgICAgICAgICAgY29va2VkICs9ICdcXHInO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ3QnOlxuICAgICAgICAgICAgICAgICAgICAgICAgY29va2VkICs9ICdcXHQnO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ3UnOlxuICAgICAgICAgICAgICAgICAgICBjYXNlICd4JzpcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzb3VyY2VbaW5kZXhdID09PSAneycpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICArK2luZGV4O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvb2tlZCArPSBzY2FuVW5pY29kZUNvZGVQb2ludEVzY2FwZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN0b3JlID0gaW5kZXg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5lc2NhcGVkID0gc2NhbkhleEVzY2FwZShjaCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVuZXNjYXBlZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb29rZWQgKz0gdW5lc2NhcGVkO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4ID0gcmVzdG9yZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29va2VkICs9IGNoO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICBjYXNlICdiJzpcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvb2tlZCArPSAnXFxiJztcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICBjYXNlICdmJzpcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvb2tlZCArPSAnXFxmJztcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICBjYXNlICd2JzpcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvb2tlZCArPSAnXFx2JztcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2ggPT09ICcwJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc0RlY2ltYWxEaWdpdChzb3VyY2UuY2hhckNvZGVBdChpbmRleCkpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIElsbGVnYWw6IFxcMDEgXFwwMiBhbmQgc28gb25cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3dFcnJvcihNZXNzYWdlcy5UZW1wbGF0ZU9jdGFsTGl0ZXJhbCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvb2tlZCArPSAnXFwwJztcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaXNPY3RhbERpZ2l0KGNoKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIElsbGVnYWw6IFxcMSBcXDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvd0Vycm9yKE1lc3NhZ2VzLlRlbXBsYXRlT2N0YWxMaXRlcmFsKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29va2VkICs9IGNoO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICArK2xpbmVOdW1iZXI7XG4gICAgICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gJ1xccicgJiYgc291cmNlW2luZGV4XSA9PT0gJ1xcbicpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICsraW5kZXg7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgbGluZVN0YXJ0ID0gaW5kZXg7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIGlmIChpc0xpbmVUZXJtaW5hdG9yKGNoLmNoYXJDb2RlQXQoMCkpKSB7XG4gICAgICAgICAgICAgICAgKytsaW5lTnVtYmVyO1xuICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gJ1xccicgJiYgc291cmNlW2luZGV4XSA9PT0gJ1xcbicpIHtcbiAgICAgICAgICAgICAgICAgICAgKytpbmRleDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgbGluZVN0YXJ0ID0gaW5kZXg7XG4gICAgICAgICAgICAgICAgY29va2VkICs9ICdcXG4nO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBjb29rZWQgKz0gY2g7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIXRlcm1pbmF0ZWQpIHtcbiAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKCk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIWhlYWQpIHtcbiAgICAgICAgICAgIHN0YXRlLmN1cmx5U3RhY2sucG9wKCk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgdHlwZTogVG9rZW4uVGVtcGxhdGUsXG4gICAgICAgICAgICB2YWx1ZToge1xuICAgICAgICAgICAgICAgIGNvb2tlZDogY29va2VkLFxuICAgICAgICAgICAgICAgIHJhdzogc291cmNlLnNsaWNlKHN0YXJ0ICsgMSwgaW5kZXggLSByYXdPZmZzZXQpXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgaGVhZDogaGVhZCxcbiAgICAgICAgICAgIHRhaWw6IHRhaWwsXG4gICAgICAgICAgICBsaW5lTnVtYmVyOiBsaW5lTnVtYmVyLFxuICAgICAgICAgICAgbGluZVN0YXJ0OiBsaW5lU3RhcnQsXG4gICAgICAgICAgICBzdGFydDogc3RhcnQsXG4gICAgICAgICAgICBlbmQ6IGluZGV4XG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gdGVzdFJlZ0V4cChwYXR0ZXJuLCBmbGFncykge1xuICAgICAgICB2YXIgdG1wID0gcGF0dGVybjtcblxuICAgICAgICBpZiAoZmxhZ3MuaW5kZXhPZigndScpID49IDApIHtcbiAgICAgICAgICAgIC8vIFJlcGxhY2UgZWFjaCBhc3RyYWwgc3ltYm9sIGFuZCBldmVyeSBVbmljb2RlIGVzY2FwZSBzZXF1ZW5jZVxuICAgICAgICAgICAgLy8gdGhhdCBwb3NzaWJseSByZXByZXNlbnRzIGFuIGFzdHJhbCBzeW1ib2wgb3IgYSBwYWlyZWQgc3Vycm9nYXRlXG4gICAgICAgICAgICAvLyB3aXRoIGEgc2luZ2xlIEFTQ0lJIHN5bWJvbCB0byBhdm9pZCB0aHJvd2luZyBvbiByZWd1bGFyXG4gICAgICAgICAgICAvLyBleHByZXNzaW9ucyB0aGF0IGFyZSBvbmx5IHZhbGlkIGluIGNvbWJpbmF0aW9uIHdpdGggdGhlIGAvdWBcbiAgICAgICAgICAgIC8vIGZsYWcuXG4gICAgICAgICAgICAvLyBOb3RlOiByZXBsYWNpbmcgd2l0aCB0aGUgQVNDSUkgc3ltYm9sIGB4YCBtaWdodCBjYXVzZSBmYWxzZVxuICAgICAgICAgICAgLy8gbmVnYXRpdmVzIGluIHVubGlrZWx5IHNjZW5hcmlvcy4gRm9yIGV4YW1wbGUsIGBbXFx1ezYxfS1iXWAgaXMgYVxuICAgICAgICAgICAgLy8gcGVyZmVjdGx5IHZhbGlkIHBhdHRlcm4gdGhhdCBpcyBlcXVpdmFsZW50IHRvIGBbYS1iXWAsIGJ1dCBpdFxuICAgICAgICAgICAgLy8gd291bGQgYmUgcmVwbGFjZWQgYnkgYFt4LWJdYCB3aGljaCB0aHJvd3MgYW4gZXJyb3IuXG4gICAgICAgICAgICB0bXAgPSB0bXBcbiAgICAgICAgICAgICAgICAucmVwbGFjZSgvXFxcXHVcXHsoWzAtOWEtZkEtRl0rKVxcfS9nLCBmdW5jdGlvbiAoJDAsICQxKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChwYXJzZUludCgkMSwgMTYpIDw9IDB4MTBGRkZGKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3gnO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKG51bGwsIE1lc3NhZ2VzLkludmFsaWRSZWdFeHApO1xuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgLnJlcGxhY2UoXG4gICAgICAgICAgICAgICAgICAgIC9cXFxcdShbYS1mQS1GMC05XXs0fSl8W1xcdUQ4MDAtXFx1REJGRl1bXFx1REMwMC1cXHVERkZGXS9nLFxuICAgICAgICAgICAgICAgICAgICAneCdcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICB9XG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CBsZW5ndGgpIHtcbiAgICAgICAgICAgIGNoID0gc291cmNlW2luZGV4KytdO1xuICAgICAgICAgICAgc3RyICs9IGNoO1xuICAgICAgICAgICAgaWYgKGNoID09PSAnXFxcXCcpIHtcbiAgICAgICAgICAgICAgICBjaCA9IHNvdXJjZVtpbmRleCsrXTtcbiAgICAgICAgICAgICAgICAvLyBFQ01BLTI2MiA3LjguNVxuICAgICAgICAgICAgICAgIGlmIChpc0xpbmVUZXJtaW5hdG9yKGNoLmNoYXJDb2RlQXQoMCkpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKG51bGwsIE1lc3NhZ2VzLlVudGVybWluYXRlZFJlZ0V4cCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHN0ciArPSBjaDtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaXNMaW5lVGVybWluYXRvcihjaC5jaGFyQ29kZUF0KDApKSkge1xuICAgICAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKG51bGwsIE1lc3NhZ2VzLlVudGVybWluYXRlZFJlZ0V4cCk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGNsYXNzTWFya2VyKSB7XG4gICAgICAgICAgICAgICAgaWYgKGNoID09PSAnXScpIHtcbiAgICAgICAgICAgICAgICAgICAgY2xhc3NNYXJrZXIgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gJy8nKSB7XG4gICAgICAgICAgICAgICAgICAgIHRlcm1pbmF0ZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGNoID09PSAnWycpIHtcbiAgICAgICAgICAgICAgICAgICAgY2xhc3NNYXJrZXIgPSB0cnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghdGVybWluYXRlZCkge1xuICAgICAgICAgICAgdGhyb3dVbmV4cGVjdGVkVG9rZW4obnVsbCwgTWVzc2FnZXMuVW50ZXJtaW5hdGVkUmVnRXhwKTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIEV4Y2x1ZGUgbGVhZGluZyBhbmQgdHJhaWxpbmcgc2xhc2guXG4gICAgICAgIGJvZHkgPSBzdHIuc3Vic3RyKDEsIHN0ci5sZW5ndGggLSAyKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIHZhbHVlOiBib2R5LFxuICAgICAgICAgICAgbGl0ZXJhbDogc3RyXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gc2NhblJlZ0V4cEZsYWdzKCkge1xuICAgICAgICB2YXIgY2gsIHN0ciwgZmxhZ3MsIHJlc3RvcmU7XG5cbiAgICAgICAgc3RyID0gJyc7XG4gICAgICAgIGZsYWdzID0gJyc7XG4gICAgICAgIHdoaWxlIChpbmRleCA8IGxlbmd0aCkge1xuICAgICAgICAgICAgY2ggPSBzb3VyY2VbaW5kZXhdO1xuICAgICAgICAgICAgaWYgKCFpc0lkZW50aWZpZXJQYXJ0KGNoLmNoYXJDb2RlQXQoMCkpKSB7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICsraW5kZXg7XG4gICAgICAgICAgICBpZiAoY2ggPT09ICdcXFxcJyAmJiBpbmRleCA8IGxlbmd0aCkge1xuICAgICAgICAgICAgICAgIGNoID0gc291cmNlW2luZGV4XTtcbiAgICAgICAgICAgICAgICBpZiAoY2ggPT09ICd1Jykge1xuICAgICAgICAgICAgICAgICAgICArK2luZGV4O1xuICAgICAgICAgICAgICAgICAgICByZXN0b3JlID0gaW5kZXg7XG4gICAgICAgICAgICAgICAgICAgIGNoID0gc2NhbkhleEVzY2FwZSgndScpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoY2gpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZsYWdzICs9IGNoO1xuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChzdHIgKz0gJ1xcXFx1JzsgcmVzdG9yZSA8IGluZGV4OyArK3Jlc3RvcmUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHIgKz0gc291cmNlW3Jlc3RvcmVdO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXggPSByZXN0b3JlO1xuICAgICAgICAgICAgICAgICAgICAgICAgZmxhZ3MgKz0gJ3UnO1xuICAgICAgICAgICAgICAgICAgICAgICAgc3RyICs9ICdcXFxcdSc7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdG9sZXJhdGVVbmV4cGVjdGVkVG9rZW4oKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBzdHIgKz0gJ1xcXFwnO1xuICAgICAgICAgICAgICAgICAgICB0b2xlcmF0ZVVuZXhwZWN0ZWRUb2tlbigpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgZmxhZ3MgKz0gY2g7XG4gICAgICAgICAgICAgICAgc3RyICs9IGNoO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIHZhbHVlOiBmbGFncyxcbiAgICAgICAgICAgIGxpdGVyYWw6IHN0clxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHNjYW5SZWdFeHAoKSB7XG4gICAgICAgIHNjYW5uaW5nID0gdHJ1ZTtcbiAgICAgICAgdmFyIHN0YXJ0LCBib2R5LCBmbGFncywgdmFsdWU7XG5cbiAgICAgICAgbG9va2FoZWFkID0gbnVsbDtcbiAgICAgICAgc2tpcENvbW1lbnQoKTtcbiAgICAgICAgc3RhcnQgPSBpbmRleDtcblxuICAgICAgICBib2R5ID0gc2NhblJlZ0V4cEJvZHkoKTtcbiAgICAgICAgZmxhZ3MgPSBzY2FuUmVnRXhwRmxhZ3MoKTtcbiAgICAgICAgdmFsdWUgPSB0ZXN0UmVnRXhwKGJvZHkudmFsdWUsIGZsYWdzLnZhbHVlKTtcbiAgICAgICAgc2Nhbm5pbmcgPSBmYWxzZTtcbiAgICAgICAgaWYgKGV4dHJhLnRva2VuaXplKSB7XG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgIHR5cGU6IFRva2VuLlJlZ3VsYXJFeHByZXNzaW9uLFxuICAgICAgICAgICAgICAgIHZhbHVlOiB2YWx1ZSxcbiAgICAgICAgICAgICAgICByZWdleDoge1xuICAgICAgICAgICAgICAgICAgICBwYXR0ZXJuOiBib2R5LnZhbHVlLFxuICAgICAgICAgICAgICAgICAgICBmbGFnczogZmxhZ3MudmFsdWVcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIGxpbmVOdW1iZXI6IGxpbmVOdW1iZXIsXG4gICAgICAgICAgICAgICAgbGluZVN0YXJ0OiBsaW5lU3RhcnQsXG4gICAgICAgICAgICAgICAgc3RhcnQ6IHN0YXJ0LFxuICAgICAgICAgICAgICAgIGVuZDogaW5kZXhcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgbGl0ZXJhbDogYm9keS5saXRlcmFsICsgZmxhZ3MubGl0ZXJhbCxcbiAgICAgICAgICAgIHZhbHVlOiB2YWx1ZSxcbiAgICAgICAgICAgIHJlZ2V4OiB7XG4gICAgICAgICAgICAgICAgcGF0dGVybjogYm9keS52YWx1ZSxcbiAgICAgICAgICAgICAgICBmbGFnczogZmxhZ3MudmFsdWVcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzdGFydDogc3RhcnQsXG4gICAgICAgICAgICBlbmQ6IGluZGV4XG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gY29sbGVjdFJlZ2V4KCkge1xuICAgICAgICB2YXIgcG9zLCBsb2MsIHJlZ2V4LCB0b2tlbjtcblxuICAgICAgICBza2lwQ29tbWVudCgpO1xuXG4gICAgICAgIHBvcyA9IGluZGV4O1xuICAgICAgICBsb2MgPSB7XG4gICAgICAgICAgICBzdGFydDoge1xuICAgICAgICAgICAgICAgIGxpbmU6IGxpbmVOdW1iZXIsXG4gICAgICAgICAgICAgICAgY29sdW1uOiBpbmRleCAtIGxpbmVTdGFydFxuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuXG4gICAgICAgIHJlZ2V4ID0gc2NhblJlZ0V4cCgpO1xuXG4gICAgICAgIGxvYy5lbmQgPSB7XG4gICAgICAgICAgICBsaW5lOiBsaW5lTnVtYmVyLFxuICAgICAgICAgICAgY29sdW1uOiBpbmRleCAtIGxpbmVTdGFydFxuICAgICAgICB9O1xuXG4gICAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBuZXh0ICovXG4gICAgICAgIGlmICghZXh0cmEudG9rZW5pemUpIHtcbiAgICAgICAgICAgIC8vIFBvcCB0aGUgcHJldmlvdXMgdG9rZW4sIHdoaWNoIGlzIGxpa2VseSAnLycgb3IgJy89J1xuICAgICAgICAgICAgaWYgKGV4dHJhLnRva2Vucy5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgdG9rZW4gPSBleHRyYS50b2tlbnNbZXh0cmEudG9rZW5zLmxlbmd0aCAtIDFdO1xuICAgICAgICAgICAgICAgIGlmICh0b2tlbi5yYW5nZVswXSA9PT0gcG9zICYmIHRva2VuLnR5cGUgPT09ICdQdW5jdHVhdG9yJykge1xuICAgICAgICAgICAgICAgICAgICBpZiAodG9rZW4udmFsdWUgPT09ICcvJyB8fCB0b2tlbi52YWx1ZSA9PT0gJy89Jykge1xuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmEudG9rZW5zLnBvcCgpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBleHRyYS50b2tlbnMucHVzaCh7XG4gICAgICAgICAgICAgICAgdHlwZTogJ1JlZ3VsYXJFeHByZXNzaW9uJyxcbiAgICAgICAgICAgICAgICB2YWx1ZTogcmVnZXgubGl0ZXJhbCxcbiAgICAgICAgICAgICAgICByZWdleDogcmVnZXgucmVnZXgsXG4gICAgICAgICAgICAgICAgcmFuZ2U6IFtwb3MsIGluZGV4XSxcbiAgICAgICAgICAgICAgICBsb2M6IGxvY1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gcmVnZXg7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gaXNJZGVudGlmaWVyTmFtZSh0b2tlbikge1xuICAgICAgICByZXR1cm4gdG9rZW4udHlwZSA9PT0gVG9rZW4uSWRlbnRpZmllciB8fFxuICAgICAgICAgICAgdG9rZW4udHlwZSA9PT0gVG9rZW4uS2V5d29yZCB8fFxuICAgICAgICAgICAgdG9rZW4udHlwZSA9PT0gVG9rZW4uQm9vbGVhbkxpdGVyYWwgfHxcbiAgICAgICAgICAgIHRva2VuLnR5cGUgPT09IFRva2VuLk51bGxMaXRlcmFsO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGFkdmFuY2VTbGFzaCgpIHtcbiAgICAgICAgdmFyIHByZXZUb2tlbixcbiAgICAgICAgICAgIGNoZWNrVG9rZW47XG4gICAgICAgIC8vIFVzaW5nIHRoZSBmb2xsb3dpbmcgYWxnb3JpdGhtOlxuICAgICAgICAvLyBodHRwczovL2dpdGh1Yi5jb20vbW96aWxsYS9zd2VldC5qcy93aWtpL2Rlc2lnblxuICAgICAgICBwcmV2VG9rZW4gPSBleHRyYS50b2tlbnNbZXh0cmEudG9rZW5zLmxlbmd0aCAtIDFdO1xuICAgICAgICBpZiAoIXByZXZUb2tlbikge1xuICAgICAgICAgICAgLy8gTm90aGluZyBiZWZvcmUgdGhhdDogaXQgY2Fubm90IGJlIGEgZGl2aXNpb24uXG4gICAgICAgICAgICByZXR1cm4gY29sbGVjdFJlZ2V4KCk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHByZXZUb2tlbi50eXBlID09PSAnUHVuY3R1YXRvcicpIHtcbiAgICAgICAgICAgIGlmIChwcmV2VG9rZW4udmFsdWUgPT09ICddJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBzY2FuUHVuY3R1YXRvcigpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHByZXZUb2tlbi52YWx1ZSA9PT0gJyknKSB7XG4gICAgICAgICAgICAgICAgY2hlY2tUb2tlbiA9IGV4dHJhLnRva2Vuc1tleHRyYS5vcGVuUGFyZW5Ub2tlbiAtIDFdO1xuICAgICAgICAgICAgICAgIGlmIChjaGVja1Rva2VuICYmXG4gICAgICAgICAgICAgICAgICAgICAgICBjaGVja1Rva2VuLnR5cGUgPT09ICdLZXl3b3JkJyAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgKGNoZWNrVG9rZW4udmFsdWUgPT09ICdpZicgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgICBjaGVja1Rva2VuLnZhbHVlID09PSAnd2hpbGUnIHx8XG4gICAgICAgICAgICAgICAgICAgICAgICAgY2hlY2tUb2tlbi52YWx1ZSA9PT0gJ2ZvcicgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgICBjaGVja1Rva2VuLnZhbHVlID09PSAnd2l0aCcpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBjb2xsZWN0UmVnZXgoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHNjYW5QdW5jdHVhdG9yKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAocHJldlRva2VuLnZhbHVlID09PSAnfScpIHtcbiAgICAgICAgICAgICAgICAvLyBEaXZpZGluZyBhIGZ1bmN0aW9uIGJ5IGFueXRoaW5nIG1ha2VzIGxpdHRsZSBzZW5zZSxcbiAgICAgICAgICAgICAgICAvLyBidXQgd2UgaGF2ZSB0byBjaGVjayBmb3IgdGhhdC5cbiAgICAgICAgICAgICAgICBpZiAoZXh0cmEudG9rZW5zW2V4dHJhLm9wZW5DdXJseVRva2VuIC0gM10gJiZcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhLnRva2Vuc1tleHRyYS5vcGVuQ3VybHlUb2tlbiAtIDNdLnR5cGUgPT09ICdLZXl3b3JkJykge1xuICAgICAgICAgICAgICAgICAgICAvLyBBbm9ueW1vdXMgZnVuY3Rpb24uXG4gICAgICAgICAgICAgICAgICAgIGNoZWNrVG9rZW4gPSBleHRyYS50b2tlbnNbZXh0cmEub3BlbkN1cmx5VG9rZW4gLSA0XTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFjaGVja1Rva2VuKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2NhblB1bmN0dWF0b3IoKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXh0cmEudG9rZW5zW2V4dHJhLm9wZW5DdXJseVRva2VuIC0gNF0gJiZcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhLnRva2Vuc1tleHRyYS5vcGVuQ3VybHlUb2tlbiAtIDRdLnR5cGUgPT09ICdLZXl3b3JkJykge1xuICAgICAgICAgICAgICAgICAgICAvLyBOYW1lZCBmdW5jdGlvbi5cbiAgICAgICAgICAgICAgICAgICAgY2hlY2tUb2tlbiA9IGV4dHJhLnRva2Vuc1tleHRyYS5vcGVuQ3VybHlUb2tlbiAtIDVdO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIWNoZWNrVG9rZW4pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBjb2xsZWN0UmVnZXgoKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBzY2FuUHVuY3R1YXRvcigpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBjaGVja1Rva2VuIGRldGVybWluZXMgd2hldGhlciB0aGUgZnVuY3Rpb24gaXNcbiAgICAgICAgICAgICAgICAvLyBhIGRlY2xhcmF0aW9uIG9yIGFuIGV4cHJlc3Npb24uXG4gICAgICAgICAgICAgICAgaWYgKEZuRXhwclRva2Vucy5pbmRleE9mKGNoZWNrVG9rZW4udmFsdWUpID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gSXQgaXMgYW4gZXhwcmVzc2lvbi5cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNjYW5QdW5jdHVhdG9yKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIEl0IGlzIGEgZGVjbGFyYXRpb24uXG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvbGxlY3RSZWdleCgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGNvbGxlY3RSZWdleCgpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChwcmV2VG9rZW4udHlwZSA9PT0gJ0tleXdvcmQnICYmIHByZXZUb2tlbi52YWx1ZSAhPT0gJ3RoaXMnKSB7XG4gICAgICAgICAgICByZXR1cm4gY29sbGVjdFJlZ2V4KCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHNjYW5QdW5jdHVhdG9yKCk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gYWR2YW5jZSgpIHtcbiAgICAgICAgdmFyIGNoLCB0b2tlbjtcblxuICAgICAgICBpZiAoaW5kZXggPj0gbGVuZ3RoKSB7XG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgIHR5cGU6IFRva2VuLkVPRixcbiAgICAgICAgICAgICAgICBsaW5lTnVtYmVyOiBsaW5lTnVtYmVyLFxuICAgICAgICAgICAgICAgIGxpbmVTdGFydDogbGluZVN0YXJ0LFxuICAgICAgICAgICAgICAgIHN0YXJ0OiBpbmRleCxcbiAgICAgICAgICAgICAgICBlbmQ6IGluZGV4XG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG5cbiAgICAgICAgY2ggPSBzb3VyY2UuY2hhckNvZGVBdChpbmRleCk7XG5cbiAgICAgICAgaWYgKGlzSWRlbnRpZmllclN0YXJ0KGNoKSkge1xuICAgICAgICAgICAgdG9rZW4gPSBzY2FuSWRlbnRpZmllcigpO1xuICAgICAgICAgICAgaWYgKHN0cmljdCAmJiBpc1N0cmljdE1vZGVSZXNlcnZlZFdvcmQodG9rZW4udmFsdWUpKSB7XG4gICAgICAgICAgICAgICAgdG9rZW4udHlwZSA9IFRva2VuLktleXdvcmQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gdG9rZW47XG4gICAgICAgIH1cblxuICAgICAgICAvLyBWZXJ5IGNvbW1vbjogKCBhbmQgKSBhbmQgO1xuICAgICAgICBpZiAoY2ggPT09IDB4MjggfHwgY2ggPT09IDB4MjkgfHwgY2ggPT09IDB4M0IpIHtcbiAgICAgICAgICAgIHJldHVybiBzY2FuUHVuY3R1YXRvcigpO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gU3RyaW5nIGxpdGVyYWwgc3RhcnRzIHdpdGggc2luZ2xlIHF1b3RlIChVKzAwMjcpIG9yIGRvdWJsZSBxdW90ZSAoVSswMDIyKS5cbiAgICAgICAgaWYgKGNoID09PSAweDI3IHx8IGNoID09PSAweDIyKSB7XG4gICAgICAgICAgICByZXR1cm4gc2NhblN0cmluZ0xpdGVyYWwoKTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIERvdCAoLikgVSswMDJFIGNhbiBhbHNvIHN0YXJ0IGEgZmxvYXRpbmctcG9pbnQgbnVtYmVyLCBoZW5jZSB0aGUgbmV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lY3RUb2tlbigpIHtcbiAgICAgICAgdmFyIGxvYywgdG9rZW4sIHZhbHVlLCBlbnRyeTtcblxuICAgICAgICBsb2MgPSB7XG4gICAgICAgICAgICBzdGFydDoge1xuICAgICAgICAgICAgICAgIGxpbmU6IGxpbmVOdW1iZXIsXG4gICAgICAgICAgICAgICAgY29sdW1uOiBpbmRleCAtIGxpbmVTdGFydFxuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuXG4gICAgICAgIHRva2VuID0gYWR2YW5jZSgpO1xuICAgICAgICBsb2MuZW5kID0ge1xuICAgICAgICAgICAgbGluZTogbGluZU51bWJlcixcbiAgICAgICAgICAgIGNvbHVtbjogaW5kZXggLSBsaW5lU3RhcnRcbiAgICAgICAgfTtcblxuICAgICAgICBpZiAodG9rZW4udHlwZSAhPT0gVG9rZW4uRU9GKSB7XG4gICAgICAgICAgICB2YWx1ZSA9IHNvdXJjZS5zbGljZSh0b2tlbi5zdGFydCwgdG9rZW4uZW5kKTtcbiAgICAgICAgICAgIGVudHJ5ID0ge1xuICAgICAgICAgICAgICAgIHR5cGU6IFRva2VuTmFtZVt0b2tlbi50eXBlXSxcbiAgICAgICAgICAgICAgICB2YWx1ZTogdmFsdWUsXG4gICAgICAgICAgICAgICAgcmFuZ2U6IFt0b2tlbi5zdGFydCwgdG9rZW4uZW5kXSxcbiAgICAgICAgICAgICAgICBsb2M6IGxvY1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGlmICh0b2tlbi5yZWdleCkge1xuICAgICAgICAgICAgICAgIGVudHJ5LnJlZ2V4ID0ge1xuICAgICAgICAgICAgICAgICAgICBwYXR0ZXJuOiB0b2tlbi5yZWdleC5wYXR0ZXJuLFxuICAgICAgICAgICAgICAgICAgICBmbGFnczogdG9rZW4ucmVnZXguZmxhZ3NcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZXh0cmEudG9rZW5zLnB1c2goZW50cnkpO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHRva2VuO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGxleCgpIHtcbiAgICAgICAgdmFyIHRva2VuO1xuICAgICAgICBzY2FubmluZyA9IHRydWU7XG5cbiAgICAgICAgbGFzdEluZGV4ID0gaW5kZXg7XG4gICAgICAgIGxhc3RMaW5lTnVtYmVyID0gbGluZU51bWJlcjtcbiAgICAgICAgbGFzdExpbmVTdGFydCA9IGxpbmVTdGFydDtcblxuICAgICAgICBza2lwQ29tbWVudCgpO1xuXG4gICAgICAgIHRva2VuID0gbG9va2FoZWFkO1xuXG4gICAgICAgIHN0YXJ0SW5kZXggPSBpbmRleDtcbiAgICAgICAgc3RhcnRMaW5lTnVtYmVyID0gbGluZU51bWJlcjtcbiAgICAgICAgc3RhcnRMaW5lU3RhcnQgPSBsaW5lU3RhcnQ7XG5cbiAgICAgICAgbG9va2FoZWFkID0gKHR5cGVvZiBleHRyYS50b2tlbnMgIT09ICd1bmRlZmluZWQnKSA/IGNvbGxlY3RUb2tlbigpIDogYWR2YW5jZSgpO1xuICAgICAgICBzY2FubmluZyA9IGZhbHNlO1xuICAgICAgICByZXR1cm4gdG9rZW47XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gcGVlaygpIHtcbiAgICAgICAgc2Nhbm5pbmcgPSB0cnVlO1xuXG4gICAgICAgIHNraXBDb21tZW50KCk7XG5cbiAgICAgICAgbGFzdEluZGV4ID0gaW5kZXg7XG4gICAgICAgIGxhc3RMaW5lTnVtYmVyID0gbGluZU51bWJlcjtcbiAgICAgICAgbGFzdExpbmVTdGFydCA9IGxpbmVTdGFydDtcblxuICAgICAgICBzdGFydEluZGV4ID0gaW5kZXg7XG4gICAgICAgIHN0YXJ0TGluZU51bWJlciA9IGxpbmVOdW1iZXI7XG4gICAgICAgIHN0YXJ0TGluZVN0YXJ0ID0gbGluZVN0YXJ0O1xuXG4gICAgICAgIGxvb2thaGVhZCA9ICh0eXBlb2YgZXh0cmEudG9rZW5zICE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RhcnRUb2tlbi5zdGFydCwgMF07XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGV4dHJhLmxvYykge1xuICAgICAgICAgICAgdGhpcy5sb2MgPSBuZXcgV3JhcHBpbmdTb3VyY2VMb2NhdGlvbihzdGFydFRva2VuKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIFdyYXBwaW5nTm9kZS5wcm90b3R5cGUgPSBOb2RlLnByb3RvdHlwZSA9IHtcblxuICAgICAgICBwcm9jZXNzQ29tbWVudDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyIGxhc3RDaGlsZCxcbiAgICAgICAgICAgICAgICBsZWFkaW5nQ29tbWVudHMsXG4gICAgICAgICAgICAgICAgdHJhaWxpbmdDb21tZW50cyxcbiAgICAgICAgICAgICAgICBib3R0b21SaWdodCA9IGV4dHJhLmJvdHRvbVJpZ2h0U3RhY2ssXG4gICAgICAgICAgICAgICAgaSxcbiAgICAgICAgICAgICAgICBjb21tZW50LFxuICAgICAgICAgICAgICAgIGxhc3QgPSBib3R0b21SaWdodFtib3R0b21SaWdodC5sZW5ndGggLSAxXTtcblxuICAgICAgICAgICAgaWYgKHRoaXMudHlwZSA9PT0gU3ludGF4LlByb2dyYW0pIHtcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5ib2R5Lmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKGV4dHJhLnRyYWlsaW5nQ29tbWVudHMubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgICAgIHRyYWlsaW5nQ29tbWVudHMgPSBbXTtcbiAgICAgICAgICAgICAgICBmb3IgKGkgPSBleHRyYS50cmFpbGluZ0NvbW1lbnRzLmxlbmd0aCAtIDE7IGkgPj0gMDsgLS1pKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbW1lbnQgPSBleHRyYS50cmFpbGluZ0NvbW1lbnRzW2ldO1xuICAgICAgICAgICAgICAgICAgICBpZiAoY29tbWVudC5yYW5nZVswXSA+PSB0aGlzLnJhbmdlWzFdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0cmFpbGluZ0NvbW1lbnRzLnVuc2hpZnQoY29tbWVudCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYS50cmFpbGluZ0NvbW1lbnRzLnNwbGljZShpLCAxKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBleHRyYS50cmFpbGluZ0NvbW1lbnRzID0gW107XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmIChsYXN0ICYmIGxhc3QudHJhaWxpbmdDb21tZW50cyAmJiBsYXN0LnRyYWlsaW5nQ29tbWVudHNbMF0ucmFuZ2VbMF0gPj0gdGhpcy5yYW5nZVsxXSkge1xuICAgICAgICAgICAgICAgICAgICB0cmFpbGluZ0NvbW1lbnRzID0gbGFzdC50cmFpbGluZ0NvbW1lbnRzO1xuICAgICAgICAgICAgICAgICAgICBkZWxldGUgbGFzdC50cmFpbGluZ0NvbW1lbnRzO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gRWF0aW5nIHRoZSBzdGFjay5cbiAgICAgICAgICAgIGlmIChsYXN0KSB7XG4gICAgICAgICAgICAgICAgd2hpbGUgKGxhc3QgJiYgbGFzdC5yYW5nZVswXSA+PSB0aGlzLnJhbmdlWzBdKSB7XG4gICAgICAgICAgICAgICAgICAgIGxhc3RDaGlsZCA9IGxhc3Q7XG4gICAgICAgICAgICAgICAgICAgIGxhc3QgPSBib3R0b21SaWdodC5wb3AoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChsYXN0Q2hpbGQpIHtcbiAgICAgICAgICAgICAgICBpZiAobGFzdENoaWxkLmxlYWRpbmdDb21tZW50cyAmJiBsYXN0Q2hpbGQubGVhZGluZ0NvbW1lbnRzW2xhc3RDaGlsZC5sZWFkaW5nQ29tbWVudHMubGVuZ3RoIC0gMV0ucmFuZ2VbMV0gPD0gdGhpcy5yYW5nZVswXSkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmxlYWRpbmdDb21tZW50cyA9IGxhc3RDaGlsZC5sZWFkaW5nQ29tbWVudHM7XG4gICAgICAgICAgICAgICAgICAgIGxhc3RDaGlsZC5sZWFkaW5nQ29tbWVudHMgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIGlmIChleHRyYS5sZWFkaW5nQ29tbWVudHMubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgICAgIGxlYWRpbmdDb21tZW50cyA9IFtdO1xuICAgICAgICAgICAgICAgIGZvciAoaSA9IGV4dHJhLmxlYWRpbmdDb21tZW50cy5sZW5ndGggLSAxOyBpID49IDA7IC0taSkge1xuICAgICAgICAgICAgICAgICAgICBjb21tZW50ID0gZXh0cmEubGVhZGluZ0NvbW1lbnRzW2ldO1xuICAgICAgICAgICAgICAgICAgICBpZiAoY29tbWVudC5yYW5nZVsxXSA8PSB0aGlzLnJhbmdlWzBdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZWFkaW5nQ29tbWVudHMudW5zaGlmdChjb21tZW50KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhLmxlYWRpbmdDb21tZW50cy5zcGxpY2UoaSwgMSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cblxuICAgICAgICAgICAgaWYgKGxlYWRpbmdDb21tZW50cyAmJiBsZWFkaW5nQ29tbWVudHMubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgICAgIHRoaXMubGVhZGluZ0NvbW1lbnRzID0gbGVhZGluZ0NvbW1lbnRzO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHRyYWlsaW5nQ29tbWVudHMgJiYgdHJhaWxpbmdDb21tZW50cy5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgdGhpcy50cmFpbGluZ0NvbW1lbnRzID0gdHJhaWxpbmdDb21tZW50cztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgYm90dG9tUmlnaHQucHVzaCh0aGlzKTtcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2g6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIGlmIChleHRyYS5yYW5nZSkge1xuICAgICAgICAgICAgICAgIHRoaXMucmFuZ2VbMV0gPSBsYXN0SW5kZXg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoZXh0cmEubG9jKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5sb2MuZW5kID0ge1xuICAgICAgICAgICAgICAgICAgICBsaW5lOiBsYXN0TGluZU51bWJlcixcbiAgICAgICAgICAgICAgICAgICAgY29sdW1uOiBsYXN0SW5kZXggLSBsYXN0TGluZVN0YXJ0XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBpZiAoZXh0cmEuc291cmNlKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMubG9jLnNvdXJjZSA9IGV4dHJhLnNvdXJjZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChleHRyYS5hdHRhY2hDb21tZW50KSB7XG4gICAgICAgICAgICAgICAgdGhpcy5wcm9jZXNzQ29tbWVudCgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaEFycmF5RXhwcmVzc2lvbjogZnVuY3Rpb24gKGVsZW1lbnRzKSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguQXJyYXlFeHByZXNzaW9uO1xuICAgICAgICAgICAgdGhpcy5lbGVtZW50cyA9IGVsZW1lbnRzO1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaEFycmF5UGF0dGVybjogZnVuY3Rpb24gKGVsZW1lbnRzKSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguQXJyYXlQYXR0ZXJuO1xuICAgICAgICAgICAgdGhpcy5lbGVtZW50cyA9IGVsZW1lbnRzO1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaEFycm93RnVuY3Rpb25FeHByZXNzaW9uOiBmdW5jdGlvbiAocGFyYW1zLCBkZWZhdWx0cywgYm9keSwgZXhwcmVzc2lvbikge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LkFycm93RnVuY3Rpb25FeHByZXNzaW9uO1xuICAgICAgICAgICAgdGhpcy5pZCA9IG51bGw7XG4gICAgICAgICAgICB0aGlzLnBhcmFtcyA9IHBhcmFtcztcbiAgICAgICAgICAgIHRoaXMuZGVmYXVsdHMgPSBkZWZhdWx0cztcbiAgICAgICAgICAgIHRoaXMuYm9keSA9IGJvZHk7XG4gICAgICAgICAgICB0aGlzLmdlbmVyYXRvciA9IGZhbHNlO1xuICAgICAgICAgICAgdGhpcy5leHByZXNzaW9uID0gZXhwcmVzc2lvbjtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hBc3NpZ25tZW50RXhwcmVzc2lvbjogZnVuY3Rpb24gKG9wZXJhdG9yLCBsZWZ0LCByaWdodCkge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LkFzc2lnbm1lbnRFeHByZXNzaW9uO1xuICAgICAgICAgICAgdGhpcy5vcGVyYXRvciA9IG9wZX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ICAgICB0aGlzLmJvZHkgPSBib2R5O1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaEJyZWFrU3RhdGVtZW50OiBmdW5jdGlvbiAobGFiZWwpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5CcmVha1N0YXRlbWVudDtcbiAgICAgICAgICAgIHRoaXMubGFiZWwgPSBsYWJlbDtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hDYWxsRXhwcmVzc2lvbjogZnVuY3Rpb24gKGNhbGxlZSwgYXJncykge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LkNhbGxFeHByZXNzaW9uO1xuICAgICAgICAgICAgdGhpcy5jYWxsZWUgPSBjYWxsZWU7XG4gICAgICAgICAgICB0aGlzLmFyZ3VtZW50cyA9IGFyZ3M7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoQ2F0Y2hDbGF1c2U6IGZ1bmN0aW9uIChwYXJhbSwgYm9keSkge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LkNhdGNoQ2xhdXNlO1xuICAgICAgICAgICAgdGhpcy5wYXJhbSA9IHBhcmFtO1xuICAgICAgICAgICAgdGhpcy5ib2R5ID0gYm9keTtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hDbGFzc0JvZHk6IGZ1bmN0aW9uIChib2R5KSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguQ2xhc3NCb2R5O1xuICAgICAgICAgICAgdGhpcy5ib2R5ID0gYm9keTtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hDbGFzc0RlY2xhcmF0aW9uOiBmdW5jdGlvbiAoaWQsIHN1cGVyQ2xhc3MsIGJvZHkpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5DbGFzc0RlY2xhcmF0aW9uO1xuICAgICAgICAgICAgdGhpcy5pZCA9IGlkO1xuICAgICAgICAgICAgdGhpcy5zdXBlckNsYXNzID0gc3VwZXJDbGFzcztcbiAgICAgICAgICAgIHRoaXMuYm9keSA9IGJvZHk7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoQ2xhc3NFeHByZXNzaW9uOiBmdW5jdGlvbiAoaWQsIHN1cGVyQ2xhc3MsIGJvZHkpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5DbGFzc0V4cHJlc3Npb247XG4gICAgICAgICAgICB0aGlzLmlkID0gaWQ7XG4gICAgICAgICAgICB0aGlzLnN1cGVyQ2xhc3MgPSBzdXBlckNsYXNzO1xuICAgICAgICAgICAgdGhpcy5ib2R5ID0gYm9keTtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hDb25kaXRpb25hbEV4cHJlc3Npb246IGZ1bmN0aW9uICh0ZXN0LCBjb25zZXF1ZW50LCBhbHRlcm5hdGUpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5Db25kaXRpb25hbEV4cHJlc3Npb247XG4gICAgICAgICAgICB0aGlzLnRlc3QgPSB0ZXN0O1xuICAgICAgICAgICAgdGhpcy5jb25zZXF1ZW50ID0gY29uc2VxdWVudDtcbiAgICAgICAgICAgIHRoaXMuYWx0ZXJuYXRlID0gYWx0ZXJuYXRlO1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaENvbnRpbnVlU3RhdGVtZW50OiBmdW5jdGlvbiAobGFiZWwpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5Db250aW51ZVN0YXRlbWVudDtcbiAgICAgICAgICAgIHRoaXMubGFiZWwgPSBsYWJlbDtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hEZWJ1Z2dlclN0YXRlbWVudDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LkRlYnVnZ2VyU3RhdGVtZW50O1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaERvV2hpbGVTdGF0ZW1lbnQ6IGZ1bmN0aW9uIChib2R5LCB0ZXN0KSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguRG9XaGlsZVN0YXRlbWVudDtcbiAgICAgICAgICAgIHRoaXMuYm9keSA9IGJvZHk7XG4gICAgICAgICAgICB0aGlzLnRlc3QgPSB0ZXN0O1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaEVtcHR5U3RhdGVtZW50OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguRW1wdHlTdGF0ZW1lbnQ7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoRXhwcmVzc2lvblN0YXRlbWVudDogZnVuY3Rpb24gKGV4cHJlc3Npb24pIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5FeHByZXNzaW9uU3RhdGVtZW50O1xuICAgICAgICAgICAgdGhpcy5leHByZXNzaW9uID0gZXhwcmVzc2lvbjtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hGb3JTdGF0ZW1lbnQ6IGZ1bmN0aW9uIChpbml0LCB0ZXN0LCB1cGRhdGUsIGJvZHkpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5Gb3JTdGF0ZW1lbnQ7XG4gICAgICAgICAgICB0aGlzLmluaXQgPSBpbml0O1xuICAgICAgICAgICAgdGhpcy50ZXN0ID0gdGVzdDtcbiAgICAgICAgICAgIHRoaXMudXBkYXRlID0gdXBkYXRlO1xuICAgICAgICAgICAgdGhpcy5ib2R5ID0gYm9keTtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hGb3JJblN0YXRlbWVudDogZnVuY3Rpb24gKGxlZnQsIHJpZ2h0LCBib2R5KSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguRm9ySW5TdGF0ZW1lbnQ7XG4gICAgICAgICAgICB0aGlzLmxlZnQgPSBsZWZ0O1xuICAgICAgICAgICAgdGhpcy5yaWdodCA9IHJpZ2h0O1xuICAgICAgICAgICAgdGhpcy5ib2R5ID0gYm9keTtcbiAgICAgICAgICAgIHRoaXMuZWFjaCA9IGZhbHNlO1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaEZ1bmN0aW9uRGVjbGFyYXRpb246IGZ1bmN0aW9uIChpZCwgcGFyYW1zLCBkZWZhdWx0cywgYm9keSkge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LkZ1bmN0aW9uRGVjbGFyYXRpb247XG4gICAgICAgICAgICB0aGlzLmlkID0gaWQ7XG4gICAgICAgICAgICB0aGlzLnBhcmFtcyA9IHBhcmFtcztcbiAgICAgICAgICAgIHRoaXMuZGVmYXVsdHMgPSBkZWZhdWx0cztcbiAgICAgICAgICAgIHRoaXMuYm9keSA9IGJvZHk7XG4gICAgICAgICAgICB0aGlzLmdlbmVyYXRvciA9IGZhbHNlO1xuICAgICAgICAgICAgdGhpcy5leHByZXNzaW9uID0gZmFsc2U7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoRnVuY3Rpb25FeHByZXNzaW9uOiBmdW5jdGlvbiAoaWQsIHBhcmFtcywgZGVmYXVsdHMsIGJvZHkpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5GdW5jdGlvbkV4cHJlc3Npb247XG4gICAgICAgICAgICB0aGlzLmlkID0gaWQ7XG4gICAgICAgICAgICB0aGlzLnBhcmFtcyA9IHBhcmFtcztcbiAgICAgICAgICAgIHRoaXMuZGVmYXVsdHMgPSBkZWZhdWx0cztcbiAgICAgICAgICAgIHRoaXMuYm9keSA9IGJvZHk7XG4gICAgICAgICAgICB0aGlzLmdlbmVyYXRvciA9IGZhbHNlO1xuICAgICAgICAgICAgdGhpcy5leHByZXNzaW9uID0gZmFsc2U7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoSWRlbnRpZmllcjogZnVuY3Rpb24gKG5hbWUpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5JZGVudGlmaWVyO1xuICAgICAgICAgICAgdGhpcy5uYW1lID0gbmFtZTtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hJZlN0YXRlbWVudDogZnVuY3Rpb24gKHRlc3QsIGNvbnNlcXVlbnQsIGFsdGVybmF0ZSkge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LklmU3RhdGVtZW50O1xuICAgICAgICAgICAgdGhpcy50ZXN0ID0gdGVzdDtcbiAgICAgICAgICAgIHRoaXMuY29uc2VxdWVudCA9IGNvbnNlcXVlbnQ7XG4gICAgICAgICAgICB0aGlzLmFsdGVybmF0ZSA9IGFsdGVybmF0ZTtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hMYWJlbGVkU3RhdGVtZW50OiBmdW5jdGlvbiAobGFiZWwsIGJvZHkpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5MYWJlbGVkU3RhdGVtZW50O1xuICAgICAgICAgICAgdGhpcy5sYWJlbCA9IGxhYmVsO1xuICAgICAgICAgICAgdGhpcy5ib2R5ID0gYm9keTtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hMaXRlcmFsOiBmdW5jdGlvbiAodG9rZW4pIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5MaXRlcmFsO1xuICAgICAgICAgICAgdGhpcy52YWx1ZSA9IHRva2VuLnZhbHVlO1xuICAgICAgICAgICAgdGhpcy5yYXcgPSBzb3VyY2Uuc2xpY2UodG9rZW4uc3RhcnQsIHRva2VuLmVuZCk7XG4gICAgICAgICAgICBpZiAodG9rZW4ucmVnZXgpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnJlZ2V4ID0gdG9rZW4ucmVnZXg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoTWVtYmVyRXhwcmVzc2lvbjogZnVuY3Rpb24gKGFjY2Vzc29yLCBvYmplY3QsIHByb3BlcnR5KSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguTWVtYmVyRXhwcmVzc2lvbjtcbiAgICAgICAgICAgIHRoaXMuY29tcHV0ZWQgPSBhY2Nlc3NvciA9PT0gJ1snO1xuICAgICAgICAgICAgdGhpcy5vYmplY3QgPSBvYmplY3Q7XG4gICAgICAgICAgICB0aGlzLnByb3BlcnR5ID0gcHJvcGVydHk7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoTmV3RXhwcmVzc2lvbjogZnVuY3Rpb24gKGNhbGxlZSwgYXJncykge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4Lk5ld0V4cHJlc3Npb247XG4gICAgICAgICAgICB0aGlzLmNhbGxlZSA9IGNhbGxlZTtcbiAgICAgICAgICAgIHRoaXMuYXJndW1lbnRzID0gYXJncztcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hPYmplY3RFeHByZXNzaW9uOiBmdW5jdGlvbiAocHJvcGVydGllcykge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4Lk9iamVjdEV4cHJlc3Npb247XG4gICAgICAgICAgICB0aGlzLnByb3BlcnRpZXMgPSBwcm9wZXJ0aWVzO1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaE9iamVjdFBhdHRlcm46IGZ1bmN0aW9uIChwcm9wZXJ0aWVzKSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguT2JqZWN0UGF0dGVybjtcbiAgICAgICAgICAgIHRoaXMucHJvcGVydGllcyA9IHByb3BlcnRpZXM7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoUG9zdGZpeEV4cHJlc3Npb246IGZ1bmN0aW9uIChvcGVyYXRvciwgYXJndW1lbnQpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5VcGRhdGVFeHByZXNzaW9uO1xuICAgICAgICAgICAgdGhpcy5vcGVyYXRvciA9IG9wZXJhdG9yO1xuICAgICAgICAgICAgdGhpcy5hcmd1bWVudCA9IGFyZ3VtZW50O1xuICAgICAgICAgICAgdGhpcy5wcmVmaXggPSBmYWxzZTtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hQcm9ncmFtOiBmdW5jdGlvbiAoYm9keSkge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LlByb2dyYW07XG4gICAgICAgICAgICB0aGlzLmJvZHkgPSBib2R5O1xuICAgICAgICAgICAgaWYgKHNvdXJjZVR5cGUgPT09ICdtb2R1bGUnKSB7XG4gICAgICAgICAgICAgICAgLy8gdmVyeSByZXN0cmljdGl2ZSBmb3Igbm93XG4gICAgICAgICAgICAgICAgdGhpcy5zb3VyY2VUeXBlID0gc291cmNlVHlwZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hQcm9wZXJ0eTogZnVuY3Rpb24gKGtpbmQsIGtleSwgY29tcHV0ZWQsIHZhbHVlLCBtZXRob2QsIHNob3J0aGFuZCkge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LlByb3BlcnR5O1xuICAgICAgICAgICAgdGhpcy5rZXkgPSBrZXk7XG4gICAgICAgICAgICB0aGlzLmNvbXB1dGVkID0gY29tcHV0ZWQ7XG4gICAgICAgICAgICB0aGlzLnZhbHVlID0gdmFsdWU7XG4gICAgICAgICAgICB0aGlzLmtpbmQgPSBraW5kO1xuICAgICAgICAgICAgdGhpcy5tZXRob2QgPSBtZXRob2Q7XG4gICAgICAgICAgICB0aGlzLnNob3J0aGFuZCA9IHNob3J0aGFuZDtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hSZXN0RWxlbWVudDogZnVuY3Rpb24gKGFyZ3VtZW50KSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguUmVzdEVsZW1lbnQ7XG4gICAgICAgICAgICB0aGlzLmFyZ3VtZW50ID0gYXJndW1lbnQ7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoUmV0dXJuU3RhdGVtZW50OiBmdW5jdGlvbiAoYXJndW1lbnQpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5SZXR1cm5TdGF0ZW1lbnQ7XG4gICAgICAgICAgICB0aGlzLmFyZ3VtZW50ID0gYXJndW1lbnQ7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoU2VxdWVuY2VFeHByZXNzaW9uOiBmdW5jdGlvbiAoZXhwcmVzc2lvbnMpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5TZXF1ZW5jZUV4cHJlc3Npb247XG4gICAgICAgICAgICB0aGlzLmV4cHJlc3Npb25zID0gZXhwcmVzc2lvbnM7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoU3ByZWFkRWxlbWVudDogZnVuY3Rpb24gKGFyZ3VtZW50KSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguU3ByZWFkRWxlbWVudDtcbiAgICAgICAgICAgIHRoaXMuYXJndW1lbnQgPSBhcmd1bWVudDtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hTd2l0Y2hDYXNlOiBmdW5jdGlvbiAodGVzdCwgY29uc2VxdWVudCkge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LlN3aXRjaENhc2U7XG4gICAgICAgICAgICB0aGlzLnRlc3QgPSB0ZXN0O1xuICAgICAgICAgICAgdGhpcy5jb25zZXF1ZW50ID0gY29uc2VxdWVudDtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hTdXBlcjogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LlN1cGVyO1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO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ICAgIHRoaXMudHlwZSA9IFN5bnRheC5UZW1wbGF0ZUxpdGVyYWw7XG4gICAgICAgICAgICB0aGlzLnF1YXNpcyA9IHF1YXNpcztcbiAgICAgICAgICAgIHRoaXMuZXhwcmVzc2lvbnMgPSBleHByZXNzaW9ucztcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hUaGlzRXhwcmVzc2lvbjogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LlRoaXNFeHByZXNzaW9uO1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaFRocm93U3RhdGVtZW50OiBmdW5jdGlvbiAoYXJndW1lbnQpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5UaHJvd1N0YXRlbWVudDtcbiAgICAgICAgICAgIHRoaXMuYXJndW1lbnQgPSBhcmd1bWVudDtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hUcnlTdGF0ZW1lbnQ6IGZ1bmN0aW9uIChibG9jaywgaGFuZGxlciwgZmluYWxpemVyKSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguVHJ5U3RhdGVtZW50O1xuICAgICAgICAgICAgdGhpcy5ibG9jayA9IGJsb2NrO1xuICAgICAgICAgICAgdGhpcy5ndWFyZGVkSGFuZGxlcnMgPSBbXTtcbiAgICAgICAgICAgIHRoaXMuaGFuZGxlcnMgPSBoYW5kbGVyID8gWyBoYW5kbGVyIF0gOiBbXTtcbiAgICAgICAgICAgIHRoaXMuaGFuZGxlciA9IGhhbmRsZXI7XG4gICAgICAgICAgICB0aGlzLmZpbmFsaXplciA9IGZpbmFsaXplcjtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hVbmFyeUV4cHJlc3Npb246IGZ1bmN0aW9uIChvcGVyYXRvciwgYXJndW1lbnQpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IChvcGVyYXRvciA9PT0gJysrJyB8fCBvcGVyYXRvciA9PT0gJy0tJykgPyBTeW50YXguVXBkYXRlRXhwcmVzc2lvbiA6IFN5bnRheC5VbmFyeUV4cHJlc3Npb247XG4gICAgICAgICAgICB0aGlzLm9wZXJhdG9yID0gb3BlcmF0b3I7XG4gICAgICAgICAgICB0aGlzLmFyZ3VtZW50ID0gYXJndW1lbnQ7XG4gICAgICAgICAgICB0aGlzLnByZWZpeCA9IHRydWU7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoVmFyaWFibGVEZWNsYXJhdGlvbjogZnVuY3Rpb24gKGRlY2xhcmF0aW9ucykge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LlZhcmlhYmxlRGVjbGFyYXRpb247XG4gICAgICAgICAgICB0aGlzLmRlY2xhcmF0aW9ucyA9IGRlY2xhcmF0aW9ucztcbiAgICAgICAgICAgIHRoaXMua2luZCA9ICd2YXInO1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaExleGljYWxEZWNsYXJhdGlvbjogZnVuY3Rpb24gKGRlY2xhcmF0aW9ucywga2luZCkge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LlZhcmlhYmxlRGVjbGFyYXRpb247XG4gICAgICAgICAgICB0aGlzLmRlY2xhcmF0aW9ucyA9IGRlY2xhcmF0aW9ucztcbiAgICAgICAgICAgIHRoaXMua2luZCA9IGtpbmQ7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoVmFyaWFibGVEZWNsYXJhdG9yOiBmdW5jdGlvbiAoaWQsIGluaXQpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5WYXJpYWJsZURlY2xhcmF0b3I7XG4gICAgICAgICAgICB0aGlzLmlkID0gaWQ7XG4gICAgICAgICAgICB0aGlzLmluaXQgPSBpbml0O1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaFdoaWxlU3RhdGVtZW50OiBmdW5jdGlvbiAodGVzdCwgYm9keSkge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LldoaWxlU3RhdGVtZW50O1xuICAgICAgICAgICAgdGhpcy50ZXN0ID0gdGVzdDtcbiAgICAgICAgICAgIHRoaXMuYm9keSA9IGJvZHk7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoV2l0aFN0YXRlbWVudDogZnVuY3Rpb24gKG9iamVjdCwgYm9keSkge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LldpdGhTdGF0ZW1lbnQ7XG4gICAgICAgICAgICB0aGlzLm9iamVjdCA9IG9iamVjdDtcbiAgICAgICAgICAgIHRoaXMuYm9keSA9IGJvZHk7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoRXhwb3J0U3BlY2lmaWVyOiBmdW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gICAgICAgICAgdGhpcy5zcGVjaWZpZXJzID0gc3BlY2lmaWVycztcbiAgICAgICAgICAgIHRoaXMuc291cmNlID0gc3JjO1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaEV4cG9ydERlZmF1bHREZWNsYXJhdGlvbjogZnVuY3Rpb24gKGRlY2xhcmF0aW9uKSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguRXhwb3J0RGVmYXVsdERlY2xhcmF0aW9uO1xuICAgICAgICAgICAgdGhpcy5kZWNsYXJhdGlvbiA9IGRlY2xhcmF0aW9uO1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaEV4cG9ydEFsbERlY2xhcmF0aW9uOiBmdW5jdGlvbiAoc3JjKSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguRXhwb3J0QWxsRGVjbGFyYXRpb247XG4gICAgICAgICAgICB0aGlzLnNvdXJjZSA9IHNyYztcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hJbXBvcnRTcGVjaWZpZXI6IGZ1bmN0aW9uIChsb2NhbCwgaW1wb3J0ZWQpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5JbXBvcnRTcGVjaWZpZXI7XG4gICAgICAgICAgICB0aGlzLmxvY2FsID0gbG9jYWwgfHwgaW1wb3J0ZWQ7XG4gICAgICAgICAgICB0aGlzLmltcG9ydGVkID0gaW1wb3J0ZWQ7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoSW1wb3J0RGVjbGFyYXRpb246IGZ1bmN0aW9uIChzcGVjaWZpZXJzLCBzcmMpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5JbXBvcnREZWNsYXJhdGlvbjtcbiAgICAgICAgICAgIHRoaXMuc3BlY2lmaWVycyA9IHNwZWNpZmllcnM7XG4gICAgICAgICAgICB0aGlzLnNvdXJjZSA9IHNyYztcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfVxuICAgIH07XG5cblxuICAgIGZ1bmN0aW9uIHJlY29yZEVycm9yKGVycm9yKSB7XG4gICAgICAgIHZhciBlLCBleGlzdGluZztcblxuICAgICAgICBmb3IgKGUgPSAwOyBlIDwgZXh0cmEuZXJyb3JzLmxlbmd0aDsgZSsrKSB7XG4gICAgICAgICAgICBleGlzdGluZyA9IGV4dHJhLmVycm9yc1tlXTtcbiAgICAgICAgICAgIC8vIFByZXZlbnQgZHVwbGljYXRlZCBlcnJvci5cbiAgICAgICAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBuZXh0ICovXG4gICAgICAgICAgICBpZiAoZXhpc3RpbmcuaW5kZXggPT09IGVycm9yLmluZGV4ICYmIGV4aXN0aW5nLm1lc3NhZ2UgPT09IGVycm9yLm1lc3NhZ2UpIHtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBleHRyYS5lcnJvcnMucHVzaChlcnJvcik7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gY3JlYXRlRXJyb3IobGluZSwgcG9zLCBkZXNjcmlwdGlvbikge1xuICAgICAgICB2YXIgZXJyb3IgPSBuZXcgRXJyb3IoJ0xpbmUgJyArIGxpbmUgKyAnOiAnICsgZGVzY3JpcHRpb24pO1xuICAgICAgICBlcnJvci5pbmRleCA9IHBvcztcbiAgICAgICAgZXJyb3IubGlu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xkKS9nLFxuICAgICAgICAgICAgZnVuY3Rpb24gKHdob2xlLCBpZHgpIHtcbiAgICAgICAgICAgICAgICBhc3NlcnQoaWR4IDwgYXJncy5sZW5ndGgsICdNZXNzYWdlIHJlZmVyZW5jZSBtdXN0IGJlIGluIHJhbmdlJyk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGFyZ3NbaWR4XTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgKTtcblxuICAgICAgICBlcnJvciA9IGNyZWF0ZUVycm9yKGxpbmVOdW1iZXIsIGxhc3RJbmRleCwgbXNnKTtcbiAgICAgICAgaWYgKGV4dHJhLmVycm9ycykge1xuICAgICAgICAgICAgcmVjb3JkRXJyb3IoZXJyb3IpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhyb3cgZXJyb3I7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvLyBUaHJvdyBhbiBleGNlcHRpb24gYmVjYXVzZSBvZiB0aGUgdG9rZW4uXG5cbiAgICBmdW5jdGlvbiB1bmV4cGVjdGVkVG9rZW5FcnJvcih0b2tlbiwgbWVzc2FnZSkge1xuICAgICAgICB2YXIgdmFsdWUsIG1zZyA9IG1lc3NhZ2UgfHwgTWVzc2FnZXMuVW5leHBlY3RlZFRva2VuO1xuXG4gICAgICAgIGlmICh0b2tlbikge1xuICAgICAgICAgICAgaWYgKCFtZXNzYWdlKSB7XG4gICAgICAgICAgICAgICAgbXNnID0gKHRva2VuLnR5cGUgPT09IFRva2VuLkVPRikgPyBNZXNzYWdlcy5VbmV4cGVjdGVkRU9TIDpcbiAgICAgICAgICAgICAgICAgICAgKHRva2VuLnR5cGUgPT09IFRva2VuLklkZW50aWZpZXIpID8gTWVzc2FnZXMuVW5leHBlY3RlZElkZW50aWZpZXIgOlxuICAgICAgICAgICAgICAgICAgICAodG9rZW4udHlwZSA9PT0gVG9rZW4uTnVtZXJpY0xpdGVyYWwpID8gTWVzc2FnZXMuVW5leHBlY3RlZE51bWJlciA6XG4gICAgICAgICAgICAgICAgICAgICh0b2tlbi50eXBlID09PSBUb2tlbi5TdHJpbmdMaXRlcmFsKSA/IE1lc3NhZ2VzLlVuZXhwZWN0ZWRTdHJpbmcgOlxuICAgICAgICAgICAgICAgICAgICAodG9rZW4udHlwZSA9PT0gVG9rZW4uVGVtcGxhdGUpID8gTWVzc2FnZXMuVW5leHBlY3RlZFRlbXBsYXRlIDpcbiAgICAgICAgICAgICAgICAgICAgTWVzc2FnZXMuVW5leHBlY3RlZFRva2VuO1xuXG4gICAgICAgICAgICAgICAgaWYgKHRva2VuLnR5cGUgPT09IFRva2VuLktleXdvcmQpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlzRnV0dXJlUmVzZXJ2ZWRXb3JkKHRva2VuLnZhbHVlKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbXNnID0gTWVzc2FnZXMuVW5leHBlY3RlZFJlc2VydmVkO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHN0cmljdCAmJiBpc1N0cmljdE1vZGVSZXNlcnZlZFdvcmQodG9rZW4udmFsdWUpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBtc2cgPSBNZXNzYWdlcy5TdHJpY3RSZXNlcnZlZFdvcmQ7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHZhbHVlID0gKHRva2VuLnR5cGUgPT09IFRva2VuLlRlbXBsYXRlKSA/IHRva2VuLnZhbHVlLnJhdyA6IHRva2VuLnZhbHVlO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdmFsdWUgPSAnSUxMRUdBTCc7XG4gICAgICAgIH1cblxuICAgICAgICBtc2cgPSBtc2cucmVwbGFjZSgnJTAnLCB2YWx1ZSk7XG5cbiAgICAgICAgcmV0dXJuICh0b2tlbiAmJiB0eXBlb2YgdG9rZW4ubGluZU51bWJlciA9PT0gJ251bWJlcic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ICAgICByZXR1cm4gbG9va2FoZWFkLnR5cGUgPT09IFRva2VuLklkZW50aWZpZXIgJiYgbG9va2FoZWFkLnZhbHVlID09PSBrZXl3b3JkO1xuICAgIH1cblxuICAgIC8vIFJldHVybiB0cnVlIGlmIHRoZSBuZXh0IHRva2VuIGlzIGFuIGFzc2lnbm1lbnQgb3BlcmF0b3JcblxuICAgIGZ1bmN0aW9uIG1hdGNoQXNzaWduKCkge1xuICAgICAgICB2YXIgb3A7XG5cbiAgICAgICAgaWYgKGxvb2thaGVhZC50eXBlICE9PSBUb2tlbi5QdW5jdHVhdG9yKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgb3AgPSBsb29rYWhlYWQudmFsdWU7XG4gICAgICAgIHJldHVybiBvcCA9PT0gJz0nIHx8XG4gICAgICAgICAgICBvcCA9PT0gJyo9JyB8fFxuICAgICAgICAgICAgb3AgPT09ICcvPScgfHxcbiAgICAgICAgICAgIG9wID09PSAnJT0nIHx8XG4gICAgICAgICAgICBvcCA9PT0gJys9JyB8fFxuICAgICAgICAgICAgb3AgPT09ICctPScgfHxcbiAgICAgICAgICAgIG9wID09PSAnPDw9JyB8fFxuICAgICAgICAgICAgb3AgPT09ICc+Pj0nIHx8XG4gICAgICAgICAgICBvcCA9PT0gJz4+Pj0nIHx8XG4gICAgICAgICAgICBvcCA9PT0gJyY9JyB8fFxuICAgICAgICAgICAgb3AgPT09ICdePScgfHxcbiAgICAgICAgICAgIG9wID09PSAnfD0nO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGNvbnN1bWVTZW1pY29sb24oKSB7XG4gICAgICAgIC8vIENhdGNoIHRoZSB2ZXJ5IGNvbW1vbiBjYXNlIGZpcnN0OiBpbW1lZGlhdGVseSBhIHNlbWljb2xvbiAoVSswMDNCKS5cbiAgICAgICAgaWYgKHNvdXJjZS5jaGFyQ29kZUF0KHN0YXJ0SW5kZXgpID09PSAweDNCIHx8IG1hdGNoKC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cbiAgICAgICAgICAgICAgICAgICAgcmVzdE5vZGUgPSBuZXcgTm9kZSgpO1xuICAgICAgICAgICAgICAgICAgICBsZXgoKTtcbiAgICAgICAgICAgICAgICAgICAgcmVzdCA9IHBhcnNlVmFyaWFibGVJZGVudGlmaWVyKCk7XG4gICAgICAgICAgICAgICAgICAgIGVsZW1lbnRzLnB1c2gocmVzdE5vZGUuZmluaXNoUmVzdEVsZW1lbnQocmVzdCkpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBlbGVtZW50cy5wdXNoKHBhcnNlUGF0dGVybldpdGhEZWZhdWx0KCkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoIW1hdGNoKCddJykpIHtcbiAgICAgICAgICAgICAgICAgICAgZXhwZWN0KCcsJyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgIH1cblxuICAgICAgICBleHBlY3QoJ10nKTtcblxuICAgICAgICByZXR1cm4gbm9kZS5maW5pc2hBcnJheVBhdHRlcm4oZWxlbWVudHMpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHBhcnNlUHJvcGVydHlQYXR0ZXJuKCkge1xuICAgICAgICB2YXIgbm9kZSA9IG5ldyBOb2RlKCksIGtleSwgY29tcHV0ZWQgPSBtYXRjaCgnWycpLCBpbml0O1xuICAgICAgICBpZiAobG9va2FoZWFkLnR5cGUgPT09IFRva2VuLklkZW50aWZpZXIpIHtcbiAgICAgICAgICAgIGtleSA9IHBhcnNlVmFyaWFibGVJZGVudGlmaWVyKCk7XG4gICAgICAgICAgICBpZiAobWF0Y2goJz0nKSkge1xuICAgICAgICAgICAgICAgIGxleCgpO1xuICAgICAgICAgICAgICAgIGluaXQgPSBwYXJzZUFzc2lnbm1lbnRFeHByZXNzaW9uKCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG5vZGUuZmluaXNoUHJvcGVydHkoXG4gICAgICAgICAgICAgICAgICAgICdpbml0Jywga2V5LCBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgbmV3IFdyYXBwaW5nTm9kZShrZXkpLmZpbmlzaEFzc2lnbm1lbnRQYXR0ZXJuKGtleSwgaW5pdCksIGZhbHNlLCBmYWxzZSk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCFtYXRjaCgnOicpKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG5vZGUuZmluaXNoUHJvcGVydHkoJ2luaXQnLCBrZXksIGZhbHNlLCBrZXksIGZhbHNlLCB0cnVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGtleSA9IHBhcnNlT2JqZWN0UHJvcGVydHlLZXkoKTtcbiAgICAgICAgfVxuICAgICAgICBleHBlY3QoJzonKTtcbiAgICAgICAgaW5pdCA9IHBhcnNlUGF0dGVybldpdGhEZWZhdWx0KCk7XG4gICAgICAgIHJldHVybiBub2RlLmZpbmlzaFByb3BlcnR5KCdpbml0Jywga2V5LCBjb21wdXRlZCwgaW5pdCwgZmFsc2UsIGZhbHNlKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBwYXJzZU9iamVjdFBhdHRlcm4oKSB7XG4gICAgICAgIHZhciBub2RlID0gbmV3IE5vZGUoKSwgcHJvcGVydGllcyA9IFtdO1xuXG4gICAgICAgIGV4cGVjdCgneycpO1xuXG4gICAgICAgIHdoaWxlICghbWF0Y2goJ30nKSkge1xuICAgICAgICAgICAgcHJvcGVydGllcy5wdXNoKHBhcnNlUHJvcGVydHlQYXR0ZXJuKCkpO1xuICAgICAgICAgICAgaWYgKCFtYXRjaCgnfScpKSB7XG4gICAgICAgICAgICAgICAgZXhwZWN0KCcsJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBsZXgoKTtcblxuICAgICAgICByZXR1cm4gbm9kZS5maW5pc2hPYmplY3R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WFsaXNlcigpIHtcbiAgICAgICAgdmFyIGVsZW1lbnRzID0gW10sIG5vZGUgPSBuZXcgTm9kZSgpLCByZXN0U3ByZWFkO1xuXG4gICAgICAgIGV4cGVjdCgnWycpO1xuXG4gICAgICAgIHdoaWxlICghbWF0Y2goJ10nKSkge1xuICAgICAgICAgICAgaWYgKG1hdGNoKCcsJykpIHtcbiAgICAgICAgICAgICAgICBsZXgoKTtcbiAgICAgICAgICAgICAgICBlbGVtZW50cy5wdXNoKG51bGwpO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChtYXRjaCgnLi4uJykpIHtcbiAgICAgICAgICAgICAgICByZXN0U3ByZWFkID0gbmV3IE5vZGUoKTtcbiAgICAgICAgICAgICAgICBsZXgoKTtcbiAgICAgICAgICAgICAgICByZXN0U3ByZWFkLmZpbmlzaFNwcmVhZEVsZW1lbnQoaW5oZXJpdENvdmVyR3JhbW1hcihwYXJzZUFzc2lnbm1lbnRFeHByZXNzaW9uKSk7XG5cbiAgICAgICAgICAgICAgICBpZiAoIW1hdGNoKCddJykpIHtcbiAgICAgICAgICAgICAgICAgICAgaXNBc3NpZ25tZW50VGFyZ2V0ID0gaXNCaW5kaW5nRWxlbWVudCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICBleHBlY3QoJywnKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxlbWVudHMucHVzaChyZXN0U3ByZWFkKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgZWxlbWVudHMucHVzaChpbmhlcml0Q292ZXJHcmFtbWFyKHBhcnNlQXNzaWdubWVudEV4cHJlc3Npb24pKTtcblxuICAgICAgICAgICAgICAgIGlmICghbWF0Y2goJ10nKSkge1xuICAgICAgICAgICAgICAgICAgICBleHBlY3QoJywnKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBsZXgoKTtcblxuICAgICAgICByZXR1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AgICAgICAgICAgICAgZXhwZWN0KCcoJyk7XG4gICAgICAgICAgICAgICAgZXhwZWN0KCcpJyk7XG4gICAgICAgICAgICAgICAgdmFsdWUgPSBwYXJzZVByb3BlcnR5RnVuY3Rpb24obWV0aG9kTm9kZSwge1xuICAgICAgICAgICAgICAgICAgICBwYXJhbXM6IFtdLFxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0czogW10sXG4gICAgICAgICAgICAgICAgICAgIHN0cmljdGVkOiBudWxsLFxuICAgICAgICAgICAgICAgICAgICBmaXJzdFJlc3RyaWN0ZWQ6IG51bGwsXG4gICAgICAgICAgICAgICAgICAgIG1lc3NhZ2U6IG51bGxcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICByZXR1cm4gbm9kZS5maW5pc2hQcm9wZXJ0eSgnZ2V0Jywga2V5LCBjb21wdXRlZCwgdmFsdWUsIGZhbHNlLCBmYWxzZSk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHRva2VuLnZhbHVlID09PSAnc2V0JyAmJiBsb29rYWhlYWRQcm9wZXJ0eU5hbWUoKSkge1xuICAgICAgICAgICAgICAgIGNvbXB1dGVkID0gbWF0Y2goJ1snKTtcbiAgICAgICAgICAgICAgICBrZXkgPSBwYXJzZU9iamVjdFByb3BlcnR5S2V5KCk7XG4gICAgICAgICAgICAgICAgbWV0aG9kTm9kZSA9IG5ldyBOb2RlKCk7XG4gICAgICAgICAgICAgICAgZXhwZWN0KCcoJyk7XG5cbiAgICAgICAgICAgICAgICBvcHRpb25zID0ge1xuICAgICAgICAgICAgICAgICAgICBwYXJhbXM6IFtdLFxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0Q291bnQ6IDAsXG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHRzOiBbXSxcbiAgICAgICAgICAgICAgICAgICAgZmlyc3RSZXN0cmljdGVkOiBudWxsLFxuICAgICAgICAgICAgICAgICAgICBwYXJhbVNldDoge31cbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIGlmIChtYXRjaCgnKScpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRvbGVyYXRlVW5leHBlY3RlZFRva2VuKGxvb2thaGVhZCk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcGFyc2VQYXJhbShvcHRpb25zKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMuZGVmYXVsdENvdW50ID09PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zLmRlZmF1bHRzID0gW107XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZXhwZWN0KCcpJyk7XG5cbiAgICAgICAgICAgICAgICB2YWx1ZSA9IHBhcnNlUHJvcGVydHlGdW5jdGlvbihtZXRob2ROb2RlLCBvcHRpb25zKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gbm9kZS5maW5pc2hQcm9wZXJ0eSgnc2V0Jywga2V5LCBjb21wdXRlZCwgdmFsdWUsIGZhbHNlLCBmYWxzZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAobWF0Y2goJygnKSkge1xuICAgICAgICAgICAgdmFsdWUgPSBwYXJzZVByb3BlcnR5TWV0aG9kRnVuY3Rpb24oKTtcbiAgICAgICAgICAgIHJldHVybiBub2RlLmZpbmlzaFByb3BlcnR5KCdpbml0Jywga2V5LCBjb21wdXRlZCwgdmFsdWUsIHRydWUsIGZhbHNlKTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIE5vdCBhIE1ldGhvZERlZmluaXRpb24uXG4gICAgICAgIHJldHVybiBudWxsO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGNoZWNrUHJvdG8oa2V5LCBjb21wdXRlZCwgaGFzUHJvdG8pIHtcbiAgICAgICAgaWYgKGNvbXB1dGVkID09PSBmYWxzZSAmJiAoa2V5LnR5cGUgPT09IFN5bnRheC5JZGVudGlmaWVyICYmIGtleS5uYW1lID09PSAnX19wcm90b19fJyB8fFxuICAgICAgICAgICAga2V5LnR5cGUgPT09IFN5bnRheC5MaXRlcmFsICYmIGtleS52YWx1ZSA9PT0gJ19fcHJvdG9fXycpKSB7XG4gICAgICAgICAgICBpZiAoaGFzUHJvdG8udmFsdWUpIHtcbiAgICAgICAgICAgICAgICB0b2xlcmF0ZUVycm9yKE1lc3NhZ2VzLkR1cGxpY2F0ZVByb3RvUHJvcGVydHkpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBoYXNQcm90by52YWx1ZSA9IHRydWU7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBmdW5jdGlvbiBwYXJzZU9iamVjdFByb3BlcnR5KGhhc1Byb3RvKSB7XG4gICAgICAgIHZhciB0b2tlbiA9IGxvb2thaGVhZCwgbm9kZSA9IG5ldyBOb2RlKCksIGNvbXB1dGVkLCBrZXksIG1heWJlTWV0aG9kLCB2YWx1ZTtcblxuICAgICAgICBjb21wdXRlZCA9IG1hdGNoKCdbJyk7XG4gICAgICAgIGtleSA9IHBhcnNlT2JqZWN0UHJvcGVydHlLZXkoKTtcbiAgICAgICAgbWF5YmVNZXRob2QgPSB0cnlQYXJzZU1ldGhvZERlZmluaXRpb24odG9rZW4sIGtleSwgY29tcHV0ZWQsIG5vZGUpO1xuXG4gICAgICAgIGlmIChtYXliZU1ldGhvZCkge1xuICAgICAgICAgICAgY2hlY2tQcm90byhtYXliZU1ldGhvZC5rZXksIG1heWJlTWV0aG9kLmNvbXB1dGVkLCBoYXNQcm90byk7XG4gICAgICAgICAgICAvLyBmaW5pc2hlZFxuICAgICAgICAgICAgcmV0dXJuIG1heWJlTWV0aG9kO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gaW5pdCBwcm9wZXJ0eSBvciBzaG9ydCBoYW5kIHByb3BlcnR5LlxuICAgICAgICBjaGVja1Byb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KCkge1xuICAgICAgICB2YXIgcHJvcGVydGllcyA9IFtdLCBoYXNQcm90byA9IHt2YWx1ZTogZmFsc2V9LCBub2RlID0gbmV3IE5vZGUoKTtcblxuICAgICAgICBleHBlY3QoJ3snKTtcblxuICAgICAgICB3aGlsZSAoIW1hdGNoKCd9JykpIHtcbiAgICAgICAgICAgIHByb3BlcnRpZXMucHVzaChwYXJzZU9iamVjdFByb3BlcnR5KGhhc1Byb3RvKSk7XG5cbiAgICAgICAgICAgIGlmICghbWF0Y2goJ30nKSkge1xuICAgICAgICAgICAgICAgIGV4cGVjdENvbW1hU2VwYXJhdG9yKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBleHBlY3QoJ30nKTtcblxuICAgICAgICByZXR1cm4gbm9kZS5maW5pc2hPYmplY3RFeHByZXNzaW9uKHByb3BlcnRpZXMpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHJlaW50ZXJwcmV0RXhwcmVzc2lvbkFzUGF0dGVybihleHByKSB7XG4gICAgICAgIHZhciBpO1xuICAgICAgICBzd2l0Y2ggKGV4cHIudHlwZSkge1xuICAgICAgICBjYXNlIFN5bnRheC5JZGVudGlmaWVyOlxuICAgICAgICBjYXNlIFN5bnRheC5NZW1iZXJFeHByZXNzaW9uOlxuICAgICAgICBjYXNlIFN5bnRheC5SZXN0RWxlbWVudDpcbiAgICAgICAgY2FzZSBTeW50YXguQXNzaWdubWVudFBhdHRlcm46XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSBTeW50YXguU3ByZWFkRWxlbWVudDpcbiAgICAgICAgICAgIGV4cHIudHlwZSA9IFN5bnRheC5SZXN0RWxlbWVudDtcbiAgICAgICAgICAgIHJlaW50ZXJwcmV0RXhwcmVzc2lvbkFzUGF0dGVybihleHByLmFyZ3VtZW50KTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIFN5bnRheC5BcnJheUV4cHJlc3Npb246XG4gICAgICAgICAgICBleHByLnR5cGUgPSBTeW50YXguQXJyYXlQYXR0ZXJuO1xuICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IGV4cHIuZWxlbWVudHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBpZiAoZXhwci5lbGVtZW50c1tpXSAhPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICByZWludGVycHJldEV4cHJlc3Npb25Bc1BhdHRlcm4oZXhwci5lbGVtZW50c1tpXSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgU3ludGF4Lk9iamVjdEV4cHJlc3Npb246XG4gICAgICAgICAgICBleHByLnR5cGUgPSBTeW50YXguT2JqZWN0UGF0dGVybjtcbiAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBleHByLnByb3BlcnRpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICByZWludGVycHJldEV4cHJlc3Npb25Bc1BhdHRlcm4oZXhwci5wcm9wZXJ0aWVzW2ldLnZhbHVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIFN5bnRheC5Bc3NpZ25tZW50RXhwcmVzc2lvbjpcbiAgICAgICAgICAgIGV4cHIudHlwZSA9IFN5bnRheC5Bc3NpZ25tZW50UGF0dGVybjtcbiAgICAgICAgICAgIHJlaW50ZXJwcmV0RXhwcmVzc2lvbkFzUGF0dGVybihleHByLmxlZnQpO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAvLyBBbGxvdyBvdGhlciBub2RlIHR5cGUgZm9yIHRvbGVyYW50IHBhcnNpbmcuXG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIHBhcnNlVGVtcGxhdGVFbGVtZW50KG9wdGlvbikge1xuICAgICAgIC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yYXRvclxuXG4gICAgZnVuY3Rpb24gcGFyc2VHcm91cEV4cHJlc3Npb24oKSB7XG4gICAgICAgIHZhciBleHByLCBleHByZXNzaW9ucywgc3RhcnRUb2tlbiwgaTtcblxuICAgICAgICBleHBlY3QoJygnKTtcblxuICAgICAgICBpZiAobWF0Y2goJyknKSkge1xuICAgICAgICAgICAgbGV4KCk7XG4gICAgICAgICAgICBpZiAoIW1hdGNoKCc9PicpKSB7XG4gICAgICAgICAgICAgICAgZXhwZWN0KCc9PicpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICB0eXBlOiBQbGFjZUhvbGRlcnMuQXJyb3dQYXJhbWV0ZXJQbGFjZUhvbGRlcixcbiAgICAgICAgICAgICAgICBwYXJhbXM6IFtdXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG5cbiAgICAgICAgc3RhcnRUb2tlbiA9IGxvb2thaGVhZDtcbiAgICAgICAgaWYgKG1hdGNoKCcuLi4nKSkge1xuICAgICAgICAgICAgZXhwciA9IHBhcnNlUmVzdEVsZW1lbnQoKTtcbiAgICAgICAgICAgIGV4cGVjdCgnKScpO1xuICAgICAgICAgICAgaWYgKCFtYXRjaCgnPT4nKSkge1xuICAgICAgICAgICAgICAgIGV4cGVjdCgnPT4nKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgdHlwZTogUGxhY2VIb2xkZXJzLkFycm93UGFyYW1ldGVyUGxhY2VIb2xkZXIsXG4gICAgICAgICAgICAgICAgcGFyYW1zOiBbZXhwcl1cbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cblxuICAgICAgICBpc0JpbmRpbmdFbGVtZW50ID0gdHJ1ZTtcbiAgICAgICAgZXhwciA9IGluaGVyaXRDb3ZlckdyYW1tYXIocGFyc2VBc3NpZ25tZW50RXhwcmVzc2lvbik7XG5cbiAgICAgICAgaWYgKG1hdGNoKCcsJykpIHtcbiAgICAgICAgICAgIGlzQXNzaWdubWVudFRhcmdldCA9IGZhbHNlO1xuICAgICAgICAgICAgZXhwcmVzc2lvbnMgPSBbZXhwcl07XG5cbiAgICAgICAgICAgIHdoaWxlIChzdGFydEluZGV4IDwgbGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgaWYgKCFtYXRjaCgnLCcpKSB7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBsZXgoKTtcblxuICAgICAgICAgICAgICAgIGlmIChtYXRjaCgnLi4uJykpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFpc0JpbmRpbmdFbGVtZW50KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvd1VuZXhwZWN0ZWRUb2tlbihsb29rYWhlYWQpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGV4cHJlc3Npb25zLnB1c2gocGFyc2VSZXN0RWxlbWVudCgpKTtcbiAgICAgICAgICAgICAgICAgICAgZXhwZWN0KCcpJyk7XG4gICAgICAgICAgICAgICAgICAgIGlmICghbWF0Y2goJz0+JykpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4cGVjdCgnPT4nKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpc0JpbmRpbmdFbGVtZW50ID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBleHByZXNzaW9ucy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmVpbnRlcnByZXRFeHByZXNzaW9uQXNQYXR0ZXJuKGV4cHJlc3Npb25zW2ldKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogUGxhY2VIb2xkZXJzLkFycm93UGFyYW1ldGVyUGxhY2VIb2xkZXIsXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXM6IGV4cHJlc3Npb25zXG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZXhwcmVzc2lvbnMucHVzaChpbmhlcml0Q292ZXJHcmFtbWFyKHBhcnNlQXNzaWdubWVudEV4cHJlc3Npb24pKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZXhwciA9IG5ldyBXcmFwcGluZ05vZGUoc3RhcnRUb2tlbikuZmluaXNoU2VxdWVuY2VFeHByZXNzaW9uKGV4cHJlc3Npb25zKTtcbiAgICAgICAgfVxuXG5cbiAgICAgICAgZXhwZWN0KCcpJyk7XG5cbiAgICAgICAgaWYgKG1hdGNoKCc9PicpKSB7XG4gICAgICAgICAgICBpZiAoIWlzQmluZGluZ0VsZW1lbnQpIHtcbiAgICAgICAgICAgICAgICB0aHJvd1VuZXhwZWN0ZWRUb2tlbihsb29rYWhlYWQpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoZXhwci50eXBlID09PSBTeW50YXguU2VxdWVuY2VFeHByZXNzaW9uKSB7XG4gICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IGV4cHIuZXhwcmVzc2lvbnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgcmVpbnRlcnByZXRFeHByZXNzaW9uQXNQYXR0ZXJuKGV4cHIuZXhwcmVzc2lvbnNbaV0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmVpbnRlcnByZXRFeHByZXNzaW9uQXNQYXR0ZXJuKGV4cHIpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBleHByID0ge1xuICAgICAgICAgICAgICAgIHR5cGU6IFBsYWNlSG9sZGVycy5BcnJvd1BhcmFtZXRlclBsYWNlSG9sZGVyLFxuICAgICAgICAgICAgICAgIHBhcmFtczogZXhwci50eXBlID09PSBTeW50YXguU2VxdWVuY2VFeHByZXNzaW9uID8gZXhwci5leHByZXNzaW9ucyA6IFtleHByXVxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICBpc0JpbmRpbmdFbGVtZW50ID0gZmFsc2U7XG4gICAgICAgIHJldHVybiBleHByO1xuICAgIH1cblxuXG4gICAgLy8gMTEuMSBQcmltYXJ5IEV4cHJlc3Npb25zXG5cbiAgICBmdW5jdGlvbiBwYXJzZVByaW1hcnlFeHByZXNzaW9uKCkge1xuICAgICAgICB2YXIgdHlwZSwgdG9rZW4sIGV4cHIsIG5vZGU7XG5cbiAgICAgICAgaWYgKG1hdGNoKCcoJykpIHtcbiAgICAgICAgICAgIGlzQmluZGluZ0VsZW1lbnQgPSBmYWxzZTtcbiAgICAgICAgICAgIHJldHVybiBpbmhlcml0Q292ZXJHcmFtbWFyKHBhcnNlR3JvdXBFeHByZXNzaW9uKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChtYXRjaCgnWycpKSB7XG4gICAgICAgICAgICByZXR1cm4gaW5oZXJpdENvdmVyR3JhbW1hcihwYXJzZUFycmF5SW5pdGlhbGlzZXIpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKG1hdGNoKCd7JykpIHtcbiAgICAgICAgICAgIHJldHVybiBpbmhlcml0Q292ZXJHcmFtbWFyKHBhcnNlT2JqZWN0SW5pdGlhbGlzZXIpO1xuICAgICAgICB9XG5cbiAgICAgICAgdHlwZSA9IGxvb2thaGVhZC50eXBlO1xuICAgICAgICBub2RlID0gbmV3IE5vZGUoKTtcblxuICAgICAgICBpZiAodHlwZSA9PT0gVG9rZW4uSWRlbnRpZmllcikge1xuICAgICAgICAgICAgZXhwciA9IG5vZGUuZmluaXNoSWRlbnRpZmllcihsZXgoKS52YWx1ZSk7XG4gICAgICAgIH0gZWxzZSBpZiAodHlwZSA9PT0gVG9rZW4uU3RyaW5nTGl0ZXJhbCB8fCB0eXBlID09PSBUb2tlbi5OdW1lcmljTGl0ZXJhbCkge1xuICAgICAgICAgICAgaXNBc3NpZ25tZW50VGFyZ2V0ID0gaXNCaW5kaW5nRWxlbWVudCA9IGZhbHNlO1xuICAgICAgICAgICAgaWYgKHN0cmljdCAmJiBsb29rYWhlYWQub2N0YWwpIHtcbiAgICAgICAgICAgICAgICB0b2xlcmF0ZVVuZXhwZWN0ZWRUb2tlbihsb29rYWhlYWQsIE1lc3NhZ2VzLlN0cmljdE9jdGFsTGl0ZXJhbCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBleHByID0gbm9kZS5maW5pc2hMaXRlcmFsKGxleCgpKTtcbiAgICAgICAgfSBlbHNlIGlmICh0eXBlID09PSBUb2tlbi5LZXl3b3JkKSB7XG4gICAgICAgICAgICBpc0Fzc2lnbm1lbnRUYXJnZXQgPSBpc0JpbmRpbmdFbGVtZW50ID0gZmFsc2U7XG4gICAgICAgICAgICBpZiAobWF0Y2hLZXl3b3JkKCdmdW5jdGlvbicpKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhcnNlRnVuY3Rpb25FeHByZXNzaW9uKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAobWF0Y2hLZXl3b3JkKCd0aGlzJykpIHtcbiAgICAgICAgICAgICAgICBsZXgoKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gbm9kZS5maW5pc2hUaGlzRXhwcmVzc2lvbigpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKG1hdGNoS2V5d29yZCgnY2xhc3MnKSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBwYXJzZUNsYXNzRXhwcmVzc2lvbigpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhyb3dVbmV4cGVjdGVkVG9rZW4obGV4KCkpO1xuICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPT09IFRva2VuLkJvb2xlYW5MaXRlcmFsKSB7XG4gICAgICAgICAgICBpc0Fzc2lnbm1lbnRUYXJnZXQgPSBpc0JpbmRpbmdFbGVtZW50ID0gZmFsc2U7XG4gICAgICAgICAgICB0b2tlbiA9IGxleCgpO1xuICAgICAgICAgICAgdG9rZW4udmFsdWUgPSAodG9rZW4udmFsdWUgPT09ICd0cnVlJyk7XG4gICAgICAgICAgICBleHByID0gbm9kZS5maW5pc2hMaXRlcmFsKHRva2VuKTtcbiAgICAgICAgfSBlbHNlIGlmICh0eXBlID09PSBUb2tlbi5OdWxsTGl0ZXJhbCkge1xuICAgICAgICAgICAgaXNBc3NpZ25tZW50VGFyZ2V0ID0gaXNCaW5kaW5nRWxlbWVudCA9IGZhbHNlO1xuICAgICAgICAgICAgdG9rZW4gPSBsZXgoKTtcbiAgICAgICAgICAgIHRva2VuLnZhbHVlID0gbnVsbDtcbiAgICAgICAgICAgIGV4cHIgPSBub2RlLmZpbmlzaExpdGVyYWwodG9rZW4pO1xuICAgICAgICB9IGVsc2UgaWYgKG1hdGNoKCcvJykgfHwgbWF0Y2goJy89JykpIHtcbiAgICAgICAgICAgIGlzQXNzaWdubWVudFRhcmdldCA9IGlzQmluZGluZ0VsZW1lbnQgPSBmYWxzZTtcbiAgICAgICAgICAgIGluZGV4ID0gc3RhcnRJbmRleDtcblxuICAgICAgICAgICAgaWYgKHR5cGVvZiBleHRyYS50b2tlbnMgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgdG9rZW4gPSBjb2xsZWN0UmVnZXgoKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdG9rZW4gPSBzY2FuUmVnRXhwKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXgoKTtcbiAgICAgICAgICAgIGV4cHIgPSBub2RlLmZpbmlzaExpdGVyYWwodG9rZW4pO1xuICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPT09IFRva2VuLlRlbXBsYXRlKSB7XG4gICAgICAgICAgICBleHByID0gcGFyc2VUZW1wbGF0ZUxpdGVyYWwoKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKGxleCgpKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBleHByO1xuICAgIH1cblxuICAgIC8vIDExLjIgTGVmdC1IYW5kLVNpZGUgRXhwcmVzc2lvbnNcblxuICAgIGZ1bmN0aW9uIHBhcnNlQXJndW1lbnRzKCkge1xuICAgICAgICB2YXIgYXJncyA9IFtdO1xuXG4gICAgICAgIGV4cGVjdCgnKCcpO1xuXG4gICAgICAgIGlmICghbWF0Y2goJyknKSkge1xuICAgICAgICAgICAgd2hpbGUgKHN0YXJ0SW5kZXggPCBsZW5ndGgpIHtcbiAgICAgICAgICAgICAgICBhcmdzLnB1c2goaXNvbGF0ZUNvdmVyR3JhbW1hcihwYXJzZUFzc2lnbm1lbnRFeHByZXNzaW9uKSk7XG4gICAgICAgICAgICAgICAgaWYgKG1hdGNoKCcpJykpIHtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGV4cGVjdENvbW1hU2VwYXJhdG9yKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBleHBlY3QoJyknKTtcblxuICAgICAgICByZXR1cm4gYXJncztcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBwYXJzZU5vbkNvbXB1dGVkUHJvcGVydHkoKSB7XG4gICAgICAgIHZhciB0b2tlbiwgbm9kZSA9IG5ldyBOb2RlKCk7XG5cbiAgICAgICAgdG9rZW4gPSBsZXgoKTtcblxuICAgICAgICBpZiAoIWlzSWRlbnRpZmllck5hbWUodG9rZW4pKSB7XG4gICAgICAgICAgICB0aHJvd1VuZXhwZWN0ZWRUb2tlbih0b2tlbik7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gbm9kZS5maW5pc2hJZGVudGlmaWVyKHRva2VuLnZhbHVlK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XG4gICAgICAgIHN0YXJ0VG9rZW4gPSBsb29rYWhlYWQ7XG4gICAgICAgIHN0YXRlLmFsbG93SW4gPSB0cnVlO1xuXG4gICAgICAgIGlmIChtYXRjaEtleXdvcmQoJ3N1cGVyJykgJiYgc3RhdGUuaW5GdW5jdGlvbkJvZHkpIHtcbiAgICAgICAgICAgIGV4cHIgPSBuZXcgTm9kZSgpO1xuICAgICAgICAgICAgbGV4KCk7XG4gICAgICAgICAgICBleHByID0gZXhwci5maW5pc2hTdXBlcigpO1xuICAgICAgICAgICAgaWYgKCFtYXRjaCgnKCcpICYmICFtYXRjaCgnLicpICYmICFtYXRjaCgnWycpKSB7XG4gICAgICAgICAgICAgICAgdGhyb3dVbmV4cGVjdGVkVG9rZW4obG9va2FoZWFkKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGV4cHIgPSBpbmhlcml0Q292ZXJHcmFtbWFyKG1hdGNoS2V5d29yZCgnbmV3JykgPyBwYXJzZU5ld0V4cHJlc3Npb24gOiBwYXJzZVByaW1hcnlFeHByZXNzaW9uKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGZvciAoOzspIHtcbiAgICAgICAgICAgIGlmIChtYXRjaCgnLicpKSB7XG4gICAgICAgICAgICAgICAgaXNCaW5kaW5nRWxlbWVudCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIGlzQXNzaWdubWVudFRhcmdldCA9IHRydWU7XG4gICAgICAgICAgICAgICAgcHJvcGVydHkgPSBwYXJzZU5vbkNvbXB1dGVkTWVtYmVyKCk7XG4gICAgICAgICAgICAgICAgZXhwciA9IG5ldyBXcmFwcGluZ05vZGUoc3RhcnRUb2tlbikuZmluaXNoTWVtYmVyRXhwcmVzc2lvbignLicsIGV4cHIsIHByb3BlcnR5KTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobWF0Y2goJygnKSkge1xuICAgICAgICAgICAgICAgIGlzQmluZGluZ0VsZW1lbnQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICBpc0Fzc2lnbm1lbnRUYXJnZXQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICBhcmdzID0gcGFyc2VBcmd1bWVudHMoKTtcbiAgICAgICAgICAgICAgICBleHByID0gbmV3IFdyYXBwaW5nTm9kZShzdGFydFRva2VuKS5maW5pc2hDYWxsRXhwcmVzc2lvbihleHByLCBhcmdzKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobWF0Y2goJ1snKSkge1xuICAgICAgICAgICAgICAgIGlzQmluZGluZ0VsZW1lbnQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICBpc0Fzc2lnbm1lbnRUYXJnZXQgPSB0cnVlO1xuICAgICAgICAgICAgICAgIHByb3BlcnR5ID0gcGFyc2VDb21wdXRlZE1lbWJlcigpO1xuICAgICAgICAgICAgICAgIGV4cHIgPSBuZXcgV3JhcHBpbmdOb2RlKHN0YXJ0VG9rZW4pLmZpbmlzaE1lbWJlckV4cHJlc3Npb24oJ1snLCBleHByLCBwcm9wZXJ0eSk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGxvb2thaGVhZC50eXBlID09PSBUb2tlbi5UZW1wbGF0ZSAmJiBsb29rYWhlYWQuaGVhZCkge1xuICAgICAgICAgICAgICAgIHF1YXNpID0gcGFyc2VUZW1wbGF0ZUxpdGVyYWwoKTtcbiAgICAgICAgICAgICAgICBleHByID0gbmV3IFdyYXBwaW5nTm9kZShzdGFydFRva2VuKS5maW5pc2hUYWdnZWRUZW1wbGF0ZUV4cHJlc3Npb24oZXhwciwgcXVhc2kpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBzdGF0ZS5hbGxvd0luID0gcHJldmlvdXNBbGxvd0luO1xuXG4gICAgICAgIHJldHVybiBleHByO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHBhcnNlTGVmdEhhbmRTaWRlRXhwcmVzc2lvbigpIHtcbiAgICAgICAgdmFyIHF1YXNpLCBleHByLCBwcm9wZXJ0eSwgc3RhcnRUb2tlbjtcbiAgICAgICAgYXNzZXJ0KHN0YXRlLmFsbG93SW4sICdjYWxsZWUgb2YgbmV3IGV4cHJlc3Npb24gYWx3YXlzIGFsbG93IGluIGtleXdvcmQuJyk7XG5cbiAgICAgICAgc3RhcnRUb2tlbiA9IGxvb2thaGVhZDtcblxuICAgICAgICBpZiAobWF0Y2hLZXl3b3JkKCdzdXBlcicpICYmIHN0YXRlLmluRnVuY3Rpb25Cb2R5KSB7XG4gICAgICAgICAgICBleHByID0gbmV3IE5vZGUoKTtcbiAgICAgICAgICAgIGxleCgpO1xuICAgICAgICAgICAgZXhwciA9IGV4cHIuZmluaXNoU3VwZXIoKTtcbiAgICAgICAgICAgIGlmICghbWF0Y2goJ1snKSAmJiAhbWF0Y2goJy4nKSkge1xuICAgICAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKGxvb2thaGVhZCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBleHByID0gaW5oZXJpdENvdmVyR3JhbW1hcihtYXRjaEtleXdvcmQoJ25ldycpID8gcGFyc2VOZXdFeHByZXNzaW9uIDogcGFyc2VQcmltYXJ5RXhwcmVzc2lvbik7XG4gICAgICAgIH1cblxuICAgICAgICBmb3IgKDs7KSB7XG4gICAgICAgICAgICBpZiAobWF0Y2goJ1snKSkge1xuICAgICAgICAgICAgICAgIGlzQmluZGluZ0VsZW1lbnQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICBpc0Fzc2lnbm1lbnRUYXJnZXQgPSB0cnVlO1xuICAgICAgICAgICAgICAgIHByb3BlcnR5ID0gcGFyc2VDb21wdXRlZE1lbWJlcigpO1xuICAgICAgICAgICAgICAgIGV4cHIgPSBuZXcgV3JhcHBpbmdOb2RlKHN0YXJ0VG9rZW4pLmZpbmlzaE1lbWJlckV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dDYWxsKTtcblxuICAgICAgICBpZiAoIWhhc0xpbmVUZXJtaW5hdG9yICYmIGxvb2thaGVhZC50eXBlID09PSBUb2tlbi5QdW5jdHVhdG9yKSB7XG4gICAgICAgICAgICBpZiAobWF0Y2goJysrJykgfHwgbWF0Y2goJy0tJykpIHtcbiAgICAgICAgICAgICAgICAvLyAxMS4zLjEsIDExLjMuMlxuICAgICAgICAgICAgICAgIGlmIChzdHJpY3QgJiYgZXhwci50eXBlID09PSBTeW50YXguSWRlbnRpZmllciAmJiBpc1Jlc3RyaWN0ZWRXb3JkKGV4cHIubmFtZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdG9sZXJhdGVFcnJvcihNZXNzYWdlcy5TdHJpY3RMSFNQb3N0Zml4KTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZiAoIWlzQXNzaWdubWVudFRhcmdldCkge1xuICAgICAgICAgICAgICAgICAgICB0b2xlcmF0ZUVycm9yKE1lc3NhZ2VzLkludmFsaWRMSFNJbkFzc2lnbm1lbnQpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlzQXNzaWdubWVudFRhcmdldCA9IGlzQmluZGluZ0VsZW1lbnQgPSBmYWxzZTtcblxuICAgICAgICAgICAgICAgIHRva2VuID0gbGV4KCk7XG4gICAgICAgICAgICAgICAgZXhwciA9IG5ldyBXcmFwcGluZ05vZGUoc3RhcnRUb2tlbikuZmluaXNoUG9zdGZpeEV4cHJlc3Npb24odG9rZW4udmFsdWUsIGV4cHIpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGV4cHI7XG4gICAgfVxuXG4gICAgLy8gMTEuNCBVbmFyeSBPcGVyYXRvcnNcblxuICAgIGZ1bmN0aW9uIHBhcnNlVW5hcnlFeHByZXNzaW9uKCkge1xuICAgICAgICB2YXIgdG9rZW4sIGV4cHIsIHN0YXJ0VG9rZW47XG5cbiAgICAgICAgaWYgKGxvb2thaGVhZC50eXBlICE9PSBUb2tlbi5QdW5jdHVhdG9yICYmIGxvb2thaGVhZC50eXBlICE9PSBUb2tlbi5LZXl3b3JkKSB7XG4gICAgICAgICAgICBleHByID0gcGFyc2VQb3N0Zml4RXhwcmVzc2lvbigpO1xuICAgICAgICB9IGVsc2UgaWYgKG1hdGNoKCcrKycpIHx8IG1hdGNoKCctLScpKSB7XG4gICAgICAgICAgICBzdGFydFRva2VuID0gbG9va2FoZWFkO1xuICAgICAgICAgICAgdG9rZW4gPSBsZXgoKTtcbiAgICAgICAgICAgIGV4cHIgPSBpbmhlcml0Q292ZXJHcmFtbWFyKHBhcnNlVW5hcnlFeHByZXNzaW9uKTtcbiAgICAgICAgICAgIC8vIDExLjQuNCwgMTEuNC41XG4gICAgICAgICAgICBpZiAoc3RyaWN0ICYmIGV4cHIudHlwZSA9PT0gU3ludGF4LklkZW50aWZpZXIgJiYgaXNSZXN0cmljdGVkV29yZChleHByLm5hbWUpKSB7XG4gICAgICAgICAgICAgICAgdG9sZXJhdGVFcnJvcihNZXNzYWdlcy5TdHJpY3RMSFNQcmVmaXgpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoIWlzQXNzaWdubWVudFRhcmdldCkge1xuICAgICAgICAgICAgICAgIHRvbGVyYXRlRXJyb3IoTWVzc2FnZXMuSW52YWxpZExIU0luQXNzaWdubWVudCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBleHByID0gbmV3IFdyYXBwaW5nTm9kZShzdGFydFRva2VuKS5maW5pc2hVbmFyeUV4cHJlc3Npb24odG9rZW4udmFsdWUsIGV4cHIpO1xuICAgICAgICAgICAgaXNBc3NpZ25tZW50VGFyZ2V0ID0gaXNCaW5kaW5nRWxlbWVudCA9IGZhbHNlO1xuICAgICAgICB9IGVsc2UgaWYgKG1hdGNoKCcrJykgfHwgbWF0Y2goJy0nKSB8fCBtYXRjaCgnficpIHx8IG1hdGNoKCchJykpIHtcbiAgICAgICAgICA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IGV4cHIgPSBwYXJzZVBvc3RmaXhFeHByZXNzaW9uKCk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gZXhwcjtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBiaW5hcnlQcmVjZWRlbmNlKHRva2VuLCBhbGxvd0luKSB7XG4gICAgICAgIHZhciBwcmVjID0gMDtcblxuICAgICAgICBpZiAodG9rZW4udHlwZSAhPT0gVG9rZW4uUHVuY3R1YXRvciAmJiB0b2tlbi50eXBlICE9PSBUb2tlbi5LZXl3b3JkKSB7XG4gICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgfVxuXG4gICAgICAgIHN3aXRjaCAodG9rZW4udmFsdWUpIHtcbiAgICAgICAgY2FzZSAnfHwnOlxuICAgICAgICAgICAgcHJlYyA9IDE7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlICcmJic6XG4gICAgICAgICAgICBwcmVjID0gMjtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgJ3wnOlxuICAgICAgICAgICAgcHJlYyA9IDM7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlICdeJzpcbiAgICAgICAgICAgIHByZWMgPSA0O1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSAnJic6XG4gICAgICAgICAgICBwcmVjID0gNTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgJz09JzpcbiAgICAgICAgY2FzZSAnIT0nOlxuICAgICAgICBjYXNlICc9PT0nOlxuICAgICAgICBjYXNlICchPT0nOlxuICAgICAgICAgICAgcHJlYyA9IDY7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlICc8JzpcbiAgICAgICAgY2FzZSAnPic6XG4gICAgICAgIGNhc2UgJzw9JzpcbiAgICAgICAgY2FzZSAnPj0nOlxuICAgICAgICBjYXNlICdpbnN0YW5jZW9mJzpcbiAgICAgICAgICAgIHByZWMgPSA3O1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSAnaW4nOlxuICAgICAgICAgICAgcHJlYyA9IGFsbG93SW4gPyA3IDogMDtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgJzw8JzpcbiAgICAgICAgY2FzZSAnPj4nOlxuICAgICAgICBjYXNlICc+Pj4nOlxuICAgICAgICAgICAgcHJlYyA9IDg7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlICcrJzpcbiAgICAgICAgY2FzZSAnLSc6XG4gICAgICAgICAgICBwcmVjID0gOTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgJyonOlxuICAgICAgICBjYXNlICcvJzpcbiAgICAgICAgY2FzZSAnJSc6XG4gICAgICAgICAgICBwcmVjID0gMTE7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gcHJlYztcbiAgICB9XG5cbiAgICAvLyAxMS41IE11bHRpcGxpY2F0aXZlIE9wZXJhdG9yc1xuICAgIC8vIDExLjYgQWRkaXRpdmUgT3BlcmF0b3JzXG4gICAgLy8gMTEuNyBCaXR3aXNlIFNoaWZ0IE9wZXJhdG9yc1xuICAgIC8vIDExLjggUmVsYXRpb25hbCBPcGVyYXRvcnNcbiAgICAvLyAxMS45IEVxdWFsaXR5IE9wZXJhdG9yc1xuICAgIC8vIDExLjEwIEJpbmFyeSBCaXR3aXNlIE9wZXJhdG9yc1xuICAgIC8vIDExLjExIEJpbmFyeSBMb2dpY2FsIE9wZXJhdG9yc1xuXG4gICAgZnVuY3Rpb24gcGFyc2VCaW5hcnlFeHByZXNzaW9uKCkge1xuICAgICAgICB2YXIgbWFya2VyLCBtYXJrZXJzLCBleHByLCB0b2tlbiwgcHJlYywgc3RhY2ssIHJpZ2h0LCBvcGVyYXRvciwgbGVmdCw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AgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgIGFzc2VydChwYXJhbS50eXBlID09PSBTeW50YXguT2JqZWN0UGF0dGVybiwgJ0ludmFsaWQgdHlwZScpO1xuICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IHBhcmFtLnByb3BlcnRpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBjaGVja1BhdHRlcm5QYXJhbShvcHRpb25zLCBwYXJhbS5wcm9wZXJ0aWVzW2ldLnZhbHVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgfVxuICAgIGZ1bmN0aW9uIHJlaW50ZXJwcmV0QXNDb3ZlckZvcm1hbHNMaXN0KGV4cHIpIHtcbiAgICAgICAgdmFyIGksIGxlbiwgcGFyYW0sIHBhcmFtcywgZGVmYXVsdHMsIGRlZmF1bHRDb3VudCwgb3B0aW9ucywgdG9rZW47XG5cbiAgICAgICAgZGVmYXVsdHMgPSBbXTtcbiAgICAgICAgZGVmYXVsdENvdW50ID0gMDtcbiAgICAgICAgcGFyYW1zID0gW2V4cHJdO1xuXG4gICAgICAgIHN3aXRjaCAoZXhwci50eXBlKSB7XG4gICAgICAgIGNhc2UgU3ludGF4LklkZW50aWZpZXI6XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSBQbGFjZUhvbGRlcnMuQXJyb3dQYXJhbWV0ZXJQbGFjZUhvbGRlcjpcbiAgICAgICAgICAgIHBhcmFtcyA9IGV4cHIucGFyYW1zO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgfVxuXG4gICAgICAgIG9wdGlvbnMgPSB7XG4gICAgICAgICAgICBwYXJhbVNldDoge31cbiAgICAgICAgfTtcblxuICAgICAgICBmb3IgKGkgPSAwLCBsZW4gPSBwYXJhbXMubGVuZ3RoOyBpIDwgbGVuOyBpICs9IDEpIHtcbiAgICAgICAgICAgIHBhcmFtID0gcGFyYW1zW2ldO1xuICAgICAgICAgICAgc3dpdGNoIChwYXJhbS50eXBlKSB7XG4gICAgICAgICAgICBjYXNlIFN5bnRheC5Bc3NpZ25tZW50UGF0dGVybjpcbiAgICAgICAgICAgICAgICBwYXJhbXNbaV0gPSBwYXJhbS5sZWZ0O1xuICAgICAgICAgICAgICAgIGRlZmF1bHRzLnB1c2gocGFyYW0ucmlnaHQpO1xuICAgICAgICAgICAgICAgICsrZGVmYXVsdENvdW50O1xuICAgICAgICAgICAgICAgIGNoZWNrUGF0dGVyblBhcmFtKG9wdGlvbnMsIHBhcmFtLmxlZnQpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICBjaGVja1BhdHRlcm5QYXJhbShvcHRpb25zLCBwYXJhbSk7XG4gICAgICAgICAgICAgICAgcGFyYW1zW2ldID0gcGFyYW07XG4gICAgICAgICAgICAgICAgZGVmYXVsdHMucHVzaChudWxsKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChvcHRpb25zLm1lc3NhZ2UgPT09IE1lc3NhZ2VzLlN0cmljdFBhcmFtRHVwZSkge1xuICAgICAgICAgICAgdG9rZW4gPSBzdHJpY3QgPyBvcHRpb25zLnN0cmljdGVkIDogb3B0aW9ucy5maXJzdFJlc3RyaWN0ZWQ7XG4gICAgICAgICAgICB0aHJvd1VuZXhwZWN0ZWRUb2tlbih0b2tlbiwgb3B0aW9ucy5tZXNzYWdlKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChkZWZhdWx0Q291bnQgPT09IDApIHtcbiAgICAgICAgICAgIGRlZmF1bHRzID0gW107XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm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ZmluaXNoQXJyb3dGdW5jdGlvbkV4cHJlc3Npb24ob3B0aW9ucy5wYXJhbXMsIG9wdGlvbnMuZGVmYXVsdHMsIGJvZHksIGJvZHkudHlwZSAhPT0gU3ludGF4LkJsb2NrU3RhdGVtZW50KTtcbiAgICB9XG5cbiAgICAvLyAxMS4xMyBBc3NpZ25tZW50IE9wZXJhdG9yc1xuXG4gICAgZnVuY3Rpb24gcGFyc2VBc3NpZ25tZW50RXhwcmVzc2lvbigpIHtcbiAgICAgICAgdmFyIHRva2VuLCBleHByLCByaWdodCwgbGlzdCwgc3RhcnRUb2tlbjtcblxuICAgICAgICBzdGFydFRva2VuID0gbG9va2FoZWFkO1xuICAgICAgICB0b2tlbiA9IGxvb2thaGVhZDtcblxuICAgICAgICBleHByID0gcGFyc2VDb25kaXRpb25hbEV4cHJlc3Npb24oKTtcblxuICAgICAgICBpZiAoZXhwci50eXBlID09PSBQbGFjZUhvbGRlcnMuQXJyb3dQYXJhbWV0ZXJQbGFjZUhvbGRlciB8fCBtYXRjaCgnPT4nKSkge1xuICAgICAgICAgICAgaXNBc3NpZ25tZW50VGFyZ2V0ID0gaXNCaW5kaW5nRWxlbWVudCA9IGZhbHNlO1xuICAgICAgICAgICAgbGlzdCA9IHJlaW50ZXJwcmV0QXNDb3ZlckZvcm1hbHNMaXN0KGV4cHIpO1xuXG4gICAgICAgICAgICBpZiAobGlzdCkge1xuICAgICAgICAgICAgICAgIGZpcnN0Q292ZXJJbml0aWFsaXplZE5hbWVFcnJvciA9IG51bGw7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhcnNlQXJyb3dGdW5jdGlvbkV4cHJlc3Npb24obGlzdCwgbmV3IFdyYXBwaW5nTm9kZShzdGFydFRva2VuKSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJldHVybiBleHByO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKG1hdGNoQXNzaWduKCkpIHtcbiAgICAgICAgICAgIGlmICghaXNBc3NpZ25tZW50VGFyZ2V0KSB7XG4gICAgICAgICAgICAgICAgdG9sZXJhdGVFcnJvcihNZXNzYWdlcy5JbnZhbGlkTEhTSW5Bc3NpZ25tZW50KTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gMTEuMTMuMVxuICAgICAgICAgICAgaWYgKHN0cmljdCAmJiBleHByLnR5cGUgPT09IFN5bnRheC5JZGVudGlmaWVyICYmIGlzUmVzdHJpY3RlZFdvcmQoZXhwci5uYW1lKSkge1xuICAgICAgICAgICAgICAgIHRvbGVyYXRlVW5leHBlY3RlZFRva2VuKHRva2VuLCBNZXNzYWdlcy5TdHJpY3RMSFNBc3NpZ25tZW50KTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKCFtYXRjaCgnPScpKSB7XG4gICAgICAgICAgICAgICAgaXNBc3NpZ25tZW50VGFyZ2V0ID0gaXNCaW5kaW5nRWxlbWVudCA9IGZhbHNlO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZWludGVycHJldEV4cHJlc3Npb25Bc1BhdHRlcm4oZXhwcik7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHRva2VuID0gbGV4KCk7XG4gICAgICAgICAgICByaWdodCA9IGlzb2xhdGVDb3ZlckdyYW1tYXIocGFyc2VBc3NpZ25tZW50RXhwcmVzc2lvbik7XG4gICAgICAgICAgICBleHByID0gbmV3IFdyYXBwaW5nTm9kZShzdGFydFRva2VuKS5maW5pc2hBc3NpZ25tZW50RXhwcmVzc2lvbih0b2tlbi52YWx1ZSwgZXhwciwgcmlnaHQpO1xuICAgICAgICAgICAgZmlyc3RDb3ZlckluaXRpYWxpemVkTmFtZUVycm9yID0gbnVsbDtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBleHByO1xuICAgIH1cblxuICAgIC8vIDExLjE0IENvbW1hIE9wZXJhdG9yXG5cbiAgICBmdW5jdGlvbiBwYXJzZUV4cHJlc3Npb24oKSB7XG4gICAgICAgIHZhciBleHByLCBzdGFydFRva2VuID0gbG9va2FoZWFkLCBleHByZXNzaW9ucztcblxuICAgICAgICBleHByID0gaXNvbGF0ZUNvdmVyR3JhbW1hcihwYXJzZUFzc2lnbm1lbnRFeHByZXNzaW9uKTtcblxuICAgICAgICBpZiAobWF0Y2goJywnKSkge1xuICAgICAgICAgICAgZXhwcmVzc2lvbnMgPSBbZXhwcl07XG5cbiAgICAgICAgICAgIHdoaWxlIChzdGFydEluZGV4IDwgbGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgaWYgKCFtYXRjaCgnLCcpKSB7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBsZXgoKTtcbiAgICAgICAgICAgICAgICBleHByZXNzaW9ucy5wdXNoKGlzb2xhdGVDb3ZlckdyYW1tYXIocGFyc2VBc3NpZ25tZW50RXhwcmVzc2lvbikpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBleHByID0gbmV3IFdyYXBwaW5nTm9kZShzdGFydFRva2VuKS5maW5pc2hTZXF1ZW5jZUV4cHJlc3Npb24oZXhwcmVzc2lvbnMpO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGV4cHI7XG4gICAgfVxuXG4gICAgLy8gMTIuMSBCbG9ja1xuXG4gICAgZnVuY3Rpb24gcGFyc2VTdGF0ZW1lbnRMaXN0SXRlbSgpIHtcbiAgICAgICAgaWYgKGxvb2thaGVhZC50eXBlID09PSBUb2tlbi5LZXl3b3JkKSB7XG4gICAgICAgICAgICBzd2l0Y2ggKGxvb2thaGVhZC52YWx1ZSkge1xuICAgICAgICAgICAgY2FzZSAnZXhwb3J0JzpcbiAgICAgICAgICAgICAgICBpZiAoc291cmNlVHlwZSAhPT0gJ21vZHVsZScpIHtcbiAgICAgICAgICAgICAgICAgICAgdG9sZXJhdGVVbmV4cGVjdGVkVG9rZW4obG9va2FoZWFkLCBNZXNzYWdlcy5JbGxlZ2FsRXhwb3J0RGVjbGFyYXRpb24pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gcGFyc2VFeHBvcnREZWNsYXJhdGlvbigpO1xuICAgICAgICAgICAgY2FzZSAnaW1wb3J0JzpcbiAgICAgICAgICAgICAgICBpZiAoc291cmNlVHlwZSAhPT0gJ21vZHVsZScpIHtcbiAgICAgICAgICAgICAgICAgICAgdG9sZXJhdGVVbmV4cGVjdGVkVG9rZW4obG9va2FoZWFkLCBNZXNzYWdlcy5JbGxlZ2FsSW1wb3J0RGVjbGFyYXRpb24pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gcGFyc2VJbXBvcnREZWNsYXJhdGlvbigpO1xuICAgICAgICAgICAgY2FzZSAnY29uc3QnOlxuICAgICAgICAgICAgY2FzZSAnbGV0JzpcbiAgICAgICAgICAgICAgICByZXR1cm4gcGFyc2VMZXhpY2FsRGVjbGFyYXRpb24oe2luRm9yOiBmYWxzZX0pO1xuICAgICAgICAgICAgY2FzZSAnZnVuY3Rpb24nOlxuICAgICAgICAgICAgICAgIHJldHVybiBwYXJzZUZ1bmN0aW9uRGVjbGFyYXRpb24obmV3IE5vZGUoKSk7XG4gICAgICAgICAgICBjYXNlICdjbGFzcyc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhcnNlQ2xhc3NEZWNsYXJhdGlvbigpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHBhcnNlU3RhdGVtZW50KCk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gcGFyc2VTdGF0ZW1lbnRMaXN0KCkge1xuICAgICAgICB2YXIgbGlzdCA9IFtdO1xuICAgICAgICB3aGlsZSAoc3RhcnRJbmRleCA8IGxlbmd0aCkge1xuICAgICAgICAgICAgaWYgKG1hdGNoKCd9JykpIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICA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ICAgfVxuXG4gICAgZnVuY3Rpb24gcGFyc2VWYXJpYWJsZURlY2xhcmF0aW9uKCkge1xuICAgICAgICB2YXIgaW5pdCA9IG51bGwsIGlkLCBub2RlID0gbmV3IE5vZGUoKTtcblxuICAgICAgICBpZCA9IHBhcnNlUGF0dGVybigpO1xuXG4gICAgICAgIC8vIDEyLjIuMVxuICAgICAgICBpZiAoc3RyaWN0ICYmIGlzUmVzdHJpY3RlZFdvcmQoaWQubmFtZSkpIHtcbiAgICAgICAgICAgIHRvbGVyYXRlRXJyb3IoTWVzc2FnZXMuU3RyaWN0VmFyTmFtZSk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAobWF0Y2goJz0nKSkge1xuICAgICAgICAgICAgbGV4KCk7XG4gICAgICAgICAgICBpbml0ID0gaXNvbGF0ZUNvdmVyR3JhbW1hcihwYXJzZUFzc2lnbm1lbnRFeHByZXNzaW9uKTtcbiAgICAgICAgfSBlbHNlIGlmIChpZC50eXBlICE9PSBTeW50YXguSWRlbnRpZmllcikge1xuICAgICAgICAgICAgZXhwZWN0KCc9Jyk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gbm9kZS5maW5pc2hWYXJpYWJsZURlY2xhcmF0b3IoaWQsIGluaXQpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHBhcnNlVmFyaWFibGVEZWNsYXJhdGlvbkxpc3QoKSB7XG4gICAgICAgIHZhciBsaXN0ID0gW107XG5cbiAgICAgICAgZG8ge1xuICAgICAgICAgICAgbGlzdC5wdXNoKHBhcnNlVmFyaWFibGVEZWNsYXJhdGlvbigpKTtcbiAgICAgICAgICAgIGlmICghbWF0Y2goJywnKSkge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV4KCk7XG4gICAgICAgIH0gd2hpbGUgKHN0YXJ0SW5kZXggPCBsZW5ndGgpO1xuXG4gICAgICAgIHJldHVybiBsaXN0O1xuICAgIH1cblxuICAgIGZ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G9rZW4sIHRlc3QsIHVwZGF0ZSwgbGVmdCwgcmlnaHQsIGtpbmQsIGRlY2xhcmF0aW9ucyxcbiAgICAgICAgICAgIGJvZHksIG9sZEluSXRlcmF0aW9uLCBwcmV2aW91c0FsbG93SW4gPSBzdGF0ZS5hbGxvd0luO1xuXG4gICAgICAgIGluaXQgPSB0ZXN0ID0gdXBkYXRlID0gbnVsbDtcblxuICAgICAgICBleHBlY3RLZXl3b3JkKCdmb3InKTtcblxuICAgICAgICBleHBlY3QoJygnKTtcblxuICAgICAgICBpZiAobWF0Y2goJzsnKSkge1xuICAgICAgICAgICAgbGV4KCk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAobWF0Y2hLZXl3b3JkKCd2YXInKSkge1xuICAgICAgICAgICAgICAgIGluaXQgPSBuZXcgTm9kZSgpO1xuICAgICAgICAgICAgICAgIGxleCgpO1xuXG4gICAgICAgICAgICAgICAgc3RhdGUuYWxsb3dJbiA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIGluaXQgPSBpbml0LmZpbmlzaFZhcmlhYmxlRGVjbGFyYXRpb24ocGFyc2VWYXJpYWJsZURlY2xhcmF0aW9uTGlzdCgpKTtcbiAgICAgICAgICAgICAgICBzdGF0ZS5hbGxvd0luID0gcHJldmlvdXNBbGxvd0luO1xuXG4gICAgICAgICAgICAgICAgaWYgKGluaXQuZGVjbGFyYXRpb25zLmxlbmd0aCA9PT0gMSAmJiBtYXRjaEtleXdvcmQoJ2luJykpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV4KCk7XG4gICAgICAgICAgICAgICAgICAgIGxlZnQgPSBpbml0O1xuICAgICAgICAgICAgICAgICAgICByaWdodCA9IHBhcnNlRXhwcmVzc2lvbigpO1xuICAgICAgICAgICAgICAgICAgICBpbml0ID0gbnVsbDtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBleHBlY3QoJzsnKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1hdGNoS2V5d29yZCgnY29uc3QnKSB8fCBtYXRjaEtleXdvcmQoJ2xldCcpKSB7XG4gICAgICAgICAgICAgICAgaW5pdCA9IG5ldyBOb2RlKCk7XG4gICAgICAgICAgICAgICAga2luZCA9IGxleCgpLnZhbHVlO1xuXG4gICAgICAgICAgICAgICAgc3RhdGUuYWxsb3dJbiA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIGRlY2xhcmF0aW9ucyA9IHBhcnNlQmluZGluZ0xpc3Qoa2luZCwge2luRm9yOiB0cnVlfSk7XG4gICAgICAgICAgICAgICAgc3RhdGUuYWxsb3dJbiA9IHByZXZpb3VzQWxsb3dJbjtcblxuICAgICAgICAgICAgICAgIGlmIChkZWNsYXJhdGlvbnMubGVuZ3RoID09PSAxICYmIGRlY2xhcmF0aW9uc1swXS5pbml0ID09PSBudWxsICYmIG1hdGNoS2V5d29yZCgnaW4nKSkge1xuICAgICAgICAgICAgICAgICAgICBpbml0ID0gaW5pdC5maW5pc2hMZXhpY2FsRGVjbGFyYXRpb24oZGVjbGFyYXRpb25zLCBraW5kKTtcbiAgICAgICAgICAgICAgICAgICAgbGV4KCk7XG4gICAgICAgICAgICAgICAgICAgIGxlZnQgPSBpbml0O1xuICAgICAgICAgICAgICAgICAgICByaWdodCA9IHBhcnNlRXhwcmVzc2lvbigpO1xuICAgICAgICAgICAgICAgICAgICBpbml0ID0gbnVsbDtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBjb25zdW1lU2VtaWNvbG9uKCk7XG4gICAgICAgICAgICAgICAgICAgIGluaXQgPSBpbml0LmZpbmlzaExleGljYWxEZWNsYXJhdGlvbihkZWNsYXJhdGlvbnMsIGtpbmQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaW5pdFN0YXJ0VG9rZW4gPSBsb29rYWhlYWQ7XG4gICAgICAgICAgICAgICAgc3RhdGUuYWxsb3dJbiA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIGluaXQgPSBpbmhlcml0Q292ZXJHcmFtbWFyKHBhcnNlQXNzaWdubWVudEV4cHJlc3Npb24pO1xuICAgICAgICAgICAgICAgIHN0YXRlLmFsbG93SW4gPSBwcmV2aW91c0FsbG93SW47XG5cbiAgICAgICAgICAgICAgICBpZiAobWF0Y2hLZXl3b3JkKCdpbicpKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghaXNBc3NpZ25tZW50VGFyZ2V0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0b2xlcmF0ZUVycm9yKE1lc3NhZ2VzLkludmFsaWRMSFNJbkZvckluKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGxleCgpO1xuICAgICAgICAgICAgICAgICAgICByZWludGVycHJldEV4cHJlc3Npb25Bc1BhdHRlcm4oaW5pdCk7XG4gICAgICAgICAgICAgICAgICAgIGxlZnQgPSBpbml0O1xuICAgICAgICAgICAgICAgICAgICByaWdodCA9IHBhcnNlRXhwcmVzc2lvbigpO1xuICAgICAgICAgICAgICAgICAgICBpbml0ID0gbnVsbDtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBpZiAobWF0Y2goJywnKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaW5pdFNlcSA9IFtpbml0XTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlIChtYXRjaCgnLCcpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV4KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5pdFNlcS5wdXNoKGlzb2xhdGVDb3ZlckdyYW1tYXIocGFyc2VBc3NpZ25tZW50RXhwcmVzc2lvbikpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgaW5pdCA9IG5ldyBXcmFwcGluZ05vZGUoaW5pdFN0YXJ0VG9rZW4pLmZpbmlzaFNlcXVlbmNlRXhwcmVzc2lvbihpbml0U2VxKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBleHBlY3QoJzsnKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodHlwZW9mIGxlZnQgPT09ICd1bmRlZmluZWQnKSB7XG5cbiAgICAgICAgICAgIGlmICghbWF0Y2goJzsnKSkge1xuICAgICAgICAgICAgICAgIHRlc3QgPSBwYXJzZUV4cHJlc3Npb24oKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGV4cGVjdCgnOycpO1xuXG4gICAgICAgICAgICBpZiAoIW1hdGNoKCcpJykpIHtcbiAgICAgICAgICAgICAgICB1cGRhdGUgPSBwYXJzZUV4cHJlc3Npb24oKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGV4cGVjdCgnKScpO1xuXG4gICAgICAgIG9sZEluSXRlcmF0aW9uID0gc3RhdGUuaW5JdGVyYXRpb247XG4gICAgICAgIHN0YXRlLmluSXRlcmF0aW9uID0gdHJ1ZTtcblxuICAgICAgICBib2R5ID0gaXNvbGF0ZUNvdmVyR3JhbW1hcihwYXJzZVN0YXRlbWVudCk7XG5cbiAgICAgICAgc3RhdGUuaW5JdGVyYXRpb24gPSBvbGRJbkl0ZXJhdGlvbjtcblxuICAgICAgICByZXR1cm4gKHR5cGVvZiBsZWZ0ID09PSAndW5kZWZpbmVkJykgP1xuICAgICAgICAgICAgICAgIG5vZGUuZmluaXNoRm9yU3RhdGVtZW50KGluaXQsIHRlc3QsIHVwZGF0ZSwgYm9keSkgOlxuICAgICAgICAgICAgICAgIG5vZGUuZmluaXNoRm9ySW5TdGF0ZW1lbnQobGVmdCwgcmlnaHQsIGJvZHkpO1xuICAgIH1cblxuICAgIC8vIDEyLjcgVGhlIGNvbnRpbnVlIHN0YXRlbWVudFxuXG4gICAgZnVuY3Rpb24gcGFyc2VDb250aW51ZVN0YXRlbWVudChub2RlKSB7XG4gICAgICAgIHZhciBsYWJlbCA9IG51bGwsIGtleTtcblxuICAgICAgICBleHBlY3RLZXl3b3JkKCdjb250aW51ZScpO1xuXG4gICAgICAgIC8vIE9wdGltaXplIHRoZSBtb3N0IGNvbW1vbiBmb3JtOiAnY29udGludWU7Jy5cbiAgICAgICAgaWYgKHNvdXJjZS5jaGFyQ29kZUF0KHN0YXJ0SW5kZXgpID09PSAweDNCKSB7XG4gICAgICAgICAgICBsZXgoKTtcblxuICAgICAgICAgICAgaWYgKCFzdGF0ZS5pbkl0ZXJhdGlvbikge1xuICAgICAgICAgICAgICAgIHRocm93RXJyb3IoTWVzc2FnZXMuSWxsZWdhbENvbnRpbnVlKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcmV0dXJuIG5vZGUuZmluaXNoQ29udGludWVTdGF0ZW1lbnQobnVsbCk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoaGFzTGluZVRlcm1pbmF0b3IpIHtcbiAgICAgICAgICAgIGlmICghc3RhdGUuaW5JdGVyYXRpb24pIHtcbiAgICAgICAgICAgICAgICB0aHJvd0Vycm9yKE1lc3NhZ2VzLklsbGVnYWxDb250aW51ZSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJldHVybiBub2RlLmZpbmlzaENvbnRpbnVlU3RhdGVtZW50KG51bGwpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGxvb2thaGVhZC50eXBlID09PSBUb2tlbi5JZGVudGlmaWVyKSB7XG4gICAgICAgICAgICBsYWJlbCA9IHBhcnNlVmFyaWFibGVJZGVudGlmaWVyKCk7XG5cbiAgICAgICAgICAgIGtleSA9ICckJyArIGxhYmVsLm5hbWU7XG4gICAgICAgICAgICBpZiAoIU9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHkuY2FsbChz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gbnVsbDtcblxuICAgICAgICBleHBlY3RLZXl3b3JkKCdyZXR1cm4nKTtcblxuICAgICAgICBpZiAoIXN0YXRlLmluRnVuY3Rpb25Cb2R5KSB7XG4gICAgICAgICAgICB0b2xlcmF0ZUVycm9yKE1lc3NhZ2VzLklsbGVnYWxSZXR1cm4pO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gJ3JldHVybicgZm9sbG93ZWQgYnkgYSBzcGFjZSBhbmQgYW4gaWRlbnRpZmllciBpcyB2ZXJ5IGNvbW1vbi5cbiAgICAgICAgaWYgKHNvdXJjZS5jaGFyQ29kZUF0KGxhc3RJbmRleCkgPT09IDB4MjApIHtcbiAgICAgICAgICAgIGlmIChpc0lkZW50aWZpZXJTdGFydChzb3VyY2UuY2hhckNvZGVBdChsYXN0SW5kZXggKyAxKSkpIHtcbiAgICAgICAgICAgICAgICBhcmd1bWVudCA9IHBhcnNlRXhwcmVzc2lvbigpO1xuICAgICAgICAgICAgICAgIGNvbnN1bWVTZW1pY29sb24oKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gbm9kZS5maW5pc2hSZXR1cm5TdGF0ZW1lbnQoYXJndW1lbnQpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGhhc0xpbmVUZXJtaW5hdG9yKSB7XG4gICAgICAgICAgICAvLyBIQUNLXG4gICAgICAgICAgICByZXR1cm4gbm9kZS5maW5pc2hSZXR1cm5TdGF0ZW1lbnQobnVsbCk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIW1hdGNoKCc7JykpIHtcbiAgICAgICAgICAgIGlmICghbWF0Y2goJ30nKSAmJiBsb29rYWhlYWQudHlwZSAhPT0gVG9rZW4uRU9GKSB7XG4gICAgICAgICAgICAgICAgYXJndW1lbnQgPSBwYXJzZUV4cHJlc3Npb24oKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGNvbnN1bWVTZW1pY29sb24oKTtcblxuICAgICA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oJ2NhdGNoJykpIHtcbiAgICAgICAgICAgIGhhbmRsZXIgPSBwYXJzZUNhdGNoQ2xhdXNlKCk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAobWF0Y2hLZXl3b3JkKCdmaW5hbGx5JykpIHtcbiAgICAgICAgICAgIGxleCgpO1xuICAgICAgICAgICAgZmluYWxpemVyID0gcGFyc2VCbG9jaygpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCFoYW5kbGVyICYmICFmaW5hbGl6ZXIpIHtcbiAgICAgICAgICAgIHRocm93RXJyb3IoTWVzc2FnZXMuTm9DYXRjaE9yRmluYWxseSk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gbm9kZS5maW5pc2hUcnlTdGF0ZW1lbnQoYmxvY2ssIGhhbmRsZXIsIGZpbmFsaXplcik7XG4gICAgfVxuXG4gICAgLy8gMTIuMTUgVGhlIGRlYnVnZ2VyIHN0YXRlbWVudFxuXG4gICAgZnVuY3Rpb24gcGFyc2VEZWJ1Z2dlclN0YXRlbWVudChub2RlKSB7XG4gICAgICAgIGV4cGVjdEtleXdvcmQoJ2RlYnVnZ2VyJyk7XG5cbiAgICAgICAgY29uc3VtZVNlbWljb2xvbigpO1xuXG4gICAgICAgIHJldHVybiBub2RlLmZpbmlzaERlYnVnZ2VyU3RhdGVtZW50KCk7XG4gICAgfVxuXG4gICAgLy8gMTIgU3RhdGVtZW50c1xuXG4gICAgZnVuY3Rpb24gcGFyc2VTdGF0ZW1lbnQoKSB7XG4gICAgICAgIHZhciB0eXBlID0gbG9va2FoZWFkLnR5cGUsXG4gICAgICAgICAgICBleHByLFxuICAgICAgICAgICAgbGFiZWxlZEJvZHksXG4gICAgICAgICAgICBrZXksXG4gICAgICAgICAgICBub2RlO1xuXG4gICAgICAgIGlmICh0eXBlID09PSBUb2tlbi5FT0YpIHtcbiAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKGxvb2thaGVhZCk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodHlwZSA9PT0gVG9rZW4uUHVuY3R1YXRvciAmJiBsb29rYWhlYWQudmFsdWUgPT09ICd7Jykge1xuICAgICAgICAgICAgcmV0dXJuIHBhcnNlQmxvY2soKTtcbiAgICAgICAgfVxuICAgICAgICBpc0Fzc2lnbm1lbnRUYXJnZXQgPSBpc0JpbmRpbmdFbGVtZW50ID0gdHJ1ZTtcbiAgICAgICAgbm9kZSA9IG5ldyBOb2RlKCk7XG5cbiAgICAgICAgaWYgKHR5cGUgPT09IFRva2VuLlB1bmN0dWF0b3IpIHtcbiAgICAgICAgICAgIHN3aXRjaCAobG9va2FoZWFkLnZhbHVlKSB7XG4gICAgICAgICAgICBjYXNlICc7JzpcbiAgICAgICAgICAgICAgICByZXR1cm4gcGFyc2VFbXB0eVN0YXRlbWVudChub2RlKTtcbiAgICAgICAgICAgIGNhc2UgJygnOlxuICAgICAgICAgICAgICAgIHJldHVybiBwYXJzZUV4cHJlc3Npb25TdGF0ZW1lbnQobm9kZSk7XG4gICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPT09IFRva2VuLktleXdvcmQpIHtcbiAgICAgICAgICAgIHN3aXRjaCAobG9va2FoZWFkLnZhbHVlKSB7XG4gICAgICAgICAgICBjYXNlICdicmVhayc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhcnNlQnJlYWtTdGF0ZW1lbnQobm9kZSk7XG4gICAgICAgICAgICBjYXNlICdjb250aW51ZSc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhcnNlQ29udGludWVTdGF0ZW1lbnQobm9kZSk7XG4gICAgICAgICAgICBjYXNlICdkZWJ1Z2dlcic6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhcnNlRGVidWdnZXJTdGF0ZW1lbnQobm9kZSk7XG4gICAgICAgICAgICBjYXNlICdkbyc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhcnNlRG9XaGlsZVN0YXRlbWVudChub2RlKTtcbiAgICAgICAgICAgIGNhc2UgJ2Zvcic6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhcnNlRm9yU3RhdGVtZW50KG5vZGUpO1xuICAgICAgICAgICAgY2FzZSAnZnVuY3Rpb24nOlxuICAgICAgICAgICAgICAgIHJldHVybiBwYXJzZUZ1bmN0aW9uRGVjbGFyYXRpb24obm9kZSk7XG4gICAgICAgICAgICBjYXNlICdpZic6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhcnNlSWZTdGF0ZW1lbnQobm9kZSk7XG4gICAgICAgICAgICBjYXNlICdyZXR1cm4nOlxuICAgICAgICAgICAgICAgIHJldHVybiBwYXJzZVJldHVyblN0YXRlbWVudChub2RlKTtcbiAgICAgICAgICAgIGNhc2UgJ3N3aXRjaCc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhcnNlU3dpdGNoU3RhdGVtZW50KG5vZGUpO1xuICAgICAgICAgICAgY2FzZSAndGhyb3cnOlxuICAgICAgICAgICAgICAgIHJldHVybiBwYXJzZVRocm93U3RhdGVtZW50KG5vZGUpO1xuICAgICAgICAgICAgY2FzZSAndHJ5JzpcbiAgICAgICAgICAgICAgICByZXR1cm4gcGFyc2VUcnlTdGF0ZW1lbnQobm9kZSk7XG4gICAgICAgICAgICBjYXNlICd2YXInOlxuICAgICAgICAgICAgICAgIHJldHVybiBwYXJzZVZhcmlhYmxlU3RhdGVtZW50KG5vZGUpO1xuICAgICAgICAgICAgY2FzZSAnd2hpbGUnOlxuICAgICAgICAgICAgICAgIHJldHVybiBwYXJzZVdoaWxlU3RhdGVtZW50KG5vZGUpO1xuICAgICAgICAgICAgY2FzZSAnd2l0aCc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhcnNlV2l0aFN0YXRlbWVudChub2RlKTtcbiAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAg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FxuICAgICAgICAgICAgb2xkTGFiZWxTZXQsIG9sZEluSXRlcmF0aW9uLCBvbGRJblN3aXRjaCwgb2xkSW5GdW5jdGlvbkJvZHksIG9sZFBhcmVudGhlc2lzQ291bnQsXG4gICAgICAgICAgICBub2RlID0gbmV3IE5vZGUoKTtcblxuICAgICAgICBleHBlY3QoJ3snKTtcblxuICAgICAgICB3aGlsZSAoc3RhcnRJbmRleCA8IGxlbmd0aCkge1xuICAgICAgICAgICAgaWYgKGxvb2thaGVhZC50eXBlICE9PSBUb2tlbi5TdHJpbmdMaXRlcmFsKSB7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0b2tlbiA9IGxvb2thaGVhZDtcblxuICAgICAgICAgICAgc3RhdGVtZW50ID0gcGFyc2VTdGF0ZW1lbnRMaXN0SXRlbSgpO1xuICAgICAgICAgICAgYm9keS5wdXNoKHN0YXRlbWVudCk7XG4gICAgICAgICAgICBpZiAoc3RhdGVtZW50LmV4cHJlc3Npb24udHlwZSAhPT0gU3ludGF4LkxpdGVyYWwpIHtcbiAgICAgICAgICAgICAgICAvLyB0aGlzIGlzIG5vdCBkaXJlY3RpdmVcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGRpcmVjdGl2ZSA9IHNvdXJjZS5zbGljZSh0b2tlbi5zdGFydCArIDEsIHRva2VuLmVuZCAtIDEpO1xuICAgICAgICAgICAgaWYgKGRpcmVjdGl2ZSA9PT0gJ3VzZSBzdHJpY3QnKSB7XG4gICAgICAgICAgICAgICAgc3RyaWN0ID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBpZiAoZmlyc3RSZXN0cmljdGVkKSB7XG4gICAgICAgICAgICAgICAgICAgIHRvbGVyYXRlVW5leHBlY3RlZFRva2VuKGZpcnN0UmVzdHJpY3RlZCwgTWVzc2FnZXMuU3RyaWN0T2N0YWxMaXRlcmFsKTtcbiAgICAgICAgIC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ChudWxsKTtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuXG4gICAgICAgIHBhcmFtID0gcGFyc2VQYXR0ZXJuV2l0aERlZmF1bHQoKTtcbiAgICAgICAgdmFsaWRhdGVQYXJhbShvcHRpb25zLCB0b2tlbiwgdG9rZW4udmFsdWUpO1xuXG4gICAgICAgIGlmIChwYXJhbS50eXBlID09PSBTeW50YXguQXNzaWdubWVudFBhdHRlcm4pIHtcbiAgICAgICAgICAgIGRlZiA9IHBhcmFtLnJpZ2h0O1xuICAgICAgICAgICAgcGFyYW0gPSBwYXJhbS5sZWZ0O1xuICAgICAgICAgICAgKytvcHRpb25zLmRlZmF1bHRDb3VudDtcbiAgICAgICAgfVxuXG4gICAgICAgIG9wdGlvbnMucGFyYW1zLnB1c2gocGFyYW0pO1xuICAgICAgICBvcHRpb25zLmRlZmF1bHRzLnB1c2goZGVmKTtcblxuICAgICAgICByZXR1cm4gIW1hdGNoKCcpJyk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gcGFyc2VQYXJhbXMoZmlyc3RSZXN0cmljdGVkKSB7XG4gICAgICAgIHZhciBvcHRpb25zO1xuXG4gICAgICAgIG9wdGlvbnMgPSB7XG4gICAgICAgICAgICBwYXJhbXM6IFtdLFxuICAgICAgICAgICAgZGVmYXVsdENvdW50OiAwLFxuICAgICAgICAgICAgZGVmYXVsdHM6IFtdLFxuICAgICAgICAgICAgZmlyc3RSZXN0cmljdGVkOiBmaXJzdFJlc3RyaWN0ZWRcbiAgICAgICAgfTtcblxuICAgICAgICBleHBlY3QoJygnKTtcblxuICAgICAgICBpZiAoIW1hdGNoKCcpJykpIHtcbiAgICAgICAgICAgIG9wdGlvbnMucGFyYW1TZXQgPSB7fTtcbiAgICAgICAgICAgIHdoaWxlIChzdGFydEluZGV4IDwgbGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgaWYgKCFwYXJzZVBhcmFtKG9wdGlvbnMpKSB7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBleHBlY3QoJywnKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGV4cGVjdCgnKScpO1xuXG4gICAgICAgIGlmIChvcHRpb25zLmRlZmF1bHRDb3VudCA9PT0gMCkge1xuICAgICAgICAgICAgb3B0aW9ucy5kZWZhdWx0cyA9IFtdO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIHBhcmFtczogb3B0aW9ucy5wYXJhbXMsXG4gICAgICAgICAgICBkZWZhdWx0czogb3B0aW9ucy5kZWZhdWx0cyxcbiAgICAgICAgICAgIHN0cmljdGVkOiBvcHRpb25zLnN0cmljdGVkLFxuICAgICAgICAgICAgZmlyc3RSZXN0cmljdGVkOiBvcHRpb25zLmZpcnN0UmVzdHJpY3RlZCxcbiAgICAgICAgICAgIG1lc3NhZ2U6IG9wdGlvbnMubWVzc2FnZVxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHBhcnNlRnVuY3Rpb25EZWNsYXJhdGlvbihub2RlLCBpZGVudGlmaWVySXNPcHRpb25hbCkge1xuICAgICAgICB2YXIgaWQgPSBudWxsLCBwYXJhbXMgPSBbXSwgZGVmYXVsdHMgPSBbXSwgYm9keSwgdG9rZW4sIHN0cmljdGVkLCB0bXAsIGZpcnN0UmVzdHJpY3RlZCwgbWVzc2FnZSwgcHJldmlvdXNTdHJpY3Q7XG5cbiAgICAgICAgZXhwZWN0S2V5d29yZCgnZnVuY3Rpb24nKTtcbiAgICAgICAgaWYgKCFpZGVudGlmaWVySXNPcHRpb25hbCB8fCAhbWF0Y2goJygnKSkge1xuICAgICAgICAgICAgdG9rZW4gPSBsb29rYWhlYWQ7XG4gICAgICAgICAgICBpZCA9IHBhcnNlVmFyaWFibGVJZGVudGlmaWVyKCk7XG4gICAgICAgICAgICBpZiAoc3RyaWN0KSB7XG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Qcm9wZXJ0eUtleSgpO1xuICAgICAgICAgICAgICAgIGlmIChrZXkubmFtZSA9PT0gJ3N0YXRpYycgJiYgbG9va2FoZWFkUHJvcGVydHlOYW1lKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgdG9rZW4gPSBsb29rYWhlYWQ7XG4gICAgICAgICAgICAgICAgICAgIGlzU3RhdGljID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgY29tcHV0ZWQgPSBtYXRjaCgnWycpO1xuICAgICAgICAgICAgICAgICAgICBrZXkgPSBwYXJzZU9iamVjdFByb3BlcnR5S2V5KCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIG1ldGhvZCA9IHRyeVBhcnNlTWV0aG9kRGVmaW5pdGlvbih0b2tlbiwga2V5LCBjb21wdXRlZCwgbWV0aG9kKTtcbiAgICAgICAgICAgICAgICBpZiAobWV0aG9kKSB7XG4gICAgICAgICAgICAgICAgICAgIG1ldGhvZFsnc3RhdGljJ10gPSBpc1N0YXRpYztcbiAgICAgICAgICAgICAgICAgICAgaWYgKG1ldGhvZC5raW5kID09PSAnaW5pdCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZC5raW5kID0gJ21ldGhvZCc7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKCFpc1N0YXRpYykge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFtZXRob2QuY29tcHV0ZWQgJiYgKG1ldGhvZC5rZXkubmFtZSB8fCBtZXRob2Qua2V5LnZhbHVlLnRvU3RyaW5nKCkpID09PSAnY29uc3RydWN0b3InKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1ldGhvZC5raW5kICE9PSAnbWV0aG9kJyB8fCAhbWV0aG9kLm1ldGhvZCB8fCBtZXRob2QudmFsdWUuZ2VuZXJhdG9yKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKHRva2VuLCBNZXNzYWdlcy5Db25zdHJ1Y3RvclNwZWNpYWxNZXRob2QpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaGFzQ29uc3RydWN0b3IpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3dVbmV4cGVjdGVkVG9rZW4odG9rZW4sIE1lc3NhZ2VzLkR1cGxpY2F0ZUNvbnN0cnVjdG9yKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoYXNDb25zdHJ1Y3RvciA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZC5raW5kID0gJ2NvbnN0cnVjdG9yJztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghbWV0aG9kLmNvbXB1dGVkICYmIChtZXRob2Qua2V5Lm5hbWUgfHwgbWV0aG9kLmtleS52YWx1ZS50b1N0cmluZygpKSA9PT0gJ3Byb3RvdHlwZScpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvd1VuZXhwZWN0ZWRUb2tlbih0b2tlbiwgTWVzc2FnZXMuU3RhdGljUHJvdG90eXBlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBtZXRob2QudHlwZSA9IFN5bnRheC5NZXRob2REZWZpbml0aW9uO1xuICAgICAgICAgICAgICAgICAgICBkZWxldGUgbWV0aG9kLm1ldGhvZDtcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIG1ldGhvZC5zaG9ydGhhbmQ7XG4gICAgICAgICAgICAgICAgICAgIGJvZHkucHVzaChtZXRob2QpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKGxvb2thaGVhZCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxleCgpO1xuICAgICAgICByZXR1cm4gY2xhc3NCb2R5LmZpbmlzaENsYXNzQm9keShib2R5KTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBwYXJzZUNsYXNzRGVjbGFyYXRpb24oaWRlbnRpZmllcklzT3B0aW9uYWwpIHtcbiAgICAgICAgdmFyIGlkID0gbnVsbCwgc3VwZXJDbGFzcyA9IG51bGwsIGNsYXNzTm9kZSA9IG5ldyBOb2RlKCksIGNsYXNzQm9keSwgcHJldmlvdXNTdHJpY3QgPSBzdHJpY3Q7XG4gICAgICAgIHN0cmljdCA9IHRydWU7XG5cbiAgICAgICAgZXhwZWN0S2V5d29yZCgnY2xhc3MnKTtcblxuICAgICAgICBpZiAoIWlkZW50aWZpZXJJc09wdGlvbmFsIHx8IGxvb2thaGVhZC50eXBlID09PSBUb2tlbi5JZGVudGlmaWVyKSB7XG4gICAgICAgICAgICBpZCA9IHBhcnNlVmFyaWFibGVJZGVudGlmaWVyKCk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAobWF0Y2hLZXl3b3JkKCdleHRlbmRzJykpIHtcbiAgICAgICAgICAgIGxleCgpO1xuICAgICAgICAgICAgc3VwZXJDbGFzcyA9IGlzb2xhdGVDb3ZlckdyYW1tYXIocGFyc2VMZWZ0SGFuZFNpZGVFeHByZXNzaW9uQWxsb3dDYWxsKTtcbiAgICAgICAgfVxuICAgICAgICBjbGFzc0JvZHkgPSBwYXJzZUNsYXNzQm9keSgpO1xuICAgICAgICBzdHJpY3QgPSBwcmV2aW91c1N0cmljdDtcblxuICAgICAgICByZXR1cm4gY2xhc3NOb2RlLmZpbmlzaENsYXN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51bGwsXG4gICAgICAgICAgICBpc0V4cG9ydEZyb21JZGVudGlmaWVyLFxuICAgICAgICAgICAgc3JjID0gbnVsbCwgc3BlY2lmaWVycyA9IFtdO1xuXG4gICAgICAgIC8vIG5vbi1kZWZhdWx0IGV4cG9ydFxuICAgICAgICBpZiAobG9va2FoZWFkLnR5cGUgPT09IFRva2VuLktleXdvcmQpIHtcbiAgICAgICAgICAgIC8vIGNvdmVyczpcbiAgICAgICAgICAgIC8vIGV4cG9ydCB2YXIgZiA9IDE7XG4gICAgICAgICAgICBzd2l0Y2ggKGxvb2thaGVhZC52YWx1ZSkge1xuICAgICAgICAgICAgICAgIGNhc2UgJ2xldCc6XG4gICAgICAgICAgICAgICAgY2FzZSAnY29uc3QnOlxuICAgICAgICAgICAgICAgIGNhc2UgJ3Zhcic6XG4gICAgICAgICAgICAgICAgY2FzZSAnY2xhc3MnOlxuICAgICAgICAgICAgICAgIGNhc2UgJ2Z1bmN0aW9uJzpcbiAgICAgICAgICAgICAgICAgICAgZGVjbGFyYXRpb24gPSBwYXJzZVN0YXRlbWVudExpc3RJdGVtKCk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBub2RlLmZpbmlzaEV4cG9ydE5hbWVkRGVjbGFyYXRpb24oZGVjbGFyYXRpb24sIHNwZWNpZmllcnMsIG51bGwpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgZXhwZWN0KCd7Jyk7XG4gICAgICAgIGlmICghbWF0Y2goJ30nKSkge1xuICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgIGlzRXhwb3J0RnJvbUlkZW50aWZpZXIgPSBpc0V4cG9ydEZyb21JZGVudGlmaWVyIHx8IG1hdGNoS2V5d29yZCgnZGVmYXVsdCcpO1xuICAgICAgICAgICAgICAgIHNwZWNpZmllcnMucHVzaChwYXJzZUV4cG9ydFNwZWNpZmllcigpKTtcbiAgICAgICAgICAgIH0gd2hpbGUgKG1hdGNoKCcsJykgJiYgbGV4KCkpO1xuICAgICAgICB9XG4gICAgICAgIGV4cGVjdCgnfScpO1xuXG4gICAgICAgIGlmIChtYXRjaENvbnRleHR1YWxLZXl3b3JkKCdmcm9tJykpIHtcbiAgICAgICAgICAgIC8vIGNvdmVyaW5nOlxuICAgICAgICAgICAgLy8gZXhwb3J0IHtkZWZhdWx0fSBmcm9tICdmb28nO1xuICAgICAgICAgICAgLy8gZXhwb3J0IHtmb299IGZyb20gJ2Zvbyc7XG4gICAgICAgICAgICBsZXgoKTtcbiAgICAgICAgICAgIHNyYyA9IHBhcnNlTW9kdWxlU3BlY2lmaWVyKCk7XG4gICAgICAgICAgICBjb25zdW1lU2VtaWNvbG9uKCk7XG4gICAgICAgIH0gZWxzZSBpZiAoaXNFeHBvcnRGcm9tSWRlbnRpZmllcikge1xuICAgICAgICAgICAgLy8gY292ZXJpbmc6XG4gICAgICAgICAgICAvLyBleHBvcnQge2RlZmF1bHR9OyAvLyBtaXNzaW5nIGZyb21DbGF1c2VcbiAgICAgICAgICAgIHRocm93RXJyb3IobG9va2FoZWFkLnZhbHVlID9cbiAgICAgICAgICAgICAgICAgICAgTWVzc2FnZXMuVW5leHBlY3RlZFRva2VuIDogTWVzc2FnZXMuTWlzc2luZ0Zyb21DbGF1c2UsIGxvb2thaGVhZC52YWx1ZSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAvLyBjb3ZlclxuICAgICAgICAgICAgLy8gZXhwb3J0IHtmb299O1xuICAgICAgICAgICAgY29uc3VtZVNlbWljb2xvbigpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBub2RlLmZpbmlzaEV4cG9ydE5hbWVkRGVjbGFyYXRpb24oZGVjbGFyYXRpb24sIHNwZWNpZmllcnMsIHNyYyk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gcGFyc2VFeHBvcnREZWZhdWx0RGVjbGFyYXRpb24obm9kZSkge1xuICAgICAgICB2YXIgZGVjbGFyYXRpb24gPSBudWxsLFxuICAgICA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F0aW9uKHNwZWNpZmllcnMsIHNyYyk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIW1hdGNoS2V5d29yZCgnZGVmYXVsdCcpICYmIGlzSWRlbnRpZmllck5hbWUobG9va2FoZWFkKSkge1xuICAgICAgICAgICAgLy8gY292ZXJzOlxuICAgICAgICAgICAgLy8gaW1wb3J0IGZvb1xuICAgICAgICAgICAgLy8gaW1wb3J0IGZvbywgLi4uXG4gICAgICAgICAgICBzcGVjaWZpZXJzLnB1c2gocGFyc2VJbXBvcnREZWZhdWx0U3BlY2lmaWVyKCkpO1xuICAgICAgICAgICAgaWYgKG1hdGNoKCcsJykpIHtcbiAgICAgICAgICAgICAgICBsZXgoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAobWF0Y2goJyonKSkge1xuICAgICAgICAgICAgLy8gY292ZXJzOlxuICAgICAgICAgICAgLy8gaW1wb3J0IGZvbywgKiBhcyBmb29cbiAgICAgICAgICAgIC8vIGltcG9ydCAqIGFzIGZvb1xuICAgICAgICAgICAgc3BlY2lmaWVycy5wdXNoKHBhcnNlSW1wb3J0TmFtZXNwYWNlU3BlY2lmaWVyKCkpO1xuICAgICAgICB9IGVsc2UgaWYgKG1hdGNoKCd7JykpIHtcbiAgICAgICAgICAgIC8vIGNvdmVyczpcbiAgICAgICAgICAgIC8vIGltcG9ydCBmb28sIHtiYXJ9XG4gICAgICAgICAgICAvLyBpbXBvcnQge2Jhcn1cbiAgICAgICAgICAgIHNwZWNpZmllcnMgPSBzcGVjaWZpZXJzLmNvbmNhdChwYXJzZU5hbWVkSW1wb3J0cygpKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghbWF0Y2hDb250ZXh0dWFsS2V5d29yZCgnZnJvbScpKSB7XG4gICAgICAgICAgICB0aHJvd0Vycm9yKGxvb2thaGVhZC52YWx1ZSA/XG4gICAgICAgICAgICAgICAgICAgIE1lc3NhZ2VzLlVuZXhwZWN0ZWRUb2tlbiA6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RpdmUgPT09ICd1c2Ugc3RyaWN0Jykge1xuICAgICAgICAgICAgICAgIHN0cmljdCA9IHRydWU7XG4gICAgICAgICAgICAgICAgaWYgKGZpcnN0UmVzdHJpY3RlZCkge1xuICAgICAgICAgICAgICAgICAgICB0b2xlcmF0ZVVuZXhwZWN0ZWRUb2tlbihmaXJzdFJlc3RyaWN0ZWQsIE1lc3NhZ2VzLlN0cmljdE9jdGFsTGl0ZXJhbCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZiAoIWZpcnN0UmVzdHJpY3RlZCAmJiB0b2tlbi5vY3RhbCkge1xuICAgICAgICAgICAgICAgICAgICBmaXJzdFJlc3RyaWN0ZWQgPSB0b2tlbjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICB3aGlsZSAoc3RhcnRJbmRleCA8IGxlbmd0aCkge1xuICAgICAgICAgICAgc3RhdGVtZW50ID0gcGFyc2VTdGF0ZW1lbnRMaXN0SXRlbSgpO1xuICAgICAgICAgICAgLyogaXN0YW5idWwgaWdub3JlIGlmICovXG4gICAgICAgICAgICBpZiAodHlwZW9mIHN0YXRlbWVudCA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJvZHkucHVzaChzdGF0ZW1lbnQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBib2R5O1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHBhcnNlUHJvZ3JhbSgpIHtcbiAgICAgICAgdmFyIGJvZHksIG5vZGU7XG5cbiAgICAgICAgcGVlaygpO1xuICAgICAgICBub2RlID0gbmV3IE5vZGUoKTtcblxuICAgICAgICBib2R5ID0gcGFyc2VTY3JpcHRCb2R5KCk7XG4gICAgICAgIHJldHVybiBub2RlLmZpbmlzaFByb2dyYW0oYm9keSk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gZmlsdGVyVG9rZW5Mb2NhdGlvbigpIHtcbiAgICAgICAgdmFyIGksIGVudHJ5LCB0b2tlbiwgdG9rZW5zID0gW107XG5cbiAgICAgICAgZm9yIChpID0gMDsgaSA8IGV4dHJhLnRva2Vucy5sZW5ndGg7ICsraSkge1xuICAgICAgICAgICAgZW50cnkgPSBleHRyYS50b2tlbnNbaV07XG4gICAgICAgICAgICB0b2tlbiA9IHtcbiAgICAgICAgICAgICAgICB0eXBlOiBlbnRyeS50eXBlLFxuICAgICAgICAgICAgICAgIHZhbHVlOiBlbnRyeS52YWx1ZVxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGlmIChlbnRyeS5yZWdleCkge1xuICAgICAgICAgICAgICAgIHRva2VuLnJlZ2V4ID0ge1xuICAgICAgICAgICAgICAgICAgICBwYXR0ZXJuOiBlbnRyeS5yZWdleC5wYXR0ZXJuLFxuICAgICAgICAgICAgICAgICAgICBmbGFnczogZW50cnkucmVnZXguZmxhZ3NcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGV4dHJhLnJhbmdlKSB7XG4gICAgICAgICAgICAgICAgdG9rZW4ucmFuZ2UgPSBlbnRyeS5yYW5nZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChleHRyYS5sb2MpIHtcbiAgICAgICAgICAgICAgICB0b2tlbi5sb2MgPSBlbnRyeS5sb2M7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0b2tlbnMucHVzaCh0b2tlbik7XG4gICAgICAgIH1cblxuICAgICAgICBleHRyYS50b2tlbnMgPSB0b2tlbnM7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gdG9rZW5pemUoY29kZSwgb3B0aW9ucykge1xuICAgICAgICB2YXIgdG9TdHJpbmcsXG4gICAgICAgICAgICB0b2tlbnM7XG5cbiAgICAgICAgdG9TdHJpbmcgPSBTdHJpbmc7XG4gICAgICAgIGlmICh0eXBlb2YgY29kZSAhPT0gJ3N0cmluZycgJiYgIShjb2RlIGluc3RhbmNlb2YgU3RyaW5nKSkge1xuICAgICAgICAgICAgY29kZSA9IHRvU3RyaW5nKGNvZGUpO1xuICAgICAgICB9XG5cbiAgICAgICAgc291cmNlID0gY29kZTtcbiAgICAgICAgaW5kZXggPSAwO1xuICAgICAgICBsaW5lTnVtYmVyID0gKHNvdXJjZS5sZW5ndGggPiAwKSA/IDEgOiAwO1xuICAgICAgICBsaW5lU3RhcnQgPSAwO1xuICAgICAgICBzdGFydEluZGV4ID0gaW5kZXg7XG4gICAgICAgIHN0YXJ0TGluZU51bWJlciA9IGxpbmVOdW1iZXI7XG4gICAgICAgIHN0YXJ0TGluZVN0YXJ0ID0gbGluZVN0YXJ0O1xuICAgICAgICBsZW5ndGggPSBzb3VyY2UubGVuZ3RoO1xuICAgICAgICBsb29rYWhlYWQgPSBudWxsO1xuICAgICAgICBzdGF0ZSA9IHtcbiAgICAgICAgICAgIGFsbG93SW46IHRydWUsXG4gICAgICAgICAgICBsYWJlbFNldDoge30sXG4gICAgICAgICAgICBpbkZ1bmN0aW9uQm9keTogZmFsc2UsXG4gICAgICAgICAgICBpbkl0ZXJhdGlvbjogZmFsc2UsXG4gICAgICAgICAgICBpblN3aXRjaDogZmFsc2UsXG4gICAgICAgICAgICBsYXN0Q29tbWVudFN0YXJ0OiAtMSxcbiAgICAgICAgICAgIGN1cmx5U3RhY2s6IFtdXG4gICAgICAgIH07XG5cbiAgICAgICAgZXh0cmEgPSB7fTtcblxuICAgICAgICAvLyBPcHRpb25zIG1hdGNoaW5nLlxuICAgICAgICBvcHRpb25zID0gb3B0aW9ucyB8fCB7fTtcblxuICAgICAgICAvLyBPZiBjb3Vyc2Ugd2UgY29sbGVjdCB0b2tlbnMgaGVyZS5cbiAgICAgICAgb3B0aW9ucy50b2tlbnMgPSB0cnVlO1xuICAgICAgICBleHRyYS50b2tlbnMgPSBbXTtcbiAgICAgICAgZXh0cmEudG9rZW5pemUgPSB0cnVlO1xuICAgICAgICAvLyBUaGUgZm9sbG93aW5nIHR3byBmaWVsZHMgYXJlIG5lY2Vzc2FyeSB0byBjb21wdXRlIHRoZSBSZWdleCB0b2tlbnMuXG4gICAgICAgIGV4dHJhLm9wZW5QYXJlblRva2VuID0gLTE7XG4gICAgICAgIGV4dHJhLm9wZW5DdXJseVRva2VuID0gLTE7XG5cbiAgICAgICAgZXh0cmEucmFuZ2UgPSAodHlwZW9mIG9wdGlvbnMucmFuZ2UgPT09ICdib29sZWFuJykgJiYgb3B0aW9ucy5yYW5nZTtcbiAgICAgICAgZXh0cmEubG9jID0gKHR5cGVvZiBvcHRpb25zLmxvYyA9PT0gJ2Jvb2xlYW4nKSAmJiBvcHRpb25zLmxvYztcblxuICAgICAgICBpZiAodHlwZW9mIG9wdGlvbnMuY29tbWVudCA9PT0gJ2Jvb2xlYW4nICYmIG9wdGlvbnMuY29tbWVudCkge1xuICAgICAgICAgICAgZXh0cmEuY29tbWVudHMgPSBbXTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodHlwZW9mIG9wdGlvbnMudG9sZXJhbnQgPT09ICdib29sZWFuJyAmJiBvcHRpb25zLnRvbGVyYW50KSB7XG4gICAgICAgICAgICBleHRyYS5lcnJvcnMgPSBbXTtcbiAgICAgICAgfVxuXG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgICBwZWVrKCk7XG4gICAgICAgICAgICBpZiAobG9va2FoZWFkLnR5cGUgPT09IFRva2VuLkVPRikge1xuICAgICAgICAgICAgICAgIHJldHVybiBleHRyYS50b2tlbnM7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGxleCgpO1xuICAgICAgICAgICAgd2hpbGUgKGxvb2thaGVhZC50eXBlICE9PSBUb2tlbi5FT0YpIHtcbiAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICBsZXgoKTtcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChsZXhFcnJvcikge1xuICAgICAgICAgICAgICAgICAgICBpZiAoZXh0cmEuZXJyb3JzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZWNvcmRFcnJvcihsZXhFcnJvcik7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBXZSBoYXZlIHRvIGJyZWFrIG9uIHRoZSBmaXJzdCBlcnJvclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gdG8gYXZvaWQgaW5maW5pdGUgbG9vcHMuXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IGxleEVycm9yO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmaWx0ZXJUb2tlbkxvY2F0aW9uKCk7XG4gICAgICAgICAgICB0b2tlbnMgPSBleHRyYS50b2tlbnM7XG4gICAgICAgICAgICBpZiAodHlwZW9mIGV4dHJhLmNvbW1lbnRzICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgIHRva2Vucy5jb21tZW50cyA9IGV4dHJhLmNvbW1lbnRzO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHR5cGVvZiBleHRyYS5lcnJvcnMgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgdG9rZW5zLmVycm9ycyA9IGV4dHJhLmVycm9ycztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgdGhyb3cgZTtcbiAgICAgICAgfSBmaW5hbGx5IHtcbiAgICAgICAgICAgIGV4dHJhID0ge307XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRva2VucztcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBwYXJzZShjb2RlLCBvcHRpb25zKSB7XG4gICAgICAgIHZhciBwcm9ncmFtLCB0b1N0cmluZztcblxuICAgICAgICB0b1N0cmluZyA9IFN0cmluZztcbiAgICAgICAgaWYgKHR5cGVvZiBjb2RlICE9PSAnc3RyaW5nJyAmJiAhKGNvZGUgaW5zdGFuY2VvZiBTdHJpbmcpKSB7XG4gICAgICAgICAgICBjb2RlID0gdG9TdHJpbmcoY29kZSk7XG4gICAgICAgIH1cblxuICAgICAgICBzb3VyY2UgPSBjb2RlO1xuICAgICAgICBpbmRleCA9IDA7XG4gICAgICAgIGxpbmVOdW1iZXIgPSAoc291cmNlLmxlbmd0aCA+IDApID8gMSA6IDA7XG4gICAgICAgIGxpbmVTdGFydCA9IDA7XG4gICAgICAgIHN0YXJ0SW5kZXggPSBpbmRleDtcbiAgICAgICAgc3RhcnRMaW5lTnVtYmVyID0gbGluZU51bWJlcjtcbiAgICAgICAgc3RhcnRMaW5lU3RhcnQgPSBsaW5lU3RhcnQ7XG4gICAgICAgIGxlbmd0aCA9IHNvdXJjZS5sZW5ndGg7XG4gICAgICAgIGxvb2thaGVhZCA9IG51bGw7XG4gICAgICAgIHN0YXRlID0ge1xuICAgICAgICAgICAgYWxsb3dJbjogdHJ1ZSxcbiAgICAgICAgICAgIGxhYmVsU2V0OiB7fSxcbiAgICAgICAgICAgIGluRnVuY3Rpb25Cb2R5OiBmYWxzZSxcbiAgICAgICAgICAgIGluSXRlcmF0aW9uOiBmYWxzZSxcbiAgICAgICAgICAgIGluU3dpdGNoOiBmYWxzZSxcbiAgICAgICAgICAgIGxhc3RDb21tZW50U3RhcnQ6IC0xLFxuICAgICAgICAgICAgY3VybHlTdGFjazogW11cbiAgICAgICAgfTtcbiAgICAgICAgc291cmNlVHlwZSA9ICdzY3JpcHQnO1xuICAgICAgICBzdHJpY3QgPSBmYWxzZTtcblxuICAgICAgICBleHRyYSA9IHt9O1xuICAgICAgICBpZiAodHlwZW9mIG9wdGlvbnMgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBleHRyYS5yYW5nZSA9ICh0eXBlb2Ygb3B0aW9ucy5yYW5nZSA9PT0gJ2Jvb2xlYW4nKSAmJiBvcHRpb25zLnJhbmdlO1xuICAgICAgICAgICAgZXh0cmEubG9jID0gKHR5cGVvZiBvcHRpb25zLmxvYyA9PT0gJ2Jvb2xlYW4nKSAmJiBvcHRpb25zLmxvYztcbiAgICAgICAgICAgIGV4dHJhLmF0dGFjaENvbW1lbnQgPSAodHlwZW9mIG9wdGlvbnMuYXR0YWNoQ29tbWVudCA9PT0gJ2Jvb2xlYW4nKSAmJiBvcHRpb25zLmF0dGFjaENvbW1lbnQ7XG5cbiAgICAgICAgICAgIGlmIChleHRyYS5sb2MgJiYgb3B0aW9ucy5zb3VyY2UgIT09IG51bGwgJiYgb3B0aW9ucy5zb3VyY2UgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgIGV4dHJhLnNvdXJjZSA9IHRvU3RyaW5nKG9wdGlvbnMuc291cmNlKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKHR5cGVvZiBvcHRpb25zLnRva2VucyA9PT0gJ2Jvb2xlYW4nICYmIG9wdGlvbnMudG9rZW5zKSB7XG4gICAgICAgICAgICAgICAgZXh0cmEudG9rZW5zID0gW107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodHlwZW9mIG9wdGlvbnMuY29tbWVudCA9PT0gJ2Jvb2xlYW4nICYmIG9wdGlvbnMuY29tbWVudCkge1xuICAgICAgICAgICAgICAgIGV4dHJhLmNvbW1lbnRzID0gW107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodHlwZW9mIG9wdGlvbnMudG9sZXJhbnQgPT09ICdib29sZWFuJyAmJiBvcHRpb25zLnRvbGVyYW50KSB7XG4gICAgICAgICAgICAgICAgZXh0cmEuZXJyb3JzID0gW107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoZXh0cmEuYXR0YWNoQ29tbWVudCkge1xuICAgICAgICAgICAgICAgIGV4dHJhLnJhbmdlID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBleHRyYS5jb21tZW50cyA9IFtdO1xuICAgICAgICAgICAgICAgIGV4dHJhLmJvdHRvbVJpZ2h0U3RhY2sgPSBbXTtcbiAgICAgICAgICAgICAgICBleHRyYS50cmFpbGluZ0NvbW1lbnRzID0gW107XG4gICAgICAgICAgICAgICAgZXh0cmEubGVhZGluZ0NvbW1lbnRzID0gW107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAob3B0aW9ucy5zb3VyY2VUeXBlID09PSAnbW9kdWxlJykge1xuICAgICAgICAgICAgICAgIC8vIHZlcnkgcmVzdHJpY3RpdmUgY29uZGl0aW9uIGZvciBub3dcbiAgICAgICAgICAgICAgICBzb3VyY2VUeXBlID0gb3B0aW9ucy5zb3VyY2VUeXBlO1xuICAgICAgICAgICAgICAgIHN0cmljdCA9IHRydWU7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICB0cnkge1xuICAgICAgICAgICAgcHJvZ3JhbSA9IHBhcnNlUHJvZ3JhbSgpO1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBleHRyYS5jb21tZW50cyAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICBwcm9ncmFtLmNvbW1lbnRzID0gZXh0cmEuY29tbWVudHM7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodHlwZW9mIGV4dHJhLnRva2VucyAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICBmaWx0ZXJUb2tlbkxvY2F0aW9uKCk7XG4gICAgICAgICAgICAgICAgcHJvZ3JhbS50b2tlbnMgPSBleHRyYS50b2tlbnM7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodHlwZW9mIGV4dHJhLmVycm9ycyAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICBwcm9ncmFtLmVycm9ycyA9IGV4dHJhLmVycm9ycztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgdGhyb3cgZTtcbiAgICAgICAgfSBmaW5hbGx5IHtcbiAgICAgICAgICAgIGV4dHJhID0ge307XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gcHJvZ3JhbTtcbiAgICB9XG5cbiAgICAvLyBTeW5jIHdpdGggKi5qc29uIG1hbmlmZXN0cy5cbiAgICBleHBvcnRzLnZlcnNpb24gPSAnMi4yLjAnO1xuXG4gICAgZXhwb3J0cy50b2tlbml6ZSA9IHRva2VuaXplO1xuXG4gICAgZXhwb3J0cy5wYXJzZSA9IHBhcnNlO1xuXG4gICAgLy8gRGVlcCBjb3B5LlxuICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBuZXh0ICovXG4gICAgZXhwb3J0cy5TeW50YXggPSAoZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgbmFtZSwgdHlwZXMgPSB7fTtcblxuICAgICAgICBpZiAodHlwZW9mIE9iamVjdC5jcmVhdGUgPT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICAgIHR5cGVzID0gT2JqZWN0LmNyZWF0ZShudWxsKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGZvciAobmFtZSBpbiBTeW50YXgpIHtcbiAgICAgICAgICAgIGlmIChTeW50YXguaGFzT3duUHJvcGVydHkobmFtZSkpIHtcbiAgICAgICAgICAgICAgICB0eXBlc1tuYW1lXSA9IFN5bnRheFtuYW1lXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0eXBlb2YgT2JqZWN0LmZyZWV6ZSA9PT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICAgICAgT2JqZWN0LmZyZWV6ZSh0eXBlcyk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gdHlwZXM7XG4gICAgfSgpKTtcblxufSkpO1xuLyogdmltOiBzZXQgc3c9NCB0cz00IGV0IHR3PTgwIDogKi9cbiIsInZhciBi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kpICYmXG4gICAgICAgICEoa2V5ID09ICdjb25zdHJ1Y3RvcicgJiYgKGlzUHJvdG8gfHwgIWhhc093blByb3BlcnR5LmNhbGwob2JqZWN0LCBrZXkpKSkpIHtcbiAgICAgIHJlc3VsdC5wdXNoKGtleSk7XG4gICAgfVxuICB9XG4gIGlmIChzdXBwb3J0Lm5vbkVudW1TaGFkb3dzICYmIG9iamVjdCAhPT0gb2JqZWN0UHJvdG8pIHtcbiAgICB2YXIgdGFnID0gb2JqZWN0ID09PSBzdHJpbmdQcm90byA/IHN0cmluZ1RhZyA6IChvYmplY3QgPT09IGVycm9yUHJvdG8gPyBlcnJvclRhZyA6IG9ialRvU3RyaW5nLmNhbGwob2JqZWN0KSksXG4gICAgICAgIG5vbkVudW1zID0gbm9uRW51bVByb3BzW3RhZ10gfHwgbm9uRW51bVByb3BzW29iamVjdFRhZ107XG5cbiAgICBpZiAodGFnID09IG9iamVjdFRhZykge1xuICAgICAgcHJvdG8gPSBvYmplY3RQcm90bztcbiAgICB9XG4gICAgbGVuZ3RoID0gc2hhZG93UHJvcHMubGVuZ3RoO1xuICAgIHdoaWxlIChsZW5ndGgtLSkge1xuICAgICAga2V5ID0gc2hhZG93UHJvcHNbbGVuZ3RoXTtcbiAgICAgIHZhciBub25FbnVtID0gbm9uRW51bXNba2V5XTtcbiAgICAgIGlmICghKGlzUHJvdG8gJiYgbm9uRW51bSkgJiZcbiAgICAgICAgICAobm9uRW51bSA/IGhhc093blByb3BlcnR5LmNhbGwob2JqZWN0LCBrZXkpIDogb2JqZWN0W2tleV0gIT09IHByb3RvW2tleV0pKSB7XG4gICAgICAgIHJlc3VsdC5wdXNoKGtleSk7XG4gICAgICB9XG4gICAgfVxuICB9XG4gIHJldHVybiByZXN1bHQ7XG59XG5cbm1vZHVsZS5leHBvcnRzID0ga2V5c0luO1xuIiwidmFyIGtleXMgPSByZXF1aXJlKCcuL2tleXMnKSxcbiAgICB0b09iamVjdCA9IHJlcXVpcmUoJy4uL2ludGV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YWwpeyAgXG4gIHZhciBpZHggPSAwO1xuICB2YXIgbGVuID0gYXJyLmxlbmd0aDtcbiAgdmFyIGN1cnIgPSBhcmd1bWVudHMubGVuZ3RoID09IDNcbiAgICA/IGluaXRpYWxcbiAgICA6IGFycltpZHgrK107XG5cbiAgd2hpbGUgKGlkeCA8IGxlbikge1xuICAgIGN1cnIgPSBmbi5jYWxsKG51bGwsIGN1cnIsIGFycltpZHhdLCArK2lkeCwgYXJyKTtcbiAgfVxuICBcbiAgcmV0dXJuIGN1cnI7XG59OyJdfQ==
+
+'use strict';
+
+window.SwaggerUi = Backbone.Router.extend({
+
+ dom_id: 'swagger_ui',
+
+ // Attributes
+ options: null,
+ api: null,
+ headerView: null,
+ mainView: null,
+
+ // SwaggerUi accepts all the same options as SwaggerApi
+ initialize: function(options) {
+ options = options || {};
+ if(!options.highlightSizeThreshold) {
+ options.highlightSizeThreshold = 100000;
+ }
+
+ // Allow dom_id to be overridden
+ if (options.dom_id) {
+ this.dom_id = options.dom_id;
+ delete options.dom_id;
+ }
+
+ if (!options.supportedSubmitMethods){
+ options.supportedSubmitMethods = [
+ 'get',
+ 'put',
+ 'post',
+ 'delete',
+ 'head',
+ 'options',
+ 'patch'
+ ];
+ }
+
+ if (typeof options.oauth2RedirectUrl === 'string') {
+ window.oAuthRedirectUrl = options.redirectUrl;
+ }
+
+ // Create an empty div which contains the dom_id
+ if (! $('#' + this.dom_id).length){
+ $('body').append('<div id="' + this.dom_id + '"></div>') ;
+ }
+
+ this.options = options;
+
+ // set marked options
+ marked.setOptions({gfm: true});
+
+ // Set the callbacks
+ var that = this;
+ this.options.success = function() { return that.render(); };
+ this.options.progress = function(d) { return that.showMessage(d); };
+ this.options.failure = function(d) { return that.onLoadFailure(d); };
+
+ // Create view to handle the header inputs
+ this.headerView = new SwaggerUi.Views.HeaderView({el: $('#header')});
+
+ // Event handler for when the baseUrl/apiKey is entered by user
+ this.headerView.on('update-swagger-ui', function(data) {
+ return that.updateSwaggerUi(data);
+ });
+ },
+
+ // Set an option after initializing
+ setOption: function(option, value) {
+ this.options[option] = value;
+ },
+
+ // Get the value of a previously set option
+ getOption: function(option) {
+ return this.options[option];
+ },
+
+ // Event handler for when url/key is received from user
+ updateSwaggerUi: function(data){
+ this.options.url = data.url;
+ this.load();
+ },
+
+ // Create an api and render
+ load: function(){
+ // Initialize the API object
+ if (this.mainView) {
+ this.mainView.clear();
+ }
+ var url = this.options.url;
+ if (url && url.indexOf('http') !== 0) {
+ url = this.buildUrl(window.location.href.toString(), url);
+ }
+ if(this.api) {
+ this.options.authorizations = this.api.clientAuthorizations.authz;
+ }
+ this.options.url = url;
+ this.headerView.update(url);
+
+ this.api = new SwaggerClient(this.options);
+ },
+
+ // collapse all sections
+ collapseAll: function(){
+ Docs.collapseEndpointListForResource('');
+ },
+
+ // list operations for all sections
+ listAll: function(){
+ Docs.collapseOperationsForResource('');
+ },
+
+ // expand operations for all sections
+ expandAll: function(){
+ Docs.expandOperationsForResource('');
+ },
+
+ // This is bound to success handler for SwaggerApi
+ // so it gets called when SwaggerApi completes loading
+ render: function(){
+ this.showMessage('Finished Loading Resource Information. Rendering Swagger UI...');
+ this.mainView = new SwaggerUi.Views.MainView({
+ model: this.api,
+ el: $('#' + this.dom_id),
+ swaggerOptions: this.options,
+ router: this
+ }).render();
+ this.showMessage();
+ switch (this.options.docExpansion) {
+ case 'full':
+ this.expandAll(); break;
+ case 'list':
+ this.listAll(); break;
+ default:
+ break;
+ }
+ this.renderGFM();
+
+ if (this.options.onComplete){
+ this.options.onComplete(this.api, this);
+ }
+
+ setTimeout(Docs.shebang.bind(this), 100);
+ },
+
+ buildUrl: function(base, url){
+ if (url.indexOf('/') === 0) {
+ var parts = base.split('/');
+ base = parts[0] + '//' + parts[2];
+ return base + url;
+ } else {
+ var endOfPath = base.length;
+
+ if (base.indexOf('?') > -1){
+ endOfPath = Math.min(endOfPath, base.indexOf('?'));
+ }
+
+ if (base.indexOf('#') > -1){
+ endOfPath = Math.min(endOfPath, base.indexOf('#'));
+ }
+
+ base = base.substring(0, endOfPath);
+
+ if (base.indexOf('/', base.length - 1 ) !== -1){
+ return base + url;
+ }
+
+ return base + '/' + url;
+ }
+ },
+
+ // Shows message on topbar of the ui
+ showMessage: function(data){
+ if (data === undefined) {
+ data = '';
+ }
+ var $msgbar = $('#message-bar');
+ $msgbar.removeClass('message-fail');
+ $msgbar.addClass('message-success');
+ $msgbar.html(data);
+ if(window.SwaggerTranslator) {
+ window.SwaggerTranslator.translate($msgbar);
+ }
+ },
+
+ // shows message in red
+ onLoadFailure: function(data){
+ if (data === undefined) {
+ data = '';
+ }
+ $('#message-bar').removeClass('message-success');
+ $('#message-bar').addClass('message-fail');
+
+ var val = $('#message-bar').text(data);
+
+ if (this.options.onFailure) {
+ this.options.onFailure(data);
+ }
+
+ return val;
+ },
+
+ // Renders GFM for elements with 'markdown' class
+ renderGFM: function(){
+ $('.markdown').each(function(){
+ $(this).html(marked($(this).html()));
+ });
+
+ $('.propDesc', '.model-signature .description').each(function () {
+ $(this).html(marked($(this).html())).addClass('markdown');
+ });
+ }
+
+});
+
+window.SwaggerUi.Views = {};
+
+// don't break backward compatibility with previous versions and warn users to upgrade their code
+(function(){
+ window.authorizations = {
+ add: function() {
+ warn('Using window.authorizations is deprecated. Please use SwaggerUi.api.clientAuthorizations.add().');
+
+ if (typeof window.swaggerUi === 'undefined') {
+ throw new TypeError('window.swaggerUi is not defined');
+ }
+
+ if (window.swaggerUi instanceof SwaggerUi) {
+ window.swaggerUi.api.clientAuthorizations.add.apply(window.swaggerUi.api.clientAuthorizations, arguments);
+ }
+ }
+ };
+
+ window.ApiKeyAuthorization = function() {
+ warn('window.ApiKeyAuthorization is deprecated. Please use SwaggerClient.ApiKeyAuthorization.');
+ SwaggerClient.ApiKeyAuthorization.apply(window, arguments);
+ };
+
+ window.PasswordAuthorization = function() {
+ warn('window.PasswordAuthorization is deprecated. Please use SwaggerClient.PasswordAuthorization.');
+ SwaggerClient.PasswordAuthorization.apply(window, arguments);
+ };
+
+ function warn(message) {
+ if ('console' in window && typeof window.console.warn === 'function') {
+ console.warn(message);
+ }
+ }
+})();
+
+
+// UMD
+(function (root, factory) {
+ if (typeof define === 'function' && define.amd) {
+ // AMD. Register as an anonymous module.
+ define(['b'], function (b) {
+ return (root.SwaggerUi = factory(b));
+ });
+ } else if (typeof exports === 'object') {
+ // Node. Does not work with strict CommonJS, but
+ // only CommonJS-like environments that support module.exports,
+ // like Node.
+ module.exports = factory(require('b'));
+ } else {
+ // Browser globals
+ root.SwaggerUi = factory(root.b);
+ }
+}(this, function () {
+ return SwaggerUi;
+}));
+
+'use strict';
+
+SwaggerUi.Views.ApiKeyButton = Backbone.View.extend({ // TODO: append this to global SwaggerUi
+
+ events:{
+ 'click #apikey_button' : 'toggleApiKeyContainer',
+ 'click #apply_api_key' : 'applyApiKey'
+ },
+
+ initialize: function(opts){
+ this.options = opts || {};
+ this.router = this.options.router;
+ },
+
+ render: function(){
+ var template = this.template();
+ $(this.el).html(template(this.model));
+
+ return this;
+ },
+
+
+ applyApiKey: function(){
+ var keyAuth = new SwaggerClient.ApiKeyAuthorization(
+ this.model.name,
+ $('#input_apiKey_entry').val(),
+ this.model.in
+ );
+ this.router.api.clientAuthorizations.add(this.model.name, keyAuth);
+ this.router.load();
+ $('#apikey_container').show();
+ },
+
+ toggleApiKeyContainer: function(){
+ if ($('#apikey_container').length) {
+
+ var elem = $('#apikey_container').first();
+
+ if (elem.is(':visible')){
+ elem.hide();
+ } else {
+
+ // hide others
+ $('.auth_container').hide();
+ elem.show();
+ }
+ }
+ },
+
+ template: function(){
+ return Handlebars.templates.apikey_button_view;
+ }
+
+});
+'use strict';
+
+SwaggerUi.Views.BasicAuthButton = Backbone.View.extend({
+
+
+ initialize: function (opts) {
+ this.options = opts || {};
+ this.router = this.options.router;
+ },
+
+ render: function(){
+ var template = this.template();
+ $(this.el).html(template(this.model));
+
+ return this;
+ },
+
+ events: {
+ 'click #basic_auth_button' : 'togglePasswordContainer',
+ 'click #apply_basic_auth' : 'applyPassword'
+ },
+
+ applyPassword: function(){
+ var username = $('.input_username').val();
+ var password = $('.input_password').val();
+ var basicAuth = new SwaggerClient.PasswordAuthorization('basic', username, password);
+ this.router.api.clientAuthorizations.add(this.model.type, basicAuth);
+ this.router.load();
+ $('#basic_auth_container').hide();
+ },
+
+ togglePasswordContainer: function(){
+ if ($('#basic_auth_container').length) {
+ var elem = $('#basic_auth_container').show();
+ if (elem.is(':visible')){
+ elem.slideUp();
+ } else {
+ // hide others
+ $('.auth_container').hide();
+ elem.show();
+ }
+ }
+ },
+
+ template: function(){
+ return Handlebars.templates.basic_auth_button_view;
+ }
+
+});
+'use strict';
+
+SwaggerUi.Views.ContentTypeView = Backbone.View.extend({
+ initialize: function() {},
+
+ render: function(){
+ this.model.contentTypeId = 'ct' + Math.random();
+ $(this.el).html(Handlebars.templates.content_type(this.model));
+ return this;
+ }
+});
+'use strict';
+
+SwaggerUi.Views.HeaderView = Backbone.View.extend({
+ events: {
+ 'click #show-pet-store-icon' : 'showPetStore',
+ 'click #explore' : 'showCustom',
+ 'keyup #input_baseUrl' : 'showCustomOnKeyup',
+ 'keyup #input_apiKey' : 'showCustomOnKeyup'
+ },
+
+ initialize: function(){},
+
+ showPetStore: function(){
+ this.trigger('update-swagger-ui', {
+ url:'http://petstore.swagger.io/v2/swagger.json'
+ });
+ },
+
+ showCustomOnKeyup: function(e){
+ if (e.keyCode === 13) {
+ this.showCustom();
+ }
+ },
+
+ showCustom: function(e){
+ if (e) {
+ e.preventDefault();
+ }
+
+ this.trigger('update-swagger-ui', {
+ url: $('#input_baseUrl').val(),
+ apiKey: $('#input_apiKey').val()
+ });
+ },
+
+ update: function(url, apiKey, trigger){
+ if (trigger === undefined) {
+ trigger = false;
+ }
+
+ $('#input_baseUrl').val(url);
+
+ //$('#input_apiKey').val(apiKey);
+ if (trigger) {
+ this.trigger('update-swagger-ui', {url:url});
+ }
+ }
+});
+
+'use strict';
+
+SwaggerUi.Views.MainView = Backbone.View.extend({
+ apisSorter : {
+ alpha : function(a,b){ return a.name.localeCompare(b.name); }
+ },
+ operationsSorters : {
+ alpha : function(a,b){ return a.path.localeCompare(b.path); },
+ method : function(a,b){ return a.method.localeCompare(b.method); }
+ },
+ initialize: function(opts){
+ var sorterOption, sorterFn, key, value;
+ opts = opts || {};
+
+ this.router = opts.router;
+
+ // Sort APIs
+ if (opts.swaggerOptions.apisSorter) {
+ sorterOption = opts.swaggerOptions.apisSorter;
+ if (_.isFunction(sorterOption)) {
+ sorterFn = sorterOption;
+ } else {
+ sorterFn = this.apisSorter[sorterOption];
+ }
+ if (_.isFunction(sorterFn)) {
+ this.model.apisArray.sort(sorterFn);
+ }
+ }
+ // Sort operations of each API
+ if (opts.swaggerOptions.operationsSorter) {
+ sorterOption = opts.swaggerOptions.operationsSorter;
+ if (_.isFunction(sorterOption)) {
+ sorterFn = sorterOption;
+ } else {
+ sorterFn = this.operationsSorters[sorterOption];
+ }
+ if (_.isFunction(sorterFn)) {
+ for (key in this.model.apisArray) {
+ this.model.apisArray[key].operationsArray.sort(sorterFn);
+ }
+ }
+ }
+
+ // set up the UI for input
+ this.model.auths = [];
+
+ for (key in this.model.securityDefinitions) {
+ value = this.model.securityDefinitions[key];
+
+ this.model.auths.push({
+ name: key,
+ type: value.type,
+ value: value
+ });
+ }
+
+ if ('validatorUrl' in opts.swaggerOptions) {
+ // Validator URL specified explicitly
+ this.model.validatorUrl = opts.swaggerOptions.validatorUrl;
+ } else if (this.model.url.indexOf('localhost') > 0) {
+ // Localhost override
+ this.model.validatorUrl = null;
+ } else {
+ // Default validator
+ if(window.location.protocol === 'https:') {
+ this.model.validatorUrl = 'https://online.swagger.io/validator';
+ }
+ else {
+ this.model.validatorUrl = 'http://online.swagger.io/validator';
+ }
+ }
+ },
+
+ render: function(){
+ if (this.model.securityDefinitions) {
+ for (var name in this.model.securityDefinitions) {
+ var auth = this.model.securityDefinitions[name];
+ var button;
+
+ if (auth.type === 'apiKey' && $('#apikey_button').length === 0) {
+ button = new SwaggerUi.Views.ApiKeyButton({model: auth, router: this.router}).render().el;
+ $('.auth_main_container').append(button);
+ }
+
+ if (auth.type === 'basicAuth' && $('#basic_auth_button').length === 0) {
+ button = new SwaggerUi.Views.BasicAuthButton({model: auth, router: this.router}).render().el;
+ $('.auth_main_container').append(button);
+ }
+ }
+ }
+
+ // Render the outer container for resources
+ $(this.el).html(Handlebars.templates.main(this.model));
+
+ // Render each resource
+
+ var resources = {};
+ var counter = 0;
+ for (var i = 0; i < this.model.apisArray.length; i++) {
+ var resource = this.model.apisArray[i];
+ var id = resource.name;
+ while (typeof resources[id] !== 'undefined') {
+ id = id + '_' + counter;
+ counter += 1;
+ }
+ resource.id = id;
+ resources[id] = resource;
+ this.addResource(resource, this.model.auths);
+ }
+
+ $('.propWrap').hover(function onHover(){
+ $('.optionsWrapper', $(this)).show();
+ }, function offhover(){
+ $('.optionsWrapper', $(this)).hide();
+ });
+ return this;
+ },
+
+ addResource: function(resource, auths){
+ // Render a resource and add it to resources li
+ resource.id = resource.id.replace(/\s/g, '_');
+ var resourceView = new SwaggerUi.Views.ResourceView({
+ model: resource,
+ router: this.router,
+ tagName: 'li',
+ id: 'resource_' + resource.id,
+ className: 'resource',
+ auths: auths,
+ swaggerOptions: this.options.swaggerOptions
+ });
+ $('#resources', this.el).append(resourceView.render().el);
+ },
+
+ clear: function(){
+ $(this.el).html('');
+ }
+});
+
+'use strict';
+
+SwaggerUi.Views.OperationView = Backbone.View.extend({
+ invocationUrl: null,
+
+ events: {
+ 'submit .sandbox' : 'submitOperation',
+ 'click .submit' : 'submitOperation',
+ 'click .response_hider' : 'hideResponse',
+ 'click .toggleOperation' : 'toggleOperationContent',
+ 'mouseenter .api-ic' : 'mouseEnter',
+ 'dblclick .curl' : 'selectText',
+ },
+
+ initialize: function(opts) {
+ opts = opts || {};
+ this.router = opts.router;
+ this.auths = opts.auths;
+ this.parentId = this.model.parentId;
+ this.nickname = this.model.nickname;
+ this.model.encodedParentId = encodeURIComponent(this.parentId);
+ return this;
+ },
+
+ selectText: function(event) {
+ var doc = document,
+ text = event.target.firstChild,
+ range,
+ selection;
+ if (doc.body.createTextRange) {
+ range = document.body.createTextRange();
+ range.moveToElementText(text);
+ range.select();
+ } else if (window.getSelection) {
+ selection = window.getSelection();
+ range = document.createRange();
+ range.selectNodeContents(text);
+ selection.removeAllRanges();
+ selection.addRange(range);
+ }
+ },
+
+ mouseEnter: function(e) {
+ var elem = $(this.el).find('.content');
+ var x = e.pageX;
+ var y = e.pageY;
+ var scX = $(window).scrollLeft();
+ var scY = $(window).scrollTop();
+ var scMaxX = scX + $(window).width();
+ var scMaxY = scY + $(window).height();
+ var wd = elem.width();
+ var hgh = elem.height();
+
+ if (x + wd > scMaxX) {
+ x = scMaxX - wd;
+ }
+
+ if (x < scX) {
+ x = scX;
+ }
+
+ if (y + hgh > scMaxY) {
+ y = scMaxY - hgh;
+ }
+
+ if (y < scY) {
+ y = scY;
+ }
+
+ var pos = {};
+ pos.top = y;
+ pos.left = x;
+ elem.css(pos);
+ },
+
+ // Note: copied from CoffeeScript compiled file
+ // TODO: redactor
+ render: function() {
+ var a, auth, auths, code, contentTypeModel, isMethodSubmissionSupported, k, key, l, len, len1, len2, len3, len4, m, modelAuths, n, o, p, param, q, ref, ref1, ref2, ref3, ref4, ref5, responseContentTypeView, responseSignatureView, schema, schemaObj, scopeIndex, signatureModel, statusCode, successResponse, type, v, value;
+ isMethodSubmissionSupported = jQuery.inArray(this.model.method, this.model.supportedSubmitMethods()) >= 0;
+ if (!isMethodSubmissionSupported) {
+ this.model.isReadOnly = true;
+ }
+ this.model.description = this.model.description || this.model.notes;
+ this.model.oauth = null;
+ modelAuths = this.model.authorizations || this.model.security;
+ if (modelAuths) {
+ if (Array.isArray(modelAuths)) {
+ for (l = 0, len = modelAuths.length; l < len; l++) {
+ auths = modelAuths[l];
+ for (key in auths) {
+ for (a in this.auths) {
+ auth = this.auths[a];
+ if (key === auth.name) {
+ if (auth.type === 'oauth2') {
+ this.model.oauth = {};
+ this.model.oauth.scopes = [];
+ ref1 = auth.value.scopes;
+ for (k in ref1) {
+ v = ref1[k];
+ scopeIndex = auths[key].indexOf(k);
+ if (scopeIndex >= 0) {
+ o = {
+ scope: k,
+ description: v
+ };
+ this.model.oauth.scopes.push(o);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ } else {
+ for (k in modelAuths) {
+ v = modelAuths[k];
+ if (k === 'oauth2') {
+ if (this.model.oauth === null) {
+ this.model.oauth = {};
+ }
+ if (this.model.oauth.scopes === void 0) {
+ this.model.oauth.scopes = [];
+ }
+ for (m = 0, len1 = v.length; m < len1; m++) {
+ o = v[m];
+ this.model.oauth.scopes.push(o);
+ }
+ }
+ }
+ }
+ }
+ if (typeof this.model.responses !== 'undefined') {
+ this.model.responseMessages = [];
+ ref2 = this.model.responses;
+ for (code in ref2) {
+ value = ref2[code];
+ schema = null;
+ schemaObj = this.model.responses[code].schema;
+ if (schemaObj && schemaObj.$ref) {
+ schema = schemaObj.$ref;
+ if (schema.indexOf('#/definitions/') !== -1) {
+ schema = schema.replace(/^.*#\/definitions\//, '');
+ }
+ }
+ this.model.responseMessages.push({
+ code: code,
+ message: value.description,
+ responseModel: schema
+ });
+ }
+ }
+ if (typeof this.model.responseMessages === 'undefined') {
+ this.model.responseMessages = [];
+ }
+ signatureModel = null;
+ if (this.model.successResponse) {
+ successResponse = this.model.successResponse;
+ for (key in successResponse) {
+ value = successResponse[key];
+ this.model.successCode = key;
+ if (typeof value === 'object' && typeof value.createJSONSample === 'function') {
+ signatureModel = {
+ sampleJSON: JSON.stringify(value.createJSONSample(), void 0, 2),
+ isParam: false,
+ signature: value.getMockSignature()
+ };
+ }
+ }
+ } else if (this.model.responseClassSignature && this.model.responseClassSignature !== 'string') {
+ signatureModel = {
+ sampleJSON: this.model.responseSampleJSON,
+ isParam: false,
+ signature: this.model.responseClassSignature
+ };
+ }
+ var opts = this.options.swaggerOptions;
+ if (opts.showRequestHeaders) {
+ this.model.showRequestHeaders = true;
+ }
+ $(this.el).html(Handlebars.templates.operation(this.model));
+ if (signatureModel) {
+ responseSignatureView = new SwaggerUi.Views.SignatureView({
+ model: signatureModel,
+ router: this.router,
+ tagName: 'div'
+ });
+ $('.model-signature', $(this.el)).append(responseSignatureView.render().el);
+ } else {
+ this.model.responseClassSignature = 'string';
+ $('.model-signature', $(this.el)).html(this.model.type);
+ }
+ contentTypeModel = {
+ isParam: false
+ };
+ contentTypeModel.consumes = this.model.consumes;
+ contentTypeModel.produces = this.model.produces;
+ ref3 = this.model.parameters;
+ for (n = 0, len2 = ref3.length; n < len2; n++) {
+ param = ref3[n];
+ type = param.type || param.dataType || '';
+ if (typeof type === 'undefined') {
+ schema = param.schema;
+ if (schema && schema.$ref) {
+ ref = schema.$ref;
+ if (ref.indexOf('#/definitions/') === 0) {
+ type = ref.substring('#/definitions/'.length);
+ } else {
+ type = ref;
+ }
+ }
+ }
+ if (type && type.toLowerCase() === 'file') {
+ if (!contentTypeModel.consumes) {
+ contentTypeModel.consumes = 'multipart/form-data';
+ }
+ }
+ param.type = type;
+ }
+ responseContentTypeView = new SwaggerUi.Views.ResponseContentTypeView({
+ model: contentTypeModel,
+ router: this.router
+ });
+ $('.response-content-type', $(this.el)).append(responseContentTypeView.render().el);
+ ref4 = this.model.parameters;
+ for (p = 0, len3 = ref4.length; p < len3; p++) {
+ param = ref4[p];
+ this.addParameter(param, contentTypeModel.consumes);
+ }
+ ref5 = this.model.responseMessages;
+ for (q = 0, len4 = ref5.length; q < len4; q++) {
+ statusCode = ref5[q];
+ this.addStatusCode(statusCode);
+ }
+ return this;
+ },
+
+ addParameter: function(param, consumes) {
+ // Render a parameter
+ param.consumes = consumes;
+ var paramView = new SwaggerUi.Views.ParameterView({
+ model: param,
+ tagName: 'tr',
+ readOnly: this.model.isReadOnly
+ });
+ $('.operation-params', $(this.el)).append(paramView.render().el);
+ },
+
+ addStatusCode: function(statusCode) {
+ // Render status codes
+ var statusCodeView = new SwaggerUi.Views.StatusCodeView({
+ model: statusCode,
+ tagName: 'tr',
+ router: this.router
+ });
+ $('.operation-status', $(this.el)).append(statusCodeView.render().el);
+ },
+
+ // Note: copied from CoffeeScript compiled file
+ // TODO: redactor
+ submitOperation: function(e) {
+ var error_free, form, isFileUpload, map, opts;
+ if (e !== null) {
+ e.preventDefault();
+ }
+ form = $('.sandbox', $(this.el));
+ error_free = true;
+ form.find('input.required').each(function() {
+ $(this).removeClass('error');
+ if (jQuery.trim($(this).val()) === '') {
+ $(this).addClass('error');
+ $(this).wiggle({
+ callback: (function(_this) {
+ return function() {
+ $(_this).focus();
+ };
+ })(this)
+ });
+ error_free = false;
+ }
+ });
+ form.find('textarea.required').each(function() {
+ $(this).removeClass('error');
+ if (jQuery.trim($(this).val()) === '') {
+ $(this).addClass('error');
+ $(this).wiggle({
+ callback: (function(_this) {
+ return function() {
+ return $(_this).focus();
+ };
+ })(this)
+ });
+ error_free = false;
+ }
+ });
+ form.find('select.required').each(function() {
+ $(this).removeClass('error');
+ if (this.selectedIndex === -1) {
+ $(this).addClass('error');
+ $(this).wiggle({
+ callback: (function(_this) {
+ return function() {
+ $(_this).focus();
+ };
+ })(this)
+ });
+ error_free = false;
+ }
+ });
+ if (error_free) {
+ map = this.getInputMap(form);
+ isFileUpload = this.isFileUpload(form);
+ opts = {
+ parent: this
+ };
+ if (this.options.swaggerOptions) {
+ for(var key in this.options.swaggerOptions) {
+ opts[key] = this.options.swaggerOptions[key];
+ }
+ }
+ opts.responseContentType = $('div select[name=responseContentType]', $(this.el)).val();
+ opts.requestContentType = $('div select[name=parameterContentType]', $(this.el)).val();
+ $('.response_throbber', $(this.el)).show();
+ if (isFileUpload) {
+ $('.request_url', $(this.el)).html('<pre></pre>');
+ $('.request_url pre', $(this.el)).text(this.invocationUrl);
+
+ opts.useJQuery = true;
+ map.parameterContentType = 'multipart/form-data';
+
+ return this.model.execute(map, opts, this.showCompleteStatus, this.showErrorStatus, this);
+ } else {
+ this.map = map;
+ return this.model.execute(map, opts, this.showCompleteStatus, this.showErrorStatus, this);
+ }
+ }
+ },
+
+ getInputMap: function (form) {
+ var map, ref1, l, len, o, ref2, m, len1, val, ref3, n, len2;
+ map = {};
+ ref1 = form.find('input');
+ for (l = 0, len = ref1.length; l < len; l++) {
+ o = ref1[l];
+ if ((o.value !== null) && jQuery.trim(o.value).length > 0) {
+ map[o.name] = o.value;
+ }
+ if (o.type === 'file') {
+ map[o.name] = o.files[0];
+ }
+ }
+ ref2 = form.find('textarea');
+ for (m = 0, len1 = ref2.length; m < len1; m++) {
+ o = ref2[m];
+ val = this.getTextAreaValue(o);
+ if ((val !== null) && jQuery.trim(val).length > 0) {
+ map[o.name] = val;
+ }
+ }
+ ref3 = form.find('select');
+ for (n = 0, len2 = ref3.length; n < len2; n++) {
+ o = ref3[n];
+ val = this.getSelectedValue(o);
+ if ((val !== null) && jQuery.trim(val).length > 0) {
+ map[o.name] = val;
+ }
+ }
+ return map;
+ },
+
+ isFileUpload: function (form) {
+ var ref1, l, len, o;
+ var isFileUpload = false;
+ ref1 = form.find('input');
+ for (l = 0, len = ref1.length; l < len; l++) {
+ o = ref1[l];
+ if (o.type === 'file') {
+ isFileUpload = true;
+ }
+ }
+ return isFileUpload;
+ },
+
+ success: function(response, parent) {
+ parent.showCompleteStatus(response);
+ },
+
+ // wraps a jquery response as a shred response
+ wrap: function(data) {
+ var h, headerArray, headers, i, l, len, o;
+ headers = {};
+ headerArray = data.getAllResponseHeaders().split('\r');
+ for (l = 0, len = headerArray.length; l < len; l++) {
+ i = headerArray[l];
+ h = i.match(/^([^:]*?):(.*)$/);
+ if (!h) {
+ h = [];
+ }
+ h.shift();
+ if (h[0] !== void 0 && h[1] !== void 0) {
+ headers[h[0].trim()] = h[1].trim();
+ }
+ }
+ o = {};
+ o.content = {};
+ o.content.data = data.responseText;
+ o.headers = headers;
+ o.request = {};
+ o.request.url = this.invocationUrl;
+ o.status = data.status;
+ return o;
+ },
+
+ getSelectedValue: function(select) {
+ if (!select.multiple) {
+ return select.value;
+ } else {
+ var options = [];
+ for (var l = 0, len = select.options.length; l < len; l++) {
+ var opt = select.options[l];
+ if (opt.selected) {
+ options.push(opt.value);
+ }
+ }
+ if (options.length > 0) {
+ return options;
+ } else {
+ return null;
+ }
+ }
+ },
+
+ // handler for hide response link
+ hideResponse: function(e) {
+ if (e) { e.preventDefault(); }
+ $('.response', $(this.el)).slideUp();
+ $('.response_hider', $(this.el)).fadeOut();
+ },
+
+ // Show response from server
+ showResponse: function(response) {
+ var prettyJson = JSON.stringify(response, null, '\t').replace(/\n/g, '<br>');
+ $('.response_body', $(this.el)).html(_.escape(prettyJson));
+ },
+
+ // Show error from server
+ showErrorStatus: function(data, parent) {
+ parent.showStatus(data);
+ },
+
+ // show the status codes
+ showCompleteStatus: function(data, parent){
+ parent.showStatus(data);
+ },
+
+ // Adapted from http://stackoverflow.com/a/2893259/454004
+ // Note: directly ported from CoffeeScript
+ // TODO: Cleanup CoffeeScript artifacts
+ formatXml: function(xml) {
+ var contexp, fn, formatted, indent, l, lastType, len, lines, ln, pad, reg, transitions, wsexp;
+ reg = /(>)(<)(\/*)/g;
+ wsexp = /[ ]*(.*)[ ]+\n/g;
+ contexp = /(<.+>)(.+\n)/g;
+ xml = xml.replace(reg, '$1\n$2$3').replace(wsexp, '$1\n').replace(contexp, '$1\n$2');
+ pad = 0;
+ formatted = '';
+ lines = xml.split('\n');
+ indent = 0;
+ lastType = 'other';
+ transitions = {
+ 'single->single': 0,
+ 'single->closing': -1,
+ 'single->opening': 0,
+ 'single->other': 0,
+ 'closing->single': 0,
+ 'closing->closing': -1,
+ 'closing->opening': 0,
+ 'closing->other': 0,
+ 'opening->single': 1,
+ 'opening->closing': 0,
+ 'opening->opening': 1,
+ 'opening->other': 1,
+ 'other->single': 0,
+ 'other->closing': -1,
+ 'other->opening': 0,
+ 'other->other': 0
+ };
+ fn = function(ln) {
+ var fromTo, j, key, padding, type, types, value;
+ types = {
+ single: Boolean(ln.match(/<.+\/>/)),
+ closing: Boolean(ln.match(/<\/.+>/)),
+ opening: Boolean(ln.match(/<[^!?].*>/))
+ };
+ type = ((function() {
+ var results;
+ results = [];
+ for (key in types) {
+ value = types[key];
+ if (value) {
+ results.push(key);
+ }
+ }
+ return results;
+ })())[0];
+ type = type === void 0 ? 'other' : type;
+ fromTo = lastType + '->' + type;
+ lastType = type;
+ padding = '';
+ indent += transitions[fromTo];
+ padding = ((function() {
+ var m, ref1, results;
+ results = [];
+ for (j = m = 0, ref1 = indent; 0 <= ref1 ? m < ref1 : m > ref1; j = 0 <= ref1 ? ++m : --m) {
+ results.push(' ');
+ }
+ return results;
+ })()).join('');
+ if (fromTo === 'opening->closing') {
+ formatted = formatted.substr(0, formatted.length - 1) + ln + '\n';
+ } else {
+ formatted += padding + ln + '\n';
+ }
+ };
+ for (l = 0, len = lines.length; l < len; l++) {
+ ln = lines[l];
+ fn(ln);
+ }
+ return formatted;
+ },
+
+ // puts the response data in UI
+ showStatus: function(response) {
+ var url, content;
+ if (response.content === undefined) {
+ content = response.data;
+ url = response.url;
+ } else {
+ content = response.content.data;
+ url = response.request.url;
+ }
+ var headers = response.headers;
+ content = jQuery.trim(content);
+
+ // if server is nice, and sends content-type back, we can use it
+ var contentType = null;
+ if (headers) {
+ contentType = headers['Content-Type'] || headers['content-type'];
+ if (contentType) {
+ contentType = contentType.split(';')[0].trim();
+ }
+ }
+ $('.response_body', $(this.el)).removeClass('json');
+ $('.response_body', $(this.el)).removeClass('xml');
+
+ var supportsAudioPlayback = function(contentType){
+ var audioElement = document.createElement('audio');
+ return !!(audioElement.canPlayType && audioElement.canPlayType(contentType).replace(/no/, ''));
+ };
+
+ var pre;
+ var code;
+ if (!content) {
+ code = $('<code />').text('no content');
+ pre = $('<pre class="json" />').append(code);
+
+ // JSON
+ } else if (contentType === 'application/json' || /\+json$/.test(contentType)) {
+ var json = null;
+ try {
+ json = JSON.stringify(JSON.parse(content), null, ' ');
+ } catch (_error) {
+ json = 'can\'t parse JSON. Raw result:\n\n' + content;
+ }
+ code = $('<code />').text(json);
+ pre = $('<pre class="json" />').append(code);
+
+ // XML
+ } else if (contentType === 'application/xml' || /\+xml$/.test(contentType)) {
+ code = $('<code />').text(this.formatXml(content));
+ pre = $('<pre class="xml" />').append(code);
+
+ // HTML
+ } else if (contentType === 'text/html') {
+ code = $('<code />').html(_.escape(content));
+ pre = $('<pre class="xml" />').append(code);
+
+ // Plain Text
+ } else if (/text\/plain/.test(contentType)) {
+ code = $('<code />').text(content);
+ pre = $('<pre class="plain" />').append(code);
+
+
+ // Image
+ } else if (/^image\//.test(contentType)) {
+ pre = $('<img>').attr('src', url);
+
+ // Audio
+ } else if (/^audio\//.test(contentType) && supportsAudioPlayback(contentType)) {
+ pre = $('<audio controls>').append($('<source>').attr('src', url).attr('type', contentType));
+
+ // Download
+ } else if (headers['Content-Disposition'] && (/attachment/).test(headers['Content-Disposition']) ||
+ headers['content-disposition'] && (/attachment/).test(headers['content-disposition']) ||
+ headers['Content-Description'] && (/File Transfer/).test(headers['Content-Description']) ||
+ headers['content-description'] && (/File Transfer/).test(headers['content-description'])) {
+
+ if ('Blob' in window) {
+ var type = contentType || 'text/html';
+ var blob = new Blob([content], {type: type});
+ var a = document.createElement('a');
+ var href = window.URL.createObjectURL(blob);
+ var fileName = response.url.substr(response.url.lastIndexOf('/') + 1);
+ var download = [type, fileName, href].join(':');
+
+ a.setAttribute('href', href);
+ a.setAttribute('download', download);
+ a.innerText = 'Download ' + fileName;
+
+ pre = $('<div/>').append(a);
+ } else {
+ pre = $('<pre class="json" />').append('Download headers detected but your browser does not support downloading binary via XHR (Blob).');
+ }
+
+ // Location header based redirect download
+ } else if(headers.location || headers.Location) {
+ window.location = response.url;
+
+ // Anything else (CORS)
+ } else {
+ code = $('<code />').text(content);
+ pre = $('<pre class="json" />').append(code);
+ }
+ var response_body = pre;
+ $('.request_url', $(this.el)).html('<pre></pre>');
+ $('.request_url pre', $(this.el)).text(url);
+ $('.response_code', $(this.el)).html('<pre>' + response.status + '</pre>');
+ $('.response_body', $(this.el)).html(response_body);
+ $('.response_headers', $(this.el)).html('<pre>' + _.escape(JSON.stringify(response.headers, null, ' ')).replace(/\n/g, '<br>') + '</pre>');
+ $('.response', $(this.el)).slideDown();
+ $('.response_hider', $(this.el)).show();
+ $('.response_throbber', $(this.el)).hide();
+
+
+ //adds curl output
+ var curlCommand = this.model.asCurl(this.map);
+ curlCommand = curlCommand.replace('!', '&#33;');
+ $( '.curl', $(this.el)).html('<pre>' + curlCommand + '</pre>');
+
+ // only highlight the response if response is less than threshold, default state is highlight response
+ var opts = this.options.swaggerOptions;
+
+ if (opts.showRequestHeaders) {
+ var form = $('.sandbox', $(this.el)),
+ map = this.getInputMap(form),
+ requestHeaders = this.model.getHeaderParams(map);
+ delete requestHeaders['Content-Type'];
+ $('.request_headers', $(this.el)).html('<pre>' + _.escape(JSON.stringify(requestHeaders, null, ' ')).replace(/\n/g, '<br>') + '</pre>');
+ }
+
+ var response_body_el = $('.response_body', $(this.el))[0];
+ // only highlight the response if response is less than threshold, default state is highlight response
+ if (opts.highlightSizeThreshold && typeof response.data !== 'undefined' && response.data.length > opts.highlightSizeThreshold) {
+ return response_body_el;
+ } else {
+ return hljs.highlightBlock(response_body_el);
+ }
+ },
+
+ toggleOperationContent: function (event) {
+ var elem = $('#' + Docs.escapeResourceName(this.parentId + '_' + this.nickname + '_content'));
+ if (elem.is(':visible')){
+ event.preventDefault();
+ $.bbq.pushState('#/', 2);
+ Docs.collapseOperation(elem);
+ } else {
+ event.preventDefault();
+ Docs.expandOperation(elem);
+ }
+ },
+
+ getTextAreaValue: function(textArea) {
+ var param, parsed, result, i;
+ if (textArea.value === null || jQuery.trim(textArea.value).length === 0) {
+ return null;
+ }
+ param = this.getParamByName(textArea.name);
+ if (param && param.type && param.type.toLowerCase() === 'array') {
+ parsed = textArea.value.split('\n');
+ result = [];
+ for (i = 0; i < parsed.length; i++) {
+ if (parsed[i] !== null && jQuery.trim(parsed[i]).length > 0) {
+ result.push(parsed[i]);
+ }
+ }
+ return result.length > 0 ? result : null;
+ } else {
+ return textArea.value;
+ }
+ },
+
+ getParamByName: function(name) {
+ var i;
+ if (this.model.parameters) {
+ for(i = 0; i < this.model.parameters.length; i++) {
+ if (this.model.parameters[i].name === name) {
+ return this.model.parameters[i];
+ }
+ }
+ }
+ return null;
+ }
+
+});
+
+'use strict';
+
+SwaggerUi.Views.ParameterContentTypeView = Backbone.View.extend({
+ initialize: function () {},
+
+ render: function(){
+ this.model.parameterContentTypeId = 'pct' + Math.random();
+ $(this.el).html(Handlebars.templates.parameter_content_type(this.model));
+ return this;
+ }
+
+});
+'use strict';
+
+SwaggerUi.Views.ParameterView = Backbone.View.extend({
+ initialize: function(){
+ Handlebars.registerHelper('isArray', function(param, opts) {
+ if (param.type.toLowerCase() === 'array' || param.allowMultiple) {
+ return opts.fn(this);
+ } else {
+ return opts.inverse(this);
+ }
+ });
+ },
+
+ render: function() {
+ var type = this.model.type || this.model.dataType;
+
+ if (typeof type === 'undefined') {
+ var schema = this.model.schema;
+ if (schema && schema.$ref) {
+ var ref = schema.$ref;
+ if (ref.indexOf('#/definitions/') === 0) {
+ type = ref.substring('#/definitions/'.length);
+ } else {
+ type = ref;
+ }
+ }
+ }
+
+ this.model.type = type;
+ this.model.paramType = this.model.in || this.model.paramType;
+ this.model.isBody = this.model.paramType === 'body' || this.model.in === 'body';
+ this.model.isFile = type && type.toLowerCase() === 'file';
+
+ // Allow for default === false
+ if(typeof this.model.default === 'undefined') {
+ this.model.default = this.model.defaultValue;
+ }
+
+ this.model.hasDefault = (typeof this.model.default !== 'undefined');
+ this.model.valueId = 'm' + this.model.name + Math.random();
+
+ if (this.model.allowableValues) {
+ this.model.isList = true;
+ }
+
+ var template = this.template();
+ $(this.el).html(template(this.model));
+
+ var signatureModel = {
+ sampleJSON: this.model.sampleJSON,
+ isParam: true,
+ signature: this.model.signature
+ };
+
+ if (this.model.sampleJSON) {
+ var signatureView = new SwaggerUi.Views.SignatureView({model: signatureModel, tagName: 'div'});
+ $('.model-signature', $(this.el)).append(signatureView.render().el);
+ }
+ else {
+ $('.model-signature', $(this.el)).html(this.model.signature);
+ }
+
+ var isParam = false;
+
+ if (this.model.isBody) {
+ isParam = true;
+ }
+
+ var contentTypeModel = {
+ isParam: isParam
+ };
+
+ contentTypeModel.consumes = this.model.consumes;
+
+ if (isParam) {
+ var parameterContentTypeView = new SwaggerUi.Views.ParameterContentTypeView({model: contentTypeModel});
+ $('.parameter-content-type', $(this.el)).append(parameterContentTypeView.render().el);
+ }
+
+ else {
+ var responseContentTypeView = new SwaggerUi.Views.ResponseContentTypeView({model: contentTypeModel});
+ $('.response-content-type', $(this.el)).append(responseContentTypeView.render().el);
+ }
+
+ return this;
+ },
+
+ // Return an appropriate template based on if the parameter is a list, readonly, required
+ template: function(){
+ if (this.model.isList) {
+ return Handlebars.templates.param_list;
+ } else {
+ if (this.options.readOnly) {
+ if (this.model.required) {
+ return Handlebars.templates.param_readonly_required;
+ } else {
+ return Handlebars.templates.param_readonly;
+ }
+ } else {
+ if (this.model.required) {
+ return Handlebars.templates.param_required;
+ } else {
+ return Handlebars.templates.param;
+ }
+ }
+ }
+ }
+});
+
+'use strict';
+
+SwaggerUi.Views.ResourceView = Backbone.View.extend({
+ initialize: function(opts) {
+ opts = opts || {};
+ this.router = opts.router;
+ this.auths = opts.auths;
+ if ('' === this.model.description) {
+ this.model.description = null;
+ }
+ if (this.model.description) {
+ this.model.summary = this.model.description;
+ }
+ },
+
+ render: function(){
+ var methods = {};
+
+
+ $(this.el).html(Handlebars.templates.resource(this.model));
+
+ // Render each operation
+ for (var i = 0; i < this.model.operationsArray.length; i++) {
+ var operation = this.model.operationsArray[i];
+ var counter = 0;
+ var id = operation.nickname;
+
+ while (typeof methods[id] !== 'undefined') {
+ id = id + '_' + counter;
+ counter += 1;
+ }
+
+ methods[id] = operation;
+
+ operation.nickname = id;
+ operation.parentId = this.model.id;
+ this.addOperation(operation);
+ }
+
+ $('.toggleEndpointList', this.el).click(this.callDocs.bind(this, 'toggleEndpointListForResource'));
+ $('.collapseResource', this.el).click(this.callDocs.bind(this, 'collapseOperationsForResource'));
+ $('.expandResource', this.el).click(this.callDocs.bind(this, 'expandOperationsForResource'));
+
+ return this;
+ },
+
+ addOperation: function(operation) {
+
+ operation.number = this.number;
+
+ // Render an operation and add it to operations li
+ var operationView = new SwaggerUi.Views.OperationView({
+ model: operation,
+ router: this.router,
+ tagName: 'li',
+ className: 'endpoint',
+ swaggerOptions: this.options.swaggerOptions,
+ auths: this.auths
+ });
+
+ $('.endpoints', $(this.el)).append(operationView.render().el);
+
+ this.number++;
+
+ },
+ // Generic Event handler (`Docs` is global)
+
+
+ callDocs: function(fnName, e) {
+ e.preventDefault();
+ Docs[fnName](e.currentTarget.getAttribute('data-id'));
+ }
+});
+'use strict';
+
+SwaggerUi.Views.ResponseContentTypeView = Backbone.View.extend({
+ initialize: function(){},
+
+ render: function(){
+ this.model.responseContentTypeId = 'rct' + Math.random();
+ $(this.el).html(Handlebars.templates.response_content_type(this.model));
+ return this;
+ }
+});
+'use strict';
+
+SwaggerUi.Views.SignatureView = Backbone.View.extend({
+ events: {
+ 'click a.description-link' : 'switchToDescription',
+ 'click a.snippet-link' : 'switchToSnippet',
+ 'mousedown .snippet' : 'snippetToTextArea'
+ },
+
+ initialize: function () {
+
+ },
+
+ render: function(){
+
+ $(this.el).html(Handlebars.templates.signature(this.model));
+
+ this.switchToSnippet();
+
+ this.isParam = this.model.isParam;
+
+ if (this.isParam) {
+ $('.notice', $(this.el)).text('Click to set as parameter value');
+ }
+
+ return this;
+ },
+
+ // handler for show signature
+ switchToDescription: function(e){
+ if (e) { e.preventDefault(); }
+
+ $('.snippet', $(this.el)).hide();
+ $('.description', $(this.el)).show();
+ $('.description-link', $(this.el)).addClass('selected');
+ $('.snippet-link', $(this.el)).removeClass('selected');
+ },
+
+ // handler for show sample
+ switchToSnippet: function(e){
+ if (e) { e.preventDefault(); }
+
+ $('.description', $(this.el)).hide();
+ $('.snippet', $(this.el)).show();
+ $('.snippet-link', $(this.el)).addClass('selected');
+ $('.description-link', $(this.el)).removeClass('selected');
+ },
+
+ // handler for snippet to text area
+ snippetToTextArea: function(e) {
+ if (this.isParam) {
+ if (e) { e.preventDefault(); }
+
+ var textArea = $('textarea', $(this.el.parentNode.parentNode.parentNode));
+
+ // Fix for bug in IE 10/11 which causes placeholder text to be copied to "value"
+ if ($.trim(textArea.val()) === '' || textArea.prop('placeholder') === textArea.val()) {
+ textArea.val(this.model.sampleJSON);
+ }
+ }
+ }
+});
+'use strict';
+
+SwaggerUi.Views.StatusCodeView = Backbone.View.extend({
+ initialize: function (opts) {
+ this.options = opts || {};
+ this.router = this.options.router;
+ },
+
+ render: function(){
+ $(this.el).html(Handlebars.templates.status_code(this.model));
+
+ if (this.router.api.models.hasOwnProperty(this.model.responseModel)) {
+ var responseModel = {
+ sampleJSON: JSON.stringify(this.router.api.models[this.model.responseModel].createJSONSample(), null, 2),
+ isParam: false,
+ signature: this.router.api.models[this.model.responseModel].getMockSignature(),
+ };
+
+ var responseModelView = new SwaggerUi.Views.SignatureView({model: responseModel, tagName: 'div'});
+ $('.model-signature', this.$el).append(responseModelView.render().el);
+ } else {
+ $('.model-signature', this.$el).html('');
+ }
+ return this;
+ }
+});}).call(this);
diff --git a/openecomp-be/tools/swagger-ui/swagger-ui.min.js b/openecomp-be/tools/swagger-ui/swagger-ui.min.js
new file mode 100644
index 0000000000..56bc1ff238
--- /dev/null
+++ b/openecomp-be/tools/swagger-ui/swagger-ui.min.js
@@ -0,0 +1,32 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+(function(){function e(){e.history=e.history||[],e.history.push(arguments),this.console&&console.log(Array.prototype.slice.call(arguments)[0])}this.Handlebars=this.Handlebars||{},this.Handlebars.templates=this.Handlebars.templates||{},this.Handlebars.templates.apikey_button_view=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return"<!--div class='auth_button' id='apikey_button'><img class='auth_icon' alt='apply api key' src='images/apikey.jpeg'></div-->\n<div class='auth_container' id='apikey_container'>\n <div class='key_input_container'>\n <div class='auth_label'><label for='input_apiKey_entry'>"+s((i=null!=(i=t.keyName||(null!=e?e.keyName:e))?i:o,typeof i===a?i.call(e,{name:"keyName",hash:{},data:r}):i))+"</label></div>\n <input placeholder='api_key' class='auth_input' id='input_apiKey_entry' name='apiKey' type='text'/>\n <div class='auth_submit'><a class='auth_submit_button' id='apply_api_key' href='#' data-sw-translate>apply</a></div>\n </div>\n</div>\n"},useData:!0}),this.Handlebars.templates.basic_auth_button_view=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){return'<div class=\'auth_button\' id=\'basic_auth_button\'><img class=\'auth_icon\' src=\'images/password.jpeg\'></div>\n<div class=\'auth_container\' id=\'basic_auth_container\'>\n <div class=\'key_input_container\'>\n <div class="auth_label"><label for="input_username" data-sw-translate>Username</label></div>\n <input placeholder="username" class="auth_input" id="input_username" name="username" type="text"/>\n <div class="auth_label"><label for="password" data-sw-translate>Password</label></div>\n <input placeholder="password" class="auth_input" id="input_password" name="password" type="password"/>\n <div class=\'auth_submit\'><a class=\'auth_submit_button\' id="apply_basic_auth" href="#">apply</a></div>\n </div>\n</div>\n\n'},useData:!0}),this.Handlebars.templates.content_type=Handlebars.template({1:function(e,t,n,r){var i,a="";return i=t.each.call(e,null!=e?e.produces:e,{name:"each",hash:{},fn:this.program(2,r),inverse:this.noop,data:r}),null!=i&&(a+=i),a},2:function(e,t,n,r){var i,a=this.lambda,o=' <option value="';return i=a(e,e),null!=i&&(o+=i),o+='">',i=a(e,e),null!=i&&(o+=i),o+"</option>\n"},4:function(e,t,n,r){return' <option value="application/json">application/json</option>\n'},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,l=this.escapeExpression,u='<label data-sw-translate for="'+l((a=null!=(a=t.contentTypeId||(null!=e?e.contentTypeId:e))?a:s,typeof a===o?a.call(e,{name:"contentTypeId",hash:{},data:r}):a))+'">Response Content Type</label>\n<select name="contentType" id="'+l((a=null!=(a=t.contentTypeId||(null!=e?e.contentTypeId:e))?a:s,typeof a===o?a.call(e,{name:"contentTypeId",hash:{},data:r}):a))+'">\n';return i=t["if"].call(e,null!=e?e.produces:e,{name:"if",hash:{},fn:this.program(1,r),inverse:this.program(4,r),data:r}),null!=i&&(u+=i),u+"</select>\n"},useData:!0}),$(function(){$.fn.vAlign=function(){return this.each(function(){var e=$(this).height(),t=$(this).parent().height(),n=(t-e)/2;$(this).css("margin-top",n)})},$.fn.stretchFormtasticInputWidthToParent=function(){return this.each(function(){var e=$(this).closest("form").innerWidth(),t=parseInt($(this).closest("form").css("padding-left"),10)+parseInt($(this).closest("form").css("padding-right"),10),n=parseInt($(this).css("padding-left"),10)+parseInt($(this).css("padding-right"),10);$(this).css("width",e-t-n)})},$("form.formtastic li.string input, form.formtastic textarea").stretchFormtasticInputWidthToParent(),$("ul.downplayed li div.content p").vAlign(),$("form.sandbox").submit(function(){var e=!0;return $(this).find("input.required").each(function(){$(this).removeClass("error"),""===$(this).val()&&($(this).addClass("error"),$(this).wiggle(),e=!1)}),e})}),Function.prototype.bind&&console&&"object"==typeof console.log&&["log","info","warn","error","assert","dir","clear","profile","profileEnd"].forEach(function(e){console[e]=this.bind(console[e],console)},Function.prototype.call),window.Docs={shebang:function(){var e=$.param.fragment().split("/");switch(e.shift(),e.length){case 1:if(e[0].length>0){var t="resource_"+e[0];Docs.expandEndpointListForResource(e[0]),$("#"+t).slideto({highlight:!1})}break;case 2:Docs.expandEndpointListForResource(e[0]),$("#"+t).slideto({highlight:!1});var n=e.join("_"),r=n+"_content";Docs.expandOperation($("#"+r)),$("#"+n).slideto({highlight:!1})}},toggleEndpointListForResource:function(e){var t=$("li#resource_"+Docs.escapeResourceName(e)+" ul.endpoints");t.is(":visible")?Docs.collapseEndpointListForResource(e):Docs.expandEndpointListForResource(e)},expandEndpointListForResource:function(e){var e=Docs.escapeResourceName(e);if(""==e)return void $(".resource ul.endpoints").slideDown();$("li#resource_"+e).addClass("active");var t=$("li#resource_"+e+" ul.endpoints");t.slideDown()},collapseEndpointListForResource:function(e){var e=Docs.escapeResourceName(e);if(""==e)return void $(".resource ul.endpoints").slideUp();$("li#resource_"+e).removeClass("active");var t=$("li#resource_"+e+" ul.endpoints");t.slideUp()},expandOperationsForResource:function(e){return Docs.expandEndpointListForResource(e),""==e?void $(".resource ul.endpoints li.operation div.content").slideDown():void $("li#resource_"+Docs.escapeResourceName(e)+" li.operation div.content").each(function(){Docs.expandOperation($(this))})},collapseOperationsForResource:function(e){return Docs.expandEndpointListForResource(e),""==e?void $(".resource ul.endpoints li.operation div.content").slideUp():void $("li#resource_"+Docs.escapeResourceName(e)+" li.operation div.content").each(function(){Docs.collapseOperation($(this))})},escapeResourceName:function(e){return e.replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]\^`{|}~]/g,"\\$&")},expandOperation:function(e){e.slideDown()},collapseOperation:function(e){e.slideUp()}},Handlebars.registerHelper("sanitize",function(e){return e=e.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,""),new Handlebars.SafeString(e)}),Handlebars.registerHelper("renderTextParam",function(e){var t,n="text",r="",i="array"===e.type.toLowerCase()||e.allowMultiple,a=i&&Array.isArray(e["default"])?e["default"].join("\n"):e["default"],o=Object.keys(e).filter(function(e){return null!==e.match(/^X-data-/i)}).reduce(function(t,n){return t+=" "+n.substring(2,n.length)+"='"+e[n]+"'"},"");if("undefined"==typeof a&&(a=""),e.format&&"password"===e.format&&(n="password"),e.valueId&&(r=" id='"+e.valueId+"'"),i)t="<textarea class='body-textarea"+(e.required?" required":"")+"' name='"+e.name+"'"+r+o,t+=" placeholder='Provide multiple values in new lines"+(e.required?" (at least one required).":".")+"'>",t+=a+"</textarea>";else{var s="parameter";e.required&&(s+=" required"),t="<input class='"+s+"' minlength='"+(e.required?1:0)+"'",t+=" name='"+e.name+"' placeholder='"+(e.required?"(required)":"")+"'"+r+o,t+=" type='"+n+"' value='"+a+"'/>"}return new Handlebars.SafeString(t)}),this.Handlebars.templates.main=Handlebars.template({1:function(e,t,n,r){var i,a=this.lambda,o=this.escapeExpression,s=' <div class="info_title">'+o(a(null!=(i=null!=e?e.info:e)?i.title:i,e))+'</div>\n <div class="info_description markdown">';return i=a(null!=(i=null!=e?e.info:e)?i.description:i,e),null!=i&&(s+=i),s+="</div>\n",i=t["if"].call(e,null!=e?e.externalDocs:e,{name:"if",hash:{},fn:this.program(2,r),inverse:this.noop,data:r}),null!=i&&(s+=i),s+=" ",i=t["if"].call(e,null!=(i=null!=e?e.info:e)?i.termsOfServiceUrl:i,{name:"if",hash:{},fn:this.program(4,r),inverse:this.noop,data:r}),null!=i&&(s+=i),s+="\n ",i=t["if"].call(e,null!=(i=null!=(i=null!=e?e.info:e)?i.contact:i)?i.name:i,{name:"if",hash:{},fn:this.program(6,r),inverse:this.noop,data:r}),null!=i&&(s+=i),s+="\n ",i=t["if"].call(e,null!=(i=null!=(i=null!=e?e.info:e)?i.contact:i)?i.url:i,{name:"if",hash:{},fn:this.program(8,r),inverse:this.noop,data:r}),null!=i&&(s+=i),s+="\n ",i=t["if"].call(e,null!=(i=null!=(i=null!=e?e.info:e)?i.contact:i)?i.email:i,{name:"if",hash:{},fn:this.program(10,r),inverse:this.noop,data:r}),null!=i&&(s+=i),s+="\n ",i=t["if"].call(e,null!=(i=null!=e?e.info:e)?i.license:i,{name:"if",hash:{},fn:this.program(12,r),inverse:this.noop,data:r}),null!=i&&(s+=i),s+"\n"},2:function(e,t,n,r){var i,a=this.lambda,o=this.escapeExpression;return" <p>"+o(a(null!=(i=null!=e?e.externalDocs:e)?i.description:i,e))+'</p>\n <a href="'+o(a(null!=(i=null!=e?e.externalDocs:e)?i.url:i,e))+'" target="_blank">'+o(a(null!=(i=null!=e?e.externalDocs:e)?i.url:i,e))+"</a>\n"},4:function(e,t,n,r){var i,a=this.lambda,o=this.escapeExpression;return'<div class="info_tos"><a href="'+o(a(null!=(i=null!=e?e.info:e)?i.termsOfServiceUrl:i,e))+'" data-sw-translate>Terms of service</a></div>'},6:function(e,t,n,r){var i,a=this.lambda,o=this.escapeExpression;return"<div class='info_name' data-sw-translate>Created by "+o(a(null!=(i=null!=(i=null!=e?e.info:e)?i.contact:i)?i.name:i,e))+"</div>"},8:function(e,t,n,r){var i,a=this.lambda,o=this.escapeExpression;return"<div class='info_url' data-sw-translate>See more at <a href=\""+o(a(null!=(i=null!=(i=null!=e?e.info:e)?i.contact:i)?i.url:i,e))+'">'+o(a(null!=(i=null!=(i=null!=e?e.info:e)?i.contact:i)?i.url:i,e))+"</a></div>"},10:function(e,t,n,r){var i,a=this.lambda,o=this.escapeExpression;return"<div class='info_email'><a href=\"mailto:"+o(a(null!=(i=null!=(i=null!=e?e.info:e)?i.contact:i)?i.email:i,e))+"?subject="+o(a(null!=(i=null!=e?e.info:e)?i.title:i,e))+'" data-sw-translate>Contact the developer</a></div>'},12:function(e,t,n,r){var i,a=this.lambda,o=this.escapeExpression;return"<div class='info_license'><a href='"+o(a(null!=(i=null!=(i=null!=e?e.info:e)?i.license:i)?i.url:i,e))+"'>"+o(a(null!=(i=null!=(i=null!=e?e.info:e)?i.license:i)?i.name:i,e))+"</a></div>"},14:function(e,t,n,r){var i,a=this.lambda,o=this.escapeExpression;return' , <span style="font-variant: small-caps" data-sw-translate>api version</span>: '+o(a(null!=(i=null!=e?e.info:e)?i.version:i,e))+"\n "},16:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return' <span style="float:right"><a href="'+s((i=null!=(i=t.validatorUrl||(null!=e?e.validatorUrl:e))?i:o,typeof i===a?i.call(e,{name:"validatorUrl",hash:{},data:r}):i))+"/debug?url="+s((i=null!=(i=t.url||(null!=e?e.url:e))?i:o,typeof i===a?i.call(e,{name:"url",hash:{},data:r}):i))+'"><img id="validator" src="'+s((i=null!=(i=t.validatorUrl||(null!=e?e.validatorUrl:e))?i:o,typeof i===a?i.call(e,{name:"validatorUrl",hash:{},data:r}):i))+"?url="+s((i=null!=(i=t.url||(null!=e?e.url:e))?i:o,typeof i===a?i.call(e,{name:"url",hash:{},data:r}):i))+'"></a>\n </span>\n'},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,l=this.escapeExpression,u="<div class='info' id='api_info'>\n";return i=t["if"].call(e,null!=e?e.info:e,{name:"if",hash:{},fn:this.program(1,r),inverse:this.noop,data:r}),null!=i&&(u+=i),u+="</div>\n<div class='container' id='resources_container'>\n <ul id='resources'></ul>\n\n <div class=\"footer\">\n <h4 style=\"color: #999\">[ <span style=\"font-variant: small-caps\">base url</span>: "+l((a=null!=(a=t.basePath||(null!=e?e.basePath:e))?a:s,typeof a===o?a.call(e,{name:"basePath",hash:{},data:r}):a))+"\n",i=t["if"].call(e,null!=(i=null!=e?e.info:e)?i.version:i,{name:"if",hash:{},fn:this.program(14,r),inverse:this.noop,data:r}),null!=i&&(u+=i),u+="]\n",i=t["if"].call(e,null!=e?e.validatorUrl:e,{name:"if",hash:{},fn:this.program(16,r),inverse:this.noop,data:r}),null!=i&&(u+=i),u+" </h4>\n </div>\n</div>\n"},useData:!0}),this.Handlebars.templates.operation=Handlebars.template({1:function(e,t,n,r){return"deprecated"},3:function(e,t,n,r){return" <h4>Warning: Deprecated</h4>\n"},5:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,l=' <h4>Implementation Notes</h4>\n <div class="markdown">';return a=null!=(a=t.description||(null!=e?e.description:e))?a:s,i=typeof a===o?a.call(e,{name:"description",hash:{},data:r}):a,null!=i&&(l+=i),l+"</div>\n"},7:function(e,t,n,r){return' <div class="auth">\n <span class="api-ic ic-error">'},9:function(e,t,n,r){var i,a=' <div class="api_information_panel">\n';return i=t.each.call(e,e,{name:"each",hash:{},fn:this.program(10,r),inverse:this.noop,data:r}),null!=i&&(a+=i),a+" </div>\n"},10:function(e,t,n,r){var i,a=this.lambda,o=this.escapeExpression,s=" <div title='";return i=a(null!=e?e.description:e,e),null!=i&&(s+=i),s+"'>"+o(a(null!=e?e.scope:e,e))+"</div>\n"},12:function(e,t,n,r){return"</span></div>"},14:function(e,t,n,r){return' <div class=\'access\'>\n <span class="api-ic ic-off" title="click to authenticate"></span>\n </div>\n'},16:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return" <h4><span data-sw-translate>Response Class</span> (<span data-sw-translate>Status</span> "+s((i=null!=(i=t.successCode||(null!=e?e.successCode:e))?i:o,typeof i===a?i.call(e,{name:"successCode",hash:{},data:r}):i))+')</h4>\n <p><span class="model-signature" /></p>\n <br/>\n <div class="response-content-type" />\n'},18:function(e,t,n,r){return' <h4 data-sw-translate>Parameters</h4>\n <table class=\'fullwidth\'>\n <thead>\n <tr>\n <th style="width: 100px; max-width: 100px" data-sw-translate>Parameter</th>\n <th style="width: 310px; max-width: 310px" data-sw-translate>Value</th>\n <th style="width: 200px; max-width: 200px" data-sw-translate>Description</th>\n <th style="width: 100px; max-width: 100px" data-sw-translate>Parameter Type</th>\n <th style="width: 220px; max-width: 230px" data-sw-translate>Data Type</th>\n </tr>\n </thead>\n <tbody class="operation-params">\n\n </tbody>\n </table>\n'},20:function(e,t,n,r){return" <div style='margin:0;padding:0;display:inline'></div>\n <h4 data-sw-translate>Response Messages</h4>\n <table class='fullwidth'>\n <thead>\n <tr>\n <th data-sw-translate>HTTP Status Code</th>\n <th data-sw-translate>Reason</th>\n <th data-sw-translate>Response Model</th>\n <th data-sw-translate>Headers</th>\n </tr>\n </thead>\n <tbody class=\"operation-status\">\n\n </tbody>\n </table>\n"},22:function(e,t,n,r){return""},24:function(e,t,n,r){return" <div class='sandbox_header'>\n <input class='submit' type='button' value='Try it out!' data-sw-translate/>\n <a href='#' class='response_hider' style='display:none' data-sw-translate>Hide Response</a>\n <span class='response_throbber' style='display:none'></span>\n </div>\n"},26:function(e,t,n,r){return" <h4 data-sw-translate>Request Headers</h4>\n <div class='block request_headers'></div>\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a,o,s="function",l=t.helperMissing,u=this.escapeExpression,c=t.blockHelperMissing,p="\n <ul class='operations' >\n <li class='"+u((a=null!=(a=t.method||(null!=e?e.method:e))?a:l,typeof a===s?a.call(e,{name:"method",hash:{},data:r}):a))+" operation' id='"+u((a=null!=(a=t.parentId||(null!=e?e.parentId:e))?a:l,typeof a===s?a.call(e,{name:"parentId",hash:{},data:r}):a))+"_"+u((a=null!=(a=t.nickname||(null!=e?e.nickname:e))?a:l,typeof a===s?a.call(e,{name:"nickname",hash:{},data:r}):a))+"'>\n <div class='heading'>\n <h3>\n <span class='http_method'>\n <a href='#!/"+u((a=null!=(a=t.encodedParentId||(null!=e?e.encodedParentId:e))?a:l,typeof a===s?a.call(e,{name:"encodedParentId",hash:{},data:r}):a))+"/"+u((a=null!=(a=t.nickname||(null!=e?e.nickname:e))?a:l,typeof a===s?a.call(e,{name:"nickname",hash:{},data:r}):a))+'\' class="toggleOperation">'+u((a=null!=(a=t.method||(null!=e?e.method:e))?a:l,typeof a===s?a.call(e,{name:"method",hash:{},data:r}):a))+"</a>\n </span>\n <span class='path'>\n <a href='#!/"+u((a=null!=(a=t.encodedParentId||(null!=e?e.encodedParentId:e))?a:l,typeof a===s?a.call(e,{name:"encodedParentId",hash:{},data:r}):a))+"/"+u((a=null!=(a=t.nickname||(null!=e?e.nickname:e))?a:l,typeof a===s?a.call(e,{name:"nickname",hash:{},data:r}):a))+"' class=\"toggleOperation ";return i=t["if"].call(e,null!=e?e.deprecated:e,{name:"if",hash:{},fn:this.program(1,r),inverse:this.noop,data:r}),null!=i&&(p+=i),p+='">'+u((a=null!=(a=t.path||(null!=e?e.path:e))?a:l,typeof a===s?a.call(e,{name:"path",hash:{},data:r}):a))+"</a>\n </span>\n </h3>\n <ul class='options'>\n <li>\n <a href='#!/"+u((a=null!=(a=t.encodedParentId||(null!=e?e.encodedParentId:e))?a:l,typeof a===s?a.call(e,{name:"encodedParentId",hash:{},data:r}):a))+"/"+u((a=null!=(a=t.nickname||(null!=e?e.nickname:e))?a:l,typeof a===s?a.call(e,{name:"nickname",hash:{},data:r}):a))+'\' class="toggleOperation">',a=null!=(a=t.summary||(null!=e?e.summary:e))?a:l,i=typeof a===s?a.call(e,{name:"summary",hash:{},data:r}):a,null!=i&&(p+=i),p+="</a>\n </li>\n </ul>\n </div>\n <div class='content' id='"+u((a=null!=(a=t.parentId||(null!=e?e.parentId:e))?a:l,typeof a===s?a.call(e,{name:"parentId",hash:{},data:r}):a))+"_"+u((a=null!=(a=t.nickname||(null!=e?e.nickname:e))?a:l,typeof a===s?a.call(e,{name:"nickname",hash:{},data:r}):a))+"_content' style='display:none'>\n",i=t["if"].call(e,null!=e?e.deprecated:e,{name:"if",hash:{},fn:this.program(3,r),inverse:this.noop,data:r}),null!=i&&(p+=i),i=t["if"].call(e,null!=e?e.description:e,{name:"if",hash:{},fn:this.program(5,r),inverse:this.noop,data:r}),null!=i&&(p+=i),a=null!=(a=t.oauth||(null!=e?e.oauth:e))?a:l,o={name:"oauth",hash:{},fn:this.program(7,r),inverse:this.noop,data:r},i=typeof a===s?a.call(e,o):a,t.oauth||(i=c.call(e,i,o)),null!=i&&(p+=i),p+="\n",i=t.each.call(e,null!=e?e.oauth:e,{name:"each",hash:{},fn:this.program(9,r),inverse:this.noop,data:r}),null!=i&&(p+=i),p+=" ",a=null!=(a=t.oauth||(null!=e?e.oauth:e))?a:l,o={name:"oauth",hash:{},fn:this.program(12,r),inverse:this.noop,data:r},i=typeof a===s?a.call(e,o):a,t.oauth||(i=c.call(e,i,o)),null!=i&&(p+=i),p+="\n",a=null!=(a=t.oauth||(null!=e?e.oauth:e))?a:l,o={name:"oauth",hash:{},fn:this.program(14,r),inverse:this.noop,data:r},i=typeof a===s?a.call(e,o):a,t.oauth||(i=c.call(e,i,o)),null!=i&&(p+=i),i=t["if"].call(e,null!=e?e.type:e,{name:"if",hash:{},fn:this.program(16,r),inverse:this.noop,data:r}),null!=i&&(p+=i),p+=" <form accept-charset='UTF-8' class='sandbox'>\n <div style='margin:0;padding:0;display:inline'></div>\n",i=t["if"].call(e,null!=e?e.parameters:e,{name:"if",hash:{},fn:this.program(18,r),inverse:this.noop,data:r}),null!=i&&(p+=i),i=t["if"].call(e,null!=e?e.responseMessages:e,{name:"if",hash:{},fn:this.program(20,r),inverse:this.noop,data:r}),null!=i&&(p+=i),i=t["if"].call(e,null!=e?e.isReadOnly:e,{name:"if",hash:{},fn:this.program(22,r),inverse:this.program(24,r),data:r}),null!=i&&(p+=i),p+=" </form>\n <div class='response' style='display:none'>\n <h4>Curl</h4>\n <div class='block curl'></div>\n <h4 data-sw-translate>Request URL</h4>\n <div class='block request_url'></div>\n",i=t["if"].call(e,null!=e?e.showRequestHeaders:e,{name:"if",hash:{},fn:this.program(26,r),inverse:this.noop,data:r}),null!=i&&(p+=i),p+" <h4 data-sw-translate>Response Body</h4>\n <div class='block response_body'></div>\n <h4 data-sw-translate>Response Code</h4>\n <div class='block response_code'></div>\n <h4 data-sw-translate>Response Headers</h4>\n <div class='block response_headers'></div>\n </div>\n </div>\n </li>\n </ul>\n"},useData:!0}),this.Handlebars.templates.param_list=Handlebars.template({1:function(e,t,n,r){return" required"},3:function(e,t,n,r){return' multiple="multiple"'},5:function(e,t,n,r){return" required "},7:function(e,t,n,r){var i,a=" <option ";return i=t.unless.call(e,null!=e?e.hasDefault:e,{name:"unless",hash:{},fn:this.program(8,r),inverse:this.noop,data:r}),null!=i&&(a+=i),a+" value=''></option>\n"},8:function(e,t,n,r){return' selected="" '},10:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,l=this.escapeExpression,u="\n <option ";return i=t["if"].call(e,null!=e?e.isDefault:e,{name:"if",hash:{},fn:this.program(11,r),inverse:this.noop,data:r}),null!=i&&(u+=i),u+=" value='"+l((a=null!=(a=t.value||(null!=e?e.value:e))?a:s,typeof a===o?a.call(e,{name:"value",hash:{},data:r}):a))+"'> "+l((a=null!=(a=t.value||(null!=e?e.value:e))?a:s,typeof a===o?a.call(e,{name:"value",hash:{},data:r}):a))+" ",i=t["if"].call(e,null!=e?e.isDefault:e,{name:"if",hash:{},fn:this.program(13,r),inverse:this.noop,data:r}),null!=i&&(u+=i),u+" </option>\n\n"},11:function(e,t,n,r){return' selected="" '},13:function(e,t,n,r){return" (default) "},15:function(e,t,n,r){return"<strong>"},17:function(e,t,n,r){return"</strong>"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,l=this.escapeExpression,u="<td class='code";return i=t["if"].call(e,null!=e?e.required:e,{name:"if",hash:{},fn:this.program(1,r),inverse:this.noop,data:r}),null!=i&&(u+=i),u+="'><label for='"+l((a=null!=(a=t.valueId||(null!=e?e.valueId:e))?a:s,typeof a===o?a.call(e,{name:"valueId",hash:{},data:r}):a))+"'>"+l((a=null!=(a=t.name||(null!=e?e.name:e))?a:s,typeof a===o?a.call(e,{name:"name",hash:{},data:r}):a))+"</label></td>\n<td>\n <select ",i=(t.isArray||e&&e.isArray||s).call(e,e,{name:"isArray",hash:{},fn:this.program(3,r),inverse:this.noop,data:r}),null!=i&&(u+=i),u+=' class="parameter ',i=t["if"].call(e,null!=e?e.required:e,{name:"if",hash:{},fn:this.program(5,r),inverse:this.noop,data:r}),null!=i&&(u+=i),u+='" name="'+l((a=null!=(a=t.name||(null!=e?e.name:e))?a:s,typeof a===o?a.call(e,{name:"name",hash:{},data:r}):a))+'" id="'+l((a=null!=(a=t.valueId||(null!=e?e.valueId:e))?a:s,typeof a===o?a.call(e,{name:"valueId",hash:{},data:r}):a))+'">\n\n',i=t.unless.call(e,null!=e?e.required:e,{name:"unless",hash:{},fn:this.program(7,r),inverse:this.noop,data:r}),null!=i&&(u+=i),u+="\n",i=t.each.call(e,null!=(i=null!=e?e.allowableValues:e)?i.descriptiveValues:i,{name:"each",hash:{},fn:this.program(10,r),inverse:this.noop,data:r}),null!=i&&(u+=i),u+='\n </select>\n</td>\n<td class="markdown">',i=t["if"].call(e,null!=e?e.required:e,{name:"if",hash:{},fn:this.program(15,r),inverse:this.noop,data:r}),null!=i&&(u+=i),a=null!=(a=t.description||(null!=e?e.description:e))?a:s,i=typeof a===o?a.call(e,{name:"description",hash:{},data:r}):a,null!=i&&(u+=i),i=t["if"].call(e,null!=e?e.required:e,{name:"if",hash:{},fn:this.program(17,r),inverse:this.noop,data:r}),null!=i&&(u+=i),u+="</td>\n<td>",a=null!=(a=t.paramType||(null!=e?e.paramType:e))?a:s,i=typeof a===o?a.call(e,{name:"paramType",hash:{},data:r}):a,null!=i&&(u+=i),u+'</td>\n<td><span class="model-signature"></span></td>\n'},useData:!0}),this.Handlebars.templates.param_readonly_required=Handlebars.template({1:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return" <textarea class='body-textarea' readonly='readonly' placeholder='(required)' name='"+s((i=null!=(i=t.name||(null!=e?e.name:e))?i:o,typeof i===a?i.call(e,{name:"name",hash:{},data:r}):i))+"' id='"+s((i=null!=(i=t.valueId||(null!=e?e.valueId:e))?i:o,typeof i===a?i.call(e,{name:"valueId",hash:{},data:r}):i))+"'>"+s((i=null!=(i=t["default"]||(null!=e?e["default"]:e))?i:o,typeof i===a?i.call(e,{name:"default",hash:{},data:r}):i))+"</textarea>\n"},3:function(e,t,n,r){var i,a="";return i=t["if"].call(e,null!=e?e["default"]:e,{name:"if",hash:{},fn:this.program(4,r),inverse:this.program(6,r),data:r}),null!=i&&(a+=i),a},4:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return" "+s((i=null!=(i=t["default"]||(null!=e?e["default"]:e))?i:o,typeof i===a?i.call(e,{name:"default",hash:{},data:r}):i))+"\n"},6:function(e,t,n,r){return" (empty)\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,l=this.escapeExpression,u="<td class='code required'><label for='"+l((a=null!=(a=t.valueId||(null!=e?e.valueId:e))?a:s,typeof a===o?a.call(e,{name:"valueId",hash:{},data:r}):a))+"'>"+l((a=null!=(a=t.name||(null!=e?e.name:e))?a:s,typeof a===o?a.call(e,{name:"name",hash:{},data:r}):a))+"</label></td>\n<td>\n";return i=t["if"].call(e,null!=e?e.isBody:e,{name:"if",hash:{},fn:this.program(1,r),inverse:this.program(3,r),data:r}),null!=i&&(u+=i),u+='</td>\n<td class="markdown">',a=null!=(a=t.description||(null!=e?e.description:e))?a:s,i=typeof a===o?a.call(e,{name:"description",hash:{},data:r}):a,null!=i&&(u+=i),u+="</td>\n<td>",a=null!=(a=t.paramType||(null!=e?e.paramType:e))?a:s,i=typeof a===o?a.call(e,{name:"paramType",hash:{},data:r}):a,null!=i&&(u+=i),u+'</td>\n<td><span class="model-signature"></span></td>\n'},useData:!0}),this.Handlebars.templates.param_readonly=Handlebars.template({1:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return" <textarea class='body-textarea' readonly='readonly' name='"+s((i=null!=(i=t.name||(null!=e?e.name:e))?i:o,typeof i===a?i.call(e,{name:"name",hash:{},data:r}):i))+"' id='"+s((i=null!=(i=t.valueId||(null!=e?e.valueId:e))?i:o,typeof i===a?i.call(e,{name:"valueId",hash:{},data:r}):i))+"'>"+s((i=null!=(i=t["default"]||(null!=e?e["default"]:e))?i:o,typeof i===a?i.call(e,{name:"default",hash:{},data:r}):i))+"</textarea>\n"},3:function(e,t,n,r){var i,a="";return i=t["if"].call(e,null!=e?e["default"]:e,{name:"if",hash:{},fn:this.program(4,r),inverse:this.program(6,r),data:r}),null!=i&&(a+=i),a},4:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return" "+s((i=null!=(i=t["default"]||(null!=e?e["default"]:e))?i:o,typeof i===a?i.call(e,{name:"default",hash:{},data:r}):i))+"\n"},6:function(e,t,n,r){return" (empty)\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,l=this.escapeExpression,u="<td class='code'><label for='"+l((a=null!=(a=t.valueId||(null!=e?e.valueId:e))?a:s,typeof a===o?a.call(e,{name:"valueId",hash:{},data:r}):a))+"'>"+l((a=null!=(a=t.name||(null!=e?e.name:e))?a:s,typeof a===o?a.call(e,{name:"name",hash:{},data:r}):a))+"</label></td>\n<td>\n";return i=t["if"].call(e,null!=e?e.isBody:e,{name:"if",hash:{},fn:this.program(1,r),inverse:this.program(3,r),data:r}),null!=i&&(u+=i),u+='</td>\n<td class="markdown">',a=null!=(a=t.description||(null!=e?e.description:e))?a:s,i=typeof a===o?a.call(e,{name:"description",hash:{},data:r}):a,null!=i&&(u+=i),u+="</td>\n<td>",a=null!=(a=t.paramType||(null!=e?e.paramType:e))?a:s,i=typeof a===o?a.call(e,{name:"paramType",hash:{},data:r}):a,null!=i&&(u+=i),u+'</td>\n<td><span class="model-signature"></span></td>\n'},useData:!0}),this.Handlebars.templates.param_required=Handlebars.template({1:function(e,t,n,r){var i,a="";return i=t["if"].call(e,null!=e?e.isFile:e,{name:"if",hash:{},fn:this.program(2,r),inverse:this.program(4,r),data:r}),null!=i&&(a+=i),a},2:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return' <input type="file" name=\''+s((i=null!=(i=t.name||(null!=e?e.name:e))?i:o,typeof i===a?i.call(e,{name:"name",hash:{},data:r}):i))+"' id='"+s((i=null!=(i=t.valueId||(null!=e?e.valueId:e))?i:o,typeof i===a?i.call(e,{name:"valueId",hash:{},data:r}):i))+"'/>\n"},4:function(e,t,n,r){var i,a="";return i=t["if"].call(e,null!=e?e["default"]:e,{name:"if",hash:{},fn:this.program(5,r),inverse:this.program(7,r),data:r}),null!=i&&(a+=i),a},5:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return" <textarea class='body-textarea required' placeholder='(required)' name='"+s((i=null!=(i=t.name||(null!=e?e.name:e))?i:o,typeof i===a?i.call(e,{name:"name",hash:{},data:r}):i))+"' id=\""+s((i=null!=(i=t.valueId||(null!=e?e.valueId:e))?i:o,typeof i===a?i.call(e,{name:"valueId",hash:{},data:r}):i))+'">'+s((i=null!=(i=t["default"]||(null!=e?e["default"]:e))?i:o,typeof i===a?i.call(e,{name:"default",hash:{},data:r}):i))+'</textarea>\n <br />\n <div class="parameter-content-type" />\n'},7:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return" <textarea class='body-textarea required' placeholder='(required)' name='"+s((i=null!=(i=t.name||(null!=e?e.name:e))?i:o,typeof i===a?i.call(e,{name:"name",hash:{},data:r}):i))+"' id='"+s((i=null!=(i=t.valueId||(null!=e?e.valueId:e))?i:o,typeof i===a?i.call(e,{name:"valueId",hash:{},data:r}):i))+'\'></textarea>\n <br />\n <div class="parameter-content-type" />\n'},9:function(e,t,n,r){var i,a="";return i=t["if"].call(e,null!=e?e.isFile:e,{name:"if",hash:{},fn:this.program(10,r),inverse:this.program(12,r),data:r}),null!=i&&(a+=i),a},10:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return" <input class='parameter' class='required' type='file' name='"+s((i=null!=(i=t.name||(null!=e?e.name:e))?i:o,typeof i===a?i.call(e,{name:"name",hash:{},data:r}):i))+"' id='"+s((i=null!=(i=t.valueId||(null!=e?e.valueId:e))?i:o,typeof i===a?i.call(e,{name:"valueId",hash:{},data:r}):i))+"'/>\n"},12:function(e,t,n,r){var i,a=t.helperMissing,o="";return i=(t.renderTextParam||e&&e.renderTextParam||a).call(e,e,{name:"renderTextParam",hash:{},fn:this.program(13,r),inverse:this.noop,data:r}),null!=i&&(o+=i),o},13:function(e,t,n,r){return""},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,l=this.escapeExpression,u="<td class='code required'><label for='"+l((a=null!=(a=t.valueId||(null!=e?e.valueId:e))?a:s,typeof a===o?a.call(e,{name:"valueId",hash:{},data:r}):a))+"'>"+l((a=null!=(a=t.name||(null!=e?e.name:e))?a:s,typeof a===o?a.call(e,{name:"name",hash:{},data:r}):a))+"</label></td>\n<td>\n";return i=t["if"].call(e,null!=e?e.isBody:e,{name:"if",hash:{},fn:this.program(1,r),inverse:this.program(9,r),data:r}),null!=i&&(u+=i),u+='</td>\n<td>\n <strong><span class="markdown">',a=null!=(a=t.description||(null!=e?e.description:e))?a:s,i=typeof a===o?a.call(e,{name:"description",hash:{},data:r}):a,null!=i&&(u+=i),u+="</span></strong>\n</td>\n<td>",a=null!=(a=t.paramType||(null!=e?e.paramType:e))?a:s,i=typeof a===o?a.call(e,{name:"paramType",hash:{},data:r}):a,null!=i&&(u+=i),u+'</td>\n<td><span class="model-signature"></span></td>\n'},useData:!0}),this.Handlebars.templates.param=Handlebars.template({1:function(e,t,n,r){var i,a="";return i=t["if"].call(e,null!=e?e.isFile:e,{name:"if",hash:{},fn:this.program(2,r),inverse:this.program(4,r),data:r}),null!=i&&(a+=i),a},2:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return' <input type="file" name=\''+s((i=null!=(i=t.name||(null!=e?e.name:e))?i:o,typeof i===a?i.call(e,{name:"name",hash:{},data:r}):i))+"' id='"+s((i=null!=(i=t.valueId||(null!=e?e.valueId:e))?i:o,typeof i===a?i.call(e,{name:"valueId",hash:{},data:r}):i))+'\'/>\n <div class="parameter-content-type" />\n'},4:function(e,t,n,r){var i,a="";return i=t["if"].call(e,null!=e?e["default"]:e,{name:"if",hash:{},fn:this.program(5,r),inverse:this.program(7,r),data:r}),null!=i&&(a+=i),a},5:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return" <textarea class='body-textarea' name='"+s((i=null!=(i=t.name||(null!=e?e.name:e))?i:o,typeof i===a?i.call(e,{name:"name",hash:{},data:r}):i))+"' id='"+s((i=null!=(i=t.valueId||(null!=e?e.valueId:e))?i:o,typeof i===a?i.call(e,{name:"valueId",hash:{},data:r}):i))+"'>"+s((i=null!=(i=t["default"]||(null!=e?e["default"]:e))?i:o,typeof i===a?i.call(e,{name:"default",
+hash:{},data:r}):i))+'</textarea>\n <br />\n <div class="parameter-content-type" />\n'},7:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return" <textarea class='body-textarea' name='"+s((i=null!=(i=t.name||(null!=e?e.name:e))?i:o,typeof i===a?i.call(e,{name:"name",hash:{},data:r}):i))+"' id='"+s((i=null!=(i=t.valueId||(null!=e?e.valueId:e))?i:o,typeof i===a?i.call(e,{name:"valueId",hash:{},data:r}):i))+'\'></textarea>\n <br />\n <div class="parameter-content-type" />\n'},9:function(e,t,n,r){var i,a="";return i=t["if"].call(e,null!=e?e.isFile:e,{name:"if",hash:{},fn:this.program(2,r),inverse:this.program(10,r),data:r}),null!=i&&(a+=i),a},10:function(e,t,n,r){var i,a=t.helperMissing,o="";return i=(t.renderTextParam||e&&e.renderTextParam||a).call(e,e,{name:"renderTextParam",hash:{},fn:this.program(11,r),inverse:this.noop,data:r}),null!=i&&(o+=i),o},11:function(e,t,n,r){return""},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,l=this.escapeExpression,u="<td class='code'><label for='"+l((a=null!=(a=t.valueId||(null!=e?e.valueId:e))?a:s,typeof a===o?a.call(e,{name:"valueId",hash:{},data:r}):a))+"'>"+l((a=null!=(a=t.name||(null!=e?e.name:e))?a:s,typeof a===o?a.call(e,{name:"name",hash:{},data:r}):a))+"</label></td>\n<td>\n\n";return i=t["if"].call(e,null!=e?e.isBody:e,{name:"if",hash:{},fn:this.program(1,r),inverse:this.program(9,r),data:r}),null!=i&&(u+=i),u+='\n</td>\n<td class="markdown">',a=null!=(a=t.description||(null!=e?e.description:e))?a:s,i=typeof a===o?a.call(e,{name:"description",hash:{},data:r}):a,null!=i&&(u+=i),u+="</td>\n<td>",a=null!=(a=t.paramType||(null!=e?e.paramType:e))?a:s,i=typeof a===o?a.call(e,{name:"paramType",hash:{},data:r}):a,null!=i&&(u+=i),u+'</td>\n<td>\n <span class="model-signature"></span>\n</td>\n'},useData:!0}),this.Handlebars.templates.parameter_content_type=Handlebars.template({1:function(e,t,n,r){var i,a="";return i=t.each.call(e,null!=e?e.consumes:e,{name:"each",hash:{},fn:this.program(2,r),inverse:this.noop,data:r}),null!=i&&(a+=i),a},2:function(e,t,n,r){var i,a=this.lambda,o=' <option value="';return i=a(e,e),null!=i&&(o+=i),o+='">',i=a(e,e),null!=i&&(o+=i),o+"</option>\n"},4:function(e,t,n,r){return' <option value="application/json">application/json</option>\n'},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,l=this.escapeExpression,u='<label for="'+l((a=null!=(a=t.parameterContentTypeId||(null!=e?e.parameterContentTypeId:e))?a:s,typeof a===o?a.call(e,{name:"parameterContentTypeId",hash:{},data:r}):a))+'">Parameter content type:</label>\n<select name="parameterContentType" id="'+l((a=null!=(a=t.parameterContentTypeId||(null!=e?e.parameterContentTypeId:e))?a:s,typeof a===o?a.call(e,{name:"parameterContentTypeId",hash:{},data:r}):a))+'">\n';return i=t["if"].call(e,null!=e?e.consumes:e,{name:"if",hash:{},fn:this.program(1,r),inverse:this.program(4,r),data:r}),null!=i&&(u+=i),u+"</select>\n"},useData:!0}),this.Handlebars.templates.resource=Handlebars.template({1:function(e,t,n,r){return" : "},3:function(e,t,n,r){var i,a="function",o=t.helperMissing,s=this.escapeExpression;return" <li>\n <a href='"+s((i=null!=(i=t.url||(null!=e?e.url:e))?i:o,typeof i===a?i.call(e,{name:"url",hash:{},data:r}):i))+"' data-sw-translate>Raw</a>\n </li>\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a,o,s="function",l=t.helperMissing,u=this.escapeExpression,c=t.blockHelperMissing,p="<div class='heading'>\n <h2>\n <a href='#!/"+u((a=null!=(a=t.id||(null!=e?e.id:e))?a:l,typeof a===s?a.call(e,{name:"id",hash:{},data:r}):a))+'\' class="toggleEndpointList" data-id="'+u((a=null!=(a=t.id||(null!=e?e.id:e))?a:l,typeof a===s?a.call(e,{name:"id",hash:{},data:r}):a))+'">'+u((a=null!=(a=t.name||(null!=e?e.name:e))?a:l,typeof a===s?a.call(e,{name:"name",hash:{},data:r}):a))+"</a> ";return a=null!=(a=t.summary||(null!=e?e.summary:e))?a:l,o={name:"summary",hash:{},fn:this.program(1,r),inverse:this.noop,data:r},i=typeof a===s?a.call(e,o):a,t.summary||(i=c.call(e,i,o)),null!=i&&(p+=i),a=null!=(a=t.summary||(null!=e?e.summary:e))?a:l,i=typeof a===s?a.call(e,{name:"summary",hash:{},data:r}):a,null!=i&&(p+=i),p+="\n </h2>\n <ul class='options'>\n <li>\n <a href='#!/"+u((a=null!=(a=t.id||(null!=e?e.id:e))?a:l,typeof a===s?a.call(e,{name:"id",hash:{},data:r}):a))+"' id='endpointListTogger_"+u((a=null!=(a=t.id||(null!=e?e.id:e))?a:l,typeof a===s?a.call(e,{name:"id",hash:{},data:r}):a))+'\' class="toggleEndpointList" data-id="'+u((a=null!=(a=t.id||(null!=e?e.id:e))?a:l,typeof a===s?a.call(e,{name:"id",hash:{},data:r}):a))+'" data-sw-translate>Show/Hide</a>\n </li>\n <li>\n <a href=\'#\' class="collapseResource" data-id="'+u((a=null!=(a=t.id||(null!=e?e.id:e))?a:l,typeof a===s?a.call(e,{name:"id",hash:{},data:r}):a))+'" data-sw-translate>\n List Operations\n </a>\n </li>\n <li>\n <a href=\'#\' class="expandResource" data-id="'+u((a=null!=(a=t.id||(null!=e?e.id:e))?a:l,typeof a===s?a.call(e,{name:"id",hash:{},data:r}):a))+'" data-sw-translate>\n Expand Operations\n </a>\n </li>\n',i=t["if"].call(e,null!=e?e.url:e,{name:"if",hash:{},fn:this.program(3,r),inverse:this.noop,data:r}),null!=i&&(p+=i),p+" </ul>\n</div>\n<ul class='endpoints' id='"+u((a=null!=(a=t.id||(null!=e?e.id:e))?a:l,typeof a===s?a.call(e,{name:"id",hash:{},data:r}):a))+"_endpoint_list' style='display:none'>\n\n</ul>\n"},useData:!0}),this.Handlebars.templates.response_content_type=Handlebars.template({1:function(e,t,n,r){var i,a="";return i=t.each.call(e,null!=e?e.produces:e,{name:"each",hash:{},fn:this.program(2,r),inverse:this.noop,data:r}),null!=i&&(a+=i),a},2:function(e,t,n,r){var i,a=this.lambda,o=' <option value="';return i=a(e,e),null!=i&&(o+=i),o+='">',i=a(e,e),null!=i&&(o+=i),o+"</option>\n"},4:function(e,t,n,r){return' <option value="application/json">application/json</option>\n'},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,l=this.escapeExpression,u='<label data-sw-translate for="'+l((a=null!=(a=t.responseContentTypeId||(null!=e?e.responseContentTypeId:e))?a:s,typeof a===o?a.call(e,{name:"responseContentTypeId",hash:{},data:r}):a))+'">Response Content Type</label>\n<select name="responseContentType" id="'+l((a=null!=(a=t.responseContentTypeId||(null!=e?e.responseContentTypeId:e))?a:s,typeof a===o?a.call(e,{name:"responseContentTypeId",hash:{},data:r}):a))+'">\n';return i=t["if"].call(e,null!=e?e.produces:e,{name:"if",hash:{},fn:this.program(1,r),inverse:this.program(4,r),data:r}),null!=i&&(u+=i),u+"</select>\n"},useData:!0}),this.Handlebars.templates.signature=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,l=this.escapeExpression,u='<div>\n<ul class="signature-nav">\n <li><a class="description-link" href="#" data-sw-translate>Model</a></li>\n <li><a class="snippet-link" href="#" data-sw-translate>Model Schema</a></li>\n</ul>\n<div>\n\n<div class="signature-container">\n <div class="description">\n ';return a=null!=(a=t.signature||(null!=e?e.signature:e))?a:s,i=typeof a===o?a.call(e,{name:"signature",hash:{},data:r}):a,null!=i&&(u+=i),u+'\n </div>\n\n <div class="snippet">\n <pre><code>'+l((a=null!=(a=t.sampleJSON||(null!=e?e.sampleJSON:e))?a:s,typeof a===o?a.call(e,{name:"sampleJSON",hash:{},data:r}):a))+'</code></pre>\n <small class="notice"></small>\n </div>\n</div>\n\n'},useData:!0}),this.Handlebars.templates.status_code=Handlebars.template({1:function(e,t,n,r){var i=this.lambda,a=this.escapeExpression;return" <tr>\n <td>"+a(i(r&&r.key,e))+"</td>\n <td>"+a(i(null!=e?e.description:e,e))+"</td>\n <td>"+a(i(null!=e?e.type:e,e))+"</td>\n </tr>\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,a,o="function",s=t.helperMissing,l=this.escapeExpression,u="<td width='15%' class='code'>"+l((a=null!=(a=t.code||(null!=e?e.code:e))?a:s,typeof a===o?a.call(e,{name:"code",hash:{},data:r}):a))+'</td>\n<td class="markdown">';return a=null!=(a=t.message||(null!=e?e.message:e))?a:s,i=typeof a===o?a.call(e,{name:"message",hash:{},data:r}):a,null!=i&&(u+=i),u+='</td>\n<td width=\'50%\'><span class="model-signature" /></td>\n<td class="headers">\n <table>\n <tbody>\n',i=t.each.call(e,null!=e?e.headers:e,{name:"each",hash:{},fn:this.program(1,r),inverse:this.noop,data:r}),null!=i&&(u+=i),u+" </tbody>\n </table>\n</td>"},useData:!0}),function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.SwaggerClient=e()}}(function(){var e;return function t(e,n,r){function i(o,s){if(!n[o]){if(!e[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[o]={exports:{}};e[o][0].call(c.exports,function(t){var n=e[o][1][t];return i(n?n:t)},c,c.exports,t,e,n,r)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o<r.length;o++)i(r[o]);return i}({1:[function(e,t,n){"use strict";var r=e("./lib/auth"),i=e("./lib/helpers"),a=e("./lib/client"),o=function(e,t){return i.log('This is deprecated, use "new SwaggerClient" instead.'),new a(e,t)};Array.prototype.indexOf||(Array.prototype.indexOf=function(e,t){for(var n=t||0,r=this.length;r>n;n++)if(this[n]===e)return n;return-1}),String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),String.prototype.endsWith||(String.prototype.endsWith=function(e){return-1!==this.indexOf(e,this.length-e.length)}),t.exports=a,a.ApiKeyAuthorization=r.ApiKeyAuthorization,a.PasswordAuthorization=r.PasswordAuthorization,a.CookieAuthorization=r.CookieAuthorization,a.SwaggerApi=o,a.SwaggerClient=o,a.SchemaMarkup=e("./lib/schema-markup")},{"./lib/auth":2,"./lib/client":3,"./lib/helpers":4,"./lib/schema-markup":7}],2:[function(e,t,n){"use strict";var r=e("./helpers"),i=e("btoa"),a=e("cookiejar"),o={each:e("lodash-compat/collection/each"),includes:e("lodash-compat/collection/includes"),isObject:e("lodash-compat/lang/isObject"),isArray:e("lodash-compat/lang/isArray")},s=t.exports.SwaggerAuthorizations=function(e){this.authz=e||{}};s.prototype.add=function(e,t){if(o.isObject(e))for(var n in e)this.authz[n]=e[n];else"string"==typeof e&&(this.authz[e]=t);return t},s.prototype.remove=function(e){return delete this.authz[e]},s.prototype.apply=function(e,t){var n=!0,r=!t,i=[];return o.each(t,function(e,t){"string"==typeof t&&i.push(t),o.each(e,function(e,t){i.push(t)})}),o.each(this.authz,function(t,a){if(r||o.includes(i,a)){var s=t.apply(e);n=n&&!!s}}),n};var l=t.exports.ApiKeyAuthorization=function(e,t,n){this.name=e,this.value=t,this.type=n};l.prototype.apply=function(e){return"query"===this.type?(e.url.indexOf("?")>0?e.url=e.url+"&"+this.name+"="+this.value:e.url=e.url+"?"+this.name+"="+this.value,!0):"header"===this.type?("undefined"==typeof e.headers[this.name]&&(e.headers[this.name]=this.value),!0):void 0};var u=t.exports.CookieAuthorization=function(e){this.cookie=e};u.prototype.apply=function(e){return e.cookieJar=e.cookieJar||new a,e.cookieJar.setCookie(this.cookie),!0};var c=t.exports.PasswordAuthorization=function(e,t){3===arguments.length&&(r.log("PasswordAuthorization: the 'name' argument has been removed, pass only username and password"),e=arguments[1],t=arguments[2]),this.username=e,this.password=t};c.prototype.apply=function(e){return"undefined"==typeof e.headers.Authorization&&(e.headers.Authorization="Basic "+i(this.username+":"+this.password)),!0}},{"./helpers":4,btoa:18,cookiejar:19,"lodash-compat/collection/each":55,"lodash-compat/collection/includes":58,"lodash-compat/lang/isArray":143,"lodash-compat/lang/isObject":147}],3:[function(e,t,n){"use strict";var r={bind:e("lodash-compat/function/bind"),cloneDeep:e("lodash-compat/lang/cloneDeep"),find:e("lodash-compat/collection/find"),forEach:e("lodash-compat/collection/forEach"),indexOf:e("lodash-compat/array/indexOf"),isArray:e("lodash-compat/lang/isArray"),isObject:e("lodash-compat/lang/isObject"),isFunction:e("lodash-compat/lang/isFunction"),isPlainObject:e("lodash-compat/lang/isPlainObject"),isUndefined:e("lodash-compat/lang/isUndefined")},i=e("./auth"),a=e("./helpers"),o=e("./types/model"),s=e("./types/operation"),l=e("./types/operationGroup"),u=e("./resolver"),c=e("./http"),p=e("./spec-converter"),f=["apis","authorizationScheme","authorizations","basePath","build","buildFrom1_1Spec","buildFrom1_2Spec","buildFromSpec","clientAuthorizations","convertInfo","debug","defaultErrorCallback","defaultSuccessCallback","fail","failure","finish","help","idFromOp","info","initialize","isBuilt","isValid","modelPropertyMacro","models","modelsArray","options","parameterMacro","parseUri","progress","resourceCount","sampleModels","selfReflect","setConsolidatedModels","spec","supportedSubmitMethods","swaggerRequestHeaders","tagFromLabel","title","url","useJQuery"],h=["apis","asCurl","description","externalDocs","help","label","name","operation","operations","operationsArray","path","tag"],d=["delete","get","head","options","patch","post","put"],m=t.exports=function(e,t){return this.authorizations=null,this.authorizationScheme=null,this.basePath=null,this.debug=!1,this.info=null,this.isBuilt=!1,this.isValid=!1,this.modelsArray=[],this.resourceCount=0,this.url=null,this.useJQuery=!1,this.swaggerObject={},this.clientAuthorizations=new i.SwaggerAuthorizations,"undefined"!=typeof e?this.initialize(e,t):this};m.prototype.initialize=function(e,t){this.models={},this.sampleModels={},"string"==typeof e?this.url=e:r.isObject(e)&&(t=e,this.url=t.url),t=t||{},this.clientAuthorizations.add(t.authorizations),this.swaggerRequestHeaders=t.swaggerRequestHeaders||"application/json;charset=utf-8,*/*",this.defaultSuccessCallback=t.defaultSuccessCallback||null,this.defaultErrorCallback=t.defaultErrorCallback||null,this.modelPropertyMacro=t.modelPropertyMacro||null,this.parameterMacro=t.parameterMacro||null,"function"==typeof t.success&&(this.success=t.success),t.useJQuery&&(this.useJQuery=t.useJQuery),this.options=t||{},this.supportedSubmitMethods=t.supportedSubmitMethods||[],this.failure=t.failure||function(){},this.progress=t.progress||function(){},this.spec=r.cloneDeep(t.spec),t.scheme&&(this.scheme=t.scheme),"function"==typeof t.success&&(this.ready=!0,this.build())},m.prototype.build=function(e){if(this.isBuilt)return this;var t=this;this.progress("fetching resource list: "+this.url+"; Please wait.");var n={useJQuery:this.useJQuery,url:this.url,method:"get",headers:{accept:this.swaggerRequestHeaders},on:{error:function(e){return"http"!==t.url.substring(0,4)?t.fail("Please specify the protocol for "+t.url):0===e.status?t.fail("Can't read from server. It may not have the appropriate access-control-origin settings."):404===e.status?t.fail("Can't read swagger JSON from "+t.url):t.fail(e.status+" : "+e.statusText+" "+t.url)},response:function(e){var n=e.obj;if(!n)return t.fail("failed to parse JSON/YAML response");if(t.swaggerVersion=n.swaggerVersion,t.swaggerObject=n,n.swagger&&2===parseInt(n.swagger))t.swaggerVersion=n.swagger,(new u).resolve(n,t.url,t.buildFromSpec,t),t.isValid=!0;else{var r=new p;t.oldSwaggerObject=t.swaggerObject,r.setDocumentationLocation(t.url),r.convert(n,t.clientAuthorizations,function(e){t.swaggerObject=e,(new u).resolve(e,t.url,t.buildFromSpec,t),t.isValid=!0})}}}};if(this.spec)t.swaggerObject=this.spec,setTimeout(function(){(new u).resolve(t.spec,t.buildFromSpec,t)},10);else{if(this.clientAuthorizations.apply(n),e)return n;(new c).execute(n,this.options)}return this},m.prototype.buildFromSpec=function(e){if(this.isBuilt)return this;this.apis={},this.apisArray=[],this.basePath=e.basePath||"",this.consumes=e.consumes,this.host=e.host||"",this.info=e.info||{},this.produces=e.produces,this.schemes=e.schemes||[],this.securityDefinitions=e.securityDefinitions,this.title=e.title||"",e.externalDocs&&(this.externalDocs=e.externalDocs),this.authSchemes=e.securityDefinitions;var t,n={};if(Array.isArray(e.tags))for(n={},t=0;t<e.tags.length;t++){var i=e.tags[t];n[i.name]=i}var u;"string"==typeof this.url?(u=this.parseUri(this.url),"undefined"==typeof this.scheme&&"undefined"==typeof this.schemes||0===this.schemes.length?this.scheme=u.scheme||"http":"undefined"==typeof this.scheme&&(this.scheme=this.schemes[0]),("undefined"==typeof this.host||""===this.host)&&(this.host=u.host,u.port&&(this.host=this.host+":"+u.port))):"undefined"==typeof this.schemes||0===this.schemes.length?this.scheme="http":"undefined"==typeof this.scheme&&(this.scheme=this.schemes[0]),this.definitions=e.definitions;var c;for(c in this.definitions){var p=new o(c,this.definitions[c],this.models,this.modelPropertyMacro);p&&(this.models[c]=p)}var m=this;return m.apis.help=r.bind(m.help,m),r.forEach(e.paths,function(e,t){r.isPlainObject(e)&&r.forEach(d,function(i){var o=e[i];if(!r.isUndefined(o)){if(!r.isPlainObject(o))return void a.log("The '"+i+"' operation for '"+t+"' path is not an Operation Object");var u=o.tags;(r.isUndefined(u)||!r.isArray(u)||0===u.length)&&(u=o.tags=["default"]);var c=m.idFromOp(t,i,o),p=new s(m,o.scheme,c,i,t,o,m.definitions,m.models,m.clientAuthorizations);r.forEach(u,function(e){var t=r.indexOf(f,e)>-1?"_"+e:e,i=r.indexOf(h,e)>-1?"_"+e:e,o=m[t];if(t!==e&&a.log("The '"+e+"' tag conflicts with a SwaggerClient function/property name. Use 'client."+t+"' or 'client.apis."+e+"' instead of 'client."+e+"'."),i!==e&&a.log("The '"+e+"' tag conflicts with a SwaggerClient operation function/property name. Use 'client.apis."+i+"' instead of 'client.apis."+e+"'."),r.indexOf(h,c)>-1&&(a.log("The '"+c+"' operationId conflicts with a SwaggerClient operation function/property name. Use 'client.apis."+i+"._"+c+"' instead of 'client.apis."+i+"."+c+"'."),c="_"+c,p.nickname=c),r.isUndefined(o)){o=m[t]=m.apis[i]={},o.operations={},o.label=i,o.apis={};var s=n[e];r.isUndefined(s)||(o.description=s.description,o.externalDocs=s.externalDocs),m[t].help=r.bind(m.help,o),m.apisArray.push(new l(e,o.description,o.externalDocs,p))}r.isFunction(o.help)||(o.help=r.bind(m.help,o)),m.apis[i][c]=o[c]=r.bind(p.execute,p),m.apis[i][c].help=o[c].help=r.bind(p.help,p),m.apis[i][c].asCurl=o[c].asCurl=r.bind(p.asCurl,p),o.apis[c]=o.operations[c]=p;var u=r.find(m.apisArray,function(t){return t.tag===e});u&&u.operationsArray.push(p)})}})}),this.isBuilt=!0,this.success&&(this.isValid=!0,this.isBuilt=!0,this.success()),this},m.prototype.parseUri=function(e){var t=/^(((([^:\/#\?]+:)?(?:(\/\/)((?:(([^:@\/#\?]+)(?:\:([^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((\/?(?:[^\/\?#]+\/+)*)([^\?#]*)))?(\?[^#]+)?)(#.*)?/,n=t.exec(e);return{scheme:n[4].replace(":",""),host:n[11],port:n[12],path:n[15]}},m.prototype.help=function(e){var t="";return this instanceof m?r.forEach(this.apis,function(e,n){r.isPlainObject(e)&&(t+="operations for the '"+n+"' tag\n",r.forEach(e.operations,function(e,n){t+=" * "+n+": "+e.summary+"\n"}))}):(this instanceof l||r.isPlainObject(this))&&(t+="operations for the '"+this.label+"' tag\n",r.forEach(this.apis,function(e,n){t+=" * "+n+": "+e.summary+"\n"})),e?t:(a.log(t),t)},m.prototype.tagFromLabel=function(e){return e},m.prototype.idFromOp=function(e,t,n){n&&n.operationId||(n=n||{},n.operationId=t+"_"+e);var r=n.operationId.replace(/[\s!@#$%^&*()_+=\[{\]};:<>|.\/?,\\'""-]/g,"_")||e.substring(1)+"_"+t;return r=r.replace(/((_){2,})/g,"_"),r=r.replace(/^(_)*/g,""),r=r.replace(/([_])*$/g,"")},m.prototype.setHost=function(e){this.host=e,this.apis&&r.forEach(this.apis,function(t){t.operations&&r.forEach(t.operations,function(t){t.host=e})})},m.prototype.setBasePath=function(e){this.basePath=e,this.apis&&r.forEach(this.apis,function(t){t.operations&&r.forEach(t.operations,function(t){t.basePath=e})})},m.prototype.fail=function(e){throw this.failure(e),e}},{"./auth":2,"./helpers":4,"./http":5,"./resolver":6,"./spec-converter":8,"./types/model":9,"./types/operation":10,"./types/operationGroup":11,"lodash-compat/array/indexOf":52,"lodash-compat/collection/find":56,"lodash-compat/collection/forEach":57,"lodash-compat/function/bind":61,"lodash-compat/lang/cloneDeep":141,"lodash-compat/lang/isArray":143,"lodash-compat/lang/isFunction":145,"lodash-compat/lang/isObject":147,"lodash-compat/lang/isPlainObject":148,"lodash-compat/lang/isUndefined":151}],4:[function(e,t,n){(function(n){"use strict";var r={isPlainObject:e("lodash-compat/lang/isPlainObject"),indexOf:e("lodash-compat/array/indexOf")};t.exports.__bind=function(e,t){return function(){return e.apply(t,arguments)}};var i=t.exports.log=function(){console&&"test"!==n.env.NODE_ENV&&console.log(Array.prototype.slice.call(arguments)[0])};t.exports.fail=function(e){i(e)};var a=(t.exports.optionHtml=function(e,t){return'<tr><td class="optionName">'+e+":</td><td>"+t+"</td></tr>"},t.exports.resolveSchema=function(e){return r.isPlainObject(e.schema)&&(e=a(e.schema)),e});t.exports.simpleRef=function(e){return"undefined"==typeof e?null:0===e.indexOf("#/definitions/")?e.substring("#/definitions/".length):e}}).call(this,e("_process"))},{_process:17,"lodash-compat/array/indexOf":52,"lodash-compat/lang/isPlainObject":148}],5:[function(e,t,n){"use strict";var r=e("./helpers"),i=e("jquery"),a=e("superagent"),o=e("js-yaml"),s={isObject:e("lodash-compat/lang/isObject")},l=function(){},u=function(){},c=t.exports=function(){};c.prototype.execute=function(e,t){var n;n=t&&t.client?t.client:new u(t),(e&&e.useJQuery===!0||this.isInternetExplorer())&&(n=new l(t));var r=e.on.response,i=function(e){t&&t.responseInterceptor&&(e=t.responseInterceptor.apply(e)),r(e)};e.on.response=function(e){i(e)},s.isObject(e)&&s.isObject(e.body)&&(e.body.type&&"formData"===e.body.type?(e.contentType=!1,e.processData=!1,delete e.headers["Content-Type"]):e.body=JSON.stringify(e.body)),n.execute(e)},c.prototype.isInternetExplorer=function(){var e=!1;if("undefined"!=typeof navigator&&navigator.userAgent){var t=navigator.userAgent.toLowerCase();if(-1!==t.indexOf("msie")){var n=parseInt(t.split("msie")[1]);8>=n&&(e=!0)}}return e},l.prototype.execute=function(e){var t=e.on,n=e;return e.type=e.method,e.cache=!1,delete e.useJQuery,e.data=e.body,delete e.body,e.complete=function(e){for(var i={},a=e.getAllResponseHeaders().split("\n"),s=0;s<a.length;s++){var l=a[s].trim();if(0!==l.length){var u=l.indexOf(":");if(-1!==u){var c=l.substring(0,u).trim(),p=l.substring(u+1).trim();i[c]=p}else i[l]=null}}var f={url:n.url,method:n.method,status:e.status,statusText:e.statusText,data:e.responseText,headers:i};try{var h=e.responseJSON||o.safeLoad(e.responseText);f.obj="string"==typeof h?{}:h}catch(d){r.log("unable to parse JSON/YAML content")}if(f.obj=f.obj||null,e.status>=200&&e.status<300)t.response(f);else{if(!(0===e.status||e.status>=400&&e.status<599))return t.response(f);t.error(f)}},i.support.cors=!0,i.ajax(e)},u.prototype.execute=function(e){var t=e.method.toLowerCase();"delete"===t&&(t="del");var n,i=e.headers||{},s=a[t](e.url);for(n in i)s.set(n,i[n]);e.body&&s.send(e.body),"function"==typeof s.buffer&&s.buffer(),s.end(function(t,n){n=n||{status:0,headers:{error:"no response from server"}};var i,a={url:e.url,method:e.method,headers:n.headers};if(!t&&n.error&&(t=n.error),t&&e.on&&e.on.error)a.obj=t,a.status=n?n.status:500,a.statusText=n?n.text:t.message,i=e.on.error;else if(n&&e.on&&e.on.response){var s;if(n.body&&Object.keys(n.body).length>0)s=n.body;else try{s=o.safeLoad(n.text),s="string"==typeof s?null:s}catch(l){r.log("cannot parse JSON/YAML content")}a.obj=s||null,a.status=n.status,a.statusText=n.text,i=e.on.response}a.data=a.statusText,i&&i(a)})}},{"./helpers":4,jquery:20,"js-yaml":21,"lodash-compat/lang/isObject":147,superagent:160}],6:[function(e,t,n){"use strict";var r=e("./http"),i={isObject:e("lodash-compat/lang/isObject"),isArray:e("lodash-compat/lang/isArray")},a=t.exports=function(){};a.prototype.processAllOf=function(e,t,n,r,i){var a,o,s;t["x-resolved-from"]=["#/definitions/"+e];var l=t.allOf;for(l.sort(function(e,t){return e.$ref&&t.$ref?0:e.$ref?-1:1}),a=0;a<l.length;a++)s=l[a],o="/definitions/"+e+"/allOf",this.resolveInline(null,i,s,n,r,o)},a.prototype.resolve=function(e,t,n,a){var o,s,l=t,u=n,c=a;"function"==typeof t&&(l=null,u=t,c=n);var p=l;this.scope=c||this,this.iteration=this.iteration||0;var f,h,d,m,g=0,y={},v={},b=[];for(f in e.definitions){var w=e.definitions[f];for(m in w.properties)d=w.properties[m],i.isArray(d.allOf)?this.processAllOf(f,d,b,v,e):this.resolveTo(l,d,b,"/definitions");w.allOf&&this.processAllOf(f,w,b,v,e)}for(f in e.paths){var x,S,A;h=e.paths[f];for(x in h)if("$ref"===x)o="/paths"+f,this.resolveInline(l,e,h,b,v,o);else{S=h[x];var C=S.parameters;for(s in C){var E=C[s];o="/paths"+f+"/"+x+"/parameters","body"===E["in"]&&E.schema&&this.resolveTo(l,E.schema,b,o),E.$ref&&this.resolveInline(l,e,E,b,v,E.$ref)}for(A in S.responses){var k=S.responses[A];o="/paths"+f+"/"+x+"/responses/"+A,i.isObject(k)&&(k.$ref&&this.resolveInline(l,e,k,b,v,o),k.schema&&this.resolveTo(l,k.schema,b,o))}}}var O,j=0,T=[],I=b;for(s=0;s<I.length;s++){var _=I[s];if(l===_.root){if("ref"===_.resolveAs){var D,L=((_.root||"")+"/"+_.key).split("/"),P=[],N="";if(_.key.indexOf("../")>=0){for(var $=0;$<L.length;$++)".."===L[$]?P=P.slice(0,P.length-1):P.push(L[$]);for(D=0;D<P.length;D++)D>0&&(N+="/"),N+=P[D];_.root=N,T.push(_)}else if(O=_.key.split("#"),2===O.length){(0===O[0].indexOf("http://")||0===O[0].indexOf("https://"))&&(_.root=O[0]),o=O[1].split("/");var M,R=e;for(D=0;D<o.length;D++){var F=o[D];if(""!==F){if(R=R[F],"undefined"==typeof R){M=null;break}M=R}}null===M&&T.push(_)}}else if("inline"===_.resolveAs){if(_.key&&-1===_.key.indexOf("#")&&"/"!==_.key.charAt(0)){for(O=_.root.split("/"),o="",s=0;s<O.length-1;s++)o+=O[s]+"/";o+=_.key,_.root=o,_.location=""}T.push(_)}}else T.push(_)}j=T.length;for(var U=0;U<T.length;U++)!function(t,n){if(null===t.root||t.root===l)n.resolveItem(e,p,b,y,v,t),g+=1,g===j&&n.finish(e,l,b,y,v,u);else{var i={useJQuery:!1,url:t.root,method:"get",headers:{accept:n.scope.swaggerRequestHeaders||"application/json"},on:{error:function(){g+=1,v[t.key]={root:t.root,location:t.location},g===j&&n.finish(e,p,b,y,v,u)},response:function(r){var i=r.obj;n.resolveItem(i,t.root,b,y,v,t),g+=1,g===j&&n.finish(e,p,b,y,v,u)}}};c&&c.clientAuthorizations&&c.clientAuthorizations.apply(i),(new r).execute(i)}}(T[U],this);0===Object.keys(T).length&&this.finish(e,p,b,y,v,u)},a.prototype.resolveItem=function(e,t,n,r,i,a){var o=a.location,s=e,l=o.split("/");if(""!==o)for(var u=0;u<l.length;u++){var c=l[u];if(-1!==c.indexOf("~1")&&(c=l[u].replace(/~0/g,"~").replace(/~1/g,"/"),"/"!==c.charAt(0)&&(c="/"+c)),"undefined"==typeof s||null===s)break;if(""===c&&u===l.length-1&&l.length>1){s=null;break}c.length>0&&(s=s[c])}var p=a.key;l=a.key.split("/");var f=l[l.length-1];f.indexOf("#")>=0&&(f=f.split("#")[1]),null!==s&&"undefined"!=typeof s?r[p]={name:f,obj:s,key:a.key,root:a.root}:i[p]={root:a.root,location:a.location}},a.prototype.finish=function(e,t,n,r,i,a){var o;for(o in n){var s=n[o],l=s.key,u=r[l];if(u)if(e.definitions=e.definitions||{},"ref"===s.resolveAs){for(l in u.obj)var c=this.retainRoot(u.obj[l],s.root);e.definitions[u.name]=u.obj,s.obj.$ref="#/definitions/"+u.name}else if("inline"===s.resolveAs){var p=s.obj;p["x-resolved-from"]=[s.key],delete p.$ref;for(l in u.obj){var c=this.retainRoot(u.obj[l],s.root);p[l]=c}}}var f=this.countUnresolvedRefs(e);0===f.length||this.iteration>5?(this.resolveAllOf(e.definitions),a.call(this.scope,e,i)):(this.iteration+=1,this.resolve(e,t,a,this.scope))},a.prototype.countUnresolvedRefs=function(e){var t,n=this.getRefs(e),r=[],i=[];for(t in n)0===t.indexOf("#")?r.push(t.substring(1)):i.push(t);for(t=0;t<r.length;t++)for(var a=r[t],o=a.split("/"),s=e,l=0;l<o.length;l++){var u=o[l];if(""!==u&&(s=s[u],"undefined"==typeof s)){i.push(a);break}}return i.length},a.prototype.getRefs=function(e,t){t=t||e;var n={};for(var r in t)if(t.hasOwnProperty(r)){var a=t[r];if("$ref"===r&&"string"==typeof a)n[a]=null;else if(i.isObject(a)){var o=this.getRefs(a);for(var s in o)n[s]=null}}return n},a.prototype.retainRoot=function(e,t){for(var n in e){var r=e[n];"$ref"===n&&"string"==typeof r?0!==r.indexOf("http://")&&0!==r.indexOf("https://")&&(0!==r.indexOf("#")&&(r="#"+r),r=(t||"")+r,e[n]=r):i.isObject(r)&&this.retainRoot(r,t)}return e},a.prototype.resolveInline=function(e,t,n,r,i,a){var o,s,l,u,c=n.$ref,p=n.$ref,f=!1;if(p){if(0===p.indexOf("../")){for(s=p.split("../"),l=e.split("/"),p="",o=0;o<s.length;o++)""===s[o]?l=l.slice(0,l.length-1):p+=s[o];for(e="",o=0;o<l.length-1;o++)o>0&&(e+="/"),e+=l[o];f=!0}if(p.indexOf("#")>=0)if(0===p.indexOf("/"))u=p.split("#"),s=e.split("//"),l=s[1].split("/"),e=s[0]+"//"+l[0]+u[0],a=u[1];else{if(u=p.split("#"),""!==u[0]){if(l=e.split("/"),l=l.slice(0,l.length-1),!f){e="";for(var h=0;h<l.length;h++)h>0&&(e+="/"),e+=l[h]}e+="/"+p.split("#")[0]}a=u[1]}0===p.indexOf("http")?(p.indexOf("#")>=0?(e=p.split("#")[0],a=p.split("#")[1]):(e=p,a=""),r.push({obj:n,resolveAs:"inline",root:e,key:c,location:a})):0===p.indexOf("#")?(a=p.split("#")[1],r.push({obj:n,resolveAs:"inline",root:e,key:c,location:a})):r.push({obj:n,resolveAs:"inline",root:e,key:c,location:a})}else"array"===n.type&&this.resolveTo(e,n.items,r,a)},a.prototype.resolveTo=function(e,t,n,r){var i,a,o=t.$ref,s=e;if("undefined"!=typeof o){if(o.indexOf("#")>=0){var l=o.split("#");if(l[0]&&0===o.indexOf("/"));else if(l[0]&&0===l[0].indexOf("http"))s=l[0],o=l[1];else if(l[0]&&l[0].length>0){for(i=e.split("/"),s="",a=0;a<i.length-1;a++)s+=i[a]+"/";s+=l[0]}r=l[1]}else if(0===o.indexOf("http://")||0===o.indexOf("https://"))s=o,r="";else{for(i=e.split("/"),s="",a=0;a<i.length-1;a++)s+=i[a]+"/";s+=o,r=""}n.push({obj:t,resolveAs:"ref",root:s,key:o,location:r})}else if("array"===t.type){var u=t.items;this.resolveTo(e,u,n,r)}},a.prototype.resolveAllOf=function(e,t,n){n=n||0,t=t||e;var r;for(var a in t)if(t.hasOwnProperty(a)){var o=t[a];if(null===o)throw new TypeError("Swagger 2.0 does not support null types ("+t+"). See https://github.com/swagger-api/swagger-spec/issues/229.");if("object"==typeof o&&this.resolveAllOf(e,o,n+1),o&&"undefined"!=typeof o.allOf){var s=o.allOf;if(i.isArray(s)){var l={};l["x-composed"]=!0,"undefined"!=typeof o["x-resolved-from"]&&(l["x-resolved-from"]=o["x-resolved-from"]),l.properties={},o.example&&(l.example=o.example);for(var u=0;u<s.length;u++){var c=s[u],p="self";"undefined"!=typeof c["x-resolved-from"]&&(p=c["x-resolved-from"][0]);for(var f in c)if(l.hasOwnProperty(f))if("properties"===f){var h=c[f];for(r in h){l.properties[r]=JSON.parse(JSON.stringify(h[r]));var d=h[r]["x-resolved-from"];("undefined"==typeof d||"self"===d)&&(d=p),l.properties[r]["x-resolved-from"]=d}}else if("required"===f){for(var m=l.required.concat(c[f]),g=0;g<m.length;++g)for(var y=g+1;y<m.length;++y)m[g]===m[y]&&m.splice(y--,1);l.required=m}else"x-resolved-from"===f&&l["x-resolved-from"].push(p);else if(l[f]=JSON.parse(JSON.stringify(c[f])),"properties"===f)for(r in l[f])l[f][r]["x-resolved-from"]=p}t[a]=l}}i.isObject(o)&&this.resolveAllOf(e,o,n+1)}}},{"./http":5,"lodash-compat/lang/isArray":143,"lodash-compat/lang/isObject":147}],7:[function(e,t,n){"use strict";function r(e,t){return'<tr><td class="optionName">'+e+":</td><td>"+t+"</td></tr>"}function i(e,t){var n;return"integer"===e&&"int32"===t?n="integer":"integer"===e&&"int64"===t?n="long":"integer"===e&&"undefined"==typeof t?n="long":"string"===e&&"date-time"===t?n="date-time":"string"===e&&"date"===t?n="date":"number"===e&&"float"===t?n="float":"number"===e&&"double"===t?n="double":"number"===e&&"undefined"==typeof t?n="double":"boolean"===e?n="boolean":"string"===e&&(n="string"),n}function a(e,t){var n="";return"undefined"!=typeof e.$ref?n+=l.simpleRef(e.$ref):"undefined"==typeof e.type?n+="object":"array"===e.type?t?n+=a(e.items||e.$ref||{}):(n+="Array[",
+n+=a(e.items||e.$ref||{}),n+="]"):n+="integer"===e.type&&"int32"===e.format?"integer":"integer"===e.type&&"int64"===e.format?"long":"integer"===e.type&&"undefined"==typeof e.format?"long":"string"===e.type&&"date-time"===e.format?"date-time":"string"===e.type&&"date"===e.format?"date":"string"===e.type&&"undefined"==typeof e.format?"string":"number"===e.type&&"float"===e.format?"float":"number"===e.type&&"double"===e.format?"double":"number"===e.type&&"undefined"==typeof e.format?"double":"boolean"===e.type?"boolean":e.$ref?l.simpleRef(e.$ref):e.type,n}function o(e,t,n,r){e=l.resolveSchema(e),"function"!=typeof r&&(r=function(e){return(e||{})["default"]}),n=n||{};var i,a,s=e.type||"object",c=e.format;return u.isUndefined(e.example)?u.isUndefined(e.items)&&u.isArray(e["enum"])&&(a=e["enum"][0]):a=e.example,u.isUndefined(a)&&(e.$ref?(i=t[l.simpleRef(e.$ref)],u.isUndefined(i)||(u.isUndefined(n[i.name])?(n[i.name]=i,a=o(i.definition,t,n,r),delete n[i.name]):a="array"===i.type?[]:{})):u.isUndefined(e["default"])?"string"===s?a="date-time"===c?(new Date).toISOString():"date"===c?(new Date).toISOString().split("T")[0]:"string":"integer"===s?a=0:"number"===s?a=0:"boolean"===s?a=!0:"object"===s?(a={},u.forEach(e.properties,function(e,i){var s=u.cloneDeep(e);s["default"]=r(e),a[i]=o(s,t,n,r)})):"array"===s&&(a=[],u.isArray(e.items)?u.forEach(e.items,function(e){a.push(o(e,t,n,r))}):u.isPlainObject(e.items)?a.push(o(e.items,t,n,r)):u.isUndefined(e.items)?a.push({}):l.log("Array type's 'items' property is not an array or an object, cannot process")):a=e["default"]),a}function s(e,t,n,i){function a(e,t,r){var i,a=t;return e.$ref?(a=e.title||l.simpleRef(e.$ref),i=n[a]):u.isUndefined(t)&&(a=e.title||"Inline Model "+ ++m,i={definition:e}),r!==!0&&(h[a]=u.isUndefined(i)?{}:i.definition),a}function o(e){var t='<span class="propType">',n=e.type||"object";return e.$ref?t+=a(e,l.simpleRef(e.$ref)):"object"===n?t+=u.isUndefined(e.properties)?"object":a(e):"array"===n?(t+="Array[",u.isArray(e.items)?t+=u.map(e.items,a).join(","):u.isPlainObject(e.items)?t+=u.isUndefined(e.items.$ref)?u.isUndefined(e.items.type)||-1!==u.indexOf(["array","object"],e.items.type)?a(e.items):e.items.type:a(e.items,l.simpleRef(e.items.$ref)):(l.log("Array type's 'items' schema is not an array or an object, cannot process"),t+="object"),t+="]"):t+=e.type,t+="</span>"}function s(e,t){var n="",i=e.type||"object",a="array"===i;switch(a&&(i=u.isPlainObject(e.items)&&!u.isUndefined(e.items.type)?e.items.type:"object"),u.isUndefined(e["default"])||(n+=r("Default",e["default"])),i){case"string":e.minLength&&(n+=r("Min. Length",e.minLength)),e.maxLength&&(n+=r("Max. Length",e.maxLength)),e.pattern&&(n+=r("Reg. Exp.",e.pattern));break;case"integer":case"number":e.minimum&&(n+=r("Min. Value",e.minimum)),e.exclusiveMinimum&&(n+=r("Exclusive Min.","true")),e.maximum&&(n+=r("Max. Value",e.maximum)),e.exclusiveMaximum&&(n+=r("Exclusive Max.","true")),e.multipleOf&&(n+=r("Multiple Of",e.multipleOf))}if(a&&(e.minItems&&(n+=r("Min. Items",e.minItems)),e.maxItems&&(n+=r("Max. Items",e.maxItems)),e.uniqueItems&&(n+=r("Unique Items","true")),e.collectionFormat&&(n+=r("Coll. Format",e.collectionFormat))),u.isUndefined(e.items)&&u.isArray(e["enum"])){var o;o="number"===i||"integer"===i?e["enum"].join(", "):'"'+e["enum"].join('", "')+'"',n+=r("Enum",o)}return n.length>0&&(t='<span class="propWrap">'+t+'<table class="optionsWrapper"><tr><th colspan="2">'+i+"</th></tr>"+n+"</table></span>"),t}function c(e,t){var r=e.type||"object",c="array"===e.type,h=p+t+" "+(c?"[":"{")+f;return t&&d.push(t),c?u.isArray(e.items)?h+="<div>"+u.map(e.items,function(e){var t=e.type||"object";return u.isUndefined(e.$ref)?u.indexOf(["array","object"],t)>-1?"object"===t&&u.isUndefined(e.properties)?"object":a(e):s(e,t):a(e,l.simpleRef(e.$ref))}).join(",</div><div>"):u.isPlainObject(e.items)?h+=u.isUndefined(e.items.$ref)?u.indexOf(["array","object"],e.items.type||"object")>-1?(u.isUndefined(e.items.type)||"object"===e.items.type)&&u.isUndefined(e.items.properties)?"<div>object</div>":"<div>"+a(e.items)+"</div>":"<div>"+s(e.items,e.items.type)+"</div>":"<div>"+a(e.items,l.simpleRef(e.items.$ref))+"</div>":(l.log("Array type's 'items' property is not an array or an object, cannot process"),h+="<div>object</div>"):e.$ref?h+="<div>"+a(e,t)+"</div>":"object"===r?(h+="<div>",u.isPlainObject(e.properties)&&(h+=u.map(e.properties,function(t,r){var a,c=u.indexOf(e.required,r)>=0,p=u.cloneDeep(t),f=c?"required":"",h='<span class="propName '+f+'">'+r+"</span> (";return p["default"]=i(p),p=l.resolveSchema(p),u.isUndefined(p.$ref)||(a=n[l.simpleRef(p.$ref)],u.isUndefined(a)||-1!==u.indexOf([void 0,"array","object"],a.definition.type)||(p=l.resolveSchema(a.definition))),h+=o(p),c||(h+=', <span class="propOptKey">optional</span>'),h+=")",u.isUndefined(p.description)||(h+=': <span class="propDesc">'+p.description+"</span>"),p["enum"]&&(h+=' = <span class="propVals">[\''+p["enum"].join("', '")+"']</span>"),s(p,h)}).join(",</div><div>")),h+="</div>"):h+="<div>"+s(e,r)+"</div>",h+p+(c?"]":"}")+f}var p='<span class="strong">',f="</span>";if(u.isObject(arguments[0])&&(e=void 0,t=arguments[0],n=arguments[1],i=arguments[2]),n=n||{},t=l.resolveSchema(t),u.isEmpty(t))return p+"Empty"+f;if("string"==typeof t.$ref&&(e=l.simpleRef(t.$ref),t=n[e],"undefined"==typeof t))return p+e+" is not defined!"+f;"string"!=typeof e&&(e=t.title||"Inline Model"),t.definition&&(t=t.definition),"function"!=typeof i&&(i=function(e){return(e||{})["default"]});for(var h={},d=[],m=0,g=c(t,e);u.keys(h).length>0;)u.forEach(h,function(e,t){var n=u.indexOf(d,t)>-1;delete h[t],n||(d.push(t),g+="<br />"+c(e,t))});return g}var l=e("./helpers"),u={isPlainObject:e("lodash-compat/lang/isPlainObject"),isUndefined:e("lodash-compat/lang/isUndefined"),isArray:e("lodash-compat/lang/isArray"),isObject:e("lodash-compat/lang/isObject"),isEmpty:e("lodash-compat/lang/isEmpty"),map:e("lodash-compat/collection/map"),indexOf:e("lodash-compat/array/indexOf"),cloneDeep:e("lodash-compat/lang/cloneDeep"),keys:e("lodash-compat/object/keys"),forEach:e("lodash-compat/collection/forEach")};t.exports.optionHtml=r,t.exports.typeFromJsonSchema=i,t.exports.getStringSignature=a,t.exports.schemaToHTML=s,t.exports.schemaToJSON=o},{"./helpers":4,"lodash-compat/array/indexOf":52,"lodash-compat/collection/forEach":57,"lodash-compat/collection/map":59,"lodash-compat/lang/cloneDeep":141,"lodash-compat/lang/isArray":143,"lodash-compat/lang/isEmpty":144,"lodash-compat/lang/isObject":147,"lodash-compat/lang/isPlainObject":148,"lodash-compat/lang/isUndefined":151,"lodash-compat/object/keys":152}],8:[function(e,t,n){"use strict";var r=e("./http"),i={isObject:e("lodash-compat/lang/isObject")},a=t.exports=function(){this.errors=[],this.warnings=[],this.modelMap={}};a.prototype.setDocumentationLocation=function(e){this.docLocation=e},a.prototype.convert=function(e,t,n){if(!e||!Array.isArray(e.apis))return this.finish(n,null);this.clientAuthorizations=t;var r={swagger:"2.0"};r.originalVersion=e.swaggerVersion,this.apiInfo(e,r),this.securityDefinitions(e,r),e.basePath&&this.setDocumentationLocation(e.basePath);var i,a=!1;for(i=0;i<e.apis.length;i++){var o=e.apis[i];Array.isArray(o.operations)&&(a=!0)}a?(this.declaration(e,r),this.finish(n,r)):this.resourceListing(e,r,n)},a.prototype.declaration=function(e,t){var n,r,a,o;if(e.apis){0===e.basePath.indexOf("http://")?(a=e.basePath.substring("http://".length),o=a.indexOf("/"),o>0?(t.host=a.substring(0,o),t.basePath=a.substring(o)):(t.host=a,t.basePath="/")):0===e.basePath.indexOf("https://")?(a=e.basePath.substring("https://".length),o=a.indexOf("/"),o>0?(t.host=a.substring(0,o),t.basePath=a.substring(o)):(t.host=a,t.basePath="/")):t.basePath=e.basePath;var s;if(e.authorizations&&(s=e.authorizations),e.consumes&&(t.consumes=e.consumes),e.produces&&(t.produces=e.produces),i.isObject(e))for(n in e.models){var l=e.models[n],u=l.id||n;this.modelMap[u]=n}for(r=0;r<e.apis.length;r++){var c=e.apis[r],p=c.path,f=c.operations;this.operations(p,e.resourcePath,f,s,t)}var h=e.models||{};this.models(h,t)}},a.prototype.models=function(e,t){if(i.isObject(e)){var n;t.definitions=t.definitions||{};for(n in e){var r,a=e[n],o=[],s={properties:{}};for(r in a.properties){var l=a.properties[r],u={};this.dataType(l,u),l.description&&(u.description=l.description),l["enum"]&&(u["enum"]=l["enum"]),"boolean"==typeof l.required&&l.required===!0&&o.push(r),"string"==typeof l.required&&"true"===l.required&&o.push(r),s.properties[r]=u}o.length>0&&(s["enum"]=o),s.required=a.required,t.definitions[n]=s}}},a.prototype.extractTag=function(e){var t=e||"default";return(0===t.indexOf("http:")||0===t.indexOf("https:"))&&(t=t.split(["/"]),t=t[t.length-1].substring()),t.endsWith(".json")&&(t=t.substring(0,t.length-".json".length)),t.replace("/","")},a.prototype.operations=function(e,t,n,r,i){if(Array.isArray(n)){var a;i.paths||(i.paths={});var o=i.paths[e]||{},s=this.extractTag(t);i.tags=i.tags||[];var l=!1;for(a=0;a<i.tags.length;a++){var u=i.tags[a];u.name===s&&(l=!0)}for(l||i.tags.push({name:s}),a=0;a<n.length;a++){var c=n[a],p=(c.method||c.httpMethod).toLowerCase(),f={tags:[s]},h=c.authorizations;if(h&&0===Object.keys(h).length&&(h=r),"undefined"!=typeof h){var d;for(var m in h){f.security=f.security||[];var g=h[m];if(g){var y=[];for(var v in g)y.push(g[v].scope);d={},d[m]=y,f.security.push(d)}else d={},d[m]=[],f.security.push(d)}}c.consumes?f.consumes=c.consumes:i.consumes&&(f.consumes=i.consumes),c.produces?f.produces=c.produces:i.produces&&(f.produces=i.produces),c.summary&&(f.summary=c.summary),c.notes&&(f.description=c.notes),c.nickname&&(f.operationId=c.nickname),c.deprecated&&(f.deprecated=c.deprecated),this.authorizations(h,i),this.parameters(f,c.parameters,i),this.responseMessages(f,c,i),o[p]=f}i.paths[e]=o}},a.prototype.responseMessages=function(e,t){if(i.isObject(t)){var n={};this.dataType(t,n),!n.schema&&n.type&&(n={schema:n}),e.responses=e.responses||{};var r=!1;if(Array.isArray(t.responseMessages)){var a,o=t.responseMessages;for(a=0;a<o.length;a++){var s=o[a],l={description:s.message};200===s.code&&(r=!0),s.responseModel&&(l.schema={$ref:s.responseModel}),e.responses[""+s.code]=l}}r?e.responses["default"]=n:e.responses[200]=n}},a.prototype.authorizations=function(e){!i.isObject(e)},a.prototype.parameters=function(e,t){if(Array.isArray(t)){var n;for(n=0;n<t.length;n++){var r=t[n],i={};if(i.name=r.name,i.description=r.description,i.required=r.required,i["in"]=r.paramType,"body"===i["in"]&&(i.name="body"),"form"===i["in"]&&(i["in"]="formData"),r["enum"]&&(i["enum"]=r["enum"]),r.allowMultiple===!0||"true"===r.allowMultiple){var a={};if(this.dataType(r,a),i.type="array",i.items=a,r.allowableValues){var o=r.allowableValues;"LIST"===o.valueType&&(i["enum"]=o.values)}}else this.dataType(r,i);"undefined"!=typeof r.defaultValue&&(i["default"]=r.defaultValue),e.parameters=e.parameters||[],e.parameters.push(i)}}},a.prototype.dataType=function(e,t){if(i.isObject(e)){e.minimum&&(t.minimum=e.minimum),e.maximum&&(t.maximum=e.maximum),e.format&&(t.format=e.format),"undefined"!=typeof e.defaultValue&&(t["default"]=e.defaultValue);var n=this.toJsonSchema(e);n&&(t=t||{},n.type&&(t.type=n.type),n.format&&(t.format=n.format),n.$ref&&(t.schema={$ref:n.$ref}),n.items&&(t.items=n.items))}},a.prototype.toJsonSchema=function(e){if(!e)return"object";var t=e.type||e.dataType||e.responseClass||"",n=t.toLowerCase(),r=(e.format||"").toLowerCase();if(0===n.indexOf("list[")){var i=t.substring(5,t.length-1),a=this.toJsonSchema({type:i});return{type:"array",items:a}}if("int"===n||"integer"===n&&"int32"===r)return{type:"integer",format:"int32"};if("long"===n||"integer"===n&&"int64"===r)return{type:"integer",format:"int64"};if("integer"===n)return{type:"integer",format:"int64"};if("float"===n||"number"===n&&"float"===r)return{type:"number",format:"float"};if("double"===n||"number"===n&&"double"===r)return{type:"number",format:"double"};if("string"===n&&"date-time"===r||"date"===n)return{type:"string",format:"date-time"};if("string"===n)return{type:"string"};if("file"===n)return{type:"file"};if("boolean"===n)return{type:"boolean"};if("array"===n||"list"===n){if(e.items){var o=this.toJsonSchema(e.items);return{type:"array",items:o}}return{type:"array",items:{type:"object"}}}return e.$ref?{$ref:"#/definitions/"+this.modelMap[e.$ref]||e.$ref}:"void"===n||""===n?{}:{$ref:"#/definitions/"+this.modelMap[e.type]||e.type}},a.prototype.resourceListing=function(e,t,n){var i,a=0,o=this,s=e.apis.length,l=t;for(0===s&&this.finish(n,t),i=0;s>i;i++){var u=e.apis[i],c=u.path,p=this.getAbsolutePath(e.swaggerVersion,this.docLocation,c);u.description&&(t.tags=t.tags||[],t.tags.push({name:this.extractTag(u.path),description:u.description||""}));var f={url:p,headers:{accept:"application/json"},on:{},method:"get"};f.on.response=function(e){a+=1;var t=e.obj;t&&o.declaration(t,l),a===s&&o.finish(n,l)},f.on.error=function(e){console.error(e),a+=1,a===s&&o.finish(n,l)},this.clientAuthorizations&&"function"==typeof this.clientAuthorizations.apply&&this.clientAuthorizations.apply(f),(new r).execute(f)}},a.prototype.getAbsolutePath=function(e,t,n){if("1.0"===e&&t.endsWith(".json")){var r=t.lastIndexOf("/");r>0&&(t=t.substring(0,r))}var i=t;return 0===n.indexOf("http://")||0===n.indexOf("https://")?i=n:(t.endsWith("/")&&(i=t.substring(0,t.length-1)),i+=n),i=i.replace("{format}","json")},a.prototype.securityDefinitions=function(e,t){if(e.authorizations){var n;for(n in e.authorizations){var r=!1,i={},a=e.authorizations[n];if("apiKey"===a.type)i.type="apiKey",i["in"]=a.passAs,i.name=a.keyname||n,r=!0;else if("oauth2"===a.type){var o,s=a.scopes||[],l={};for(o in s){var u=s[o];l[u.scope]=u.description}if(i.type="oauth2",o>0&&(i.scopes=l),a.grantTypes){if(a.grantTypes.implicit){var c=a.grantTypes.implicit;i.flow="implicit",i.authorizationUrl=c.loginEndpoint,r=!0}if(a.grantTypes.authorization_code&&!i.flow){var p=a.grantTypes.authorization_code;i.flow="accessCode",i.authorizationUrl=p.tokenRequestEndpoint.url,i.tokenUrl=p.tokenEndpoint.url,r=!0}}}r&&(t.securityDefinitions=t.securityDefinitions||{},t.securityDefinitions[n]=i)}}},a.prototype.apiInfo=function(e,t){if(e.info){var n=e.info;t.info={},n.contact&&(t.info.contact={},t.info.contact.email=n.contact),n.description&&(t.info.description=n.description),n.title&&(t.info.title=n.title),n.termsOfServiceUrl&&(t.info.termsOfService=n.termsOfServiceUrl),(n.license||n.licenseUrl)&&(t.license={},n.license&&(t.license.name=n.license),n.licenseUrl&&(t.license.url=n.licenseUrl))}else this.warnings.push("missing info section")},a.prototype.finish=function(e,t){e(t)}},{"./http":5,"lodash-compat/lang/isObject":147}],9:[function(e,t,n){"use strict";var r={isPlainObject:e("lodash-compat/lang/isPlainObject"),isString:e("lodash-compat/lang/isString")},i=e("../schema-markup.js"),a=e("js-yaml"),o=t.exports=function(e,t,n,r){return this.definition=t||{},this.isArray="array"===t.type,this.models=n||{},this.name=t.title||e||"Inline Model",this.modelPropertyMacro=r||function(e){return e["default"]},this};o.prototype.createJSONSample=o.prototype.getSampleValue=function(e){return e=e||{},e[this.name]=this,this.examples&&r.isPlainObject(this.examples)&&this.examples["application/json"]?(this.definition.example=this.examples["application/json"],r.isString(this.definition.example)&&(this.definition.example=a.safeLoad(this.definition.example))):this.definition.example||(this.definition.example=this.examples),i.schemaToJSON(this.definition,this.models,e,this.modelPropertyMacro)},o.prototype.getMockSignature=function(){return i.schemaToHTML(this.name,this.definition,this.models,this.modelPropertyMacro)}},{"../schema-markup.js":7,"js-yaml":21,"lodash-compat/lang/isPlainObject":148,"lodash-compat/lang/isString":149}],10:[function(e,t,n){"use strict";function r(e,t){if(i.isEmpty(t))return e[0];for(var n=0,r=t.length;r>n;n++)if(e.indexOf(t[n])>-1)return t[n];return e[0]}var i={cloneDeep:e("lodash-compat/lang/cloneDeep"),isUndefined:e("lodash-compat/lang/isUndefined"),isEmpty:e("lodash-compat/lang/isEmpty"),isObject:e("lodash-compat/lang/isObject")},a=e("../helpers"),o=e("./model"),s=e("../http"),l=t.exports=function(e,t,n,r,i,a,s,l,u){var c=[];if(e=e||{},a=a||{},e&&e.options&&(this.client=e.options.client||null,this.responseInterceptor=e.options.responseInterceptor||null),this.authorizations=a.security,this.basePath=e.basePath||"/",this.clientAuthorizations=u,this.consumes=a.consumes||e.consumes||["application/json"],this.produces=a.produces||e.produces||["application/json"],this.deprecated=a.deprecated,this.description=a.description,this.host=e.host||"localhost",this.method=r||c.push("Operation "+n+" is missing method."),this.models=l||{},this.nickname=n||c.push("Operations must have a nickname."),this.operation=a,this.operations={},this.parameters=null!==a?a.parameters||[]:{},this.parent=e,this.path=i||c.push("Operation "+this.nickname+" is missing path."),this.responses=a.responses||{},this.scheme=t||e.scheme||"http",this.schemes=a.schemes||e.schemes,this.security=a.security,this.summary=a.summary||"",this.type=null,this.useJQuery=e.useJQuery,this.parameterMacro=e.parameterMacro||function(e,t){return t["default"]},this.inlineModels=[],"string"==typeof this.deprecated)switch(this.deprecated.toLowerCase()){case"true":case"yes":case"1":this.deprecated=!0;break;case"false":case"no":case"0":case null:this.deprecated=!1;break;default:this.deprecated=Boolean(this.deprecated)}var p,f;if(s){var h;for(h in s)f=new o(h,s[h],this.models,e.modelPropertyMacro),f&&(this.models[h]=f)}else s={};for(p=0;p<this.parameters.length;p++){var d=this.parameters[p];d["default"]=this.parameterMacro(this,d),"array"===d.type&&(d.isList=!0,d.allowMultiple=!0,d.items&&d.items["enum"]&&(d["enum"]=d.items["enum"]));var m=this.getType(d);if(m&&"boolean"===m.toString().toLowerCase()&&(d.allowableValues={},d.isList=!0,d["enum"]=[!0,!1]),d["x-examples"]){var g=d["x-examples"]["default"];"undefined"!=typeof g&&(d["default"]=g)}if("undefined"!=typeof d["enum"]){var y;for(d.allowableValues={},d.allowableValues.values=[],d.allowableValues.descriptiveValues=[],y=0;y<d["enum"].length;y++){var v=d["enum"][y],b=v===d["default"]||v+""===d["default"];d.allowableValues.values.push(v),d.allowableValues.descriptiveValues.push({value:v+"",isDefault:b})}}"array"===d.type&&(m=[m],"undefined"==typeof d.allowableValues&&(delete d.isList,delete d.allowMultiple)),d.signature=this.getModelSignature(m,this.models).toString(),d.sampleJSON=this.getModelSampleJSON(m,this.models),d.responseClassSignature=d.signature}var w,x,S=this.responses;if(S[200]?(x=S[200],w="200"):S[201]?(x=S[201],w="201"):S[202]?(x=S[202],w="202"):S[203]?(x=S[203],w="203"):S[204]?(x=S[204],w="204"):S[205]?(x=S[205],w="205"):S[206]?(x=S[206],w="206"):S["default"]&&(x=S["default"],w="default"),x&&x.schema){var A,C=this.resolveModel(x.schema,s);delete S[w],C?(this.successResponse={},A=this.successResponse[w]=C):x.schema.type&&"object"!==x.schema.type&&"array"!==x.schema.type?(this.successResponse={},A=this.successResponse[w]=x.schema):(this.successResponse={},A=this.successResponse[w]=new o(void 0,x.schema||{},this.models,e.modelPropertyMacro)),A&&(x.description&&(A.description=x.description),x.examples&&(A.examples=x.examples),x.headers&&(A.headers=x.headers)),this.type=x}return c.length>0&&this.resource&&this.resource.api&&this.resource.api.fail&&this.resource.api.fail(c),this};l.prototype.isDefaultArrayItemValue=function(e,t){return t["default"]&&Array.isArray(t["default"])?-1!==t["default"].indexOf(e):e===t["default"]},l.prototype.getType=function(e){var t,n=e.type,r=e.format,i=!1;"integer"===n&&"int32"===r?t="integer":"integer"===n&&"int64"===r?t="long":"integer"===n?t="integer":"string"===n?t="date-time"===r?"date-time":"date"===r?"date":"string":"number"===n&&"float"===r?t="float":"number"===n&&"double"===r?t="double":"number"===n?t="double":"boolean"===n?t="boolean":"array"===n&&(i=!0,e.items&&(t=this.getType(e.items))),e.$ref&&(t=a.simpleRef(e.$ref));var o=e.schema;if(o){var s=o.$ref;return s?(s=a.simpleRef(s),i?[s]:s):"object"===o.type?this.addInlineModel(o):this.getType(o)}return i?[t]:t},l.prototype.addInlineModel=function(e){var t=this.inlineModels.length,n=this.resolveModel(e,{});return n?(this.inlineModels.push(n),"Inline Model "+t):null},l.prototype.getInlineModel=function(e){if(/^Inline Model \d+$/.test(e)){var t=parseInt(e.substr("Inline Model".length).trim(),10),n=this.inlineModels[t];return n}return null},l.prototype.resolveModel=function(e,t){if("undefined"!=typeof e.$ref){var n=e.$ref;if(0===n.indexOf("#/definitions/")&&(n=n.substring("#/definitions/".length)),t[n])return new o(n,t[n],this.models,this.parent.modelPropertyMacro)}else if(e&&"object"==typeof e&&("object"===e.type||i.isUndefined(e.type)))return new o(void 0,e,this.models,this.parent.modelPropertyMacro);return null},l.prototype.help=function(e){for(var t=this.nickname+": "+this.summary+"\n",n=0;n<this.parameters.length;n++){var r=this.parameters[n],i=r.signature;t+="\n * "+r.name+" ("+i+"): "+r.description}return"undefined"==typeof e&&a.log(t),t},l.prototype.getModelSignature=function(e,t){var n,r;return e instanceof Array&&(r=!0,e=e[0]),"undefined"==typeof e?(e="undefined",n=!0):t[e]?(e=t[e],n=!1):this.getInlineModel(e)?(e=this.getInlineModel(e),n=!1):n=!0,n?r?"Array["+e+"]":e.toString():r?"Array["+e.getMockSignature()+"]":e.getMockSignature()},l.prototype.supportHeaderParams=function(){return!0},l.prototype.supportedSubmitMethods=function(){return this.parent.supportedSubmitMethods},l.prototype.getHeaderParams=function(e){for(var t=this.setContentTypes(e,{}),n=0;n<this.parameters.length;n++){var r=this.parameters[n];if("undefined"!=typeof e[r.name]&&"header"===r["in"]){var i=e[r.name];Array.isArray(i)&&(i=i.toString()),t[r.name]=i}}return t},l.prototype.urlify=function(e){for(var t={},n=this.path,r="",i=0;i<this.parameters.length;i++){var a=this.parameters[i];if("undefined"!=typeof e[a.name])if("path"===a["in"]){var o=new RegExp("{"+a.name+"}","gi"),s=e[a.name];s=Array.isArray(s)?this.encodePathCollection(a.collectionFormat,a.name,s):this.encodePathParam(s),n=n.replace(o,s)}else if("query"===a["in"]&&"undefined"!=typeof e[a.name])if(r+=""===r?"?":"&","undefined"!=typeof a.collectionFormat){var l=e[a.name];r+=Array.isArray(l)?this.encodeQueryCollection(a.collectionFormat,a.name,l):this.encodeQueryParam(a.name)+"="+this.encodeQueryParam(e[a.name])}else r+=this.encodeQueryParam(a.name)+"="+this.encodeQueryParam(e[a.name]);else"formData"===a["in"]&&(t[a.name]=e[a.name])}var u=this.scheme+"://"+this.host;return"/"!==this.basePath&&(u+=this.basePath),u+n+r},l.prototype.getMissingParams=function(e){var t,n=[];for(t=0;t<this.parameters.length;t++){var r=this.parameters[t];r.required===!0&&"undefined"==typeof e[r.name]&&(n=r.name)}return n},l.prototype.getBody=function(e,t,n){for(var r,i,a,o={},s=!1,l=0;l<this.parameters.length;l++){var u=this.parameters[l];"undefined"!=typeof t[u.name]?"body"===u["in"]?r=t[u.name]:"formData"===u["in"]&&(o[u.name]=t[u.name]):"body"===u["in"]&&(s=!0)}if(s&&"undefined"==typeof r){var c=e["Content-Type"];c&&0===c.indexOf("application/json")&&(r="{}")}if("application/x-www-form-urlencoded"===e["Content-Type"]&&"formData"===u["in"]){var p="";for(i in o)a=o[i],"undefined"!=typeof a&&(""!==p&&(p+="&"),p+=encodeURIComponent(i)+"="+encodeURIComponent(a));r=p}else if(e["Content-Type"]&&e["Content-Type"].indexOf("multipart/form-data")>=0&&n.useJQuery){var f=new FormData;f.type="formData";for(i in o)a=t[i],"undefined"!=typeof a&&("file"===a.type&&a.value?(delete e["Content-Type"],f.append(i,a.value)):f.append(i,a));r=f}return r},l.prototype.getModelSampleJSON=function(e,t){var n,r,a;if(t=t||{},n=e instanceof Array,a=n?e[0]:e,t[a]?r=t[a].createJSONSample():this.getInlineModel(a)&&(r=this.getInlineModel(a).createJSONSample()),r){if(r=n?[r]:r,"string"==typeof r)return r;if(i.isObject(r)){var o=r;if(r instanceof Array&&r.length>0&&(o=r[0]),o.nodeName){var s=(new XMLSerializer).serializeToString(o);return this.formatXml(s)}return JSON.stringify(r,null,2)}return r}},l.prototype["do"]=function(e,t,n,r,i){return this.execute(e,t,n,r,i)},l.prototype.execute=function(e,t,n,r,o){var l,u,c=e||{},p={};i.isObject(t)&&(p=t,l=n,u=r),this.client&&(p.client=this.client),this.responseInterceptor&&(p.responseInterceptor=this.responseInterceptor),"function"==typeof t&&(l=t,u=n),l=l||this.parent.defaultSuccessCallback||a.log,u=u||this.parent.defaultErrorCallback||a.log,"undefined"==typeof p.useJQuery&&(p.useJQuery=this.useJQuery);var f=this.getMissingParams(c);if(f.length>0){var h="missing required params: "+f;return a.fail(h),void u(h)}var d,m=this.getHeaderParams(c),g=this.setContentTypes(c,p),y={};for(d in m)y[d]=m[d];for(d in g)y[d]=g[d];var v=this.getBody(g,c,p),b=this.urlify(c);if(b.indexOf(".{format}")>0&&y){var w=y.Accept||y.accept;w&&w.indexOf("json")>0?b=b.replace(".{format}",".json"):w&&w.indexOf("xml")>0&&(b=b.replace(".{format}",".xml"))}var x={url:b,method:this.method.toUpperCase(),body:v,useJQuery:p.useJQuery,headers:y,on:{response:function(e){return l(e,o)},error:function(e){return u(e,o)}}};return this.clientAuthorizations.apply(x,this.operation.security),p.mock===!0?x:void(new s).execute(x,p)},l.prototype.setContentTypes=function(e,t){var n,i,o=this.parameters,s=e.parameterContentType||r(this.consumes,["application/json","application/yaml"]),l=t.responseContentType||r(this.produces,["application/json","application/yaml"]),u=[],c=[],p={};for(i=0;i<o.length;i++){var f=o[i];if("formData"===f["in"])"file"===f.type?u.push(f):c.push(f);else if("header"===f["in"]&&t){var h=f.name,d=t[f.name];"undefined"!=typeof t[f.name]&&(p[h]=d)}else"body"===f["in"]&&"undefined"!=typeof e[f.name]&&(n=e[f.name])}return"post"===this.method||"put"===this.method||"patch"===this.method||"delete"===this.method&&n?(t.requestContentType&&(s=t.requestContentType),c.length>0&&(s=t.requestContentType?t.requestContentType:u.length>0?"multipart/form-data":"application/x-www-form-urlencoded")):s=null,s&&this.consumes&&-1===this.consumes.indexOf(s)&&a.log("server doesn't consume "+s+", try "+JSON.stringify(this.consumes)),this.matchesAccept(l)||a.log("server can't produce "+l),(s&&""!==n||"application/x-www-form-urlencoded"===s)&&(p["Content-Type"]=s),l&&(p.Accept=l),p},l.prototype.matchesAccept=function(e){return e&&this.produces?-1!==this.produces.indexOf(e)||-1!==this.produces.indexOf("*/*"):!0},l.prototype.asCurl=function(e,t){var n={mock:!0};if("object"==typeof t)for(var r in t)n[r]=t[r];var a=this.execute(e,n);this.clientAuthorizations.apply(a,this.operation.security);var o=[];if(o.push("-X "+this.method.toUpperCase()),a.headers){var s;for(s in a.headers){var l=a.headers[s];"string"==typeof l&&(l=l.replace(/"/g,'\\"')),o.push('--header "'+s+": "+l+'"')}}if(a.body){var u;u=i.isObject(a.body)?JSON.stringify(a.body):a.body,o.push('-d "'+u.replace(/"/g,'\\"')+'"')}return"curl "+o.join(" ")+' "'+a.url+'"'},l.prototype.encodePathCollection=function(e,t,n){var r,i="",a="";for(a="ssv"===e?"%20":"tsv"===e?"\\t":"pipes"===e?"|":",",r=0;r<n.length;r++)0===r?i=this.encodeQueryParam(n[r]):i+=a+this.encodeQueryParam(n[r]);return i},l.prototype.encodeQueryCollection=function(e,t,n){var r,i="";if("default"===e||"multi"===e)for(r=0;r<n.length;r++)r>0&&(i+="&"),i+=this.encodeQueryParam(t)+"="+this.encodeQueryParam(n[r]);else{var a="";if("csv"===e)a=",";else if("ssv"===e)a="%20";else if("tsv"===e)a="\\t";else if("pipes"===e)a="|";else if("brackets"===e)for(r=0;r<n.length;r++)0!==r&&(i+="&"),i+=this.encodeQueryParam(t)+"[]="+this.encodeQueryParam(n[r]);if(""!==a)for(r=0;r<n.length;r++)0===r?i=this.encodeQueryParam(t)+"="+this.encodeQueryParam(n[r]):i+=a+this.encodeQueryParam(n[r])}return i},l.prototype.encodeQueryParam=function(e){return encodeURIComponent(e)},l.prototype.encodePathParam=function(e){return encodeURIComponent(e)}},{"../helpers":4,"../http":5,"./model":9,"lodash-compat/lang/cloneDeep":141,"lodash-compat/lang/isEmpty":144,"lodash-compat/lang/isObject":147,"lodash-compat/lang/isUndefined":151}],11:[function(e,t,n){"use strict";var r=t.exports=function(e,t,n,r){this.description=t,this.externalDocs=n,this.name=e,this.operation=r,this.operationsArray=[],this.path=e,this.tag=e};r.prototype.sort=function(){}},{}],12:[function(e,t,n){},{}],13:[function(e,t,n){function r(){return i.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function i(e){return this instanceof i?(this.length=0,this.parent=void 0,"number"==typeof e?a(this,e):"string"==typeof e?o(this,e,arguments.length>1?arguments[1]:"utf8"):s(this,e)):arguments.length>1?new i(e,arguments[1]):new i(e)}function a(e,t){if(e=h(e,0>t?0:0|d(t)),!i.TYPED_ARRAY_SUPPORT)for(var n=0;t>n;n++)e[n]=0;return e}function o(e,t,n){("string"!=typeof n||""===n)&&(n="utf8");var r=0|g(t,n);return e=h(e,r),e.write(t,n),e}function s(e,t){if(i.isBuffer(t))return l(e,t);if(Y(t))return u(e,t);if(null==t)throw new TypeError("must start with number, buffer, array or string");return"undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer?c(e,t):t.length?p(e,t):f(e,t)}function l(e,t){var n=0|d(t.length);return e=h(e,n),t.copy(e,0,0,n),e}function u(e,t){var n=0|d(t.length);e=h(e,n);for(var r=0;n>r;r+=1)e[r]=255&t[r];return e}function c(e,t){var n=0|d(t.length);e=h(e,n);for(var r=0;n>r;r+=1)e[r]=255&t[r];return e}function p(e,t){var n=0|d(t.length);e=h(e,n);for(var r=0;n>r;r+=1)e[r]=255&t[r];return e}function f(e,t){var n,r=0;"Buffer"===t.type&&Y(t.data)&&(n=t.data,r=0|d(n.length)),e=h(e,r);for(var i=0;r>i;i+=1)e[i]=255&n[i];return e}function h(e,t){i.TYPED_ARRAY_SUPPORT?e=i._augment(new Uint8Array(t)):(e.length=t,e._isBuffer=!0);var n=0!==t&&t<=i.poolSize>>>1;return n&&(e.parent=K),e}function d(e){if(e>=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|e}function m(e,t){if(!(this instanceof m))return new m(e,t);var n=new i(e,t);return delete n.parent,n}function g(e,t){"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"binary":case"raw":case"raws":return n;case"utf8":case"utf-8":return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return H(e).length;default:if(r)return U(e).length;t=(""+t).toLowerCase(),r=!0}}function y(e,t,n){var r=!1;if(t=0|t,n=void 0===n||n===1/0?this.length:0|n,e||(e="utf8"),0>t&&(t=0),n>this.length&&(n=this.length),t>=n)return"";for(;;)switch(e){case"hex":return j(this,t,n);case"utf8":case"utf-8":return E(this,t,n);case"ascii":return k(this,t,n);case"binary":return O(this,t,n);case"base64":return C(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function v(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;var a=t.length;if(a%2!==0)throw new Error("Invalid hex string");r>a/2&&(r=a/2);for(var o=0;r>o;o++){var s=parseInt(t.substr(2*o,2),16);if(isNaN(s))throw new Error("Invalid hex string");e[n+o]=s}return o}function b(e,t,n,r){return z(U(t,e.length-n),e,n,r)}function w(e,t,n,r){return z(B(t),e,n,r)}function x(e,t,n,r){return w(e,t,n,r)}function S(e,t,n,r){return z(H(t),e,n,r)}function A(e,t,n,r){return z(q(t,e.length-n),e,n,r)}function C(e,t,n){return 0===t&&n===e.length?W.fromByteArray(e):W.fromByteArray(e.slice(t,n))}function E(e,t,n){var r="",i="";n=Math.min(e.length,n);for(var a=t;n>a;a++)e[a]<=127?(r+=V(i)+String.fromCharCode(e[a]),i=""):i+="%"+e[a].toString(16);return r+V(i)}function k(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;n>i;i++)r+=String.fromCharCode(127&e[i]);return r}function O(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;n>i;i++)r+=String.fromCharCode(e[i]);return r}function j(e,t,n){var r=e.length;(!t||0>t)&&(t=0),(!n||0>n||n>r)&&(n=r);for(var i="",a=t;n>a;a++)i+=F(e[a]);return i}function T(e,t,n){for(var r=e.slice(t,n),i="",a=0;a<r.length;a+=2)i+=String.fromCharCode(r[a]+256*r[a+1]);
+return i}function I(e,t,n){if(e%1!==0||0>e)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function _(e,t,n,r,a,o){if(!i.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(t>a||o>t)throw new RangeError("value is out of bounds");if(n+r>e.length)throw new RangeError("index out of range")}function D(e,t,n,r){0>t&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-n,2);a>i;i++)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function L(e,t,n,r){0>t&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-n,4);a>i;i++)e[n+i]=t>>>8*(r?i:3-i)&255}function P(e,t,n,r,i,a){if(t>i||a>t)throw new RangeError("value is out of bounds");if(n+r>e.length)throw new RangeError("index out of range");if(0>n)throw new RangeError("index out of range")}function N(e,t,n,r,i){return i||P(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),J.write(e,t,n,r,23,4),n+4}function $(e,t,n,r,i){return i||P(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),J.write(e,t,n,r,52,8),n+8}function M(e){if(e=R(e).replace(X,""),e.length<2)return"";for(;e.length%4!==0;)e+="=";return e}function R(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function F(e){return 16>e?"0"+e.toString(16):e.toString(16)}function U(e,t){t=t||1/0;for(var n,r=e.length,i=null,a=[],o=0;r>o;o++){if(n=e.charCodeAt(o),n>55295&&57344>n){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(56320>n){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&((t-=3)>-1&&a.push(239,191,189),i=null);if(128>n){if((t-=1)<0)break;a.push(n)}else if(2048>n){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(65536>n){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(2097152>n))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function B(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t}function q(e,t){for(var n,r,i,a=[],o=0;o<e.length&&!((t-=2)<0);o++)n=e.charCodeAt(o),r=n>>8,i=n%256,a.push(i),a.push(r);return a}function H(e){return W.toByteArray(M(e))}function z(e,t,n,r){for(var i=0;r>i&&!(i+n>=t.length||i>=e.length);i++)t[i+n]=e[i];return i}function V(e){try{return decodeURIComponent(e)}catch(t){return String.fromCharCode(65533)}}var W=e("base64-js"),J=e("ieee754"),Y=e("is-array");n.Buffer=i,n.SlowBuffer=m,n.INSPECT_MAX_BYTES=50,i.poolSize=8192;var K={};i.TYPED_ARRAY_SUPPORT=function(){function e(){}try{var t=new ArrayBuffer(0),n=new Uint8Array(t);return n.foo=function(){return 42},n.constructor=e,42===n.foo()&&n.constructor===e&&"function"==typeof n.subarray&&0===new Uint8Array(1).subarray(1,1).byteLength}catch(r){return!1}}(),i.isBuffer=function(e){return!(null==e||!e._isBuffer)},i.compare=function(e,t){if(!i.isBuffer(e)||!i.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,a=0,o=Math.min(n,r);o>a&&e[a]===t[a];)++a;return a!==o&&(n=e[a],r=t[a]),r>n?-1:n>r?1:0},i.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(e,t){if(!Y(e))throw new TypeError("list argument must be an Array of Buffers.");if(0===e.length)return new i(0);if(1===e.length)return e[0];var n;if(void 0===t)for(t=0,n=0;n<e.length;n++)t+=e[n].length;var r=new i(t),a=0;for(n=0;n<e.length;n++){var o=e[n];o.copy(r,a),a+=o.length}return r},i.byteLength=g,i.prototype.length=void 0,i.prototype.parent=void 0,i.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?E(this,0,e):y.apply(this,arguments)},i.prototype.equals=function(e){if(!i.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:0===i.compare(this,e)},i.prototype.inspect=function(){var e="",t=n.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},i.prototype.compare=function(e){if(!i.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?0:i.compare(this,e)},i.prototype.indexOf=function(e,t){function n(e,t,n){for(var r=-1,i=0;n+i<e.length;i++)if(e[n+i]===t[-1===r?0:i-r]){if(-1===r&&(r=i),i-r+1===t.length)return n+r}else r=-1;return-1}if(t>2147483647?t=2147483647:-2147483648>t&&(t=-2147483648),t>>=0,0===this.length)return-1;if(t>=this.length)return-1;if(0>t&&(t=Math.max(this.length+t,0)),"string"==typeof e)return 0===e.length?-1:String.prototype.indexOf.call(this,e,t);if(i.isBuffer(e))return n(this,e,t);if("number"==typeof e)return i.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,e,t):n(this,[e],t);throw new TypeError("val must be string, number or Buffer")},i.prototype.get=function(e){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(e)},i.prototype.set=function(e,t){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(e,t)},i.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else if(isFinite(t))t=0|t,isFinite(n)?(n=0|n,void 0===r&&(r="utf8")):(r=n,n=void 0);else{var i=r;r=t,t=0|n,n=i}var a=this.length-t;if((void 0===n||n>a)&&(n=a),e.length>0&&(0>n||0>t)||t>this.length)throw new RangeError("attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return v(this,e,t,n);case"utf8":case"utf-8":return b(this,e,t,n);case"ascii":return w(this,e,t,n);case"binary":return x(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},i.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,0>e?(e+=n,0>e&&(e=0)):e>n&&(e=n),0>t?(t+=n,0>t&&(t=0)):t>n&&(t=n),e>t&&(t=e);var r;if(i.TYPED_ARRAY_SUPPORT)r=i._augment(this.subarray(e,t));else{var a=t-e;r=new i(a,void 0);for(var o=0;a>o;o++)r[o]=this[o+e]}return r.length&&(r.parent=this.parent||this),r},i.prototype.readUIntLE=function(e,t,n){e=0|e,t=0|t,n||I(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r},i.prototype.readUIntBE=function(e,t,n){e=0|e,t=0|t,n||I(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},i.prototype.readUInt8=function(e,t){return t||I(e,1,this.length),this[e]},i.prototype.readUInt16LE=function(e,t){return t||I(e,2,this.length),this[e]|this[e+1]<<8},i.prototype.readUInt16BE=function(e,t){return t||I(e,2,this.length),this[e]<<8|this[e+1]},i.prototype.readUInt32LE=function(e,t){return t||I(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},i.prototype.readUInt32BE=function(e,t){return t||I(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},i.prototype.readIntLE=function(e,t,n){e=0|e,t=0|t,n||I(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*t)),r},i.prototype.readIntBE=function(e,t,n){e=0|e,t=0|t,n||I(e,t,this.length);for(var r=t,i=1,a=this[e+--r];r>0&&(i*=256);)a+=this[e+--r]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*t)),a},i.prototype.readInt8=function(e,t){return t||I(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},i.prototype.readInt16LE=function(e,t){t||I(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt16BE=function(e,t){t||I(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt32LE=function(e,t){return t||I(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},i.prototype.readInt32BE=function(e,t){return t||I(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},i.prototype.readFloatLE=function(e,t){return t||I(e,4,this.length),J.read(this,e,!0,23,4)},i.prototype.readFloatBE=function(e,t){return t||I(e,4,this.length),J.read(this,e,!1,23,4)},i.prototype.readDoubleLE=function(e,t){return t||I(e,8,this.length),J.read(this,e,!0,52,8)},i.prototype.readDoubleBE=function(e,t){return t||I(e,8,this.length),J.read(this,e,!1,52,8)},i.prototype.writeUIntLE=function(e,t,n,r){e=+e,t=0|t,n=0|n,r||_(this,e,t,n,Math.pow(2,8*n),0);var i=1,a=0;for(this[t]=255&e;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},i.prototype.writeUIntBE=function(e,t,n,r){e=+e,t=0|t,n=0|n,r||_(this,e,t,n,Math.pow(2,8*n),0);var i=n-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},i.prototype.writeUInt8=function(e,t,n){return e=+e,t=0|t,n||_(this,e,t,1,255,0),i.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=e,t+1},i.prototype.writeUInt16LE=function(e,t,n){return e=+e,t=0|t,n||_(this,e,t,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[t]=e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},i.prototype.writeUInt16BE=function(e,t,n){return e=+e,t=0|t,n||_(this,e,t,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e):D(this,e,t,!1),t+2},i.prototype.writeUInt32LE=function(e,t,n){return e=+e,t=0|t,n||_(this,e,t,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e):L(this,e,t,!0),t+4},i.prototype.writeUInt32BE=function(e,t,n){return e=+e,t=0|t,n||_(this,e,t,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e):L(this,e,t,!1),t+4},i.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t=0|t,!r){var i=Math.pow(2,8*n-1);_(this,e,t,n,i-1,-i)}var a=0,o=1,s=0>e?1:0;for(this[t]=255&e;++a<n&&(o*=256);)this[t+a]=(e/o>>0)-s&255;return t+n},i.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t=0|t,!r){var i=Math.pow(2,8*n-1);_(this,e,t,n,i-1,-i)}var a=n-1,o=1,s=0>e?1:0;for(this[t+a]=255&e;--a>=0&&(o*=256);)this[t+a]=(e/o>>0)-s&255;return t+n},i.prototype.writeInt8=function(e,t,n){return e=+e,t=0|t,n||_(this,e,t,1,127,-128),i.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),0>e&&(e=255+e+1),this[t]=e,t+1},i.prototype.writeInt16LE=function(e,t,n){return e=+e,t=0|t,n||_(this,e,t,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[t]=e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},i.prototype.writeInt16BE=function(e,t,n){return e=+e,t=0|t,n||_(this,e,t,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e):D(this,e,t,!1),t+2},i.prototype.writeInt32LE=function(e,t,n){return e=+e,t=0|t,n||_(this,e,t,4,2147483647,-2147483648),i.TYPED_ARRAY_SUPPORT?(this[t]=e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):L(this,e,t,!0),t+4},i.prototype.writeInt32BE=function(e,t,n){return e=+e,t=0|t,n||_(this,e,t,4,2147483647,-2147483648),0>e&&(e=4294967295+e+1),i.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e):L(this,e,t,!1),t+4},i.prototype.writeFloatLE=function(e,t,n){return N(this,e,t,!0,n)},i.prototype.writeFloatBE=function(e,t,n){return N(this,e,t,!1,n)},i.prototype.writeDoubleLE=function(e,t,n){return $(this,e,t,!0,n)},i.prototype.writeDoubleBE=function(e,t,n){return $(this,e,t,!1,n)},i.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&n>r&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(0>t)throw new RangeError("targetStart out of bounds");if(0>n||n>=this.length)throw new RangeError("sourceStart out of bounds");if(0>r)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var a=r-n;if(1e3>a||!i.TYPED_ARRAY_SUPPORT)for(var o=0;a>o;o++)e[o+t]=this[o+n];else e._set(this.subarray(n,n+a),t);return a},i.prototype.fill=function(e,t,n){if(e||(e=0),t||(t=0),n||(n=this.length),t>n)throw new RangeError("end < start");if(n!==t&&0!==this.length){if(0>t||t>=this.length)throw new RangeError("start out of bounds");if(0>n||n>this.length)throw new RangeError("end out of bounds");var r;if("number"==typeof e)for(r=t;n>r;r++)this[r]=e;else{var i=U(e.toString()),a=i.length;for(r=t;n>r;r++)this[r]=i[r%a]}return this}},i.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(i.TYPED_ARRAY_SUPPORT)return new i(this).buffer;for(var e=new Uint8Array(this.length),t=0,n=e.length;n>t;t+=1)e[t]=this[t];return e.buffer}throw new TypeError("Buffer.toArrayBuffer not supported in this browser")};var Q=i.prototype;i._augment=function(e){return e.constructor=i,e._isBuffer=!0,e._set=e.set,e.get=Q.get,e.set=Q.set,e.write=Q.write,e.toString=Q.toString,e.toLocaleString=Q.toString,e.toJSON=Q.toJSON,e.equals=Q.equals,e.compare=Q.compare,e.indexOf=Q.indexOf,e.copy=Q.copy,e.slice=Q.slice,e.readUIntLE=Q.readUIntLE,e.readUIntBE=Q.readUIntBE,e.readUInt8=Q.readUInt8,e.readUInt16LE=Q.readUInt16LE,e.readUInt16BE=Q.readUInt16BE,e.readUInt32LE=Q.readUInt32LE,e.readUInt32BE=Q.readUInt32BE,e.readIntLE=Q.readIntLE,e.readIntBE=Q.readIntBE,e.readInt8=Q.readInt8,e.readInt16LE=Q.readInt16LE,e.readInt16BE=Q.readInt16BE,e.readInt32LE=Q.readInt32LE,e.readInt32BE=Q.readInt32BE,e.readFloatLE=Q.readFloatLE,e.readFloatBE=Q.readFloatBE,e.readDoubleLE=Q.readDoubleLE,e.readDoubleBE=Q.readDoubleBE,e.writeUInt8=Q.writeUInt8,e.writeUIntLE=Q.writeUIntLE,e.writeUIntBE=Q.writeUIntBE,e.writeUInt16LE=Q.writeUInt16LE,e.writeUInt16BE=Q.writeUInt16BE,e.writeUInt32LE=Q.writeUInt32LE,e.writeUInt32BE=Q.writeUInt32BE,e.writeIntLE=Q.writeIntLE,e.writeIntBE=Q.writeIntBE,e.writeInt8=Q.writeInt8,e.writeInt16LE=Q.writeInt16LE,e.writeInt16BE=Q.writeInt16BE,e.writeInt32LE=Q.writeInt32LE,e.writeInt32BE=Q.writeInt32BE,e.writeFloatLE=Q.writeFloatLE,e.writeFloatBE=Q.writeFloatBE,e.writeDoubleLE=Q.writeDoubleLE,e.writeDoubleBE=Q.writeDoubleBE,e.fill=Q.fill,e.inspect=Q.inspect,e.toArrayBuffer=Q.toArrayBuffer,e};var X=/[^+\/0-9A-z\-]/g},{"base64-js":14,ieee754:15,"is-array":16}],14:[function(e,t,n){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(e){"use strict";function t(e){var t=e.charCodeAt(0);return t===o||t===p?62:t===s||t===f?63:l>t?-1:l+10>t?t-l+26+26:c+26>t?t-c:u+26>t?t-u+26:void 0}function n(e){function n(e){u[p++]=e}var r,i,o,s,l,u;if(e.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var c=e.length;l="="===e.charAt(c-2)?2:"="===e.charAt(c-1)?1:0,u=new a(3*e.length/4-l),o=l>0?e.length-4:e.length;var p=0;for(r=0,i=0;o>r;r+=4,i+=3)s=t(e.charAt(r))<<18|t(e.charAt(r+1))<<12|t(e.charAt(r+2))<<6|t(e.charAt(r+3)),n((16711680&s)>>16),n((65280&s)>>8),n(255&s);return 2===l?(s=t(e.charAt(r))<<2|t(e.charAt(r+1))>>4,n(255&s)):1===l&&(s=t(e.charAt(r))<<10|t(e.charAt(r+1))<<4|t(e.charAt(r+2))>>2,n(s>>8&255),n(255&s)),u}function i(e){function t(e){return r.charAt(e)}function n(e){return t(e>>18&63)+t(e>>12&63)+t(e>>6&63)+t(63&e)}var i,a,o,s=e.length%3,l="";for(i=0,o=e.length-s;o>i;i+=3)a=(e[i]<<16)+(e[i+1]<<8)+e[i+2],l+=n(a);switch(s){case 1:a=e[e.length-1],l+=t(a>>2),l+=t(a<<4&63),l+="==";break;case 2:a=(e[e.length-2]<<8)+e[e.length-1],l+=t(a>>10),l+=t(a>>4&63),l+=t(a<<2&63),l+="="}return l}var a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="+".charCodeAt(0),s="/".charCodeAt(0),l="0".charCodeAt(0),u="a".charCodeAt(0),c="A".charCodeAt(0),p="-".charCodeAt(0),f="_".charCodeAt(0);e.toByteArray=n,e.fromByteArray=i}("undefined"==typeof n?this.base64js={}:n)},{}],15:[function(e,t,n){n.read=function(e,t,n,r,i){var a,o,s=8*i-r-1,l=(1<<s)-1,u=l>>1,c=-7,p=n?i-1:0,f=n?-1:1,h=e[t+p];for(p+=f,a=h&(1<<-c)-1,h>>=-c,c+=s;c>0;a=256*a+e[t+p],p+=f,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=r;c>0;o=256*o+e[t+p],p+=f,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:(h?-1:1)*(1/0);o+=Math.pow(2,r),a-=u}return(h?-1:1)*o*Math.pow(2,a-r)},n.write=function(e,t,n,r,i,a){var o,s,l,u=8*a-i-1,c=(1<<u)-1,p=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:a-1,d=r?1:-1,m=0>t||0===t&&0>1/t?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),t+=o+p>=1?f/l:f*Math.pow(2,1-p),t*l>=2&&(o++,l/=2),o+p>=c?(s=0,o=c):o+p>=1?(s=(t*l-1)*Math.pow(2,i),o+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,i),o=0));i>=8;e[n+h]=255&s,h+=d,s/=256,i-=8);for(o=o<<i|s,u+=i;u>0;e[n+h]=255&o,h+=d,o/=256,u-=8);e[n+h-d]|=128*m}},{}],16:[function(e,t,n){var r=Array.isArray,i=Object.prototype.toString;t.exports=r||function(e){return!!e&&"[object Array]"==i.call(e)}},{}],17:[function(e,t,n){function r(){if(!s){s=!0;for(var e,t=o.length;t;){e=o,o=[];for(var n=-1;++n<t;)e[n]();t=o.length}s=!1}}function i(){}var a=t.exports={},o=[],s=!1;a.nextTick=function(e){o.push(e),s||setTimeout(r,0)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=i,a.addListener=i,a.once=i,a.off=i,a.removeListener=i,a.removeAllListeners=i,a.emit=i,a.binding=function(e){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(e){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},{}],18:[function(e,t,n){(function(e){!function(){"use strict";function n(t){var n;return n=t instanceof e?t:new e(t.toString(),"binary"),n.toString("base64")}t.exports=n}()}).call(this,e("buffer").Buffer)},{buffer:13}],19:[function(e,t,n){!function(){"use strict";function e(t,n,r,i){return this instanceof e?(this.domain=t||void 0,this.path=n||"/",this.secure=!!r,this.script=!!i,this):new e(t,n,r,i)}function t(e,n,r){return e instanceof t?e:this instanceof t?(this.name=null,this.value=null,this.expiration_date=1/0,this.path=String(r||"/"),this.explicit_path=!1,this.domain=n||null,this.explicit_domain=!1,this.secure=!1,this.noscript=!1,e&&this.parse(e,n,r),this):new t(e)}function r(){var e,n,i;return this instanceof r?(e=Object.create(null),this.setCookie=function(r,a,o){var s,l;if(r=new t(r,a,o),s=r.expiration_date<=Date.now(),void 0!==e[r.name]){for(n=e[r.name],l=0;l<n.length;l+=1)if(i=n[l],i.collidesWith(r))return s?(n.splice(l,1),0===n.length&&delete e[r.name],!1):(n[l]=r,r);return s?!1:(n.push(r),r)}return s?!1:(e[r.name]=[r],e[r.name])},this.getCookie=function(t,r){var i,a;if(n=e[t])for(a=0;a<n.length;a+=1)if(i=n[a],i.expiration_date<=Date.now())0===n.length&&delete e[i.name];else if(i.matches(r))return i},this.getCookies=function(t){var n,r,i=[];for(n in e)r=this.getCookie(n,t),r&&i.push(r);return i.toString=function(){return i.join(":")},i.toValueString=function(){return i.map(function(e){return e.toValueString()}).join(";")},i},this):new r}n.CookieAccessInfo=e,n.Cookie=t,t.prototype.toString=function(){var e=[this.name+"="+this.value];return this.expiration_date!==1/0&&e.push("expires="+new Date(this.expiration_date).toGMTString()),this.domain&&e.push("domain="+this.domain),this.path&&e.push("path="+this.path),this.secure&&e.push("secure"),this.noscript&&e.push("httponly"),e.join("; ")},t.prototype.toValueString=function(){return this.name+"="+this.value};var i=/[:](?=\s*[a-zA-Z0-9_\-]+\s*[=])/g;t.prototype.parse=function(e,n,r){if(this instanceof t){var i,a=e.split(";").filter(function(e){return!!e}),o=a[0].match(/([^=]+)=([\s\S]*)/),s=o[1],l=o[2];for(this.name=s,this.value=l,i=1;i<a.length;i+=1)switch(o=a[i].match(/([^=]+)(?:=([\s\S]*))?/),s=o[1].trim().toLowerCase(),l=o[2],s){case"httponly":this.noscript=!0;break;case"expires":this.expiration_date=l?Number(Date.parse(l)):1/0;break;case"path":this.path=l?l.trim():"",this.explicit_path=!0;break;case"domain":this.domain=l?l.trim():"",this.explicit_domain=!!this.domain;break;case"secure":this.secure=!0}return this.explicit_path||(this.path=r||"/"),this.explicit_domain||(this.domain=n),this}return(new t).parse(e,n,r)},t.prototype.matches=function(e){return this.noscript&&e.script||this.secure&&!e.secure||!this.collidesWith(e)?!1:!0},t.prototype.collidesWith=function(e){if(this.path&&!e.path||this.domain&&!e.domain)return!1;if(this.path&&0!==e.path.indexOf(this.path))return!1;if(!this.explicit_path&&this.path!==e.path)return!1;var t=e.domain&&e.domain.replace(/^[\.]/,""),n=this.domain&&this.domain.replace(/^[\.]/,"");if(n===t)return!0;if(n){if(!this.explicit_domain)return!1;var r=t.indexOf(n);return-1===r||r!==t.length-n.length?!1:!0}return!0},n.CookieJar=r,r.prototype.setCookies=function(e,n,r){e=Array.isArray(e)?e:e.split(i);var a,o,s=[];for(e=e.map(t),a=0;a<e.length;a+=1)o=e[a],this.setCookie(o,n,r)&&s.push(o);return s}}()},{}],20:[function(t,n,r){!function(e,t){"object"==typeof n&&"object"==typeof n.exports?n.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(t,n){function r(e){var t="length"in e&&e.length,n=ee.type(e);return"function"===n||ee.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e}function i(e,t,n){if(ee.isFunction(t))return ee.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return ee.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(le.test(t))return ee.filter(t,e,n);t=ee.filter(t,e)}return ee.grep(e,function(e){return J.call(t,e)>=0!==n})}function a(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function o(e){var t=me[e]={};return ee.each(e.match(de)||[],function(e,n){t[n]=!0}),t}function s(){G.removeEventListener("DOMContentLoaded",s,!1),t.removeEventListener("load",s,!1),ee.ready()}function l(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=ee.expando+l.uid++}function u(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(xe,"-$1").toLowerCase(),n=e.getAttribute(r),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:we.test(n)?ee.parseJSON(n):n}catch(i){}be.set(e,t,n)}else n=void 0;return n}function c(){return!0}function p(){return!1}function f(){try{return G.activeElement}catch(e){}}function h(e,t){return ee.nodeName(e,"table")&&ee.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function d(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function m(e){var t=Me.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function g(e,t){for(var n=0,r=e.length;r>n;n++)ve.set(e[n],"globalEval",!t||ve.get(t[n],"globalEval"))}function y(e,t){var n,r,i,a,o,s,l,u;if(1===t.nodeType){if(ve.hasData(e)&&(a=ve.access(e),o=ve.set(t,a),u=a.events)){delete o.handle,o.events={};for(i in u)for(n=0,r=u[i].length;r>n;n++)ee.event.add(t,i,u[i][n])}be.hasData(e)&&(s=be.access(e),l=ee.extend({},s),be.set(t,l))}}function v(e,t){var n=e.getElementsByTagName?e.getElementsByTagName(t||"*"):e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&ee.nodeName(e,t)?ee.merge([e],n):n}function b(e,t){var n=t.nodeName.toLowerCase();"input"===n&&Ee.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}function w(e,n){var r,i=ee(n.createElement(e)).appendTo(n.body),a=t.getDefaultComputedStyle&&(r=t.getDefaultComputedStyle(i[0]))?r.display:ee.css(i[0],"display");return i.detach(),a}function x(e){var t=G,n=Be[e];return n||(n=w(e,t),"none"!==n&&n||(Ue=(Ue||ee("<iframe frameborder='0' width='0' height='0'/>")).appendTo(t.documentElement),t=Ue[0].contentDocument,t.write(),t.close(),n=w(e,t),Ue.detach()),Be[e]=n),n}function S(e,t,n){var r,i,a,o,s=e.style;return n=n||ze(e),n&&(o=n.getPropertyValue(t)||n[t]),n&&(""!==o||ee.contains(e.ownerDocument,e)||(o=ee.style(e,t)),He.test(o)&&qe.test(t)&&(r=s.width,i=s.minWidth,a=s.maxWidth,s.minWidth=s.maxWidth=s.width=o,o=n.width,s.width=r,s.minWidth=i,s.maxWidth=a)),void 0!==o?o+"":o}function A(e,t){return{get:function(){return e()?void delete this.get:(this.get=t).apply(this,arguments)}}}function C(e,t){if(t in e)return t;for(var n=t[0].toUpperCase()+t.slice(1),r=t,i=Qe.length;i--;)if(t=Qe[i]+n,t in e)return t;return r}function E(e,t,n){var r=We.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function k(e,t,n,r,i){for(var a=n===(r?"border":"content")?4:"width"===t?1:0,o=0;4>a;a+=2)"margin"===n&&(o+=ee.css(e,n+Ae[a],!0,i)),r?("content"===n&&(o-=ee.css(e,"padding"+Ae[a],!0,i)),"margin"!==n&&(o-=ee.css(e,"border"+Ae[a]+"Width",!0,i))):(o+=ee.css(e,"padding"+Ae[a],!0,i),"padding"!==n&&(o+=ee.css(e,"border"+Ae[a]+"Width",!0,i)));return o}function O(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,a=ze(e),o="border-box"===ee.css(e,"boxSizing",!1,a);if(0>=i||null==i){if(i=S(e,t,a),(0>i||null==i)&&(i=e.style[t]),He.test(i))return i;r=o&&(X.boxSizingReliable()||i===e.style[t]),i=parseFloat(i)||0}return i+k(e,t,n||(o?"border":"content"),r,a)+"px"}function j(e,t){for(var n,r,i,a=[],o=0,s=e.length;s>o;o++)r=e[o],r.style&&(a[o]=ve.get(r,"olddisplay"),n=r.style.display,t?(a[o]||"none"!==n||(r.style.display=""),""===r.style.display&&Ce(r)&&(a[o]=ve.access(r,"olddisplay",x(r.nodeName)))):(i=Ce(r),"none"===n&&i||ve.set(r,"olddisplay",i?n:ee.css(r,"display"))));for(o=0;s>o;o++)r=e[o],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?a[o]||"":"none"));return e}function T(e,t,n,r,i){return new T.prototype.init(e,t,n,r,i)}function I(){return setTimeout(function(){Xe=void 0}),Xe=ee.now()}function _(e,t){var n,r=0,i={height:e};for(t=t?1:0;4>r;r+=2-t)n=Ae[r],i["margin"+n]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function D(e,t,n){for(var r,i=(rt[t]||[]).concat(rt["*"]),a=0,o=i.length;o>a;a++)if(r=i[a].call(n,t,e))return r}function L(e,t,n){var r,i,a,o,s,l,u,c,p=this,f={},h=e.style,d=e.nodeType&&Ce(e),m=ve.get(e,"fxshow");n.queue||(s=ee._queueHooks(e,"fx"),null==s.unqueued&&(s.unqueued=0,l=s.empty.fire,s.empty.fire=function(){s.unqueued||l()}),s.unqueued++,p.always(function(){p.always(function(){s.unqueued--,ee.queue(e,"fx").length||s.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],u=ee.css(e,"display"),c="none"===u?ve.get(e,"olddisplay")||x(e.nodeName):u,"inline"===c&&"none"===ee.css(e,"float")&&(h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]}));for(r in t)if(i=t[r],Ze.exec(i)){if(delete t[r],a=a||"toggle"===i,i===(d?"hide":"show")){if("show"!==i||!m||void 0===m[r])continue;d=!0}f[r]=m&&m[r]||ee.style(e,r)}else u=void 0;if(ee.isEmptyObject(f))"inline"===("none"===u?x(e.nodeName):u)&&(h.display=u);else{m?"hidden"in m&&(d=m.hidden):m=ve.access(e,"fxshow",{}),a&&(m.hidden=!d),d?ee(e).show():p.done(function(){ee(e).hide()}),p.done(function(){var t;ve.remove(e,"fxshow");for(t in f)ee.style(e,t,f[t])});for(r in f)o=D(d?m[r]:0,r,p),r in m||(m[r]=o.start,d&&(o.end=o.start,o.start="width"===r||"height"===r?1:0))}}function P(e,t){var n,r,i,a,o;for(n in e)if(r=ee.camelCase(n),i=t[r],a=e[n],ee.isArray(a)&&(i=a[1],a=e[n]=a[0]),n!==r&&(e[r]=a,delete e[n]),o=ee.cssHooks[r],o&&"expand"in o){a=o.expand(a),delete e[r];for(n in a)n in e||(e[n]=a[n],t[n]=i)}else t[r]=i}function N(e,t,n){var r,i,a=0,o=nt.length,s=ee.Deferred().always(function(){delete l.elem}),l=function(){if(i)return!1;for(var t=Xe||I(),n=Math.max(0,u.startTime+u.duration-t),r=n/u.duration||0,a=1-r,o=0,l=u.tweens.length;l>o;o++)u.tweens[o].run(a);return s.notifyWith(e,[u,a,n]),1>a&&l?n:(s.resolveWith(e,[u]),!1)},u=s.promise({elem:e,props:ee.extend({},t),opts:ee.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xe||I(),duration:n.duration,tweens:[],createTween:function(t,n){var r=ee.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(r),r},stop:function(t){var n=0,r=t?u.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)u.tweens[n].run(1);return t?s.resolveWith(e,[u,t]):s.rejectWith(e,[u,t]),this}}),c=u.props;for(P(c,u.opts.specialEasing);o>a;a++)if(r=nt[a].call(u,e,c,u.opts))return r;return ee.map(c,D,u),ee.isFunction(u.opts.start)&&u.opts.start.call(e,u),ee.fx.timer(ee.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}function $(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,a=t.toLowerCase().match(de)||[];if(ee.isFunction(n))for(;r=a[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function M(e,t,n,r){function i(s){var l;return a[s]=!0,ee.each(e[s]||[],function(e,s){var u=s(t,n,r);return"string"!=typeof u||o||a[u]?o?!(l=u):void 0:(t.dataTypes.unshift(u),i(u),!1)}),l}var a={},o=e===wt;return i(t.dataTypes[0])||!a["*"]&&i("*")}function R(e,t){var n,r,i=ee.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&ee.extend(!0,e,r),e}function F(e,t,n){for(var r,i,a,o,s=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){l.unshift(i);break}if(l[0]in n)a=l[0];else{for(i in n){if(!l[0]||e.converters[i+" "+l[0]]){a=i;break}o||(o=i)}a=a||o}return a?(a!==l[0]&&l.unshift(a),n[a]):void 0}function U(e,t,n,r){var i,a,o,s,l,u={},c=e.dataTypes.slice();if(c[1])for(o in e.converters)u[o.toLowerCase()]=e.converters[o];for(a=c.shift();a;)if(e.responseFields[a]&&(n[e.responseFields[a]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=a,a=c.shift())if("*"===a)a=l;else if("*"!==l&&l!==a){if(o=u[l+" "+a]||u["* "+a],!o)for(i in u)if(s=i.split(" "),s[1]===a&&(o=u[l+" "+s[0]]||u["* "+s[0]])){o===!0?o=u[i]:u[i]!==!0&&(a=s[0],c.unshift(s[1]));break}if(o!==!0)if(o&&e["throws"])t=o(t);else try{t=o(t)}catch(p){return{state:"parsererror",error:o?p:"No conversion from "+l+" to "+a}}}return{state:"success",data:t}}function B(e,t,n,r){var i;if(ee.isArray(t))ee.each(t,function(t,i){n||Et.test(e)?r(e,i):B(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==ee.type(t))r(e,t);else for(i in t)B(e+"["+i+"]",t[i],n,r)}function q(e){return ee.isWindow(e)?e:9===e.nodeType&&e.defaultView}var H=[],z=H.slice,V=H.concat,W=H.push,J=H.indexOf,Y={},K=Y.toString,Q=Y.hasOwnProperty,X={},G=t.document,Z="2.1.4",ee=function(e,t){return new ee.fn.init(e,t)},te=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,ne=/^-ms-/,re=/-([\da-z])/gi,ie=function(e,t){return t.toUpperCase()};ee.fn=ee.prototype={jquery:Z,constructor:ee,selector:"",length:0,toArray:function(){return z.call(this)},get:function(e){return null!=e?0>e?this[e+this.length]:this[e]:z.call(this)},pushStack:function(e){var t=ee.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return ee.each(this,e,t)},map:function(e){return this.pushStack(ee.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(z.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:W,sort:H.sort,splice:H.splice},ee.extend=ee.fn.extend=function(){var e,t,n,r,i,a,o=arguments[0]||{},s=1,l=arguments.length,u=!1;for("boolean"==typeof o&&(u=o,o=arguments[s]||{},s++),"object"==typeof o||ee.isFunction(o)||(o={}),s===l&&(o=this,s--);l>s;s++)if(null!=(e=arguments[s]))for(t in e)n=o[t],r=e[t],o!==r&&(u&&r&&(ee.isPlainObject(r)||(i=ee.isArray(r)))?(i?(i=!1,a=n&&ee.isArray(n)?n:[]):a=n&&ee.isPlainObject(n)?n:{},o[t]=ee.extend(u,a,r)):void 0!==r&&(o[t]=r));return o},ee.extend({expando:"jQuery"+(Z+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isFunction:function(e){return"function"===ee.type(e)},isArray:Array.isArray,isWindow:function(e){return null!=e&&e===e.window},isNumeric:function(e){return!ee.isArray(e)&&e-parseFloat(e)+1>=0},isPlainObject:function(e){return"object"!==ee.type(e)||e.nodeType||ee.isWindow(e)?!1:e.constructor&&!Q.call(e.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?Y[K.call(e)]||"object":typeof e;
+},globalEval:function(e){var t,n=eval;e=ee.trim(e),e&&(1===e.indexOf("use strict")?(t=G.createElement("script"),t.text=e,G.head.appendChild(t).parentNode.removeChild(t)):n(e))},camelCase:function(e){return e.replace(ne,"ms-").replace(re,ie)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var i,a=0,o=e.length,s=r(e);if(n){if(s)for(;o>a&&(i=t.apply(e[a],n),i!==!1);a++);else for(a in e)if(i=t.apply(e[a],n),i===!1)break}else if(s)for(;o>a&&(i=t.call(e[a],a,e[a]),i!==!1);a++);else for(a in e)if(i=t.call(e[a],a,e[a]),i===!1)break;return e},trim:function(e){return null==e?"":(e+"").replace(te,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(r(Object(e))?ee.merge(n,"string"==typeof e?[e]:e):W.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:J.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;n>r;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r,i=[],a=0,o=e.length,s=!n;o>a;a++)r=!t(e[a],a),r!==s&&i.push(e[a]);return i},map:function(e,t,n){var i,a=0,o=e.length,s=r(e),l=[];if(s)for(;o>a;a++)i=t(e[a],a,n),null!=i&&l.push(i);else for(a in e)i=t(e[a],a,n),null!=i&&l.push(i);return V.apply([],l)},guid:1,proxy:function(e,t){var n,r,i;return"string"==typeof t&&(n=e[t],t=e,e=n),ee.isFunction(e)?(r=z.call(arguments,2),i=function(){return e.apply(t||this,r.concat(z.call(arguments)))},i.guid=e.guid=e.guid||ee.guid++,i):void 0},now:Date.now,support:X}),ee.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){Y["[object "+t+"]"]=t.toLowerCase()});var ae=function(e){function t(e,t,n,r){var i,a,o,s,l,u,p,h,d,m;if((t?t.ownerDocument||t:U)!==D&&_(t),t=t||D,n=n||[],s=t.nodeType,"string"!=typeof e||!e||1!==s&&9!==s&&11!==s)return n;if(!r&&P){if(11!==s&&(i=ve.exec(e)))if(o=i[1]){if(9===s){if(a=t.getElementById(o),!a||!a.parentNode)return n;if(a.id===o)return n.push(a),n}else if(t.ownerDocument&&(a=t.ownerDocument.getElementById(o))&&R(t,a)&&a.id===o)return n.push(a),n}else{if(i[2])return G.apply(n,t.getElementsByTagName(e)),n;if((o=i[3])&&x.getElementsByClassName)return G.apply(n,t.getElementsByClassName(o)),n}if(x.qsa&&(!N||!N.test(e))){if(h=p=F,d=t,m=1!==s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(u=E(e),(p=t.getAttribute("id"))?h=p.replace(we,"\\$&"):t.setAttribute("id",h),h="[id='"+h+"'] ",l=u.length;l--;)u[l]=h+f(u[l]);d=be.test(e)&&c(t.parentNode)||t,m=u.join(",")}if(m)try{return G.apply(n,d.querySelectorAll(m)),n}catch(g){}finally{p||t.removeAttribute("id")}}}return O(e.replace(le,"$1"),t,n,r)}function n(){function e(n,r){return t.push(n+" ")>S.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[F]=!0,e}function i(e){var t=D.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function a(e,t){for(var n=e.split("|"),r=e.length;r--;)S.attrHandle[n[r]]=t}function o(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||J)-(~e.sourceIndex||J);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function u(e){return r(function(t){return t=+t,r(function(n,r){for(var i,a=e([],n.length,t),o=a.length;o--;)n[i=a[o]]&&(n[i]=!(r[i]=n[i]))})})}function c(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function p(){}function f(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function h(e,t,n){var r=t.dir,i=n&&"parentNode"===r,a=q++;return t.first?function(t,n,a){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,a)}:function(t,n,o){var s,l,u=[B,a];if(o){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,o))return!0}else for(;t=t[r];)if(1===t.nodeType||i){if(l=t[F]||(t[F]={}),(s=l[r])&&s[0]===B&&s[1]===a)return u[2]=s[2];if(l[r]=u,u[2]=e(t,n,o))return!0}}}function d(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function m(e,n,r){for(var i=0,a=n.length;a>i;i++)t(e,n[i],r);return r}function g(e,t,n,r,i){for(var a,o=[],s=0,l=e.length,u=null!=t;l>s;s++)(a=e[s])&&(!n||n(a,r,i))&&(o.push(a),u&&t.push(s));return o}function y(e,t,n,i,a,o){return i&&!i[F]&&(i=y(i)),a&&!a[F]&&(a=y(a,o)),r(function(r,o,s,l){var u,c,p,f=[],h=[],d=o.length,y=r||m(t||"*",s.nodeType?[s]:s,[]),v=!e||!r&&t?y:g(y,f,e,s,l),b=n?a||(r?e:d||i)?[]:o:v;if(n&&n(v,b,s,l),i)for(u=g(b,h),i(u,[],s,l),c=u.length;c--;)(p=u[c])&&(b[h[c]]=!(v[h[c]]=p));if(r){if(a||e){if(a){for(u=[],c=b.length;c--;)(p=b[c])&&u.push(v[c]=p);a(null,b=[],u,l)}for(c=b.length;c--;)(p=b[c])&&(u=a?ee(r,p):f[c])>-1&&(r[u]=!(o[u]=p))}}else b=g(b===o?b.splice(d,b.length):b),a?a(null,o,b,l):G.apply(o,b)})}function v(e){for(var t,n,r,i=e.length,a=S.relative[e[0].type],o=a||S.relative[" "],s=a?1:0,l=h(function(e){return e===t},o,!0),u=h(function(e){return ee(t,e)>-1},o,!0),c=[function(e,n,r){var i=!a&&(r||n!==j)||((t=n).nodeType?l(e,n,r):u(e,n,r));return t=null,i}];i>s;s++)if(n=S.relative[e[s].type])c=[h(d(c),n)];else{if(n=S.filter[e[s].type].apply(null,e[s].matches),n[F]){for(r=++s;i>r&&!S.relative[e[r].type];r++);return y(s>1&&d(c),s>1&&f(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(le,"$1"),n,r>s&&v(e.slice(s,r)),i>r&&v(e=e.slice(r)),i>r&&f(e))}c.push(n)}return d(c)}function b(e,n){var i=n.length>0,a=e.length>0,o=function(r,o,s,l,u){var c,p,f,h=0,d="0",m=r&&[],y=[],v=j,b=r||a&&S.find.TAG("*",u),w=B+=null==v?1:Math.random()||.1,x=b.length;for(u&&(j=o!==D&&o);d!==x&&null!=(c=b[d]);d++){if(a&&c){for(p=0;f=e[p++];)if(f(c,o,s)){l.push(c);break}u&&(B=w)}i&&((c=!f&&c)&&h--,r&&m.push(c))}if(h+=d,i&&d!==h){for(p=0;f=n[p++];)f(m,y,o,s);if(r){if(h>0)for(;d--;)m[d]||y[d]||(y[d]=Q.call(l));y=g(y)}G.apply(l,y),u&&!r&&y.length>0&&h+n.length>1&&t.uniqueSort(l)}return u&&(B=w,j=v),m};return i?r(o):o}var w,x,S,A,C,E,k,O,j,T,I,_,D,L,P,N,$,M,R,F="sizzle"+1*new Date,U=e.document,B=0,q=0,H=n(),z=n(),V=n(),W=function(e,t){return e===t&&(I=!0),0},J=1<<31,Y={}.hasOwnProperty,K=[],Q=K.pop,X=K.push,G=K.push,Z=K.slice,ee=function(e,t){for(var n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1},te="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",ne="[\\x20\\t\\r\\n\\f]",re="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",ie=re.replace("w","w#"),ae="\\["+ne+"*("+re+")(?:"+ne+"*([*^$|!~]?=)"+ne+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+ie+"))|)"+ne+"*\\]",oe=":("+re+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+ae+")*)|.*)\\)|)",se=new RegExp(ne+"+","g"),le=new RegExp("^"+ne+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ne+"+$","g"),ue=new RegExp("^"+ne+"*,"+ne+"*"),ce=new RegExp("^"+ne+"*([>+~]|"+ne+")"+ne+"*"),pe=new RegExp("="+ne+"*([^\\]'\"]*?)"+ne+"*\\]","g"),fe=new RegExp(oe),he=new RegExp("^"+ie+"$"),de={ID:new RegExp("^#("+re+")"),CLASS:new RegExp("^\\.("+re+")"),TAG:new RegExp("^("+re.replace("w","w*")+")"),ATTR:new RegExp("^"+ae),PSEUDO:new RegExp("^"+oe),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ne+"*(even|odd|(([+-]|)(\\d*)n|)"+ne+"*(?:([+-]|)"+ne+"*(\\d+)|))"+ne+"*\\)|)","i"),bool:new RegExp("^(?:"+te+")$","i"),needsContext:new RegExp("^"+ne+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ne+"*((?:-\\d)?\\d*)"+ne+"*\\)|)(?=[^-]|$)","i")},me=/^(?:input|select|textarea|button)$/i,ge=/^h\d$/i,ye=/^[^{]+\{\s*\[native \w/,ve=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,be=/[+~]/,we=/'|\\/g,xe=new RegExp("\\\\([\\da-f]{1,6}"+ne+"?|("+ne+")|.)","ig"),Se=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},Ae=function(){_()};try{G.apply(K=Z.call(U.childNodes),U.childNodes),K[U.childNodes.length].nodeType}catch(Ce){G={apply:K.length?function(e,t){X.apply(e,Z.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}x=t.support={},C=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},_=t.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:U;return r!==D&&9===r.nodeType&&r.documentElement?(D=r,L=r.documentElement,n=r.defaultView,n&&n!==n.top&&(n.addEventListener?n.addEventListener("unload",Ae,!1):n.attachEvent&&n.attachEvent("onunload",Ae)),P=!C(r),x.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),x.getElementsByTagName=i(function(e){return e.appendChild(r.createComment("")),!e.getElementsByTagName("*").length}),x.getElementsByClassName=ye.test(r.getElementsByClassName),x.getById=i(function(e){return L.appendChild(e).id=F,!r.getElementsByName||!r.getElementsByName(F).length}),x.getById?(S.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&P){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},S.filter.ID=function(e){var t=e.replace(xe,Se);return function(e){return e.getAttribute("id")===t}}):(delete S.find.ID,S.filter.ID=function(e){var t=e.replace(xe,Se);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),S.find.TAG=x.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):x.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,a=t.getElementsByTagName(e);if("*"===e){for(;n=a[i++];)1===n.nodeType&&r.push(n);return r}return a},S.find.CLASS=x.getElementsByClassName&&function(e,t){return P?t.getElementsByClassName(e):void 0},$=[],N=[],(x.qsa=ye.test(r.querySelectorAll))&&(i(function(e){L.appendChild(e).innerHTML="<a id='"+F+"'></a><select id='"+F+"-\f]' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&N.push("[*^$]="+ne+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||N.push("\\["+ne+"*(?:value|"+te+")"),e.querySelectorAll("[id~="+F+"-]").length||N.push("~="),e.querySelectorAll(":checked").length||N.push(":checked"),e.querySelectorAll("a#"+F+"+*").length||N.push(".#.+[+~]")}),i(function(e){var t=r.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&N.push("name"+ne+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||N.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),N.push(",.*:")})),(x.matchesSelector=ye.test(M=L.matches||L.webkitMatchesSelector||L.mozMatchesSelector||L.oMatchesSelector||L.msMatchesSelector))&&i(function(e){x.disconnectedMatch=M.call(e,"div"),M.call(e,"[s!='']:x"),$.push("!=",oe)}),N=N.length&&new RegExp(N.join("|")),$=$.length&&new RegExp($.join("|")),t=ye.test(L.compareDocumentPosition),R=t||ye.test(L.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},W=t?function(e,t){if(e===t)return I=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!x.sortDetached&&t.compareDocumentPosition(e)===n?e===r||e.ownerDocument===U&&R(U,e)?-1:t===r||t.ownerDocument===U&&R(U,t)?1:T?ee(T,e)-ee(T,t):0:4&n?-1:1)}:function(e,t){if(e===t)return I=!0,0;var n,i=0,a=e.parentNode,s=t.parentNode,l=[e],u=[t];if(!a||!s)return e===r?-1:t===r?1:a?-1:s?1:T?ee(T,e)-ee(T,t):0;if(a===s)return o(e,t);for(n=e;n=n.parentNode;)l.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;l[i]===u[i];)i++;return i?o(l[i],u[i]):l[i]===U?-1:u[i]===U?1:0},r):D},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==D&&_(e),n=n.replace(pe,"='$1']"),x.matchesSelector&&P&&(!$||!$.test(n))&&(!N||!N.test(n)))try{var r=M.call(e,n);if(r||x.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(i){}return t(n,D,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==D&&_(e),R(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==D&&_(e);var n=S.attrHandle[t.toLowerCase()],r=n&&Y.call(S.attrHandle,t.toLowerCase())?n(e,t,!P):void 0;return void 0!==r?r:x.attributes||!P?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],r=0,i=0;if(I=!x.detectDuplicates,T=!x.sortStable&&e.slice(0),e.sort(W),I){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return T=null,e},A=t.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=A(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=A(t);return n},S=t.selectors={cacheLength:50,createPseudo:r,match:de,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(xe,Se),e[3]=(e[3]||e[4]||e[5]||"").replace(xe,Se),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return de.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&fe.test(n)&&(t=E(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(xe,Se).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=H[e+" "];return t||(t=new RegExp("(^|"+ne+")"+e+"("+ne+"|$)"))&&H(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,r){return function(i){var a=t.attr(i,e);return null==a?"!="===n:n?(a+="","="===n?a===r:"!="===n?a!==r:"^="===n?r&&0===a.indexOf(r):"*="===n?r&&a.indexOf(r)>-1:"$="===n?r&&a.slice(-r.length)===r:"~="===n?(" "+a.replace(se," ")+" ").indexOf(r)>-1:"|="===n?a===r||a.slice(0,r.length+1)===r+"-":!1):!0}},CHILD:function(e,t,n,r,i){var a="nth"!==e.slice(0,3),o="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,p,f,h,d,m=a!==o?"nextSibling":"previousSibling",g=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!l&&!s;if(g){if(a){for(;m;){for(p=t;p=p[m];)if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;d=m="only"===e&&!d&&"nextSibling"}return!0}if(d=[o?g.firstChild:g.lastChild],o&&v){for(c=g[F]||(g[F]={}),u=c[e]||[],h=u[0]===B&&u[1],f=u[0]===B&&u[2],p=h&&g.childNodes[h];p=++h&&p&&p[m]||(f=h=0)||d.pop();)if(1===p.nodeType&&++f&&p===t){c[e]=[B,h,f];break}}else if(v&&(u=(t[F]||(t[F]={}))[e])&&u[0]===B)f=u[1];else for(;(p=++h&&p&&p[m]||(f=h=0)||d.pop())&&((s?p.nodeName.toLowerCase()!==y:1!==p.nodeType)||!++f||(v&&((p[F]||(p[F]={}))[e]=[B,f]),p!==t)););return f-=i,f===r||f%r===0&&f/r>=0}}},PSEUDO:function(e,n){var i,a=S.pseudos[e]||S.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return a[F]?a(n):a.length>1?(i=[e,e,"",n],S.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,t){for(var r,i=a(e,n),o=i.length;o--;)r=ee(e,i[o]),e[r]=!(t[r]=i[o])}):function(e){return a(e,0,i)}):a}},pseudos:{not:r(function(e){var t=[],n=[],i=k(e.replace(le,"$1"));return i[F]?r(function(e,t,n,r){for(var a,o=i(e,null,r,[]),s=e.length;s--;)(a=o[s])&&(e[s]=!(t[s]=a))}):function(e,r,a){return t[0]=e,i(t,null,a,n),t[0]=null,!n.pop()}}),has:r(function(e){return function(n){return t(e,n).length>0}}),contains:r(function(e){return e=e.replace(xe,Se),function(t){return(t.textContent||t.innerText||A(t)).indexOf(e)>-1}}),lang:r(function(e){return he.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(xe,Se).toLowerCase(),function(t){var n;do if(n=P?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===L},focus:function(e){return e===D.activeElement&&(!D.hasFocus||D.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!S.pseudos.empty(e)},header:function(e){return ge.test(e.nodeName)},input:function(e){return me.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:u(function(){return[0]}),last:u(function(e,t){return[t-1]}),eq:u(function(e,t,n){return[0>n?n+t:n]}),even:u(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:u(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:u(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:u(function(e,t,n){for(var r=0>n?n+t:n;++r<t;)e.push(r);return e})}},S.pseudos.nth=S.pseudos.eq;for(w in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})S.pseudos[w]=s(w);for(w in{submit:!0,reset:!0})S.pseudos[w]=l(w);return p.prototype=S.filters=S.pseudos,S.setFilters=new p,E=t.tokenize=function(e,n){var r,i,a,o,s,l,u,c=z[e+" "];if(c)return n?0:c.slice(0);for(s=e,l=[],u=S.preFilter;s;){(!r||(i=ue.exec(s)))&&(i&&(s=s.slice(i[0].length)||s),l.push(a=[])),r=!1,(i=ce.exec(s))&&(r=i.shift(),a.push({value:r,type:i[0].replace(le," ")}),s=s.slice(r.length));for(o in S.filter)!(i=de[o].exec(s))||u[o]&&!(i=u[o](i))||(r=i.shift(),a.push({value:r,type:o,matches:i}),s=s.slice(r.length));if(!r)break}return n?s.length:s?t.error(e):z(e,l).slice(0)},k=t.compile=function(e,t){var n,r=[],i=[],a=V[e+" "];if(!a){for(t||(t=E(e)),n=t.length;n--;)a=v(t[n]),a[F]?r.push(a):i.push(a);a=V(e,b(i,r)),a.selector=e}return a},O=t.select=function(e,t,n,r){var i,a,o,s,l,u="function"==typeof e&&e,p=!r&&E(e=u.selector||e);if(n=n||[],1===p.length){if(a=p[0]=p[0].slice(0),a.length>2&&"ID"===(o=a[0]).type&&x.getById&&9===t.nodeType&&P&&S.relative[a[1].type]){if(t=(S.find.ID(o.matches[0].replace(xe,Se),t)||[])[0],!t)return n;u&&(t=t.parentNode),e=e.slice(a.shift().value.length)}for(i=de.needsContext.test(e)?0:a.length;i--&&(o=a[i],!S.relative[s=o.type]);)if((l=S.find[s])&&(r=l(o.matches[0].replace(xe,Se),be.test(a[0].type)&&c(t.parentNode)||t))){if(a.splice(i,1),e=r.length&&f(a),!e)return G.apply(n,r),n;break}}return(u||k(e,p))(r,t,!P,n,be.test(e)&&c(t.parentNode)||t),n},x.sortStable=F.split("").sort(W).join("")===F,x.detectDuplicates=!!I,_(),x.sortDetached=i(function(e){return 1&e.compareDocumentPosition(D.createElement("div"))}),i(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||a("type|href|height|width",function(e,t,n){return n?void 0:e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),x.attributes&&i(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||a("value",function(e,t,n){return n||"input"!==e.nodeName.toLowerCase()?void 0:e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||a(te,function(e,t,n){var r;return n?void 0:e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),t}(t);ee.find=ae,ee.expr=ae.selectors,ee.expr[":"]=ee.expr.pseudos,ee.unique=ae.uniqueSort,ee.text=ae.getText,ee.isXMLDoc=ae.isXML,ee.contains=ae.contains;var oe=ee.expr.match.needsContext,se=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,le=/^.[^:#\[\.,]*$/;ee.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?ee.find.matchesSelector(r,e)?[r]:[]:ee.find.matches(e,ee.grep(t,function(e){return 1===e.nodeType}))},ee.fn.extend({find:function(e){var t,n=this.length,r=[],i=this;if("string"!=typeof e)return this.pushStack(ee(e).filter(function(){for(t=0;n>t;t++)if(ee.contains(i[t],this))return!0}));for(t=0;n>t;t++)ee.find(e,i[t],r);return r=this.pushStack(n>1?ee.unique(r):r),r.selector=this.selector?this.selector+" "+e:e,r},filter:function(e){return this.pushStack(i(this,e||[],!1))},not:function(e){return this.pushStack(i(this,e||[],!0))},is:function(e){return!!i(this,"string"==typeof e&&oe.test(e)?ee(e):e||[],!1).length}});var ue,ce=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,pe=ee.fn.init=function(e,t){var n,r;if(!e)return this;if("string"==typeof e){if(n="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:ce.exec(e),!n||!n[1]&&t)return!t||t.jquery?(t||ue).find(e):this.constructor(t).find(e);if(n[1]){if(t=t instanceof ee?t[0]:t,ee.merge(this,ee.parseHTML(n[1],t&&t.nodeType?t.ownerDocument||t:G,!0)),se.test(n[1])&&ee.isPlainObject(t))for(n in t)ee.isFunction(this[n])?this[n](t[n]):this.attr(n,t[n]);return this}return r=G.getElementById(n[2]),r&&r.parentNode&&(this.length=1,this[0]=r),this.context=G,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):ee.isFunction(e)?"undefined"!=typeof ue.ready?ue.ready(e):e(ee):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),ee.makeArray(e,this))};pe.prototype=ee.fn,ue=ee(G);var fe=/^(?:parents|prev(?:Until|All))/,he={children:!0,contents:!0,next:!0,prev:!0};ee.extend({dir:function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&ee(e).is(n))break;r.push(e)}return r},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}}),ee.fn.extend({has:function(e){var t=ee(e,this),n=t.length;return this.filter(function(){for(var e=0;n>e;e++)if(ee.contains(this,t[e]))return!0})},closest:function(e,t){for(var n,r=0,i=this.length,a=[],o=oe.test(e)||"string"!=typeof e?ee(e,t||this.context):0;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(o?o.index(n)>-1:1===n.nodeType&&ee.find.matchesSelector(n,e))){a.push(n);break}return this.pushStack(a.length>1?ee.unique(a):a)},index:function(e){return e?"string"==typeof e?J.call(ee(e),this[0]):J.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(ee.unique(ee.merge(this.get(),ee(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),ee.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return ee.dir(e,"parentNode")},parentsUntil:function(e,t,n){return ee.dir(e,"parentNode",n)},next:function(e){return a(e,"nextSibling")},prev:function(e){return a(e,"previousSibling")},nextAll:function(e){return ee.dir(e,"nextSibling")},prevAll:function(e){return ee.dir(e,"previousSibling")},nextUntil:function(e,t,n){return ee.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return ee.dir(e,"previousSibling",n)},siblings:function(e){return ee.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return ee.sibling(e.firstChild)},contents:function(e){return e.contentDocument||ee.merge([],e.childNodes)}},function(e,t){ee.fn[e]=function(n,r){var i=ee.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=ee.filter(r,i)),this.length>1&&(he[e]||ee.unique(i),fe.test(e)&&i.reverse()),this.pushStack(i)}});var de=/\S+/g,me={};ee.Callbacks=function(e){e="string"==typeof e?me[e]||o(e):ee.extend({},e);var t,n,r,i,a,s,l=[],u=!e.once&&[],c=function(o){for(t=e.memory&&o,n=!0,s=i||0,i=0,a=l.length,r=!0;l&&a>s;s++)if(l[s].apply(o[0],o[1])===!1&&e.stopOnFalse){t=!1;break}r=!1,l&&(u?u.length&&c(u.shift()):t?l=[]:p.disable())},p={add:function(){if(l){var n=l.length;!function o(t){ee.each(t,function(t,n){var r=ee.type(n);"function"===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==r&&o(n)})}(arguments),r?a=l.length:t&&(i=n,c(t))}return this},remove:function(){return l&&ee.each(arguments,function(e,t){for(var n;(n=ee.inArray(t,l,n))>-1;)l.splice(n,1),r&&(a>=n&&a--,s>=n&&s--)}),this},has:function(e){return e?ee.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],a=0,this},disable:function(){return l=u=t=void 0,this},disabled:function(){return!l},lock:function(){return u=void 0,t||p.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!l||n&&!u||(t=t||[],t=[e,t.slice?t.slice():t],r?u.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!n}};return p},ee.extend({Deferred:function(e){var t=[["resolve","done",ee.Callbacks("once memory"),"resolved"],["reject","fail",ee.Callbacks("once memory"),"rejected"],["notify","progress",ee.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return ee.Deferred(function(n){ee.each(t,function(t,a){var o=ee.isFunction(e[t])&&e[t];i[a[1]](function(){var e=o&&o.apply(this,arguments);e&&ee.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a[0]+"With"](this===r?n.promise():this,o?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?ee.extend(e,r):r}},i={};return r.pipe=r.then,ee.each(t,function(e,a){var o=a[2],s=a[3];r[a[1]]=o.add,s&&o.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[a[0]]=function(){return i[a[0]+"With"](this===i?r:this,arguments),this},i[a[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t,n,r,i=0,a=z.call(arguments),o=a.length,s=1!==o||e&&ee.isFunction(e.promise)?o:0,l=1===s?e:ee.Deferred(),u=function(e,n,r){return function(i){n[e]=this,r[e]=arguments.length>1?z.call(arguments):i,r===t?l.notifyWith(n,r):--s||l.resolveWith(n,r)}};if(o>1)for(t=new Array(o),n=new Array(o),r=new Array(o);o>i;i++)a[i]&&ee.isFunction(a[i].promise)?a[i].promise().done(u(i,r,a)).fail(l.reject).progress(u(i,n,t)):--s;return s||l.resolveWith(r,a),l.promise()}});var ge;ee.fn.ready=function(e){return ee.ready.promise().done(e),this},ee.extend({isReady:!1,readyWait:1,holdReady:function(e){e?ee.readyWait++:ee.ready(!0)},ready:function(e){(e===!0?--ee.readyWait:ee.isReady)||(ee.isReady=!0,e!==!0&&--ee.readyWait>0||(ge.resolveWith(G,[ee]),ee.fn.triggerHandler&&(ee(G).triggerHandler("ready"),ee(G).off("ready"))))}}),ee.ready.promise=function(e){return ge||(ge=ee.Deferred(),"complete"===G.readyState?setTimeout(ee.ready):(G.addEventListener("DOMContentLoaded",s,!1),t.addEventListener("load",s,!1))),ge.promise(e)},ee.ready.promise();var ye=ee.access=function(e,t,n,r,i,a,o){var s=0,l=e.length,u=null==n;if("object"===ee.type(n)){i=!0;for(s in n)ee.access(e,t,s,n[s],!0,a,o)}else if(void 0!==r&&(i=!0,ee.isFunction(r)||(o=!0),u&&(o?(t.call(e,r),t=null):(u=t,t=function(e,t,n){return u.call(ee(e),n)})),t))for(;l>s;s++)t(e[s],n,o?r:r.call(e[s],s,t(e[s],n)));return i?e:u?t.call(e):l?t(e[0],n):a};ee.acceptData=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType},l.uid=1,l.accepts=ee.acceptData,l.prototype={key:function(e){if(!l.accepts(e))return 0;var t={},n=e[this.expando];if(!n){n=l.uid++;try{t[this.expando]={value:n},Object.defineProperties(e,t)}catch(r){t[this.expando]=n,ee.extend(e,t)}}return this.cache[n]||(this.cache[n]={}),n},set:function(e,t,n){var r,i=this.key(e),a=this.cache[i];if("string"==typeof t)a[t]=n;else if(ee.isEmptyObject(a))ee.extend(this.cache[i],t);else for(r in t)a[r]=t[r];return a},get:function(e,t){var n=this.cache[this.key(e)];return void 0===t?n:n[t]},access:function(e,t,n){var r;return void 0===t||t&&"string"==typeof t&&void 0===n?(r=this.get(e,t),void 0!==r?r:this.get(e,ee.camelCase(t))):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r,i,a=this.key(e),o=this.cache[a];if(void 0===t)this.cache[a]={};else{ee.isArray(t)?r=t.concat(t.map(ee.camelCase)):(i=ee.camelCase(t),t in o?r=[t,i]:(r=i,r=r in o?[r]:r.match(de)||[])),n=r.length;for(;n--;)delete o[r[n]]}},hasData:function(e){return!ee.isEmptyObject(this.cache[e[this.expando]]||{})},discard:function(e){e[this.expando]&&delete this.cache[e[this.expando]]}};var ve=new l,be=new l,we=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,xe=/([A-Z])/g;ee.extend({hasData:function(e){return be.hasData(e)||ve.hasData(e)},data:function(e,t,n){return be.access(e,t,n)},removeData:function(e,t){be.remove(e,t)},_data:function(e,t,n){return ve.access(e,t,n)},_removeData:function(e,t){ve.remove(e,t)}}),ee.fn.extend({data:function(e,t){var n,r,i,a=this[0],o=a&&a.attributes;if(void 0===e){if(this.length&&(i=be.get(a),1===a.nodeType&&!ve.get(a,"hasDataAttrs"))){for(n=o.length;n--;)o[n]&&(r=o[n].name,0===r.indexOf("data-")&&(r=ee.camelCase(r.slice(5)),u(a,r,i[r])));ve.set(a,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each(function(){be.set(this,e)}):ye(this,function(t){var n,r=ee.camelCase(e);if(a&&void 0===t){if(n=be.get(a,e),void 0!==n)return n;if(n=be.get(a,r),void 0!==n)return n;if(n=u(a,r,void 0),void 0!==n)return n}else this.each(function(){var n=be.get(this,r);be.set(this,r,t),-1!==e.indexOf("-")&&void 0!==n&&be.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){be.remove(this,e)})}}),ee.extend({queue:function(e,t,n){var r;return e?(t=(t||"fx")+"queue",r=ve.get(e,t),n&&(!r||ee.isArray(n)?r=ve.access(e,t,ee.makeArray(n)):r.push(n)),r||[]):void 0},dequeue:function(e,t){t=t||"fx";var n=ee.queue(e,t),r=n.length,i=n.shift(),a=ee._queueHooks(e,t),o=function(){ee.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete a.stop,i.call(e,o,a)),!r&&a&&a.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return ve.get(e,n)||ve.access(e,n,{empty:ee.Callbacks("once memory").add(function(){ve.remove(e,[t+"queue",n])})})}}),ee.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?ee.queue(this[0],e):void 0===t?this:this.each(function(){var n=ee.queue(this,e,t);ee._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&ee.dequeue(this,e)})},dequeue:function(e){return this.each(function(){ee.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=ee.Deferred(),a=this,o=this.length,s=function(){--r||i.resolveWith(a,[a])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";o--;)n=ve.get(a[o],e+"queueHooks"),n&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var Se=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,Ae=["Top","Right","Bottom","Left"],Ce=function(e,t){return e=t||e,"none"===ee.css(e,"display")||!ee.contains(e.ownerDocument,e)},Ee=/^(?:checkbox|radio)$/i;!function(){var e=G.createDocumentFragment(),t=e.appendChild(G.createElement("div")),n=G.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),t.appendChild(n),X.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="<textarea>x</textarea>",X.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue}();var ke="undefined";X.focusinBubbles="onfocusin"in t;var Oe=/^key/,je=/^(?:mouse|pointer|contextmenu)|click/,Te=/^(?:focusinfocus|focusoutblur)$/,Ie=/^([^.]*)(?:\.(.+)|)$/;ee.event={global:{},add:function(e,t,n,r,i){var a,o,s,l,u,c,p,f,h,d,m,g=ve.get(e);if(g)for(n.handler&&(a=n,n=a.handler,i=a.selector),n.guid||(n.guid=ee.guid++),(l=g.events)||(l=g.events={}),(o=g.handle)||(o=g.handle=function(t){return typeof ee!==ke&&ee.event.triggered!==t.type?ee.event.dispatch.apply(e,arguments):void 0}),t=(t||"").match(de)||[""],u=t.length;u--;)s=Ie.exec(t[u])||[],h=m=s[1],d=(s[2]||"").split(".").sort(),h&&(p=ee.event.special[h]||{},
+h=(i?p.delegateType:p.bindType)||h,p=ee.event.special[h]||{},c=ee.extend({type:h,origType:m,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&ee.expr.match.needsContext.test(i),namespace:d.join(".")},a),(f=l[h])||(f=l[h]=[],f.delegateCount=0,p.setup&&p.setup.call(e,r,d,o)!==!1||e.addEventListener&&e.addEventListener(h,o,!1)),p.add&&(p.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?f.splice(f.delegateCount++,0,c):f.push(c),ee.event.global[h]=!0)},remove:function(e,t,n,r,i){var a,o,s,l,u,c,p,f,h,d,m,g=ve.hasData(e)&&ve.get(e);if(g&&(l=g.events)){for(t=(t||"").match(de)||[""],u=t.length;u--;)if(s=Ie.exec(t[u])||[],h=m=s[1],d=(s[2]||"").split(".").sort(),h){for(p=ee.event.special[h]||{},h=(r?p.delegateType:p.bindType)||h,f=l[h]||[],s=s[2]&&new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),o=a=f.length;a--;)c=f[a],!i&&m!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(f.splice(a,1),c.selector&&f.delegateCount--,p.remove&&p.remove.call(e,c));o&&!f.length&&(p.teardown&&p.teardown.call(e,d,g.handle)!==!1||ee.removeEvent(e,h,g.handle),delete l[h])}else for(h in l)ee.event.remove(e,h+t[u],n,r,!0);ee.isEmptyObject(l)&&(delete g.handle,ve.remove(e,"events"))}},trigger:function(e,n,r,i){var a,o,s,l,u,c,p,f=[r||G],h=Q.call(e,"type")?e.type:e,d=Q.call(e,"namespace")?e.namespace.split("."):[];if(o=s=r=r||G,3!==r.nodeType&&8!==r.nodeType&&!Te.test(h+ee.event.triggered)&&(h.indexOf(".")>=0&&(d=h.split("."),h=d.shift(),d.sort()),u=h.indexOf(":")<0&&"on"+h,e=e[ee.expando]?e:new ee.Event(h,"object"==typeof e&&e),e.isTrigger=i?2:3,e.namespace=d.join("."),e.namespace_re=e.namespace?new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=r),n=null==n?[e]:ee.makeArray(n,[e]),p=ee.event.special[h]||{},i||!p.trigger||p.trigger.apply(r,n)!==!1)){if(!i&&!p.noBubble&&!ee.isWindow(r)){for(l=p.delegateType||h,Te.test(l+h)||(o=o.parentNode);o;o=o.parentNode)f.push(o),s=o;s===(r.ownerDocument||G)&&f.push(s.defaultView||s.parentWindow||t)}for(a=0;(o=f[a++])&&!e.isPropagationStopped();)e.type=a>1?l:p.bindType||h,c=(ve.get(o,"events")||{})[e.type]&&ve.get(o,"handle"),c&&c.apply(o,n),c=u&&o[u],c&&c.apply&&ee.acceptData(o)&&(e.result=c.apply(o,n),e.result===!1&&e.preventDefault());return e.type=h,i||e.isDefaultPrevented()||p._default&&p._default.apply(f.pop(),n)!==!1||!ee.acceptData(r)||u&&ee.isFunction(r[h])&&!ee.isWindow(r)&&(s=r[u],s&&(r[u]=null),ee.event.triggered=h,r[h](),ee.event.triggered=void 0,s&&(r[u]=s)),e.result}},dispatch:function(e){e=ee.event.fix(e);var t,n,r,i,a,o=[],s=z.call(arguments),l=(ve.get(this,"events")||{})[e.type]||[],u=ee.event.special[e.type]||{};if(s[0]=e,e.delegateTarget=this,!u.preDispatch||u.preDispatch.call(this,e)!==!1){for(o=ee.event.handlers.call(this,e,l),t=0;(i=o[t++])&&!e.isPropagationStopped();)for(e.currentTarget=i.elem,n=0;(a=i.handlers[n++])&&!e.isImmediatePropagationStopped();)(!e.namespace_re||e.namespace_re.test(a.namespace))&&(e.handleObj=a,e.data=a.data,r=((ee.event.special[a.origType]||{}).handle||a.handler).apply(i.elem,s),void 0!==r&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,i,a,o=[],s=t.delegateCount,l=e.target;if(s&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!==this;l=l.parentNode||this)if(l.disabled!==!0||"click"!==e.type){for(r=[],n=0;s>n;n++)a=t[n],i=a.selector+" ",void 0===r[i]&&(r[i]=a.needsContext?ee(i,this).index(l)>=0:ee.find(i,this,null,[l]).length),r[i]&&r.push(a);r.length&&o.push({elem:l,handlers:r})}return s<t.length&&o.push({elem:this,handlers:t.slice(s)}),o},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,r,i,a=t.button;return null==e.pageX&&null!=t.clientX&&(n=e.target.ownerDocument||G,r=n.documentElement,i=n.body,e.pageX=t.clientX+(r&&r.scrollLeft||i&&i.scrollLeft||0)-(r&&r.clientLeft||i&&i.clientLeft||0),e.pageY=t.clientY+(r&&r.scrollTop||i&&i.scrollTop||0)-(r&&r.clientTop||i&&i.clientTop||0)),e.which||void 0===a||(e.which=1&a?1:2&a?3:4&a?2:0),e}},fix:function(e){if(e[ee.expando])return e;var t,n,r,i=e.type,a=e,o=this.fixHooks[i];for(o||(this.fixHooks[i]=o=je.test(i)?this.mouseHooks:Oe.test(i)?this.keyHooks:{}),r=o.props?this.props.concat(o.props):this.props,e=new ee.Event(a),t=r.length;t--;)n=r[t],e[n]=a[n];return e.target||(e.target=G),3===e.target.nodeType&&(e.target=e.target.parentNode),o.filter?o.filter(e,a):e},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==f()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===f()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&ee.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(e){return ee.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=ee.extend(new ee.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?ee.event.trigger(i,null,t):ee.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},ee.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)},ee.Event=function(e,t){return this instanceof ee.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&e.returnValue===!1?c:p):this.type=e,t&&ee.extend(this,t),this.timeStamp=e&&e.timeStamp||ee.now(),void(this[ee.expando]=!0)):new ee.Event(e,t)},ee.Event.prototype={isDefaultPrevented:p,isPropagationStopped:p,isImmediatePropagationStopped:p,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=c,e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=c,e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=c,e&&e.stopImmediatePropagation&&e.stopImmediatePropagation(),this.stopPropagation()}},ee.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){ee.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,a=e.handleObj;return(!i||i!==r&&!ee.contains(r,i))&&(e.type=a.origType,n=a.handler.apply(this,arguments),e.type=t),n}}}),X.focusinBubbles||ee.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){ee.event.simulate(t,e.target,ee.event.fix(e),!0)};ee.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=ve.access(r,t);i||r.addEventListener(e,n,!0),ve.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=ve.access(r,t)-1;i?ve.access(r,t,i):(r.removeEventListener(e,n,!0),ve.remove(r,t))}}}),ee.fn.extend({on:function(e,t,n,r,i){var a,o;if("object"==typeof e){"string"!=typeof t&&(n=n||t,t=void 0);for(o in e)this.on(o,t,n,e[o],i);return this}if(null==n&&null==r?(r=t,n=t=void 0):null==r&&("string"==typeof t?(r=n,n=void 0):(r=n,n=t,t=void 0)),r===!1)r=p;else if(!r)return this;return 1===i&&(a=r,r=function(e){return ee().off(e),a.apply(this,arguments)},r.guid=a.guid||(a.guid=ee.guid++)),this.each(function(){ee.event.add(this,e,r,n,t)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,ee(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return(t===!1||"function"==typeof t)&&(n=t,t=void 0),n===!1&&(n=p),this.each(function(){ee.event.remove(this,e,n,t)})},trigger:function(e,t){return this.each(function(){ee.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];return n?ee.event.trigger(e,t,n,!0):void 0}});var _e=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,De=/<([\w:]+)/,Le=/<|&#?\w+;/,Pe=/<(?:script|style|link)/i,Ne=/checked\s*(?:[^=]|=\s*.checked.)/i,$e=/^$|\/(?:java|ecma)script/i,Me=/^true\/(.*)/,Re=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Fe={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};Fe.optgroup=Fe.option,Fe.tbody=Fe.tfoot=Fe.colgroup=Fe.caption=Fe.thead,Fe.th=Fe.td,ee.extend({clone:function(e,t,n){var r,i,a,o,s=e.cloneNode(!0),l=ee.contains(e.ownerDocument,e);if(!(X.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||ee.isXMLDoc(e)))for(o=v(s),a=v(e),r=0,i=a.length;i>r;r++)b(a[r],o[r]);if(t)if(n)for(a=a||v(e),o=o||v(s),r=0,i=a.length;i>r;r++)y(a[r],o[r]);else y(e,s);return o=v(s,"script"),o.length>0&&g(o,!l&&v(e,"script")),s},buildFragment:function(e,t,n,r){for(var i,a,o,s,l,u,c=t.createDocumentFragment(),p=[],f=0,h=e.length;h>f;f++)if(i=e[f],i||0===i)if("object"===ee.type(i))ee.merge(p,i.nodeType?[i]:i);else if(Le.test(i)){for(a=a||c.appendChild(t.createElement("div")),o=(De.exec(i)||["",""])[1].toLowerCase(),s=Fe[o]||Fe._default,a.innerHTML=s[1]+i.replace(_e,"<$1></$2>")+s[2],u=s[0];u--;)a=a.lastChild;ee.merge(p,a.childNodes),a=c.firstChild,a.textContent=""}else p.push(t.createTextNode(i));for(c.textContent="",f=0;i=p[f++];)if((!r||-1===ee.inArray(i,r))&&(l=ee.contains(i.ownerDocument,i),a=v(c.appendChild(i),"script"),l&&g(a),n))for(u=0;i=a[u++];)$e.test(i.type||"")&&n.push(i);return c},cleanData:function(e){for(var t,n,r,i,a=ee.event.special,o=0;void 0!==(n=e[o]);o++){if(ee.acceptData(n)&&(i=n[ve.expando],i&&(t=ve.cache[i]))){if(t.events)for(r in t.events)a[r]?ee.event.remove(n,r):ee.removeEvent(n,r,t.handle);ve.cache[i]&&delete ve.cache[i]}delete be.cache[n[be.expando]]}}}),ee.fn.extend({text:function(e){return ye(this,function(e){return void 0===e?ee.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=e)})},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=h(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=h(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){for(var n,r=e?ee.filter(e,this):this,i=0;null!=(n=r[i]);i++)t||1!==n.nodeType||ee.cleanData(v(n)),n.parentNode&&(t&&ee.contains(n.ownerDocument,n)&&g(v(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(ee.cleanData(v(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return ee.clone(this,e,t)})},html:function(e){return ye(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Pe.test(e)&&!Fe[(De.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(_e,"<$1></$2>");try{for(;r>n;n++)t=this[n]||{},1===t.nodeType&&(ee.cleanData(v(t,!1)),t.innerHTML=e);t=0}catch(i){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=arguments[0];return this.domManip(arguments,function(t){e=this.parentNode,ee.cleanData(v(this)),e&&e.replaceChild(t,this)}),e&&(e.length||e.nodeType)?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t){e=V.apply([],e);var n,r,i,a,o,s,l=0,u=this.length,c=this,p=u-1,f=e[0],h=ee.isFunction(f);if(h||u>1&&"string"==typeof f&&!X.checkClone&&Ne.test(f))return this.each(function(n){var r=c.eq(n);h&&(e[0]=f.call(this,n,r.html())),r.domManip(e,t)});if(u&&(n=ee.buildFragment(e,this[0].ownerDocument,!1,this),r=n.firstChild,1===n.childNodes.length&&(n=r),r)){for(i=ee.map(v(n,"script"),d),a=i.length;u>l;l++)o=n,l!==p&&(o=ee.clone(o,!0,!0),a&&ee.merge(i,v(o,"script"))),t.call(this[l],o,l);if(a)for(s=i[i.length-1].ownerDocument,ee.map(i,m),l=0;a>l;l++)o=i[l],$e.test(o.type||"")&&!ve.access(o,"globalEval")&&ee.contains(s,o)&&(o.src?ee._evalUrl&&ee._evalUrl(o.src):ee.globalEval(o.textContent.replace(Re,"")))}return this}}),ee.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){ee.fn[e]=function(e){for(var n,r=[],i=ee(e),a=i.length-1,o=0;a>=o;o++)n=o===a?this:this.clone(!0),ee(i[o])[t](n),W.apply(r,n.get());return this.pushStack(r)}});var Ue,Be={},qe=/^margin/,He=new RegExp("^("+Se+")(?!px)[a-z%]+$","i"),ze=function(e){return e.ownerDocument.defaultView.opener?e.ownerDocument.defaultView.getComputedStyle(e,null):t.getComputedStyle(e,null)};!function(){function e(){o.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",o.innerHTML="",i.appendChild(a);var e=t.getComputedStyle(o,null);n="1%"!==e.top,r="4px"===e.width,i.removeChild(a)}var n,r,i=G.documentElement,a=G.createElement("div"),o=G.createElement("div");o.style&&(o.style.backgroundClip="content-box",o.cloneNode(!0).style.backgroundClip="",X.clearCloneStyle="content-box"===o.style.backgroundClip,a.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",a.appendChild(o),t.getComputedStyle&&ee.extend(X,{pixelPosition:function(){return e(),n},boxSizingReliable:function(){return null==r&&e(),r},reliableMarginRight:function(){var e,n=o.appendChild(G.createElement("div"));return n.style.cssText=o.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",n.style.marginRight=n.style.width="0",o.style.width="1px",i.appendChild(a),e=!parseFloat(t.getComputedStyle(n,null).marginRight),i.removeChild(a),o.removeChild(n),e}}))}(),ee.swap=function(e,t,n,r){var i,a,o={};for(a in t)o[a]=e.style[a],e.style[a]=t[a];i=n.apply(e,r||[]);for(a in t)e.style[a]=o[a];return i};var Ve=/^(none|table(?!-c[ea]).+)/,We=new RegExp("^("+Se+")(.*)$","i"),Je=new RegExp("^([+-])=("+Se+")","i"),Ye={position:"absolute",visibility:"hidden",display:"block"},Ke={letterSpacing:"0",fontWeight:"400"},Qe=["Webkit","O","Moz","ms"];ee.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=S(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,a,o,s=ee.camelCase(t),l=e.style;return t=ee.cssProps[s]||(ee.cssProps[s]=C(l,s)),o=ee.cssHooks[t]||ee.cssHooks[s],void 0===n?o&&"get"in o&&void 0!==(i=o.get(e,!1,r))?i:l[t]:(a=typeof n,"string"===a&&(i=Je.exec(n))&&(n=(i[1]+1)*i[2]+parseFloat(ee.css(e,t)),a="number"),null!=n&&n===n&&("number"!==a||ee.cssNumber[s]||(n+="px"),X.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),o&&"set"in o&&void 0===(n=o.set(e,n,r))||(l[t]=n)),void 0)}},css:function(e,t,n,r){var i,a,o,s=ee.camelCase(t);return t=ee.cssProps[s]||(ee.cssProps[s]=C(e.style,s)),o=ee.cssHooks[t]||ee.cssHooks[s],o&&"get"in o&&(i=o.get(e,!0,n)),void 0===i&&(i=S(e,t,r)),"normal"===i&&t in Ke&&(i=Ke[t]),""===n||n?(a=parseFloat(i),n===!0||ee.isNumeric(a)?a||0:i):i}}),ee.each(["height","width"],function(e,t){ee.cssHooks[t]={get:function(e,n,r){return n?Ve.test(ee.css(e,"display"))&&0===e.offsetWidth?ee.swap(e,Ye,function(){return O(e,t,r)}):O(e,t,r):void 0},set:function(e,n,r){var i=r&&ze(e);return E(e,n,r?k(e,t,r,"border-box"===ee.css(e,"boxSizing",!1,i),i):0)}}}),ee.cssHooks.marginRight=A(X.reliableMarginRight,function(e,t){return t?ee.swap(e,{display:"inline-block"},S,[e,"marginRight"]):void 0}),ee.each({margin:"",padding:"",border:"Width"},function(e,t){ee.cssHooks[e+t]={expand:function(n){for(var r=0,i={},a="string"==typeof n?n.split(" "):[n];4>r;r++)i[e+Ae[r]+t]=a[r]||a[r-2]||a[0];return i}},qe.test(e)||(ee.cssHooks[e+t].set=E)}),ee.fn.extend({css:function(e,t){return ye(this,function(e,t,n){var r,i,a={},o=0;if(ee.isArray(t)){for(r=ze(e),i=t.length;i>o;o++)a[t[o]]=ee.css(e,t[o],!1,r);return a}return void 0!==n?ee.style(e,t,n):ee.css(e,t)},e,t,arguments.length>1)},show:function(){return j(this,!0)},hide:function(){return j(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){Ce(this)?ee(this).show():ee(this).hide()})}}),ee.Tween=T,T.prototype={constructor:T,init:function(e,t,n,r,i,a){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=a||(ee.cssNumber[n]?"":"px")},cur:function(){var e=T.propHooks[this.prop];return e&&e.get?e.get(this):T.propHooks._default.get(this)},run:function(e){var t,n=T.propHooks[this.prop];return this.options.duration?this.pos=t=ee.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):T.propHooks._default.set(this),this}},T.prototype.init.prototype=T.prototype,T.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=ee.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){ee.fx.step[e.prop]?ee.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[ee.cssProps[e.prop]]||ee.cssHooks[e.prop])?ee.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},T.propHooks.scrollTop=T.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},ee.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},ee.fx=T.prototype.init,ee.fx.step={};var Xe,Ge,Ze=/^(?:toggle|show|hide)$/,et=new RegExp("^(?:([+-])=|)("+Se+")([a-z%]*)$","i"),tt=/queueHooks$/,nt=[L],rt={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=et.exec(t),a=i&&i[3]||(ee.cssNumber[e]?"":"px"),o=(ee.cssNumber[e]||"px"!==a&&+r)&&et.exec(ee.css(n.elem,e)),s=1,l=20;if(o&&o[3]!==a){a=a||o[3],i=i||[],o=+r||1;do s=s||".5",o/=s,ee.style(n.elem,e,o+a);while(s!==(s=n.cur()/r)&&1!==s&&--l)}return i&&(o=n.start=+o||+r||0,n.unit=a,n.end=i[1]?o+(i[1]+1)*i[2]:+i[2]),n}]};ee.Animation=ee.extend(N,{tweener:function(e,t){ee.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,r=0,i=e.length;i>r;r++)n=e[r],rt[n]=rt[n]||[],rt[n].unshift(t)},prefilter:function(e,t){t?nt.unshift(e):nt.push(e)}}),ee.speed=function(e,t,n){var r=e&&"object"==typeof e?ee.extend({},e):{complete:n||!n&&t||ee.isFunction(e)&&e,duration:e,easing:n&&t||t&&!ee.isFunction(t)&&t};return r.duration=ee.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in ee.fx.speeds?ee.fx.speeds[r.duration]:ee.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){ee.isFunction(r.old)&&r.old.call(this),r.queue&&ee.dequeue(this,r.queue)},r},ee.fn.extend({fadeTo:function(e,t,n,r){return this.filter(Ce).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=ee.isEmptyObject(e),a=ee.speed(t,n,r),o=function(){var t=N(this,ee.extend({},e),a);(i||ve.get(this,"finish"))&&t.stop(!0)};return o.finish=o,i||a.queue===!1?this.each(o):this.queue(a.queue,o)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",a=ee.timers,o=ve.get(this);if(i)o[i]&&o[i].stop&&r(o[i]);else for(i in o)o[i]&&o[i].stop&&tt.test(i)&&r(o[i]);for(i=a.length;i--;)a[i].elem!==this||null!=e&&a[i].queue!==e||(a[i].anim.stop(n),t=!1,a.splice(i,1));(t||!n)&&ee.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=ve.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],a=ee.timers,o=r?r.length:0;for(n.finish=!0,ee.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=a.length;t--;)a[t].elem===this&&a[t].queue===e&&(a[t].anim.stop(!0),a.splice(t,1));for(t=0;o>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),ee.each(["toggle","show","hide"],function(e,t){var n=ee.fn[t];ee.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(_(t,!0),e,r,i)}}),ee.each({slideDown:_("show"),slideUp:_("hide"),slideToggle:_("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){ee.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),ee.timers=[],ee.fx.tick=function(){var e,t=0,n=ee.timers;for(Xe=ee.now();t<n.length;t++)e=n[t],e()||n[t]!==e||n.splice(t--,1);n.length||ee.fx.stop(),Xe=void 0},ee.fx.timer=function(e){ee.timers.push(e),e()?ee.fx.start():ee.timers.pop()},ee.fx.interval=13,ee.fx.start=function(){Ge||(Ge=setInterval(ee.fx.tick,ee.fx.interval))},ee.fx.stop=function(){clearInterval(Ge),Ge=null},ee.fx.speeds={slow:600,fast:200,_default:400},ee.fn.delay=function(e,t){return e=ee.fx?ee.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},function(){var e=G.createElement("input"),t=G.createElement("select"),n=t.appendChild(G.createElement("option"));e.type="checkbox",X.checkOn=""!==e.value,X.optSelected=n.selected,t.disabled=!0,X.optDisabled=!n.disabled,e=G.createElement("input"),e.value="t",e.type="radio",X.radioValue="t"===e.value}();var it,at,ot=ee.expr.attrHandle;ee.fn.extend({attr:function(e,t){return ye(this,ee.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){ee.removeAttr(this,e)})}}),ee.extend({attr:function(e,t,n){var r,i,a=e.nodeType;if(e&&3!==a&&8!==a&&2!==a)return typeof e.getAttribute===ke?ee.prop(e,t,n):(1===a&&ee.isXMLDoc(e)||(t=t.toLowerCase(),r=ee.attrHooks[t]||(ee.expr.match.bool.test(t)?at:it)),void 0===n?r&&"get"in r&&null!==(i=r.get(e,t))?i:(i=ee.find.attr(e,t),null==i?void 0:i):null!==n?r&&"set"in r&&void 0!==(i=r.set(e,n,t))?i:(e.setAttribute(t,n+""),n):void ee.removeAttr(e,t))},removeAttr:function(e,t){var n,r,i=0,a=t&&t.match(de);if(a&&1===e.nodeType)for(;n=a[i++];)r=ee.propFix[n]||n,ee.expr.match.bool.test(n)&&(e[r]=!1),e.removeAttribute(n)},attrHooks:{type:{set:function(e,t){if(!X.radioValue&&"radio"===t&&ee.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}}}),at={set:function(e,t,n){return t===!1?ee.removeAttr(e,n):e.setAttribute(n,n),n}},ee.each(ee.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ot[t]||ee.find.attr;ot[t]=function(e,t,r){var i,a;return r||(a=ot[t],ot[t]=i,i=null!=n(e,t,r)?t.toLowerCase():null,ot[t]=a),i}});var st=/^(?:input|select|textarea|button)$/i;ee.fn.extend({prop:function(e,t){return ye(this,ee.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[ee.propFix[e]||e]})}}),ee.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(e,t,n){var r,i,a,o=e.nodeType;if(e&&3!==o&&8!==o&&2!==o)return a=1!==o||!ee.isXMLDoc(e),a&&(t=ee.propFix[t]||t,i=ee.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){return e.hasAttribute("tabindex")||st.test(e.nodeName)||e.href?e.tabIndex:-1}}}}),X.optSelected||(ee.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null}}),ee.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){ee.propFix[this.toLowerCase()]=this});var lt=/[\t\r\n\f]/g;ee.fn.extend({addClass:function(e){var t,n,r,i,a,o,s="string"==typeof e&&e,l=0,u=this.length;if(ee.isFunction(e))return this.each(function(t){ee(this).addClass(e.call(this,t,this.className))});if(s)for(t=(e||"").match(de)||[];u>l;l++)if(n=this[l],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(lt," "):" ")){for(a=0;i=t[a++];)r.indexOf(" "+i+" ")<0&&(r+=i+" ");o=ee.trim(r),n.className!==o&&(n.className=o)}return this},removeClass:function(e){var t,n,r,i,a,o,s=0===arguments.length||"string"==typeof e&&e,l=0,u=this.length;if(ee.isFunction(e))return this.each(function(t){ee(this).removeClass(e.call(this,t,this.className))});if(s)for(t=(e||"").match(de)||[];u>l;l++)if(n=this[l],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(lt," "):"")){for(a=0;i=t[a++];)for(;r.indexOf(" "+i+" ")>=0;)r=r.replace(" "+i+" "," ");o=e?ee.trim(r):"",n.className!==o&&(n.className=o)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):ee.isFunction(e)?this.each(function(n){ee(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n)for(var t,r=0,i=ee(this),a=e.match(de)||[];t=a[r++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else(n===ke||"boolean"===n)&&(this.className&&ve.set(this,"__className__",this.className),this.className=this.className||e===!1?"":ve.get(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(lt," ").indexOf(t)>=0)return!0;return!1}});var ut=/\r/g;ee.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=ee.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(i=r?e.call(this,n,ee(this).val()):e,null==i?i="":"number"==typeof i?i+="":ee.isArray(i)&&(i=ee.map(i,function(e){return null==e?"":e+""})),t=ee.valHooks[this.type]||ee.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return t=ee.valHooks[i.type]||ee.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:(n=i.value,"string"==typeof n?n.replace(ut,""):null==n?"":n)}}}),ee.extend({valHooks:{option:{get:function(e){var t=ee.find.attr(e,"value");return null!=t?t:ee.trim(ee.text(e))}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,a="select-one"===e.type||0>i,o=a?null:[],s=a?i+1:r.length,l=0>i?s:a?i:0;s>l;l++)if(n=r[l],(n.selected||l===i)&&(X.optDisabled?!n.disabled:null===n.getAttribute("disabled"))&&(!n.parentNode.disabled||!ee.nodeName(n.parentNode,"optgroup"))){if(t=ee(n).val(),a)return t;o.push(t)}return o},set:function(e,t){for(var n,r,i=e.options,a=ee.makeArray(t),o=i.length;o--;)r=i[o],(r.selected=ee.inArray(r.value,a)>=0)&&(n=!0);return n||(e.selectedIndex=-1),a}}}}),ee.each(["radio","checkbox"],function(){ee.valHooks[this]={set:function(e,t){return ee.isArray(t)?e.checked=ee.inArray(ee(e).val(),t)>=0:void 0}},X.checkOn||(ee.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),ee.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){ee.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),ee.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var ct=ee.now(),pt=/\?/;ee.parseJSON=function(e){return JSON.parse(e+"")},ee.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{n=new DOMParser,t=n.parseFromString(e,"text/xml")}catch(r){t=void 0}return(!t||t.getElementsByTagName("parsererror").length)&&ee.error("Invalid XML: "+e),t};var ft=/#.*$/,ht=/([?&])_=[^&]*/,dt=/^(.*?):[ \t]*([^\r\n]*)$/gm,mt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,gt=/^(?:GET|HEAD)$/,yt=/^\/\//,vt=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,bt={},wt={},xt="*/".concat("*"),St=t.location.href,At=vt.exec(St.toLowerCase())||[];ee.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:St,type:"GET",isLocal:mt.test(At[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":xt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":ee.parseJSON,"text xml":ee.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?R(R(e,ee.ajaxSettings),t):R(ee.ajaxSettings,e)},ajaxPrefilter:$(bt),ajaxTransport:$(wt),ajax:function(e,t){function n(e,t,n,o){var l,c,y,v,w,S=t;2!==b&&(b=2,s&&clearTimeout(s),r=void 0,a=o||"",x.readyState=e>0?4:0,l=e>=200&&300>e||304===e,n&&(v=F(p,x,n)),v=U(p,v,x,l),l?(p.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(ee.lastModified[i]=w),w=x.getResponseHeader("etag"),w&&(ee.etag[i]=w)),204===e||"HEAD"===p.type?S="nocontent":304===e?S="notmodified":(S=v.state,c=v.data,y=v.error,l=!y)):(y=S,(e||!S)&&(S="error",0>e&&(e=0))),x.status=e,x.statusText=(t||S)+"",l?d.resolveWith(f,[c,S,x]):d.rejectWith(f,[x,S,y]),x.statusCode(g),g=void 0,u&&h.trigger(l?"ajaxSuccess":"ajaxError",[x,p,l?c:y]),m.fireWith(f,[x,S]),u&&(h.trigger("ajaxComplete",[x,p]),--ee.active||ee.event.trigger("ajaxStop")))}"object"==typeof e&&(t=e,e=void 0),t=t||{};var r,i,a,o,s,l,u,c,p=ee.ajaxSetup({},t),f=p.context||p,h=p.context&&(f.nodeType||f.jquery)?ee(f):ee.event,d=ee.Deferred(),m=ee.Callbacks("once memory"),g=p.statusCode||{},y={},v={},b=0,w="canceled",x={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!o)for(o={};t=dt.exec(a);)o[t[1].toLowerCase()]=t[2];t=o[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return b||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>b)for(t in e)g[t]=[g[t],e[t]];else x.always(e[x.status]);return this},abort:function(e){var t=e||w;return r&&r.abort(t),n(0,t),this}};if(d.promise(x).complete=m.add,x.success=x.done,x.error=x.fail,p.url=((e||p.url||St)+"").replace(ft,"").replace(yt,At[1]+"//"),p.type=t.method||t.type||p.method||p.type,p.dataTypes=ee.trim(p.dataType||"*").toLowerCase().match(de)||[""],null==p.crossDomain&&(l=vt.exec(p.url.toLowerCase()),p.crossDomain=!(!l||l[1]===At[1]&&l[2]===At[2]&&(l[3]||("http:"===l[1]?"80":"443"))===(At[3]||("http:"===At[1]?"80":"443")))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=ee.param(p.data,p.traditional)),M(bt,p,t,x),2===b)return x;u=ee.event&&p.global,u&&0===ee.active++&&ee.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!gt.test(p.type),i=p.url,p.hasContent||(p.data&&(i=p.url+=(pt.test(i)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=ht.test(i)?i.replace(ht,"$1_="+ct++):i+(pt.test(i)?"&":"?")+"_="+ct++)),p.ifModified&&(ee.lastModified[i]&&x.setRequestHeader("If-Modified-Since",ee.lastModified[i]),ee.etag[i]&&x.setRequestHeader("If-None-Match",ee.etag[i])),(p.data&&p.hasContent&&p.contentType!==!1||t.contentType)&&x.setRequestHeader("Content-Type",p.contentType),x.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+xt+"; q=0.01":""):p.accepts["*"]);
+for(c in p.headers)x.setRequestHeader(c,p.headers[c]);if(p.beforeSend&&(p.beforeSend.call(f,x,p)===!1||2===b))return x.abort();w="abort";for(c in{success:1,error:1,complete:1})x[c](p[c]);if(r=M(wt,p,t,x)){x.readyState=1,u&&h.trigger("ajaxSend",[x,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){x.abort("timeout")},p.timeout));try{b=1,r.send(y,n)}catch(S){if(!(2>b))throw S;n(-1,S)}}else n(-1,"No Transport");return x},getJSON:function(e,t,n){return ee.get(e,t,n,"json")},getScript:function(e,t){return ee.get(e,void 0,t,"script")}}),ee.each(["get","post"],function(e,t){ee[t]=function(e,n,r,i){return ee.isFunction(n)&&(i=i||r,r=n,n=void 0),ee.ajax({url:e,type:t,dataType:i,data:n,success:r})}}),ee._evalUrl=function(e){return ee.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},ee.fn.extend({wrapAll:function(e){var t;return ee.isFunction(e)?this.each(function(t){ee(this).wrapAll(e.call(this,t))}):(this[0]&&(t=ee(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this)},wrapInner:function(e){return ee.isFunction(e)?this.each(function(t){ee(this).wrapInner(e.call(this,t))}):this.each(function(){var t=ee(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=ee.isFunction(e);return this.each(function(n){ee(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){ee.nodeName(this,"body")||ee(this).replaceWith(this.childNodes)}).end()}}),ee.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0},ee.expr.filters.visible=function(e){return!ee.expr.filters.hidden(e)};var Ct=/%20/g,Et=/\[\]$/,kt=/\r?\n/g,Ot=/^(?:submit|button|image|reset|file)$/i,jt=/^(?:input|select|textarea|keygen)/i;ee.param=function(e,t){var n,r=[],i=function(e,t){t=ee.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=ee.ajaxSettings&&ee.ajaxSettings.traditional),ee.isArray(e)||e.jquery&&!ee.isPlainObject(e))ee.each(e,function(){i(this.name,this.value)});else for(n in e)B(n,e[n],t,i);return r.join("&").replace(Ct,"+")},ee.fn.extend({serialize:function(){return ee.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=ee.prop(this,"elements");return e?ee.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!ee(this).is(":disabled")&&jt.test(this.nodeName)&&!Ot.test(e)&&(this.checked||!Ee.test(e))}).map(function(e,t){var n=ee(this).val();return null==n?null:ee.isArray(n)?ee.map(n,function(e){return{name:t.name,value:e.replace(kt,"\r\n")}}):{name:t.name,value:n.replace(kt,"\r\n")}}).get()}}),ee.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(e){}};var Tt=0,It={},_t={0:200,1223:204},Dt=ee.ajaxSettings.xhr();t.attachEvent&&t.attachEvent("onunload",function(){for(var e in It)It[e]()}),X.cors=!!Dt&&"withCredentials"in Dt,X.ajax=Dt=!!Dt,ee.ajaxTransport(function(e){var t;return X.cors||Dt&&!e.crossDomain?{send:function(n,r){var i,a=e.xhr(),o=++Tt;if(a.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(i in e.xhrFields)a[i]=e.xhrFields[i];e.mimeType&&a.overrideMimeType&&a.overrideMimeType(e.mimeType),e.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest");for(i in n)a.setRequestHeader(i,n[i]);t=function(e){return function(){t&&(delete It[o],t=a.onload=a.onerror=null,"abort"===e?a.abort():"error"===e?r(a.status,a.statusText):r(_t[a.status]||a.status,a.statusText,"string"==typeof a.responseText?{text:a.responseText}:void 0,a.getAllResponseHeaders()))}},a.onload=t(),a.onerror=t("error"),t=It[o]=t("abort");try{a.send(e.hasContent&&e.data||null)}catch(s){if(t)throw s}},abort:function(){t&&t()}}:void 0}),ee.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return ee.globalEval(e),e}}}),ee.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),ee.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(r,i){t=ee("<script>").prop({async:!0,charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),G.head.appendChild(t[0])},abort:function(){n&&n()}}}});var Lt=[],Pt=/(=)\?(?=&|$)|\?\?/;ee.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Lt.pop()||ee.expando+"_"+ct++;return this[e]=!0,e}}),ee.ajaxPrefilter("json jsonp",function(e,n,r){var i,a,o,s=e.jsonp!==!1&&(Pt.test(e.url)?"url":"string"==typeof e.data&&!(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Pt.test(e.data)&&"data");return s||"jsonp"===e.dataTypes[0]?(i=e.jsonpCallback=ee.isFunction(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,s?e[s]=e[s].replace(Pt,"$1"+i):e.jsonp!==!1&&(e.url+=(pt.test(e.url)?"&":"?")+e.jsonp+"="+i),e.converters["script json"]=function(){return o||ee.error(i+" was not called"),o[0]},e.dataTypes[0]="json",a=t[i],t[i]=function(){o=arguments},r.always(function(){t[i]=a,e[i]&&(e.jsonpCallback=n.jsonpCallback,Lt.push(i)),o&&ee.isFunction(a)&&a(o[0]),o=a=void 0}),"script"):void 0}),ee.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||G;var r=se.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=ee.buildFragment([e],t,i),i&&i.length&&ee(i).remove(),ee.merge([],r.childNodes))};var Nt=ee.fn.load;ee.fn.load=function(e,t,n){if("string"!=typeof e&&Nt)return Nt.apply(this,arguments);var r,i,a,o=this,s=e.indexOf(" ");return s>=0&&(r=ee.trim(e.slice(s)),e=e.slice(0,s)),ee.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),o.length>0&&ee.ajax({url:e,type:i,dataType:"html",data:t}).done(function(e){a=arguments,o.html(r?ee("<div>").append(ee.parseHTML(e)).find(r):e)}).complete(n&&function(e,t){o.each(n,a||[e.responseText,t,e])}),this},ee.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){ee.fn[t]=function(e){return this.on(t,e)}}),ee.expr.filters.animated=function(e){return ee.grep(ee.timers,function(t){return e===t.elem}).length};var $t=t.document.documentElement;ee.offset={setOffset:function(e,t,n){var r,i,a,o,s,l,u,c=ee.css(e,"position"),p=ee(e),f={};"static"===c&&(e.style.position="relative"),s=p.offset(),a=ee.css(e,"top"),l=ee.css(e,"left"),u=("absolute"===c||"fixed"===c)&&(a+l).indexOf("auto")>-1,u?(r=p.position(),o=r.top,i=r.left):(o=parseFloat(a)||0,i=parseFloat(l)||0),ee.isFunction(t)&&(t=t.call(e,n,s)),null!=t.top&&(f.top=t.top-s.top+o),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):p.css(f)}},ee.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){ee.offset.setOffset(this,e,t)});var t,n,r=this[0],i={top:0,left:0},a=r&&r.ownerDocument;if(a)return t=a.documentElement,ee.contains(t,r)?(typeof r.getBoundingClientRect!==ke&&(i=r.getBoundingClientRect()),n=q(a),{top:i.top+n.pageYOffset-t.clientTop,left:i.left+n.pageXOffset-t.clientLeft}):i},position:function(){if(this[0]){var e,t,n=this[0],r={top:0,left:0};return"fixed"===ee.css(n,"position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),ee.nodeName(e[0],"html")||(r=e.offset()),r.top+=ee.css(e[0],"borderTopWidth",!0),r.left+=ee.css(e[0],"borderLeftWidth",!0)),{top:t.top-r.top-ee.css(n,"marginTop",!0),left:t.left-r.left-ee.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||$t;e&&!ee.nodeName(e,"html")&&"static"===ee.css(e,"position");)e=e.offsetParent;return e||$t})}}),ee.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r="pageYOffset"===n;ee.fn[e]=function(i){return ye(this,function(e,i,a){var o=q(e);return void 0===a?o?o[n]:e[i]:void(o?o.scrollTo(r?t.pageXOffset:a,r?a:t.pageYOffset):e[i]=a)},e,i,arguments.length,null)}}),ee.each(["top","left"],function(e,t){ee.cssHooks[t]=A(X.pixelPosition,function(e,n){return n?(n=S(e,t),He.test(n)?ee(e).position()[t]+"px":n):void 0})}),ee.each({Height:"height",Width:"width"},function(e,t){ee.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){ee.fn[r]=function(r,i){var a=arguments.length&&(n||"boolean"!=typeof r),o=n||(r===!0||i===!0?"margin":"border");return ye(this,function(t,n,r){var i;return ee.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):void 0===r?ee.css(t,n,o):ee.style(t,n,r,o)},t,a?r:void 0,a,null)}})}),ee.fn.size=function(){return this.length},ee.fn.andSelf=ee.fn.addBack,"function"==typeof e&&e.amd&&e("jquery",[],function(){return ee});var Mt=t.jQuery,Rt=t.$;return ee.noConflict=function(e){return t.$===ee&&(t.$=Rt),e&&t.jQuery===ee&&(t.jQuery=Mt),ee},typeof n===ke&&(t.jQuery=t.$=ee),ee})},{}],21:[function(e,t,n){"use strict";var r=e("./lib/js-yaml.js");t.exports=r},{"./lib/js-yaml.js":22}],22:[function(e,t,n){"use strict";function r(e){return function(){throw new Error("Function "+e+" is deprecated and cannot be used.")}}var i=e("./js-yaml/loader"),a=e("./js-yaml/dumper");t.exports.Type=e("./js-yaml/type"),t.exports.Schema=e("./js-yaml/schema"),t.exports.FAILSAFE_SCHEMA=e("./js-yaml/schema/failsafe"),t.exports.JSON_SCHEMA=e("./js-yaml/schema/json"),t.exports.CORE_SCHEMA=e("./js-yaml/schema/core"),t.exports.DEFAULT_SAFE_SCHEMA=e("./js-yaml/schema/default_safe"),t.exports.DEFAULT_FULL_SCHEMA=e("./js-yaml/schema/default_full"),t.exports.load=i.load,t.exports.loadAll=i.loadAll,t.exports.safeLoad=i.safeLoad,t.exports.safeLoadAll=i.safeLoadAll,t.exports.dump=a.dump,t.exports.safeDump=a.safeDump,t.exports.YAMLException=e("./js-yaml/exception"),t.exports.MINIMAL_SCHEMA=e("./js-yaml/schema/failsafe"),t.exports.SAFE_SCHEMA=e("./js-yaml/schema/default_safe"),t.exports.DEFAULT_SCHEMA=e("./js-yaml/schema/default_full"),t.exports.scan=r("scan"),t.exports.parse=r("parse"),t.exports.compose=r("compose"),t.exports.addConstructor=r("addConstructor")},{"./js-yaml/dumper":24,"./js-yaml/exception":25,"./js-yaml/loader":26,"./js-yaml/schema":28,"./js-yaml/schema/core":29,"./js-yaml/schema/default_full":30,"./js-yaml/schema/default_safe":31,"./js-yaml/schema/failsafe":32,"./js-yaml/schema/json":33,"./js-yaml/type":34}],23:[function(e,t,n){"use strict";function r(e){return"undefined"==typeof e||null===e}function i(e){return"object"==typeof e&&null!==e}function a(e){return Array.isArray(e)?e:r(e)?[]:[e]}function o(e,t){var n,r,i,a;if(t)for(a=Object.keys(t),n=0,r=a.length;r>n;n+=1)i=a[n],e[i]=t[i];return e}function s(e,t){var n,r="";for(n=0;t>n;n+=1)r+=e;return r}function l(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e}t.exports.isNothing=r,t.exports.isObject=i,t.exports.toArray=a,t.exports.repeat=s,t.exports.isNegativeZero=l,t.exports.extend=o},{}],24:[function(e,t,n){"use strict";function r(e,t){var n,r,i,a,o,s,l;if(null===t)return{};for(n={},r=Object.keys(t),i=0,a=r.length;a>i;i+=1)o=r[i],s=String(t[o]),"!!"===o.slice(0,2)&&(o="tag:yaml.org,2002:"+o.slice(2)),l=e.compiledTypeMap[o],l&&I.call(l.styleAliases,s)&&(s=l.styleAliases[s]),n[o]=s;return n}function i(e){var t,n,r;if(t=e.toString(16).toUpperCase(),255>=e)n="x",r=2;else if(65535>=e)n="u",r=4;else{if(!(4294967295>=e))throw new k("code point within a string may not be greater than 0xFFFFFFFF");n="U",r=8}return"\\"+n+E.repeat("0",r-t.length)+t}function a(e){this.schema=e.schema||O,this.indent=Math.max(1,e.indent||2),this.skipInvalid=e.skipInvalid||!1,this.flowLevel=E.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=r(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function o(e,t){for(var n,r=E.repeat(" ",t),i=0,a=-1,o="",s=e.length;s>i;)a=e.indexOf("\n",i),-1===a?(n=e.slice(i),i=s):(n=e.slice(i,a+1),i=a+1),n.length&&"\n"!==n&&(o+=r),o+=n;return o}function s(e,t){return"\n"+E.repeat(" ",e.indent*t)}function l(e,t){var n,r,i;for(n=0,r=e.implicitTypes.length;r>n;n+=1)if(i=e.implicitTypes[n],i.resolve(t))return!0;return!1}function u(e){this.source=e,this.result="",this.checkpoint=0}function c(e,t,n){var r,i,a,s,c,f,m,g,y,v,b,w,x,S,A,C,E,k,O,j,T;if(0===t.length)return void(e.dump="''");if(-1!==te.indexOf(t))return void(e.dump="'"+t+"'");for(r=!0,i=t.length?t.charCodeAt(0):0,a=P===i||P===t.charCodeAt(t.length-1),(H===i||W===i||J===i||Q===i)&&(r=!1),a?(r=!1,s=!1,c=!1):(s=!0,c=!0),f=!0,m=new u(t),g=!1,y=0,v=0,b=e.indent*n,w=80,40>b?w-=b:w=40,S=0;S<t.length;S++){if(x=t.charCodeAt(S),r){if(h(x))continue;r=!1}f&&x===U&&(f=!1),A=ee[x],C=d(x),(A||C)&&(x!==D&&x!==$&&x!==U?(s=!1,c=!1):x===D&&(g=!0,f=!1,S>0&&(E=t.charCodeAt(S-1),E===P&&(c=!1,s=!1)),s&&(k=S-y,y=S,k>v&&(v=k))),x!==$&&(f=!1),m.takeUpTo(S),m.escapeChar())}if(r&&l(e,t)&&(r=!1),O="",(s||c)&&(j=0,t.charCodeAt(t.length-1)===D&&(j+=1,t.charCodeAt(t.length-2)===D&&(j+=1)),0===j?O="-":2===j&&(O="+")),c&&w>v&&(s=!1),g||(c=!1),r)e.dump=t;else if(f)e.dump="'"+t+"'";else if(s)T=p(t,w),e.dump=">"+O+"\n"+o(T,b);else if(c)O||(t=t.replace(/\n$/,"")),e.dump="|"+O+"\n"+o(t,b);else{if(!m)throw new Error("Failed to dump scalar value");m.finish(),e.dump='"'+m.result+'"'}}function p(e,t){var n,r="",i=0,a=e.length,o=/\n+$/.exec(e);for(o&&(a=o.index+1);a>i;)n=e.indexOf("\n",i),n>a||-1===n?(r&&(r+="\n\n"),r+=f(e.slice(i,a),t),i=a):(r&&(r+="\n\n"),r+=f(e.slice(i,n),t),i=n+1);return o&&"\n"!==o[0]&&(r+=o[0]),r}function f(e,t){if(""===e)return e;for(var n,r,i,a=/[^\s] [^\s]/g,o="",s=0,l=0,u=a.exec(e);u;)n=u.index,n-l>t&&(r=s!==l?s:n,o&&(o+="\n"),i=e.slice(l,r),o+=i,l=r+1),s=n+1,u=a.exec(e);return o&&(o+="\n"),o+=l!==s&&e.length-l>t?e.slice(l,s)+"\n"+e.slice(s+1):e.slice(l)}function h(e){return _!==e&&D!==e&&L!==e&&q!==e&&Y!==e&&K!==e&&X!==e&&Z!==e&&M!==e&&F!==e&&B!==e&&N!==e&&G!==e&&V!==e&&U!==e&&$!==e&&R!==e&&z!==e&&!ee[e]&&!d(e)}function d(e){return!(e>=32&&126>=e||133===e||e>=160&&55295>=e||e>=57344&&65533>=e||e>=65536&&1114111>=e)}function m(e,t,n){var r,i,a="",o=e.tag;for(r=0,i=n.length;i>r;r+=1)w(e,t,n[r],!1,!1)&&(0!==r&&(a+=", "),a+=e.dump);e.tag=o,e.dump="["+a+"]"}function g(e,t,n,r){var i,a,o="",l=e.tag;for(i=0,a=n.length;a>i;i+=1)w(e,t+1,n[i],!0,!0)&&(r&&0===i||(o+=s(e,t)),o+="- "+e.dump);e.tag=l,e.dump=o||"[]"}function y(e,t,n){var r,i,a,o,s,l="",u=e.tag,c=Object.keys(n);for(r=0,i=c.length;i>r;r+=1)s="",0!==r&&(s+=", "),a=c[r],o=n[a],w(e,t,a,!1,!1)&&(e.dump.length>1024&&(s+="? "),s+=e.dump+": ",w(e,t,o,!1,!1)&&(s+=e.dump,l+=s));e.tag=u,e.dump="{"+l+"}"}function v(e,t,n,r){var i,a,o,l,u,c,p="",f=e.tag,h=Object.keys(n);if(e.sortKeys===!0)h.sort();else if("function"==typeof e.sortKeys)h.sort(e.sortKeys);else if(e.sortKeys)throw new k("sortKeys must be a boolean or a function");for(i=0,a=h.length;a>i;i+=1)c="",r&&0===i||(c+=s(e,t)),o=h[i],l=n[o],w(e,t+1,o,!0,!0)&&(u=null!==e.tag&&"?"!==e.tag||e.dump&&e.dump.length>1024,u&&(c+=e.dump&&D===e.dump.charCodeAt(0)?"?":"? "),c+=e.dump,u&&(c+=s(e,t)),w(e,t+1,l,!0,u)&&(c+=e.dump&&D===e.dump.charCodeAt(0)?":":": ",c+=e.dump,p+=c));e.tag=f,e.dump=p||"{}"}function b(e,t,n){var r,i,a,o,s,l;for(i=n?e.explicitTypes:e.implicitTypes,a=0,o=i.length;o>a;a+=1)if(s=i[a],(s.instanceOf||s.predicate)&&(!s.instanceOf||"object"==typeof t&&t instanceof s.instanceOf)&&(!s.predicate||s.predicate(t))){if(e.tag=n?s.tag:"?",s.represent){if(l=e.styleMap[s.tag]||s.defaultStyle,"[object Function]"===T.call(s.represent))r=s.represent(t,l);else{if(!I.call(s.represent,l))throw new k("!<"+s.tag+'> tag resolver accepts not "'+l+'" style');r=s.represent[l](t,l)}e.dump=r}return!0}return!1}function w(e,t,n,r,i){e.tag=null,e.dump=n,b(e,n,!1)||b(e,n,!0);var a=T.call(e.dump);r&&(r=0>e.flowLevel||e.flowLevel>t),(null!==e.tag&&"?"!==e.tag||2!==e.indent&&t>0)&&(i=!1);var o,s,l="[object Object]"===a||"[object Array]"===a;if(l&&(o=e.duplicates.indexOf(n),s=-1!==o),s&&e.usedDuplicates[o])e.dump="*ref_"+o;else{if(l&&s&&!e.usedDuplicates[o]&&(e.usedDuplicates[o]=!0),"[object Object]"===a)r&&0!==Object.keys(e.dump).length?(v(e,t,e.dump,i),s&&(e.dump="&ref_"+o+(0===t?"\n":"")+e.dump)):(y(e,t,e.dump),s&&(e.dump="&ref_"+o+" "+e.dump));else if("[object Array]"===a)r&&0!==e.dump.length?(g(e,t,e.dump,i),s&&(e.dump="&ref_"+o+(0===t?"\n":"")+e.dump)):(m(e,t,e.dump),s&&(e.dump="&ref_"+o+" "+e.dump));else{if("[object String]"!==a){if(e.skipInvalid)return!1;throw new k("unacceptable kind of an object to dump "+a)}"?"!==e.tag&&c(e,e.dump,t)}null!==e.tag&&"?"!==e.tag&&(e.dump="!<"+e.tag+"> "+e.dump)}return!0}function x(e,t){var n,r,i=[],a=[];for(S(e,i,a),n=0,r=a.length;r>n;n+=1)t.duplicates.push(i[a[n]]);t.usedDuplicates=new Array(r)}function S(e,t,n){var r,i,a;T.call(e);if(null!==e&&"object"==typeof e)if(i=t.indexOf(e),-1!==i)-1===n.indexOf(i)&&n.push(i);else if(t.push(e),Array.isArray(e))for(i=0,a=e.length;a>i;i+=1)S(e[i],t,n);else for(r=Object.keys(e),i=0,a=r.length;a>i;i+=1)S(e[r[i]],t,n)}function A(e,t){t=t||{};var n=new a(t);return x(e,n),w(n,0,e,!0,!0)?n.dump+"\n":""}function C(e,t){return A(e,E.extend({schema:j},t))}var E=e("./common"),k=e("./exception"),O=e("./schema/default_full"),j=e("./schema/default_safe"),T=Object.prototype.toString,I=Object.prototype.hasOwnProperty,_=9,D=10,L=13,P=32,N=33,$=34,M=35,R=37,F=38,U=39,B=42,q=44,H=45,z=58,V=62,W=63,J=64,Y=91,K=93,Q=96,X=123,G=124,Z=125,ee={};ee[0]="\\0",ee[7]="\\a",ee[8]="\\b",ee[9]="\\t",ee[10]="\\n",ee[11]="\\v",ee[12]="\\f",ee[13]="\\r",ee[27]="\\e",ee[34]='\\"',ee[92]="\\\\",ee[133]="\\N",ee[160]="\\_",ee[8232]="\\L",ee[8233]="\\P";var te=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];u.prototype.takeUpTo=function(e){var t;if(e<this.checkpoint)throw t=new Error("position should be > checkpoint"),t.position=e,t.checkpoint=this.checkpoint,t;return this.result+=this.source.slice(this.checkpoint,e),this.checkpoint=e,this},u.prototype.escapeChar=function(){var e,t;return e=this.source.charCodeAt(this.checkpoint),t=ee[e]||i(e),this.result+=t,this.checkpoint+=1,this},u.prototype.finish=function(){this.source.length>this.checkpoint&&this.takeUpTo(this.source.length)},t.exports.dump=A,t.exports.safeDump=C},{"./common":23,"./exception":25,"./schema/default_full":30,"./schema/default_safe":31}],25:[function(e,t,n){"use strict";function r(e,t){this.name="YAMLException",this.reason=e,this.mark=t,this.message=this.toString(!1)}r.prototype.toString=function(e){var t;return t="JS-YAML: "+(this.reason||"(unknown reason)"),!e&&this.mark&&(t+=" "+this.mark.toString()),t},t.exports=r},{}],26:[function(e,t,n){"use strict";function r(e){return 10===e||13===e}function i(e){return 9===e||32===e}function a(e){return 9===e||32===e||10===e||13===e}function o(e){return 44===e||91===e||93===e||123===e||125===e}function s(e){var t;return e>=48&&57>=e?e-48:(t=32|e,t>=97&&102>=t?t-97+10:-1)}function l(e){return 120===e?2:117===e?4:85===e?8:0}function u(e){return e>=48&&57>=e?e-48:-1}function c(e){return 48===e?"\x00":97===e?"":98===e?"\b":116===e?" ":9===e?" ":110===e?"\n":118===e?" ":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"…":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function p(e){return 65535>=e?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function f(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||z,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function h(e,t){return new B(t,new q(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function d(e,t){throw h(e,t)}function m(e,t){var n=h(e,t);if(!e.onWarning)throw n;e.onWarning.call(null,n)}function g(e,t,n,r){var i,a,o,s;if(n>t){if(s=e.input.slice(t,n),r)for(i=0,a=s.length;a>i;i+=1)o=s.charCodeAt(i),9===o||o>=32&&1114111>=o||d(e,"expected valid JSON character");e.result+=s}}function y(e,t,n){var r,i,a,o;for(U.isObject(n)||d(e,"cannot merge mappings; the provided source object is unacceptable"),r=Object.keys(n),a=0,o=r.length;o>a;a+=1)i=r[a],V.call(t,i)||(t[i]=n[i])}function v(e,t,n,r,i){var a,o;if(r=String(r),null===t&&(t={}),"tag:yaml.org,2002:merge"===n)if(Array.isArray(i))for(a=0,o=i.length;o>a;a+=1)y(e,t,i[a]);else y(e,t,i);else t[r]=i;return t}function b(e){var t;t=e.input.charCodeAt(e.position),10===t?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):d(e,"a line break is expected"),e.line+=1,e.lineStart=e.position}function w(e,t,n){for(var a=0,o=e.input.charCodeAt(e.position);0!==o;){for(;i(o);)o=e.input.charCodeAt(++e.position);if(t&&35===o)do o=e.input.charCodeAt(++e.position);while(10!==o&&13!==o&&0!==o);if(!r(o))break;for(b(e),o=e.input.charCodeAt(e.position),a++,e.lineIndent=0;32===o;)e.lineIndent++,o=e.input.charCodeAt(++e.position)}return-1!==n&&0!==a&&e.lineIndent<n&&m(e,"deficient indentation"),a}function x(e){var t,n=e.position;return t=e.input.charCodeAt(n),45!==t&&46!==t||e.input.charCodeAt(n+1)!==t||e.input.charCodeAt(n+2)!==t||(n+=3,t=e.input.charCodeAt(n),0!==t&&!a(t))?!1:!0}function S(e,t){1===t?e.result+=" ":t>1&&(e.result+=U.repeat("\n",t-1))}function A(e,t,n){var s,l,u,c,p,f,h,d,m,y=e.kind,v=e.result;if(m=e.input.charCodeAt(e.position),a(m)||o(m)||35===m||38===m||42===m||33===m||124===m||62===m||39===m||34===m||37===m||64===m||96===m)return!1;if((63===m||45===m)&&(l=e.input.charCodeAt(e.position+1),a(l)||n&&o(l)))return!1;for(e.kind="scalar",e.result="",u=c=e.position,p=!1;0!==m;){if(58===m){if(l=e.input.charCodeAt(e.position+1),a(l)||n&&o(l))break}else if(35===m){if(s=e.input.charCodeAt(e.position-1),a(s))break}else{if(e.position===e.lineStart&&x(e)||n&&o(m))break;if(r(m)){if(f=e.line,h=e.lineStart,d=e.lineIndent,w(e,!1,-1),e.lineIndent>=t){p=!0,m=e.input.charCodeAt(e.position);continue}e.position=c,e.line=f,e.lineStart=h,e.lineIndent=d;break}}p&&(g(e,u,c,!1),S(e,e.line-f),u=c=e.position,p=!1),i(m)||(c=e.position+1),m=e.input.charCodeAt(++e.position)}return g(e,u,c,!1),e.result?!0:(e.kind=y,e.result=v,!1)}function C(e,t){var n,i,a;if(n=e.input.charCodeAt(e.position),39!==n)return!1;for(e.kind="scalar",e.result="",e.position++,i=a=e.position;0!==(n=e.input.charCodeAt(e.position));)if(39===n){if(g(e,i,e.position,!0),n=e.input.charCodeAt(++e.position),39!==n)return!0;i=a=e.position,e.position++}else r(n)?(g(e,i,a,!0),S(e,w(e,!1,t)),i=a=e.position):e.position===e.lineStart&&x(e)?d(e,"unexpected end of the document within a single quoted scalar"):(e.position++,a=e.position);d(e,"unexpected end of the stream within a single quoted scalar")}function E(e,t){var n,i,a,o,u,c;if(c=e.input.charCodeAt(e.position),34!==c)return!1;for(e.kind="scalar",e.result="",e.position++,n=i=e.position;0!==(c=e.input.charCodeAt(e.position));){if(34===c)return g(e,n,e.position,!0),e.position++,!0;if(92===c){if(g(e,n,e.position,!0),c=e.input.charCodeAt(++e.position),r(c))w(e,!1,t);else if(256>c&&ie[c])e.result+=ae[c],e.position++;else if((u=l(c))>0){for(a=u,o=0;a>0;a--)c=e.input.charCodeAt(++e.position),(u=s(c))>=0?o=(o<<4)+u:d(e,"expected hexadecimal character");e.result+=p(o),e.position++}else d(e,"unknown escape sequence");n=i=e.position}else r(c)?(g(e,n,i,!0),S(e,w(e,!1,t)),n=i=e.position):e.position===e.lineStart&&x(e)?d(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}d(e,"unexpected end of the stream within a double quoted scalar")}function k(e,t){var n,r,i,o,s,l,u,c,p,f,h,m=!0,g=e.tag,y=e.anchor;if(h=e.input.charCodeAt(e.position),91===h)o=93,u=!1,r=[];else{if(123!==h)return!1;o=125,u=!0,r={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=r),h=e.input.charCodeAt(++e.position);0!==h;){if(w(e,!0,t),h=e.input.charCodeAt(e.position),h===o)return e.position++,e.tag=g,e.anchor=y,e.kind=u?"mapping":"sequence",e.result=r,!0;m||d(e,"missed comma between flow collection entries"),p=c=f=null,s=l=!1,63===h&&(i=e.input.charCodeAt(e.position+1),a(i)&&(s=l=!0,e.position++,w(e,!0,t))),n=e.line,L(e,t,W,!1,!0),p=e.tag,c=e.result,w(e,!0,t),h=e.input.charCodeAt(e.position),!l&&e.line!==n||58!==h||(s=!0,h=e.input.charCodeAt(++e.position),w(e,!0,t),L(e,t,W,!1,!0),f=e.result),u?v(e,r,p,c,f):s?r.push(v(e,null,p,c,f)):r.push(c),w(e,!0,t),h=e.input.charCodeAt(e.position),44===h?(m=!0,h=e.input.charCodeAt(++e.position)):m=!1}d(e,"unexpected end of the stream within a flow collection")}function O(e,t){var n,a,o,s,l=Q,c=!1,p=t,f=0,h=!1;if(s=e.input.charCodeAt(e.position),124===s)a=!1;else{if(62!==s)return!1;a=!0}for(e.kind="scalar",e.result="";0!==s;)if(s=e.input.charCodeAt(++e.position),43===s||45===s)Q===l?l=43===s?G:X:d(e,"repeat of a chomping mode identifier");else{if(!((o=u(s))>=0))break;0===o?d(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?d(e,"repeat of an indentation width identifier"):(p=t+o-1,c=!0)}if(i(s)){do s=e.input.charCodeAt(++e.position);while(i(s));if(35===s)do s=e.input.charCodeAt(++e.position);while(!r(s)&&0!==s)}for(;0!==s;){for(b(e),e.lineIndent=0,s=e.input.charCodeAt(e.position);(!c||e.lineIndent<p)&&32===s;)e.lineIndent++,s=e.input.charCodeAt(++e.position);if(!c&&e.lineIndent>p&&(p=e.lineIndent),r(s))f++;else{if(e.lineIndent<p){l===G?e.result+=U.repeat("\n",f):l===Q&&c&&(e.result+="\n");break}for(a?i(s)?(h=!0,e.result+=U.repeat("\n",f+1)):h?(h=!1,e.result+=U.repeat("\n",f+1)):0===f?c&&(e.result+=" "):e.result+=U.repeat("\n",f):c&&(e.result+=U.repeat("\n",f+1)),c=!0,f=0,n=e.position;!r(s)&&0!==s;)s=e.input.charCodeAt(++e.position);g(e,n,e.position,!1)}}return!0}function j(e,t){var n,r,i,o=e.tag,s=e.anchor,l=[],u=!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=l),i=e.input.charCodeAt(e.position);0!==i&&45===i&&(r=e.input.charCodeAt(e.position+1),a(r));)if(u=!0,e.position++,w(e,!0,-1)&&e.lineIndent<=t)l.push(null),i=e.input.charCodeAt(e.position);else if(n=e.line,L(e,t,Y,!1,!0),l.push(e.result),w(e,!0,-1),i=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==i)d(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break;return u?(e.tag=o,e.anchor=s,e.kind="sequence",e.result=l,!0):!1}function T(e,t,n){var r,o,s,l,u=e.tag,c=e.anchor,p={},f=null,h=null,m=null,g=!1,y=!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=p),l=e.input.charCodeAt(e.position);0!==l;){if(r=e.input.charCodeAt(e.position+1),s=e.line,63!==l&&58!==l||!a(r)){if(!L(e,n,J,!1,!0))break;if(e.line===s){for(l=e.input.charCodeAt(e.position);i(l);)l=e.input.charCodeAt(++e.position);if(58===l)l=e.input.charCodeAt(++e.position),a(l)||d(e,"a whitespace character is expected after the key-value separator within a block mapping"),g&&(v(e,p,f,h,null),f=h=m=null),y=!0,g=!1,o=!1,f=e.tag,h=e.result;else{if(!y)return e.tag=u,e.anchor=c,!0;d(e,"can not read an implicit mapping pair; a colon is missed")}}else{if(!y)return e.tag=u,e.anchor=c,!0;d(e,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===l?(g&&(v(e,p,f,h,null),f=h=m=null),y=!0,g=!0,o=!0):g?(g=!1,o=!0):d(e,"incomplete explicit mapping pair; a key node is missed"),e.position+=1,l=r;if((e.line===s||e.lineIndent>t)&&(L(e,t,K,!0,o)&&(g?h=e.result:m=e.result),g||(v(e,p,f,h,m),f=h=m=null),w(e,!0,-1),l=e.input.charCodeAt(e.position)),e.lineIndent>t&&0!==l)d(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return g&&v(e,p,f,h,null),y&&(e.tag=u,e.anchor=c,e.kind="mapping",e.result=p),y}function I(e){var t,n,r,i,o=!1,s=!1;if(i=e.input.charCodeAt(e.position),33!==i)return!1;if(null!==e.tag&&d(e,"duplication of a tag property"),i=e.input.charCodeAt(++e.position),60===i?(o=!0,i=e.input.charCodeAt(++e.position)):33===i?(s=!0,n="!!",i=e.input.charCodeAt(++e.position)):n="!",t=e.position,o){do i=e.input.charCodeAt(++e.position);while(0!==i&&62!==i);e.position<e.length?(r=e.input.slice(t,e.position),i=e.input.charCodeAt(++e.position)):d(e,"unexpected end of the stream within a verbatim tag")}else{for(;0!==i&&!a(i);)33===i&&(s?d(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),ne.test(n)||d(e,"named tag handle cannot contain such characters"),s=!0,t=e.position+1)),i=e.input.charCodeAt(++e.position);r=e.input.slice(t,e.position),te.test(r)&&d(e,"tag suffix cannot contain flow indicator characters")}return r&&!re.test(r)&&d(e,"tag name cannot contain such characters: "+r),o?e.tag=r:V.call(e.tagMap,n)?e.tag=e.tagMap[n]+r:"!"===n?e.tag="!"+r:"!!"===n?e.tag="tag:yaml.org,2002:"+r:d(e,'undeclared tag handle "'+n+'"'),!0}function _(e){var t,n;if(n=e.input.charCodeAt(e.position),38!==n)return!1;for(null!==e.anchor&&d(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!a(n)&&!o(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&d(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function D(e){var t,n,r;e.length,e.input;if(r=e.input.charCodeAt(e.position),42!==r)return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!a(r)&&!o(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&d(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),e.anchorMap.hasOwnProperty(n)||d(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],w(e,!0,-1),!0}function L(e,t,n,r,i){var a,o,s,l,u,c,p,f,h=1,g=!1,y=!1;if(e.tag=null,e.anchor=null,e.kind=null,e.result=null,a=o=s=K===n||Y===n,r&&w(e,!0,-1)&&(g=!0,e.lineIndent>t?h=1:e.lineIndent===t?h=0:e.lineIndent<t&&(h=-1)),1===h)for(;I(e)||_(e);)w(e,!0,-1)?(g=!0,s=a,e.lineIndent>t?h=1:e.lineIndent===t?h=0:e.lineIndent<t&&(h=-1)):s=!1;if(s&&(s=g||i),(1===h||K===n)&&(p=W===n||J===n?t:t+1,f=e.position-e.lineStart,1===h?s&&(j(e,f)||T(e,f,p))||k(e,p)?y=!0:(o&&O(e,p)||C(e,p)||E(e,p)?y=!0:D(e)?(y=!0,(null!==e.tag||null!==e.anchor)&&d(e,"alias node should not have any properties")):A(e,p,W===n)&&(y=!0,null===e.tag&&(e.tag="?")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===h&&(y=s&&j(e,f))),null!==e.tag&&"!"!==e.tag)if("?"===e.tag){for(l=0,u=e.implicitTypes.length;u>l;l+=1)if(c=e.implicitTypes[l],c.resolve(e.result)){e.result=c.construct(e.result),e.tag=c.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else V.call(e.typeMap,e.tag)?(c=e.typeMap[e.tag],null!==e.result&&c.kind!==e.kind&&d(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+c.kind+'", not "'+e.kind+'"'),c.resolve(e.result)?(e.result=c.construct(e.result),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):d(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):m(e,"unknown tag !<"+e.tag+">");return null!==e.tag||null!==e.anchor||y}function P(e){var t,n,o,s,l=e.position,u=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap={},e.anchorMap={};0!==(s=e.input.charCodeAt(e.position))&&(w(e,!0,-1),s=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==s));){for(u=!0,s=e.input.charCodeAt(++e.position),t=e.position;0!==s&&!a(s);)s=e.input.charCodeAt(++e.position);for(n=e.input.slice(t,e.position),o=[],n.length<1&&d(e,"directive name must not be less than one character in length");0!==s;){for(;i(s);)s=e.input.charCodeAt(++e.position);if(35===s){do s=e.input.charCodeAt(++e.position);while(0!==s&&!r(s));break}if(r(s))break;for(t=e.position;0!==s&&!a(s);)s=e.input.charCodeAt(++e.position);o.push(e.input.slice(t,e.position))}0!==s&&b(e),V.call(se,n)?se[n](e,n,o):m(e,'unknown document directive "'+n+'"')}return w(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,w(e,!0,-1)):u&&d(e,"directives end mark is expected"),L(e,e.lineIndent-1,K,!1,!0),w(e,!0,-1),e.checkLineBreaks&&ee.test(e.input.slice(l,e.position))&&m(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&x(e)?void(46===e.input.charCodeAt(e.position)&&(e.position+=3,
+w(e,!0,-1))):void(e.position<e.length-1&&d(e,"end of the stream or a document separator is expected"))}function N(e,t){e=String(e),t=t||{},0!==e.length&&(10!==e.charCodeAt(e.length-1)&&13!==e.charCodeAt(e.length-1)&&(e+="\n"),65279===e.charCodeAt(0)&&(e=e.slice(1)));var n=new f(e,t);for(Z.test(n.input)&&d(n,"the stream contains non-printable characters"),n.input+="\x00";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)P(n);return n.documents}function $(e,t,n){var r,i,a=N(e,n);for(r=0,i=a.length;i>r;r+=1)t(a[r])}function M(e,t){var n=N(e,t);if(0===n.length)return void 0;if(1===n.length)return n[0];throw new B("expected a single document in the stream, but found more")}function R(e,t,n){$(e,t,U.extend({schema:H},n))}function F(e,t){return M(e,U.extend({schema:H},t))}for(var U=e("./common"),B=e("./exception"),q=e("./mark"),H=e("./schema/default_safe"),z=e("./schema/default_full"),V=Object.prototype.hasOwnProperty,W=1,J=2,Y=3,K=4,Q=1,X=2,G=3,Z=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,ee=/[\x85\u2028\u2029]/,te=/[,\[\]\{\}]/,ne=/^(?:!|!!|![a-z\-]+!)$/i,re=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i,ie=new Array(256),ae=new Array(256),oe=0;256>oe;oe++)ie[oe]=c(oe)?1:0,ae[oe]=c(oe);var se={YAML:function(e,t,n){var r,i,a;null!==e.version&&d(e,"duplication of %YAML directive"),1!==n.length&&d(e,"YAML directive accepts exactly one argument"),r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),null===r&&d(e,"ill-formed argument of the YAML directive"),i=parseInt(r[1],10),a=parseInt(r[2],10),1!==i&&d(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=2>a,1!==a&&2!==a&&m(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var r,i;2!==n.length&&d(e,"TAG directive accepts exactly two arguments"),r=n[0],i=n[1],ne.test(r)||d(e,"ill-formed tag handle (first argument) of the TAG directive"),V.call(e.tagMap,r)&&d(e,'there is a previously declared suffix for "'+r+'" tag handle'),re.test(i)||d(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagMap[r]=i}};t.exports.loadAll=$,t.exports.load=M,t.exports.safeLoadAll=R,t.exports.safeLoad=F},{"./common":23,"./exception":25,"./mark":27,"./schema/default_full":30,"./schema/default_safe":31}],27:[function(e,t,n){"use strict";function r(e,t,n,r,i){this.name=e,this.buffer=t,this.position=n,this.line=r,this.column=i}var i=e("./common");r.prototype.getSnippet=function(e,t){var n,r,a,o,s;if(!this.buffer)return null;for(e=e||4,t=t||75,n="",r=this.position;r>0&&-1==="\x00\r\nÂ…\u2028\u2029".indexOf(this.buffer.charAt(r-1));)if(r-=1,this.position-r>t/2-1){n=" ... ",r+=5;break}for(a="",o=this.position;o<this.buffer.length&&-1==="\x00\r\nÂ…\u2028\u2029".indexOf(this.buffer.charAt(o));)if(o+=1,o-this.position>t/2-1){a=" ... ",o-=5;break}return s=this.buffer.slice(r,o),i.repeat(" ",e)+n+s+a+"\n"+i.repeat(" ",e+this.position-r+n.length)+"^"},r.prototype.toString=function(e){var t,n="";return this.name&&(n+='in "'+this.name+'" '),n+="at line "+(this.line+1)+", column "+(this.column+1),e||(t=this.getSnippet(),t&&(n+=":\n"+t)),n},t.exports=r},{"./common":23}],28:[function(e,t,n){"use strict";function r(e,t,n){var i=[];return e.include.forEach(function(e){n=r(e,t,n)}),e[t].forEach(function(e){n.forEach(function(t,n){t.tag===e.tag&&i.push(n)}),n.push(e)}),n.filter(function(e,t){return-1===i.indexOf(t)})}function i(){function e(e){r[e.tag]=e}var t,n,r={};for(t=0,n=arguments.length;n>t;t+=1)arguments[t].forEach(e);return r}function a(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach(function(e){if(e.loadKind&&"scalar"!==e.loadKind)throw new s("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=r(this,"implicit",[]),this.compiledExplicit=r(this,"explicit",[]),this.compiledTypeMap=i(this.compiledImplicit,this.compiledExplicit)}var o=e("./common"),s=e("./exception"),l=e("./type");a.DEFAULT=null,a.create=function(){var e,t;switch(arguments.length){case 1:e=a.DEFAULT,t=arguments[0];break;case 2:e=arguments[0],t=arguments[1];break;default:throw new s("Wrong number of arguments for Schema.create function")}if(e=o.toArray(e),t=o.toArray(t),!e.every(function(e){return e instanceof a}))throw new s("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!t.every(function(e){return e instanceof l}))throw new s("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new a({include:e,explicit:t})},t.exports=a},{"./common":23,"./exception":25,"./type":34}],29:[function(e,t,n){"use strict";var r=e("../schema");t.exports=new r({include:[e("./json")]})},{"../schema":28,"./json":33}],30:[function(e,t,n){"use strict";var r=e("../schema");t.exports=r.DEFAULT=new r({include:[e("./default_safe")],explicit:[e("../type/js/undefined"),e("../type/js/regexp"),e("../type/js/function")]})},{"../schema":28,"../type/js/function":39,"../type/js/regexp":40,"../type/js/undefined":41,"./default_safe":31}],31:[function(e,t,n){"use strict";var r=e("../schema");t.exports=new r({include:[e("./core")],implicit:[e("../type/timestamp"),e("../type/merge")],explicit:[e("../type/binary"),e("../type/omap"),e("../type/pairs"),e("../type/set")]})},{"../schema":28,"../type/binary":35,"../type/merge":43,"../type/omap":45,"../type/pairs":46,"../type/set":48,"../type/timestamp":50,"./core":29}],32:[function(e,t,n){"use strict";var r=e("../schema");t.exports=new r({explicit:[e("../type/str"),e("../type/seq"),e("../type/map")]})},{"../schema":28,"../type/map":42,"../type/seq":47,"../type/str":49}],33:[function(e,t,n){"use strict";var r=e("../schema");t.exports=new r({include:[e("./failsafe")],implicit:[e("../type/null"),e("../type/bool"),e("../type/int"),e("../type/float")]})},{"../schema":28,"../type/bool":36,"../type/float":37,"../type/int":38,"../type/null":44,"./failsafe":32}],34:[function(e,t,n){"use strict";function r(e){var t={};return null!==e&&Object.keys(e).forEach(function(n){e[n].forEach(function(e){t[String(e)]=n})}),t}function i(e,t){if(t=t||{},Object.keys(t).forEach(function(t){if(-1===o.indexOf(t))throw new a('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')}),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=r(t.styleAliases||null),-1===s.indexOf(this.kind))throw new a('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var a=e("./exception"),o=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],s=["scalar","sequence","mapping"];t.exports=i},{"./exception":25}],35:[function(e,t,n){"use strict";function r(e){if(null===e)return!1;var t,n,r=0,i=e.length,a=u;for(n=0;i>n;n++)if(t=a.indexOf(e.charAt(n)),!(t>64)){if(0>t)return!1;r+=6}return r%8===0}function i(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,a=u,o=0,l=[];for(t=0;i>t;t++)t%4===0&&t&&(l.push(o>>16&255),l.push(o>>8&255),l.push(255&o)),o=o<<6|a.indexOf(r.charAt(t));return n=i%4*6,0===n?(l.push(o>>16&255),l.push(o>>8&255),l.push(255&o)):18===n?(l.push(o>>10&255),l.push(o>>2&255)):12===n&&l.push(o>>4&255),s?new s(l):l}function a(e){var t,n,r="",i=0,a=e.length,o=u;for(t=0;a>t;t++)t%3===0&&t&&(r+=o[i>>18&63],r+=o[i>>12&63],r+=o[i>>6&63],r+=o[63&i]),i=(i<<8)+e[t];return n=a%3,0===n?(r+=o[i>>18&63],r+=o[i>>12&63],r+=o[i>>6&63],r+=o[63&i]):2===n?(r+=o[i>>10&63],r+=o[i>>4&63],r+=o[i<<2&63],r+=o[64]):1===n&&(r+=o[i>>2&63],r+=o[i<<4&63],r+=o[64],r+=o[64]),r}function o(e){return s&&s.isBuffer(e)}var s=e("buffer").Buffer,l=e("../type"),u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";t.exports=new l("tag:yaml.org,2002:binary",{kind:"scalar",resolve:r,construct:i,predicate:o,represent:a})},{"../type":34,buffer:12}],36:[function(e,t,n){"use strict";function r(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)}function i(e){return"true"===e||"True"===e||"TRUE"===e}function a(e){return"[object Boolean]"===Object.prototype.toString.call(e)}var o=e("../type");t.exports=new o("tag:yaml.org,2002:bool",{kind:"scalar",resolve:r,construct:i,predicate:a,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})},{"../type":34}],37:[function(e,t,n){"use strict";function r(e){if(null===e)return!1;return u.test(e)?!0:!1}function i(e){var t,n,r,i;return t=e.replace(/_/g,"").toLowerCase(),n="-"===t[0]?-1:1,i=[],0<="+-".indexOf(t[0])&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:0<=t.indexOf(":")?(t.split(":").forEach(function(e){i.unshift(parseFloat(e,10))}),t=0,r=1,i.forEach(function(e){t+=e*r,r*=60}),n*t):n*parseFloat(t,10)}function a(e,t){if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(s.isNegativeZero(e))return"-0.0";return e.toString(10)}function o(e){return"[object Number]"===Object.prototype.toString.call(e)&&(0!==e%1||s.isNegativeZero(e))}var s=e("../common"),l=e("../type"),u=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)\\.[0-9_]*(?:[eE][-+][0-9]+)?|\\.[0-9_]+(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");t.exports=new l("tag:yaml.org,2002:float",{kind:"scalar",resolve:r,construct:i,predicate:o,represent:a,defaultStyle:"lowercase"})},{"../common":23,"../type":34}],38:[function(e,t,n){"use strict";function r(e){return e>=48&&57>=e||e>=65&&70>=e||e>=97&&102>=e}function i(e){return e>=48&&55>=e}function a(e){return e>=48&&57>=e}function o(e){if(null===e)return!1;var t,n=e.length,o=0,s=!1;if(!n)return!1;if(t=e[o],("-"===t||"+"===t)&&(t=e[++o]),"0"===t){if(o+1===n)return!0;if(t=e[++o],"b"===t){for(o++;n>o;o++)if(t=e[o],"_"!==t){if("0"!==t&&"1"!==t)return!1;s=!0}return s}if("x"===t){for(o++;n>o;o++)if(t=e[o],"_"!==t){if(!r(e.charCodeAt(o)))return!1;s=!0}return s}for(;n>o;o++)if(t=e[o],"_"!==t){if(!i(e.charCodeAt(o)))return!1;s=!0}return s}for(;n>o;o++)if(t=e[o],"_"!==t){if(":"===t)break;if(!a(e.charCodeAt(o)))return!1;s=!0}return s?":"!==t?!0:/^(:[0-5]?[0-9])+$/.test(e.slice(o)):!1}function s(e){var t,n,r=e,i=1,a=[];return-1!==r.indexOf("_")&&(r=r.replace(/_/g,"")),t=r[0],("-"===t||"+"===t)&&("-"===t&&(i=-1),r=r.slice(1),t=r[0]),"0"===r?0:"0"===t?"b"===r[1]?i*parseInt(r.slice(2),2):"x"===r[1]?i*parseInt(r,16):i*parseInt(r,8):-1!==r.indexOf(":")?(r.split(":").forEach(function(e){a.unshift(parseInt(e,10))}),r=0,n=1,a.forEach(function(e){r+=e*n,n*=60}),i*r):i*parseInt(r,10)}function l(e){return"[object Number]"===Object.prototype.toString.call(e)&&0===e%1&&!u.isNegativeZero(e)}var u=e("../common"),c=e("../type");t.exports=new c("tag:yaml.org,2002:int",{kind:"scalar",resolve:o,construct:s,predicate:l,represent:{binary:function(e){return"0b"+e.toString(2)},octal:function(e){return"0"+e.toString(8)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return"0x"+e.toString(16).toUpperCase()}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},{"../common":23,"../type":34}],39:[function(e,t,n){"use strict";function r(e){if(null===e)return!1;try{var t="("+e+")",n=s.parse(t,{range:!0});return"Program"!==n.type||1!==n.body.length||"ExpressionStatement"!==n.body[0].type||"FunctionExpression"!==n.body[0].expression.type?!1:!0}catch(r){return!1}}function i(e){var t,n="("+e+")",r=s.parse(n,{range:!0}),i=[];if("Program"!==r.type||1!==r.body.length||"ExpressionStatement"!==r.body[0].type||"FunctionExpression"!==r.body[0].expression.type)throw new Error("Failed to resolve function");return r.body[0].expression.params.forEach(function(e){i.push(e.name)}),t=r.body[0].expression.body.range,new Function(i,n.slice(t[0]+1,t[1]-1))}function a(e){return e.toString()}function o(e){return"[object Function]"===Object.prototype.toString.call(e)}var s;try{s=e("esprima")}catch(l){"undefined"!=typeof window&&(s=window.esprima)}var u=e("../../type");t.exports=new u("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:r,construct:i,predicate:o,represent:a})},{"../../type":34,esprima:51}],40:[function(e,t,n){"use strict";function r(e){if(null===e)return!1;if(0===e.length)return!1;var t=e,n=/\/([gim]*)$/.exec(e),r="";if("/"===t[0]){if(n&&(r=n[1]),r.length>3)return!1;if("/"!==t[t.length-r.length-1])return!1;t=t.slice(1,t.length-r.length-1)}try{new RegExp(t,r);return!0}catch(i){return!1}}function i(e){var t=e,n=/\/([gim]*)$/.exec(e),r="";return"/"===t[0]&&(n&&(r=n[1]),t=t.slice(1,t.length-r.length-1)),new RegExp(t,r)}function a(e){var t="/"+e.source+"/";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),t}function o(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var s=e("../../type");t.exports=new s("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:r,construct:i,predicate:o,represent:a})},{"../../type":34}],41:[function(e,t,n){"use strict";function r(){return!0}function i(){return void 0}function a(){return""}function o(e){return"undefined"==typeof e}var s=e("../../type");t.exports=new s("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:r,construct:i,predicate:o,represent:a})},{"../../type":34}],42:[function(e,t,n){"use strict";var r=e("../type");t.exports=new r("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}})},{"../type":34}],43:[function(e,t,n){"use strict";function r(e){return"<<"===e||null===e}var i=e("../type");t.exports=new i("tag:yaml.org,2002:merge",{kind:"scalar",resolve:r})},{"../type":34}],44:[function(e,t,n){"use strict";function r(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)}function i(){return null}function a(e){return null===e}var o=e("../type");t.exports=new o("tag:yaml.org,2002:null",{kind:"scalar",resolve:r,construct:i,predicate:a,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})},{"../type":34}],45:[function(e,t,n){"use strict";function r(e){if(null===e)return!0;var t,n,r,i,a,l=[],u=e;for(t=0,n=u.length;n>t;t+=1){if(r=u[t],a=!1,"[object Object]"!==s.call(r))return!1;for(i in r)if(o.call(r,i)){if(a)return!1;a=!0}if(!a)return!1;if(-1!==l.indexOf(i))return!1;l.push(i)}return!0}function i(e){return null!==e?e:[]}var a=e("../type"),o=Object.prototype.hasOwnProperty,s=Object.prototype.toString;t.exports=new a("tag:yaml.org,2002:omap",{kind:"sequence",resolve:r,construct:i})},{"../type":34}],46:[function(e,t,n){"use strict";function r(e){if(null===e)return!0;var t,n,r,i,a,s=e;for(a=new Array(s.length),t=0,n=s.length;n>t;t+=1){if(r=s[t],"[object Object]"!==o.call(r))return!1;if(i=Object.keys(r),1!==i.length)return!1;a[t]=[i[0],r[i[0]]]}return!0}function i(e){if(null===e)return[];var t,n,r,i,a,o=e;for(a=new Array(o.length),t=0,n=o.length;n>t;t+=1)r=o[t],i=Object.keys(r),a[t]=[i[0],r[i[0]]];return a}var a=e("../type"),o=Object.prototype.toString;t.exports=new a("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:r,construct:i})},{"../type":34}],47:[function(e,t,n){"use strict";var r=e("../type");t.exports=new r("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}})},{"../type":34}],48:[function(e,t,n){"use strict";function r(e){if(null===e)return!0;var t,n=e;for(t in n)if(o.call(n,t)&&null!==n[t])return!1;return!0}function i(e){return null!==e?e:{}}var a=e("../type"),o=Object.prototype.hasOwnProperty;t.exports=new a("tag:yaml.org,2002:set",{kind:"mapping",resolve:r,construct:i})},{"../type":34}],49:[function(e,t,n){"use strict";var r=e("../type");t.exports=new r("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}})},{"../type":34}],50:[function(e,t,n){"use strict";function r(e){if(null===e)return!1;var t;return t=s.exec(e),null===t?!1:!0}function i(e){var t,n,r,i,a,o,l,u,c,p,f=0,h=null;if(t=s.exec(e),null===t)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(a=+t[4],o=+t[5],l=+t[6],t[7]){for(f=t[7].slice(0,3);f.length<3;)f+="0";f=+f}return t[9]&&(u=+t[10],c=+(t[11]||0),h=6e4*(60*u+c),"-"===t[9]&&(h=-h)),p=new Date(Date.UTC(n,r,i,a,o,l,f)),h&&p.setTime(p.getTime()-h),p}function a(e){return e.toISOString()}var o=e("../type"),s=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?)?$");t.exports=new o("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:r,construct:i,instanceOf:Date,represent:a})},{"../type":34}],51:[function(t,n,r){!function(t,n){"use strict";"function"==typeof e&&e.amd?e(["exports"],n):n("undefined"!=typeof r?r:t.esprima={})}(this,function(e){"use strict";function t(e,t){if(!e)throw new Error("ASSERT: "+t)}function n(e){return e>=48&&57>=e}function r(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function i(e){return"01234567".indexOf(e)>=0}function a(e){var t="0"!==e,n="01234567".indexOf(e);return dn>nn&&i(Zt[nn])&&(t=!0,n=8*n+"01234567".indexOf(Zt[nn++]),"0123".indexOf(e)>=0&&dn>nn&&i(Zt[nn])&&(n=8*n+"01234567".indexOf(Zt[nn++]))),{code:n,octal:t}}function o(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0}function s(e){return 10===e||13===e||8232===e||8233===e}function l(e){return 36===e||95===e||e>=65&&90>=e||e>=97&&122>=e||92===e||e>=128&&Gt.NonAsciiIdentifierStart.test(String.fromCharCode(e))}function u(e){return 36===e||95===e||e>=65&&90>=e||e>=97&&122>=e||e>=48&&57>=e||92===e||e>=128&&Gt.NonAsciiIdentifierPart.test(String.fromCharCode(e))}function c(e){switch(e){case"enum":case"export":case"import":case"super":return!0;default:return!1}}function p(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}}function f(e){return"eval"===e||"arguments"===e}function h(e){switch(e.length){case 2:return"if"===e||"in"===e||"do"===e;case 3:return"var"===e||"for"===e||"new"===e||"try"===e||"let"===e;case 4:return"this"===e||"else"===e||"case"===e||"void"===e||"with"===e||"enum"===e;case 5:return"while"===e||"break"===e||"catch"===e||"throw"===e||"const"===e||"yield"===e||"class"===e||"super"===e;case 6:return"return"===e||"typeof"===e||"delete"===e||"switch"===e||"export"===e||"import"===e;case 7:return"default"===e||"finally"===e||"extends"===e;case 8:return"function"===e||"continue"===e||"debugger"===e;case 10:return"instanceof"===e;default:return!1}}function d(e,n,r,i,a){var o;t("number"==typeof r,"Comment must have valid position"),gn.lastCommentStart=r,o={type:e,value:n},yn.range&&(o.range=[r,i]),yn.loc&&(o.loc=a),yn.comments.push(o),yn.attachComment&&(yn.leadingComments.push(o),yn.trailingComments.push(o))}function m(e){var t,n,r,i;for(t=nn-e,n={start:{line:rn,column:nn-an-e}};dn>nn;)if(r=Zt.charCodeAt(nn),++nn,s(r))return on=!0,yn.comments&&(i=Zt.slice(t+e,nn-1),n.end={line:rn,column:nn-an-1},d("Line",i,t,nn-1,n)),13===r&&10===Zt.charCodeAt(nn)&&++nn,++rn,void(an=nn);yn.comments&&(i=Zt.slice(t+e,nn),n.end={line:rn,column:nn-an},d("Line",i,t,nn,n))}function g(){var e,t,n,r;for(yn.comments&&(e=nn-2,t={start:{line:rn,column:nn-an-2}});dn>nn;)if(n=Zt.charCodeAt(nn),s(n))13===n&&10===Zt.charCodeAt(nn+1)&&++nn,on=!0,++rn,++nn,an=nn;else if(42===n){if(47===Zt.charCodeAt(nn+1))return++nn,++nn,void(yn.comments&&(r=Zt.slice(e+2,nn-2),t.end={line:rn,column:nn-an},d("Block",r,e,nn,t)));++nn}else++nn;yn.comments&&(t.end={line:rn,column:nn-an},r=Zt.slice(e+2,nn),d("Block",r,e,nn,t)),Z()}function y(){var e,t;for(on=!1,t=0===nn;dn>nn;)if(e=Zt.charCodeAt(nn),o(e))++nn;else if(s(e))on=!0,++nn,13===e&&10===Zt.charCodeAt(nn)&&++nn,++rn,an=nn,t=!0;else if(47===e)if(e=Zt.charCodeAt(nn+1),47===e)++nn,++nn,m(2),t=!0;else{if(42!==e)break;++nn,++nn,g()}else if(t&&45===e){if(45!==Zt.charCodeAt(nn+1)||62!==Zt.charCodeAt(nn+2))break;nn+=3,m(3)}else{if(60!==e)break;if("!--"!==Zt.slice(nn+1,nn+4))break;++nn,++nn,++nn,++nn,m(4)}}function v(e){var t,n,i,a=0;for(n="u"===e?4:2,t=0;n>t;++t){if(!(dn>nn&&r(Zt[nn])))return"";i=Zt[nn++],a=16*a+"0123456789abcdef".indexOf(i.toLowerCase())}return String.fromCharCode(a)}function b(){var e,t,n,i;for(e=Zt[nn],t=0,"}"===e&&G();dn>nn&&(e=Zt[nn++],r(e));)t=16*t+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||"}"!==e)&&G(),65535>=t?String.fromCharCode(t):(n=(t-65536>>10)+55296,i=(t-65536&1023)+56320,String.fromCharCode(n,i))}function w(){var e,t;for(e=Zt.charCodeAt(nn++),t=String.fromCharCode(e),92===e&&(117!==Zt.charCodeAt(nn)&&G(),++nn,e=v("u"),e&&"\\"!==e&&l(e.charCodeAt(0))||G(),t=e);dn>nn&&(e=Zt.charCodeAt(nn),u(e));)++nn,t+=String.fromCharCode(e),92===e&&(t=t.substr(0,t.length-1),117!==Zt.charCodeAt(nn)&&G(),++nn,e=v("u"),e&&"\\"!==e&&u(e.charCodeAt(0))||G(),t+=e);return t}function x(){var e,t;for(e=nn++;dn>nn;){if(t=Zt.charCodeAt(nn),92===t)return nn=e,w();if(!u(t))break;++nn}return Zt.slice(e,nn)}function S(){var e,t,n;return e=nn,t=92===Zt.charCodeAt(nn)?w():x(),n=1===t.length?Wt.Identifier:h(t)?Wt.Keyword:"null"===t?Wt.NullLiteral:"true"===t||"false"===t?Wt.BooleanLiteral:Wt.Identifier,{type:n,value:t,lineNumber:rn,lineStart:an,start:e,end:nn}}function A(){var e,t;switch(e={type:Wt.Punctuator,value:"",lineNumber:rn,lineStart:an,start:nn,end:nn},t=Zt[nn]){case"(":yn.tokenize&&(yn.openParenToken=yn.tokens.length),++nn;break;case"{":yn.tokenize&&(yn.openCurlyToken=yn.tokens.length),gn.curlyStack.push("{"),++nn;break;case".":++nn,"."===Zt[nn]&&"."===Zt[nn+1]&&(nn+=2,t="...");break;case"}":++nn,gn.curlyStack.pop();break;case")":case";":case",":case"[":case"]":case":":case"?":case"~":++nn;break;default:t=Zt.substr(nn,4),">>>="===t?nn+=4:(t=t.substr(0,3),"==="===t||"!=="===t||">>>"===t||"<<="===t||">>="===t?nn+=3:(t=t.substr(0,2),"&&"===t||"||"===t||"=="===t||"!="===t||"+="===t||"-="===t||"*="===t||"/="===t||"++"===t||"--"===t||"<<"===t||">>"===t||"&="===t||"|="===t||"^="===t||"%="===t||"<="===t||">="===t||"=>"===t?nn+=2:(t=Zt[nn],"<>=!+-*%&|^/".indexOf(t)>=0&&++nn)))}return nn===e.start&&G(),e.end=nn,e.value=t,e}function C(e){for(var t="";dn>nn&&r(Zt[nn]);)t+=Zt[nn++];return 0===t.length&&G(),l(Zt.charCodeAt(nn))&&G(),{type:Wt.NumericLiteral,value:parseInt("0x"+t,16),lineNumber:rn,lineStart:an,start:e,end:nn}}function E(e){var t,r;for(r="";dn>nn&&(t=Zt[nn],"0"===t||"1"===t);)r+=Zt[nn++];return 0===r.length&&G(),dn>nn&&(t=Zt.charCodeAt(nn),(l(t)||n(t))&&G()),{type:Wt.NumericLiteral,value:parseInt(r,2),lineNumber:rn,lineStart:an,start:e,end:nn}}function k(e,t){var r,a;for(i(e)?(a=!0,r="0"+Zt[nn++]):(a=!1,++nn,r="");dn>nn&&i(Zt[nn]);)r+=Zt[nn++];return a||0!==r.length||G(),(l(Zt.charCodeAt(nn))||n(Zt.charCodeAt(nn)))&&G(),{type:Wt.NumericLiteral,value:parseInt(r,8),octal:a,lineNumber:rn,lineStart:an,start:t,end:nn}}function O(){var e,t;for(e=nn+1;dn>e;++e){if(t=Zt[e],"8"===t||"9"===t)return!1;if(!i(t))return!0}return!0}function j(){var e,r,a;if(a=Zt[nn],t(n(a.charCodeAt(0))||"."===a,"Numeric literal must start with a decimal digit or a decimal point"),r=nn,e="","."!==a){if(e=Zt[nn++],a=Zt[nn],"0"===e){if("x"===a||"X"===a)return++nn,C(r);if("b"===a||"B"===a)return++nn,E(r);if("o"===a||"O"===a)return k(a,r);if(i(a)&&O())return k(a,r)}for(;n(Zt.charCodeAt(nn));)e+=Zt[nn++];a=Zt[nn]}if("."===a){for(e+=Zt[nn++];n(Zt.charCodeAt(nn));)e+=Zt[nn++];a=Zt[nn]}if("e"===a||"E"===a)if(e+=Zt[nn++],a=Zt[nn],("+"===a||"-"===a)&&(e+=Zt[nn++]),n(Zt.charCodeAt(nn)))for(;n(Zt.charCodeAt(nn));)e+=Zt[nn++];else G();return l(Zt.charCodeAt(nn))&&G(),{type:Wt.NumericLiteral,value:parseFloat(e),lineNumber:rn,lineStart:an,start:r,end:nn}}function T(){var e,n,r,o,l,u="",c=!1;for(e=Zt[nn],t("'"===e||'"'===e,"String literal must starts with a quote"),n=nn,++nn;dn>nn;){if(r=Zt[nn++],r===e){e="";break}if("\\"===r)if(r=Zt[nn++],r&&s(r.charCodeAt(0)))++rn,"\r"===r&&"\n"===Zt[nn]&&++nn,an=nn;else switch(r){case"u":case"x":if("{"===Zt[nn])++nn,u+=b();else{if(o=v(r),!o)throw G();u+=o}break;case"n":u+="\n";break;case"r":u+="\r";break;case"t":u+=" ";break;case"b":u+="\b";break;case"f":u+="\f";break;case"v":u+=" ";break;case"8":case"9":throw G();default:i(r)?(l=a(r),c=l.octal||c,u+=String.fromCharCode(l.code)):u+=r}else{if(s(r.charCodeAt(0)))break;u+=r}}return""!==e&&G(),{type:Wt.StringLiteral,value:u,octal:c,lineNumber:pn,lineStart:fn,start:n,end:nn}}function I(){var e,t,r,a,o,l,u,c,p="";for(a=!1,l=!1,t=nn,o="`"===Zt[nn],r=2,++nn;dn>nn;){if(e=Zt[nn++],"`"===e){r=1,l=!0,a=!0;break}if("$"===e){if("{"===Zt[nn]){gn.curlyStack.push("${"),++nn,a=!0;break}p+=e}else if("\\"===e)if(e=Zt[nn++],s(e.charCodeAt(0)))++rn,"\r"===e&&"\n"===Zt[nn]&&++nn,an=nn;else switch(e){case"n":p+="\n";break;case"r":p+="\r";break;case"t":p+=" ";break;case"u":case"x":"{"===Zt[nn]?(++nn,p+=b()):(u=nn,c=v(e),c?p+=c:(nn=u,p+=e));break;case"b":p+="\b";break;case"f":p+="\f";break;case"v":p+=" ";break;default:"0"===e?(n(Zt.charCodeAt(nn))&&K(Xt.TemplateOctalLiteral),p+="\x00"):i(e)?K(Xt.TemplateOctalLiteral):p+=e}else s(e.charCodeAt(0))?(++rn,"\r"===e&&"\n"===Zt[nn]&&++nn,an=nn,p+="\n"):p+=e}return a||G(),o||gn.curlyStack.pop(),{type:Wt.Template,value:{cooked:p,raw:Zt.slice(t+1,nn-r)},head:o,tail:l,lineNumber:rn,lineStart:an,start:t,end:nn}}function _(e,t){var n=e;t.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,function(e,t){return parseInt(t,16)<=1114111?"x":void G(null,Xt.InvalidRegExp)}).replace(/\\u([a-fA-F0-9]{4})|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{RegExp(n)}catch(r){G(null,Xt.InvalidRegExp)}try{return new RegExp(e,t)}catch(i){return null}}function D(){var e,n,r,i,a;for(e=Zt[nn],t("/"===e,"Regular expression literal must start with a slash"),n=Zt[nn++],r=!1,i=!1;dn>nn;)if(e=Zt[nn++],n+=e,"\\"===e)e=Zt[nn++],s(e.charCodeAt(0))&&G(null,Xt.UnterminatedRegExp),n+=e;else if(s(e.charCodeAt(0)))G(null,Xt.UnterminatedRegExp);else if(r)"]"===e&&(r=!1);else{if("/"===e){i=!0;break}"["===e&&(r=!0)}return i||G(null,Xt.UnterminatedRegExp),a=n.substr(1,n.length-2),{value:a,literal:n}}function L(){var e,t,n,r;for(t="",n="";dn>nn&&(e=Zt[nn],u(e.charCodeAt(0)));)if(++nn,"\\"===e&&dn>nn)if(e=Zt[nn],"u"===e){if(++nn,r=nn,e=v("u"))for(n+=e,t+="\\u";nn>r;++r)t+=Zt[r];else nn=r,n+="u",t+="\\u";Z()}else t+="\\",Z();else n+=e,t+=e;return{value:n,literal:t}}function P(){hn=!0;var e,t,n,r;return mn=null,y(),e=nn,t=D(),n=L(),r=_(t.value,n.value),hn=!1,yn.tokenize?{type:Wt.RegularExpression,value:r,regex:{pattern:t.value,flags:n.value},lineNumber:rn,lineStart:an,start:e,end:nn}:{literal:t.literal+n.literal,value:r,regex:{pattern:t.value,flags:n.value},start:e,end:nn}}function N(){var e,t,n,r;return y(),e=nn,t={start:{line:rn,column:nn-an}},n=P(),t.end={line:rn,column:nn-an},yn.tokenize||(yn.tokens.length>0&&(r=yn.tokens[yn.tokens.length-1],r.range[0]===e&&"Punctuator"===r.type&&("/"===r.value||"/="===r.value)&&yn.tokens.pop()),yn.tokens.push({type:"RegularExpression",value:n.literal,regex:n.regex,range:[e,nn],loc:t})),n}function $(e){return e.type===Wt.Identifier||e.type===Wt.Keyword||e.type===Wt.BooleanLiteral||e.type===Wt.NullLiteral}function M(){var e,t;if(e=yn.tokens[yn.tokens.length-1],!e)return N();if("Punctuator"===e.type){if("]"===e.value)return A();if(")"===e.value)return t=yn.tokens[yn.openParenToken-1],!t||"Keyword"!==t.type||"if"!==t.value&&"while"!==t.value&&"for"!==t.value&&"with"!==t.value?A():N();if("}"===e.value){if(yn.tokens[yn.openCurlyToken-3]&&"Keyword"===yn.tokens[yn.openCurlyToken-3].type){if(t=yn.tokens[yn.openCurlyToken-4],!t)return A()}else{if(!yn.tokens[yn.openCurlyToken-4]||"Keyword"!==yn.tokens[yn.openCurlyToken-4].type)return A();if(t=yn.tokens[yn.openCurlyToken-5],!t)return N()}return Yt.indexOf(t.value)>=0?A():N()}return N()}return"Keyword"===e.type&&"this"!==e.value?N():A()}function R(){var e,t;return nn>=dn?{type:Wt.EOF,lineNumber:rn,lineStart:an,start:nn,end:nn}:(e=Zt.charCodeAt(nn),l(e)?(t=S(),en&&p(t.value)&&(t.type=Wt.Keyword),t):40===e||41===e||59===e?A():39===e||34===e?T():46===e?n(Zt.charCodeAt(nn+1))?j():A():n(e)?j():yn.tokenize&&47===e?M():96===e||125===e&&"${"===gn.curlyStack[gn.curlyStack.length-1]?I():A())}function F(){var e,t,n,r;return e={start:{line:rn,column:nn-an}},t=R(),e.end={line:rn,column:nn-an},t.type!==Wt.EOF&&(n=Zt.slice(t.start,t.end),r={type:Jt[t.type],value:n,range:[t.start,t.end],loc:e},t.regex&&(r.regex={pattern:t.regex.pattern,flags:t.regex.flags}),yn.tokens.push(r)),t}function U(){var e;return hn=!0,sn=nn,ln=rn,un=an,y(),e=mn,cn=nn,pn=rn,fn=an,mn="undefined"!=typeof yn.tokens?F():R(),hn=!1,e}function B(){hn=!0,y(),sn=nn,ln=rn,un=an,cn=nn,pn=rn,fn=an,mn="undefined"!=typeof yn.tokens?F():R(),hn=!1}function q(){this.line=pn,this.column=cn-fn}function H(){this.start=new q,this.end=null}function z(e){this.start={line:e.lineNumber,column:e.start-e.lineStart},this.end=null}function V(){yn.range&&(this.range=[cn,0]),yn.loc&&(this.loc=new H)}function W(e){yn.range&&(this.range=[e.start,0]),yn.loc&&(this.loc=new z(e))}function J(e){var t,n;for(t=0;t<yn.errors.length;t++)if(n=yn.errors[t],n.index===e.index&&n.message===e.message)return;yn.errors.push(e)}function Y(e,t,n){var r=new Error("Line "+e+": "+n);return r.index=t,r.lineNumber=e,r.column=t-(hn?an:un)+1,r.description=n,r}function K(e){var n,r;throw n=Array.prototype.slice.call(arguments,1),r=e.replace(/%(\d)/g,function(e,r){return t(r<n.length,"Message reference must be in range"),n[r]}),Y(ln,sn,r)}function Q(e){var n,r,i;if(n=Array.prototype.slice.call(arguments,1),r=e.replace(/%(\d)/g,function(e,r){return t(r<n.length,"Message reference must be in range"),n[r]}),i=Y(rn,sn,r),!yn.errors)throw i;J(i)}function X(e,t){var n,r=t||Xt.UnexpectedToken;return e?(t||(r=e.type===Wt.EOF?Xt.UnexpectedEOS:e.type===Wt.Identifier?Xt.UnexpectedIdentifier:e.type===Wt.NumericLiteral?Xt.UnexpectedNumber:e.type===Wt.StringLiteral?Xt.UnexpectedString:e.type===Wt.Template?Xt.UnexpectedTemplate:Xt.UnexpectedToken,e.type===Wt.Keyword&&(c(e.value)?r=Xt.UnexpectedReserved:en&&p(e.value)&&(r=Xt.StrictReservedWord))),n=e.type===Wt.Template?e.value.raw:e.value):n="ILLEGAL",r=r.replace("%0",n),e&&"number"==typeof e.lineNumber?Y(e.lineNumber,e.start,r):Y(hn?rn:ln,hn?nn:sn,r)}function G(e,t){throw X(e,t)}function Z(e,t){var n=X(e,t);if(!yn.errors)throw n;J(n)}function ee(e){var t=U();(t.type!==Wt.Punctuator||t.value!==e)&&G(t)}function te(){var e;yn.errors?(e=mn,e.type===Wt.Punctuator&&","===e.value?U():e.type===Wt.Punctuator&&";"===e.value?(U(),Z(e)):Z(e,Xt.UnexpectedToken)):ee(",")}function ne(e){var t=U();(t.type!==Wt.Keyword||t.value!==e)&&G(t)}function re(e){return mn.type===Wt.Punctuator&&mn.value===e}function ie(e){return mn.type===Wt.Keyword&&mn.value===e}function ae(e){return mn.type===Wt.Identifier&&mn.value===e}function oe(){var e;return mn.type!==Wt.Punctuator?!1:(e=mn.value,"="===e||"*="===e||"/="===e||"%="===e||"+="===e||"-="===e||"<<="===e||">>="===e||">>>="===e||"&="===e||"^="===e||"|="===e)}function se(){return 59===Zt.charCodeAt(cn)||re(";")?void U():void(on||(sn=cn,ln=pn,un=fn,mn.type===Wt.EOF||re("}")||G(mn)))}function le(e){var t,n=vn,r=bn,i=wn;return vn=!0,bn=!0,wn=null,t=e(),null!==wn&&G(wn),vn=n,bn=r,wn=i,t}function ue(e){var t,n=vn,r=bn,i=wn;
+return vn=!0,bn=!0,wn=null,t=e(),vn=vn&&n,bn=bn&&r,wn=i||wn,t}function ce(){var e,t,n=new V,r=[];for(ee("[");!re("]");)if(re(","))U(),r.push(null);else{if(re("...")){t=new V,U(),e=Qe(),r.push(t.finishRestElement(e));break}r.push(de()),re("]")||ee(",")}return ee("]"),n.finishArrayPattern(r)}function pe(){var e,t,n=new V,r=re("[");if(mn.type===Wt.Identifier){if(e=Qe(),re("="))return U(),t=Ve(),n.finishProperty("init",e,!1,new W(e).finishAssignmentPattern(e,t),!1,!1);if(!re(":"))return n.finishProperty("init",e,!1,e,!1,!0)}else e=ve();return ee(":"),t=de(),n.finishProperty("init",e,r,t,!1,!1)}function fe(){var e=new V,t=[];for(ee("{");!re("}");)t.push(pe()),re("}")||ee(",");return U(),e.finishObjectPattern(t)}function he(){return mn.type===Wt.Identifier?Qe():re("[")?ce():re("{")?fe():void G(mn)}function de(){var e,t,n=mn;return e=he(),re("=")&&(U(),t=le(Ve),e=new W(n).finishAssignmentPattern(e,t)),e}function me(){var e,t=[],n=new V;for(ee("[");!re("]");)re(",")?(U(),t.push(null)):re("...")?(e=new V,U(),e.finishSpreadElement(ue(Ve)),re("]")||(bn=vn=!1,ee(",")),t.push(e)):(t.push(ue(Ve)),re("]")||ee(","));return U(),n.finishArrayExpression(t)}function ge(e,t){var n,r;return bn=vn=!1,n=en,r=le(xt),en&&t.firstRestricted&&Z(t.firstRestricted,t.message),en&&t.stricted&&Z(t.stricted,t.message),en=n,e.finishFunctionExpression(null,t.params,t.defaults,r)}function ye(){var e,t,n=new V;return e=Ct(),t=ge(n,e)}function ve(){var e,t,n=new V;switch(e=U(),e.type){case Wt.StringLiteral:case Wt.NumericLiteral:return en&&e.octal&&Z(e,Xt.StrictOctalLiteral),n.finishLiteral(e);case Wt.Identifier:case Wt.BooleanLiteral:case Wt.NullLiteral:case Wt.Keyword:return n.finishIdentifier(e.value);case Wt.Punctuator:if("["===e.value)return t=le(Ve),ee("]"),t}G(e)}function be(){switch(mn.type){case Wt.Identifier:case Wt.StringLiteral:case Wt.BooleanLiteral:case Wt.NullLiteral:case Wt.NumericLiteral:case Wt.Keyword:return!0;case Wt.Punctuator:return"["===mn.value}return!1}function we(e,t,n,r){var i,a,o;if(e.type===Wt.Identifier){if("get"===e.value&&be())return n=re("["),t=ve(),o=new V,ee("("),ee(")"),i=ge(o,{params:[],defaults:[],stricted:null,firstRestricted:null,message:null}),r.finishProperty("get",t,n,i,!1,!1);if("set"===e.value&&be())return n=re("["),t=ve(),o=new V,ee("("),a={params:[],defaultCount:0,defaults:[],firstRestricted:null,paramSet:{}},re(")")?Z(mn):(At(a),0===a.defaultCount&&(a.defaults=[])),ee(")"),i=ge(o,a),r.finishProperty("set",t,n,i,!1,!1)}return re("(")?(i=ye(),r.finishProperty("init",t,n,i,!0,!1)):null}function xe(e,t,n){t===!1&&(e.type===Kt.Identifier&&"__proto__"===e.name||e.type===Kt.Literal&&"__proto__"===e.value)&&(n.value?Q(Xt.DuplicateProtoProperty):n.value=!0)}function Se(e){var t,n,r,i,a=mn,o=new V;return t=re("["),n=ve(),(r=we(a,n,t,o))?(xe(r.key,r.computed,e),r):(xe(n,t,e),re(":")?(U(),i=ue(Ve),o.finishProperty("init",n,t,i,!1,!1)):a.type===Wt.Identifier?re("=")?(wn=mn,U(),i=le(Ve),o.finishProperty("init",n,t,new W(a).finishAssignmentPattern(n,i),!1,!0)):o.finishProperty("init",n,t,n,!1,!0):void G(mn))}function Ae(){var e=[],t={value:!1},n=new V;for(ee("{");!re("}");)e.push(Se(t)),re("}")||te();return ee("}"),n.finishObjectExpression(e)}function Ce(e){var t;switch(e.type){case Kt.Identifier:case Kt.MemberExpression:case Kt.RestElement:case Kt.AssignmentPattern:break;case Kt.SpreadElement:e.type=Kt.RestElement,Ce(e.argument);break;case Kt.ArrayExpression:for(e.type=Kt.ArrayPattern,t=0;t<e.elements.length;t++)null!==e.elements[t]&&Ce(e.elements[t]);break;case Kt.ObjectExpression:for(e.type=Kt.ObjectPattern,t=0;t<e.properties.length;t++)Ce(e.properties[t].value);break;case Kt.AssignmentExpression:e.type=Kt.AssignmentPattern,Ce(e.left)}}function Ee(e){var t,n;return(mn.type!==Wt.Template||e.head&&!mn.head)&&G(),t=new V,n=U(),t.finishTemplateElement({raw:n.value.raw,cooked:n.value.cooked},n.tail)}function ke(){var e,t,n,r=new V;for(e=Ee({head:!0}),t=[e],n=[];!e.tail;)n.push(We()),e=Ee({head:!1}),t.push(e);return r.finishTemplateLiteral(t,n)}function Oe(){var e,t,n,r;if(ee("("),re(")"))return U(),re("=>")||ee("=>"),{type:Qt.ArrowParameterPlaceHolder,params:[]};if(n=mn,re("..."))return e=rt(),ee(")"),re("=>")||ee("=>"),{type:Qt.ArrowParameterPlaceHolder,params:[e]};if(vn=!0,e=ue(Ve),re(",")){for(bn=!1,t=[e];dn>cn&&re(",");){if(U(),re("...")){for(vn||G(mn),t.push(rt()),ee(")"),re("=>")||ee("=>"),vn=!1,r=0;r<t.length;r++)Ce(t[r]);return{type:Qt.ArrowParameterPlaceHolder,params:t}}t.push(ue(Ve))}e=new W(n).finishSequenceExpression(t)}if(ee(")"),re("=>")){if(vn||G(mn),e.type===Kt.SequenceExpression)for(r=0;r<e.expressions.length;r++)Ce(e.expressions[r]);else Ce(e);e={type:Qt.ArrowParameterPlaceHolder,params:e.type===Kt.SequenceExpression?e.expressions:[e]}}return vn=!1,e}function je(){var e,t,n,r;if(re("("))return vn=!1,ue(Oe);if(re("["))return ue(me);if(re("{"))return ue(Ae);if(e=mn.type,r=new V,e===Wt.Identifier)n=r.finishIdentifier(U().value);else if(e===Wt.StringLiteral||e===Wt.NumericLiteral)bn=vn=!1,en&&mn.octal&&Z(mn,Xt.StrictOctalLiteral),n=r.finishLiteral(U());else if(e===Wt.Keyword){if(bn=vn=!1,ie("function"))return kt();if(ie("this"))return U(),r.finishThisExpression();if(ie("class"))return Tt();G(U())}else e===Wt.BooleanLiteral?(bn=vn=!1,t=U(),t.value="true"===t.value,n=r.finishLiteral(t)):e===Wt.NullLiteral?(bn=vn=!1,t=U(),t.value=null,n=r.finishLiteral(t)):re("/")||re("/=")?(bn=vn=!1,nn=cn,t="undefined"!=typeof yn.tokens?N():P(),U(),n=r.finishLiteral(t)):e===Wt.Template?n=ke():G(U());return n}function Te(){var e=[];if(ee("("),!re(")"))for(;dn>cn&&(e.push(le(Ve)),!re(")"));)te();return ee(")"),e}function Ie(){var e,t=new V;return e=U(),$(e)||G(e),t.finishIdentifier(e.value)}function _e(){return ee("."),Ie()}function De(){var e;return ee("["),e=le(We),ee("]"),e}function Le(){var e,t,n=new V;return ne("new"),e=le(Ne),t=re("(")?Te():[],bn=vn=!1,n.finishNewExpression(e,t)}function Pe(){var e,t,n,r,i,a=gn.allowIn;for(i=mn,gn.allowIn=!0,ie("super")&&gn.inFunctionBody?(t=new V,U(),t=t.finishSuper(),re("(")||re(".")||re("[")||G(mn)):t=ue(ie("new")?Le:je);;)if(re("."))vn=!1,bn=!0,r=_e(),t=new W(i).finishMemberExpression(".",t,r);else if(re("("))vn=!1,bn=!1,n=Te(),t=new W(i).finishCallExpression(t,n);else if(re("["))vn=!1,bn=!0,r=De(),t=new W(i).finishMemberExpression("[",t,r);else{if(mn.type!==Wt.Template||!mn.head)break;e=ke(),t=new W(i).finishTaggedTemplateExpression(t,e)}return gn.allowIn=a,t}function Ne(){var e,n,r,i;for(t(gn.allowIn,"callee of new expression always allow in keyword."),i=mn,ie("super")&&gn.inFunctionBody?(n=new V,U(),n=n.finishSuper(),re("[")||re(".")||G(mn)):n=ue(ie("new")?Le:je);;)if(re("["))vn=!1,bn=!0,r=De(),n=new W(i).finishMemberExpression("[",n,r);else if(re("."))vn=!1,bn=!0,r=_e(),n=new W(i).finishMemberExpression(".",n,r);else{if(mn.type!==Wt.Template||!mn.head)break;e=ke(),n=new W(i).finishTaggedTemplateExpression(n,e)}return n}function $e(){var e,t,n=mn;return e=ue(Pe),on||mn.type!==Wt.Punctuator||(re("++")||re("--"))&&(en&&e.type===Kt.Identifier&&f(e.name)&&Q(Xt.StrictLHSPostfix),bn||Q(Xt.InvalidLHSInAssignment),bn=vn=!1,t=U(),e=new W(n).finishPostfixExpression(t.value,e)),e}function Me(){var e,t,n;return mn.type!==Wt.Punctuator&&mn.type!==Wt.Keyword?t=$e():re("++")||re("--")?(n=mn,e=U(),t=ue(Me),en&&t.type===Kt.Identifier&&f(t.name)&&Q(Xt.StrictLHSPrefix),bn||Q(Xt.InvalidLHSInAssignment),t=new W(n).finishUnaryExpression(e.value,t),bn=vn=!1):re("+")||re("-")||re("~")||re("!")?(n=mn,e=U(),t=ue(Me),t=new W(n).finishUnaryExpression(e.value,t),bn=vn=!1):ie("delete")||ie("void")||ie("typeof")?(n=mn,e=U(),t=ue(Me),t=new W(n).finishUnaryExpression(e.value,t),en&&"delete"===t.operator&&t.argument.type===Kt.Identifier&&Q(Xt.StrictDelete),bn=vn=!1):t=$e(),t}function Re(e,t){var n=0;if(e.type!==Wt.Punctuator&&e.type!==Wt.Keyword)return 0;switch(e.value){case"||":n=1;break;case"&&":n=2;break;case"|":n=3;break;case"^":n=4;break;case"&":n=5;break;case"==":case"!=":case"===":case"!==":n=6;break;case"<":case">":case"<=":case">=":case"instanceof":n=7;break;case"in":n=t?7:0;break;case"<<":case">>":case">>>":n=8;break;case"+":case"-":n=9;break;case"*":case"/":case"%":n=11}return n}function Fe(){var e,t,n,r,i,a,o,s,l,u;if(e=mn,l=ue(Me),r=mn,i=Re(r,gn.allowIn),0===i)return l;for(bn=vn=!1,r.prec=i,U(),t=[e,mn],o=le(Me),a=[l,r,o];(i=Re(mn,gn.allowIn))>0;){for(;a.length>2&&i<=a[a.length-2].prec;)o=a.pop(),s=a.pop().value,l=a.pop(),t.pop(),n=new W(t[t.length-1]).finishBinaryExpression(s,l,o),a.push(n);r=U(),r.prec=i,a.push(r),t.push(mn),n=le(Me),a.push(n)}for(u=a.length-1,n=a[u],t.pop();u>1;)n=new W(t.pop()).finishBinaryExpression(a[u-1].value,a[u-2],n),u-=2;return n}function Ue(){var e,t,n,r,i;return i=mn,e=ue(Fe),re("?")&&(U(),t=gn.allowIn,gn.allowIn=!0,n=le(Ve),gn.allowIn=t,ee(":"),r=le(Ve),e=new W(i).finishConditionalExpression(e,n,r),bn=vn=!1),e}function Be(){return re("{")?xt():le(Ve)}function qe(e,n){var r;switch(n.type){case Kt.Identifier:St(e,n,n.name);break;case Kt.RestElement:qe(e,n.argument);break;case Kt.AssignmentPattern:qe(e,n.left);break;case Kt.ArrayPattern:for(r=0;r<n.elements.length;r++)null!==n.elements[r]&&qe(e,n.elements[r]);break;default:for(t(n.type===Kt.ObjectPattern,"Invalid type"),r=0;r<n.properties.length;r++)qe(e,n.properties[r].value)}}function He(e){var t,n,r,i,a,o,s,l;switch(a=[],o=0,i=[e],e.type){case Kt.Identifier:break;case Qt.ArrowParameterPlaceHolder:i=e.params;break;default:return null}for(s={paramSet:{}},t=0,n=i.length;n>t;t+=1)switch(r=i[t],r.type){case Kt.AssignmentPattern:i[t]=r.left,a.push(r.right),++o,qe(s,r.left);break;default:qe(s,r),i[t]=r,a.push(null)}return s.message===Xt.StrictParamDupe&&(l=en?s.stricted:s.firstRestricted,G(l,s.message)),0===o&&(a=[]),{params:i,defaults:a,stricted:s.stricted,firstRestricted:s.firstRestricted,message:s.message}}function ze(e,t){var n,r;return on&&Z(mn),ee("=>"),n=en,r=Be(),en&&e.firstRestricted&&G(e.firstRestricted,e.message),en&&e.stricted&&Z(e.stricted,e.message),en=n,t.finishArrowFunctionExpression(e.params,e.defaults,r,r.type!==Kt.BlockStatement)}function Ve(){var e,t,n,r,i;return i=mn,e=mn,t=Ue(),t.type===Qt.ArrowParameterPlaceHolder||re("=>")?(bn=vn=!1,r=He(t),r?(wn=null,ze(r,new W(i))):t):(oe()&&(bn||Q(Xt.InvalidLHSInAssignment),en&&t.type===Kt.Identifier&&f(t.name)&&Z(e,Xt.StrictLHSAssignment),re("=")?Ce(t):bn=vn=!1,e=U(),n=le(Ve),t=new W(i).finishAssignmentExpression(e.value,t,n),wn=null),t)}function We(){var e,t,n=mn;if(e=le(Ve),re(",")){for(t=[e];dn>cn&&re(",");)U(),t.push(le(Ve));e=new W(n).finishSequenceExpression(t)}return e}function Je(){if(mn.type===Wt.Keyword)switch(mn.value){case"export":return"module"!==tn&&Z(mn,Xt.IllegalExportDeclaration),Nt();case"import":return"module"!==tn&&Z(mn,Xt.IllegalImportDeclaration),Ut();case"const":case"let":return nt({inFor:!1});case"function":return Et(new V);case"class":return jt()}return wt()}function Ye(){for(var e=[];dn>cn&&!re("}");)e.push(Je());return e}function Ke(){var e,t=new V;return ee("{"),e=Ye(),ee("}"),t.finishBlockStatement(e)}function Qe(){var e,t=new V;return e=U(),e.type!==Wt.Identifier&&(en&&e.type===Wt.Keyword&&p(e.value)?Z(e,Xt.StrictReservedWord):G(e)),t.finishIdentifier(e.value)}function Xe(){var e,t=null,n=new V;return e=he(),en&&f(e.name)&&Q(Xt.StrictVarName),re("=")?(U(),t=le(Ve)):e.type!==Kt.Identifier&&ee("="),n.finishVariableDeclarator(e,t)}function Ge(){var e=[];do{if(e.push(Xe()),!re(","))break;U()}while(dn>cn);return e}function Ze(e){var t;return ne("var"),t=Ge(),se(),e.finishVariableDeclaration(t)}function et(e,t){var n,r=null,i=new V;return n=he(),en&&n.type===Kt.Identifier&&f(n.name)&&Q(Xt.StrictVarName),"const"===e?ie("in")||(ee("="),r=le(Ve)):(!t.inFor&&n.type!==Kt.Identifier||re("="))&&(ee("="),r=le(Ve)),i.finishVariableDeclarator(n,r)}function tt(e,t){var n=[];do{if(n.push(et(e,t)),!re(","))break;U()}while(dn>cn);return n}function nt(e){var n,r,i=new V;return n=U().value,t("let"===n||"const"===n,"Lexical declaration must be either let or const"),r=tt(n,e),se(),i.finishLexicalDeclaration(r,n)}function rt(){var e,t=new V;return U(),re("{")&&K(Xt.ObjectPatternAsRestParameter),e=Qe(),re("=")&&K(Xt.DefaultRestParameter),re(")")||K(Xt.ParameterAfterRestParameter),t.finishRestElement(e)}function it(e){return ee(";"),e.finishEmptyStatement()}function at(e){var t=We();return se(),e.finishExpressionStatement(t)}function ot(e){var t,n,r;return ne("if"),ee("("),t=We(),ee(")"),n=wt(),ie("else")?(U(),r=wt()):r=null,e.finishIfStatement(t,n,r)}function st(e){var t,n,r;return ne("do"),r=gn.inIteration,gn.inIteration=!0,t=wt(),gn.inIteration=r,ne("while"),ee("("),n=We(),ee(")"),re(";")&&U(),e.finishDoWhileStatement(t,n)}function lt(e){var t,n,r;return ne("while"),ee("("),t=We(),ee(")"),r=gn.inIteration,gn.inIteration=!0,n=wt(),gn.inIteration=r,e.finishWhileStatement(t,n)}function ut(e){var t,n,r,i,a,o,s,l,u,c,p,f=gn.allowIn;if(t=i=a=null,ne("for"),ee("("),re(";"))U();else if(ie("var"))t=new V,U(),gn.allowIn=!1,t=t.finishVariableDeclaration(Ge()),gn.allowIn=f,1===t.declarations.length&&ie("in")?(U(),o=t,s=We(),t=null):ee(";");else if(ie("const")||ie("let"))t=new V,l=U().value,gn.allowIn=!1,u=tt(l,{inFor:!0}),gn.allowIn=f,1===u.length&&null===u[0].init&&ie("in")?(t=t.finishLexicalDeclaration(u,l),U(),o=t,s=We(),t=null):(se(),t=t.finishLexicalDeclaration(u,l));else if(r=mn,gn.allowIn=!1,t=ue(Ve),gn.allowIn=f,ie("in"))bn||Q(Xt.InvalidLHSInForIn),U(),Ce(t),o=t,s=We(),t=null;else{if(re(",")){for(n=[t];re(",");)U(),n.push(le(Ve));t=new W(r).finishSequenceExpression(n)}ee(";")}return"undefined"==typeof o&&(re(";")||(i=We()),ee(";"),re(")")||(a=We())),ee(")"),p=gn.inIteration,gn.inIteration=!0,c=le(wt),gn.inIteration=p,"undefined"==typeof o?e.finishForStatement(t,i,a,c):e.finishForInStatement(o,s,c)}function ct(e){var t,n=null;return ne("continue"),59===Zt.charCodeAt(cn)?(U(),gn.inIteration||K(Xt.IllegalContinue),e.finishContinueStatement(null)):on?(gn.inIteration||K(Xt.IllegalContinue),e.finishContinueStatement(null)):(mn.type===Wt.Identifier&&(n=Qe(),t="$"+n.name,Object.prototype.hasOwnProperty.call(gn.labelSet,t)||K(Xt.UnknownLabel,n.name)),se(),null!==n||gn.inIteration||K(Xt.IllegalContinue),e.finishContinueStatement(n))}function pt(e){var t,n=null;return ne("break"),59===Zt.charCodeAt(sn)?(U(),gn.inIteration||gn.inSwitch||K(Xt.IllegalBreak),e.finishBreakStatement(null)):on?(gn.inIteration||gn.inSwitch||K(Xt.IllegalBreak),e.finishBreakStatement(null)):(mn.type===Wt.Identifier&&(n=Qe(),t="$"+n.name,Object.prototype.hasOwnProperty.call(gn.labelSet,t)||K(Xt.UnknownLabel,n.name)),se(),null!==n||gn.inIteration||gn.inSwitch||K(Xt.IllegalBreak),e.finishBreakStatement(n))}function ft(e){var t=null;return ne("return"),gn.inFunctionBody||Q(Xt.IllegalReturn),32===Zt.charCodeAt(sn)&&l(Zt.charCodeAt(sn+1))?(t=We(),se(),e.finishReturnStatement(t)):on?e.finishReturnStatement(null):(re(";")||re("}")||mn.type===Wt.EOF||(t=We()),se(),e.finishReturnStatement(t))}function ht(e){var t,n;return en&&Q(Xt.StrictModeWith),ne("with"),ee("("),t=We(),ee(")"),n=wt(),e.finishWithStatement(t,n)}function dt(){var e,t,n=[],r=new V;for(ie("default")?(U(),e=null):(ne("case"),e=We()),ee(":");dn>cn&&!(re("}")||ie("default")||ie("case"));)t=Je(),n.push(t);return r.finishSwitchCase(e,n)}function mt(e){var t,n,r,i,a;if(ne("switch"),ee("("),t=We(),ee(")"),ee("{"),n=[],re("}"))return U(),e.finishSwitchStatement(t,n);for(i=gn.inSwitch,gn.inSwitch=!0,a=!1;dn>cn&&!re("}");)r=dt(),null===r.test&&(a&&K(Xt.MultipleDefaultsInSwitch),a=!0),n.push(r);return gn.inSwitch=i,ee("}"),e.finishSwitchStatement(t,n)}function gt(e){var t;return ne("throw"),on&&K(Xt.NewlineAfterThrow),t=We(),se(),e.finishThrowStatement(t)}function yt(){var e,t,n=new V;return ne("catch"),ee("("),re(")")&&G(mn),e=he(),en&&f(e.name)&&Q(Xt.StrictCatchVariable),ee(")"),t=Ke(),n.finishCatchClause(e,t)}function vt(e){var t,n=null,r=null;return ne("try"),t=Ke(),ie("catch")&&(n=yt()),ie("finally")&&(U(),r=Ke()),n||r||K(Xt.NoCatchOrFinally),e.finishTryStatement(t,n,r)}function bt(e){return ne("debugger"),se(),e.finishDebuggerStatement()}function wt(){var e,t,n,r,i=mn.type;if(i===Wt.EOF&&G(mn),i===Wt.Punctuator&&"{"===mn.value)return Ke();if(bn=vn=!0,r=new V,i===Wt.Punctuator)switch(mn.value){case";":return it(r);case"(":return at(r)}else if(i===Wt.Keyword)switch(mn.value){case"break":return pt(r);case"continue":return ct(r);case"debugger":return bt(r);case"do":return st(r);case"for":return ut(r);case"function":return Et(r);case"if":return ot(r);case"return":return ft(r);case"switch":return mt(r);case"throw":return gt(r);case"try":return vt(r);case"var":return Ze(r);case"while":return lt(r);case"with":return ht(r)}return e=We(),e.type===Kt.Identifier&&re(":")?(U(),n="$"+e.name,Object.prototype.hasOwnProperty.call(gn.labelSet,n)&&K(Xt.Redeclaration,"Label",e.name),gn.labelSet[n]=!0,t=wt(),delete gn.labelSet[n],r.finishLabeledStatement(e,t)):(se(),r.finishExpressionStatement(e))}function xt(){var e,t,n,r,i,a,o,s,l,u=[],c=new V;for(ee("{");dn>cn&&mn.type===Wt.StringLiteral&&(t=mn,e=Je(),u.push(e),e.expression.type===Kt.Literal);)n=Zt.slice(t.start+1,t.end-1),"use strict"===n?(en=!0,r&&Z(r,Xt.StrictOctalLiteral)):!r&&t.octal&&(r=t);for(i=gn.labelSet,a=gn.inIteration,o=gn.inSwitch,s=gn.inFunctionBody,l=gn.parenthesizedCount,gn.labelSet={},gn.inIteration=!1,gn.inSwitch=!1,gn.inFunctionBody=!0,gn.parenthesizedCount=0;dn>cn&&!re("}");)u.push(Je());return ee("}"),gn.labelSet=i,gn.inIteration=a,gn.inSwitch=o,gn.inFunctionBody=s,gn.parenthesizedCount=l,c.finishBlockStatement(u)}function St(e,t,n){var r="$"+n;en?(f(n)&&(e.stricted=t,e.message=Xt.StrictParamName),Object.prototype.hasOwnProperty.call(e.paramSet,r)&&(e.stricted=t,e.message=Xt.StrictParamDupe)):e.firstRestricted||(f(n)?(e.firstRestricted=t,e.message=Xt.StrictParamName):p(n)?(e.firstRestricted=t,e.message=Xt.StrictReservedWord):Object.prototype.hasOwnProperty.call(e.paramSet,r)&&(e.firstRestricted=t,e.message=Xt.StrictParamDupe)),e.paramSet[r]=!0}function At(e){var t,n,r;return t=mn,"..."===t.value?(n=rt(),St(e,n.argument,n.argument.name),e.params.push(n),e.defaults.push(null),!1):(n=de(),St(e,t,t.value),n.type===Kt.AssignmentPattern&&(r=n.right,n=n.left,++e.defaultCount),e.params.push(n),e.defaults.push(r),!re(")"))}function Ct(e){var t;if(t={params:[],defaultCount:0,defaults:[],firstRestricted:e},ee("("),!re(")"))for(t.paramSet={};dn>cn&&At(t);)ee(",");return ee(")"),0===t.defaultCount&&(t.defaults=[]),{params:t.params,defaults:t.defaults,stricted:t.stricted,firstRestricted:t.firstRestricted,message:t.message}}function Et(e,t){var n,r,i,a,o,s,l,u=null,c=[],h=[];return ne("function"),t&&re("(")||(r=mn,u=Qe(),en?f(r.value)&&Z(r,Xt.StrictFunctionName):f(r.value)?(o=r,s=Xt.StrictFunctionName):p(r.value)&&(o=r,s=Xt.StrictReservedWord)),a=Ct(o),c=a.params,h=a.defaults,i=a.stricted,o=a.firstRestricted,a.message&&(s=a.message),l=en,n=xt(),en&&o&&G(o,s),en&&i&&Z(i,s),en=l,e.finishFunctionDeclaration(u,c,h,n)}function kt(){var e,t,n,r,i,a,o,s=null,l=[],u=[],c=new V;return ne("function"),re("(")||(e=mn,s=Qe(),en?f(e.value)&&Z(e,Xt.StrictFunctionName):f(e.value)?(n=e,r=Xt.StrictFunctionName):p(e.value)&&(n=e,r=Xt.StrictReservedWord)),i=Ct(n),l=i.params,u=i.defaults,t=i.stricted,n=i.firstRestricted,i.message&&(r=i.message),o=en,a=xt(),en&&n&&G(n,r),en&&t&&Z(t,r),en=o,c.finishFunctionExpression(s,l,u,a)}function Ot(){var e,t,n,r,i,a,o,s=!1;for(e=new V,ee("{"),r=[];!re("}");)re(";")?U():(i=new V,t=mn,n=!1,a=re("["),o=ve(),"static"===o.name&&be()&&(t=mn,n=!0,a=re("["),o=ve()),i=we(t,o,a,i),i?(i["static"]=n,"init"===i.kind&&(i.kind="method"),n?i.computed||"prototype"!==(i.key.name||i.key.value.toString())||G(t,Xt.StaticPrototype):i.computed||"constructor"!==(i.key.name||i.key.value.toString())||(("method"!==i.kind||!i.method||i.value.generator)&&G(t,Xt.ConstructorSpecialMethod),s?G(t,Xt.DuplicateConstructor):s=!0,i.kind="constructor"),i.type=Kt.MethodDefinition,delete i.method,delete i.shorthand,r.push(i)):G(mn));return U(),e.finishClassBody(r)}function jt(e){var t,n=null,r=null,i=new V,a=en;return en=!0,ne("class"),e&&mn.type!==Wt.Identifier||(n=Qe()),ie("extends")&&(U(),r=le(Pe)),t=Ot(),en=a,i.finishClassDeclaration(n,r,t)}function Tt(){var e,t=null,n=null,r=new V,i=en;return en=!0,ne("class"),mn.type===Wt.Identifier&&(t=Qe()),ie("extends")&&(U(),n=le(Pe)),e=Ot(),en=i,r.finishClassExpression(t,n,e)}function It(){var e=new V;return mn.type!==Wt.StringLiteral&&K(Xt.InvalidModuleSpecifier),e.finishLiteral(U())}function _t(){var e,t,n,r=new V;return ie("default")?(n=new V,U(),t=n.finishIdentifier("default")):t=Qe(),ae("as")&&(U(),e=Ie()),r.finishExportSpecifier(t,e)}function Dt(e){var t,n=null,r=null,i=[];if(mn.type===Wt.Keyword)switch(mn.value){case"let":case"const":case"var":case"class":case"function":return n=Je(),e.finishExportNamedDeclaration(n,i,null)}if(ee("{"),!re("}"))do t=t||ie("default"),i.push(_t());while(re(",")&&U());return ee("}"),ae("from")?(U(),r=It(),se()):t?K(mn.value?Xt.UnexpectedToken:Xt.MissingFromClause,mn.value):se(),e.finishExportNamedDeclaration(n,i,r)}function Lt(e){var t=null,n=null;return ne("default"),ie("function")?(t=Et(new V,!0),e.finishExportDefaultDeclaration(t)):ie("class")?(t=jt(!0),e.finishExportDefaultDeclaration(t)):(ae("from")&&K(Xt.UnexpectedToken,mn.value),n=re("{")?Ae():re("[")?me():Ve(),se(),e.finishExportDefaultDeclaration(n))}function Pt(e){var t;return ee("*"),ae("from")||K(mn.value?Xt.UnexpectedToken:Xt.MissingFromClause,mn.value),U(),t=It(),se(),e.finishExportAllDeclaration(t)}function Nt(){var e=new V;return gn.inFunctionBody&&K(Xt.IllegalExportDeclaration),ne("export"),ie("default")?Lt(e):re("*")?Pt(e):Dt(e)}function $t(){var e,t,n=new V;return t=Ie(),ae("as")&&(U(),e=Qe()),n.finishImportSpecifier(e,t)}function Mt(){var e=[];if(ee("{"),!re("}"))do e.push($t());while(re(",")&&U());return ee("}"),e}function Rt(){var e,t=new V;return e=Ie(),t.finishImportDefaultSpecifier(e)}function Ft(){var e,t=new V;return ee("*"),ae("as")||K(Xt.NoAsAfterImportNamespace),U(),e=Ie(),t.finishImportNamespaceSpecifier(e)}function Ut(){var e,t,n=new V;return gn.inFunctionBody&&K(Xt.IllegalImportDeclaration),ne("import"),e=[],mn.type===Wt.StringLiteral?(t=It(),se(),n.finishImportDeclaration(e,t)):(!ie("default")&&$(mn)&&(e.push(Rt()),re(",")&&U()),re("*")?e.push(Ft()):re("{")&&(e=e.concat(Mt())),ae("from")||K(mn.value?Xt.UnexpectedToken:Xt.MissingFromClause,mn.value),U(),t=It(),se(),n.finishImportDeclaration(e,t))}function Bt(){for(var e,t,n,r,i=[];dn>cn&&(t=mn,t.type===Wt.StringLiteral)&&(e=Je(),i.push(e),e.expression.type===Kt.Literal);)n=Zt.slice(t.start+1,t.end-1),"use strict"===n?(en=!0,r&&Z(r,Xt.StrictOctalLiteral)):!r&&t.octal&&(r=t);for(;dn>cn&&(e=Je(),"undefined"!=typeof e);)i.push(e);return i}function qt(){var e,t;return B(),t=new V,e=Bt(),t.finishProgram(e)}function Ht(){var e,t,n,r=[];for(e=0;e<yn.tokens.length;++e)t=yn.tokens[e],n={type:t.type,value:t.value},t.regex&&(n.regex={pattern:t.regex.pattern,flags:t.regex.flags}),yn.range&&(n.range=t.range),yn.loc&&(n.loc=t.loc),r.push(n);yn.tokens=r}function zt(e,t){var n,r;n=String,"string"==typeof e||e instanceof String||(e=n(e)),Zt=e,nn=0,rn=Zt.length>0?1:0,an=0,cn=nn,pn=rn,fn=an,dn=Zt.length,mn=null,gn={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1,curlyStack:[]},yn={},t=t||{},t.tokens=!0,yn.tokens=[],yn.tokenize=!0,yn.openParenToken=-1,yn.openCurlyToken=-1,yn.range="boolean"==typeof t.range&&t.range,yn.loc="boolean"==typeof t.loc&&t.loc,"boolean"==typeof t.comment&&t.comment&&(yn.comments=[]),"boolean"==typeof t.tolerant&&t.tolerant&&(yn.errors=[]);try{if(B(),mn.type===Wt.EOF)return yn.tokens;for(U();mn.type!==Wt.EOF;)try{U()}catch(i){if(yn.errors){J(i);break}throw i}Ht(),r=yn.tokens,"undefined"!=typeof yn.comments&&(r.comments=yn.comments),"undefined"!=typeof yn.errors&&(r.errors=yn.errors)}catch(a){throw a}finally{yn={}}return r}function Vt(e,t){var n,r;r=String,"string"==typeof e||e instanceof String||(e=r(e)),Zt=e,nn=0,rn=Zt.length>0?1:0,an=0,cn=nn,pn=rn,fn=an,dn=Zt.length,mn=null,gn={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1,curlyStack:[]},tn="script",en=!1,yn={},"undefined"!=typeof t&&(yn.range="boolean"==typeof t.range&&t.range,yn.loc="boolean"==typeof t.loc&&t.loc,yn.attachComment="boolean"==typeof t.attachComment&&t.attachComment,yn.loc&&null!==t.source&&void 0!==t.source&&(yn.source=r(t.source)),"boolean"==typeof t.tokens&&t.tokens&&(yn.tokens=[]),"boolean"==typeof t.comment&&t.comment&&(yn.comments=[]),"boolean"==typeof t.tolerant&&t.tolerant&&(yn.errors=[]),yn.attachComment&&(yn.range=!0,yn.comments=[],yn.bottomRightStack=[],yn.trailingComments=[],yn.leadingComments=[]),"module"===t.sourceType&&(tn=t.sourceType,en=!0));try{n=qt(),"undefined"!=typeof yn.comments&&(n.comments=yn.comments),"undefined"!=typeof yn.tokens&&(Ht(),n.tokens=yn.tokens),"undefined"!=typeof yn.errors&&(n.errors=yn.errors)}catch(i){throw i}finally{yn={}}return n}var Wt,Jt,Yt,Kt,Qt,Xt,Gt,Zt,en,tn,nn,rn,an,on,sn,ln,un,cn,pn,fn,hn,dn,mn,gn,yn,vn,bn,wn;Wt={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8,RegularExpression:9,Template:10},Jt={},Jt[Wt.BooleanLiteral]="Boolean",Jt[Wt.EOF]="<end>",Jt[Wt.Identifier]="Identifier",Jt[Wt.Keyword]="Keyword",Jt[Wt.NullLiteral]="Null",Jt[Wt.NumericLiteral]="Numeric",Jt[Wt.Punctuator]="Punctuator",Jt[Wt.StringLiteral]="String",Jt[Wt.RegularExpression]="RegularExpression",Jt[Wt.Template]="Template",Yt=["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="],Kt={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MethodDefinition:"MethodDefinition",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchCase:"SwitchCase",SwitchStatement:"SwitchStatement",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement"},Qt={ArrowParameterPlaceHolder:"ArrowParameterPlaceHolder"},Xt={UnexpectedToken:"Unexpected token %0",UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved:"Unexpected reserved word",UnexpectedTemplate:"Unexpected quasi %0",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalReturn:"Illegal return statement",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode",TemplateOctalLiteral:"Octal literals are not allowed in template strings.",ParameterAfterRestParameter:"Rest parameter must be last formal parameter",DefaultRestParameter:"Unexpected token =",ObjectPatternAsRestParameter:"Unexpected token {",DuplicateProtoProperty:"Duplicate __proto__ fields are not allowed in object literals",ConstructorSpecialMethod:"Class constructor may not be an accessor",DuplicateConstructor:"A class may only have one constructor",StaticPrototype:"Classes may not have static property named prototype",MissingFromClause:"Unexpected token",NoAsAfterImportNamespace:"Unexpected token",InvalidModuleSpecifier:"Unexpected token",IllegalImportDeclaration:"Unexpected token",IllegalExportDeclaration:"Unexpected token"},Gt={NonAsciiIdentifierStart:new RegExp("[ªµºÀ-ÖØ-öø-Ë?ˆ-Ë‘Ë -ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-Ò?ÒŠ-Ô¯Ô±-Õ–Õ™Õ¡-Ö‡×?-תװ-ײؠ-يٮٯٱ-Û“Û•Û¥Û¦Û®Û¯Ûº-Û¼Û¿Ü?Ü’-ܯÝ?-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢲऄ-हऽà¥?क़-ॡॱ-ঀঅ-ঌà¦?à¦?ও-নপ-রলশ-হঽৎড়à§?য়-ৡৰৱਅ-ਊà¨?à¨?ਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-àª?àª?-ઑઓ-નપ-રલળવ-હઽà«?ૠૡଅ-ଌà¬?à¬?ଓ-ନପ-ରଲଳଵ-ହଽଡ଼à­?à­Ÿ-ୡୱஃஅ-ஊஎ-à®?à®’-கஙசஜஞடணதந-பம-ஹà¯?à°…-ఌఎ-à°?à°’-నప-హఽౘౙౠౡಅ-ಌಎ-à²?ಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-à´?à´’-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-à·†à¸?-ะาำเ-ๆàº?ຂຄງຈຊàº?ດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿá??-á?•á?š-á??á?¡á?¥á?¦á?®-á?°á?µ-á‚?á‚Žá‚ -ჅჇáƒ?áƒ?-ჺჼ-ቈቊ-á‰?á‰?-ቖቘቚ-á‰?በ-ኈኊ-áŠ?áŠ?-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-áŒ?ጒ-ጕጘ-á?šáŽ€-áŽ?Ꭰ-á?´á??-ᙬᙯ-ᙿáš?-áššáš -ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱá?€-á?‘á? -á?¬á?®-á?°áž€-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞá¥?-ᥭᥰ-ᥴᦀ-ᦫá§?-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-á°£á±?-á±?ᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-á¼?á¼ -ὅὈ-á½?á½?-ὗὙὛá½?Ὗ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-á¿Œá¿?-á¿“á¿–-Ίῠ-Ῥῲ-ῴῶ-ῼâ?±â?¿â‚?-ₜℂℇℊ-â„“â„•â„™-â„?ℤΩℨK-ℭℯ-ℹℼ-â„¿â……-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-â·Žâ·?-â·–â·˜-ⷞⸯ々-〇〡-〩〱-〵〸-〼ã??-ã‚–ã‚?-ã‚Ÿã‚¡-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿã?€-䶵一-鿌ꀀ-ê’Œê“?-ꓽꔀ-ꘌê˜?-ꘟꘪꘫꙀ-ꙮꙿ-êš?êš -ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎêž?-ꞭꞰꞱꟷ-ê ?ê ƒ-ê …ê ‡-ê Šê Œ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲê§?ꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ê©‚ê©„-ê©‹ê© -ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ê«?ê« -ꫪꫲ-ê«´ê¬?-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ê­šê­œ-ꭟꭤꭥꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-ï©­ï©°-龎ff-stﬓ-ﬗï¬?ײַ-ﬨשׁ-זּטּ-לּמּנּï­?ףּפּצּ-ﮱﯓ-ï´½ïµ?-ï¶?ﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Zï½?-zヲ-하-ᅦᅧ-ï¿?ï¿’-ï¿—ï¿š-ï¿œ]"),NonAsciiIdentifierPart:new RegExp("[ªµºÀ-ÖØ-öø-Ë?ˆ-Ë‘Ë -ˤˬˮ̀-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-Ò?Òƒ-Ò‡ÒŠ-Ô¯Ô±-Õ–Õ™Õ¡-Ö‡Ö‘-Ö½Ö¿×?ׇׂׅׄ×?-תװ-ײØ?-ؚؠ-٩ٮ-Û“Û•-ۜ۟-Û¨Ûª-Û¼Û¿Ü?-ÝŠÝ?-ޱ߀-ߵߺࠀ-à ­à¡€-࡛ࢠ-ࢲࣤ-ॣ०-९ॱ-ঃঅ-ঌà¦?à¦?ও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়à§?য়-ৣ০-ৱà¨?-ਃਅ-ਊà¨?à¨?ਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-à©?à©‘à©™-ੜਫ਼੦-ੵàª?-ઃઅ-àª?àª?-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-à«?à«?à« -ૣ૦-૯à¬?-ଃଅ-ଌà¬?à¬?ଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-à­?à­–à­—à­œà­?à­Ÿ-ୣ୦-୯ୱஂஃஅ-ஊஎ-à®?à®’-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-à¯?à¯?ௗ௦-௯ఀ-ఃఅ-ఌఎ-à°?à°’-నప-హఽ-ౄె-ైొ-à±?ౕౖౘౙౠ-ౣ౦-౯à²?-ಃಅ-ಌಎ-à²?ಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-à³?ೕೖೞೠ-ೣ೦-೯ೱೲà´?-ഃഅ-ഌഎ-à´?à´’-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්à·?-ුූෘ-à·Ÿà·¦-෯ෲෳà¸?-ฺเ-๎à¹?-๙àº?ຂຄງຈຊàº?ດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-à»?à»?-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-á?‰á??-á‚?á‚ -ჅჇáƒ?áƒ?-ჺჼ-ቈቊ-á‰?á‰?-ቖቘቚ-á‰?በ-ኈኊ-áŠ?áŠ?-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-áŒ?ጒ-ጕጘ-á?šá??-á?ŸáŽ€-áŽ?Ꭰ-á?´á??-ᙬᙯ-ᙿáš?-áššáš -ᛪᛮ-ᛸᜀ-ᜌᜎ-᜔ᜠ-᜴á?€-á?“á? -á?¬á?®-á?°á?²á?³áž€-៓ៗៜáŸ?០-៩᠋-á ?á ?-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤞᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉá§?-᧙ᨀ-ᨛᨠ-á©žá© -᩿᩼-᪉áª?-᪙ᪧ᪰-᪽ᬀ-á­‹á­?-᭙᭫-᭳ᮀ-᯳ᰀ-á°·á±€-᱉á±?-á±½á³?-á³’á³”-ᳶ᳸᳹ᴀ-᷵᷼-ἕἘ-á¼?á¼ -ὅὈ-á½?á½?-ὗὙὛá½?Ὗ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-á¿Œá¿?-á¿“á¿–-Ίῠ-Ῥῲ-ῴῶ-ῼ‌â€?‿â?€â?”â?±â?¿â‚?-â‚œâƒ?-⃥⃜⃡-⃰ℂℇℊ-â„“â„•â„™-â„?ℤΩℨK-ℭℯ-ℹℼ-â„¿â……-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-â·Žâ·?-â·–â·˜-â·žâ· -ⷿⸯ々-〇〡-〯〱-〵〸-〼ã??-ゖ゙゚ã‚?-ã‚Ÿã‚¡-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿã?€-䶵一-鿌ꀀ-ê’Œê“?-ꓽꔀ-ꘌê˜?-ꘫꙀ-꙯ꙴ-꙽ꙿ-êš?ꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎêž?-ꞭꞰꞱꟷ-ꠧꡀ-ꡳꢀ-꣄ê£?-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ê§?-꧙ꧠ-ꧾꨀ-ꨶꩀ-ê©?ê©?-꩙ꩠ-ꩶꩺ-ê«‚ê«›-ê«?ê« -ꫯꫲ-꫶ê¬?-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ê­šê­œ-ꭟꭤꭥꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-ï©­ï©°-龎ff-stﬓ-ﬗï¬?-ﬨשׁ-זּטּ-לּמּנּï­?ףּפּצּ-ﮱﯓ-ï´½ïµ?-ï¶?ﶒ-ﷇﷰ-ﷻ︀-ï¸?︠-︭︳︴ï¹?-ï¹?ï¹°-ﹴﹶ-ﻼï¼?-9A-Z_ï½?-zヲ-하-ᅦᅧ-ï¿?ï¿’-ï¿—ï¿š-ï¿œ]")
+},W.prototype=V.prototype={processComment:function(){var e,t,n,r,i,a=yn.bottomRightStack,o=a[a.length-1];if(!(this.type===Kt.Program&&this.body.length>0)){if(yn.trailingComments.length>0){for(n=[],r=yn.trailingComments.length-1;r>=0;--r)i=yn.trailingComments[r],i.range[0]>=this.range[1]&&(n.unshift(i),yn.trailingComments.splice(r,1));yn.trailingComments=[]}else o&&o.trailingComments&&o.trailingComments[0].range[0]>=this.range[1]&&(n=o.trailingComments,delete o.trailingComments);if(o)for(;o&&o.range[0]>=this.range[0];)e=o,o=a.pop();if(e)e.leadingComments&&e.leadingComments[e.leadingComments.length-1].range[1]<=this.range[0]&&(this.leadingComments=e.leadingComments,e.leadingComments=void 0);else if(yn.leadingComments.length>0)for(t=[],r=yn.leadingComments.length-1;r>=0;--r)i=yn.leadingComments[r],i.range[1]<=this.range[0]&&(t.unshift(i),yn.leadingComments.splice(r,1));t&&t.length>0&&(this.leadingComments=t),n&&n.length>0&&(this.trailingComments=n),a.push(this)}},finish:function(){yn.range&&(this.range[1]=sn),yn.loc&&(this.loc.end={line:ln,column:sn-un},yn.source&&(this.loc.source=yn.source)),yn.attachComment&&this.processComment()},finishArrayExpression:function(e){return this.type=Kt.ArrayExpression,this.elements=e,this.finish(),this},finishArrayPattern:function(e){return this.type=Kt.ArrayPattern,this.elements=e,this.finish(),this},finishArrowFunctionExpression:function(e,t,n,r){return this.type=Kt.ArrowFunctionExpression,this.id=null,this.params=e,this.defaults=t,this.body=n,this.generator=!1,this.expression=r,this.finish(),this},finishAssignmentExpression:function(e,t,n){return this.type=Kt.AssignmentExpression,this.operator=e,this.left=t,this.right=n,this.finish(),this},finishAssignmentPattern:function(e,t){return this.type=Kt.AssignmentPattern,this.left=e,this.right=t,this.finish(),this},finishBinaryExpression:function(e,t,n){return this.type="||"===e||"&&"===e?Kt.LogicalExpression:Kt.BinaryExpression,this.operator=e,this.left=t,this.right=n,this.finish(),this},finishBlockStatement:function(e){return this.type=Kt.BlockStatement,this.body=e,this.finish(),this},finishBreakStatement:function(e){return this.type=Kt.BreakStatement,this.label=e,this.finish(),this},finishCallExpression:function(e,t){return this.type=Kt.CallExpression,this.callee=e,this.arguments=t,this.finish(),this},finishCatchClause:function(e,t){return this.type=Kt.CatchClause,this.param=e,this.body=t,this.finish(),this},finishClassBody:function(e){return this.type=Kt.ClassBody,this.body=e,this.finish(),this},finishClassDeclaration:function(e,t,n){return this.type=Kt.ClassDeclaration,this.id=e,this.superClass=t,this.body=n,this.finish(),this},finishClassExpression:function(e,t,n){return this.type=Kt.ClassExpression,this.id=e,this.superClass=t,this.body=n,this.finish(),this},finishConditionalExpression:function(e,t,n){return this.type=Kt.ConditionalExpression,this.test=e,this.consequent=t,this.alternate=n,this.finish(),this},finishContinueStatement:function(e){return this.type=Kt.ContinueStatement,this.label=e,this.finish(),this},finishDebuggerStatement:function(){return this.type=Kt.DebuggerStatement,this.finish(),this},finishDoWhileStatement:function(e,t){return this.type=Kt.DoWhileStatement,this.body=e,this.test=t,this.finish(),this},finishEmptyStatement:function(){return this.type=Kt.EmptyStatement,this.finish(),this},finishExpressionStatement:function(e){return this.type=Kt.ExpressionStatement,this.expression=e,this.finish(),this},finishForStatement:function(e,t,n,r){return this.type=Kt.ForStatement,this.init=e,this.test=t,this.update=n,this.body=r,this.finish(),this},finishForInStatement:function(e,t,n){return this.type=Kt.ForInStatement,this.left=e,this.right=t,this.body=n,this.each=!1,this.finish(),this},finishFunctionDeclaration:function(e,t,n,r){return this.type=Kt.FunctionDeclaration,this.id=e,this.params=t,this.defaults=n,this.body=r,this.generator=!1,this.expression=!1,this.finish(),this},finishFunctionExpression:function(e,t,n,r){return this.type=Kt.FunctionExpression,this.id=e,this.params=t,this.defaults=n,this.body=r,this.generator=!1,this.expression=!1,this.finish(),this},finishIdentifier:function(e){return this.type=Kt.Identifier,this.name=e,this.finish(),this},finishIfStatement:function(e,t,n){return this.type=Kt.IfStatement,this.test=e,this.consequent=t,this.alternate=n,this.finish(),this},finishLabeledStatement:function(e,t){return this.type=Kt.LabeledStatement,this.label=e,this.body=t,this.finish(),this},finishLiteral:function(e){return this.type=Kt.Literal,this.value=e.value,this.raw=Zt.slice(e.start,e.end),e.regex&&(this.regex=e.regex),this.finish(),this},finishMemberExpression:function(e,t,n){return this.type=Kt.MemberExpression,this.computed="["===e,this.object=t,this.property=n,this.finish(),this},finishNewExpression:function(e,t){return this.type=Kt.NewExpression,this.callee=e,this.arguments=t,this.finish(),this},finishObjectExpression:function(e){return this.type=Kt.ObjectExpression,this.properties=e,this.finish(),this},finishObjectPattern:function(e){return this.type=Kt.ObjectPattern,this.properties=e,this.finish(),this},finishPostfixExpression:function(e,t){return this.type=Kt.UpdateExpression,this.operator=e,this.argument=t,this.prefix=!1,this.finish(),this},finishProgram:function(e){return this.type=Kt.Program,this.body=e,"module"===tn&&(this.sourceType=tn),this.finish(),this},finishProperty:function(e,t,n,r,i,a){return this.type=Kt.Property,this.key=t,this.computed=n,this.value=r,this.kind=e,this.method=i,this.shorthand=a,this.finish(),this},finishRestElement:function(e){return this.type=Kt.RestElement,this.argument=e,this.finish(),this},finishReturnStatement:function(e){return this.type=Kt.ReturnStatement,this.argument=e,this.finish(),this},finishSequenceExpression:function(e){return this.type=Kt.SequenceExpression,this.expressions=e,this.finish(),this},finishSpreadElement:function(e){return this.type=Kt.SpreadElement,this.argument=e,this.finish(),this},finishSwitchCase:function(e,t){return this.type=Kt.SwitchCase,this.test=e,this.consequent=t,this.finish(),this},finishSuper:function(){return this.type=Kt.Super,this.finish(),this},finishSwitchStatement:function(e,t){return this.type=Kt.SwitchStatement,this.discriminant=e,this.cases=t,this.finish(),this},finishTaggedTemplateExpression:function(e,t){return this.type=Kt.TaggedTemplateExpression,this.tag=e,this.quasi=t,this.finish(),this},finishTemplateElement:function(e,t){return this.type=Kt.TemplateElement,this.value=e,this.tail=t,this.finish(),this},finishTemplateLiteral:function(e,t){return this.type=Kt.TemplateLiteral,this.quasis=e,this.expressions=t,this.finish(),this},finishThisExpression:function(){return this.type=Kt.ThisExpression,this.finish(),this},finishThrowStatement:function(e){return this.type=Kt.ThrowStatement,this.argument=e,this.finish(),this},finishTryStatement:function(e,t,n){return this.type=Kt.TryStatement,this.block=e,this.guardedHandlers=[],this.handlers=t?[t]:[],this.handler=t,this.finalizer=n,this.finish(),this},finishUnaryExpression:function(e,t){return this.type="++"===e||"--"===e?Kt.UpdateExpression:Kt.UnaryExpression,this.operator=e,this.argument=t,this.prefix=!0,this.finish(),this},finishVariableDeclaration:function(e){return this.type=Kt.VariableDeclaration,this.declarations=e,this.kind="var",this.finish(),this},finishLexicalDeclaration:function(e,t){return this.type=Kt.VariableDeclaration,this.declarations=e,this.kind=t,this.finish(),this},finishVariableDeclarator:function(e,t){return this.type=Kt.VariableDeclarator,this.id=e,this.init=t,this.finish(),this},finishWhileStatement:function(e,t){return this.type=Kt.WhileStatement,this.test=e,this.body=t,this.finish(),this},finishWithStatement:function(e,t){return this.type=Kt.WithStatement,this.object=e,this.body=t,this.finish(),this},finishExportSpecifier:function(e,t){return this.type=Kt.ExportSpecifier,this.exported=t||e,this.local=e,this.finish(),this},finishImportDefaultSpecifier:function(e){return this.type=Kt.ImportDefaultSpecifier,this.local=e,this.finish(),this},finishImportNamespaceSpecifier:function(e){return this.type=Kt.ImportNamespaceSpecifier,this.local=e,this.finish(),this},finishExportNamedDeclaration:function(e,t,n){return this.type=Kt.ExportNamedDeclaration,this.declaration=e,this.specifiers=t,this.source=n,this.finish(),this},finishExportDefaultDeclaration:function(e){return this.type=Kt.ExportDefaultDeclaration,this.declaration=e,this.finish(),this},finishExportAllDeclaration:function(e){return this.type=Kt.ExportAllDeclaration,this.source=e,this.finish(),this},finishImportSpecifier:function(e,t){return this.type=Kt.ImportSpecifier,this.local=e||t,this.imported=t,this.finish(),this},finishImportDeclaration:function(e,t){return this.type=Kt.ImportDeclaration,this.specifiers=e,this.source=t,this.finish(),this}},e.version="2.2.0",e.tokenize=zt,e.parse=Vt,e.Syntax=function(){var e,t={};"function"==typeof Object.create&&(t=Object.create(null));for(e in Kt)Kt.hasOwnProperty(e)&&(t[e]=Kt[e]);return"function"==typeof Object.freeze&&Object.freeze(t),t}()})},{}],52:[function(e,t,n){function r(e,t,n){var r=e?e.length:0;if(!r)return-1;if("number"==typeof n)n=0>n?o(r+n,0):n;else if(n){var s=a(e,t);return r>s&&(t===t?t===e[s]:e[s]!==e[s])?s:-1}return i(e,t,n||0)}var i=e("../internal/baseIndexOf"),a=e("../internal/binaryIndex"),o=Math.max;t.exports=r},{"../internal/baseIndexOf":81,"../internal/binaryIndex":95}],53:[function(e,t,n){function r(e){var t=e?e.length:0;return t?e[t-1]:void 0}t.exports=r},{}],54:[function(e,t,n){function r(e){if(l(e)&&!s(e)&&!(e instanceof i)){if(e instanceof a)return e;if(p.call(e,"__chain__")&&p.call(e,"__wrapped__"))return u(e)}return new a(e)}var i=e("../internal/LazyWrapper"),a=e("../internal/LodashWrapper"),o=e("../internal/baseLodash"),s=e("../lang/isArray"),l=e("../internal/isObjectLike"),u=e("../internal/wrapperClone"),c=Object.prototype,p=c.hasOwnProperty;r.prototype=o.prototype,t.exports=r},{"../internal/LazyWrapper":63,"../internal/LodashWrapper":64,"../internal/baseLodash":85,"../internal/isObjectLike":129,"../internal/wrapperClone":140,"../lang/isArray":143}],55:[function(e,t,n){t.exports=e("./forEach")},{"./forEach":57}],56:[function(e,t,n){var r=e("../internal/baseEach"),i=e("../internal/createFind"),a=i(r);t.exports=a},{"../internal/baseEach":74,"../internal/createFind":105}],57:[function(e,t,n){var r=e("../internal/arrayEach"),i=e("../internal/baseEach"),a=e("../internal/createForEach"),o=a(r,i);t.exports=o},{"../internal/arrayEach":66,"../internal/baseEach":74,"../internal/createForEach":106}],58:[function(e,t,n){function r(e,t,n,r){var f=e?a(e):0;return l(f)||(e=c(e),f=e.length),n="number"!=typeof n||r&&s(t,n,r)?0:0>n?p(f+n,0):n||0,"string"==typeof e||!o(e)&&u(e)?f>=n&&e.indexOf(t,n)>-1:!!f&&i(e,t,n)>-1}var i=e("../internal/baseIndexOf"),a=e("../internal/getLength"),o=e("../lang/isArray"),s=e("../internal/isIterateeCall"),l=e("../internal/isLength"),u=e("../lang/isString"),c=e("../object/values"),p=Math.max;t.exports=r},{"../internal/baseIndexOf":81,"../internal/getLength":115,"../internal/isIterateeCall":125,"../internal/isLength":128,"../lang/isArray":143,"../lang/isString":149,"../object/values":155}],59:[function(e,t,n){function r(e,t,n){var r=s(e)?i:o;return t=a(t,n,3),r(e,t)}var i=e("../internal/arrayMap"),a=e("../internal/baseCallback"),o=e("../internal/baseMap"),s=e("../lang/isArray");t.exports=r},{"../internal/arrayMap":67,"../internal/baseCallback":70,"../internal/baseMap":86,"../lang/isArray":143}],60:[function(e,t,n){var r=e("../internal/getNative"),i=r(Date,"now"),a=i||function(){return(new Date).getTime()};t.exports=a},{"../internal/getNative":117}],61:[function(e,t,n){var r=e("../internal/createWrapper"),i=e("../internal/replaceHolders"),a=e("./restParam"),o=1,s=32,l=a(function(e,t,n){var a=o;if(n.length){var u=i(n,l.placeholder);a|=s}return r(e,a,t,n,u)});l.placeholder={},t.exports=l},{"../internal/createWrapper":109,"../internal/replaceHolders":135,"./restParam":62}],62:[function(e,t,n){function r(e,t){if("function"!=typeof e)throw new TypeError(i);return t=a(void 0===t?e.length-1:+t||0,0),function(){for(var n=arguments,r=-1,i=a(n.length-t,0),o=Array(i);++r<i;)o[r]=n[t+r];switch(t){case 0:return e.call(this,o);case 1:return e.call(this,n[0],o);case 2:return e.call(this,n[0],n[1],o)}var s=Array(t+1);for(r=-1;++r<t;)s[r]=n[r];return s[t]=o,e.apply(this,s)}}var i="Expected a function",a=Math.max;t.exports=r},{}],63:[function(e,t,n){function r(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=o,this.__views__=[]}var i=e("./baseCreate"),a=e("./baseLodash"),o=Number.POSITIVE_INFINITY;r.prototype=i(a.prototype),r.prototype.constructor=r,t.exports=r},{"./baseCreate":73,"./baseLodash":85}],64:[function(e,t,n){function r(e,t,n){this.__wrapped__=e,this.__actions__=n||[],this.__chain__=!!t}var i=e("./baseCreate"),a=e("./baseLodash");r.prototype=i(a.prototype),r.prototype.constructor=r,t.exports=r},{"./baseCreate":73,"./baseLodash":85}],65:[function(e,t,n){function r(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}t.exports=r},{}],66:[function(e,t,n){function r(e,t){for(var n=-1,r=e.length;++n<r&&t(e[n],n,e)!==!1;);return e}t.exports=r},{}],67:[function(e,t,n){function r(e,t){for(var n=-1,r=e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}t.exports=r},{}],68:[function(e,t,n){function r(e,t){for(var n=-1,r=e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}t.exports=r},{}],69:[function(e,t,n){function r(e,t){return null==t?e:i(t,a(t),e)}var i=e("./baseCopy"),a=e("../object/keys");t.exports=r},{"../object/keys":152,"./baseCopy":72}],70:[function(e,t,n){function r(e,t,n){var r=typeof e;return"function"==r?void 0===t?e:o(e,t,n):null==e?s:"object"==r?i(e):void 0===t?l(e):a(e,t)}var i=e("./baseMatches"),a=e("./baseMatchesProperty"),o=e("./bindCallback"),s=e("../utility/identity"),l=e("../utility/property");t.exports=r},{"../utility/identity":157,"../utility/property":159,"./baseMatches":87,"./baseMatchesProperty":88,"./bindCallback":97}],71:[function(e,t,n){function r(e,t,n,m,g,y,v){var w;if(n&&(w=g?n(e,m,g):n(e)),void 0!==w)return w;if(!h(e))return e;var x=p(e);if(x){if(w=l(e),!t)return i(e,w)}else{var A=F.call(e),C=A==b;if(A!=S&&A!=d&&(!C||g))return M[A]?u(e,A,t):g?e:{};if(f(e))return g?e:{};if(w=c(C?{}:e),!t)return o(w,e)}y||(y=[]),v||(v=[]);for(var E=y.length;E--;)if(y[E]==e)return v[E];return y.push(e),v.push(w),(x?a:s)(e,function(i,a){w[a]=r(i,t,n,a,e,y,v)}),w}var i=e("./arrayCopy"),a=e("./arrayEach"),o=e("./baseAssign"),s=e("./baseForOwn"),l=e("./initCloneArray"),u=e("./initCloneByTag"),c=e("./initCloneObject"),p=e("../lang/isArray"),f=e("./isHostObject"),h=e("../lang/isObject"),d="[object Arguments]",m="[object Array]",g="[object Boolean]",y="[object Date]",v="[object Error]",b="[object Function]",w="[object Map]",x="[object Number]",S="[object Object]",A="[object RegExp]",C="[object Set]",E="[object String]",k="[object WeakMap]",O="[object ArrayBuffer]",j="[object Float32Array]",T="[object Float64Array]",I="[object Int8Array]",_="[object Int16Array]",D="[object Int32Array]",L="[object Uint8Array]",P="[object Uint8ClampedArray]",N="[object Uint16Array]",$="[object Uint32Array]",M={};M[d]=M[m]=M[O]=M[g]=M[y]=M[j]=M[T]=M[I]=M[_]=M[D]=M[x]=M[S]=M[A]=M[E]=M[L]=M[P]=M[N]=M[$]=!0,M[v]=M[b]=M[w]=M[C]=M[k]=!1;var R=Object.prototype,F=R.toString;t.exports=r},{"../lang/isArray":143,"../lang/isObject":147,"./arrayCopy":65,"./arrayEach":66,"./baseAssign":69,"./baseForOwn":79,"./initCloneArray":119,"./initCloneByTag":120,"./initCloneObject":121,"./isHostObject":123}],72:[function(e,t,n){function r(e,t,n){n||(n={});for(var r=-1,i=t.length;++r<i;){var a=t[r];n[a]=e[a]}return n}t.exports=r},{}],73:[function(e,t,n){var r=e("../lang/isObject"),i=function(){function e(){}return function(t){if(r(t)){e.prototype=t;var n=new e;e.prototype=void 0}return n||{}}}();t.exports=i},{"../lang/isObject":147}],74:[function(e,t,n){var r=e("./baseForOwn"),i=e("./createBaseEach"),a=i(r);t.exports=a},{"./baseForOwn":79,"./createBaseEach":101}],75:[function(e,t,n){function r(e,t,n,r){var i;return n(e,function(e,n,a){return t(e,n,a)?(i=r?n:e,!1):void 0}),i}t.exports=r},{}],76:[function(e,t,n){function r(e,t,n){for(var r=e.length,i=n?r:-1;n?i--:++i<r;)if(t(e[i],i,e))return i;return-1}t.exports=r},{}],77:[function(e,t,n){var r=e("./createBaseFor"),i=r();t.exports=i},{"./createBaseFor":102}],78:[function(e,t,n){function r(e,t){return i(e,t,a)}var i=e("./baseFor"),a=e("../object/keysIn");t.exports=r},{"../object/keysIn":153,"./baseFor":77}],79:[function(e,t,n){function r(e,t){return i(e,t,a)}var i=e("./baseFor"),a=e("../object/keys");t.exports=r},{"../object/keys":152,"./baseFor":77}],80:[function(e,t,n){function r(e,t,n){if(null!=e){e=i(e),void 0!==n&&n in e&&(t=[n]);for(var r=0,a=t.length;null!=e&&a>r;)e=i(e)[t[r++]];return r&&r==a?e:void 0}}var i=e("./toObject");t.exports=r},{"./toObject":138}],81:[function(e,t,n){function r(e,t,n){if(t!==t)return i(e,n);for(var r=n-1,a=e.length;++r<a;)if(e[r]===t)return r;return-1}var i=e("./indexOfNaN");t.exports=r},{"./indexOfNaN":118}],82:[function(e,t,n){function r(e,t,n,s,l,u){return e===t?!0:null==e||null==t||!a(e)&&!o(t)?e!==e&&t!==t:i(e,t,r,n,s,l,u)}var i=e("./baseIsEqualDeep"),a=e("../lang/isObject"),o=e("./isObjectLike");t.exports=r},{"../lang/isObject":147,"./baseIsEqualDeep":83,"./isObjectLike":129}],83:[function(e,t,n){function r(e,t,n,r,h,g,y){var v=s(e),b=s(t),w=p,x=p;v||(w=m.call(e),w==c?w=f:w!=f&&(v=u(e))),b||(x=m.call(t),x==c?x=f:x!=f&&(b=u(t)));var S=w==f&&!l(e),A=x==f&&!l(t),C=w==x;if(C&&!v&&!S)return a(e,t,w);if(!h){var E=S&&d.call(e,"__wrapped__"),k=A&&d.call(t,"__wrapped__");if(E||k)return n(E?e.value():e,k?t.value():t,r,h,g,y)}if(!C)return!1;g||(g=[]),y||(y=[]);for(var O=g.length;O--;)if(g[O]==e)return y[O]==t;g.push(e),y.push(t);var j=(v?i:o)(e,t,n,r,h,g,y);return g.pop(),y.pop(),j}var i=e("./equalArrays"),a=e("./equalByTag"),o=e("./equalObjects"),s=e("../lang/isArray"),l=e("./isHostObject"),u=e("../lang/isTypedArray"),c="[object Arguments]",p="[object Array]",f="[object Object]",h=Object.prototype,d=h.hasOwnProperty,m=h.toString;t.exports=r},{"../lang/isArray":143,"../lang/isTypedArray":150,"./equalArrays":110,"./equalByTag":111,"./equalObjects":112,"./isHostObject":123}],84:[function(e,t,n){function r(e,t,n){var r=t.length,o=r,s=!n;if(null==e)return!o;for(e=a(e);r--;){var l=t[r];if(s&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++r<o;){l=t[r];var u=l[0],c=e[u],p=l[1];if(s&&l[2]){if(void 0===c&&!(u in e))return!1}else{var f=n?n(c,p,u):void 0;if(!(void 0===f?i(p,c,n,!0):f))return!1}}return!0}var i=e("./baseIsEqual"),a=e("./toObject");t.exports=r},{"./baseIsEqual":82,"./toObject":138}],85:[function(e,t,n){function r(){}t.exports=r},{}],86:[function(e,t,n){function r(e,t){var n=-1,r=a(e)?Array(e.length):[];return i(e,function(e,i,a){r[++n]=t(e,i,a)}),r}var i=e("./baseEach"),a=e("./isArrayLike");t.exports=r},{"./baseEach":74,"./isArrayLike":122}],87:[function(e,t,n){function r(e){var t=a(e);if(1==t.length&&t[0][2]){var n=t[0][0],r=t[0][1];return function(e){return null==e?!1:(e=o(e),e[n]===r&&(void 0!==r||n in e))}}return function(e){return i(e,t)}}var i=e("./baseIsMatch"),a=e("./getMatchData"),o=e("./toObject");t.exports=r},{"./baseIsMatch":84,"./getMatchData":116,"./toObject":138}],88:[function(e,t,n){function r(e,t){var n=s(e),r=l(e)&&u(t),h=e+"";return e=f(e),function(s){if(null==s)return!1;var l=h;if(s=p(s),(n||!r)&&!(l in s)){if(s=1==e.length?s:i(s,o(e,0,-1)),null==s)return!1;l=c(e),s=p(s)}return s[l]===t?void 0!==t||l in s:a(t,s[l],void 0,!0)}}var i=e("./baseGet"),a=e("./baseIsEqual"),o=e("./baseSlice"),s=e("../lang/isArray"),l=e("./isKey"),u=e("./isStrictComparable"),c=e("../array/last"),p=e("./toObject"),f=e("./toPath");t.exports=r},{"../array/last":53,"../lang/isArray":143,"./baseGet":80,"./baseIsEqual":82,"./baseSlice":92,"./isKey":126,"./isStrictComparable":130,"./toObject":138,"./toPath":139}],89:[function(e,t,n){function r(e){return function(t){return null==t?void 0:i(t)[e]}}var i=e("./toObject");t.exports=r},{"./toObject":138}],90:[function(e,t,n){function r(e){var t=e+"";return e=a(e),function(n){return i(n,e,t)}}var i=e("./baseGet"),a=e("./toPath");t.exports=r},{"./baseGet":80,"./toPath":139}],91:[function(e,t,n){var r=e("../utility/identity"),i=e("./metaMap"),a=i?function(e,t){return i.set(e,t),e}:r;t.exports=a},{"../utility/identity":157,"./metaMap":132}],92:[function(e,t,n){function r(e,t,n){var r=-1,i=e.length;t=null==t?0:+t||0,0>t&&(t=-t>i?0:i+t),n=void 0===n||n>i?i:+n||0,0>n&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}t.exports=r},{}],93:[function(e,t,n){function r(e){return null==e?"":e+""}t.exports=r},{}],94:[function(e,t,n){function r(e,t){for(var n=-1,r=t.length,i=Array(r);++n<r;)i[n]=e[t[n]];return i}t.exports=r},{}],95:[function(e,t,n){function r(e,t,n){var r=0,o=e?e.length:r;if("number"==typeof t&&t===t&&s>=o){for(;o>r;){var l=r+o>>>1,u=e[l];(n?t>=u:t>u)&&null!==u?r=l+1:o=l}return o}return i(e,t,a,n)}var i=e("./binaryIndexBy"),a=e("../utility/identity"),o=4294967295,s=o>>>1;t.exports=r},{"../utility/identity":157,"./binaryIndexBy":96}],96:[function(e,t,n){function r(e,t,n,r){t=n(t);for(var o=0,l=e?e.length:0,u=t!==t,c=null===t,p=void 0===t;l>o;){var f=i((o+l)/2),h=n(e[f]),d=void 0!==h,m=h===h;if(u)var g=m||r;else g=c?m&&d&&(r||null!=h):p?m&&(r||d):null==h?!1:r?t>=h:t>h;g?o=f+1:l=f}return a(l,s)}var i=Math.floor,a=Math.min,o=4294967295,s=o-1;t.exports=r},{}],97:[function(e,t,n){function r(e,t,n){if("function"!=typeof e)return i;if(void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 3:return function(n,r,i){return e.call(t,n,r,i)};case 4:return function(n,r,i,a){return e.call(t,n,r,i,a)};case 5:return function(n,r,i,a,o){return e.call(t,n,r,i,a,o)}}return function(){return e.apply(t,arguments)}}var i=e("../utility/identity");t.exports=r},{"../utility/identity":157}],98:[function(e,t,n){(function(e){function n(e){var t=new r(e.byteLength),n=new i(t);return n.set(new i(e)),t}var r=e.ArrayBuffer,i=e.Uint8Array;t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],99:[function(e,t,n){function r(e,t,n){for(var r=n.length,a=-1,o=i(e.length-r,0),s=-1,l=t.length,u=Array(l+o);++s<l;)u[s]=t[s];for(;++a<r;)u[n[a]]=e[a];for(;o--;)u[s++]=e[a++];return u}var i=Math.max;t.exports=r},{}],100:[function(e,t,n){function r(e,t,n){for(var r=-1,a=n.length,o=-1,s=i(e.length-a,0),l=-1,u=t.length,c=Array(s+u);++o<s;)c[o]=e[o];for(var p=o;++l<u;)c[p+l]=t[l];for(;++r<a;)c[p+n[r]]=e[o++];return c}var i=Math.max;t.exports=r},{}],101:[function(e,t,n){function r(e,t){return function(n,r){var s=n?i(n):0;if(!a(s))return e(n,r);for(var l=t?s:-1,u=o(n);(t?l--:++l<s)&&r(u[l],l,u)!==!1;);return n}}var i=e("./getLength"),a=e("./isLength"),o=e("./toObject");t.exports=r},{"./getLength":115,"./isLength":128,"./toObject":138}],102:[function(e,t,n){function r(e){return function(t,n,r){for(var a=i(t),o=r(t),s=o.length,l=e?s:-1;e?l--:++l<s;){var u=o[l];if(n(a[u],u,a)===!1)break}return t}}var i=e("./toObject");t.exports=r},{"./toObject":138}],103:[function(e,t,n){(function(n){function r(e,t){function r(){var i=this&&this!==n&&this instanceof r?a:e;return i.apply(t,arguments)}var a=i(e);return r}var i=e("./createCtorWrapper");t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./createCtorWrapper":104}],104:[function(e,t,n){function r(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=i(e.prototype),r=e.apply(n,t);return a(r)?r:n}}var i=e("./baseCreate"),a=e("../lang/isObject");t.exports=r},{"../lang/isObject":147,"./baseCreate":73}],105:[function(e,t,n){function r(e,t){return function(n,r,l){if(r=i(r,l,3),s(n)){var u=o(n,r,t);return u>-1?n[u]:void 0}return a(n,r,e)}}var i=e("./baseCallback"),a=e("./baseFind"),o=e("./baseFindIndex"),s=e("../lang/isArray");t.exports=r},{"../lang/isArray":143,"./baseCallback":70,"./baseFind":75,"./baseFindIndex":76}],106:[function(e,t,n){function r(e,t){return function(n,r,o){return"function"==typeof r&&void 0===o&&a(n)?e(n,r):t(n,i(r,o,3))}}var i=e("./bindCallback"),a=e("../lang/isArray");t.exports=r},{"../lang/isArray":143,"./bindCallback":97}],107:[function(e,t,n){(function(n){function r(e,t,x,S,A,C,E,k,O,j){function T(){for(var d=arguments.length,m=d,g=Array(d);m--;)g[m]=arguments[m];if(S&&(g=a(g,S,A)),C&&(g=o(g,C,E)),L||N){var b=T.placeholder,M=c(g,b);if(d-=M.length,j>d){var R=k?i(k):void 0,F=w(j-d,0),U=L?M:void 0,B=L?void 0:M,q=L?g:void 0,H=L?void 0:g;t|=L?y:v,t&=~(L?v:y),P||(t&=~(f|h));var z=[e,t,x,q,U,H,B,R,O,F],V=r.apply(void 0,z);return l(e)&&p(V,z),V.placeholder=b,V}}var W=_?x:this,J=D?W[e]:e;return k&&(g=u(g,k)),I&&O<g.length&&(g.length=O),this&&this!==n&&this instanceof T&&(J=$||s(e)),J.apply(W,g)}var I=t&b,_=t&f,D=t&h,L=t&m,P=t&d,N=t&g,$=D?void 0:s(e);return T}var i=e("./arrayCopy"),a=e("./composeArgs"),o=e("./composeArgsRight"),s=e("./createCtorWrapper"),l=e("./isLaziable"),u=e("./reorder"),c=e("./replaceHolders"),p=e("./setData"),f=1,h=2,d=4,m=8,g=16,y=32,v=64,b=128,w=Math.max;t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./arrayCopy":65,"./composeArgs":99,"./composeArgsRight":100,"./createCtorWrapper":104,"./isLaziable":127,"./reorder":134,"./replaceHolders":135,"./setData":136}],108:[function(e,t,n){(function(n){function r(e,t,r,o){function s(){for(var t=-1,i=arguments.length,a=-1,c=o.length,p=Array(c+i);++a<c;)p[a]=o[a];for(;i--;)p[a++]=arguments[++t];var f=this&&this!==n&&this instanceof s?u:e;return f.apply(l?r:this,p)}var l=t&a,u=i(e);return s}var i=e("./createCtorWrapper"),a=1;t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./createCtorWrapper":104}],109:[function(e,t,n){function r(e,t,n,r,y,v,b,w){var x=t&f;if(!x&&"function"!=typeof e)throw new TypeError(m);var S=r?r.length:0;if(S||(t&=~(h|d),r=y=void 0),S-=y?y.length:0,t&d){var A=r,C=y;r=y=void 0}var E=x?void 0:l(e),k=[e,t,n,r,y,A,C,v,b,w];if(E&&(u(k,E),t=k[1],w=k[9]),k[9]=null==w?x?0:e.length:g(w-S,0)||0,t==p)var O=a(k[0],k[2]);else O=t!=h&&t!=(p|h)||k[4].length?o.apply(void 0,k):s.apply(void 0,k);var j=E?i:c;return j(O,k)}var i=e("./baseSetData"),a=e("./createBindWrapper"),o=e("./createHybridWrapper"),s=e("./createPartialWrapper"),l=e("./getData"),u=e("./mergeData"),c=e("./setData"),p=1,f=2,h=32,d=64,m="Expected a function",g=Math.max;t.exports=r},{"./baseSetData":91,"./createBindWrapper":103,"./createHybridWrapper":107,"./createPartialWrapper":108,"./getData":113,"./mergeData":131,"./setData":136}],110:[function(e,t,n){function r(e,t,n,r,a,o,s){var l=-1,u=e.length,c=t.length;if(u!=c&&!(a&&c>u))return!1;for(;++l<u;){var p=e[l],f=t[l],h=r?r(a?f:p,a?p:f,l):void 0;if(void 0!==h){if(h)continue;return!1}if(a){if(!i(t,function(e){return p===e||n(p,e,r,a,o,s)}))return!1}else if(p!==f&&!n(p,f,r,a,o,s))return!1}return!0}var i=e("./arraySome");t.exports=r},{"./arraySome":68}],111:[function(e,t,n){function r(e,t,n){switch(n){case i:case a:return+e==+t;case o:return e.name==t.name&&e.message==t.message;case s:return e!=+e?t!=+t:e==+t;case l:case u:return e==t+""}return!1}var i="[object Boolean]",a="[object Date]",o="[object Error]",s="[object Number]",l="[object RegExp]",u="[object String]";t.exports=r},{}],112:[function(e,t,n){function r(e,t,n,r,a,s,l){var u=i(e),c=u.length,p=i(t),f=p.length;if(c!=f&&!a)return!1;for(var h=c;h--;){var d=u[h];if(!(a?d in t:o.call(t,d)))return!1}for(var m=a;++h<c;){d=u[h];var g=e[d],y=t[d],v=r?r(a?y:g,a?g:y,d):void 0;if(!(void 0===v?n(g,y,r,a,s,l):v))return!1;m||(m="constructor"==d)}if(!m){var b=e.constructor,w=t.constructor;if(b!=w&&"constructor"in e&&"constructor"in t&&!("function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w))return!1}return!0}var i=e("../object/keys"),a=Object.prototype,o=a.hasOwnProperty;t.exports=r},{"../object/keys":152}],113:[function(e,t,n){var r=e("./metaMap"),i=e("../utility/noop"),a=r?function(e){return r.get(e)}:i;t.exports=a},{"../utility/noop":158,"./metaMap":132}],114:[function(e,t,n){function r(e){for(var t=e.name,n=i[t],r=n?n.length:0;r--;){var a=n[r],o=a.func;if(null==o||o==e)return a.name}return t}var i=e("./realNames");t.exports=r},{"./realNames":133}],115:[function(e,t,n){var r=e("./baseProperty"),i=r("length");t.exports=i},{"./baseProperty":89}],116:[function(e,t,n){function r(e){for(var t=a(e),n=t.length;n--;)t[n][2]=i(t[n][1]);return t}var i=e("./isStrictComparable"),a=e("../object/pairs");t.exports=r},{"../object/pairs":154,"./isStrictComparable":130}],117:[function(e,t,n){function r(e,t){var n=null==e?void 0:e[t];return i(n)?n:void 0}var i=e("../lang/isNative");t.exports=r},{"../lang/isNative":146}],118:[function(e,t,n){function r(e,t,n){for(var r=e.length,i=t+(n?0:-1);n?i--:++i<r;){var a=e[i];if(a!==a)return i}return-1}t.exports=r},{}],119:[function(e,t,n){function r(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&a.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var i=Object.prototype,a=i.hasOwnProperty;t.exports=r},{}],120:[function(e,t,n){(function(n){function r(e,t,n){var r=e.constructor;switch(t){case c:return i(e);case a:case o:return new r(+e);case p:case f:case h:case d:case m:case g:case y:case v:case b:r instanceof r&&(r=S[t]);var x=e.buffer;return new r(n?i(x):x,e.byteOffset,e.length);case s:case u:return new r(e);case l:var A=new r(e.source,w.exec(e));A.lastIndex=e.lastIndex}return A}var i=e("./bufferClone"),a="[object Boolean]",o="[object Date]",s="[object Number]",l="[object RegExp]",u="[object String]",c="[object ArrayBuffer]",p="[object Float32Array]",f="[object Float64Array]",h="[object Int8Array]",d="[object Int16Array]",m="[object Int32Array]",g="[object Uint8Array]",y="[object Uint8ClampedArray]",v="[object Uint16Array]",b="[object Uint32Array]",w=/\w*$/,x=n.Uint8Array,S={};S[p]=n.Float32Array,S[f]=n.Float64Array,S[h]=n.Int8Array,S[d]=n.Int16Array,S[m]=n.Int32Array,S[g]=x,S[y]=n.Uint8ClampedArray,S[v]=n.Uint16Array,S[b]=n.Uint32Array,t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./bufferClone":98}],121:[function(e,t,n){function r(e){var t=e.constructor;return"function"==typeof t&&t instanceof t||(t=Object),new t}t.exports=r},{}],122:[function(e,t,n){function r(e){return null!=e&&a(i(e))}var i=e("./getLength"),a=e("./isLength");t.exports=r},{"./getLength":115,"./isLength":128}],123:[function(e,t,n){var r=function(){try{Object({toString:0}+"")}catch(e){return function(){return!1}}return function(e){return"function"!=typeof e.toString&&"string"==typeof(e+"")}}();t.exports=r},{}],124:[function(e,t,n){function r(e,t){return e="number"==typeof e||i.test(e)?+e:-1,t=null==t?a:t,e>-1&&e%1==0&&t>e}var i=/^\d+$/,a=9007199254740991;t.exports=r},{}],125:[function(e,t,n){function r(e,t,n){if(!o(n))return!1;var r=typeof t;if("number"==r?i(n)&&a(t,n.length):"string"==r&&t in n){var s=n[t];return e===e?e===s:s!==s}return!1}var i=e("./isArrayLike"),a=e("./isIndex"),o=e("../lang/isObject");t.exports=r},{"../lang/isObject":147,"./isArrayLike":122,"./isIndex":124}],126:[function(e,t,n){function r(e,t){var n=typeof e;if("string"==n&&s.test(e)||"number"==n)return!0;if(i(e))return!1;var r=!o.test(e);return r||null!=t&&e in a(t)}var i=e("../lang/isArray"),a=e("./toObject"),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,s=/^\w*$/;t.exports=r},{"../lang/isArray":143,"./toObject":138}],127:[function(e,t,n){function r(e){
+var t=o(e);if(!(t in i.prototype))return!1;var n=s[t];if(e===n)return!0;var r=a(n);return!!r&&e===r[0]}var i=e("./LazyWrapper"),a=e("./getData"),o=e("./getFuncName"),s=e("../chain/lodash");t.exports=r},{"../chain/lodash":54,"./LazyWrapper":63,"./getData":113,"./getFuncName":114}],128:[function(e,t,n){function r(e){return"number"==typeof e&&e>-1&&e%1==0&&i>=e}var i=9007199254740991;t.exports=r},{}],129:[function(e,t,n){function r(e){return!!e&&"object"==typeof e}t.exports=r},{}],130:[function(e,t,n){function r(e){return e===e&&!i(e)}var i=e("../lang/isObject");t.exports=r},{"../lang/isObject":147}],131:[function(e,t,n){function r(e,t){var n=e[1],r=t[1],m=n|r,g=p>m,y=r==p&&n==c||r==p&&n==f&&e[7].length<=t[8]||r==(p|f)&&n==c;if(!g&&!y)return e;r&l&&(e[2]=t[2],m|=n&l?0:u);var v=t[3];if(v){var b=e[3];e[3]=b?a(b,v,t[4]):i(v),e[4]=b?s(e[3],h):i(t[4])}return v=t[5],v&&(b=e[5],e[5]=b?o(b,v,t[6]):i(v),e[6]=b?s(e[5],h):i(t[6])),v=t[7],v&&(e[7]=i(v)),r&p&&(e[8]=null==e[8]?t[8]:d(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=m,e}var i=e("./arrayCopy"),a=e("./composeArgs"),o=e("./composeArgsRight"),s=e("./replaceHolders"),l=1,u=4,c=8,p=128,f=256,h="__lodash_placeholder__",d=Math.min;t.exports=r},{"./arrayCopy":65,"./composeArgs":99,"./composeArgsRight":100,"./replaceHolders":135}],132:[function(e,t,n){(function(n){var r=e("./getNative"),i=r(n,"WeakMap"),a=i&&new i;t.exports=a}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./getNative":117}],133:[function(e,t,n){var r={};t.exports=r},{}],134:[function(e,t,n){function r(e,t){for(var n=e.length,r=o(t.length,n),s=i(e);r--;){var l=t[r];e[r]=a(l,n)?s[l]:void 0}return e}var i=e("./arrayCopy"),a=e("./isIndex"),o=Math.min;t.exports=r},{"./arrayCopy":65,"./isIndex":124}],135:[function(e,t,n){function r(e,t){for(var n=-1,r=e.length,a=-1,o=[];++n<r;)e[n]===t&&(e[n]=i,o[++a]=n);return o}var i="__lodash_placeholder__";t.exports=r},{}],136:[function(e,t,n){var r=e("./baseSetData"),i=e("../date/now"),a=150,o=16,s=function(){var e=0,t=0;return function(n,s){var l=i(),u=o-(l-t);if(t=l,u>0){if(++e>=a)return n}else e=0;return r(n,s)}}();t.exports=s},{"../date/now":60,"./baseSetData":91}],137:[function(e,t,n){function r(e){for(var t=u(e),n=t.length,r=n&&e.length,c=!!r&&s(r)&&(a(e)||i(e)||l(e)),f=-1,h=[];++f<n;){var d=t[f];(c&&o(d,r)||p.call(e,d))&&h.push(d)}return h}var i=e("../lang/isArguments"),a=e("../lang/isArray"),o=e("./isIndex"),s=e("./isLength"),l=e("../lang/isString"),u=e("../object/keysIn"),c=Object.prototype,p=c.hasOwnProperty;t.exports=r},{"../lang/isArguments":142,"../lang/isArray":143,"../lang/isString":149,"../object/keysIn":153,"./isIndex":124,"./isLength":128}],138:[function(e,t,n){function r(e){if(o.unindexedChars&&a(e)){for(var t=-1,n=e.length,r=Object(e);++t<n;)r[t]=e.charAt(t);return r}return i(e)?e:Object(e)}var i=e("../lang/isObject"),a=e("../lang/isString"),o=e("../support");t.exports=r},{"../lang/isObject":147,"../lang/isString":149,"../support":156}],139:[function(e,t,n){function r(e){if(a(e))return e;var t=[];return i(e).replace(o,function(e,n,r,i){t.push(r?i.replace(s,"$1"):n||e)}),t}var i=e("./baseToString"),a=e("../lang/isArray"),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,s=/\\(\\)?/g;t.exports=r},{"../lang/isArray":143,"./baseToString":93}],140:[function(e,t,n){function r(e){return e instanceof i?e.clone():new a(e.__wrapped__,e.__chain__,o(e.__actions__))}var i=e("./LazyWrapper"),a=e("./LodashWrapper"),o=e("./arrayCopy");t.exports=r},{"./LazyWrapper":63,"./LodashWrapper":64,"./arrayCopy":65}],141:[function(e,t,n){function r(e,t,n){return"function"==typeof t?i(e,!0,a(t,n,1)):i(e,!0)}var i=e("../internal/baseClone"),a=e("../internal/bindCallback");t.exports=r},{"../internal/baseClone":71,"../internal/bindCallback":97}],142:[function(e,t,n){function r(e){return a(e)&&i(e)&&s.call(e,"callee")&&!l.call(e,"callee")}var i=e("../internal/isArrayLike"),a=e("../internal/isObjectLike"),o=Object.prototype,s=o.hasOwnProperty,l=o.propertyIsEnumerable;t.exports=r},{"../internal/isArrayLike":122,"../internal/isObjectLike":129}],143:[function(e,t,n){var r=e("../internal/getNative"),i=e("../internal/isLength"),a=e("../internal/isObjectLike"),o="[object Array]",s=Object.prototype,l=s.toString,u=r(Array,"isArray"),c=u||function(e){return a(e)&&i(e.length)&&l.call(e)==o};t.exports=c},{"../internal/getNative":117,"../internal/isLength":128,"../internal/isObjectLike":129}],144:[function(e,t,n){function r(e){return null==e?!0:o(e)&&(a(e)||u(e)||i(e)||l(e)&&s(e.splice))?!e.length:!c(e).length}var i=e("./isArguments"),a=e("./isArray"),o=e("../internal/isArrayLike"),s=e("./isFunction"),l=e("../internal/isObjectLike"),u=e("./isString"),c=e("../object/keys");t.exports=r},{"../internal/isArrayLike":122,"../internal/isObjectLike":129,"../object/keys":152,"./isArguments":142,"./isArray":143,"./isFunction":145,"./isString":149}],145:[function(e,t,n){function r(e){return i(e)&&s.call(e)==a}var i=e("./isObject"),a="[object Function]",o=Object.prototype,s=o.toString;t.exports=r},{"./isObject":147}],146:[function(e,t,n){function r(e){return null==e?!1:i(e)?p.test(u.call(e)):o(e)&&(a(e)?p:s).test(e)}var i=e("./isFunction"),a=e("../internal/isHostObject"),o=e("../internal/isObjectLike"),s=/^\[object .+?Constructor\]$/,l=Object.prototype,u=Function.prototype.toString,c=l.hasOwnProperty,p=RegExp("^"+u.call(c).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=r},{"../internal/isHostObject":123,"../internal/isObjectLike":129,"./isFunction":145}],147:[function(e,t,n){function r(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}t.exports=r},{}],148:[function(e,t,n){function r(e){var t;if(!s(e)||f.call(e)!=u||o(e)||a(e)||!p.call(e,"constructor")&&(t=e.constructor,"function"==typeof t&&!(t instanceof t)))return!1;var n;return l.ownLast?(i(e,function(e,t,r){return n=p.call(r,t),!1}),n!==!1):(i(e,function(e,t){n=t}),void 0===n||p.call(e,n))}var i=e("../internal/baseForIn"),a=e("./isArguments"),o=e("../internal/isHostObject"),s=e("../internal/isObjectLike"),l=e("../support"),u="[object Object]",c=Object.prototype,p=c.hasOwnProperty,f=c.toString;t.exports=r},{"../internal/baseForIn":78,"../internal/isHostObject":123,"../internal/isObjectLike":129,"../support":156,"./isArguments":142}],149:[function(e,t,n){function r(e){return"string"==typeof e||i(e)&&s.call(e)==a}var i=e("../internal/isObjectLike"),a="[object String]",o=Object.prototype,s=o.toString;t.exports=r},{"../internal/isObjectLike":129}],150:[function(e,t,n){function r(e){return a(e)&&i(e.length)&&!!T[_.call(e)]}var i=e("../internal/isLength"),a=e("../internal/isObjectLike"),o="[object Arguments]",s="[object Array]",l="[object Boolean]",u="[object Date]",c="[object Error]",p="[object Function]",f="[object Map]",h="[object Number]",d="[object Object]",m="[object RegExp]",g="[object Set]",y="[object String]",v="[object WeakMap]",b="[object ArrayBuffer]",w="[object Float32Array]",x="[object Float64Array]",S="[object Int8Array]",A="[object Int16Array]",C="[object Int32Array]",E="[object Uint8Array]",k="[object Uint8ClampedArray]",O="[object Uint16Array]",j="[object Uint32Array]",T={};T[w]=T[x]=T[S]=T[A]=T[C]=T[E]=T[k]=T[O]=T[j]=!0,T[o]=T[s]=T[b]=T[l]=T[u]=T[c]=T[p]=T[f]=T[h]=T[d]=T[m]=T[g]=T[y]=T[v]=!1;var I=Object.prototype,_=I.toString;t.exports=r},{"../internal/isLength":128,"../internal/isObjectLike":129}],151:[function(e,t,n){function r(e){return void 0===e}t.exports=r},{}],152:[function(e,t,n){var r=e("../internal/getNative"),i=e("../internal/isArrayLike"),a=e("../lang/isObject"),o=e("../internal/shimKeys"),s=e("../support"),l=r(Object,"keys"),u=l?function(e){var t=null==e?void 0:e.constructor;return"function"==typeof t&&t.prototype===e||("function"==typeof e?s.enumPrototypes:i(e))?o(e):a(e)?l(e):[]}:o;t.exports=u},{"../internal/getNative":117,"../internal/isArrayLike":122,"../internal/shimKeys":137,"../lang/isObject":147,"../support":156}],153:[function(e,t,n){function r(e){if(null==e)return[];c(e)||(e=Object(e));var t=e.length;t=t&&u(t)&&(o(e)||a(e)||p(e))&&t||0;for(var n=e.constructor,r=-1,i=s(n)&&n.prototype||C,h=i===e,d=Array(t),m=t>0,y=f.enumErrorProps&&(e===A||e instanceof Error),v=f.enumPrototypes&&s(e);++r<t;)d[r]=r+"";for(var w in e)v&&"prototype"==w||y&&("message"==w||"name"==w)||m&&l(w,t)||"constructor"==w&&(h||!k.call(e,w))||d.push(w);if(f.nonEnumShadows&&e!==C){var T=e===E?x:e===A?g:O.call(e),I=j[T]||j[b];for(T==b&&(i=C),t=S.length;t--;){w=S[t];var _=I[w];h&&_||(_?!k.call(e,w):e[w]===i[w])||d.push(w)}}return d}var i=e("../internal/arrayEach"),a=e("../lang/isArguments"),o=e("../lang/isArray"),s=e("../lang/isFunction"),l=e("../internal/isIndex"),u=e("../internal/isLength"),c=e("../lang/isObject"),p=e("../lang/isString"),f=e("../support"),h="[object Array]",d="[object Boolean]",m="[object Date]",g="[object Error]",y="[object Function]",v="[object Number]",b="[object Object]",w="[object RegExp]",x="[object String]",S=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],A=Error.prototype,C=Object.prototype,E=String.prototype,k=C.hasOwnProperty,O=C.toString,j={};j[h]=j[m]=j[v]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},j[d]=j[x]={constructor:!0,toString:!0,valueOf:!0},j[g]=j[y]=j[w]={constructor:!0,toString:!0},j[b]={constructor:!0},i(S,function(e){for(var t in j)if(k.call(j,t)){var n=j[t];n[e]=k.call(n,e)}}),t.exports=r},{"../internal/arrayEach":66,"../internal/isIndex":124,"../internal/isLength":128,"../lang/isArguments":142,"../lang/isArray":143,"../lang/isFunction":145,"../lang/isObject":147,"../lang/isString":149,"../support":156}],154:[function(e,t,n){function r(e){e=a(e);for(var t=-1,n=i(e),r=n.length,o=Array(r);++t<r;){var s=n[t];o[t]=[s,e[s]]}return o}var i=e("./keys"),a=e("../internal/toObject");t.exports=r},{"../internal/toObject":138,"./keys":152}],155:[function(e,t,n){function r(e){return i(e,a(e))}var i=e("../internal/baseValues"),a=e("./keys");t.exports=r},{"../internal/baseValues":94,"./keys":152}],156:[function(e,t,n){var r=Array.prototype,i=Error.prototype,a=Object.prototype,o=a.propertyIsEnumerable,s=r.splice,l={};!function(e){var t=function(){this.x=e},n={0:e,length:e},r=[];t.prototype={valueOf:e,y:e};for(var a in new t)r.push(a);l.enumErrorProps=o.call(i,"message")||o.call(i,"name"),l.enumPrototypes=o.call(t,"prototype"),l.nonEnumShadows=!/valueOf/.test(r),l.ownLast="x"!=r[0],l.spliceObjects=(s.call(n,0,1),!n[0]),l.unindexedChars="x"[0]+Object("x")[0]!="xx"}(1,0),t.exports=l},{}],157:[function(e,t,n){function r(e){return e}t.exports=r},{}],158:[function(e,t,n){function r(){}t.exports=r},{}],159:[function(e,t,n){function r(e){return o(e)?i(e):a(e)}var i=e("../internal/baseProperty"),a=e("../internal/basePropertyDeep"),o=e("../internal/isKey");t.exports=r},{"../internal/baseProperty":89,"../internal/basePropertyDeep":90,"../internal/isKey":126}],160:[function(e,t,n){function r(){}function i(e){var t={}.toString.call(e);switch(t){case"[object File]":case"[object Blob]":case"[object FormData]":return!0;default:return!1}}function a(e){return e===Object(e)}function o(e){if(!a(e))return e;var t=[];for(var n in e)null!=e[n]&&t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t.join("&")}function s(e){for(var t,n,r={},i=e.split("&"),a=0,o=i.length;o>a;++a)n=i[a],t=n.split("="),r[decodeURIComponent(t[0])]=decodeURIComponent(t[1]);return r}function l(e){var t,n,r,i,a=e.split(/\r?\n/),o={};a.pop();for(var s=0,l=a.length;l>s;++s)n=a[s],t=n.indexOf(":"),r=n.slice(0,t).toLowerCase(),i=y(n.slice(t+1)),o[r]=i;return o}function u(e){return e.split(/ *; */).shift()}function c(e){return m(e.split(/ *; */),function(e,t){var n=t.split(/ *= */),r=n.shift(),i=n.shift();return r&&i&&(e[r]=i),e},{})}function p(e,t){t=t||{},this.req=e,this.xhr=this.req.xhr,this.text="HEAD"!=this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||"undefined"==typeof this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText,this.setStatusProperties(this.xhr.status),this.header=this.headers=l(this.xhr.getAllResponseHeaders()),this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this.setHeaderProperties(this.header),this.body="HEAD"!=this.req.method?this.parseBody(this.text?this.text:this.xhr.response):null}function f(e,t){var n=this;d.call(this),this._query=this._query||[],this.method=e,this.url=t,this.header={},this._header={},this.on("end",function(){var e=null,t=null;try{t=new p(n)}catch(r){return e=new Error("Parser is unable to parse the response"),e.parse=!0,e.original=r,n.callback(e)}if(n.emit("response",t),e)return n.callback(e,t);if(t.status>=200&&t.status<300)return n.callback(e,t);var i=new Error(t.statusText||"Unsuccessful HTTP response");i.original=e,i.response=t,i.status=t.status,n.callback(e||i,t)})}function h(e,t){return"function"==typeof t?new f("GET",e).end(t):1==arguments.length?new f("GET",e):new f(e,t)}var d=e("emitter"),m=e("reduce"),g="undefined"==typeof window?this||self:window;h.getXHR=function(){if(!(!g.XMLHttpRequest||g.location&&"file:"==g.location.protocol&&g.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}return!1};var y="".trim?function(e){return e.trim()}:function(e){return e.replace(/(^\s*|\s*$)/g,"")};h.serializeObject=o,h.parseString=s,h.types={html:"text/html",json:"application/json",xml:"application/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},h.serialize={"application/x-www-form-urlencoded":o,"application/json":JSON.stringify},h.parse={"application/x-www-form-urlencoded":s,"application/json":JSON.parse},p.prototype.get=function(e){return this.header[e.toLowerCase()]},p.prototype.setHeaderProperties=function(e){var t=this.header["content-type"]||"";this.type=u(t);var n=c(t);for(var r in n)this[r]=n[r]},p.prototype.parseBody=function(e){var t=h.parse[this.type];return t&&e&&(e.length||e instanceof Object)?t(e):null},p.prototype.setStatusProperties=function(e){1223===e&&(e=204);var t=e/100|0;this.status=e,this.statusType=t,this.info=1==t,this.ok=2==t,this.clientError=4==t,this.serverError=5==t,this.error=4==t||5==t?this.toError():!1,this.accepted=202==e,this.noContent=204==e,this.badRequest=400==e,this.unauthorized=401==e,this.notAcceptable=406==e,this.notFound=404==e,this.forbidden=403==e},p.prototype.toError=function(){var e=this.req,t=e.method,n=e.url,r="cannot "+t+" "+n+" ("+this.status+")",i=new Error(r);return i.status=this.status,i.method=t,i.url=n,i},h.Response=p,d(f.prototype),f.prototype.use=function(e){return e(this),this},f.prototype.timeout=function(e){return this._timeout=e,this},f.prototype.clearTimeout=function(){return this._timeout=0,clearTimeout(this._timer),this},f.prototype.abort=function(){return this.aborted?void 0:(this.aborted=!0,this.xhr.abort(),this.clearTimeout(),this.emit("abort"),this)},f.prototype.set=function(e,t){if(a(e)){for(var n in e)this.set(n,e[n]);return this}return this._header[e.toLowerCase()]=t,this.header[e]=t,this},f.prototype.unset=function(e){return delete this._header[e.toLowerCase()],delete this.header[e],this},f.prototype.getHeader=function(e){return this._header[e.toLowerCase()]},f.prototype.type=function(e){return this.set("Content-Type",h.types[e]||e),this},f.prototype.accept=function(e){return this.set("Accept",h.types[e]||e),this},f.prototype.auth=function(e,t){var n=btoa(e+":"+t);return this.set("Authorization","Basic "+n),this},f.prototype.query=function(e){return"string"!=typeof e&&(e=o(e)),e&&this._query.push(e),this},f.prototype.field=function(e,t){return this._formData||(this._formData=new g.FormData),this._formData.append(e,t),this},f.prototype.attach=function(e,t,n){return this._formData||(this._formData=new g.FormData),this._formData.append(e,t,n),this},f.prototype.send=function(e){var t=a(e),n=this.getHeader("Content-Type");if(t&&a(this._data))for(var r in e)this._data[r]=e[r];else"string"==typeof e?(n||this.type("form"),n=this.getHeader("Content-Type"),"application/x-www-form-urlencoded"==n?this._data=this._data?this._data+"&"+e:e:this._data=(this._data||"")+e):this._data=e;return!t||i(e)?this:(n||this.type("json"),this)},f.prototype.callback=function(e,t){var n=this._callback;this.clearTimeout(),n(e,t)},f.prototype.crossDomainError=function(){var e=new Error("Origin is not allowed by Access-Control-Allow-Origin");e.crossDomain=!0,this.callback(e)},f.prototype.timeoutError=function(){var e=this._timeout,t=new Error("timeout of "+e+"ms exceeded");t.timeout=e,this.callback(t)},f.prototype.withCredentials=function(){return this._withCredentials=!0,this},f.prototype.end=function(e){var t=this,n=this.xhr=h.getXHR(),a=this._query.join("&"),o=this._timeout,s=this._formData||this._data;this._callback=e||r,n.onreadystatechange=function(){if(4==n.readyState){var e;try{e=n.status}catch(r){e=0}if(0==e){if(t.timedout)return t.timeoutError();if(t.aborted)return;return t.crossDomainError()}t.emit("end")}};var l=function(e){e.total>0&&(e.percent=e.loaded/e.total*100),t.emit("progress",e)};this.hasListeners("progress")&&(n.onprogress=l);try{n.upload&&this.hasListeners("progress")&&(n.upload.onprogress=l)}catch(u){}if(o&&!this._timer&&(this._timer=setTimeout(function(){t.timedout=!0,t.abort()},o)),a&&(a=h.serializeObject(a),this.url+=~this.url.indexOf("?")?"&"+a:"?"+a),n.open(this.method,this.url,!0),this._withCredentials&&(n.withCredentials=!0),"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof s&&!i(s)){var c=h.serialize[this.getHeader("Content-Type")];c&&(s=c(s))}for(var p in this.header)null!=this.header[p]&&n.setRequestHeader(p,this.header[p]);return this.emit("request",this),n.send(s),this},h.Request=f,h.get=function(e,t,n){var r=h("GET",e);return"function"==typeof t&&(n=t,t=null),t&&r.query(t),n&&r.end(n),r},h.head=function(e,t,n){var r=h("HEAD",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},h.del=function(e,t){var n=h("DELETE",e);return t&&n.end(t),n},h.patch=function(e,t,n){var r=h("PATCH",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},h.post=function(e,t,n){var r=h("POST",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},h.put=function(e,t,n){var r=h("PUT",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},t.exports=h},{emitter:161,reduce:162}],161:[function(e,t,n){function r(e){return e?i(e):void 0}function i(e){for(var t in r.prototype)e[t]=r.prototype[t];return e}t.exports=r,r.prototype.on=r.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[e]=this._callbacks[e]||[]).push(t),this},r.prototype.once=function(e,t){function n(){r.off(e,n),t.apply(this,arguments)}var r=this;return this._callbacks=this._callbacks||{},n.fn=t,this.on(e,n),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n=this._callbacks[e];if(!n)return this;if(1==arguments.length)return delete this._callbacks[e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return this},r.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),n=this._callbacks[e];if(n){n=n.slice(0);for(var r=0,i=n.length;i>r;++r)n[r].apply(this,t)}return this},r.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[e]||[]},r.prototype.hasListeners=function(e){return!!this.listeners(e).length}},{}],162:[function(e,t,n){t.exports=function(e,t,n){for(var r=0,i=e.length,a=3==arguments.length?n:e[r++];i>r;)a=t.call(null,a,e[r],++r,e);return a}},{}]},{},[1])(1)}),window.SwaggerUi=Backbone.Router.extend({dom_id:"swagger_ui",options:null,api:null,headerView:null,mainView:null,initialize:function(e){e=e||{},e.highlightSizeThreshold||(e.highlightSizeThreshold=1e5),e.dom_id&&(this.dom_id=e.dom_id,delete e.dom_id),e.supportedSubmitMethods||(e.supportedSubmitMethods=["get","put","post","delete","head","options","patch"]),"string"==typeof e.oauth2RedirectUrl&&(window.oAuthRedirectUrl=e.redirectUrl),$("#"+this.dom_id).length||$("body").append('<div id="'+this.dom_id+'"></div>'),this.options=e,marked.setOptions({gfm:!0});var t=this;this.options.success=function(){return t.render()},this.options.progress=function(e){return t.showMessage(e)},this.options.failure=function(e){return t.onLoadFailure(e)},this.headerView=new SwaggerUi.Views.HeaderView({el:$("#header")}),this.headerView.on("update-swagger-ui",function(e){return t.updateSwaggerUi(e)})},setOption:function(e,t){this.options[e]=t},getOption:function(e){return this.options[e]},updateSwaggerUi:function(e){this.options.url=e.url,this.load()},load:function(){this.mainView&&this.mainView.clear();var e=this.options.url;e&&0!==e.indexOf("http")&&(e=this.buildUrl(window.location.href.toString(),e)),this.api&&(this.options.authorizations=this.api.clientAuthorizations.authz),this.options.url=e,this.headerView.update(e),this.api=new SwaggerClient(this.options)},collapseAll:function(){Docs.collapseEndpointListForResource("")},listAll:function(){Docs.collapseOperationsForResource("")},expandAll:function(){Docs.expandOperationsForResource("")},render:function(){switch(this.showMessage("Finished Loading Resource Information. Rendering Swagger UI..."),this.mainView=new SwaggerUi.Views.MainView({model:this.api,el:$("#"+this.dom_id),swaggerOptions:this.options,router:this}).render(),this.showMessage(),this.options.docExpansion){case"full":this.expandAll();break;case"list":this.listAll()}this.renderGFM(),this.options.onComplete&&this.options.onComplete(this.api,this),setTimeout(Docs.shebang.bind(this),100)},buildUrl:function(e,t){if(0===t.indexOf("/")){var n=e.split("/");return e=n[0]+"//"+n[2],e+t}var r=e.length;return e.indexOf("?")>-1&&(r=Math.min(r,e.indexOf("?"))),e.indexOf("#")>-1&&(r=Math.min(r,e.indexOf("#"))),e=e.substring(0,r),-1!==e.indexOf("/",e.length-1)?e+t:e+"/"+t},showMessage:function(e){void 0===e&&(e="");var t=$("#message-bar");t.removeClass("message-fail"),t.addClass("message-success"),t.html(e),window.SwaggerTranslator&&window.SwaggerTranslator.translate(t)},onLoadFailure:function(e){void 0===e&&(e=""),$("#message-bar").removeClass("message-success"),$("#message-bar").addClass("message-fail");var t=$("#message-bar").text(e);return this.options.onFailure&&this.options.onFailure(e),t},renderGFM:function(){$(".markdown").each(function(){$(this).html(marked($(this).html()))}),$(".propDesc",".model-signature .description").each(function(){$(this).html(marked($(this).html())).addClass("markdown")})}}),window.SwaggerUi.Views={},function(){function e(e){"console"in window&&"function"==typeof window.console.warn&&console.warn(e)}window.authorizations={add:function(){if(e("Using window.authorizations is deprecated. Please use SwaggerUi.api.clientAuthorizations.add()."),"undefined"==typeof window.swaggerUi)throw new TypeError("window.swaggerUi is not defined");window.swaggerUi instanceof SwaggerUi&&window.swaggerUi.api.clientAuthorizations.add.apply(window.swaggerUi.api.clientAuthorizations,arguments)}},window.ApiKeyAuthorization=function(){e("window.ApiKeyAuthorization is deprecated. Please use SwaggerClient.ApiKeyAuthorization."),SwaggerClient.ApiKeyAuthorization.apply(window,arguments)},window.PasswordAuthorization=function(){e("window.PasswordAuthorization is deprecated. Please use SwaggerClient.PasswordAuthorization."),SwaggerClient.PasswordAuthorization.apply(window,arguments)}}(),function(e,t){"function"==typeof define&&define.amd?define(["b"],function(n){return e.SwaggerUi=t(n)}):"object"==typeof exports?module.exports=t(require("b")):e.SwaggerUi=t(e.b)}(this,function(){return SwaggerUi}),SwaggerUi.Views.ApiKeyButton=Backbone.View.extend({events:{"click #apikey_button":"toggleApiKeyContainer","click #apply_api_key":"applyApiKey"},initialize:function(e){this.options=e||{},this.router=this.options.router},render:function(){var e=this.template();return $(this.el).html(e(this.model)),this},applyApiKey:function(){var e=new SwaggerClient.ApiKeyAuthorization(this.model.name,$("#input_apiKey_entry").val(),this.model["in"]);this.router.api.clientAuthorizations.add(this.model.name,e),this.router.load(),$("#apikey_container").show()},toggleApiKeyContainer:function(){if($("#apikey_container").length){var e=$("#apikey_container").first();e.is(":visible")?e.hide():($(".auth_container").hide(),e.show())}},template:function(){return Handlebars.templates.apikey_button_view}}),SwaggerUi.Views.BasicAuthButton=Backbone.View.extend({initialize:function(e){this.options=e||{},this.router=this.options.router},render:function(){var e=this.template();return $(this.el).html(e(this.model)),this},events:{"click #basic_auth_button":"togglePasswordContainer","click #apply_basic_auth":"applyPassword"},applyPassword:function(){var e=$(".input_username").val(),t=$(".input_password").val(),n=new SwaggerClient.PasswordAuthorization("basic",e,t);this.router.api.clientAuthorizations.add(this.model.type,n),this.router.load(),$("#basic_auth_container").hide()},togglePasswordContainer:function(){if($("#basic_auth_container").length){var e=$("#basic_auth_container").show();e.is(":visible")?e.slideUp():($(".auth_container").hide(),e.show())}},template:function(){return Handlebars.templates.basic_auth_button_view}}),SwaggerUi.Views.ContentTypeView=Backbone.View.extend({initialize:function(){},render:function(){return this.model.contentTypeId="ct"+Math.random(),$(this.el).html(Handlebars.templates.content_type(this.model)),this}}),SwaggerUi.Views.HeaderView=Backbone.View.extend({events:{"click #show-pet-store-icon":"showPetStore","click #explore":"showCustom","keyup #input_baseUrl":"showCustomOnKeyup","keyup #input_apiKey":"showCustomOnKeyup"},initialize:function(){},showPetStore:function(){this.trigger("update-swagger-ui",{url:"http://petstore.swagger.io/v2/swagger.json"})},showCustomOnKeyup:function(e){13===e.keyCode&&this.showCustom()},showCustom:function(e){e&&e.preventDefault(),this.trigger("update-swagger-ui",{url:$("#input_baseUrl").val(),apiKey:$("#input_apiKey").val()})},update:function(e,t,n){void 0===n&&(n=!1),$("#input_baseUrl").val(e),n&&this.trigger("update-swagger-ui",{url:e})}}),SwaggerUi.Views.MainView=Backbone.View.extend({apisSorter:{alpha:function(e,t){return e.name.localeCompare(t.name)}},operationsSorters:{alpha:function(e,t){return e.path.localeCompare(t.path)},method:function(e,t){return e.method.localeCompare(t.method)}},initialize:function(e){var t,n,r,i;if(e=e||{},this.router=e.router,e.swaggerOptions.apisSorter&&(t=e.swaggerOptions.apisSorter,n=_.isFunction(t)?t:this.apisSorter[t],_.isFunction(n)&&this.model.apisArray.sort(n)),e.swaggerOptions.operationsSorter&&(t=e.swaggerOptions.operationsSorter,n=_.isFunction(t)?t:this.operationsSorters[t],_.isFunction(n)))for(r in this.model.apisArray)this.model.apisArray[r].operationsArray.sort(n);this.model.auths=[];for(r in this.model.securityDefinitions)i=this.model.securityDefinitions[r],this.model.auths.push({name:r,type:i.type,value:i});"validatorUrl"in e.swaggerOptions?this.model.validatorUrl=e.swaggerOptions.validatorUrl:this.model.url.indexOf("localhost")>0?this.model.validatorUrl=null:"https:"===window.location.protocol?this.model.validatorUrl="https://online.swagger.io/validator":this.model.validatorUrl="http://online.swagger.io/validator"},render:function(){if(this.model.securityDefinitions)for(var e in this.model.securityDefinitions){var t,n=this.model.securityDefinitions[e];"apiKey"===n.type&&0===$("#apikey_button").length&&(t=new SwaggerUi.Views.ApiKeyButton({model:n,router:this.router}).render().el,$(".auth_main_container").append(t)),"basicAuth"===n.type&&0===$("#basic_auth_button").length&&(t=new SwaggerUi.Views.BasicAuthButton({model:n,router:this.router}).render().el,$(".auth_main_container").append(t))}$(this.el).html(Handlebars.templates.main(this.model));for(var r={},i=0,a=0;a<this.model.apisArray.length;a++){for(var o=this.model.apisArray[a],s=o.name;"undefined"!=typeof r[s];)s=s+"_"+i,i+=1;o.id=s,r[s]=o,this.addResource(o,this.model.auths)}return $(".propWrap").hover(function(){$(".optionsWrapper",$(this)).show()},function(){$(".optionsWrapper",$(this)).hide()}),this},addResource:function(e,t){e.id=e.id.replace(/\s/g,"_");var n=new SwaggerUi.Views.ResourceView({model:e,router:this.router,tagName:"li",id:"resource_"+e.id,className:"resource",auths:t,swaggerOptions:this.options.swaggerOptions});$("#resources",this.el).append(n.render().el)},clear:function(){$(this.el).html("")}}),SwaggerUi.Views.OperationView=Backbone.View.extend({invocationUrl:null,events:{"submit .sandbox":"submitOperation","click .submit":"submitOperation","click .response_hider":"hideResponse","click .toggleOperation":"toggleOperationContent","mouseenter .api-ic":"mouseEnter","dblclick .curl":"selectText"},initialize:function(e){return e=e||{},this.router=e.router,this.auths=e.auths,this.parentId=this.model.parentId,this.nickname=this.model.nickname,this.model.encodedParentId=encodeURIComponent(this.parentId),this},selectText:function(e){var t,n,r=document,i=e.target.firstChild;r.body.createTextRange?(t=document.body.createTextRange(),t.moveToElementText(i),t.select()):window.getSelection&&(n=window.getSelection(),t=document.createRange(),t.selectNodeContents(i),n.removeAllRanges(),n.addRange(t))},mouseEnter:function(e){var t=$(this.el).find(".content"),n=e.pageX,r=e.pageY,i=$(window).scrollLeft(),a=$(window).scrollTop(),o=i+$(window).width(),s=a+$(window).height(),l=t.width(),u=t.height();n+l>o&&(n=o-l),i>n&&(n=i),r+u>s&&(r=s-u),a>r&&(r=a);var c={};c.top=r,c.left=n,t.css(c)},render:function(){var e,t,n,r,i,a,o,s,l,u,c,p,f,h,d,m,g,y,v,b,w,x,S,A,C,E,k,O,j,T,I,_,D,L,P,N,M,R;if(a=jQuery.inArray(this.model.method,this.model.supportedSubmitMethods())>=0,a||(this.model.isReadOnly=!0),this.model.description=this.model.description||this.model.notes,this.model.oauth=null,m=this.model.authorizations||this.model.security)if(Array.isArray(m))for(l=0,u=m.length;u>l;l++){n=m[l];for(s in n)for(e in this.auths)if(t=this.auths[e],s===t.name&&"oauth2"===t.type){this.model.oauth={},this.model.oauth.scopes=[],S=t.value.scopes;for(o in S)M=S[o],_=n[s].indexOf(o),_>=0&&(y={scope:o,description:M},this.model.oauth.scopes.push(y))}}else for(o in m)if(M=m[o],"oauth2"===o)for(null===this.model.oauth&&(this.model.oauth={}),void 0===this.model.oauth.scopes&&(this.model.oauth.scopes=[]),d=0,c=M.length;c>d;d++)y=M[d],this.model.oauth.scopes.push(y);if("undefined"!=typeof this.model.responses){this.model.responseMessages=[],A=this.model.responses;for(r in A)R=A[r],T=null,I=this.model.responses[r].schema,I&&I.$ref&&(T=I.$ref,-1!==T.indexOf("#/definitions/")&&(T=T.replace(/^.*#\/definitions\//,""))),this.model.responseMessages.push({code:r,message:R.description,responseModel:T})}if("undefined"==typeof this.model.responseMessages&&(this.model.responseMessages=[]),D=null,this.model.successResponse){P=this.model.successResponse;for(s in P)R=P[s],this.model.successCode=s,"object"==typeof R&&"function"==typeof R.createJSONSample&&(D={sampleJSON:JSON.stringify(R.createJSONSample(),void 0,2),isParam:!1,signature:R.getMockSignature()})}else this.model.responseClassSignature&&"string"!==this.model.responseClassSignature&&(D={sampleJSON:this.model.responseSampleJSON,isParam:!1,signature:this.model.responseClassSignature});var F=this.options.swaggerOptions;for(F.showRequestHeaders&&(this.model.showRequestHeaders=!0),$(this.el).html(Handlebars.templates.operation(this.model)),D?(j=new SwaggerUi.Views.SignatureView({model:D,
+router:this.router,tagName:"div"}),$(".model-signature",$(this.el)).append(j.render().el)):(this.model.responseClassSignature="string",$(".model-signature",$(this.el)).html(this.model.type)),i={isParam:!1},i.consumes=this.model.consumes,i.produces=this.model.produces,C=this.model.parameters,g=0,p=C.length;p>g;g++)b=C[g],N=b.type||b.dataType||"","undefined"==typeof N&&(T=b.schema,T&&T.$ref&&(x=T.$ref,N=0===x.indexOf("#/definitions/")?x.substring("#/definitions/".length):x)),N&&"file"===N.toLowerCase()&&(i.consumes||(i.consumes="multipart/form-data")),b.type=N;for(O=new SwaggerUi.Views.ResponseContentTypeView({model:i,router:this.router}),$(".response-content-type",$(this.el)).append(O.render().el),E=this.model.parameters,v=0,f=E.length;f>v;v++)b=E[v],this.addParameter(b,i.consumes);for(k=this.model.responseMessages,w=0,h=k.length;h>w;w++)L=k[w],this.addStatusCode(L);return this},addParameter:function(e,t){e.consumes=t;var n=new SwaggerUi.Views.ParameterView({model:e,tagName:"tr",readOnly:this.model.isReadOnly});$(".operation-params",$(this.el)).append(n.render().el)},addStatusCode:function(e){var t=new SwaggerUi.Views.StatusCodeView({model:e,tagName:"tr",router:this.router});$(".operation-status",$(this.el)).append(t.render().el)},submitOperation:function(e){var t,n,r,i,a;if(null!==e&&e.preventDefault(),n=$(".sandbox",$(this.el)),t=!0,n.find("input.required").each(function(){$(this).removeClass("error"),""===jQuery.trim($(this).val())&&($(this).addClass("error"),$(this).wiggle({callback:function(e){return function(){$(e).focus()}}(this)}),t=!1)}),n.find("textarea.required").each(function(){$(this).removeClass("error"),""===jQuery.trim($(this).val())&&($(this).addClass("error"),$(this).wiggle({callback:function(e){return function(){return $(e).focus()}}(this)}),t=!1)}),n.find("select.required").each(function(){$(this).removeClass("error"),-1===this.selectedIndex&&($(this).addClass("error"),$(this).wiggle({callback:function(e){return function(){$(e).focus()}}(this)}),t=!1)}),t){if(i=this.getInputMap(n),r=this.isFileUpload(n),a={parent:this},this.options.swaggerOptions)for(var o in this.options.swaggerOptions)a[o]=this.options.swaggerOptions[o];return a.responseContentType=$("div select[name=responseContentType]",$(this.el)).val(),a.requestContentType=$("div select[name=parameterContentType]",$(this.el)).val(),$(".response_throbber",$(this.el)).show(),r?($(".request_url",$(this.el)).html("<pre></pre>"),$(".request_url pre",$(this.el)).text(this.invocationUrl),a.useJQuery=!0,i.parameterContentType="multipart/form-data",this.model.execute(i,a,this.showCompleteStatus,this.showErrorStatus,this)):(this.map=i,this.model.execute(i,a,this.showCompleteStatus,this.showErrorStatus,this))}},getInputMap:function(e){var t,n,r,i,a,o,s,l,u,c,p,f;for(t={},n=e.find("input"),r=0,i=n.length;i>r;r++)a=n[r],null!==a.value&&jQuery.trim(a.value).length>0&&(t[a.name]=a.value),"file"===a.type&&(t[a.name]=a.files[0]);for(o=e.find("textarea"),s=0,l=o.length;l>s;s++)a=o[s],u=this.getTextAreaValue(a),null!==u&&jQuery.trim(u).length>0&&(t[a.name]=u);for(c=e.find("select"),p=0,f=c.length;f>p;p++)a=c[p],u=this.getSelectedValue(a),null!==u&&jQuery.trim(u).length>0&&(t[a.name]=u);return t},isFileUpload:function(e){var t,n,r,i,a=!1;for(t=e.find("input"),n=0,r=t.length;r>n;n++)i=t[n],"file"===i.type&&(a=!0);return a},success:function(e,t){t.showCompleteStatus(e)},wrap:function(e){var t,n,r,i,a,o,s;for(r={},n=e.getAllResponseHeaders().split("\r"),a=0,o=n.length;o>a;a++)i=n[a],t=i.match(/^([^:]*?):(.*)$/),t||(t=[]),t.shift(),void 0!==t[0]&&void 0!==t[1]&&(r[t[0].trim()]=t[1].trim());return s={},s.content={},s.content.data=e.responseText,s.headers=r,s.request={},s.request.url=this.invocationUrl,s.status=e.status,s},getSelectedValue:function(e){if(e.multiple){for(var t=[],n=0,r=e.options.length;r>n;n++){var i=e.options[n];i.selected&&t.push(i.value)}return t.length>0?t:null}return e.value},hideResponse:function(e){e&&e.preventDefault(),$(".response",$(this.el)).slideUp(),$(".response_hider",$(this.el)).fadeOut()},showResponse:function(e){var t=JSON.stringify(e,null," ").replace(/\n/g,"<br>");$(".response_body",$(this.el)).html(_.escape(t))},showErrorStatus:function(e,t){t.showStatus(e)},showCompleteStatus:function(e,t){t.showStatus(e)},formatXml:function(e){var t,n,r,i,a,o,s,l,u,c,p,f,h;for(p=/(>)(<)(\/*)/g,h=/[ ]*(.*)[ ]+\n/g,t=/(<.+>)(.+\n)/g,e=e.replace(p,"$1\n$2$3").replace(h,"$1\n").replace(t,"$1\n$2"),c=0,r="",l=e.split("\n"),i=0,o="other",f={"single->single":0,"single->closing":-1,"single->opening":0,"single->other":0,"closing->single":0,"closing->closing":-1,"closing->opening":0,"closing->other":0,"opening->single":1,"opening->closing":0,"opening->opening":1,"opening->other":1,"other->single":0,"other->closing":-1,"other->opening":0,"other->other":0},n=function(e){var t,n,a,s,l,u,c;u={single:Boolean(e.match(/<.+\/>/)),closing:Boolean(e.match(/<\/.+>/)),opening:Boolean(e.match(/<[^!?].*>/))},l=function(){var e;e=[];for(a in u)c=u[a],c&&e.push(a);return e}()[0],l=void 0===l?"other":l,t=o+"->"+l,o=l,s="",i+=f[t],s=function(){var e,t,r;for(r=[],n=e=0,t=i;t>=0?t>e:e>t;n=t>=0?++e:--e)r.push(" ");return r}().join(""),"opening->closing"===t?r=r.substr(0,r.length-1)+e+"\n":r+=s+e+"\n"},a=0,s=l.length;s>a;a++)u=l[a],n(u);return r},showStatus:function(e){var t,n;void 0===e.content?(n=e.data,t=e.url):(n=e.content.data,t=e.request.url);var r=e.headers;n=jQuery.trim(n);var i=null;r&&(i=r["Content-Type"]||r["content-type"],i&&(i=i.split(";")[0].trim())),$(".response_body",$(this.el)).removeClass("json"),$(".response_body",$(this.el)).removeClass("xml");var a,o,s=function(e){var t=document.createElement("audio");return!(!t.canPlayType||!t.canPlayType(e).replace(/no/,""))};if(n)if("application/json"===i||/\+json$/.test(i)){var l=null;try{l=JSON.stringify(JSON.parse(n),null," ")}catch(u){l="can't parse JSON. Raw result:\n\n"+n}o=$("<code />").text(l),a=$('<pre class="json" />').append(o)}else if("application/xml"===i||/\+xml$/.test(i))o=$("<code />").text(this.formatXml(n)),a=$('<pre class="xml" />').append(o);else if("text/html"===i)o=$("<code />").html(_.escape(n)),a=$('<pre class="xml" />').append(o);else if(/text\/plain/.test(i))o=$("<code />").text(n),a=$('<pre class="plain" />').append(o);else if(/^image\//.test(i))a=$("<img>").attr("src",t);else if(/^audio\//.test(i)&&s(i))a=$("<audio controls>").append($("<source>").attr("src",t).attr("type",i));else if(r["Content-Disposition"]&&/attachment/.test(r["Content-Disposition"])||r["content-disposition"]&&/attachment/.test(r["content-disposition"])||r["Content-Description"]&&/File Transfer/.test(r["Content-Description"])||r["content-description"]&&/File Transfer/.test(r["content-description"]))if("Blob"in window){var c=i||"text/html",p=new Blob([n],{type:c}),f=document.createElement("a"),h=window.URL.createObjectURL(p),d=e.url.substr(e.url.lastIndexOf("/")+1),m=[c,d,h].join(":");f.setAttribute("href",h),f.setAttribute("download",m),f.innerText="Download "+d,a=$("<div/>").append(f)}else a=$('<pre class="json" />').append("Download headers detected but your browser does not support downloading binary via XHR (Blob).");else r.location||r.Location?window.location=e.url:(o=$("<code />").text(n),a=$('<pre class="json" />').append(o));else o=$("<code />").text("no content"),a=$('<pre class="json" />').append(o);var g=a;$(".request_url",$(this.el)).html("<pre></pre>"),$(".request_url pre",$(this.el)).text(t),$(".response_code",$(this.el)).html("<pre>"+e.status+"</pre>"),$(".response_body",$(this.el)).html(g),$(".response_headers",$(this.el)).html("<pre>"+_.escape(JSON.stringify(e.headers,null," ")).replace(/\n/g,"<br>")+"</pre>"),$(".response",$(this.el)).slideDown(),$(".response_hider",$(this.el)).show(),$(".response_throbber",$(this.el)).hide();var y=this.model.asCurl(this.map);y=y.replace("!","&#33;"),$(".curl",$(this.el)).html("<pre>"+y+"</pre>");var v=this.options.swaggerOptions;if(v.showRequestHeaders){var b=$(".sandbox",$(this.el)),w=this.getInputMap(b),x=this.model.getHeaderParams(w);delete x["Content-Type"],$(".request_headers",$(this.el)).html("<pre>"+_.escape(JSON.stringify(x,null," ")).replace(/\n/g,"<br>")+"</pre>")}var S=$(".response_body",$(this.el))[0];return v.highlightSizeThreshold&&"undefined"!=typeof e.data&&e.data.length>v.highlightSizeThreshold?S:hljs.highlightBlock(S)},toggleOperationContent:function(e){var t=$("#"+Docs.escapeResourceName(this.parentId+"_"+this.nickname+"_content"));t.is(":visible")?(e.preventDefault(),$.bbq.pushState("#/",2),Docs.collapseOperation(t)):(e.preventDefault(),Docs.expandOperation(t))},getTextAreaValue:function(e){var t,n,r,i;if(null===e.value||0===jQuery.trim(e.value).length)return null;if(t=this.getParamByName(e.name),t&&t.type&&"array"===t.type.toLowerCase()){for(n=e.value.split("\n"),r=[],i=0;i<n.length;i++)null!==n[i]&&jQuery.trim(n[i]).length>0&&r.push(n[i]);return r.length>0?r:null}return e.value},getParamByName:function(e){var t;if(this.model.parameters)for(t=0;t<this.model.parameters.length;t++)if(this.model.parameters[t].name===e)return this.model.parameters[t];return null}}),SwaggerUi.Views.ParameterContentTypeView=Backbone.View.extend({initialize:function(){},render:function(){return this.model.parameterContentTypeId="pct"+Math.random(),$(this.el).html(Handlebars.templates.parameter_content_type(this.model)),this}}),SwaggerUi.Views.ParameterView=Backbone.View.extend({initialize:function(){Handlebars.registerHelper("isArray",function(e,t){return"array"===e.type.toLowerCase()||e.allowMultiple?t.fn(this):t.inverse(this)})},render:function(){var e=this.model.type||this.model.dataType;if("undefined"==typeof e){var t=this.model.schema;if(t&&t.$ref){var n=t.$ref;e=0===n.indexOf("#/definitions/")?n.substring("#/definitions/".length):n}}this.model.type=e,this.model.paramType=this.model["in"]||this.model.paramType,this.model.isBody="body"===this.model.paramType||"body"===this.model["in"],this.model.isFile=e&&"file"===e.toLowerCase(),"undefined"==typeof this.model["default"]&&(this.model["default"]=this.model.defaultValue),this.model.hasDefault="undefined"!=typeof this.model["default"],this.model.valueId="m"+this.model.name+Math.random(),this.model.allowableValues&&(this.model.isList=!0);var r=this.template();$(this.el).html(r(this.model));var i={sampleJSON:this.model.sampleJSON,isParam:!0,signature:this.model.signature};if(this.model.sampleJSON){var a=new SwaggerUi.Views.SignatureView({model:i,tagName:"div"});$(".model-signature",$(this.el)).append(a.render().el)}else $(".model-signature",$(this.el)).html(this.model.signature);var o=!1;this.model.isBody&&(o=!0);var s={isParam:o};if(s.consumes=this.model.consumes,o){var l=new SwaggerUi.Views.ParameterContentTypeView({model:s});$(".parameter-content-type",$(this.el)).append(l.render().el)}else{var u=new SwaggerUi.Views.ResponseContentTypeView({model:s});$(".response-content-type",$(this.el)).append(u.render().el)}return this},template:function(){return this.model.isList?Handlebars.templates.param_list:this.options.readOnly?this.model.required?Handlebars.templates.param_readonly_required:Handlebars.templates.param_readonly:this.model.required?Handlebars.templates.param_required:Handlebars.templates.param}}),SwaggerUi.Views.ResourceView=Backbone.View.extend({initialize:function(e){e=e||{},this.router=e.router,this.auths=e.auths,""===this.model.description&&(this.model.description=null),this.model.description&&(this.model.summary=this.model.description)},render:function(){var e={};$(this.el).html(Handlebars.templates.resource(this.model));for(var t=0;t<this.model.operationsArray.length;t++){for(var n=this.model.operationsArray[t],r=0,i=n.nickname;"undefined"!=typeof e[i];)i=i+"_"+r,r+=1;e[i]=n,n.nickname=i,n.parentId=this.model.id,this.addOperation(n)}return $(".toggleEndpointList",this.el).click(this.callDocs.bind(this,"toggleEndpointListForResource")),$(".collapseResource",this.el).click(this.callDocs.bind(this,"collapseOperationsForResource")),$(".expandResource",this.el).click(this.callDocs.bind(this,"expandOperationsForResource")),this},addOperation:function(e){e.number=this.number;var t=new SwaggerUi.Views.OperationView({model:e,router:this.router,tagName:"li",className:"endpoint",swaggerOptions:this.options.swaggerOptions,auths:this.auths});$(".endpoints",$(this.el)).append(t.render().el),this.number++},callDocs:function(e,t){t.preventDefault(),Docs[e](t.currentTarget.getAttribute("data-id"))}}),SwaggerUi.Views.ResponseContentTypeView=Backbone.View.extend({initialize:function(){},render:function(){return this.model.responseContentTypeId="rct"+Math.random(),$(this.el).html(Handlebars.templates.response_content_type(this.model)),this}}),SwaggerUi.Views.SignatureView=Backbone.View.extend({events:{"click a.description-link":"switchToDescription","click a.snippet-link":"switchToSnippet","mousedown .snippet":"snippetToTextArea"},initialize:function(){},render:function(){return $(this.el).html(Handlebars.templates.signature(this.model)),this.switchToSnippet(),this.isParam=this.model.isParam,this.isParam&&$(".notice",$(this.el)).text("Click to set as parameter value"),this},switchToDescription:function(e){e&&e.preventDefault(),$(".snippet",$(this.el)).hide(),$(".description",$(this.el)).show(),$(".description-link",$(this.el)).addClass("selected"),$(".snippet-link",$(this.el)).removeClass("selected")},switchToSnippet:function(e){e&&e.preventDefault(),$(".description",$(this.el)).hide(),$(".snippet",$(this.el)).show(),$(".snippet-link",$(this.el)).addClass("selected"),$(".description-link",$(this.el)).removeClass("selected")},snippetToTextArea:function(e){if(this.isParam){e&&e.preventDefault();var t=$("textarea",$(this.el.parentNode.parentNode.parentNode));(""===$.trim(t.val())||t.prop("placeholder")===t.val())&&t.val(this.model.sampleJSON)}}}),SwaggerUi.Views.StatusCodeView=Backbone.View.extend({initialize:function(e){this.options=e||{},this.router=this.options.router},render:function(){if($(this.el).html(Handlebars.templates.status_code(this.model)),this.router.api.models.hasOwnProperty(this.model.responseModel)){var e={sampleJSON:JSON.stringify(this.router.api.models[this.model.responseModel].createJSONSample(),null,2),isParam:!1,signature:this.router.api.models[this.model.responseModel].getMockSignature()},t=new SwaggerUi.Views.SignatureView({model:e,tagName:"div"});$(".model-signature",this.$el).append(t.render().el)}else $(".model-signature",this.$el).html("");return this}})}).call(this);
diff --git a/openecomp-be/tools/test.push b/openecomp-be/tools/test.push
new file mode 100644
index 0000000000..55dd22e7d0
--- /dev/null
+++ b/openecomp-be/tools/test.push
@@ -0,0 +1 @@
+Test9 \ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 963cfd4d1a..27b32b3e09 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
<module>ui-ci</module>
<module>sdc-os-chef</module>
- <!--<module>openecomp-be</module>-->
+ <module>openecomp-be</module>
<!--<module>openecomp-ui</module>-->
</modules>
diff --git a/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-normatives/files/default/normatives.tar.gz b/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-normatives/files/default/normatives.tar.gz
index ce23d66c73..4a5217f2cc 100644
--- a/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-normatives/files/default/normatives.tar.gz
+++ b/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-normatives/files/default/normatives.tar.gz
Binary files differ